aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/rrc
diff options
context:
space:
mode:
authorDarien Spencer <cusneud@mail.com>2018-05-17 17:20:04 +0300
committerPascal Quantin <pascal.quantin@gmail.com>2018-05-17 21:22:13 +0000
commit2a9886bf09eb27489d1f95bc73ccaa05da446794 (patch)
treed773346e09a42bbe2a761a8d6dca6b61da2fc8a5 /epan/dissectors/asn1/rrc
parent644939ed9e4e5449970e27a674a6936723daed5c (diff)
RRC: Make the U-RNTI field filterable
U-RNTI is defined in ASN.1 as a 'SEQUENCE' of 2 numbers. this update adds the U-RNTI field to the tree as a UINT32 with the value of the numbers combined so it could be filtered. Change-Id: I31e9f39a257aaf98c36eebb2cb7c33eb156a0e9f Reviewed-on: https://code.wireshark.org/review/27566 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/asn1/rrc')
-rw-r--r--epan/dissectors/asn1/rrc/packet-rrc-template.c15
-rw-r--r--epan/dissectors/asn1/rrc/rrc.cnf42
2 files changed, 45 insertions, 12 deletions
diff --git a/epan/dissectors/asn1/rrc/packet-rrc-template.c b/epan/dissectors/asn1/rrc/packet-rrc-template.c
index 2911612821..4423dcc5d2 100644
--- a/epan/dissectors/asn1/rrc/packet-rrc-template.c
+++ b/epan/dissectors/asn1/rrc/packet-rrc-template.c
@@ -266,6 +266,9 @@ static int dissect_SysInfoType22_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tr
/* Initialize the protocol and registered fields */
int proto_rrc = -1;
static int hf_test;
+static int hf_urnti;
+static int hf_urnti_new;
+static int hf_urnti_current;
#include "packet-rrc-hf.c"
/* Initialize the subtree pointers */
@@ -490,6 +493,18 @@ void proto_register_rrc(void) {
{ "RAB Test", "rrc.RAB.test",
FT_UINT8, BASE_DEC, NULL, 0,
"rrc.RAB_Info_r6", HFILL }},
+ { &hf_urnti,
+ { "U-RNTI", "rrc.urnti",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ NULL, HFILL }},
+ { &hf_urnti_new,
+ { "New U-RNTI", "rrc.urnti_new",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ NULL, HFILL }},
+ { &hf_urnti_current,
+ { "Current U-RNTI", "rrc.urnti_current",
+ FT_UINT32, BASE_HEX, NULL, 0,
+ NULL, HFILL }},
{ &hf_rrc_eutra_feat_group_ind_1,
{ "Indicator 1", "rrc.eutra_feat_group_ind_1",
FT_BOOLEAN, BASE_NONE, TFS(&rrc_eutra_feat_group_ind_1_val), 0,
diff --git a/epan/dissectors/asn1/rrc/rrc.cnf b/epan/dissectors/asn1/rrc/rrc.cnf
index 3fac36430b..0c8d0c558f 100644
--- a/epan/dissectors/asn1/rrc/rrc.cnf
+++ b/epan/dissectors/asn1/rrc/rrc.cnf
@@ -1123,22 +1123,40 @@ HNBName TYPE=FT_STRING DISPLAY=STR_UNICODE
guint32 s_rnc_id;
guint32 s_rnti;
guint32 u_rnti_value;
+ guint32 original_offset;
+ proto_item *ti;
+ guint32 item_len;
+ proto_tree *sub_tree;
+ gboolean is_new_urnti;
+ int generated_field_hf;
+ original_offset = offset;
%(DEFAULT_BODY)s
- gboolean is_new_urnti = hf_index != hf_rrc_u_RNTI; /* hf_rrc_u_RNTI is for current U-RNTI, any other hf is for new U-RNTI */
+
+ /* Reconstructing the U-RNTI from the parsed components */
s_rnc_id = private_data_get_s_rnc_id(actx);
s_rnti = private_data_get_s_rnti(actx);
- if(s_rnc_id != 0 && s_rnti != 0) {
- u_rnti_value = (s_rnc_id << 20) | s_rnti;
- /* Distinguishing between new allocated U-RNTIs and previously used ones */
- if (is_new_urnti) {
- private_data_set_new_u_rnti(actx, u_rnti_value);
- }
- else {
- private_data_set_current_u_rnti(actx, u_rnti_value);
- }
- /* Adding U-RNTI value to it's tree item */
- proto_item_append_text(actx->created_item,": %%08x", u_rnti_value);
+ u_rnti_value = (s_rnc_id << 20) | s_rnti;
+
+ /* Distinguishing between new allocated U-RNTIs and previously used ones */
+ /* hf_rrc_u_RNTI is for current U-RNTI, any other hf is for new U-RNTI */
+ is_new_urnti = hf_index != hf_rrc_u_RNTI;
+ if (is_new_urnti) {
+ private_data_set_new_u_rnti(actx, u_rnti_value);
+ generated_field_hf = hf_urnti_new;
}
+ else {
+ private_data_set_current_u_rnti(actx, u_rnti_value);
+ generated_field_hf = hf_urnti_current;
+ }
+
+ /* Adding a "Current U-RNTI" or "New U-RNTI" as generated field */
+ sub_tree = proto_item_get_subtree(actx->created_item);
+ item_len = proto_item_get_len(actx->created_item);
+ ti = proto_tree_add_uint(sub_tree, generated_field_hf, tvb, original_offset/8, item_len, u_rnti_value);
+ PROTO_ITEM_SET_GENERATED(ti);
+ ti = proto_tree_add_uint(sub_tree, hf_urnti, tvb, original_offset/8, item_len, u_rnti_value);
+ PROTO_ITEM_SET_HIDDEN(ti);
+
private_data_set_s_rnc_id(actx, 0);
private_data_set_s_rnti(actx, 0);