Commit Graph

306 Commits

Author SHA1 Message Date
Vladimir Bespalov 5ecb57cb90 Add ZBOSS NCP protocol dissector 2022-01-30 09:34:26 +00:00
João Valverde 0ccd69e530 Replace g_strdup_printf() with ws_strdup_printf()
Use macros from inttypes.h.
2021-12-19 21:21:58 +00:00
João Valverde 22ee2764a7 Replace g_snprintf() with snprintf() (dissectors)
Use macros from inttypes.h with format strings.
2021-12-19 20:25:11 +00:00
Uli Heilmeier 86d5606be3 IEEE 802.15.4: Add PAN ID when flag is set
According to IEEE 802.15.4-2020 Section 7.3.5.1 Destination PAN ID field is
present when PAN ID Present bit is set. Therefore we should check for the bit.

Fixes: wireshark/wireshark#17496
2021-09-04 11:17:08 +02:00
Evan Huus 8ee8808876 First pass pinfo->pool conversion, part 2
Automated find/replace of wmem_packet_scope() with pinfo->pool in all
files where it didn't cause a build failure.
2021-07-21 09:54:57 -04:00
Guy Harris 57a1514ac7 Cast away the return value of g_strlcpy() and g_strlcat().
Most of the time, the return value tells us nothing useful, as we've
already decided that we're perfectly willing to live with string
truncation.  Hopefully this keeps Coverity from whining that those
routines could return an error code (NARRATOR: They don't) and thus that
we're ignoring the possibility of failure (as indicated, we've already
decided that we can live with string truncation, so truncation is *NOT*
a failure).
2021-04-30 03:19:19 -07:00
James Ko dbdfe53538 Separate the data bytes in IEEE 802.15.4 TAP DLT
Improve dissection of IEEE 802.15.4 TAP DLT by reporting the number of
data bytes of the original data frame and create a separate packet bytes
pane containing just that data without the TAP TLV content.
2021-04-10 07:48:30 +00:00
Dario Lombardo ea929d6401 wsutils: add local implementation of g_memdup2.
g_memdup() was deprecated and replaced with g_memdup2() in GLib 2.68,
we provide our own copy of g_memdup2() for older GLib versions.
2021-03-25 09:38:10 +00:00
Pedro Jose Marron cc4ad69366 IEEE 802154: Improve support for vendor specific IEs
Provide better dissection information for vendor specific IEs
and remove the expert warning displayed so far.
2020-10-30 22:15:12 +00:00
Kenneth Soerensen 38cdd3df4e ieee802154: Add timeout to ACK tracking
In captures where a lot of packets are missing, requests and ACKs are
sometimes incorrectly paired. With this improvement, ACKs must arrive in
a reasonable time to be paired with a request.
2020-10-21 10:02:56 +00:00
Martin Mathieson 4c9f59ee56 Fix more spelling errors in dissector strings.
A second batch of spelling errors, detected using a script
that uses pyspellcheck and a Wireshark-specific dictionary file.

I will take at least one more pass through the dissectors, as
further improvements are made to the script.
2020-08-29 21:32:39 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00:00
Guy Harris 76a69be324 If possible use proto_tree_add_item(), not proto_tree_add_bytes_item().
Only use proto_tree_add_bytes_item() if you

	1) are processing a hex string rather than binary byte array;

	2) need the raw byte data.

While we're at it, fix the encoding argument in some calls adding
FT_BYTES fields to be ENC_NA, and, for some cases that could use
FT_UINT_BYTES, use proto_tree_add_item_ret_uint() to handle the length
and add a comment about that.

Change-Id: I6a1baca5c7da3001c0a6669f9c251e9773346c8c
Reviewed-on: https://code.wireshark.org/review/36967
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-04-28 18:23:53 +00:00
Jaap Keuter 9750d00ff1 Introduce tfs_get_string helper
true_false_strings have no helper function to properly retrieve the
string representing the true or false value, much like unit_strings,
even though this is not uncommon in dissectors.
This change introduces the helper function and modifies the dissectors,
so that they use this helper i.s.o. their own expressions.

Change-Id: I477ed2d90a9a529fc5dcfef7e3ea42ec180d27ae
Reviewed-on: https://code.wireshark.org/review/36920
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-25 04:39:46 +00:00
Kenneth Soerensen bbb1a794c5 ieee802154: Do not require correct FCS for ACK tracking
There is a good chance that the required information is still
valid even with a wrong FCS.

Change-Id: I244b2b4a857b7cefd1f4ef22eb151d5ac3ee4133
Reviewed-on: https://code.wireshark.org/review/35953
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-28 15:52:38 +00:00
Kenneth Soerensen 535f5277f3 ieee802154: Use the dissector internal address format for ACK tracking
This makes the address representation in ieee802154_transaction_t and
ieee802154_packet consistent.

Change-Id: I6ae66b48c3b2afe5843e6a82fe5adf1c6be5a7cd
Reviewed-on: https://code.wireshark.org/review/35780
Reviewed-by: Martin Boye Petersen <martinboyepetersen@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-01-16 20:08:07 +00:00
Kenneth Soerensen 9e135f8748 ieee802154: Use ACK tracking to add generated addresses to ACKs
Change-Id: I86a0aae9409ab5f81a70560997c637f8f16718fa
Reviewed-on: https://code.wireshark.org/review/35754
Petri-Dish: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-13 07:44:06 +00:00
Stig Bjørlykke a673a50ad8 epan: Rename dissector_filters.c to conversation_filter.c
For the same reason as in g89c9d909.

Change-Id: I5e344ebdf8ba05d169484aa32b409d84edc6124f
Reviewed-on: https://code.wireshark.org/review/34943
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-11-04 10:17:16 +00:00
Devan Lai 610c7566f2 ieee802154: handle IEEE 802.15.4e LE WUF
Wake-up frames in 802.15.4e have a specific structure that is not
consistent with the fields present in a single-byte FCF.
As a special case when 802154e_compatibility is enabled, detect
multi-purpose frames that are exactly 12 bytes long and contain
a Rendezvous Time IE and parse them as an 802.15.4e wake-up frame.

Bug: 16102
Change-Id: I87c6317fffb0670dae0d5bdd499271fe02a40b22
Reviewed-on: https://code.wireshark.org/review/34684
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-03 10:49:25 +00:00
Devan Lai 6a7d3150ee ieee802154: support multipurpose frames
Add support for IEEE802.15.4-2015 multipurpose frames, which are
similar to data frames with the following exceptions:
 - The Frame Control Field can be either 1 or 2 octets, with different
   bit offsets for all fields except for Frame Type.
 - The Frame Version field, when present, must always be set to 00.
 - The source PAN ID is always absent
 - Instead of a PAN ID Compression field, there is a PAN ID Present
   field for the destination PAN ID only.

See Section 7.3.5 of IEEE802.15.4-2015 (esp Figure 7-19) for details.

Bug: 16101
Change-Id: I1e64d90694b567573ca10395b823adb9015f8917
Reviewed-on: https://code.wireshark.org/review/34682
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-03 07:52:32 +00:00
Devan Lai b5091d8cd8 ieee802154: handle IEEE 802.15.4e PAN ID compression
Add a new 802154e_compatibility preference.
When enabled, it will attempt to handle certain PAN ID compression schemes
that are permitted in 802.15.4e-2012 but not in 802.15.4-2015.

Specifically, when either the source or destination address are present
in short form and the PAN ID Compression bit is cleared, 802.15.4-2015 expects
the source PAN ID to be present, whereas 802.15.4e-2012 does not.

Bug: 16102
Change-Id: I7fea7bd6d0a78c859360a1130b242e90eac8feec
Reviewed-on: https://code.wireshark.org/review/34683
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-03 07:51:53 +00:00
Kenneth Soerensen c91856a48f IEEE 802.15.4: Add conversation table and conversation filter
Change-Id: I3ec5be36bff3768bce66975deb15fec2dcc5cb26
Reviewed-on: https://code.wireshark.org/review/34155
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-08-11 15:12:06 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Kenneth Soerensen 2377dff96c IEEE 802.15.4: Do not create new addresses but reuse the existing ones
Change-Id: I86519fe73b9225f5e1e19e20977debbea4aa0d74
Reviewed-on: https://code.wireshark.org/review/33954
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-16 06:42:40 +00:00
Martin Kaiser f155601d66 decode_as: remove the "title" member from decode_as_t
The title of a decode_as_t was used by the GTK UI. It's no
longer required for Qt.

Change-Id: Ibd9d4acbe9cad2c1af520340d04e550326a97ebe
Reviewed-on: https://code.wireshark.org/review/33557
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-11 18:50:32 +00:00
Alexis La Goutte ff9189ef92 ieee802154: empty paragraph passed to '@param' command [-Wdocumentation]
Change-Id: I76f7a20a7a8f019a9b99404e08a3249cdc6ea6ef
Reviewed-on: https://code.wireshark.org/review/33008
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Kenneth Soerensen <knnthsrnsn@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-05-15 11:26:10 +00:00
Kenneth Soerensen 9f8ac4d422 IEEE 802.15.4: Separate ACK tracking and conversations
ACK tracking did not work for protocols like ZigBee because the ACK is
send without address information. By moving the ACK tracking out-side
the conversation and only use the interface and the sequence number to
match requests and ACKs this is now working.

If addresses are present in the ACK they will still be used to avoid
invalid matches.

The nature of the wmem_tree ensures that the ACK tracking will always
work on the latest requests.

Change-Id: I5c763e34ec340b19a7998ddcfe9f72fccfd2acd1
Reviewed-on: https://code.wireshark.org/review/32927
Reviewed-by: James Ko <jck@exegin.com>
Tested-by: Petri Dish Buildbot
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-09 04:02:22 +00:00
Alexis La Goutte 4db2258dd6 fix: no previous prototype
for function 'ieee802154_create_tap_tlv_tree' [-Wmissing-prototypes]

Change-Id: I74de53e945685a289c302a784afd3d3f5f22891b
Reviewed-on: https://code.wireshark.org/review/32799
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-09 17:46:51 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +00:00
James Ko 2bd680746a IEEE802154_TAP: Add TLVs for channel plan and freq
Channel Center Frequency (Type=11).  In addition to or instead of
channel number for packet reception, the channel center frequency may be
specified in kHz as  IEEE-754 floating point number.
Channel Plan (Type=12) - Allow reporting of a generic channel plan used
to calculate channel numbers.  The channel plan consists of the channel
0 center frequency, channel spacing and number of channels.

Change-Id: I41fa585e9c2fd8986b1fb61a49de74ee2adac4fa
Reviewed-on: https://code.wireshark.org/review/32415
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-15 04:34:20 +00:00
Stig Bjørlykke e327892d09 ieee802154: Show header fields
Add a new subtree with Header fields Version, Reserved and Length.
Include padding length in the TLV entry.

Change-Id: I7c39253f4d2f5f3b2d5721d10af3f8b563ea0d04
Reviewed-on: https://code.wireshark.org/review/32346
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-03-07 11:11:31 +00:00
Uli Heilmeier f6f048361f IEEE802154: Fixing some implicit conversations
Fixing some "implicit conversion loses integer precision" warnings
reported by clang with -Wshorten-64-to-32 option

Change-Id: Ica92971e689c28c6d1ea995e821d648a19186c09
Reviewed-on: https://code.wireshark.org/review/32331
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-03-05 12:50:32 +00:00
James Ko e1316e1b20 IEEE 802.15.4-2015 CCM* nonce for TSCH mode
Enable decryption in TSCH mode which requires ASN in nonce.

Change-Id: Iae24add3a15cef00ef0037acd99f30b684e97ae2
Reviewed-on: https://code.wireshark.org/review/32142
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-03-02 08:29:28 +00:00
Dario Lombardo 349735613d ieee802154: fix compilation with gcc-4.
Error:
../epan/dissectors/packet-ieee802154.c: In function 'dissect_ieee802154_header_ie':
../epan/dissectors/packet-ieee802154.c:3788:10: error: variable 'remaining' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered]
     gint remaining = tvb_reported_length_remaining(tvb, offset) - IEEE802154_MIC_LENGTH(packet->security_level);
          ^

Change-Id: I6dadaa9e502f8f38bf476b690395727c836172fd
Reviewed-on: https://code.wireshark.org/review/32283
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-01 10:21:18 +00:00
Guy Harris 1cbcc57e0a Put a fake "FCS OK" value into the tree if we don't have FCS information.
That was what was being done before; do it in the main dissector
routine, as 1) the main dissector routine doesn't call the FCS or TI
CC24xx dissector if we don't have an FCS or TI CC24xx metadata trailer
and 2) that means we pull duplicate code out of those dissectors.

Also, those routines are only called if we have the full FCS/metadata
available, so there's no need for them to check for that.  (Arguably,
they should be called if the data is present, according to the reported
length, even if it's not available in the captured data, so we mark the
frame as having been cut off so the full data isn't available.)

Change-Id: I6be2a1f71a27bc41aea93e3c92743fc12c997c94
Reviewed-on: https://code.wireshark.org/review/32281
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-01 03:03:30 +00:00
Guy Harris 74a776d391 Pull some common code from the FCS/metadata dissectors.
Put the "mark frames with an invalid CRC" stuff into the main dissector
code, as it's the same regardless of whether you have an FCS that can be
checked or metadata with an "FCS bad" flag.

Change-Id: I2540c1934032c91f22b66babd81fb928212f18b5
Reviewed-on: https://code.wireshark.org/review/32280
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-01 02:26:08 +00:00
Guy Harris 8ecb42ae0d Have separate routines to dissect an FCS and TI CC24xx metadata.
Those fields have nothing in common.

Change-Id: Ida29ce36a8a3e311b58a900a5631e314ebc39662
Reviewed-on: https://code.wireshark.org/review/32279
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-01 00:19:42 +00:00
Guy Harris 371c71ac1e Don't use a global variable for the FCS length.
Use local variables and parameters instead.

Change-Id: If491ef9c4e961848bb59f48d107157372f93e43f
Reviewed-on: https://code.wireshark.org/review/32278
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-03-01 00:01:34 +00:00
Guy Harris f5164e6eff Don't use the same variable for the configured FCS type and the tap FCS type.
There's the value the user configured, which should neither be used nor
modified by the 802.15.4 TAP dissector; that dissector should just set
the FCS length variable.  It should also call the common dissector, as
most of the other top-level dissectors do.

That lets us have separate types for the "configured FCS type" and "tap
FCS type" variables; do so.

Speaking of calling the common dissector, the "non-ASK" dissector should
do so as well.  Make it so.

While we're at it, fail if there's an unknown FCS type in the tap
header.

Change-Id: Ib0de81764670302c771be3851e9717f0a8399ac6
Reviewed-on: https://code.wireshark.org/review/32277
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-28 23:46:02 +00:00
Guy Harris 65ca4b4da7 Clean up ITU-T vs. CCITT, fix some comments.
The CCITT was part of the ITU, and was renamed the ITU-T:

	https://en.wikipedia.org/wiki/ITU-T#History

so just say ITU-T.  As for whose idea those particular 16-bit and 32-bit
CRC generator polynomials originally were, I don't know. 802.15.4 speaks
of "a 32-bit CRC equivalent to ANSI X3.66-1979", but there ain't no
32-bit CRC in that standard, and its 16-bit CRC is Yet Another
x^16 + x^12 + x^5 + 1 CRC that they claim came from CCITT/ITU-T V.41;
V.42 has both 16-bit and 32-bit CRCs.

Clean up more comments about the TI CC24xx metadata trailer.

The "non-ASK PHY" name may have made sense when the type was created, as
all the PHYs other than ASK, at the time, may have had the same
preamble/SFD/PHR, but that's no longer true.  List, in a comment, the
ones to which it applies, all of which have 16-bit CRCs.

Change-Id: Ie509dc06d06aec9738447f8da254c4edc5971a92
Reviewed-on: https://code.wireshark.org/review/32276
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-28 23:05:40 +00:00
Guy Harris 7bf2fbf85a Replace another tvb_new_subset_length_caplen() call.
tvb_new_subset_length() is sufficient, and correctly calculates the
captured length of the tvbuff, rather than possibly setting it too large
by setting it based on the length of the TLV header.

Change-Id: I510ee6742fcbc08ae7331585a65c768e98e6b3d9
Reviewed-on: https://code.wireshark.org/review/32271
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-28 18:48:29 +00:00
Guy Harris bf8ca6a605 Replace a tvb_new_subset_length_caplen() call with tvb_new_subset_remaining().
It's simpler, and is not incorrectly using the *captured* length to set
the *reported* length.

Change-Id: If4b7f1c431f4c39dcc568698358667a1b4fc1a12
Reviewed-on: https://code.wireshark.org/review/32268
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-28 18:42:01 +00:00
Guy Harris c6781b6385 Remove FCS length checks from code that's handed a tvbuff without an FCS.
Data handed to dissect_ieee802154_decrypt() should have, and does, have
the FCS stripped off, so we don't need to use the FCS length.

While we're at it:

Update more comments for CC24xx metadata not being an FCS.

Do the header IE processing loop with a "data remaining" counter,
explain why we're doing a "data remaining" check and why it includes the
MIC length, and note that we should use the "data remaining" counter to
do more checks for invalid frames.

Change-Id: I928dbf6142b5876b6a25b954f798936c9e97ac0d
Reviewed-on: https://code.wireshark.org/review/32267
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-28 18:27:31 +00:00
James Ko 6ce7509223 Add IEEE 802.15.4 TAP link type
New link type for IEEE 802.15.4 with pseudo-header and optional
meta-data TLVs, PHY payload exactly as it appears in the spec (no
padding, no nothing), and FCS if specified by FCS Type TLV.
Specification at https://github.com/jkcko/ieee802.15.4-tap

Bug: 15429
Change-Id: I67bd154891ad5818be9a1630aa5cbb863b55509a
Reviewed-on: https://code.wireshark.org/review/32141
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-28 17:55:14 +00:00
Guy Harris 8fad9ba447 Fix the FCS handling.
All the complicated stuff to see whether the captured data includes all
of, some of, or none of the FCS is necessary, and should not have been
removed.  The previous code would sometimes dissect packet data at the
end as both payload *and* FCS.

This also means that the decryption code doesn't have to worry about the
FCS, and expects the payload handed to it *not* to have the FCS.  Update
callers to handle that.

This puts back the changes from
e4d3916530, for which the comment was:

    Clean up the way we handle the FCS.

    For the "802.15.4 with FCS" link-layer type, strip what FCS we find,
    if any, off and use that new tvbuff for all dissection except for
    checking and dissection of the FCS itself.

    For the "802.15.4 without FCS" link-layer type, don't fake an
    uncaptured FCS by increasing the reported length, just use the
    tvbuff as is.

    This means we handle 802.15.4 the same way we handle other
    link-layer types where the FCS might, or might not, appear as
    part of the captured data.

"Handling stuff at the ends of packets is hard, let's go shopping!"

Change-Id: Iaf3e8392efec9d1c35f73966e22f2a3ae91317a1
Reviewed-on: https://code.wireshark.org/review/32254
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-27 23:35:06 +00:00
Guy Harris a4c8b2d4e6 Fix a comment.
There's no MIC at the end of an unencrypted packet, and thus we're not
removing any MIC.

Change-Id: Ie19790afc573b66f5dd09a4f8afc0fe69895eabe
Reviewed-on: https://code.wireshark.org/review/32249
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-27 21:20:08 +00:00
Guy Harris 179d872565 Fix subset-tvbuff creation.
Use tvb_new_subset_length(), rather than (incorrectly) attempting to
calculate the captured length ourselves.

Change-Id: I9f608ee5bf59f261111b2a75900dddad12fb5554
Reviewed-on: https://code.wireshark.org/review/32245
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-27 21:11:20 +00:00
Guy Harris 812afa8065 More "it's not an FCS, it's metadata" comment updates.
Change-Id: I2c0be3fe7cd900cd93d9fb64475a911e5bb3f9ac
Reviewed-on: https://code.wireshark.org/review/32230
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-27 09:52:00 +00:00
Guy Harris 5ab0bc2a3c The TI CC24xx chips put metadata, not an FCS, at the end of the packet.
Don't call it an "FCS" in the CC24xx case.  It's not an FCS; it's not
even just an "FCS OK" bit.

Display the metadata in question in bit order, from the "CRC OK" bit
downwards.

Change-Id: I8da29bbb1f8b5ef3905af75dd34c1563b904a4d8
Reviewed-on: https://code.wireshark.org/review/32228
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-02-27 09:47:29 +00:00
James Ko 8ee96f4ccb Add IEEE 802.15.4 ACK tracking
Add flag to protocol configuration to enable ACK tracking.
Fix duplicate strings in dissector.

Change-Id: I245f2f2c9aad408a8e8429e8ac5ea5dac37a4f69
Reviewed-on: https://code.wireshark.org/review/32140
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-27 05:07:45 +00:00