srsLTE/srsepc/hdr/mme/mme.h

80 lines
1.8 KiB
C
Raw Normal View History

/**
2017-10-09 04:22:17 -07: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
*
* 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
#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"
#include <cstddef>
2019-03-19 06:53:58 -07:00
namespace srsepc {
2019-03-19 06:53:58 -07:00
typedef struct {
s1ap_args_t s1ap_args;
2019-03-19 06:53:58 -07:00
// diameter_args_t diameter_args;
// gtpc_args_t gtpc_args;
} mme_args_t;
typedef struct {
int fd;
uint64_t imsi;
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
{
public:
static mme* get_instance(void);
static void cleanup(void);
2019-03-19 06:53:58 -07:00
int init(mme_args_t* args);
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();
// 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
bool m_running;
fd_set m_set;
// Timer map
std::vector<mme_timer_t> timers;
// Timer Methods
void handle_timer_expire(int timer_fd);
// Logs
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