diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2021-02-07 14:56:32 +0100 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-02-10 10:08:21 +0000 |
commit | cb3d463a388e2f3fb511c03161fd1841500ad1f8 (patch) | |
tree | 4118f20aea147d5356d6d33f0aad706ac5bb8ac9 /epan/dissectors/asn1/lte-rrc | |
parent | a1e03ea89e0bad27772025dc9ecd87cc7a672376 (diff) |
lte-rrc: Add preference to put NAS in the root tree
Add a preference to put DedicatedInfoNAS in the root packet
details tree.
Diffstat (limited to 'epan/dissectors/asn1/lte-rrc')
-rw-r--r-- | epan/dissectors/asn1/lte-rrc/lte-rrc.cnf | 10 | ||||
-rw-r--r-- | epan/dissectors/asn1/lte-rrc/packet-lte-rrc-template.c | 9 |
2 files changed, 16 insertions, 3 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(<e_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", + <e_rrc_nas_in_root_tree); } |