X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ee68aa36460d7efeca48747f33b7f2adc0900bfb..20ecf68b9ed076df8c7db120e69a44663c4e6e82:/print-ospf6.c diff --git a/print-ospf6.c b/print-ospf6.c index c734b4d2..c94a7793 100644 --- a/print-ospf6.c +++ b/print-ospf6.c @@ -379,7 +379,7 @@ ospf6_print_ls_type(netdissect_options *ndo, ls_type & LS_TYPE_MASK, tok2str(ospf6_ls_scope_values, "Unknown", ls_type & LS_SCOPE_MASK), ls_type &0x8000 ? ", transitive" : "", /* U-bit */ - ipaddr_string(ndo, (const u_char *)ls_stateid)); + GET_IPADDR_STRING((const u_char *)ls_stateid)); } static int @@ -388,11 +388,10 @@ ospf6_print_lshdr(netdissect_options *ndo, { if ((const u_char *)(lshp + 1) > dataend) goto trunc; - ND_TCHECK_2(lshp->ls_type); - ND_TCHECK_4(lshp->ls_seq); + ND_TCHECK_4(lshp->ls_router); ND_PRINT("\n\t Advertising Router %s, seq 0x%08x, age %us, length %u", - ipaddr_string(ndo, lshp->ls_router), + GET_IPADDR_STRING(lshp->ls_router), GET_BE_U_4(lshp->ls_seq), GET_BE_U_2(lshp->ls_age), GET_BE_U_2(lshp->ls_length)-(u_int)sizeof(struct lsa6_hdr)); @@ -428,7 +427,7 @@ ospf6_print_lsaprefix(netdissect_options *ndo, ND_TCHECK_LEN(lsapp->lsa_p_prefix, wordlen * 4); memset(prefix, 0, sizeof(prefix)); memcpy(prefix, lsapp->lsa_p_prefix, wordlen * 4); - ND_PRINT("\n\t\t%s/%u", ip6addr_string(ndo, prefix), + ND_PRINT("\n\t\t%s/%u", ip6addr_string(ndo, prefix), /* local buffer, not packet data; don't use GET_IP6ADDR_STRING() */ GET_U_1(lsapp->lsa_p_len)); if (GET_U_1(lsapp->lsa_p_opt)) { ND_PRINT(", Options [%s]", @@ -510,25 +509,25 @@ ospf6_print_lsa(netdissect_options *ndo, case RLA_TYPE_VIRTUAL: ND_PRINT("\n\t Virtual Link: Neighbor Router-ID %s" "\n\t Neighbor Interface-ID %s, Interface %s", - ipaddr_string(ndo, rlp->link_nrtid), - ipaddr_string(ndo, rlp->link_nifid), - ipaddr_string(ndo, rlp->link_ifid)); + GET_IPADDR_STRING(rlp->link_nrtid), + GET_IPADDR_STRING(rlp->link_nifid), + GET_IPADDR_STRING(rlp->link_ifid)); break; case RLA_TYPE_ROUTER: ND_PRINT("\n\t Neighbor Router-ID %s" "\n\t Neighbor Interface-ID %s, Interface %s", - ipaddr_string(ndo, rlp->link_nrtid), - ipaddr_string(ndo, rlp->link_nifid), - ipaddr_string(ndo, rlp->link_ifid)); + GET_IPADDR_STRING(rlp->link_nrtid), + GET_IPADDR_STRING(rlp->link_nifid), + GET_IPADDR_STRING(rlp->link_ifid)); break; case RLA_TYPE_TRANSIT: ND_PRINT("\n\t Neighbor Network-ID %s" "\n\t Neighbor Interface-ID %s, Interface %s", - ipaddr_string(ndo, rlp->link_nrtid), - ipaddr_string(ndo, rlp->link_nifid), - ipaddr_string(ndo, rlp->link_ifid)); + GET_IPADDR_STRING(rlp->link_nrtid), + GET_IPADDR_STRING(rlp->link_nifid), + GET_IPADDR_STRING(rlp->link_ifid)); break; default: @@ -557,7 +556,7 @@ ospf6_print_lsa(netdissect_options *ndo, return (1); lsa_length -= sizeof (*ap); ND_TCHECK_SIZE(ap); - ND_PRINT("\n\t\t%s", ipaddr_string(ndo, *ap)); + ND_PRINT("\n\t\t%s", GET_IPADDR_STRING(*ap)); ++ap; } break; @@ -604,9 +603,9 @@ ospf6_print_lsa(netdissect_options *ndo, if (lsa_length < sizeof (nd_ipv6)) return (1); lsa_length -= sizeof (nd_ipv6); - ND_TCHECK_8(tptr); + ND_TCHECK_16(tptr); ND_PRINT(" forward %s", - ip6addr_string(ndo, tptr)); + GET_IP6ADDR_STRING(tptr)); tptr += sizeof(nd_ipv6); } @@ -616,7 +615,7 @@ ospf6_print_lsa(netdissect_options *ndo, lsa_length -= sizeof (uint32_t); ND_TCHECK_4(tptr); ND_PRINT(" tag %s", - ipaddr_string(ndo, tptr)); + GET_IPADDR_STRING(tptr)); tptr += sizeof(uint32_t); } @@ -626,7 +625,7 @@ ospf6_print_lsa(netdissect_options *ndo, lsa_length -= sizeof (uint32_t); ND_TCHECK_4(tptr); ND_PRINT(" RefLSID: %s", - ipaddr_string(ndo, tptr)); + GET_IPADDR_STRING(tptr)); tptr += sizeof(uint32_t); } break; @@ -649,7 +648,7 @@ ospf6_print_lsa(netdissect_options *ndo, prefixes = GET_BE_U_4(llsap->llsa_nprefix); ND_PRINT("\n\t Priority %u, Link-local address %s, Prefixes %u:", GET_U_1(llsap->llsa_priority), - ip6addr_string(ndo, llsap->llsa_lladdr), + GET_IP6ADDR_STRING(llsap->llsa_lladdr), prefixes); tptr = (const uint8_t *)llsap->llsa_prefix; @@ -742,23 +741,23 @@ ospf6_decode_v3(netdissect_options *ndo, ND_PRINT("\n\t Hello Timer %us, Dead Timer %us, Interface-ID %s, Priority %u", GET_BE_U_2(hellop->hello_helloint), GET_BE_U_2(hellop->hello_deadint), - ipaddr_string(ndo, hellop->hello_ifid), + GET_IPADDR_STRING(hellop->hello_ifid), GET_U_1(hellop->hello_priority)); ND_TCHECK_4(hellop->hello_dr); if (GET_BE_U_4(hellop->hello_dr) != 0) ND_PRINT("\n\t Designated Router %s", - ipaddr_string(ndo, hellop->hello_dr)); + GET_IPADDR_STRING(hellop->hello_dr)); ND_TCHECK_4(hellop->hello_bdr); if (GET_BE_U_4(hellop->hello_bdr) != 0) ND_PRINT(", Backup Designated Router %s", - ipaddr_string(ndo, hellop->hello_bdr)); + GET_IPADDR_STRING(hellop->hello_bdr)); if (ndo->ndo_vflag > 1) { ND_PRINT("\n\t Neighbor List:"); ap = hellop->hello_neighbor; while ((const u_char *)ap < dataend) { ND_TCHECK_SIZE(ap); - ND_PRINT("\n\t %s", ipaddr_string(ndo, *ap)); + ND_PRINT("\n\t %s", GET_IPADDR_STRING(*ap)); ++ap; } } @@ -797,7 +796,7 @@ ospf6_decode_v3(netdissect_options *ndo, while ((const u_char *)lsrp < dataend) { ND_TCHECK_SIZE(lsrp); ND_PRINT("\n\t Advertising Router %s", - ipaddr_string(ndo, lsrp->ls_router)); + GET_IPADDR_STRING(lsrp->ls_router)); ospf6_print_ls_type(ndo, GET_BE_U_2(lsrp->ls_type), &lsrp->ls_stateid); @@ -990,11 +989,11 @@ ospf6_print(netdissect_options *ndo, dataend = bp + datalen; ND_TCHECK_4(op->ospf6_routerid); - ND_PRINT("\n\tRouter-ID %s", ipaddr_string(ndo, op->ospf6_routerid)); + ND_PRINT("\n\tRouter-ID %s", GET_IPADDR_STRING(op->ospf6_routerid)); ND_TCHECK_4(op->ospf6_areaid); if (GET_BE_U_4(op->ospf6_areaid) != 0) - ND_PRINT(", Area %s", ipaddr_string(ndo, op->ospf6_areaid)); + ND_PRINT(", Area %s", GET_IPADDR_STRING(op->ospf6_areaid)); else ND_PRINT(", Backbone Area"); ND_TCHECK_1(op->ospf6_instanceid);