diff options
author | hannes <hannes> | 2004-09-15 17:54:10 +0000 |
---|---|---|
committer | hannes <hannes> | 2004-09-15 17:54:10 +0000 |
commit | 88157719fa7fe2e0bbfdbc3d51e2f2c85c39ead5 (patch) | |
tree | b4436a6ab0a032dd1c9db70ce0f2dff97dddc105 | |
parent | 7c5a9ceee5f8e484cca9da32a9b22481319a4164 (diff) | |
download | tcpdump-88157719fa7fe2e0bbfdbc3d51e2f2c85c39ead5.tar.gz |
bugfix: changed format for diffserv-TE subTLVs, add tok2str() for decoding BC models
-rw-r--r-- | gmpls.c | 13 | ||||
-rw-r--r-- | gmpls.h | 3 | ||||
-rw-r--r-- | print-isoclns.c | 17 | ||||
-rw-r--r-- | print-ospf.c | 9 |
4 files changed, 28 insertions, 14 deletions
@@ -15,7 +15,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.4 2003-11-16 09:36:09 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/gmpls.c,v 1.5 2004-09-15 17:54:10 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -132,3 +132,14 @@ struct tok gmpls_payload_values[] = { { 58, "Fiber Channel"}, { 0, NULL } }; + +#define DIFFSERV_BC_MODEL_RDM 0 /* draft-ietf-tewg-diff-te-proto-07 */ +#define DIFFSERV_BC_MODEL_MAM 1 /* draft-ietf-tewg-diff-te-proto-07 */ +#define DIFFSERV_BC_MODEL_EXTD_MAM 254 /* experimental */ + +struct tok diffserv_te_bc_values[] = { + { DIFFSERV_BC_MODEL_RDM, "Russian dolls"}, + { DIFFSERV_BC_MODEL_MAM, "Maximum allocation"}, + { DIFFSERV_BC_MODEL_EXTD_MAM, "Maximum allocation with E-LSP support"}, + { 0, NULL } +}; @@ -1,4 +1,4 @@ -/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.2 2003-06-09 23:28:09 guy Exp $ (LBL) */ +/* @(#) $Header: /tcpdump/master/tcpdump/gmpls.h,v 1.3 2004-09-15 17:54:11 hannes Exp $ (LBL) */ /* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that: (1) source code @@ -18,3 +18,4 @@ extern struct tok gmpls_link_prot_values[]; extern struct tok gmpls_switch_cap_values[]; extern struct tok gmpls_encoding_values[]; extern struct tok gmpls_payload_values[]; +extern struct tok diffserv_te_bc_values[]; diff --git a/print-isoclns.c b/print-isoclns.c index 0e80a99d..56737044 100644 --- a/print-isoclns.c +++ b/print-isoclns.c @@ -26,7 +26,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.120 2004-09-09 07:11:57 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-isoclns.c,v 1.121 2004-09-15 17:54:11 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -1091,20 +1091,19 @@ isis_print_is_reach_subtlv (const u_int8_t *tptr,int subt,int subl,const char *i } break; case ISIS_SUBTLV_EXT_IS_REACH_DIFFSERV_TE: - if (subl >= 36) { - printf("%sBandwidth Constraints Model ID: (%u)",ident, *tptr); - tptr+=4; - /* for now lets just print the first 8 BCs - - * FIXME is this dep. on the BC model ? - */ - for (bandwidth_constraint = 0; bandwidth_constraint < 8; bandwidth_constraint++) { + printf("%sBandwidth Constraints Model ID: %s (%u)", + ident, + tok2str(diffserv_te_bc_values, "unknown", *tptr), + *tptr); + tptr++; + /* decode BCs until the subTLV ends */ + for (bandwidth_constraint = 0; bandwidth_constraint < (subl-1)/4; bandwidth_constraint++) { bw.i = EXTRACT_32BITS(tptr); printf("%s Bandwidth constraint %d: %.3f Mbps", ident, bandwidth_constraint, bw.f*8/1000000 ); tptr+=4; - } } break; case ISIS_SUBTLV_EXT_IS_REACH_TE_METRIC: diff --git a/print-ospf.c b/print-ospf.c index 8d9045f6..b6382350 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.52 2004-09-09 16:17:38 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ospf.c,v 1.53 2004-09-15 17:54:11 hannes Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -566,8 +566,11 @@ ospf_print_lsa(register const struct lsa *lsap) } break; case LS_OPAQUE_TE_LINK_SUBTLV_DIFFSERV_TE: - printf("\n\t\tBandwidth Constraints Model ID: (%u)", *tptr); - for (bandwidth_constraint = 0; bandwidth_constraint < 8; bandwidth_constraint++) { + 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, |