Lines Matching refs:bp

137 static void pimv2_print(netdissect_options *, register const u_char *bp, register u_int len, u_int …
141 register const u_char *bp, register u_int len) in pimv1_join_prune_print() argument
147 if (ND_TTEST2(bp[0], 30) && bp[11] == 1 && in pimv1_join_prune_print()
148 ((njoin = EXTRACT_16BITS(&bp[20])) + EXTRACT_16BITS(&bp[22])) == 1) { in pimv1_join_prune_print()
151 ND_PRINT((ndo, " RPF %s ", ipaddr_string(ndo, bp))); in pimv1_join_prune_print()
152 hold = EXTRACT_16BITS(&bp[6]); in pimv1_join_prune_print()
158 ipaddr_string(ndo, &bp[26]), bp[25] & 0x3f, in pimv1_join_prune_print()
159 ipaddr_string(ndo, &bp[12]))); in pimv1_join_prune_print()
160 if (EXTRACT_32BITS(&bp[16]) != 0xffffffff) in pimv1_join_prune_print()
161 ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[16]))); in pimv1_join_prune_print()
163 (bp[24] & 0x01) ? "Sparse" : "Dense", in pimv1_join_prune_print()
164 (bp[25] & 0x80) ? " WC" : "", in pimv1_join_prune_print()
165 (bp[25] & 0x40) ? "RP" : "SPT")); in pimv1_join_prune_print()
169 ND_TCHECK2(bp[0], sizeof(struct in_addr)); in pimv1_join_prune_print()
172 ND_PRINT((ndo, " Upstream Nbr: %s", ipaddr_string(ndo, bp))); in pimv1_join_prune_print()
173 ND_TCHECK2(bp[6], 2); in pimv1_join_prune_print()
177 relts_print(ndo, EXTRACT_16BITS(&bp[6])); in pimv1_join_prune_print()
180 bp += 8; in pimv1_join_prune_print()
183 ND_TCHECK2(bp[0], 4); in pimv1_join_prune_print()
184 ngroups = bp[3]; in pimv1_join_prune_print()
185 bp += 4; in pimv1_join_prune_print()
192 ND_TCHECK2(bp[0], sizeof(struct in_addr)); in pimv1_join_prune_print()
193 ND_PRINT((ndo, "\n\tGroup: %s", ipaddr_string(ndo, bp))); in pimv1_join_prune_print()
194 ND_TCHECK2(bp[4], sizeof(struct in_addr)); in pimv1_join_prune_print()
195 if (EXTRACT_32BITS(&bp[4]) != 0xffffffff) in pimv1_join_prune_print()
196 ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[4]))); in pimv1_join_prune_print()
197 ND_TCHECK2(bp[8], 4); in pimv1_join_prune_print()
198 njoin = EXTRACT_16BITS(&bp[8]); in pimv1_join_prune_print()
199 nprune = EXTRACT_16BITS(&bp[10]); in pimv1_join_prune_print()
201 bp += 12; in pimv1_join_prune_print()
210 ND_TCHECK2(bp[0], 6); in pimv1_join_prune_print()
212 (bp[0] & 0x01) ? "Sparse " : "Dense ", in pimv1_join_prune_print()
213 (bp[1] & 0x80) ? "WC " : "", in pimv1_join_prune_print()
214 (bp[1] & 0x40) ? "RP " : "SPT ", in pimv1_join_prune_print()
215 ipaddr_string(ndo, &bp[2]), bp[1] & 0x3f)); in pimv1_join_prune_print()
216 bp += 6; in pimv1_join_prune_print()
228 register const u_char *bp, register u_int len) in pimv1_print() argument
234 if (bp >= ep) in pimv1_print()
237 ND_TCHECK(bp[1]); in pimv1_print()
238 type = bp[1]; in pimv1_print()
243 if (ND_TTEST(bp[8])) { in pimv1_print()
244 switch (bp[8] >> 4) { in pimv1_print()
255 ND_PRINT((ndo, " mode-%d", bp[8] >> 4)); in pimv1_print()
260 ND_TCHECK2(bp[10],2); in pimv1_print()
262 relts_print(ndo, EXTRACT_16BITS(&bp[10])); in pimv1_print()
268 ND_TCHECK2(bp[8], 20); /* ip header */ in pimv1_print()
269 ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, &bp[20]), in pimv1_print()
270 ipaddr_string(ndo, &bp[24]))); in pimv1_print()
273 ND_TCHECK2(bp[12], sizeof(struct in_addr)); in pimv1_print()
274 ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, &bp[8]), in pimv1_print()
275 ipaddr_string(ndo, &bp[12]))); in pimv1_print()
279 ND_TCHECK2(bp[22], 2); in pimv1_print()
280 ND_PRINT((ndo, " group %s", ipaddr_string(ndo, &bp[8]))); in pimv1_print()
281 if (EXTRACT_32BITS(&bp[12]) != 0xffffffff) in pimv1_print()
282 ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[12]))); in pimv1_print()
283 ND_PRINT((ndo, " RP %s hold ", ipaddr_string(ndo, &bp[16]))); in pimv1_print()
284 relts_print(ndo, EXTRACT_16BITS(&bp[22])); in pimv1_print()
288 ND_TCHECK2(bp[16], sizeof(struct in_addr)); in pimv1_print()
289 ND_PRINT((ndo, " for %s > %s", ipaddr_string(ndo, &bp[16]), in pimv1_print()
290 ipaddr_string(ndo, &bp[8]))); in pimv1_print()
291 if (EXTRACT_32BITS(&bp[12]) != 0xffffffff) in pimv1_print()
292 ND_PRINT((ndo, "/%s", ipaddr_string(ndo, &bp[12]))); in pimv1_print()
293 ND_TCHECK2(bp[24], 4); in pimv1_print()
295 (bp[20] & 0x80) ? "RP-tree" : "SPT", in pimv1_print()
296 EXTRACT_32BITS(&bp[20]) & 0x7fffffff, in pimv1_print()
297 EXTRACT_32BITS(&bp[24]))); in pimv1_print()
303 pimv1_join_prune_print(ndo, &bp[8], len - 8); in pimv1_print()
306 if ((bp[4] >> 4) != 1) in pimv1_print()
307 ND_PRINT((ndo, " [v%d]", bp[4] >> 4)); in pimv1_print()
323 register const u_char *bp, register u_int len) in cisco_autorp_print() argument
329 ND_TCHECK(bp[0]); in cisco_autorp_print()
331 type = bp[0]; in cisco_autorp_print()
344 ND_TCHECK(bp[1]); in cisco_autorp_print()
345 numrps = bp[1]; in cisco_autorp_print()
347 ND_TCHECK2(bp[2], 2); in cisco_autorp_print()
349 hold = EXTRACT_16BITS(&bp[2]); in cisco_autorp_print()
351 relts_print(ndo, EXTRACT_16BITS(&bp[2])); in cisco_autorp_print()
357 bp += 8; len -= 8; in cisco_autorp_print()
376 ND_TCHECK2(bp[0], 4); in cisco_autorp_print()
377 ND_PRINT((ndo, " RP %s", ipaddr_string(ndo, bp))); in cisco_autorp_print()
378 ND_TCHECK(bp[4]); in cisco_autorp_print()
379 switch (bp[4] & 0x3) { in cisco_autorp_print()
389 if (bp[4] & 0xfc) in cisco_autorp_print()
390 ND_PRINT((ndo, " [rsvd=0x%02x]", bp[4] & 0xfc)); in cisco_autorp_print()
391 ND_TCHECK(bp[5]); in cisco_autorp_print()
392 nentries = bp[5]; in cisco_autorp_print()
393 bp += 6; len -= 6; in cisco_autorp_print()
396 ND_TCHECK2(bp[0], 6); in cisco_autorp_print()
397 ND_PRINT((ndo, "%c%s%s/%d", s, bp[0] & 1 ? "!" : "", in cisco_autorp_print()
398 ipaddr_string(ndo, &bp[2]), bp[1])); in cisco_autorp_print()
399 if (bp[0] & 0x02) { in cisco_autorp_print()
402 if (bp[0] & 0xfc) { in cisco_autorp_print()
403 ND_PRINT((ndo, "[rsvd=0x%02x]", bp[0] & 0xfc)); in cisco_autorp_print()
406 bp += 6; len -= 6; in cisco_autorp_print()
418 register const u_char *bp, register u_int len, u_int cksum) in pim_print() argument
421 register struct pim *pim = (struct pim *)bp; in pim_print()
424 if (bp >= ep) in pim_print()
443 pimv2_print(ndo, bp, len, cksum); in pim_print()
523 const u_char *bp, enum pimv2_addrtype at, int silent) in pimv2_addr_print() argument
528 ND_TCHECK(bp[0]); in pimv2_addr_print()
531 ND_TCHECK(bp[1]); in pimv2_addr_print()
532 switch (bp[0]) { in pimv2_addr_print()
546 if (bp[1] != 0) in pimv2_addr_print()
567 bp += hdrlen; in pimv2_addr_print()
570 ND_TCHECK2(bp[0], len); in pimv2_addr_print()
573 ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp))); in pimv2_addr_print()
578 ND_PRINT((ndo, "%s", ip6addr_string(ndo, bp))); in pimv2_addr_print()
584 ND_TCHECK2(bp[0], len + 2); in pimv2_addr_print()
587 ND_PRINT((ndo, "%s", ipaddr_string(ndo, bp + 2))); in pimv2_addr_print()
588 if (bp[1] != 32) in pimv2_addr_print()
589 ND_PRINT((ndo, "/%u", bp[1])); in pimv2_addr_print()
595 ND_PRINT((ndo, "%s", ip6addr_string(ndo, bp + 2))); in pimv2_addr_print()
596 if (bp[1] != 128) in pimv2_addr_print()
597 ND_PRINT((ndo, "/%u", bp[1])); in pimv2_addr_print()
601 if (bp[0] && !silent) { in pimv2_addr_print()
603 ND_PRINT((ndo, "(0x%02x)", bp[0])); in pimv2_addr_print()
606 bp[0] & 0x04 ? "S" : "", in pimv2_addr_print()
607 bp[0] & 0x02 ? "W" : "", in pimv2_addr_print()
608 bp[0] & 0x01 ? "R" : "")); in pimv2_addr_print()
609 if (bp[0] & 0xf8) { in pimv2_addr_print()
610 ND_PRINT((ndo, "+0x%02x", bp[0] & 0xf8)); in pimv2_addr_print()
625 register const u_char *bp, register u_int len, u_int cksum) in pimv2_print() argument
628 register struct pim *pim = (struct pim *)bp; in pimv2_print()
632 if (bp >= ep) in pimv2_print()
634 if (ep > bp + len) in pimv2_print()
635 ep = bp + len; in pimv2_print()
645 ND_PRINT((ndo, "(%scorrect)", ND_TTEST2(bp[0], len) && cksum ? "in" : "" )); in pimv2_print()
652 bp += 4; in pimv2_print()
653 while (bp < ep) { in pimv2_print()
654 ND_TCHECK2(bp[0], 4); in pimv2_print()
655 otype = EXTRACT_16BITS(&bp[0]); in pimv2_print()
656 olen = EXTRACT_16BITS(&bp[2]); in pimv2_print()
657 ND_TCHECK2(bp[0], 4 + olen); in pimv2_print()
662 bp += 4; in pimv2_print()
666 relts_print(ndo, EXTRACT_16BITS(bp)); in pimv2_print()
675 lan_delay = EXTRACT_16BITS(bp); in pimv2_print()
676 override_interval = EXTRACT_16BITS(bp+2); in pimv2_print()
691 ND_PRINT((ndo, "%u", EXTRACT_32BITS(bp))); in pimv2_print()
700 ND_PRINT((ndo, "0x%08x", EXTRACT_32BITS(bp))); in pimv2_print()
704 ND_PRINT((ndo, "v%d", *bp)); in pimv2_print()
705 if (*(bp+1) != 0) { in pimv2_print()
707 relts_print(ndo, *(bp+1)); in pimv2_print()
709 if (EXTRACT_16BITS(bp+2) != 0) { in pimv2_print()
710 ND_PRINT((ndo, " ?0x%04x?", EXTRACT_16BITS(bp+2))); in pimv2_print()
720 const u_char *ptr = bp; in pimv2_print()
721 while (ptr < (bp+olen)) { in pimv2_print()
736 print_unknown_data(ndo, bp, "\n\t ", olen); in pimv2_print()
741 print_unknown_data(ndo, bp, "\n\t ", olen); in pimv2_print()
742 bp += olen; in pimv2_print()
751 ND_TCHECK2(*(bp + 4), PIMV2_REGISTER_FLAG_LEN); in pimv2_print()
756 EXTRACT_32BITS(bp+4)))); in pimv2_print()
758 bp += 8; len -= 8; in pimv2_print()
760 ip = (struct ip *)bp; in pimv2_print()
769 ip_print(ndo, bp, len); in pimv2_print()
773 ip6_print(ndo, bp, len); in pimv2_print()
784 bp += 4; len -= 4; in pimv2_print()
785 if (bp >= ep) in pimv2_print()
788 if ((advance = pimv2_addr_print(ndo, bp, pimv2_group, 0)) < 0) { in pimv2_print()
792 bp += advance; len -= advance; in pimv2_print()
793 if (bp >= ep) in pimv2_print()
796 if ((advance = pimv2_addr_print(ndo, bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
800 bp += advance; len -= advance; in pimv2_print()
850 bp += 4; len -= 4; in pimv2_print()
852 if (bp >= ep) in pimv2_print()
855 if ((advance = pimv2_addr_print(ndo, bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
859 bp += advance; len -= advance; in pimv2_print()
861 if (bp + 4 > ep) in pimv2_print()
863 ngroup = bp[1]; in pimv2_print()
864 holdtime = EXTRACT_16BITS(&bp[2]); in pimv2_print()
873 bp += 4; len -= 4; in pimv2_print()
875 if (bp >= ep) in pimv2_print()
878 if ((advance = pimv2_addr_print(ndo, bp, pimv2_group, 0)) < 0) { in pimv2_print()
882 bp += advance; len -= advance; in pimv2_print()
883 if (bp + 4 > ep) { in pimv2_print()
887 njoin = EXTRACT_16BITS(&bp[0]); in pimv2_print()
888 nprune = EXTRACT_16BITS(&bp[2]); in pimv2_print()
890 bp += 4; len -= 4; in pimv2_print()
893 if ((advance = pimv2_addr_print(ndo, bp, pimv2_source, 0)) < 0) { in pimv2_print()
897 bp += advance; len -= advance; in pimv2_print()
901 if ((advance = pimv2_addr_print(ndo, bp, pimv2_source, 0)) < 0) { in pimv2_print()
905 bp += advance; len -= advance; in pimv2_print()
915 bp += 4; in pimv2_print()
918 if (bp + sizeof(uint16_t) >= ep) break; in pimv2_print()
919 ND_PRINT((ndo, " tag=%x", EXTRACT_16BITS(bp))); in pimv2_print()
920 bp += sizeof(uint16_t); in pimv2_print()
921 if (bp >= ep) break; in pimv2_print()
922 ND_PRINT((ndo, " hashmlen=%d", bp[0])); in pimv2_print()
923 if (bp + 1 >= ep) break; in pimv2_print()
924 ND_PRINT((ndo, " BSRprio=%d", bp[1])); in pimv2_print()
925 bp += 2; in pimv2_print()
928 if (bp >= ep) break; in pimv2_print()
930 if ((advance = pimv2_addr_print(ndo, bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
934 bp += advance; in pimv2_print()
936 for (i = 0; bp < ep; i++) { in pimv2_print()
939 if ((advance = pimv2_addr_print(ndo, bp, pimv2_group, 0)) in pimv2_print()
944 bp += advance; in pimv2_print()
947 if (bp >= ep) { in pimv2_print()
951 ND_PRINT((ndo, " RPcnt=%d", bp[0])); in pimv2_print()
952 if (bp + 1 >= ep) { in pimv2_print()
956 ND_PRINT((ndo, " FRPcnt=%d", frpcnt = bp[1])); in pimv2_print()
957 bp += 4; in pimv2_print()
959 for (j = 0; j < frpcnt && bp < ep; j++) { in pimv2_print()
962 if ((advance = pimv2_addr_print(ndo, bp, in pimv2_print()
968 bp += advance; in pimv2_print()
970 if (bp + 1 >= ep) { in pimv2_print()
975 relts_print(ndo, EXTRACT_16BITS(bp)); in pimv2_print()
976 if (bp + 2 >= ep) { in pimv2_print()
980 ND_PRINT((ndo, ",prio=%d", bp[2])); in pimv2_print()
981 bp += 4; in pimv2_print()
989 bp += 4; len -= 4; in pimv2_print()
990 if (bp >= ep) in pimv2_print()
993 if ((advance = pimv2_addr_print(ndo, bp, pimv2_group, 0)) < 0) { in pimv2_print()
997 bp += advance; len -= advance; in pimv2_print()
998 if (bp >= ep) in pimv2_print()
1001 if ((advance = pimv2_addr_print(ndo, bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1005 bp += advance; len -= advance; in pimv2_print()
1006 if (bp + 8 > ep) in pimv2_print()
1008 if (bp[0] & 0x80) in pimv2_print()
1010 ND_PRINT((ndo, " pref=%u", EXTRACT_32BITS(&bp[0]) & 0x7fffffff)); in pimv2_print()
1011 ND_PRINT((ndo, " metric=%u", EXTRACT_32BITS(&bp[4]))); in pimv2_print()
1017 bp += 4; in pimv2_print()
1020 if (bp >= ep) break; in pimv2_print()
1021 ND_PRINT((ndo, " prefix-cnt=%d", bp[0])); in pimv2_print()
1022 pfxcnt = bp[0]; in pimv2_print()
1023 if (bp + 1 >= ep) break; in pimv2_print()
1024 ND_PRINT((ndo, " prio=%d", bp[1])); in pimv2_print()
1025 if (bp + 3 >= ep) break; in pimv2_print()
1027 relts_print(ndo, EXTRACT_16BITS(&bp[2])); in pimv2_print()
1028 bp += 4; in pimv2_print()
1031 if (bp >= ep) break; in pimv2_print()
1033 if ((advance = pimv2_addr_print(ndo, bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1037 bp += advance; in pimv2_print()
1040 for (i = 0; i < pfxcnt && bp < ep; i++) { in pimv2_print()
1042 if ((advance = pimv2_addr_print(ndo, bp, pimv2_group, 0)) in pimv2_print()
1047 bp += advance; in pimv2_print()
1054 if ((advance = pimv2_addr_print(ndo, bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1058 bp += advance; in pimv2_print()
1060 if ((advance = pimv2_addr_print(ndo, bp, pimv2_group, 0)) < 0) { in pimv2_print()
1064 bp += advance; in pimv2_print()
1066 if ((advance = pimv2_addr_print(ndo, bp, pimv2_unicast, 0)) < 0) { in pimv2_print()
1070 bp += advance; in pimv2_print()
1071 ND_TCHECK2(bp[0], 2); in pimv2_print()
1073 relts_print(ndo, EXTRACT_16BITS(bp)); in pimv2_print()