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
littleBu
OpenXG-RAN
Commits
ca37e0c1
Commit
ca37e0c1
authored
Jan 23, 2025
by
Laurent THOMAS
Committed by
Robert Schmidt
Jan 23, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up NAS code, remove unused compile options
parent
d68a8b51
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
36 additions
and
284 deletions
+36
-284
CMakeLists.txt
CMakeLists.txt
+1
-5
cmake_targets/at_commands/CMakeLists.txt
cmake_targets/at_commands/CMakeLists.txt
+0
-4
executables/lte-ue.c
executables/lte-ue.c
+3
-2
openair3/NAS/COMMON/API/NETWORK/nas_message.c
openair3/NAS/COMMON/API/NETWORK/nas_message.c
+18
-143
openair3/NAS/COMMON/API/NETWORK/nas_message.h
openair3/NAS/COMMON/API/NETWORK/nas_message.h
+0
-4
openair3/NAS/COMMON/API/NETWORK/network_api.c
openair3/NAS/COMMON/API/NETWORK/network_api.c
+0
-6
openair3/NAS/COMMON/EMM/MSG/emm_msg.c
openair3/NAS/COMMON/EMM/MSG/emm_msg.c
+5
-21
openair3/NAS/COMMON/ESM/MSG/esm_msg.c
openair3/NAS/COMMON/ESM/MSG/esm_msg.c
+5
-36
openair3/NAS/COMMON/UTIL/nas_log.h
openair3/NAS/COMMON/UTIL/nas_log.h
+1
-1
openair3/NAS/COMMON/UTIL/nas_timer.c
openair3/NAS/COMMON/UTIL/nas_timer.c
+0
-37
openair3/NAS/COMMON/UTIL/nas_timer.h
openair3/NAS/COMMON/UTIL/nas_timer.h
+0
-4
openair3/NAS/UE/nas_itti_messaging.c
openair3/NAS/UE/nas_itti_messaging.c
+1
-2
openair3/NAS/UE/nas_itti_messaging.h
openair3/NAS/UE/nas_itti_messaging.h
+1
-11
openair3/NAS/UE/nas_ue_task.c
openair3/NAS/UE/nas_ue_task.c
+1
-6
openair3/SECU/key_nas_deriver.c
openair3/SECU/key_nas_deriver.c
+0
-2
No files found.
CMakeLists.txt
View file @
ca37e0c1
...
...
@@ -260,7 +260,6 @@ endif()
# Debug related options
#########################################
add_boolean_option
(
DEBUG_ASN1 False
"Enable ASN1 debug logs"
OFF
)
# asn1c skeletons have hardcoded this flag to make customized debug logs
# OAI uses this feature to re-use OAI LOG_I(ASN1, ...)
# see common/utils/config.h
...
...
@@ -505,7 +504,7 @@ add_boolean_option(ENABLE_VCD_FIFO False "time measurements of proc cal
##########################
# PHY options
##########################
add_integer_option
(
MAX_NUM_CCs 1
"
????
"
ON
)
add_integer_option
(
MAX_NUM_CCs 1
"
Carrier component data arrays size (oai doesn't support carrier aggreagtion for now)
"
ON
)
add_boolean_option
(
SMBV False
"Rohde&Schwarz SMBV100A vector signal generator"
ON
)
add_boolean_option
(
DEBUG_PHY False
"Enable PHY layer debugging options"
ON
)
add_boolean_option
(
DEBUG_PHY_PROC False
"Enable debugging of PHY layer procedures"
ON
)
...
...
@@ -513,10 +512,7 @@ add_boolean_option(DEBUG_PHY_PROC False "Enable debugging of PHY layer
##########################
# NAS LAYER OPTIONS
##########################
add_boolean_option
(
ENABLE_NAS_UE_LOGGING True
"????"
ON
)
add_boolean_option
(
NAS_BUILT_IN_UE True
"UE NAS layer present in this executable"
ON
)
add_boolean_option
(
NAS_UE True
"NAS UE INSTANCE (<> NAS_MME)"
ON
)
##########################
# RRC LAYER OPTIONS
...
...
cmake_targets/at_commands/CMakeLists.txt
View file @
ca37e0c1
...
...
@@ -105,11 +105,7 @@ add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
##########################
# NAS LAYER OPTIONS
##########################
add_boolean_option
(
ENABLE_NAS_UE_LOGGING True
"????"
)
add_boolean_option
(
NAS_BUILT_IN_EPC False
"MME NAS layer not present in this executable"
)
add_boolean_option
(
NAS_BUILT_IN_UE False
"UE NAS layer present in this executable"
)
add_boolean_option
(
NAS_UE True
"NAS UE INSTANCE (<> NAS_MME)"
)
add_boolean_option
(
NAS_MME False
"NAS_UE and NAS_MME are incompatible options"
)
################################################################################
# SECU LIB
...
...
executables/lte-ue.c
View file @
ca37e0c1
...
...
@@ -1726,7 +1726,8 @@ void *UE_thread(void *arg) {
pthread_mutex_unlock(&sync_mutex);
*/
wait_sync
(
"UE thread"
);
#ifdef NAS_UE
#ifdef NAS_BUILT_IN_UE
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_NAS_UE
,
0
,
INITIALIZE_MESSAGE
);
itti_send_msg_to_task
(
TASK_NAS_UE
,
UE
->
Mod_id
+
NB_eNB_INST
,
message_p
);
...
...
@@ -2089,7 +2090,7 @@ void init_UE_single_thread_stub(int nb_inst) {
AssertFatal
(
PHY_vars_UE_g
[
i
][
0
]
!=
NULL
,
"PHY_vars_UE_g[inst][0] is NULL
\n
"
);
if
(
NFAPI_MODE
==
NFAPI_UE_STUB_PNF
||
NFAPI_MODE
==
NFAPI_MODE_STANDALONE_PNF
)
{
#ifdef NAS_UE
#ifdef NAS_
BUILT_IN_
UE
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_NAS_UE
,
0
,
INITIALIZE_MESSAGE
);
itti_send_msg_to_task
(
TASK_NAS_UE
,
i
+
NB_eNB_INST
,
message_p
);
...
...
openair3/NAS/COMMON/API/NETWORK/nas_message.c
View file @
ca37e0c1
This diff is collapsed.
Click to expand it.
openair3/NAS/COMMON/API/NETWORK/nas_message.h
View file @
ca37e0c1
...
...
@@ -42,11 +42,7 @@ Description Defines the layer 3 messages supported by the NAS sublayer
#include "commonDef.h"
#include "emm_msg.h"
#if defined(NAS_BUILT_IN_EPC)
#include "emmData.h"
#endif
#include "esm_msg.h"
/****************************************************************************/
/********************* G L O B A L C O N S T A N T S *******************/
/****************************************************************************/
...
...
openair3/NAS/COMMON/API/NETWORK/network_api.c
View file @
ca37e0c1
...
...
@@ -129,13 +129,7 @@ int network_api_initialize(const char* host, const char* port)
_network_api_id
.
send
=
socket_send
;
_network_api_id
.
close
=
socket_close
;
/* Initialize UDP communication channel with the network layer */
#ifdef NAS_UE
_network_api_id
.
endpoint
=
NETWORK_API_OPEN
(
SOCKET_CLIENT
,
host
,
port
);
#endif
#ifdef NAS_MME
_network_api_id
.
endpoint
=
NETWORK_API_OPEN
(
SOCKET_SERVER
,
NULL
,
port
);
#endif
if
(
_network_api_id
.
endpoint
==
NULL
)
{
LOG_TRACE
(
ERROR
,
"NET-API - Failed to open connection endpoint, %s"
,
((
errno
<
0
)
?
gai_strerror
(
errno
)
:
strerror
(
errno
)));
...
...
openair3/NAS/COMMON/EMM/MSG/emm_msg.c
View file @
ca37e0c1
...
...
@@ -86,14 +86,6 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
LOG_FUNC_IN
;
int
header_result
;
int
decode_result
;
uint8_t
*
buffer_log
=
buffer
;
uint32_t
len_log
=
len
;
int
down_link
;
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
down_link
=
0
;
# else
down_link
=
1
;
# endif
/* First decode the EMM message header */
header_result
=
_emm_msg_decode_header
(
&
msg
->
header
,
buffer
,
len
);
...
...
@@ -247,14 +239,13 @@ int emm_msg_decode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
if
(
decode_result
<
0
)
{
LOG_TRACE
(
ERROR
,
"EMM-MSG - Failed to decode L3 EMM message 0x%x "
"(%d)"
,
msg
->
header
.
message_type
,
decode_result
);
LOG_FUNC_RETURN
(
decode_result
);
LOG_FUNC_RETURN
(
decode_result
);
}
else
{
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
/* Message has been decoded and security header removed, handle it has a plain message */
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
len_log
,
down_link
);
#if defined(NAS_BUILT_IN_EPC)
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
len_log
,
0
);
#endif
}
LOG_FUNC_RETURN
(
header_result
+
decode_result
);
}
...
...
@@ -279,13 +270,6 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
LOG_FUNC_IN
;
int
header_result
;
int
encode_result
;
uint8_t
*
buffer_log
=
buffer
;
int
down_link
;
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
down_link
=
1
;
# else
down_link
=
0
;
# endif
/* First encode the EMM message header */
header_result
=
_emm_msg_encode_header
(
&
msg
->
header
,
buffer
,
len
);
...
...
@@ -443,8 +427,8 @@ int emm_msg_encode(EMM_msg *msg, uint8_t *buffer, uint32_t len) {
LOG_TRACE
(
ERROR
,
"EMM-MSG - Failed to encode L3 EMM message 0x%x "
"(%d)"
,
msg
->
header
.
message_type
,
encode_result
);
}
else
{
#if
((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE))
)
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
header_result
+
encode_result
,
down_link
);
#if
defined(NAS_BUILT_IN_EPC
)
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
header_result
+
encode_result
,
1
);
#endif
}
...
...
openair3/NAS/COMMON/ESM/MSG/esm_msg.c
View file @
ca37e0c1
...
...
@@ -43,10 +43,6 @@ Description Defines EPS Session Management messages
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
# include "nas_itti_messaging.h"
#endif
/****************************************************************************/
/**************** E X T E R N A L D E F I N I T I O N S ****************/
/****************************************************************************/
...
...
@@ -84,19 +80,6 @@ int esm_msg_decode(ESM_msg *msg, uint8_t *buffer, uint32_t len)
{
int
header_result
;
int
decode_result
;
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
uint8_t
*
buffer_log
=
buffer
;
uint32_t
len_log
=
len
;
int
down_link
;
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
down_link
=
0
;
# else
down_link
=
1
;
# endif
#endif
LOG_FUNC_IN
;
/* First decode the ESM message header */
...
...
@@ -210,14 +193,12 @@ int esm_msg_decode(ESM_msg *msg, uint8_t *buffer, uint32_t len)
if
(
decode_result
<
0
)
{
LOG_TRACE
(
ERROR
,
"ESM-MSG - Failed to decode L3 ESM message 0x%x "
"(%u)"
,
msg
->
header
.
message_type
,
decode_result
);
LOG_FUNC_RETURN
(
decode_result
);
LOG_FUNC_RETURN
(
decode_result
);
}
else
{
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
/* Message has been decoded and security header removed, handle it has a plain message */
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
len_log
,
down_link
);
#if defined(NAS_BUILT_IN_EPC)
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
len_log
,
0
);
#endif
}
LOG_FUNC_RETURN
(
header_result
+
decode_result
);
}
...
...
@@ -245,17 +226,6 @@ int esm_msg_encode(ESM_msg *msg, uint8_t *buffer, uint32_t len)
int
header_result
;
int
encode_result
;
#if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE)))
uint8_t
*
buffer_log
=
buffer
;
int
down_link
;
# if ((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)))
down_link
=
1
;
# else
down_link
=
0
;
# endif
#endif
/* First encode the ESM message header */
header_result
=
_esm_msg_encode_header
(
&
msg
->
header
,
buffer
,
len
);
...
...
@@ -371,11 +341,10 @@ int esm_msg_encode(ESM_msg *msg, uint8_t *buffer, uint32_t len)
LOG_TRACE
(
ERROR
,
"ESM-MSG - Failed to encode L3 ESM message 0x%x "
"(%d)"
,
msg
->
header
.
message_type
,
encode_result
);
}
else
{
#if
((defined(NAS_BUILT_IN_EPC) && defined(NAS_MME)) || (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) && defined(NAS_UE))
)
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
header_result
+
encode_result
,
down_link
);
#if
defined(NAS_BUILT_IN_EPC
)
nas_itti_plain_msg
((
char
*
)
buffer_log
,
(
nas_message_t
*
)
msg
,
header_result
+
encode_result
,
1
);
#endif
}
LOG_FUNC_RETURN
(
header_result
+
encode_result
);
}
...
...
openair3/NAS/COMMON/UTIL/nas_log.h
View file @
ca37e0c1
...
...
@@ -38,7 +38,7 @@ Description Usefull logging functions
#ifndef __NAS_LOG_H__
#define __NAS_LOG_H__
#if defined(NAS_BUILT_IN_UE)
&& defined(NAS_UE)
#if defined(NAS_BUILT_IN_UE)
# include "common/utils/LOG/log.h"
# undef LOG_TRACE
#endif
...
...
openair3/NAS/COMMON/UTIL/nas_timer.c
View file @
ca37e0c1
...
...
@@ -216,11 +216,7 @@ int nas_timer_start(long sec, nas_timer_callback_t cb, void *args)
/* Insert the new entry into the timer queue */
_nas_timer_db_insert_entry
(
id
,
te
);
# if defined(NAS_MME)
ret
=
timer_setup
(
sec
,
0
,
TASK_NAS_MME
,
INSTANCE_DEFAULT
,
TIMER_PERIODIC
,
args
,
&
timer_id
);
# else
ret
=
timer_setup
(
sec
,
0
,
TASK_NAS_UE
,
INSTANCE_DEFAULT
,
TIMER_PERIODIC
,
args
,
&
timer_id
);
# endif
if
(
ret
==
-
1
)
{
return
NAS_TIMER_INACTIVE_ID
;
...
...
@@ -295,39 +291,6 @@ int nas_timer_restart(int id)
return
(
NAS_TIMER_INACTIVE_ID
);
}
/****************************************************************************/
/********************* L O C A L F U N C T I O N S *********************/
/****************************************************************************/
/****************************************************************************
** **
** Name: _nas_timer_handler() **
** **
** Description: The timer handler is executed whenever the system deli- **
** vers signal SIGALARM. It starts execution of the callback **
** function of the first entry within the queue of active **
** timer entries. The entry is not removed from the queue of **
** active timer entries and shall be explicitly removed when **
** the timer expires. **
** **
** Inputs: None **
** Others: None **
** **
** Outputs: None **
** Return: None **
** Others: _nas_timer_db **
** **
***************************************************************************/
void
nas_timer_handle_signal_expiry
(
long
timer_id
,
void
*
arg_p
)
{
/* Get the timer entry for which the system timer expired */
nas_timer_entry_t
*
te
=
_nas_timer_db
.
head
->
entry
;
te
->
cb
(
te
->
args
);
}
/*
* -----------------------------------------------------------------------------
* Functions used to manage the timer database
...
...
openair3/NAS/COMMON/UTIL/nas_timer.h
View file @
ca37e0c1
...
...
@@ -74,8 +74,4 @@ int nas_timer_start(long sec, nas_timer_callback_t cb, void *args);
int
nas_timer_stop
(
int
id
);
int
nas_timer_restart
(
int
id
);
#if defined(NAS_BUILT_IN_EPC)
void
nas_timer_handle_signal_expiry
(
long
timer_id
,
void
*
arg_p
);
#endif
#endif
/* __NAS_TIMER_H__ */
openair3/NAS/UE/nas_itti_messaging.c
View file @
ca37e0c1
...
...
@@ -27,8 +27,7 @@
# define TASK_ORIGIN TASK_NAS_UE
#if (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE) )
#if defined(NAS_BUILT_IN_UE)
__attribute__
((
unused
))
static
const
uint8_t
emm_message_ids
[]
=
{
ATTACH_REQUEST
,
ATTACH_ACCEPT
,
...
...
openair3/NAS/UE/nas_itti_messaging.h
View file @
ca37e0c1
...
...
@@ -30,22 +30,13 @@
#ifndef NAS_ITTI_MESSAGING_H_
#define NAS_ITTI_MESSAGING_H_
# if (defined(ENABLE_NAS_UE_LOGGING) && defined(NAS_BUILT_IN_UE))
int
nas_itti_plain_msg
(
const
char
*
buffer
,
const
nas_message_t
*
msg
,
const
int
lengthP
,
const
int
instance
);
int
nas_itti_protected_msg
(
const
char
*
buffer
,
const
nas_message_t
*
msg
,
const
int
lengthP
,
const
int
instance
);
# endif
# if defined(NAS_BUILT_IN_UE)
int
nas_itti_protected_msg
(
const
char
*
buffer
,
const
nas_message_t
*
msg
,
const
int
lengthP
,
const
int
instance
);
int
nas_itti_kenb_refresh_req
(
const
Byte_t
kenb
[
32
],
int
user_id
);
...
...
@@ -56,5 +47,4 @@ int nas_itti_nas_establish_req(as_cause_t cause, as_call_type_t type, as_stmsi_t
int
nas_itti_ul_data_req
(
const
uint32_t
ue_idP
,
void
*
const
data_pP
,
const
uint32_t
lengthP
,
int
user_id
);
int
nas_itti_rab_establish_rsp
(
const
as_stmsi_t
s_tmsi
,
const
as_rab_id_t
rabID
,
const
nas_error_code_t
errCode
,
int
user_id
);
# endif
#endif
/* NAS_ITTI_MESSAGING_H_ */
openair3/NAS/UE/nas_ue_task.c
View file @
ca37e0c1
...
...
@@ -34,8 +34,6 @@
#include "nas_user.h"
#include "common/ran_context.h"
// FIXME make command line option for NAS_UE_AUTOSTART
# define NAS_UE_AUTOSTART 1
// FIXME review these externs
extern
uint16_t
NB_UE_INST
;
...
...
@@ -203,15 +201,12 @@ void *nas_ue_task(void *args_p)
switch
(
ITTI_MSG_ID
(
msg_p
))
{
case
INITIALIZE_MESSAGE
:
LOG_I
(
NAS
,
"[UE %d] Received %s
\n
"
,
Mod_id
,
ITTI_MSG_NAME
(
msg_p
));
#if (NAS_UE_AUTOSTART != 0)
LOG_I
(
NAS
,
"[UE %d] Received %s
\n
"
,
Mod_id
,
ITTI_MSG_NAME
(
msg_p
));
{
/* Send an activate modem command to NAS like UserProcess should do it */
char
*
user_data
=
"at+cfun=1
\r
"
;
nas_user_receive_and_process
(
user
,
user_data
);
}
#endif
break
;
case
TERMINATE_MESSAGE
:
...
...
openair3/SECU/key_nas_deriver.c
View file @
ca37e0c1
...
...
@@ -139,7 +139,6 @@ void nr_derive_key(algorithm_type_dist_t alg_type, uint8_t alg_id, const uint8_t
* NOTE: knas is dynamically allocated by the KDF function
*/
#ifndef NAS_UE
void
derive_keNB
(
const
uint8_t
kasme
[
32
],
const
uint32_t
nas_count
,
uint8_t
*
keNB
)
{
uint8_t
s
[
7
]
=
{
0
};
...
...
@@ -159,7 +158,6 @@ void derive_keNB(const uint8_t kasme[32], const uint32_t nas_count, uint8_t *keN
byte_array_t
data
=
{.
buf
=
s
,
.
len
=
7
};
kdf
(
kasme
,
data
,
32
,
keNB
);
}
#endif
void
derive_keNB_star
(
const
uint8_t
*
kenb_32
,
const
uint16_t
pci
,
...
...
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