Changeset View
Changeset View
Standalone View
Standalone View
sbin/pfctl/pfctl_parser.c
| Show First 20 Lines • Show All 704 Lines • ▼ Show 20 Lines | if (i == ETHER_ADDR_LEN) | ||||
| return; | return; | ||||
| printf("%s%02x:%02x:%02x:%02x:%02x:%02x", a->neg ? "! " : "", | printf("%s%02x:%02x:%02x:%02x:%02x:%02x", a->neg ? "! " : "", | ||||
| a->addr[0], a->addr[1], a->addr[2], a->addr[3], a->addr[4], | a->addr[0], a->addr[1], a->addr[2], a->addr[3], a->addr[4], | ||||
| a->addr[5]); | a->addr[5]); | ||||
| } | } | ||||
| void | void | ||||
| print_eth_rule(struct pfctl_eth_rule *r, int rule_numbers) | print_eth_rule(struct pfctl_eth_rule *r, const char *anchor_call, | ||||
| int rule_numbers) | |||||
| { | { | ||||
| static const char *actiontypes[] = { "pass", "block" }; | static const char *actiontypes[] = { "pass", "block" }; | ||||
| if (rule_numbers) | if (rule_numbers) | ||||
| printf("@%u ", r->nr); | printf("@%u ", r->nr); | ||||
| printf("ether %s", actiontypes[r->action]); | printf("ether "); | ||||
| if (anchor_call[0]) { | |||||
| if (anchor_call[0] == '_') { | |||||
| printf("anchor"); | |||||
| } else | |||||
| printf("anchor \"%s\"", anchor_call); | |||||
| } else { | |||||
| printf("%s", actiontypes[r->action]); | |||||
| } | |||||
| if (r->direction == PF_IN) | if (r->direction == PF_IN) | ||||
| printf(" in"); | printf(" in"); | ||||
| else if (r->direction == PF_OUT) | else if (r->direction == PF_OUT) | ||||
| printf(" out"); | printf(" out"); | ||||
| if (r->quick) | if (r->quick) | ||||
| printf(" quick"); | printf(" quick"); | ||||
| if (r->ifname[0]) { | if (r->ifname[0]) { | ||||
| ▲ Show 20 Lines • Show All 1,221 Lines • Show Last 20 Lines | |||||