Lines Matching defs:ip
77 #include <netinet/ip.h>
111 struct ip iphdr; /* capsule IP header, host byte ordered */
127 struct ip *ip;
130 if (mbuf_len(m) < sizeof(*ip)) {
131 m = m_pullup(m, sizeof(*ip));
135 ip = mtod(m, struct ip *);
136 tos = ip->ip_tos;
176 iphdr.ip_len = m->m_pkthdr.len + sizeof(struct ip);
183 M_PREPEND(m, sizeof(struct ip), M_DONTWAIT);
184 if (m && mbuf_len(m) < sizeof(struct ip))
185 m = m_pullup(m, sizeof(struct ip));
190 bcopy(&iphdr, mtod(m, struct ip *), sizeof(struct ip));
226 - sizeof(struct ip);
241 struct ip *ip;
245 ip = mtod(m, struct ip *);
246 proto = ip->ip_p;
257 otos = ip->ip_tos;
265 if (mbuf_len(m) < sizeof(*ip)) {
266 m = m_pullup(m, sizeof(*ip));
270 ip = mtod(m, struct ip *);
272 ip_ecn_egress(ECN_ALLOWED, &otos, &ip->ip_tos);
274 ip_ecn_egress(ECN_NOCARE, &otos, &ip->ip_tos);
338 struct ip ip;
349 mbuf_copydata((struct mbuf *)(size_t)m, 0, sizeof(ip), &ip);
353 if (src->sin_addr.s_addr == ip.ip_dst.s_addr)
355 if (dst->sin_addr.s_addr == ip.ip_src.s_addr)
361 if (IN_MULTICAST(ntohl(ip.ip_src.s_addr)))
363 switch ((ntohl(ip.ip_src.s_addr) & 0xff000000) >> 24) {
375 if (ip.ip_src.s_addr == ia4->ia_broadaddr.sin_addr.s_addr) {
393 sin.sin_addr = ip.ip_src;