Commit Graph

1341 Commits

Author SHA1 Message Date
Martin Mathieson e0300eaed8 Fix lots of spellings 2024-02-25 22:46:47 +00:00
dariusd0 a313faaa42 Fix two typo'd words. 2024-02-11 23:14:36 +00:00
Martin Mathieson 7b58f82228 Set BASE_NONE for FT_BOOLEAN items with zero mask 2024-01-27 16:42:17 +00:00
Martin Mathieson 4571d9f194 Fix more FT_BOOLEAN items with no mask - set len to BASE_NONE 2024-01-25 22:01:03 +00:00
Chaitanya Tata 72e83ae49a ieee80211: Add decode as Wi-Fi for UDP payload
If Wi-Fi packet is encapsulated in an UDP payload (IPIP tunneling),
then we can use this functionality to decode it as 802.11.

This is intended primarily for [1].

[1] - https://docs.zephyrproject.org/latest/samples/net/capture/README.html

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-01-23 20:18:41 +00:00
Martin Mathieson d0bb6b3dfe Dissectors: remove accidental double-colons 2024-01-19 10:38:41 +00:00
David Perry bf909bf93e Add descriptions for heur dissector tables
Build on !13975 to add human-readable descriptions for all heuristic
dissector tables in Wireshark.

Chosen names are meant to give some info on when a heuristic dissector
lookup will be made. Terms like 'fallback' are used when the heuristic
is only consulted if other checks do not result in dissection, for
example.

People with more intimate knowledge of the protocols and dissectors
involved are encouraged to suggest or implement better descriptions.
2024-01-17 08:35:43 +00:00
Martin Mathieson 5de1a339c4 Fix some spelling errors 2023-12-21 16:37:45 +00:00
Liam Kearney e2594ef0e4 ieee80211: Allow RPS IE dissector to parse multiple raw assignments 2023-12-19 09:46:45 +00:00
Liam Kearney 71da5f72b5 ieee80211: Fix RPS IE (802.11ah / S1G) dissector for RAW slot definition.
Fix slot definition subfield format to give an 8 bit slot duration if set to 0, update the 11 bit mask to be 11 bits,
and add a custom formatter to print the slot duration in uS
2023-12-18 08:23:07 +00:00
Martin Mathieson bfda80d230 check_typed_item_calls.py: Improve checks around items in bitmask calls 2023-12-08 09:20:02 +00:00
Stig Bjørlykke b14d9c963c Remove init of tap variables
A tap_id is never 0, so initializing tap variables to -1 is not
necessary.
2023-12-06 13:07:05 +00:00
WFA-achuang 3b8fb201a0 ieee80211: Fix two issues
1. Check if there are elements after SAE confirm paramter
2. Fix wrong MIC length in FT element for AKM FT_FILS_SAH256
2023-11-28 09:40:17 +00:00
David Perry 24e7627fe4 Change some `wmem_packet_scope()` to `pinfo->pool`
As requested [here][1], help with removing calls to
`wmem_packet_scope()` in favour of references to `pinfo->pool`.

* Plugins chosen semi-alphabetically.
* When a calling function already has a `pinfo` argument, use that.
    * Remove `_U_` from its signature if it was there.
* If a function seems narrowly focused on getting and (possibly)
  returning memory, change the function signature to take a
  `wmem_allocator_t *`.
* If it seems more focused on packet-based operations, pass in a
  `packet_info *` instead and use `pinfo->pool` within.
* Some of the files in this MR still have references to
  `wmem_packet_scope()` where it would take significant work to remove.
  These will need revisiting later.

[1]: https://www.wireshark.org/lists/wireshark-dev/202107/msg00052.html
2023-11-22 07:22:10 +00:00
Stig Bjørlykke 2a9bc63325 Remove init of proto variables
Remove init of proto, header field, expert info and subtree variables.
This will reduces the binary size by approximate 1266320 bytes due to
using .bss to zero-initialize the fields.

The conversion is done using the tools/convert-proto-init.py script.
2023-11-20 08:20:54 +01:00
John Thacker 7b550c21d4 docs: Add wsug chapter on 802.11 Decryption Keys, link UAT help
Initially taken from the Wiki page (including images, compressed
with tools/compress-pngs.py), and expanded to cover lastest additions.

Link the Help button from the 802.11 Decryption Keys UAT to the page.

Fix #11273
2023-11-14 19:47:35 +00:00
John Thacker 09e9b352d0 dot11decrypt: Explain why key parsing failed
Have parse_key_string take a pointer to char* (such as
the one from a uat_update_cb_t) and set the failure reason
when returning NULL. This should be more user friendly than
just "Invalid key format".

Related to #11273
2023-11-13 18:48:28 -05:00
John Thacker 24570a3573 dot11decrypt: Don't keep copying and converting strings and bytes
dot11decrypt and packet-ieee80211 don't need to do the same
conversion from string to byte array, and they don't need to
uselessly copy the strings around

parse_key_string does all the validity checking; it doesn't return
a decryption_key_t with a valid type otherwise, so the 802.11
dissector shouldn't waste time checking that.

Just have parse_key_string store the key as a GByteArray.
For WPA with password, that means we store the length instead of
using a null-terminated string, but that's a bonus anyway since
it allows us to handle opaque byte strings with internal NULs, which
802.11 does technically allow.

Also clean up the API a bit by passing a struct to a static
function, making it easier to change later.
2023-11-13 09:18:31 -05:00
Martin Mathieson 8ca602f6e7 Fix (or ignore) more consecutive item filters 2023-11-07 18:34:11 +00:00
Martin Mathieson bc528a344e Fix some more copy/pasted filters 2023-11-07 06:12:31 +00:00
Jaap Keuter 62d45fcc7c WLAN: Fix header field registrations using 0 rather than NULL
... and also a blurb.
2023-11-03 13:40:23 +00:00
WFA-achuang 33cd0c0f06 ieee80211: Update the naming of description and display filter 2023-10-23 09:10:34 +00:00
WFA-achuang b0b6428471 ieee80211: Add different display filter for each WMM AC 2023-10-18 13:07:57 +00:00
Alexis La Goutte 65d035d1bb ieee80211: Add dissection of ETAG FILS Request Parameter
Close: #19386
2023-10-18 05:45:34 +00:00
WFA-achuang 80dded9664 ieee80211: Update the naming of display filter in EHT multi-link fields 2023-10-06 13:04:20 +00:00
David Perry 4995e9a8d5 proto.c: `proto_tree_add_mac48_detail()` function
Create a public function in `epan/proto.c` to dissect a single MAC-48
address. Encapsulates the name and OUI resolution, and the LG and IG
bit parsing.

Created after observing that `packet-ieee80211.c` does not resolve the
OUI or IG/LG bits for WLAN fields (`wlan.ra`, `wlan.da`, `wlan.sa`,
`wlan.bssid`) the way that `packet-eth.c` does.

This change modifies `packet-eth.c` and `packet-ieee80211.c`
to use the new function.

Add IG/LG bits
2023-09-27 07:00:15 +00:00
Gerald Combs c8a725e54e epan: Convert the UAT API to C99 types
Ping #19116
2023-09-24 19:04:40 +00:00
Jaap Keuter 71d1a90dec IEEE80211: fix dead code ext_request expert (CID 1541037) 2023-09-23 16:27:14 +00:00
João Valverde 78547a149f Make tfs_true_false the default for booleans
Instead of adding a TFS(&tfs_true_false) to every boolean
field, make it the default if "strings" is NULL.

This seems to match the already existing documentation:

    If the Boolean field is to be displayed as "False" or "True", the
    'strings' field would be set to NULL.
2023-09-22 12:19:55 +00:00
WFA-achuang 1f0f38fed6 ieee80211: Use expert_add_info_format() when adding an expert info to an item 2023-09-14 10:18:21 +08:00
WFA-achuang e5f9636964 ieee80211: Add new fields in ML and TWT element. Also update some elements. 2023-09-11 10:36:36 +00:00
Adrian Granados b13af00f13 ieee80211: Fix typos in EHT IE names 2023-09-06 05:01:19 +00:00
Martin Mathieson 15c80eebd9 Fix a couple of value_string issues 2023-09-05 12:22:23 +01:00
Albert Chuang 71a1519827
ieee80211: Add/update some elements and fix some warnings 2023-09-04 13:10:39 +00:00
John Thacker f2f7c7bf1c Remove some uses of tvb_new_subset_length_caplen()
These are all very obvious what was intended, and should be
tvb_new_subset_length() or tvb_new_subset_remaining() instead.
A few of them could throw exceptions (and sometimes the wrong
exception) on packets where the captured length was not the full
reported length, but for most of these this change has no effect
(especially after commit 0c4dcc164b)

This makes it easier to find the calls that need fixing.
2023-09-02 10:19:15 +00:00
Alexis La Goutte 6dc63bfd41 ieee80211: fix Dead Store found by Clang Analyzer 2023-08-29 19:13:26 +00:00
Martin Mathieson 320e6ccedc Fix some spelling errors 2023-08-28 06:30:01 +00:00
WFA-achuang 69bfaccbad ieee80211: Update description of two Multi-Link fields 2023-08-25 05:29:31 +00:00
WFA-achuang 35e77d059e ieee80211: Fix build error 2023-08-25 05:29:31 +00:00
WFA-achuang 8cd16bec05 ieee80211: Add EHT Action and Protected EHT Action frames dissector 2023-08-25 05:29:31 +00:00
Alexis La Goutte 008d389e94 ieee80211: fix mask is all set
packet-ieee80211.c hf_ieee80211_gann_flags_reserved filter= wlan.gann.flags.reserved  - mask is all set - this is confusing - set 0 instead! : 0xFF
packet-ieee80211.c hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl filter= wlan.trigger.he.common_info.bar_info.blk_ack_starting_seq_ctrl  - mask is all set - this is confusing - set 0 instead! : 0xFFFF
2023-08-17 17:43:02 +00:00
Alexis La Goutte e4544bd5ae ieee80211: fix wrong item type/length and bitmask
Warning: epan/dissectors/packet-ieee80211.c:24227 proto_tree_add_uint called for hf_ieee80211_he_om_rx_nss  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24229 proto_tree_add_uint called for hf_ieee80211_he_om_channel_width  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24233 proto_tree_add_uint called for hf_ieee80211_he_om_tx_nsts  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24326 proto_tree_add_uint called for hf_ieee80211_he_uph_ul_power_headroom  -  item type is FT_UINT8 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24330 proto_tree_add_uint called for hf_ieee80211_he_uph_reserved  -  item type is FT_UINT8 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24348 proto_tree_add_uint called for hf_ieee80211_he_btc_avail_chan  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24350 proto_tree_add_uint called for hf_ieee80211_he_btc_reserved  -  item type is FT_UINT16 but call has len 4
2023-08-17 17:43:02 +00:00
Martin Mathieson 87d5daa331 Fix some spelling errors 2023-08-16 12:26:39 +01:00
WFA-achuang 75fc8ceaaa ieee80211: Add five EXT element dissectors
QoS Characteristics(113), AKM Suite Selector(114)
MLO link Infor(133), AID Bitmap(134), BW Indication(135)
Also add AKM 24 and 25 dissector
2023-08-16 17:50:52 +08:00
Albert Chuang 23bc2d48bb ieee80211: Update 5 EHT element to verson D3.0 2023-08-15 06:02:28 +00:00
Van Ly Vu 5eb3fdc47a Fix typo for field wlan.wfa.ie.wpau.cs.oui 2023-07-29 03:24:06 +00:00
Ivan Tan 74406642ae ieee802.11be draft2.0:Fix mlo assoc response && EHT NDP Announcement 2023-07-28 06:20:15 +00:00
Martin Mathieson d53114e469 WLAN: Fix some more inconsistent fields[] for add_bitmask() calls 2023-07-22 16:37:56 +00:00
Gerald Combs b96e2e2075 Convert epan/crypt to C99 types
Convert GLib types to their C99 equivalents. Convert the Windows types
in dot11decrypt_interop.h as well and get rid of that file.

Fix a couple of encoding issues.

Ping #19116.
2023-06-22 23:41:04 +00:00
WFA-achuang 0619e7bfba ieee80211: Add OPS, MAX CHAN SW Time and OCI elements. Update TWT element. 2023-06-15 10:57:41 +00:00