2 * netsniff-ng - the packet sniffing beast
3 * Copyright 2012 Markus Amend <markus@netsniff-ng.org>
4 * Subject to the GPL, version 2.
6 * ICMPv6 described in RFC4443, RFC2710, RFC4861, RFC2894,
7 * RFC4620, RFC3122, RFC3810, RFC3775, RFC3971, RFC4065
9 * Look also for an good overview:
10 * http://www.iana.org/assignments/icmpv6-parameters
15 #include <netinet/in.h>
16 #include <arpa/inet.h>
17 #include <asm/byteorder.h>
21 #include "dissector_eth.h"
25 #define icmpv6_code_range_valid(code, sarr) ((code) < array_size((sarr)))
27 struct icmpv6_general_hdr
{
33 /* for type 0x01 and 0x03 */
34 struct icmpv6_type_1_3
{
36 uint8_t invoking_pkt
[0];
39 struct icmpv6_type_2
{
41 uint8_t invoking_pkt
[0];
44 struct icmpv6_type_4
{
46 uint8_t invoking_pkt
[0];
49 struct icmpv6_type_128_129
{
56 struct icmpv6_type_130_131_132
{
59 struct in6_addr ipv6_addr
;
63 struct icmpv6_type_130_mldv2
{
67 struct in6_addr ipv6_addr
[0];
70 /* Neighbor Discovery msg */
71 struct icmpv6_type_133_141_142
{
76 struct icmpv6_type_134
{
77 uint8_t cur_hop_limit
;
79 uint16_t router_lifetime
;
80 uint32_t reachable_time
;
81 uint32_t retrans_timer
;
85 struct icmpv6_type_135
{
87 struct in6_addr ipv6_addr
;
91 struct icmpv6_type_136
{
93 struct in6_addr ipv6_addr
;
97 struct icmpv6_type_137
{
99 struct in6_addr ipv6_targ_addr
;
100 struct in6_addr ipv6_dest_addr
;
104 struct icmpv6_neighb_disc_ops_general
{
110 struct icmpv6_neighb_disc_ops_type_1_2
{
111 uint8_t link_lay_addr
[0];
114 struct icmpv6_neighb_disc_ops_type_3
{
117 uint32_t valid_lifetime
;
118 uint32_t preferred_lifetime
;
120 struct in6_addr prefix
;
123 struct icmpv6_neighb_disc_ops_type_4
{
126 uint8_t ip_hdr_data
[0];
129 struct icmpv6_neighb_disc_ops_type_5
{
134 struct icmpv6_neighb_disc_ops_type_9_10
{
137 uint8_t ip_hdr_data
[0];
140 struct icmpv6_neighb_disc_ops_type_15
{
147 struct icmpv6_neighb_disc_ops_type_16
{
154 struct icmpv6_neighb_disc_ops_type_17
{
160 struct icmpv6_neighb_disc_ops_type_17_1
{
162 struct in6_addr ipv6_addr
;
165 struct icmpv6_neighb_disc_ops_type_17_2
{
166 struct in6_addr ipv6_addr
;
169 struct icmpv6_neighb_disc_ops_type_19
{
173 /* end Neighbor Discovery msg */
175 struct icmpv6_type_138
{
183 /* Node Information Queries */
184 struct icmpv6_type_139_140
{
190 /* end Node Information Queries */
193 struct icmpv6_type_143
{
199 struct icmpv6_mldv2_addr_rec
{
201 uint8_t aux_data_len
;
203 struct in6_addr multic_addr
;
204 struct in6_addr src_addr
[0];
206 /* end MLDv2 report */
208 /* ICMP Mobility Support */
209 struct icmpv6_type_144_146
{
214 struct icmpv6_type_145
{
217 struct in6_addr home_agent_addr
[0];
220 struct icmpv6_type_147
{
225 /* end ICMP Mobility Support */
227 /* SEcure Neighbor Discovery */
228 struct icmpv6_type_148
{
234 struct icmpv6_type_149
{
241 /* end SEcure Neighbor Discovery */
243 struct icmpv6_type_150
{
245 uint32_t subtype_res
;
247 #if defined(__LITTLE_ENDIAN_BITFIELD)
250 #elif defined(__BIG_ENDIAN_BITFIELD)
254 # error "Please fix <asm/byteorder.h>"
261 /* Multicast Router Discovery */
262 struct icmpv6_type_151
{
267 struct icmpv6_type_152
{
271 struct icmpv6_type_153
{
274 /* end Multicast Router Discovery */
276 struct icmpv6_type_154
{
283 static int8_t print_ipv6_addr_list(struct pkt_buff
*pkt
, uint8_t nr_addr
)
285 char address
[INET6_ADDRSTRLEN
];
286 struct in6_addr
*addr
;
289 addr
= (struct in6_addr
*) pkt_pull(pkt
, sizeof(*addr
));
293 tprintf("\n\t Address: %s",
294 inet_ntop(AF_INET6
, addr
, address
,
301 static char *icmpv6_mcast_rec_types
[] = {
304 "CHANGE_TO_INCLUDE_MODE",
305 "CHANGE_TO_EXCLUDE_MODE",
310 static int8_t dissect_icmpv6_mcast_rec(struct pkt_buff
*pkt
,
313 uint16_t nr_src
, aux_data_len_bytes
;
314 struct icmpv6_mldv2_addr_rec
*addr_rec
;
317 addr_rec
= (struct icmpv6_mldv2_addr_rec
*)
318 pkt_pull(pkt
,sizeof(*addr_rec
));
319 if (addr_rec
== NULL
)
321 aux_data_len_bytes
= addr_rec
->aux_data_len
* 4;
322 nr_src
= ntohs(addr_rec
->nr_src
);
324 tprintf(", Rec Type %s (%u)",
325 icmpv6_code_range_valid(addr_rec
->rec_type
- 1,
326 icmpv6_mcast_rec_types
) ?
327 icmpv6_mcast_rec_types
[addr_rec
->rec_type
- 1]
328 : "Unknown", addr_rec
->rec_type
);
329 if (aux_data_len_bytes
> pkt_len(pkt
)) {
330 tprintf(", Aux Data Len (%u, %u bytes) %s",
331 addr_rec
->aux_data_len
,
333 colorize_start_full(black
, red
) "invalid"
337 tprintf(", Aux Data Len (%u, %u bytes)",addr_rec
->aux_data_len
,
339 tprintf(", Nr. of Sources (%u)",nr_src
);
341 if(!print_ipv6_addr_list(pkt
, nr_src
))
344 if (aux_data_len_bytes
> pkt_len(pkt
)) {
345 tprintf("\nAux Data Len %s",
346 colorize_start_full(black
, red
) "invalid"
351 tprintf(", Aux Data: ");
352 while (aux_data_len_bytes
--) {
353 tprintf("%x", *pkt_pull(pkt
,1));
360 static int8_t dissect_neighb_disc_ops_1(struct pkt_buff
*pkt
,
363 struct icmpv6_neighb_disc_ops_type_1_2
*icmp_neighb_disc_1
;
365 icmp_neighb_disc_1
= (struct icmpv6_neighb_disc_ops_type_1_2
*)
366 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_1
));
367 if (icmp_neighb_disc_1
== NULL
)
369 len
-= sizeof(*icmp_neighb_disc_1
);
373 tprintf("Address 0x");
376 tprintf("%x", *pkt_pull(pkt
,1));
382 static int8_t dissect_neighb_disc_ops_2(struct pkt_buff
*pkt
,
385 return dissect_neighb_disc_ops_1(pkt
, len
);
388 static int8_t dissect_neighb_disc_ops_3(struct pkt_buff
*pkt
,
391 char address
[INET6_ADDRSTRLEN
];
392 struct icmpv6_neighb_disc_ops_type_3
*icmp_neighb_disc_3
;
394 icmp_neighb_disc_3
= (struct icmpv6_neighb_disc_ops_type_3
*)
395 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_3
));
396 if (icmp_neighb_disc_3
== NULL
)
398 len
-= sizeof(*icmp_neighb_disc_3
);
402 tprintf("Prefix Len (%u) ",icmp_neighb_disc_3
->prefix_len
);
403 tprintf("L (%u) A (%u) Res1 (0x%x) ",icmp_neighb_disc_3
->l_a_res1
>> 7,
404 (icmp_neighb_disc_3
->l_a_res1
>> 7) & 0x1,
405 icmp_neighb_disc_3
->l_a_res1
& 0x3F);
406 tprintf("Valid Lifetime (%us) ",
407 ntohl(icmp_neighb_disc_3
->valid_lifetime
));
408 tprintf("Preferred Lifetime (%us) ",
409 ntohl(icmp_neighb_disc_3
->preferred_lifetime
));
410 tprintf("Reserved2 (0x%x) ",
411 ntohl(icmp_neighb_disc_3
->res2
));
412 tprintf("Prefix: %s ",
413 inet_ntop(AF_INET6
,&icmp_neighb_disc_3
->prefix
,
414 address
, sizeof(address
)));
419 static int8_t dissect_neighb_disc_ops_4(struct pkt_buff
*pkt
,
422 struct icmpv6_neighb_disc_ops_type_4
*icmp_neighb_disc_4
;
424 icmp_neighb_disc_4
= (struct icmpv6_neighb_disc_ops_type_4
*)
425 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_4
));
426 if (icmp_neighb_disc_4
== NULL
)
428 len
-= sizeof(*icmp_neighb_disc_4
);
432 tprintf("Reserved 1 (0x%x) ", ntohs(icmp_neighb_disc_4
->res1
));
433 tprintf("Reserved 2 (0x%x) ", ntohl(icmp_neighb_disc_4
->res2
));
434 tprintf("IP header + data ");
437 tprintf("%x", *pkt_pull(pkt
,1));
443 static int8_t dissect_neighb_disc_ops_5(struct pkt_buff
*pkt
,
446 struct icmpv6_neighb_disc_ops_type_5
*icmp_neighb_disc_5
;
448 icmp_neighb_disc_5
= (struct icmpv6_neighb_disc_ops_type_5
*)
449 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_5
));
450 if (icmp_neighb_disc_5
== NULL
)
452 len
-= sizeof(*icmp_neighb_disc_5
);
456 tprintf("Reserved (0x%x) ", ntohs(icmp_neighb_disc_5
->res1
));
457 tprintf("MTU (%u)", ntohl(icmp_neighb_disc_5
->MTU
));
462 static int8_t dissect_neighb_disc_ops_9(struct pkt_buff
*pkt
,
465 struct icmpv6_neighb_disc_ops_type_9_10
*icmp_neighb_disc_9
;
467 icmp_neighb_disc_9
= (struct icmpv6_neighb_disc_ops_type_9_10
*)
468 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_9
));
469 if (icmp_neighb_disc_9
== NULL
)
471 len
-= sizeof(*icmp_neighb_disc_9
);
475 tprintf("Reserved 1 (0x%x) ", ntohs(icmp_neighb_disc_9
->res1
));
476 tprintf("Reserved 2 (0x%x) ", ntohl(icmp_neighb_disc_9
->res2
));
478 return print_ipv6_addr_list(pkt
, len
/ sizeof(struct in6_addr
));
481 static int8_t dissect_neighb_disc_ops_10(struct pkt_buff
*pkt
,
484 return dissect_neighb_disc_ops_9(pkt
, len
);
487 static char *icmpv6_neighb_disc_ops_15_name
[] = {
488 "DER Encoded X.501 Name",
492 static int8_t dissect_neighb_disc_ops_15(struct pkt_buff
*pkt
,
497 struct icmpv6_neighb_disc_ops_type_15
*icmp_neighb_disc_15
;
499 icmp_neighb_disc_15
= (struct icmpv6_neighb_disc_ops_type_15
*)
500 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_15
));
501 if (icmp_neighb_disc_15
== NULL
)
503 len
-= sizeof(*icmp_neighb_disc_15
);
506 pad_len
= icmp_neighb_disc_15
->pad_len
;
508 tprintf("Name Type %s (%u) ",
509 icmpv6_code_range_valid(icmp_neighb_disc_15
->name_type
- 1,
510 icmpv6_neighb_disc_ops_15_name
) ?
511 icmpv6_neighb_disc_ops_15_name
[
512 icmp_neighb_disc_15
->name_type
- 1] : "Unknown",
513 icmp_neighb_disc_15
->name_type
);
515 tprintf("Pad Len (%u, invalid)\n%s", pad_len
,
516 colorize_start_full(black
, red
)
517 "Skip Option" colorize_end());
522 tprintf("Pad Len (%u) ", pad_len
);
524 name_len
= len
- pad_len
;
528 tprintf("%c", *pkt_pull(pkt
,1));
532 tprintf("Padding (");
535 tprintf("%x", *pkt_pull(pkt
,1));
542 static char *icmpv6_neighb_disc_ops_16_cert
[] = {
543 "X.509v3 Certificate",
546 static int8_t dissect_neighb_disc_ops_16(struct pkt_buff
*pkt
,
549 struct icmpv6_neighb_disc_ops_type_16
*icmp_neighb_disc_16
;
551 icmp_neighb_disc_16
= (struct icmpv6_neighb_disc_ops_type_16
*)
552 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_16
));
553 if (icmp_neighb_disc_16
== NULL
)
555 len
-= sizeof(*icmp_neighb_disc_16
);
559 tprintf("Cert Type %s (%u) ",
560 icmpv6_code_range_valid(icmp_neighb_disc_16
->cert_type
- 1,
561 icmpv6_neighb_disc_ops_16_cert
) ?
562 icmpv6_neighb_disc_ops_16_cert
[
563 icmp_neighb_disc_16
->cert_type
- 1] : "Unknown",
564 icmp_neighb_disc_16
->cert_type
);
565 tprintf("Res (0x%x) ", icmp_neighb_disc_16
->res
);
567 tprintf("Certificate + Padding (");
569 tprintf("%x", *pkt_pull(pkt
,1));
576 static char *icmpv6_neighb_disc_ops_17_codes
[] = {
577 "Old Care-of Address",
578 "New Care-of Address",
583 static int8_t dissect_neighb_disc_ops_17(struct pkt_buff
*pkt
,
586 char address
[INET6_ADDRSTRLEN
];
587 struct icmpv6_neighb_disc_ops_type_17
*icmp_neighb_disc_17
;
589 icmp_neighb_disc_17
= (struct icmpv6_neighb_disc_ops_type_17
*)
590 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_17
));
591 if (icmp_neighb_disc_17
== NULL
)
593 len
-= sizeof(*icmp_neighb_disc_17
);
597 tprintf("Opt Code %s (%u) ",
598 icmpv6_code_range_valid(icmp_neighb_disc_17
->opt_code
- 1,
599 icmpv6_neighb_disc_ops_17_codes
) ?
600 icmpv6_neighb_disc_ops_17_codes
[
601 icmp_neighb_disc_17
->opt_code
- 1] : "Unknown",
602 icmp_neighb_disc_17
->opt_code
);
603 tprintf("Prefix Len (%u) ", icmp_neighb_disc_17
->prefix_len
);
605 if (len
== sizeof(struct icmpv6_neighb_disc_ops_type_17_1
)) {
606 struct icmpv6_neighb_disc_ops_type_17_1
607 *icmp_neighb_disc_17_1
;
609 icmp_neighb_disc_17_1
=
610 (struct icmpv6_neighb_disc_ops_type_17_1
*)
611 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_17_1
));
612 if (icmp_neighb_disc_17_1
== NULL
)
614 len
-= sizeof(*icmp_neighb_disc_17_1
);
618 tprintf("Res (0x%x) ",icmp_neighb_disc_17_1
->res
);
620 inet_ntop(AF_INET6
,&icmp_neighb_disc_17_1
->ipv6_addr
,
621 address
, sizeof(address
)));
623 else if (len
== sizeof(struct icmpv6_neighb_disc_ops_type_17_2
)) {
624 struct icmpv6_neighb_disc_ops_type_17_2
625 *icmp_neighb_disc_17_2
;
627 icmp_neighb_disc_17_2
=
628 (struct icmpv6_neighb_disc_ops_type_17_2
*)
629 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_17_2
));
630 if (icmp_neighb_disc_17_2
== NULL
)
632 len
-= sizeof(*icmp_neighb_disc_17_2
);
637 inet_ntop(AF_INET6
,&icmp_neighb_disc_17_2
->ipv6_addr
,
638 address
, sizeof(address
)));
641 tprintf("%s (", colorize_start_full(black
, red
)
642 "Error Wrong Length. Skip Option" colorize_end());
644 tprintf("%x", *pkt_pull(pkt
,1));
652 static char *icmpv6_neighb_disc_ops_19_codes
[] = {
653 "Wildcard requesting resolution for all nearby access points",
654 "Link-Layer Address of the New Access Point",
655 "Link-Layer Address of the MN",
656 "Link-Layer Address of the NAR",
657 "Link-Layer Address of the source of RtSolPr or PrRtAdv \
659 "The access point identified by the LLA belongs to the \
660 current interface of the router",
661 "No prefix information available for the access point \
662 identified by the LLA",
663 "No fast handover support available for the access point \
664 identified by the LLA",
667 static int8_t dissect_neighb_disc_ops_19(struct pkt_buff
*pkt
,
670 struct icmpv6_neighb_disc_ops_type_19
*icmp_neighb_disc_19
;
672 icmp_neighb_disc_19
= (struct icmpv6_neighb_disc_ops_type_19
*)
673 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_19
));
674 if (icmp_neighb_disc_19
== NULL
)
676 len
-= sizeof(*icmp_neighb_disc_19
);
680 tprintf("Opt Code %s (%u) ",
681 icmpv6_code_range_valid(icmp_neighb_disc_19
->opt_code
,
682 icmpv6_neighb_disc_ops_19_codes
) ?
683 icmpv6_neighb_disc_ops_19_codes
[
684 icmp_neighb_disc_19
->opt_code
] : "Unknown",
685 icmp_neighb_disc_19
->opt_code
);
689 tprintf("%x", *pkt_pull(pkt
,1));
696 static inline char *icmpv6_neighb_disc_ops(uint8_t code
) {
699 return "Source Link-Layer Address";
701 return "Target Link-Layer Address";
703 return "Prefix Information";
705 return "Redirected Header";
709 return "NBMA Shortcut Limit Option";
711 return "Advertisement Interval Option";
713 return "Home Agent Information Option";
715 return "Source Address List";
717 return "Target Address List";
721 return "RSA Signature option";
723 return "Timestamp option";
725 return "Nonce option";
727 return "Trust Anchor option";
729 return "Certificate option";
731 return "IP Address/Prefix Option";
733 return "New Router Prefix Information Option";
735 return "Link-layer Address Option";
737 return "Neighbor Advertisement Acknowledgment Option";
740 return "Prefix Information";
742 return "Redirected Header";
746 return "NBMA Shortcut Limit Option";
748 return "Advertisement Interval Option";
750 return "Home Agent Information Option";
752 return "Source Address List";
754 return "Target Address List";
756 return "DNS Search List Option";
758 return "Proxy Signature (PS)";
761 return "CARD Request option";
763 return "CARD Reply option";
766 return "RFC3692-style Experiment 1";
768 return "RFC3692-style Experiment 2";
774 static int8_t dissect_neighb_disc_ops(struct pkt_buff
*pkt
)
777 uint16_t ops_total_len
;
778 ssize_t ops_payl_len
;
779 struct icmpv6_neighb_disc_ops_general
*icmp_neighb_disc
;
781 while(pkt_len(pkt
)) {
782 icmp_neighb_disc
= (struct icmpv6_neighb_disc_ops_general
*)
783 pkt_pull(pkt
,sizeof(*icmp_neighb_disc
));
784 if (icmp_neighb_disc
== NULL
)
787 ops_total_len
= icmp_neighb_disc
->len
* 8;
788 pad_bytes
= (size_t) (ops_total_len
% 8);
789 ops_payl_len
= ops_total_len
- sizeof(*icmp_neighb_disc
) -
792 tprintf("\n\tOption %s (%u) ",
793 icmpv6_neighb_disc_ops(icmp_neighb_disc
->type
) ?
794 icmpv6_neighb_disc_ops(icmp_neighb_disc
->type
)
795 : "Type Unknown", icmp_neighb_disc
->type
);
796 if (ops_payl_len
> pkt_len(pkt
) || ops_payl_len
< 0) {
797 tprintf("Length (%u, %u bytes, %s%s%s) ",
798 icmp_neighb_disc
->len
,
800 colorize_start_full(black
, red
),
801 "invalid", colorize_end());
805 tprintf("Length (%u, %u bytes) ",icmp_neighb_disc
->len
,
808 switch (icmp_neighb_disc
->type
) {
810 if (!dissect_neighb_disc_ops_1(pkt
, ops_payl_len
))
814 if (!dissect_neighb_disc_ops_2(pkt
, ops_payl_len
))
818 if (!dissect_neighb_disc_ops_3(pkt
, ops_payl_len
))
822 if (!dissect_neighb_disc_ops_4(pkt
, ops_payl_len
))
826 if (!dissect_neighb_disc_ops_5(pkt
, ops_payl_len
))
829 /* Type 9 and 10 defined in
830 * http://tools.ietf.org/html/rfc3122#section-3.1
833 if (!dissect_neighb_disc_ops_9(pkt
, ops_payl_len
))
837 if (!dissect_neighb_disc_ops_10(pkt
, ops_payl_len
))
840 /* Type 15 and 16 defined in
841 * http://tools.ietf.org/html/rfc3971#section-6.4.3
842 * http://tools.ietf.org/html/rfc3971#section-6.4.4
845 if (!dissect_neighb_disc_ops_15(pkt
, ops_payl_len
))
849 if (!dissect_neighb_disc_ops_16(pkt
, ops_payl_len
))
852 /* Type 17 and 19 defined in
853 * http://tools.ietf.org/html/rfc5568#section-6.4
856 if (!dissect_neighb_disc_ops_17(pkt
, ops_payl_len
))
860 if (!dissect_neighb_disc_ops_19(pkt
, ops_payl_len
))
864 pkt_pull(pkt
, ops_payl_len
);
867 /* Skip Padding Bytes */
868 if (pad_bytes
> pkt_len(pkt
)) {
869 tprintf(" %s",colorize_start_full(black
, red
)
870 "Invalid Padding" colorize_end());
873 pkt_pull(pkt
, pad_bytes
);
879 static char *icmpv6_type_1_codes
[] = {
880 "No route to destination",
881 "Communication with destination administratively prohibited",
882 "Beyond scope of source address",
883 "Address unreachable",
885 "Source address failed ingress/egress policy",
886 "Reject route to destination",
887 "Error in Source Routing Header",
890 static int8_t dissect_icmpv6_type1(struct pkt_buff
*pkt
)
892 struct icmpv6_type_1_3
*icmp_1
;
894 icmp_1
= (struct icmpv6_type_1_3
*) pkt_pull(pkt
,sizeof(*icmp_1
));
898 tprintf(", Unused (0x%x)",ntohl(icmp_1
->unused
));
899 tprintf(" Payload include as much of invoking packet");
904 static int8_t dissect_icmpv6_type2(struct pkt_buff
*pkt
)
906 struct icmpv6_type_2
*icmp_2
;
908 icmp_2
= (struct icmpv6_type_2
*) pkt_pull(pkt
,sizeof(*icmp_2
));
912 tprintf(", MTU (0x%x)",ntohl(icmp_2
->MTU
));
913 tprintf(" Payload include as much of invoking packet");
918 static char *icmpv6_type_3_codes
[] = {
919 "Hop limit exceeded in transit",
920 "Fragment reassembly time exceeded",
923 static int8_t dissect_icmpv6_type3(struct pkt_buff
*pkt
)
925 struct icmpv6_type_1_3
*icmp_3
;
927 icmp_3
= (struct icmpv6_type_1_3
*) pkt_pull(pkt
,sizeof(*icmp_3
));
931 tprintf(", Unused (0x%x)",ntohl(icmp_3
->unused
));
932 tprintf(" Payload include as much of invoking packet");
937 static char *icmpv6_type_4_codes
[] = {
938 "Erroneous header field encountered",
939 "Unrecognized Next Header type encountered",
940 "Unrecognized IPv6 option encountered",
943 static int8_t dissect_icmpv6_type4(struct pkt_buff
*pkt
)
945 struct icmpv6_type_4
*icmp_4
;
947 icmp_4
= (struct icmpv6_type_4
*) pkt_pull(pkt
,sizeof(*icmp_4
));
951 tprintf(", Pointer (0x%x)",ntohl(icmp_4
->pointer
));
952 tprintf(" Payload include as much of invoking packet");
957 static int8_t dissect_icmpv6_type128(struct pkt_buff
*pkt
)
959 struct icmpv6_type_128_129
*icmp_128
;
961 icmp_128
= (struct icmpv6_type_128_129
*)
962 pkt_pull(pkt
,sizeof(*icmp_128
));
963 if (icmp_128
== NULL
)
966 tprintf(", ID (0x%x)",ntohs(icmp_128
->id
));
967 tprintf(", Seq. Nr. (%u)",ntohs(icmp_128
->sn
));
968 tprintf(" Payload include Data");
973 static int8_t dissect_icmpv6_type129(struct pkt_buff
*pkt
)
975 struct icmpv6_type_128_129
*icmp_129
;
977 icmp_129
= (struct icmpv6_type_128_129
*)
978 pkt_pull(pkt
,sizeof(*icmp_129
));
979 if (icmp_129
== NULL
)
982 tprintf(", ID (0x%x)",ntohs(icmp_129
->id
));
983 tprintf(", Seq. Nr. (%u)",ntohs(icmp_129
->sn
));
984 tprintf(" Payload include Data");
989 static int8_t dissect_icmpv6_type130(struct pkt_buff
*pkt
)
991 char address
[INET6_ADDRSTRLEN
];
992 uint16_t nr_src
, maxrespdel
;
993 uint8_t switch_mldv2
= 0;
994 struct icmpv6_type_130_131_132
*icmp_130
;
996 icmp_130
= (struct icmpv6_type_130_131_132
*)
997 pkt_pull(pkt
,sizeof(*icmp_130
));
998 if (icmp_130
== NULL
)
1000 maxrespdel
= ntohs(icmp_130
->maxrespdel
);
1002 if(pkt_len(pkt
) >= sizeof(struct icmpv6_type_130_mldv2
))
1006 tprintf(", MLDv2, Max Resp Delay (%ums)", maxrespdel
>> 15 ?
1007 (((maxrespdel
& 0xFFF) | 0x1000) <<
1008 (((maxrespdel
>> 12) & 0x3) + 3)) : maxrespdel
);
1010 tprintf(", Max Resp Delay (%ums)",maxrespdel
);
1011 tprintf(", Res (0x%x)",ntohs(icmp_130
->res
));
1012 tprintf(", Address: %s",
1013 inet_ntop(AF_INET6
, &icmp_130
->ipv6_addr
,
1014 address
, sizeof(address
)));
1017 struct icmpv6_type_130_mldv2
*icmp_130_mldv2
;
1019 icmp_130_mldv2
= (struct icmpv6_type_130_mldv2
*)
1020 pkt_pull(pkt
,sizeof(*icmp_130_mldv2
));
1021 if (icmp_130_mldv2
== NULL
)
1024 nr_src
= ntohs(icmp_130_mldv2
->nr_src
);
1026 tprintf(", Resv (0x%x)",icmp_130_mldv2
->resv_S_QRV
>> 4);
1027 tprintf(", S (%u)",(icmp_130_mldv2
->resv_S_QRV
>> 3) & 0x1);
1028 tprintf(", QRV (0x%x)",icmp_130_mldv2
->resv_S_QRV
& 0x3);
1029 tprintf(", QQIC (%u)",icmp_130_mldv2
->QQIC
);
1030 tprintf(", Nr Src (0x%x)",nr_src
);
1032 return print_ipv6_addr_list(pkt
, nr_src
);
1038 static int8_t dissect_icmpv6_type131(struct pkt_buff
*pkt
)
1040 char address
[INET6_ADDRSTRLEN
];
1041 struct icmpv6_type_130_131_132
*icmp_131
;
1043 icmp_131
= (struct icmpv6_type_130_131_132
*)
1044 pkt_pull(pkt
,sizeof(*icmp_131
));
1045 if (icmp_131
== NULL
)
1048 tprintf(", Max Resp Delay (%ums)",ntohs(icmp_131
->maxrespdel
));
1049 tprintf(", Res (0x%x)",ntohs(icmp_131
->res
));
1050 tprintf(", Address: %s",
1051 inet_ntop(AF_INET6
, &icmp_131
->ipv6_addr
,
1052 address
, sizeof(address
)));
1057 static inline int8_t dissect_icmpv6_type132(struct pkt_buff
*pkt
)
1059 return dissect_icmpv6_type131(pkt
);
1062 static int8_t dissect_icmpv6_type133(struct pkt_buff
*pkt
)
1064 struct icmpv6_type_133_141_142
*icmp_133
;
1066 icmp_133
= (struct icmpv6_type_133_141_142
*)
1067 pkt_pull(pkt
,sizeof(*icmp_133
));
1068 if (icmp_133
== NULL
)
1071 tprintf(", Reserved (0x%x)",ntohl(icmp_133
->res
));
1073 return dissect_neighb_disc_ops(pkt
);
1076 static int8_t dissect_icmpv6_type134(struct pkt_buff
*pkt
)
1078 struct icmpv6_type_134
*icmp_134
;
1080 icmp_134
= (struct icmpv6_type_134
*)
1081 pkt_pull(pkt
,sizeof(*icmp_134
));
1082 if (icmp_134
== NULL
)
1085 tprintf(", Cur Hop Limit (%u)",icmp_134
->cur_hop_limit
);
1086 tprintf(", M (%u) O (%u)",icmp_134
->m_o_res
>> 7,
1087 (icmp_134
->m_o_res
>> 6) & 0x1);
1088 tprintf(", Router Lifetime (%us)",ntohs(icmp_134
->router_lifetime
));
1089 tprintf(", Reachable Time (%ums)",ntohl(icmp_134
->reachable_time
));
1090 tprintf(", Retrans Timer (%ums)",ntohl(icmp_134
->retrans_timer
));
1092 return dissect_neighb_disc_ops(pkt
);
1095 static int8_t dissect_icmpv6_type135(struct pkt_buff
*pkt
)
1097 char address
[INET6_ADDRSTRLEN
];
1098 struct icmpv6_type_135
*icmp_135
;
1100 icmp_135
= (struct icmpv6_type_135
*)
1101 pkt_pull(pkt
,sizeof(*icmp_135
));
1102 if (icmp_135
== NULL
)
1105 tprintf(", Reserved (0x%x)",ntohl(icmp_135
->res
));
1106 tprintf(", Target Address: %s",
1107 inet_ntop(AF_INET6
, &icmp_135
->ipv6_addr
,
1108 address
, sizeof(address
)));
1110 return dissect_neighb_disc_ops(pkt
);
1113 static int8_t dissect_icmpv6_type136(struct pkt_buff
*pkt
)
1115 char address
[INET6_ADDRSTRLEN
];
1117 struct icmpv6_type_136
*icmp_136
;
1119 icmp_136
= (struct icmpv6_type_136
*)
1120 pkt_pull(pkt
,sizeof(*icmp_136
));
1121 if (icmp_136
== NULL
)
1123 r_s_o_res
= ntohl(icmp_136
->r_s_o_res
);
1125 tprintf(", R (%u) S (%u) O (%u) Reserved (0x%x)", r_s_o_res
>> 31,
1126 (r_s_o_res
>> 30) & 0x1, (r_s_o_res
>> 29) & 0x1,
1127 r_s_o_res
& 0x1FFFFFFF);
1128 tprintf(", Target Address: %s",
1129 inet_ntop(AF_INET6
, &icmp_136
->ipv6_addr
,
1130 address
, sizeof(address
)));
1132 return dissect_neighb_disc_ops(pkt
);
1135 static int8_t dissect_icmpv6_type137(struct pkt_buff
*pkt
)
1137 char address
[INET6_ADDRSTRLEN
];
1138 struct icmpv6_type_137
*icmp_137
;
1140 icmp_137
= (struct icmpv6_type_137
*)
1141 pkt_pull(pkt
,sizeof(*icmp_137
));
1142 if (icmp_137
== NULL
)
1145 tprintf(", Reserved (0x%x)",icmp_137
->res
);
1146 tprintf(", Target Address: %s",
1147 inet_ntop(AF_INET6
, &icmp_137
->ipv6_targ_addr
,
1148 address
, sizeof(address
)));
1149 tprintf(", Dest Address: %s",
1150 inet_ntop(AF_INET6
, &icmp_137
->ipv6_dest_addr
,
1151 address
, sizeof(address
)));
1153 return dissect_neighb_disc_ops(pkt
);
1156 static void dissect_icmpv6_rr_body(struct pkt_buff
*pkt
)
1159 * Upgrade Dissector for Message Body
1160 * from http://tools.ietf.org/html/rfc2894#section-3.2
1163 tprintf(" Message Body recognized");
1166 static inline char *icmpv6_type_138_codes(uint8_t code
) {
1169 return "Router Renumbering Command";
1171 return "Router Renumbering Result";
1173 return "Sequence Number Reset";
1179 static int8_t dissect_icmpv6_type138(struct pkt_buff
*pkt
)
1181 struct icmpv6_type_138
*icmp_138
;
1183 icmp_138
= (struct icmpv6_type_138
*)
1184 pkt_pull(pkt
,sizeof(*icmp_138
));
1185 if (icmp_138
== NULL
)
1188 tprintf(", Sequence Nr. (%u)",ntohl(icmp_138
->seq_nr
));
1189 tprintf(", Segment Nr. (%u)",icmp_138
->seg_nr
);
1190 tprintf(", T (%u) R (%u) A (%u) S (%u) P (%u) Res \
1191 (0x%x) ",icmp_138
->flags
>> 7, (icmp_138
->flags
>> 6) & 1,
1192 (icmp_138
->flags
>> 5) & 1, (icmp_138
->flags
>> 4) & 1,
1193 (icmp_138
->flags
>> 3) & 1, icmp_138
->flags
& 7);
1194 tprintf(", Max Delay (%ums)", ntohs(icmp_138
->maxdelay
));
1195 tprintf(", Res (0x%x)", ntohl(icmp_138
->res
));
1197 dissect_icmpv6_rr_body(pkt
);
1202 static void dissect_icmpv6_node_inf_data(struct pkt_buff
*pkt
)
1205 * Upgrade Dissector for Data field
1206 * http://tools.ietf.org/html/rfc4620#section-4
1209 tprintf(" Data recognized");
1212 static char *icmpv6_node_inf_qtypes
[] = {
1220 static char *icmpv6_type_139_codes
[] = {
1221 "Data contains IPv6 Address",
1222 "Data contains Name or nothing",
1223 "Data contains IPv4 Address",
1226 static int8_t dissect_icmpv6_type139(struct pkt_buff
*pkt
)
1228 char *qtype_name
= "Unknown";
1230 struct icmpv6_type_139_140
*icmp_139
;
1232 icmp_139
= (struct icmpv6_type_139_140
*)
1233 pkt_pull(pkt
,sizeof(*icmp_139
));
1234 if (icmp_139
== NULL
)
1237 qtype_nr
= ntohs(icmp_139
->qtype
);
1238 if (icmpv6_code_range_valid(qtype_nr
, icmpv6_node_inf_qtypes
))
1239 qtype_name
= icmpv6_node_inf_qtypes
[qtype_nr
];
1241 tprintf(", Qtype %s (%u)",qtype_name
, qtype_nr
);
1242 tprintf(", Flags (0x%x)",ntohs(icmp_139
->flags
));
1243 tprintf(", Nonce (0x%x)",ntohll(icmp_139
->nonce
));
1245 dissect_icmpv6_node_inf_data(pkt
);
1250 static char *icmpv6_type_140_codes
[] = {
1251 "Successfull reply",
1252 "Responder refuses answer",
1253 "Qtype is unknown to the Responder",
1256 static inline int8_t dissect_icmpv6_type140(struct pkt_buff
*pkt
)
1258 return dissect_icmpv6_type139(pkt
);
1261 static inline int8_t dissect_icmpv6_type141(struct pkt_buff
*pkt
)
1263 return dissect_icmpv6_type133(pkt
);
1266 static inline int8_t dissect_icmpv6_type142(struct pkt_buff
*pkt
)
1268 return dissect_icmpv6_type133(pkt
);
1271 static int8_t dissect_icmpv6_type143(struct pkt_buff
*pkt
)
1274 struct icmpv6_type_143
*icmp_143
;
1276 icmp_143
= (struct icmpv6_type_143
*)
1277 pkt_pull(pkt
,sizeof(*icmp_143
));
1278 if (icmp_143
== NULL
)
1280 nr_rec
= ntohs(icmp_143
->nr_rec
);
1282 tprintf(", Res (0x%x)",ntohs(icmp_143
->res
));
1283 tprintf(", Nr. Mcast Addr Records (%u)",nr_rec
);
1285 return dissect_icmpv6_mcast_rec(pkt
, nr_rec
);
1288 static int8_t dissect_icmpv6_type144(struct pkt_buff
*pkt
)
1290 struct icmpv6_type_144_146
*icmp_144
;
1292 icmp_144
= (struct icmpv6_type_144_146
*)
1293 pkt_pull(pkt
,sizeof(*icmp_144
));
1294 if (icmp_144
== NULL
)
1297 tprintf(", ID (%u)",ntohs(icmp_144
->id
));
1298 tprintf(", Res (0x%x)",ntohs(icmp_144
->res
));
1303 static int8_t dissect_icmpv6_type145(struct pkt_buff
*pkt
)
1305 struct icmpv6_type_145
*icmp_145
;
1307 icmp_145
= (struct icmpv6_type_145
*)
1308 pkt_pull(pkt
,sizeof(*icmp_145
));
1309 if (icmp_145
== NULL
)
1312 tprintf(", ID (%u)",ntohs(icmp_145
->id
));
1313 tprintf(", Res (0x%x)",ntohs(icmp_145
->res
));
1315 return print_ipv6_addr_list(pkt
, pkt_len(pkt
) /
1316 sizeof(struct in6_addr
));
1319 static inline int8_t dissect_icmpv6_type146(struct pkt_buff
*pkt
)
1321 return dissect_icmpv6_type144(pkt
);
1324 static int8_t dissect_icmpv6_type147(struct pkt_buff
*pkt
)
1327 struct icmpv6_type_147
*icmp_147
;
1329 icmp_147
= (struct icmpv6_type_147
*)
1330 pkt_pull(pkt
,sizeof(*icmp_147
));
1331 if (icmp_147
== NULL
)
1333 m_o_res
= ntohs(icmp_147
->m_o_res
);
1335 tprintf(", ID (%u)",ntohs(icmp_147
->id
));
1336 tprintf(", M (%u) O (%u) Res (0x%x)",m_o_res
>> 15,
1337 (m_o_res
>> 14) & 1, m_o_res
& 0x3FFF);
1339 return dissect_neighb_disc_ops(pkt
);
1342 static int8_t dissect_icmpv6_type148(struct pkt_buff
*pkt
)
1344 struct icmpv6_type_148
*icmp_148
;
1346 icmp_148
= (struct icmpv6_type_148
*)
1347 pkt_pull(pkt
,sizeof(*icmp_148
));
1348 if (icmp_148
== NULL
)
1351 tprintf(", ID (%u)",ntohs(icmp_148
->id
));
1352 tprintf(", Component (%u)",ntohs(icmp_148
->comp
));
1354 return dissect_neighb_disc_ops(pkt
);
1357 static int8_t dissect_icmpv6_type149(struct pkt_buff
*pkt
)
1359 struct icmpv6_type_149
*icmp_149
;
1361 icmp_149
= (struct icmpv6_type_149
*)
1362 pkt_pull(pkt
,sizeof(*icmp_149
));
1363 if (icmp_149
== NULL
)
1366 tprintf(", ID (%u)",ntohs(icmp_149
->id
));
1367 tprintf(", All Components (%u)",ntohs(icmp_149
->all_comp
));
1368 tprintf(", Component (%u)",ntohs(icmp_149
->comp
));
1369 tprintf(", Res (0x%x)",ntohs(icmp_149
->res
));
1371 return dissect_neighb_disc_ops(pkt
);
1374 static int8_t dissect_icmpv6_type150(struct pkt_buff
*pkt
)
1376 struct icmpv6_type_150
*icmp_150
;
1378 icmp_150
= (struct icmpv6_type_150
*)
1379 pkt_pull(pkt
,sizeof(*icmp_150
));
1380 if (icmp_150
== NULL
)
1383 tprintf(", Subtype (%u)",icmp_150
->subtype
);
1384 tprintf(", Res (0x%x)",icmp_150
->res
);
1385 tprintf(", Options in Payload");
1390 static int8_t dissect_icmpv6_type151(struct pkt_buff
*pkt
)
1392 struct icmpv6_type_151
*icmp_151
;
1394 icmp_151
= (struct icmpv6_type_151
*)
1395 pkt_pull(pkt
,sizeof(*icmp_151
));
1396 if (icmp_151
== NULL
)
1399 tprintf(", Query Interval (%us)",ntohs(icmp_151
->query_intv
));
1400 tprintf(", Robustness Variable (%u)",ntohs(icmp_151
->rob_var
));
1405 static int8_t dissect_icmpv6_type152(struct pkt_buff
*pkt
)
1407 struct icmpv6_type_152
*icmp_152
;
1409 icmp_152
= (struct icmpv6_type_152
*)
1410 pkt_pull(pkt
,sizeof(*icmp_152
));
1411 if (icmp_152
== NULL
)
1417 static int8_t dissect_icmpv6_type153(struct pkt_buff
*pkt
)
1419 struct icmpv6_type_153
*icmp_153
;
1421 icmp_153
= (struct icmpv6_type_153
*)
1422 pkt_pull(pkt
,sizeof(*icmp_153
));
1423 if (icmp_153
== NULL
)
1429 static int8_t dissect_icmpv6_type154(struct pkt_buff
*pkt
)
1431 struct icmpv6_type_154
*icmp_154
;
1433 icmp_154
= (struct icmpv6_type_154
*)
1434 pkt_pull(pkt
,sizeof(*icmp_154
));
1435 if (icmp_154
== NULL
)
1438 tprintf(", Subtype (%u)",icmp_154
->subtype
);
1439 tprintf(", Res (0x%x)",icmp_154
->res
);
1440 tprintf(", ID (%u)",ntohs(icmp_154
->id
));
1442 return dissect_neighb_disc_ops(pkt
);
1445 static inline char *icmpv6_type_155_codes(uint8_t code
) {
1448 return "DODAG Information Solicitation";
1450 return "DODAG Information Object";
1452 return "Destination Advertisement Object";
1454 return "Destination Advertisement Object Acknowledgment";
1456 return "Secure DODAG Information Solicitation";
1458 return "Secure DODAG Information Object";
1460 return "Secure Destination Advertisement Object";
1462 return "Secure Destination Advertisement Object Acknowledgment";
1464 return "Consistency Check";
1470 static void icmpv6_process(struct icmpv6_general_hdr
*icmp
, char **type
,
1471 char **code
, int8_t (**optional
)(struct pkt_buff
*pkt
))
1473 *type
= "Unknown Type";
1474 *code
= "Unknown Code";
1476 switch (icmp
->h_type
) {
1478 *type
= "Destination Unreachable";
1479 if (icmpv6_code_range_valid(icmp
->h_code
, icmpv6_type_1_codes
))
1480 *code
= icmpv6_type_1_codes
[icmp
->h_code
];
1481 *optional
= dissect_icmpv6_type1
;
1484 *type
= "Packet Too Big";
1485 *optional
= dissect_icmpv6_type2
;
1488 *type
= "Time Exceeded";
1489 if (icmpv6_code_range_valid(icmp
->h_code
, icmpv6_type_3_codes
))
1490 *code
= icmpv6_type_3_codes
[icmp
->h_code
];
1491 *optional
= dissect_icmpv6_type3
;
1494 *type
= "Parameter Problem";
1495 if (icmpv6_code_range_valid(icmp
->h_code
, icmpv6_type_4_codes
))
1496 *code
= icmpv6_type_4_codes
[icmp
->h_code
];
1497 *optional
= dissect_icmpv6_type4
;
1500 *type
= "Private experimation";
1503 *type
= "Private experimation";
1506 *type
= "Reserved for expansion of ICMPv6 error messages";
1509 *type
= "Echo Request";
1510 *optional
= dissect_icmpv6_type128
;
1513 *type
= "Echo Reply";
1514 *optional
= dissect_icmpv6_type129
;
1517 *type
= "Multicast Listener Query";
1518 *optional
= dissect_icmpv6_type130
;
1521 *type
= "Multicast Listener Report";
1522 *optional
= dissect_icmpv6_type131
;
1525 *type
= "Multicast Listener Done";
1526 *optional
= dissect_icmpv6_type132
;
1529 *type
= "Router Solicitation";
1530 *optional
= dissect_icmpv6_type133
;
1533 *type
= "Router Advertisement";
1534 *optional
= dissect_icmpv6_type134
;
1537 *type
= "Neighbor Solicitation";
1538 *optional
= dissect_icmpv6_type135
;
1541 *type
= "Neighbor Advertisement";
1542 *optional
= dissect_icmpv6_type136
;
1545 *type
= "Redirect Message";
1546 *optional
= dissect_icmpv6_type137
;
1549 *type
= "Router Renumbering";
1550 if(icmpv6_type_138_codes(icmp
->h_code
))
1551 *code
= icmpv6_type_138_codes(icmp
->h_code
);
1552 *optional
= dissect_icmpv6_type138
;
1555 *type
= "ICMP Node Information Query";
1556 if (icmpv6_code_range_valid(icmp
->h_code
,
1557 icmpv6_type_139_codes
))
1558 *code
= icmpv6_type_139_codes
[icmp
->h_code
];
1559 *optional
= dissect_icmpv6_type139
;
1562 *type
= "ICMP Node Information Response";
1563 if (icmpv6_code_range_valid(icmp
->h_code
,
1564 icmpv6_type_140_codes
))
1565 *code
= icmpv6_type_140_codes
[icmp
->h_code
];
1566 *optional
= dissect_icmpv6_type140
;
1569 *type
= "Inverse Neighbor Discovery Solicitation Message";
1570 *optional
= dissect_icmpv6_type141
;
1573 *type
= "Inverse Neighbor Discovery Advertisement Message";
1574 *optional
= dissect_icmpv6_type142
;
1577 *type
= "Multicast Listener Report v2";
1578 *optional
= dissect_icmpv6_type143
;
1581 *type
= "Home Agent Address Discovery Request Message";
1582 *optional
= dissect_icmpv6_type144
;
1585 *type
= "Home Agent Address Discovery Reply Message";
1586 *optional
= dissect_icmpv6_type145
;
1589 *type
= "Mobile Prefix Solicitation";
1590 *optional
= dissect_icmpv6_type146
;
1593 *type
= "Mobile Prefix Advertisement";
1594 *optional
= dissect_icmpv6_type147
;
1597 *type
= "Certification Path Solicitation";
1598 *optional
= dissect_icmpv6_type148
;
1601 *type
= "Certification Path Advertisement";
1602 *optional
= dissect_icmpv6_type149
;
1605 *type
= "ICMP messages utilized by experimental mobility "
1606 "protocols such as Seamoby";
1607 *optional
= dissect_icmpv6_type150
;
1610 *type
= "Multicast Router Advertisement";
1611 *code
= "Ad. Interval";
1612 *optional
= dissect_icmpv6_type151
;
1615 *type
= "Multicast Router Solicitation";
1617 *optional
= dissect_icmpv6_type152
;
1620 *type
= "Multicast Router Termination";
1622 *optional
= dissect_icmpv6_type153
;
1625 *type
= "FMIPv6 Messages";
1626 *optional
= dissect_icmpv6_type154
;
1629 *type
= "RPL Control Message";
1630 if(icmpv6_type_155_codes(icmp
->h_code
))
1631 *code
= icmpv6_type_155_codes(icmp
->h_code
);
1634 *type
= "Private experimation";
1637 *type
= "Private experimation";
1640 *type
= "Reserved for expansion of ICMPv6 error messages";
1645 static void icmpv6(struct pkt_buff
*pkt
)
1647 char *type
= NULL
, *code
= NULL
;
1648 int8_t (*optional
)(struct pkt_buff
*pkt
) = NULL
;
1649 struct icmpv6_general_hdr
*icmp
=
1650 (struct icmpv6_general_hdr
*) pkt_pull(pkt
, sizeof(*icmp
));
1655 icmpv6_process(icmp
, &type
, &code
, &optional
);
1657 tprintf(" [ ICMPv6 ");
1658 tprintf("%s (%u), ", type
, icmp
->h_type
);
1659 tprintf("%s (%u), ", code
, icmp
->h_code
);
1660 tprintf("Chks (0x%x)", ntohs(icmp
->h_chksum
));
1662 if (!((*optional
) (pkt
)))
1663 tprintf("\n%s%s%s", colorize_start_full(black
, red
),
1664 "Failed to dissect Message", colorize_end());
1668 static void icmpv6_less(struct pkt_buff
*pkt
)
1670 struct icmpv6_general_hdr
*icmp
=
1671 (struct icmpv6_general_hdr
*) pkt_pull(pkt
, sizeof(*icmp
));
1676 tprintf(" ICMPv6 Type (%u) Code (%u)", icmp
->h_type
, icmp
->h_code
);
1679 struct protocol icmpv6_ops
= {
1681 .print_full
= icmpv6
,
1682 .print_less
= icmpv6_less
,
1685 EXPORT_SYMBOL(icmpv6_ops
);