aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2021-02-07 14:56:32 +0100
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-02-10 10:08:21 +0000
commitcb3d463a388e2f3fb511c03161fd1841500ad1f8 (patch)
tree4118f20aea147d5356d6d33f0aad706ac5bb8ac9
parenta1e03ea89e0bad27772025dc9ecd87cc7a672376 (diff)
lte-rrc: Add preference to put NAS in the root tree
Add a preference to put DedicatedInfoNAS in the root packet details tree.
-rw-r--r--epan/dissectors/asn1/lte-rrc/lte-rrc.cnf10
-rw-r--r--epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c9
-rw-r--r--epan/dissectors/packet-lte-rrc.c33
3 files changed, 39 insertions, 13 deletions
diff --git a/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf b/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf
index ca21df4201..f37cc40ae6 100644
--- a/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf
+++ b/epan/dissectors/asn1/lte-rrc/lte-rrc.cnf
@@ -821,11 +821,15 @@ SI-OrPSI-GERAN TYPE_PREFIX
#.FN_BODY DedicatedInfoNAS VAL_PTR = &nas_eps_tvb
tvbuff_t *nas_eps_tvb=NULL;
- proto_tree *subtree;
%(DEFAULT_BODY)s
if ((nas_eps_tvb)&&(nas_eps_handle)) {
- subtree = proto_item_add_subtree(actx->created_item, ett_lte_rrc_dedicatedInfoNAS);
- lte_rrc_call_dissector(nas_eps_handle, nas_eps_tvb, actx->pinfo, subtree);
+ proto_tree *nas_tree;
+ if (lte_rrc_nas_in_root_tree) {
+ nas_tree = proto_tree_get_root(tree);
+ } else {
+ nas_tree = proto_item_add_subtree(actx->created_item, ett_lte_rrc_dedicatedInfoNAS);
+ }
+ lte_rrc_call_dissector(nas_eps_handle, nas_eps_tvb, actx->pinfo, nas_tree);
}
#.FN_BODY UECapabilityEnquiry-v1510-IEs/requestedFreqBandsNR-MRDC-r15 VAL_PTR = &freq_band_list_tvb
diff --git a/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c b/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c
index bc99254cba..ded743b259 100644
--- a/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c
+++ b/epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <epan/packet.h>
+#include <epan/prefs.h>
#include <epan/to_str.h>
#include <epan/asn1.h>
#include <epan/expert.h>
@@ -63,6 +64,7 @@ static wmem_map_t *lte_rrc_system_info_value_changed_hash = NULL;
static guint8 system_info_value_current;
static gboolean system_info_value_current_set;
+static gboolean lte_rrc_nas_in_root_tree;
extern int proto_mac_lte;
extern int proto_rlc_lte;
@@ -4444,6 +4446,7 @@ void proto_register_lte_rrc(void) {
};
expert_module_t* expert_lte_rrc;
+ module_t *lte_rrc_module;
/* Register protocol */
proto_lte_rrc = proto_register_protocol(PNAME, PSNAME, PFNAME);
@@ -4491,6 +4494,12 @@ void proto_register_lte_rrc(void) {
reassembly_table_register(&lte_rrc_sib12_reassembly_table,
&addresses_reassembly_table_functions);
+ /* Register configuration preferences */
+ lte_rrc_module = prefs_register_protocol(proto_lte_rrc, NULL);
+ prefs_register_bool_preference(lte_rrc_module, "nas_in_root_tree",
+ "Show NAS PDU in root packet details",
+ "Whether the NAS PDU should be shown in the root packet details tree",
+ &lte_rrc_nas_in_root_tree);
}
diff --git a/epan/dissectors/packet-lte-rrc.c b/epan/dissectors/packet-lte-rrc.c
index 81760687e3..9babefd9ea 100644
--- a/epan/dissectors/packet-lte-rrc.c
+++ b/epan/dissectors/packet-lte-rrc.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <epan/packet.h>
+#include <epan/prefs.h>
#include <epan/to_str.h>
#include <epan/asn1.h>
#include <epan/expert.h>
@@ -71,6 +72,7 @@ static wmem_map_t *lte_rrc_system_info_value_changed_hash = NULL;
static guint8 system_info_value_current;
static gboolean system_info_value_current_set;
+static gboolean lte_rrc_nas_in_root_tree;
extern int proto_mac_lte;
extern int proto_rlc_lte;
@@ -313,7 +315,7 @@ typedef enum _SI_OrPSI_GERAN_enum {
} SI_OrPSI_GERAN_enum;
/*--- End of included file: packet-lte-rrc-val.h ---*/
-#line 74 "./asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 76 "./asn1/lte-rrc/packet-lte-rrc-template.c"
/* Initialize the protocol and registered fields */
static int proto_lte_rrc = -1;
@@ -8761,7 +8763,7 @@ static int hf_lte_rrc_carrierFreq_r14 = -1; /* CarrierFreq_NB_r13 */
static int dummy_hf_lte_rrc_eag_field = -1; /* never registered */
/*--- End of included file: packet-lte-rrc-hf.c ---*/
-#line 79 "./asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 81 "./asn1/lte-rrc/packet-lte-rrc-template.c"
static int hf_lte_rrc_eutra_cap_feat_group_ind_1 = -1;
static int hf_lte_rrc_eutra_cap_feat_group_ind_2 = -1;
@@ -12661,7 +12663,7 @@ static gint ett_lte_rrc_SCPTM_NeighbourCellList_NB_r14 = -1;
static gint ett_lte_rrc_PCI_ARFCN_NB_r14 = -1;
/*--- End of included file: packet-lte-rrc-ett.c ---*/
-#line 273 "./asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 275 "./asn1/lte-rrc/packet-lte-rrc-template.c"
static gint ett_lte_rrc_featureGroupIndicators = -1;
static gint ett_lte_rrc_featureGroupIndRel9Add = -1;
@@ -70556,13 +70558,17 @@ dissect_lte_rrc_RRCConnectionReject(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_
static int
dissect_lte_rrc_DedicatedInfoNAS(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
tvbuff_t *nas_eps_tvb=NULL;
- proto_tree *subtree;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &nas_eps_tvb);
if ((nas_eps_tvb)&&(nas_eps_handle)) {
- subtree = proto_item_add_subtree(actx->created_item, ett_lte_rrc_dedicatedInfoNAS);
- lte_rrc_call_dissector(nas_eps_handle, nas_eps_tvb, actx->pinfo, subtree);
+ proto_tree *nas_tree;
+ if (lte_rrc_nas_in_root_tree) {
+ nas_tree = proto_tree_get_root(tree);
+ } else {
+ nas_tree = proto_item_add_subtree(actx->created_item, ett_lte_rrc_dedicatedInfoNAS);
+ }
+ lte_rrc_call_dissector(nas_eps_handle, nas_eps_tvb, actx->pinfo, nas_tree);
}
@@ -127728,7 +127734,7 @@ static int dissect_UE_RadioPagingInfo_NB_r13_PDU(tvbuff_t *tvb _U_, packet_info
/*--- End of included file: packet-lte-rrc-fn.c ---*/
-#line 3245 "./asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 3247 "./asn1/lte-rrc/packet-lte-rrc-template.c"
static int
dissect_lte_rrc_DL_CCCH(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
@@ -161856,7 +161862,7 @@ void proto_register_lte_rrc(void) {
"CarrierFreq_NB_r13", HFILL }},
/*--- End of included file: packet-lte-rrc-hfarr.c ---*/
-#line 3620 "./asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 3622 "./asn1/lte-rrc/packet-lte-rrc-template.c"
{ &hf_lte_rrc_eutra_cap_feat_group_ind_1,
{ "Indicator 1", "lte-rrc.eutra_cap_feat_group_ind_1",
@@ -166321,7 +166327,7 @@ void proto_register_lte_rrc(void) {
&ett_lte_rrc_PCI_ARFCN_NB_r14,
/*--- End of included file: packet-lte-rrc-ettarr.c ---*/
-#line 4379 "./asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 4381 "./asn1/lte-rrc/packet-lte-rrc-template.c"
&ett_lte_rrc_featureGroupIndicators,
&ett_lte_rrc_featureGroupIndRel9Add,
@@ -166390,6 +166396,7 @@ void proto_register_lte_rrc(void) {
};
expert_module_t* expert_lte_rrc;
+ module_t *lte_rrc_module;
/* Register protocol */
proto_lte_rrc = proto_register_protocol(PNAME, PSNAME, PFNAME);
@@ -166466,7 +166473,7 @@ void proto_register_lte_rrc(void) {
/*--- End of included file: packet-lte-rrc-dis-reg.c ---*/
-#line 4485 "./asn1/lte-rrc/packet-lte-rrc-template.c"
+#line 4488 "./asn1/lte-rrc/packet-lte-rrc-template.c"
lte_rrc_etws_cmas_dcs_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal);
lte_rrc_system_info_value_changed_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_direct_hash, g_direct_equal);
@@ -166476,6 +166483,12 @@ void proto_register_lte_rrc(void) {
reassembly_table_register(&lte_rrc_sib12_reassembly_table,
&addresses_reassembly_table_functions);
+ /* Register configuration preferences */
+ lte_rrc_module = prefs_register_protocol(proto_lte_rrc, NULL);
+ prefs_register_bool_preference(lte_rrc_module, "nas_in_root_tree",
+ "Show NAS PDU in root packet details",
+ "Whether the NAS PDU should be shown in the root packet details tree",
+ &lte_rrc_nas_in_root_tree);
}