You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
5.4 KiB
C

/**
7 years ago
*
* \section COPYRIGHT
7 years ago
*
* Copyright 2013-2021 Software Radio Systems Limited
7 years ago
*
* 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.
7 years ago
*
*/
#ifndef SRSRAN_EPC_INTERFACES_H
#define SRSRAN_EPC_INTERFACES_H
#include "srsran/asn1/gtpc_ies.h"
#include "srsran/common/common.h"
#include <netinet/sctp.h>
#include <queue>
namespace srsepc {
class nas;
enum nas_timer_type {
T_3413,
};
/******************
* MME Interfaces *
******************/
class gtpc_interface_nas // NAS -> GTP-C
7 years ago
{
public:
virtual bool send_create_session_request(uint64_t imsi) = 0;
virtual bool send_modify_bearer_request(uint64_t imsi, uint16_t erab_to_modify, srsran::gtp_fteid_t* enb_fteid) = 0;
virtual bool send_delete_session_request(uint64_t imsi) = 0;
virtual bool send_downlink_data_notification_failure_indication(uint64_t imsi,
enum srsran::gtpc_cause_value cause) = 0;
7 years ago
};
class s1ap_interface_gtpc // GTP-C -> S1AP
{
public:
virtual bool send_initial_context_setup_request(uint64_t imsi, uint16_t erab_to_setup) = 0;
};
class s1ap_interface_nas // NAS -> S1AP
{
public:
virtual uint32_t allocate_m_tmsi(uint64_t imsi) = 0;
virtual uint32_t get_next_mme_ue_s1ap_id() = 0;
virtual bool add_nas_ctx_to_imsi_map(nas* nas_ctx) = 0;
virtual bool add_nas_ctx_to_mme_ue_s1ap_id_map(nas* nas_ctx) = 0;
virtual bool add_ue_to_enb_set(int32_t enb_assoc, uint32_t mme_ue_s1ap_id) = 0;
virtual bool release_ue_ecm_ctx(uint32_t mme_ue_s1ap_id) = 0;
virtual bool delete_ue_ctx(uint64_t imsi) = 0;
virtual uint64_t find_imsi_from_m_tmsi(uint32_t m_tmsi) = 0;
virtual nas* find_nas_ctx_from_imsi(uint64_t imsi) = 0;
virtual bool send_initial_context_setup_request(uint64_t imsi, uint16_t erab_to_setup) = 0;
virtual bool send_ue_context_release_command(uint32_t mme_ue_s1ap_id) = 0;
virtual bool send_erab_release_command(uint32_t enb_ue_s1ap_id,
uint32_t mme_ue_s1ap_id,
std::vector<uint16_t> erabs_to_release,
struct sctp_sndrcvinfo enb_sri) = 0;
virtual bool send_erab_modify_request(uint32_t enb_ue_s1ap_id,
uint32_t mme_ue_s1ap_id,
std::map<uint16_t, uint16_t> erabs_to_modify,
srsran::byte_buffer_t* nas_msg,
struct sctp_sndrcvinfo enb_sri) = 0;
virtual bool send_downlink_nas_transport(uint32_t enb_ue_s1ap_id,
uint32_t mme_ue_s1ap_id,
srsran::byte_buffer_t* nas_msg,
struct sctp_sndrcvinfo enb_sri) = 0;
};
class hss_interface_nas // NAS -> HSS
{
public:
virtual bool gen_auth_info_answer(uint64_t imsi, uint8_t* k_asme, uint8_t* autn, uint8_t* rand, uint8_t* xres) = 0;
virtual bool gen_update_loc_answer(uint64_t imsi, uint8_t* qci) = 0;
virtual bool resync_sqn(uint64_t imsi, uint8_t* auts) = 0;
};
class mme_interface_nas // NAS -> MME
{
public:
virtual bool add_nas_timer(int timer_fd, enum nas_timer_type type, uint64_t imsi) = 0;
virtual bool is_nas_timer_running(enum nas_timer_type type, uint64_t imsi) = 0;
virtual bool remove_nas_timer(enum nas_timer_type type, uint64_t imsi) = 0;
};
class s1ap_interface_mme // MME -> S1AP
{
public:
virtual bool expire_nas_timer(enum nas_timer_type type, uint64_t imsi) = 0;
};
/*******************
* SPGW Interfaces *
*******************/
class gtpu_interface_gtpc // GTP-C -> GTP-U
{
public:
virtual in_addr_t get_s1u_addr() = 0;
virtual bool modify_gtpu_tunnel(in_addr_t ue_ipv4, srsran::gtpc_f_teid_ie dw_user_fteid, uint32_t up_ctrl_teid) = 0;
virtual bool delete_gtpu_tunnel(in_addr_t ue_ipv4) = 0;
virtual bool delete_gtpc_tunnel(in_addr_t ue_ipv4) = 0;
virtual void send_all_queued_packets(srsran::gtp_fteid_t dw_user_fteid,
std::queue<srsran::unique_byte_buffer_t>& pkt_queue) = 0;
};
class gtpc_interface_gtpu // GTP-U -> GTP-C
{
public:
virtual bool queue_downlink_packet(uint32_t spgw_ctr_teid, srsran::unique_byte_buffer_t msg) = 0;
virtual bool send_downlink_data_notification(uint32_t spgw_ctr_teid) = 0;
};
} // namespace srsepc
#endif // SRSRAN_EPC_INTERFACES_H