Searched refs:npc (Results 1 - 25 of 80) sorted by relevance

1234

/netbsd-current/sys/net/npf/
H A Dnpf_inet.c250 npf_tcpsaw(const npf_cache_t *npc, tcp_seq *seq, tcp_seq *ack, uint32_t *win) argument
252 const struct tcphdr *th = npc->npc_l4.tcp;
255 KASSERT(npf_iscached(npc, NPC_TCP));
262 if (npf_iscached(npc, NPC_IP4)) {
263 const struct ip *ip = npc->npc_ip.v4;
264 return ntohs(ip->ip_len) - npc->npc_hlen - thlen;
265 } else if (npf_iscached(npc, NPC_IP6)) {
266 const struct ip6_hdr *ip6 = npc->npc_ip.v6;
268 (npc->npc_hlen - sizeof(*ip6)) - thlen;
277 npf_fetch_tcpopts(npf_cache_t *npc, uint16_ argument
351 npf_set_mss(npf_cache_t *npc, uint16_t mss, uint16_t *old, uint16_t *new, bool *mid) argument
424 npf_cache_ip(npf_cache_t *npc, nbuf_t *nbuf) argument
566 npf_cache_tcp(npf_cache_t *npc, nbuf_t *nbuf, unsigned hlen) argument
588 npf_cache_all(npf_cache_t *npc) argument
669 npf_recache(npf_cache_t *npc) argument
687 npf_rwrip(const npf_cache_t *npc, u_int which, const npf_addr_t *addr) argument
700 npf_rwrport(const npf_cache_t *npc, u_int which, const in_port_t port) argument
725 npf_rwrcksum(const npf_cache_t *npc, u_int which, const npf_addr_t *addr, const in_port_t port) argument
795 npf_napt_rwr(const npf_cache_t *npc, u_int which, const npf_addr_t *addr, const in_addr_t port) argument
839 npf_npt66_rwr(const npf_cache_t *npc, u_int which, const npf_addr_t *pref, npf_netmask_t len, uint16_t adj) argument
[all...]
H A Dnpf_sendpkt.c60 #define m_freem(m) (npc)->npc_ctx->mbufops->free(m)
61 #define mtod(m,t) ((t)((npc)->npc_ctx->mbufops->getdata(m)))
73 npf_ip6_setscope(const npf_cache_t *npc, struct ip6_hdr *ip6) argument
75 const struct ifnet *rcvif = npc->npc_nbuf->nb_ifp;
92 npf_return_tcp(npf_cache_t *npc) argument
94 npf_t *npf = npc->npc_ctx;
104 KASSERT(npf_iscached(npc, NPC_IP46));
105 KASSERT(npf_iscached(npc, NPC_LAYER4));
106 tcpdlen = npf_tcpsaw(npc, &seq, &ack, &win);
107 oth = npc
217 npf_return_icmp(const npf_cache_t *npc) argument
246 npf_return_block(npf_cache_t *npc, const int retfl) argument
[all...]
H A Dnpf_alg_icmp.c74 npfa_icmp_match(npf_cache_t *npc, npf_nat_t *nt, int di) argument
76 const int proto = npc->npc_proto;
77 const struct ip *ip = npc->npc_ip.v4;
80 KASSERT(npf_iscached(npc, NPC_IP46));
81 KASSERT(npf_iscached(npc, NPC_LAYER4));
90 const struct tcphdr *th = npc->npc_l4.tcp;
95 const struct udphdr *uh = npc->npc_l4.udp;
123 * the nbuf nor npc is touched.
127 npfa_icmp4_inspect(const int type, npf_cache_t *npc, bool *hasqid) argument
129 nbuf_t *nbuf = npc
160 npfa_icmp6_inspect(const int type, npf_cache_t *npc, bool *hasqid) argument
193 npfa_icmp_inspect(npf_cache_t *npc, npf_cache_t *enpc) argument
238 npfa_icmp_conn(npf_cache_t *npc, int di) argument
320 npfa_icmp_nat(npf_cache_t *npc, npf_nat_t *nt, npf_flow_t flow) argument
[all...]
H A Dnpf_bpf.c85 npf_bpf_prepare(npf_cache_t *npc, bpf_args_t *args, uint32_t *M) argument
87 nbuf_t *nbuf = npc->npc_nbuf;
101 args->arg = npc;
111 const u_int alen = npc->npc_alen;
121 M[BPF_MW_L4OFF] = npc->npc_hlen;
122 M[BPF_MW_L4PROTO] = npc->npc_proto;
156 const npf_cache_t * const npc = (const npf_cache_t *)args->arg; local
157 const uint32_t ver = (npc->npc_alen & 4) | ((npc->npc_alen >> 4) * 6);
161 M[BPF_MW_L4OFF] = npc
176 const npf_cache_t * const npc = (const npf_cache_t *)args->arg; local
[all...]
H A Dnpf_handler.c82 npf_reassembly(npf_t *npf, npf_cache_t *npc, bool *mff) argument
84 nbuf_t *nbuf = npc->npc_nbuf;
91 if (npf_iscached(npc, NPC_IP4) && npf->ip4_reassembly) {
93 } else if (npf_iscached(npc, NPC_IP6) && npf->ip6_reassembly) {
94 error = ip6_reass_packet(&m, npc->npc_hlen);
122 npc->npc_info = 0;
124 if (npf_cache_all(npc) & (NPC_IPFRAG|NPC_FMTERR)) {
147 npf_cache_t npc; local
162 memset(&npc, 0, sizeof(npf_cache_t));
163 npc
[all...]
H A Dnpf_ext_normalize.c103 npf_normalize_ip4(npf_cache_t *npc, npf_normalize_t *np) argument
105 struct ip *ip = npc->npc_ip.v4;
144 npf_normalize(npf_cache_t *npc, void *params, const npf_match_info_t *mi, argument
160 if (npf_iscached(npc, NPC_IP4) && (np->n_random_id || np->n_minttl)) {
161 npf_normalize_ip4(npc, np);
163 th = npc->npc_l4.tcp;
169 if (maxmss == 0 || !npf_iscached(npc, NPC_TCP) ||
175 if (!npf_fetch_tcpopts(npc, &mss, &wscale)) {
191 if (npf_set_mss(npc, maxmss, old, new, &mid) &&
192 !nbuf_cksum_barrier(npc
[all...]
H A Dnpf_nat.c413 npf_nat_inspect(npf_cache_t *npc, const unsigned di) argument
415 npf_t *npf = npc->npc_ctx;
421 rl = npf_ruleset_inspect(npc, rlset, di, NPF_LAYER_3);
433 npf_nat_algo_netmap(const npf_cache_t *npc, const npf_natpolicy_t *np, argument
436 const npf_addr_t *orig_addr = npc->npc_ips[which];
443 npf_addr_mask(&np->n_taddr, np->n_tmask, npc->npc_alen, addr);
444 npf_addr_bitor(orig_addr, np->n_tmask, npc->npc_alen, addr);
448 npf_nat_getaddr(npf_cache_t *npc, npf_natpolicy_t *np, const unsigned alen) argument
464 npc->npc_ips[NPF_SRC],
465 npc
477 npf_nat_create(npf_cache_t *npc, npf_natpolicy_t *np, npf_conn_t *con) argument
584 npf_dnat_translate(npf_cache_t *npc, npf_nat_t *nt, npf_flow_t flow) argument
621 npf_snat_translate(npf_cache_t *npc, const npf_natpolicy_t *np, npf_flow_t flow) argument
648 npf_nat_share_policy(npf_cache_t *npc, npf_conn_t *con, npf_nat_t *src_nt) argument
678 npf_nat_lookup(const npf_cache_t *npc, npf_conn_t *con, const unsigned di, npf_flow_t *flow) argument
716 npf_do_nat(npf_cache_t *npc, npf_conn_t *con, const unsigned di) argument
[all...]
H A Dnpf_state.c145 npf_state_init(npf_cache_t *npc, npf_state_t *nst) argument
147 const int proto = npc->npc_proto;
150 KASSERT(npf_iscached(npc, NPC_IP46));
151 KASSERT(npf_iscached(npc, NPC_LAYER4));
158 ret = npf_state_tcp(npc, nst, NPF_FLOW_FORW);
187 npf_state_inspect(npf_cache_t *npc, npf_state_t *nst, const npf_flow_t flow) argument
189 const int proto = npc->npc_proto;
195 ret = npf_state_tcp(npc, nst, flow);
H A Dnpf_connkey.c226 npf_conn_conkey(const npf_cache_t *npc, npf_connkey_t *key, argument
229 const npf_conn_params_t *params = npc->npc_ctx->params[NPF_PARAMS_CONN];
230 const nbuf_t *nbuf = npc->npc_nbuf;
231 const unsigned proto = npc->npc_proto;
232 const unsigned alen = npc->npc_alen;
238 if (npc->npc_ckey) {
243 return npf_connkey_copy(npc->npc_ckey, key, invert);
248 KASSERT(npf_iscached(npc, NPC_TCP));
249 th = npc->npc_l4.tcp;
254 KASSERT(npf_iscached(npc, NPC_UD
[all...]
H A Dnpf_alg.c219 npf_alg_match(npf_cache_t *npc, npf_nat_t *nt, int di) argument
221 npf_t *npf = npc->npc_ctx;
227 KASSERTMSG(npf_iscached(npc, NPC_IP46), "expecting protocol number");
236 if (match_func && match_func(npc, nt, di)) {
255 npf_alg_exec(npf_cache_t *npc, npf_nat_t *nt, const npf_flow_t flow) argument
257 npf_t *npf = npc->npc_ctx;
270 translate_func(npc, nt, flow);
294 npf_alg_conn(npf_cache_t *npc, int di) argument
296 npf_t *npf = npc->npc_ctx;
309 if (inspect_func && (con = inspect_func(npc, d
[all...]
H A Dnpf_state_tcp.c292 npf_tcp_inwindow(npf_cache_t *npc, npf_state_t *nst, const npf_flow_t flow) argument
295 const struct tcphdr * const th = npc->npc_l4.tcp;
302 params = npc->npc_ctx->params[NPF_PARAMS_TCP_STATE];
303 KASSERT(npf_iscached(npc, NPC_TCP));
323 tcpdlen = npf_tcpsaw(__UNCONST(npc), &seq, &ack, &win);
358 (void)npf_fetch_tcpopts(npc, NULL, &fstate->nst_wscale);
378 (void)npf_fetch_tcpopts(npc, NULL, &fstate->nst_wscale);
408 npf_stats_inc(npc->npc_ctx, NPF_STAT_INVALID_STATE_TCP1);
414 npf_stats_inc(npc->npc_ctx, NPF_STAT_INVALID_STATE_TCP2);
425 npf_stats_inc(npc
458 npf_state_tcp(npf_cache_t *npc, npf_state_t *nst, npf_flow_t flow) argument
[all...]
H A Dnpf_ext_log.c83 npf_log(npf_cache_t *npc, void *meta, const npf_match_info_t *mi, int *decision) argument
85 struct mbuf *m = nbuf_head_mbuf(npc->npc_nbuf);
93 if (npf_iscached(npc, NPC_IP4)) {
95 } else if (npf_iscached(npc, NPC_IP6)) {
106 struct nbuf *nb = npc->npc_nbuf;
107 npf_ifmap_copyname(npc->npc_ctx, nb ? nb->nb_ifid : 0,
H A Dnpf_conn.c257 npf_conn_trackable_p(const npf_cache_t *npc) argument
259 const npf_t *npf = npc->npc_ctx;
268 if (!npf_iscached(npc, NPC_IP46) || !npf_iscached(npc, NPC_LAYER4)) {
326 npf_conn_lookup(const npf_cache_t *npc, const unsigned di, npf_flow_t *flow) argument
328 npf_t *npf = npc->npc_ctx;
329 const nbuf_t *nbuf = npc->npc_nbuf;
334 if (!npf_conn_conkey(npc, &key, di, NPF_FLOW_FORW)) {
341 KASSERT(npc->npc_proto == atomic_load_relaxed(&con->c_proto));
360 npf_conn_inspect(npf_cache_t *npc, cons argument
424 npf_conn_establish(npf_cache_t *npc, const unsigned di, bool global) argument
560 npf_conn_setnat(const npf_cache_t *npc, npf_conn_t *con, npf_nat_t *nt, unsigned ntype) argument
[all...]
H A Dnpf_rproc.c366 npf_rproc_run(npf_cache_t *npc, npf_rproc_t *rp, const npf_match_info_t *mi, argument
371 KASSERT(!nbuf_flag_p(npc->npc_nbuf, NBUF_DATAREF_RESET));
380 if (!extops->proc(npc, rp->rp_ext_meta[i], mi, decision)) {
384 if (nbuf_flag_p(npc->npc_nbuf, NBUF_DATAREF_RESET)) {
385 npf_recache(npc);
/netbsd-current/usr.sbin/npf/npftest/libnpftest/
H A Dnpf_bpf_test.c50 npf_cache_t *npc; local
58 npc = get_cached_pkt(m, NULL);
60 bc_args.pkt = (const uint8_t *)nbuf_dataptr(npc->npc_nbuf);
67 bc_args.arg = npc;
80 put_cached_pkt(npc);
H A Dnpf_nat_test.c168 npf_cache_t npc; local
179 memset(&npc, 0, sizeof(npf_cache_t));
180 npc.npc_ctx = npf_getkernctx();
181 npc.npc_nbuf = &nbuf;
183 if (!npf_cache_all(&npc)) {
188 const struct udphdr *uh = npc.npc_l4.udp;
193 npf_inet_ntop(af, npc.npc_ips[NPF_SRC], sbuf, sizeof(sbuf));
194 npf_inet_ntop(af, npc.npc_ips[NPF_DST], dbuf, sizeof(dbuf));
210 CHECK_TRUE(match_addr(af, saddr, npc.npc_ips[NPF_SRC]));
212 CHECK_TRUE(match_addr(af, daddr, npc
[all...]
H A Dnpf_mbuf_subr.c310 npf_cache_t *npc = kmem_zalloc(sizeof(npf_cache_t), KM_SLEEP); local
314 npc->npc_info = 0;
315 npc->npc_ctx = npf_getkernctx();
317 nbuf_init(npc->npc_ctx, nbuf, m, ifp);
318 npc->npc_nbuf = nbuf;
319 ret = npf_cache_all(npc);
322 return npc;
326 put_cached_pkt(npf_cache_t *npc) argument
328 struct mbuf *m = nbuf_head_mbuf(npc->npc_nbuf);
329 kmem_free(npc
[all...]
H A Dnpf_state_test.c137 npf_cache_t *npc; local
146 npc = get_cached_pkt(construct_packet(p), NULL);
148 ret = npf_state_init(npc, nst);
152 ret = npf_state_inspect(npc, nst,
154 put_cached_pkt(npc);
H A Dnpf_rule_test.c63 npf_cache_t *npc; local
69 npc = get_cached_pkt(m, t->ifname);
72 rl = npf_ruleset_inspect(npc, npf_config_ruleset(npf), t->di, NPF_LAYER_3);
81 put_cached_pkt(npc);
H A Dnpf_gc_test.c52 npf_cache_t *npc = get_cached_pkt(m, NULL); local
55 con = npf_conn_establish(npc, PFIL_IN, true);
61 put_cached_pkt(npc);
/netbsd-current/external/gpl3/gdb.old/dist/sim/common/
H A Dcgen-engine.h205 npc,br_type are for communication between the cti insn and cti-chain. */
207 IADDR npc = 0; /* assign a value for -Wall */ \
216 pbb_br_npc = npc; \
222 CPU_PBB_BR_NPC (current_cpu) = npc; \
229 npc = (newval); \
235 npc = (newval); \
/netbsd-current/external/gpl3/gdb/dist/sim/common/
H A Dcgen-engine.h205 npc,br_type are for communication between the cti insn and cti-chain. */
207 IADDR npc = 0; /* assign a value for -Wall */ \
216 pbb_br_npc = npc; \
222 CPU_PBB_BR_NPC (current_cpu) = npc; \
229 npc = (newval); \
235 npc = (newval); \
/netbsd-current/sys/arch/sparc64/dev/
H A Dpyro.c442 pci_chipset_tag_t npc; local
444 npc = kmem_alloc(sizeof *npc, KM_SLEEP);
445 memcpy(npc, pc, sizeof *pc);
446 npc->cookie = pbm;
447 npc->rootnode = node;
448 npc->spc_conf_read = pyro_conf_read;
449 npc->spc_conf_write = pyro_conf_write;
450 npc->spc_intr_map = pyro_intr_map;
451 npc
[all...]
H A Dvpci.c465 pci_chipset_tag_t npc; local
467 npc = kmem_alloc(sizeof *npc, KM_SLEEP);
468 memcpy(npc, pc, sizeof *pc);
469 npc->cookie = pbm;
470 npc->rootnode = node;
471 npc->spc_conf_read = vpci_conf_read;
472 npc->spc_conf_write = vpci_conf_write;
473 npc->spc_intr_map = vpci_intr_map;
474 npc
[all...]
/netbsd-current/external/gpl3/binutils/dist/gprofng/libcollector/
H A Dunwind.c1601 unsigned long npc = adjust_ret_addr (ra, ra - tbgn, tend); local
1602 if (npc == 0)
1604 DprintfT (SP_DUMP_UNWIND, "unwind.c:%d cached pc=0x%lX\n", __LINE__, npc);
1605 wctx->pc = npc;
1719 unsigned long npc = adjust_ret_addr (ra, ra - tbgn, tend); local
1720 if (npc == 0)
1735 wctx->pc = npc;
1846 is_after_ret (unsigned char * npc) argument
1848 if (*npc != 0xe8)
1850 unsigned char * onpc = npc;
2129 unsigned char *npc = jmp_reg_switch_ctx[cur_jmp_reg_switch]->pc; local
2453 unsigned char *npc = cur->pc + immv; local
2912 unsigned char *npc = cur->pc + imm8; local
3545 unsigned char *npc = cur->pc + imm8; local
3612 unsigned char *npc = cur->pc + z + immz; local
3653 unsigned char *npc = cur->pc + imm8; local
4063 unsigned long npc = adjust_ret_addr (ra, ra - tbgn, tend); local
4103 unsigned long npc = 0; local
[all...]

Completed in 222 milliseconds

1234