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 tprintf(", Aux Data: ");
345 while (aux_data_len_bytes
--) {
346 tprintf("%x", *pkt_pull(pkt
,1));
353 static int8_t dissect_neighb_disc_ops_1(struct pkt_buff
*pkt
,
356 struct icmpv6_neighb_disc_ops_type_1_2
*icmp_neighb_disc_1
;
358 icmp_neighb_disc_1
= (struct icmpv6_neighb_disc_ops_type_1_2
*)
359 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_1
));
360 if (icmp_neighb_disc_1
== NULL
)
362 len
-= sizeof(*icmp_neighb_disc_1
);
366 tprintf("Address 0x");
369 tprintf("%x", *pkt_pull(pkt
,1));
375 static int8_t dissect_neighb_disc_ops_2(struct pkt_buff
*pkt
,
378 return dissect_neighb_disc_ops_1(pkt
, len
);
381 static int8_t dissect_neighb_disc_ops_3(struct pkt_buff
*pkt
,
384 char address
[INET6_ADDRSTRLEN
];
385 struct icmpv6_neighb_disc_ops_type_3
*icmp_neighb_disc_3
;
387 icmp_neighb_disc_3
= (struct icmpv6_neighb_disc_ops_type_3
*)
388 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_3
));
389 if (icmp_neighb_disc_3
== NULL
)
391 len
-= sizeof(*icmp_neighb_disc_3
);
395 tprintf("Prefix Len (%u) ",icmp_neighb_disc_3
->prefix_len
);
396 tprintf("L (%u) A (%u) Res1 (0x%x) ",icmp_neighb_disc_3
->l_a_res1
>> 7,
397 (icmp_neighb_disc_3
->l_a_res1
>> 7) & 0x1,
398 icmp_neighb_disc_3
->l_a_res1
& 0x3F);
399 tprintf("Valid Lifetime (%us) ",
400 ntohl(icmp_neighb_disc_3
->valid_lifetime
));
401 tprintf("Preferred Lifetime (%us) ",
402 ntohl(icmp_neighb_disc_3
->preferred_lifetime
));
403 tprintf("Reserved2 (0x%x) ",
404 ntohl(icmp_neighb_disc_3
->res2
));
405 tprintf("Prefix: %s ",
406 inet_ntop(AF_INET6
,&icmp_neighb_disc_3
->prefix
,
407 address
, sizeof(address
)));
412 static int8_t dissect_neighb_disc_ops_4(struct pkt_buff
*pkt
,
415 struct icmpv6_neighb_disc_ops_type_4
*icmp_neighb_disc_4
;
417 icmp_neighb_disc_4
= (struct icmpv6_neighb_disc_ops_type_4
*)
418 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_4
));
419 if (icmp_neighb_disc_4
== NULL
)
421 len
-= sizeof(*icmp_neighb_disc_4
);
425 tprintf("Reserved 1 (0x%x) ", ntohs(icmp_neighb_disc_4
->res1
));
426 tprintf("Reserved 2 (0x%x) ", ntohl(icmp_neighb_disc_4
->res2
));
427 tprintf("IP header + data ");
430 tprintf("%x", *pkt_pull(pkt
,1));
436 static int8_t dissect_neighb_disc_ops_5(struct pkt_buff
*pkt
,
439 struct icmpv6_neighb_disc_ops_type_5
*icmp_neighb_disc_5
;
441 icmp_neighb_disc_5
= (struct icmpv6_neighb_disc_ops_type_5
*)
442 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_5
));
443 if (icmp_neighb_disc_5
== NULL
)
445 len
-= sizeof(*icmp_neighb_disc_5
);
449 tprintf("Reserved (0x%x) ", ntohs(icmp_neighb_disc_5
->res1
));
450 tprintf("MTU (%u)", ntohl(icmp_neighb_disc_5
->MTU
));
455 static int8_t dissect_neighb_disc_ops_9(struct pkt_buff
*pkt
,
458 struct icmpv6_neighb_disc_ops_type_9_10
*icmp_neighb_disc_9
;
460 icmp_neighb_disc_9
= (struct icmpv6_neighb_disc_ops_type_9_10
*)
461 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_9
));
462 if (icmp_neighb_disc_9
== NULL
)
464 len
-= sizeof(*icmp_neighb_disc_9
);
468 tprintf("Reserved 1 (0x%x) ", ntohs(icmp_neighb_disc_9
->res1
));
469 tprintf("Reserved 2 (0x%x) ", ntohl(icmp_neighb_disc_9
->res2
));
471 return print_ipv6_addr_list(pkt
, len
/ sizeof(struct in6_addr
));
474 static int8_t dissect_neighb_disc_ops_10(struct pkt_buff
*pkt
,
477 return dissect_neighb_disc_ops_9(pkt
, len
);
480 static char *icmpv6_neighb_disc_ops_15_name
[] = {
481 "DER Encoded X.501 Name",
485 static int8_t dissect_neighb_disc_ops_15(struct pkt_buff
*pkt
,
490 struct icmpv6_neighb_disc_ops_type_15
*icmp_neighb_disc_15
;
492 icmp_neighb_disc_15
= (struct icmpv6_neighb_disc_ops_type_15
*)
493 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_15
));
494 if (icmp_neighb_disc_15
== NULL
)
496 len
-= sizeof(*icmp_neighb_disc_15
);
499 pad_len
= icmp_neighb_disc_15
->pad_len
;
501 tprintf("Name Type %s (%u) ",
502 icmpv6_code_range_valid(icmp_neighb_disc_15
->name_type
- 1,
503 icmpv6_neighb_disc_ops_15_name
) ?
504 icmpv6_neighb_disc_ops_15_name
[
505 icmp_neighb_disc_15
->name_type
- 1] : "Unknown",
506 icmp_neighb_disc_15
->name_type
);
508 tprintf("Pad Len (%u, invalid)\n%s", pad_len
,
509 colorize_start_full(black
, red
)
510 "Skip Option" colorize_end());
515 tprintf("Pad Len (%u) ", pad_len
);
517 name_len
= len
- pad_len
;
521 tprintf("%c", *pkt_pull(pkt
,1));
525 tprintf("Padding (");
528 tprintf("%x", *pkt_pull(pkt
,1));
535 static char *icmpv6_neighb_disc_ops_16_cert
[] = {
536 "X.509v3 Certificate",
539 static int8_t dissect_neighb_disc_ops_16(struct pkt_buff
*pkt
,
542 struct icmpv6_neighb_disc_ops_type_16
*icmp_neighb_disc_16
;
544 icmp_neighb_disc_16
= (struct icmpv6_neighb_disc_ops_type_16
*)
545 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_16
));
546 if (icmp_neighb_disc_16
== NULL
)
548 len
-= sizeof(*icmp_neighb_disc_16
);
552 tprintf("Cert Type %s (%u) ",
553 icmpv6_code_range_valid(icmp_neighb_disc_16
->cert_type
- 1,
554 icmpv6_neighb_disc_ops_16_cert
) ?
555 icmpv6_neighb_disc_ops_16_cert
[
556 icmp_neighb_disc_16
->cert_type
- 1] : "Unknown",
557 icmp_neighb_disc_16
->cert_type
);
558 tprintf("Res (0x%x) ", icmp_neighb_disc_16
->res
);
560 tprintf("Certificate + Padding (");
562 tprintf("%x", *pkt_pull(pkt
,1));
569 static char *icmpv6_neighb_disc_ops_17_codes
[] = {
570 "Old Care-of Address",
571 "New Care-of Address",
576 static int8_t dissect_neighb_disc_ops_17(struct pkt_buff
*pkt
,
579 char address
[INET6_ADDRSTRLEN
];
580 struct icmpv6_neighb_disc_ops_type_17
*icmp_neighb_disc_17
;
582 icmp_neighb_disc_17
= (struct icmpv6_neighb_disc_ops_type_17
*)
583 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_17
));
584 if (icmp_neighb_disc_17
== NULL
)
586 len
-= sizeof(*icmp_neighb_disc_17
);
590 tprintf("Opt Code %s (%u) ",
591 icmpv6_code_range_valid(icmp_neighb_disc_17
->opt_code
- 1,
592 icmpv6_neighb_disc_ops_17_codes
) ?
593 icmpv6_neighb_disc_ops_17_codes
[
594 icmp_neighb_disc_17
->opt_code
- 1] : "Unknown",
595 icmp_neighb_disc_17
->opt_code
);
596 tprintf("Prefix Len (%u) ", icmp_neighb_disc_17
->prefix_len
);
598 if (len
== sizeof(struct icmpv6_neighb_disc_ops_type_17_1
)) {
599 struct icmpv6_neighb_disc_ops_type_17_1
600 *icmp_neighb_disc_17_1
;
602 icmp_neighb_disc_17_1
=
603 (struct icmpv6_neighb_disc_ops_type_17_1
*)
604 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_17_1
));
605 if (icmp_neighb_disc_17_1
== NULL
)
607 len
-= sizeof(*icmp_neighb_disc_17_1
);
611 tprintf("Res (0x%x) ",icmp_neighb_disc_17_1
->res
);
613 inet_ntop(AF_INET6
,&icmp_neighb_disc_17_1
->ipv6_addr
,
614 address
, sizeof(address
)));
616 else if (len
== sizeof(struct icmpv6_neighb_disc_ops_type_17_2
)) {
617 struct icmpv6_neighb_disc_ops_type_17_2
618 *icmp_neighb_disc_17_2
;
620 icmp_neighb_disc_17_2
=
621 (struct icmpv6_neighb_disc_ops_type_17_2
*)
622 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_17_2
));
623 if (icmp_neighb_disc_17_2
== NULL
)
625 len
-= sizeof(*icmp_neighb_disc_17_2
);
630 inet_ntop(AF_INET6
,&icmp_neighb_disc_17_2
->ipv6_addr
,
631 address
, sizeof(address
)));
634 tprintf("%s (", colorize_start_full(black
, red
)
635 "Error Wrong Length. Skip Option" colorize_end());
637 tprintf("%x", *pkt_pull(pkt
,1));
645 static char *icmpv6_neighb_disc_ops_19_codes
[] = {
646 "Wildcard requesting resolution for all nearby access points",
647 "Link-Layer Address of the New Access Point",
648 "Link-Layer Address of the MN",
649 "Link-Layer Address of the NAR",
650 "Link-Layer Address of the source of RtSolPr or PrRtAdv \
652 "The access point identified by the LLA belongs to the \
653 current interface of the router",
654 "No prefix information available for the access point \
655 identified by the LLA",
656 "No fast handover support available for the access point \
657 identified by the LLA",
660 static int8_t dissect_neighb_disc_ops_19(struct pkt_buff
*pkt
,
663 struct icmpv6_neighb_disc_ops_type_19
*icmp_neighb_disc_19
;
665 icmp_neighb_disc_19
= (struct icmpv6_neighb_disc_ops_type_19
*)
666 pkt_pull(pkt
,sizeof(*icmp_neighb_disc_19
));
667 if (icmp_neighb_disc_19
== NULL
)
669 len
-= sizeof(*icmp_neighb_disc_19
);
673 tprintf("Opt Code %s (%u) ",
674 icmpv6_code_range_valid(icmp_neighb_disc_19
->opt_code
,
675 icmpv6_neighb_disc_ops_19_codes
) ?
676 icmpv6_neighb_disc_ops_19_codes
[
677 icmp_neighb_disc_19
->opt_code
] : "Unknown",
678 icmp_neighb_disc_19
->opt_code
);
682 tprintf("%x", *pkt_pull(pkt
,1));
689 static inline char *icmpv6_neighb_disc_ops(uint8_t code
) {
692 return "Source Link-Layer Address";
694 return "Target Link-Layer Address";
696 return "Prefix Information";
698 return "Redirected Header";
702 return "NBMA Shortcut Limit Option";
704 return "Advertisement Interval Option";
706 return "Home Agent Information Option";
708 return "Source Address List";
710 return "Target Address List";
714 return "RSA Signature option";
716 return "Timestamp option";
718 return "Nonce option";
720 return "Trust Anchor option";
722 return "Certificate option";
724 return "IP Address/Prefix Option";
726 return "New Router Prefix Information Option";
728 return "Link-layer Address Option";
730 return "Neighbor Advertisement Acknowledgment Option";
733 return "Prefix Information";
735 return "Redirected Header";
739 return "NBMA Shortcut Limit Option";
741 return "Advertisement Interval Option";
743 return "Home Agent Information Option";
745 return "Source Address List";
747 return "Target Address List";
749 return "DNS Search List Option";
751 return "Proxy Signature (PS)";
754 return "CARD Request option";
756 return "CARD Reply option";
759 return "RFC3692-style Experiment 1";
761 return "RFC3692-style Experiment 2";
767 static int8_t dissect_neighb_disc_ops(struct pkt_buff
*pkt
)
770 uint16_t ops_total_len
;
771 ssize_t ops_payl_len
;
772 struct icmpv6_neighb_disc_ops_general
*icmp_neighb_disc
;
774 while(pkt_len(pkt
)) {
775 icmp_neighb_disc
= (struct icmpv6_neighb_disc_ops_general
*)
776 pkt_pull(pkt
,sizeof(*icmp_neighb_disc
));
777 if (icmp_neighb_disc
== NULL
)
780 ops_total_len
= icmp_neighb_disc
->len
* 8;
781 pad_bytes
= (size_t) (ops_total_len
% 8);
782 ops_payl_len
= ops_total_len
- sizeof(*icmp_neighb_disc
) -
785 tprintf("\n\tOption %s (%u) ",
786 icmpv6_neighb_disc_ops(icmp_neighb_disc
->type
) ?
787 icmpv6_neighb_disc_ops(icmp_neighb_disc
->type
)
788 : "Type Unknown", icmp_neighb_disc
->type
);
789 if (ops_payl_len
> pkt_len(pkt
) || ops_payl_len
< 0) {
790 tprintf("Length (%u, %u bytes, %s%s%s) ",
791 icmp_neighb_disc
->len
,
793 colorize_start_full(black
, red
),
794 "invalid", colorize_end());
798 tprintf("Length (%u, %u bytes) ",icmp_neighb_disc
->len
,
801 switch (icmp_neighb_disc
->type
) {
803 if (!dissect_neighb_disc_ops_1(pkt
, ops_payl_len
))
807 if (!dissect_neighb_disc_ops_2(pkt
, ops_payl_len
))
811 if (!dissect_neighb_disc_ops_3(pkt
, ops_payl_len
))
815 if (!dissect_neighb_disc_ops_4(pkt
, ops_payl_len
))
819 if (!dissect_neighb_disc_ops_5(pkt
, ops_payl_len
))
822 /* Type 9 and 10 defined in
823 * http://tools.ietf.org/html/rfc3122#section-3.1
826 if (!dissect_neighb_disc_ops_9(pkt
, ops_payl_len
))
830 if (!dissect_neighb_disc_ops_10(pkt
, ops_payl_len
))
833 /* Type 15 and 16 defined in
834 * http://tools.ietf.org/html/rfc3971#section-6.4.3
835 * http://tools.ietf.org/html/rfc3971#section-6.4.4
838 if (!dissect_neighb_disc_ops_15(pkt
, ops_payl_len
))
842 if (!dissect_neighb_disc_ops_16(pkt
, ops_payl_len
))
845 /* Type 17 and 19 defined in
846 * http://tools.ietf.org/html/rfc5568#section-6.4
849 if (!dissect_neighb_disc_ops_17(pkt
, ops_payl_len
))
853 if (!dissect_neighb_disc_ops_19(pkt
, ops_payl_len
))
857 pkt_pull(pkt
, ops_payl_len
);
860 /* Skip Padding Bytes */
861 if (pad_bytes
> pkt_len(pkt
)) {
862 tprintf(" %s",colorize_start_full(black
, red
)
863 "Invalid Padding" colorize_end());
866 pkt_pull(pkt
, pad_bytes
);
872 static char *icmpv6_type_1_codes
[] = {
873 "No route to destination",
874 "Communication with destination administratively prohibited",
875 "Beyond scope of source address",
876 "Address unreachable",
878 "Source address failed ingress/egress policy",
879 "Reject route to destination",
880 "Error in Source Routing Header",
883 static int8_t dissect_icmpv6_type1(struct pkt_buff
*pkt
)
885 struct icmpv6_type_1_3
*icmp_1
;
887 icmp_1
= (struct icmpv6_type_1_3
*) pkt_pull(pkt
,sizeof(*icmp_1
));
891 tprintf(", Unused (0x%x)",ntohl(icmp_1
->unused
));
892 tprintf(" Payload include as much of invoking packet");
897 static int8_t dissect_icmpv6_type2(struct pkt_buff
*pkt
)
899 struct icmpv6_type_2
*icmp_2
;
901 icmp_2
= (struct icmpv6_type_2
*) pkt_pull(pkt
,sizeof(*icmp_2
));
905 tprintf(", MTU (0x%x)",ntohl(icmp_2
->MTU
));
906 tprintf(" Payload include as much of invoking packet");
911 static char *icmpv6_type_3_codes
[] = {
912 "Hop limit exceeded in transit",
913 "Fragment reassembly time exceeded",
916 static int8_t dissect_icmpv6_type3(struct pkt_buff
*pkt
)
918 struct icmpv6_type_1_3
*icmp_3
;
920 icmp_3
= (struct icmpv6_type_1_3
*) pkt_pull(pkt
,sizeof(*icmp_3
));
924 tprintf(", Unused (0x%x)",ntohl(icmp_3
->unused
));
925 tprintf(" Payload include as much of invoking packet");
930 static char *icmpv6_type_4_codes
[] = {
931 "Erroneous header field encountered",
932 "Unrecognized Next Header type encountered",
933 "Unrecognized IPv6 option encountered",
936 static int8_t dissect_icmpv6_type4(struct pkt_buff
*pkt
)
938 struct icmpv6_type_4
*icmp_4
;
940 icmp_4
= (struct icmpv6_type_4
*) pkt_pull(pkt
,sizeof(*icmp_4
));
944 tprintf(", Pointer (0x%x)",ntohl(icmp_4
->pointer
));
945 tprintf(" Payload include as much of invoking packet");
950 static int8_t dissect_icmpv6_type128(struct pkt_buff
*pkt
)
952 struct icmpv6_type_128_129
*icmp_128
;
954 icmp_128
= (struct icmpv6_type_128_129
*)
955 pkt_pull(pkt
,sizeof(*icmp_128
));
956 if (icmp_128
== NULL
)
959 tprintf(", ID (0x%x)",ntohs(icmp_128
->id
));
960 tprintf(", Seq. Nr. (%u)",ntohs(icmp_128
->sn
));
961 tprintf(" Payload include Data");
966 static int8_t dissect_icmpv6_type129(struct pkt_buff
*pkt
)
968 struct icmpv6_type_128_129
*icmp_129
;
970 icmp_129
= (struct icmpv6_type_128_129
*)
971 pkt_pull(pkt
,sizeof(*icmp_129
));
972 if (icmp_129
== NULL
)
975 tprintf(", ID (0x%x)",ntohs(icmp_129
->id
));
976 tprintf(", Seq. Nr. (%u)",ntohs(icmp_129
->sn
));
977 tprintf(" Payload include Data");
982 static int8_t dissect_icmpv6_type130(struct pkt_buff
*pkt
)
984 char address
[INET6_ADDRSTRLEN
];
985 uint16_t nr_src
, maxrespdel
;
986 uint8_t switch_mldv2
= 0;
987 struct icmpv6_type_130_131_132
*icmp_130
;
989 icmp_130
= (struct icmpv6_type_130_131_132
*)
990 pkt_pull(pkt
,sizeof(*icmp_130
));
991 if (icmp_130
== NULL
)
993 maxrespdel
= ntohs(icmp_130
->maxrespdel
);
995 if(pkt_len(pkt
) >= sizeof(struct icmpv6_type_130_mldv2
))
999 tprintf(", MLDv2, Max Resp Delay (%ums)", maxrespdel
>> 15 ?
1000 (((maxrespdel
& 0xFFF) | 0x1000) <<
1001 (((maxrespdel
>> 12) & 0x3) + 3)) : maxrespdel
);
1003 tprintf(", Max Resp Delay (%ums)",maxrespdel
);
1004 tprintf(", Res (0x%x)",ntohs(icmp_130
->res
));
1005 tprintf(", Address: %s",
1006 inet_ntop(AF_INET6
, &icmp_130
->ipv6_addr
,
1007 address
, sizeof(address
)));
1010 struct icmpv6_type_130_mldv2
*icmp_130_mldv2
;
1012 icmp_130_mldv2
= (struct icmpv6_type_130_mldv2
*)
1013 pkt_pull(pkt
,sizeof(*icmp_130_mldv2
));
1014 if (icmp_130_mldv2
== NULL
)
1017 nr_src
= ntohs(icmp_130_mldv2
->nr_src
);
1019 tprintf(", Resv (0x%x)",icmp_130_mldv2
->resv_S_QRV
>> 4);
1020 tprintf(", S (%u)",(icmp_130_mldv2
->resv_S_QRV
>> 3) & 0x1);
1021 tprintf(", QRV (0x%x)",icmp_130_mldv2
->resv_S_QRV
& 0x3);
1022 tprintf(", QQIC (%u)",icmp_130_mldv2
->QQIC
);
1023 tprintf(", Nr Src (0x%x)",nr_src
);
1025 return print_ipv6_addr_list(pkt
, nr_src
);
1031 static int8_t dissect_icmpv6_type131(struct pkt_buff
*pkt
)
1033 char address
[INET6_ADDRSTRLEN
];
1034 struct icmpv6_type_130_131_132
*icmp_131
;
1036 icmp_131
= (struct icmpv6_type_130_131_132
*)
1037 pkt_pull(pkt
,sizeof(*icmp_131
));
1038 if (icmp_131
== NULL
)
1041 tprintf(", Max Resp Delay (%ums)",ntohs(icmp_131
->maxrespdel
));
1042 tprintf(", Res (0x%x)",ntohs(icmp_131
->res
));
1043 tprintf(", Address: %s",
1044 inet_ntop(AF_INET6
, &icmp_131
->ipv6_addr
,
1045 address
, sizeof(address
)));
1050 static inline int8_t dissect_icmpv6_type132(struct pkt_buff
*pkt
)
1052 return dissect_icmpv6_type131(pkt
);
1055 static int8_t dissect_icmpv6_type133(struct pkt_buff
*pkt
)
1057 struct icmpv6_type_133_141_142
*icmp_133
;
1059 icmp_133
= (struct icmpv6_type_133_141_142
*)
1060 pkt_pull(pkt
,sizeof(*icmp_133
));
1061 if (icmp_133
== NULL
)
1064 tprintf(", Reserved (0x%x)",ntohl(icmp_133
->res
));
1066 return dissect_neighb_disc_ops(pkt
);
1069 static int8_t dissect_icmpv6_type134(struct pkt_buff
*pkt
)
1071 struct icmpv6_type_134
*icmp_134
;
1073 icmp_134
= (struct icmpv6_type_134
*)
1074 pkt_pull(pkt
,sizeof(*icmp_134
));
1075 if (icmp_134
== NULL
)
1078 tprintf(", Cur Hop Limit (%u)",icmp_134
->cur_hop_limit
);
1079 tprintf(", M (%u) O (%u)",icmp_134
->m_o_res
>> 7,
1080 (icmp_134
->m_o_res
>> 6) & 0x1);
1081 tprintf(", Router Lifetime (%us)",ntohs(icmp_134
->router_lifetime
));
1082 tprintf(", Reachable Time (%ums)",ntohl(icmp_134
->reachable_time
));
1083 tprintf(", Retrans Timer (%ums)",ntohl(icmp_134
->retrans_timer
));
1085 return dissect_neighb_disc_ops(pkt
);
1088 static int8_t dissect_icmpv6_type135(struct pkt_buff
*pkt
)
1090 char address
[INET6_ADDRSTRLEN
];
1091 struct icmpv6_type_135
*icmp_135
;
1093 icmp_135
= (struct icmpv6_type_135
*)
1094 pkt_pull(pkt
,sizeof(*icmp_135
));
1095 if (icmp_135
== NULL
)
1098 tprintf(", Reserved (0x%x)",ntohl(icmp_135
->res
));
1099 tprintf(", Target Address: %s",
1100 inet_ntop(AF_INET6
, &icmp_135
->ipv6_addr
,
1101 address
, sizeof(address
)));
1103 return dissect_neighb_disc_ops(pkt
);
1106 static int8_t dissect_icmpv6_type136(struct pkt_buff
*pkt
)
1108 char address
[INET6_ADDRSTRLEN
];
1110 struct icmpv6_type_136
*icmp_136
;
1112 icmp_136
= (struct icmpv6_type_136
*)
1113 pkt_pull(pkt
,sizeof(*icmp_136
));
1114 if (icmp_136
== NULL
)
1116 r_s_o_res
= ntohl(icmp_136
->r_s_o_res
);
1118 tprintf(", R (%u) S (%u) O (%u) Reserved (0x%x)", r_s_o_res
>> 31,
1119 (r_s_o_res
>> 30) & 0x1, (r_s_o_res
>> 29) & 0x1,
1120 r_s_o_res
& 0x1FFFFFFF);
1121 tprintf(", Target Address: %s",
1122 inet_ntop(AF_INET6
, &icmp_136
->ipv6_addr
,
1123 address
, sizeof(address
)));
1125 return dissect_neighb_disc_ops(pkt
);
1128 static int8_t dissect_icmpv6_type137(struct pkt_buff
*pkt
)
1130 char address
[INET6_ADDRSTRLEN
];
1131 struct icmpv6_type_137
*icmp_137
;
1133 icmp_137
= (struct icmpv6_type_137
*)
1134 pkt_pull(pkt
,sizeof(*icmp_137
));
1135 if (icmp_137
== NULL
)
1138 tprintf(", Reserved (0x%x)",icmp_137
->res
);
1139 tprintf(", Target Address: %s",
1140 inet_ntop(AF_INET6
, &icmp_137
->ipv6_targ_addr
,
1141 address
, sizeof(address
)));
1142 tprintf(", Dest Address: %s",
1143 inet_ntop(AF_INET6
, &icmp_137
->ipv6_dest_addr
,
1144 address
, sizeof(address
)));
1146 return dissect_neighb_disc_ops(pkt
);
1149 static void dissect_icmpv6_rr_body(struct pkt_buff
*pkt
)
1152 * Upgrade Dissector for Message Body
1153 * from http://tools.ietf.org/html/rfc2894#section-3.2
1156 tprintf(" Message Body recognized");
1159 static inline char *icmpv6_type_138_codes(uint8_t code
) {
1162 return "Router Renumbering Command";
1164 return "Router Renumbering Result";
1166 return "Sequence Number Reset";
1172 static int8_t dissect_icmpv6_type138(struct pkt_buff
*pkt
)
1174 struct icmpv6_type_138
*icmp_138
;
1176 icmp_138
= (struct icmpv6_type_138
*)
1177 pkt_pull(pkt
,sizeof(*icmp_138
));
1178 if (icmp_138
== NULL
)
1181 tprintf(", Sequence Nr. (%u)",ntohl(icmp_138
->seq_nr
));
1182 tprintf(", Segment Nr. (%u)",icmp_138
->seg_nr
);
1183 tprintf(", T (%u) R (%u) A (%u) S (%u) P (%u) Res \
1184 (0x%x) ",icmp_138
->flags
>> 7, (icmp_138
->flags
>> 6) & 1,
1185 (icmp_138
->flags
>> 5) & 1, (icmp_138
->flags
>> 4) & 1,
1186 (icmp_138
->flags
>> 3) & 1, icmp_138
->flags
& 7);
1187 tprintf(", Max Delay (%ums)", ntohs(icmp_138
->maxdelay
));
1188 tprintf(", Res (0x%x)", ntohl(icmp_138
->res
));
1190 dissect_icmpv6_rr_body(pkt
);
1195 static void dissect_icmpv6_node_inf_data(struct pkt_buff
*pkt
)
1198 * Upgrade Dissector for Data field
1199 * http://tools.ietf.org/html/rfc4620#section-4
1202 tprintf(" Data recognized");
1205 static char *icmpv6_node_inf_qtypes
[] = {
1213 static char *icmpv6_type_139_codes
[] = {
1214 "Data contains IPv6 Address",
1215 "Data contains Name or nothing",
1216 "Data contains IPv4 Address",
1219 static int8_t dissect_icmpv6_type139(struct pkt_buff
*pkt
)
1221 char *qtype_name
= "Unknown";
1223 struct icmpv6_type_139_140
*icmp_139
;
1225 icmp_139
= (struct icmpv6_type_139_140
*)
1226 pkt_pull(pkt
,sizeof(*icmp_139
));
1227 if (icmp_139
== NULL
)
1230 qtype_nr
= ntohs(icmp_139
->qtype
);
1231 if (icmpv6_code_range_valid(qtype_nr
, icmpv6_node_inf_qtypes
))
1232 qtype_name
= icmpv6_node_inf_qtypes
[qtype_nr
];
1234 tprintf(", Qtype %s (%u)",qtype_name
, qtype_nr
);
1235 tprintf(", Flags (0x%x)",ntohs(icmp_139
->flags
));
1236 tprintf(", Nonce (0x%x)",ntohll(icmp_139
->nonce
));
1238 dissect_icmpv6_node_inf_data(pkt
);
1243 static char *icmpv6_type_140_codes
[] = {
1244 "Successfull reply",
1245 "Responder refuses answer",
1246 "Qtype is unknown to the Responder",
1249 static inline int8_t dissect_icmpv6_type140(struct pkt_buff
*pkt
)
1251 return dissect_icmpv6_type139(pkt
);
1254 static inline int8_t dissect_icmpv6_type141(struct pkt_buff
*pkt
)
1256 return dissect_icmpv6_type133(pkt
);
1259 static inline int8_t dissect_icmpv6_type142(struct pkt_buff
*pkt
)
1261 return dissect_icmpv6_type133(pkt
);
1264 static int8_t dissect_icmpv6_type143(struct pkt_buff
*pkt
)
1267 struct icmpv6_type_143
*icmp_143
;
1269 icmp_143
= (struct icmpv6_type_143
*)
1270 pkt_pull(pkt
,sizeof(*icmp_143
));
1271 if (icmp_143
== NULL
)
1273 nr_rec
= ntohs(icmp_143
->nr_rec
);
1275 tprintf(", Res (0x%x)",ntohs(icmp_143
->res
));
1276 tprintf(", Nr. Mcast Addr Records (%u)",nr_rec
);
1278 return dissect_icmpv6_mcast_rec(pkt
, nr_rec
);
1281 static int8_t dissect_icmpv6_type144(struct pkt_buff
*pkt
)
1283 struct icmpv6_type_144_146
*icmp_144
;
1285 icmp_144
= (struct icmpv6_type_144_146
*)
1286 pkt_pull(pkt
,sizeof(*icmp_144
));
1287 if (icmp_144
== NULL
)
1290 tprintf(", ID (%u)",ntohs(icmp_144
->id
));
1291 tprintf(", Res (0x%x)",ntohs(icmp_144
->res
));
1296 static int8_t dissect_icmpv6_type145(struct pkt_buff
*pkt
)
1298 struct icmpv6_type_145
*icmp_145
;
1300 icmp_145
= (struct icmpv6_type_145
*)
1301 pkt_pull(pkt
,sizeof(*icmp_145
));
1302 if (icmp_145
== NULL
)
1305 tprintf(", ID (%u)",ntohs(icmp_145
->id
));
1306 tprintf(", Res (0x%x)",ntohs(icmp_145
->res
));
1308 return print_ipv6_addr_list(pkt
, pkt_len(pkt
) /
1309 sizeof(struct in6_addr
));
1312 static inline int8_t dissect_icmpv6_type146(struct pkt_buff
*pkt
)
1314 return dissect_icmpv6_type144(pkt
);
1317 static int8_t dissect_icmpv6_type147(struct pkt_buff
*pkt
)
1320 struct icmpv6_type_147
*icmp_147
;
1322 icmp_147
= (struct icmpv6_type_147
*)
1323 pkt_pull(pkt
,sizeof(*icmp_147
));
1324 if (icmp_147
== NULL
)
1326 m_o_res
= ntohs(icmp_147
->m_o_res
);
1328 tprintf(", ID (%u)",ntohs(icmp_147
->id
));
1329 tprintf(", M (%u) O (%u) Res (0x%x)",m_o_res
>> 15,
1330 (m_o_res
>> 14) & 1, m_o_res
& 0x3FFF);
1332 return dissect_neighb_disc_ops(pkt
);
1335 static int8_t dissect_icmpv6_type148(struct pkt_buff
*pkt
)
1337 struct icmpv6_type_148
*icmp_148
;
1339 icmp_148
= (struct icmpv6_type_148
*)
1340 pkt_pull(pkt
,sizeof(*icmp_148
));
1341 if (icmp_148
== NULL
)
1344 tprintf(", ID (%u)",ntohs(icmp_148
->id
));
1345 tprintf(", Component (%u)",ntohs(icmp_148
->comp
));
1347 return dissect_neighb_disc_ops(pkt
);
1350 static int8_t dissect_icmpv6_type149(struct pkt_buff
*pkt
)
1352 struct icmpv6_type_149
*icmp_149
;
1354 icmp_149
= (struct icmpv6_type_149
*)
1355 pkt_pull(pkt
,sizeof(*icmp_149
));
1356 if (icmp_149
== NULL
)
1359 tprintf(", ID (%u)",ntohs(icmp_149
->id
));
1360 tprintf(", All Components (%u)",ntohs(icmp_149
->all_comp
));
1361 tprintf(", Component (%u)",ntohs(icmp_149
->comp
));
1362 tprintf(", Res (0x%x)",ntohs(icmp_149
->res
));
1364 return dissect_neighb_disc_ops(pkt
);
1367 static int8_t dissect_icmpv6_type150(struct pkt_buff
*pkt
)
1369 struct icmpv6_type_150
*icmp_150
;
1371 icmp_150
= (struct icmpv6_type_150
*)
1372 pkt_pull(pkt
,sizeof(*icmp_150
));
1373 if (icmp_150
== NULL
)
1376 tprintf(", Subtype (%u)",icmp_150
->subtype
);
1377 tprintf(", Res (0x%x)",icmp_150
->res
);
1378 tprintf(", Options in Payload");
1383 static int8_t dissect_icmpv6_type151(struct pkt_buff
*pkt
)
1385 struct icmpv6_type_151
*icmp_151
;
1387 icmp_151
= (struct icmpv6_type_151
*)
1388 pkt_pull(pkt
,sizeof(*icmp_151
));
1389 if (icmp_151
== NULL
)
1392 tprintf(", Query Interval (%us)",ntohs(icmp_151
->query_intv
));
1393 tprintf(", Robustness Variable (%u)",ntohs(icmp_151
->rob_var
));
1398 static int8_t dissect_icmpv6_type152(struct pkt_buff
*pkt
)
1400 struct icmpv6_type_152
*icmp_152
;
1402 icmp_152
= (struct icmpv6_type_152
*)
1403 pkt_pull(pkt
,sizeof(*icmp_152
));
1404 if (icmp_152
== NULL
)
1410 static int8_t dissect_icmpv6_type153(struct pkt_buff
*pkt
)
1412 struct icmpv6_type_153
*icmp_153
;
1414 icmp_153
= (struct icmpv6_type_153
*)
1415 pkt_pull(pkt
,sizeof(*icmp_153
));
1416 if (icmp_153
== NULL
)
1422 static int8_t dissect_icmpv6_type154(struct pkt_buff
*pkt
)
1424 struct icmpv6_type_154
*icmp_154
;
1426 icmp_154
= (struct icmpv6_type_154
*)
1427 pkt_pull(pkt
,sizeof(*icmp_154
));
1428 if (icmp_154
== NULL
)
1431 tprintf(", Subtype (%u)",icmp_154
->subtype
);
1432 tprintf(", Res (0x%x)",icmp_154
->res
);
1433 tprintf(", ID (%u)",ntohs(icmp_154
->id
));
1435 return dissect_neighb_disc_ops(pkt
);
1438 static inline char *icmpv6_type_155_codes(uint8_t code
) {
1441 return "DODAG Information Solicitation";
1443 return "DODAG Information Object";
1445 return "Destination Advertisement Object";
1447 return "Destination Advertisement Object Acknowledgment";
1449 return "Secure DODAG Information Solicitation";
1451 return "Secure DODAG Information Object";
1453 return "Secure Destination Advertisement Object";
1455 return "Secure Destination Advertisement Object Acknowledgment";
1457 return "Consistency Check";
1463 static void icmpv6_process(struct icmpv6_general_hdr
*icmp
, char **type
,
1464 char **code
, int8_t (**optional
)(struct pkt_buff
*pkt
))
1466 *type
= "Unknown Type";
1467 *code
= "Unknown Code";
1469 switch (icmp
->h_type
) {
1471 *type
= "Destination Unreachable";
1472 if (icmpv6_code_range_valid(icmp
->h_code
, icmpv6_type_1_codes
))
1473 *code
= icmpv6_type_1_codes
[icmp
->h_code
];
1474 *optional
= dissect_icmpv6_type1
;
1477 *type
= "Packet Too Big";
1478 *optional
= dissect_icmpv6_type2
;
1481 *type
= "Time Exceeded";
1482 if (icmpv6_code_range_valid(icmp
->h_code
, icmpv6_type_3_codes
))
1483 *code
= icmpv6_type_3_codes
[icmp
->h_code
];
1484 *optional
= dissect_icmpv6_type3
;
1487 *type
= "Parameter Problem";
1488 if (icmpv6_code_range_valid(icmp
->h_code
, icmpv6_type_4_codes
))
1489 *code
= icmpv6_type_4_codes
[icmp
->h_code
];
1490 *optional
= dissect_icmpv6_type4
;
1493 *type
= "Private experimation";
1496 *type
= "Private experimation";
1499 *type
= "Reserved for expansion of ICMPv6 error messages";
1502 *type
= "Echo Request";
1503 *optional
= dissect_icmpv6_type128
;
1506 *type
= "Echo Reply";
1507 *optional
= dissect_icmpv6_type129
;
1510 *type
= "Multicast Listener Query";
1511 *optional
= dissect_icmpv6_type130
;
1514 *type
= "Multicast Listener Report";
1515 *optional
= dissect_icmpv6_type131
;
1518 *type
= "Multicast Listener Done";
1519 *optional
= dissect_icmpv6_type132
;
1522 *type
= "Router Solicitation";
1523 *optional
= dissect_icmpv6_type133
;
1526 *type
= "Router Advertisement";
1527 *optional
= dissect_icmpv6_type134
;
1530 *type
= "Neighbor Solicitation";
1531 *optional
= dissect_icmpv6_type135
;
1534 *type
= "Neighbor Advertisement";
1535 *optional
= dissect_icmpv6_type136
;
1538 *type
= "Redirect Message";
1539 *optional
= dissect_icmpv6_type137
;
1542 *type
= "Router Renumbering";
1543 if(icmpv6_type_138_codes(icmp
->h_code
))
1544 *code
= icmpv6_type_138_codes(icmp
->h_code
);
1545 *optional
= dissect_icmpv6_type138
;
1548 *type
= "ICMP Node Information Query";
1549 if (icmpv6_code_range_valid(icmp
->h_code
,
1550 icmpv6_type_139_codes
))
1551 *code
= icmpv6_type_139_codes
[icmp
->h_code
];
1552 *optional
= dissect_icmpv6_type139
;
1555 *type
= "ICMP Node Information Response";
1556 if (icmpv6_code_range_valid(icmp
->h_code
,
1557 icmpv6_type_140_codes
))
1558 *code
= icmpv6_type_140_codes
[icmp
->h_code
];
1559 *optional
= dissect_icmpv6_type140
;
1562 *type
= "Inverse Neighbor Discovery Solicitation Message";
1563 *optional
= dissect_icmpv6_type141
;
1566 *type
= "Inverse Neighbor Discovery Advertisement Message";
1567 *optional
= dissect_icmpv6_type142
;
1570 *type
= "Multicast Listener Report v2";
1571 *optional
= dissect_icmpv6_type143
;
1574 *type
= "Home Agent Address Discovery Request Message";
1575 *optional
= dissect_icmpv6_type144
;
1578 *type
= "Home Agent Address Discovery Reply Message";
1579 *optional
= dissect_icmpv6_type145
;
1582 *type
= "Mobile Prefix Solicitation";
1583 *optional
= dissect_icmpv6_type146
;
1586 *type
= "Mobile Prefix Advertisement";
1587 *optional
= dissect_icmpv6_type147
;
1590 *type
= "Certification Path Solicitation";
1591 *optional
= dissect_icmpv6_type148
;
1594 *type
= "Certification Path Advertisement";
1595 *optional
= dissect_icmpv6_type149
;
1598 *type
= "ICMP messages utilized by experimental mobility "
1599 "protocols such as Seamoby";
1600 *optional
= dissect_icmpv6_type150
;
1603 *type
= "Multicast Router Advertisement";
1604 *code
= "Ad. Interval";
1605 *optional
= dissect_icmpv6_type151
;
1608 *type
= "Multicast Router Solicitation";
1610 *optional
= dissect_icmpv6_type152
;
1613 *type
= "Multicast Router Termination";
1615 *optional
= dissect_icmpv6_type153
;
1618 *type
= "FMIPv6 Messages";
1619 *optional
= dissect_icmpv6_type154
;
1622 *type
= "RPL Control Message";
1623 if(icmpv6_type_155_codes(icmp
->h_code
))
1624 *code
= icmpv6_type_155_codes(icmp
->h_code
);
1627 *type
= "Private experimation";
1630 *type
= "Private experimation";
1633 *type
= "Reserved for expansion of ICMPv6 error messages";
1638 static void icmpv6(struct pkt_buff
*pkt
)
1640 char *type
= NULL
, *code
= NULL
;
1641 int8_t (*optional
)(struct pkt_buff
*pkt
) = NULL
;
1642 struct icmpv6_general_hdr
*icmp
=
1643 (struct icmpv6_general_hdr
*) pkt_pull(pkt
, sizeof(*icmp
));
1648 icmpv6_process(icmp
, &type
, &code
, &optional
);
1650 tprintf(" [ ICMPv6 ");
1651 tprintf("%s (%u), ", type
, icmp
->h_type
);
1652 tprintf("%s (%u), ", code
, icmp
->h_code
);
1653 tprintf("Chks (0x%x)", ntohs(icmp
->h_chksum
));
1655 if (!((*optional
) (pkt
)))
1656 tprintf("\n%s%s%s", colorize_start_full(black
, red
),
1657 "Failed to dissect Message", colorize_end());
1661 static void icmpv6_less(struct pkt_buff
*pkt
)
1663 struct icmpv6_general_hdr
*icmp
=
1664 (struct icmpv6_general_hdr
*) pkt_pull(pkt
, sizeof(*icmp
));
1669 tprintf(" ICMPv6 Type (%u) Code (%u)", icmp
->h_type
, icmp
->h_code
);
1672 struct protocol icmpv6_ops
= {
1674 .print_full
= icmpv6
,
1675 .print_less
= icmpv6_less
,
1678 EXPORT_SYMBOL(icmpv6_ops
);