Lines Matching defs:ip

85 #include <netinet/ip.h>
141 static struct ip *
145 struct ip *ip;
148 ip = mtod(m, __typeof__(ip));
149 ovbcopy((caddr_t)ip, (caddr_t)(((u_char *)ip) + stripsiz), iphlen);
153 ip = mtod(m, __typeof__(ip));
154 ip->ip_len = ip->ip_len - stripsiz;
155 ip->ip_p = IPPROTO_ESP;
156 return ip;
164 struct ip *ip;
203 ip = mtod(m, struct ip *);
205 if (ip->ip_p != IPPROTO_ESP &&
206 !(ip->ip_p == IPPROTO_UDP && off >= sizeof(struct udphdr))) {
212 esp = (struct esp *)(void *)(((u_int8_t *)ip) + off);
214 hlen = IP_VHL_HL(ip->ip_vhl) << 2;
216 hlen = ip->ip_hl << 2;
223 (caddr_t)&ip->ip_src, (caddr_t)&ip->ip_dst,
254 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
277 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
308 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
315 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
322 ip = mtod(m, struct ip *);
324 ip->ip_len = ip->ip_len - siz;
326 ip->ip_len = htons(ntohs(ip->ip_len) - siz);
413 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
420 ip = mtod(m, struct ip *);
422 ip->ip_len = ip->ip_len - taillen;
424 ip->ip_len = htons(ntohs(ip->ip_len) - taillen);
426 if (ip->ip_p == IPPROTO_UDP) {
427 // offset includes the outer ip and udp header lengths.
445 struct udphdr *encap_uh = (__typeof__(encap_uh))(void *)((caddr_t)ip + off);
451 ip = esp4_input_strip_UDP_encap(m, off);
452 esp = (struct esp *)(void *)(((u_int8_t *)ip) + off);
480 tos = ip->ip_tos;
485 if (m->m_len < sizeof(*ip)) {
486 m = m_pullup(m, sizeof(*ip));
492 ip = mtod(m, struct ip *);
494 ip_ecn_egress(ip4_ipsec_ecn, &tos, &ip->ip_tos);
496 (caddr_t)&ip->ip_src, (caddr_t)&ip->ip_dst)) {
499 ipsec4_logpacketstr(ip, spi), ipsec_logsastr(sav)));
509 ipaddr->sin_addr = ip->ip_dst;
541 // ip_ecn_egress(ip4_ipsec_ecn, &tos, &ip->ip_tos);
608 ip = mtod(m, struct ip *);
609 ovbcopy((caddr_t)ip, (caddr_t)(((u_char *)ip) + stripsiz), off);
614 ip = mtod(m, struct ip *);
616 ip->ip_len = ip->ip_len - stripsiz;
618 ip->ip_len = htons(ntohs(ip->ip_len) - stripsiz);
620 ip->ip_p = nxt;
664 ip = mtod(m, struct ip *);
666 udp = (struct udphdr *)(void *)(((u_int8_t *)ip) + off);
682 struct ip *, ip, struct ifnet *, m->m_pkthdr.rcvif,
683 struct ip *, ip, struct ip6_hdr *, NULL);