srsue/extnas: add a possibility to enable the external NAS interface

The new configuration section '[extnas]' allows to disable the
built-in NAS implementation, and provide the interface (UNIX
domain socket) to an external entity. The interface itself will
be implemented in the follow up commits.
This commit is contained in:
Vadim Yanitskiy 2020-03-13 01:42:55 +07:00
parent 900ad92912
commit 74b2c5c711
5 changed files with 22 additions and 3 deletions

View File

@ -68,6 +68,7 @@ typedef struct {
usim_args_t usim;
rrc_args_t rrc;
std::string ue_category_str;
nas_ext_args_t nas_ext;
nas_args_t nas;
gw_args_t gw;
uint32_t sync_queue_size; // Max allowed difference between PHY and Stack clocks (in TTI)

View File

@ -37,6 +37,7 @@
#include "srslte/upper/pdcp.h"
#include "srslte/upper/rlc.h"
#include "upper/nas.h"
#include "upper/nas_ext.h"
#include "upper/usim.h"
#include "srslte/common/buffer_pool.h"

View File

@ -139,6 +139,9 @@ static int parse_args(all_args_t* args, int argc, char* argv[])
("nas.eia", bpo::value<string>(&args->stack.nas.eia)->default_value("1,2,3"), "List of integrity algorithms included in UE capabilities")
("nas.eea", bpo::value<string>(&args->stack.nas.eea)->default_value("0,1,2,3"), "List of ciphering algorithms included in UE capabilities")
("extnas.enable", bpo::value<bool>(&args->stack.nas_ext.enable)->default_value(false), "Disable the built-in NAS implementation, provide external interface")
("extnas.sock_path", bpo::value<string>(&args->stack.nas_ext.sock_path)->default_value("/tmp/ue_extnas.sock"), "UNIX socket path of the external interface")
("pcap.enable", bpo::value<bool>(&args->stack.pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark")
("pcap.filename", bpo::value<string>(&args->stack.pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename")
("pcap.nas_enable", bpo::value<bool>(&args->stack.pcap.nas_enable)->default_value(false), "Enable NAS packet captures for wireshark")

View File

@ -106,9 +106,13 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_)
extif_log->set_hex_limit(args.log.extif_hex_limit);
// Should we use the built-in NAS implementation
// TODO: or provide an external interface (RRCTL)?
std::unique_ptr<srsue::nas> nas_impl(new srsue::nas(&task_sched, args.nas));
nas = std::move(nas_impl);
if (!args.nas_ext.enable) {
std::unique_ptr<srsue::nas> nas_impl(new srsue::nas(&task_sched, args.nas));
nas = std::move(nas_impl);
} else { // ... or provide an external interface (RRCTL)?
std::unique_ptr<srsue::nas_ext> nas_impl(new srsue::nas_ext(&task_sched, args.nas_ext));
nas = std::move(nas_impl);
}
// Set up pcap
if (args.pcap.enable) {

View File

@ -163,6 +163,16 @@ imei = 353490069873319
#eia = 1,2
#eea = 0,1,2
#####################################################################
# External NAS interface configuration
#
# enable: Disable the built-in NAS implementation, provide external interface
# sock_path: UNIX socket path of the external interface
#####################################################################
[extnas]
#enable = false
#sock_path = /tmp/ue_extnas.sock
#####################################################################
# GW configuration
#