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

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%


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 :-)

permanent link

answered 17 Dec '10, 07:17

SYN-bit's gravatar image

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

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×4
×2

question asked: 17 Dec '10, 05:39

question was seen: 2,280 times

last updated: 17 Dec '10, 07:17

p​o​w​e​r​e​d by O​S​Q​A