Commit Graph

263 Commits

Author SHA1 Message Date
Martin Mathieson be51acfffb Fix some issues seen by tools/check_typed_item_calls.py 2023-01-20 12:47:59 +00:00
Martin Mathieson dd8828014c Change some vals entries to equivalent common tfs 2023-01-03 07:26:20 +00:00
João Valverde ceca3fed61 DCT2000: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-14 11:00:46 +01:00
Martin Mathieson 9a5029b364 DCT2000: Don't assign to tag unused value 2022-08-21 19:48:13 +00:00
Martin Mathieson 17f5e15fcc DCT2000: call dissectors for R16 RRC 2022-06-20 11:16:18 +00:00
Martin Mathieson 0b6bb6949e DCT2000: Fix format of string with PDCP-NR keys 2022-06-06 17:58:07 +01:00
Alexis La Goutte 406f5263c3 catapult-dct200: fix clang analyer warning (Dead.Store)
packet-catapult-dct2000.c:1099:13: warning: Value stored to 'tag' is never read [deadcode.DeadStores]
packet-catapult-dct2000.c:1100:13: warning: Value stored to 'len' is never read [deadcode.DeadStores]
packet-catapult-dct2000.c:3076:21: warning: Value stored to 'sub_dissector_result' is never read [deadcode.DeadStores]
2022-05-22 08:40:44 +00:00
Martin Mathieson 000e4ec75e PDCP-LTE: Allow updated keys to be found by frame number 2022-05-03 22:02:23 +00:00
Martin Mathieson 58821b50b5 PDCP-NR: changes to make security keys work better 2022-04-19 15:13:51 +00:00
João Valverde 8efad466c4 Tools: Fix fix-encoding-args.pl ASCII string validation
Do not require a useless ENC_NA parameter for string encodings.
FT_STRING and FT_STRINGZ types don't have any ndianness.

Follow-up to 6ec429622c.
2022-02-15 11:38:16 +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
Martin Mathieson 834312cb62 DCT2000: For ipprim frames, show header even when no payload dissector 2021-12-17 16:37:22 +00:00
Jaap Keuter adbaced04c Dissectors should not include stdio.h, unless needed 2021-12-05 12:45:46 +00:00
Alexis La Goutte a39fcee57a catapult-dct2000: Fix Dead Store found by Clang Analyzer
packet-catapult-dct2000.c:2826:21: warning: Value stored to 'sub_dissector_result' is never read [deadcode.DeadStores]
2021-09-06 04:21:15 +00: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
Martin Mathieson eb2015a373 DCT2000: Support a format for MAC-NR PDUs inside comment lines 2021-07-13 17:22:01 +01: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
Martin Mathieson e8fd04a145 DCT2000: Lookup xnap and ngap protocols 2021-04-28 10:37:16 +00:00
Jose Rubio 270561ade1 DCT2000: Allow any PDU to be dissected.
There are traffic dumps that only include the PDU payload
without lower layer information.  This commit allows any
dissector to be embedded in the DCT2000 as a protocol name.
tshark/wireshark will decode it despite having no lower
layer information.

The change allows a DCT2000 protocol field to look for a
dissector.

The change can be enabled or disabled with the preference
dct2000.use_protocol_name_as_dissector_name and it defaults
to FALSE.

Example:

Session Transcript (format 3.1)
December 6, 2020     16:45:20.5185
LTE-RRC.1/lte_rrc.dl_dcch/1/// r tm 22.5695 l $2c02
S1AP.1/s1ap/1/// s tm 23.3926 l
$001700130000020063000608023d7c00830002400202a0
2020-12-13 11:17:42 +00:00
Martin Mathieson de99214e43 DCT2000: misc changes
- For NR/LTE RRC messages, add cellGroup Id
- NRUP messages appearing as hex in comments passed to dissector
2020-11-26 00:56:36 +00:00
Guy Harris 75c739e4b7 ISDN, LAPD: clean up the way they connect to other dissectors.
Have the ISDN dissector take the ISDN pseudo-header through its data
argument, rather than assuming it's in pinfo->pseudo_header, so it can
be used if the link-layer type of the capture isn't ISDN.

Have it add the direction to its protocol tree, so it's there for all
ISDN packets.

Have more versions of the LAPD dissector:

	one where the ISDN direction information is available through
	an ISDN pseudo-header passed as its data argument;

	one for use when the link-layer type *is* LAPD, where the ISDN
	direction information may be available through the direction
	part of the packet flags.

Pass more flags to the routine that does LAPD dissection to indicate the
direction (user->network or network->user) and whether the user or
network side is on another machine; set those appropriately in the
dissector routines that call it.  To set those flags:

	in the routine that handles WTAP_ENCAP_LAPD, check the direction
	flags in pinfo->rec->rec_header.packet_header.pack_flags;

	in the routine that handles WTAP_ENCAP_LINUX_LAPD, check the SLL
	header;

	in the routine that's called from the ISDN dissector and other
	dissectors that can supply an ISDN pseudo-header, check the
	struct isdn_phdr passed to it via the data argument;

	for the routine that's to be called from L2TP pseudowire type
	and SCTP dissector tables, pass nothing, as there's currently
	no direction indication supplied - if that information is
	available from the encapsulating protocol in some fashion, we
	should make changes to supply that information.

Have the AudioCodes Trunk trace protocol dissector call the
LAPD-with-pseudoheader dissector, handing it an ISDN pseudo-header with
a direction indication from the direction field (and a channel of 0 to
indicate the D channel).

Have the Ascend text dump reader in libwiretap use WTAP_ENCAP_ASCEND for
all packets, even Ethernet and ISDN packets, and have the Ascend text
dump dissector handle that, calling the "no FCS" version of the Ethernet
dissector and calling the LAPD-with-pseudoheader dissector with a
pseudo-header filled in with the direction (and a channel of 0).

Have the Catapult DCT 2000 text dump dissector call the
LAPD-with-pseudoheader dissector with the pseudo-header supplied by
libwireshark.

Have the V5 envelope function frame get its ISDN pseudo-header from its
data argument, and call the LAPD-with-pseudoheader dissector with that
pseudo-header.

Have the ISDN dissector treat its data argument as pointing to the ISDN
pseudo-header, rather than assuming it's the one in
pinfo->pseudo_header->isdn - the latter is the one supplied by
libwiretap, but there's no guarantee that an ISDN pseudo-header was
supplied by libwiretap, as the lowest-level protocol layer might not
have been ISDN.

Change-Id: I9f702b879bbc3fb42bcb43c28f797bfc327562c6
Reviewed-on: https://code.wireshark.org/review/37953
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-25 18:31:34 +00:00
Martin Mathieson 0af8d7c091 Some cppcheck fixes.
- UDPCP: fix test for Sync frame detection
- Avoid a couple of redundant assignemnts

Change-Id: Ib69a3ff4f0e802ddbbbd29eb2a803372c41a7ce4
Reviewed-on: https://code.wireshark.org/review/36526
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-03-21 21:28:15 +00:00
Martin Mathieson e30f0d0920 Some issues spotted by PVS-Studio in bug 16335. Many more remain
Change-Id: If856e25af8e33eeef5b9e595f1f6820459892b17
Reviewed-on: https://code.wireshark.org/review/36110
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-15 11:06:41 +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
Martin Mathieson 68122d26b9 DCT2000: skip/show carrierId for LTE/NR RRC headers.
Change-Id: I95023cb395a913408d47e559ff5aa2b6843749f5
Reviewed-on: https://code.wireshark.org/review/33729
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-06-25 03:55:32 +00:00
Martin Mathieson 3bbc888798 DCT2000: Fix up the way RRC dissectors are called.
Change-Id: I61d51cfdde1ec7b358a6e1ade7d58f82aa897f04
Reviewed-on: https://code.wireshark.org/review/33455
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-06-04 12:24:01 +00:00
Martin Mathieson dd708676d3 NR: Configure LCID -> RLC Bearer config from RRC
Change-Id: Ida6af4ccd2157f967b9d2340e6f12319e4dbe688
Reviewed-on: https://code.wireshark.org/review/32998
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-04-29 23:39:58 +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
Martin Mathieson e351395339 DCT2000: Add other NR RRC entry points.
Some of the PDU types needed for SA
were missing in earlier RRC versions.

Change-Id: Ida3b091fe91961cf3cd8e7476692d2467211b5fd
Reviewed-on: https://code.wireshark.org/review/31703
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-01-23 21:45:49 +00:00
Martin Mathieson 18c737c2a6 DCT2000: Pass NR NAS payload to dissector with S1AP framing
Change-Id: I2aa7a7f347e897b1a455ff3eb8ae126982ecc681
Reviewed-on: https://code.wireshark.org/review/31045
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-12-14 14:07:10 +00:00
Martin Mathieson b6e13a3d84 DCT2000: Call nas-5gs dissector
Change-Id: Iddca3571097210a7a0e090b506538bbf8ec64c07
Reviewed-on: https://code.wireshark.org/review/31040
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-12-13 21:11:31 +00:00
Martin Mathieson 2d589df127 DCT2000: skip optional carrier type in LTE RRC primitive header
Change-Id: I495e5b2da1b7c9a066294564837df471e25fbb73
Reviewed-on: https://code.wireshark.org/review/31037
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-12-13 18:20:27 +00:00
Gerald Combs ef01359849 Add support for protocol aliases. Switch BOOTP to DHCP.
Add support for aliasing one protocol name to another and for filtering
using aliased fields. Mark aliased fields as deprecated.

Rename the BOOTP dissector to DHCP and alias "bootp" to "dhcp". This
lets you use both "dhcp.type" and "bootp.type" as display filter fields
without having to duplicate all 500+ DHCP/BOOTP fields.

To do:
- Add checks to proto.c:check_valid_filter_name_or_fail?
- Transition SSL to TLS.
- Rename packet-bootp.c to packet-dhcp.c?

Change-Id: I29977859995e8347d80b8e83f1618db441b10279
Ping-Bug: 14922
Reviewed-on: https://code.wireshark.org/review/29327
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-31 05:25:17 +00:00
Martin Mathieson f5c1c1935c DCT2000: For LTE MAC, set flag to say whether sf/sfn present or not
Change-Id: Id11866fd90e69a0185a8095a82fab5fbc44c92ae
Reviewed-on: https://code.wireshark.org/review/29260
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-08-23 10:11:31 +00:00
Martin Mathieson 81d1e2b55b DT2000: Call RRC dissector from newer primitives.
Change-Id: I7293771e96b029e2710a98e955bc40a16df2627a
Reviewed-on: https://code.wireshark.org/review/28429
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-25 16:51:24 +00:00
Martin Mathieson 3b5b7b4da9 dct2000: call LTE NAS dissector for r13 release
Change-Id: I35208b9bea8613468da53ae1541d0c5083cd27c0
Reviewed-on: https://code.wireshark.org/review/28201
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-06-11 13:02:12 +00:00
Martin Mathieson 871ed51bb1 DCT2000: call lte rrc dissector for later releases
Change-Id: I3c21c5c0654856edd31191062018a988f9e50ed1
Reviewed-on: https://code.wireshark.org/review/27952
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-06-02 00:58:21 +00:00
Martin Mathieson 52066dae67 DCT2000: call NR RRC dissector for protocol payloads.
N.B. as the primitive headers are (so far) identical to LTE,
re-use that code and remote 'lte' from primitive header fields.

Change-Id: I53ece508608fc9108f218ee2933e1b13cc9777bb
Reviewed-on: https://code.wireshark.org/review/27921
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-31 04:29:16 +00:00
Martin Mathieson 1a6daa235e DCT2000: Only look up old protocol name mappings if preference enabled
Change-Id: I871f7669c9303452f3407b65f83f68dee1ffc3bf
Reviewed-on: https://code.wireshark.org/review/27197
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-04-29 18:01:21 +00:00
Martin Mathieson 032cb4b79f Catapult DCT2000: Update sscanf patterns, and avoid calling if possible
Change-Id: Iafb7d62ab4a0431a00eaa284d421ea38b568533f
Reviewed-on: https://code.wireshark.org/review/25990
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2018-02-22 16:26:20 +00:00
Martin Mathieson 6325ceb5e5 DCT2000: read new LTE MAC outheader values
Also extend the carrier id enum to r10 levels.
Change-Id: I1eac50c54801010f0ad7408debb80ad811e03fbe
Reviewed-on: https://code.wireshark.org/review/25793
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-15 05:30:21 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Martin Mathieson 42322ac8cf dct2000 wiretap: expect all lines to have exactly 4 subsecond digits.
Should fix clang warning created by https://code.wireshark.org/review/#/c/25492.

Change-Id: Iafa31e24cd786a510f3a953d615df4cbc3930fa6
Reviewed-on: https://code.wireshark.org/review/25508
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-30 00:42:10 +00:00
Martin Mathieson baca10e725 DCT2000: after profiling, speed up some parts
Change-Id: Ia335aaca3368608fe495c887d846fe3f057b74dd
Reviewed-on: https://code.wireshark.org/review/25486
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-27 23:12:08 +00:00
Darien Spencer f48305069c FP: Combining heuristic dissectors
Combining all seperate heuristic dissector into one 'fp over udp' dissector.
Also refactored the 'unknown format' dissector (formarly heur_dissect_fp) so it could work 'chained' to the others.

Change-Id: I396c362a400f51171ee091317b6735dfd8bd19df
Reviewed-on: https://code.wireshark.org/review/22368
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-06-28 21:01:05 +00:00
Darien Spencer 0dada943c0 RLC: Renamed U-RNTI to UE ID
The 'U-RNTI' field in RLC Info struct is both used in the code and shown in the UI as a generic unique 'UE ID' (not specificly U-RNTI, although sometimes it is)
This commit renames the field to fit it's usage.

Change-Id: Ib42b8ed5192fe60c9a164d6d225634be53708c66
Reviewed-on: https://code.wireshark.org/review/22225
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-06-19 23:50:23 +00:00
Darien Spencer 31ffb58eb0 [UMTS RLC] Rename proto variable
To match the recently renamed file name.

Change-Id: Id784b955ec96a52a5f380d415094dce81e1774d5
Reviewed-on: https://code.wireshark.org/review/22222
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-06-19 13:43:20 +00:00
Darien Spencer 8775b0b1b2 [UMTS RLC] Renaming dissector files to fit FP/MAC
Currently the UMTS FP & MAC dissector's are named packet-umts_X.
This commit renames the UMTS RLC's files to show their relation.

Change-Id: I9e37be95f7c7d08278075a49b8abc2b480a13d64
Reviewed-on: https://code.wireshark.org/review/22188
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: Anders Broman <a.broman58@gmail.com>
2017-06-17 18:48:59 +00:00
Stig Bjørlykke d99112d393 Use col_append_str() for fixed strings
Change from col_append_fstr() to col_append_str() when
appending strings without formatting.

Change-Id: I8975704c246f2b9a1301ed5f96273aa9d61c6f44
Reviewed-on: https://code.wireshark.org/review/20857
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-03 05:32:17 +00:00
Guy Harris 1bea950b7a Add bounds checks for references to outhdr_values.
Don't run past the end of the outhdr_values array.

While we're at it, don't make it a global array - it doesn't need to be
global, as its values don't persist from invocation to invocation, and
this would allow use of this routine in multiple threads in parallel.
(Yes, we have other global variables that don't maintain state, but we
should get rid of that, too.)

Change-Id: I7ceed3c9ba6356eddb7d52472e9d53dd08f90029
Reviewed-on: https://code.wireshark.org/review/20770
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-28 23:14:20 +00:00