ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] adding an encap_type_info element

From: Lange Jan-Erik <Jan-Erik.Lange@xxxxxxxxxxxxxx>
Date: Thu, 18 Nov 2010 13:28:59 +0100
Hello,
 
I want to dissect a packet that is not ethernet compliant. In the following I decribe the strategy to realize this.
Can you tell me where I'm wrong?
 
1. I have to add a new encap_type_info element to the encap_table_base[] struct in the wtap.c file.
 /* WTAP_ENCAP_MYPHYLAYER */
 { "My Phy Layer", "myphylayer" },
 
2. In the wtap.h file I have to add a new #define element, ie.
#define WTAP_ENCAP_MYPHYLAYER                    129
 
3. Now I can add the dissecor:
dissector_add("myphylayer", WTAP_ENCAP_MYPHYLAYER, myprot_handle);
 
Is this correct in general or are there points missing?
 
Best regards
Jan