lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I have written LUA scripts which dissect proprietary packets from network. I had written the lua scripts as

-- declare our protocol
InDirectnip_proto = Proto("INIPD","NIP","NIP Messages")

-- create a function to dissect it
function InDirectnip_proto.dissector(buffer,pinfo,tree)
    pinfo.cols.protocol = "INIPD"

-- load the udp.port table
udp_table = DissectorTable.get("udp.port")

-- register caicd direct mip protocol to handle udp port 50019

I need help to get the following

a) How can I get the source ip address of packets in this script file

I tried to get the ip address as


but i got the error "A Field extractor must be defined before Taps or Dissectors get called" in wireshark. Please help me how to define extarctor before dissectors gets called.

b) is there any way to register multiple udp port in single lua file?

Thanks in Advance