THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

How to call lua dissector from C dissector?

I want to write a lua dissector that i can call from a dissector written in C in wireshark.

I want to be able to call the lua dissector as following in the C dissector.

static dissector_handle_t gtp_tpdu_custom_handle;
gtp_tpdu_custom_handle = find_dissector("gtp_tpdu_custom");
if (gtp_tpdu_custom_handle) {
    call_dissector(gtp_tpdu_custom_handle, tvb, pinfo, tree);
}

I want to write a lua dissector and register as "gtp_tpdu_custom" that I can call from C dissector.

How can i achieve it?

ranjeetsih's avatar
1
ranjeetsih
asked 2021-03-17 14:33:25 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

a dissector as following is working fine.

local gtp_tpdu_custom = Proto.new("gtp_tpdu_custom", "BNG GTP Custom Demo dissector")

function gtp_tpdu_custom.dissector(buffer, pinfo, tree)
end
ranjeetsih's avatar
1
ranjeetsih
answered 2021-03-17 16:04:47 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer