PDCP-NR: Set 'cipheringDisabled' from RRC

This commit is contained in:
Martin Mathieson 2021-01-01 22:19:28 +00:00 committed by Wireshark GitLab Utility
parent 4907aa5f47
commit 41a6457ff3
9 changed files with 132 additions and 108 deletions

View File

@ -1468,9 +1468,7 @@ VisitedCellInfo-r16/timeSpent-r16 DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&uni
#.FN_BODY SIBpos-r16/assistanceDataSIB-Element-r16 VAL_PTR = &assist_data_sib_elem_tvb
tvbuff_t *assist_data_sib_elem_tvb = NULL;
%(DEFAULT_BODY)s
if (assist_data_sib_elem_tvb) {
proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_nr_rrc_assistanceDataSIB_Element_r16);
@ -1481,8 +1479,8 @@ VisitedCellInfo-r16/timeSpent-r16 DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&uni
#.FN_BODY RLC-BearerConfig
struct mac_nr_info *p_mac_nr_info;
/* Get the struct and clear it out */
nr_drb_mapping_t *drb_mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
memset(drb_mapping, 0, sizeof(nr_drb_mapping_t));
nr_drb_mac_rlc_mapping_t *drb_mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
memset(drb_mapping, 0, sizeof(nr_drb_mac_rlc_mapping_t));
%(DEFAULT_BODY)s
/* Need UE identifier */
p_mac_nr_info = (mac_nr_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_mac_nr, 0);
@ -1494,41 +1492,41 @@ VisitedCellInfo-r16/timeSpent-r16 DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&uni
#.FN_BODY DRB-Identity VAL_PTR=&value
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
%(DEFAULT_BODY)s
mapping->drbid = (guint8)value;
#.FN_BODY RLC-Config VAL_PTR=&value
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
%(DEFAULT_BODY)s
mapping->rlcMode = (value==0) ? RLC_AM_MODE : RLC_UM_MODE;
mapping->rlcMode_present = TRUE;
#.FN_BODY LogicalChannelIdentity VAL_PTR=&value
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
%(DEFAULT_BODY)s
mapping->lcid = (guint8)value;
mapping->lcid_present = TRUE;
#.FN_BODY UL-UM-RLC
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_UPLINK;
%(DEFAULT_BODY)s
#.FN_BODY DL-UM-RLC
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_DOWNLINK;
%(DEFAULT_BODY)s
#.FN_BODY UL-AM-RLC
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_UPLINK;
%(DEFAULT_BODY)s
#.FN_BODY DL-AM-RLC
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_DOWNLINK;
%(DEFAULT_BODY)s
@ -1536,7 +1534,7 @@ VisitedCellInfo-r16/timeSpent-r16 DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&uni
#.FN_BODY SN-FieldLengthUM VAL_PTR=&value
guint32 value;
%(DEFAULT_BODY)s
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
if (mapping->tempDirection == DIRECTION_UPLINK) {
mapping->rlcUlSnLength_present = TRUE;
mapping->rlcUlSnLength = (value=0) ? 6 : 12;
@ -1549,7 +1547,7 @@ VisitedCellInfo-r16/timeSpent-r16 DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&uni
#.FN_BODY SN-FieldLengthAM VAL_PTR=&value
guint32 value;
%(DEFAULT_BODY)s
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
if (mapping->tempDirection == DIRECTION_UPLINK) {
mapping->rlcUlSnLength_present = TRUE;
mapping->rlcUlSnLength = (value=0) ? 12 : 18;
@ -1559,53 +1557,57 @@ VisitedCellInfo-r16/timeSpent-r16 DISPLAY=BASE_DEC|BASE_UNIT_STRING STRINGS=&uni
mapping->rlcDlSnLength = (value=0) ? 12 : 18;
}
#.FN_BODY DRB-ToAddMod
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
memset(mapping, 0, sizeof(*mapping));
%(DEFAULT_BODY)s
/* Need UE identifier. Use mac-nr. */
mac_nr_info *p_mac_nr_info = (mac_nr_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_mac_nr, 0);
if (p_mac_nr_info) {
/* Configure PDCP SN length(s) for this DRB */
if (mapping->pdcpUlSnLength_present || mapping->pdcpDlSnLength_present) {
set_rlc_nr_drb_pdcp_seqnum_length(actx->pinfo, //p_mac_nr_info->ueid, mapping->drbid,
mapping);
}
}
#.FN_BODY SDAP-Config/sdap-HeaderDL VAL_PTR=&value
guint32 value;
%(DEFAULT_BODY)s
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpDlSdap = !value;
#.FN_BODY SDAP-Config/sdap-HeaderUL VAL_PTR=&value
guint32 value;
%(DEFAULT_BODY)s
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpUlSdap = !value;
#.FN_BODY PDCP-Config/drb/integrityProtection
%(DEFAULT_BODY)s
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpIntegrityProtection = TRUE;
#.FN_BODY DRB-ToAddMod
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
memset(mapping, 0, sizeof(*mapping));
%(DEFAULT_BODY)s
/* Need UE identifier */
mac_nr_info *p_mac_nr_info = (mac_nr_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_mac_nr, 0);
if (p_mac_nr_info) {
/* Configure PDCP SN length(s) for this DRB */
if (mapping->pdcpUlSnLength_present || mapping->pdcpDlSnLength_present) {
set_rlc_nr_drb_pdcp_seqnum_length(actx->pinfo, p_mac_nr_info->ueid, mapping->drbid,
mapping->pdcpUlSnLength, mapping->pdcpDlSnLength,
mapping->pdcpUlSdap, mapping->pdcpDlSdap,
mapping->pdcpIntegrityProtection);
}
}
#.FN_HDR PDCP-Config/eag_1/cipheringDisabled
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpCipheringDisabled = TRUE;
#.FN_BODY PDCP-Config/drb/pdcp-SN-SizeUL VAL_PTR=&value
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
%(DEFAULT_BODY)s
mapping->pdcpUlSnLength_present = TRUE;
mapping->pdcpUlSnLength = (value) ? 18 : 12;
#.FN_BODY PDCP-Config/drb/pdcp-SN-SizeDL VAL_PTR=&value
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
%(DEFAULT_BODY)s
mapping->pdcpDlSnLength_present = TRUE;
mapping->pdcpDlSnLength = (value) ? 18 : 12;
#.TYPE_ATTR
CA-ParametersEUTRA-v1570/dl-1024QAM-TotalWeightedLayers DISPLAY=BASE_CUSTOM STRINGS=CF_FUNC(nr_rrc_dl_1024QAM_TotalWeightedLayers_fmt)

View File

@ -166,7 +166,8 @@ typedef struct {
guint16 message_identifier;
guint8 warning_message_segment_type;
guint8 warning_message_segment_number;
nr_drb_mapping_t drb_mapping;
nr_drb_mac_rlc_mapping_t drb_rlc_mapping;
nr_drb_rlc_pdcp_mapping_t drb_pdcp_mapping;
lpp_pos_sib_type_t pos_sib_type;
pdcp_nr_security_info_t pdcp_security;
} nr_rrc_private_data_t;

View File

@ -2788,7 +2788,7 @@ static void set_bearer_type(dynamic_lcid_drb_mapping_t *mapping, guint8 rlcMode,
/* Set LCID -> RLC channel mappings from signalling protocol (i.e. RRC or similar). */
void set_mac_nr_bearer_mapping(nr_drb_mapping_t *drb_mapping)
void set_mac_nr_bearer_mapping(nr_drb_mac_rlc_mapping_t *drb_mapping)
{
ue_dynamic_drb_mappings_t *ue_mappings;
guint8 lcid = 0;

View File

@ -114,10 +114,11 @@ void set_mac_nr_proto_data(packet_info *pinfo, mac_nr_info *p_mac_nr_info);
/* Type to store parameters for configuring LCID->RLC channel settings for DRB */
/* Some are optional, and may not be seen (e.g. on reestablishment) */
typedef struct nr_drb_mapping_t
typedef struct nr_drb_mac_rlc_mapping_t
{
guint16 ueid; /* Mandatory */
guint8 drbid; /* Mandatory */
gboolean lcid_present;
guint8 lcid; /* Part of LogicalChannelConfig - optional */
gboolean rlcMode_present;
@ -129,21 +130,12 @@ typedef struct nr_drb_mapping_t
guint8 rlcUlSnLength; /* Part of RLC config - optional */
gboolean rlcDlSnLength_present;
guint8 rlcDlSnLength; /* Part of RLC config - optional */
gboolean pdcpUlSnLength_present;
guint8 pdcpUlSnLength; /* Part of PDCP config - optional */
gboolean pdcpDlSnLength_present;
guint8 pdcpDlSnLength; /* Part of PDCP config - optional */
gboolean pdcpUlSdap;
gboolean pdcpDlSdap;
gboolean pdcpIntegrityProtection;
} nr_drb_mapping_t;
} nr_drb_mac_rlc_mapping_t;
/* Set details of an LCID -> drb channel mapping. To be called from
configuration protocol (i.e. RRC) */
void set_mac_nr_bearer_mapping(nr_drb_mapping_t *drb_mapping);
void set_mac_nr_bearer_mapping(nr_drb_mac_rlc_mapping_t *drb_mapping);
/*

View File

@ -8661,7 +8661,8 @@ typedef struct {
guint16 message_identifier;
guint8 warning_message_segment_type;
guint8 warning_message_segment_number;
nr_drb_mapping_t drb_mapping;
nr_drb_mac_rlc_mapping_t drb_rlc_mapping;
nr_drb_rlc_pdcp_mapping_t drb_pdcp_mapping;
lpp_pos_sib_type_t pos_sib_type;
pdcp_nr_security_info_t pdcp_security;
} nr_rrc_private_data_t;
@ -18068,11 +18069,9 @@ dissect_nr_rrc_SystemInformation_IEs(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
static int
dissect_nr_rrc_T_assistanceDataSIB_Element_r16(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
tvbuff_t *assist_data_sib_elem_tvb = NULL;
offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
NO_BOUND, NO_BOUND, FALSE, &assist_data_sib_elem_tvb);
if (assist_data_sib_elem_tvb) {
proto_tree *subtree = proto_item_add_subtree(actx->created_item, ett_nr_rrc_assistanceDataSIB_Element_r16);
@ -24438,7 +24437,7 @@ static const value_string nr_rrc_T_pdcp_SN_SizeUL_vals[] = {
static int
dissect_nr_rrc_T_pdcp_SN_SizeUL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
2, &value, FALSE, 0, NULL);
@ -24460,7 +24459,7 @@ static const value_string nr_rrc_T_pdcp_SN_SizeDL_vals[] = {
static int
dissect_nr_rrc_T_pdcp_SN_SizeDL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
2, &value, FALSE, 0, NULL);
@ -24468,6 +24467,7 @@ dissect_nr_rrc_T_pdcp_SN_SizeDL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
mapping->pdcpDlSnLength = (value) ? 18 : 12;
return offset;
}
@ -24615,7 +24615,7 @@ dissect_nr_rrc_T_integrityProtection(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
1, NULL, FALSE, 0, NULL);
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpIntegrityProtection = TRUE;
@ -24687,7 +24687,7 @@ dissect_nr_rrc_CellGroupId(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _
static int
dissect_nr_rrc_LogicalChannelIdentity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
1U, maxLC_ID, &value, FALSE);
@ -24866,6 +24866,9 @@ static const value_string nr_rrc_T_cipheringDisabled_vals[] = {
static int
dissect_nr_rrc_T_cipheringDisabled(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpCipheringDisabled = TRUE;
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
1, NULL, FALSE, 0, NULL);
@ -25198,7 +25201,7 @@ dissect_nr_rrc_T_sdap_HeaderDL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
2, &value, FALSE, 0, NULL);
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpDlSdap = !value;
@ -25219,7 +25222,7 @@ dissect_nr_rrc_T_sdap_HeaderUL(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
2, &value, FALSE, 0, NULL);
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
mapping->pdcpUlSdap = !value;
@ -25296,7 +25299,7 @@ dissect_nr_rrc_T_cnAssociation(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
static int
dissect_nr_rrc_DRB_Identity(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
1U, 32U, &value, FALSE);
@ -25377,20 +25380,18 @@ static const per_sequence_t DRB_ToAddMod_sequence[] = {
static int
dissect_nr_rrc_DRB_ToAddMod(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_rlc_pdcp_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_pdcp_mapping;
memset(mapping, 0, sizeof(*mapping));
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_nr_rrc_DRB_ToAddMod, DRB_ToAddMod_sequence);
/* Need UE identifier */
/* Need UE identifier. Use mac-nr. */
mac_nr_info *p_mac_nr_info = (mac_nr_info *)p_get_proto_data(wmem_file_scope(), actx->pinfo, proto_mac_nr, 0);
if (p_mac_nr_info) {
/* Configure PDCP SN length(s) for this DRB */
if (mapping->pdcpUlSnLength_present || mapping->pdcpDlSnLength_present) {
set_rlc_nr_drb_pdcp_seqnum_length(actx->pinfo, p_mac_nr_info->ueid, mapping->drbid,
mapping->pdcpUlSnLength, mapping->pdcpDlSnLength,
mapping->pdcpUlSdap, mapping->pdcpDlSdap,
mapping->pdcpIntegrityProtection);
set_rlc_nr_drb_pdcp_seqnum_length(actx->pinfo, //p_mac_nr_info->ueid, mapping->drbid,
mapping);
}
}
@ -33871,7 +33872,7 @@ dissect_nr_rrc_SN_FieldLengthAM(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
2, &value, FALSE, 0, NULL);
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
if (mapping->tempDirection == DIRECTION_UPLINK) {
mapping->rlcUlSnLength_present = TRUE;
mapping->rlcUlSnLength = (value=0) ? 12 : 18;
@ -33882,6 +33883,7 @@ dissect_nr_rrc_SN_FieldLengthAM(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
}
return offset;
}
@ -34147,7 +34149,7 @@ dissect_nr_rrc_SN_FieldLengthUM(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *a
offset = dissect_per_enumerated(tvb, offset, actx, tree, hf_index,
2, &value, FALSE, 0, NULL);
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
if (mapping->tempDirection == DIRECTION_UPLINK) {
mapping->rlcUlSnLength_present = TRUE;
mapping->rlcUlSnLength = (value=0) ? 6 : 12;
@ -46862,7 +46864,7 @@ static const per_sequence_t UL_AM_RLC_sequence[] = {
static int
dissect_nr_rrc_UL_AM_RLC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_UPLINK;
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_nr_rrc_UL_AM_RLC, UL_AM_RLC_sequence);
@ -47010,7 +47012,7 @@ static const per_sequence_t DL_AM_RLC_sequence[] = {
static int
dissect_nr_rrc_DL_AM_RLC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_DOWNLINK;
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_nr_rrc_DL_AM_RLC, DL_AM_RLC_sequence);
@ -47044,7 +47046,7 @@ static const per_sequence_t UL_UM_RLC_sequence[] = {
static int
dissect_nr_rrc_UL_UM_RLC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_UPLINK;
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_nr_rrc_UL_UM_RLC, UL_UM_RLC_sequence);
@ -47063,7 +47065,7 @@ static const per_sequence_t DL_UM_RLC_sequence[] = {
static int
dissect_nr_rrc_DL_UM_RLC(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
mapping->tempDirection = DIRECTION_DOWNLINK;
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_nr_rrc_DL_UM_RLC, DL_UM_RLC_sequence);
@ -47136,7 +47138,7 @@ static const per_choice_t RLC_Config_choice[] = {
static int
dissect_nr_rrc_RLC_Config(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
guint32 value;
nr_drb_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
nr_drb_mac_rlc_mapping_t *mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
offset = dissect_per_choice(tvb, offset, actx, tree, hf_index,
ett_nr_rrc_RLC_Config, RLC_Config_choice,
&value);
@ -56503,8 +56505,8 @@ static int
dissect_nr_rrc_RLC_BearerConfig(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
struct mac_nr_info *p_mac_nr_info;
/* Get the struct and clear it out */
nr_drb_mapping_t *drb_mapping = &nr_rrc_get_private_data(actx)->drb_mapping;
memset(drb_mapping, 0, sizeof(nr_drb_mapping_t));
nr_drb_mac_rlc_mapping_t *drb_mapping = &nr_rrc_get_private_data(actx)->drb_rlc_mapping;
memset(drb_mapping, 0, sizeof(nr_drb_mac_rlc_mapping_t));
offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
ett_nr_rrc_RLC_BearerConfig, RLC_BearerConfig_sequence);
@ -86752,7 +86754,7 @@ static int dissect_UECapabilityEnquiry_v1560_IEs_PDU(tvbuff_t *tvb _U_, packet_i
/*--- End of included file: packet-nr-rrc-fn.c ---*/
#line 518 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 519 "./asn1/nr-rrc/packet-nr-rrc-template.c"
int
dissect_nr_rrc_nr_RLF_Report_r16_PDU(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_, void *data _U_) {
@ -110133,7 +110135,7 @@ proto_register_nr_rrc(void) {
"T_lowSE_64QAM_MCS_TableSidelink_r16_01", HFILL }},
/*--- End of included file: packet-nr-rrc-hfarr.c ---*/
#line 550 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 551 "./asn1/nr-rrc/packet-nr-rrc-template.c"
{ &hf_nr_rrc_serialNumber_gs,
{ "Geographical Scope", "nr-rrc.serialNumber.gs",
@ -112621,7 +112623,7 @@ proto_register_nr_rrc(void) {
&ett_nr_rrc_T_fr2_r16_02,
/*--- End of included file: packet-nr-rrc-ettarr.c ---*/
#line 688 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 689 "./asn1/nr-rrc/packet-nr-rrc-template.c"
&ett_nr_rrc_DedicatedNAS_Message,
&ett_nr_rrc_targetRAT_MessageContainer,
&ett_nr_rrc_nas_Container,
@ -112708,7 +112710,7 @@ proto_register_nr_rrc(void) {
/*--- End of included file: packet-nr-rrc-dis-reg.c ---*/
#line 754 "./asn1/nr-rrc/packet-nr-rrc-template.c"
#line 755 "./asn1/nr-rrc/packet-nr-rrc-template.c"
nr_rrc_etws_cmas_dcs_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(),
g_direct_hash, g_direct_equal);

View File

@ -386,7 +386,7 @@ void set_pdcp_nr_up_integrity_key(guint16 ueid, const char *key)
wmem_map_insert(pdcp_security_key_hash, GUINT_TO_POINTER((guint)ueid), key_record);
}
/* Check and convert RRC integrity key */
/* Check and convert UP integrity key */
key_record->upIntegrityKeyString = g_strdup(key);
update_key_from_string(key_record->upIntegrityKeyString, key_record->upIntegrityBinaryKey, &key_record->upIntegrityKeyOK, err);
if (err) {
@ -457,18 +457,19 @@ static const value_string control_pdu_type_vals[] = {
};
static const value_string integrity_algorithm_vals[] = {
{ 0, "NIA0 (NULL)" },
{ 1, "NIA1 (SNOW3G)" },
{ 2, "NIA2 (AES)" },
{ 3, "NIA3 (ZUC)" },
{ nia0, "NIA0 (NULL)" },
{ nia1, "NIA1 (SNOW3G)" },
{ nia2, "NIA2 (AES)" },
{ nia3, "NIA3 (ZUC)" },
{ 0, NULL }
};
static const value_string ciphering_algorithm_vals[] = {
{ 0, "NEA0 (NULL)" },
{ 1, "NEA1 (SNOW3G)" },
{ 2, "NEA2 (AES)" },
{ 3, "NEA3 (ZUC)" },
{ nea0, "NEA0 (NULL)" },
{ nea1, "NEA1 (SNOW3G)" },
{ nea2, "NEA2 (AES)" },
{ nea3, "NEA3 (ZUC)" },
{ nea_disabled, "Ciphering disabled" },
{ 0, NULL }
};
@ -1396,7 +1397,7 @@ static tvbuff_t *decipher_payload(tvbuff_t *tvb, packet_info *pinfo, int *offset
tvbuff_t *decrypted_tvb;
/* Nothing to do if NULL ciphering */
if (pdu_security_settings->ciphering == nea0) {
if (pdu_security_settings->ciphering == nea0 || pdu_security_settings->ciphering == nea_disabled) {
return tvb;
}
@ -1765,6 +1766,10 @@ static gboolean dissect_pdcp_nr_heur(tvbuff_t *tvb, packet_info *pinfo,
p_pdcp_nr_info->sdap_header = tvb_get_guint8(tvb, offset) & 0x03;
offset++;
break;
case PDCP_NR_CIPHER_DISABLED_TAG:
p_pdcp_nr_info->ciphering_disabled = TRUE;
break;
case PDCP_NR_PAYLOAD_TAG:
/* Have reached data, so get out of loop */
@ -1888,6 +1893,11 @@ static int dissect_pdcp_nr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
pdcp_nr_security_info_t *security_to_store = wmem_new(wmem_file_scope(), pdcp_nr_security_info_t);
/* Take a deep copy of the settings */
*security_to_store = *current_security;
/* But ciphering may be turned off for this channel */
if (p_pdcp_info->ciphering_disabled) {
security_to_store->ciphering = nea_disabled;
}
wmem_map_insert(pdcp_security_result_hash,
get_ueid_frame_hash_key(p_pdcp_info->ueid, pinfo->num, TRUE),
security_to_store);
@ -2731,10 +2741,10 @@ void proto_register_pdcp_nr(void)
static uat_field_t ue_keys_uat_flds[] = {
UAT_FLD_DEC(uat_ue_keys_records, ueid, "UEId", "UE Identifier of UE associated with keys"),
UAT_FLD_CSTRING(uat_ue_keys_records, rrcCipherKeyString, "RRC Cipher Key", "Key for deciphering signalling messages"),
UAT_FLD_CSTRING(uat_ue_keys_records, upCipherKeyString, "User-Plane Cipher Key", "Key for deciphering user-plane messages"),
UAT_FLD_CSTRING(uat_ue_keys_records, rrcIntegrityKeyString, "RRC Integrity Key", "Key for calculating signalling integrity MAC"),
UAT_FLD_CSTRING(uat_ue_keys_records, upIntegrityKeyString, "RRC Integrity Key", "Key for calculating user-plane integrity MAC"),
UAT_FLD_CSTRING(uat_ue_keys_records, rrcCipherKeyString, "RRC Cipher Key", "Key for deciphering signalling messages"),
UAT_FLD_CSTRING(uat_ue_keys_records, upCipherKeyString, "User-Plane Cipher Key", "Key for deciphering user-plane messages"),
UAT_FLD_CSTRING(uat_ue_keys_records, rrcIntegrityKeyString, "RRC Integrity Key", "Key for calculating signalling integrity MAC"),
UAT_FLD_CSTRING(uat_ue_keys_records, upIntegrityKeyString, "User-Plane Integrity Key", "Key for calculating user-plane integrity MAC"),
UAT_END_FIELDS
};

View File

@ -38,7 +38,7 @@ typedef enum NRBearerType
#define PDCP_NR_DL_SDAP_HEADER_PRESENT 0x02
enum nr_security_integrity_algorithm_e { nia0, nia1, nia2, nia3 };
enum nr_security_ciphering_algorithm_e { nea0, nea1, nea2, nea3 };
enum nr_security_ciphering_algorithm_e { nea0, nea1, nea2, nea3, nea_disabled=999};
typedef struct pdcp_nr_security_info_t
{
@ -67,6 +67,7 @@ typedef struct pdcp_nr_info
enum pdcp_nr_plane plane;
guint8 seqnum_length;
gboolean maci_present;
gboolean ciphering_disabled;
/* PDCP_NR_(U|D)L_SDAP_HEADER_PRESENT bitmask */
guint8 sdap_header;
@ -166,6 +167,9 @@ void set_pdcp_nr_proto_data(packet_info *pinfo, pdcp_nr_info *p_pdcp_nr_info);
#define PDCP_NR_SDAP_HEADER_TAG 0x10
/* 1 byte, bitmask with PDCP_NR_UL_SDAP_HEADER_PRESENT and/or PDCP_NR_DL_SDAP_HEADER_PRESENT */
#define PDCP_NR_CIPHER_DISABLED_TAG 0x11
/* 0 byte */
/* PDCP PDU. Following this tag comes the actual PDCP PDU (there is no length, the PDU
continues until the end of the frame) */
#define PDCP_NR_PAYLOAD_TAG 0x01

View File

@ -72,6 +72,7 @@ typedef struct rlc_ue_parameters {
gboolean pdcp_sdap_ul;
gboolean pdcp_sdap_dl;
gboolean pdcp_integrity;
gboolean pdcp_ciphering_disabled;
} rlc_ue_parameters;
static wmem_tree_t *ue_parameters_tree;
@ -467,6 +468,7 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
key[2].length = 0;
key[2].key = NULL;
/* Look up configured params for this PDCP DRB. */
params = (rlc_ue_parameters *)wmem_tree_lookup32_array_le(ue_parameters_tree, key);
if (params && (params->id != id)) {
params = NULL;
@ -485,6 +487,7 @@ static void show_PDU_in_tree(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb
}
}
p_pdcp_nr_info->maci_present = params->pdcp_integrity;
p_pdcp_nr_info->ciphering_disabled = params->pdcp_ciphering_disabled;
}
break;
@ -1302,12 +1305,8 @@ static void dissect_rlc_nr_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree
/* Configure number of PDCP SN bits to use for DRB channels */
void set_rlc_nr_drb_pdcp_seqnum_length(packet_info *pinfo, guint16 ueid, guint8 drbid,
guint8 userplane_seqnum_length_ul,
guint8 userplane_seqnum_length_dl,
gboolean sdap_ul,
gboolean sdap_dl,
gboolean integrity)
void set_rlc_nr_drb_pdcp_seqnum_length(packet_info *pinfo,
nr_drb_rlc_pdcp_mapping_t *drb_mapping)
{
wmem_tree_key_t key[3];
guint32 id;
@ -1317,7 +1316,7 @@ void set_rlc_nr_drb_pdcp_seqnum_length(packet_info *pinfo, guint16 ueid, guint8
return;
}
id = (drbid << 16) | ueid;
id = (drb_mapping->drbid << 16) | drb_mapping->ueid;
key[0].length = 1;
key[0].key = &id;
key[1].length = 1;
@ -1338,11 +1337,12 @@ void set_rlc_nr_drb_pdcp_seqnum_length(packet_info *pinfo, guint16 ueid, guint8
}
/* Populate params */
params->pdcp_sn_bits_ul = userplane_seqnum_length_ul;
params->pdcp_sn_bits_dl = userplane_seqnum_length_dl;
params->pdcp_sdap_ul = sdap_ul;
params->pdcp_sdap_dl = sdap_dl;
params->pdcp_integrity = integrity;
params->pdcp_sn_bits_ul = drb_mapping->pdcpUlSnLength;
params->pdcp_sn_bits_dl = drb_mapping->pdcpDlSnLength;
params->pdcp_sdap_ul = drb_mapping->pdcpUlSdap;
params->pdcp_sdap_dl = drb_mapping->pdcpDlSdap;
params->pdcp_integrity = drb_mapping->pdcpIntegrityProtection;
params->pdcp_ciphering_disabled = drb_mapping->pdcpCipheringDisabled;
}

View File

@ -47,12 +47,25 @@ typedef struct rlc_nr_info
guint16 pduLength;
} rlc_nr_info;
typedef struct nr_drb_rlc_pdcp_mapping_t
{
guint16 ueid; /* Mandatory */
guint8 drbid; /* Mandatory */
gboolean pdcpUlSnLength_present;
guint8 pdcpUlSnLength; /* Part of PDCP config - optional */
gboolean pdcpDlSnLength_present;
guint8 pdcpDlSnLength; /* Part of PDCP config - optional */
gboolean pdcpUlSdap;
gboolean pdcpDlSdap;
gboolean pdcpIntegrityProtection;
gboolean pdcpCipheringDisabled;
} nr_drb_rlc_pdcp_mapping_t;
/* Configure number of PDCP SN bits to use for DRB channels. */
void set_rlc_nr_drb_pdcp_seqnum_length(packet_info *pinfo, guint16 ueid, guint8 drbid,
guint8 userplane_seqnum_length_ul,
guint8 userplane_seqnum_length_dl,
gboolean sdap_ul, gboolean sdap_dl,
gboolean integrity);
void set_rlc_nr_drb_pdcp_seqnum_length(packet_info *pinfo,
nr_drb_rlc_pdcp_mapping_t *drb_mapping);
/*****************************************************************/
/* UDP framing format */