• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/contrib/ipfilter/netinet/

Lines Matching refs:ip

49 #include <netinet/ip.h>
78 extern int ip_optcopy(struct ip *, struct ip *);
131 struct ip *ip = mtod(*mp, struct ip *);
138 ip->ip_len = htons(ip->ip_len);
139 ip->ip_off = htons(ip->ip_off);
142 rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp, (dir == PFIL_OUT),
147 ip = mtod(*mp, struct ip *);
148 ip->ip_len = ntohs(ip->ip_len);
149 ip->ip_off = ntohs(ip->ip_off);
164 error = ipf_check(&V_ipfmain, mtod(*mp, struct ip *),
356 ip_t *ip;
392 ip = mtod(m, struct ip *);
393 bzero((char *)ip, hlen);
395 ip6 = (ip6_t *)ip;
397 tcp2 = (struct tcphdr *)((char *)ip + hlen);
431 ip->ip_p = IPPROTO_TCP;
432 ip->ip_len = htons(sizeof(struct tcphdr));
433 ip->ip_src.s_addr = fin->fin_daddr;
434 ip->ip_dst.s_addr = fin->fin_saddr;
436 ip->ip_len = htons(hlen + sizeof(*tcp2));
450 ip_t *ip, *oip;
453 ip = mtod(m, ip_t *);
457 IP_V_A(ip, fin->fin_v);
464 fnew.fin_p = ip->ip_p;
465 fnew.fin_plen = ntohs(ip->ip_len);
466 IP_HL_A(ip, sizeof(*oip) >> 2);
467 ip->ip_tos = oip->ip_tos;
468 ip->ip_id = fin->fin_ip->ip_id;
469 ip->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0);
470 ip->ip_ttl = V_ip_defttl;
471 ip->ip_sum = 0;
476 ip6_t *ip6 = (ip6_t *)ip;
498 fnew.fin_ip = ip;
501 fnew.fin_dp = (char *)ip + hlen;
502 (void) ipf_makefrip(hlen, ip, &fnew);
523 ip_t *ip, *ip2;
629 ip = mtod(m, ip_t *);
630 icmp = (struct icmp *)((char *)ip + hlen);
653 ip6 = (ip6_t *)ip;
669 ip->ip_p = IPPROTO_ICMP;
670 ip->ip_src.s_addr = dst4.s_addr;
671 ip->ip_dst.s_addr = fin->fin_saddr;
678 ip->ip_len = htons(iclen);
679 ip->ip_p = IPPROTO_ICMP;
698 register struct ip *ip, *mhip;
738 * currently "to <if>" and "to <if>:ip#" are not supported
746 ip = mtod(m0, struct ip *);
754 dst.sin_addr = ip->ip_dst;
779 if (in_localaddr(ip->ip_dst))
815 ip->ip_sum = 0;
826 ip->ip_sum = 0;
830 if (ntohs(ip->ip_len) <= ifp->if_mtu) {
831 if (!ip->ip_sum)
832 ip->ip_sum = in_cksum(m, hlen);
842 ip_off = ntohs(ip->ip_off);
862 mhlen = sizeof (struct ip);
863 for (off = hlen + len; off < ntohs(ip->ip_len); off += len) {
875 mhip = mtod(m, struct ip *);
876 bcopy((char *)ip, (char *)mhip, sizeof(*ip));
877 if (hlen > sizeof (struct ip)) {
878 mhlen = ip_optcopy(ip, mhip) + sizeof (struct ip);
883 if (off + len >= ntohs(ip->ip_len))
884 len = ntohs(ip->ip_len) - off;
905 m_adj(m0, hlen + firstlen - ip->ip_len);
906 ip->ip_len = htons((u_short)(hlen + firstlen));
907 ip->ip_off = htons((u_short)IP_MF);
908 ip->ip_sum = 0;
909 ip->ip_sum = in_cksum(m0, hlen);
1049 ip_t *ip;
1066 ip = fin->fin_ip;
1095 sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
1214 char *ip;
1219 ip = (char *)fin->fin_ip;
1221 return ip;
1225 dpoff = (char *)fin->fin_dp - (char *)ip;
1290 ip = MTOD(m, char *) + ipoff;
1292 fin->fin_ip = (ip_t *)ip;
1296 fin->fin_fraghdr = (char *)ip +
1303 return ip;