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

Convert tvbuff_t* to unsigned char*

0

Is there a nice clean way to convert tvbuff_t to an unsigned char? I am using an external library for some decryption and it accepts the unsigned char*. I was looking through the Wireshark source code but only came up with:

struct tvbuff;
typedef struct tvbuff tvbuff_t;

Which doesn't give me enough information to be able to convert, that is unless I can simply do a byte for byte conversion?

Thank you for your time, Brandon

asked 26 Jul '11, 08:16

officialhopsof's gravatar image

officialhopsof
318812
accept rate: 100%

edited 29 Jul '11, 11:56

helloworld's gravatar image

helloworld
3.1k42041

Oh, also, I do not need the header information, I simply need the actual message data.

(26 Jul '11, 08:47) officialhopsof

One Answer:

5

See README.developer section 1.4.2 "Extracting data from packets".

Note the caveats around using functions such as tvb_get_ptr() though.

answered 26 Jul '11, 10:04

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Found it! Thanks!

(26 Jul '11, 12:24) officialhopsof
2

If this is the correct answer please click the tick so it shows as the accepted answer.

(27 Jul '11, 01:55) Jaap ♦