Lines Matching refs:pf
408 pfctl_adjust_skip_ifaces(struct pfctl *pf) in pfctl_adjust_skip_ifaces() argument
417 pfctl_set_interface_flags(pf, p->pfik_name, PFI_IFLAG_SKIP, 0); in pfctl_adjust_skip_ifaces()
427 pfctl_set_interface_flags(pf, in pfctl_adjust_skip_ifaces()
438 pfctl_set_interface_flags(pf, p->pfik_name, PFI_IFLAG_SKIP, 0); in pfctl_adjust_skip_ifaces()
1724 pfctl_add_pool(struct pfctl *pf, struct pfctl_pool *p, sa_family_t af, int which) in pfctl_add_pool() argument
1729 pf->paddr.af = af; in pfctl_add_pool()
1731 memcpy(&pf->paddr.addr, pa, sizeof(struct pf_pooladdr)); in pfctl_add_pool()
1732 if ((pf->opts & PF_OPT_NOACTION) == 0) { in pfctl_add_pool()
1733 if ((ret = pfctl_add_addr(pf->h, &pf->paddr, which)) != 0) in pfctl_add_pool()
1751 pfctl_append_rule(struct pfctl *pf, struct pfctl_rule *r, in pfctl_append_rule() argument
1763 rs = &pf->anchor->ruleset; in pfctl_append_rule()
1803 pfctl_append_eth_rule(struct pfctl *pf, struct pfctl_eth_rule *r, in pfctl_append_eth_rule() argument
1810 rs = &pf->eanchor->ruleset; in pfctl_append_eth_rule()
1844 pfctl_eth_ruleset_trans(struct pfctl *pf, char *path, in pfctl_eth_ruleset_trans() argument
1847 int osize = pf->trans->pfrb_size; in pfctl_eth_ruleset_trans()
1849 if ((pf->loadopt & PFCTL_FLAG_ETH) != 0) { in pfctl_eth_ruleset_trans()
1850 if (pfctl_add_trans(pf->trans, PF_RULESET_ETH, path)) in pfctl_eth_ruleset_trans()
1853 if (pfctl_trans(pf->dev, pf->trans, DIOCXBEGIN, osize)) in pfctl_eth_ruleset_trans()
1860 pfctl_ruleset_trans(struct pfctl *pf, char *path, struct pfctl_anchor *a, bool do_eth) in pfctl_ruleset_trans() argument
1862 int osize = pf->trans->pfrb_size; in pfctl_ruleset_trans()
1864 if ((pf->loadopt & PFCTL_FLAG_ETH) != 0 && do_eth) { in pfctl_ruleset_trans()
1865 if (pfctl_add_trans(pf->trans, PF_RULESET_ETH, path)) in pfctl_ruleset_trans()
1868 if ((pf->loadopt & PFCTL_FLAG_NAT) != 0) { in pfctl_ruleset_trans()
1869 if (pfctl_add_trans(pf->trans, PF_RULESET_NAT, path) || in pfctl_ruleset_trans()
1870 pfctl_add_trans(pf->trans, PF_RULESET_BINAT, path) || in pfctl_ruleset_trans()
1871 pfctl_add_trans(pf->trans, PF_RULESET_RDR, path)) in pfctl_ruleset_trans()
1874 if (a == pf->astack[0] && ((altqsupport && in pfctl_ruleset_trans()
1875 (pf->loadopt & PFCTL_FLAG_ALTQ) != 0))) { in pfctl_ruleset_trans()
1876 if (pfctl_add_trans(pf->trans, PF_RULESET_ALTQ, path)) in pfctl_ruleset_trans()
1879 if ((pf->loadopt & PFCTL_FLAG_FILTER) != 0) { in pfctl_ruleset_trans()
1880 if (pfctl_add_trans(pf->trans, PF_RULESET_SCRUB, path) || in pfctl_ruleset_trans()
1881 pfctl_add_trans(pf->trans, PF_RULESET_FILTER, path)) in pfctl_ruleset_trans()
1884 if (pf->loadopt & PFCTL_FLAG_TABLE) in pfctl_ruleset_trans()
1885 if (pfctl_add_trans(pf->trans, PF_RULESET_TABLE, path)) in pfctl_ruleset_trans()
1887 if (pfctl_trans(pf->dev, pf->trans, DIOCXBEGIN, osize)) in pfctl_ruleset_trans()
1894 pfctl_load_eth_ruleset(struct pfctl *pf, char *path, in pfctl_load_eth_ruleset() argument
1901 pf->eanchor = rs->anchor; in pfctl_load_eth_ruleset()
1903 snprintf(&path[len], MAXPATHLEN - len, "/%s", pf->eanchor->name); in pfctl_load_eth_ruleset()
1905 snprintf(&path[len], MAXPATHLEN - len, "%s", pf->eanchor->name); in pfctl_load_eth_ruleset()
1910 if (pf->opts & PF_OPT_VERBOSE) in pfctl_load_eth_ruleset()
1912 if ((pf->opts & PF_OPT_NOACTION) == 0 && in pfctl_load_eth_ruleset()
1913 (error = pfctl_eth_ruleset_trans(pf, in pfctl_load_eth_ruleset()
1919 } else if (pf->opts & PF_OPT_VERBOSE) in pfctl_load_eth_ruleset()
1926 error = pfctl_load_eth_rule(pf, path, r, depth); in pfctl_load_eth_ruleset()
1931 if ((error = pfctl_load_eth_ruleset(pf, path, in pfctl_load_eth_ruleset()
1934 } else if (pf->opts & PF_OPT_VERBOSE) in pfctl_load_eth_ruleset()
1938 if (brace && pf->opts & PF_OPT_VERBOSE) { in pfctl_load_eth_ruleset()
1939 INDENT(depth - 1, (pf->opts & PF_OPT_VERBOSE)); in pfctl_load_eth_ruleset()
1951 pfctl_load_eth_rule(struct pfctl *pf, char *path, struct pfctl_eth_rule *r, in pfctl_load_eth_rule() argument
1976 if ((pf->opts & PF_OPT_NOACTION) == 0) in pfctl_load_eth_rule()
1977 if ((ret = pfctl_add_eth_rule(pf->dev, r, anchor, name, in pfctl_load_eth_rule()
1978 pf->eth_ticket)) != 0) in pfctl_load_eth_rule()
1981 if (pf->opts & PF_OPT_VERBOSE) { in pfctl_load_eth_rule()
1982 INDENT(depth, !(pf->opts & PF_OPT_VERBOSE2)); in pfctl_load_eth_rule()
1984 pf->opts & (PF_OPT_VERBOSE2 | PF_OPT_DEBUG)); in pfctl_load_eth_rule()
1993 pfctl_load_ruleset(struct pfctl *pf, char *path, struct pfctl_ruleset *rs, in pfctl_load_ruleset() argument
2000 pf->anchor = rs->anchor; in pfctl_load_ruleset()
2003 snprintf(&path[len], MAXPATHLEN - len, "/%s", pf->anchor->name); in pfctl_load_ruleset()
2005 snprintf(&path[len], MAXPATHLEN - len, "%s", pf->anchor->name); in pfctl_load_ruleset()
2010 if (pf->opts & PF_OPT_VERBOSE) in pfctl_load_ruleset()
2012 if ((pf->opts & PF_OPT_NOACTION) == 0 && in pfctl_load_ruleset()
2013 (error = pfctl_ruleset_trans(pf, in pfctl_load_ruleset()
2019 } else if (pf->opts & PF_OPT_VERBOSE) in pfctl_load_ruleset()
2024 if (pf->optimize && rs_num == PF_RULESET_FILTER) in pfctl_load_ruleset()
2025 pfctl_optimize_ruleset(pf, rs); in pfctl_load_ruleset()
2035 if ((error = pfctl_load_rule(pf, path, r, depth))) in pfctl_load_ruleset()
2038 if ((error = pfctl_load_ruleset(pf, path, in pfctl_load_ruleset()
2041 } else if (pf->opts & PF_OPT_VERBOSE) in pfctl_load_ruleset()
2045 if (brace && pf->opts & PF_OPT_VERBOSE) { in pfctl_load_ruleset()
2046 INDENT(depth - 1, (pf->opts & PF_OPT_VERBOSE)); in pfctl_load_ruleset()
2059 pfctl_load_rule(struct pfctl *pf, char *path, struct pfctl_rule *r, int depth) in pfctl_load_rule() argument
2070 if ((pf->opts & PF_OPT_NOACTION) == 0) in pfctl_load_rule()
2071 ticket = pfctl_get_ticket(pf->trans, rs_num, path); in pfctl_load_rule()
2090 if ((pf->opts & PF_OPT_NOACTION) == 0) { in pfctl_load_rule()
2091 if ((pf->opts & PF_OPT_NOACTION) == 0) { in pfctl_load_rule()
2092 if ((error = pfctl_begin_addrs(pf->h, in pfctl_load_rule()
2093 &pf->paddr.ticket)) != 0) in pfctl_load_rule()
2097 if (pfctl_add_pool(pf, &r->rdr, r->af, PF_RDR)) in pfctl_load_rule()
2099 if (pfctl_add_pool(pf, &r->nat, r->naf ? r->naf : r->af, PF_NAT)) in pfctl_load_rule()
2101 if (pfctl_add_pool(pf, &r->route, r->af, PF_RT)) in pfctl_load_rule()
2103 error = pfctl_add_rule_h(pf->h, r, anchor, name, ticket, in pfctl_load_rule()
2104 pf->paddr.ticket); in pfctl_load_rule()
2118 if (pf->opts & PF_OPT_VERBOSE) { in pfctl_load_rule()
2119 INDENT(depth, !(pf->opts & PF_OPT_VERBOSE2)); in pfctl_load_rule()
2121 pf->opts & PF_OPT_VERBOSE2, in pfctl_load_rule()
2122 pf->opts & PF_OPT_NUMERIC); in pfctl_load_rule()
2133 pfctl_add_altq(struct pfctl *pf, struct pf_altq *a) in pfctl_add_altq() argument
2137 memcpy(&pf->paltq->altq, a, sizeof(struct pf_altq)); in pfctl_add_altq()
2138 if ((pf->opts & PF_OPT_NOACTION) == 0) { in pfctl_add_altq()
2139 if (ioctl(pf->dev, DIOCADDALTQ, pf->paltq)) { in pfctl_add_altq()
2149 pfaltq_store(&pf->paltq->altq); in pfctl_add_altq()
2163 struct pfctl pf; in pfctl_rules() local
2191 memset(&pf, 0, sizeof(pf)); in pfctl_rules()
2198 pf.dev = dev; in pfctl_rules()
2199 pf.h = pfh; in pfctl_rules()
2200 pf.opts = opts; in pfctl_rules()
2201 pf.optimize = optimize; in pfctl_rules()
2202 pf.loadopt = loadopt; in pfctl_rules()
2205 if ((pf.anchor = calloc(1, sizeof(*pf.anchor))) == NULL) in pfctl_rules()
2207 rs = &pf.anchor->ruleset; in pfctl_rules()
2209 rs->anchor = pf.anchor; in pfctl_rules()
2210 if (strlcpy(pf.anchor->path, anchorname, in pfctl_rules()
2211 sizeof(pf.anchor->path)) >= sizeof(pf.anchor->path)) in pfctl_rules()
2213 if (strlcpy(pf.anchor->name, anchorname, in pfctl_rules()
2214 sizeof(pf.anchor->name)) >= sizeof(pf.anchor->name)) in pfctl_rules()
2218 pf.astack[0] = pf.anchor; in pfctl_rules()
2219 pf.asd = 0; in pfctl_rules()
2221 pf.loadopt &= ~PFCTL_FLAG_ALTQ; in pfctl_rules()
2222 pf.paltq = &pa; in pfctl_rules()
2223 pf.trans = t; in pfctl_rules()
2224 pfctl_init_options(&pf); in pfctl_rules()
2227 if ((pf.eanchor = calloc(1, sizeof(*pf.eanchor))) == NULL) in pfctl_rules()
2230 if (strlcpy(pf.eanchor->path, anchorname, in pfctl_rules()
2231 sizeof(pf.eanchor->path)) >= sizeof(pf.eanchor->path)) in pfctl_rules()
2233 if (strlcpy(pf.eanchor->name, anchorname, in pfctl_rules()
2234 sizeof(pf.eanchor->name)) >= sizeof(pf.eanchor->name)) in pfctl_rules()
2237 ethrs = &pf.eanchor->ruleset; in pfctl_rules()
2239 ethrs->anchor = pf.eanchor; in pfctl_rules()
2240 pf.eastack[0] = pf.eanchor; in pfctl_rules()
2248 if (pfctl_ruleset_trans(&pf, anchorname, pf.anchor, true)) in pfctl_rules()
2250 if (pf.loadopt & PFCTL_FLAG_ETH) in pfctl_rules()
2251 pf.eth_ticket = pfctl_get_ticket(t, PF_RULESET_ETH, anchorname); in pfctl_rules()
2252 if (altqsupport && (pf.loadopt & PFCTL_FLAG_ALTQ)) in pfctl_rules()
2255 if (pf.loadopt & PFCTL_FLAG_TABLE) in pfctl_rules()
2256 pf.astack[0]->ruleset.tticket = in pfctl_rules()
2260 if (parse_config(filename, &pf) < 0) { in pfctl_rules()
2268 pfctl_adjust_skip_ifaces(&pf); in pfctl_rules()
2270 if ((pf.loadopt & PFCTL_FLAG_FILTER && in pfctl_rules()
2271 (pfctl_load_ruleset(&pf, path, rs, PF_RULESET_SCRUB, 0))) || in pfctl_rules()
2272 (pf.loadopt & PFCTL_FLAG_ETH && in pfctl_rules()
2273 (pfctl_load_eth_ruleset(&pf, path, ethrs, 0))) || in pfctl_rules()
2274 (pf.loadopt & PFCTL_FLAG_NAT && in pfctl_rules()
2275 (pfctl_load_ruleset(&pf, path, rs, PF_RULESET_NAT, 0) || in pfctl_rules()
2276 pfctl_load_ruleset(&pf, path, rs, PF_RULESET_RDR, 0) || in pfctl_rules()
2277 pfctl_load_ruleset(&pf, path, rs, PF_RULESET_BINAT, 0))) || in pfctl_rules()
2278 (pf.loadopt & PFCTL_FLAG_FILTER && in pfctl_rules()
2279 pfctl_load_ruleset(&pf, path, rs, PF_RULESET_FILTER, 0))) { in pfctl_rules()
2286 if ((altqsupport && (pf.loadopt & PFCTL_FLAG_ALTQ) != 0)) in pfctl_rules()
2292 if (pfctl_load_anchors(dev, &pf, t) == -1) in pfctl_rules()
2297 if (pfctl_load_options(&pf)) in pfctl_rules()
2342 pfctl_init_options(struct pfctl *pf) in pfctl_init_options() argument
2345 pf->timeout[PFTM_TCP_FIRST_PACKET] = PFTM_TCP_FIRST_PACKET_VAL; in pfctl_init_options()
2346 pf->timeout[PFTM_TCP_OPENING] = PFTM_TCP_OPENING_VAL; in pfctl_init_options()
2347 pf->timeout[PFTM_TCP_ESTABLISHED] = PFTM_TCP_ESTABLISHED_VAL; in pfctl_init_options()
2348 pf->timeout[PFTM_TCP_CLOSING] = PFTM_TCP_CLOSING_VAL; in pfctl_init_options()
2349 pf->timeout[PFTM_TCP_FIN_WAIT] = PFTM_TCP_FIN_WAIT_VAL; in pfctl_init_options()
2350 pf->timeout[PFTM_TCP_CLOSED] = PFTM_TCP_CLOSED_VAL; in pfctl_init_options()
2351 pf->timeout[PFTM_SCTP_FIRST_PACKET] = PFTM_TCP_FIRST_PACKET_VAL; in pfctl_init_options()
2352 pf->timeout[PFTM_SCTP_OPENING] = PFTM_TCP_OPENING_VAL; in pfctl_init_options()
2353 pf->timeout[PFTM_SCTP_ESTABLISHED] = PFTM_TCP_ESTABLISHED_VAL; in pfctl_init_options()
2354 pf->timeout[PFTM_SCTP_CLOSING] = PFTM_TCP_CLOSING_VAL; in pfctl_init_options()
2355 pf->timeout[PFTM_SCTP_CLOSED] = PFTM_TCP_CLOSED_VAL; in pfctl_init_options()
2356 pf->timeout[PFTM_UDP_FIRST_PACKET] = PFTM_UDP_FIRST_PACKET_VAL; in pfctl_init_options()
2357 pf->timeout[PFTM_UDP_SINGLE] = PFTM_UDP_SINGLE_VAL; in pfctl_init_options()
2358 pf->timeout[PFTM_UDP_MULTIPLE] = PFTM_UDP_MULTIPLE_VAL; in pfctl_init_options()
2359 pf->timeout[PFTM_ICMP_FIRST_PACKET] = PFTM_ICMP_FIRST_PACKET_VAL; in pfctl_init_options()
2360 pf->timeout[PFTM_ICMP_ERROR_REPLY] = PFTM_ICMP_ERROR_REPLY_VAL; in pfctl_init_options()
2361 pf->timeout[PFTM_OTHER_FIRST_PACKET] = PFTM_OTHER_FIRST_PACKET_VAL; in pfctl_init_options()
2362 pf->timeout[PFTM_OTHER_SINGLE] = PFTM_OTHER_SINGLE_VAL; in pfctl_init_options()
2363 pf->timeout[PFTM_OTHER_MULTIPLE] = PFTM_OTHER_MULTIPLE_VAL; in pfctl_init_options()
2364 pf->timeout[PFTM_FRAG] = PFTM_FRAG_VAL; in pfctl_init_options()
2365 pf->timeout[PFTM_INTERVAL] = PFTM_INTERVAL_VAL; in pfctl_init_options()
2366 pf->timeout[PFTM_SRC_NODE] = PFTM_SRC_NODE_VAL; in pfctl_init_options()
2367 pf->timeout[PFTM_TS_DIFF] = PFTM_TS_DIFF_VAL; in pfctl_init_options()
2368 pf->timeout[PFTM_ADAPTIVE_START] = PFSTATE_ADAPT_START; in pfctl_init_options()
2369 pf->timeout[PFTM_ADAPTIVE_END] = PFSTATE_ADAPT_END; in pfctl_init_options()
2371 pf->limit[PF_LIMIT_STATES] = PFSTATE_HIWAT; in pfctl_init_options()
2372 pf->limit[PF_LIMIT_FRAGS] = PFFRAG_FRENT_HIWAT; in pfctl_init_options()
2373 pf->limit[PF_LIMIT_SRC_NODES] = PFSNODE_HIWAT; in pfctl_init_options()
2374 pf->limit[PF_LIMIT_TABLE_ENTRIES] = PFR_KENTRY_HIWAT; in pfctl_init_options()
2376 pf->debug = PF_DEBUG_URGENT; in pfctl_init_options()
2377 pf->reassemble = 0; in pfctl_init_options()
2379 pf->syncookies = false; in pfctl_init_options()
2380 pf->syncookieswat[0] = PF_SYNCOOKIES_LOWATPCT; in pfctl_init_options()
2381 pf->syncookieswat[1] = PF_SYNCOOKIES_HIWATPCT; in pfctl_init_options()
2385 pfctl_load_options(struct pfctl *pf) in pfctl_load_options() argument
2394 if ((pf->opts & PF_OPT_MERGE) && !pf->limit_set[i]) in pfctl_load_options()
2396 if (pfctl_load_limit(pf, i, pf->limit[i])) in pfctl_load_options()
2404 if (pf->limit_set[PF_LIMIT_STATES] && in pfctl_load_options()
2405 !pf->timeout_set[PFTM_ADAPTIVE_START] && in pfctl_load_options()
2406 !pf->timeout_set[PFTM_ADAPTIVE_END]) { in pfctl_load_options()
2407 pf->timeout[PFTM_ADAPTIVE_START] = in pfctl_load_options()
2408 (pf->limit[PF_LIMIT_STATES] / 10) * 6; in pfctl_load_options()
2409 pf->timeout_set[PFTM_ADAPTIVE_START] = 1; in pfctl_load_options()
2410 pf->timeout[PFTM_ADAPTIVE_END] = in pfctl_load_options()
2411 (pf->limit[PF_LIMIT_STATES] / 10) * 12; in pfctl_load_options()
2412 pf->timeout_set[PFTM_ADAPTIVE_END] = 1; in pfctl_load_options()
2417 if ((pf->opts & PF_OPT_MERGE) && !pf->timeout_set[i]) in pfctl_load_options()
2419 if (pfctl_load_timeout(pf, i, pf->timeout[i])) in pfctl_load_options()
2424 if (!(pf->opts & PF_OPT_MERGE) || pf->debug_set) in pfctl_load_options()
2425 if (pfctl_load_debug(pf, pf->debug)) in pfctl_load_options()
2429 if (!(pf->opts & PF_OPT_MERGE) || pf->ifname_set) in pfctl_load_options()
2430 if (pfctl_load_logif(pf, pf->ifname)) in pfctl_load_options()
2434 if (!(pf->opts & PF_OPT_MERGE) || pf->hostid_set) in pfctl_load_options()
2435 if (pfctl_load_hostid(pf, pf->hostid)) in pfctl_load_options()
2439 if (!(pf->opts & PF_OPT_MERGE) || pf->reass_set) in pfctl_load_options()
2440 if (pfctl_load_reassembly(pf, pf->reassemble)) in pfctl_load_options()
2444 if (pfctl_set_keepcounters(pf->dev, pf->keep_counters)) in pfctl_load_options()
2448 if (pfctl_load_syncookies(pf, pf->syncookies)) in pfctl_load_options()
2455 pfctl_apply_limit(struct pfctl *pf, const char *opt, unsigned int limit) in pfctl_apply_limit() argument
2462 pf->limit[pf_limits[i].index] = limit; in pfctl_apply_limit()
2463 pf->limit_set[pf_limits[i].index] = 1; in pfctl_apply_limit()
2472 if (pf->opts & PF_OPT_VERBOSE) in pfctl_apply_limit()
2479 pfctl_load_limit(struct pfctl *pf, unsigned int index, unsigned int limit) in pfctl_load_limit() argument
2481 if (pfctl_set_limit(pf->h, index, limit)) { in pfctl_load_limit()
2494 pfctl_apply_timeout(struct pfctl *pf, const char *opt, int seconds, int quiet) in pfctl_apply_timeout() argument
2503 pf->timeout[pf_timeouts[i].timeout] = seconds; in pfctl_apply_timeout()
2504 pf->timeout_set[pf_timeouts[i].timeout] = 1; in pfctl_apply_timeout()
2515 if (pf->opts & PF_OPT_VERBOSE && ! quiet) in pfctl_apply_timeout()
2522 pfctl_load_timeout(struct pfctl *pf, unsigned int timeout, unsigned int seconds) in pfctl_load_timeout() argument
2524 if (pfctl_set_timeout(pf->h, timeout, seconds)) { in pfctl_load_timeout()
2532 pfctl_set_reassembly(struct pfctl *pf, int on, int nodf) in pfctl_set_reassembly() argument
2537 pf->reass_set = 1; in pfctl_set_reassembly()
2539 pf->reassemble = PF_REASS_ENABLED; in pfctl_set_reassembly()
2541 pf->reassemble |= PF_REASS_NODF; in pfctl_set_reassembly()
2543 pf->reassemble = 0; in pfctl_set_reassembly()
2546 if (pf->opts & PF_OPT_VERBOSE) in pfctl_set_reassembly()
2554 pfctl_set_optimization(struct pfctl *pf, const char *opt) in pfctl_set_optimization() argument
2573 if ((r = pfctl_apply_timeout(pf, hint[i].name, in pfctl_set_optimization()
2577 if (pf->opts & PF_OPT_VERBOSE) in pfctl_set_optimization()
2584 pfctl_set_logif(struct pfctl *pf, char *ifname) in pfctl_set_logif() argument
2591 free(pf->ifname); in pfctl_set_logif()
2592 pf->ifname = NULL; in pfctl_set_logif()
2594 pf->ifname = strdup(ifname); in pfctl_set_logif()
2595 if (!pf->ifname) in pfctl_set_logif()
2598 pf->ifname_set = 1; in pfctl_set_logif()
2600 if (pf->opts & PF_OPT_VERBOSE) in pfctl_set_logif()
2607 pfctl_load_logif(struct pfctl *pf, char *ifname) in pfctl_load_logif() argument
2617 pfctl_set_hostid(struct pfctl *pf, u_int32_t hostid) in pfctl_set_hostid() argument
2624 pf->hostid = hostid; in pfctl_set_hostid()
2625 pf->hostid_set = 1; in pfctl_set_hostid()
2627 if (pf->opts & PF_OPT_VERBOSE) in pfctl_set_hostid()
2632 pfctl_load_hostid(struct pfctl *pf, u_int32_t hostid) in pfctl_load_hostid() argument
2642 pfctl_load_reassembly(struct pfctl *pf, u_int32_t reassembly) in pfctl_load_reassembly() argument
2652 pfctl_load_syncookies(struct pfctl *pf, u_int8_t val) in pfctl_load_syncookies() argument
2659 cookies.lowwater = pf->syncookieswat[0]; in pfctl_load_syncookies()
2660 cookies.highwater = pf->syncookieswat[1]; in pfctl_load_syncookies()
2670 pfctl_cfg_syncookies(struct pfctl *pf, uint8_t val, struct pfctl_watermarks *w) in pfctl_cfg_syncookies() argument
2685 pf->syncookieswat[0] = w->lo; in pfctl_cfg_syncookies()
2686 pf->syncookieswat[1] = w->hi; in pfctl_cfg_syncookies()
2687 pf->syncookieswat_set = 1; in pfctl_cfg_syncookies()
2690 if (pf->opts & PF_OPT_VERBOSE) { in pfctl_cfg_syncookies()
2696 if (pf->syncookieswat_set) in pfctl_cfg_syncookies()
2698 "end %u%%)\n", pf->syncookieswat[1], in pfctl_cfg_syncookies()
2699 pf->syncookieswat[0]); in pfctl_cfg_syncookies()
2708 pf->syncookies = val; in pfctl_cfg_syncookies()
2713 pfctl_do_set_debug(struct pfctl *pf, char *d) in pfctl_do_set_debug() argument
2722 pf->debug = PF_DEBUG_NONE; in pfctl_do_set_debug()
2724 pf->debug = PF_DEBUG_URGENT; in pfctl_do_set_debug()
2726 pf->debug = PF_DEBUG_MISC; in pfctl_do_set_debug()
2728 pf->debug = PF_DEBUG_NOISY; in pfctl_do_set_debug()
2734 pf->debug_set = 1; in pfctl_do_set_debug()
2735 level = pf->debug; in pfctl_do_set_debug()
2737 if ((pf->opts & PF_OPT_NOACTION) == 0) in pfctl_do_set_debug()
2741 if (pf->opts & PF_OPT_VERBOSE) in pfctl_do_set_debug()
2748 pfctl_load_debug(struct pfctl *pf, unsigned int level) in pfctl_load_debug() argument
2750 if (pfctl_set_debug(pf->h, level)) { in pfctl_load_debug()
2758 pfctl_set_interface_flags(struct pfctl *pf, char *ifname, int flags, int how) in pfctl_set_interface_flags() argument
2774 pfctl_set_interface_flags(pf, n->ifname, flags, how); in pfctl_set_interface_flags()
2780 if ((pf->opts & PF_OPT_NOACTION) == 0) { in pfctl_set_interface_flags()
2782 if (ioctl(pf->dev, DIOCCLRIFFLAG, &pi)) in pfctl_set_interface_flags()
2785 if (ioctl(pf->dev, DIOCSETIFFLAG, &pi)) in pfctl_set_interface_flags()