| /openbsd/src/usr.sbin/tcpdump/ |
| D | print-ip6.c | 52 const struct ip6_hdr *ip6; in ip6_print() local 61 ip6 = (const struct ip6_hdr *)bp; in ip6_print() 62 if ((u_char *)(ip6 + 1) > snapend) { in ip6_print() 72 if ((intptr_t)ip6 & (sizeof(u_int32_t)-1)) { in ip6_print() 84 memmove((char *)abuf, (char *)ip6, min(length, clen)); in ip6_print() 87 ip6 = (struct ip6_hdr *)abuf; in ip6_print() 99 if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { in ip6_print() 100 printf("bad-ip6-version %u", ip6->ip6_vfc >> 4); in ip6_print() 105 len = ntohs(ip6->ip6_plen); in ip6_print() 110 cp = (const u_char *)ip6; in ip6_print() [all …]
|
| D | print-tcp.c | 150 static int tcp6_cksum(const struct ip6_hdr *ip6, const struct tcphdr *tp, in tcp6_cksum() argument 168 phu.ph.ph_src = ip6->ip6_src; in tcp6_cksum() 169 phu.ph.ph_dst = ip6->ip6_dst; in tcp6_cksum() 191 const struct ip6_hdr *ip6; in tcp_print() local 197 ip6 = NULL; in tcp_print() 201 ip6 = (struct ip6_hdr *)bp2; in tcp_print() 215 if (ip6) { in tcp_print() 217 ip6addr_string(&ip6->ip6_src), in tcp_print() 218 ip6addr_string(&ip6->ip6_dst)); in tcp_print() 230 if (ip6) { in tcp_print() [all …]
|
| /openbsd/src/usr.sbin/dhcrelay6/ |
| D | packet.c | 116 struct ip6_hdr ip6; in assemble_udp_ip6_header() local 119 memset(&ip6, 0, sizeof(ip6)); in assemble_udp_ip6_header() 120 ip6.ip6_vfc = IPV6_VERSION; in assemble_udp_ip6_header() 121 ip6.ip6_nxt = IPPROTO_UDP; in assemble_udp_ip6_header() 122 ip6.ip6_src = ss2sin6(&pc->pc_src)->sin6_addr; in assemble_udp_ip6_header() 123 ip6.ip6_dst = ss2sin6(&pc->pc_dst)->sin6_addr; in assemble_udp_ip6_header() 124 ip6.ip6_plen = htons(sizeof(uh) + plen); in assemble_udp_ip6_header() 125 ip6.ip6_hlim = 64; in assemble_udp_ip6_header() 126 memcpy(&p[*off], &ip6, sizeof(ip6)); in assemble_udp_ip6_header() 127 *off += sizeof(ip6); in assemble_udp_ip6_header() [all …]
|
| /openbsd/src/sys/netinet6/ |
| D | ip6_input.c | 250 struct ip6_hdr *ip6; in ip6intr() local 252 ip6 = mtod(m, struct ip6_hdr *); in ip6intr() 254 nxt = ip6->ip6_nxt; in ip6intr() 274 struct ip6_hdr *ip6; in ipv6_check() local 276 if (m->m_len < sizeof(*ip6)) { in ipv6_check() 277 m = m_pullup(m, sizeof(*ip6)); in ipv6_check() 284 ip6 = mtod(m, struct ip6_hdr *); in ipv6_check() 286 if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { in ipv6_check() 294 if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_src) || in ipv6_check() 295 IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst)) { in ipv6_check() [all …]
|
| D | ip6_forward.c | 85 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); in ip6_forward() local 112 IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) || in ip6_forward() 113 IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { in ip6_forward() 121 inet_ntop(AF_INET6, &ip6->ip6_src, src6, sizeof(src6)); in ip6_forward() 122 inet_ntop(AF_INET6, &ip6->ip6_dst, dst6, sizeof(dst6)); in ip6_forward() 126 src6, dst6, ip6->ip6_nxt, ifidx); in ip6_forward() 132 if (ip6->ip6_hlim <= IPV6_HLIMDEC) { in ip6_forward() 137 ip6->ip6_hlim -= IPV6_HLIMDEC; in ip6_forward() 156 switch (ip6->ip6_nxt) { in ip6_forward() 209 rt = route6_mpath(ro, &ip6->ip6_dst, &ip6->ip6_src, in ip6_forward() [all …]
|
| D | frag6.c | 117 struct ip6_hdr *ip6; in frag6_input() local 126 ip6 = mtod(m, struct ip6_hdr *); in frag6_input() 132 if (ip6->ip6_plen == 0) { in frag6_input() 145 (((ntohs(ip6->ip6_plen) - offset) & 0x7) != 0)) { in frag6_input() 170 if (sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) <= offset) { in frag6_input() 189 IN6_ARE_ADDR_EQUAL(&ip6->ip6_src, &q6->ip6q_src) && in frag6_input() 190 IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &q6->ip6q_dst)) in frag6_input() 224 q6->ip6q_src = ip6->ip6_src; in frag6_input() 225 q6->ip6q_dst = ip6->ip6_dst; in frag6_input() 226 q6->ip6q_ecn = (ntohl(ip6->ip6_flow) >> 20) & IPTOS_ECN_MASK; in frag6_input() [all …]
|
| D | nd6_nbr.c | 101 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); in nd6_ns_input() local 103 struct in6_addr saddr6 = ip6->ip6_src; in nd6_ns_input() 104 struct in6_addr daddr6 = ip6->ip6_dst; in nd6_ns_input() 127 ip6 = mtod(m, struct ip6_hdr *); /* adjust pointer for safety */ in nd6_ns_input() 130 if (ip6->ip6_hlim != 255) { in nd6_ns_input() 133 ip6->ip6_hlim, in nd6_ns_input() 134 inet_ntop(AF_INET6, &ip6->ip6_src, addr, sizeof(addr)), in nd6_ns_input() 135 inet_ntop(AF_INET6, &ip6->ip6_dst, addr0, sizeof(addr0)), in nd6_ns_input() 186 if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) && lladdr) { in nd6_ns_input() 366 struct ip6_hdr *ip6; in nd6_ns_output() local [all …]
|
| D | raw_ip6.c | 138 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); in rip6_input() local 162 in6_recoverscope(&rip6src, &ip6->ip6_src); in rip6_input() 164 key = &ip6->ip6_dst; in rip6_input() 207 !IN6_ARE_ADDR_EQUAL(&inp->inp_faddr6, &ip6->ip6_src)) in rip6_input() 238 rip6_sbappend(last, n, ip6, *offp, &rip6src); in rip6_input() 271 rip6_sbappend(last, m, ip6, *offp, &rip6src); in rip6_input() 278 rip6_sbappend(struct inpcb *inp, struct mbuf *m, struct ip6_hdr *ip6, int hlen, in rip6_sbappend() argument 306 struct ip6_hdr *ip6; in rip6_ctlinput() local 332 ip6 = ip6cp->ip6c_ip6; in rip6_ctlinput() 337 ip6 = NULL; in rip6_ctlinput() [all …]
|
| D | udp6_output.c | 102 struct ip6_hdr *ip6; in udp6_output() local 207 ip6 = mtod(m, struct ip6_hdr *); in udp6_output() 208 ip6->ip6_flow = inp->inp_flowinfo & IPV6_FLOWINFO_MASK; in udp6_output() 209 ip6->ip6_vfc &= ~IPV6_VERSION_MASK; in udp6_output() 210 ip6->ip6_vfc |= IPV6_VERSION; in udp6_output() 212 ip6->ip6_plen = htons((u_short)plen); in udp6_output() 214 ip6->ip6_nxt = IPPROTO_UDP; in udp6_output() 215 ip6->ip6_hlim = in6_selecthlim(inp); in udp6_output() 216 ip6->ip6_src = *laddr; in udp6_output() 217 ip6->ip6_dst = *faddr; in udp6_output()
|
| D | ip6_output.c | 166 struct ip6_hdr *ip6; in ip6_output() local 188 ip6 = mtod(m, struct ip6_hdr *); in ip6_output() 189 finaldst = ip6->ip6_dst; in ip6_output() 258 ip6 = mtod(m, struct ip6_hdr *); in ip6_output() 262 plen = m->m_pkthdr.len - sizeof(*ip6); in ip6_output() 275 ip6 = mtod(m, struct ip6_hdr *); in ip6_output() 278 ip6->ip6_plen = 0; in ip6_output() 280 ip6->ip6_plen = htons(plen); in ip6_output() 293 u_char *nexthdrp = &ip6->ip6_nxt; in ip6_output() 310 *mtod(exthdrs.ip6e_dest2, u_char *) = ip6->ip6_nxt; in ip6_output() [all …]
|
| D | icmp6.c | 393 struct ip6_hdr *ip6, *nip6; in icmp6_input() local 405 ip6 = mtod(m, struct ip6_hdr *); in icmp6_input() 425 inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src)))); in icmp6_input() 459 carp_lsdrop(ifp, m, AF_INET6, ip6->ip6_src.s6_addr32, in icmp6_input() 460 ip6->ip6_dst.s6_addr32, 1)) { in icmp6_input() 583 bcopy(ip6, nip6, sizeof(struct ip6_hdr)); in icmp6_input() 729 inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src)), in icmp6_input() 730 inet_ntop(AF_INET6, &ip6->ip6_dst, dst, sizeof(dst)), in icmp6_input() 1053 struct ip6_hdr *ip6; in icmp6_reflect() local 1106 ip6 = mtod(m, struct ip6_hdr *); in icmp6_reflect() [all …]
|
| D | mld6.c | 172 struct ip6_hdr *ip6; in mld6_input() local 189 ip6 = mtod(m, struct ip6_hdr *);/* in case mpullup */ in mld6_input() 190 if (!IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src)) { in mld6_input() 196 inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src)), in mld6_input() 404 struct ip6_hdr *ip6; in mld6_sendpkt() local 453 ip6 = mtod(mh, struct ip6_hdr *); in mld6_sendpkt() 454 ip6->ip6_flow = 0; in mld6_sendpkt() 455 ip6->ip6_vfc &= ~IPV6_VERSION_MASK; in mld6_sendpkt() 456 ip6->ip6_vfc |= IPV6_VERSION; in mld6_sendpkt() 458 ip6->ip6_nxt = IPPROTO_ICMPV6; in mld6_sendpkt() [all …]
|
| D | ip6_mroute.c | 856 ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m, int flags) in ip6_mforward() argument 870 if (ip6->ip6_hlim <= 1 || IN6_IS_ADDR_MC_INTFACELOCAL(&ip6->ip6_dst) || in ip6_mforward() 871 IN6_IS_ADDR_MC_LINKLOCAL(&ip6->ip6_dst)) in ip6_mforward() 873 ip6->ip6_hlim--; in ip6_mforward() 882 if (IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src)) { in ip6_mforward() 889 inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src)); in ip6_mforward() 890 inet_ntop(AF_INET6, &ip6->ip6_dst, dst, sizeof(dst)); in ip6_mforward() 893 src, dst, ip6->ip6_nxt, m->m_pkthdr.ph_ifidx); in ip6_mforward() 901 rt = mf6c_find(NULL, &ip6->ip6_src, &ip6->ip6_dst, rtableid); in ip6_mforward() 935 sin6.sin6_addr = ip6->ip6_src; in ip6_mforward() [all …]
|
| D | nd6_rtr.c | 70 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); in nd6_rtr_cache() local 73 struct in6_addr saddr6 = ip6->ip6_src; in nd6_rtr_cache() 84 if (ip6->ip6_hlim != 255) { in nd6_rtr_cache() 87 __func__, ip6->ip6_hlim, in nd6_rtr_cache() 88 inet_ntop(AF_INET6, &ip6->ip6_src, src, sizeof(src)), in nd6_rtr_cache() 89 inet_ntop(AF_INET6, &ip6->ip6_dst, dst, sizeof(dst)), in nd6_rtr_cache()
|
| /openbsd/src/regress/sys/netinet/pmtu/ |
| D | tcp_atomicfrag6.py | 23 ip6=IPv6(src=FAKE_NET_ADDR6, dst=REMOTE_ADDR6) variable 28 synack=srp1(e/ip6/syn, iface=LOCAL_IF, timeout=5) 37 data=srp1(e/ip6/ack, iface=LOCAL_IF, timeout=5) 49 "ip6 and src "+ip6.dst+" and dst "+ip6.src+" and proto ipv6-frag" 64 if fh.offset != 0 or fh.nh != (ip6/syn).nh: 77 data=srp1(e/ip6/ack, iface=LOCAL_IF, timeout=5) 86 sendp(e/ip6/rst, iface=LOCAL_IF)
|
| D | udp_echo6.py | 25 ip6=IPv6(src=FAKE_NET_ADDR6, dst=REMOTE_ADDR6) variable 35 echo=srp1(e/ip6/udp, iface=LOCAL_IF, timeout=5) 51 "ip6 and src "+ip6.dst+" and dst "+ip6.src+" and proto ipv6-frag" 56 sendp(e/ip6/udp, iface=LOCAL_IF) 63 if fh.offset != 0 or fh.nh != (ip6/udp).nh:
|
| D | tcp_connect6.py | 23 ip6=IPv6(src=FAKE_NET_ADDR6, dst=REMOTE_ADDR6) variable 28 synack=srp1(e/ip6/syn, iface=LOCAL_IF, timeout=5) 37 data=srp1(e/ip6/ack, iface=LOCAL_IF, timeout=5) 50 (ip6.dst, syn.dport, ip6.src, syn.sport) 70 sendp(e/ip6/rst, iface=LOCAL_IF)
|
| D | udp_atomicfrag6.py | 25 ip6=IPv6(src=FAKE_NET_ADDR6, dst=REMOTE_ADDR6) variable 35 echo=srp1(e/ip6/udp, iface=LOCAL_IF, timeout=5) 51 "ip6 and src "+ip6.dst+" and dst "+ip6.src+" and proto ipv6-frag" 56 sendp(e/ip6/udp, iface=LOCAL_IF) 65 if fh.offset != 0 or fh.nh != (ip6/udp).nh:
|
| /openbsd/src/sys/netinet/ |
| D | tcp_subr.c | 249 struct ip6_hdr *ip6; in tcp_template() local 251 ip6 = mtod(m, struct ip6_hdr *); in tcp_template() 253 ip6->ip6_src = inp->inp_laddr6; in tcp_template() 254 ip6->ip6_dst = inp->inp_faddr6; in tcp_template() 255 ip6->ip6_flow = htonl(0x60000000) | in tcp_template() 258 ip6->ip6_nxt = IPPROTO_TCP; in tcp_template() 259 ip6->ip6_plen = htons(sizeof(struct tcphdr)); /*XXX*/ in tcp_template() 260 ip6->ip6_hlim = in6_selecthlim(inp); /*XXX*/ in tcp_template() 305 struct ip6_hdr *ip6; in tcp_respond() local 330 ip6 = mtod(m, struct ip6_hdr *); in tcp_respond() [all …]
|
| D | udp_usrreq.c | 210 struct ip6_hdr *ip6 = NULL; in udp_input() local 258 ip6 = mtod(m, struct ip6_hdr *); in udp_input() 277 if (ip6) in udp_input() 292 else if (ip6) in udp_input() 367 srcsa.sin6.sin6_flowinfo = htonl(0x0fffffff) & ip6->ip6_flow; in udp_input() 370 in6_recoverscope(&srcsa.sin6, &ip6->ip6_src); in udp_input() 377 dstsa.sin6.sin6_flowinfo = htonl(0x0fffffff) & ip6->ip6_flow; in udp_input() 380 in6_recoverscope(&dstsa.sin6, &ip6->ip6_dst); in udp_input() 407 if (ip6) in udp_input() 416 if (ip6) in udp_input() [all …]
|
| D | ip_ipip.c | 150 struct ip6_hdr *ip6; in ipip_input_if() local 188 ip6 = mtod(m, struct ip6_hdr *); in ipip_input_if() 189 otos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; in ipip_input_if() 200 ip6 = NULL; in ipip_input_if() 266 ip6 = mtod(m, struct ip6_hdr *); in ipip_input_if() 267 itos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; in ipip_input_if() 273 ip6->ip6_flow &= ~htonl(0xff << 20); in ipip_input_if() 274 ip6->ip6_flow |= htonl((u_int32_t) itos << 20); in ipip_input_if() 292 } else if (ip6) { in ipip_input_if() 296 sin6->sin6_addr = ip6->ip6_src; in ipip_input_if() [all …]
|
| D | ipsec_output.c | 86 struct ip6_hdr *ip6; in ipsp_process_packet() local 198 ip6 = mtod(m, struct ip6_hdr *); in ipsp_process_packet() 213 &ip6->ip6_dst))) || in ipsp_process_packet() 241 if (m->m_pkthdr.len - sizeof(*ip6) > in ipsp_process_packet() 247 ip6 = mtod(m, struct ip6_hdr *); in ipsp_process_packet() 248 ip6->ip6_plen = htons(m->m_pkthdr.len in ipsp_process_packet() 249 - sizeof(*ip6)); in ipsp_process_packet() 296 ip6 = mtod(m, struct ip6_hdr *); in ipsp_process_packet() 299 nxt = ip6->ip6_nxt; in ipsp_process_packet() 400 struct ip6_hdr *ip6; in ipsp_process_done() local [all …]
|
| D | ip_ah.c | 208 struct ip6_hdr ip6; in ah_massage_headers() local 336 m_copydata(m, 0, sizeof(ip6), &ip6); in ah_massage_headers() 339 if (ip6.ip6_plen == 0) { in ah_massage_headers() 346 ip6.ip6_flow = 0; in ah_massage_headers() 347 ip6.ip6_hlim = 0; in ah_massage_headers() 348 ip6.ip6_vfc &= ~IPV6_VERSION_MASK; in ah_massage_headers() 349 ip6.ip6_vfc |= IPV6_VERSION; in ah_massage_headers() 352 if (IN6_IS_SCOPE_EMBED(&ip6.ip6_src)) in ah_massage_headers() 353 ip6.ip6_src.s6_addr16[1] = 0; in ah_massage_headers() 354 if (IN6_IS_SCOPE_EMBED(&ip6.ip6_dst)) in ah_massage_headers() [all …]
|
| /openbsd/src/sys/net/ |
| D | if_gif.c | 248 struct ip6_hdr *ip6; in gif_start() local 250 m = m_pullup(m, sizeof(*ip6)); in gif_start() 254 ip6 = mtod(m, struct ip6_hdr *); in gif_start() 255 tos = ntohl(ip6->ip6_flow >> 20); in gif_start() 346 struct ip6_hdr *ip6; in gif_send() local 353 m = m_prepend(m, sizeof(*ip6), M_DONTWAIT); in gif_send() 361 ip6 = mtod(m, struct ip6_hdr *); in gif_send() 362 ip6->ip6_flow = htonl(flow); in gif_send() 363 ip6->ip6_vfc |= IPV6_VERSION; in gif_send() 364 ip6->ip6_plen = htons(len); in gif_send() [all …]
|
| /openbsd/src/sbin/isakmpd/ |
| D | log.c | 76 struct ip6_hdr ip6; /* IPv6 header */ member 560 hdrlen = sizeof(hdr.ip.ip6); in log_packet_iov() 561 hdr.ip.ip6.ip6_vfc = IPV6_VERSION; in log_packet_iov() 562 hdr.ip.ip6.ip6_nxt = IPPROTO_UDP; in log_packet_iov() 563 hdr.ip.ip6.ip6_plen = udp.uh_ulen; in log_packet_iov() 564 memcpy(&hdr.ip.ip6.ip6_src, in log_packet_iov() 566 sizeof hdr.ip.ip6.ip6_src); in log_packet_iov() 567 memcpy(&hdr.ip.ip6.ip6_dst, in log_packet_iov() 569 sizeof hdr.ip.ip6.ip6_dst); in log_packet_iov() 603 struct ip6_hdr *ip6; in udp_cksum() local [all …]
|