OS Manuals

libnvmf_tid_get_canonical-libnvme3(2)

libnvmf_tid_get_canonical - Return the canonical string form of a TID.

libnvmf_tid_get_canonical(9) libnvme API manual libnvmf_tid_get_canonical(9)

libnvmf_tid_get_canonical - Return the canonical string form of a TID.

const char * libnvmf_tid_get_canonical (const struct libnvmf_tid *tid );

The transport ID.

Returns a deterministic, fixed-field-order semicolon-separated key=value string (e.g. "transport=tcp;traddr=1.2.3.4;trsvcid=8009"). Only non-NULL fields are included. The string is lazily computed and cached; it is invalidated by any identity change.

The fixed field order makes the output independent of the order fields were set, so the same logical TID always yields the same canonical string. This is the stable primitive libnvme provides for naming a connection; a caller that wants a compact hash (e.g. for a systemd unit name) derives it from this string itself -- libnvme does not hash it.

The constructors store numeric addresses in one form: IPv6 is compressed, and an IPv4-mapped IPv6 address ("::ffff:1.2.3.4") becomes the IPv4 address ("1.2.3.4"). So two spellings of one numeric address yield the same canonical string.

Cached canonical string, or NULL on allocation failure.

libnvmf_tid_get_canonical October 2026

nvme-cli 3.2-r0 · os · ingested 2026-10-31