• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/tcpdump-4.4.0/

Lines Matching defs:ip

24     "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.159 2007-09-14 01:29:28 guy Exp $ (LBL)";
41 #include "ip.h"
91 ip_finddst(const struct ip *ip)
98 cp = (const u_char *)(ip + 1);
99 length = (IP_HL(ip) << 2) - sizeof(struct ip);
128 memcpy(&retval, &ip->ip_dst.s_addr, sizeof(u_int32_t));
136 nextproto4_cksum(const struct ip *ip, const u_int8_t *data,
152 memcpy(&ph.src, &ip->ip_src.s_addr, sizeof(u_int32_t));
153 if (IP_HL(ip) == 5)
154 memcpy(&ph.dst, &ip->ip_dst.s_addr, sizeof(u_int32_t));
156 ph.dst = ip_finddst(ip);
301 printf("[|ip]");
314 const struct ip *ip;
344 (const u_char *)ipds->ip,
367 sctp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len);
371 dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len);
376 tcp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
382 udp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
388 icmp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
406 igrp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
422 ospf_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
430 /* DVMRP multicast tunnel (ip-in-ip encapsulation) */
440 /* ip6-in-ip encapsulation */
468 ipaddr_string(&ipds->ip->ip_src),
469 ipaddr_string(&ipds->ip->ip_dst));
470 carp_print(ipds->cp, ipds->len, ipds->ip->ip_ttl);
474 ipaddr_string(&ipds->ip->ip_src),
475 ipaddr_string(&ipds->ip->ip_dst));
476 vrrp_print(ipds->cp, ipds->len, ipds->ip->ip_ttl);
481 pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
488 ND_PRINT((ndo, " ip-proto-%d", ipds->nh));
502 ipd.ip = (const struct ip *)bp2;
529 ipds->ip = (const struct ip *)bp;
530 if (IP_V(ipds->ip) != 4) { /* print version if != 4 */
531 printf("IP%u ", IP_V(ipds->ip));
532 if (IP_V(ipds->ip) == 6)
538 if ((u_char *)(ipds->ip + 1) > ndo->ndo_snapend) {
539 printf("[|ip]");
542 if (length < sizeof (struct ip)) {
543 (void)printf("truncated-ip %u", length);
546 hlen = IP_HL(ipds->ip) * 4;
547 if (hlen < sizeof (struct ip)) {
552 ipds->len = EXTRACT_16BITS(&ipds->ip->ip_len);
554 (void)printf("truncated-ip - %u bytes missing! ",
581 ipds->off = EXTRACT_16BITS(&ipds->ip->ip_off);
584 (void)printf("(tos 0x%x", (int)ipds->ip->ip_tos);
586 if (ipds->ip->ip_tos & 0x03) {
587 switch (ipds->ip->ip_tos & 0x03) {
599 if (ipds->ip->ip_ttl >= 1)
600 (void)printf(", ttl %u", ipds->ip->ip_ttl);
609 EXTRACT_16BITS(&ipds->ip->ip_id),
612 tok2str(ipproto_values,"unknown",ipds->ip->ip_p),
613 ipds->ip->ip_p);
615 (void)printf(", length %u", EXTRACT_16BITS(&ipds->ip->ip_len));
617 if ((hlen - sizeof(struct ip)) > 0) {
619 ip_optprint((u_char *)(ipds->ip + 1), hlen - sizeof(struct ip));
623 if (!Kflag && (u_char *)ipds->ip + hlen <= ndo->ndo_snapend) {
624 vec[0].ptr = (const u_int8_t *)(void *)ipds->ip;
628 ip_sum = EXTRACT_16BITS(&ipds->ip->ip_sum);
642 ipds->cp = (const u_char *)ipds->ip + hlen;
643 ipds->nh = ipds->ip->ip_p;
648 ipaddr_string(&ipds->ip->ip_src),
649 ipaddr_string(&ipds->ip->ip_dst));
658 * next level protocol header. print the ip addr
662 (void)printf("%s > %s:", ipaddr_string(&ipds->ip->ip_src),
663 ipaddr_string(&ipds->ip->ip_dst));
664 if (!ndo->ndo_nflag && (proto = getprotobynumber(ipds->ip->ip_p)) != NULL)
667 (void)printf(" ip-proto-%d", ipds->ip->ip_p);
675 struct ip *ip, hdr;
677 ip = (struct ip *)bp;
679 (void)printf("truncated-ip %d", length);
682 memcpy (&hdr, (char *)ip, 4);
693 (void)printf("unknown ip %d", IP_V(&hdr));