This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

2 protocols in a same code?

0

I have a protocol such that there is a x header and y header. How can i have these headers under a single packet-xyz.c file? It should look something like this .. IP TCP X Y

asked 27 Mar '11, 02:21

niks3089's gravatar image

niks3089
21151518
accept rate: 0%


One Answer:

0

Write two separate dissectors, and put the source to both of them in the packet-xyz.c file. Have the dissector for protocol X call the dissector for protocol Y, when appropriate. The only difference between this and having two dissectors in different source files is that you put them both in the same source file. (Using a single dissector for both protocol layers is the wrong way to do it.)

answered 27 Mar '11, 14:50

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%