Commit Graph

50 Commits

Author SHA1 Message Date
Guy Harris 2c0d11716b Fix VHT valid checks.
The valid array in a struct mcs_vht_valid is indexed by the bandwidth
and the NSS-1; use the NSS-1, not the NSS, as the index.

The maximum possible value of the NSS is MAX_VHT_NSS, so allow a value
of MAX_VHT_NSS.

Change-Id: I49585f217f3e70356c1dd1ba32b6c714ce202236
Reviewed-on: https://code.wireshark.org/review/16426
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-14 03:13:56 +00:00
Michael Mann 90e97df313 packet-ieee80211-radio.c: Prevent array overflow.
Found by VS Code Analysis.

Change-Id: Idab6cb5496749ebff47466b20a9a665b1574565d
Reviewed-on: https://code.wireshark.org/review/16421
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-14 02:44:40 +00:00
Pascal Quantin 52ab7bb941 802.11 radio: fix an out of bounds access
Bug: 12571
Change-Id: I4dafdd9bdec5acddf346fd2db6a06d9dfabcbb2e
Reviewed-on: https://code.wireshark.org/review/16228
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-30 21:41:18 +00:00
Guy Harris 497159f372 Check for an invalid 11ac MCS/bandwidth/NSS combination.
A few of the combinations are marked as "Not valid" in 802.11ac-2013.

Ping-Bug: 12558
Change-Id: I18b78ebb84ab32a6fc53c6d634ef07ae87fb4866
Reviewed-on: https://code.wireshark.org/review/16153
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-26 20:45:22 +00:00
Joerg Mayer 3b7d139708 Cisco WIDS wlan frames as sent by standalone APs do not include the QoS control
stuff.

Bug: 12421
Change-Id: Idc56bd573b72465e36c8141d3c0736b286ff220a
Reviewed-on: https://code.wireshark.org/review/15448
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-05-20 17:45:53 +00:00
Michael Mann 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +00:00
Guy Harris ce6ac9e822 And we need to check Nsts as well.
The check against 0 isn't really necessary, as stbc_streams >= 0 and
ieee80211_ht_streams[info_n->mcs_index] >= 1, but, what the heck.

Make stbc_streams unsigned, as the value assigned to it is unsigned.

Bug: 12085
Change-Id: I98e0edb718f62ee07bbe56b9d15859c68b7d2e43
Reviewed-on: https://code.wireshark.org/review/13844
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-09 02:23:22 +00:00
Guy Harris 2ecb5a9d52 Check whether Ness is valid as well.
It's also used as an array index, and it also is no guaranteed to be in
the proper range in all capture files, so bounds-check it.

Make the variable's type match that of the field in the radio metadata.
(It's never negative, so it's unsigned.)

This appears to be the last of the unchecked array references from bug
12085.

Bug: 12085
Change-Id: I3e5b821a9b70dfd520d01036f6f7d02008aca200
Reviewed-on: https://code.wireshark.org/review/13806
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-07 20:52:20 +00:00
Guy Harris 8a7b5efd84 MAX_MCS_INDEX is a valid array index.
The arrays have MAX_MCS_INDEX+1 entries; valid indices to from 0 to
MAX_MCX_INDEX.

Change-Id: Ibbd30d36cc16143482b34212b1c6ce8df9e555ab
Ping-Bug: 12085
Reviewed-on: https://code.wireshark.org/review/13805
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-07 20:47:38 +00:00
Guy Harris 949c84f46d MAX_MCS_INDEX is a valid array index.
The arrays have MAX_MCS_INDEX+1 entries; valid indices to from 0 to
MAX_MCX_INDEX.

Change-Id: Ib8b939e687a00505cab5e5f9b3b6dce34e9d0b47
Reviewed-on: https://code.wireshark.org/review/13803
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-07 19:33:04 +00:00
Guy Harris 485af0aa41 Check whether mcs_index is sane, not just whether it's set.
Don't just check whether we *have* the MCS index, check whether it's a
valid MCS index, before we use it in calculations.  Otherwise, we'll
make out-of-bounds array accesses.

(May or may not fix bug 12085, so just Ping-Bug for now.  It's necessary
in any case.)

Change-Id: I7119366397b260089aea35ae9fcd5ad9ec6b06f2
Ping-Bug: 12085
Reviewed-on: https://code.wireshark.org/review/13790
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-06 08:43:42 +00:00
Simon Barber 640209215e Adds calculation of preamble length and frame duration.
Change-Id: Ie7077b675a242a60ee859098a504707cc61345db
Reviewed-on: https://code.wireshark.org/review/13090
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-03 05:58:05 +00:00
Guy Harris 72a9a43933 Add A-MPDU reassembly information to the radio metadata.
Change-Id: I338e7fb60ff62d1d26ca0b32468ada4294d52d8d
Reviewed-on: https://code.wireshark.org/review/13594
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-29 07:56:28 +00:00
Guy Harris 94f499bb11 dBm signal strength is signed; report it as such in the RSSI column.
Change-Id: Ifc0516f0229a7bedd953e9a81beb300df1c4208c
Reviewed-on: https://code.wireshark.org/review/13113
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-07 21:09:33 +00:00
Alexis La Goutte 30f378a373 802.11 (radio): fix no previous prototype for function 'ieee80211_vhtrate' [-Wmissing-prototypes]
Change-Id: I863668e98de1eaeff8e2360070881fffc972ad8a
Reviewed-on: https://code.wireshark.org/review/12916
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-30 05:26:53 +00:00
Simon Barber ec6fa1a8a0 Refactor VHT rates table, to use Ndbps (number of data bits per symbol)
to calculate rate. This will enable calculation of FEC rounding precisely
later on.

Change-Id: If7dcee39e12db208636fc8a90bfd784ffbea723c
Reviewed-on: https://code.wireshark.org/review/12857
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-25 02:44:59 +00:00
Simon Barber 8fa7e2fb34 Refactoring: Use data bits per symbol MCS table to calculate rates and
remove redundant HT MCS/rate table. Preparation for duration calculations
that will use this data as well.

Change-Id: Iee4fb2eefb00eaa53a6368eca4ed60f705ff49df
Reviewed-on: https://code.wireshark.org/review/12856
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-25 02:44:30 +00:00
Simon Barber ffa9e938e2 Refactor 802.11 radio flags.
The use of a flag field here is aesthetically unpleasing when the flags
are referred to frequently. Convert these into bitfield entries.

Change-Id: I6f47e31558439dfd343ec7f856d04480366a1237
Reviewed-on: https://code.wireshark.org/review/12511
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-24 07:58:51 +00:00
Guy Harris 021a695e62 Consistently use spaces rather than tabs.
Change-Id: I9761b7ce0eb42c3b6dc39bd01179c302b2233e91
Reviewed-on: https://code.wireshark.org/review/12540
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-11 19:10:20 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michael Mann 10261d1202 Remove manual setting of pinfo->current_proto.
Calling a protocol dissection function will properly set/restore pinfo->current_proto, so there's no need to duplicate it.

Change-Id: Ic2ec0b35fa4d46a98f3410bf238056425076e4a9
Reviewed-on: https://code.wireshark.org/review/12205
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-27 05:00:37 +00:00
Guy Harris e988e1c764 Wrong field name for signal strength as a percentage.
Copy-and-pasteo.

Change-Id: I42ba4f172f9b837f01d3b30f2d14e7ee066f3e83
Reviewed-on: https://code.wireshark.org/review/12203
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-26 20:01:22 +00:00
Dario Lombardo cd76cf6df8 ieee802.11: changed blurb to stop checkAPI complains.
Change-Id: I9ec74a7af229a1af3ca946acc5af94ede1913c29
Reviewed-on: https://code.wireshark.org/review/10016
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-08-13 16:02:38 +00:00
Guy Harris 53fcaabe66 Use the NSS provided by the Ixia Veriwave hardware.
It doesn't appear to provide the FEC type, although radiotap does, so
add a flag to indicate whether we have that.

Change-Id: I298d79bc6b640ee2408c3d70075c32bf331a210c
Reviewed-on: https://code.wireshark.org/review/9533
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-07-07 07:40:31 +00:00
Guy Harris b9145bc836 "Short preamble" is 802.11[bg]-only, so put it in the PHY-specifc info.
We're already only setting it for 11b and 11g; this makes it a bit
cleaner, e.g. we don't need to say "oh, wait, we *don't* have short
preamble" for 11n and 11ac.

Change-Id: Idcf3e8c93d6a417f0319e4bd33247b98f07b6052
Reviewed-on: https://code.wireshark.org/review/9209
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-28 19:44:07 +00:00
Guy Harris 2762995316 If we don't know whether STBC is being used, we don't know NSTS.
If we don't know whether space-time block coding is being used, we don't
know the number of space-time streams, so don't try to calculate it and
don't put it into the protocol tree.

Change-Id: I7ffd1b0e79e45fee526305846aadca04eb135b11
Reviewed-on: https://code.wireshark.org/review/9205
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-28 16:51:52 +00:00
Guy Harris 5c438e1e05 Those aren't booleans, they're counts of streams.
Change-Id: Id0520da614f239d3146f5c03ef1a930e8a0fcd94
Reviewed-on: https://code.wireshark.org/review/9184
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-26 21:27:53 +00:00
Guy Harris 0f42ed0522 Squelch a compiler warning.
It's a bogus warning, but not all compilers do enough dataflow analysis
to figure that out.

Change-Id: Iebc1fffab87e83b16210003b60aae2333e0b5ec9
Reviewed-on: https://code.wireshark.org/review/9179
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-26 19:32:17 +00:00
Guy Harris 78adf17850 Fix handling of 11ac radio metadata.
Add more fields to the metadata to handle everything radiotap has, and
show them.

Call the FEC type field just "FEC", and have it be an integer field with
0 meaning BCC and 1 meaning LDPC, rather than a Boolean.

11ac doesn't have *an* MCS, it can have up to 4, one per user.

Label the 11ac bandwidth values the same way we do in the radiotap
dissector.

Change-Id: I2c2415baff3e5d68d49dda497980e8271d26b1f6
Reviewed-on: https://code.wireshark.org/review/9176
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-26 18:29:08 +00:00
Guy Harris f1bc598d87 Clean up 802.11 radio information handling.
Have a field that holds the PHY type but nothing else.  Have
a union with structures holding PHY-type-specific information, as a
bunch of attributes are PHY-specific.

If we have a channel and band, but don't have the frequency, attempt to
calculate the frequency, and add that to the radio information if we
succeed.  If we have the frequency, but don't have the channel, attempt
to calculate the channel, and add that to the radio information if we
succeed.

Handle FHSS information, 11a "half/quarter-clocked" and turbo
information, 11g normal vs. Super G, additional 11n and 11ac
information, and the "short preamble" flag for 11b and 11g.

Add a PHY type for 11 legacy DSSS and detect it if possible.

Clean up the AVS dissector - make all fields wlancap. fields (if you
want generic fields, use the wlan_radio. fields).

Set more fields when writing out Commview Wi-Fi files.

Change-Id: I691ac59f5e9e1a23779b56a65124049914b72e69
Reviewed-on: https://code.wireshark.org/review/9146
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-25 19:15:56 +00:00
Guy Harris ad784bc7ce Put the frequency/channel and RSSI data into columns.
Change-Id: I039e727aff46c08b93908a216608e196ed4bd662
Reviewed-on: https://code.wireshark.org/review/9080
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-24 00:21:51 +00:00
Guy Harris 8aa91b31b9 Provide PHY type and band information in the 802.11 pseudo-header.
Provide that information so that the "802.11 radio information" protocol
can indicate whether a packet was 802.11 legacy/11b/11a/11g/11n/11ac,
and possibly whether it's 2.4 GHz or 5 GHz 11n.  (Sometimes the center
frequency might not be supplied, so the band information can be useful.)

Also, provide some 11ac information, now that we can distinguish between
11n and 11ac.  Don't calculate the data rate from the MCS index unless
it's 11n; we don't yet have code to calculate it for 11ac.

For radiotap, only provide guard interval information for 11n and 11ac,
not for earlier standards.

Handle the 11ac flag in the Peek remote protocol.

For Peek tagged files, the "extension flags" are 11n/11ac flags, so we
don't have to check for the "MCS used" bit in order to decide that the
packet is 11n or 11ac or to decide whether to provide the "bandwidth" or
"short GI" information.

Change-Id: Ia8a1a9b11a35243ed84eb4e72c384cc77512b098
Reviewed-on: https://code.wireshark.org/review/9032
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-22 22:05:17 +00:00
Guy Harris 2895d58dc3 Call the "802.11 radio information" dissector for radio headers.
Have dissectors of various forms of radio information headers in the
packets fill in a struct ieee_802_11_phdr with radio information as
appropriate, and call the "802.11 radio information" dissector rather
than the raw 802.11 dissector.

This means that the radio information can be found in a
protocol-independent and encapsulation-independent form when you're
looking at the packet; that information can be presented in a form
somewhat easier to read than the raw metadata header format.

It also enables having a single "radio information" tap that allows
statistics to handle all different sorts of radio information
encapsulation.

In addition, it lets us clean up some of the arguments passed to the
common 802.11 dissector routine, by having it pull that information from
the struct ieee_802_11_phdr.

Ensure that the right structure gets passed to that routine, and that
all the appropriate parts of that structure are filled in.

Rename the 802.11 radio protocol to "wlan_radio", rather than just
"radio", as it's 802.11-specific.  Give all its fields "wlan_radio."
names rather than "wlan." names.

Change-Id: I78d79afece0ce0cf5fc17293c1e29596413b31c8
Reviewed-on: https://code.wireshark.org/review/8992
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-20 23:02:21 +00:00
Guy Harris d9b36c46d0 Pass the 802.11 pseudo-header as an argument.
Rather than accessing it through pinfo->pseudo_header, have it passed as
an argument.

This means we no longer tweak the pseudo-header filled in by libwiretap,
but instead construct our own pseudo-header, which is a bit cleaner.

It also opens up the possibility of other dissectors passing radio
information down to the 802.11 dissector, so it can display it in a
better-organized format than the raw metadata headers for
radiotap/PPI/Prism/AVS/etc., and having some of the options for 802.11
dissection (Atheros padding, Centrino stuff, etc.) also passed in
through that pseudo-header so we have fewer arguments to
dissect_ieee80211_common().

Change-Id: I470300a0407ebf029c542f7ca5878593563a70a9
Reviewed-on: https://code.wireshark.org/review/8980
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-06-18 20:13:50 +00:00
Bill Meier 9c866ff971 Replace tabs by spaces when editor modelines has "expandtab"
Change-Id: If7a6f2697be732ae4f94ed8b845fd293c32510f7
Also: tabs-stops should be 8
Reviewed-on: https://code.wireshark.org/review/7100
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-02-13 17:34:53 +00:00
Guy Harris a683dd3edf Make the data rate field float, and calculate it for 802.11n.
Bug: 10637
Change-Id: Ifd4094f308246e92500cc7149c0d42c8496fb9f4
Reviewed-on: https://code.wireshark.org/review/5005
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-30 19:14:21 +00:00
Guy Harris ec33c3dfe7 Support the bandwidth and "short GI" fields from Peek tagged files.
Add a number of fields corresponding to components of the radiotap MCS
field, add presence bits for them, and set and dissect the fields
supported by Peek tagged files.

Change-Id: I3fc801a3bc180e1c174d074a794af0f3d338f249
Reviewed-on: https://code.wireshark.org/review/4989
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-30 06:53:01 +00:00
Guy Harris aff087af98 Handle the MCS index in Peek tagged files.
Use the "MCS index used" extended flag bit to indicate whether the "data
rate or MCS index" field is a data rate or MCS index.

Display the MCS index value if it's present.

(More to come - MCS indices, plus other information, should be used to
calculate the data rate for 11n and beyond.)

Get rid of the hdr_info_t structure while we're at it; just use local
variables for each of the fields.

Change-Id: I546f53a8ebd89078d5f23e1290557b97348aff38
Reviewed-on: https://code.wireshark.org/review/4988
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-30 00:09:25 +00:00
Guy Harris 8165448504 Expand the 802.11 pseudo-header and support new radio metadata.
Add a set of presence bits, so we can indicate which bits of radio
metadata we do and don't have.

Fill in more radio metadata from capture files, and display it.

(More to come.)

Change-Id: Idea2c05442c74af17c14c4d5a8d8025ab27fbd15
Reviewed-on: https://code.wireshark.org/review/4987
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-29 23:04:05 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Jakub Zawadzki 82e2675f45 Avoid including <wiretap/wtap.h> in dissectors.
svn path=/trunk/; revision=53655
2013-11-29 20:53:00 +00:00
Michael Mann ffaeb8a433 Convert proto_tree_add_uint64_format calls to proto_tree_add_uint64_format_value where appropriate.
svn path=/trunk/; revision=52299
2013-09-30 15:52:24 +00:00
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Guy Harris 9ad02809f2 Put in a comment explaining what the signal strength value probably
means here.

svn path=/trunk/; revision=47665
2013-02-15 00:43:04 +00:00
Guy Harris 58a2320b89 Show the signal strength as a percentage in the RSSI column, as that's
what it is.

svn path=/trunk/; revision=47663
2013-02-14 22:38:50 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Anders Broman 3e9d852a1b From Jouni Malinen:
Move sniffer meta data parsing to separate files

packet-ieee80211.c includes dissectors for three different styles
of IEEE 802.11 sniffer meta data (like signal strength). Move these
to separate files in the same style as a fourth format (radiotap)
was already handled, so that packet-ieee80211.c focuses on the
actual IEEE 802.11 frame dissecting.

This reverts
http://anonsvn.wireshark.org/viewvc?revision=23911&view=revision
Objections?
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6443

svn path=/trunk/; revision=39379
2011-10-12 05:08:51 +00:00