mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-12 20:28:27 +00:00
Add rule type to match a COM field of the peer by ID and value because this will be powerful.
This commit is contained in:
@ -250,6 +250,12 @@ bool NetworkConfig::toDictionary(Dictionary<ZT_NETWORKCONFIG_DICT_CAPACITY> &d,b
|
||||
tmp.append((uint32_t)rules[i].v.tcpseq[0]);
|
||||
tmp.append((uint32_t)rules[i].v.tcpseq[1]);
|
||||
break;
|
||||
case ZT_NETWORK_RULE_MATCH_COM_FIELD_GE:
|
||||
case ZT_NETWORK_RULE_MATCH_COM_FIELD_LE:
|
||||
tmp.append((uint8_t)16);
|
||||
tmp.append((uint64_t)rules[i].v.comIV[0]);
|
||||
tmp.append((uint64_t)rules[i].v.comIV[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (tmp.size()) {
|
||||
@ -469,6 +475,11 @@ bool NetworkConfig::fromDictionary(const Dictionary<ZT_NETWORKCONFIG_DICT_CAPACI
|
||||
rules[ruleCount].v.tcpseq[0] = tmp.at<uint32_t>(p);
|
||||
rules[ruleCount].v.tcpseq[1] = tmp.at<uint32_t>(p + 4);
|
||||
break;
|
||||
case ZT_NETWORK_RULE_MATCH_COM_FIELD_GE:
|
||||
case ZT_NETWORK_RULE_MATCH_COM_FIELD_LE:
|
||||
rules[ruleCount].v.comIV[0] = tmp.at<uint64_t>(p);
|
||||
rules[ruleCount].v.comIV[1] = tmp.at<uint64_t>(p + 8);
|
||||
break;
|
||||
}
|
||||
p += fieldLen;
|
||||
++ruleCount;
|
||||
|
Reference in New Issue
Block a user