This is our old Q&A Site. Please post any new questions and answers at
tvb_set_real_data(tvbuff_t* tvb, const guint8* data, const guint length, const gint reported_length)

Hi all, could i use the above function to create a tvb by passing a packet in hex string into its parameters?



Eddie Choo

asked 04 Aug '11, 00:49

eddie%20choo's gravatar image

eddie choo
accept rate: 66%

edited 04 Aug '11, 16:14

helloworld's gravatar image


Hi helloworld, i was thinking that i should open a new question because i wanted to be more specified in getting response only for this tvb_set_real_data function.Thanks

Eddie Choo

(04 Aug '11, 19:11) eddie choo

What do you mean by a "hex string"? Do you mean the ASCII hex representation of some 8 bit binary values, e.g. given the values 01, 66, 255, you have a string "0142FF"?

If so, it all depends on what the consumer of the tvb is expecting. If the consumer is expecting a hex string, all will be OK, if the consumer is expecting the binary values that the hex string represents then things won't go so well.

However if your "hex string" is in fact a pointer to the binary representation then you should be OK.

An example would help to clarify your question.

permanent link

answered 04 Aug '11, 01:14

grahamb's gravatar image

grahamb ♦
accept rate: 22%

Hi Graham, I wanted to use the wireshark dissectors to dissect the packet in hex string format, which is something like this: 03b1682daa0980030e160b12950012042618061003020812060012045649734162 3f4804ba1411b66b1e281c060700118605010101a011600f80020780a1090607040 000010 002036c17a115020100020103a30d040825054373236300f50a0100 I have now found a temporary solution, which is to explore deeper in the tvb_get_uintX() function and modified slightly so that it only deals with the real_data parameter of the tvb, in which i hope is in the hex format. Thanks for your reply

Eddie Choo

(04 Aug '11, 19:15) eddie choo
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 04 Aug '11, 00:49

question was seen: 3,928 times

last updated: 04 Aug '11, 19:16

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