I’ve moved the python-radiotap module into a Google Code hosting project, mainly because I wanted to play with the service and python-radiotap seemed like a good reason to do so.
The project can be found at http://code.google.com/p/python-radiotap/
Enjoy.
April 14th, 2007
Here’s a little bit of code I wrote recently to parse Radiotap headers in Python. It’s pretty simple, you get two methods, get_length(buf) and parse(buf).
get_length(buf) takes a string holding a radiotap header and returns the recorded length of the radiotap header. Use this method to determine where the next protocol header starts in your buffer.
parse(buf) takes the same string and returns a dictionary mapping the RTAP_* constants defined in the radiotap module to the values recorded in the radiotap header. This dictionary will only contain the keys that are present in the radiotap header, so you can use things like has_key(radiotap.RTAP_ANTENNA) to see if the radiotap header contained antenna information.
Just note that all values are passed back as they are read, so they will all be little-endian, as this is what Radiotap is encoded in.
radiotap parser for python.
February 19th, 2007