]> The Tcpdump Group git mirrors - tcpdump/commitdiff
bugfix: changed format for diffserv-TE subTLVs, add tok2str() for decoding BC models
authorhannes <hannes>
Wed, 15 Sep 2004 17:54:10 +0000 (17:54 +0000)
committerhannes <hannes>
Wed, 15 Sep 2004 17:54:10 +0000 (17:54 +0000)
gmpls.c
gmpls.h
print-isoclns.c
print-ospf.c

diff --git a/gmpls.c b/gmpls.c
index 731219b2f44a0b3300a2aa39ce14b7c541bb2bb4..7d563446a77ed72293c67ac7175c0558122f86da 100644 (file)
--- a/gmpls.c
+++ b/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 }
+};
diff --git a/gmpls.h b/gmpls.h
index b6cf880bd798cae24f645792c09a8f4a547c95af..c4a7792821e6dd1d48c04bcdda157842b007fc8f 100644 (file)
--- a/gmpls.h
+++ b/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[];
index 0e80a99dd1339764f44e8c5d46396738d265d8f8..56737044e22dbc546e7a1e51310d67c26d918f71 100644 (file)
@@ -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:
index 8d9045f6aab7e9995f0b26c6d5a4ffa49c918223..b6382350cf43e006428a0cd528dceeed6c889faa 100644 (file)
@@ -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,