libnvmf_tid_get_canonical(9)
π NAME π
okay so this is the libnvmf_tid_get_canonical(9) page from the libnvme API manual β¨ buckle up bestie, itβs actually super straightforward π«Ά
libnvmf_tid_get_canonical β return the canonical string form of a TID. periodt π
πΈ SYNOPSIS πΈ
const char * libnvmf_tid_get_canonical (const struct libnvmf_tid *tid );
π ARGUMENTS π
tidβ the transport ID. thatβs the whole assignment, no cap π¦
β¨ DESCRIPTION β¨
bestie, this function hands you back a deterministic, fixed-field-order, semicolon-separated key=value string β like "transport=tcp;traddr=1.2.3.4;trsvcid=8009" πΈ only non-NULL fields make it in. the string is lazily computed and cached; any identity change invalidates it. itβs giving βefficient and correctβ π
the way the field order is fixed means the output doesnβt care what order the fields were set in β same logical TID, same canonical string, every time π this is the stable primitive libnvme gives you for naming a connection; if a caller wants a compact hash (e.g. for a systemd unit name), it derives that from this string itself β libnvme does not hash it. iykyk π
also, 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. iconic behavior, honestly π
π₯ RETURN π₯
the cached canonical string, or NULL on allocation failure π
with love from the libnvme API manual π β source/version libnvmf_tid_get_canonicalibnvmf_tid_get_canonical(9), dated October 2026 π
π¦ where this page comes from
- arch rolling: nvme-cli 3.2-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms