Fixed SPGW initialization bug.

This commit is contained in:
Pedro Alvarez 2017-11-28 17:52:57 +00:00
parent 5bd630ad15
commit 103361deb9
6 changed files with 19 additions and 6 deletions

View File

@ -31,7 +31,7 @@ namespace srslte{
int
gtpc_pack_create_session_request(gtpc_create_session_request_t, srslte::byte_buffer_t)
gtpc_pack_create_session_request(struct gtpc_create_session_request *cs_req, srslte::byte_buffer_t)
{
//FIXME
return 0;

View File

@ -77,6 +77,7 @@ private:
virtual ~mme();
static mme *m_instance;
s1ap *m_s1ap;
mme_gtpc *m_mme_gtpc;
bool m_running;
srslte::byte_buffer_pool *m_pool;

View File

@ -43,7 +43,7 @@ public:
static mme_gtpc* get_instance(void);
static void cleanup(void);
void init();
bool init();
uint64_t get_new_ctrl_teid();
void send_create_session_request(uint64_t imsi, uint32_t mme_s1ap_id);

View File

@ -73,6 +73,9 @@ int
mme::init(mme_args_t* args, srslte::log_filter *s1ap_log)
{
/*Init logger*/
m_s1ap_log = s1ap_log;
/*Init S1AP*/
m_s1ap = s1ap::get_instance();
if(m_s1ap->init(args->s1ap_args, s1ap_log)){
@ -80,8 +83,15 @@ mme::init(mme_args_t* args, srslte::log_filter *s1ap_log)
exit(-1);
}
/*Init logger*/
m_s1ap_log = s1ap_log;
/*Init GTP-C*/
m_mme_gtpc = mme_gtpc::get_instance();
if(!m_mme_gtpc->init())
{
m_s1ap_log->console("Error initializing GTP-C\n");
exit(-1);
}
/*Log successful initialization*/
m_s1ap_log->info("MME Initialized. MCC: %d, MNC: %d\n",args->s1ap_args.mcc, args->s1ap_args.mnc);
m_s1ap_log->console("MME Initialized. \n");
return 0;

View File

@ -65,12 +65,14 @@ mme_gtpc::cleanup(void)
}
void
bool
mme_gtpc::init()
{
m_s1ap = s1ap::get_instance();
m_mme_gtpc_ip = inet_addr("127.0.0.1");//FIXME At the moment, the GTP-C messages are not sent over the wire. So this parameter is not used.
m_spgw = spgw::get_instance();
return true;
}
uint64_t

View File

@ -51,7 +51,6 @@ spgw::spgw():
m_next_ctrl_teid(1),
m_next_user_teid(1)
{
m_pool = srslte::byte_buffer_pool::get_instance();
return;
}
@ -84,6 +83,7 @@ int
spgw::init(spgw_args_t* args, srslte::log_filter *spgw_log)
{
srslte::error_t err;
m_pool = srslte::byte_buffer_pool::get_instance();
//Init log
m_spgw_log = spgw_log;