First time here? Check out the FAQ!
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 dissector for IPv6 next header

  • retag add tags

I am working on a Lua dissector for a new IPv6 hop-by-hop extension header we are developing in the IETF. See: https://tools.ietf.org/html/draft-hin...

I have gotten it to work to parse and display the header, but I don't know how to call the next dissector. It can be any IP protocol (TCP/UDP/etc.) as defined in https://www.iana.org/assignments/prot....

I can get it to work in a test case for UDP by using a static value:

     Dissector.get("udp"):call(buffer(aoptionlen):tvb(), pinfo, tree)

inside the function. How do I do this for the general case? I have the next header value in a variable.

Thanks in advance.

Bob

bobhinden's avatar
1
bobhinden
asked 2019-03-27 17:48:05 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Somewhat guessing, but maybe use dissectortable.get("ip.proto") to get the table of dissectors registered with ip, then use dissectortable::try() to call the appropriate entry from that table with the protocol value you have for the next header.

This is the Lua equivalent of what's done in the C IPv6 dissector.

grahamb's avatar
23.8k
grahamb
answered 2019-03-27 18:43:59 +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