aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Strnad <pavel_strnad@hotmail.com>2018-03-19 09:13:35 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2018-03-19 14:37:04 +0000
commit18cd454da9e99c4d85d6afbe9c3b831e65d559b6 (patch)
tree0b8b02208447d7aef7e47a89baaf33bc48f90900
parent4d3c8bc61e768b4789bd2fb8a40f848ac50f8936 (diff)
S1AP: fix filtering on cell-ID
Filter does not work due to same shared short name for cell-id being used for two different asn.1 defintions cell-ID OCTET STRING, cell-ID CellIdentity, Change-Id: I5921bc82d46f38d43f9083e41d3a0558821042eb Reviewed-on: https://code.wireshark.org/review/26545 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Pavel Strnad <pavel_strnad@hotmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/asn1/s1ap/s1ap.cnf11
-rw-r--r--epan/dissectors/packet-s1ap.c16
2 files changed, 23 insertions, 4 deletions
diff --git a/epan/dissectors/asn1/s1ap/s1ap.cnf b/epan/dissectors/asn1/s1ap/s1ap.cnf
index 52e43b17cb..d0f4d9a48b 100644
--- a/epan/dissectors/asn1/s1ap/s1ap.cnf
+++ b/epan/dissectors/asn1/s1ap/s1ap.cnf
@@ -2120,6 +2120,17 @@ SecondaryRATReport N s1ap.proc.imsg id-SecondaryRATReport
#.END
+#.FIELD_ATTR
+EUTRAN-CGI/cell-ID ABBREV=CellIdentity TYPE=FT_UINT32 DISPLAY=BASE_HEX
+#.FN_BODY CellIdentity VAL_PTR = &cell_id_tvb HF_INDEX=-1
+ tvbuff_t *cell_id_tvb = NULL;
+%(DEFAULT_BODY)s
+ if (cell_id_tvb) {
+ guint32 cell_id = tvb_get_bits32(cell_id_tvb, 0, 28, ENC_BIG_ENDIAN);
+ actx->created_item = proto_tree_add_uint(tree, hf_index, cell_id_tvb, 0, 4, cell_id);
+ }
+#.END
+
#
# Editor modelines - http://www.wireshark.org/tools/modelines.html
#
diff --git a/epan/dissectors/packet-s1ap.c b/epan/dissectors/packet-s1ap.c
index b45bd80124..23cad496bf 100644
--- a/epan/dissectors/packet-s1ap.c
+++ b/epan/dissectors/packet-s1ap.c
@@ -2600,8 +2600,16 @@ dissect_s1ap_Additional_GUTI(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
static int
dissect_s1ap_CellIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_per_bit_string(tvb, offset, actx, tree, hf_index,
- 28, 28, FALSE, NULL, NULL);
+#line 2126 "./asn1/s1ap/s1ap.cnf"
+ tvbuff_t *cell_id_tvb = NULL;
+ offset = dissect_per_bit_string(tvb, offset, actx, tree, -1,
+ 28, 28, FALSE, &cell_id_tvb, NULL);
+
+ if (cell_id_tvb) {
+ guint32 cell_id = tvb_get_bits32(cell_id_tvb, 0, 28, ENC_BIG_ENDIAN);
+ actx->created_item = proto_tree_add_uint(tree, hf_index, cell_id_tvb, 0, 4, cell_id);
+ }
+
return offset;
}
@@ -17227,8 +17235,8 @@ void proto_register_s1ap(void) {
FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_octet_octets, 0,
"INTEGER", HFILL }},
{ &hf_s1ap_cell_ID,
- { "cell-ID", "s1ap.cell_ID",
- FT_BYTES, BASE_NONE, NULL, 0,
+ { "cell-ID", "s1ap.CellIdentity",
+ FT_UINT32, BASE_HEX, NULL, 0,
"CellIdentity", HFILL }},
{ &hf_s1ap_expectedActivity,
{ "expectedActivity", "s1ap.expectedActivity_element",