NNG_SOCKADDR_ZT(5)

πŸ“¦
version 1.12.0 Β· 4 versions
, in ubuntu stonking

πŸ’– 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 value NNG_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 the zt transport 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