Commit Graph

61 Commits

Author SHA1 Message Date
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
John Thacker 06c1bbb2be gsm_map: stat table formatting in cli
The TABLE_ITEM_FLOATs (Avg Bytes, etc.) in the stat table need a float
format string, or else unpredictable output happens with tshark.
2021-12-06 23:15:55 -05: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
Anders Broman 6e4e4ebd50 GSM-MAP: Dissect SM-DeliveryFailureCause variants
V1 version may omit SEQUENCE and have only the SM_EnumeratedDeliveryFailureCause element.
2021-11-08 16:12:23 +01:00
Anders Broman a757a93208 GSM MAP Update to 3GPP TS 29.002 V17.1.0 (2021-06) 2021-09-28 10:17:55 +02:00
Anders Broman d7a8a55d2a GSM MAP: Dissect message noteSubscriberPresent. 2021-09-28 04:59:19 +00:00
Anders Broman 062994e089 GSM MAP: Handle Version 1 of ResetArg
Closes #17549
2021-09-02 09:36:44 +00:00
Evan Huus e69446aa55 asn1: convert most dissectors to pinfo->pool
Part 1/2 as the commits were too big for CI.

Largely find/replace, with a few manual tweaks. Then regenerate the asn1
dissector sources and make sure everything still builds. There are a
handful of cases I skipped as too complex, but this covers most of the
asn1 dissectors.
2021-07-26 15:30:11 +00:00
Anders Broman 96ed53bb68 GSM MAP:Use ENC_APN_STR 2021-05-24 06:37:03 +00:00
BasiL 3173a808a3 GSM_MAP: Error Code typo's fix
some of the error codes have missed last character
2021-04-20 20:16:20 +00:00
John Thacker 68ba60774f Prettify and standardize LAC, RAC, SAC, TAC in several ASN.1 dissectors
The LAC, RAC, SAC, and TAC tend to be defined in ASN.1 as OCTET STRINGS
of lengths 1, 2, or 3. It generally makes sense to dissect them as
FT_UINT[8,16,24], as appropriate, with BASE_DEC_HEX instead of as FT_BYTES,
so standardize on that.  See commit d6f91a7ca4
for similar work for S1AP.
2021-03-30 21:48:00 -04:00
Martin Kaiser 72468248c7 gsm_map: create and populate the stats table only once
Use the new stat_tap_find_table function during init to check if our
statistics table already exists.

If so, we can safely assume that its rows have already beend initialized.
All we have to do is clear the data that was collected by the tap.
2021-02-07 22:46:43 +00:00
Martin Kaiser dedfbc9d20 gsm_map: remove a variable that is always 0
There's just one table at index 0.
2021-01-14 10:02:19 +00:00
Guy Harris a883081b70 Update URLs pointing to the bug database.
Switch from bugs.wireshark.org to the GitLab issues list.
2020-10-03 07:54:12 -07:00
Martin Mathieson fc64ba242a More dissector spelling fixes. 2020-09-24 16:40:51 +00:00
Martin Mathieson 51cbb47e1f Fix some detected spelling errors in ASN1 dissectors.
Done by scanning the asan1 template files. If there are spelling
mistakes in the specifications, we should ignore.  Note that for z3950, I had
already found and accidentally fixed the same errors in the generated
file (before I taught my script to ignore gnerated dissector files).
2020-09-05 00:51:48 +00:00
Pascal Quantin 73eff55668 GSM MAP: fix typo in template file
g4c36f43612 changed the autogenerated file instead of the template one
2020-08-26 19:43:31 +02:00
Martin Mathieson 3b67c5b308 TFS: Add some commonly-defined string pairs to tfs.c
'check_tfs.py --common'    can look for tfs values that appear multiple times.
Current output prior to these dssector changes was:

('No Extension', 'Extension') appears 3 times in:  ['epan/dissectors/packet-bssap.c', 'epan/dissectors/packet-camel.c', 'epan/dissectors/packet-gsm_map.c']
('Optimised for signalling traffic', 'Not optimised for signalling traffic') appears 3 times in:  ['epan/dissectors/packet-gsm_a_gm.c', 'epan/dissectors/packet-gsm_map.c', 'epan/dissectors/packet-gtp.c']
('Data PDU', 'Control PDU') appears 3 times in:  ['epan/dissectors/packet-pdcp-lte.c', 'epan/dissectors/packet-pdcp-nr.c', 'epan/dissectors/packet-rlc-nr.c']
('Message sent to originating side', 'Message sent from originating side') appears 3 times in:  ['epan/dissectors/packet-q2931.c', 'epan/dissectors/packet-q931.c', 'epan/dissectors/packet-q933.c']
('User', 'Provider') appears 3 times in:  ['epan/dissectors/packet-q2931.c', 'epan/dissectors/packet-q931.c', 'epan/dissectors/packet-q933.c']

The first and last ones were made common, the others seem a little too specialised.

Checking some of the existing items in tfs.c (using QtCreator's 'Find Usages'),
some of the common items are used a lot, but many of them are not referenced.

Change-Id: Ia4006d2c4fa7cafbc3b004dc7a367a986dbeb0c4
Reviewed-on: https://code.wireshark.org/review/38177
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-17 02:58:01 +00:00
Guy Harris 524baee94f Add string encoding values for various BCD encodings, and use them.
Add some ENC_ values for various flavors of packed BCD, and use that
instead of explicitly calling tvb_bcd_dig_to_wmem_packet_str() and
adding the result.

Change-Id: I07511d9d09c9231b610c121cd6ffb3b16fb017a9
Reviewed-on: https://code.wireshark.org/review/36952
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-04-27 01:53:09 +00:00
Vasil Velichkov 13d5615db9 gsm_map: Dissect location number with the ISUP dissect function
There are at least two problems with the previous implemenation:

- The odd/even indicator was not used when dissecting the digits and
an additional 0 was displayed when location number has odd number of
digits.
- For International Numbers the correct NA is 4 and not 3 (national) and
for national numbers an incorrect country code is displayed.

Change-Id: If5bb143642205eab762fbccae28f131af28d89c0
Reviewed-on: https://code.wireshark.org/review/36720
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-06 05:55:45 +00:00
Martin Mathieson ec781e9749 proto: Add a debug check to sanity-check range_string
Check is enabled by #ifdef ENABLE_CHECK_FILTER
Remaining issues found by this check are fixed here,
along with a documentation note that the entries
are checked in order and the first match is used.

The only issue not yet fixed is in packet-isup.c,
where the spec was not available to me.

Change-Id: Ife747cda9b91a265bc2b81ce0a53f55f3389919e
Reviewed-on: https://code.wireshark.org/review/36708
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-04-05 17:40:21 +00:00
Peter Wu 0145bd0ce5 asn1: fix -Wmisleading-indentation warnings with Clang 10
A lot of auto-generated ASN.1 dissectors have broken identation and
Clang 10 started warning about them for the first time. Fix these by
using 2 spaces as indentation instead of 2, none, or tabs.

Change-Id: Ia91668596c2f5000954d2265c39cc5dba18e44a7
Reviewed-on: https://code.wireshark.org/review/36368
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-03-11 04:18:46 +00:00
Anders Broman 1b7261727a GSM MAP: Update to V15.5.0 (2019-06)
Change-Id: I7ff9ca683ba085f05b948c069eaeab9dffaf6605
Reviewed-on: https://code.wireshark.org/review/34676
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-10-02 12:37:15 +00:00
Anders Broman 88096e1fc5 GSM MAP: Fix dissection of authenticationSet in SentParameterList
Ber choice called with a non FT_UINT hf variable. Work around by
duplicating ASN1 code.

Change-Id: I71b38e25288f222058793110eb43c122c012dcca
Reviewed-on: https://code.wireshark.org/review/33191
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-05-14 11:48:56 +00:00
Anders Broman a44e838158 GSM MAP: Update to V15.4.0 (2018-12)
Change-Id: I2ce50236b963e14e48214e8a72a98bec96cfea71
Reviewed-on: https://code.wireshark.org/review/32958
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-23 13:38:55 +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
Vasil Velichkov 122cc388a2 GSM MAP: Dissect several LocationInformationEPS's subparameters
Change DiameterIdentity's field type to FT_STRING and add dissection of
- E-UTRAN Cell Global Identity
- Tracking Area Identity
- GeographicalInformation
- GeodeticInformation

Change-Id: Ifff52b511f495b281318778f6007be896748e4ce
Reviewed-on: https://code.wireshark.org/review/32128
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-02-25 14:17:59 +00:00
Guy Harris 2d41b15495 Add a "failed" return for tap packet routines.
This allows taps that can fail to report an error and fail; a failed
tap's packet routine won't be called again, so they don't have to keep
track of whether they've failed themselves.

We make the return value from the packet routine an enum.

Don't have a separate type for the per-packet routine for "follow" taps;
they're expected to act like tap packet routines, so just use the type
for tap packet routines.

One tap packet routine returned -1; that's not a valid return value, and
wasn't one before this change (the return value was a boolean), so
presume the intent was "don't redraw".

Another tap routine's early return, without doing any work, returned
TRUE; this is presumably an error (no work done, no need to redraw), so
presumably it should be "don't redraw".

Clean up some white space while we're at it.

Change-Id: Ia7d2b717b2cace4b13c2b886e699aa4d79cc82c8
Reviewed-on: https://code.wireshark.org/review/31283
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-01 05:03:42 +00:00
Jeff Morriss 8087b610e8 GSM MAP: register a few more MAP SSNs by default.
SSNs 145 and 148-150 are all used by MAP so register for them.

This allows Wireshark to decode messages between, for example, an SGSN and
GMLC without having to touch the dissector preferences.

Change-Id: Iaaad668bcde074a2a89d3de605659849856dc396
Reviewed-on: https://code.wireshark.org/review/30531
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-11-07 18:50:07 +00:00
dishadaniel 236af95178 Added support for new proprietary fields (private extensions) for Ericsson.
Change-Id: Ie97289527dbcef7e5d18e5e152659ebb5de9bc19
Reviewed-on: https://code.wireshark.org/review/27940
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-04 12:17:18 +00:00
Vasil Velichkov d0823e3920 GSM MAP: Dissect SM-RP-SMEA
According to 3GPP TS 29.002 this parameter contains an address field
which is encoded as defined in 3GPP TS 23.040.

Change-Id: If82a09e43729a90ede1619da34e50ed5d14e869a
Reviewed-on: https://code.wireshark.org/review/27569
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-05-16 18:07:59 +00:00
Guy Harris afad14dcfe Get rid of some GTK+-only stuff.
Change-Id: I85806476246a567f747e3911e3d15716e9cfe06b
Reviewed-on: https://code.wireshark.org/review/27514
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-13 20:21:14 +00:00
Dario Lombardo 4a156da068 Remove autotools build system.
It has been replaced by cmake.

Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a
Reviewed-on: https://code.wireshark.org/review/26969
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18 03:46:17 +00:00
Dario Lombardo 692cef88c7 dissectors: more SPDX license convertions.
Change-Id: I96e1f1cdbaaf49d65705ecacc903f73cf0e47d7c
Reviewed-on: https://code.wireshark.org/review/26334
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2018-03-07 17:18:47 +00:00
Guy Harris c61b543e97 Get rid of more new_ prefixes for statistics functions and types.
There are no "old" versions of them that we're keeping around.

Change-Id: I3c76a14d0ec1a06df39c547da37f4dea9987df4d
Reviewed-on: https://code.wireshark.org/review/25892
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-19 00:12:51 +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
AndersBroman 445c0bb747 [GSM MAP] Propagate top_tree to external message handlers.
Change-Id: Ib3d0a43c0cdeca0ed32ff4dfef13c66e485fb0fb
Reviewed-on: https://code.wireshark.org/review/23304
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-30 10:44:55 +00:00
AndersBroman ed6239d17e [GSM MAP] Get rid of a global variable and use the new
dissector_try_uint_new() interface.

Change-Id: I714ca04f43c00017969e8655614566df4c53e5e9
Reviewed-on: https://code.wireshark.org/review/23288
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Tomáš Kukosa <tomas.kukosa@ixperta.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-29 16:18:02 +00:00
AndersBroman 6726d9e0cd [GSM MAP] Dissect Ext2-QoS-Subscribed, Ext3-QoS-Subscribed and
Ext4-QoS-Subscribed

Change-Id: Ic6a0f80d5f2339fd90284d1fddffe57b66c6771d
Reviewed-on: https://code.wireshark.org/review/23108
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-08-18 08:14:08 +00:00
Guy Harris 01f2e2b201 We really only need one range_foreach routine.
Rename range_foreach_r() to range_foreach(), getting rid of the old
range_foreach().

If your callback doesn't require an additional argument, just pass NULL
when calling range_foreach(), and declare the argument as unused.

Change-Id: I49a56f90610e39cf2ddc398c9e30ed11a6ca90db
Reviewed-on: https://code.wireshark.org/review/23025
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-08-08 22:06:27 +00:00
Pascal Quantin f9997eebd9 GSM SMS: use TCAP OTID as last resort for reassembly when GSM MAP does not give info
Bug: 13592
Change-Id: Ie13e7466da906e72418c6f9d5ea6f816ff14e129
Reviewed-on: https://code.wireshark.org/review/21425
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-04-30 17:06:42 +00:00
Pascal Quantin fb1a6320ec GSM MAP: use TCAP OTID to retrieve SM-RP-OA and SM-RP-DA fields when required
Bug: 13592
Change-Id: Ib8a0ff6d897699c44e5c4b8834123169066cf904
Reviewed-on: https://code.wireshark.org/review/21397
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-04-29 06:04:18 +00:00
Pascal Quantin 4b2ee36743 GSM SMS: optionally use GSM-MAP info to perform reassembly (off by default)
Change-Id: I62c7a04e62167bd2d68d861f1d8d854f3159b159
Ping-Bug: 13592
Reviewed-on: https://code.wireshark.org/review/21306
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2017-04-24 18:59:36 +00:00
AndersBroman 0c597f111f [GSM MAP] Update to 3GPP TS 29.002 V14.3.0 (2017-03).
Change-Id: I97a4ee7cdcb8644a4f2e3f108842d4c28d788c54
Reviewed-on: https://code.wireshark.org/review/21076
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-04-13 16:40:11 +00:00
Alexis La Goutte c1e6724cf6 dissectors: fix this statement may fall through [-Werror=implicit-fallthrough=] found by gcc7
Change-Id: Iba6238988ded675cba328ab512232d1919d93b4a
Reviewed-on: https://code.wireshark.org/review/20415
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-03-05 22:39:13 +00:00
Guy Harris c303679d99 Decode TBCD strings in GSM MAP as per the GSM MAP spec.
Hex digits 0xa through 0xe are '*', '#', 'a', 'b', and 'c',
respectively.

Constify the dgt_set_t argument to tvb_bcd_dig_to_wmem_packet_str(),
while we're at it.

Bug: 13316
Change-Id: I7586f35d23fd262453779d99946e7ccad4b6ffab
Reviewed-on: https://code.wireshark.org/review/19620
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-01-13 07:16:30 +00:00
Michael Mann 6a6d7ea34f Convert range API to always use wmem memory.
This is mostly to address memory leaks in range preferences (the biggest
user of range functionality) on shutdown.
Now range preferences must use epan scoped memory when referencing
internal preference structures to keep consistency.

Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157
Reviewed-on: https://code.wireshark.org/review/19387
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-07 00:44:10 +00:00
Dario Lombardo 479323072c gsm_map: use ws_strtoi in template.
Change-Id: I682955b3c58695d831d6d8013eaa77d347a0ec2e
Reviewed-on: https://code.wireshark.org/review/17820
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-22 03:41:23 +00:00
Guy Harris a4c8ebc18b Don't do any Decode As stuff for dissector tables not used with Decode As.
Have all dissector tables have a "supports Decode As" flag, which
defaults to FALSE, and which is set to TRUE if a register_decode_as()
refers to it.

When adding a dissector to a dissector table with a given key, only add
it for Decode As if the dissector table supports it.

For non-FT_STRING dissector tables, always check for multiple entries
for the same protocol with different dissectors, and report an error if
we found them.

This means there's no need for the creator of a dissector table to
specify whether duplicates of that sort should be allowed - we always do
the check when registering something for "Decode As" (in a non-FT_STRING
dissector table), and just don't bother registering anything for "Decode
As" if the dissector table doesn't support "Decode As", so there's no
check done for those dissector tables.

Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed
Reviewed-on: https://code.wireshark.org/review/17402
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-31 00:08:01 +00:00
Michael Mann a062c80236 ASN.1 dissectors - don't try to find yourself.
If an ASN.1 dissector is calling register_dissector for itself in its proto_register_xxx
function and then calling find_dissector for itself in its proto_reg_handoff_xxx
function then just create a static handle for that dissector and use the return
value of register_dissector, so the find isn't necessary.

Change-Id: I911bdadc2fb4259601c141b955e741a2369cc447
Reviewed-on: https://code.wireshark.org/review/16233
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>
2016-07-01 14:26:20 +00:00