I have a custom packet that can be encapsulated in a TCP/IP or Ethernet protocol. The problem im having is adding my heuristic dissector in at the lowest level so the TCP/IP and Ethernet sections of the packets are decoded by their respective dissectors first before coming to my dissector. If i use Is there any way to add my heuristic dissector in just before the "data dissector"?. I'm yet to find anything that lists all the different levels/types of heuristic dissectors....the only ones i've found are, "eth", "tcp", "udp" and a couple of others that haven't helped thanks in advance for the help asked 31 Jan '13, 14:46 StealthUE edited 01 Feb '13, 17:18 Guy Harris ♦♦ |
One Answer:
OK, then to dissect packets with an EtherType of 0x8819 with your dissector, and have the Ethernet dissector dissect the destination address, source address, and EtherType/length field and hand your dissector the Ethernet payload (i.e., the tvbuff handed to your dissector starts with the first byte of the payload, not the first byte of the destination address, and it includes neither the destination address, the source address, or the EtherType/length field), what you would do is:
As for whatever Cobranet-over-IP encapsulation you're using (Cirrus Logic seems pretty insistent that they don't use IP):
As for 0x8401, there's "registered" in the sense of "registered with the IEEE", which requires $2,825 US and possibly as much as 97 days (or more if they have questions), and there's "registered" in the sense of "registered in the "ethernet" table of Wireshark. Wireshark doesn't know, or care, whether you've registered an Ethernet type with the IEEE, although dissectors that register an EtherType value in the "ethertype" table when that EtherType value isn't "registered" with the IEEE might not be accepted into the official Wireshark source code base if submitted for inclusion. For that one, you'd make a call to answered 31 Jan '13, 17:59 Guy Harris ♦♦ edited 31 Jan '13, 18:05 you sir are a genius!. thanks heaps. I'll give this a go :). Ive read almost every bit of documentation on dissecting packets in wireshark and have yet to come across this information. thanks again...saved me heaps of time (31 Jan '13, 18:03) StealthUE
(31 Jan '13, 18:07) Guy Harris ♦♦ hey, this is what i have so far. It's not picking up the packets...not sure why
This is what my packet looks like [Dest. MAC Addr][Source MAC Addr][Cobranet packet identifier][0x84][0x01][DATA to process] any help is appreciated :) (31 Jan ‘13, 19:18) StealthUE hey Guy Harris, can you have a look at the code below and tell me what im doing wrong..thanks (31 Jan ‘13, 19:27) StealthUE i also tried changing the index values in tvb_get_guint8(tvb,INDEX) but it didnt change anything (31 Jan ‘13, 19:32) StealthUE
If by “Cobranet packet identifier” you mean 0x8819, then that’s the EtherType of the packet, not 0x8401, and it’s not capturing the packets because you didn’t do
so that your dissector will be called for an EtherType of 0x8819. (31 Jan ‘13, 20:30) Guy Harris ♦♦ ahhhhh, thanks man (31 Jan ‘13, 20:35) StealthUE showing 5 of 7 show 2 more comments |
Does your protocol have a specific Ethernet type value that you've either registered with the IEEE or are using despite that? If so, the right answer is not to use a heuristic dissector, but to register your dissector in the "ethertype" table using the Ethernet type value.
Cirrus Cobranet Packet. How would I go about registering the dissector in the "ethertype" table?. My protocol can come in as either an (1) ethernet packet->my protocol or (2) ethernet packet->ip packet->my protocol. Would registering it in the "ethertype" table cause my dissector to reject the second type?
"Ethernet II" isn't an Ethernet type value; I'm referring to EtherType values.
sorry my bad, i edited it but it must not have refreshed for you. Cirrus Cobranet Packet 0x8819
inside my protocol there is also another type thats consistently used, 0x8401 but it's not a registered ethertype value. Can you point me to an example that registers its own ethertype value??