aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2008-02-12 03:16:09 +0000
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2008-02-12 03:16:09 +0000
commit63d7786894d72d8b3c4c0a01c62fec4efdcb2c55 (patch)
treeaf744fcb03e5f1df24631059a5792b6679c28b54 /epan/proto.c
parent8c9dc20266a9e30f0a03d6e78c0b0b2ebb9d4c86 (diff)
Introduce a new column type called custom, which lets you put any display
filter name in the description field and it will display that field in the packet list if it occurs in that packet. Note that the more common fields are implemented, but a number of them remain to be implemented in epan/proto.c. I will work on these other fields as I have time. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24308 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/epan/proto.c b/epan/proto.c
index d477d644f6..e0317e33de 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -45,6 +45,7 @@
#include "emem.h"
#include "charsets.h"
#include "asm_utils.h"
+#include "column-utils.h"
#ifdef NEED_G_ASCII_STRCASECMP_H
#include "g_ascii_strcasecmp.h"
@@ -1640,6 +1641,7 @@ proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint
static void
proto_tree_set_ipxnet(field_info *fi, guint32 value)
{
+ col_custom_set_fstr(fi->hfinfo->abbrev, "%u", value);
fvalue_set_uinteger(&fi->value, value);
}
@@ -2166,10 +2168,13 @@ proto_item_append_string(proto_item *pi, const char *str)
static void
proto_tree_set_string(field_info *fi, const char* value)
{
- if (value)
+ if (value) {
+ col_custom_set_fstr(fi->hfinfo->abbrev, "%s", value);
fvalue_set(&fi->value, (gpointer) value, FALSE);
- else
+ } else {
+ col_custom_set_fstr(fi->hfinfo->abbrev, "[ Null ]");
fvalue_set(&fi->value, (gpointer) "[ Null ]", FALSE);
+ }
}
static void
@@ -2278,6 +2283,7 @@ proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s
static void
proto_tree_set_ether(field_info *fi, const guint8* value)
{
+ col_custom_set_fstr(fi->hfinfo->abbrev, "%s", value);
fvalue_set(&fi->value, (gpointer) value, FALSE);
}
@@ -2634,6 +2640,7 @@ proto_tree_set_uint(field_info *fi, guint32 value)
integer >>= hfinfo->bitshift;
}
}
+ col_custom_set_fstr(hfinfo->abbrev, "%u", value);
fvalue_set_uinteger(&fi->value, integer);
}
@@ -2798,6 +2805,8 @@ proto_tree_set_int(field_info *fi, gint32 value)
integer >>= hfinfo->bitshift;
}
}
+
+ col_custom_set_fstr(hfinfo->abbrev, "%u", value);
fvalue_set_sinteger(&fi->value, integer);
}