Lines Matching refs:ip
16 void printpacket(ip)
17 struct ip *ip;
23 if (IP_V(ip) == 6) {
25 len = ntohs(((u_short *)ip)[2]) + 40;
27 off = ntohs(ip->ip_off);
28 len = ntohs(ip->ip_len);
35 for (s = (u_char *)ip, i = 0; i < len; i++) {
47 if (IP_V(ip) == 6) {
48 printpacket6(ip);
52 tcp = (struct tcphdr *)((char *)ip + (IP_HL(ip) << 2));
53 printf("ip %d(%d) %d", ntohs(ip->ip_len), IP_HL(ip) << 2, ip->ip_p);
56 printf(" %s", inet_ntoa(ip->ip_src));
58 if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_UDP)
61 printf("%s", inet_ntoa(ip->ip_dst));
63 if (ip->ip_p == IPPROTO_TCP || ip->ip_p == IPPROTO_UDP)
65 if ((ip->ip_p == IPPROTO_TCP) && (tcp->th_flags != 0)) {