Ask Your Question
0

Facing error during loading of lua script

asked 2023-12-19 06:31:30 +0000

ofc gravatar image

updated 2023-12-19 08:17:43 +0000

grahamb gravatar image

Hi,

I am facing below error while loading my lua script :

Lua:Error during loading: .lua : 809: No such int32_t function/proper for object type 'ProtoFiled'
stack traceback:
 [C]: in function '_index' *.lua:809 in main chunk.

Below is highlighted line is 809:

local logControlresp = {
      LogControlresp = "LOGCONTRLRESPONSEStruct",
      **transId        = ProtoField.int32_t("RSYS_FAPI.logControlresp.transId", "transId"),**
      nStatus        = ProtoField.int32_t("RSYS_FAPI.logControlresp.nStatus", "paramCnt"),
}
logControlresp.transId,
logControlresp.nStatus,

function addPhyLogCtrlRespToTree(tvbuf, tree, offset, payLen, endianness)

    local info
    local PhyLogCtrlRespTree
    info = tvbuf:range(offset, payLen)
    PhyLogCtrlRespTree = tree:add(info, logControlresp.LogControlresp)
    info = tvbuf:range(offset, 4)
    PhyLogCtrlRespTree:add_packet_field(logControlresp.transId, info, endianness)
    offset = offset + 4
    info = tvbuf:range(offset, 1)
    PhyLogCtrlRespTree:add_packet_field(logControlresp.nStatus, info, endianness)
    offset = offset + 1


    offset = offset + THREE_BYTES_RESERVED    
end

Please help me to solve this error I am new to lua parser scripting and not getting solution to this online

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2023-12-19 17:21:52 +0000

Chuckc gravatar image

The _t types are for "C" code. There are examples of this in the Wireshark Developer’s Guide.

int32_t tag;
int32_t len1;

For lua code, see section 11.3.7. ProtoField:

11.3.7.11. ProtoField.int32(abbr, [name], [base], [valuestring], [mask], [desc])

Creates a ProtoField of a signed 32-bit integer.

local logControlresp = {
      LogControlresp = "LOGCONTRLRESPONSEStruct",
      transId        = ProtoField.int32("RSYS_FAPI.logControlresp.transId", "transId"),
      nStatus        = ProtoField.int32("RSYS_FAPI.logControlresp.nStatus", "paramCnt"),
}
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2023-12-19 06:31:30 +0000

Seen: 491 times

Last updated: Dec 19 '23