Wireshark

  • Riverbed Technology
  • WinPcap
the world's foremost network protocol analyzer
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] tapping and access to fields

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 05 Jan 2007 10:45:33 -0800

Mikael Wikström wrote:

I'm trying to write a tap to calculate some statistics based on values
found in multiple frames in one or more packets. I want to be able to
access some values from the prism/radiotap, for example
radiotap.rate/prism.rate.data, and wlan.type_subtype from the wlan
frame. Writing a tap for the wlan protocol gives me a basic static
context with some useful generic wlan fields but how to I access the
other fields?

1. What is the best way of accessing a field from a frame that is not
in my static protocol dependent tap context?

I.e., how do you access the radiotap.rate/prism.rate.data and the wlan.type_subtype values for the current frame?

The only way to do that is to use the epan_dissect_t pointer handed to the tap's packet routine; the "tree" field points to the protocol tree. You'd have to dig the values out of the protocol tree by hand.

Another solution might be to have the radiotap and Prism dissectors supply to the 802.11 dissector, as private data, some of the radio information they see (along with a bitset indicating which of those values are present), and have the 802.11 dissector supply that to its taps (again, with the bitset, as there's no guarantee that any particular value is available).

2. How do I access (1) of the previous frame in my tap?

Wiretap does not itself provide anything to taps to let them get at any information about frames other than the frame currently being processed. Taps process frames sequentially, so you know that the frame you processed prior to the current frame is the previous frame; you could keep that value in the data structure pointed to by the "tapdata" argument.

  • References:
    • [Wireshark-dev] tapping and access to fields
      • From: Mikael Wikström
  • Prev by Date: Re: [Wireshark-dev] text file as input to wireshark
  • Next by Date: [Wireshark-dev] Wireshark 0.99.4 totally hangs XP Pro SP2
  • Previous by thread: [Wireshark-dev] tapping and access to fields
  • Next by thread: [Wireshark-dev] Problems compiling the cvs version
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation