Lines Matching refs:bp

119 static void pimv2_print(register const u_char *bp, register u_int len, u_int cksum);
122 pimv1_join_prune_print(register const u_char *bp, register u_int len) in pimv1_join_prune_print() argument
128 if (TTEST2(bp[0], 30) && bp[11] == 1 && in pimv1_join_prune_print()
129 ((njoin = EXTRACT_16BITS(&bp[20])) + EXTRACT_16BITS(&bp[22])) == 1) { in pimv1_join_prune_print()
132 (void)printf(" RPF %s ", ipaddr_string(bp)); in pimv1_join_prune_print()
133 hold = EXTRACT_16BITS(&bp[6]); in pimv1_join_prune_print()
139 ipaddr_string(&bp[26]), bp[25] & 0x3f, in pimv1_join_prune_print()
140 ipaddr_string(&bp[12])); in pimv1_join_prune_print()
141 if (EXTRACT_32BITS(&bp[16]) != 0xffffffff) in pimv1_join_prune_print()
142 (void)printf("/%s", ipaddr_string(&bp[16])); in pimv1_join_prune_print()
144 (bp[24] & 0x01) ? "Sparse" : "Dense", in pimv1_join_prune_print()
145 (bp[25] & 0x80) ? " WC" : "", in pimv1_join_prune_print()
146 (bp[25] & 0x40) ? "RP" : "SPT"); in pimv1_join_prune_print()
150 TCHECK2(bp[0], sizeof(struct in_addr)); in pimv1_join_prune_print()
153 (void)printf(" Upstream Nbr: %s", ipaddr_string(bp)); in pimv1_join_prune_print()
154 TCHECK2(bp[6], 2); in pimv1_join_prune_print()
158 relts_print(EXTRACT_16BITS(&bp[6])); in pimv1_join_prune_print()
161 bp += 8; in pimv1_join_prune_print()
164 TCHECK2(bp[0], 4); in pimv1_join_prune_print()
165 ngroups = bp[3]; in pimv1_join_prune_print()
166 bp += 4; in pimv1_join_prune_print()
173 TCHECK2(bp[0], sizeof(struct in_addr)); in pimv1_join_prune_print()
174 (void)printf("\n\tGroup: %s", ipaddr_string(bp)); in pimv1_join_prune_print()
175 TCHECK2(bp[4], sizeof(struct in_addr)); in pimv1_join_prune_print()
176 if (EXTRACT_32BITS(&bp[4]) != 0xffffffff) in pimv1_join_prune_print()
177 (void)printf("/%s", ipaddr_string(&bp[4])); in pimv1_join_prune_print()
178 TCHECK2(bp[8], 4); in pimv1_join_prune_print()
179 njoin = EXTRACT_16BITS(&bp[8]); in pimv1_join_prune_print()
180 nprune = EXTRACT_16BITS(&bp[10]); in pimv1_join_prune_print()
182 bp += 12; in pimv1_join_prune_print()
191 TCHECK2(bp[0], 6); in pimv1_join_prune_print()
193 (bp[0] & 0x01) ? "Sparse " : "Dense ", in pimv1_join_prune_print()
194 (bp[1] & 0x80) ? "WC " : "", in pimv1_join_prune_print()
195 (bp[1] & 0x40) ? "RP " : "SPT ", in pimv1_join_prune_print()
196 ipaddr_string(&bp[2]), bp[1] & 0x3f); in pimv1_join_prune_print()
197 bp += 6; in pimv1_join_prune_print()
208 pimv1_print(register const u_char *bp, register u_int len) in pimv1_print() argument
214 if (bp >= ep) in pimv1_print()
217 TCHECK(bp[1]); in pimv1_print()
218 type = bp[1]; in pimv1_print()
223 if (TTEST(bp[8])) { in pimv1_print()
224 switch (bp[8] >> 4) { in pimv1_print()
235 (void)printf(" mode-%d", bp[8] >> 4); in pimv1_print()
240 TCHECK2(bp[10],2); in pimv1_print()
242 relts_print(EXTRACT_16BITS(&bp[10])); in pimv1_print()
249 TCHECK2(bp[8], 20); /* ip header */ in pimv1_print()
250 (void)printf(" for %s > %s", ipaddr_string(&bp[20]), in pimv1_print()
251 ipaddr_string(&bp[24])); in pimv1_print()
255 TCHECK2(bp[12], sizeof(struct in_addr)); in pimv1_print()
256 (void)printf(" for %s > %s", ipaddr_string(&bp[8]), in pimv1_print()
257 ipaddr_string(&bp[12])); in pimv1_print()
262 pimv1_join_prune_print(&bp[8], len - 8); in pimv1_print()
267 TCHECK2(bp[22], 2); in pimv1_print()
269 ipaddr_string(&bp[8])); in pimv1_print()
270 if (EXTRACT_32BITS(&bp[12]) != 0xffffffff) in pimv1_print()
271 (void)printf("/%s", ipaddr_string(&bp[12])); in pimv1_print()
272 (void)printf(" RP %s hold ", ipaddr_string(&bp[16])); in pimv1_print()
273 relts_print(EXTRACT_16BITS(&bp[22])); in pimv1_print()
278 TCHECK2(bp[16], sizeof(struct in_addr)); in pimv1_print()
279 (void)printf(" for %s > %s", ipaddr_string(&bp[16]), in pimv1_print()
280 ipaddr_string(&bp[8])); in pimv1_print()
281 if (EXTRACT_32BITS(&bp[12]) != 0xffffffff) in pimv1_print()
282 (void)printf("/%s", ipaddr_string(&bp[12])); in pimv1_print()
283 TCHECK2(bp[24], 4); in pimv1_print()
285 (bp[20] & 0x80) ? "RP-tree" : "SPT", in pimv1_print()
286 EXTRACT_32BITS(&bp[20]) & 0x7fffffff, in pimv1_print()
287 EXTRACT_32BITS(&bp[24])); in pimv1_print()
292 pimv1_join_prune_print(&bp[8], len - 8); in pimv1_print()
297 pimv1_join_prune_print(&bp[8], len - 8); in pimv1_print()
306 if ((bp[4] >> 4) != 1) in pimv1_print()
307 (void)printf(" [v%d]", bp[4] >> 4); in pimv1_print()
322 cisco_autorp_print(register const u_char *bp, register u_int len) in cisco_autorp_print() argument
328 TCHECK(bp[0]); in cisco_autorp_print()
330 type = bp[0]; in cisco_autorp_print()
343 TCHECK(bp[1]); in cisco_autorp_print()
344 numrps = bp[1]; in cisco_autorp_print()
346 TCHECK2(bp[2], 2); in cisco_autorp_print()
348 hold = EXTRACT_16BITS(&bp[2]); in cisco_autorp_print()
350 relts_print(EXTRACT_16BITS(&bp[2])); in cisco_autorp_print()
356 bp += 8; len -= 8; in cisco_autorp_print()
375 TCHECK2(bp[0], 4); in cisco_autorp_print()
376 (void)printf(" RP %s", ipaddr_string(bp)); in cisco_autorp_print()
377 TCHECK(bp[4]); in cisco_autorp_print()
378 switch (bp[4] & 0x3) { in cisco_autorp_print()
388 if (bp[4] & 0xfc) in cisco_autorp_print()
389 (void)printf(" [rsvd=0x%02x]", bp[4] & 0xfc); in cisco_autorp_print()
390 TCHECK(bp[5]); in cisco_autorp_print()
391 nentries = bp[5]; in cisco_autorp_print()
392 bp += 6; len -= 6; in cisco_autorp_print()
395 TCHECK2(bp[0], 6); in cisco_autorp_print()
396 (void)printf("%c%s%s/%d", s, bp[0] & 1 ? "!" : "", in cisco_autorp_print()
397 ipaddr_string(&bp[2]), bp[1]); in cisco_autorp_print()
398 if (bp[0] & 0x02) { in cisco_autorp_print()
401 if (bp[0] & 0xfc) { in cisco_autorp_print()
402 (void)printf("[rsvd=0x%02x]", bp[0] & 0xfc); in cisco_autorp_print()
405 bp += 6; len -= 6; in cisco_autorp_print()
416 pim_print(register const u_char *bp, register u_int len, u_int cksum) in pim_print() argument
419 register struct pim *pim = (struct pim *)bp; in pim_print()
422 if (bp >= ep) in pim_print()
441 pimv2_print(bp, len, cksum); in pim_print()
520 pimv2_addr_print(const u_char *bp, enum pimv2_addrtype at, int silent) in pimv2_addr_print() argument
525 TCHECK(bp[0]); in pimv2_addr_print()
528 TCHECK(bp[1]); in pimv2_addr_print()
529 switch (bp[0]) { in pimv2_addr_print()
543 if (bp[1] != 0) in pimv2_addr_print()
564 bp += hdrlen; in pimv2_addr_print()
567 TCHECK2(bp[0], len); in pimv2_addr_print()
570 (void)printf("%s", ipaddr_string(bp)); in pimv2_addr_print()
575 (void)printf("%s", ip6addr_string(bp)); in pimv2_addr_print()
581 TCHECK2(bp[0], len + 2); in pimv2_addr_print()
584 (void)printf("%s", ipaddr_string(bp + 2)); in pimv2_addr_print()
585 if (bp[1] != 32) in pimv2_addr_print()
586 (void)printf("/%u", bp[1]); in pimv2_addr_print()
592 (void)printf("%s", ip6addr_string(bp + 2)); in pimv2_addr_print()
593 if (bp[1] != 128) in pimv2_addr_print()
594 (void)printf("/%u", bp[1]); in pimv2_addr_print()
598 if (bp[0] && !silent) { in pimv2_addr_print()
600 (void)printf("(0x%02x)", bp[0]); in pimv2_addr_print()
603 bp[0] & 0x04 ? "S" : "", in pimv2_addr_print()
604 bp[0] & 0x02 ? "W" : "", in pimv2_addr_print()
605 bp[0] & 0x01 ? "R" : ""); in pimv2_addr_print()
606 if (bp[0] & 0xf8) { in pimv2_addr_print()
607 (void) printf("+0x%02x", bp[0] & 0xf8); in pimv2_addr_print()
621 pimv2_print(register const u_char *bp, register u_int len, u_int cksum) in pimv2_print() argument
624 register struct pim *pim = (struct pim *)bp; in pimv2_print()
628 if (bp >= ep) in pimv2_print()
630 if (ep > bp + len) in pimv2_print()
631 ep = bp + len; in pimv2_print()
641 printf("(%scorrect)", TTEST2(bp[0], len) && cksum ? "in" : "" ); in pimv2_print()
648 bp += 4; in pimv2_print()
649 while (bp < ep) { in pimv2_print()
650 TCHECK2(bp[0], 4); in pimv2_print()
651 otype = EXTRACT_16BITS(&bp[0]); in pimv2_print()
652 olen = EXTRACT_16BITS(&bp[2]); in pimv2_print()
653 TCHECK2(bp[0], 4 + olen); in pimv2_print()
659 bp += 4; in pimv2_print()
663 relts_print(EXTRACT_16BITS(bp)); in pimv2_print()
672 lan_delay = EXTRACT_16BITS(bp); in pimv2_print()
673 override_interval = EXTRACT_16BITS(bp+2); in pimv2_print()
688 printf("%u", EXTRACT_32BITS(bp)); in pimv2_print()
697 (void)printf("0x%08x", EXTRACT_32BITS(bp)); in pimv2_print()
701 (void)printf("v%d", *bp); in pimv2_print()
702 if (*(bp+1) != 0) { in pimv2_print()
704 relts_print(*(bp+1)); in pimv2_print()
706 if (EXTRACT_16BITS(bp+2) != 0) { in pimv2_print()
707 (void)printf(" ?0x%04x?", EXTRACT_16BITS(bp+2)); in pimv2_print()
717 const u_char *ptr = bp; in pimv2_print()
718 while (ptr < (bp+olen)) { in pimv2_print()
733 print_unknown_data(bp,"\n\t ",olen); in pimv2_print()
738 print_unknown_data(bp,"\n\t ",olen); in pimv2_print()
739 bp += olen; in pimv2_print()
748 if (!TTEST2(*(bp+4), PIMV2_REGISTER_FLAG_LEN)) in pimv2_print()
754 EXTRACT_32BITS(bp+4))); in pimv2_print()
756 bp += 8; len -= 8; in pimv2_print()
758 ip = (struct ip *)bp; in pimv2_print()
767 ip_print(gndo, bp, len); in pimv2_print()
771 ip6_print(gndo, bp, len); in pimv2_print()
782 bp += 4; len -= 4; in pimv2_print()
783 if (bp >= ep) in pimv2_print()
786 if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { in pimv2_print()
790 bp += advance; len -= advance; in pimv2_print()
791 if (bp >= ep) in pimv2_print()
794 if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
798 bp += advance; len -= advance; in pimv2_print()
848 bp += 4; len -= 4; in pimv2_print()
850 if (bp >= ep) in pimv2_print()
853 if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
857 bp += advance; len -= advance; in pimv2_print()
859 if (bp + 4 > ep) in pimv2_print()
861 ngroup = bp[1]; in pimv2_print()
862 holdtime = EXTRACT_16BITS(&bp[2]); in pimv2_print()
871 bp += 4; len -= 4; in pimv2_print()
873 if (bp >= ep) in pimv2_print()
876 if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { in pimv2_print()
880 bp += advance; len -= advance; in pimv2_print()
881 if (bp + 4 > ep) { in pimv2_print()
885 njoin = EXTRACT_16BITS(&bp[0]); in pimv2_print()
886 nprune = EXTRACT_16BITS(&bp[2]); in pimv2_print()
888 bp += 4; len -= 4; in pimv2_print()
891 if ((advance = pimv2_addr_print(bp, pimv2_source, 0)) < 0) { in pimv2_print()
895 bp += advance; len -= advance; in pimv2_print()
899 if ((advance = pimv2_addr_print(bp, pimv2_source, 0)) < 0) { in pimv2_print()
903 bp += advance; len -= advance; in pimv2_print()
913 bp += 4; in pimv2_print()
916 if (bp + sizeof(u_int16_t) >= ep) break; in pimv2_print()
917 (void)printf(" tag=%x", EXTRACT_16BITS(bp)); in pimv2_print()
918 bp += sizeof(u_int16_t); in pimv2_print()
919 if (bp >= ep) break; in pimv2_print()
920 (void)printf(" hashmlen=%d", bp[0]); in pimv2_print()
921 if (bp + 1 >= ep) break; in pimv2_print()
922 (void)printf(" BSRprio=%d", bp[1]); in pimv2_print()
923 bp += 2; in pimv2_print()
926 if (bp >= ep) break; in pimv2_print()
928 if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
932 bp += advance; in pimv2_print()
934 for (i = 0; bp < ep; i++) { in pimv2_print()
937 if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) in pimv2_print()
942 bp += advance; in pimv2_print()
945 if (bp >= ep) { in pimv2_print()
949 (void)printf(" RPcnt=%d", bp[0]); in pimv2_print()
950 if (bp + 1 >= ep) { in pimv2_print()
954 (void)printf(" FRPcnt=%d", frpcnt = bp[1]); in pimv2_print()
955 bp += 4; in pimv2_print()
957 for (j = 0; j < frpcnt && bp < ep; j++) { in pimv2_print()
960 if ((advance = pimv2_addr_print(bp, in pimv2_print()
966 bp += advance; in pimv2_print()
968 if (bp + 1 >= ep) { in pimv2_print()
973 relts_print(EXTRACT_16BITS(bp)); in pimv2_print()
974 if (bp + 2 >= ep) { in pimv2_print()
978 (void)printf(",prio=%d", bp[2]); in pimv2_print()
979 bp += 4; in pimv2_print()
987 bp += 4; len -= 4; in pimv2_print()
988 if (bp >= ep) in pimv2_print()
991 if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { in pimv2_print()
995 bp += advance; len -= advance; in pimv2_print()
996 if (bp >= ep) in pimv2_print()
999 if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1003 bp += advance; len -= advance; in pimv2_print()
1004 if (bp + 8 > ep) in pimv2_print()
1006 if (bp[0] & 0x80) in pimv2_print()
1008 (void)printf(" pref=%u", EXTRACT_32BITS(&bp[0]) & 0x7fffffff); in pimv2_print()
1009 (void)printf(" metric=%u", EXTRACT_32BITS(&bp[4])); in pimv2_print()
1015 bp += 4; in pimv2_print()
1018 if (bp >= ep) break; in pimv2_print()
1019 (void)printf(" prefix-cnt=%d", bp[0]); in pimv2_print()
1020 pfxcnt = bp[0]; in pimv2_print()
1021 if (bp + 1 >= ep) break; in pimv2_print()
1022 (void)printf(" prio=%d", bp[1]); in pimv2_print()
1023 if (bp + 3 >= ep) break; in pimv2_print()
1025 relts_print(EXTRACT_16BITS(&bp[2])); in pimv2_print()
1026 bp += 4; in pimv2_print()
1029 if (bp >= ep) break; in pimv2_print()
1031 if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1035 bp += advance; in pimv2_print()
1038 for (i = 0; i < pfxcnt && bp < ep; i++) { in pimv2_print()
1040 if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) in pimv2_print()
1045 bp += advance; in pimv2_print()
1052 if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1056 bp += advance; in pimv2_print()
1058 if ((advance = pimv2_addr_print(bp, pimv2_group, 0)) < 0) { in pimv2_print()
1062 bp += advance; in pimv2_print()
1064 if ((advance = pimv2_addr_print(bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1068 bp += advance; in pimv2_print()
1069 TCHECK2(bp[0], 2); in pimv2_print()
1071 relts_print(EXTRACT_16BITS(bp)); in pimv2_print()