libnvmf_tid_from_fields-libnvme32
Allocate a tid from individual field strings.
Usage
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. |
Overview
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.