This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

proto_tree_append_text function

0

Hello,

I am writing a dissector in C and I donwloaded the last version of the source from svn. I want to use the proto_tree_append_text to add a label to an item. My compiler said that this function is not defined. This are are my include at the begin of my c file:

#ifdef HAVE_CONFIG_H
# include "config.h"

#endif

#include <stdio.h> #include <glib.h> #include <epan/packet.h> #include <epan/emem.h> #include <epan/dissectors/packet-tcp.h> #include <epan/prefs.h> #include <string.h>

Somebody can help me and tell what include I should add?

Thanks. Sandrine.

asked 17 Dec ‘10, 05:39

Sandrine%20Beauche's gravatar image

Sandrine Bea…
16224
accept rate: 0%


One Answer:

1

The function to use would be proto_item_append_text and is declared in epan/proto.h:

/** Append to text of item after it has already been created.
 @param ti the item to append the text to
 @param format printf like format string
 @param ... printf like parameters */
extern void proto_item_append_text(proto_item *ti, const char *format, ...)
        G_GNUC_PRINTF(2,3);

Hope this helps :-)

answered 17 Dec '10, 07:17

SYN-bit's gravatar image

SYN-bit ♦♦
17.1k957245
accept rate: 20%