Home
last modified time | relevance | path

Searched refs:npc (Results 1 – 25 of 111) sorted by relevance

12345

/netbsd/sys/net/npf/
H A Dnpf_inet.c342 npf_recache(npc); in npf_fetch_tcpopts()
418 npf_recache(npc); in npf_set_mss()
464 npc->npc_ip.v4 = ip; in npf_cache_ip()
488 npc->npc_hlen = hlen; in npf_cache_ip()
555 npc->npc_ip.v6 = ip6; in npf_cache_ip()
577 npc->npc_l4.tcp = th; in npf_cache_tcp()
610 hlen = npc->npc_hlen; in npf_cache_all()
676 npc->npc_info = 0; in npf_recache()
692 memcpy(npc->npc_ips[which], addr, npc->npc_alen); in npf_rwrip()
705 KASSERT(npf_iscached(npc, NPC_TCP) || npf_iscached(npc, NPC_UDP)); in npf_rwrport()
[all …]
H A Dnpf_alg_icmp.c76 const int proto = npc->npc_proto; in npfa_icmp_match()
129 nbuf_t *nbuf = npc->npc_nbuf; in npfa_icmp4_inspect()
162 nbuf_t *nbuf = npc->npc_nbuf; in npfa_icmp6_inspect()
195 nbuf_t *nbuf = npc->npc_nbuf; in npfa_icmp_inspect()
207 enpc->npc_ctx = npc->npc_ctx; in npfa_icmp_inspect()
231 npc->npc_info |= NPC_ICMP_ID; in npfa_icmp_inspect()
311 npf_recache(npc); in npfa_icmp_conn()
333 ic = npc->npc_l4.icmp; in npfa_icmp_nat()
436 npf_recache(npc); in npfa_icmp_nat()
438 ic = npc->npc_l4.icmp; in npfa_icmp_nat()
[all …]
H A Dnpf_sendpkt.c92 npf_return_tcp(npf_cache_t *npc) in npf_return_tcp() argument
94 npf_t *npf = npc->npc_ctx; in npf_return_tcp()
107 oth = npc->npc_l4.tcp; in npf_return_tcp()
114 if (npf_iscached(npc, NPC_IP4)) { in npf_return_tcp()
132 if (npf_iscached(npc, NPC_IP4)) { in npf_return_tcp()
133 struct ip *oip = npc->npc_ip.v4; in npf_return_tcp()
178 if (npf_iscached(npc, NPC_IP4)) { in npf_return_tcp()
248 if (!npf_iscached(npc, NPC_IP46) || !npf_iscached(npc, NPC_LAYER4)) { in npf_return_block()
251 switch (npc->npc_proto) { in npf_return_block()
254 (void)npf_return_tcp(npc); in npf_return_block()
[all …]
H A Dnpf_nat.c415 npf_t *npf = npc->npc_ctx; in npf_nat_inspect()
464 npc->npc_ips[NPF_SRC], in npf_nat_getaddr()
465 npc->npc_ips[NPF_DST]); in npf_nat_getaddr()
482 npf_t *npf = npc->npc_ctx; in npf_nat_create()
608 npf_alg_exec(npc, nt, flow); in npf_dnat_translate()
609 npf_recache(npc); in npf_dnat_translate()
718 nbuf_t *nbuf = npc->npc_nbuf; in npf_do_nat()
726 if (!npf_iscached(npc, NPC_IP46) || !npf_iscached(npc, NPC_LAYER4)) { in npf_do_nat()
745 np = npf_nat_inspect(npc, di); in npf_do_nat()
755 npf_recache(npc); in npf_do_nat()
[all …]
H A Dnpf_handler.c84 nbuf_t *nbuf = npc->npc_nbuf; in npf_reassembly()
122 npc->npc_info = 0; in npf_reassembly()
147 npf_cache_t npc; in npfk_packet_handler() local
162 memset(&npc, 0, sizeof(npf_cache_t)); in npfk_packet_handler()
163 npc.npc_ctx = npf; in npfk_packet_handler()
164 npc.npc_nbuf = &nbuf; in npfk_packet_handler()
177 flags = npf_cache_all(&npc); in npfk_packet_handler()
188 error = npf_reassembly(npf, &npc, &mff); in npfk_packet_handler()
204 con = npf_conn_inspect(&npc, di, &error); in npfk_packet_handler()
257 con = npf_conn_establish(&npc, di, in npfk_packet_handler()
[all …]
H A Dnpf_bpf.c87 nbuf_t *nbuf = npc->npc_nbuf; in npf_bpf_prepare()
101 args->arg = npc; in npf_bpf_prepare()
111 const u_int alen = npc->npc_alen; in npf_bpf_prepare()
121 M[BPF_MW_L4OFF] = npc->npc_hlen; in npf_bpf_prepare()
122 M[BPF_MW_L4PROTO] = npc->npc_proto; in npf_bpf_prepare()
157 const uint32_t ver = (npc->npc_alen & 4) | ((npc->npc_alen >> 4) * 6); in npf_cop_l3()
161 M[BPF_MW_L4OFF] = npc->npc_hlen; in npf_cop_l3()
162 M[BPF_MW_L4PROTO] = npc->npc_proto; in npf_cop_l3()
177 npf_tableset_t *tblset = npf_config_tableset(npc->npc_ctx); in npf_cop_table()
182 if (!npf_iscached(npc, NPC_IP46)) { in npf_cop_table()
[all …]
H A Dnpf_ext_normalize.c103 npf_normalize_ip4(npf_cache_t *npc, npf_normalize_t *np) in npf_normalize_ip4() argument
105 struct ip *ip = npc->npc_ip.v4; in npf_normalize_ip4()
144 npf_normalize(npf_cache_t *npc, void *params, const npf_match_info_t *mi, in npf_normalize() argument
160 if (npf_iscached(npc, NPC_IP4) && (np->n_random_id || np->n_minttl)) { in npf_normalize()
161 npf_normalize_ip4(npc, np); in npf_normalize()
163 th = npc->npc_l4.tcp; in npf_normalize()
169 if (maxmss == 0 || !npf_iscached(npc, NPC_TCP) || in npf_normalize()
175 if (!npf_fetch_tcpopts(npc, &mss, &wscale)) { in npf_normalize()
191 if (npf_set_mss(npc, maxmss, old, new, &mid) && in npf_normalize()
192 !nbuf_cksum_barrier(npc->npc_nbuf, mi->mi_di)) { in npf_normalize()
[all …]
H A Dnpf_conn.c259 const npf_t *npf = npc->npc_ctx; in npf_conn_trackable_p()
268 if (!npf_iscached(npc, NPC_IP46) || !npf_iscached(npc, NPC_LAYER4)) { in npf_conn_trackable_p()
328 npf_t *npf = npc->npc_ctx; in npf_conn_lookup()
329 const nbuf_t *nbuf = npc->npc_nbuf; in npf_conn_lookup()
362 nbuf_t *nbuf = npc->npc_nbuf; in npf_conn_inspect()
368 if (!npf_conn_trackable_p(npc)) { in npf_conn_inspect()
426 npf_t *npf = npc->npc_ctx; in npf_conn_establish()
429 const nbuf_t *nbuf = npc->npc_nbuf; in npf_conn_establish()
437 if (!npf_conn_trackable_p(npc)) { in npf_conn_establish()
456 con->c_proto = npc->npc_proto; in npf_conn_establish()
[all …]
H A Dnpf_connkey.c230 const nbuf_t *nbuf = npc->npc_nbuf; in npf_conn_conkey()
231 const unsigned proto = npc->npc_proto; in npf_conn_conkey()
232 const unsigned alen = npc->npc_alen; in npf_conn_conkey()
238 if (npc->npc_ckey) { in npf_conn_conkey()
248 KASSERT(npf_iscached(npc, NPC_TCP)); in npf_conn_conkey()
249 th = npc->npc_l4.tcp; in npf_conn_conkey()
254 KASSERT(npf_iscached(npc, NPC_UDP)); in npf_conn_conkey()
255 uh = npc->npc_l4.udp; in npf_conn_conkey()
260 if (npf_iscached(npc, NPC_ICMP_ID)) { in npf_conn_conkey()
261 const struct icmp *ic = npc->npc_l4.icmp; in npf_conn_conkey()
[all …]
H A Dnpf_state_tcp.c295 const struct tcphdr * const th = npc->npc_l4.tcp; in npf_tcp_inwindow()
302 params = npc->npc_ctx->params[NPF_PARAMS_TCP_STATE]; in npf_tcp_inwindow()
303 KASSERT(npf_iscached(npc, NPC_TCP)); in npf_tcp_inwindow()
323 tcpdlen = npf_tcpsaw(__UNCONST(npc), &seq, &ack, &win); in npf_tcp_inwindow()
358 (void)npf_fetch_tcpopts(npc, NULL, &fstate->nst_wscale); in npf_tcp_inwindow()
378 (void)npf_fetch_tcpopts(npc, NULL, &fstate->nst_wscale); in npf_tcp_inwindow()
408 npf_stats_inc(npc->npc_ctx, NPF_STAT_INVALID_STATE_TCP1); in npf_tcp_inwindow()
414 npf_stats_inc(npc->npc_ctx, NPF_STAT_INVALID_STATE_TCP2); in npf_tcp_inwindow()
425 npf_stats_inc(npc->npc_ctx, NPF_STAT_INVALID_STATE_TCP3); in npf_tcp_inwindow()
460 const struct tcphdr * const th = npc->npc_l4.tcp; in npf_state_tcp()
[all …]
H A Dnpf_state.c145 npf_state_init(npf_cache_t *npc, npf_state_t *nst) in npf_state_init() argument
147 const int proto = npc->npc_proto; in npf_state_init()
150 KASSERT(npf_iscached(npc, NPC_IP46)); in npf_state_init()
151 KASSERT(npf_iscached(npc, NPC_LAYER4)); in npf_state_init()
158 ret = npf_state_tcp(npc, nst, NPF_FLOW_FORW); in npf_state_init()
187 npf_state_inspect(npf_cache_t *npc, npf_state_t *nst, const npf_flow_t flow) in npf_state_inspect() argument
189 const int proto = npc->npc_proto; in npf_state_inspect()
195 ret = npf_state_tcp(npc, nst, flow); in npf_state_inspect()
H A Dnpf_alg.c219 npf_alg_match(npf_cache_t *npc, npf_nat_t *nt, int di) in npf_alg_match() argument
221 npf_t *npf = npc->npc_ctx; in npf_alg_match()
227 KASSERTMSG(npf_iscached(npc, NPC_IP46), "expecting protocol number"); in npf_alg_match()
236 if (match_func && match_func(npc, nt, di)) { in npf_alg_match()
255 npf_alg_exec(npf_cache_t *npc, npf_nat_t *nt, const npf_flow_t flow) in npf_alg_exec() argument
257 npf_t *npf = npc->npc_ctx; in npf_alg_exec()
270 translate_func(npc, nt, flow); in npf_alg_exec()
294 npf_alg_conn(npf_cache_t *npc, int di) in npf_alg_conn() argument
296 npf_t *npf = npc->npc_ctx; in npf_alg_conn()
309 if (inspect_func && (con = inspect_func(npc, di)) != NULL) { in npf_alg_conn()
H A Dnpf_ext_log.c83 npf_log(npf_cache_t *npc, void *meta, const npf_match_info_t *mi, int *decision) in npf_log() argument
85 struct mbuf *m = nbuf_head_mbuf(npc->npc_nbuf); in npf_log()
93 if (npf_iscached(npc, NPC_IP4)) { in npf_log()
95 } else if (npf_iscached(npc, NPC_IP6)) { in npf_log()
106 struct nbuf *nb = npc->npc_nbuf; in npf_log()
107 npf_ifmap_copyname(npc->npc_ctx, nb ? nb->nb_ifid : 0, in npf_log()
/netbsd/usr.sbin/npf/npftest/libnpftest/
H A Dnpf_nat_test.c168 npf_cache_t npc; in checkresult() local
179 memset(&npc, 0, sizeof(npf_cache_t)); in checkresult()
180 npc.npc_ctx = npf_getkernctx(); in checkresult()
181 npc.npc_nbuf = &nbuf; in checkresult()
183 if (!npf_cache_all(&npc)) { in checkresult()
188 const struct udphdr *uh = npc.npc_l4.udp; in checkresult()
193 npf_inet_ntop(af, npc.npc_ips[NPF_SRC], sbuf, sizeof(sbuf)); in checkresult()
194 npf_inet_ntop(af, npc.npc_ips[NPF_DST], dbuf, sizeof(dbuf)); in checkresult()
210 CHECK_TRUE(match_addr(af, saddr, npc.npc_ips[NPF_SRC])); in checkresult()
212 CHECK_TRUE(match_addr(af, daddr, npc.npc_ips[NPF_DST])); in checkresult()
H A Dnpf_mbuf_subr.c310 npf_cache_t *npc = kmem_zalloc(sizeof(npf_cache_t), KM_SLEEP); in get_cached_pkt() local
314 npc->npc_info = 0; in get_cached_pkt()
315 npc->npc_ctx = npf_getkernctx(); in get_cached_pkt()
317 nbuf_init(npc->npc_ctx, nbuf, m, ifp); in get_cached_pkt()
318 npc->npc_nbuf = nbuf; in get_cached_pkt()
319 ret = npf_cache_all(npc); in get_cached_pkt()
322 return npc; in get_cached_pkt()
326 put_cached_pkt(npf_cache_t *npc) in put_cached_pkt() argument
328 struct mbuf *m = nbuf_head_mbuf(npc->npc_nbuf); in put_cached_pkt()
329 kmem_free(npc->npc_nbuf, sizeof(nbuf_t)); in put_cached_pkt()
[all …]
H A Dnpf_bpf_test.c50 npf_cache_t *npc; in test_bpf_code() local
58 npc = get_cached_pkt(m, NULL); in test_bpf_code()
60 bc_args.pkt = (const uint8_t *)nbuf_dataptr(npc->npc_nbuf); in test_bpf_code()
67 bc_args.arg = npc; in test_bpf_code()
80 put_cached_pkt(npc); in test_bpf_code()
H A Dnpf_state_test.c137 npf_cache_t *npc; in process_packet() local
146 npc = get_cached_pkt(construct_packet(p), NULL); in process_packet()
148 ret = npf_state_init(npc, nst); in process_packet()
152 ret = npf_state_inspect(npc, nst, in process_packet()
154 put_cached_pkt(npc); in process_packet()
H A Dnpf_rule_test.c63 npf_cache_t *npc; in run_raw_testcase() local
69 npc = get_cached_pkt(m, t->ifname); in run_raw_testcase()
72 rl = npf_ruleset_inspect(npc, npf_config_ruleset(npf), t->di, NPF_LAYER_3); in run_raw_testcase()
81 put_cached_pkt(npc); in run_raw_testcase()
/netbsd/external/gpl3/binutils/dist/gprofng/libcollector/
H A Dunwind.c1602 if (npc == 0) in cache_get()
1720 if (npc == 0) in process_return_real()
1857 npc -= 5; in is_after_ret()
1861 if (*(npc - 1) != 0xc3 || *(npc - 2) != 0xc9) in is_after_ret()
2132 npc = check_modrm (npc); // pc next to "jmp reg" instruction in find_i386_ret_addr()
4064 if (npc == 0) in find_i386_ret_addr()
4188 if (npc == 0) in adjust_ret_addr()
4214 npc = ra; in adjust_ret_addr()
4270 npc = ra - 19; in adjust_ret_addr()
4279 npc = ra - 4; in adjust_ret_addr()
[all …]
/netbsd/sys/arch/sparc64/dev/
H A Dpyro.c442 pci_chipset_tag_t npc; in pyro_alloc_chipset() local
444 npc = kmem_alloc(sizeof *npc, KM_SLEEP); in pyro_alloc_chipset()
445 memcpy(npc, pc, sizeof *pc); in pyro_alloc_chipset()
446 npc->cookie = pbm; in pyro_alloc_chipset()
447 npc->rootnode = node; in pyro_alloc_chipset()
448 npc->spc_conf_read = pyro_conf_read; in pyro_alloc_chipset()
449 npc->spc_conf_write = pyro_conf_write; in pyro_alloc_chipset()
450 npc->spc_intr_map = pyro_intr_map; in pyro_alloc_chipset()
451 npc->spc_intr_establish = pyro_pci_intr_establish; in pyro_alloc_chipset()
452 npc->spc_find_ino = NULL; in pyro_alloc_chipset()
[all …]
H A Dvpci.c465 pci_chipset_tag_t npc; in vpci_alloc_chipset() local
467 npc = kmem_alloc(sizeof *npc, KM_SLEEP); in vpci_alloc_chipset()
468 memcpy(npc, pc, sizeof *pc); in vpci_alloc_chipset()
469 npc->cookie = pbm; in vpci_alloc_chipset()
470 npc->rootnode = node; in vpci_alloc_chipset()
471 npc->spc_conf_read = vpci_conf_read; in vpci_alloc_chipset()
472 npc->spc_conf_write = vpci_conf_write; in vpci_alloc_chipset()
473 npc->spc_intr_map = vpci_intr_map; in vpci_alloc_chipset()
474 npc->spc_intr_establish = vpci_pci_intr_establish; in vpci_alloc_chipset()
475 npc->spc_find_ino = NULL; in vpci_alloc_chipset()
[all …]
/netbsd/external/gpl3/gdb/dist/sim/common/
H A Dcgen-engine.h205 IADDR npc = 0; /* assign a value for -Wall */ \
214 pbb_br_npc = npc; \
220 CPU_PBB_BR_NPC (current_cpu) = npc; \
227 npc = (newval); \
233 npc = (newval); \
/netbsd/external/gpl3/gdb.old/dist/sim/common/
H A Dcgen-engine.h205 IADDR npc = 0; /* assign a value for -Wall */ \
214 pbb_br_npc = npc; \
220 CPU_PBB_BR_NPC (current_cpu) = npc; \
227 npc = (newval); \
233 npc = (newval); \
/netbsd/external/gpl3/gdb/dist/sim/erc32/
H A Dinterf.c91 if (sregs->pc == 0 || sregs->npc == 0)
98 sregs->pc, sregs->npc,
108 sregs->pc = sregs->npc;
109 sregs->npc = sregs->npc + 4;
302 sregs.npc = sregs.pc + 4;
/netbsd/external/gpl3/gdb.old/dist/sim/erc32/
H A Dinterf.c91 if (sregs->pc == 0 || sregs->npc == 0)
98 sregs->pc, sregs->npc,
108 sregs->pc = sregs->npc;
109 sregs->npc = sregs->npc + 4;
302 sregs.npc = sregs.pc + 4;

12345