Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
lizhongxiao
OpenXG-RAN
Commits
84579c5d
Commit
84579c5d
authored
Sep 29, 2020
by
zhenghuangkun
Committed by
yoshio.inoue
Oct 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify MME_MODE_ENABLED to AMF_MODE_ENABLED
Modify kenb to kgnb Modify some warnings
parent
ad44cbdc
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
247 additions
and
698 deletions
+247
-698
executables/nr-ru.c
executables/nr-ru.c
+1
-1
executables/nr-softmodem.c
executables/nr-softmodem.c
+2
-2
openair1/SIMULATION/NR_PHY/nr_unitary_defs.h
openair1/SIMULATION/NR_PHY/nr_unitary_defs.h
+2
-2
openair2/GNB_APP/gnb_app.c
openair2/GNB_APP/gnb_app.c
+1
-1
openair2/GNB_APP/gnb_config.c
openair2/GNB_APP/gnb_config.c
+8
-8
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+1
-2
openair2/RRC/NR/nr_rrc_defs.h
openair2/RRC/NR/nr_rrc_defs.h
+4
-4
openair2/RRC/NR/rrc_gNB.c
openair2/RRC/NR/rrc_gNB.c
+4
-4
openair2/RRC/NR/rrc_gNB_NGAP.c
openair2/RRC/NR/rrc_gNB_NGAP.c
+5
-5
openair2/RRC/NR/rrc_gNB_NGAP.h
openair2/RRC/NR/rrc_gNB_NGAP.h
+1
-1
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+195
-0
openair2/RRC/NR_UE/rrc_defs.h
openair2/RRC/NR_UE/rrc_defs.h
+3
-0
openair3/NGAP/ngap_gNB.c
openair3/NGAP/ngap_gNB.c
+1
-0
openair3/NGAP/ngap_gNB.h
openair3/NGAP/ngap_gNB.h
+10
-0
openair3/NGAP/ngap_gNB_handlers.c
openair3/NGAP/ngap_gNB_handlers.c
+3
-221
openair3/NGAP/ngap_gNB_nas_procedures.c
openair3/NGAP/ngap_gNB_nas_procedures.c
+2
-381
openair3/NGAP/ngap_gNB_overload.c
openair3/NGAP/ngap_gNB_overload.c
+1
-32
openair3/NGAP/ngap_gNB_trace.c
openair3/NGAP/ngap_gNB_trace.c
+1
-32
targets/COMMON/create_nr_tasks.c
targets/COMMON/create_nr_tasks.c
+2
-2
No files found.
executables/nr-ru.c
View file @
84579c5d
...
...
@@ -1796,7 +1796,7 @@ void init_RU_proc(RU_t *ru) {
pthread_cond_init
(
&
proc
->
cond_asynch_rxtx
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_synch
,
NULL
);
pthread_cond_init
(
&
proc
->
cond_gNBs
,
NULL
);
//
threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "thread_FH", -1, OAI_PRIORITY_RT_MAX );
threadCreate
(
&
proc
->
pthread_FH
,
ru_thread
,
(
void
*
)
ru
,
"thread_FH"
,
-
1
,
OAI_PRIORITY_RT_MAX
);
if
(
get_thread_parallel_conf
()
==
PARALLEL_RU_L1_SPLIT
||
get_thread_parallel_conf
()
==
PARALLEL_RU_L1_TRX_SPLIT
)
threadCreate
(
&
proc
->
pthread_FH1
,
ru_thread_tx
,
(
void
*
)
ru
,
"thread_FH1"
,
-
1
,
OAI_PRIORITY_RT
);
...
...
executables/nr-softmodem.c
View file @
84579c5d
...
...
@@ -401,7 +401,7 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
if
(
EPC
_MODE_ENABLED
&&
(
get_softmodem_params
()
->
phy_test
==
0
&&
get_softmodem_params
()
->
do_ra
==
0
))
{
if
(
AMF
_MODE_ENABLED
&&
(
get_softmodem_params
()
->
phy_test
==
0
&&
get_softmodem_params
()
->
do_ra
==
0
))
{
if
(
gnb_nb
>
0
)
{
/*
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
...
...
@@ -824,7 +824,7 @@ int main( int argc, char **argv )
}
openair0_cfg
[
0
].
threequarter_fs
=
threequarter_fs
;
EPC
_MODE_ENABLED
=
!
IS_SOFTMODEM_NOS1
;
//!get_softmodem_params()->phy_test;
AMF
_MODE_ENABLED
=
!
IS_SOFTMODEM_NOS1
;
//!get_softmodem_params()->phy_test;
if
(
get_softmodem_params
()
->
do_ra
)
AssertFatal
(
get_softmodem_params
()
->
phy_test
==
0
,
"RA and phy_test are mutually exclusive
\n
"
);
...
...
openair1/SIMULATION/NR_PHY/nr_unitary_defs.h
View file @
84579c5d
...
...
@@ -235,8 +235,8 @@ void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL
void
fix_scc
(
NR_ServingCellConfigCommon_t
*
scc
,
uint64_t
ssbmap
);
void
prepare_scc
(
NR_ServingCellConfigCommon_t
*
scc
);
s1ap_eNB_config_t
s1
ap_config
;
uint32_t
s1ap_generate_e
NB_id
(
void
)
{
return
0
;}
ngap_gNB_config_t
ng
ap_config
;
uint32_t
ngap_generate_g
NB_id
(
void
)
{
return
0
;}
void
configure_nfapi_pnf
(
char
*
vnf_ip_addr
,
int
vnf_p5_port
,
char
*
pnf_ip_addr
,
int
pnf_p7_port
,
int
vnf_p7_port
)
{
return
;}
void
configure_nfapi_vnf
(
char
*
vnf_addr
,
int
vnf_p5_port
)
{
return
;}
...
...
openair2/GNB_APP/gnb_app.c
View file @
84579c5d
...
...
@@ -173,7 +173,7 @@ void *gNB_app_task(void *args_p)
__attribute__
((
unused
))
uint32_t
x2_register_gnb_pending
=
gNB_app_register_x2
(
gnb_id_start
,
gnb_id_end
);
}
if
(
EPC
_MODE_ENABLED
)
{
if
(
AMF
_MODE_ENABLED
)
{
/* Try to register each gNB */
//registered_gnb = 0;
__attribute__
((
unused
))
uint32_t
register_gnb_pending
=
gNB_app_register
(
gnb_id_start
,
gnb_id_end
);
//, gnb_properties_p);
...
...
openair2/GNB_APP/gnb_config.c
View file @
84579c5d
...
...
@@ -342,7 +342,7 @@ void RCconfig_nr_flexran()
/* gNB ID from configuration, as read in by RCconfig_RRC() */
if
(
!
GNBParamList
.
paramarray
[
i
][
GNB_GNB_ID_IDX
].
uptr
)
{
// Calculate a default gNB ID
if
(
EPC
_MODE_ENABLED
)
if
(
AMF
_MODE_ENABLED
)
gnb_id
=
i
+
(
ngap_generate_gNB_id
()
&
0xFFFFFF8
);
else
gnb_id
=
i
;
...
...
@@ -536,7 +536,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
AssertFatal
(
i
<
num_gnbs
,
"Failed to parse config file no %ith element in %s
\n
"
,
i
,
GNB_CONFIG_STRING_ACTIVE_GNBS
);
/*
if (
EPC
_MODE_ENABLED) {
if (
AMF
_MODE_ENABLED) {
if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0;
asn1_xer_print = 0;
...
...
@@ -562,7 +562,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
if
(
GNBParamList
.
paramarray
[
i
][
GNB_GNB_ID_IDX
].
uptr
==
NULL
)
{
// Calculate a default gNB ID
if
(
EPC
_MODE_ENABLED
)
{
if
(
AMF
_MODE_ENABLED
)
{
uint32_t
hash
;
hash
=
ngap_generate_gNB_id
();
gnb_id
=
i
+
(
hash
&
0xFFFFFF8
);
...
...
@@ -742,7 +742,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
config_get
(
GNBSParams
,
sizeof
(
GNBSParams
)
/
sizeof
(
paramdef_t
),
NULL
);
/*
if (
EPC
_MODE_ENABLED) {
if (
AMF
_MODE_ENABLED) {
if (strcasecmp( *(GNBSParams[GNB_ASN1_VERBOSITY_IDX].strptr), GNB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) {
asn_debug = 0;
asn1_xer_print = 0;
...
...
@@ -771,7 +771,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
for
(
k
=
0
;
k
<
GNBParamList
.
numelt
;
k
++
)
{
if
(
GNBParamList
.
paramarray
[
k
][
GNB_GNB_ID_IDX
].
uptr
==
NULL
)
{
// Calculate a default gNB ID
if
(
EPC
_MODE_ENABLED
)
{
if
(
AMF
_MODE_ENABLED
)
{
uint32_t
hash
;
hash
=
ngap_generate_gNB_id
();
...
...
@@ -925,7 +925,7 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
// SCTP SETTING
NGAP_REGISTER_GNB_REQ
(
msg_p
).
sctp_out_streams
=
SCTP_OUT_STREAMS
;
NGAP_REGISTER_GNB_REQ
(
msg_p
).
sctp_in_streams
=
SCTP_IN_STREAMS
;
if
(
EPC
_MODE_ENABLED
)
{
if
(
AMF
_MODE_ENABLED
)
{
sprintf
(
aprefix
,
"%s.[%i].%s"
,
GNB_CONFIG_STRING_GNB_LIST
,
k
,
GNB_CONFIG_STRING_SCTP_CONFIG
);
config_get
(
SCTPParams
,
sizeof
(
SCTPParams
)
/
sizeof
(
paramdef_t
),
aprefix
);
NGAP_REGISTER_GNB_REQ
(
msg_p
).
sctp_in_streams
=
(
uint16_t
)
*
(
SCTPParams
[
GNB_SCTP_INSTREAMS_IDX
].
uptr
);
...
...
@@ -1044,7 +1044,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
for
(
k
=
0
;
k
<
GNBParamList
.
numelt
;
k
++
)
{
if
(
GNBParamList
.
paramarray
[
k
][
GNB_GNB_ID_IDX
].
uptr
==
NULL
)
{
// Calculate a default eNB ID
if
(
EPC
_MODE_ENABLED
)
{
if
(
AMF
_MODE_ENABLED
)
{
uint32_t
hash
;
hash
=
ngap_generate_gNB_id
();
gnb_id
=
k
+
(
hash
&
0xFFFFFF8
);
...
...
@@ -1165,7 +1165,7 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
X2AP_REGISTER_ENB_REQ
(
msg_p
).
sctp_out_streams
=
SCTP_OUT_STREAMS
;
X2AP_REGISTER_ENB_REQ
(
msg_p
).
sctp_in_streams
=
SCTP_IN_STREAMS
;
if
(
EPC
_MODE_ENABLED
)
{
if
(
AMF
_MODE_ENABLED
)
{
sprintf
(
aprefix
,
"%s.[%i].%s"
,
GNB_CONFIG_STRING_GNB_LIST
,
k
,
GNB_CONFIG_STRING_SCTP_CONFIG
);
config_get
(
SCTPParams
,
sizeof
(
SCTPParams
)
/
sizeof
(
paramdef_t
),
aprefix
);
X2AP_REGISTER_ENB_REQ
(
msg_p
).
sctp_in_streams
=
(
uint16_t
)
*
(
SCTPParams
[
GNB_SCTP_INSTREAMS_IDX
].
uptr
);
...
...
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
84579c5d
...
...
@@ -659,7 +659,6 @@ uint8_t do_RRCSetup(const protocol_ctxt_t *const ctxt_pP,
NR_MAC_CellGroupConfig_t
*
mac_CellGroupConfig
=
NULL
;
char
masterCellGroup_buf
[
1000
];
int
size
=
0
;
long
*
logicalChannelGroup
=
NULL
;
memset
((
void
*
)
&
dl_ccch_msg
,
0
,
sizeof
(
NR_DL_CCCH_Message_t
));
...
...
@@ -937,7 +936,6 @@ uint16_t do_RRCReconfiguration(
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
));
...
...
@@ -951,6 +949,7 @@ uint16_t do_RRCReconfiguration(
uint8_t
xid
=
rrc_gNB_get_next_transaction_identifier
(
ctxt_pP
->
module_id
);
/******************** Radio Bearer Config ********************/
ie
=
calloc
(
1
,
sizeof
(
NR_RRCReconfiguration_IEs_t
));
ie
->
radioBearerConfig
=
calloc
(
1
,
sizeof
(
NR_RadioBearerConfig_t
));
/* Configure SRB2 */
...
...
openair2/RRC/NR/nr_rrc_defs.h
View file @
84579c5d
...
...
@@ -290,9 +290,9 @@ typedef struct gNB_RRC_UE_s {
ImsiMobileIdentity_t
imsi
;
#if defined(ENABLE_SECURITY)
/* K
e
NB as derived from KASME received from EPC */
uint8_t
k
e
nb
[
32
];
int8_t
k
e
nb_ncc
;
/* K
g
NB as derived from KASME received from EPC */
uint8_t
k
g
nb
[
32
];
int8_t
k
g
nb_ncc
;
uint8_t
nh
[
32
];
int8_t
nh_ncc
;
#endif
...
...
@@ -322,7 +322,7 @@ typedef struct gNB_RRC_UE_s {
uint64_t
amf_ue_ngap_id
:
40
;
nr_rrc_guami_t
ue_guami
;
security_capabilities_t
security_capabilities
;
ngap_security_capabilities_t
security_capabilities
;
/* Total number of e_rab already setup in the list */
uint8_t
setup_e_rabs
;
...
...
openair2/RRC/NR/rrc_gNB.c
View file @
84579c5d
...
...
@@ -542,18 +542,18 @@ rrc_gNB_process_RRCReconfigurationComplete(
return
;
}
/* Derive the keys from k
e
nb */
/* Derive the keys from k
g
nb */
if
(
DRB_configList
!=
NULL
)
{
derive_key_up_enc
(
ue_context_pP
->
ue_context
.
ciphering_algorithm
,
ue_context_pP
->
ue_context
.
k
e
nb
,
ue_context_pP
->
ue_context
.
k
g
nb
,
&
kUPenc
);
}
derive_key_rrc_enc
(
ue_context_pP
->
ue_context
.
ciphering_algorithm
,
ue_context_pP
->
ue_context
.
k
e
nb
,
ue_context_pP
->
ue_context
.
k
g
nb
,
&
kRRCenc
);
derive_key_rrc_int
(
ue_context_pP
->
ue_context
.
integrity_algorithm
,
ue_context_pP
->
ue_context
.
k
e
nb
,
ue_context_pP
->
ue_context
.
k
g
nb
,
&
kRRCint
);
/* Refresh SRBs/DRBs */
...
...
openair2/RRC/NR/rrc_gNB_NGAP.c
View file @
84579c5d
...
...
@@ -370,7 +370,7 @@ int
rrc_gNB_process_security
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
,
security_capabilities_t
*
security_capabilities_pP
ngap_
security_capabilities_t
*
security_capabilities_pP
)
{
boolean_t
changed
=
FALSE
;
NR_CipheringAlgorithm_t
cipheringAlgorithm
;
...
...
@@ -381,19 +381,19 @@ rrc_gNB_process_security(
LOG_D
(
NR_RRC
,
"[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %lu NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u
\n
"
,
ctxt_pP
->
module_id
,
ue_context_pP
->
ue_context
.
security_capabilities
.
encryption_algorithms
,
ue_context_pP
->
ue_context
.
security_capabilities
.
nR
encryption_algorithms
,
(
unsigned
long
)
ue_context_pP
->
ue_context
.
ciphering_algorithm
,
ue_context_pP
->
ue_context
.
security_capabilities
.
integrity_algorithms
,
ue_context_pP
->
ue_context
.
security_capabilities
.
nR
integrity_algorithms
,
ue_context_pP
->
ue_context
.
integrity_algorithm
);
/* Select relevant algorithms */
cipheringAlgorithm
=
rrc_gNB_select_ciphering
(
ue_context_pP
->
ue_context
.
security_capabilities
.
encryption_algorithms
);
cipheringAlgorithm
=
rrc_gNB_select_ciphering
(
ue_context_pP
->
ue_context
.
security_capabilities
.
nR
encryption_algorithms
);
if
(
ue_context_pP
->
ue_context
.
ciphering_algorithm
!=
cipheringAlgorithm
)
{
ue_context_pP
->
ue_context
.
ciphering_algorithm
=
cipheringAlgorithm
;
changed
=
TRUE
;
}
integrityProtAlgorithm
=
rrc_gNB_select_integrity
(
ue_context_pP
->
ue_context
.
security_capabilities
.
integrity_algorithms
);
integrityProtAlgorithm
=
rrc_gNB_select_integrity
(
ue_context_pP
->
ue_context
.
security_capabilities
.
nR
integrity_algorithms
);
if
(
ue_context_pP
->
ue_context
.
integrity_algorithm
!=
integrityProtAlgorithm
)
{
ue_context_pP
->
ue_context
.
integrity_algorithm
=
integrityProtAlgorithm
;
...
...
openair2/RRC/NR/rrc_gNB_NGAP.h
View file @
84579c5d
...
...
@@ -74,7 +74,7 @@ int
rrc_gNB_process_security
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
rrc_gNB_ue_context_t
*
const
ue_context_pP
,
security_capabilities_t
*
security_capabilities_pP
ngap_
security_capabilities_t
*
security_capabilities_pP
);
#endif
openair2/RRC/NR_UE/rrc_UE.c
View file @
84579c5d
...
...
@@ -507,3 +507,198 @@ int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(
return
0
;
}
//-----------------------------------------------------------------------------
void
nr_rrc_ue_process_securityModeCommand
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
NR_SecurityModeCommand_t
*
const
securityModeCommand
,
const
uint8_t
gNB_index
)
//-----------------------------------------------------------------------------
{
asn_enc_rval_t
enc_rval
;
NR_UL_DCCH_Message_t
ul_dcch_msg
;
uint8_t
buffer
[
200
];
int
i
,
securityMode
;
LOG_I
(
RRC
,
"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), Processing securityModeCommand (eNB %d)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
ctxt_pP
->
subframe
,
gNB_index
);
switch
(
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
->
securityConfigSMC
.
securityAlgorithmConfig
.
cipheringAlgorithm
)
{
case
NR_CipheringAlgorithm_nea0
:
LOG_I
(
RRC
,
"[UE %d] Security algorithm is set to nea0
\n
"
,
ctxt_pP
->
module_id
);
securityMode
=
NR_CipheringAlgorithm_nea0
;
break
;
case
NR_CipheringAlgorithm_nea1
:
LOG_I
(
RRC
,
"[UE %d] Security algorithm is set to nea1
\n
"
,
ctxt_pP
->
module_id
);
securityMode
=
NR_CipheringAlgorithm_nea1
;
break
;
case
NR_CipheringAlgorithm_nea2
:
LOG_I
(
RRC
,
"[UE %d] Security algorithm is set to nea2
\n
"
,
ctxt_pP
->
module_id
);
securityMode
=
NR_CipheringAlgorithm_nea2
;
break
;
default:
LOG_I
(
RRC
,
"[UE %d] Security algorithm is set to none
\n
"
,
ctxt_pP
->
module_id
);
securityMode
=
NR_CipheringAlgorithm_spare1
;
break
;
}
switch
(
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
.
securityConfigSMC
.
securityAlgorithmConfig
.
integrityProtAlgorithm
)
{
case
NR_IntegrityProtAlgorithm_nia1
:
LOG_I
(
RRC
,
"[UE %d] Integrity protection algorithm is set to nia1
\n
"
,
ctxt_pP
->
module_id
);
securityMode
|=
1
<<
5
;
break
;
case
NR_IntegrityProtAlgorithm_nia2
:
LOG_I
(
RRC
,
"[UE %d] Integrity protection algorithm is set to nia2
\n
"
,
ctxt_pP
->
module_id
);
securityMode
|=
1
<<
6
;
break
;
default:
LOG_I
(
RRC
,
"[UE %d] Integrity protection algorithm is set to none
\n
"
,
ctxt_pP
->
module_id
);
securityMode
|=
0x70
;
break
;
}
LOG_D
(
RRC
,
"[UE %d] security mode is %x
\n
"
,
ctxt_pP
->
module_id
,
securityMode
);
NR_UE_rrc_inst
->
cipheringAlgorithm
=
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
.
securityConfigSMC
.
securityAlgorithmConfig
.
cipheringAlgorithm
;
NR_UE_rrc_inst
->
integrityProtAlgorithm
=
securityModeCommand
->
criticalExtensions
.
choice
->
securityModeCommand
.
securityConfigSMC
.
securityAlgorithmConfig
.
integrityProtAlgorithm
;
memset
((
void
*
)
&
ul_dcch_msg
,
0
,
sizeof
(
LTE_UL_DCCH_Message_t
));
//memset((void *)&SecurityModeCommand,0,sizeof(SecurityModeCommand_t));
ul_dcch_msg
.
message
.
present
=
LTE_UL_DCCH_MessageType_PR_c1
;
if
(
securityMode
>=
NO_SECURITY_MODE
)
{
LOG_I
(
RRC
,
"rrc_ue_process_securityModeCommand, security mode complete case
\n
"
);
ul_dcch_msg
.
message
.
choice
.
c1
.
present
=
LTE_UL_DCCH_MessageType__c1_PR_securityModeComplete
;
}
else
{
LOG_I
(
RRC
,
"rrc_ue_process_securityModeCommand, security mode failure case
\n
"
);
ul_dcch_msg
.
message
.
choice
.
c1
.
present
=
LTE_UL_DCCH_MessageType__c1_PR_securityModeFailure
;
}
uint8_t
*
kRRCenc
=
NULL
;
uint8_t
*
kUPenc
=
NULL
;
uint8_t
*
kRRCint
=
NULL
;
pdcp_t
*
pdcp_p
=
NULL
;
hash_key_t
key
=
HASHTABLE_NOT_A_KEY_VALUE
;
hashtable_rc_t
h_rc
;
key
=
PDCP_COLL_KEY_VALUE
(
ctxt_pP
->
module_id
,
ctxt_pP
->
rnti
,
ctxt_pP
->
enb_flag
,
DCCH
,
SRB_FLAG_YES
);
h_rc
=
hashtable_get
(
pdcp_coll_p
,
key
,
(
void
**
)
&
pdcp_p
);
if
(
h_rc
==
HASH_TABLE_OK
)
{
LOG_D
(
RRC
,
"PDCP_COLL_KEY_VALUE() returns valid key = %ld
\n
"
,
key
);
LOG_D
(
RRC
,
"driving kRRCenc, kRRCint and kUPenc from KgNB="
"%02x%02x%02x%02x"
"%02x%02x%02x%02x"
"%02x%02x%02x%02x"
"%02x%02x%02x%02x"
"%02x%02x%02x%02x"
"%02x%02x%02x%02x"
"%02x%02x%02x%02x"
"%02x%02x%02x%02x
\n
"
,
NR_UE_rrc_inst
->
kgnb
[
0
],
NR_UE_rrc_inst
->
kgnb
[
1
],
NR_UE_rrc_inst
->
kgnb
[
2
],
NR_UE_rrc_inst
->
kgnb
[
3
],
NR_UE_rrc_inst
->
kgnb
[
4
],
NR_UE_rrc_inst
->
kgnb
[
5
],
NR_UE_rrc_inst
->
kgnb
[
6
],
NR_UE_rrc_inst
->
kgnb
[
7
],
NR_UE_rrc_inst
->
kgnb
[
8
],
NR_UE_rrc_inst
->
kgnb
[
9
],
NR_UE_rrc_inst
->
kgnb
[
10
],
NR_UE_rrc_inst
->
kgnb
[
11
],
NR_UE_rrc_inst
->
kgnb
[
12
],
NR_UE_rrc_inst
->
kgnb
[
13
],
NR_UE_rrc_inst
->
kgnb
[
14
],
NR_UE_rrc_inst
->
kgnb
[
15
],
NR_UE_rrc_inst
->
kgnb
[
16
],
NR_UE_rrc_inst
->
kgnb
[
17
],
NR_UE_rrc_inst
->
kgnb
[
18
],
NR_UE_rrc_inst
->
kgnb
[
19
],
NR_UE_rrc_inst
->
kgnb
[
20
],
NR_UE_rrc_inst
->
kgnb
[
21
],
NR_UE_rrc_inst
->
kgnb
[
22
],
NR_UE_rrc_inst
->
kgnb
[
23
],
NR_UE_rrc_inst
->
kgnb
[
24
],
NR_UE_rrc_inst
->
kgnb
[
25
],
NR_UE_rrc_inst
->
kgnb
[
26
],
NR_UE_rrc_inst
->
kgnb
[
27
],
NR_UE_rrc_inst
->
kgnb
[
28
],
NR_UE_rrc_inst
->
kgnb
[
29
],
NR_UE_rrc_inst
->
kgnb
[
30
],
NR_UE_rrc_inst
->
kgnb
[
31
]);
derive_key_rrc_enc
(
NR_UE_rrc_inst
->
cipheringAlgorithm
,
NR_UE_rrc_inst
->
kgnb
,
&
kRRCenc
);
derive_key_rrc_int
(
NR_UE_rrc_inst
->
integrityProtAlgorithm
,
NR_UE_rrc_inst
->
kgnb
,
&
kRRCint
);
derive_key_up_enc
(
NR_UE_rrc_inst
->
cipheringAlgorithm
,
NR_UE_rrc_inst
->
kgnb
,
&
kUPenc
);
if
(
securityMode
!=
0xff
)
{
pdcp_config_set_security
(
ctxt_pP
,
pdcp_p
,
0
,
0
,
NR_UE_rrc_inst
->
cipheringAlgorithm
|
(
NR_UE_rrc_inst
->
integrityProtAlgorithm
<<
4
),
kRRCenc
,
kRRCint
,
kUPenc
);
}
else
{
LOG_I
(
RRC
,
"skipped pdcp_config_set_security() as securityMode == 0x%02x"
,
securityMode
);
}
}
else
{
LOG_I
(
RRC
,
"Could not get PDCP instance where key=0x%ld
\n
"
,
key
);
}
if
(
securityModeCommand
->
criticalExtensions
.
present
==
NR_SecurityModeComplete__criticalExtensions_PR_securityModeComplete
)
{
ul_dcch_msg
.
message
.
choice
->
c1
->
choice
.
securityModeComplete
.
rrc_TransactionIdentifier
=
securityModeCommand
->
rrc_TransactionIdentifier
;
ul_dcch_msg
.
message
.
choice
->
c1
->
choice
.
securityModeComplete
.
criticalExtensions
.
present
=
NR_SecurityModeComplete__criticalExtensions_PR_securityModeComplete
;
ul_dcch_msg
.
message
.
choice
->
c1
->
choice
.
securityModeComplete
.
criticalExtensions
.
choice
.
securityModeComplete
->
nonCriticalExtension
=
NULL
;
LOG_I
(
RRC
,
"[UE %d] SFN/SF %d/%d: Receiving from SRB1 (DL-DCCH), encoding securityModeComplete (eNB %d), rrc_TransactionIdentifier: %ld
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
ctxt_pP
->
subframe
,
gNB_index
,
securityModeCommand
->
rrc_TransactionIdentifier
);
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_UL_DCCH_Message
,
NULL
,
(
void
*
)
&
ul_dcch_msg
,
buffer
,
100
);
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %jd)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_DCCH_Message
,
(
void
*
)
&
ul_dcch_msg
);
}
LOG_D
(
RRC
,
"securityModeComplete Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
for
(
i
=
0
;
i
<
(
enc_rval
.
encoded
+
7
)
/
8
;
i
++
)
{
LOG_T
(
RRC
,
"%02x."
,
buffer
[
i
]);
}
LOG_T
(
RRC
,
"
\n
"
);
rrc_data_req
(
ctxt_pP
,
DCCH
,
rrc_mui
++
,
SDU_CONFIRM_NO
,
(
enc_rval
.
encoded
+
7
)
/
8
,
buffer
,
PDCP_TRANSMISSION_MODE_CONTROL
);
}
else
LOG_W
(
RRC
,
"securityModeCommand->criticalExtensions.present (%d) != NR_SecurityModeCommand__criticalExtensions_PR_securityModeCommand
\n
"
,
securityModeCommand
->
criticalExtensions
.
present
);
}
//-----------------------------------------------------------------------------
void
rrc_ue_generate_RRCSetupRequest
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
)
{
uint8_t
i
=
0
,
rv
[
6
];
if
(
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
==
0
)
{
// Get RRCConnectionRequest, fill random for now
// Generate random byte stream for contention resolution
for
(
i
=
0
;
i
<
6
;
i
++
)
{
#ifdef SMBV
// if SMBV is configured the contention resolution needs to be fix for the connection procedure to succeed
rv
[
i
]
=
i
;
#else
rv
[
i
]
=
taus
()
&
0xff
;
#endif
LOG_T
(
RRC
,
"%x."
,
rv
[
i
]);
}
LOG_T
(
RRC
,
"
\n
"
);
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
=
do_RRCSetupRequest
(
ctxt_pP
->
module_id
,
(
uint8_t
*
)
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
,
rv
);
LOG_I
(
RRC
,
"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCSetupRequest (bytes %d, eNB %d)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
,
gNB_index
);
for
(
i
=
0
;
i
<
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
;
i
++
)
{
LOG_T
(
RRC
,
"%x."
,
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
[
i
]);
}
LOG_T
(
RRC
,
"
\n
"
);
/*UE_rrc_inst[ue_mod_idP].Srb0[Idx].Tx_buffer.Payload[i] = taus()&0xff;
UE_rrc_inst[ue_mod_idP].Srb0[Idx].Tx_buffer.payload_size =i; */
}
}
openair2/RRC/NR_UE/rrc_defs.h
View file @
84579c5d
...
...
@@ -70,6 +70,9 @@ typedef struct NR_UE_RRC_INST_s {
NR_RadioBearerConfig_t
*
radio_bearer_config
;
NR_MIB_t
*
mib
;
/* KeNB as computed from parameters within USIM card */
uint8_t
kgnb
[
32
];
// lists
// CellGroupConfig.rlc-BearerToAddModList
...
...
openair3/NGAP/ngap_gNB.c
View file @
84579c5d
...
...
@@ -65,6 +65,7 @@
#include "oaisim_amf_test_s1c.h"
#endif
ngap_gNB_config_t
ngap_config
;
static
int
ngap_gNB_generate_ng_setup_request
(
ngap_gNB_instance_t
*
instance_p
,
ngap_gNB_amf_data_t
*
ngap_amf_data_p
);
...
...
openair3/NGAP/ngap_gNB.h
View file @
84579c5d
...
...
@@ -39,6 +39,16 @@
#ifndef NGAP_GNB_H_
#define NGAP_GNB_H_
typedef
struct
ngap_gNB_config_s
{
// MME related params
unsigned
char
amf_enabled
;
///< AMF enabled ?
}
ngap_gNB_config_t
;
extern
ngap_gNB_config_t
ngap_config
;
#define AMF_MODE_ENABLED ngap_config.amf_enabled
void
*
ngap_gNB_process_itti_msg
(
void
*
);
void
ngap_gNB_init
(
void
);
void
*
ngap_gNB_task
(
void
*
arg
);
...
...
openair3/NGAP/ngap_gNB_handlers.c
View file @
84579c5d
This diff is collapsed.
Click to expand it.
openair3/NGAP/ngap_gNB_nas_procedures.c
View file @
84579c5d
This diff is collapsed.
Click to expand it.
openair3/NGAP/ngap_gNB_overload.c
View file @
84579c5d
...
...
@@ -49,38 +49,7 @@ int ngap_gNB_handle_overload_start(uint32_t assoc_id,
uint32_t
stream
,
NGAP_NGAP_PDU_t
*
pdu
)
{
#if 0
ngap_gNB_amf_data_t *amf_desc_p;
NGAP_OverloadStart_t *container;
NGAP_OverloadStartIEs_t *ie;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.OverloadStart;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_OverloadStartIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_OverloadResponse, true);
if (ie != NULL) {
DevCheck(ie->value.choice.OverloadResponse.present ==
NGAP_OverloadResponse_PR_overloadAction,
NGAP_OverloadResponse_PR_overloadAction, 0, 0);
}
/* Non UE-associated signalling -> stream 0 */
DevCheck(stream == 0, stream, 0, 0);
if ((amf_desc_p = ngap_gNB_get_AMF(NULL, assoc_id, 0)) == NULL) {
/* No AMF context associated */
return -1;
}
/* Mark the AMF as overloaded and set the overload state according to
* the value received.
*/
amf_desc_p->state = NGAP_GNB_OVERLOAD;
amf_desc_p->overload_state =
ie->value.choice.OverloadResponse.choice.overloadAction;
#endif
//TODO
return
0
;
}
...
...
openair3/NGAP/ngap_gNB_trace.c
View file @
84579c5d
...
...
@@ -50,38 +50,7 @@ int ngap_gNB_handle_trace_start(uint32_t assoc_id,
uint32_t
stream
,
NGAP_NGAP_PDU_t
*
pdu
)
{
#if 0
NGAP_TraceStart_t *container;
NGAP_TraceStartIEs_t *ie;
struct ngap_gNB_ue_context_s *ue_desc_p = NULL;
struct ngap_gNB_amf_data_s *amf_ref_p;
DevAssert(pdu != NULL);
container = &pdu->choice.initiatingMessage.value.choice.TraceStart;
NGAP_FIND_PROTOCOLIE_BY_ID(NGAP_TraceStartIEs_t, ie, container,
NGAP_ProtocolIE_ID_id_gNB_UE_NGAP_ID, TRUE);
amf_ref_p = ngap_gNB_get_AMF(NULL, assoc_id, 0);
DevAssert(amf_ref_p != NULL);
if (ie != NULL) {
ue_desc_p = ngap_gNB_get_ue_context(amf_ref_p->ngap_gNB_instance,
ie->value.choice.GNB_UE_NGAP_ID);
}
if (ue_desc_p == NULL) {
/* Could not find context associated with this gNB_ue_ngap_id -> generate
* trace failure indication.
*/
NGAP_E_UTRAN_Trace_ID_t trace_id;
NGAP_Cause_t cause;
memset(&trace_id, 0, sizeof(NGAP_E_UTRAN_Trace_ID_t));
memset(&cause, 0, sizeof(NGAP_Cause_t));
cause.present = NGAP_Cause_PR_radioNetwork;
cause.choice.radioNetwork = NGAP_CauseRadioNetwork_unknown_pair_ue_ngap_id;
ngap_gNB_generate_trace_failure(NULL, &trace_id, &cause);
}
#endif
//TODO
return
0
;
}
...
...
targets/COMMON/create_nr_tasks.c
View file @
84579c5d
...
...
@@ -26,7 +26,7 @@
# ifdef OPENAIR2
#include "sctp_eNB_task.h"
#include "
s1ap_e
NB.h"
#include "
ngap_g
NB.h"
#include "nas_ue_task.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
...
...
@@ -59,7 +59,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
}
if
(
EPC
_MODE_ENABLED
)
{
if
(
AMF
_MODE_ENABLED
)
{
if
(
gnb_nb
>
0
)
{
/*if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n");
...
...
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