---
name: "nng_sockaddr_zt"
section: "5"
platform: "linux"
package: "libnng-dev"
version: "1.10.1-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nng_sockaddr_zt"
---

# nng\_sockaddr\_zt(5)

ZeroTier socket address

## NAME

nng\_sockaddr\_zt - ZeroTier socket address

## 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;
```

## DESCRIPTION

An `nng_sockaddr_zt` is the flavor of `nng_sockaddr` used to represent ZeroTier addresses, including the port number used by the *zt* transport.

**Important**\

The ZeroTier transport, and the details of this structure, are still considered experimental, and subject to change.

The following structure members are present:

`sa_family`

This field will always have the value `NNG_AF_ZT`.

`sa_nwid`

This field holds the ZeroTier network number (or ID). This value is in native byte order.

`sa_nodeid`

This field holds the ZeroTier node ID. This value is in native byte order, and only the lower 40 bits are significant. (ZeroTier node numbers are 40 bits long.) A zero value here is used for a wild-card to indicate that the caller’s own node number be used.

`sa_port`

This field holds the port number used by the *zt* transport to distinguish different sockets. This value in native byte order. A zero value here indicates that a port number should be chosen randomly from the ephemeral ports. Only the lower 24 bits of the port number are used.

**Note**\

ZeroTier port numbers are in **native** byte order, and are larger than TCP/IP port numbers. They are also not part of the ZeroTier protocol itself, but defined by the Scalability Protocols binding for them.

## SEE ALSO

[nng\_sockaddr(5)](/nng_sockaddr/5.md), [nng\_zerotier(7)](/nng_zerotier/7.md), [nng(7)](/nng/7.md)
