ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] LUA Development Issue - Pulling a Character

From: Ahad L. Amdani <ahad.amdani@xxxxxxxx>
Date: Thu, 28 Sep 2006 15:48:27 +0000 (UTC)
Ahad L. Amdani <ahad.amdani@...> writes:

> 
> Hello,
> 
> I'm doing some extension development on Wireshark through LUA and I can't 
seem 
> to find out how to pull just a single character from the packet. The packet 
is 
> encoded in little endian format, so I can use the tvbrange:le_uint and 
> tvbrange:le_float functions to pull those types of values, but there doesn't 
> seem to be a tvbrange:char() -- there is a tvbrange:string() but it doesn't 
> work correctly, or at least, in my experience. I also tried the bytes() and 
> tried to print out the bytearray, but that didn't work either.
> 

I've just read that LUA also supports calling functions written in C. Is there 
a C-based function pre-defined that takes specified amount of bytes or 
characters from the packet? Possibly one that assumes little endian format, 
such as the le_uint() and le_float() functions?

Thanks in advance,
  Ahad