NGAP: Use bitmask for NRCellIdentity and EUTRACellIdentity

Using a bitmask in the field definition allows us to use
proto_tree_add_item, which means that when print.c writes
PDML and JSON, the value written is the correctly masked
value (PDML also includes the unmasked value.)

When functions like proto_tree_add_uint are used instead,
the value written to PDML and JSON is the original value
from the packet buffer, not properly shifted.
This commit is contained in:
John Thacker 2022-11-19 07:58:48 -05:00
parent f9e0e555e0
commit b10e26d742
2 changed files with 172 additions and 176 deletions

View File

@ -615,14 +615,13 @@ TimeSynchronizationAssistanceInformation/uuTimeSynchronizationErrorBudget DISPLA
%(DEFAULT_BODY)s
#.FIELD_ATTR
NR-CGI/nRCellIdentity ABBREV=NRCellIdentity TYPE=FT_UINT40 DISPLAY=BASE_HEX
NR-CGI/nRCellIdentity ABBREV=NRCellIdentity TYPE=FT_UINT40 DISPLAY=BASE_HEX BITMASK=0xFFFFFFFFF0
#.FN_BODY NRCellIdentity VAL_PTR = &cell_id_tvb HF_INDEX=-1
tvbuff_t *cell_id_tvb = NULL;
%(DEFAULT_BODY)s
if (cell_id_tvb) {
guint64 cell_id = tvb_get_bits64(cell_id_tvb, 0, 36, ENC_BIG_ENDIAN);
actx->created_item = proto_tree_add_uint64(tree, hf_index, cell_id_tvb, 0, 5, cell_id);
actx->created_item = proto_tree_add_item(tree, hf_index, cell_id_tvb, 0, 5, ENC_BIG_ENDIAN);
}
#.FN_BODY EUTRA-CGI
@ -631,14 +630,13 @@ NR-CGI/nRCellIdentity ABBREV=NRCellIdentity TYPE=FT_UINT40 DISPLAY=BASE_HEX
%(DEFAULT_BODY)s
#.FIELD_ATTR
EUTRA-CGI/eUTRACellIdentity ABBREV=EUTRACellIdentity TYPE=FT_UINT32 DISPLAY=BASE_HEX
EUTRA-CGI/eUTRACellIdentity ABBREV=EUTRACellIdentity TYPE=FT_UINT32 DISPLAY=BASE_HEX BITMASK=0xFFFFFFF0
#.FN_BODY EUTRACellIdentity 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);
actx->created_item = proto_tree_add_item(tree, hf_index, cell_id_tvb, 0, 4, ENC_BIG_ENDIAN);
}
#.TYPE_ATTR

File diff suppressed because it is too large Load Diff