Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreadman committed Feb 11, 2025
2 parents 0bbd226 + 08450d7 commit 994a2b5
Show file tree
Hide file tree
Showing 15 changed files with 310 additions and 150 deletions.
4 changes: 1 addition & 3 deletions epan/capture_dissectors.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ void capture_dissector_add_uint(const char *name, const uint32_t pattern, captur
/* Make sure table exists */
sub_dissectors = (struct capture_dissector_table*)g_hash_table_lookup( capture_dissector_tables, name );
if (sub_dissectors == NULL) {
fprintf(stderr, "OOPS: Subdissector \"%s\" not found in capture_dissector_tables\n", name);
if (wireshark_abort_on_dissector_bug)
abort();
ws_dissector_oops("Subdissector \"%s\" not found in capture_dissector_tables\n", name);
return;
}

Expand Down
114 changes: 111 additions & 3 deletions epan/conversation.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ enum {
DEINTD_ENDP_EXACT_IDX,
DEINTD_EXACT_IDX_COUNT,
DEINTD_ADDRS_IDX_COUNT = DEINTD_PORT2_IDX,
DEINTD_ENDP_NO_PORTS_IDX = DEINTD_PORT1_IDX
DEINTD_ENDP_NO_PORTS_IDX = DEINTD_PORT1_IDX,
DEINTD_NO_PORT2_IDX_COUNT = DEINTD_EXACT_IDX_COUNT,
DEINTD_NO_ADDR2_PORT2_IDX_COUNT = DEINTD_ENDP_EXACT_IDX
};

/* Names for conversation_element_type values. */
Expand Down Expand Up @@ -153,6 +155,16 @@ static wmem_map_t *conversation_hashtable_exact_addr_port_anc = NULL;
*/
static wmem_map_t *conversation_hashtable_exact_addr_anc = NULL;

/*
* Hash table for conversations with one wildcard port, and an anchor
*/
static wmem_map_t *conversation_hashtable_no_port2_anc = NULL;

/*
* Hash table for conversations with one wildcard address and port, and an anchor.
*/
static wmem_map_t *conversation_hashtable_no_addr2_or_port2_anc;

/*
* Hash table for deinterlacing conversations (typically L1 or L2)
*/
Expand Down Expand Up @@ -689,6 +701,33 @@ conversation_init(void)
wmem_map_insert(conversation_hashtable_element_list, wmem_strdup(wmem_epan_scope(), addrs_anc_map_key),
conversation_hashtable_exact_addr_anc);

conversation_element_t no_port2_elements_anc[DEINTD_NO_PORT2_IDX_COUNT] = {
{ CE_ADDRESS, .addr_val = ADDRESS_INIT_NONE },
{ CE_ADDRESS, .addr_val = ADDRESS_INIT_NONE },
{ CE_PORT, .port_val = 0 },
{ CE_UINT, .uint_val = 0 },
{ CE_CONVERSATION_TYPE, .conversation_type_val = CONVERSATION_NONE }
};
char *no_port2_anc_map_key = conversation_element_list_name(wmem_epan_scope(), no_port2_elements_anc);
conversation_hashtable_no_port2_anc = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(),
conversation_hash_element_list,
conversation_match_element_list);
wmem_map_insert(conversation_hashtable_element_list, wmem_strdup(wmem_epan_scope(), no_port2_anc_map_key),
conversation_hashtable_no_port2_anc);

conversation_element_t no_addr2_or_port2_elements_anc[DEINTD_NO_ADDR2_PORT2_IDX_COUNT] = {
{ CE_ADDRESS, .addr_val = ADDRESS_INIT_NONE },
{ CE_PORT, .port_val = 0 },
{ CE_UINT, .uint_val = 0 },
{ CE_CONVERSATION_TYPE, .conversation_type_val = CONVERSATION_NONE }
};
char *no_addr2_or_port2_anc_map_key = conversation_element_list_name(wmem_epan_scope(), no_addr2_or_port2_elements_anc);
conversation_hashtable_no_addr2_or_port2_anc = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(),
conversation_hash_element_list,
conversation_match_element_list);
wmem_map_insert(conversation_hashtable_element_list, wmem_strdup(wmem_epan_scope(), no_addr2_or_port2_anc_map_key),
conversation_hashtable_no_addr2_or_port2_anc);

}

/**
Expand Down Expand Up @@ -1192,6 +1231,44 @@ conversation_new_deinterlaced(const uint32_t setup_frame, const address *addr1,

return conversation;
}
else if (options & NO_PORT2) {
conversation_element_t *new_key = wmem_alloc(wmem_file_scope(), sizeof(conversation_element_t) * (DEINTD_EXACT_IDX_COUNT+1));

new_key[DEINTD_ADDR1_IDX].type = CE_ADDRESS;
if (addr1 != NULL) {
copy_address_wmem(wmem_file_scope(), &new_key[DEINTD_ADDR1_IDX].addr_val, addr1);
}
else {
clear_address(&new_key[DEINTD_ADDR1_IDX].addr_val);
}

new_key[DEINTD_ADDR2_IDX].type = CE_ADDRESS;
if (addr2 != NULL) {
copy_address_wmem(wmem_file_scope(), &new_key[DEINTD_ADDR2_IDX].addr_val, addr2);
}
else {
clear_address(&new_key[DEINTD_ADDR2_IDX].addr_val);
}

new_key[DEINTD_PORT1_IDX].type = CE_PORT;
new_key[DEINTD_PORT1_IDX].port_val = port1;

new_key[DEINTD_PORT1_IDX + 1].type = CE_UINT;
new_key[DEINTD_PORT1_IDX + 1].uint_val = anchor;

new_key[DEINTD_PORT1_IDX + 2].type = CE_CONVERSATION_TYPE;
new_key[DEINTD_PORT1_IDX + 2].conversation_type_val = ctype;

// set the options and key pointer
conversation->options = options;
conversation->key_ptr = new_key;

new_index++;

conversation_insert_into_hashtable(conversation_hashtable_exact_addr_port_anc, conversation);

return conversation;
}
else {
conversation_element_t *new_key = wmem_alloc(wmem_file_scope(), sizeof(conversation_element_t) * (DEINTD_EXACT_IDX_COUNT+2));

Expand Down Expand Up @@ -1503,6 +1580,25 @@ conversation_lookup_no_anc_anc(const uint32_t frame_num, const address *addr1,
return conversation_lookup_hashtable(conversation_hashtable_exact_addr_anc, frame_num, key);
}

/*
* Search a particular hash table for a conversation with the specified
* {addr1, port1, addr2, anchor} and set up before frame_num.
*/
static conversation_t *
conversation_lookup_no_port2_anc(const uint32_t frame_num, const address *addr1, const uint32_t port1,
const address *addr2, const conversation_type ctype,
const uint32_t anchor)
{
conversation_element_t key[DEINTD_NO_PORT2_IDX_COUNT] = {
{ CE_ADDRESS, .addr_val = *addr1 },
{ CE_ADDRESS, .addr_val = *addr2 },
{ CE_PORT, .port_val = port1 },
{ CE_UINT, .uint_val = anchor },
{ CE_CONVERSATION_TYPE, .conversation_type_val = ctype },
};
return conversation_lookup_hashtable(conversation_hashtable_exact_addr_port_anc, frame_num, key);
}

/*
* Search a particular hash table for a conversation with the specified
* {addr1, addr2, key1, key2, key3} and set up before frame_num.
Expand Down Expand Up @@ -1963,6 +2059,20 @@ find_conversation_deinterlaced(const uint32_t frame_num, const address *addr_a,
}

}
else if(options & NO_PORT_B) { /* typically : protocols over UDP */
conversation = conversation_lookup_no_port2_anc(frame_num, addr_a, port_a, addr_b, ctype, anchor);
other_conv = conversation_lookup_no_port2_anc(frame_num, addr_b, port_b, addr_a, ctype, anchor);
if (other_conv != NULL) {
if (conversation != NULL) {
if(other_conv->conv_index > conversation->conv_index) {
conversation = other_conv;
}
}
else {
conversation = other_conv;
}
}
}
else { /* typically : IP protocols */
if (!(options & NO_ANC)) {
conversation = conversation_lookup_no_ports_anc(frame_num, addr_a, addr_b, ctype, anchor);
Expand Down Expand Up @@ -2253,7 +2363,6 @@ conversation_t *
find_conversation_strat(const packet_info *pinfo, const conversation_type ctype, const unsigned options)
{
conversation_t *conv=NULL;

/* deinterlacing is only supported for the Ethernet wtap for now */
if( (pinfo->pseudo_header != NULL)
&& (pinfo->rec->rec_header.packet_header.pkt_encap == WTAP_ENCAP_ETHERNET)
Expand All @@ -2266,7 +2375,6 @@ find_conversation_strat(const packet_info *pinfo, const conversation_type ctype,
else {
conv = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst, ctype, pinfo->srcport, pinfo->destport, options);
}

return conv;
}

Expand Down
31 changes: 26 additions & 5 deletions epan/dissectors/packet-ieee80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -6616,6 +6616,9 @@ static int hf_ieee80211_rsn_cap_mfpr;
static int hf_ieee80211_rsn_cap_mfpc;
static int hf_ieee80211_rsn_cap_jmr;
static int hf_ieee80211_rsn_cap_peerkey;
static int hf_ieee80211_rsn_cap_spp_amsdu_cap;
static int hf_ieee80211_rsn_cap_spp_amsdu_req;
static int hf_ieee80211_rsn_cap_pbac;
static int hf_ieee80211_rsn_cap_extended_key_id_iaf;
static int hf_ieee80211_rsn_cap_ocvc;
static int hf_ieee80211_rsn_pmkid_count;
Expand Down Expand Up @@ -22054,6 +22057,9 @@ dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
&hf_ieee80211_rsn_cap_mfpc,
&hf_ieee80211_rsn_cap_jmr,
&hf_ieee80211_rsn_cap_peerkey,
&hf_ieee80211_rsn_cap_spp_amsdu_cap,
&hf_ieee80211_rsn_cap_spp_amsdu_req,
&hf_ieee80211_rsn_cap_pbac,
&hf_ieee80211_rsn_cap_extended_key_id_iaf,
&hf_ieee80211_rsn_cap_ocvc,
NULL
Expand Down Expand Up @@ -48933,22 +48939,37 @@ proto_register_ieee80211(void)

{&hf_ieee80211_rsn_cap_mfpr,
{"Management Frame Protection Required", "wlan.rsn.capabilities.mfpr",
FT_BOOLEAN, 16, NULL, 0x0040,
FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0040,
NULL, HFILL }},

{&hf_ieee80211_rsn_cap_mfpc,
{"Management Frame Protection Capable", "wlan.rsn.capabilities.mfpc",
FT_BOOLEAN, 16, NULL, 0x0080,
FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x0080,
NULL, HFILL }},

{&hf_ieee80211_rsn_cap_jmr,
{"Joint Multi-band RSNA", "wlan.rsn.capabilities.jmr",
FT_BOOLEAN, 16, NULL, 0x0100,
FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100,
NULL, HFILL }},

{&hf_ieee80211_rsn_cap_peerkey,
{"PeerKey Enabled", "wlan.rsn.capabilities.peerkey",
FT_BOOLEAN, 16, NULL, 0x0200,
FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200,
NULL, HFILL }},

{&hf_ieee80211_rsn_cap_spp_amsdu_cap,
{"SPP A-MSDU Capable", "wlan.rsn.capabilities.spp_amsdu_cap",
FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x0400,
NULL, HFILL }},

{&hf_ieee80211_rsn_cap_spp_amsdu_req,
{"SPP A-MSDU Required", "wlan.rsn.capabilities.spp_amsdu_req",
FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0800,
NULL, HFILL }},

{&hf_ieee80211_rsn_cap_pbac,
{"PBAC (protected block ack agreement capable)", "wlan.rsn.capabilities.pbac",
FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x1000,
NULL, HFILL }},

{&hf_ieee80211_rsn_cap_extended_key_id_iaf,
Expand All @@ -48958,7 +48979,7 @@ proto_register_ieee80211(void)

{&hf_ieee80211_rsn_cap_ocvc,
{"OCVC", "wlan.rsn.capabilities.ocvc",
FT_BOOLEAN, 16, NULL, 0x4000,
FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000,
NULL, HFILL }},

{&hf_ieee80211_rsn_pmkid_count,
Expand Down
11 changes: 9 additions & 2 deletions epan/dissectors/packet-oran.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* packet-oran.c
* Routines for O-RAN fronthaul UC-plane dissection
* Copyright 2020, Jan Schiefer, Keysight Technologies, Inc.
* Copyright 2020- Martin Mathieson
*
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <[email protected]>
Expand Down Expand Up @@ -868,8 +870,6 @@ static AllowedCTs_t ext_cts[HIGHEST_EXTTYPE] = {
{ false, false, false, true, false, false, false }, // SE 25 (5)
{ false, false, false, true, false, false, false }, // SE 26 (5)
{ false, false, false, true, false, false, false }, // SE 27 (5)


};

static bool se_allowed_in_st(unsigned se, unsigned ct)
Expand All @@ -896,6 +896,7 @@ static bool se_allowed_in_st(unsigned se, unsigned ct)

/************************************************************************************/

/* Table 7.7.1.2-2 */
static const value_string bfw_comp_headers_iq_width[] = {
{0, "I and Q are 16 bits wide"},
{1, "I and Q are 1 bit wide"},
Expand Down Expand Up @@ -1008,6 +1009,7 @@ static const value_string lbtTrafficClass_vals[] = {
{0, NULL}
};

/* 7.5.3.22 */
static const value_string lbtPdschRes_vals[] = {
{0, "not sensing – indicates that the O-RU is transmitting data"},
{1, "currently sensing – indicates the O-RU has not yet acquired the channel"},
Expand All @@ -1016,12 +1018,14 @@ static const value_string lbtPdschRes_vals[] = {
{0, NULL}
};

/* Table 7.5.2.15-3 */
static const value_string ci_comp_opt_vals[] = {
{0, "compression per UE, one ciCompParam exists before the I/Q value of each UE"},
{1, "compression per PRB, one ciCompParam exists before the I/Q value of each PRB"},
{0, NULL}
};

/* 7.5.2.17 */
static const range_string cmd_scope_vals[] = {
{0, 0, "ARRAY-COMMAND"},
{1, 1, "CARRIER-COMMAND"},
Expand Down Expand Up @@ -1088,6 +1092,7 @@ static const value_string prg_size_st5_vals[] = {
{ 0, NULL}
};

/* 7.7.21.3.2 */
static const value_string prg_size_st6_vals[] = {
{ 0, "if ciPrbGroupSize is 2 or 4, then ciPrbGroupSize, else WIDEBAND"},
{ 1, "Precoding resource block group size as WIDEBAND"},
Expand All @@ -1096,12 +1101,14 @@ static const value_string prg_size_st6_vals[] = {
{ 0, NULL}
};

/* 7.7.24.4 */
static const value_string alpn_per_sym_vals[] = {
{ 0, "report one allocated IPN value per all allocated symbols with DMRS"},
{ 1, "report one allocated IPN value per group of consecutive DMRS symbols"},
{ 0, NULL}
};

/* 7.7.24.5 */
static const value_string ant_dmrs_snr_vals[] = {
{ 0, "O-RU shall not report the MEAS_ANT_DMRS_SNR"},
{ 1, "O-RU shall report the MEAS_ANT_DMRS_SNR"},
Expand Down
Loading

0 comments on commit 994a2b5

Please sign in to comment.