ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] How to show ip address by Lua in wireshark

Date: Tue, 24 Nov 2009 15:01:07 -0500
In Lua, userdata is a different type from a string.  The %s tells Wireshark to expect a string, but the ipv4() method returns a specialized format that is not necessarily printable.

To print the address in the display tree, you need to find a way to convert those bytes to a string, or else find a different datatree:add() method that accepts the ipv4 format data.  (If you can find the latter, that would be the better solution.)

BTW, you may need to upgrade to a newer version than 1.1.1 to get all the latest Lua functionality.

b.