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

error: implicit declaration of function ‘tvb_get_guint16’

0

Getting following error while make :

error: implicit declaration of function 'tvb_get_guint16'

error: implicit declaration of function 'tvb_get_guint24'

What library i will have to include to fix this ?

asked 10 Jun '12, 09:10

yogeshg's gravatar image

yogeshg
41222326
accept rate: 0%


One Answer:

0

You are calling a function that does not exist, hence the error message. In tvbuff.c only tvb_get_guint8() is defined.

What are you trying to do? Please post the part of your code, where you call those functions.

Regards
Kurt

answered 10 Jun '12, 10:32

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

actually i was trying to read 16 bits or 24 bits , and i googled and found these functions used in some dissector by someone. Anyways i have fixed it now , i am using "tvb_get_ntohs" and "tvb_get_ntoh24". Anyways thanks for reply.

(10 Jun '12, 10:42) yogeshg

Yes. For an 8-bit quantity, "big-endian" ("host byte order") and "little-endian" are the same, but for any integral quantity bigger than 8 bits, the byte order matters. If there were tvb_get_guint16() or tvb_get_guint24() or... routines, they would have to take an argument specifying the byte order; Wireshark, instead, has separate routines to fetch big-endian (tvb_getntoh...) and little-endian (tvb_getletoh...) values.

(10 Jun '12, 15:02) Guy Harris ♦♦