forked from osmocom/wireshark
NB-IoT SRB1bis implementation
Change-Id: If0c9dd3f3ca2321aaf9176330299a32f611d34ce Reviewed-on: https://code.wireshark.org/review/20990 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
This commit is contained in:
parent
87fc4cc5d7
commit
90c2e34cbd
|
@ -3371,7 +3371,7 @@ static void call_rlc_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
guint8 mode, guint8 direction, guint16 ueid,
|
||||
guint16 channelType, guint16 channelId,
|
||||
guint8 sequenceNumberLength,
|
||||
guint8 priority, gboolean rlcExtLiField)
|
||||
guint8 priority, gboolean rlcExtLiField, mac_lte_nb_mode nbMode)
|
||||
{
|
||||
tvbuff_t *rb_tvb = tvb_new_subset_length(tvb, offset, data_length);
|
||||
struct rlc_lte_info *p_rlc_lte_info;
|
||||
|
@ -3392,6 +3392,11 @@ static void call_rlc_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
|
|||
p_rlc_lte_info->pduLength = data_length;
|
||||
p_rlc_lte_info->sequenceNumberLength = sequenceNumberLength;
|
||||
p_rlc_lte_info->extendedLiField = rlcExtLiField;
|
||||
if (nbMode == nb_mode) {
|
||||
p_rlc_lte_info->nbMode = rlc_nb_mode;
|
||||
} else {
|
||||
p_rlc_lte_info->nbMode = rlc_no_nb_mode;
|
||||
}
|
||||
|
||||
/* Store info in packet */
|
||||
p_add_proto_data(wmem_file_scope(), pinfo, proto_rlc_lte, 0, p_rlc_lte_info);
|
||||
|
@ -5694,7 +5699,9 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
}
|
||||
|
||||
/* LCID 1 and 2 can be assumed to be srb1&2, so can dissect as RLC AM */
|
||||
else if ((lcids[n] == 1) || (lcids[n] == 2)) {
|
||||
/* LCID 3 in NB mode can be assumed to be srb1bis, so can dissect as RLC AM */
|
||||
else if ((lcids[n] == 1) || (lcids[n] == 2) ||
|
||||
(p_mac_lte_info->nbMode == nb_mode && lcids[n] == 3)) {
|
||||
if (global_mac_lte_attempt_srb_decode) {
|
||||
/* Call RLC dissector */
|
||||
call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, data_length,
|
||||
|
@ -5702,7 +5709,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
CHANNEL_TYPE_SRB, lcids[n], 0,
|
||||
get_mac_lte_channel_priority(p_mac_lte_info->ueid,
|
||||
lcids[n], p_mac_lte_info->direction),
|
||||
FALSE);
|
||||
FALSE, p_mac_lte_info->nbMode);
|
||||
|
||||
/* Hide raw view of bytes */
|
||||
PROTO_ITEM_SET_HIDDEN(sdu_ti);
|
||||
|
@ -5735,7 +5742,7 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, data_length,
|
||||
RLC_UM_MODE, p_mac_lte_info->direction, p_mac_lte_info->ueid,
|
||||
CHANNEL_TYPE_DRB, (guint16)drb_id, seqnum_length,
|
||||
priority, FALSE);
|
||||
priority, FALSE, p_mac_lte_info->nbMode);
|
||||
break;
|
||||
case rlcAM:
|
||||
case rlcAMulExtLiField:
|
||||
|
@ -5756,13 +5763,13 @@ static void dissect_ulsch_or_dlsch(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, data_length,
|
||||
RLC_AM_MODE, p_mac_lte_info->direction, p_mac_lte_info->ueid,
|
||||
CHANNEL_TYPE_DRB, (guint16)drb_id, seqnum_length,
|
||||
priority, rlc_ext_li_field);
|
||||
priority, rlc_ext_li_field, p_mac_lte_info->nbMode);
|
||||
break;
|
||||
case rlcTM:
|
||||
call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, data_length,
|
||||
RLC_TM_MODE, p_mac_lte_info->direction, p_mac_lte_info->ueid,
|
||||
CHANNEL_TYPE_DRB, (guint16)drb_id, 0,
|
||||
priority, FALSE);
|
||||
priority, FALSE, p_mac_lte_info->nbMode);
|
||||
break;
|
||||
case rlcRaw:
|
||||
/* Nothing to do! */
|
||||
|
@ -6219,12 +6226,12 @@ static void dissect_mch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, pro
|
|||
/* Call RLC dissector */
|
||||
call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, data_length,
|
||||
RLC_UM_MODE, DIRECTION_DOWNLINK, 0,
|
||||
CHANNEL_TYPE_MCCH, 0, 5, 0, FALSE);
|
||||
CHANNEL_TYPE_MCCH, 0, 5, 0, FALSE, p_mac_lte_info->nbMode);
|
||||
} else if ((lcids[n] <= 28) && global_mac_lte_call_rlc_for_mtch) {
|
||||
/* Call RLC dissector */
|
||||
call_rlc_dissector(tvb, pinfo, tree, pdu_ti, offset, data_length,
|
||||
RLC_UM_MODE, DIRECTION_DOWNLINK, 0,
|
||||
CHANNEL_TYPE_MTCH, 0, 5, 0, FALSE);
|
||||
CHANNEL_TYPE_MTCH, 0, 5, 0, FALSE, p_mac_lte_info->nbMode);
|
||||
} else {
|
||||
/* Dissect SDU as raw bytes */
|
||||
sdu_ti = proto_tree_add_bytes_format(tree, hf_mac_lte_mch_sdu, tvb, offset, pdu_lengths[n],
|
||||
|
|
|
@ -829,7 +829,11 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
|
|||
}
|
||||
|
||||
p_pdcp_lte_info->ueid = rlc_info->ueid;
|
||||
p_pdcp_lte_info->channelType = Channel_DCCH;
|
||||
if (rlc_info->nbMode == rlc_nb_mode) {
|
||||
p_pdcp_lte_info->channelType = Channel_DCCH_NB;
|
||||
} else {
|
||||
p_pdcp_lte_info->channelType = Channel_DCCH;
|
||||
}
|
||||
p_pdcp_lte_info->channelId = rlc_info->channelId;
|
||||
p_pdcp_lte_info->direction = rlc_info->direction;
|
||||
p_pdcp_lte_info->is_retx = (state != SN_OK);
|
||||
|
@ -838,7 +842,12 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
|
|||
p_pdcp_lte_info->no_header_pdu = FALSE;
|
||||
if (rlc_info->channelType == CHANNEL_TYPE_SRB) {
|
||||
p_pdcp_lte_info->plane = SIGNALING_PLANE;
|
||||
p_pdcp_lte_info->seqnum_length = 5;
|
||||
if ((rlc_info->nbMode == rlc_nb_mode) && (rlc_info->channelId == 3)) {
|
||||
p_pdcp_lte_info->no_header_pdu = TRUE;
|
||||
p_pdcp_lte_info->seqnum_length = 0;
|
||||
} else {
|
||||
p_pdcp_lte_info->seqnum_length = 5;
|
||||
}
|
||||
}
|
||||
else {
|
||||
p_pdcp_lte_info->plane = USER_PLANE;
|
||||
|
@ -2831,6 +2840,11 @@ static gboolean dissect_rlc_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
|
|||
case RLC_LTE_EXT_LI_FIELD_TAG:
|
||||
p_rlc_lte_info->extendedLiField = TRUE;
|
||||
break;
|
||||
case RLC_LTE_NB_MODE_TAG:
|
||||
p_rlc_lte_info->nbMode =
|
||||
(rlc_lte_nb_mode)tvb_get_guint8(tvb, offset);
|
||||
offset++;
|
||||
break;
|
||||
|
||||
case RLC_LTE_PAYLOAD_TAG:
|
||||
/* Have reached data, so set payload length and get out of loop */
|
||||
|
|
|
@ -51,6 +51,13 @@
|
|||
#define AM_SN_LENGTH_10_BITS 10
|
||||
#define AM_SN_LENGTH_16_BITS 16
|
||||
|
||||
|
||||
typedef enum rlc_lte_nb_mode {
|
||||
rlc_no_nb_mode = 0,
|
||||
rlc_nb_mode = 1
|
||||
} rlc_lte_nb_mode;
|
||||
|
||||
|
||||
/* Info attached to each LTE RLC frame */
|
||||
typedef struct rlc_lte_info
|
||||
{
|
||||
|
@ -63,6 +70,7 @@ typedef struct rlc_lte_info
|
|||
guint16 channelId;
|
||||
guint16 pduLength;
|
||||
gboolean extendedLiField;
|
||||
rlc_lte_nb_mode nbMode;
|
||||
} rlc_lte_info;
|
||||
|
||||
|
||||
|
@ -155,6 +163,9 @@ void set_rlc_lte_drb_li_field(packet_info *pinfo, guint16 ueid, guint8 drbid, gb
|
|||
#define RLC_LTE_EXT_LI_FIELD_TAG 0x08
|
||||
/* 0 byte, tag presence indicates that AM DRB PDU is using an extended LI field of 15 bits */
|
||||
|
||||
#define RLC_LTE_NB_MODE_TAG 0x09
|
||||
/* 1 byte containing rlc_lte_nb_mode enum value */
|
||||
|
||||
/* RLC PDU. Following this tag comes the actual RLC PDU (there is no length, the PDU
|
||||
continues until the end of the frame) */
|
||||
#define RLC_LTE_PAYLOAD_TAG 0x01
|
||||
|
|
Loading…
Reference in New Issue