ASCII representation to uint for ProtoField
Hi folks,
I want to create a filter possibility. For strings it works perfect with: Protocol_Type = ProtoField.string( "MyProtocol.Type", "Type " ) Protocol.fields = { Protocol_Type } TreeNode:add_le(Protocol_Type, buffer( 9, 3 ) )
but how can I do it for ascii represented (uint) numbers to filter it as numbers, not as string:
0x30 0x32 0x33 0x34 -> ProtoField.uint16 = 234 (decimal)
0x30 0x30 0x30 0x30 -> ProtoField.uint16 = 0 (decimal)
The string representation have a fixed length of four bytes (0..9999)
TIA Matthias
I'm not a Lua programmer, so I can say for certain, but does bytearray:__tostring() help here? Get the byte array from the tvb then use this to get the string and add that as tree item?