Package com.zerotier.sockets
Class ZeroTierNative
java.lang.Object
com.zerotier.sockets.ZeroTierNative
public class ZeroTierNative
extends java.lang.Object
Class that exposes the low-level C socket interface provided by libzt. This
can be used instead of the higher-level ZeroTierSocket API.
-
Field Summary
Fields Modifier and Type Field Description static int
ZTS_AF_INET
IPv4 address familystatic int
ZTS_AF_INET6
IPv6 address familystatic int
ZTS_EACCES
Permission deniedstatic int
ZTS_EADDRINUSE
Address already in usestatic int
ZTS_EADDRNOTAVAIL
Cannot assign requested addressstatic int
ZTS_EAFNOSUPPORT
Address family not supported by protocolstatic int
ZTS_EAGAIN
Try againstatic int
ZTS_EALREADY
Operation already in progressstatic int
ZTS_EBADF
Bad file numberstatic int
ZTS_EBUSY
Device or resource busystatic int
ZTS_ECONNABORTED
Software caused connection abortstatic int
ZTS_ECONNRESET
Connection reset by peerstatic int
ZTS_EDESTADDRREQ
Destination address requiredstatic int
ZTS_EEXIST
File existsstatic int
ZTS_EFAULT
Bad addressstatic int
ZTS_EHOSTUNREACH
No route to hoststatic int
ZTS_EINPROGRESS
Operation now in progressstatic int
ZTS_EINTR
Interrupted system callstatic int
ZTS_EINVAL
Invalid argumentstatic int
ZTS_EIO
I/O errorstatic int
ZTS_EISCONN
Transport endpoint is already connectedstatic int
ZTS_EMFILE
Too many open filesstatic int
ZTS_EMSGSIZE
Message too longstatic int
ZTS_ENETDOWN
Network is downstatic int
ZTS_ENETUNREACH
Network is unreachablestatic int
ZTS_ENFILE
File table overflowstatic int
ZTS_ENOBUFS
No buffer space availablestatic int
ZTS_ENODEV
No such devicestatic int
ZTS_ENOENT
No such file or directorystatic int
ZTS_ENOMEM
Out of memorystatic int
ZTS_ENOPROTOOPT
Protocol not availablestatic int
ZTS_ENOSYS
Function not implementedstatic int
ZTS_ENOTCONN
Transport endpoint is not connectedstatic int
ZTS_ENOTSOCK
Socket operation on non-socketstatic int
ZTS_ENXIO
No such device or addressstatic int
ZTS_EOPNOTSUPP
Operation not supported on transport endpointstatic int
ZTS_EPERM
Operation not permitted (`zts_errno` value)static int
ZTS_EPFNOSUPPORT
Protocol family not supportedstatic int
ZTS_EPROTONOSUPPORT
Protocol not supportedstatic int
ZTS_EPROTOTYPE
Protocol wrong type for socketstatic int
ZTS_ERR_ARG
(-3) Invalid argumentstatic int
ZTS_ERR_GENERAL
(-5) Consider filing a bug reportstatic int
ZTS_ERR_OK
(0) No errorstatic int
ZTS_ERR_RESULT
(-4) No result (not necessarily an error)static int
ZTS_ERR_SERVICE
(-2) You probably did something at the wrong timestatic int
ZTS_ERR_SOCKET
(-1) Socket error, see zts_errnostatic int
ZTS_ESOCKTNOSUPPORT
Socket type not supportedstatic int
ZTS_ESRCH
No such processstatic int
ZTS_ETIMEDOUT
Connection timed outstatic int
ZTS_EVENT_ADDR_ADDED_IP4
A new managed IPv4 address was assigned to this peerstatic int
ZTS_EVENT_ADDR_ADDED_IP6
A new managed IPv4 address was assigned to this peerstatic int
ZTS_EVENT_ADDR_REMOVED_IP4
A managed IPv4 address assignment was removed from this peerstatic int
ZTS_EVENT_ADDR_REMOVED_IP6
A managed IPv6 address assignment was removed from this peerstatic int
ZTS_EVENT_NETIF_DOWN
lwIP netif down (for debug purposes)static int
ZTS_EVENT_NETIF_LINK_DOWN
lwIP netif link down (for debug purposes)static int
ZTS_EVENT_NETIF_LINK_UP
lwIP netif link up (for debug purposes)static int
ZTS_EVENT_NETIF_REMOVED
lwIP netif removed (for debug purposes)static int
ZTS_EVENT_NETIF_UP
lwIP netif up (for debug purposes)static int
ZTS_EVENT_NETWORK_ACCESS_DENIED
The node is not allowed to join the network (you must authorize node)static int
ZTS_EVENT_NETWORK_CLIENT_TOO_OLD
The version of ZeroTier inside libzt is too oldstatic int
ZTS_EVENT_NETWORK_DOWN
Network controller is unreachablestatic int
ZTS_EVENT_NETWORK_NOT_FOUND
Network ID does not correspond to a known networkstatic int
ZTS_EVENT_NETWORK_OK
The node joined the network successfully (no action needed)static int
ZTS_EVENT_NETWORK_READY_IP4
The node has received an IPv4 address from the network controllerstatic int
ZTS_EVENT_NETWORK_READY_IP4_IP6
Deprecatedstatic int
ZTS_EVENT_NETWORK_READY_IP6
The node has received an IPv6 address from the network controllerstatic int
ZTS_EVENT_NETWORK_REQ_CONFIG
The configuration for a network has been requested (no action needed)static int
ZTS_EVENT_NETWORK_UPDATE
Network change received from controllerstatic int
ZTS_EVENT_NODE_DOWN
Node is shutting down This is generated within Node's destructor when it is being shut down.static int
ZTS_EVENT_NODE_FATAL_ERROR
A fatal error has occurred.static int
ZTS_EVENT_NODE_OFFLINE
Node is offline -- network does not seem to be reachable by any available strategystatic int
ZTS_EVENT_NODE_ONLINE
Node is online -- at least one upstream node appears reachablestatic int
ZTS_EVENT_NODE_UP
Node has been initialized This is the first event generated; and is always sent.static int
ZTS_EVENT_PEER_DIRECT
A direct P2P path to peer is knownstatic int
ZTS_EVENT_PEER_PATH_DEAD
A known path to a peer is now considered deadstatic int
ZTS_EVENT_PEER_PATH_DISCOVERED
A new path to a peer was discoveredstatic int
ZTS_EVENT_PEER_RELAY
A direct P2P path to peer is NOT known.static int
ZTS_EVENT_PEER_UNREACHABLE
A peer is unreachable.static int
ZTS_EVENT_ROUTE_ADDED
A new managed network route was addedstatic int
ZTS_EVENT_ROUTE_REMOVED
A managed network route was removedstatic int
ZTS_EVENT_STACK_DOWN
TCP/IP stack (lwIP) id down (for debug purposes)static int
ZTS_EVENT_STACK_UP
TCP/IP stack (lwIP) is up (for debug purposes)static int
ZTS_EVENT_STORE_IDENTITY_PUBLIC
The node's public key (identity)static int
ZTS_EVENT_STORE_IDENTITY_SECRET
The node's secret key (identity)static int
ZTS_EVENT_STORE_NETWORK
New network configstatic int
ZTS_EVENT_STORE_PEER
New reachability hints and peer configurationstatic int
ZTS_EVENT_STORE_PLANET
The node has received an updated planet configstatic int
ZTS_EWOULDBLOCK
Operation would blockstatic int
ZTS_F_GETFL
static int
ZTS_F_SETFL
static int
ZTS_FIONBIO
static int
ZTS_FIONREAD
static int
ZTS_ID_STR_BUF_LEN
The length of a human-friendly identity key pair stringstatic int
ZTS_INET_ADDRSTRLEN
Max length of human-readable IPv4 stringstatic int
ZTS_INET6_ADDRSTRLEN
Max length of human-readable IPv6 stringstatic int
ZTS_IP_MAX_STR_LEN
Maximum (and required) length of string buffers used to receive string-format IP addresses from the API.static int
ZTS_IP_TOS
static int
ZTS_IP_TTL
static int
ZTS_IPPROTO_ICMP
static int
ZTS_IPPROTO_ICMPV6
static int
ZTS_IPPROTO_IP
static int
ZTS_IPPROTO_IPV6
static int
ZTS_IPPROTO_RAW
static int
ZTS_IPPROTO_TCP
static int
ZTS_IPPROTO_UDP
static int
ZTS_IPPROTO_UDPLITE
static int
ZTS_MAC_ADDRSTRLEN
Length of human-readable MAC address stringstatic int
ZTS_MAX_ASSIGNED_ADDRESSES
Maximum number of statically assigned IP addresses per network endpoint using ZT address management (not DHCP)static int
ZTS_MAX_MULTICAST_SUBSCRIPTIONS
Maximum number of multicast groups a device / network interface can be subscribed to at oncestatic int
ZTS_MAX_NETWORK_ROUTES
Maximum number of pushed routes on a networkstatic int
ZTS_MAX_NETWORK_SHORT_NAME_LENGTH
Maximum length of network short namestatic int
ZTS_MAX_PEER_NETWORK_PATHS
Maximum number of direct network paths to a given peerstatic int
ZTS_MSG_DONTWAIT
static int
ZTS_MSG_MORE
static int
ZTS_MSG_OOB
static int
ZTS_MSG_PEEK
static int
ZTS_MSG_WAITALL
static int
ZTS_O_NDELAY
static int
ZTS_O_NONBLOCK
static int
ZTS_PF_INET
static int
ZTS_PF_INET6
static int
ZTS_SHUT_RD
static int
ZTS_SHUT_RDWR
static int
ZTS_SHUT_WR
static int
ZTS_SO_ACCEPTCONN
static int
ZTS_SO_BROADCAST
static int
ZTS_SO_CONTIMEO
static int
ZTS_SO_DEBUG
static int
ZTS_SO_DONTLINGER
static int
ZTS_SO_DONTROUTE
static int
ZTS_SO_ERROR
static int
ZTS_SO_KEEPALIVE
static int
ZTS_SO_LINGER
static int
ZTS_SO_NO_CHECK
static int
ZTS_SO_OOBINLINE
static int
ZTS_SO_RCVBUF
static int
ZTS_SO_RCVLOWAT
static int
ZTS_SO_RCVTIMEO
static int
ZTS_SO_REUSEADDR
static int
ZTS_SO_REUSEPORT
static int
ZTS_SO_SNDBUF
static int
ZTS_SO_SNDLOWAT
static int
ZTS_SO_SNDTIMEO
static int
ZTS_SO_TYPE
static int
ZTS_SO_USELOOPBACK
static int
ZTS_SOCK_DGRAM
Datagram socketstatic int
ZTS_SOCK_RAW
static int
ZTS_SOCK_STREAM
Stream socketstatic int
ZTS_SOL_SOCKET
static int
ZTS_STORE_DATA_LEN
Required buffer length to safely receive data store itemsstatic int
ZTS_TCP_KEEPALIVE
static int
ZTS_TCP_KEEPCNT
static int
ZTS_TCP_KEEPIDLE
static int
ZTS_TCP_KEEPINTVL
static int
ZTS_TCP_NODELAY
-
Constructor Summary
Constructors Constructor Description ZeroTierNative()
-
Method Summary
Modifier and Type Method Description static int
zts_addr_compute_6plane_str(long net_id, long node_id, java.lang.String dst, int len)
static int
zts_addr_compute_rfc4193_str(long net_id, long node_id, java.lang.String dst, int len)
static java.lang.String
zts_addr_get_str(long net_id, int family)
static int
zts_addr_is_assigned(long net_id, int family)
static int
zts_bind(int fd, java.lang.String ipstr, int port)
static int
zts_bsd_accept(int fd, com.zerotier.sockets.ZeroTierSocketAddress addr)
static int
zts_bsd_close(int fd)
static int
zts_bsd_fcntl(int sock, int cmd, int flag)
static int
zts_bsd_getpeername(int fd, com.zerotier.sockets.ZeroTierSocketAddress addr)
static boolean
zts_bsd_getsockname(int fd, com.zerotier.sockets.ZeroTierSocketAddress addr)
static int
zts_bsd_listen(int fd, int backlog)
static int
zts_bsd_read(int fd, byte[] buf)
static int
zts_bsd_read_length(int fd, byte[] buf, int len)
static int
zts_bsd_read_offset(int fd, byte[] buf, int offset, int len)
static int
zts_bsd_recv(int fd, byte[] buf, int flags)
static int
zts_bsd_recvfrom(int fd, byte[] buf, int flags, com.zerotier.sockets.ZeroTierSocketAddress addr)
static int
zts_bsd_select(int nfds, com.zerotier.sockets.ZeroTierFileDescriptorSet readfds, com.zerotier.sockets.ZeroTierFileDescriptorSet writefds, com.zerotier.sockets.ZeroTierFileDescriptorSet exceptfds, int timeout_sec, int timeout_usec)
static int
zts_bsd_send(int fd, byte[] buf, int flags)
static int
zts_bsd_sendto(int fd, byte[] buf, int flags, com.zerotier.sockets.ZeroTierSocketAddress addr)
static int
zts_bsd_shutdown(int fd, int how)
static int
zts_bsd_socket(int family, int type, int protocol)
static int
zts_bsd_write(int fd, byte[] buf)
static int
zts_bsd_write_byte(int fd, byte b)
static int
zts_bsd_write_offset(int fd, byte[] buf, int offset, int len)
static int
zts_connect(int fd, java.lang.String ipstr, int port, int timeout_ms)
static int
zts_core_lock_obtain()
static int
zts_core_lock_release()
static int
zts_core_query_addr(long net_id, int idx, java.lang.String addr, int len)
static int
zts_core_query_addr_count(long net_id)
static int
zts_core_query_mc_count(long net_id)
static int
zts_core_query_path(long peer_id, int idx, java.lang.String dst, int len)
static int
zts_core_query_path_count(long peer_id)
static int
zts_core_query_route_count(long net_id)
static int
zts_get_blocking(int fd)
static int
zts_get_keepalive(int fd)
static int
zts_get_linger_enabled(int fd)
static int
zts_get_linger_value(int fd)
static int
zts_get_no_delay(int fd)
static int
zts_get_pending_data_size(int fd)
static int
zts_get_recv_buf_size(int fd)
static int
zts_get_recv_timeout(int fd)
static int
zts_get_reuse_addr(int fd)
static int
zts_get_send_buf_size(int fd)
static int
zts_get_send_timeout(int fd)
static int
zts_get_ttl(int fd)
static int
zts_init()
static int
zts_init_allow_id_cache(int allowed)
static int
zts_init_allow_net_cache(int allowed)
static int
zts_init_allow_peer_cache(int allowed)
static int
zts_init_allow_roots_cache(int allowed)
static int
zts_init_blacklist_if(java.lang.String prefix, int len)
static int
zts_init_from_storage(java.lang.String path)
static int
zts_init_set_event_handler(ZeroTierEventListener callbackClass)
static int
zts_init_set_port(short port)
static int
zts_moon_deorbit(long moon_roots_id)
static int
zts_moon_orbit(long moon_roots_id, long moon_seed)
static long
zts_net_compute_adhoc_id(short start_port, short end_port)
static int
zts_net_get_broadcast(long net_id)
static long
zts_net_get_mac(long net_id)
static java.lang.String
zts_net_get_mac_str(long net_id)
static int
zts_net_get_mtu(long net_id)
static int
zts_net_get_name(long net_id, java.lang.String dst, int len)
static int
zts_net_get_status(long net_id)
static int
zts_net_get_type(long net_id)
static int
zts_net_join(long net_id)
static int
zts_net_leave(long net_id)
static int
zts_net_transport_is_ready(long net_id)
static int
zts_node_free()
static long
zts_node_get_id()
static int
zts_node_get_port()
static int
zts_node_is_online()
static int
zts_node_start()
static int
zts_node_stop()
static int
zts_route_is_assigned(long net_id, int family)
static int
zts_set_blocking(int fd, int enabled)
static int
zts_set_keepalive(int fd, int enabled)
static int
zts_set_linger(int fd, int enabled, int value)
static int
zts_set_no_delay(int fd, int enabled)
static int
zts_set_recv_buf_size(int fd, int size)
static int
zts_set_recv_timeout(int fd, int seconds, int microseconds)
static int
zts_set_reuse_addr(int fd, int enabled)
static int
zts_set_send_buf_size(int fd, int size)
static int
zts_set_send_timeout(int fd, int seconds, int microseconds)
static int
zts_set_ttl(int fd, int ttl)
static void
zts_util_delay(long milliseconds)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
ZTS_EVENT_NODE_UP
public static int ZTS_EVENT_NODE_UPNode has been initialized This is the first event generated; and is always sent. It may occur before node's constructor returns. -
ZTS_EVENT_NODE_ONLINE
public static int ZTS_EVENT_NODE_ONLINENode is online -- at least one upstream node appears reachable -
ZTS_EVENT_NODE_OFFLINE
public static int ZTS_EVENT_NODE_OFFLINENode is offline -- network does not seem to be reachable by any available strategy -
ZTS_EVENT_NODE_DOWN
public static int ZTS_EVENT_NODE_DOWNNode is shutting down This is generated within Node's destructor when it is being shut down. It's done for convenience; since cleaning up other state in the event handler may appear more idiomatic. -
ZTS_EVENT_NODE_FATAL_ERROR
public static int ZTS_EVENT_NODE_FATAL_ERRORA fatal error has occurred. One possible reason is: Your identity has collided with another node's ZeroTier address This happens if two different public keys both hash (via the algorithm in Identity::generate()) to the same 40-bit ZeroTier address. This is something you should "never" see; where "never" is defined as once per 2^39 new node initializations / identity creations. If you do see it; you're going to see it very soon after a node is first initialized. This is reported as an event rather than a return code since it's detected asynchronously via error messages from authoritative nodes. If this occurs; you must shut down and delete the node; delete the identity.secret record/file from the data store; and restart to generate a new identity. If you don't do this; you will not be able to communicate with other nodes. We'd automate this process; but we don't think silently deleting private keys or changing our address without telling the calling code is good form. It violates the principle of least surprise. You can technically get away with not handling this; but we recommend doing so in a mature reliable application. Besides; handling this condition is a good way to make sure it never arises. It's like how umbrellas prevent rain and smoke detectors prevent fires. They do; right? Meta-data: none -
ZTS_EVENT_NETWORK_NOT_FOUND
public static int ZTS_EVENT_NETWORK_NOT_FOUNDNetwork ID does not correspond to a known network -
ZTS_EVENT_NETWORK_CLIENT_TOO_OLD
public static int ZTS_EVENT_NETWORK_CLIENT_TOO_OLDThe version of ZeroTier inside libzt is too old -
ZTS_EVENT_NETWORK_REQ_CONFIG
public static int ZTS_EVENT_NETWORK_REQ_CONFIGThe configuration for a network has been requested (no action needed) -
ZTS_EVENT_NETWORK_OK
public static int ZTS_EVENT_NETWORK_OKThe node joined the network successfully (no action needed) -
ZTS_EVENT_NETWORK_ACCESS_DENIED
public static int ZTS_EVENT_NETWORK_ACCESS_DENIEDThe node is not allowed to join the network (you must authorize node) -
ZTS_EVENT_NETWORK_READY_IP4
public static int ZTS_EVENT_NETWORK_READY_IP4The node has received an IPv4 address from the network controller -
ZTS_EVENT_NETWORK_READY_IP6
public static int ZTS_EVENT_NETWORK_READY_IP6The node has received an IPv6 address from the network controller -
ZTS_EVENT_NETWORK_READY_IP4_IP6
public static int ZTS_EVENT_NETWORK_READY_IP4_IP6Deprecated -
ZTS_EVENT_NETWORK_DOWN
public static int ZTS_EVENT_NETWORK_DOWNNetwork controller is unreachable -
ZTS_EVENT_NETWORK_UPDATE
public static int ZTS_EVENT_NETWORK_UPDATENetwork change received from controller -
ZTS_EVENT_STACK_UP
public static int ZTS_EVENT_STACK_UPTCP/IP stack (lwIP) is up (for debug purposes) -
ZTS_EVENT_STACK_DOWN
public static int ZTS_EVENT_STACK_DOWNTCP/IP stack (lwIP) id down (for debug purposes) -
ZTS_EVENT_NETIF_UP
public static int ZTS_EVENT_NETIF_UPlwIP netif up (for debug purposes) -
ZTS_EVENT_NETIF_DOWN
public static int ZTS_EVENT_NETIF_DOWNlwIP netif down (for debug purposes) -
ZTS_EVENT_NETIF_REMOVED
public static int ZTS_EVENT_NETIF_REMOVEDlwIP netif removed (for debug purposes) -
ZTS_EVENT_NETIF_LINK_UP
public static int ZTS_EVENT_NETIF_LINK_UPlwIP netif link up (for debug purposes) -
ZTS_EVENT_NETIF_LINK_DOWN
public static int ZTS_EVENT_NETIF_LINK_DOWNlwIP netif link down (for debug purposes) -
ZTS_EVENT_PEER_DIRECT
public static int ZTS_EVENT_PEER_DIRECTA direct P2P path to peer is known -
ZTS_EVENT_PEER_RELAY
public static int ZTS_EVENT_PEER_RELAYA direct P2P path to peer is NOT known. Traffic is now relayed -
ZTS_EVENT_PEER_UNREACHABLE
public static int ZTS_EVENT_PEER_UNREACHABLEA peer is unreachable. Check NAT/Firewall settings -
ZTS_EVENT_PEER_PATH_DISCOVERED
public static int ZTS_EVENT_PEER_PATH_DISCOVEREDA new path to a peer was discovered -
ZTS_EVENT_PEER_PATH_DEAD
public static int ZTS_EVENT_PEER_PATH_DEADA known path to a peer is now considered dead -
ZTS_EVENT_ROUTE_ADDED
public static int ZTS_EVENT_ROUTE_ADDEDA new managed network route was added -
ZTS_EVENT_ROUTE_REMOVED
public static int ZTS_EVENT_ROUTE_REMOVEDA managed network route was removed -
ZTS_EVENT_ADDR_ADDED_IP4
public static int ZTS_EVENT_ADDR_ADDED_IP4A new managed IPv4 address was assigned to this peer -
ZTS_EVENT_ADDR_REMOVED_IP4
public static int ZTS_EVENT_ADDR_REMOVED_IP4A managed IPv4 address assignment was removed from this peer -
ZTS_EVENT_ADDR_ADDED_IP6
public static int ZTS_EVENT_ADDR_ADDED_IP6A new managed IPv4 address was assigned to this peer -
ZTS_EVENT_ADDR_REMOVED_IP6
public static int ZTS_EVENT_ADDR_REMOVED_IP6A managed IPv6 address assignment was removed from this peer -
ZTS_EVENT_STORE_IDENTITY_SECRET
public static int ZTS_EVENT_STORE_IDENTITY_SECRETThe node's secret key (identity) -
ZTS_EVENT_STORE_IDENTITY_PUBLIC
public static int ZTS_EVENT_STORE_IDENTITY_PUBLICThe node's public key (identity) -
ZTS_EVENT_STORE_PLANET
public static int ZTS_EVENT_STORE_PLANETThe node has received an updated planet config -
ZTS_EVENT_STORE_PEER
public static int ZTS_EVENT_STORE_PEERNew reachability hints and peer configuration -
ZTS_EVENT_STORE_NETWORK
public static int ZTS_EVENT_STORE_NETWORKNew network config -
ZTS_SOCK_STREAM
public static int ZTS_SOCK_STREAMStream socket -
ZTS_SOCK_DGRAM
public static int ZTS_SOCK_DGRAMDatagram socket -
ZTS_SOCK_RAW
public static int ZTS_SOCK_RAW -
ZTS_AF_INET
public static int ZTS_AF_INETIPv4 address family -
ZTS_AF_INET6
public static int ZTS_AF_INET6IPv6 address family -
ZTS_PF_INET
public static int ZTS_PF_INET -
ZTS_PF_INET6
public static int ZTS_PF_INET6 -
ZTS_IPPROTO_IP
public static int ZTS_IPPROTO_IP -
ZTS_IPPROTO_ICMP
public static int ZTS_IPPROTO_ICMP -
ZTS_IPPROTO_TCP
public static int ZTS_IPPROTO_TCP -
ZTS_IPPROTO_UDP
public static int ZTS_IPPROTO_UDP -
ZTS_IPPROTO_IPV6
public static int ZTS_IPPROTO_IPV6 -
ZTS_IPPROTO_ICMPV6
public static int ZTS_IPPROTO_ICMPV6 -
ZTS_IPPROTO_UDPLITE
public static int ZTS_IPPROTO_UDPLITE -
ZTS_IPPROTO_RAW
public static int ZTS_IPPROTO_RAW -
ZTS_MSG_PEEK
public static int ZTS_MSG_PEEK -
ZTS_MSG_WAITALL
public static int ZTS_MSG_WAITALL -
ZTS_MSG_OOB
public static int ZTS_MSG_OOB -
ZTS_MSG_DONTWAIT
public static int ZTS_MSG_DONTWAIT -
ZTS_MSG_MORE
public static int ZTS_MSG_MORE -
ZTS_F_GETFL
public static int ZTS_F_GETFL -
ZTS_F_SETFL
public static int ZTS_F_SETFL -
ZTS_O_NONBLOCK
public static int ZTS_O_NONBLOCK -
ZTS_O_NDELAY
public static int ZTS_O_NDELAY -
ZTS_SHUT_RD
public static int ZTS_SHUT_RD -
ZTS_SHUT_WR
public static int ZTS_SHUT_WR -
ZTS_SHUT_RDWR
public static int ZTS_SHUT_RDWR -
ZTS_FIONREAD
public static int ZTS_FIONREAD -
ZTS_FIONBIO
public static int ZTS_FIONBIO -
ZTS_SOL_SOCKET
public static int ZTS_SOL_SOCKET -
ZTS_SO_REUSEADDR
public static int ZTS_SO_REUSEADDR -
ZTS_SO_KEEPALIVE
public static int ZTS_SO_KEEPALIVE -
ZTS_SO_BROADCAST
public static int ZTS_SO_BROADCAST -
ZTS_SO_DEBUG
public static int ZTS_SO_DEBUG -
ZTS_SO_ACCEPTCONN
public static int ZTS_SO_ACCEPTCONN -
ZTS_SO_DONTROUTE
public static int ZTS_SO_DONTROUTE -
ZTS_SO_USELOOPBACK
public static int ZTS_SO_USELOOPBACK -
ZTS_SO_LINGER
public static int ZTS_SO_LINGER -
ZTS_SO_DONTLINGER
public static int ZTS_SO_DONTLINGER -
ZTS_SO_OOBINLINE
public static int ZTS_SO_OOBINLINE -
ZTS_SO_REUSEPORT
public static int ZTS_SO_REUSEPORT -
ZTS_SO_SNDBUF
public static int ZTS_SO_SNDBUF -
ZTS_SO_RCVBUF
public static int ZTS_SO_RCVBUF -
ZTS_SO_SNDLOWAT
public static int ZTS_SO_SNDLOWAT -
ZTS_SO_RCVLOWAT
public static int ZTS_SO_RCVLOWAT -
ZTS_SO_SNDTIMEO
public static int ZTS_SO_SNDTIMEO -
ZTS_SO_RCVTIMEO
public static int ZTS_SO_RCVTIMEO -
ZTS_SO_ERROR
public static int ZTS_SO_ERROR -
ZTS_SO_TYPE
public static int ZTS_SO_TYPE -
ZTS_SO_CONTIMEO
public static int ZTS_SO_CONTIMEO -
ZTS_SO_NO_CHECK
public static int ZTS_SO_NO_CHECK -
ZTS_IP_TOS
public static int ZTS_IP_TOS -
ZTS_IP_TTL
public static int ZTS_IP_TTL -
ZTS_TCP_NODELAY
public static int ZTS_TCP_NODELAY -
ZTS_TCP_KEEPALIVE
public static int ZTS_TCP_KEEPALIVE -
ZTS_TCP_KEEPIDLE
public static int ZTS_TCP_KEEPIDLE -
ZTS_TCP_KEEPINTVL
public static int ZTS_TCP_KEEPINTVL -
ZTS_TCP_KEEPCNT
public static int ZTS_TCP_KEEPCNT -
ZTS_ERR_OK
public static int ZTS_ERR_OK(0) No error -
ZTS_ERR_SOCKET
public static int ZTS_ERR_SOCKET(-1) Socket error, see zts_errno -
ZTS_ERR_SERVICE
public static int ZTS_ERR_SERVICE(-2) You probably did something at the wrong time -
ZTS_ERR_ARG
public static int ZTS_ERR_ARG(-3) Invalid argument -
ZTS_ERR_RESULT
public static int ZTS_ERR_RESULT(-4) No result (not necessarily an error) -
ZTS_ERR_GENERAL
public static int ZTS_ERR_GENERAL(-5) Consider filing a bug report -
ZTS_EPERM
public static int ZTS_EPERMOperation not permitted (`zts_errno` value) -
ZTS_ENOENT
public static int ZTS_ENOENTNo such file or directory -
ZTS_ESRCH
public static int ZTS_ESRCHNo such process -
ZTS_EINTR
public static int ZTS_EINTRInterrupted system call -
ZTS_EIO
public static int ZTS_EIOI/O error -
ZTS_ENXIO
public static int ZTS_ENXIONo such device or address -
ZTS_EBADF
public static int ZTS_EBADFBad file number -
ZTS_EAGAIN
public static int ZTS_EAGAINTry again -
ZTS_EWOULDBLOCK
public static int ZTS_EWOULDBLOCKOperation would block -
ZTS_ENOMEM
public static int ZTS_ENOMEMOut of memory -
ZTS_EACCES
public static int ZTS_EACCESPermission denied -
ZTS_EFAULT
public static int ZTS_EFAULTBad address -
ZTS_EBUSY
public static int ZTS_EBUSYDevice or resource busy -
ZTS_EEXIST
public static int ZTS_EEXISTFile exists -
ZTS_ENODEV
public static int ZTS_ENODEVNo such device -
ZTS_EINVAL
public static int ZTS_EINVALInvalid argument -
ZTS_ENFILE
public static int ZTS_ENFILEFile table overflow -
ZTS_EMFILE
public static int ZTS_EMFILEToo many open files -
ZTS_ENOSYS
public static int ZTS_ENOSYSFunction not implemented -
ZTS_ENOTSOCK
public static int ZTS_ENOTSOCKSocket operation on non-socket -
ZTS_EDESTADDRREQ
public static int ZTS_EDESTADDRREQDestination address required -
ZTS_EMSGSIZE
public static int ZTS_EMSGSIZEMessage too long -
ZTS_EPROTOTYPE
public static int ZTS_EPROTOTYPEProtocol wrong type for socket -
ZTS_ENOPROTOOPT
public static int ZTS_ENOPROTOOPTProtocol not available -
ZTS_EPROTONOSUPPORT
public static int ZTS_EPROTONOSUPPORTProtocol not supported -
ZTS_ESOCKTNOSUPPORT
public static int ZTS_ESOCKTNOSUPPORTSocket type not supported -
ZTS_EOPNOTSUPP
public static int ZTS_EOPNOTSUPPOperation not supported on transport endpoint -
ZTS_EPFNOSUPPORT
public static int ZTS_EPFNOSUPPORTProtocol family not supported -
ZTS_EAFNOSUPPORT
public static int ZTS_EAFNOSUPPORTAddress family not supported by protocol -
ZTS_EADDRINUSE
public static int ZTS_EADDRINUSEAddress already in use -
ZTS_EADDRNOTAVAIL
public static int ZTS_EADDRNOTAVAILCannot assign requested address -
ZTS_ENETDOWN
public static int ZTS_ENETDOWNNetwork is down -
ZTS_ENETUNREACH
public static int ZTS_ENETUNREACHNetwork is unreachable -
ZTS_ECONNABORTED
public static int ZTS_ECONNABORTEDSoftware caused connection abort -
ZTS_ECONNRESET
public static int ZTS_ECONNRESETConnection reset by peer -
ZTS_ENOBUFS
public static int ZTS_ENOBUFSNo buffer space available -
ZTS_EISCONN
public static int ZTS_EISCONNTransport endpoint is already connected -
ZTS_ENOTCONN
public static int ZTS_ENOTCONNTransport endpoint is not connected -
ZTS_ETIMEDOUT
public static int ZTS_ETIMEDOUTConnection timed out -
ZTS_EHOSTUNREACH
public static int ZTS_EHOSTUNREACHNo route to host -
ZTS_EALREADY
public static int ZTS_EALREADYOperation already in progress -
ZTS_EINPROGRESS
public static int ZTS_EINPROGRESSOperation now in progress -
ZTS_MAC_ADDRSTRLEN
public static int ZTS_MAC_ADDRSTRLENLength of human-readable MAC address string -
ZTS_INET_ADDRSTRLEN
public static int ZTS_INET_ADDRSTRLENMax length of human-readable IPv4 string -
ZTS_INET6_ADDRSTRLEN
public static int ZTS_INET6_ADDRSTRLENMax length of human-readable IPv6 string -
ZTS_IP_MAX_STR_LEN
public static int ZTS_IP_MAX_STR_LENMaximum (and required) length of string buffers used to receive string-format IP addresses from the API. This is set to `ZTS_INET6_ADDRSTRLEN` to handle all cases: `ZTS_AF_INET` and `ZTS_AF_INET6` -
ZTS_STORE_DATA_LEN
public static int ZTS_STORE_DATA_LENRequired buffer length to safely receive data store items -
ZTS_MAX_NETWORK_SHORT_NAME_LENGTH
public static int ZTS_MAX_NETWORK_SHORT_NAME_LENGTHMaximum length of network short name -
ZTS_MAX_NETWORK_ROUTES
public static int ZTS_MAX_NETWORK_ROUTESMaximum number of pushed routes on a network -
ZTS_MAX_ASSIGNED_ADDRESSES
public static int ZTS_MAX_ASSIGNED_ADDRESSESMaximum number of statically assigned IP addresses per network endpoint using ZT address management (not DHCP) -
ZTS_MAX_PEER_NETWORK_PATHS
public static int ZTS_MAX_PEER_NETWORK_PATHSMaximum number of direct network paths to a given peer -
ZTS_MAX_MULTICAST_SUBSCRIPTIONS
public static int ZTS_MAX_MULTICAST_SUBSCRIPTIONSMaximum number of multicast groups a device / network interface can be subscribed to at once -
ZTS_ID_STR_BUF_LEN
public static int ZTS_ID_STR_BUF_LENThe length of a human-friendly identity key pair string
-
-
Constructor Details
-
ZeroTierNative
public ZeroTierNative()
-
-
Method Details
-
zts_init
public static int zts_init() -
zts_init_from_storage
public static int zts_init_from_storage(java.lang.String path) -
zts_init_set_event_handler
-
zts_init_set_port
public static int zts_init_set_port(short port) -
zts_init_blacklist_if
public static int zts_init_blacklist_if(java.lang.String prefix, int len) -
zts_init_allow_net_cache
public static int zts_init_allow_net_cache(int allowed) -
zts_init_allow_peer_cache
public static int zts_init_allow_peer_cache(int allowed) -
zts_init_allow_roots_cache
public static int zts_init_allow_roots_cache(int allowed) -
zts_init_allow_id_cache
public static int zts_init_allow_id_cache(int allowed) -
zts_addr_is_assigned
public static int zts_addr_is_assigned(long net_id, int family) -
zts_addr_get_str
public static java.lang.String zts_addr_get_str(long net_id, int family) -
zts_addr_compute_rfc4193_str
public static int zts_addr_compute_rfc4193_str(long net_id, long node_id, java.lang.String dst, int len) -
zts_addr_compute_6plane_str
public static int zts_addr_compute_6plane_str(long net_id, long node_id, java.lang.String dst, int len) -
zts_net_compute_adhoc_id
public static long zts_net_compute_adhoc_id(short start_port, short end_port) -
zts_net_join
public static int zts_net_join(long net_id) -
zts_net_leave
public static int zts_net_leave(long net_id) -
zts_net_transport_is_ready
public static int zts_net_transport_is_ready(long net_id) -
zts_net_get_mac
public static long zts_net_get_mac(long net_id) -
zts_net_get_mac_str
public static java.lang.String zts_net_get_mac_str(long net_id) -
zts_net_get_broadcast
public static int zts_net_get_broadcast(long net_id) -
zts_net_get_mtu
public static int zts_net_get_mtu(long net_id) -
zts_net_get_name
public static int zts_net_get_name(long net_id, java.lang.String dst, int len) -
zts_net_get_status
public static int zts_net_get_status(long net_id) -
zts_net_get_type
public static int zts_net_get_type(long net_id) -
zts_route_is_assigned
public static int zts_route_is_assigned(long net_id, int family) -
zts_node_start
public static int zts_node_start() -
zts_node_is_online
public static int zts_node_is_online() -
zts_node_get_id
public static long zts_node_get_id() -
zts_node_get_port
public static int zts_node_get_port() -
zts_node_stop
public static int zts_node_stop() -
zts_node_free
public static int zts_node_free() -
zts_moon_orbit
public static int zts_moon_orbit(long moon_roots_id, long moon_seed) -
zts_moon_deorbit
public static int zts_moon_deorbit(long moon_roots_id) -
zts_connect
public static int zts_connect(int fd, java.lang.String ipstr, int port, int timeout_ms) -
zts_bind
public static int zts_bind(int fd, java.lang.String ipstr, int port) -
zts_set_no_delay
public static int zts_set_no_delay(int fd, int enabled) -
zts_get_no_delay
public static int zts_get_no_delay(int fd) -
zts_set_linger
public static int zts_set_linger(int fd, int enabled, int value) -
zts_get_linger_enabled
public static int zts_get_linger_enabled(int fd) -
zts_get_linger_value
public static int zts_get_linger_value(int fd) -
zts_get_pending_data_size
public static int zts_get_pending_data_size(int fd) -
zts_set_reuse_addr
public static int zts_set_reuse_addr(int fd, int enabled) -
zts_get_reuse_addr
public static int zts_get_reuse_addr(int fd) -
zts_set_recv_timeout
public static int zts_set_recv_timeout(int fd, int seconds, int microseconds) -
zts_get_recv_timeout
public static int zts_get_recv_timeout(int fd) -
zts_set_send_timeout
public static int zts_set_send_timeout(int fd, int seconds, int microseconds) -
zts_get_send_timeout
public static int zts_get_send_timeout(int fd) -
zts_set_send_buf_size
public static int zts_set_send_buf_size(int fd, int size) -
zts_get_send_buf_size
public static int zts_get_send_buf_size(int fd) -
zts_set_recv_buf_size
public static int zts_set_recv_buf_size(int fd, int size) -
zts_get_recv_buf_size
public static int zts_get_recv_buf_size(int fd) -
zts_set_ttl
public static int zts_set_ttl(int fd, int ttl) -
zts_get_ttl
public static int zts_get_ttl(int fd) -
zts_set_blocking
public static int zts_set_blocking(int fd, int enabled) -
zts_get_blocking
public static int zts_get_blocking(int fd) -
zts_set_keepalive
public static int zts_set_keepalive(int fd, int enabled) -
zts_get_keepalive
public static int zts_get_keepalive(int fd) -
zts_core_lock_obtain
public static int zts_core_lock_obtain() -
zts_core_lock_release
public static int zts_core_lock_release() -
zts_core_query_addr_count
public static int zts_core_query_addr_count(long net_id) -
zts_core_query_addr
public static int zts_core_query_addr(long net_id, int idx, java.lang.String addr, int len) -
zts_core_query_route_count
public static int zts_core_query_route_count(long net_id) -
zts_core_query_path_count
public static int zts_core_query_path_count(long peer_id) -
zts_core_query_path
public static int zts_core_query_path(long peer_id, int idx, java.lang.String dst, int len) -
zts_core_query_mc_count
public static int zts_core_query_mc_count(long net_id) -
zts_util_delay
public static void zts_util_delay(long milliseconds) -
zts_bsd_socket
public static int zts_bsd_socket(int family, int type, int protocol) -
zts_bsd_listen
public static int zts_bsd_listen(int fd, int backlog) -
zts_bsd_accept
public static int zts_bsd_accept(int fd, com.zerotier.sockets.ZeroTierSocketAddress addr) -
zts_bsd_read
public static int zts_bsd_read(int fd, byte[] buf) -
zts_bsd_read_offset
public static int zts_bsd_read_offset(int fd, byte[] buf, int offset, int len) -
zts_bsd_read_length
public static int zts_bsd_read_length(int fd, byte[] buf, int len) -
zts_bsd_recv
public static int zts_bsd_recv(int fd, byte[] buf, int flags) -
zts_bsd_recvfrom
public static int zts_bsd_recvfrom(int fd, byte[] buf, int flags, com.zerotier.sockets.ZeroTierSocketAddress addr) -
zts_bsd_write
public static int zts_bsd_write(int fd, byte[] buf) -
zts_bsd_write_byte
public static int zts_bsd_write_byte(int fd, byte b) -
zts_bsd_write_offset
public static int zts_bsd_write_offset(int fd, byte[] buf, int offset, int len) -
zts_bsd_sendto
public static int zts_bsd_sendto(int fd, byte[] buf, int flags, com.zerotier.sockets.ZeroTierSocketAddress addr) -
zts_bsd_send
public static int zts_bsd_send(int fd, byte[] buf, int flags) -
zts_bsd_shutdown
public static int zts_bsd_shutdown(int fd, int how) -
zts_bsd_close
public static int zts_bsd_close(int fd) -
zts_bsd_getsockname
public static boolean zts_bsd_getsockname(int fd, com.zerotier.sockets.ZeroTierSocketAddress addr) -
zts_bsd_getpeername
public static int zts_bsd_getpeername(int fd, com.zerotier.sockets.ZeroTierSocketAddress addr) -
zts_bsd_fcntl
public static int zts_bsd_fcntl(int sock, int cmd, int flag) -
zts_bsd_select
public static int zts_bsd_select(int nfds, com.zerotier.sockets.ZeroTierFileDescriptorSet readfds, com.zerotier.sockets.ZeroTierFileDescriptorSet writefds, com.zerotier.sockets.ZeroTierFileDescriptorSet exceptfds, int timeout_sec, int timeout_usec)
-