Wireshark-dev: [Wireshark-dev] Minor patch to CDP dissector

From: Stephen Fisher <stephentfisher@xxxxxxxxx>
Date: Thu, 17 Aug 2006 10:56:25 -0700
I recently submitted a patch (which was committed) to add the device id 
and port id to the info column in the CDP dissector.  I had left "Cisco 
Discovery Protocol" in the info column from before.  After using it on 
multiple computers, I noticed that the device and port id doesn't always 
fit on the screen.  Since it already says CDP in the protocol column and 
Cisco Discovery Protocol in the tree, the attached patch removes the 
redundant "Cisco Discovery Protocol" from the info column:

Before:

  Cisco Discovery Protocol  Device ID: myswitch.domain.com  Port ID: GigabitEthernet3/17

After:

  Device ID: myswitch.domain.com  Port ID: GigabitEthernet3/17


Thanks,
  Steve

Index: epan/dissectors/packet-cdp.c
===================================================================
--- epan/dissectors/packet-cdp.c	(revision 18938)
+++ epan/dissectors/packet-cdp.c	(working copy)
@@ -151,7 +151,7 @@
     if (check_col(pinfo->cinfo, COL_PROTOCOL))
         col_set_str(pinfo->cinfo, COL_PROTOCOL, "CDP");
     if (check_col(pinfo->cinfo, COL_INFO))
-        col_set_str(pinfo->cinfo, COL_INFO, "Cisco Discovery Protocol");
+	col_clear(pinfo->cinfo, COL_INFO);
 
     if (tree){
         ti = proto_tree_add_item(tree, proto_cdp, tvb, offset, -1, FALSE);
@@ -198,7 +198,7 @@
 
 		if(check_col(pinfo->cinfo, COL_INFO))
 		    col_append_fstr(pinfo->cinfo, COL_INFO,
-				    "  Device ID: %s",
+				    "Device ID: %s  ",
 				    tvb_format_stringzpad(tvb, offset + 4,
 							  length - 4));
 
@@ -232,7 +232,7 @@
 
 		if(check_col(pinfo->cinfo, COL_INFO))
 		    col_append_fstr(pinfo->cinfo, COL_INFO,
-				    "  Port ID: %s",
+				    "Port ID: %s  ",
 				    tvb_format_stringzpad(tvb, offset + 4,
 							  length - 4));