2 * Copyright (c) 1995, 1996
3 * The Regents of the University of California. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the University of California,
13 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23 static const char rcsid
[] _U_
=
24 "@(#) $Header: /tcpdump/master/tcpdump/print-pim.c,v 1.41 2003-12-15 13:15:25 hannes Exp $ (LBL)";
31 #include <tcpdump-stdinc.h>
32 #include "interface.h"
34 #define PIMV2_TYPE_HELLO 0
35 #define PIMV2_TYPE_REGISTER 1
36 #define PIMV2_TYPE_REGISTER_STOP 2
37 #define PIMV2_TYPE_JOIN_PRUNE 3
38 #define PIMV2_TYPE_BOOTSTRAP 4
39 #define PIMV2_TYPE_ASSERT 5
40 #define PIMV2_TYPE_GRAFT 6
41 #define PIMV2_TYPE_GRAFT_ACK 7
42 #define PIMV2_TYPE_CANDIDATE_RP 8
43 #define PIMV2_TYPE_PRUNE_REFRESH 9
45 static struct tok pimv2_type_values
[] = {
46 { PIMV2_TYPE_HELLO
, "Hello" },
47 { PIMV2_TYPE_REGISTER
, "Register" },
48 { PIMV2_TYPE_REGISTER_STOP
, "Register Stop" },
49 { PIMV2_TYPE_JOIN_PRUNE
, "Join / Prune" },
50 { PIMV2_TYPE_BOOTSTRAP
, "Bootstrap" },
51 { PIMV2_TYPE_ASSERT
, "Assert" },
52 { PIMV2_TYPE_GRAFT
, "Graft" },
53 { PIMV2_TYPE_GRAFT_ACK
, "Graft Acknowledgement" },
54 { PIMV2_TYPE_CANDIDATE_RP
, "Candidate RP Advertisement" },
55 { PIMV2_TYPE_PRUNE_REFRESH
, "Prune Refresh" },
59 #define PIMV2_HELLO_OPTION_HOLDTIME 1
60 #define PIMV2_HELLO_OPTION_LANPRUNEDELAY 2
61 #define PIMV2_HELLO_OPTION_DR_PRIORITY_OLD 18
62 #define PIMV2_HELLO_OPTION_DR_PRIORITY 19
63 #define PIMV2_HELLO_OPTION_GENID 20
64 #define PIMV2_HELLO_OPTION_REFRESH_CAP 21
65 #define PIMV2_HELLO_OPTION_BIDIR_CAP 22
66 #define PIMV2_HELLO_OPTION_ADDRESS_LIST 24
67 #define PIMV2_HELLO_OPTION_ADDRESS_LIST_OLD 65001
69 static struct tok pimv2_hello_option_values
[] = {
70 { PIMV2_HELLO_OPTION_HOLDTIME
, "Hold Time" },
71 { PIMV2_HELLO_OPTION_LANPRUNEDELAY
, "LAN Prune Delay" },
72 { PIMV2_HELLO_OPTION_DR_PRIORITY_OLD
, "DR Priority (Old)" },
73 { PIMV2_HELLO_OPTION_DR_PRIORITY
, "DR Priority" },
74 { PIMV2_HELLO_OPTION_GENID
, "Generation ID" },
75 { PIMV2_HELLO_OPTION_REFRESH_CAP
, "State Refresh Capability" },
76 { PIMV2_HELLO_OPTION_BIDIR_CAP
, "Bi-Directional Capability" },
77 { PIMV2_HELLO_OPTION_ADDRESS_LIST
, "Address List" },
78 { PIMV2_HELLO_OPTION_ADDRESS_LIST_OLD
, "Address List (Old)" },
84 * XXX: We consider a case where IPv6 is not ready yet for portability,
85 * but PIM dependent defintions should be independent of IPv6...
90 /* upper 4bit: PIM version number; 2 for PIMv2 */
91 /* lower 4bit: the PIM message type, currently they are:
92 * Hello, Register, Register-Stop, Join/Prune,
93 * Bootstrap, Assert, Graft (PIM-DM only),
94 * Graft-Ack (PIM-DM only), C-RP-Adv
96 #define PIM_VER(x) (((x) & 0xf0) >> 4)
97 #define PIM_TYPE(x) ((x) & 0x0f)
98 u_char pim_rsv
; /* Reserved */
99 u_short pim_cksum
; /* IP style check sum */
106 #include "interface.h"
107 #include "addrtoname.h"
112 static void pimv2_print(register const u_char
*bp
, register u_int len
);
115 pimv1_join_prune_print(register const u_char
*bp
, register u_int len
)
117 int maddrlen
, addrlen
, ngroups
, njoin
, nprune
;
120 /* If it's a single group and a single source, use 1-line output. */
121 if (TTEST2(bp
[0], 30) && bp
[11] == 1 &&
122 ((njoin
= EXTRACT_16BITS(&bp
[20])) + EXTRACT_16BITS(&bp
[22])) == 1) {
125 (void)printf(" RPF %s ", ipaddr_string(bp
));
126 hold
= EXTRACT_16BITS(&bp
[6]);
128 (void)printf("Hold ");
131 (void)printf("%s (%s/%d, %s", njoin
? "Join" : "Prune",
132 ipaddr_string(&bp
[26]), bp
[25] & 0x3f,
133 ipaddr_string(&bp
[12]));
134 if (EXTRACT_32BITS(&bp
[16]) != 0xffffffff)
135 (void)printf("/%s", ipaddr_string(&bp
[16]));
136 (void)printf(") %s%s %s",
137 (bp
[24] & 0x01) ? "Sparse" : "Dense",
138 (bp
[25] & 0x80) ? " WC" : "",
139 (bp
[25] & 0x40) ? "RP" : "SPT");
146 (void)printf(" Upstream Nbr: %s", ipaddr_string(bp
));
150 (void)printf(" Hold time: ");
151 relts_print(EXTRACT_16BITS(&bp
[6]));
165 (void)printf("\n\tGroup: %s", ipaddr_string(bp
));
166 if (EXTRACT_32BITS(&bp
[4]) != 0xffffffff)
167 (void)printf("/%s", ipaddr_string(&bp
[4]));
169 njoin
= EXTRACT_16BITS(&bp
[8]);
170 nprune
= EXTRACT_16BITS(&bp
[10]);
171 (void)printf(" joined: %d pruned: %d", njoin
, nprune
);
174 for (njp
= 0; njp
< (njoin
+ nprune
); njp
++) {
182 (void)printf("\n\t%s %s%s%s%s/%d", type
,
183 (bp
[0] & 0x01) ? "Sparse " : "Dense ",
184 (bp
[1] & 0x80) ? "WC " : "",
185 (bp
[1] & 0x40) ? "RP " : "SPT ",
186 ipaddr_string(&bp
[2]), bp
[1] & 0x3f);
193 (void)printf("[|pim]");
198 pimv1_print(register const u_char
*bp
, register u_int len
)
200 register const u_char
*ep
;
201 register u_char type
;
203 ep
= (const u_char
*)snapend
;
212 (void)printf(" Query");
214 switch (bp
[8] >> 4) {
216 (void)printf(" Dense-mode");
219 (void)printf(" Sparse-mode");
222 (void)printf(" Sparse-Dense-mode");
225 (void)printf(" mode-%d", bp
[8] >> 4);
231 (void)printf(" (Hold-time ");
232 relts_print(EXTRACT_16BITS(&bp
[10]));
238 (void)printf(" Register");
239 TCHECK2(bp
[8], 20); /* ip header */
240 (void)printf(" for %s > %s", ipaddr_string(&bp
[20]),
241 ipaddr_string(&bp
[24]));
244 (void)printf(" Register-Stop");
246 (void)printf(" for %s > %s", ipaddr_string(&bp
[8]),
247 ipaddr_string(&bp
[12]));
250 (void)printf(" Join/Prune");
252 pimv1_join_prune_print(&bp
[8], len
- 8);
255 (void)printf(" RP-reachable");
258 (void)printf(" group %s",
259 ipaddr_string(&bp
[8]));
260 if (EXTRACT_32BITS(&bp
[12]) != 0xffffffff)
261 (void)printf("/%s", ipaddr_string(&bp
[12]));
262 (void)printf(" RP %s hold ", ipaddr_string(&bp
[16]));
263 relts_print(EXTRACT_16BITS(&bp
[22]));
267 (void)printf(" Assert");
269 (void)printf(" for %s > %s", ipaddr_string(&bp
[16]),
270 ipaddr_string(&bp
[8]));
271 if (EXTRACT_32BITS(&bp
[12]) != 0xffffffff)
272 (void)printf("/%s", ipaddr_string(&bp
[12]));
274 (void)printf(" %s pref %d metric %d",
275 (bp
[20] & 0x80) ? "RP-tree" : "SPT",
276 EXTRACT_32BITS(&bp
[20]) & 0x7fffffff,
277 EXTRACT_32BITS(&bp
[24]));
280 (void)printf(" Graft");
282 pimv1_join_prune_print(&bp
[8], len
- 8);
285 (void)printf(" Graft-ACK");
287 pimv1_join_prune_print(&bp
[8], len
- 8);
290 (void)printf(" Mode");
293 (void)printf(" [type %d]", type
);
296 if ((bp
[4] >> 4) != 1)
297 (void)printf(" [v%d]", bp
[4] >> 4);
301 (void)printf("[|pim]");
306 * auto-RP is a cisco protocol, documented at
307 * ftp://ftpeng.cisco.com/ipmulticast/specs/pim-autorp-spec01.txt
309 * This implements version 1+, dated Sept 9, 1998.
312 cisco_autorp_print(register const u_char
*bp
, register u_int len
)
319 (void)printf(" auto-rp ");
323 (void)printf("candidate-advert");
326 (void)printf("mapping");
329 (void)printf("type-0x%02x", type
);
337 (void)printf(" Hold ");
338 hold
= EXTRACT_16BITS(&bp
[2]);
340 relts_print(EXTRACT_16BITS(&bp
[2]));
344 /* Next 4 bytes are reserved. */
348 /*XXX skip unless -v? */
352 * numrps entries of the form:
355 * 2 bits: PIM version supported, bit 0 is "supports v1", 1 is "v2".
356 * 8 bits: # of entries for this RP
357 * each entry: 7 bits: reserved, 1 bit: negative,
358 * 8 bits: mask 32 bits: source
359 * lather, rinse, repeat.
366 (void)printf(" RP %s", ipaddr_string(bp
));
368 switch (bp
[4] & 0x3) {
369 case 0: printf(" PIMv?");
371 case 1: printf(" PIMv1");
373 case 2: printf(" PIMv2");
375 case 3: printf(" PIMv1+2");
379 (void)printf(" [rsvd=0x%02x]", bp
[4] & 0xfc);
384 for (; nentries
; nentries
--) {
386 (void)printf("%c%s%s/%d", s
, bp
[0] & 1 ? "!" : "",
387 ipaddr_string(&bp
[2]), bp
[1]);
389 (void)printf("[rsvd=0x%02x]", bp
[0] & 0xfe);
397 (void)printf("[|autorp]");
402 pim_print(register const u_char
*bp
, register u_int len
)
404 register const u_char
*ep
;
405 register struct pim
*pim
= (struct pim
*)bp
;
407 ep
= (const u_char
*)snapend
;
410 #ifdef notyet /* currently we see only version and type */
411 TCHECK(pim
->pim_rsv
);
414 switch (PIM_VER(pim
->pim_typever
)) {
417 printf("PIMv%u, %s (%u), length: %u",
418 PIM_VER(pim
->pim_typever
),
419 tok2str(pimv2_type_values
,"Unknown Type",PIM_TYPE(pim
->pim_typever
)),
420 PIM_TYPE(pim
->pim_typever
),
424 printf("PIMv%u, length: %u\n\t%s (%u)",
425 PIM_VER(pim
->pim_typever
),
427 tok2str(pimv2_type_values
,"Unknown Type",PIM_TYPE(pim
->pim_typever
)),
428 PIM_TYPE(pim
->pim_typever
));
429 pimv2_print(bp
, len
);
433 printf("PIMv%u, length: %u",
434 PIM_VER(pim
->pim_typever
),
442 * PIMv2 uses encoded address representations.
444 * The last PIM-SM I-D before RFC2117 was published specified the
445 * following representation for unicast addresses. However, RFC2117
446 * specified no encoding for unicast addresses with the unicast
447 * address length specified in the header. Therefore, we have to
448 * guess which encoding is being used (Cisco's PIMv2 implementation
449 * uses the non-RFC encoding). RFC2117 turns a previously "Reserved"
450 * field into a 'unicast-address-length-in-bytes' field. We guess
451 * that it's the draft encoding if this reserved field is zero.
453 * RFC2362 goes back to the encoded format, and calls the addr length
454 * field "reserved" again.
456 * The first byte is the address family, from:
459 * 1 IP (IP version 4)
460 * 2 IP6 (IP version 6)
462 * 4 HDLC (8-bit multidrop)
464 * 6 802 (includes all 802 media plus Ethernet "canonical format")
466 * 8 E.164 (SMDS, Frame Relay, ATM)
468 * 10 X.121 (X.25, Frame Relay)
473 * 15 E.164 with NSAP format subaddress
475 * In addition, the second byte is an "Encoding". 0 is the default
476 * encoding for the address family, and no other encodings are currently
481 static int pimv2_addr_len
;
483 enum pimv2_addrtype
{
484 pimv2_unicast
, pimv2_group
, pimv2_source
488 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
489 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
490 * | Addr Family | Encoding Type | Unicast Address |
491 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+++++++
493 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
494 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
495 * | Addr Family | Encoding Type | Reserved | Mask Len |
496 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
497 * | Group multicast Address |
498 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
500 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
501 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
502 * | Addr Family | Encoding Type | Rsrvd |S|W|R| Mask Len |
503 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
505 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
508 pimv2_addr_print(const u_char
*bp
, enum pimv2_addrtype at
, int silent
)
516 if (pimv2_addr_len
== 0) {
538 switch (pimv2_addr_len
) {
553 len
= pimv2_addr_len
;
563 (void)printf("%s", ipaddr_string(bp
));
566 else if (af
== AF_INET6
) {
568 (void)printf("%s", ip6addr_string(bp
));
574 TCHECK2(bp
[0], len
+ 2);
577 (void)printf("%s", ipaddr_string(bp
+ 2));
579 (void)printf("/%u", bp
[1]);
583 else if (af
== AF_INET6
) {
585 (void)printf("%s", ip6addr_string(bp
+ 2));
587 (void)printf("/%u", bp
[1]);
591 if (bp
[0] && !silent
) {
592 if (at
== pimv2_group
) {
593 (void)printf("(0x%02x)", bp
[0]);
595 (void)printf("(%s%s%s",
596 bp
[0] & 0x04 ? "S" : "",
597 bp
[0] & 0x02 ? "W" : "",
598 bp
[0] & 0x01 ? "R" : "");
600 (void) printf("+0x%02x", bp
[0] & 0xf8);
605 return hdrlen
+ 2 + len
;
614 pimv2_print(register const u_char
*bp
, register u_int len
)
616 register const u_char
*ep
;
617 register struct pim
*pim
= (struct pim
*)bp
;
620 ep
= (const u_char
*)snapend
;
625 TCHECK(pim
->pim_rsv
);
626 pimv2_addr_len
= pim
->pim_rsv
;
627 if (pimv2_addr_len
!= 0)
628 (void)printf(", RFC2117-encoding");
630 switch (PIM_TYPE(pim
->pim_typever
)) {
631 case PIMV2_TYPE_HELLO
:
633 u_int16_t otype
, olen
;
637 otype
= EXTRACT_16BITS(&bp
[0]);
638 olen
= EXTRACT_16BITS(&bp
[2]);
639 TCHECK2(bp
[0], 4 + olen
);
641 printf("\n\t %s Option (%u), Value: ",
642 tok2str( pimv2_hello_option_values
,"Unknown",otype
),
647 case PIMV2_HELLO_OPTION_HOLDTIME
:
648 relts_print(EXTRACT_16BITS(bp
));
651 case PIMV2_HELLO_OPTION_LANPRUNEDELAY
:
653 (void)printf("ERROR: Option Lenght != 4 Bytes (%u)", olen
);
656 u_int16_t lan_delay
, override_interval
;
657 lan_delay
= EXTRACT_16BITS(bp
);
658 override_interval
= EXTRACT_16BITS(bp
+2);
659 t_bit
= (lan_delay
& 0x8000)? 1 : 0;
660 lan_delay
&= ~0x8000;
661 (void)printf("\n\t T-bit=%d, LAN delay %dms, Override interval %dms",
662 t_bit
, lan_delay
, override_interval
);
666 case PIMV2_HELLO_OPTION_DR_PRIORITY_OLD
:
667 case PIMV2_HELLO_OPTION_DR_PRIORITY
:
670 printf("Bi-Directional Capability (Old)");
673 printf("%u", EXTRACT_32BITS(bp
));
676 printf("ERROR: Option Lenght != 4 Bytes (%u)", olen
);
681 case PIMV2_HELLO_OPTION_GENID
:
682 (void)printf("0x%08x", EXTRACT_32BITS(bp
));
685 case PIMV2_HELLO_OPTION_REFRESH_CAP
:
686 (void)printf("v%d", *bp
);
688 (void)printf(", interval ");
689 relts_print(*(bp
+1));
691 if (EXTRACT_16BITS(bp
+2) != 0) {
692 (void)printf(" ?0x%04x?", EXTRACT_16BITS(bp
+2));
696 case PIMV2_HELLO_OPTION_BIDIR_CAP
:
699 case PIMV2_HELLO_OPTION_ADDRESS_LIST_OLD
:
700 case PIMV2_HELLO_OPTION_ADDRESS_LIST
:
702 const u_char
*ptr
= bp
;
703 while (ptr
< (bp
+olen
)) {
707 advance
= pimv2_addr_print(ptr
, pimv2_unicast
, 0);
718 print_unknown_data(bp
,"\n\t ",olen
);
721 /* do we want to see an additionally hexdump ? */
723 print_unknown_data(bp
,"\n\t ",olen
);
729 case PIMV2_TYPE_REGISTER
:
733 if (vflag
&& bp
+ 8 <= ep
) {
734 (void)printf(" %s%s", bp
[4] & 0x80 ? "B" : "",
735 bp
[4] & 0x40 ? "N" : "");
739 /* encapsulated multicast packet */
742 ip
= (struct ip
*)bp
;
755 (void)printf(" IP ver %d", IP_V(ip
));
761 case PIMV2_TYPE_REGISTER_STOP
:
765 (void)printf(" group=");
766 if ((advance
= pimv2_addr_print(bp
, pimv2_group
, 0)) < 0) {
770 bp
+= advance
; len
-= advance
;
773 (void)printf(" source=");
774 if ((advance
= pimv2_addr_print(bp
, pimv2_unicast
, 0)) < 0) {
778 bp
+= advance
; len
-= advance
;
781 case PIMV2_TYPE_JOIN_PRUNE
:
782 case PIMV2_TYPE_GRAFT
:
783 case PIMV2_TYPE_GRAFT_ACK
:
792 if (PIM_TYPE(pim
->pim_typever
) != 7) { /*not for Graft-ACK*/
795 (void)printf(" upstream-neighbor=");
796 if ((advance
= pimv2_addr_print(bp
, pimv2_unicast
, 0)) < 0) {
800 bp
+= advance
; len
-= advance
;
805 holdtime
= EXTRACT_16BITS(&bp
[2]);
806 (void)printf(" groups=%u", ngroup
);
807 if (PIM_TYPE(pim
->pim_typever
) != 7) { /*not for Graft-ACK*/
808 (void)printf(" holdtime=");
809 if (holdtime
== 0xffff)
810 (void)printf("infty");
812 relts_print(holdtime
);
815 for (i
= 0; i
< ngroup
; i
++) {
818 (void)printf(" (group%d: ", i
);
819 if ((advance
= pimv2_addr_print(bp
, pimv2_group
, 0)) < 0) {
820 (void)printf("...)");
823 bp
+= advance
; len
-= advance
;
825 (void)printf("...)");
828 njoin
= EXTRACT_16BITS(&bp
[0]);
829 nprune
= EXTRACT_16BITS(&bp
[2]);
830 (void)printf(" join=%u", njoin
);
832 for (j
= 0; j
< njoin
; j
++) {
834 if ((advance
= pimv2_addr_print(bp
, pimv2_source
, 0)) < 0) {
835 (void)printf("...)");
838 bp
+= advance
; len
-= advance
;
840 (void)printf(" prune=%u", nprune
);
841 for (j
= 0; j
< nprune
; j
++) {
843 if ((advance
= pimv2_addr_print(bp
, pimv2_source
, 0)) < 0) {
844 (void)printf("...)");
847 bp
+= advance
; len
-= advance
;
855 case PIMV2_TYPE_BOOTSTRAP
:
860 /* Fragment Tag, Hash Mask len, and BSR-priority */
861 if (bp
+ sizeof(u_int16_t
) >= ep
) break;
862 (void)printf(" tag=%x", EXTRACT_16BITS(bp
));
863 bp
+= sizeof(u_int16_t
);
865 (void)printf(" hashmlen=%d", bp
[0]);
866 if (bp
+ 1 >= ep
) break;
867 (void)printf(" BSRprio=%d", bp
[1]);
870 /* Encoded-Unicast-BSR-Address */
872 (void)printf(" BSR=");
873 if ((advance
= pimv2_addr_print(bp
, pimv2_unicast
, 0)) < 0) {
879 for (i
= 0; bp
< ep
; i
++) {
880 /* Encoded-Group Address */
881 (void)printf(" (group%d: ", i
);
882 if ((advance
= pimv2_addr_print(bp
, pimv2_group
, 0))
884 (void)printf("...)");
889 /* RP-Count, Frag RP-Cnt, and rsvd */
891 (void)printf("...)");
894 (void)printf(" RPcnt=%d", bp
[0]);
896 (void)printf("...)");
899 (void)printf(" FRPcnt=%d", frpcnt
= bp
[1]);
902 for (j
= 0; j
< frpcnt
&& bp
< ep
; j
++) {
904 (void)printf(" RP%d=", j
);
905 if ((advance
= pimv2_addr_print(bp
,
908 (void)printf("...)");
914 (void)printf("...)");
917 (void)printf(",holdtime=");
918 relts_print(EXTRACT_16BITS(bp
));
920 (void)printf("...)");
923 (void)printf(",prio=%d", bp
[2]);
931 case PIMV2_TYPE_ASSERT
:
935 (void)printf(" group=");
936 if ((advance
= pimv2_addr_print(bp
, pimv2_group
, 0)) < 0) {
940 bp
+= advance
; len
-= advance
;
943 (void)printf(" src=");
944 if ((advance
= pimv2_addr_print(bp
, pimv2_unicast
, 0)) < 0) {
948 bp
+= advance
; len
-= advance
;
952 (void)printf(" RPT");
953 (void)printf(" pref=%u", EXTRACT_32BITS(&bp
[0]) & 0x7fffffff);
954 (void)printf(" metric=%u", EXTRACT_32BITS(&bp
[4]));
957 case PIMV2_TYPE_CANDIDATE_RP
:
962 /* Prefix-Cnt, Priority, and Holdtime */
964 (void)printf(" prefix-cnt=%d", bp
[0]);
966 if (bp
+ 1 >= ep
) break;
967 (void)printf(" prio=%d", bp
[1]);
968 if (bp
+ 3 >= ep
) break;
969 (void)printf(" holdtime=");
970 relts_print(EXTRACT_16BITS(&bp
[2]));
973 /* Encoded-Unicast-RP-Address */
975 (void)printf(" RP=");
976 if ((advance
= pimv2_addr_print(bp
, pimv2_unicast
, 0)) < 0) {
982 /* Encoded-Group Addresses */
983 for (i
= 0; i
< pfxcnt
&& bp
< ep
; i
++) {
984 (void)printf(" Group%d=", i
);
985 if ((advance
= pimv2_addr_print(bp
, pimv2_group
, 0))
995 case PIMV2_TYPE_PRUNE_REFRESH
:
996 (void)printf(" src=");
997 if ((advance
= pimv2_addr_print(bp
, pimv2_unicast
, 0)) < 0) {
1002 (void)printf(" grp=");
1003 if ((advance
= pimv2_addr_print(bp
, pimv2_group
, 0)) < 0) {
1004 (void)printf("...");
1008 (void)printf(" forwarder=");
1009 if ((advance
= pimv2_addr_print(bp
, pimv2_unicast
, 0)) < 0) {
1010 (void)printf("...");
1015 (void)printf(" TUNR ");
1016 relts_print(EXTRACT_16BITS(bp
));
1021 (void)printf(" [type %d]", PIM_TYPE(pim
->pim_typever
));
1028 (void)printf("[|pim]");