Lines Matching defs:rule

1011 pfctl_print_eth_rule_counters(struct pfctl_eth_rule *rule, int opts)
1016 (unsigned long long)rule->evaluations,
1017 (unsigned long long)(rule->packets[0] +
1018 rule->packets[1]),
1019 (unsigned long long)(rule->bytes[0] +
1020 rule->bytes[1]));
1025 if (rule->last_active_timestamp != 0) {
1026 bcopy(ctime(&rule->last_active_timestamp), timestr,
1037 pfctl_print_rule_counters(struct pfctl_rule *rule, int opts)
1046 if (rule->skip[i].nr == rule->nr + 1)
1049 if (rule->skip[i].nr == -1)
1052 printf("%u ", rule->skip[i].nr);
1057 rule->qname, rule->qid, rule->pqname, rule->pqid);
1062 (unsigned long long)rule->evaluations,
1063 (unsigned long long)(rule->packets[0] +
1064 rule->packets[1]),
1065 (unsigned long long)(rule->bytes[0] +
1066 rule->bytes[1]), (uintmax_t)rule->states_cur);
1070 (unsigned)rule->cuid, (unsigned)rule->cpid,
1071 (uintmax_t)rule->states_tot);
1075 if (rule->last_active_timestamp != 0) {
1076 bcopy(ctime(&rule->last_active_timestamp), timestr,
1101 struct pfctl_eth_rule rule;
1149 pfctl_print_eth_rule_counters(&rule, opts);
1173 if ((ret = pfctl_get_eth_rule(dev, nr, info.ticket, path, &rule,
1192 print_eth_rule(&rule, anchor_call,
1198 pfctl_print_eth_rule_counters(&rule, opts);
1201 p, depth + 1, rule.anchor_wildcard);
1216 struct pfctl_rule rule;
1263 pfctl_print_rule_counters(&rule, opts);
1300 &rule, anchor_call, opts & PF_OPT_CLRRULECTRS)) != 0) {
1305 if (pfctl_get_pool(dev, &rule.rdr,
1309 if (pfctl_get_pool(dev, &rule.nat,
1313 if (pfctl_get_pool(dev, &rule.route,
1321 if (rule.label[0][0] && (opts & PF_OPT_SHOWALL))
1323 print_rule(&rule, anchor_call, rule_numbers, numeric);
1325 pfctl_print_rule_counters(&rule, opts);
1330 pfctl_clear_pool(&rule.rdr);
1331 pfctl_clear_pool(&rule.nat);
1332 pfctl_clear_pool(&rule.route);
1341 &rule, anchor_call, opts & PF_OPT_CLRRULECTRS)) != 0) {
1346 if (pfctl_get_pool(dev, &rule.rdr,
1350 if (pfctl_get_pool(dev, &rule.nat,
1354 if (pfctl_get_pool(dev, &rule.route,
1363 while (rule.label[i][0]) {
1364 printf("%s ", rule.label[i++]);
1371 (unsigned long long)rule.evaluations,
1372 (unsigned long long)(rule.packets[0] +
1373 rule.packets[1]),
1374 (unsigned long long)(rule.bytes[0] +
1375 rule.bytes[1]),
1376 (unsigned long long)rule.packets[0],
1377 (unsigned long long)rule.bytes[0],
1378 (unsigned long long)rule.packets[1],
1379 (unsigned long long)rule.bytes[1],
1380 (uintmax_t)rule.states_tot);
1388 anchor_call, depth, rule.anchor_wildcard);
1393 if (rule.label[0][0] && (opts & PF_OPT_SHOWALL))
1396 print_rule(&rule, anchor_call, rule_numbers, numeric);
1408 pfctl_print_rule_counters(&rule, opts);
1411 rule.anchor_wildcard);
1416 pfctl_print_rule_counters(&rule, opts);
1422 pfctl_clear_pool(&rule.rdr);
1423 pfctl_clear_pool(&rule.nat);
1436 struct pfctl_rule rule;
1483 pfctl_print_rule_counters(&rule, opts);
1508 nattype[i], &rule, anchor_call)) != 0) {
1512 if (pfctl_get_pool(dev, &rule.rdr, nr,
1515 if (pfctl_get_pool(dev, &rule.nat, nr,
1518 if (pfctl_get_pool(dev, &rule.route, nr,
1526 print_rule(&rule, anchor_call,
1533 pfctl_print_rule_counters(&rule, opts);
1535 depth + 1, rule.anchor_wildcard);
1540 pfctl_print_rule_counters(&rule, opts);
1713 /* callbacks for rule/nat/rdr/addr */
1736 struct pfctl_rule *rule;
1742 errx(1, "Invalid rule type %d", r->action);
1756 sizeof(rule->anchor->path)) >= sizeof(rule->anchor->path))
1765 sizeof(rule->anchor->name)) >= sizeof(rule->anchor->name))
1769 if ((rule = calloc(1, sizeof(*rule))) == NULL)
1771 bcopy(r, rule, sizeof(*rule));
1772 TAILQ_INIT(&rule->rdr.list);
1773 pfctl_move_pool(&r->rdr, &rule->rdr);
1774 TAILQ_INIT(&rule->nat.list);
1775 pfctl_move_pool(&r->nat, &rule->nat);
1776 TAILQ_INIT(&rule->route.list);
1777 pfctl_move_pool(&r->route, &rule->route);
1779 TAILQ_INSERT_TAIL(rs->rules[rs_num].active.ptr, rule, entries);
1787 struct pfctl_eth_rule *rule;
1803 sizeof(rule->anchor->path)) >= sizeof(rule->anchor->path))
1812 sizeof(rule->anchor->name)) >= sizeof(rule->anchor->name))
1816 if ((rule = calloc(1, sizeof(*rule))) == NULL)
1818 bcopy(r, rule, sizeof(*rule));
1820 TAILQ_INSERT_TAIL(&rs->rules, rule, entries);
2091 /* an identical rule is already present */
2105 printf(" -- rule was already present");