Add "proto_tree_add_XXX_format_value()" routines, which are like the
"proto_tree_add_XXX_format()" routines except that the format doesn't have to include the field name - the field name, followed by ": ", are put into the representation string, followed by the result of the formatting, so you just format the value with the format string, not the entire representation. svn path=/trunk/; revision=17221
This commit is contained in:
parent
9fd26b71ef
commit
55c64cec5e
|
@ -461,36 +461,47 @@ proto_set_cant_toggle
|
|||
proto_set_decoding
|
||||
proto_tree_add_boolean
|
||||
proto_tree_add_boolean_format
|
||||
proto_tree_add_boolean_format_value
|
||||
proto_tree_add_boolean_hidden
|
||||
proto_tree_add_bytes
|
||||
proto_tree_add_bytes_format
|
||||
proto_tree_add_bytes_format_value
|
||||
proto_tree_add_bytes_hidden
|
||||
proto_tree_add_debug_text
|
||||
proto_tree_add_double
|
||||
proto_tree_add_double_format
|
||||
proto_tree_add_double_format_value
|
||||
proto_tree_add_double_hidden
|
||||
proto_tree_add_ether
|
||||
proto_tree_add_ether_format
|
||||
proto_tree_add_ether_format_value
|
||||
proto_tree_add_ether_hidden
|
||||
proto_tree_add_float
|
||||
proto_tree_add_float_format
|
||||
proto_tree_add_float_format_value
|
||||
proto_tree_add_float_hidden
|
||||
proto_tree_add_guid
|
||||
proto_tree_add_guid_format
|
||||
proto_tree_add_guid_format_value
|
||||
proto_tree_add_guid_hidden
|
||||
proto_tree_add_int
|
||||
proto_tree_add_int_format
|
||||
proto_tree_add_int_hidden
|
||||
proto_tree_add_int_hidden_value
|
||||
proto_tree_add_int64
|
||||
proto_tree_add_int64_format
|
||||
proto_tree_add_int64_format_value
|
||||
proto_tree_add_ipv4
|
||||
proto_tree_add_ipv4_format
|
||||
proto_tree_add_ipv4_format_value
|
||||
proto_tree_add_ipv4_hidden
|
||||
proto_tree_add_ipv6
|
||||
proto_tree_add_ipv6_format
|
||||
proto_tree_add_ipv6_format_value
|
||||
proto_tree_add_ipv6_hidden
|
||||
proto_tree_add_ipxnet
|
||||
proto_tree_add_ipxnet_format
|
||||
proto_tree_add_ipxnet_format_value
|
||||
proto_tree_add_ipxnet_hidden
|
||||
proto_tree_add_item
|
||||
proto_tree_add_item_hidden
|
||||
|
@ -498,16 +509,20 @@ proto_tree_add_none_format
|
|||
proto_tree_add_protocol_format
|
||||
proto_tree_add_string
|
||||
proto_tree_add_string_format
|
||||
proto_tree_add_string_format_value
|
||||
proto_tree_add_string_hidden
|
||||
proto_tree_add_text
|
||||
proto_tree_add_time
|
||||
proto_tree_add_time_format
|
||||
proto_tree_add_time_format_value
|
||||
proto_tree_add_time_hidden
|
||||
proto_tree_add_uint
|
||||
proto_tree_add_uint_format
|
||||
proto_tree_add_uint_format_value
|
||||
proto_tree_add_uint_hidden
|
||||
proto_tree_add_uint64
|
||||
proto_tree_add_uint64_format
|
||||
proto_tree_add_uint64_format_value
|
||||
proto_tree_children_foreach
|
||||
proto_tree_get_parent
|
||||
proto_tree_move_item
|
||||
|
|
334
epan/proto.c
334
epan/proto.c
|
@ -121,6 +121,8 @@ static proto_item *
|
|||
proto_tree_add_pi(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint *length, field_info **pfi);
|
||||
|
||||
static void
|
||||
proto_tree_set_representation_value(proto_item *pi, const char *format, va_list ap);
|
||||
static void
|
||||
proto_tree_set_representation(proto_item *pi, const char *format, va_list ap);
|
||||
|
||||
|
@ -1241,6 +1243,25 @@ proto_tree_add_bytes_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8 *start_ptr,
|
||||
const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_bytes(tree, hfindex, tvb, start, length, start_ptr);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_bytes_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint8 *start_ptr, const char *format, ...)
|
||||
|
@ -1317,6 +1338,25 @@ proto_tree_add_time_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, nstime_t *value_ptr,
|
||||
const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_time(tree, hfindex, tvb, start, length, value_ptr);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_time_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
nstime_t *value_ptr, const char *format, ...)
|
||||
|
@ -1381,6 +1421,24 @@ proto_tree_add_ipxnet_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint32 value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_ipxnet(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ipxnet_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
guint32 value, const char *format, ...)
|
||||
|
@ -1444,6 +1502,24 @@ proto_tree_add_ipv4_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint32 value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_ipv4(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ipv4_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
guint32 value, const char *format, ...)
|
||||
|
@ -1507,6 +1583,25 @@ proto_tree_add_ipv6_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value_ptr,
|
||||
const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_ipv6(tree, hfindex, tvb, start, length, value_ptr);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ipv6_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
const guint8* value_ptr, const char *format, ...)
|
||||
|
@ -1577,6 +1672,25 @@ proto_tree_add_guid_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value_ptr,
|
||||
const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_guid(tree, hfindex, tvb, start, length, value_ptr);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_guid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
const guint8* value_ptr, const char *format, ...)
|
||||
|
@ -1647,6 +1761,25 @@ proto_tree_add_oid_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint sta
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value_ptr,
|
||||
const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_oid(tree, hfindex, tvb, start, length, value_ptr);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_oid_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
const guint8* value_ptr, const char *format, ...)
|
||||
|
@ -1743,6 +1876,25 @@ proto_tree_add_string_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const char* value, const char *format,
|
||||
...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_string(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const char* value, const char *format, ...)
|
||||
|
@ -1864,6 +2016,25 @@ proto_tree_add_ether_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value,
|
||||
const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_ether(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_ether_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
const guint8* value, const char *format, ...)
|
||||
|
@ -1933,6 +2104,25 @@ proto_tree_add_boolean_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex,
|
||||
tvbuff_t *tvb, gint start, gint length, guint32 value,
|
||||
const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_boolean(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_boolean_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
guint32 value, const char *format, ...)
|
||||
|
@ -1996,6 +2186,24 @@ proto_tree_add_float_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint s
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, float value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_float(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_float_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
float value, const char *format, ...)
|
||||
|
@ -2059,6 +2267,24 @@ proto_tree_add_double_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, double value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_double(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_double_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
double value, const char *format, ...)
|
||||
|
@ -2132,6 +2358,24 @@ proto_tree_add_uint_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint st
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint32 value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_uint(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_uint_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
guint32 value, const char *format, ...)
|
||||
|
@ -2195,6 +2439,24 @@ proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint64 value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_uint64(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_uint64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
guint64 value, const char *format, ...)
|
||||
|
@ -2260,6 +2522,24 @@ proto_tree_add_int_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint sta
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, gint32 value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi = NULL;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_int(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_int_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
gint32 value, const char *format, ...)
|
||||
|
@ -2323,6 +2603,24 @@ proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, g
|
|||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, gint64 value, const char *format, ...)
|
||||
{
|
||||
proto_item *pi;
|
||||
va_list ap;
|
||||
|
||||
pi = proto_tree_add_int64(tree, hfindex, tvb, start, length, value);
|
||||
if (pi == NULL)
|
||||
return (NULL);
|
||||
|
||||
va_start(ap, format);
|
||||
proto_tree_set_representation_value(pi, format, ap);
|
||||
va_end(ap);
|
||||
|
||||
return pi;
|
||||
}
|
||||
|
||||
proto_item *
|
||||
proto_tree_add_int64_format(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start, gint length,
|
||||
gint64 value, const char *format, ...)
|
||||
|
@ -2593,8 +2891,38 @@ alloc_field_info(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
|||
return new_field_info(tree, hfinfo, tvb, start, item_length);
|
||||
}
|
||||
|
||||
/* Set representation of a proto_tree entry, if the protocol tree is to
|
||||
be visible. */
|
||||
/* If the protocol tree is to be visible, set the representation of a
|
||||
proto_tree entry with the name of the field for the item and with
|
||||
the value formatted with the supplied printf-style format and
|
||||
argument list. */
|
||||
static void
|
||||
proto_tree_set_representation_value(proto_item *pi, const char *format, va_list ap)
|
||||
{
|
||||
int ret; /*tmp return value */
|
||||
int replen;
|
||||
field_info *fi = PITEM_FINFO(pi);
|
||||
|
||||
if (!PROTO_ITEM_IS_HIDDEN(pi)) {
|
||||
ITEM_LABEL_NEW(fi->rep);
|
||||
replen = 0;
|
||||
ret = g_snprintf(fi->rep->representation, ITEM_LABEL_LENGTH,
|
||||
"%s: ", fi->hfinfo->name);
|
||||
if ((ret == -1) || (ret >= ITEM_LABEL_LENGTH)) {
|
||||
/* That's all we can put in the representation. */
|
||||
fi->rep->representation[ITEM_LABEL_LENGTH - 1] = '\0';
|
||||
return;
|
||||
}
|
||||
replen = ret;
|
||||
ret = g_vsnprintf(fi->rep->representation + replen,
|
||||
ITEM_LABEL_LENGTH - replen, format, ap);
|
||||
if ((ret == -1) || (ret >= ITEM_LABEL_LENGTH - replen))
|
||||
fi->rep->representation[ITEM_LABEL_LENGTH - 1] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/* If the protocol tree is to be visible, set the representation of a
|
||||
proto_tree entry with the representation formatted with the supplied
|
||||
printf-style format and argument list. */
|
||||
static void
|
||||
proto_tree_set_representation(proto_item *pi, const char *format, va_list ap)
|
||||
{
|
||||
|
@ -2646,7 +2974,7 @@ proto_item_append_text(proto_item *pi, const char *format, ...)
|
|||
|
||||
fi = PITEM_FINFO(pi);
|
||||
|
||||
if (!PROTO_ITEM_IS_HIDDEN(pi)) {
|
||||
if (!PROTO_ITEM_IS_HIDDEN(pi)) {
|
||||
va_start(ap, format);
|
||||
|
||||
/*
|
||||
|
|
327
epan/proto.h
327
epan/proto.h
|
@ -524,7 +524,25 @@ extern proto_item *
|
|||
proto_tree_add_bytes_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint8* start_ptr);
|
||||
|
||||
/** Add a formatted FT_BYTES to a proto_tree.
|
||||
/** Add a formatted FT_BYTES to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param start_ptr pointer to the data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_bytes_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* start_ptr, const char *format,
|
||||
...) GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_BYTES to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -556,7 +574,26 @@ extern proto_item *
|
|||
proto_tree_add_time_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, nstime_t* value_ptr);
|
||||
|
||||
/** Add a formatted FT_ABSOLUTE_TIME or FT_RELATIVE_TIME to a proto_tree.
|
||||
/** Add a formatted FT_ABSOLUTE_TIME or FT_RELATIVE_TIME to a proto_tree, with
|
||||
the format generating the string for the value and with the field name
|
||||
being included automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value_ptr pointer to the data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_time_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, nstime_t* value_ptr, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_ABSOLUTE_TIME or FT_RELATIVE_TIME to a proto_tree, with
|
||||
the format generating the entire string for the entry, including any field
|
||||
name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -588,7 +625,25 @@ extern proto_item *
|
|||
proto_tree_add_ipxnet_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, guint32 value);
|
||||
|
||||
/** Add a formatted FT_IPXNET to a proto_tree.
|
||||
/** Add a formatted FT_IPXNET to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_ipxnet_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint32 value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_IPXNET to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -620,7 +675,25 @@ extern proto_item *
|
|||
proto_tree_add_ipv4_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, guint32 value);
|
||||
|
||||
/** Add a formatted FT_IPv4 to a proto_tree.
|
||||
/** Add a formatted FT_IPv4 to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_ipv4_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint32 value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_IPv4 to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -652,7 +725,25 @@ extern proto_item *
|
|||
proto_tree_add_ipv6_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint8* value_ptr);
|
||||
|
||||
/** Add a formatted FT_IPv6 to a proto_tree.
|
||||
/** Add a formatted FT_IPv6 to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value_ptr data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_ipv6_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value_ptr, const char *format,
|
||||
...) GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_IPv6 to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -684,7 +775,25 @@ extern proto_item *
|
|||
proto_tree_add_ether_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint8* value);
|
||||
|
||||
/** Add a formatted FT_ETHER to a proto_tree.
|
||||
/** Add a formatted FT_ETHER to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_ether_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_ETHER to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -716,7 +825,25 @@ extern proto_item *
|
|||
proto_tree_add_guid_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint8* value_ptr);
|
||||
|
||||
/** Add a formatted FT_GUID to a proto_tree.
|
||||
/** Add a formatted FT_GUID to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value_ptr data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_guid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value_ptr, const char *format,
|
||||
...) GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_GUID to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -748,7 +875,25 @@ extern proto_item *
|
|||
proto_tree_add_oid_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const guint8* value_ptr);
|
||||
|
||||
/** Add a formatted FT_OID to a proto_tree.
|
||||
/** Add a formatted FT_OID to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value_ptr data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_oid_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const guint8* value_ptr, const char *format,
|
||||
...) GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_OID to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -780,7 +925,25 @@ extern proto_item *
|
|||
proto_tree_add_string_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, const char* value);
|
||||
|
||||
/** Add a formatted FT_STRING to a proto_tree.
|
||||
/** Add a formatted FT_STRING to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_string_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, const char* value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_STRING to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -812,7 +975,25 @@ extern proto_item *
|
|||
proto_tree_add_boolean_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, guint32 value);
|
||||
|
||||
/** Add a formatted FT_BOOLEAN to a proto_tree.
|
||||
/** Add a formatted FT_BOOLEAN to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_boolean_format_value(proto_tree *tree, int hfindex,
|
||||
tvbuff_t *tvb, gint start, gint length, guint32 value,
|
||||
const char *format, ...) GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_BOOLEAN to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -844,7 +1025,25 @@ extern proto_item *
|
|||
proto_tree_add_float_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, float value);
|
||||
|
||||
/** Add a formatted FT_FLOAT to a proto_tree.
|
||||
/** Add a formatted FT_FLOAT to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_float_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, float value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_FLOAT to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -876,7 +1075,25 @@ extern proto_item *
|
|||
proto_tree_add_double_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, double value);
|
||||
|
||||
/** Add a formatted FT_DOUBLE to a proto_tree.
|
||||
/** Add a formatted FT_DOUBLE to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_double_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, double value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_DOUBLE to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -902,13 +1119,32 @@ extern proto_item *
|
|||
proto_tree_add_uint(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, guint32 value);
|
||||
|
||||
/** Add a hidden of one of FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32 to a proto_tree.
|
||||
/** Add a hidden FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32 to a proto_tree.
|
||||
@deprecated use proto_tree_add_uint() and a subsequent call to PROTO_ITEM_SET_HIDDEN() instead */
|
||||
extern proto_item *
|
||||
proto_tree_add_uint_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, guint32 value);
|
||||
|
||||
/** Add a formatted of one of FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32 to a proto_tree.
|
||||
/** Add a formatted FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32 to a proto_tree,
|
||||
with the format generating the string for the value and with the field
|
||||
name being included automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_uint_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint32 value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_UINT8, FT_UINT16, FT_UINT24 or FT_UINT32 to a proto_tree,
|
||||
with the format generating the entire string for the entry, including any
|
||||
field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -934,7 +1170,25 @@ extern proto_item *
|
|||
proto_tree_add_uint64(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, guint64 value);
|
||||
|
||||
/** Add a formatted FT_UINT64 to a proto_tree.
|
||||
/** Add a formatted FT_UINT64 to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_uint64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, guint64 value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_UINT64 to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -960,13 +1214,32 @@ extern proto_item *
|
|||
proto_tree_add_int(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, gint32 value);
|
||||
|
||||
/** Add a hidden of one of FT_INT8, FT_INT16, FT_INT24 or FT_INT32 to a proto_tree.
|
||||
/** Add a hidden FT_INT8, FT_INT16, FT_INT24 or FT_INT32 to a proto_tree.
|
||||
@deprecated use proto_tree_add_int() and a subsequent call to PROTO_ITEM_SET_HIDDEN() instead */
|
||||
extern proto_item *
|
||||
proto_tree_add_int_hidden(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, gint32 value);
|
||||
|
||||
/** Add a formatted of one of FT_INT8, FT_INT16, FT_INT24 or FT_INT32 to a proto_tree.
|
||||
/** Add a formatted FT_INT8, FT_INT16, FT_INT24 or FT_INT32 to a proto_tree,
|
||||
with the format generating the string for the value and with the field
|
||||
name being included automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_int_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, gint32 value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_INT8, FT_INT16, FT_INT24 or FT_INT32 to a proto_tree,
|
||||
with the format generating the entire string for the entry, including
|
||||
any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
@ -992,7 +1265,25 @@ extern proto_item *
|
|||
proto_tree_add_int64(proto_tree *tree, int hfindex, tvbuff_t *tvb, gint start,
|
||||
gint length, gint64 value);
|
||||
|
||||
/** Add a formatted FT_INT64 to a proto_tree.
|
||||
/** Add a formatted FT_INT64 to a proto_tree, with the format generating
|
||||
the string for the value and with the field name being included
|
||||
automatically.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
@param start start of data in tvb
|
||||
@param length length of data in tvb
|
||||
@param value data to display
|
||||
@param format printf like format string
|
||||
@param ... printf like parameters
|
||||
@return the newly created item */
|
||||
extern proto_item *
|
||||
proto_tree_add_int64_format_value(proto_tree *tree, int hfindex, tvbuff_t *tvb,
|
||||
gint start, gint length, gint64 value, const char *format, ...)
|
||||
GNUC_FORMAT_CHECK(printf,7,8);
|
||||
|
||||
/** Add a formatted FT_INT64 to a proto_tree, with the format generating
|
||||
the entire string for the entry, including any field name.
|
||||
@param tree the tree to append this item to
|
||||
@param hfindex field index
|
||||
@param tvb the tv buffer of the current data
|
||||
|
|
Loading…
Reference in New Issue