282 break;
283 case IPPROTO_UDP:
284 (void) interpret_udp(flags,
285 (struct udphdr *)data, iplen, fraglen);
286 break;
287
288 case IPPROTO_IDP:
289 case IPPROTO_HELLO:
290 case IPPROTO_ND:
291 case IPPROTO_RAW:
292 break;
293 case IPPROTO_IPV6: /* IPV6 encap */
294 /* LINTED: alignment */
295 (void) interpret_ipv6(flags, (ip6_t *)data,
296 iplen);
297 break;
298 case IPPROTO_SCTP:
299 (void) interpret_sctp(flags,
300 (struct sctp_hdr *)data, iplen, fraglen);
301 break;
302 }
303 }
304 }
305
306 encap_levels--;
307 return (iplen);
308 }
309
310 int
311 interpret_ipv6(int flags, const ip6_t *ip6h, int fraglen)
312 {
313 uint8_t *data;
314 int hdrlen, iplen;
315 int version, flow, class;
316 uchar_t proto;
317 boolean_t isfrag = B_FALSE;
318 uint8_t extmask;
319 /*
320 * The print_srcname and print_dstname strings are the hostname
321 * parts of the verbose IPv6 header output, including the comma
460 (void) interpret_udp(flags, (struct udphdr *)data,
461 iplen, fraglen);
462 break;
463 case IPPROTO_IDP:
464 case IPPROTO_HELLO:
465 case IPPROTO_ND:
466 case IPPROTO_RAW:
467 break;
468 case IPPROTO_IPV6:
469 /* LINTED: alignment */
470 (void) interpret_ipv6(flags, (const ip6_t *)data,
471 iplen);
472 break;
473 case IPPROTO_SCTP:
474 (void) interpret_sctp(flags, (struct sctp_hdr *)data,
475 iplen, fraglen);
476 break;
477 case IPPROTO_OSPF:
478 interpret_ospf6(flags, data, iplen, fraglen);
479 break;
480 }
481 }
482
483 return (iplen);
484 }
485
486 /*
487 * ip_ext: data including the extension header.
488 * iplen: length of the data remaining in the packet.
489 * Returns a mask of IPv6 extension headers it processed.
490 */
491 uint8_t
492 print_ipv6_extensions(int flags, uint8_t **hdr, uint8_t *next, int *iplen,
493 int *fraglen)
494 {
495 uint8_t *data_ptr;
496 uchar_t proto = *next;
497 boolean_t is_extension_header;
498 struct ip6_hbh *ipv6ext_hbh;
499 struct ip6_dest *ipv6ext_dest;
713 case IPPROTO_FRAGMENT: return ("IPv6-Frag");
714 case IPPROTO_RSVP: return ("RSVP");
715 case IPPROTO_ENCAP: return ("IP-in-IP");
716 case IPPROTO_AH: return ("AH");
717 case IPPROTO_ESP: return ("ESP");
718 case IPPROTO_ICMP: return ("ICMP");
719 case IPPROTO_ICMPV6: return ("ICMPv6");
720 case IPPROTO_DSTOPTS: return ("IPv6-DstOpts");
721 case IPPROTO_IGMP: return ("IGMP");
722 case IPPROTO_GGP: return ("GGP");
723 case IPPROTO_TCP: return ("TCP");
724 case IPPROTO_EGP: return ("EGP");
725 case IPPROTO_PUP: return ("PUP");
726 case IPPROTO_UDP: return ("UDP");
727 case IPPROTO_IDP: return ("IDP");
728 case IPPROTO_HELLO: return ("HELLO");
729 case IPPROTO_ND: return ("ND");
730 case IPPROTO_EON: return ("EON");
731 case IPPROTO_RAW: return ("RAW");
732 case IPPROTO_OSPF: return ("OSPF");
733 default: return ("");
734 }
735 }
736
737 static void
738 prt_routing_hdr(int flags, const struct ip6_rthdr *ipv6ext_rthdr)
739 {
740 uint8_t nxt_hdr;
741 uint8_t type;
742 uint32_t len;
743 uint8_t segleft;
744 uint32_t numaddrs;
745 int i;
746 struct ip6_rthdr0 *ipv6ext_rthdr0;
747 struct in6_addr *addrs;
748 char addr[INET6_ADDRSTRLEN];
749
750 /* in summary mode, we don't do anything. */
751 if (flags & F_SUM) {
752 return;
|
282 break;
283 case IPPROTO_UDP:
284 (void) interpret_udp(flags,
285 (struct udphdr *)data, iplen, fraglen);
286 break;
287
288 case IPPROTO_IDP:
289 case IPPROTO_HELLO:
290 case IPPROTO_ND:
291 case IPPROTO_RAW:
292 break;
293 case IPPROTO_IPV6: /* IPV6 encap */
294 /* LINTED: alignment */
295 (void) interpret_ipv6(flags, (ip6_t *)data,
296 iplen);
297 break;
298 case IPPROTO_SCTP:
299 (void) interpret_sctp(flags,
300 (struct sctp_hdr *)data, iplen, fraglen);
301 break;
302 case IPPROTO_DCCP:
303 (void) interpret_dccp(flags,
304 (struct dccphdr *)data, iplen, fraglen);
305 break;
306 }
307 }
308 }
309
310 encap_levels--;
311 return (iplen);
312 }
313
314 int
315 interpret_ipv6(int flags, const ip6_t *ip6h, int fraglen)
316 {
317 uint8_t *data;
318 int hdrlen, iplen;
319 int version, flow, class;
320 uchar_t proto;
321 boolean_t isfrag = B_FALSE;
322 uint8_t extmask;
323 /*
324 * The print_srcname and print_dstname strings are the hostname
325 * parts of the verbose IPv6 header output, including the comma
464 (void) interpret_udp(flags, (struct udphdr *)data,
465 iplen, fraglen);
466 break;
467 case IPPROTO_IDP:
468 case IPPROTO_HELLO:
469 case IPPROTO_ND:
470 case IPPROTO_RAW:
471 break;
472 case IPPROTO_IPV6:
473 /* LINTED: alignment */
474 (void) interpret_ipv6(flags, (const ip6_t *)data,
475 iplen);
476 break;
477 case IPPROTO_SCTP:
478 (void) interpret_sctp(flags, (struct sctp_hdr *)data,
479 iplen, fraglen);
480 break;
481 case IPPROTO_OSPF:
482 interpret_ospf6(flags, data, iplen, fraglen);
483 break;
484 case IPPROTO_DCCP:
485 (void) interpret_dccp(flags, (struct dccphdr *)data,
486 iplen, fraglen);
487 break;
488 }
489 }
490
491 return (iplen);
492 }
493
494 /*
495 * ip_ext: data including the extension header.
496 * iplen: length of the data remaining in the packet.
497 * Returns a mask of IPv6 extension headers it processed.
498 */
499 uint8_t
500 print_ipv6_extensions(int flags, uint8_t **hdr, uint8_t *next, int *iplen,
501 int *fraglen)
502 {
503 uint8_t *data_ptr;
504 uchar_t proto = *next;
505 boolean_t is_extension_header;
506 struct ip6_hbh *ipv6ext_hbh;
507 struct ip6_dest *ipv6ext_dest;
721 case IPPROTO_FRAGMENT: return ("IPv6-Frag");
722 case IPPROTO_RSVP: return ("RSVP");
723 case IPPROTO_ENCAP: return ("IP-in-IP");
724 case IPPROTO_AH: return ("AH");
725 case IPPROTO_ESP: return ("ESP");
726 case IPPROTO_ICMP: return ("ICMP");
727 case IPPROTO_ICMPV6: return ("ICMPv6");
728 case IPPROTO_DSTOPTS: return ("IPv6-DstOpts");
729 case IPPROTO_IGMP: return ("IGMP");
730 case IPPROTO_GGP: return ("GGP");
731 case IPPROTO_TCP: return ("TCP");
732 case IPPROTO_EGP: return ("EGP");
733 case IPPROTO_PUP: return ("PUP");
734 case IPPROTO_UDP: return ("UDP");
735 case IPPROTO_IDP: return ("IDP");
736 case IPPROTO_HELLO: return ("HELLO");
737 case IPPROTO_ND: return ("ND");
738 case IPPROTO_EON: return ("EON");
739 case IPPROTO_RAW: return ("RAW");
740 case IPPROTO_OSPF: return ("OSPF");
741 case IPPROTO_DCCP: return ("DCCP");
742 default: return ("");
743 }
744 }
745
746 static void
747 prt_routing_hdr(int flags, const struct ip6_rthdr *ipv6ext_rthdr)
748 {
749 uint8_t nxt_hdr;
750 uint8_t type;
751 uint32_t len;
752 uint8_t segleft;
753 uint32_t numaddrs;
754 int i;
755 struct ip6_rthdr0 *ipv6ext_rthdr0;
756 struct in6_addr *addrs;
757 char addr[INET6_ADDRSTRLEN];
758
759 /* in summary mode, we don't do anything. */
760 if (flags & F_SUM) {
761 return;
|