aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pdcp-nr.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-04-11 21:59:14 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2018-04-12 08:00:00 +0000
commitb5ca12a88e50768e6fd8dbaaf593687ccc3c9414 (patch)
tree8118a10d34690032228d3a1c57b85178e96d6926 /epan/dissectors/packet-pdcp-nr.c
parentd0d0cf05cc6872c7d49f1ed7b2432ba97a66331f (diff)
PDCP NR: rework UDP framing format
Change-Id: I6f4a17ed91d4cb6ea39b5938add6ee882b033687 Reviewed-on: https://code.wireshark.org/review/26893 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-pdcp-nr.c')
-rw-r--r--epan/dissectors/packet-pdcp-nr.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/epan/dissectors/packet-pdcp-nr.c b/epan/dissectors/packet-pdcp-nr.c
index b61d8dfcad..7ce9b132a1 100644
--- a/epan/dissectors/packet-pdcp-nr.c
+++ b/epan/dissectors/packet-pdcp-nr.c
@@ -784,9 +784,10 @@ static gboolean dissect_pdcp_nr_heur(tvbuff_t *tvb, packet_info *pinfo,
/* Needs to be at least as long as:
- the signature string
- - mandatory fields
- - at least the payload tag and a byte of data.
- However, let attempted dissection show if there are any tags at all. */
+ - fixed header byte(s)
+ - tag for data
+ - at least one byte of PDCP PDU payload.
+ However, let attempted dissection show if there are any tags at all. */
gint min_length = (gint)(strlen(PDCP_NR_START_STRING) + 3); /* signature */
if (tvb_captured_length_remaining(tvb, offset) < min_length) {
@@ -811,15 +812,18 @@ static gboolean dissect_pdcp_nr_heur(tvbuff_t *tvb, packet_info *pinfo,
infoAlreadySet = TRUE;
}
+ /* Read fixed fields */
+ p_pdcp_nr_info->plane = (enum pdcp_nr_plane)tvb_get_guint8(tvb, offset++);
+ if (p_pdcp_nr_info->plane == NR_SIGNALING_PLANE) {
+ /* Signalling plane always has 12 SN bits */
+ p_pdcp_nr_info->seqnum_length = PDCP_NR_SN_LENGTH_12_BITS;
+ }
/* Read tagged fields */
while (tag != PDCP_NR_PAYLOAD_TAG) {
/* Process next tag */
tag = tvb_get_guint8(tvb, offset++);
switch (tag) {
- case PDCP_NR_PLANE_TAG:
- p_pdcp_nr_info->plane = (enum pdcp_nr_plane)tvb_get_guint8(tvb, offset++);
- break;
case PDCP_NR_SEQNUM_LENGTH_TAG:
p_pdcp_nr_info->seqnum_length = tvb_get_guint8(tvb, offset);
offset++;
@@ -841,14 +845,12 @@ static gboolean dissect_pdcp_nr_heur(tvbuff_t *tvb, packet_info *pinfo,
p_pdcp_nr_info->ueid = tvb_get_ntohs(tvb, offset);
offset += 2;
break;
-
case PDCP_NR_ROHC_COMPRESSION_TAG:
- p_pdcp_nr_info->rohc.rohc_compression = tvb_get_guint8(tvb, offset);
- offset += 2;
+ p_pdcp_nr_info->rohc.rohc_compression = TRUE;
break;
case PDCP_NR_ROHC_IP_VERSION_TAG:
- p_pdcp_nr_info->rohc.rohc_ip_version = tvb_get_ntohs(tvb, offset);
- offset += 2;
+ p_pdcp_nr_info->rohc.rohc_ip_version = tvb_get_guint8(tvb, offset);
+ offset++;
break;
case PDCP_NR_ROHC_CID_INC_INFO_TAG:
p_pdcp_nr_info->rohc.cid_inclusion_info = tvb_get_guint8(tvb, offset);