Lines Matching refs:ip
70 #include <netinet/ip.h>
453 struct ip *ip = mtod(m, struct ip *);
468 if (ip->ip_ttl != CARP_DFLTTL) {
471 ip->ip_ttl,
477 iplen = ip->ip_hl << 2;
482 "on %s\n", __func__, m->m_len - sizeof(struct ip),
494 ip = mtod(m, struct ip *);
496 ch = (struct carp_header *)((char *)ip + iplen);
516 ip = mtod(m, struct ip *);
517 ch = (struct carp_header *)((char *)ip + iplen);
831 struct ip *ip;
838 len = sizeof(*ip) + sizeof(ch);
844 ip = mtod(m, struct ip *);
845 ip->ip_v = IPVERSION;
846 ip->ip_hl = sizeof(*ip) >> 2;
847 ip->ip_tos = V_carp_dscp << IPTOS_DSCP_OFFSET;
848 ip->ip_len = htons(len);
849 ip->ip_off = htons(IP_DF);
850 ip->ip_ttl = CARP_DFLTTL;
851 ip->ip_p = IPPROTO_CARP;
852 ip->ip_sum = 0;
853 ip_fillid(ip);
859 ip->ip_src.s_addr =
863 ip->ip_src.s_addr = 0;
864 ip->ip_dst.s_addr = htonl(INADDR_CARP_GROUP);
866 ch_ptr = (struct carp_header *)(&ip[1]);
871 m->m_data += sizeof(*ip);
872 ch_ptr->carp_cksum = in_cksum(m, len - sizeof(*ip));
873 m->m_data -= sizeof(*ip);