summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-08-03 14:12:38 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-08-03 14:12:38 -0700
commit67cb03742e09f7ad83c2edd80e0a8ffbfcfa6285 (patch)
tree9fd2131e5db302d892eb6e0b5680dd8d2be9cdf3 /include
parent91940cbcf52c6b09f343e365632b8a1701732099 (diff)
downloadinfinitytier-67cb03742e09f7ad83c2edd80e0a8ffbfcfa6285.tar.gz
infinitytier-67cb03742e09f7ad83c2edd80e0a8ffbfcfa6285.zip
Add tag rules and split out rule serialize/deserialize so the code can be reused.
Diffstat (limited to 'include')
-rw-r--r--include/ZeroTierOne.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h
index c4696e7d..db405c08 100644
--- a/include/ZeroTierOne.h
+++ b/include/ZeroTierOne.h
@@ -525,7 +525,22 @@ enum ZT_VirtualNetworkRuleType
/**
* Frame size range (start-end, inclusive)
*/
- ZT_NETWORK_RULE_MATCH_FRAME_SIZE_RANGE = 49
+ ZT_NETWORK_RULE_MATCH_FRAME_SIZE_RANGE = 49,
+
+ /**
+ * Match a range of tag values (equality match if start==end)
+ */
+ ZT_NETWORK_RULE_MATCH_TAG_VALUE_RANGE = 50,
+
+ /**
+ * Match if all bits are set in a tag value
+ */
+ ZT_NETWORK_RULE_MATCH_TAG_VALUE_BITS_ALL = 51,
+
+ /**
+ * Match if any bit from a mask is set in a tag value
+ */
+ ZT_NETWORK_RULE_MATCH_TAG_VALUE_BITS_ANY = 52
};
/**
@@ -628,6 +643,14 @@ typedef struct
* Ethernet packet size in host byte order (start-end, inclusive)
*/
uint16_t frameSize[2];
+
+ /**
+ * For matching tag values
+ */
+ struct {
+ uint32_t id;
+ uint32_t value[2]; // only [0] is used for BITS_ALL or BITS_ANY, [0]-[1] for range
+ } tag;
} v;
} ZT_VirtualNetworkRule;