Home | History | Annotate | Download | only in tcpdump

Lines Matching full:ipds

376 	       struct ip_print_demux_state *ipds)
381 switch (ipds->nh) {
384 ipds->nh = *ipds->cp;
385 ipds->advance = ah_print(ipds->cp);
386 if (ipds->advance <= 0)
388 ipds->cp += ipds->advance;
389 ipds->len -= ipds->advance;
395 ipds->advance = esp_print(ndo, ipds->cp, ipds->len,
396 (const u_char *)ipds->ip,
398 if (ipds->advance <= 0)
400 ipds->cp += ipds->advance;
401 ipds->len -= ipds->advance + padlen;
402 ipds->nh = enh & 0xff;
409 ipds->advance = ipcomp_print(ipds->cp, &enh);
410 if (ipds->advance <= 0)
412 ipds->cp += ipds->advance;
413 ipds->len -= ipds->advance;
414 ipds->nh = enh & 0xff;
419 sctp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len);
423 dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len);
428 tcp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
429 ipds->off & (IP_MF|IP_OFFMASK));
434 udp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
435 ipds->off & (IP_MF|IP_OFFMASK));
440 icmp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
441 ipds->off & (IP_MF|IP_OFFMASK));
458 igrp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
462 eigrp_print(ipds->cp, ipds->len);
466 ND_PRINT((ndo, " nd %d", ipds->len));
470 egp_print(ipds->cp, ipds->len);
474 ospf_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
478 igmp_print(ipds->cp, ipds->len);
483 ip_print(gndo, ipds->cp, ipds->len);
493 ip6_print(ipds->cp, ipds->len);
498 rsvp_print(ipds->cp, ipds->len);
503 gre_print(ipds->cp, ipds->len);
507 mobile_print(ipds->cp, ipds->len);
511 pim_print(ipds->cp, ipds->len);
515 vrrp_print(ipds->cp, ipds->len, ipds->ip->ip_ttl);
519 pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip);
523 if ((proto = getprotobynumber(ipds->nh)) != NULL)
526 ND_PRINT((ndo, " ip-proto-%d", ipds->nh));
527 ND_PRINT((ndo, " %d", ipds->len));
560 struct ip_print_demux_state *ipds=&ipd;
566 ipds->ip = (const struct ip *)bp;
567 if (IP_V(ipds->ip) != 4) { /* print version if != 4 */
568 printf("IP%u ", IP_V(ipds->ip));
569 if (IP_V(ipds->ip) == 6)
575 if ((u_char *)(ipds->ip + 1) > snapend) {
583 hlen = IP_HL(ipds->ip) * 4;
589 ipds->len = EXTRACT_16BITS(&ipds->ip->ip_len);
590 if (length < ipds->len)
592 ipds->len - length);
593 if (ipds->len < hlen) {
595 if (ipds->len) {
596 (void)printf("bad-len %u", ipds->len);
601 ipds->len = length;
604 (void)printf("bad-len %u", ipds->len);
612 ipend = bp + ipds->len;
616 ipds->len -= hlen;
618 ipds->off = EXTRACT_16BITS(&ipds->ip->ip_off);
621 (void)printf("(tos 0x%x", (int)ipds->ip->ip_tos);
623 if (ipds->ip->ip_tos & 0x03) {
624 switch (ipds->ip->ip_tos & 0x03) {
636 if (ipds->ip->ip_ttl >= 1)
637 (void)printf(", ttl %u", ipds->ip->ip_ttl);
646 EXTRACT_16BITS(&ipds->ip->ip_id),
647 (ipds->off & 0x1fff) * 8,
648 bittok2str(ip_frag_values, "none", ipds->off&0xe000),
649 tok2str(ipproto_values,"unknown",ipds->ip->ip_p),
650 ipds->ip->ip_p);
652 (void)printf(", length %u", EXTRACT_16BITS(&ipds->ip->ip_len));
656 ip_optprint((u_char *)(ipds->ip + 1), hlen - sizeof(struct ip));
660 if ((u_char *)ipds->ip + hlen <= snapend) {
661 sum = in_cksum((const u_short *)ipds
663 ip_sum = EXTRACT_16BITS(&ipds->ip->ip_sum);
676 if ((ipds->off & 0x1fff) == 0) {
677 ipds->cp = (const u_char *)ipds->ip + hlen;
678 ipds->nh = ipds->ip->ip_p;
680 if (ipds->nh != IPPROTO_TCP && ipds->nh != IPPROTO_UDP &&
681 ipds->nh != IPPROTO_SCTP && ipds->nh != IPPROTO_DCCP) {
683 ipaddr_string(&ipds->ip->ip_src),
684 ipaddr_string(&ipds->ip->ip_dst));
686 ip_print_demux(ndo, ipds);
696 if (ipds->off & 0x1fff) {
697 (void)printf("%s > %s:", ipaddr_string(&ipds->ip->ip_src),
698 ipaddr_string(&ipds->ip->ip_dst));
699 if ((proto = getprotobynumber(ipds->ip->ip_p)) != NULL)
702 (void)printf(" ip-proto-%d", ipds->ip->ip_p);