Lines Matching defs:ip
50 * IP output. The packet in mbuf chain m contains a skeletal IP
58 register struct ip *ip;
60 register int hlen = sizeof(struct ip );
73 ip = mtod(m, struct ip *);
75 * Fill in IP header.
77 ip->ip_v = IPVERSION;
78 ip->ip_off &= IP_DF;
79 ip->ip_id = htons(ip_id++);
80 ip->ip_hl = hlen >> 2;
97 if ((u_int16_t)ip->ip_len <= IF_MTU) {
98 ip->ip_len = htons((u_int16_t)ip->ip_len);
99 ip->ip_off = htons((u_int16_t)ip->ip_off);
100 ip->ip_sum = 0;
101 ip->ip_sum = cksum(m, hlen);
111 if (ip->ip_off & IP_DF) {
117 len = (IF_MTU - hlen) &~ 7; /* ip databytes per packet */
132 mhlen = sizeof (struct ip);
133 for (off = hlen + len; off < (u_int16_t)ip->ip_len; off += len) {
134 register struct ip *mhip;
142 mhip = mtod(m, struct ip *);
143 *mhip = *ip;
146 /* if (hlen > sizeof (struct ip)) {
147 * mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
152 mhip->ip_off = ((off - hlen) >> 3) + (ip->ip_off & ~IP_MF);
153 if (ip->ip_off & IP_MF)
155 if (off + len >= (u_int16_t)ip->ip_len)
156 len = (u_int16_t)ip->ip_len - off;
178 m_adj(m, hlen + firstlen - (u_int16_t)ip->ip_len);
179 ip->ip_len = htons((u_int16_t)m->m_len);
180 ip->ip_off = htons((u_int16_t)(ip->ip_off | IP_MF));
181 ip->ip_sum = 0;
182 ip->ip_sum = cksum(m, hlen);