Ask Your Question
0

How to call dissector for IPv6 next header

asked 2019-03-27 17:48:05 +0000

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-03-27 18:43:59 +0000

grahamb gravatar image

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.

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

1 follower

Stats

Asked: 2019-03-27 17:48:05 +0000

Seen: 568 times

Last updated: Mar 27 '19