Add ability to make more field types into custom columns: FT_ETHER & FT_BYTES.
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 22 Feb 2008 03:44:08 +0000 (03:44 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 22 Feb 2008 03:44:08 +0000 (03:44 +0000)
Also change display of FT_STRING(Z) to turn non-printable characters into
backslash + number values.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24415 f5534014-38df-0310-8fa8-9805f1628bb7

epan/proto.c

index 38481fa7bf975e2e8d94927a907307577034cddb..b0604deda7820655cb6d4a23d5d1046fcad9094c 100644 (file)
@@ -1469,6 +1469,8 @@ proto_tree_set_bytes(field_info *fi, const guint8* start_ptr, gint length)
        if (length > 0) {
                g_byte_array_append(bytes, start_ptr, length);
        }
+       col_custom_set_fstr(fi->hfinfo->abbrev, "%s", bytes_to_str(bytes->data,
+                                                                  length));
        fvalue_set(&fi->value, bytes, TRUE);
 }
 
@@ -2170,7 +2172,8 @@ static void
 proto_tree_set_string(field_info *fi, const char* value)
 {
        if (value) {
-               col_custom_set_fstr(fi->hfinfo->abbrev, "%s", value);
+               col_custom_set_fstr(fi->hfinfo->abbrev, "%s",
+                                   format_text(value, strlen(value)));
                fvalue_set(&fi->value, (gpointer) value, FALSE);
        } else {
                col_custom_set_fstr(fi->hfinfo->abbrev, "[ Null ]");
@@ -2285,6 +2288,7 @@ static void
 proto_tree_set_ether(field_info *fi, const guint8* value)
 {
        fvalue_set(&fi->value, (gpointer) value, FALSE);
+       col_custom_set_fstr(fi->hfinfo->abbrev, "%s", bytes_to_str_punct(value, 6, ':'));
 }
 
 static void