Commit graph

545 commits

Author SHA1 Message Date
Guy Harris
e4756ccacf Comment cleanups.
Remove some more 802.11i references, and replace a reference to the
"WEP" bit with a reference to the "Protected" bit.

Change-Id: I77b50af2b34e2bdc4c21af29b54627ed19219090
Reviewed-on: https://code.wireshark.org/review/821
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-25 03:20:12 +00:00
Guy Harris
4038fa9b0a IEEE 802.11i is dead; long live IEEE 802.11-2012.
802.11i was absorbed into a revision of the 802.11 spec, so speak of
"IEEE 802.11 RSNA EAPOL"/"wlan_rsna_eapol" until somebody comes up with
a better name for it.

Also, add in one more key flags bit that's in 802.11-2012 but not
802.11i-2004.

Change-Id: Ia825f7466f3b3d159706eb681546b5bbb4e066bf
Reviewed-on: https://code.wireshark.org/review/820
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-25 03:08:03 +00:00
Guy Harris
2d7828794c Add a dissector table for EAPOL Key Descriptor types.
Instead of having a switch statement in the EAPOL dissector for Key
Descriptor types, have a dissector table, and:

	have the EAPOL dissector register with a dissector for the RC4
	type;

	have the 802.11 dissector register with dissectors for WPA and
	RSN types.

This means that ieee_80211_add_tagged_parameters() no longer needs to be
public; make it static.

Change-Id: I68e0592c3ea055c693d6d5d5a9eb88634ea37a95
Reviewed-on: https://code.wireshark.org/review/800
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-23 19:18:51 +00:00
Guy Harris
2a6e50ca7d Clean up white space.
This makes the code's if/then/else bracketing clearer.

Make the if/then/else style more consistent in one case, which also helps.

Change-Id: I7c765b761d92c6710461181b3e3ccd77d2a40f83
Reviewed-on: https://code.wireshark.org/review/799
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-23 18:45:07 +00:00
Hadriel Kaplan
296bc0b2a9 Fix Bug 9909 Buildbot crash correctly
Fixed a null de-reference in packet-ieee80211.c caused by change-id
I742726027bcab7d25ca4a9ce3a406518db6d272f, commit g4b8b83407ac744d114462235a8bcca0d480954c7.

See Bug 9909 for details.

Change-Id: I7189476faee3ae6ab34fb52c1564ac668496679a
Reviewed-on: https://code.wireshark.org/review/780
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-22 07:55:56 +00:00
Alexis La Goutte
da83eadf5e Enhance Neighbor report
Closed-bug: 9724

Change-Id: Id6aefcddf5bd8bd490296e84351152808c03004a
Reviewed-on: https://code.wireshark.org/review/731
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-21 21:56:43 +00:00
Hadriel Kaplan
9c5f199050 Fix bug 9909 Buildbot crash - but only to stop the crashing
This fixes the crashing on buildbot, but only in the sense that
it now calls DESSECTOR_ASSERT_NOT_REACHED() for the case that's
causing the crash - which is a null dereference, due to something
going wrong in add_tagged_field() of packet-ieee80211.c.

I don't know what the right thing to do is, but at least this
gets buildbot going again. (that file is over 25k lines!)

Change-Id: I1658944f9704a071dffc7f4834b9294fffc0e7ba
Reviewed-on: https://code.wireshark.org/review/757
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-21 04:58:15 +00:00
Alexis La Goutte
d35ccc5cdf Try to fix Mac OS X Buildbot
packet-ieee80211.c:8583: warning: integer constant is too large for 'long' type
packet-ieee80211.c:8584: warning: integer constant is too large for 'long' type
packet-ieee80211.c:8585: warning: integer constant is too large for 'long' type

Change-Id: I5badc6e0d2595d4353e33cd273d55f28737b34a8
Reviewed-on: https://code.wireshark.org/review/737
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 12:53:54 +00:00
Alexis La Goutte
8c3dee9bc9 Fix warning/error found by CheckAPI
(and fix also fix-encodings-args)

Change-Id: Ic2e99ca02398b7525b1cf68ab0d8279a2909940e
Reviewed-on: https://code.wireshark.org/review/736
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 12:53:43 +00:00
Alexis La Goutte
7bbb3ac24d Try to make Mac OS X buildbot Happy
packet-ieee80211.c:8581: warning: implicit conversion shortens 64-bit value into a 32-bit value
packet-ieee80211.c:8582: warning: integer constant is too large for 'long' type
packet-ieee80211.c:8583: warning: integer constant is too large for 'long' type
packet-ieee80211.c:8583: warning: implicit conversion shortens 64-bit value into a 32-bit value
packet-ieee80211.c:8584: warning: integer constant is too large for 'long' type
packet-ieee80211.c:8584: warning: implicit conversion shortens 64-bit value into a 32-bit value

Change-Id: I8f8c5518239c7d6e55006abfca8d9452f9a09c6a
Reviewed-on: https://code.wireshark.org/review/733
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 11:50:48 +00:00
Moraney Jalil
4b8b83407a Support for IEEE 802.11ad
(according to the 9th draft of the standard)

Closed-bug: 8594

Change-Id: I742726027bcab7d25ca4a9ce3a406518db6d272f
Reviewed-on: https://code.wireshark.org/review/632
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-19 11:18:33 +00:00
Alexis La Goutte
66d0b1893a Fix some typo on 802.11 dissector
(Found by Jalil Moraney in change to add 802.11ad support review 632)

Change-Id: I547bf647ae7400633ad27c7849088fd088928075
Reviewed-on: https://code.wireshark.org/review/708
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-17 12:57:57 +00:00
Bill Meier
4fbcfc1289 (Benign) Don't use "address-of" operator on arg of VALS() (not that it makes any actual difference)..
Change-Id: I0766d0f130648aaa5a58d9f4062fa24e898cbdc3
Reviewed-on: https://code.wireshark.org/review/545
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-07 05:03:41 +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
Alexis La Goutte
34933eb805 802.11 : Add channel number custom (to display info when report channel number is 0 or 255)
Fix also indent for other custom...

Change-Id: Ic95b65d5217a0d1e967892ac2694f3ba749242fb
Reviewed-on: https://code.wireshark.org/review/379
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 20:16:14 +00:00
Alexis La Goutte
f5ebc083c6 802.11: Regulatory Class => Operating Class (changed in 802.11-2012)
Fix also typo for hf_ieee80211_tag_measure_request_regulatory_class wrong hf name...

Change-Id: I49e582c7683e58abb8785958dcc043789fd79a26
Reviewed-on: https://code.wireshark.org/review/378
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 20:15:53 +00:00
Bill Meier
93fe4d53e2 Remove trailing whitespace.
Change-Id: Ia03a1cd4590aceda30ead4aa93ad413d90c6aea6
Reviewed-on: https://code.wireshark.org/review/372
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 16:36:38 +00:00
Alexis La Goutte
d3e03e97f0 Fix packet-ieee80211.c:13115:7: error: will never be executed [-Werror,-Wunreachable-code]
Change-Id: I0a87e6a2e9a819148a816ad1bc9da008b8cc1518
Reviewed-on: https://code.wireshark.org/review/324
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-25 15:37:53 +00:00
Alexis La Goutte
53deb521e7 Neighbor report (802.11k) may be have no subelement (len == 13)
Fix some malformed frame from sample on Bug 9724

Change-Id: I0874c2aab57799426f13e18123b05a7e73c6a75f
Partialy-Bug:9724
Reviewed-on: https://code.wireshark.org/review/340
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-25 05:57:17 +00:00
Gilbert Ramirez
4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of
having each caller cast its private data to (void**), we use void*
in the uat_new() API itself. Inside uat_new(), we cast the void*
to void**.

Some dissectors use val64_string arrays, so a VALS64() macro was
added for those, to avoid using VALS(), which is useful only for
value_string arrays.

packet-mq.c was changed because dissect_nt_sid() requires
a char**, not a guint**. All other callers of dissect_nt_sid() use
char*'s (and take the address of it) for their local storage. So,
this was changed to follow the other practices.

A confusion between gint and absolute_time_display_e in packet-time.c
was cleared up.

The ugliest fix is the addition of ip6_guint8_to_str(), for exactly
one caller. The caller uses one type of ip6 address byte array,
while ip6_to_str() expects another. This new function is in place
until the various address implementations can be consolidated.

Add VALS64() to the developer documentation.

Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805
Reviewed-on: https://code.wireshark.org/review/48
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 09:26:10 +00:00
Evan Huus
a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Jakub Zawadzki
c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Bill Meier
ebaeed5a1f (Trivial)
- Fix indentation to match editor modelines (tabs-->spaces);
 - Rework/add some whitespace;

svn path=/trunk/; revision=53978
2013-12-12 20:16:30 +00:00
Jakub Zawadzki
3ae2e5ece2 Fix warnings
svn path=/trunk/; revision=53885
2013-12-09 20:15:47 +00:00
Guy Harris
d62b116380 Make the code testing the Rx MCS Bitmask subfield of the Supported MCS
Set field of the HT Capabilities element a bit clearer, and add
comments.

Fix it so it doesn't assign a variable to itself, as clang warns about
that.

svn path=/trunk/; revision=53674
2013-11-30 10:17:30 +00:00
Michael Mann
e1532f39ec Tx MCS set is not interpreted properly in WLAN beacon frame. Bug 8894 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8894)
#BACKPORT

svn path=/trunk/; revision=53670
2013-11-30 01:35:03 +00:00
Jakub Zawadzki
d99fdfda63 Replace macros: BSWAP16, BSWAP32, BSWAP64 with glib-version.
XXX, people are not aware that expression of this macros might be evaluated multiple times, like:
 -  BSWAP16(tvb_get_letohs(tvb, off)) : \
 +  GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \

Should be tvb_get_ntohs() called?


svn path=/trunk/; revision=53653
2013-11-29 19:21:20 +00:00
Jakub Zawadzki
5ac6474c94 Rename some of pint.h macros to match common style (bits number on the end).
pntohs  -> pntoh16
   pntohl  -> pntoh32
   pletohs -> pletoh16
   pletohl -> pletoh32
   phtons  -> phton16
   phtonl  -> phton32


svn path=/trunk/; revision=53652
2013-11-29 18:59:06 +00:00
Michael Mann
9fa6c9fb80 Create new dissectors when a protocol goes across ethernet and "something else" instead a single dissector that uses pinfo->ethertype to determine if it's the "ethernet" or the "something else" case.
svn path=/trunk/; revision=53488
2013-11-21 19:51:17 +00:00
Alexis La Goutte
374683f052 Fix indent (2 spaces) and remove trailing whitespace
svn path=/trunk/; revision=53392
2013-11-17 14:28:42 +00:00
Jakub Zawadzki
4f78d3c69b Don't include <epan/bitswap.h> when not needed
svn path=/trunk/; revision=53364
2013-11-16 09:11:26 +00:00
Jakub Zawadzki
b5916f0f12 Expand CHECK_DISPLAY_AS_X ('this macro looks like a hack') macro in packet-ieee80211.c, remove it.
svn path=/trunk/; revision=53327
2013-11-14 22:40:40 +00:00
Jakub Zawadzki
ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Jakub Zawadzki
c9b2ee3768 include <wsutil/pint.h> only when needed.
svn path=/trunk/; revision=53196
2013-11-09 15:44:29 +00:00
Alexis La Goutte
55e3b53563 From Peter Wu via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9373
ieee80211: Decode Radio Measurements (Action Frames)

The length of the fixed fields are dependent on the radio measurement
action. Before this patch, fields following the action code were
ignored, leading to wrong decoding results. This patch adds recognition
for the Radio Measurement action management frames as specified in
IEEE Std 802.11-2012.

From me:
* Rename some hf (Add ff_ in name)
* Link Margin and Transmit Power are signed
* Use always proto_tree_add_item (replace proto_tree_add_text)

svn path=/trunk/; revision=53074
2013-11-04 08:59:48 +00:00
Bill Meier
0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

   https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Jörg Mayer
3392cb4772 Treat IE 173 (symbol proprietary) like we treat the vendor IE
svn path=/trunk/; revision=52886
2013-10-27 02:18:00 +00:00
Evan Huus
95f484a91e Add a very small hack to make the UAT update callback error string freeable, and
convert all existing UAT update callbacks to use glib memory instead of
ephemeral memory for that string.

UAT code paths are entirely distinct from packet dissection, so using ephemeral
memory was the wrong choice, because there was no guarantees about when it would
be freed.

The move away from emem still needs to be propogated deeper into the UAT code
itself at some point.

Net effect: remove another bunch of emem calls from dissectors, where replacing
with wmem would have caused assertions.

svn path=/trunk/; revision=52854
2013-10-25 22:14:25 +00:00
Jeff Morriss
0bf219035a Remove trailing spaces from hf name values (to satisfy checkAPIs).
svn path=/trunk/; revision=52796
2013-10-23 16:23:54 +00:00
Michael Mann
5abe9d8a89 The interpretation of Max Power Constraint in VHT TPE is incorrect. Bug 8939 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8939).
From chaitanya

svn path=/trunk/; revision=52791
2013-10-23 14:41:07 +00:00
Michael Mann
7f36cf3092 Add IEEE802.11ac VHT NDP announcement dissection. Bug 9224 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9224)
From Luca Coelho

From me: make sure return value of tvb_length_remaining is positive.

svn path=/trunk/; revision=52391
2013-10-06 01:53:26 +00:00
Pascal Quantin
a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Alexis La Goutte
9c5ff393aa From Chun-Yeow via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9163 Ability to Decode the Number of Mesh Peerings
Decode the mesh formation information fields related to the number of mesh peerings

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com>

svn path=/trunk/; revision=52152
2013-09-19 21:16:46 +00:00
Evan Huus
be2ebb1934 Remove unused variables, fix typos.
svn path=/trunk/; revision=52046
2013-09-15 02:26:20 +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
Michael Mann
9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Chris Maynard
6fc009baac Similar to the IPv4 dissector's hf_ip_dst_host, hf_ip_src_host and hf_ip_host fields, add to the Ethernet dissector:
hf_eth_dst_resolved
hf_eth_src_resolved
hf_eth_addr_resolved

and add to the IEEE802.11 dissector:

hf_ieee80211_addr_da_resolved
hf_ieee80211_addr_sa_resolved
hf_ieee80211_addr_ra_resolved
hf_ieee80211_addr_ta_resolved
hf_ieee80211_addr_bssid_resolved
hf_ieee80211_addr_resolved

Change motivated by:
http://ask.wireshark.org/questions/24314/possible-to-use-the-mac-info-in-the-wireshark-manuf-file-as-part-of-display-filter

svn path=/trunk/; revision=51742
2013-09-03 21:20:59 +00:00
Alexis La Goutte
b4a4a768dc Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=51734
2013-09-03 18:43:29 +00:00
Jörg Mayer
ee9c47b6eb Slightly improve the decoding of unknown Aironet IEs
svn path=/trunk/; revision=51570
2013-08-28 22:57:52 +00:00
Jörg Mayer
b9a4e7a56c As reported by Ben Smith (thex1le@gmail.com) on #wireshark:
Aironet IE 20 is ClientMFP

svn path=/trunk/; revision=51561
2013-08-28 14:09:32 +00:00