Added NAS 5G args

master
David Rupprecht 3 years ago committed by David Rupprecht
parent 5910d8847a
commit 59e847ba08

@ -49,7 +49,10 @@ class nas_5g : public nas_base, public nas_5g_interface_rrc_nr, public nas_5g_in
public:
explicit nas_5g(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_);
virtual ~nas_5g();
int init(usim_interface_nas* usim_, rrc_nr_interface_nas_5g* rrc_nr_, gw_interface_nas* gw_, const nas_args_t& cfg_);
int init(usim_interface_nas* usim_,
rrc_nr_interface_nas_5g* rrc_nr_,
gw_interface_nas* gw_,
const nas_5g_args_t& cfg_);
void stop();
void run_tti();
@ -80,8 +83,8 @@ private:
srsran::nas_5g::nas_5gs_msg initial_registration_request_stored;
nas_args_t cfg = {};
mm5g_state_t state;
nas_5g_args_t cfg = {};
mm5g_state_t state;
// Security
bool ia5g_caps[8] = {};
@ -125,7 +128,8 @@ private:
int send_registration_request();
int send_authentication_response(const uint8_t res[16]);
int send_security_mode_reject(const srsran::nas_5g::cause_5gmm_t::cause_5gmm_type_::options cause);
int send_authentication_failure(const srsran::nas_5g::cause_5gmm_t::cause_5gmm_type_::options cause, const uint8_t res_star[16]);
int send_authentication_failure(const srsran::nas_5g::cause_5gmm_t::cause_5gmm_type_::options cause,
const uint8_t res_star[16]);
int send_security_mode_complete(const srsran::nas_5g::security_mode_command_t& security_mode_command);
int send_registration_complete();
int send_pdu_session_establishment_request(uint32_t transaction_identity,

@ -43,5 +43,22 @@ public:
std::vector<pdu_session_cfg_t> pdu_session_cfgs;
};
class nas_5g_args_t
{
public:
nas_5g_args_t() : force_imsi_attach(false) {}
~nas_5g_args_t() = default;
bool force_imsi_attach;
// Need EPS sec capabilities in 5G
std::string eia;
std::string eea;
// 5G Security capabilities
std::string ia5g;
std::string ea5g;
std::vector<pdu_session_cfg_t> pdu_session_cfgs;
};
} // namespace srsue
#endif // SRSUE_NAS_COMMON_H

@ -69,7 +69,7 @@ void nas_5g::stop()
int nas_5g::init(usim_interface_nas* usim_,
rrc_nr_interface_nas_5g* rrc_nr_,
gw_interface_nas* gw_,
const nas_args_t& cfg_)
const nas_5g_args_t& cfg_)
{
usim = usim_;
rrc_nr = rrc_nr_;

@ -42,11 +42,18 @@ int amf_attach_request_test(srsran::nas_pcap* pcap)
args.op = "63BFA50EE6523365FF14C1F45F88737D";
usim.init(&args);
nas_args_t nas_cfg;
nas_cfg.force_imsi_attach = true;
nas_cfg.apn_name = "test123";
nas_cfg.ia5g = "0,1,2,3";
nas_cfg.ea5g = "0,1,2,3";
nas_5g_args_t nas_5g_cfg;
nas_5g_cfg.force_imsi_attach = true;
pdu_session_cfg_t pdu_session;
pdu_session.apn_name = "test123";
nas_5g_cfg.pdu_session_cfgs.push_back(pdu_session);
nas_5g_cfg.eia = "0,1,2,3";
nas_5g_cfg.eea = "0,1,2,3";
nas_5g_cfg.ia5g = "0,1,2,3";
nas_5g_cfg.ea5g = "0,1,2,3";
test_stack_dummy<srsue::nas_5g> stack(&pdcp_dummy);
srsue::nas_5g nas_5g(srslog::fetch_basic_logger("NAS-5G"), &stack.task_sched);
@ -64,7 +71,7 @@ int amf_attach_request_test(srsran::nas_pcap* pcap)
gw.init(gw_args, &stack);
stack.init(&nas_5g);
nas_5g.init(&usim, &rrc_nr_dummy, &gw, nas_cfg);
nas_5g.init(&usim, &rrc_nr_dummy, &gw, nas_5g_cfg);
rrc_nr_dummy.init(&nas_5g);
// trigger test

Loading…
Cancel
Save