Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG UE
Commits
374a89f7
Commit
374a89f7
authored
Sep 24, 2020
by
Xue Song
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RRCReconfiguration message
parent
3a159793
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
322 additions
and
98 deletions
+322
-98
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+150
-3
openair2/RRC/NR/MESSAGES/asn1_msg.h
openair2/RRC/NR/MESSAGES/asn1_msg.h
+6
-0
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+4
-0
openair2/RRC/NR/nr_rrc_proto.h
openair2/RRC/NR/nr_rrc_proto.h
+5
-0
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+151
-95
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+6
-0
No files found.
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
374a89f7
...
...
@@ -57,6 +57,10 @@
#include "NR_MAC-CellGroupConfig.h"
#include "NR_SecurityModeCommand.h"
#include "NR_CipheringAlgorithm.h"
#include "NR_RRCReconfiguration-IEs.h"
#include "NR_DRB-ToAddMod.h"
#include "NR_DRB-ToAddModList.h"
#include "NR_SecurityConfig.h"
#if defined(NR_Rel16)
#include "NR_SCS-SpecificCarrier.h"
#include "NR_TDD-UL-DL-ConfigCommon.h"
...
...
@@ -605,6 +609,7 @@ uint8_t do_RRCReject(uint8_t Mod_id,
memset
((
void
*
)
&
dl_ccch_msg
,
0
,
sizeof
(
NR_DL_CCCH_Message_t
));
dl_ccch_msg
.
message
.
present
=
NR_DL_CCCH_MessageType_PR_c1
;
dl_ccch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_DL_CCCH_MessageType__c1
));
dl_ccch_msg
.
message
.
choice
.
c1
->
present
=
NR_RRCReject__criticalExtensions_PR_rrcReject
;
rrcReject
=
dl_ccch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReject
;
...
...
@@ -659,6 +664,7 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
memset
((
void
*
)
&
dl_ccch_msg
,
0
,
sizeof
(
NR_DL_CCCH_Message_t
));
dl_ccch_msg
.
message
.
present
=
NR_DL_CCCH_MessageType_PR_c1
;
dl_ccch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_DL_CCCH_MessageType__c1
));
dl_ccch_msg
.
message
.
choice
.
c1
->
present
=
NR_DL_CCCH_MessageType__c1_PR_rrcSetup
;
rrcSetup
=
dl_ccch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetup
;
...
...
@@ -834,9 +840,6 @@ uint8_t do_NR_SecurityModeCommand(
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
/*TODO*/
//------------------------------------------------------------------------------
uint8_t
do_NR_UECapabilityEnquiry_nr
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
...
...
@@ -960,3 +963,147 @@ uint8_t do_NR_RRCConnectionRelease(uint8_t *buffer,
RRC_BUF_SIZE
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
uint16_t
do_RRCReconfiguration
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
,
uint8_t
*
buffer
,
uint8_t
Transaction_id
,
gNB_RRC_INST
*
gnb_rrc_inst
)
{
NR_DL_DCCH_Message_t
dl_dcch_msg
;
asn_enc_rval_t
enc_rval
;
NR_RRCReconfiguration_IEs_t
*
ie
;
NR_SRB_ToAddModList_t
*
SRB2_configList
=
NULL
;
NR_SRB_ToAddMod_t
*
SRB2_config
=
NULL
;
NR_DRB_ToAddModList_t
*
DRB_configList
=
NULL
;
NR_DRB_ToAddMod_t
*
DRB_config
=
NULL
;
NR_SecurityConfig_t
*
security_config
=
NULL
;
NR_CellGroupConfig_t
*
secondaryCellGroup
=
NULL
;
NR_DedicatedNAS_Message_t
*
dedicatedNAS_Message
=
NULL
;
memset
(
&
dl_dcch_msg
,
0
,
sizeof
(
NR_DL_DCCH_Message_t
));
dl_dcch_msg
.
message
.
present
=
NR_DL_DCCH_MessageType_PR_c1
;
dl_dcch_msg
.
message
.
choice
.
c1
=
CALLOC
(
1
,
sizeof
(
struct
NR_DL_DCCH_MessageType__c1
));
dl_dcch_msg
.
message
.
choice
.
c1
->
present
=
NR_DL_DCCH_MessageType__c1_PR_rrcReconfiguration
;
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
=
calloc
(
1
,
sizeof
(
NR_RRCReconfiguration_t
));
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
rrc_TransactionIdentifier
=
Transaction_id
;
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
criticalExtensions
.
present
=
NR_RRCReconfiguration__criticalExtensions_PR_rrcReconfiguration
;
uint8_t
xid
=
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
);
/******************** Radio Bearer Config ********************/
ie
->
radioBearerConfig
=
calloc
(
1
,
sizeof
(
NR_RadioBearerConfig_t
));
/* Configure SRB2 */
SRB2_configList
=
ue_context_pP
->
ue_context
.
SRB_configList2
[
xid
];
if
(
SRB2_configList
)
{
free
(
SRB2_configList
);
}
SRB2_configList
=
CALLOC
(
1
,
sizeof
(
*
SRB2_configList
));
memset
(
SRB2_configList
,
0
,
sizeof
(
*
SRB2_configList
));
SRB2_config
=
CALLOC
(
1
,
sizeof
(
*
SRB2_config
));
SRB2_config
->
srb_Identity
=
2
;
ASN_SEQUENCE_ADD
(
&
SRB2_configList
->
list
,
SRB2_config
);
/* Configure DRB */
DRB_configList
=
CALLOC
(
1
,
sizeof
(
*
DRB_configList
));
memset
(
DRB_configList
,
0
,
sizeof
(
*
DRB_configList
));
DRB_config
=
CALLOC
(
1
,
sizeof
(
*
DRB_config
));
DRB_config
->
drb_Identity
=
1
;
DRB_config
->
cnAssociation
=
CALLOC
(
1
,
sizeof
(
*
DRB_config
->
cnAssociation
));
DRB_config
->
cnAssociation
->
present
=
NR_DRB_ToAddMod__cnAssociation_PR_sdap_Config
;
// TODO sdap_Config
// TODO pdcp_Config
DRB_config
->
reestablishPDCP
=
NULL
;
DRB_config
->
recoverPDCP
=
NULL
;
DRB_config
->
pdcp_Config
=
calloc
(
1
,
sizeof
(
*
DRB_config
->
pdcp_Config
));
DRB_config
->
pdcp_Config
->
drb
=
calloc
(
1
,
sizeof
(
*
DRB_config
->
pdcp_Config
->
drb
));
DRB_config
->
pdcp_Config
->
drb
->
discardTimer
=
calloc
(
1
,
sizeof
(
*
DRB_config
->
pdcp_Config
->
drb
->
discardTimer
));
*
DRB_config
->
pdcp_Config
->
drb
->
discardTimer
=
NR_PDCP_Config__drb__discardTimer_ms30
;
DRB_config
->
pdcp_Config
->
drb
->
pdcp_SN_SizeUL
=
calloc
(
1
,
sizeof
(
*
DRB_config
->
pdcp_Config
->
drb
->
pdcp_SN_SizeUL
));
*
DRB_config
->
pdcp_Config
->
drb
->
pdcp_SN_SizeUL
=
NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits
;
DRB_config
->
pdcp_Config
->
drb
->
pdcp_SN_SizeDL
=
calloc
(
1
,
sizeof
(
*
DRB_config
->
pdcp_Config
->
drb
->
pdcp_SN_SizeDL
));
*
DRB_config
->
pdcp_Config
->
drb
->
pdcp_SN_SizeDL
=
NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits
;
DRB_config
->
pdcp_Config
->
drb
->
headerCompression
.
present
=
NR_PDCP_Config__drb__headerCompression_PR_notUsed
;
DRB_config
->
pdcp_Config
->
drb
->
headerCompression
.
choice
.
notUsed
=
0
;
DRB_config
->
pdcp_Config
->
drb
->
integrityProtection
=
NULL
;
DRB_config
->
pdcp_Config
->
drb
->
statusReportRequired
=
NULL
;
DRB_config
->
pdcp_Config
->
drb
->
outOfOrderDelivery
=
NULL
;
DRB_config
->
pdcp_Config
->
moreThanOneRLC
=
NULL
;
DRB_config
->
pdcp_Config
->
t_Reordering
=
calloc
(
1
,
sizeof
(
*
DRB_config
->
pdcp_Config
->
t_Reordering
));
*
DRB_config
->
pdcp_Config
->
t_Reordering
=
NR_PDCP_Config__t_Reordering_ms0
;
DRB_config
->
pdcp_Config
->
ext1
=
NULL
;
ASN_SEQUENCE_ADD
(
&
DRB_configList
->
list
,
DRB_config
);
/* Configure Security */
security_config
=
CALLOC
(
1
,
sizeof
(
NR_SecurityConfig_t
));
security_config
->
securityAlgorithmConfig
=
CALLOC
(
1
,
sizeof
(
*
ie
->
radioBearerConfig
->
securityConfig
->
securityAlgorithmConfig
));
security_config
->
securityAlgorithmConfig
->
cipheringAlgorithm
=
NR_CipheringAlgorithm_nea0
;
security_config
->
securityAlgorithmConfig
->
integrityProtAlgorithm
=
NULL
;
security_config
->
keyToUse
=
CALLOC
(
1
,
sizeof
(
*
ie
->
radioBearerConfig
->
securityConfig
->
keyToUse
));
*
security_config
->
keyToUse
=
NR_SecurityConfig__keyToUse_master
;
ie
=
calloc
(
1
,
sizeof
(
NR_RRCReconfiguration_IEs_t
));
ie
->
radioBearerConfig
=
calloc
(
1
,
sizeof
(
NR_RadioBearerConfig_t
));
ie
->
radioBearerConfig
->
srb_ToAddModList
=
SRB2_configList
;
ie
->
radioBearerConfig
->
drb_ToAddModList
=
DRB_configList
;
ie
->
radioBearerConfig
->
securityConfig
=
security_config
;
ie
->
radioBearerConfig
->
srb3_ToRelease
=
NULL
;
ie
->
radioBearerConfig
->
drb_ToReleaseList
=
NULL
;
/******************** Secondary Cell Group ********************/
rrc_gNB_carrier_data_t
*
carrier
=
&
(
gnb_rrc_inst
->
carrier
);
fill_default_secondaryCellGroup
(
carrier
->
ServingCellConfigCommon
,
ue_context_pP
->
ue_context
.
secondaryCellGroup
,
1
,
1
,
carrier
->
pdsch_AntennaPorts
,
carrier
->
initial_csi_index
[
gnb_rrc_inst
->
Nb_ue
]);
/******************** Meas Config ********************/
// measConfig
ie
->
measConfig
=
NULL
;
// lateNonCriticalExtension
ie
->
lateNonCriticalExtension
=
NULL
;
// nonCriticalExtension
dedicatedNAS_Message
->
buf
=
ue_context_pP
->
ue_context
.
nas_pdu
.
buffer
;
dedicatedNAS_Message
->
size
=
ue_context_pP
->
ue_context
.
nas_pdu
.
length
;
ie
->
nonCriticalExtension
->
dedicatedNAS_MessageList
=
CALLOC
(
1
,
sizeof
(
*
ie
->
nonCriticalExtension
->
dedicatedNAS_MessageList
));
ASN_SEQUENCE_ADD
(
&
ie
->
nonCriticalExtension
->
dedicatedNAS_MessageList
->
list
,
dedicatedNAS_Message
);
dl_dcch_msg
.
message
.
choice
.
c1
->
choice
.
rrcReconfiguration
->
criticalExtensions
.
choice
.
rrcReconfiguration
=
ie
;
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_DL_DCCH_Message
,
NULL
,
(
void
*
)
&
dl_dcch_msg
,
buffer
,
100
);
if
(
enc_rval
.
encoded
==
-
1
)
{
LOG_I
(
NR_RRC
,
"[gNB AssertFatal]ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
return
-
1
;
}
LOG_D
(
NR_RRC
,
"[gNB %d] RRCReconfiguration for UE %x Encoded %zd bits (%zd bytes)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
if
(
enc_rval
.
encoded
==
-
1
)
{
LOG_E
(
NR_RRC
,
"[gNB %d] ASN1 : RRCReconfiguration encoding failed for UE %x
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
);
return
(
-
1
);
}
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
openair2/RRC/NR/MESSAGES/asn1_msg.h
View file @
374a89f7
...
...
@@ -101,3 +101,9 @@ uint8_t do_NR_SecurityModeCommand(
uint8_t
do_NR_RRCConnectionRelease
(
uint8_t
*
buffer
,
uint8_t
Transaction_id
);
uint16_t
do_RRCReconfiguration
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
,
uint8_t
*
buffer
,
uint8_t
Transaction_id
,
gNB_RRC_INST
*
gnb_rrc_inst
);
openair2/RRC/NR/nr_rrc_defs.h
View file @
374a89f7
...
...
@@ -360,6 +360,10 @@ typedef struct gNB_RRC_UE_s {
struct
NR_MAC_CellGroupConfig
*
mac_CellGroupConfig
;
struct
NR_PhysicalCellGroupConfig
*
physicalCellGroupConfig
;
/* Nas Pdu */
uint8_t
nas_pdu_flag
;
ngap_nas_pdu_t
nas_pdu
;
}
gNB_RRC_UE_t
;
typedef
uid_t
ue_uid_t
;
...
...
openair2/RRC/NR/nr_rrc_proto.h
View file @
374a89f7
...
...
@@ -97,6 +97,11 @@ rrc_gNB_generate_SecurityModeCommand(
rrc_gNB_ue_context_t
*
const
ue_context_pP
);
uint8_t
rrc_gNB_get_next_transaction_identifier
(
module_id_t
gnb_mod_idP
);
/**\brief RRC eNB task.
\param void *args_p Pointer on arguments to start the task. */
void
*
rrc_gnb_task
(
void
*
args_p
);
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
374a89f7
...
...
@@ -74,6 +74,7 @@
#include "rrc_eNB_S1AP.h"
#include "rrc_gNB_NGAP.h"
#include "rrc_eNB_GTPV1U.h"
...
...
@@ -457,6 +458,60 @@ rrc_gNB_process_RRCSetupComplete(
rrc_gNB_send_NGAP_NAS_FIRST_REQ
(
ctxt_pP
,
ue_context_pP
,
rrcSetupComplete
);
}
//-----------------------------------------------------------------------------
void
rrc_gNB_generate_defaultRRCReconfiguration
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
ue_context_pP
)
//-----------------------------------------------------------------------------
{
gNB_RRC_UE_t
*
ue_p
=
&
ue_context_pP
->
ue_context
;
uint8_t
buffer
[
RRC_BUF_SIZE
];
uint16_t
size
;
gNB_RRC_INST
*
gnb_rrc_inst
=
RC
.
nrrrc
[
ctxt_pP
->
module_id
];
size
=
do_RRCReconfiguration
(
ctxt_pP
,
ue_context_pP
,
buffer
,
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
),
gnb_rrc_inst
);
LOG_DUMPMSG
(
NR_RRC
,
DEBUG_RRC
,(
char
*
)
buffer
,
size
,
"[MSG] RRC Reconfiguration
\n
"
);
free
(
ue_context_pP
->
ue_context
.
nas_pdu
.
buffer
);
LOG_I
(
NR_RRC
,
"[gNB %d] Frame %d, Logical Channel DL-DCCH, Generate NR_RRCReconfiguration (bytes %d, UE id %x)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
size
,
ue_context_pP
->
ue_context
.
rnti
);
LOG_D
(
NR_RRC
,
"[FRAME %05d][RRC_gNB][MOD %u][][--- PDCP_DATA_REQ/%d Bytes (rrcReconfiguration to UE %x MUI %d) --->][PDCP][MOD %u][RB %u]
\n
"
,
ctxt_pP
->
frame
,
ctxt_pP
->
module_id
,
size
,
ue_context_pP
->
ue_context
.
rnti
,
rrc_gNB_mui
,
ctxt_pP
->
module_id
,
DCCH
);
MSC_LOG_TX_MESSAGE
(
MSC_RRC_GNB
,
MSC_RRC_UE
,
buffer
,
size
,
MSC_AS_TIME_FMT
" NR_RRCReconfiguration UE %x MUI %d size %u"
,
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ue_context_pP
->
ue_context
.
rnti
,
rrc_gNB_mui
,
size
);
// rrc_data_req(ctxt_pP,
// DCCH,
// rrc_gNB_mui++,
// SDU_CONFIRM_NO,
// size,
// buffer,
// PDCP_TRANSMISSION_MODE_CONTROL);
// rrc_pdcp_config_asn1_req
// rrc_rlc_config_asn1_req
}
/*------------------------------------------------------------------------------*/
int
nr_rrc_gNB_decode_ccch
(
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
*
buffer
,
...
...
@@ -723,7 +778,6 @@ rrc_gNB_decode_dcch(
DCCH
,
sdu_sizeP
);
// rrcSetupComplete = ul_dcch_msg->message.choice.c1->choice.rrcSetupComplete;
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
present
==
NR_RRCSetupComplete__criticalExtensions_PR_rrcSetupComplete
)
{
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
rrcSetupComplete
->
criticalExtensions
.
choice
.
...
...
@@ -806,105 +860,106 @@ rrc_gNB_decode_dcch(
break
;
}
LOG_DUMPMSG
(
NR_RRC
,
DEBUG_RRC
,(
char
*
)
Rx_sdu
,
sdu_sizeP
,
"[MSG] NR_RRC UECapablility Information
\n
"
);
MSC_LOG_RX_MESSAGE
(
MSC_RRC_GNB
,
MSC_RRC_UE
,
Rx_sdu
,
sdu_sizeP
,
MSC_AS_TIME_FMT
" ueCapabilityInformation UE %x size %u"
,
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ue_context_p
->
ue_context
.
rnti
,
sdu_sizeP
);
LOG_I
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" received ueCapabilityInformation on UL-DCCH %d from UE
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
DCCH
);
LOG_D
(
RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(UECapabilityInformation) ---> RRC_eNB
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
DCCH
,
sdu_sizeP
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
ul_dcch_msg
);
}
LOG_I
(
NR_RRC
,
"got UE capabilities for UE %x
\n
"
,
ctxt_pP
->
rnti
);
int
eutra_index
=
-
1
;
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
present
==
NR_UECapabilityInformation__criticalExtensions_PR_ueCapabilityInformation
)
{
for
(
i
=
0
;
i
<
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
count
;
i
++
){
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
rat_Type
==
NR_RAT_Type_nr
){
if
(
ue_context_p
->
ue_context
.
UE_Capability_nr
){
LOG_DUMPMSG
(
NR_RRC
,
DEBUG_RRC
,(
char
*
)
Rx_sdu
,
sdu_sizeP
,
"[MSG] NR_RRC UECapablility Information
\n
"
);
MSC_LOG_RX_MESSAGE
(
MSC_RRC_GNB
,
MSC_RRC_UE
,
Rx_sdu
,
sdu_sizeP
,
MSC_AS_TIME_FMT
" ueCapabilityInformation UE %x size %u"
,
MSC_AS_TIME_ARGS
(
ctxt_pP
),
ue_context_p
->
ue_context
.
rnti
,
sdu_sizeP
);
LOG_I
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" received ueCapabilityInformation on UL-DCCH %d from UE
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
DCCH
);
LOG_D
(
RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" RLC RB %02d --- RLC_DATA_IND %d bytes "
"(UECapabilityInformation) ---> RRC_eNB
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
DCCH
,
sdu_sizeP
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
ul_dcch_msg
);
}
LOG_I
(
NR_RRC
,
"got UE capabilities for UE %x
\n
"
,
ctxt_pP
->
rnti
);
int
eutra_index
=
-
1
;
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
present
==
NR_UECapabilityInformation__criticalExtensions_PR_ueCapabilityInformation
)
{
for
(
i
=
0
;
i
<
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
count
;
i
++
){
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
rat_Type
==
NR_RAT_Type_nr
){
if
(
ue_context_p
->
ue_context
.
UE_Capability_nr
){
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_NR_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_nr
);
ue_context_p
->
ue_context
.
UE_Capability_nr
=
0
;
}
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_UE_NR_Capability
,
(
void
**
)
&
ue_context_p
->
ue_context
.
UE_Capability_nr
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
buf
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
,
0
,
0
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)){
xer_fprint
(
stdout
,
&
asn_DEF_NR_UE_NR_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_nr
);
}
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
)){
LOG_E
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" Failed to decode nr UE capabilities (%zu bytes)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
dec_rval
.
consumed
);
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_NR_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_nr
);
ue_context_p
->
ue_context
.
UE_Capability_nr
=
0
;
}
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_UE_NR_Capability
,
(
void
**
)
&
ue_context_p
->
ue_context
.
UE_Capability_nr
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
buf
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
,
0
,
0
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)){
xer_fprint
(
stdout
,
&
asn_DEF_NR_UE_NR_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_nr
);
}
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
)){
LOG_E
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_UE_FMT
" Failed to decode nr UE capabilities (%zu bytes)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
dec_rval
.
consumed
);
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_NR_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_nr
);
ue_context_p
->
ue_context
.
UE_Capability_nr
=
0
;
}
ue_context_p
->
ue_context
.
UE_Capability_size
=
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
;
}
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
rat_Type
==
NR_RAT_Type_eutra_nr
){
if
(
ue_context_p
->
ue_context
.
UE_Capability_MRDC
){
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_MRDC_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_MRDC
);
ue_context_p
->
ue_context
.
UE_Capability_MRDC
=
0
;
}
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_UE_MRDC_Capability
,
(
void
**
)
&
ue_context_p
->
ue_context
.
UE_Capability_MRDC
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
buf
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
,
0
,
0
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)){
xer_fprint
(
stdout
,
&
asn_DEF_NR_UE_MRDC_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_MRDC
);
}
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
)){
LOG_E
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_FMT
" Failed to decode nr UE capabilities (%zu bytes)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
dec_rval
.
consumed
);
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_MRDC_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_MRDC
);
ue_context_p
->
ue_context
.
UE_Capability_MRDC
=
0
;
}
ue_context_p
->
ue_context
.
UE_MRDC_Capability_size
=
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
;
}
ue_context_p
->
ue_context
.
UE_Capability_nr
=
0
;
}
ue_context_p
->
ue_context
.
UE_Capability_size
=
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
;
}
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
rat_Type
==
NR_RAT_Type_eutra_nr
){
if
(
ue_context_p
->
ue_context
.
UE_Capability_MRDC
){
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_MRDC_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_MRDC
);
ue_context_p
->
ue_context
.
UE_Capability_MRDC
=
0
;
}
dec_rval
=
uper_decode
(
NULL
,
&
asn_DEF_NR_UE_MRDC_Capability
,
(
void
**
)
&
ue_context_p
->
ue_context
.
UE_Capability_MRDC
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
buf
,
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
,
0
,
0
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)){
xer_fprint
(
stdout
,
&
asn_DEF_NR_UE_MRDC_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_MRDC
);
}
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
rat_Type
==
NR_RAT_Type_eutra
){
if
(
eutra_index
==
-
1
){
LOG_E
(
NR_RRC
,
"fatal: more than 1 eutra capability
\n
"
);
exit
(
1
);
}
eutra_index
=
i
;
if
((
dec_rval
.
code
!=
RC_OK
)
&&
(
dec_rval
.
consumed
==
0
)){
LOG_E
(
NR_RRC
,
PROTOCOL_NR_RRC_CTXT_FMT
" Failed to decode nr UE capabilities (%zu bytes)
\n
"
,
PROTOCOL_NR_RRC_CTXT_UE_ARGS
(
ctxt_pP
),
dec_rval
.
consumed
);
ASN_STRUCT_FREE
(
asn_DEF_NR_UE_MRDC_Capability
,
ue_context_p
->
ue_context
.
UE_Capability_MRDC
);
ue_context_p
->
ue_context
.
UE_Capability_MRDC
=
0
;
}
ue_context_p
->
ue_context
.
UE_MRDC_Capability_size
=
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
ue_CapabilityRAT_Container
.
size
;
}
if
(
ul_dcch_msg
->
message
.
choice
.
c1
->
choice
.
ueCapabilityInformation
->
criticalExtensions
.
choice
.
ueCapabilityInformation
->
ue_CapabilityRAT_ContainerList
->
list
.
array
[
i
]
->
rat_Type
==
NR_RAT_Type_eutra
){
if
(
eutra_index
==
-
1
){
LOG_E
(
NR_RRC
,
"fatal: more than 1 eutra capability
\n
"
);
exit
(
1
);
}
eutra_index
=
i
;
}
}
}
if
(
eutra_index
==
-
1
)
break
;
}
if
(
eutra_index
==
-
1
)
break
;
}
rrc_gNB_generate_defaultRRCReconfiguration
(
ctxt_pP
,
ue_context_p
);
break
;
default:
...
...
@@ -1065,6 +1120,7 @@ void *rrc_gnb_task(void *args_p) {
case
X2AP_ENDC_SGNB_RECONF_COMPLETE
:
LOG_I
(
NR_RRC
,
"Handling of reconfiguration complete message at RRC gNB is pending
\n
"
);
break
;
case
NGAP_INITIAL_CONTEXT_SETUP_REQ
:
rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ
(
msg_p
,
msg_name_p
,
instance
);
break
;
...
...
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
374a89f7
...
...
@@ -260,6 +260,12 @@ rrc_gNB_process_NGAP_INITIAL_CONTEXT_SETUP_REQ(
ue_context_p
->
ue_context
.
gNB_ue_ngap_id
=
NGAP_INITIAL_CONTEXT_SETUP_REQ
(
msg_p
).
gNB_ue_ngap_id
;
ue_context_p
->
ue_context
.
amf_ue_ngap_id
=
NGAP_INITIAL_CONTEXT_SETUP_REQ
(
msg_p
).
amf_ue_ngap_id
;
/* NAS PDU */
if
(
ue_context_p
->
ue_context
.
nas_pdu_flag
==
1
)
{
ue_context_p
->
ue_context
.
nas_pdu
.
length
=
NGAP_INITIAL_CONTEXT_SETUP_REQ
(
msg_p
).
nas_pdu
.
length
;
ue_context_p
->
ue_context
.
nas_pdu
.
buffer
=
NGAP_INITIAL_CONTEXT_SETUP_REQ
(
msg_p
).
nas_pdu
.
buffer
;
}
/* TODO security */
uint8_t
send_security_mode_command
=
TRUE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment