summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-lspping.c
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-10-28 19:06:17 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-10-28 19:06:17 +0000
commit1e8ad3bd802d66bed71b4c6405ff5d801a913e4a (patch)
treedf5e0d876c3ec2ff0e3d9c6795cb5c1e20b7d5c4 /contrib/tcpdump/print-lspping.c
parent7ab661360c2131496bd3c111b5b3b2462fe3d2be (diff)
parent5f4de8e61a87fc21b6ffecf7ef9444827c09ee69 (diff)
downloadFreeBSD-src-1e8ad3bd802d66bed71b4c6405ff5d801a913e4a.zip
FreeBSD-src-1e8ad3bd802d66bed71b4c6405ff5d801a913e4a.tar.gz
Merge tcpdump-4.1.1.
Diffstat (limited to 'contrib/tcpdump/print-lspping.c')
-rw-r--r--contrib/tcpdump/print-lspping.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/contrib/tcpdump/print-lspping.c b/contrib/tcpdump/print-lspping.c
index f47a900..6958bda 100644
--- a/contrib/tcpdump/print-lspping.c
+++ b/contrib/tcpdump/print-lspping.c
@@ -15,7 +15,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.18.2.1 2008-01-28 13:48:16 hannes Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-lspping.c,v 1.20 2008-01-28 14:20:43 hannes Exp $";
#endif
#ifdef HAVE_CONFIG_H
@@ -34,6 +34,7 @@ static const char rcsid[] _U_ =
#include "bgp.h"
#include "l2vpn.h"
+#include "oui.h"
/*
* LSPPING common header
@@ -134,7 +135,11 @@ struct lspping_tlv_header {
#define LSPPING_TLV_TARGET_FEC_STACK 1
#define LSPPING_TLV_DOWNSTREAM_MAPPING 2
#define LSPPING_TLV_PAD 3
-#define LSPPING_TLV_ERROR_CODE 4
+#define LSPPING_TLV_VENDOR_ENTERPRISE 5
+#define LSPPING_TLV_VENDOR_ENTERPRISE_LEN 4
+#define LSPPING_TLV_INTERFACE_LABEL_STACK 7
+#define LSPPING_TLV_ERROR_CODE 9
+#define LSPPING_TLV_REPLY_TOS_BYTE 10
#define LSPPING_TLV_BFD_DISCRIMINATOR 15 /* draft-ietf-bfd-mpls-02 */
#define LSPPING_TLV_BFD_DISCRIMINATOR_LEN 4
#define LSPPING_TLV_VENDOR_PRIVATE 0xfc00
@@ -144,8 +149,11 @@ static const struct tok lspping_tlv_values[] = {
{ LSPPING_TLV_DOWNSTREAM_MAPPING, "Downstream Mapping" },
{ LSPPING_TLV_PAD, "Pad" },
{ LSPPING_TLV_ERROR_CODE, "Error Code" },
+ { LSPPING_TLV_VENDOR_ENTERPRISE, "Vendor Enterprise Code" },
+ { LSPPING_TLV_INTERFACE_LABEL_STACK, "Interface Label Stack" },
+ { LSPPING_TLV_REPLY_TOS_BYTE, "Reply TOS Byte" },
{ LSPPING_TLV_BFD_DISCRIMINATOR, "BFD Discriminator" },
- { LSPPING_TLV_VENDOR_PRIVATE, "Vendor Enterprise Code" },
+ { LSPPING_TLV_VENDOR_PRIVATE, "Vendor Private Code" },
{ 0, NULL}
};
@@ -566,6 +574,7 @@ lspping_print(register const u_char *pptr, register u_int len) {
tlen-=sizeof(const struct lspping_common_header);
while(tlen>(int)sizeof(struct lspping_tlv_header)) {
+
/* did we capture enough for fully decoding the tlv header ? */
if (!TTEST2(*tptr, sizeof(struct lspping_tlv_header)))
goto trunc;
@@ -840,11 +849,24 @@ lspping_print(register const u_char *pptr, register u_int len) {
goto trunc;
printf("\n\t BFD Discriminator 0x%08x", EXTRACT_32BITS(tptr));
break;
+
+ case LSPPING_TLV_VENDOR_ENTERPRISE:
+ {
+ u_int32_t vendor_id;
+
+ if (!TTEST2(*tptr, LSPPING_TLV_VENDOR_ENTERPRISE_LEN))
+ goto trunc;
+ vendor_id = EXTRACT_32BITS(tlv_tptr);
+ printf("\n\t Vendor: %s (0x%04x)",
+ tok2str(smi_values, "Unknown", vendor_id),
+ vendor_id);
+ }
+ break;
+
/*
* FIXME those are the defined TLVs that lack a decoder
* you are welcome to contribute code ;-)
*/
-
case LSPPING_TLV_PAD:
case LSPPING_TLV_ERROR_CODE:
case LSPPING_TLV_VENDOR_PRIVATE:
OpenPOWER on IntegriCloud