I have a simple MAC layer protocol that wraps IPv6. I have captured some frames (text) and converted them using text2pcap.exe and the user defined link layer option DLT_USER0. Next, I followed directions here and added my 'SimpleMAC' protocol as follows: However, I want to add a Lua dissector to view the MAC details. Setting my Lua dissector to the correct wtap_encap dissector table entry, I can now see my 'SimpleMAC' protocol dissected, but I can no longer see the details for the IPv6 packet: How can I do this so I can see both? Here is the code for my Lua dissector:
asked 21 Nov ‘14, 10:42 littleman edited 21 Nov ‘14, 10:43 |
One Answer:
When you use a Lua script to create a new protocol and dissect a packet as it, Wireshark has no idea what other protocol(s) might be after your new protocol in the packet. So when you did this:
You told Wireshark to use your Lua-based When you instead add a user DLT entry to the DLT table in the preferences, as you did at the beginning, you told wireshark not only what your encapsulation info is for USER0, but also that the payload's protocol after it is IPv6. So when wireshark does it that way, it worked. So to do the same thing in Lua, at the end of your To call a built-in dissector, first you need to get it using So like this:
answered 23 Dec ‘14, 23:32 Hadriel Thanks, that worked like a charm! (29 Dec ‘14, 08:33) littleman |
Interestingly, I’ve found that when I modify the Lua dissector to add the Simple MAC protocol back to the wrong value ( wtap_encap_table:add(46,oProtoSimpleMac) ), Wireshark dissects both the Simple MAC and the IPv6 packet.
The problem now is, if the frame contains only MAC information (no, payload with IPv6), I get a Malformed packet error and ‘IPv6’ appears in the Protocol Column:
How do I make it stop at the Simple MAC layer if there is no additional data?