Skip to main content

ZT_VirtualNetworkRule

More...

#include <ZeroTierOne.h>

Public Attributes#

Name
uint8_tt
uint8_tip
uint8_tmask
struct ZT_VirtualNetworkRule::@0::@1ipv6
uint32_tip
struct ZT_VirtualNetworkRule::@0::@2ipv4
uint64_tstart
uint32_tend
uint16_tidx
uint8_tformat
struct ZT_VirtualNetworkRule::@0::@3intRange
uint64_tcharacteristics
uint16_tport
uint64_tzt
uint32_trandomProbability
uint8_tmac
uint16_tvlanId
uint8_tvlanPcp
uint8_tvlanDei
uint16_tetherType
uint8_tipProtocol
uint8_tvalue
struct ZT_VirtualNetworkRule::@0::@4ipTos
uint16_tframeSize
uint8_ttype
uint8_tcode
uint8_tflags
struct ZT_VirtualNetworkRule::@0::@5icmp
uint32_tid
uint32_tvalue
struct ZT_VirtualNetworkRule::@0::@6tag
uint64_taddress
uint32_tflags
uint16_tlength
struct ZT_VirtualNetworkRule::@0::@7fwd
uint8_tqosBucket
union ZT_VirtualNetworkRule::@0v

Detailed Description#

struct ZT_VirtualNetworkRule;

Network flow rule

Rules are stored in a table in which one or more match entries is followed by an action. If more than one match precedes an action, the rule is the AND of all matches. An action with no match is always taken since it matches anything. If nothing matches, the default action is DROP.

This is designed to be a more memory-efficient way of storing rules than a wide table, yet still fast and simple to access in code.

Public Attributes Documentation#

variable t#

uint8_t t;

Type and flags

Bits are: NOTTTTTT

N - If true, sense of match is inverted (no effect on actions) O - If true, result is ORed with previous instead of ANDed (no effect on actions) T - Rule or action type

AND with 0x3f to get type, 0x80 to get NOT bit, and 0x40 to get OR bit.

variable ip#

uint8_t ip;

variable mask#

uint8_t mask;

variable ipv6#

struct ZT_VirtualNetworkRule::@0::@1 ipv6;

IPv6 address in big-endian / network byte order and netmask bits

variable ip#

uint32_t ip;

variable ipv4#

struct ZT_VirtualNetworkRule::@0::@2 ipv4;

IPv4 address in big-endian / network byte order

variable start#

uint64_t start;

variable end#

uint32_t end;

variable idx#

uint16_t idx;

variable format#

uint8_t format;

variable intRange#

struct ZT_VirtualNetworkRule::@0::@3 intRange;

Integer range match in packet payload

This allows matching of ranges of integers up to 64 bits wide where the range is +/- INT32_MAX. It's packed this way so it fits in 16 bytes and doesn't enlarge the overall size of this union.

variable characteristics#

uint64_t characteristics;

Packet characteristic flags being matched

variable port#

uint16_t port;

IP port range – start-end inclusive – host byte order

variable zt#

uint64_t zt;

40-bit ZeroTier address (in least significant bits, host byte order)

variable randomProbability#

uint32_t randomProbability;

0 = never, UINT32_MAX = always

variable mac#

uint8_t mac;

48-bit Ethernet MAC address in big-endian order

variable vlanId#

uint16_t vlanId;

VLAN ID in host byte order

variable vlanPcp#

uint8_t vlanPcp;

VLAN PCP (least significant 3 bits)

variable vlanDei#

uint8_t vlanDei;

VLAN DEI (single bit / boolean)

variable etherType#

uint16_t etherType;

Ethernet type in host byte order

variable ipProtocol#

uint8_t ipProtocol;

IP protocol

variable value#

uint8_t value;

variable ipTos#

struct ZT_VirtualNetworkRule::@0::@4 ipTos;

IP type of service a.k.a. DSCP field

variable frameSize#

uint16_t frameSize;

Ethernet packet size in host byte order (start-end, inclusive)

variable type#

uint8_t type;

variable code#

uint8_t code;

variable flags#

uint8_t flags;

variable icmp#

struct ZT_VirtualNetworkRule::@0::@5 icmp;

ICMP type and code

variable id#

uint32_t id;

variable value#

uint32_t value;

variable tag#

struct ZT_VirtualNetworkRule::@0::@6 tag;

For tag-related rules

variable address#

uint64_t address;

variable flags#

uint32_t flags;

variable length#

uint16_t length;

variable fwd#

struct ZT_VirtualNetworkRule::@0::@7 fwd;

Destinations for TEE and REDIRECT

variable qosBucket#

uint8_t qosBucket;

Quality of Service (QoS) bucket we want a frame to be placed in

variable v#

union ZT_VirtualNetworkRule::@0 v;

Union containing the value of this rule – which field is used depends on 't'


Updated on 25 October 2021 at 23:59:59 UTC