Lines Matching defs:ip

74 #include <netinet/ip.h>
91 CTASSERT(sizeof(struct ip) == 20);
143 .nh_name = "ip",
416 VNET_SYSUNINIT(ip, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip_destroy, NULL);
429 struct ip *ip;
432 ip = mtod(m, struct ip *);
433 hlen = ip->ip_hl << 2;
437 if (IPSEC_INPUT(ipv4, m, hlen, ip->ip_p) != 0)
442 (*inetsw[ip_protox[ip->ip_p]].pr_input)(&m, &hlen, ip->ip_p);
455 struct ip *ip = NULL;
469 ip = mtod(m, struct ip *);
470 hlen = ip->ip_hl << 2;
471 ip_len = ntohs(ip->ip_len);
477 if (m->m_pkthdr.len < sizeof(struct ip))
480 if (m->m_len < sizeof (struct ip) &&
481 (m = m_pullup(m, sizeof (struct ip))) == NULL) {
485 ip = mtod(m, struct ip *);
487 if (ip->ip_v != IPVERSION) {
492 hlen = ip->ip_hl << 2;
493 if (hlen < sizeof(struct ip)) { /* minimum header length */
502 ip = mtod(m, struct ip *);
505 IP_PROBE(receive, NULL, NULL, ip, m->m_pkthdr.rcvif, ip, NULL);
509 if (IN_LOOPBACK(ntohl(ip->ip_dst.s_addr)) ||
510 IN_LOOPBACK(ntohl(ip->ip_src.s_addr))) {
520 if (hlen == sizeof(struct ip)) {
521 sum = in_cksum_hdr(ip);
537 ip_len = ntohs(ip->ip_len);
570 * ip pointer.
582 ip = mtod(m, struct ip *);
608 odst = ip->ip_dst;
614 ip = mtod(m, struct ip *);
615 dchg = (odst.s_addr != ip->ip_dst.s_addr);
641 if (hlen > sizeof (struct ip) && ip_dooptions(m, 0))
650 if (V_rsvp_on && ip->ip_p==IPPROTO_RSVP)
689 LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) {
695 if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr &&
721 ip->ip_dst.s_addr) {
741 if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
746 if (V_ip_mrouter && !IN_LINKLOCAL(ntohl(ip->ip_src.s_addr))) {
755 if (ip_mforward && ip_mforward(ip, ifp, m, 0) != 0) {
766 if (ip->ip_p == IPPROTO_IGMP)
777 if (ip->ip_dst.s_addr == (u_long)INADDR_BROADCAST)
779 if (ip->ip_dst.s_addr == INADDR_ANY)
782 if (IN_LINKLOCAL(ntohl(ip->ip_dst.s_addr)) ||
783 IN_LINKLOCAL(ntohl(ip->ip_src.s_addr))) {
806 if (V_ipstealth && hlen > sizeof (struct ip) && ip_dooptions(m, 1))
814 if (ip->ip_off & htons(IP_MF | IP_OFFMASK)) {
819 ip = mtod(m, struct ip *);
821 hlen = ip->ip_hl << 2;
826 if (IPSEC_INPUT(ipv4, m, hlen, ip->ip_p) != 0)
836 (*inetsw[ip_protox[ip->ip_p]].pr_input)(&m, &hlen, ip->ip_p);
957 struct ip *ip = mtod(m, struct ip *);
965 if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) {
974 ip->ip_ttl <= IPTTLDEC) {
983 sin->sin_addr = ip->ip_dst;
986 ntohl(ip->ip_src.s_addr ^ ip->ip_dst.s_addr),
1024 mcopy->m_len = min(ntohs(ip->ip_len), M_TRAILINGSPACE(mcopy));
1031 ip->ip_ttl -= IPTTLDEC;
1062 u_long src = ntohl(ip->ip_src.s_addr);
1069 dest.s_addr = ip->ip_dst.s_addr;
1131 mtu = ip_next_mtu(ntohs(ip->ip_len), 0);
1150 ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip,
1246 *mp = sbcreatecontrol((caddr_t)&ip->ip_dst,
1252 *mp = sbcreatecontrol((caddr_t)&ip->ip_ttl,
1311 *mp = sbcreatecontrol((caddr_t)&ip->ip_tos,