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
{
@ -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
{

@ -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,

@ -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"
@ -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