Added support for some missing custom column types:

FT_NONE: Print nothing
 FT_PROTOCOL: Print "Yes" if protocol exists in packet
 FT_IPv6: Print address

The changes in r29551 made wireshark crash for this columns.

svn path=/trunk/; revision=31016
This commit is contained in:
Stig Bjørlykke 2009-11-19 13:29:57 +00:00
parent 5d4f4df364
commit a1c8cdcc7c
1 changed files with 19 additions and 1 deletions

View File

@ -3289,6 +3289,8 @@ proto_custom_set(proto_tree* tree, int field_id,
gint32 integer;
guint8 *bytes;
ipv4_addr *ipv4;
struct e_in6_addr *ipv6;
address addr;
guint32 n_addr; /* network-order IPv4 address */
const true_false_string *tfstring;
@ -3317,6 +3319,16 @@ proto_custom_set(proto_tree* tree, int field_id,
switch(hfinfo->type) {
case FT_NONE: /* Nothing to add */
result[0] = '\0';
break;
case FT_PROTOCOL: /* We only check if protocol exist in packet */
if (strcmp(hfinfo->name, finfo->hfinfo->name) == 0) {
g_strlcpy(result, "Yes", size);
}
break;
case FT_UINT_BYTES:
case FT_BYTES:
bytes = fvalue_get(&finfo->value);
@ -3389,6 +3401,12 @@ proto_custom_set(proto_tree* tree, int field_id,
g_strlcpy(result, ip_to_str((guint8 *)&n_addr), size);
break;
case FT_IPv6:
ipv6 = fvalue_get(&finfo->value);
SET_ADDRESS (&addr, AT_IPv6, sizeof(struct e_in6_addr), ipv6);
address_to_str_buf(&addr, result, size);
break;
case FT_ETHER:
g_strlcpy(result, bytes_to_str_punct(fvalue_get(&finfo->value), 6, ':'), size);
break;
@ -3419,7 +3437,7 @@ proto_custom_set(proto_tree* tree, int field_id,
break;
case FT_IPXNET: /*XXX really No column custom ?*/
case FT_IPv6:
case FT_PCRE:
default:
g_error("hfinfo->type %d (%s) not handled\n",
hfinfo->type,