Lines Matching refs:attrs

244 handle_dumpstates(struct nlpcb *nlp, struct nl_parsed_state *attrs,
266 if (attrs->creatorid != 0 && s->creatorid != attrs->creatorid)
268 if (attrs->ifname[0] != 0 &&
269 strncmp(attrs->ifname, s->kif->pfik_name, IFNAMSIZ) != 0)
271 if (attrs->proto != 0 && s->key[PF_SK_WIRE]->proto != attrs->proto)
273 if (attrs->af != 0 && af != attrs->af)
276 &attrs->mask, &attrs->addr, af) &&
278 &attrs->mask, &attrs->addr, af) &&
280 &attrs->mask, &attrs->addr, af) &&
282 &attrs->mask, &attrs->addr, af))
301 handle_getstate(struct nlpcb *nlp, struct nl_parsed_state *attrs,
307 s = pf_find_state_byid(attrs->id, attrs->creatorid);
345 struct nl_parsed_state attrs = {};
346 error = nl_parse_nlmsg(hdr, &state_parser, npt, &attrs);
350 if (attrs.id != 0)
351 error = handle_getstate(npt->nlp, &attrs, hdr, npt);
353 error = handle_dumpstates(npt->nlp, &attrs, hdr, npt);
791 struct nl_parsed_addrule attrs = {};
793 attrs.rule = pf_krule_alloc();
795 error = nl_parse_nlmsg(hdr, &addrule_parser, npt, &attrs);
797 pf_free_rule(attrs.rule);
801 error = pf_ioctl_addrule(attrs.rule, attrs.ticket, attrs.pool_ticket,
802 attrs.anchor, attrs.anchor_call, nlp_get_cred(npt->nlp)->cr_uid,
819 struct pfioc_rule attrs = {};
824 error = nl_parse_nlmsg(hdr, &getrules_parser, npt, &attrs);
836 error = pf_ioctl_getrules(&attrs);
840 nlattr_add_u32(nw, PF_GR_NR, attrs.nr);
841 nlattr_add_u32(nw, PF_GR_TICKET, attrs.ticket);
877 struct nl_parsed_get_rule attrs = {};
886 error = nl_parse_nlmsg(hdr, &getrule_parser, npt, &attrs);
899 ruleset = pf_find_kruleset(attrs.anchor);
906 rs_num = pf_get_ruleset_number(attrs.action);
913 if (attrs.ticket != ruleset->rules[rs_num].active.ticket) {
920 while ((rule != NULL) && (rule->nr != attrs.nr))
1028 if (attrs.clear)
1131 struct nl_parsed_set_statusif attrs = {};
1133 error = nl_parse_nlmsg(hdr, &set_statusif_parser, npt, &attrs);
1138 strlcpy(V_pf_status.ifname, attrs.ifname, IFNAMSIZ);
1276 struct pfioc_natlook attrs = {};
1281 error = nl_parse_nlmsg(hdr, &natlook_parser, npt, &attrs);
1285 error = pf_ioctl_natlook(&attrs);
1297 nlattr_add_in6_addr(nw, PF_NL_SRC_ADDR, &attrs.rsaddr.v6);
1298 nlattr_add_in6_addr(nw, PF_NL_DST_ADDR, &attrs.rdaddr.v6);
1299 nlattr_add_u16(nw, PF_NL_SRC_PORT, attrs.rsport);
1300 nlattr_add_u16(nw, PF_NL_DST_PORT, attrs.rdport);
1324 struct pf_nl_set_debug attrs = {};
1327 error = nl_parse_nlmsg(hdr, &set_debug_parser, npt, &attrs);
1332 V_pf_status.debug = attrs.level;
1354 struct pf_nl_set_timeout attrs = {};
1357 error = nl_parse_nlmsg(hdr, &set_timeout_parser, npt, &attrs);
1361 return (pf_ioctl_set_timeout(attrs.timeout, attrs.seconds, NULL));
1367 struct pf_nl_set_timeout attrs = {};
1372 error = nl_parse_nlmsg(hdr, &set_timeout_parser, npt, &attrs);
1376 error = pf_ioctl_get_timeout(attrs.timeout, &attrs.seconds);
1388 nlattr_add_u32(nw, PF_TO_SECONDS, attrs.seconds);
1414 struct pf_nl_set_limit attrs = {};
1417 error = nl_parse_nlmsg(hdr, &set_limit_parser, npt, &attrs);
1421 return (pf_ioctl_set_limit(attrs.index, attrs.limit, NULL));
1427 struct pf_nl_set_limit attrs = {};
1432 error = nl_parse_nlmsg(hdr, &set_limit_parser, npt, &attrs);
1436 error = pf_ioctl_get_limit(attrs.index, &attrs.limit);
1448 nlattr_add_u32(nw, PF_LI_LIMIT, attrs.limit);
1530 struct pf_nl_pooladdr attrs = { 0 };
1533 error = nl_parse_nlmsg(hdr, &add_addr_parser, npt, &attrs);
1537 if (attrs.which == 0)
1538 attrs.which = PF_RDR;
1540 error = pf_ioctl_add_addr(&attrs);
1548 struct pf_nl_pooladdr attrs = { 0 };
1553 error = nl_parse_nlmsg(hdr, &add_addr_parser, npt, &attrs);
1557 if (attrs.which == 0)
1558 attrs.which = PF_RDR;
1560 error = pf_ioctl_get_addrs(&attrs);
1572 nlattr_add_u32(nw, PF_AA_NR, attrs.nr);
1585 struct pf_nl_pooladdr attrs = { 0 };
1590 error = nl_parse_nlmsg(hdr, &add_addr_parser, npt, &attrs);
1594 if (attrs.which == 0)
1595 attrs.which = PF_RDR;
1597 error = pf_ioctl_get_addr(&attrs);
1609 nlattr_add_u32(nw, PF_AA_ACTION, attrs.action);
1610 nlattr_add_u32(nw, PF_AA_TICKET, attrs.ticket);
1611 nlattr_add_u32(nw, PF_AA_NR, attrs.nr);
1612 nlattr_add_u32(nw, PF_AA_R_NUM, attrs.r_num);
1613 nlattr_add_u8(nw, PF_AA_R_ACTION, attrs.r_action);
1614 nlattr_add_u8(nw, PF_AA_R_LAST, attrs.r_last);
1615 nlattr_add_u8(nw, PF_AA_AF, attrs.af);
1616 nlattr_add_string(nw, PF_AA_ANCHOR, attrs.anchor);
1617 nlattr_add_pool_addr(nw, PF_AA_ADDR, &attrs.addr);
1638 struct pfioc_ruleset attrs = { 0 };
1643 error = nl_parse_nlmsg(hdr, &ruleset_parser, npt, &attrs);
1647 error = pf_ioctl_get_rulesets(&attrs);
1659 nlattr_add_u32(nw, PF_RS_NR, attrs.nr);
1672 struct pfioc_ruleset attrs = { 0 };
1677 error = nl_parse_nlmsg(hdr, &ruleset_parser, npt, &attrs);
1681 error = pf_ioctl_get_ruleset(&attrs);
1693 nlattr_add_string(nw, PF_RS_NAME, attrs.name);
1804 struct pfioc_table attrs = { 0 };
1810 error = nl_parse_nlmsg(hdr, &table_parser, npt, &attrs);
1815 error = pfr_clr_tables(&attrs.pfrio_table, &ndel, attrs.pfrio_flags | PFR_FLAG_USERIOCTL);
1841 struct pfioc_table attrs = { 0 };
1846 error = nl_parse_nlmsg(hdr, &table_parser, npt, &attrs);
1851 error = pfr_add_tables(&attrs.pfrio_table, 1, &attrs.pfrio_nadd,
1852 attrs.pfrio_flags | PFR_FLAG_USERIOCTL);
1865 nlattr_add_u32(nw, PF_T_NBR_ADDED, attrs.pfrio_nadd);
1878 struct pfioc_table attrs = { 0 };
1883 error = nl_parse_nlmsg(hdr, &table_parser, npt, &attrs);
1888 error = pfr_del_tables(&attrs.pfrio_table, 1, &attrs.pfrio_ndel,
1889 attrs.pfrio_flags | PFR_FLAG_USERIOCTL);
1902 nlattr_add_u32(nw, PF_T_NBR_DELETED, attrs.pfrio_ndel);
1930 struct pfioc_table attrs = { 0 };
1939 error = nl_parse_nlmsg(hdr, &table_parser, npt, &attrs);
1946 n = pfr_table_count(&attrs.pfrio_table, attrs.pfrio_flags);
1950 error = pfr_get_tstats(&attrs.pfrio_table, pfrtstats,
1951 &n, attrs.pfrio_flags | PFR_FLAG_USERIOCTL);
2013 struct pfioc_table attrs = { 0 };
2021 error = nl_parse_nlmsg(hdr, &table_parser, npt, &attrs);
2027 error = pfr_clr_tstats(&attrs.pfrio_table, 1,
2028 &nzero, attrs.pfrio_flags | PFR_FLAG_USERIOCTL);
2051 struct pfioc_table attrs = { 0 };
2057 error = nl_parse_nlmsg(hdr, &table_parser, npt, &attrs);
2062 error = pfr_clr_addrs(&attrs.pfrio_table, &ndel,
2063 attrs.pfrio_flags | PFR_FLAG_USERIOCTL);
2108 struct nl_parsed_table_addrs *attrs = target;
2112 if (attrs->addr_count >= nitems(attrs->addrs))
2119 memcpy(&attrs->addrs[attrs->addr_count], &addr, sizeof(addr));
2120 attrs->addr_count++;
2139 struct nl_parsed_table_addrs attrs = { 0 };
2144 error = nl_parse_nlmsg(hdr, &table_addr_parser, npt, &attrs);
2149 error = pfr_add_addrs(&attrs.table, &attrs.addrs[0],
2150 attrs.addr_count, &attrs.nadd, attrs.flags | PFR_FLAG_USERIOCTL);
2161 nlattr_add_u32(nw, PF_TA_NBR_ADDED, attrs.nadd);
2172 struct nl_parsed_table_addrs attrs = { 0 };
2177 error = nl_parse_nlmsg(hdr, &table_addr_parser, npt, &attrs);
2182 error = pfr_del_addrs(&attrs.table, &attrs.addrs[0],
2183 attrs.addr_count, &attrs.ndel, attrs.flags | PFR_FLAG_USERIOCTL);
2194 nlattr_add_u32(nw, PF_TA_NBR_DELETED, attrs.ndel);