---
name: "libnvmf_tid_from_fields-libnvme3"
section: "2"
platform: "linux"
package: "nvme-cli"
version: "3.2-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libnvmf_tid_from_fields-libnvme3"
---

# libnvmf\_tid\_from\_fields-libnvme3(2)

Allocate a TID from individual field strings.

## NAME

libnvmf\_tid\_from\_fields - Allocate a TID from individual field strings.

## SYNOPSIS

**int libnvmf\_tid\_from\_fields** **(const char \*transport** *,* **const char \*traddr** *,* **const char \*trsvcid** *,* **const char \*subsysnqn** *,* **const char \*host\_traddr** *,* **const char \*host\_iface** *,* **const char \*hostnqn** *,* **const char \*hostid** *,* **struct libnvmf\_tid \*\*out** *);*

## ARGUMENTS

- transport

  Transport type (e.g. "tcp", "rdma", "fc").

- traddr

  Transport address.

- trsvcid

  Transport service ID (e.g. "8009").

- subsysnqn

  Subsystem NQN.

- host\_traddr

  Host transport address, or NULL.

- host\_iface

  Host interface name, or NULL.

- hostnqn

  Host NQN, or NULL.

- hostid

  Host Identifier, or NULL.

- out

  The allocated TID on success; NULL on error.

## DESCRIPTION

Convenience constructor.  NULL fields are stored as NULL.  For an IP transport (tcp, rdma) a numeric traddr/host\_traddr is canonicalized; a hostname is rejected -- resolving it is the caller's job, not libnvme's.

## RETURN

0 on success (\**out* is the allocated TID); -EINVAL if *out* is NULL or traddr/host\_traddr is not numeric on an IP transport; -ENOMEM on allocation failure.
