Renamed s-gw to sp-gw.

master
Pedro Alvarez 7 years ago
parent 2088b3967b
commit b6d0fcfdbe

@ -25,13 +25,13 @@
*/ */
/****************************************************************************** /******************************************************************************
* File: sgw.h * File: spgw.h
* Description: Top-level S-GW class. Creates and links all * Description: Top-level SP-GW class. Creates and links all
* interfaces and helpers. * interfaces and helpers.
*****************************************************************************/ *****************************************************************************/
#ifndef SGW_H #ifndef SPGW_H
#define SGW_H #define SPGW_H
#include <cstddef> #include <cstddef>
#include "srslte/common/log.h" #include "srslte/common/log.h"
@ -44,30 +44,30 @@ namespace srsepc{
typedef struct { typedef struct {
std::string gtpc_bind_addr; std::string gtpc_bind_addr;
} sgw_args_t; } spgw_args_t;
class sgw: class spgw:
public thread public thread
{ {
public: public:
static sgw* get_instance(void); static spgw* get_instance(void);
static void cleanup(void); static void cleanup(void);
int init(sgw_args_t* args, srslte::log_filter *sgw_log); int init(spgw_args_t* args, srslte::log_filter *spgw_log);
void stop(); void stop();
void run_thread(); void run_thread();
private: private:
sgw(); spgw();
virtual ~sgw(); virtual ~spgw();
static sgw *m_instance; static spgw *m_instance;
bool m_running; bool m_running;
srslte::byte_buffer_pool *m_pool; srslte::byte_buffer_pool *m_pool;
/*Logs*/ /*Logs*/
srslte::log_filter *m_sgw_log; srslte::log_filter *m_spgw_log;
}; };

@ -1,7 +1,7 @@
add_subdirectory(mme) add_subdirectory(mme)
add_subdirectory(hss) add_subdirectory(hss)
add_subdirectory(sgw) add_subdirectory(spgw)
# Link libstdc++ and libgcc # Link libstdc++ and libgcc
if(BUILD_STATIC) if(BUILD_STATIC)

@ -26,39 +26,39 @@
#include <iostream> #include <iostream>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include "sgw/sgw.h" #include "spgw/spgw.h"
namespace srsepc{ namespace srsepc{
sgw* sgw::m_instance = NULL; spgw* spgw::m_instance = NULL;
boost::mutex sgw_instance_mutex; boost::mutex spgw_instance_mutex;
sgw::sgw(): spgw::spgw():
m_running(false) m_running(false)
{ {
m_pool = srslte::byte_buffer_pool::get_instance(); m_pool = srslte::byte_buffer_pool::get_instance();
return; return;
} }
sgw::~sgw() spgw::~spgw()
{ {
return; return;
} }
sgw* spgw*
sgw::get_instance(void) spgw::get_instance(void)
{ {
boost::mutex::scoped_lock lock(sgw_instance_mutex); boost::mutex::scoped_lock lock(spgw_instance_mutex);
if(NULL == m_instance) { if(NULL == m_instance) {
m_instance = new sgw(); m_instance = new spgw();
} }
return(m_instance); return(m_instance);
} }
void void
sgw::cleanup(void) spgw::cleanup(void)
{ {
boost::mutex::scoped_lock lock(sgw_instance_mutex); boost::mutex::scoped_lock lock(spgw_instance_mutex);
if(NULL != m_instance) { if(NULL != m_instance) {
delete m_instance; delete m_instance;
m_instance = NULL; m_instance = NULL;
@ -66,17 +66,17 @@ sgw::cleanup(void)
} }
int int
sgw::init(sgw_args_t* args, srslte::log_filter *sgw_log) spgw::init(spgw_args_t* args, srslte::log_filter *spgw_log)
{ {
m_sgw_log = sgw_log; m_spgw_log = spgw_log;
m_sgw_log->info("S-GW Initialized.\n"); m_spgw_log->info("SP-GW Initialized.\n");
m_sgw_log->console("S-GW Initialized.\n"); m_spgw_log->console("SP-GW Initialized.\n");
return 0; return 0;
} }
void void
sgw::stop() spgw::stop()
{ {
if(m_running) if(m_running)
{ {
@ -88,7 +88,7 @@ sgw::stop()
} }
void void
sgw::run_thread() spgw::run_thread()
{ {
//Mark the thread as running //Mark the thread as running
m_running=true; m_running=true;
Loading…
Cancel
Save