This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-libzt/docs/api.md

25 KiB

Summary

Members Descriptions
class swig_libzt::_object
class ZeroTier::lwIP lwIP network stack driver class
class ZeroTier::picoTCP picoTCP network stack driver class
class ZeroTier::RingBuffer
class swig_libzt::sockaddr_ll

class swig_libzt::_object

Summary

Members Descriptions

Members

class ZeroTier::lwIP

lwIP network stack driver class

Summary

Members Descriptions
public void lwip_init_interface(VirtualTap * tap,const InetAddress & ip) Set up an interface in the network stack for the VirtualTap
public int lwip_num_total_pcbs() Returns the total number of PCBs of any time or state
public int lwip_add_dns_nameserver(struct sockaddr * addr) Registers a DNS nameserver with the network stack
public int lwip_del_dns_nameserver(struct sockaddr * addr) Un-registers a DNS nameserver from the network stack
public void lwip_loop(VirtualTap * tap) Main stack loop
public void lwip_eth_rx(VirtualTap * tap,const MAC & from,const MAC & to,unsigned int etherType,const void * data,unsigned int len) Packets from the ZeroTier virtual wire enter the stack here
public int lwip_Socket(void ** pcb,int socket_family,int socket_type,int protocol) Creates a stack-specific "socket" or "VirtualSocket object"
public int lwip_Connect(VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen) Connect to remote host via userspace network stack interface - Called from VirtualTap
public int lwip_Bind(VirtualTap * tap,VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen) Bind to a userspace network stack interface - Called from VirtualTap
public int lwip_Listen(VirtualSocket * vs,int backlog) Listen for incoming VirtualSockets - Called from VirtualTap
public VirtualSocket*lwip_Accept(VirtualSocket * vs) Accept an incoming VirtualSocket - Called from VirtualTap
public int lwip_Read(VirtualSocket * vs,bool lwip_invoked) Read from RX buffer to application - Called from VirtualTap
public int lwip_Write(VirtualSocket * vs,void * data,ssize_t len) Write to userspace network stack - Called from VirtualTap
public int lwip_Close(VirtualSocket * vs) Close a VirtualSocket - Called from VirtualTap
public int lwip_Shutdown(VirtualSocket * vs,int how) Shuts down some aspect of a VirtualSocket - Called from VirtualTap

Members

public void lwip_init_interface(VirtualTap * tap,const InetAddress & ip)

Set up an interface in the network stack for the VirtualTap

public int lwip_num_total_pcbs()

Returns the total number of PCBs of any time or state

public int lwip_add_dns_nameserver(struct sockaddr * addr)

Registers a DNS nameserver with the network stack

public int lwip_del_dns_nameserver(struct sockaddr * addr)

Un-registers a DNS nameserver from the network stack

public void lwip_loop(VirtualTap * tap)

Main stack loop

public void lwip_eth_rx(VirtualTap * tap,const MAC & from,const MAC & to,unsigned int etherType,const void * data,unsigned int len)

Packets from the ZeroTier virtual wire enter the stack here

public int lwip_Socket(void ** pcb,int socket_family,int socket_type,int protocol)

Creates a stack-specific "socket" or "VirtualSocket object"

public int lwip_Connect(VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen)

Connect to remote host via userspace network stack interface - Called from VirtualTap

public int lwip_Bind(VirtualTap * tap,VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen)

Bind to a userspace network stack interface - Called from VirtualTap

public int lwip_Listen(VirtualSocket * vs,int backlog)

Listen for incoming VirtualSockets - Called from VirtualTap

public VirtualSocket*lwip_Accept(VirtualSocket * vs)

Accept an incoming VirtualSocket - Called from VirtualTap

public int lwip_Read(VirtualSocket * vs,bool lwip_invoked)

Read from RX buffer to application - Called from VirtualTap

public int lwip_Write(VirtualSocket * vs,void * data,ssize_t len)

Write to userspace network stack - Called from VirtualTap

public int lwip_Close(VirtualSocket * vs)

Close a VirtualSocket - Called from VirtualTap

public int lwip_Shutdown(VirtualSocket * vs,int how)

Shuts down some aspect of a VirtualSocket - Called from VirtualTap

class ZeroTier::picoTCP

picoTCP network stack driver class

Summary

Members Descriptions
public bool pico_init_interface(ZeroTier::VirtualTap * tap) Set up an interface in the network stack for the VirtualTap
public bool pico_register_address(VirtualTap * tap,const InetAddress & ip) Register an address with the stack
public bool pico_route_add(VirtualTap * tap,const InetAddress & addr,const InetAddress & nm,const InetAddress & gw,int metric) Adds a route to the picoTCP device
public bool pico_route_del(VirtualTap * tap,const InetAddress & addr,const InetAddress & nm,int metric) Deletes a route from the picoTCP device
public int pico_add_dns_nameserver(struct sockaddr * addr) Registers a DNS nameserver with the network stack
public int pico_del_dns_nameserver(struct sockaddr * addr) Un-registers a DNS nameserver from the network stack
public void pico_loop(VirtualTap * tap) Main stack loop
public void pico_eth_rx(VirtualTap * tap,const ZeroTier::MAC & from,const ZeroTier::MAC & to,unsigned int etherType,const void * data,unsigned int len) Packets from the ZeroTier virtual wire enter the stack here
public int pico_Socket(struct pico_socket ** p,int socket_family,int socket_type,int protocol) Creates a stack-specific "socket" or "VirtualSocket object"
public int pico_Connect(VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen) Connect to remote host via userspace network stack interface - Called from VirtualTap
public int pico_Bind(VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen) Bind to a userspace network stack interface - Called from VirtualTap
public int pico_Listen(VirtualSocket * vs,int backlog) Listen for incoming VirtualSockets - Called from VirtualTap
public VirtualSocket*pico_Accept(VirtualSocket * vs) Accept an incoming VirtualSocket - Called from VirtualTap
public int pico_Read(VirtualTap * tap,ZeroTier::PhySocket * sock,VirtualSocket * vs,bool stack_invoked) Read from RX buffer to application - Called from VirtualTap
public int pico_Write(VirtualSocket * vs,void * data,ssize_t len) Write to userspace network stack - Called from VirtualTap
public int pico_Close(VirtualSocket * vs) Close a VirtualSocket - Called from VirtualTap
public int pico_Shutdown(VirtualSocket * vs,int how) Shuts down some aspect of a VirtualSocket - Called from VirtualTap

Members

public bool pico_init_interface(ZeroTier::VirtualTap * tap)

Set up an interface in the network stack for the VirtualTap

public bool pico_register_address(VirtualTap * tap,const InetAddress & ip)

Register an address with the stack

public bool pico_route_add(VirtualTap * tap,const InetAddress & addr,const InetAddress & nm,const InetAddress & gw,int metric)

Adds a route to the picoTCP device

public bool pico_route_del(VirtualTap * tap,const InetAddress & addr,const InetAddress & nm,int metric)

Deletes a route from the picoTCP device

public int pico_add_dns_nameserver(struct sockaddr * addr)

Registers a DNS nameserver with the network stack

public int pico_del_dns_nameserver(struct sockaddr * addr)

Un-registers a DNS nameserver from the network stack

public void pico_loop(VirtualTap * tap)

Main stack loop

public void pico_eth_rx(VirtualTap * tap,const ZeroTier::MAC & from,const ZeroTier::MAC & to,unsigned int etherType,const void * data,unsigned int len)

Packets from the ZeroTier virtual wire enter the stack here

public int pico_Socket(struct pico_socket ** p,int socket_family,int socket_type,int protocol)

Creates a stack-specific "socket" or "VirtualSocket object"

public int pico_Connect(VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen)

Connect to remote host via userspace network stack interface - Called from VirtualTap

public int pico_Bind(VirtualSocket * vs,const struct sockaddr * addr,socklen_t addrlen)

Bind to a userspace network stack interface - Called from VirtualTap

public int pico_Listen(VirtualSocket * vs,int backlog)

Listen for incoming VirtualSockets - Called from VirtualTap

public VirtualSocket*pico_Accept(VirtualSocket * vs)

Accept an incoming VirtualSocket - Called from VirtualTap

public int pico_Read(VirtualTap * tap,ZeroTier::PhySocket * sock,VirtualSocket * vs,bool stack_invoked)

Read from RX buffer to application - Called from VirtualTap

public int pico_Write(VirtualSocket * vs,void * data,ssize_t len)

Write to userspace network stack - Called from VirtualTap

public int pico_Close(VirtualSocket * vs)

Close a VirtualSocket - Called from VirtualTap

public int pico_Shutdown(VirtualSocket * vs,int how)

Shuts down some aspect of a VirtualSocket - Called from VirtualTap

class ZeroTier::RingBuffer

Summary

Members Descriptions
public inline explicit RingBuffer(size_t size) create a RingBuffer with space for up to size elements.
public inline RingBuffer(const RingBuffer< T > & ring)
public inline ~RingBuffer()
public inline T * get_buf()
public inline size_t produce(size_t n)
public inline size_t consume(size_t n)
public inline size_t write(const T * data,size_t n)
public inline size_t read(T * dest,size_t n)
public inline size_t count()
public inline size_t getFree()

Members

public inline explicit RingBuffer(size_t size)

create a RingBuffer with space for up to size elements.

public inline RingBuffer(const RingBuffer< T > & ring)

public inline ~RingBuffer()

public inline T * get_buf()

public inline size_t produce(size_t n)

public inline size_t consume(size_t n)

public inline size_t write(const T * data,size_t n)

public inline size_t read(T * dest,size_t n)

public inline size_t count()

public inline size_t getFree()

class swig_libzt::sockaddr_ll

class swig_libzt::sockaddr_ll
  : public swig_libzt._object

Summary

Members Descriptions
public this
public def __init__(self)

Members

public this

public def __init__(self)

Generated by Moxygen