Ethereal-dev: [Ethereal-dev] WINSREPL: COL_INFO

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

From: Stefan Metzmacher <metze@xxxxxxxxx>
Date: Mon, 12 Sep 2005 14:33:11 +0200
Hi Ronnie,

sorry missed the attachment in my last mail.


-- 
metze
--
Stefan (metze) Metzmcher <metze at samba dot org>
=== epan/dissectors/packet-winsrepl.c
==================================================================
--- epan/dissectors/packet-winsrepl.c	(revision 65)
+++ epan/dissectors/packet-winsrepl.c	(local)
@@ -113,9 +113,9 @@
 	{WREPL_REPL_TABLE_QUERY,	"WREPL_REPL_TABLE_QUERY"},
 	{WREPL_REPL_TABLE_REPLY,	"WREPL_REPL_TABLE_REPLY"},
 	{WREPL_REPL_SEND_REQUEST,	"WREPL_REPL_SEND_REQUEST"},
-	{WREPL_REPL_SEND_REPLY,	"WREPL_REPL_SEND_REPLY"},
-	{WREPL_REPL_UPDATE,	"WREPL_REPL_UPDATE"},
-	{WREPL_REPL_INFORM,	"WREPL_REPL_INFORM"},
+	{WREPL_REPL_SEND_REPLY,		"WREPL_REPL_SEND_REPLY"},
+	{WREPL_REPL_UPDATE,		"WREPL_REPL_UPDATE"},
+	{WREPL_REPL_INFORM,		"WREPL_REPL_INFORM"},
 	{0, NULL}
 };
 
@@ -123,7 +123,7 @@
 	{WREPL_START_ASSOCIATION,	"WREPL_START_ASSOCIATION"},
 	{WREPL_START_ASSOCIATION_REPLY,	"WREPL_START_ASSOCIATION_REPLY"},
 	{WREPL_STOP_ASSOCIATION,	"WREPL_STOP_ASSOCIATION"},
-	{WREPL_REPLICATION,	"WREPL_REPLICATION"},
+	{WREPL_REPLICATION,		"WREPL_REPLICATION"},
 	{0, NULL}
 };
 
@@ -178,6 +178,8 @@
 	proto_tree_add_uint(stop_tree, hf_winsrepl_stop_reason, winsrepl_tvb, winsrepl_offset, 4, stop->reason);
 	winsrepl_offset += 4;
 
+	proto_item_append_text(stop_item, ", Reason: 0x%08X", stop->reason);
+
 	return winsrepl_offset;
 }
 
@@ -485,10 +487,13 @@
 }
 
 static int
-dissect_winsrepl_update(tvbuff_t *winsrepl_tvb _U_, packet_info *pinfo _U_,
-			int winsrepl_offset, proto_tree *winsrepl_tree _U_,
-			struct winsrepl_frame_data *winsrepl _U_)
+dissect_winsrepl_update(tvbuff_t *winsrepl_tvb, packet_info *pinfo,
+			int winsrepl_offset, proto_tree *winsrepl_tree,
+			struct winsrepl_frame_data *winsrepl)
 {
+	winsrepl_offset = dissect_winsrepl_table_reply(winsrepl_tvb, pinfo,
+						       winsrepl_offset, winsrepl_tree,
+						       winsrepl);
 	return winsrepl_offset;
 }
 
@@ -516,7 +521,7 @@
 
 static int
 dissect_winsrepl_replication(tvbuff_t *winsrepl_tvb, packet_info *pinfo,
-			     int winsrepl_offset, proto_tree *winsrepl_tree,
+			     int winsrepl_offset, proto_item *winsrepl_item, proto_tree *winsrepl_tree,
 			     struct winsrepl_frame_data *winsrepl)
 {
 	struct wrepl_replication *repl = &winsrepl->w.packet.message.replication;
@@ -535,41 +540,85 @@
 
 	switch (repl->command) {
 		case WREPL_REPL_TABLE_QUERY:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_TABLE_QUERY");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_REPL_TABLE_QUERY");
+			proto_item_append_text(repl_item, ", WREPL_REPL_TABLE_QUERY");
 			winsrepl_offset = dissect_winsrepl_table_query(winsrepl_tvb, pinfo,
 								       winsrepl_offset, repl_tree,
 								       winsrepl);
 			break;
 		case WREPL_REPL_TABLE_REPLY:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_TABLE_REPLY");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_REPL_TABLE_REPLY");
+			proto_item_append_text(repl_item, ", WREPL_REPL_TABLE_REPLY");
 			winsrepl_offset = dissect_winsrepl_table_reply(winsrepl_tvb, pinfo,
 								       winsrepl_offset, repl_tree,
 								       winsrepl);
 			break;
 		case WREPL_REPL_SEND_REQUEST:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_SEND_REQUEST");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_REPL_SEND_REQUEST");
+			proto_item_append_text(repl_item, ", WREPL_REPL_SEND_REQUEST");
 			winsrepl_offset = dissect_winsrepl_send_request(winsrepl_tvb, pinfo,
 									winsrepl_offset, repl_tree,
 									winsrepl);
 			break;
 		case WREPL_REPL_SEND_REPLY:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_SEND_REPLY");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_REPL_SEND_REPLY");
+			proto_item_append_text(repl_item, ", WREPL_REPL_SEND_REPLY");
 			winsrepl_offset = dissect_winsrepl_send_reply(winsrepl_tvb, pinfo,
 								      winsrepl_offset, repl_tree,
 								      winsrepl);
 			break;
 		case WREPL_REPL_UPDATE:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_UPDATE");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_REPL_UPDATE");
+			proto_item_append_text(repl_item, ", WREPL_REPL_UPDATE");
 			winsrepl_offset = dissect_winsrepl_update(winsrepl_tvb, pinfo,
 								  winsrepl_offset, repl_tree,
 								  winsrepl);
 			break;
 		case WREPL_REPL_5:
-		case WREPL_REPL_9:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_5");
+			}
+			proto_item_append_text(winsrepl_item, ",WREPL_REPL_5");
+			proto_item_append_text(repl_item, ",WREPL_REPL_5");
 			winsrepl_offset = dissect_winsrepl_5_or_9(winsrepl_tvb, pinfo,
 								  winsrepl_offset, repl_tree,
 								  winsrepl);
 			break;
 		case WREPL_REPL_INFORM:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_INFORM");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_REPL_INFORM");
+			proto_item_append_text(repl_item, ", WREPL_REPL_INFORM");
 			winsrepl_offset = dissect_winsrepl_inform(winsrepl_tvb, pinfo,
 								  winsrepl_offset, repl_tree,
 								  winsrepl);
 			break;
+		case WREPL_REPL_9:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_REPL_9");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_REPL_9");
+			proto_item_append_text(repl_item, ", WREPL_REPL_9");
+			winsrepl_offset = dissect_winsrepl_5_or_9(winsrepl_tvb, pinfo,
+								  winsrepl_offset, repl_tree,
+								  winsrepl);
+			break;
 	}
 
 	return winsrepl_offset;
@@ -622,24 +671,36 @@
 
 	switch (winsrepl->w.packet.mess_type) {
 		case WREPL_START_ASSOCIATION:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_START_ASSOCIATION");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_START_ASSOCIATION");
 			offset = dissect_winsrepl_start(tvb, pinfo,
-								 offset, winsrepl_tree,
-								 winsrepl);
+							offset, winsrepl_tree,
+							winsrepl);
 			break;
 		case WREPL_START_ASSOCIATION_REPLY:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_START_ASSOCIATION_REPLY");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_START_ASSOCIATION_REPLY");
 			offset = dissect_winsrepl_start(tvb, pinfo,
-								 offset, winsrepl_tree,
-								 winsrepl);
+							offset, winsrepl_tree,
+							winsrepl);
 			break;
 		case WREPL_STOP_ASSOCIATION:
+			if (check_col(pinfo->cinfo, COL_INFO)) {
+				col_add_fstr(pinfo->cinfo, COL_INFO, "WREPL_STOP_ASSOCIATION");
+			}
+			proto_item_append_text(winsrepl_item, ", WREPL_STOP_ASSOCIATION");
 			offset = dissect_winsrepl_stop(tvb, pinfo,
-								offset, winsrepl_tree,
-								winsrepl);
+						       offset, winsrepl_tree,
+						       winsrepl);
 			break;
 		case WREPL_REPLICATION:
 			offset = dissect_winsrepl_replication(tvb, pinfo,
-								       offset, winsrepl_tree,
-								       winsrepl);
+							      offset, winsrepl_item, winsrepl_tree,
+							      winsrepl);
 			break;
 	}
 
@@ -683,7 +744,7 @@
 			"WINS Replication Assoc_Ctx", HFILL }},
 
 		{ &hf_winsrepl_mess_type, {
-			"Assoc_Ctx", "winsrepl.message_type",
+			"Message_Type", "winsrepl.message_type",
 			FT_UINT32, BASE_DEC, VALS(message_type_vals), 0x0,
 			"WINS Replication Message_Type", HFILL }},
 

Attachment: pgp1c0MjWgv63.pgp
Description: PGP signature