Renamed s-gw to sp-gw.

master
Pedro Alvarez 7 years ago
parent 2088b3967b
commit b6d0fcfdbe

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

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

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