mirror of
https://github.com/the-tcpdump-group/tcpdump.git
synced 2024-11-23 18:14:29 +08:00
bugfix: changed format for diffserv-TE subTLVs, add tok2str() for decoding BC models
This commit is contained in:
parent
7c5a9ceee5
commit
88157719fa
13
gmpls.c
13
gmpls.c
@ -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 }
|
||||
};
|
||||
|
3
gmpls.h
3
gmpls.h
@ -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[];
|
||||
|
@ -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:
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user