Reputation: 343
I am looking for network protocol structure definitions in structured machine readable form, like xml, json or an other description language I'm currently not aware of. (e.g. yaml)
I'm talking here about the standard stuff: Ethernet, IP, TCP, UDP, ICMP, etc. and everything else that can run through a network [cable and wireless]. Everything that can be sniffed with wireshark for example.
What I need for my upcoming project are all these protocol definitions in machine readable form, I do not care about in which clothing these definitions come along, I just need them.
Searching the 'interwebs' for such a "universal protocol structure definition" is like to look for a needle in a haystack and throws up everything, but that what I'm looking for.
I even cursorily checked the available code of wireshark in the hope to find something usable. (Which was not the case or I weren't looking deep enough...)
Does none exist and do I have to invent a new schema for the task?
Or does it just hide before my eyes in hours of search?
Thanks in advance, experts of stackoverflow. :)
[Edit:] Some further clarification:
I know that Linux, Windows and OSX have got headers for all basic protocols, but I want to omit platform dependend code. It would be enough for the standard and most used parts (Eth, ARP, IP, TCP, UDP, ICMP, etc.), but why programming and building up much more dependencies to libraries which support more seldom used protocols, when you can use ONE machine readable format within you are able to have ALL protocols defined? (It's possible that this is just a great dream of mine...)
Rules are not important, I need the basic structure and field definitions with an optional description what the field data is for.
You could call it a protocol dictionary... and I just cannot believe that no one else has had this idea already, that's why I'm asking this question!
Program-language independence is important, not particularly for my project (C++/Qt), but for everyone else who is interested in such a dictionary.
Upvotes: 4
Views: 332
Reputation: 343
Because I were not able to find a dictionary for network protocols, I started one.
See: https://github.com/qwc/network-protocol-dictionary
At the time of writing the answer the dictionary is nearly as old as my question and because of some lack of time the repository is still in a very rough state. But it will grow with time. :)
Upvotes: 1
Reputation: 30285
How about Java code? It has the benefit of being platform independent.
For instance take a look at JNetPcap. It's an open source Java wrapper for libpcap.
It has all kinds of pure Java packet decoders for a a wide range of protocols. Package org.jnetpcap.protocol
contains the header definitions of each of the supported protocols (e.g. org.jnetpcap.protocol.network.Ipv4
). You can use these out of the box, or extend them.
Upvotes: 0