Home | History | Annotate | Download | only in npf

Lines Matching defs:enpc

193 npfa_icmp_inspect(npf_cache_t *npc, npf_cache_t *enpc)
206 memset(enpc, 0, sizeof(npf_cache_t));
207 enpc->npc_ctx = npc->npc_ctx;
208 enpc->npc_nbuf = nbuf;
212 * embedded packet. Fill the "enpc" cache, if so.
217 ret = npfa_icmp4_inspect(ic->icmp_type, enpc, &hasqid);
221 ret = npfa_icmp6_inspect(ic6->icmp6_type, enpc, &hasqid);
241 npf_cache_t enpc;
247 if (!npfa_icmp_inspect(npc, &enpc))
271 SWAP(npf_addr_t *, enpc.npc_ips[NPF_SRC], enpc.npc_ips[NPF_DST]);
273 switch (enpc.npc_proto) {
275 l4.th.th_sport = enpc.npc_l4.tcp->th_dport;
276 l4.th.th_dport = enpc.npc_l4.tcp->th_sport;
277 enpc.npc_l4.tcp = &l4.th;
280 l4.uh.uh_sport = enpc.npc_l4.udp->uh_dport;
281 l4.uh.uh_dport = enpc.npc_l4.udp->uh_sport;
282 enpc.npc_l4.udp = &l4.uh;
285 const struct icmp *ic = enpc.npc_l4.icmp;
286 ret = npfa_icmp4_inspect(ic->icmp_type, &enpc, &hasqid);
289 enpc.npc_info |= NPC_ICMP_ID;
293 const struct icmp6_hdr *ic6 = enpc.npc_l4.icmp6;
294 ret = npfa_icmp6_inspect(ic6->icmp6_type, &enpc, &hasqid);
297 enpc.npc_info |= NPC_ICMP_ID;
305 conn = npf_conn_lookup(&enpc, di, &flow);
309 * caching enpc.
323 npf_cache_t enpc;
336 if (!npfa_icmp_inspect(npc, &enpc))
348 KASSERT(npf_iscached(&enpc, NPC_IP46));
349 KASSERT(npf_iscached(&enpc, NPC_LAYER4));
358 const int proto = enpc.npc_proto;
362 if (npf_iscached(&enpc, NPC_IP4)) {
363 const struct ip *eip = enpc.npc_ip.v4;
368 const struct tcphdr *th = enpc.npc_l4.tcp;
374 const struct udphdr *uh = enpc.npc_l4.udp;
395 cksum = npf_addr_cksum(cksum, enpc.npc_alen, enpc.npc_ips[which], addr);
411 if (npf_napt_rwr(&enpc, which, addr, port)) {
419 if (npf_iscached(&enpc, NPC_IP4)) {
420 const struct ip *eip = enpc.npc_ip.v4;
425 const struct tcphdr *th = enpc.npc_l4.tcp;
431 const struct udphdr *uh = enpc.npc_l4.udp;
445 * caching enpc.