]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lspping.c
bugfix from Aaron Campbel <[email protected]>:
[tcpdump] / print-lspping.c
index d228ff6ebf709730ef0eebe770b7e8b8a0c6d93b..a96fb7562c1064e610a897d15732050e5bcc9f69 100644 (file)
@@ -15,7 +15,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.12.2.2 2005-04-19 12:49:21 hannes Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.12.2.6 2006-06-23 02:07:27 hannes Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -79,8 +79,6 @@ struct lspping_common_header {
 };
 
 #define LSPPING_VERSION            1
-#define FALSE 0
-#define TRUE  1
 
 static const struct tok lspping_msg_type_values[] = {
     { 1, "MPLS Echo Request"},
@@ -137,13 +135,16 @@ struct lspping_tlv_header {
 #define        LSPPING_TLV_DOWNSTREAM_MAPPING    2
 #define        LSPPING_TLV_PAD                   3
 #define        LSPPING_TLV_ERROR_CODE            4
-#define        LSPPING_TLV_VENDOR_PRIVATE        5 
+#define        LSPPING_TLV_BFD_DISCRIMINATOR     15 /* draft-ietf-bfd-mpls-02 */
+#define LSPPING_TLV_BFD_DISCRIMINATOR_LEN 4
+#define        LSPPING_TLV_VENDOR_PRIVATE        0xfc00
 
 static const struct tok lspping_tlv_values[] = {
     { LSPPING_TLV_TARGET_FEC_STACK, "Target FEC Stack" },
     { LSPPING_TLV_DOWNSTREAM_MAPPING, "Downstream Mapping" },
     { LSPPING_TLV_PAD, "Pad" },
     { LSPPING_TLV_ERROR_CODE, "Error Code" },
+    { LSPPING_TLV_BFD_DISCRIMINATOR, "BFD Discriminator" },
     { LSPPING_TLV_VENDOR_PRIVATE, "Vendor Enterprise Code" },
     { 0, NULL}
 };
@@ -832,6 +833,12 @@ lspping_print(register const u_char *pptr, register u_int len) {
 
             break;
 
+        case LSPPING_TLV_BFD_DISCRIMINATOR:
+            tptr += sizeof(struct lspping_tlv_header);
+            if (!TTEST2(*tptr, LSPPING_TLV_BFD_DISCRIMINATOR_LEN))
+                goto trunc;
+            printf("\n\t    BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr));
+            break;
             /*
              *  FIXME those are the defined TLVs that lack a decoder
              *  you are welcome to contribute code ;-)