mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 13:03:45 +02:00
Filter work
This commit is contained in:
parent
e7f20ad5f9
commit
366f556e5b
1 changed files with 9 additions and 3 deletions
|
@ -167,21 +167,27 @@ std::string Filter::toString(const char *sep) const
|
||||||
s.push_back('[');
|
s.push_back('[');
|
||||||
|
|
||||||
if (i->rule.etherType()) {
|
if (i->rule.etherType()) {
|
||||||
sprintf(buf,"%u-%u",i->rule.etherType().start,i->rule.etherType().end);
|
if (i->rule.etherType().magnitude() > 1)
|
||||||
|
sprintf(buf,"%u-%u",i->rule.etherType().start,i->rule.etherType().end);
|
||||||
|
else sprintf(buf,"%u",i->rule.etherType().start);
|
||||||
s.append(buf);
|
s.append(buf);
|
||||||
} else s.push_back('*');
|
} else s.push_back('*');
|
||||||
|
|
||||||
s.push_back(';');
|
s.push_back(';');
|
||||||
|
|
||||||
if (i->rule.protocol()) {
|
if (i->rule.protocol()) {
|
||||||
sprintf(buf,"%u-%u",i->rule.protocol().start,i->rule.protocol().end);
|
if (i->rule.protocol().magnitude() > 1)
|
||||||
|
sprintf(buf,"%u-%u",i->rule.protocol().start,i->rule.protocol().end);
|
||||||
|
else sprintf(buf,"%u",i->rule.protocol().start);
|
||||||
s.append(buf);
|
s.append(buf);
|
||||||
} else s.push_back('*');
|
} else s.push_back('*');
|
||||||
|
|
||||||
s.push_back(';');
|
s.push_back(';');
|
||||||
|
|
||||||
if (i->rule.port()) {
|
if (i->rule.port()) {
|
||||||
sprintf(buf,"%u-%u",i->rule.port().start,i->rule.port().end);
|
if (i->rule.port().magnitude() > 1)
|
||||||
|
sprintf(buf,"%u-%u",i->rule.port().start,i->rule.port().end);
|
||||||
|
else sprintf(buf,"%u",i->rule.port().start);
|
||||||
s.append(buf);
|
s.append(buf);
|
||||||
} else s.push_back('*');
|
} else s.push_back('*');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue