Lines Matching defs:ip
49 #include "ip.h"
63 static int tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp,
143 static int tcp_cksum(register const struct ip *ip,
147 return (nextproto4_cksum(ip, (const u_int8_t *)tp, len,
156 register const struct ip *ip;
170 ip = (struct ip *)bp2;
172 if (IP_V(ip) == 6)
180 ipaddr_string(&ip->ip_src),
181 ipaddr_string(&ip->ip_dst));
205 if (ip->ip_p == IPPROTO_TCP) {
207 ipaddr_string(&ip->ip_src),
209 ipaddr_string(&ip->ip_dst),
314 src = &ip->ip_src;
315 dst = &ip->ip_dst;
319 if (UNALIGNED_MEMCMP(src, dst, sizeof ip->ip_dst) > 0)
323 UNALIGNED_MEMCPY(&tha.src, dst, sizeof ip->ip_dst);
324 UNALIGNED_MEMCPY(&tha.dst, src, sizeof ip->ip_src);
327 UNALIGNED_MEMCPY(&tha.dst, dst, sizeof ip->ip_dst);
328 UNALIGNED_MEMCPY(&tha.src, src, sizeof ip->ip_src);
375 if (IP_V(ip) == 4) {
377 sum = tcp_cksum(ip, tp, length);
389 else if (IP_V(ip) == 6 && ip6->ip6_plen) {
523 switch (tcp_verify_signature(ip, tp,
726 nfsreq_print_noaddr((u_char *)rp, fraglen, (u_char *)ip);
731 nfsreply_print_noaddr((u_char *)rp, fraglen, (u_char *)ip);
788 tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp,
816 * Step 1: Update MD5 hash with IP pseudo-header.
818 if (IP_V(ip) == 4) {
819 MD5_Update(&ctx, (char *)&ip->ip_src, sizeof(ip->ip_src));
820 MD5_Update(&ctx, (char *)&ip->ip_dst, sizeof(ip->ip_dst));
822 MD5_Update(&ctx, (char *)&ip->ip_p, sizeof(ip->ip_p));
823 tlen = EXTRACT_16BITS(&ip->ip_len) - IP_HL(ip) * 4;
827 } else if (IP_V(ip) == 6) {
828 ip6 = (struct ip6_hdr *)ip;
842 printf("IP version not 4 or 6, ");
844 printf("IP version not 4, ");