Fixed SPGW initialization bug.

master
Pedro Alvarez 7 years ago
parent 5bd630ad15
commit 103361deb9

@ -31,7 +31,7 @@ namespace srslte{
int 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 //FIXME
return 0; return 0;

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

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

@ -73,6 +73,9 @@ int
mme::init(mme_args_t* args, srslte::log_filter *s1ap_log) mme::init(mme_args_t* args, srslte::log_filter *s1ap_log)
{ {
/*Init logger*/
m_s1ap_log = s1ap_log;
/*Init S1AP*/ /*Init S1AP*/
m_s1ap = s1ap::get_instance(); m_s1ap = s1ap::get_instance();
if(m_s1ap->init(args->s1ap_args, s1ap_log)){ 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); exit(-1);
} }
/*Init logger*/ /*Init GTP-C*/
m_s1ap_log = s1ap_log; 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->info("MME Initialized. MCC: %d, MNC: %d\n",args->s1ap_args.mcc, args->s1ap_args.mnc);
m_s1ap_log->console("MME Initialized. \n"); m_s1ap_log->console("MME Initialized. \n");
return 0; return 0;

@ -65,12 +65,14 @@ mme_gtpc::cleanup(void)
} }
void bool
mme_gtpc::init() mme_gtpc::init()
{ {
m_s1ap = s1ap::get_instance(); 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_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(); m_spgw = spgw::get_instance();
return true;
} }
uint64_t uint64_t

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

Loading…
Cancel
Save