Commit Graph

443 Commits

Author SHA1 Message Date
John Thacker c380f516a2 GTP, GTPv2: Add request/response framenum types
Add the appropriate FT_FRAMENUM string types to the request
and response fields for GTP and GTPv2, so that arrows are
drawn for the related packet symbols.
2023-01-20 00:51:19 +00:00
Martin Mathieson d17c018013 tools/check_typed_item_calls: check FT_BOOLEAN mask length 2022-12-15 13:28:05 +00:00
Martin Mathieson 793365d0e0 Fix some issues seen with cppcheck 2022-11-22 20:55:24 +00:00
John Thacker 70ebded081 GTP, GTPv2: Use ENC_APN_STR for FQDN.
Both specifications say: "The FQDN field encoding shall be identical
to the encoding of a FQDN within a DNS message of section 3.1 of IETF
RFC 1035 [31] but excluding the trailing zero byte."

Since it's only one name, that probably means that compression is
impossible, and indeed the dissectors already check and assume that
if the first byte is in the letter range, that it's probably incorrectly
directly encoded as a dotted string instead of DNS-style.

Since compression isn't supported, use ENC_APN_STR to avoid generating
bogus UTF-8 in packets with errors.

Fix #18531
2022-10-24 01:24:57 +00:00
John Thacker 333fe08bb3 gtp: Use ENC_APN_STR for decode_apn
Using ENC_APN_STR is simpler and guarantees that we produce
valid UTF-8. Fix #18402
2022-10-03 21:18:42 -04:00
John Thacker feb7f45179 gtp: Fix UE-AMBR and APN-AMBR with NSAPI IEs
The optional Authorized UE-AMBR for Uplink and Downlink
fields in UE-AMBR were never getting dissected.
Also, the trees and tree description for the UE-AMBR and
APN-AMBR with NSAPI IEs were swapped.
2022-09-28 01:26:46 +00:00
John Thacker b46a3fbf23 GTP: Fix NSAPI shift in Radio Priority
The NSAPI value was not being shifted correctly before being
added to the tree description.
2022-09-21 00:06:28 +00:00
John Thacker 0a0ff53f5c GTP: Have all the matched message types appear in SRT
Dynamically create the indices for the SRT table so that
all the message types sent from the tap get put in the SRT
table, instead of hardcoding in a list of four that is a
smaller subset of what is matched in gtp_match_response.
2022-09-19 07:44:46 -04:00
John Thacker 1ccf4f3c73 GTP: Use a map for mapping from <teid,address> to frame
For GTP session tracking (off by default), there's a mapping
from <TEID, ADDRESS> to frame numbers. The current implementation
is a tree (converting the address to a string for keys) of linked
lists of the TEIDs. That gets very slow when there's a large number
of TEIDs. Convert it to a map that uses the teid and address,
with the TEID used for the hash.

There's still a reverse lookup (foreach_remove) when TEIDs are reused
or sessions fail, but this still yields over a 10x speedup on a
few moderate sized test files (~50000 GTP-C packets).
2022-09-17 07:39:05 -04:00
John Thacker 8129b9dee8 GTP: Use direct hashing in the session table
The session table maps frames (which are 32 bit uints that
start at 1) to sessions (which are also 32 bit uints that
start at 1), so use GUINT_TO_POINTER and the direct hash
functions instead of creating extra file scope pointers.
2022-09-17 00:49:57 +00:00
John Thacker 4d9167908c GTP: Fix the version check in decode_qos_umts()
Releases 98 and 99 are older than version 8. Also fix the
extra length added for RADIUS so that it properly accounts
for the lack of allocation-retention priority in RADIUS.
Previously it was off by one, which caused errors in Release
98. Fix #10688 again.
2022-08-02 21:50:05 +00:00
Roland Knall b165f31cd3 gtp: Fix copy-paste error 2022-06-30 16:38:05 +02:00
Moshe Kaplan 96c4c9063f packet-gtp.c: Fix copy-paste error (Coverity 1506627)
Use guaranteed uplink bitrate,
instead of max uplink bitrate, when
calculating guaranteed uplink bitrate.
Fixes Coverity 1506627 and #18164.
2022-06-30 03:03:24 +00:00
Pau Espin 4c22ff6bdb GTP: Several fixes and improvements to QoS IE GBR & MBR fields
The previous output was missing some fields under some conditions, and
some output text was wrong. This ended up in big confusion when looking
at the fields. Let's add the missing fields, fix the existing ones and
provide better formatting of the strings to understand which exact field
provides the info.
2022-06-21 18:35:30 +00:00
Roland Knall 2cf938cfa8 tap: Adding flags for tap_packet
This allows flags to be passed by the registering listener
to the collection of information
2022-06-10 05:46:15 +00:00
Joakim Karlsson c2444370f4 GTP': correction of Release Identifier Extension 2022-04-26 19:40:28 +00:00
easonweii a1e0c34c30 GTP: Minor reconstruction
Extract Method for multiple message parsing for tpdus to simplify things for future bug fixes and to make the code logic clearer.
Encapsulate the following functions:
dissect_gtp_tpdu_by_handle
dissect_gtp_tpdu_as_pdcp_lte_info
dissect_gtp_tpsu_as_pdcp_nr_info
Note: The original code function is not changed.
2022-04-21 17:30:25 +00:00
John Thacker a30d6a442e GTP: Update checked messages
Updating the message checking for 3GPP TS 29.060 V16.0.0,
adding 7.5A MBMS Messages and 7.5B MS Info Change Reporting Messages.

This adds all the messages from TS 29.060. Some of them could be
updates to use the GSN specific fields in some cases. Also the
ETSI message checking needs to be updated to handle GTP' correctly.
2022-02-01 23:02:23 -05:00
John Thacker 0582cc7a68 GTP: Add UE Registration Query messages
Add message types 61 and 62, UE Registration Query Request and
Response, that first appeared in Rel 13.
2022-02-01 22:34:49 -05:00
John Thacker b7dc881571 GTP: Update more checked message contents to V16.0.0
Update 7.4 Location Management and 7.5 Mobility Management messages
to 3GPP TS 29.060 V16.0.0 for the check_etsi preference.
2022-02-01 22:13:25 -05:00
John Thacker 7023907c57 GTP: Add Initiate PDP Context Activation to checked messages
Add 7.3.12 and 7.3.13 Initiated PDP Context Activation Request
and Response to checked messages on UMTS.
2022-02-01 21:16:49 -05:00
John Thacker 185a5b3473 GTP: Update ETSI checked Tunnel Management Messages to V16.0.0
Update the optional IEs for the Tunnel Management messages to
3GPP TS 29.060 V16.0.0 for when the check_etsi preference is on.
2022-02-01 20:58:59 -05:00
John Thacker f201f23299 GTP: Use alternative GSN address decoders for Update PDP Resp
The GGSN addresses for control plane and user traffic are both
included or both not included in the Update PDP Context Response
message (included if the Cause is Request Accepted), so we know
which one is the control plane and which one is the user plane.
Also fix the coment about the IEs for the alternative address, and
that they are Conditional, not Optional.
2022-02-02 01:39:12 +00:00
John Thacker ee8a4fdfd7 GTP: Fix cut and paste wrong offset MBMS PCO
Fix the recently added MBMS PCO IE. Related to #17839.
2022-01-28 21:06:33 -05:00
easonweii 6c9662eda4 GTP: Add dissection for Source RNC PDCP Context Info IE
Add dissection for Source RNC PDCP Context Info (7.7.61) IE.
Related to #17839
2022-01-28 05:02:13 +00:00
John Thacker 84c89b8f6c GTP': Support Release 15 and higher CDRs
The Release Identifer field is only one nibble in GTP'. So in
Release 15 of 3GPP TS 32.295, an extra octet, Release Identifier
Extension, was added to support CDRs encoded with Release 16 and
higher of TS 32.298. Fix #17903.
2022-01-27 05:24:16 +00:00
John Thacker f31881ef0b GTP: Fix wrong GGSN control plane address field
Fix a typo / copy and paste error
2022-01-26 19:33:44 -05:00
John Thacker e4a33d22a8 GTP: Add MBMS UE Info IE
Add MBMS UE Info IE (7.7.55) and Enhanced NSAPI (7.7.67) IEs.
Related to #17839.
2022-01-23 21:50:55 -05:00
John Thacker fbeee407b4 GTP: Fix wrong value_string for PDP organization
PDP organization in PDP context should use its own value string,
not the value string for the PDP type number.
2022-01-23 13:23:27 -05:00
John Thacker fb37fe8537 GTP: Support Additional Trace Info IEs
Support 7.7.62 Additional Trace Info IE and 7.7.68 Additional
MBMS Trace Info IE. Related to #17839.
2022-01-23 10:29:53 -05:00
John Thacker f7ea4ab085 GTP: Dissect two IEs from BSSGP
Dissect two IEs that are transparent container from BSSGP (3GPP TS
48.018), 7.7.72 BSS Container and 7.7.78 List of set-up PFCs.
Related to #17839.
2022-01-22 14:32:21 -05:00
Eason Wei 7005b047a4 GTP: add dissection of IE's for some "for future use" 2022-01-22 12:06:34 +00:00
John Thacker 470b6b17ad GTP: Dissect more undecoded IEs
Dissect MBMS Protocol Configuration Options, Operator Selection Entity,
and PDU Numbers. Related to #17839.
2022-01-22 00:42:05 -05:00
John Thacker f57919d6ba GTP: Dissect CSG related IEs
Dissect User CSG Information (UCI), CSG Information Reporting Action,
CSG ID, and CSG Membership Indication IEs. Related to #17839.
2022-01-21 20:38:06 +00:00
Jaap Keuter f37d8bad53 GTP: add dissection of various IE's 2022-01-21 20:26:48 +00:00
John Thacker b2f78b47b4 GTP: Don't include padding in the RAC in ULI
From 3GPP TS 29.06 V 17.1.0 7.7.51:
The routing area code consists of 2 octets and is found in octet 10
and octet 11. Only the first octet (10) contains the RAC and the
second octet (11) is coded as "11111111".

Don't include the spare octet 11 in the RAC field. The RAC is only
one octet.
2022-01-21 08:49:36 -05:00
John Thacker 56f1ee5c3a GTP: Support Cell Identification IE
Related to #17839.
2022-01-21 07:48:18 -05:00
John Thacker f5bb44f75f GTP: Add CAMEL Charging Information Container IE
Add CAMEL Charging Information Container IE (type 155) from
ETSI TS 129 060 7.7.54. Related to #17839
2022-01-20 09:33:29 -05:00
John Thacker feebf6bc65 GTP: Add some undecoded IEs
Add some undecoded IEs from 3GPP TS 29.060 V17.1.0:
Hop Counter (163), Signaling Priority Indication (203), Signaling
Priority Indication with NSAPI (204), ULI Timestamp (214),
and LHN-ID with NSAPI (215). Related to #17839.
2022-01-19 21:40:29 -05:00
Alexis La Goutte 7843c1fa89 GTP: Add Extended Commong Flags IE
from https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1595

Fix #17855
2022-01-18 05:35:44 +00:00
Moshe Kaplan 69d54d6f8e Corrects repeated words throughout the code.
Repeated words were found with:
egrep "(\b[a-zA-Z]+) +\1\b" . -Ir
and then manually reviewed.
Non-displayed strings (e.g., in comments)
were also corrected, to ease future review.
2021-12-22 11:01:11 +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 19dcb725b6 epan: Remove STR_ASCII and STR_UNICODE
These display bases work to replace unprintable characters so the
name is a misnomer. In addition they are the same option and this
display behaviour is not something that is configurable.

This does not affect encodings because all our internal text strings
need to be valid UTF-8 and the source encoding is specified using
ENC_*.

Remove the assertion for valid UTF-8 in proto.c because
tvb_get_*_string() must return a valid UTF-8 string, always, and we
don't need to assert that, it is expensive.
2021-12-03 04:35:56 +00:00
Martin Mathieson a5df18e51e Fix some spelling errors 2021-10-11 04:44:49 +00:00
Evan Huus 0eda51a646 to_str: scope tvb_ip6_to_str 2021-10-07 13:31:23 -04:00
Evan Huus 07f5472aa7 to_str: scope tvb_ip_to_str 2021-10-07 10:25:12 -04:00
Michail Koreshkov 88657fd57e gtp: alternative GSN address decoders
All fields with GSN address were decodes as common hf_gsn_addr. But if
ETSI order is used, it's possible to specify alternative decoder
depending on message type and field position.
Alternative decoder for GSN address was added for mandatary fields and
optional/conditional field in the case there is single GSN address in
message.

Added new function as common dissector for all addr types.
2021-08-26 16:25:15 +00:00
Andreas Schultz 9e29ec0940 RADIUS: replace ULI decoder with version from GTPv2
Reuse the DIAMETER dissector for 3GPP-ULI for RADIUS as well.

The DIAMETER dissector for 3GPP-ULI IE is more complete than the RADIUS
version. The format of the IE is the same in RADIUS and DIAMETER.
2021-07-08 08:56:45 +00:00
Martin Mathieson 5b0afb1722 GTP: set RoHC once when calling PDCP-NR 2021-05-26 10:06:03 +01:00
ranjetsih 5177437f30 "GTP: add option to decode T-PDU Data with a plugin dissector"
As of now GTP dissector provides option to decode T-PDU data ether, async, and with some heuristics.

But there is no option present to decode a new protocol with a plugin.

This change adds an option to decode T-PDU data with a plugin, to help develop and test new protocols that are
encapsulated as GTP T-PDU data.
2021-03-23 08:02:43 +00:00