ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: [Ethereal-dev] CDP VoIP Voice VLAN patch

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

From: "Ricardo T. Muggli" <ricardo.muggli@xxxxxxxx>
Date: Mon, 7 Mar 2005 14:56:13 -0600 (CST)
This tiny patch will decode the Voice VLAN in the CDP packet. I
currently don't know what the byte that is left as "Data" represents. This
is a patch against 0.10.9.

--... ...--
Ricardo Muggli (ricardo.muggli@xxxxxxxx)
Information and Technology Services - System Management
Minnesota State University, Mankato
3010 Memorial Library
Mankato, MN  56001
Phone: 507-389-1164   Fax: 507-389-6115
--- packet-cdp.c-orig	2005-03-07 14:44:42.000000000 -0600
+++ packet-cdp.c	2005-03-07 14:37:54.000000000 -0600
@@ -445,26 +445,32 @@
 		break;
 	    case TYPE_VOIP_VLAN_REPLY:
 	      tlvi = proto_tree_add_text(cdp_tree, tvb,
-					 offset, length, "VoIP VLAN Reply");
+					 offset, length, "VoIP VLAN Reply: %u", tvb_get_ntohs(tvb, offset + 5));
 	      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);
 	      proto_tree_add_text(tlv_tree, tvb, offset + 4,
-				  length - 4, "Data");
+				  1, "Data");
+	      proto_tree_add_text(tlv_tree, tvb, offset + 5,
+				  2, "Voice VLAN: %u",
+				  tvb_get_ntohs(tvb, offset + 5));
 	      offset += length;
 	      break;
 	    case TYPE_VOIP_VLAN_QUERY:
 	      tlvi = proto_tree_add_text(cdp_tree, tvb,
-					 offset, length, "VoIP VLAN Query");
+					 offset, length, "VoIP VLAN Query: %u", tvb_get_ntohs(tvb, offset + 5));
 	      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);
 	      proto_tree_add_text(tlv_tree, tvb, offset + 4,
-				  length - 4, "Data");
+				  1, "Data");
+	      proto_tree_add_text(tlv_tree, tvb, offset + 5,
+				  2, "Voice VLAN: %u",
+				  tvb_get_ntohs(tvb, offset + 5));
 	      offset += length;
 	      break;
 	    case TYPE_MTU: