Ethereal-dev: [Ethereal-dev] packet-cdp.c: added type 0x0009 (VTP Management Domain)

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: kent@xxxxxxxxxxx (Kent Engström)
Date: 12 Jan 2001 13:05:43 +0100
The type is guessed in tcpdump's print-cdp.c, and it appears to be
correct on our network. I won't add the other types which I can't
verify.

Index: packet-cdp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-cdp.c,v
retrieving revision 1.32
diff -u -r1.32 packet-cdp.c
--- packet-cdp.c	2001/01/10 09:07:35	1.32
+++ packet-cdp.c	2001/01/12 12:00:03
@@ -78,15 +78,18 @@
 #define TYPE_PLATFORM		0x0006
 #define TYPE_IP_PREFIX		0x0007
 
+#define TYPE_VTP_MGMT_DOMAIN    0x0009 /* Guessed, from tcpdump */
+
 static const value_string type_vals[] = {
-	{ TYPE_DEVICE_ID,    "Device ID" },
-	{ TYPE_ADDRESS,      "Addresses" },
-	{ TYPE_PORT_ID,      "Port ID" },
-	{ TYPE_CAPABILITIES, "Capabilities" },
-	{ TYPE_IOS_VERSION,  "Software version" },
-	{ TYPE_PLATFORM,     "Platform" },
-	{ TYPE_IP_PREFIX,    "IP Prefix (used for ODR)" },
-	{ 0,                 NULL },
+	{ TYPE_DEVICE_ID,    	"Device ID" },
+	{ TYPE_ADDRESS,      	"Addresses" },
+	{ TYPE_PORT_ID,      	"Port ID" },
+	{ TYPE_CAPABILITIES, 	"Capabilities" },
+	{ TYPE_IOS_VERSION,  	"Software version" },
+	{ TYPE_PLATFORM,        "Platform" },
+	{ TYPE_IP_PREFIX,       "IP Prefix (used for ODR)" },
+	{ TYPE_VTP_MGMT_DOMAIN, "VTP Management Domain" },
+	{ 0,                    NULL },
 };
 	
 static void 
@@ -276,6 +279,20 @@
 			offset += 5;
 			length -= 5;
 		}
+		break;
+	    case TYPE_VTP_MGMT_DOMAIN:
+		tlvi = proto_tree_add_text(cdp_tree, tvb,
+			    offset, length, "VTP Management Domain: %.*s",
+			    length - 4,
+			    tvb_get_ptr(tvb, offset + 4, length - 4));
+		tlv_tree = proto_item_add_subtree(tlvi, ett_cdp_tlv);
+		proto_tree_add_uint(tlv_tree, hf_cdp_tlvtype, tvb,
+			    offset + TLV_TYPE, 2, type);
+		proto_tree_add_uint(tlv_tree, hf_cdp_tlvlength, tvb,
+			    offset + TLV_LENGTH, 2, length);
+		add_multi_line_string_to_tree(tlv_tree, tvb, offset + 4,
+				length - 4, "VTP Management Domain: ");
+		offset += length;
 		break;
 	    default:
 		tlvi = proto_tree_add_text(cdp_tree, tvb, offset,
-- 
Kent Engström,		Linköping University Incident Response Team
kent@xxxxxxxxxxx  	abuse@xxxxxx
+46 13 28 1744

UNIT, Linköping University; SE-581 83  LINKÖPING; SWEDEN