2020-11-26 01:25:22 -08:00
|
|
|
/**
|
2017-10-09 04:22:17 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* \section COPYRIGHT
|
2017-10-09 04:22:17 -07:00
|
|
|
*
|
2021-03-19 03:45:56 -07:00
|
|
|
* Copyright 2013-2021 Software Radio Systems Limited
|
2017-10-09 04:22:17 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* 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.
|
2017-10-09 04:22:17 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2017-10-09 07:42:13 -07:00
|
|
|
/******************************************************************************
|
|
|
|
* File: mme.h
|
|
|
|
* Description: Top-level MME class. Creates and links all
|
|
|
|
* interfaces and helpers.
|
|
|
|
*****************************************************************************/
|
2017-10-09 04:22:17 -07:00
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSEPC_MME_H
|
|
|
|
#define SRSEPC_MME_H
|
2017-10-09 04:22:17 -07:00
|
|
|
|
2019-10-17 08:17:25 -07:00
|
|
|
#include "s1ap.h"
|
2021-03-19 03:45:56 -07:00
|
|
|
#include "srsran/common/buffer_pool.h"
|
|
|
|
#include "srsran/common/standard_streams.h"
|
|
|
|
#include "srsran/common/threads.h"
|
2019-10-17 08:17:25 -07:00
|
|
|
#include <cstddef>
|
2017-10-10 09:32:34 -07:00
|
|
|
|
2019-03-19 06:53:58 -07:00
|
|
|
namespace srsepc {
|
2017-10-09 08:49:43 -07:00
|
|
|
|
2019-03-19 06:53:58 -07:00
|
|
|
typedef struct {
|
2017-10-10 09:32:34 -07:00
|
|
|
s1ap_args_t s1ap_args;
|
2019-03-19 06:53:58 -07:00
|
|
|
// diameter_args_t diameter_args;
|
|
|
|
// gtpc_args_t gtpc_args;
|
2017-10-26 06:20:29 -07:00
|
|
|
} mme_args_t;
|
2017-10-10 09:32:34 -07:00
|
|
|
|
2019-04-04 05:02:00 -07:00
|
|
|
typedef struct {
|
2019-10-17 08:17:25 -07:00
|
|
|
int fd;
|
|
|
|
uint64_t imsi;
|
2019-04-04 05:02:00 -07:00
|
|
|
enum nas_timer_type type;
|
|
|
|
} mme_timer_t;
|
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
class mme : public srsran::thread, public mme_interface_nas
|
2017-10-09 04:22:17 -07:00
|
|
|
{
|
2017-10-09 08:49:43 -07:00
|
|
|
public:
|
2017-10-09 10:36:40 -07:00
|
|
|
static mme* get_instance(void);
|
|
|
|
static void cleanup(void);
|
2019-03-19 06:53:58 -07:00
|
|
|
|
2021-01-29 02:29:20 -08:00
|
|
|
int init(mme_args_t* args);
|
2017-10-11 04:22:02 -07:00
|
|
|
void stop();
|
2019-03-19 06:53:58 -07:00
|
|
|
int get_s1_mme();
|
2017-10-18 07:27:21 -07:00
|
|
|
void run_thread();
|
2017-10-09 08:49:43 -07:00
|
|
|
|
2019-04-04 05:02:00 -07:00
|
|
|
// Timer Methods
|
|
|
|
virtual bool add_nas_timer(int timer_fd, enum nas_timer_type type, uint64_t imsi);
|
|
|
|
virtual bool is_nas_timer_running(enum nas_timer_type type, uint64_t imsi);
|
|
|
|
virtual bool remove_nas_timer(enum nas_timer_type type, uint64_t imsi);
|
|
|
|
|
2017-10-09 07:42:13 -07:00
|
|
|
private:
|
|
|
|
mme();
|
|
|
|
virtual ~mme();
|
2019-03-19 06:53:58 -07:00
|
|
|
static mme* m_instance;
|
|
|
|
s1ap* m_s1ap;
|
|
|
|
mme_gtpc* m_mme_gtpc;
|
2017-10-11 08:18:47 -07:00
|
|
|
|
2021-02-06 17:08:15 -08:00
|
|
|
bool m_running;
|
|
|
|
fd_set m_set;
|
2017-10-12 13:53:48 -07:00
|
|
|
|
2019-04-04 05:02:00 -07:00
|
|
|
// Timer map
|
2019-09-04 06:28:09 -07:00
|
|
|
std::vector<mme_timer_t> timers;
|
2019-04-04 05:02:00 -07:00
|
|
|
|
|
|
|
// Timer Methods
|
|
|
|
void handle_timer_expire(int timer_fd);
|
|
|
|
|
|
|
|
// Logs
|
2021-01-29 02:29:20 -08:00
|
|
|
srslog::basic_logger& m_s1ap_logger = srslog::fetch_basic_logger("S1AP");
|
2017-10-09 04:22:17 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace srsepc
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSEPC_MME_H
|