diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-30 14:07:00 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-09-30 14:07:00 -0700 |
commit | 988049f39bf7731c0189544b316850b81b004de3 (patch) | |
tree | 80291a78a3eaf560a1ba765150533420aac550c5 /include | |
parent | 6651b8310e2c6adc3ef311d07ba497bbcef0165f (diff) | |
download | infinitytier-988049f39bf7731c0189544b316850b81b004de3.tar.gz infinitytier-988049f39bf7731c0189544b316850b81b004de3.zip |
Add new rule to rules engine: random match.
Diffstat (limited to 'include')
-rw-r--r-- | include/ZeroTierOne.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h index c66b9079..ee03c3b1 100644 --- a/include/ZeroTierOne.h +++ b/include/ZeroTierOne.h @@ -634,24 +634,29 @@ enum ZT_VirtualNetworkRuleType ZT_NETWORK_RULE_MATCH_FRAME_SIZE_RANGE = 50, /** + * Random match with selectable probability + */ + ZT_NETWORK_RULE_MATCH_RANDOM = 51, + + /** * Match if local and remote tags differ by no more than value, use 0 to check for equality */ - ZT_NETWORK_RULE_MATCH_TAGS_DIFFERENCE = 51, + ZT_NETWORK_RULE_MATCH_TAGS_DIFFERENCE = 52, /** * Match if local and remote tags ANDed together equal value. */ - ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_AND = 52, + ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_AND = 53, /** * Match if local and remote tags ANDed together equal value. */ - ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_OR = 53, + ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_OR = 54, /** * Match if local and remote tags XORed together equal value. */ - ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_XOR = 54, + ZT_NETWORK_RULE_MATCH_TAGS_BITWISE_XOR = 55, /** * Maximum ID allowed for a MATCH entry in the rules table @@ -721,6 +726,11 @@ typedef struct uint64_t zt; /** + * 0 = never, UINT32_MAX = always + */ + uint32_t randomProbability; + + /** * 48-bit Ethernet MAC address in big-endian order */ uint8_t mac[6]; |