move ue usim interfaces to separate interfaces header file

master
Francisco 4 years ago committed by Francisco Paisana
parent 8f49b92760
commit 186285ffd3

@ -39,41 +39,6 @@
namespace srsue {
typedef enum { AUTH_OK, AUTH_FAILED, AUTH_SYNCH_FAILURE } auth_result_t;
// USIM interface for NAS
class usim_interface_nas
{
public:
virtual std::string get_imsi_str() = 0;
virtual std::string get_imei_str() = 0;
virtual bool get_imsi_vec(uint8_t* imsi_, uint32_t n) = 0;
virtual bool get_imei_vec(uint8_t* imei_, uint32_t n) = 0;
virtual bool get_home_plmn_id(srslte::plmn_id_t* home_plmn_id) = 0;
virtual auth_result_t generate_authentication_response(uint8_t* rand,
uint8_t* autn_enb,
uint16_t mcc,
uint16_t mnc,
uint8_t* res,
int* res_len,
uint8_t* k_asme) = 0;
virtual void generate_nas_keys(uint8_t* k_asme,
uint8_t* k_nas_enc,
uint8_t* k_nas_int,
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
};
// USIM interface for RRC
class usim_interface_rrc
{
public:
virtual void generate_as_keys(uint8_t* k_asme, uint32_t count_ul, srslte::as_security_config_t* sec_cfg) = 0;
virtual void generate_as_keys_ho(uint32_t pci, uint32_t earfcn, int ncc, srslte::as_security_config_t* sec_cfg) = 0;
virtual void store_keys_before_ho(const srslte::as_security_config_t& as_cfg) = 0;
virtual void restore_keys_from_failed_ho(srslte::as_security_config_t* as_cfg) = 0;
};
// GW interface for NAS
class gw_interface_nas
{
@ -247,8 +212,8 @@ public:
virtual uint32_t get_ipv4_addr() = 0;
virtual bool get_ipv6_addr(uint8_t* ipv6_addr) = 0;
virtual void
plmn_search_completed(const rrc_interface_nas::found_plmn_t found_plmns[rrc_interface_nas::MAX_FOUND_PLMNS],
int nof_plmns) = 0;
plmn_search_completed(const rrc_interface_nas::found_plmn_t found_plmns[rrc_interface_nas::MAX_FOUND_PLMNS],
int nof_plmns) = 0;
virtual bool connection_request_completed(bool outcome) = 0;
};
@ -288,13 +253,6 @@ public:
virtual bool is_config_pending() = 0;
};
class usim_interface_rrc_nr
{
public:
virtual void generate_nr_context(uint16_t sk_counter, srslte::as_security_config_t* sec_cfg) = 0;
virtual void update_nr_context(srslte::as_security_config_t* sec_cfg) = 0;
};
// PDCP interface for RLC
class pdcp_interface_rlc
{
@ -626,8 +584,8 @@ public:
} prach_info_t;
virtual void
prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec = 0.0f) = 0;
virtual prach_info_t prach_get_info() = 0;
prach_send(uint32_t preamble_idx, int allowed_subframe, float target_power_dbm, float ta_base_sec = 0.0f) = 0;
virtual prach_info_t prach_get_info() = 0;
/* Indicates the transmission of a SR signal in the next opportunity */
virtual void sr_send() = 0;

@ -0,0 +1,65 @@
/**
*
* \section COPYRIGHT
*
* Copyright 2013-2020 Software Radio Systems Limited
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
*
*/
#ifndef SRSLTE_UE_USIM_INTERFACES_H
#define SRSLTE_UE_USIM_INTERFACES_H
#include "rrc_interface_types.h"
#include <string>
namespace srsue {
enum auth_result_t { AUTH_OK, AUTH_FAILED, AUTH_SYNCH_FAILURE };
// USIM interface for NAS
class usim_interface_nas
{
public:
virtual std::string get_imsi_str() = 0;
virtual std::string get_imei_str() = 0;
virtual bool get_imsi_vec(uint8_t* imsi_, uint32_t n) = 0;
virtual bool get_imei_vec(uint8_t* imei_, uint32_t n) = 0;
virtual bool get_home_plmn_id(srslte::plmn_id_t* home_plmn_id) = 0;
virtual auth_result_t generate_authentication_response(uint8_t* rand,
uint8_t* autn_enb,
uint16_t mcc,
uint16_t mnc,
uint8_t* res,
int* res_len,
uint8_t* k_asme) = 0;
virtual void generate_nas_keys(uint8_t* k_asme,
uint8_t* k_nas_enc,
uint8_t* k_nas_int,
srslte::CIPHERING_ALGORITHM_ID_ENUM cipher_algo,
srslte::INTEGRITY_ALGORITHM_ID_ENUM integ_algo) = 0;
};
// USIM interface for RRC
class usim_interface_rrc
{
public:
virtual void generate_as_keys(uint8_t* k_asme, uint32_t count_ul, srslte::as_security_config_t* sec_cfg) = 0;
virtual void generate_as_keys_ho(uint32_t pci, uint32_t earfcn, int ncc, srslte::as_security_config_t* sec_cfg) = 0;
virtual void store_keys_before_ho(const srslte::as_security_config_t& as_cfg) = 0;
virtual void restore_keys_from_failed_ho(srslte::as_security_config_t* as_cfg) = 0;
};
class usim_interface_rrc_nr
{
public:
virtual void generate_nr_context(uint16_t sk_counter, srslte::as_security_config_t* sec_cfg) = 0;
virtual void update_nr_context(srslte::as_security_config_t* sec_cfg) = 0;
};
} // namespace srsue
#endif // SRSLTE_UE_USIM_INTERFACES_H

@ -58,6 +58,7 @@ using srslte::byte_buffer_t;
namespace srsue {
class phy_controller;
class usim_interface_rrc;
class rrc : public rrc_interface_nas,
public rrc_interface_phy_lte,
@ -78,8 +79,8 @@ public:
nas_interface_rrc* nas_,
usim_interface_rrc* usim_,
gw_interface_rrc* gw_,
rrc_nr_interface_rrc* rrc_nr_,
const rrc_args_t& args_);
rrc_nr_interface_rrc* rrc_nr_,
const rrc_args_t& args_);
void stop();
@ -165,17 +166,17 @@ private:
void process_pcch(srslte::unique_byte_buffer_t pdu);
stack_interface_rrc* stack = nullptr;
srslte::task_sched_handle task_sched;
srslog::basic_logger& logger;
phy_interface_rrc_lte* phy = nullptr;
mac_interface_rrc* mac = nullptr;
rlc_interface_rrc* rlc = nullptr;
pdcp_interface_rrc* pdcp = nullptr;
nas_interface_rrc* nas = nullptr;
usim_interface_rrc* usim = nullptr;
gw_interface_rrc* gw = nullptr;
rrc_nr_interface_rrc* rrc_nr = nullptr;
stack_interface_rrc* stack = nullptr;
srslte::task_sched_handle task_sched;
srslog::basic_logger& logger;
phy_interface_rrc_lte* phy = nullptr;
mac_interface_rrc* mac = nullptr;
rlc_interface_rrc* rlc = nullptr;
pdcp_interface_rrc* pdcp = nullptr;
nas_interface_rrc* nas = nullptr;
usim_interface_rrc* usim = nullptr;
gw_interface_rrc* gw = nullptr;
rrc_nr_interface_rrc* rrc_nr = nullptr;
srslte::unique_byte_buffer_t dedicated_info_nas;
void send_ul_ccch_msg(const asn1::rrc::ul_ccch_msg_s& msg);

@ -24,6 +24,8 @@
namespace srsue {
class usim_interface_rrc_nr;
// Expert arguments to create GW without proper RRC
struct core_less_args_t {
std::string ip_addr;

@ -31,6 +31,8 @@ using srslte::byte_buffer_t;
namespace srsue {
class usim_interface_nas;
class nas : public nas_interface_rrc, public srslte::timer_callback
{
public:

@ -16,7 +16,7 @@
#include "srslte/common/common.h"
#include "srslte/common/log.h"
#include "srslte/common/security.h"
#include "srslte/interfaces/ue_interfaces.h"
#include "srslte/interfaces/ue_usim_interfaces.h"
#include "srslte/srslog/srslog.h"
#include <string>

@ -14,6 +14,7 @@
#include "srslte/asn1/rrc.h"
#include "srslte/common/bcd_helpers.h"
#include "srslte/common/security.h"
#include "srslte/interfaces/ue_usim_interfaces.h"
#include "srsue/hdr/stack/rrc/phy_controller.h"
#include "srsue/hdr/stack/rrc/rrc_meas.h"
#include "srsue/hdr/stack/rrc/rrc_procedures.h"
@ -97,18 +98,18 @@ void rrc::init(phy_interface_rrc_lte* phy_,
nas_interface_rrc* nas_,
usim_interface_rrc* usim_,
gw_interface_rrc* gw_,
rrc_nr_interface_rrc* rrc_nr_,
const rrc_args_t& args_)
{
phy = phy_;
mac = mac_;
rlc = rlc_;
pdcp = pdcp_;
nas = nas_;
usim = usim_;
gw = gw_;
rrc_nr_interface_rrc* rrc_nr_,
const rrc_args_t& args_)
{
phy = phy_;
mac = mac_;
rlc = rlc_;
pdcp = pdcp_;
nas = nas_;
usim = usim_;
gw = gw_;
rrc_nr = rrc_nr_;
args = args_;
args = args_;
auto on_every_cell_selection = [this](uint32_t earfcn, uint32_t pci, bool csel_result) {
if (not csel_result) {
@ -2057,8 +2058,7 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry)
memcpy(info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.data(), buf, cap_len);
rat_idx++;
}
else if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().ue_cap_request[i] == rat_type_e::eutra_nr && has_nr_dc()) {
} else if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().ue_cap_request[i] == rat_type_e::eutra_nr && has_nr_dc()) {
info->ue_cap_rat_container_list[rat_idx] = get_eutra_nr_capabilities();
logger.info("Including EUTRA-NR capabilities in UE Capability Info (%d B)",
info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.size());
@ -2068,8 +2068,7 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry)
logger.info("Including NR capabilities in UE Capability Info (%d B)",
info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.size());
rat_idx++;
}
else {
} else {
logger.error("RAT Type of UE Cap request not supported or not configured");
}
}

@ -14,6 +14,7 @@
#include "srslte/common/security.h"
#include "srslte/common/standard_streams.h"
#include "srslte/common/tti_point.h"
#include "srslte/interfaces/ue_usim_interfaces.h"
#include "srsue/hdr/stack/rrc/rrc_meas.h"
#include <inttypes.h> // for printing uint64_t
@ -1321,9 +1322,9 @@ proc_outcome_t rrc::connection_reest_proc::init(asn1::rrc::reest_cause_e cause)
reest_cellid = rrc_ptr->meas_cells.find_cell(reest_source_freq, reest_source_pci)->get_cell_id();
Info("Starting... cause: \"%s\", UE context: {C-RNTI=0x%x, PCI=%d, CELL ID=%d}",
reest_cause == asn1::rrc::reest_cause_opts::recfg_fail ? "Reconfiguration failure"
: cause == asn1::rrc::reest_cause_opts::ho_fail ? "Handover failure"
: "Other failure",
reest_cause == asn1::rrc::reest_cause_opts::recfg_fail
? "Reconfiguration failure"
: cause == asn1::rrc::reest_cause_opts::ho_fail ? "Handover failure" : "Other failure",
reest_rnti,
reest_source_pci,
reest_cellid);

@ -16,14 +16,11 @@
#include <fstream>
#include <iomanip>
#include <iostream>
#include <srslte/asn1/liblte_mme.h>
#include <sstream>
#include <unistd.h>
#include "srslte/asn1/liblte_mme.h"
#include "srslte/common/bcd_helpers.h"
#include "srslte/common/logmap.h"
#include "srslte/common/security.h"
#include "srslte/interfaces/ue_usim_interfaces.h"
#include "srsue/hdr/stack/upper/nas.h"
#include "srsue/hdr/stack/upper/nas_idle_procedures.h"

Loading…
Cancel
Save