X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/ddd98d0f3b8c094cffe8b8fc5fac4f4601343054..refs/heads/tcpdump-3.9:/print-ospf.c diff --git a/print-ospf.c b/print-ospf.c index be622868..8a651146 100644 --- a/print-ospf.c +++ b/print-ospf.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.55 2004-09-20 14:56:34 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.56.2.4 2006-12-13 08:24:27 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -57,7 +57,7 @@ static struct tok ospf_option_values[] = { static struct tok ospf_authtype_values[] = { { OSPF_AUTH_NONE, "none" }, - { OSPF_AUTH_NONE, "simple" }, + { OSPF_AUTH_SIMPLE, "simple" }, { OSPF_AUTH_MD5, "MD5" }, { 0, NULL } }; @@ -128,7 +128,7 @@ static struct tok lsa_opaque_te_link_tlv_subtlv_values[] = { { LS_OPAQUE_TE_LINK_SUBTLV_LINK_PROTECTION_TYPE, "Link Protection Type" }, { LS_OPAQUE_TE_LINK_SUBTLV_INTF_SW_CAP_DESCR, "Interface Switching Capability" }, { LS_OPAQUE_TE_LINK_SUBTLV_SHARED_RISK_GROUP, "Shared Risk Link Group" }, - { LS_OPAQUE_TE_LINK_SUBTLV_DIFFSERV_TE, "Diffserv TE" }, + { LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS, "Bandwidth Constraints" }, { 0, NULL } }; @@ -253,7 +253,7 @@ ospf_print_lsa(register const struct lsa *lsap) register const struct aslametric *almp; register const struct mcla *mcp; register const u_int32_t *lp; - register int j, k, tlv_type, tlv_length, subtlv_type, subtlv_length, priority_level, bandwidth_constraint; + register int j, k, tlv_type, tlv_length, subtlv_type, subtlv_length, priority_level, te_class; register int ls_length; const u_int8_t *tptr; int count_srlg; @@ -627,22 +627,22 @@ ospf_print_lsa(register const struct lsa *lsap) printf(", %.3f Mbps", bw.f*8/1000000 ); break; case LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW: - for (priority_level = 0; priority_level < 8; priority_level++) { - bw.i = EXTRACT_32BITS(tptr+priority_level*4); - printf("\n\t\tpriority level %d: %.3f Mbps", - priority_level, + for (te_class = 0; te_class < 8; te_class++) { + bw.i = EXTRACT_32BITS(tptr+te_class*4); + printf("\n\t\tTE-Class %u: %.3f Mbps", + te_class, bw.f*8/1000000 ); } break; - case LS_OPAQUE_TE_LINK_SUBTLV_DIFFSERV_TE: + case LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS: printf("\n\t\tBandwidth Constraints Model ID: %s (%u)", tok2str(diffserv_te_bc_values, "unknown", *tptr), *tptr); /* decode BCs until the subTLV ends */ - for (bandwidth_constraint = 0; bandwidth_constraint < (subtlv_length-4)/4; bandwidth_constraint++) { - bw.i = EXTRACT_32BITS(tptr+4+bandwidth_constraint*4); - printf("\n\t\t Bandwidth constraint %d: %.3f Mbps", - bandwidth_constraint, + for (te_class = 0; te_class < (subtlv_length-4)/4; te_class++) { + bw.i = EXTRACT_32BITS(tptr+4+te_class*4); + printf("\n\t\t Bandwidth constraint CT%u: %.3f Mbps", + te_class, bw.f*8/1000000 ); } break; @@ -873,15 +873,13 @@ trunc: void ospf_print(register const u_char *bp, register u_int length, - register const u_char *bp2) + const u_char *bp2 _U_) { register const struct ospfhdr *op; - register const struct ip *ip; register const u_char *dataend; register const char *cp; op = (struct ospfhdr *)bp; - ip = (struct ip *)bp2; /* XXX Before we do anything else, strip off the MD5 trailer */ TCHECK(op->ospf_authtype); @@ -894,10 +892,9 @@ ospf_print(register const u_char *bp, register u_int length, /* value. If it's not valid, say so and return */ TCHECK(op->ospf_type); cp = tok2str(type2str, "unknown LS-type", op->ospf_type); - printf("OSPFv%u, %s (%u), length: %u", + printf("OSPFv%u, %s, length: %u", op->ospf_version, cp, - op->ospf_type, length); if (*cp == 'u') return; @@ -935,9 +932,8 @@ ospf_print(register const u_char *bp, register u_int length, break; case OSPF_AUTH_SIMPLE: - (void)fn_printn(op->ospf_authdata, - sizeof(op->ospf_authdata), NULL); - printf("\""); + printf("\n\tSimple text password: "); + safeputs(op->ospf_authdata, OSPF_AUTH_SIMPLE_LEN); break; case OSPF_AUTH_MD5: