Lines Matching refs:ip

89            const struct ip *ip)  in ip_finddst()  argument
96 cp = (const u_char *)(ip + 1); in ip_finddst()
97 length = (IP_HL(ip) << 2) - sizeof(struct ip); in ip_finddst()
126 UNALIGNED_MEMCPY(&retval, &ip->ip_dst.s_addr, sizeof(uint32_t)); in ip_finddst()
135 const struct ip *ip, const uint8_t *data, in nextproto4_cksum() argument
151 UNALIGNED_MEMCPY(&ph.src, &ip->ip_src.s_addr, sizeof(uint32_t)); in nextproto4_cksum()
152 if (IP_HL(ip) == 5) in nextproto4_cksum()
153 UNALIGNED_MEMCPY(&ph.dst, &ip->ip_dst.s_addr, sizeof(uint32_t)); in nextproto4_cksum()
155 ph.dst = ip_finddst(ndo, ip); in nextproto4_cksum()
315 const struct ip *ip; member
345 (const u_char *)ipds->ip, in ip_print_demux()
368 sctp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); in ip_print_demux()
372 dccp_print(ndo, ipds->cp, (const u_char *)ipds->ip, ipds->len); in ip_print_demux()
377 tcp_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip, in ip_print_demux()
383 udp_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip, in ip_print_demux()
389 icmp_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip, in ip_print_demux()
423 ospf_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); in ip_print_demux()
467 ipaddr_string(ndo, &ipds->ip->ip_src), in ip_print_demux()
468 ipaddr_string(ndo, &ipds->ip->ip_dst))); in ip_print_demux()
469 carp_print(ndo, ipds->cp, ipds->len, ipds->ip->ip_ttl); in ip_print_demux()
473 ipaddr_string(ndo, &ipds->ip->ip_src), in ip_print_demux()
474 ipaddr_string(ndo, &ipds->ip->ip_dst))); in ip_print_demux()
476 (const u_char *)ipds->ip, ipds->ip->ip_ttl); in ip_print_demux()
481 pgm_print(ndo, ipds->cp, ipds->len, (const u_char *)ipds->ip); in ip_print_demux()
502 ipd.ip = (const struct ip *)bp2; in ip_print_inner()
529 ipds->ip = (const struct ip *)bp; in ip_print()
530 ND_TCHECK(ipds->ip->ip_vhl); in ip_print()
531 if (IP_V(ipds->ip) != 4) { /* print version if != 4 */ in ip_print()
532 if (IP_V(ipds->ip) == 6) in ip_print()
535 ND_PRINT((ndo, "IP%u ", IP_V(ipds->ip))); in ip_print()
540 ND_TCHECK(*ipds->ip); in ip_print()
541 if (length < sizeof (struct ip)) { in ip_print()
545 hlen = IP_HL(ipds->ip) * 4; in ip_print()
546 if (hlen < sizeof (struct ip)) { in ip_print()
551 ipds->len = EXTRACT_16BITS(&ipds->ip->ip_len); in ip_print()
580 ipds->off = EXTRACT_16BITS(&ipds->ip->ip_off); in ip_print()
583 ND_PRINT((ndo, "(tos 0x%x", (int)ipds->ip->ip_tos)); in ip_print()
585 if (ipds->ip->ip_tos & 0x03) { in ip_print()
586 switch (ipds->ip->ip_tos & 0x03) { in ip_print()
598 if (ipds->ip->ip_ttl >= 1) in ip_print()
599 ND_PRINT((ndo, ", ttl %u", ipds->ip->ip_ttl)); in ip_print()
608 EXTRACT_16BITS(&ipds->ip->ip_id), in ip_print()
611 tok2str(ipproto_values,"unknown",ipds->ip->ip_p), in ip_print()
612 ipds->ip->ip_p)); in ip_print()
614 ND_PRINT((ndo, ", length %u", EXTRACT_16BITS(&ipds->ip->ip_len))); in ip_print()
616 if ((hlen - sizeof(struct ip)) > 0) { in ip_print()
618 ip_optprint(ndo, (u_char *)(ipds->ip + 1), hlen - sizeof(struct ip)); in ip_print()
622 if (!ndo->ndo_Kflag && (u_char *)ipds->ip + hlen <= ndo->ndo_snapend) { in ip_print()
623 vec[0].ptr = (const uint8_t *)(void *)ipds->ip; in ip_print()
627 ip_sum = EXTRACT_16BITS(&ipds->ip->ip_sum); in ip_print()
641 ipds->cp = (const u_char *)ipds->ip + hlen; in ip_print()
642 ipds->nh = ipds->ip->ip_p; in ip_print()
647 ipaddr_string(ndo, &ipds->ip->ip_src), in ip_print()
648 ipaddr_string(ndo, &ipds->ip->ip_dst))); in ip_print()
661 ND_PRINT((ndo, "%s > %s:", ipaddr_string(ndo, &ipds->ip->ip_src), in ip_print()
662 ipaddr_string(ndo, &ipds->ip->ip_dst))); in ip_print()
663 if (!ndo->ndo_nflag && (proto = getprotobynumber(ipds->ip->ip_p)) != NULL) in ip_print()
666 ND_PRINT((ndo, " ip-proto-%d", ipds->ip->ip_p)); in ip_print()
679 struct ip hdr; in ipN_print()