update it
This commit is contained in:
parent
7f3233327b
commit
ccb913d1b6
|
@ -6,15 +6,13 @@ libmme_la_SOURCES = \
|
||||||
event.h context.h \
|
event.h context.h \
|
||||||
s1ap_build.h s1ap_conv.h s1ap_path.h \
|
s1ap_build.h s1ap_conv.h s1ap_path.h \
|
||||||
nas_conv.h \
|
nas_conv.h \
|
||||||
s6a_message.h \
|
sm.h s6a_sm.h
|
||||||
sm.h
|
|
||||||
|
|
||||||
nodist_libmme_la_SOURCES = \
|
nodist_libmme_la_SOURCES = \
|
||||||
init.c event.c context.c \
|
init.c event.c context.c \
|
||||||
s1ap_build.c s1ap_conv.c s1ap_path.c \
|
s1ap_build.c s1ap_conv.c s1ap_path.c \
|
||||||
nas_conv.c \
|
nas_conv.c \
|
||||||
s6a_init.c ue_s6a_sm.c \
|
mme_sm.c enb_s1ap_sm.c ue_emm_sm.c s6a_sm.c
|
||||||
mme_sm.c enb_s1ap_sm.c ue_emm_sm.c
|
|
||||||
|
|
||||||
libmme_la_DEPENDENCIES = \
|
libmme_la_DEPENDENCIES = \
|
||||||
$(top_srcdir)/lib/core/src/libcore.la \
|
$(top_srcdir)/lib/core/src/libcore.la \
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
|
|
||||||
#include "s6a_message.h"
|
#include "s6a_sm.h"
|
||||||
|
|
||||||
#define EVENT_WAIT_TIMEOUT 10000 /* 10 msec */
|
#define EVENT_WAIT_TIMEOUT 10000 /* 10 msec */
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ status_t mme_initialize()
|
||||||
rv = mme_ctx_init();
|
rv = mme_ctx_init();
|
||||||
if (rv != CORE_OK) return rv;
|
if (rv != CORE_OK) return rv;
|
||||||
|
|
||||||
ret = s6a_mme_init();
|
ret = s6a_sm_init();
|
||||||
if (ret != 0) return -1;
|
if (ret != 0) return -1;
|
||||||
|
|
||||||
rv = thread_create(&mme_sm_thread, NULL, mme_sm_main, NULL);
|
rv = thread_create(&mme_sm_thread, NULL, mme_sm_main, NULL);
|
||||||
|
@ -34,7 +34,7 @@ void mme_terminate(void)
|
||||||
{
|
{
|
||||||
thread_delete(mme_sm_thread);
|
thread_delete(mme_sm_thread);
|
||||||
|
|
||||||
s6a_mme_final();
|
s6a_sm_final();
|
||||||
|
|
||||||
mme_ctx_final();
|
mme_ctx_final();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#define TRACE_MODULE _s6a_mme_init
|
|
||||||
|
|
||||||
#include "core_debug.h"
|
|
||||||
|
|
||||||
#include "s6a_lib.h"
|
|
||||||
|
|
||||||
struct session_handler *s6a_mme_reg = NULL;
|
|
||||||
|
|
||||||
status_t s6a_mme_init(void)
|
|
||||||
{
|
|
||||||
status_t rv;
|
|
||||||
|
|
||||||
rv = s6a_init(MODE_MME);
|
|
||||||
if (rv != CORE_OK) return rv;
|
|
||||||
|
|
||||||
d_assert(fd_sess_handler_create(&s6a_mme_reg,
|
|
||||||
(void *)free, NULL, NULL) == 0, return -1,);
|
|
||||||
|
|
||||||
return CORE_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void s6a_mme_final(void)
|
|
||||||
{
|
|
||||||
d_assert(fd_sess_handler_destroy(&s6a_mme_reg, NULL) == 0,,);
|
|
||||||
|
|
||||||
s6a_final();
|
|
||||||
}
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
#include "core_debug.h"
|
#include "core_debug.h"
|
||||||
|
|
||||||
#include "s6a_message.h"
|
|
||||||
#include "s6a_lib.h"
|
#include "s6a_lib.h"
|
||||||
|
#include "s6a_sm.h"
|
||||||
|
|
||||||
|
static struct session_handler *s6a_mme_reg = NULL;
|
||||||
|
|
||||||
struct sess_state {
|
struct sess_state {
|
||||||
c_int32_t randval; /* a random value to store in Test-AVP */
|
c_int32_t randval; /* a random value to store in Test-AVP */
|
||||||
|
@ -31,7 +33,7 @@ int s6a_send_auth_info_req(ue_ctx_t *ue, c_uint8_t *plmn_id)
|
||||||
mi->randval = (int32_t)random();
|
mi->randval = (int32_t)random();
|
||||||
|
|
||||||
/* Create the request */
|
/* Create the request */
|
||||||
d_assert(fd_msg_new( s6a_cmd_air, MSGFL_ALLOC_ETEID, &req ) == 0,
|
d_assert(fd_msg_new(s6a_cmd_air, MSGFL_ALLOC_ETEID, &req) == 0,
|
||||||
free(mi); return -1,);
|
free(mi); return -1,);
|
||||||
|
|
||||||
/* Create a new session */
|
/* Create a new session */
|
||||||
|
@ -221,3 +223,22 @@ out:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status_t s6a_sm_init(void)
|
||||||
|
{
|
||||||
|
status_t rv;
|
||||||
|
|
||||||
|
rv = s6a_init(MODE_MME);
|
||||||
|
if (rv != CORE_OK) return rv;
|
||||||
|
|
||||||
|
d_assert(fd_sess_handler_create(&s6a_mme_reg,
|
||||||
|
(void *)free, NULL, NULL) == 0, return -1,);
|
||||||
|
|
||||||
|
return CORE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void s6a_sm_final(void)
|
||||||
|
{
|
||||||
|
d_assert(fd_sess_handler_destroy(&s6a_mme_reg, NULL) == 0,,);
|
||||||
|
|
||||||
|
s6a_final();
|
||||||
|
}
|
|
@ -1,20 +1,16 @@
|
||||||
#ifndef _S6A_AUTH_H__
|
#ifndef __S6A_SM_H__
|
||||||
#define _S6A_AUTH_H__
|
#define __S6A_SM_H__
|
||||||
|
|
||||||
#include "core_errno.h"
|
#include "core_errno.h"
|
||||||
|
|
||||||
#include "plmn_id.h"
|
|
||||||
|
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
extern struct session_handler *s6a_mme_reg;
|
CORE_DECLARE(status_t) s6a_sm_init(void);
|
||||||
|
CORE_DECLARE(void) s6a_sm_final(void);
|
||||||
CORE_DECLARE(status_t) s6a_mme_init(void);
|
|
||||||
CORE_DECLARE(void) s6a_mme_final(void);
|
|
||||||
|
|
||||||
CORE_DECLARE(int) s6a_send_auth_info_req(ue_ctx_t *ue, c_uint8_t *plmn_id);
|
CORE_DECLARE(int) s6a_send_auth_info_req(ue_ctx_t *ue, c_uint8_t *plmn_id);
|
||||||
|
|
||||||
|
@ -22,5 +18,5 @@ CORE_DECLARE(int) s6a_send_auth_info_req(ue_ctx_t *ue, c_uint8_t *plmn_id);
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
#endif
|
#endif /* __S6A_SM_H__ */
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "nas_message.h"
|
#include "nas_message.h"
|
||||||
#include "nas_conv.h"
|
#include "nas_conv.h"
|
||||||
#include "s6a_message.h"
|
#include "s6a_sm.h"
|
||||||
|
|
||||||
#include "sm.h"
|
#include "sm.h"
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
|
|
Loading…
Reference in New Issue