Commit Graph

44120 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
João Valverde 92b4e3277c Fix dissector -Wrestrict warnings
[31/254] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-bssgp.c.o
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-bssgp.c: In function ‘de_bssgp_cell_id’:
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-bssgp.c:859:9: warning: ‘snprintf’ argument 4 overlaps destination object ‘add_string’ [-Wrestrict]
  859 |         snprintf(add_string, string_len, "%s, CI %u", add_string, ci);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-bssgp.c: In function ‘de_bssgp_rim_routing_inf’:
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-bssgp.c:2313:17: warning: ‘snprintf’ argument 4 overlaps destination object ‘add_string’ [-Wrestrict]
 2313 |                 snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-bssgp.c: In function ‘de_bssgp_rnc_identifier’:
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-bssgp.c:2767:9: warning: ‘snprintf’ argument 4 overlaps destination object ‘add_string’ [-Wrestrict]
 2767 |         snprintf(add_string, string_len, " %s, RNC-ID %u", add_string, rnc_id);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[85/254] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-gsm_a_bssmap.c.o
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-gsm_a_bssmap.c: In function ‘be_cell_id_type’:
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-gsm_a_bssmap.c:1842:21: warning: ‘snprintf’ argument 4 overlaps destination object ‘add_string’ [-Wrestrict]
 1842 |                     snprintf(add_string, string_len, "%s/RNC-ID (%u)", add_string, value);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-gsm_a_bssmap.c:1869:17: warning: ‘snprintf’ argument 4 overlaps destination object ‘add_string’ [-Wrestrict]
 1869 |                 snprintf(add_string, string_len, "%s/CI (%u)", add_string, value);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[137/254] Building C object epan/dissectors/CMakeFiles/dissectors.dir/packet-mswsp.c.o
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-mswsp.c: In function ‘get_name_from_fullpropspec’:
/home/jpv/code/wireshark/wireshark/epan/dissectors/packet-mswsp.c:2975:25: warning: ‘snprintf’ argument 4 overlaps destination object ‘dest’ [-Wrestrict]
 2975 |                         snprintf(dest, bufsize, "%s <INVALID>", dest);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-12-19 20:25: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
João Valverde c5a19582e4 epan: Convert to use stdio.h from GLib
Replace:
    g_snprintf() -> snprintf()
    g_vsnprintf() -> vsnprintf()
    g_strdup_printf() -> ws_strdup_printf()
    g_strdup_vprintf() -> ws_strdup_vprintf()

This is more portable, user-friendly and faster on platforms
where GLib does not like the native I/O.

Adjust the format string to use macros from intypes.h.
2021-12-19 19:29:53 +00:00
Martin Mathieson 3b675f0fc1 5co-legacy: fix a filter string 2021-12-19 17:39:02 +00:00
João Valverde f75b79a59d Move wmem string utility functions to wsutil 2021-12-19 10:47:50 +00:00
Martin Mathieson 62a747bae3 file-jpeg: Fix value in vals_ifd_tags_exif[] 2021-12-18 11:43:03 +00:00
Joel Colledge f4123939d1 DRBD: Tidy up choice of display base for fields
When the dissector was added, BASE_HEX_DEC was used by default for many
fields. This is often not the most appropriate display format. The
biggest change is that all fields referring to sizes in bytes now
consistently use BASE_DEC_HEX.
2021-12-18 07:06:52 +00:00
Joel Colledge 217228eece DRBD: Decode two-phase commit payloads
This part of the DRBD protocol requires some state to correctly decode.
So we use a conversation to associate the packets. This conversation
stores a map of the two-phase commit data required for decoding later
packets.
2021-12-18 07:06:52 +00:00
Joel Colledge 4a28f5704f DRBD: Use CF_FUNC with BASE_CUSTOM
This is apparently necessary to prevent compilations warnings in certain
build environments.
2021-12-18 07:06:52 +00:00
Joel Colledge 583169ce06 DRBD: Add implicit data sizes as fields
Packets such as P_DATA do not have a dedicated field containing the size
of the data. It is simply the amount of extra data in the packet. It is
useful to be able to show or filter by this value, so add it as a
separate field.

Also combine the "blksize" and "size" fields, since they have the same
meaning.

Finally, remove some duplicates of the function decode_payload_data.
2021-12-18 07:06:52 +00:00
Joel Colledge 34f5c2c344 DRBD: Decode barrier numbers and block IDs little-endian
These values are opaque handles as far as the protocol is concerned.
They are sent from some node A to B, and then back from B to A. For node
B they have no meaning other than as a handle. However, on node A they
do have meaning, so it is useful to be able to interpret them. In
practice, they are usually little-endian encoded, so decode them
accordingly.
2021-12-18 07:06:52 +00:00
Antoine Gardiol e4cd4f92f8 5co-legacy: Fix dissector unique hash computing
*** CID 1495425:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT) in packet-5co-legacy.c: 765 in fiveco_hash()
2021-12-18 06:29:41 +00:00
Pau Espin de3359fe3e IuUP: Use proto_tree_add_checksum() to show CRC Header
Use standarized API to show checksum information. This also does the
checksum validation and shows computed CRC if found incorrect, etc.
2021-12-17 23:47:06 +00:00
Pau Espin f81a64e2bf IuUP: Fix CRC Header checks
All the packets coming from a known working source (nano3g femtocell)
where being shown as containing wrong CRC Header in Wireshark.

pcap file: https://osmocom.org/attachments/download/4744/3g_call_23112021.pcapng
2021-12-17 23:47:06 +00:00
João Valverde b054f9aee6 ASN1: Convert I/O from GLib to stdio.h 2021-12-17 19:34:54 +00:00
Martin Mathieson 834312cb62 DCT2000: For ipprim frames, show header even when no payload dissector 2021-12-17 16:37:22 +00:00
João Valverde 5bba669579 Remove some lingering uses of g_assert()
Also replace some incorrect uses of g_assert_true().

  g_assert_true -> g_assert -> ws_assert
2021-12-16 10:19:45 +00:00
Jaap Keuter 9539f4e1d6 MMDBR: Don't pretend to be a multithreaded writer 2021-12-16 09:28:54 +00:00
Antoine Gardiol 4248e5b665 5co-legacy: New FiveCo Legacy dissector 2021-12-16 09:13:37 +00:00
Brian Sipos a8b4bffab5 TCPCL: Display extension names from dissectors
Dissector names allow extension items to be given standard text names.
This also uses a protocol-in-name-only to avoid the frame.protocols field from containing ":tcpcl:tcpcl:tcpcl:..." for each extension dissection.
2021-12-16 05:13:52 +00:00
João Valverde 9d97b8e361 JSON: Remove unnecessary hfindex lookup 2021-12-15 20:49:51 +00:00
Martin Mathieson bf15343241 Fix some spelling errors 2021-12-15 12:28:16 +00:00
Richard Sharpe 2b2c81a551 ieee80211-radiotap: Fix a problem with S1G 0-length PPDUS.
The code was not advancing the offset correctly and mis-dissecting NDP
frames.
2021-12-15 07:06:33 +00:00
Joakim Karlsson b46bdd77fc JSON: add handling of 3GPP NAS-5G IEs 2021-12-15 06:33:40 +00:00
AndersBroman d4e5f72fe2 RTCP: fixed a possible sigsegv 2021-12-15 06:32:29 +00:00
AndersBroman 1f91d4c9d2 RTCP: Make it possible to do decode as SRTCP 2021-12-14 19:31:47 +00:00
Martin Mathieson b76a2b7a23 O-RAN FH CUS: add some comments around u-plane dissection 2021-12-14 10:54:26 +00:00
John Thacker 9338aec867 BER: Fix typo swap in error message 2021-12-13 19:48:31 -05:00
João Valverde fb0e1a4907 regex: Remove requirement for ssize_t
The type ssize_t is not available on Windows. Because this is
used in the public API we must provide a definition for it.
To avoid having to add a header to fix this use a size_t in
the API instead, and assign SIZE_MAX to represent a null
terminated string.
2021-12-13 23:57:32 +00:00
Federico Di Pierro 41bfc91124 dissectors: re-generated sysdig events using provided tool.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-12-13 14:30:30 +00:00
Federico Di Pierro c22b8bcb5f dissectors: various fixes to sysdig packet dissector.
Mainly:
* added 3 new procexit event params
* avoid sigsegv when sysdig event has
a number of params that is
greater of the wireshark one.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-12-13 14:30:30 +00:00
Moshe Kaplan 6ecc6a2ab4 epan/addr_and_mask.h: Document functions
Document functions in epan/addr_and_mask.h
so doxygen documentation is generated for them.
2021-12-13 12:42:04 +00:00
Richard Sharpe 4916bc024e ieee802-radiotap: Fix a silly issue with the S1G radiotap dissector.
The dissector was not correctly handling the Tag and Length.
2021-12-13 09:33:14 +00:00
João Valverde f5f8d9ebb6 dfilter: Fix token associativity
TEST_EQ and TEST_NE are unused. Replace by the correct values
and add missing token to string representations.
2021-12-13 01:24:18 +00:00
John Thacker 2df6ab0906 ieee80211: BASE_HEX and BASE_CUSTOM are mutually exclusive 2021-12-12 17:09:34 -05:00
John Thacker 9a054d7837 IEEE80211: Remove ENC_NA from string encoding
With the recent commit changing the pre commit check, need
this to make a different change.
2021-12-12 21:41:35 +00:00
John Thacker a68be23b7e proto: Don't crash on adding 64 bit BASE_CUSTOM column
Similar to elsewhere, in proto_custom_set don't call hf_try_val[64]_to_str
if BASE_CUSTOM is set, even if hfinfo->strings is non-null. Fix #17762.
2021-12-12 21:22:57 +00:00
Oscar Gonzalez de Dios e29c6691d0 PCEP: As per RFC 8408, RP object can have optional TLVs.
The decoding of TLVs in RP object is added
2021-12-12 19:45:22 +00:00
Gerald Combs a6cffab3a1 [Automatic update for 2021-12-12]
Update manuf, services enterprise numbers, translations, and other items.
2021-12-12 17:54:42 +00:00
João Valverde f52611de89 Remove obsolete macro HFI_DECLS 2021-12-12 13:24:51 +00:00
João Valverde b332c3dd0b Netlink netfilter: Fix a pre-commit check
epan/dissectors/packet-netlink-netfilter.c:  FT_UINT32:        proto_tree_add_item(tree, hf_nfq_hwaddr_addr, tvb, offset, addrlen, [[ENC_BIG_ENDIAN]-->[ENC_NA]]);

(These messages are wrong, this field is FT_ETHER, not FT_UINT32).
2021-12-12 13:24:51 +00:00
João Valverde 47651506bf Netlink psample: Fix a pre-commit check
epan/dissectors/packet-netlink-psample.c (15 (of 15) fields)
netlink.psample.cmd doesn't match PROTOABBREV of netlink-psample
netlink.psample.attr_type doesn't match PROTOABBREV of netlink-psample
netlink.psample.iifindex doesn't match PROTOABBREV of netlink-psample
netlink.psample.oifindex doesn't match PROTOABBREV of netlink-psample
netlink.psample.origsize doesn't match PROTOABBREV of netlink-psample
netlink.psample.sample_group doesn't match PROTOABBREV of netlink-psample
netlink.psample.group_seq_num doesn't match PROTOABBREV of netlink-psample
netlink.psample.sample_rate doesn't match PROTOABBREV of netlink-psample
netlink.psample.tunnel doesn't match PROTOABBREV of netlink-psample
netlink.psample.group_refcount doesn't match PROTOABBREV of netlink-psample
netlink.psample.out_tc doesn't match PROTOABBREV of netlink-psample
netlink.psample.out_tc_occ doesn't match PROTOABBREV of netlink-psample
netlink.psample.latency doesn't match PROTOABBREV of netlink-psample
netlink.psample.timestamp doesn't match PROTOABBREV of netlink-psample
netlink.psample.proto doesn't match PROTOABBREV of netlink-psample
2021-12-12 13:24:51 +00:00
João Valverde cace66d45d The macro 'va_copy' is C99, use that 2021-12-12 11:56:17 +00:00
João Valverde 7cffcfa835 dfilter: Remove a default switch case 2021-12-12 10:16:27 +00:00
Роман Донченко a027211ea2 jpeg: Implement dissection for Exif-specific IFDs 2021-12-12 07:29:31 +00:00
Роман Донченко e5e2974546 jpeg: Don't create an unnecessary dummy tree item
Exif does not define the order of elements in the Exif data, so if there's
empty space in front of IFD #0, it might be used for other IFDs or standalone
values.

As such, don't create a dummy tree item covering that space.
2021-12-12 07:29:31 +00:00
João Valverde f5a40ada4d Netfilter rtnetlink: Fix some names for consistency 2021-12-11 17:02:16 +00:00
João Valverde 6c5d00a746 epan: Remove obsolete function proto_register_fields_manual()
Related with #17774.
2021-12-11 17:02:16 +00:00
João Valverde a38c4ea454 Netlink: Convert to normal proto tree API 2021-12-11 17:02:12 +00:00