Lines Matching refs:ip

62 #include <netinet/ip.h>
104 struct ip *ip = mtod(m, struct ip *);
123 dst = ip->ip_dst;
124 cp = (u_char *)(ip + 1);
125 cnt = (ip->ip_hl << 2) - sizeof (struct ip);
134 code = &cp[IPOPT_OLEN] - (u_char *)ip;
139 code = &cp[IPOPT_OLEN] - (u_char *)ip;
163 code = &cp[IPOPT_OLEN] - (u_char *)ip;
167 code = &cp[IPOPT_OFFSET] - (u_char *)ip;
170 ipaddr.sin_addr = ip->ip_dst;
193 save_rte(m, cp, ip->ip_src);
213 inet_ntoa_r(ip->ip_src, srcbuf),
214 inet_ntoa_r(ip->ip_dst, dstbuf));
265 ip->ip_dst = ipaddr.sin_addr;
270 forward = !IN_MULTICAST(ntohl(ip->ip_dst.s_addr));
279 code = &cp[IPOPT_OFFSET] - (u_char *)ip;
283 code = &cp[IPOPT_OFFSET] - (u_char *)ip;
292 (void)memcpy(&ipaddr.sin_addr, &ip->ip_dst,
319 code = cp - (u_char *)ip;
321 code = &cp[IPOPT_OLEN] - (u_char *)ip;
325 code = &cp[IPOPT_OLEN] - (u_char *)ip;
331 code = &cp[IPOPT_OFFSET] - (u_char *)ip;
346 code = &cp[IPOPT_OFFSET] - (u_char *)ip;
363 code = &cp[IPOPT_OFFSET] - (u_char *)ip;
375 code = &cp[IPOPT_OFFSET + 1] - (u_char *)ip;
488 struct ip *ip = mtod(m, struct ip *);
491 olen = (ip->ip_hl << 2) - sizeof(struct ip);
495 ip->ip_len = htons(ntohs(ip->ip_len) - olen);
496 ip->ip_hl = sizeof(struct ip) >> 2;
498 bcopy((char *)ip + sizeof(struct ip) + olen, (ip + 1),
499 (size_t )(m->m_len - sizeof(struct ip)));
514 struct ip *ip = mtod(m, struct ip *);
518 if (optlen + ntohs(ip->ip_len) > IP_MAXPACKET) {
523 ip->ip_dst = p->ipopt_dst;
533 m->m_len -= sizeof(struct ip);
534 m->m_data += sizeof(struct ip);
537 m->m_len = optlen + sizeof(struct ip);
539 bcopy(ip, mtod(m, void *), sizeof(struct ip));
544 bcopy(ip, mtod(m, void *), sizeof(struct ip));
546 ip = mtod(m, struct ip *);
547 bcopy(p->ipopt_list, ip + 1, optlen);
548 *phlen = sizeof(struct ip) + optlen;
549 ip->ip_v = IPVERSION;
550 ip->ip_hl = *phlen >> 2;
551 ip->ip_len = htons(ntohs(ip->ip_len) + optlen);
556 * Copy options from ip to jp, omitting those not copied during
560 ip_optcopy(struct ip *ip, struct ip *jp)
565 cp = (u_char *)(ip + 1);
567 cnt = (ip->ip_hl << 2) - sizeof (struct ip);
724 struct ip *ip = mtod(m, struct ip *);
729 cp = (u_char *)(ip + 1);
730 cnt = (ip->ip_hl << 2) - sizeof (struct ip);