Ethereal-dev: [Ethereal-dev] patch for packet-giop.c response_flags

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

From: Bernd Becker <bb@xxxxxxxxxxxxxxx>
Date: Fri, 13 Jun 2003 09:24:26 +0200
Hi,

trying again to get this small change in ..., see
http://ethereal.archive.sunet.se/lists/ethereal-dev/200306/msg00036.html
for details (can't get to ethereal.com right now).

The response_flags in the Request_Header should not be mapped
one to one to the SyncScope values. Certain SyncScope values
just imply certain response_flags according to a comment in the
Corba Spec v3.0, 15-35.
So now just print the numeric value of response_flags followed
by a string with the possible corresponding SyncScope values
in parenthesis.


Bernd Becker
bb@xxxxxxxxxxxxxxx
Index: packet-giop.c
===================================================================
RCS file: /cvsroot/ethereal/packet-giop.c,v
retrieving revision 1.72
diff -u -r1.72 packet-giop.c
--- packet-giop.c	5 Mar 2003 15:33:12 -0000	1.72
+++ packet-giop.c	23 Apr 2003 12:52:07 -0000
@@ -457,11 +457,30 @@
   { 0, NULL}
 };
 
-static const value_string sync_scope[] = {
-	{ 0x0, "SYNC_NONE" },
-	{ 0x1, "SYNC_WITH_TRANSPORT"},
-	{ 0x2, "SYNC_WITH_SERVER"},
-	{ 0x3, "SYNC_WITH_TARGET"},
+/*
+ * sync_scope not used for now but may be needed some day for
+ * "Corba Messaging Quality of Service" implementation
+ * static const value_string sync_scope[] = {
+ * 	{ 0x0, "SYNC_NONE" },
+ * 	{ 0x1, "SYNC_WITH_TRANSPORT"},
+ * 	{ 0x2, "SYNC_WITH_SERVER"},
+ * 	{ 0x3, "SYNC_WITH_TARGET"},
+ * 	{ 0, NULL}
+ * };
+ */
+
+/*
+ * From CORBA, v3.0: GIOP Message Formats, 15-35
+ * response_flags is set to 0x0 for a SyncScope of NONE and WITH_TRANSPORT.
+ * The flag is set to 0x1 for a SyncScope of WITH_SERVER. A non exception 
+ * reply to a request message containing a response_flags value of 0x1 should
+ * contain an empty body, i.e. the equivalent of a void operation with no
+ * out/inout parameters. The flag is set to 0x3 for a SyncScope of WITH_TARGET.
+ */
+static const value_string response_flags_vals[] = {
+	{ 0x0, "SyncScope NONE or WITH_TRANSPORT" },
+	{ 0x1, "SyncScope WITH_SERVER"},
+	{ 0x3, "SyncScope WITH_TARGET"},
 	{ 0, NULL}
 };
 
@@ -3480,9 +3499,10 @@
   if (request_tree)
     {
       proto_tree_add_text (request_tree, tvb, offset-1, 1,
-			   "Response flags: %s (%u)",
-			        match_strval(response_flags, sync_scope),
-			        response_flags);
+			   "Response flags: %u (%s)",
+				response_flags,
+				val_to_str(response_flags, response_flags_vals,
+				"No corresponding SyncScope for 0x%x"));
     }
 
   get_CDR_octet_seq( tvb, &reserved, &offset, 3);