Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

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

From: Ahad L. Amdani <ahad.amdani@xxxxxxxx>
Date: Fri, 29 Sep 2006 13:21:02 +0000 (UTC)
LEGO <luis.ontanon@...> writes:

> 
> It depends in how you want the char:
> 
> - a one byte unsigned integer can be taken with u = tvb(offset,1):get_uint()
> - a string containing just one char (supposing it's printable) would
> be taken with str = tvb(offset,1):get_string()
> - a bytearray that contains just one char would be ba =
> tvb(offset,1):get_bytes()
>      the you can fetch the value of the first byte with ba[0]
> 

See, the problem lies that when I try and call get_string() or get_bytes(), 
LUA doesn't recognize them as functions. It recognizes string() and bytes(), 
but they don't seem to return anything - or at least, that I can throw out 
onto the screen.

I'm pulling a single, readable character (looking for a Y or an N) from the 
packet.