NNG_SOCKADDR_ZT(5)
π NNG_SOCKADDR_ZT(5) β the ZeroTier socket address glow-up π
okay bestie, this is nng_sockaddr_zt from the NNG Reference Manual and it's literally the cutest lil struct you'll ever meet β it's the ZeroTier-ified flavor of nng_sockaddr, and it carries the address stuff plus the port number that the zt transport uses. π¦
β¨ NAME β¨
nng_sockaddr_zt β ZeroTier socket address. that's her. that's the whole vibe. π
πΈ SYNOPSIS πΈ
#include <nng/nng.h>
enum sockaddr_family {
NNG_AF_ZT = 5,
};
typedef struct {
uint16_t sa_family;
uint64_t sa_nwid;
uint64_t sa_nodeid;
uint32_t sa_port;
} nng_sockaddr_zt;
look at her. four little fields. absolutely iconic. β¨
π DESCRIPTION π
An nng_sockaddr_zt is the flavor of nng_sockaddr that represents ZeroTier addresses, port number included β specifically the port the zt transport uses. no cap. π«Ά
Important β οΈ The ZeroTier transport, and the details of this structure, are still considered experimental, and subject to change. so like. don't get too attached bestie. she's still figuring herself out. π
π§ the members (meet the cast) π§
sa_familyβ this field will always have the valueNNG_AF_ZT. it's loyal like that. periodt. πsa_nwidβ holds the ZeroTier network number (or ID). this value is in native byte order. slay. πsa_nodeidβ holds the ZeroTier node ID. also in native byte order, and heads up: only the lower 40 bits are significant (ZeroTier node numbers are 40 bits long, that's just the lore). a zero value here is the wild-card move β it means "use the caller's own node number." main character energy fr fr. βsa_portβ holds the port number thezttransport uses to tell different sockets apart. this value is in native byte order. a zero here means a port number should be chosen randomly from the ephemeral ports. and only the lower 24 bits of the port number are used. π
Note π ZeroTier port numbers are in native byte order, and they're larger than TCP/IP port numbers. they're also not part of the ZeroTier protocol itself β they're defined by the Scalability Protocols binding for them. iykyk. π₯
π¦ SEE ALSO π¦
go read those too, bestie, they're all part of the same universe. πΈ
and that's the whole page!! mwah π this was the NNG Reference Manual edition dated 2026-06-30 β the source/version + date of this lil masterpiece. bye bye, love u, go bind some sockets responsibly π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: libnng-dev 1.12.0-1 Β· MIT OR Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms