Integration of Filter into inbound and outbound packet path.
This commit is contained in:
parent
eaf6d6c938
commit
7404eb46c4
6 changed files with 150 additions and 61 deletions
|
@ -215,26 +215,6 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param etherType Ethernet frame type to check
|
||||
* @return True if allowed on this network
|
||||
*/
|
||||
inline bool permitsEtherType(unsigned int etherType) const
|
||||
{
|
||||
unsigned int et = 0;
|
||||
for(unsigned int i=0;i<ruleCount;++i) {
|
||||
ZT_VirtualNetworkRuleType rt = (ZT_VirtualNetworkRuleType)(rules[i].t & 0x7f);
|
||||
if (rt == ZT_NETWORK_RULE_MATCH_ETHERTYPE) {
|
||||
et = rules[i].v.etherType;
|
||||
} else if (rt == ZT_NETWORK_RULE_ACTION_ACCEPT) {
|
||||
if ((!et)||(et == etherType))
|
||||
return true;
|
||||
et = 0;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write this network config to a dictionary for transport
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue