From 83c73a83ad9ec7baa4bbf06d6da9cdd91009d5ed Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 5 Feb 2025 19:55:12 -0800 Subject: [PATCH 1/9] wscbor: Add a recursion check Blind-ish attempt at fixing #20373 --- epan/wscbor.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/epan/wscbor.c b/epan/wscbor.c index 2e2873c590..f1ac2baaa2 100644 --- a/epan/wscbor.c +++ b/epan/wscbor.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include "wscbor.h" @@ -365,7 +366,12 @@ bool wscbor_is_indefinite_break(const wscbor_chunk_t *chunk) { * an indefinite break. * @return True if the skipped item was fully valid. */ -static bool wscbor_skip_next_item_internal(wmem_allocator_t *alloc, tvbuff_t *tvb, int *offset, bool *is_break) { +// NOLINTNEXTLINE(misc-no-recursion) +static bool wscbor_skip_next_item_internal(wmem_allocator_t *alloc, tvbuff_t *tvb, int *offset, bool *is_break, unsigned depth) { + if (depth > prefs.gui_max_tree_depth) { + + return false; + } wscbor_chunk_t *chunk = wscbor_chunk_read(alloc, tvb, offset); if (wscbor_has_errors(chunk)) { wscbor_chunk_free(chunk); @@ -386,7 +392,7 @@ static bool wscbor_skip_next_item_internal(wmem_allocator_t *alloc, tvbuff_t *tv // wait for indefinite break bool was_break = false; do { - if (!wscbor_skip_next_item_internal(alloc, tvb, offset, &was_break)) { + if (!wscbor_skip_next_item_internal(alloc, tvb, offset, &was_break, depth + 1)) { return false; } } @@ -395,7 +401,7 @@ static bool wscbor_skip_next_item_internal(wmem_allocator_t *alloc, tvbuff_t *tv else { const uint64_t count = chunk->head_value; for (uint64_t ix = 0; ix < count; ++ix) { - if (!wscbor_skip_next_item_internal(alloc, tvb, offset, NULL)) { + if (!wscbor_skip_next_item_internal(alloc, tvb, offset, NULL, depth + 1)) { return false; } } @@ -407,7 +413,7 @@ static bool wscbor_skip_next_item_internal(wmem_allocator_t *alloc, tvbuff_t *tv // wait for indefinite break bool was_break = false; do { - if (!wscbor_skip_next_item_internal(alloc, tvb, offset, &was_break)) { + if (!wscbor_skip_next_item_internal(alloc, tvb, offset, &was_break, depth + 1)) { return false; } } @@ -416,10 +422,10 @@ static bool wscbor_skip_next_item_internal(wmem_allocator_t *alloc, tvbuff_t *tv else { const uint64_t count = chunk->head_value; for (uint64_t ix = 0; ix < count; ++ix) { - if (!wscbor_skip_next_item_internal(alloc, tvb, offset, NULL)) { + if (!wscbor_skip_next_item_internal(alloc, tvb, offset, NULL, depth + 1)) { return false; } - if (!wscbor_skip_next_item_internal(alloc, tvb, offset, NULL)) { + if (!wscbor_skip_next_item_internal(alloc, tvb, offset, NULL, depth + 1)) { return false; } } @@ -438,7 +444,7 @@ static bool wscbor_skip_next_item_internal(wmem_allocator_t *alloc, tvbuff_t *tv } bool wscbor_skip_next_item(wmem_allocator_t *alloc, tvbuff_t *tvb, int *offset) { - return wscbor_skip_next_item_internal(alloc, tvb, offset, NULL); + return wscbor_skip_next_item_internal(alloc, tvb, offset, NULL, 0); } bool wscbor_skip_if_errors(wmem_allocator_t *alloc, tvbuff_t *tvb, int *offset, const wscbor_chunk_t *chunk) { From 8612e4cd31112df9546f197e8fa5fd69affb5396 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Wed, 5 Feb 2025 22:14:20 -0500 Subject: [PATCH 2/9] Qt: Denote marked frames in Follow Stream Window The original request suggested highlighting them in the same color normally used for marked frames, but using reverse video still conveys the client/server information. Fix #20337 --- ui/qt/follow_stream_dialog.cpp | 9 ++++++++- ui/qt/widgets/follow_stream_text.cpp | 14 +++++++++++++- ui/qt/widgets/follow_stream_text.h | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp index 13c7d0e92a..2d0904aedb 100644 --- a/ui/qt/follow_stream_dialog.cpp +++ b/ui/qt/follow_stream_dialog.cpp @@ -611,7 +611,14 @@ FollowStreamDialog::followStream() void FollowStreamDialog::addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize) { - ui->teStreamContent->addText(std::move(text), is_from_server, packet_num, colorize); + bool marked = false; + frame_data *fdata = frame_data_sequence_find(cap_file_.capFile()->provider.frames, packet_num); + if (fdata) { + if (fdata->marked) { + marked = true; + } + } + ui->teStreamContent->addText(std::move(text), is_from_server, packet_num, colorize, marked); } // The following keyboard shortcuts should work (although diff --git a/ui/qt/widgets/follow_stream_text.cpp b/ui/qt/widgets/follow_stream_text.cpp index 564154e2bb..2e378a8018 100644 --- a/ui/qt/widgets/follow_stream_text.cpp +++ b/ui/qt/widgets/follow_stream_text.cpp @@ -51,7 +51,7 @@ void FollowStreamText::addTruncated(int cur_pos) } } -void FollowStreamText::addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize) +void FollowStreamText::addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize, bool marked) { if (truncated_) { return; @@ -71,6 +71,18 @@ void FollowStreamText::addText(QString text, bool is_from_server, uint32_t packe if (!colorize) { tcf.setBackground(palette().base().color()); tcf.setForeground(palette().text().color()); + } else if (marked) { + // We could use the normal marking color + //tcf.setForeground(ColorUtils::fromColorT(prefs.gui_marked_fg)); + //tcf.setBackground(ColorUtils::fromColorT(prefs.gui_marked_bg)); + // But a reverse video effect also conveys the server/client info + if (is_from_server) { + tcf.setForeground(ColorUtils::fromColorT(prefs.st_server_bg)); + tcf.setBackground(ColorUtils::fromColorT(prefs.st_server_fg)); + } else { + tcf.setForeground(ColorUtils::fromColorT(prefs.st_client_bg)); + tcf.setBackground(ColorUtils::fromColorT(prefs.st_client_fg)); + } } else if (is_from_server) { tcf.setForeground(ColorUtils::fromColorT(prefs.st_server_fg)); tcf.setBackground(ColorUtils::fromColorT(prefs.st_server_bg)); diff --git a/ui/qt/widgets/follow_stream_text.h b/ui/qt/widgets/follow_stream_text.h index 0276c87221..921e6773b1 100644 --- a/ui/qt/widgets/follow_stream_text.h +++ b/ui/qt/widgets/follow_stream_text.h @@ -18,7 +18,7 @@ class FollowStreamText : public QPlainTextEdit public: explicit FollowStreamText(QWidget *parent = 0); bool isTruncated() const { return truncated_; } - void addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize); + void addText(QString text, bool is_from_server, uint32_t packet_num, bool colorize, bool marked); void addDeltaTime(double delta); int currentPacket() const; From d1427b8628c4da363a5473527d201bf0b155f1c2 Mon Sep 17 00:00:00 2001 From: Andy Herron Date: Thu, 6 Feb 2025 09:19:51 +0000 Subject: [PATCH 3/9] Smb-Direct: Sample capture of request that spans packets --- ...bdirect-nonsmb-multi-packet-extract.pcapng.gz | Bin 0 -> 4530 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/captures/smbdirect-nonsmb-multi-packet-extract.pcapng.gz diff --git a/test/captures/smbdirect-nonsmb-multi-packet-extract.pcapng.gz b/test/captures/smbdirect-nonsmb-multi-packet-extract.pcapng.gz new file mode 100644 index 0000000000000000000000000000000000000000..2e43297b570f651575fa6e1da97849acd49fd7d1 GIT binary patch literal 4530 zcmV;j5l!wNiwFP!000003Z0mBP}N_z#=pR!4j>JO4(U9AfOJZSbe}^A9N-Xwbhngr z2}l`qcM3>LinN5Zw19*Hclhahz4Ol8J9FPPv-h+1+OzjOYya{2V}tSVz|;T$sEcz_ zq5uGJ`zP*dcWaVA3Sj)sF#rHC1>F?@pa&HIp67kr7X<;p-2h0<7!CM2k{ip!9onQJz5w6)NGyH&t;&PPfqxgwIY=wgYCIVQsISUXKA0g~@x| z<%$i;(QeMNW5d>SI15up6?B748YcVXR^tjvy^pc_<7WdVyhs?>bJ^+RZ&+~7oHpa@ z!&cG#9C0iO=Ag4-n&I_$AKUhLw7=M!f1yL(kkG0RsZaG3&bD3CeZ%mpE%!ds`6?vw zn$EgqY_SCv9>V*}tJF5Mh9CYxkN<~l%9DmOp|)}SID+26u0<4LpVwmceK)Y^ZO-7x zH8Yo|G20D_h6*b2QccXJ&^l|To$5o^nXwrnI0@X_l{VjYL4H~xNWGJ)$eK{qWK+6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t`1aYi*D?8k0gE&E0Dc=jw;}ezPM?v>KVm$#(cQWfE{bF`~3+ci5@8D3E`4fOpxi zRVPD;+vCpH%%BiA)|p=IJ)Kjc}-P;gl-1V#&CNyjmld zwu%QY|KvTz&8qCP=D>V%9pX_il7`|!Zn#kNWr7FUKu~Bgca%?i0_*(hC&Jazi)1^w z1@ST0n0$Gi6`gEbS$}a`uqSP4d2jlZ6Y9sI*ZwRAK$rGe);-`bR7jfvzSEKlBH}|5 zxwAi~z7S5W;slLD856|Xsz3Qj)laiMY0+)t-X>_#SM{1Y`65OVR%4n2CesX&|Tj0-hzg Q_}_2#U$mC;8{85A0AZlmvj6}9 literal 0 HcmV?d00001 From db65e3e5f8edac3fb5977aab5e18414997d9ec14 Mon Sep 17 00:00:00 2001 From: Cal Turney Date: Wed, 5 Feb 2025 16:59:56 -0500 Subject: [PATCH 4/9] SMB2: place delete_on_close in Packet List If the delete_on_close bit is set put "(delete on close)" on the create request and response, "(delete file)" or "(delete dir)" on the close request, and "(file deleted)" or "(dir deleted)" on the close response in the Packet List. --- epan/dissectors/packet-smb2.c | 29 +++++++++++++++++++++++++++++ epan/dissectors/packet-smb2.h | 2 ++ 2 files changed, 31 insertions(+) diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c index 799e4860e8..5ce0d31f03 100644 --- a/epan/dissectors/packet-smb2.c +++ b/epan/dissectors/packet-smb2.c @@ -6818,6 +6818,13 @@ dissect_smb2_close_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, which_tree = tree; } + if (si->file && si->file->delete_on_close) { + if (si->file->is_dir) + col_append_str(pinfo->cinfo, COL_INFO, ", (delete dir)"); + else + col_append_str(pinfo->cinfo, COL_INFO, ", (delete file)"); + } + /* Filename */ if (si->file && si->file->name) { item = proto_tree_add_string(which_tree, hf_smb2_filename, tvb, 0, 0, si->file->name); @@ -6893,6 +6900,13 @@ dissect_smb2_close_response(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *t /* File Attributes */ offset = dissect_fscc_file_attr(tvb, tree, offset, NULL); + if (si->file && si->file->delete_on_close) { + if (si->file->is_dir) + col_append_str(pinfo->cinfo, COL_INFO, ", (dir was deleted)"); + else + col_append_str(pinfo->cinfo, COL_INFO, ", (file was deleted)"); + } + if (pinfo->fd->visited) { if (si->file && si->file->name) { if (strcmp(si->file->name, "") == 0) @@ -10463,6 +10477,12 @@ dissect_smb2_create_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, offset = dissect_smb_access_mask(tvb, tree, offset); /* File Attributes */ + if (si->file) { + if (tvb_get_letohl(tvb, offset) & 0x10) + si->file->is_dir = TRUE; + else + si->file->is_dir = FALSE; + } offset = dissect_fscc_file_attr(tvb, tree, offset, NULL); /* share access */ @@ -10475,6 +10495,12 @@ dissect_smb2_create_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, /* create options */ offset = dissect_nt_create_options(tvb, tree, offset); + if (tvb_get_letohl(tvb, offset-4) & 0x1000) { + col_append_fstr(pinfo->cinfo, COL_INFO, ", (delete on close)"); + if (si->file) + si->file->delete_on_close = TRUE; + } + if (si->file) si->file->frame_beg = pinfo->fd->num; if (si->saved) @@ -10624,6 +10650,9 @@ dissect_smb2_create_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree if (si->saved) si->saved->uuid_fid = tag_guid; + if (si->file && si->file->delete_on_close) + col_append_fstr(pinfo->cinfo, COL_INFO, ", (delete on close)"); + /* Display the GUID subtree */ offset = dissect_smb2_fid(tvb, pinfo, tree, offset, si, FID_MODE_OPEN); diff --git a/epan/dissectors/packet-smb2.h b/epan/dissectors/packet-smb2.h index 4774e25b9d..f279fc38c3 100644 --- a/epan/dissectors/packet-smb2.h +++ b/epan/dissectors/packet-smb2.h @@ -50,6 +50,8 @@ typedef struct _smb2_fid_info_t { uint32_t frame_end; /* file name used to open this FID */ char *name; + gboolean is_dir; + gboolean delete_on_close; } smb2_fid_info_t; typedef enum { From 62a7b949e4638a62138e1c2c8fee88ffe16b5b4d Mon Sep 17 00:00:00 2001 From: Jaap Keuter Date: Thu, 6 Feb 2025 09:24:02 +0000 Subject: [PATCH 5/9] RTP: Have shim header dissector return 0 on error --- epan/dissectors/packet-cesoeth.c | 25 ++++++++++++++++--------- epan/dissectors/packet-rtp.c | 2 +- epan/dissectors/packet-rtp.h | 10 +++++++++- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/epan/dissectors/packet-cesoeth.c b/epan/dissectors/packet-cesoeth.c index c65242420f..32dae26b38 100644 --- a/epan/dissectors/packet-cesoeth.c +++ b/epan/dissectors/packet-cesoeth.c @@ -222,15 +222,22 @@ dissect_cesoeth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data int rtp_header_len = dissect_rtp_shim_header(tvb, offset, pinfo, cesoeth_tree, &rtp_info); - col_set_str(pinfo->cinfo, COL_PROTOCOL, "CESoETH (w RTP)"); - col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "RTP PT: %u, SSRC: 0x%X, Seq: %u, Time=%u", - rtp_info.info_payload_type, - rtp_info.info_sync_src, - rtp_info.info_seq_num, - rtp_info.info_timestamp - ); - - next_tvb = tvb_new_subset_length(tvb, offset + rtp_header_len, payload_len - rtp_header_len); + if (rtp_header_len > 0) + { + col_set_str(pinfo->cinfo, COL_PROTOCOL, "CESoETH (w RTP)"); + col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "RTP PT: %u, SSRC: 0x%X, Seq: %u, Time=%u", + rtp_info.info_payload_type, + rtp_info.info_sync_src, + rtp_info.info_seq_num, + rtp_info.info_timestamp + ); + + next_tvb = tvb_new_subset_length(tvb, offset + rtp_header_len, payload_len - rtp_header_len); + } + else + { + col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "RTP header missing"); + } } call_data_dissector(next_tvb, pinfo, tree); diff --git a/epan/dissectors/packet-rtp.c b/epan/dissectors/packet-rtp.c index 071b78f7a6..905127a69a 100644 --- a/epan/dissectors/packet-rtp.c +++ b/epan/dissectors/packet-rtp.c @@ -2747,7 +2747,7 @@ dissect_rtp_shim_header(tvbuff_t *tvb, int start, packet_info *pinfo _U_, proto_ proto_tree_add_uint( rtp_tree, hf_rtp_version, tvb, offset, 1, octet1); } - return offset; + return 0; } padding_set = RTP_PADDING( octet1 ); diff --git a/epan/dissectors/packet-rtp.h b/epan/dissectors/packet-rtp.h index 51b4270def..35ae4b6ff1 100644 --- a/epan/dissectors/packet-rtp.h +++ b/epan/dissectors/packet-rtp.h @@ -297,7 +297,15 @@ bluetooth_add_address(packet_info *pinfo, address *addr, uint32_t stream_number, const char *setup_method, uint32_t setup_frame_number, uint32_t media_types, void *data); -/* Dissect the header only, without side effects */ +/* Dissects the RTP header only, without side effects. + + @param tvb The tv buffer of the current data + @param start The start of RTP data in tvb + @param pinfo Packet info from the current protocol + @param tree The tree to append the RTP header dissection to + @param rtp_info structure with RTP header info + @return number of bytes consumed + */ WS_DLL_PUBLIC int dissect_rtp_shim_header(tvbuff_t *tvb, int start, packet_info *pinfo, proto_tree *tree, From 452aa3e23dacf7f7c9a6a42d7e786bee96a5644b Mon Sep 17 00:00:00 2001 From: Joakim Karlsson Date: Thu, 6 Feb 2025 11:44:18 +0100 Subject: [PATCH 6/9] radius: update 3GPP dictionary with missing values --- resources/protocols/radius/dictionary.3gpp | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/resources/protocols/radius/dictionary.3gpp b/resources/protocols/radius/dictionary.3gpp index 63ed0e042f..59840606b7 100644 --- a/resources/protocols/radius/dictionary.3gpp +++ b/resources/protocols/radius/dictionary.3gpp @@ -55,8 +55,8 @@ ATTRIBUTE 3GPP-Packet-Filter 25 octets ATTRIBUTE 3GPP-Negotiated-DSCP 26 byte ATTRIBUTE 3GPP-Allocate-IP-Type 27 byte -ATTRIBUTE External-Identifier 28 octets -ATTRIBUTE TWAN-Identifier 29 octets +ATTRIBUTE 3GPP-External-Identifier 28 octets +ATTRIBUTE 3GPP-TWAN-Identifier 29 octets ATTRIBUTE 3GPP-User-Location-Info-Time 30 octets ATTRIBUTE 3GPP-Secondary-RAT-Usage 31 octets ATTRIBUTE 3GPP-UE-Local-IP-Address 32 octets @@ -90,7 +90,13 @@ VALUE 3GPP-PDP-Type IPv4 0 VALUE 3GPP-PDP-Type PPP 1 VALUE 3GPP-PDP-Type IPv6 2 VALUE 3GPP-PDP-Type IPv4v6 3 +VALUE 3GPP-PDP-Type Non-IP 4 +VALUE 3GPP-PDP-Type Unstructured 5 +VALUE 3GPP-PDP-Type Ethernet 6 +# +# 0-9 specified in 3GPP TS 29.274 +# VALUE 3GPP-RAT-Type Reserved 0 VALUE 3GPP-RAT-Type UTRAN 1 VALUE 3GPP-RAT-Type GERAN 2 @@ -99,10 +105,24 @@ VALUE 3GPP-RAT-Type GAN 4 VALUE 3GPP-RAT-Type HSPA-Evolution 5 VALUE 3GPP-RAT-Type EUTRAN 6 VALUE 3GPP-RAT-Type Virtual 7 +VALUE 3GPP-RAT-Type EUTRAN-NB-IoT 8 +VALUE 3GPP-RAT-Type LTE-M 9 + +# +# 10+ Specified in 3GPP TS 29.061 +# +VALUE 3GPP-RAT-Type NR 51 +VALUE 3GPP-RAT-Type NR-Unlicensed 52 +VALUE 3GPP-RAT-Type Trusted-WLAN 53 +VALUE 3GPP-RAT-Type Trusted-Non-3GPP 54 +VALUE 3GPP-RAT-Type Wireline-Access 55 +VALUE 3GPP-RAT-Type Wireline-Cable-Access 56 +VALUE 3GPP-RAT-Type Wireline-BPF-Access 57 VALUE 3GPP-RAT-Type IEEE-802.16e 101 VALUE 3GPP-RAT-Type 3GPP2-eHRPD 102 VALUE 3GPP-RAT-Type 3GPP2-HRPD 103 VALUE 3GPP-RAT-Type 3GPP2-1xRTT 104 +VALUE 3GPP-RAT-Type 3GPP2-UMB 105 VALUE 3GPP-Allocate-IP-Type Do-Not-Allocate 0 VALUE 3GPP-Allocate-IP-Type Allocate-IPv4-Address 1 From 1e0df8c78375081079c7dc6a639d7752415119e8 Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Thu, 6 Feb 2025 13:52:26 +0800 Subject: [PATCH 7/9] Thread: fix parsing Server TLV The `server_decode` is not passed for parsing the sub-TLV. This commit fixes this issue by passing the current `server_decode` to the dissector. --- epan/dissectors/packet-thread.c | 36 +++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/epan/dissectors/packet-thread.c b/epan/dissectors/packet-thread.c index 430d501f77..a7addd828d 100644 --- a/epan/dissectors/packet-thread.c +++ b/epan/dissectors/packet-thread.c @@ -2845,7 +2845,7 @@ dissect_thread_mc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat static int // NOLINTNEXTLINE(misc-no-recursion) -dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +dissect_thread_nwd_with_server_decode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int server_decode) { proto_item *proto_root; proto_tree *thread_nwd_tree; @@ -2854,7 +2854,6 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da unsigned offset = 0, tlv_offset; proto_item *ti; uint8_t tlv_type, tlv_len; - int g_server_decode = 1; /* used to check if the full decoding of Server TLV has to be done or not */ /* Create the protocol tree. */ proto_root = proto_tree_add_item(tree, proto_thread_nwd, tvb, 0, tvb_reported_length(tvb), ENC_NA); @@ -2954,7 +2953,7 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da sub_tlv_tree = proto_item_add_subtree(ti, ett_thread_nwd_prefix_sub_tlvs); /* Call this dissector for sub-TLVs */ sub_tvb = tvb_new_subset_length(tvb, offset, remaining); /* remove prefix length (1) and prefix (prefix_byte_len) */ - dissect_thread_nwd(sub_tvb, pinfo, sub_tlv_tree, data); + dissect_thread_nwd_with_server_decode(sub_tvb, pinfo, sub_tlv_tree, server_decode); offset += remaining; } } @@ -3060,7 +3059,7 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_service_anycast_seqno, tvb, offset + 1, 1, ENC_NA); offset += 2; tlv_offset += 2; - g_server_decode = 2; + server_decode = 2; } else if(((s_data_len == 1) && (thread_service_data == 0x5d)) || ((s_data_len == 19) && (thread_service_data == 0x5d))) { proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_service_s_data, tvb, offset, s_data_len, ENC_NA); @@ -3069,11 +3068,11 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da tlv_offset += 1; if(s_data_len == 1) { - g_server_decode = 3; + server_decode = 3; } else if(s_data_len == 19) { - g_server_decode = 2; + server_decode = 2; proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_service_unicast_ipv6_address, tvb, offset, 16, ENC_NA); proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_service_unicast_port_number, tvb, offset + 16, 2, ENC_NA); offset += 18; @@ -3088,10 +3087,10 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da //Flag to be 1 (BIG_ENDIAN so check the MSB) and thread_service_data = 1 then Server Sub TLV needs to be decoded with s_server_data fields if(((flags & THREAD_NWD_TLV_SERVICE_T) == THREAD_NWD_TLV_SERVICE_T) && (thread_service_data == THREAD_SERVICE_DATA_BBR)) { - g_server_decode = 1; + server_decode = 1; } else { - g_server_decode = 0; + server_decode = 0; } } @@ -3101,10 +3100,10 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da // //Flag to be 1 (BIG_ENDIAN so check the MSB) and thread_service_data = 1 then Server Sub TLV needs to be decoded with s_server_data fields // if(((flags & THREAD_NWD_TLV_SERVICE_T) == THREAD_NWD_TLV_SERVICE_T) && // (thread_service_data == THREAD_SERVICE_DATA_BBR)) { - // g_server_decode = 1; + // server_decode = 1; // } // else { - // g_server_decode = 0; + // server_decode = 0; // } // Thread 1.3 Service TLV code @@ -3118,7 +3117,7 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da sub_tlv_tree = proto_item_add_subtree(ti, ett_thread_nwd_prefix_sub_tlvs); /* Call this dissector for sub-TLVs. Should only be server TLVs */ sub_tvb = tvb_new_subset_length(tvb, offset, remaining); /* remove prefix length (1) and prefix (prefix_byte_len) */ - dissect_thread_nwd(sub_tvb, pinfo, sub_tlv_tree, data); + dissect_thread_nwd_with_server_decode(sub_tvb, pinfo, sub_tlv_tree, server_decode); offset += remaining; } } @@ -3126,7 +3125,7 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da case THREAD_NWD_TLV_SERVER: { - if(g_server_decode == 1) { + if(server_decode == 1) { //2 bytes of server 16 proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_server_16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -3141,7 +3140,7 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_service_s_data_mlrtimeout, tvb, offset, 4, ENC_NA); offset += 4; } - else if(g_server_decode == 0) { + else if(server_decode == 0) { //2 bytes of server 16 proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_server_16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -3157,7 +3156,7 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da } // Thread 1.3 Service TLV code - else if(g_server_decode == 2) { + else if(server_decode == 2) { //2 bytes of server 16 proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_server_16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -3170,7 +3169,7 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da offset += remaining; } } - else if(g_server_decode == 3) { + else if(server_decode == 3) { //2 bytes of server 16 proto_tree_add_item(tlv_tree, hf_thread_nwd_tlv_server_16, tvb, offset, 2, ENC_BIG_ENDIAN); offset += 2; @@ -3201,6 +3200,13 @@ dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da return tvb_captured_length(tvb); } +static int +// NOLINTNEXTLINE(misc-no-recursion) +dissect_thread_nwd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) +{ + return dissect_thread_nwd_with_server_decode(tvb, pinfo, tree, 1); +} + static int dissect_thread_coap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { From 5b830615d653fa9b80773a17a26d5ebc074a7bfe Mon Sep 17 00:00:00 2001 From: Szilard Turi-Kovats Date: Thu, 6 Feb 2025 12:23:49 +0100 Subject: [PATCH 8/9] ITS: GeoNetworking: Show CBR (Channel busy ratio) in 0.00[%] format The value is encoded as unsigned int (0..255) The actual represenation is percentage (0..100) --- epan/dissectors/packet-geonw.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-geonw.c b/epan/dissectors/packet-geonw.c index 1fb640dfeb..229ddf50c0 100644 --- a/epan/dissectors/packet-geonw.c +++ b/epan/dissectors/packet-geonw.c @@ -2963,6 +2963,12 @@ display_heading( char *result, uint32_t hexver ) snprintf( result, ITEM_LABEL_LENGTH, "%.1f degrees", hexver/10.); } +static void +display_cbr( char *result, uint8_t hexver ) +{ + snprintf( result, ITEM_LABEL_LENGTH, "%.2f %% (%u)", hexver * 100.0 / 255.0, hexver); +} + static void display_elevation( char *result, int32_t hexver ) { @@ -3231,12 +3237,12 @@ proto_register_geonw(void) { &hf_geonw_dccmco_cbr_l_0_hop, { "Local channel busy ratio", "geonw.cbr_l0hop", - FT_UINT8, BASE_DEC, NULL, 0x80, + FT_UINT8, BASE_CUSTOM, CF_FUNC(display_cbr), 0x00, NULL, HFILL }}, { &hf_geonw_dccmco_cbr_l_1_hop, { "Max neighbouring CBR", "geonw.cbr_l1hop", - FT_UINT8, BASE_DEC, NULL, 0x80, + FT_UINT8, BASE_CUSTOM, CF_FUNC(display_cbr), 0x00, NULL, HFILL }}, { &hf_geonw_dccmco_output_power, From f66f426cd1e9f198c9242bc0495cc666f9ade1d1 Mon Sep 17 00:00:00 2001 From: Alastair Knowles Date: Thu, 6 Feb 2025 12:21:25 +0000 Subject: [PATCH 9/9] wslua-conversation: Update readme to indicate addition of conversations --- doc/Wireshark_Release_Notes.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/Wireshark_Release_Notes.adoc b/doc/Wireshark_Release_Notes.adoc index 3465d265f1..f86bb384c7 100644 --- a/doc/Wireshark_Release_Notes.adoc +++ b/doc/Wireshark_Release_Notes.adoc @@ -151,6 +151,9 @@ The following features are either new or have been significantly updated since v the "Print" and "Export Packet Dissection" dialogs, and in TShark with the `--hexdump time` option. wsbuglink:17132[] +* Lua now has a `Conversation` object, which exposes conversations and conversation + data to Lua. Resolves wsbuglink:15396[] + === Removed Features and Support Wireshark no longer supports AirPcap and WinPcap.