diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-04 12:35:25 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-04 12:35:25 -0700 |
| commit | 8a7753cfe3824ad378e779140fdd99f5c2873642 (patch) | |
| tree | 0fc514a6ab11fdcf9d5a76825918bec25e3beafd /node/Filter.cpp | |
| parent | 331382cf2f3a3da9c5ec6821f9d63d3f3452202a (diff) | |
| download | infinitytier-8a7753cfe3824ad378e779140fdd99f5c2873642.tar.gz infinitytier-8a7753cfe3824ad378e779140fdd99f5c2873642.zip | |
Filter cleanup, prep for filter integration in a few places.
Diffstat (limited to 'node/Filter.cpp')
| -rw-r--r-- | node/Filter.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/node/Filter.cpp b/node/Filter.cpp index 2980149b..286a0144 100644 --- a/node/Filter.cpp +++ b/node/Filter.cpp @@ -66,7 +66,8 @@ bool Filter::run( const unsigned int vlanId, const ZT_VirtualNetworkRule *rules, const unsigned int ruleCount, - const Tag *tags, + const uint32_t *tagKeys, + const uint32_t *tagValues, const unsigned int tagCount, Address &sendCopyOfPacketTo) { @@ -248,13 +249,13 @@ bool Filter::run( case ZT_NETWORK_RULE_MATCH_TAG_VALUE_BITS_ALL: case ZT_NETWORK_RULE_MATCH_TAG_VALUE_BITS_ANY: for(unsigned int i=0;i<tagCount;++i) { // sequential scan is probably fastest since this is going to be <64 entries (usually only one or two) - if (tags[i].id() == rules[rn].v.tag.id) { + if (tagKeys[i] == rules[rn].v.tag.id) { if (rt == ZT_NETWORK_RULE_MATCH_TAG_VALUE_RANGE) { - thisRuleMatches = (uint8_t)((tags[i].value() >= rules[rn].v.tag.value[0])&&(tags[i].value() <= rules[rn].v.tag.value[1])); + thisRuleMatches = (uint8_t)((tagValues[i] >= rules[rn].v.tag.value[0])&&(tagValues[i] <= rules[rn].v.tag.value[1])); } else if (rt == ZT_NETWORK_RULE_MATCH_TAG_VALUE_BITS_ALL) { - thisRuleMatches = (uint8_t)((tags[i].value() & rules[rn].v.tag.value[0]) == rules[rn].v.tag.value[0]); + thisRuleMatches = (uint8_t)((tagValues[i] & rules[rn].v.tag.value[0]) == rules[rn].v.tag.value[0]); } else if (rt == ZT_NETWORK_RULE_MATCH_TAG_VALUE_BITS_ANY) { - thisRuleMatches = (uint8_t)((tags[i].value() & rules[rn].v.tag.value[0]) != 0); + thisRuleMatches = (uint8_t)((tagValues[i] & rules[rn].v.tag.value[0]) != 0); } break; } |
