Package: ethereal-dev
Version: 0.10.11-1.01
Severity: wishlist
Tags: patch, upstream

Currently a sequence<octet> is presented one line per octet
in the detail view.  This is ugly and not consistent with
the presentation of e.g. the object key.  The sequence
should be presented in one line only.

diff -ur ethereal-0.10.11/epan/dissectors/packet-giop.c 
ethereal-0.10.11.octets/epan/dissectors/packet-giop.c
--- ethereal-0.10.11/epan/dissectors/packet-giop.c      2005-06-18 
18:44:59.000000000 +0000
+++ ethereal-0.10.11.octets/epan/dissectors/packet-giop.c       2005-06-18 
19:24:39.436281192 +0000
@@ -1873,7 +1873,7 @@
  * Caller must free the new string.
  */
 
-static gchar * make_printable_string (gchar *in, guint32 len) {
+gchar * make_printable_string (gchar *in, guint32 len) {
   guint32 i = 0;
   gchar *print_string = NULL;
 
diff -ur ethereal-0.10.11/epan/dissectors/packet-giop.h 
ethereal-0.10.11.octets/epan/dissectors/packet-giop.h
--- ethereal-0.10.11/epan/dissectors/packet-giop.h      2005-06-18 
18:45:03.000000000 +0000
+++ ethereal-0.10.11.octets/epan/dissectors/packet-giop.h       2005-06-18 
18:43:13.000000000 +0000
@@ -534,7 +534,16 @@
                           gboolean old_stream_is_big_endian, guint32 
old_boundary,
                           gboolean *new_stream_is_big_endian_ptr, guint32 
*new_boundary_ptr );
 
+/* Take in an array of char and create a new string.
+ * Replace non-printable characters with periods.
+ *
+ * The array may contain \0's so dont use strdup
+ * The string is \0 terminated, and thus longer than
+ * the initial sequence.
+ * Caller must free the new string.
+ */
 
+extern gchar * make_printable_string (gchar *in, guint32 len);
 
 /*
  * Enums for TCkind
diff -ur ethereal-0.10.11/ethereal_gen.py 
ethereal-0.10.11.octets/ethereal_gen.py
--- ethereal-0.10.11/ethereal_gen.py    2005-06-18 18:43:54.000000000 +0000
+++ ethereal-0.10.11.octets/ethereal_gen.py     2005-06-18 18:43:16.000000000 
+0000
@@ -997,6 +997,9 @@
             self.get_CDR_struct(type,pn)
         elif pt ==  idltype.tk_TypeCode: # will I ever get here ?
             self.get_CDR_TypeCode(pn)
+        elif pt == idltype.tk_sequence and \
+                 type.unalias().seqType().kind() == idltype.tk_octet:
+            self.get_CDR_sequence_octet(type,pn)
         elif pt == idltype.tk_sequence:
             self.get_CDR_sequence(type,pn)
         elif pt == idltype.tk_objref:
@@ -1412,6 +1415,17 @@
         
         self.st.out(self.template_get_CDR_sequence_loop_end)
 
+    #
+    # Generate code to access a sequence of octet
+    #
+
+    def get_CDR_sequence_octet(self,type, pn):
+        self.st.out(self.template_get_CDR_sequence_length, seqname=pn)
+        self.st.out(self.template_get_CDR_sequence_octet, seqname=pn)
+        self.addvar(self.c_i_lim + pn + ";")
+        self.addvar("gchar * binary_seq_" + pn + ";")
+        self.addvar("gchar * text_seq_" + pn + ";")
+
 
         
     #
@@ -2081,6 +2095,18 @@
 """
     
 
+    template_get_CDR_sequence_octet = """\
+if ([EMAIL PROTECTED]@ > 0 and tree) {
+    get_CDR_octet_seq(tvb, &[EMAIL PROTECTED]@, offset,
+        [EMAIL PROTECTED]@);
+    [EMAIL PROTECTED]@ = make_printable_string([EMAIL PROTECTED]@,
+        [EMAIL PROTECTED]@);
+    proto_tree_add_text(tree, tvb, *offset - [EMAIL PROTECTED]@,
+        [EMAIL PROTECTED]@, \"@seqname@: %s\", [EMAIL PROTECTED]@);
+    g_free([EMAIL PROTECTED]@);
+    g_free([EMAIL PROTECTED]@);
+}
+"""
 
     template_get_CDR_array_start = """\
 for ([EMAIL PROTECTED]@=0; [EMAIL PROTECTED]@ < @aval@; [EMAIL PROTECTED]@++) {

Reply via email to