update it
This commit is contained in:
parent
bf72ba526e
commit
3059914d39
|
@ -50,17 +50,20 @@ status_t mme_context_init()
|
|||
index_init(&mme_esm_pool, MAX_NUM_OF_ESM);
|
||||
pool_init(&mme_pdn_pool, MAX_NUM_OF_UE_PDN);
|
||||
|
||||
self.mme_addr = inet_addr("127.0.0.1");
|
||||
|
||||
self.mme_ue_s1ap_id_hash = hash_make();
|
||||
|
||||
self.s1ap_addr = inet_addr("127.0.0.1");
|
||||
self.s1ap_addr = self.mme_addr;
|
||||
self.s1ap_port = S1AP_SCTP_PORT;
|
||||
|
||||
mme_sgw_t *sgw = mme_sgw_add();
|
||||
d_assert(sgw, return CORE_ERROR, "Can't add SGW context");
|
||||
|
||||
self.s11_addr = inet_addr("127.0.0.1");
|
||||
self.s11_addr = self.mme_addr;
|
||||
self.s11_port = GTPV2_C_UDP_PORT;
|
||||
|
||||
/* FIXME : It should be removed */
|
||||
sgw->gnode.addr = inet_addr("127.0.0.1");
|
||||
sgw->gnode.port = GTPV2_C_UDP_PORT+1;
|
||||
|
||||
|
@ -304,10 +307,12 @@ mme_ue_t* mme_ue_add(mme_enb_t *enb)
|
|||
ue->mme_ue_s1ap_id = NEXT_ID(self.mme_ue_s1ap_id, 1, 0xffffffff);
|
||||
hash_set(self.mme_ue_s1ap_id_hash, &ue->mme_ue_s1ap_id,
|
||||
sizeof(ue->mme_ue_s1ap_id), ue);
|
||||
ue->mme_s11_teid = ue->index;
|
||||
ue->mme_s11_addr = mme_self()->s11_addr;
|
||||
|
||||
ue->ebi = MIN_EPS_BEARER_ID - 1; /* Setup EBI Generator */
|
||||
|
||||
list_init(&ue->pdn_list);
|
||||
ue->ebi = MIN_EPS_BEARER_ID - 1;
|
||||
|
||||
list_init(&ue->esm_list);
|
||||
list_append(&enb->ue_list, ue);
|
||||
|
||||
|
@ -367,6 +372,11 @@ mme_ue_t* mme_ue_find_by_mme_ue_s1ap_id(c_uint32_t mme_ue_s1ap_id)
|
|||
&mme_ue_s1ap_id, sizeof(mme_ue_s1ap_id));
|
||||
}
|
||||
|
||||
mme_ue_t* mme_ue_find_by_teid(c_uint32_t teid)
|
||||
{
|
||||
return mme_ue_find(teid);
|
||||
}
|
||||
|
||||
hash_index_t *mme_ue_first()
|
||||
{
|
||||
d_assert(self.mme_ue_s1ap_id_hash, return NULL, "Null param");
|
||||
|
@ -446,8 +456,6 @@ mme_esm_t* mme_esm_add(mme_ue_t *ue, c_uint8_t pti)
|
|||
esm->pti = pti;
|
||||
esm->ebi = NEXT_ID(ue->ebi, MIN_EPS_BEARER_ID, MAX_EPS_BEARER_ID);
|
||||
|
||||
esm->teid = esm->index;
|
||||
|
||||
esm->ue = ue;
|
||||
list_append(&ue->esm_list, esm);
|
||||
|
||||
|
@ -496,11 +504,6 @@ mme_esm_t* mme_esm_find(index_t index)
|
|||
return index_find(&mme_esm_pool, index);
|
||||
}
|
||||
|
||||
mme_esm_t* mme_esm_find_by_teid(c_uint32_t teid)
|
||||
{
|
||||
return mme_esm_find(teid);
|
||||
}
|
||||
|
||||
mme_esm_t* mme_esm_find_by_pti(mme_ue_t *ue, c_uint8_t pti)
|
||||
{
|
||||
mme_esm_t *esm = NULL;
|
||||
|
|
|
@ -33,6 +33,8 @@ typedef struct _served_gummei {
|
|||
} srvd_gummei_t;
|
||||
|
||||
typedef struct _mme_context_t {
|
||||
c_uint32_t mme_addr; /* MME local address */
|
||||
|
||||
c_uint32_t s1ap_addr; /* MME S1AP local address */
|
||||
c_uint16_t s1ap_port; /* MME S1AP local port */
|
||||
net_sock_t *s1ap_sock; /* MME S1AP local listen socket */
|
||||
|
@ -139,6 +141,13 @@ typedef struct _mme_ue_t {
|
|||
list_t pdn_list;
|
||||
c_uint32_t subscribed_rau_tau_timer; /* seconds */
|
||||
|
||||
/* IMPORTANT!
|
||||
* MME-S11-TEID is same with an index */
|
||||
c_uint32_t mme_s11_teid;
|
||||
c_uint32_t mme_s11_addr;
|
||||
c_uint32_t sgw_s11_teid;
|
||||
c_uint32_t sgw_s11_addr;
|
||||
|
||||
/* ESM Info */
|
||||
c_uint8_t ebi; /* EPS Bearer ID generator */
|
||||
list_t esm_list;
|
||||
|
@ -154,14 +163,10 @@ typedef struct _mme_esm_t {
|
|||
c_uint8_t pti; /** Procedure Trasaction Identity */
|
||||
c_uint8_t ebi; /** EPS Bearer ID */
|
||||
|
||||
/* IMPORTANT!
|
||||
* MME-S11-F-TEID is same with an index */
|
||||
c_uint32_t teid;
|
||||
c_uint32_t sgw_s11_addr; /* SGW-S11-F-TEID IPv4 Address */
|
||||
c_uint32_t sgw_s11_teid; /* SGW-S11-F-TEID */
|
||||
|
||||
c_uint32_t sgw_s1u_addr; /* SGW-S1U-F-TEID IPv4 Address */
|
||||
c_uint32_t sgw_s1u_teid; /* SGW-S1U-F-TEID */
|
||||
c_uint32_t enb_s1u_teid;
|
||||
c_uint32_t enb_s1u_addr;
|
||||
c_uint32_t sgw_s1u_teid;
|
||||
c_uint32_t sgw_s1u_addr;
|
||||
|
||||
/* Protocol Configuration Options */
|
||||
c_uint8_t ue_pco[MAX_PCO_LEN];
|
||||
|
@ -201,6 +206,7 @@ CORE_DECLARE(status_t) mme_ue_remove_all();
|
|||
CORE_DECLARE(mme_ue_t*) mme_ue_find(index_t index);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_mme_ue_s1ap_id(
|
||||
c_uint32_t mme_ue_s1ap_id);
|
||||
CORE_DECLARE(mme_ue_t*) mme_ue_find_by_teid(c_uint32_t teid);
|
||||
CORE_DECLARE(hash_index_t *) mme_ue_first();
|
||||
CORE_DECLARE(hash_index_t *) mme_ue_next(hash_index_t *hi);
|
||||
CORE_DECLARE(mme_ue_t *) mme_ue_this(hash_index_t *hi);
|
||||
|
@ -216,7 +222,6 @@ CORE_DECLARE(status_t) mme_esm_remove(mme_esm_t *esm);
|
|||
CORE_DECLARE(status_t) mme_esm_remove_all(mme_ue_t *ue);
|
||||
CORE_DECLARE(mme_esm_t*) mme_esm_find(index_t index);
|
||||
CORE_DECLARE(mme_esm_t*) mme_esm_find_by_pti(mme_ue_t *ue, c_uint8_t pti);
|
||||
CORE_DECLARE(mme_esm_t*) mme_esm_find_by_teid(c_uint32_t teid);
|
||||
CORE_DECLARE(mme_esm_t*) mme_esm_first(mme_ue_t *ue);
|
||||
CORE_DECLARE(mme_esm_t*) mme_esm_next(mme_esm_t *esm);
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@ status_t mme_s11_build_create_session_request(pkbuf_t **pkbuf, mme_esm_t *esm)
|
|||
memset(&s11, 0, sizeof(gtp_f_teid_t));
|
||||
s11.ipv4 = 1;
|
||||
s11.interface_type = GTP_F_TEID_S11_MME_GTP_C;
|
||||
s11.teid = htonl(esm->teid);
|
||||
s11.ipv4_addr = mme_self()->s11_addr;
|
||||
s11.teid = htonl(ue->mme_s11_teid);
|
||||
s11.ipv4_addr = ue->mme_s11_addr;
|
||||
req->sender_f_teid_for_control_plane.presence = 1;
|
||||
req->sender_f_teid_for_control_plane.data = &s11;
|
||||
req->sender_f_teid_for_control_plane.len = GTP_F_TEID_IPV4_LEN;
|
||||
|
|
|
@ -229,7 +229,7 @@ void mme_state_operational(fsm_t *s, event_t *e)
|
|||
c_uint8_t type;
|
||||
c_uint32_t teid;
|
||||
gtp_message_t gtp_message;
|
||||
mme_esm_t *esm = NULL;
|
||||
mme_ue_t *ue = NULL;
|
||||
|
||||
d_assert(pkbuf, break, "Null param");
|
||||
d_assert(sock, pkbuf_free(pkbuf); break, "Null param");
|
||||
|
@ -241,13 +241,13 @@ void mme_state_operational(fsm_t *s, event_t *e)
|
|||
if (rv != CORE_OK)
|
||||
break;
|
||||
|
||||
esm = mme_esm_find_by_teid(teid);
|
||||
d_assert(esm, pkbuf_free(pkbuf); break,
|
||||
ue = mme_ue_find_by_teid(teid);
|
||||
d_assert(ue, pkbuf_free(pkbuf); break,
|
||||
"No Session Context(TEID:%d)", teid);
|
||||
switch(type)
|
||||
{
|
||||
case GTP_CREATE_SESSION_RESPONSE_TYPE:
|
||||
d_info("receive reponse : %d, %d", teid, esm->pti);
|
||||
d_info("receive reponse : %d", teid);
|
||||
break;
|
||||
default:
|
||||
d_warn("Not implmeneted(type:%d)", type);
|
||||
|
|
|
@ -61,7 +61,7 @@ typedef struct _pgw_bearer_t {
|
|||
c_uint8_t id;
|
||||
|
||||
/* IMPORTANT!
|
||||
* PGW-S5U-F-TEID is same with an index */
|
||||
* PGW-S5U-TEID is same with an index */
|
||||
c_uint32_t pgw_s5u_teid;
|
||||
c_uint32_t pgw_s5u_addr;
|
||||
|
||||
|
|
|
@ -73,14 +73,14 @@ typedef struct _sgw_bearer_t {
|
|||
c_uint8_t id;
|
||||
|
||||
/* IMPORTANT!
|
||||
* SGW-S1U-F-TEID is same with an index */
|
||||
* SGW-S1U-TEID is same with an index */
|
||||
c_uint32_t sgw_s1u_teid;
|
||||
c_uint32_t sgw_s1u_addr;
|
||||
c_uint32_t enb_s1u_teid;
|
||||
c_uint32_t enb_s1u_addr;
|
||||
|
||||
/* IMPORTANT!
|
||||
* SGW-S5U-F-TEID is same with an index */
|
||||
* SGW-S5U-TEID is same with an index */
|
||||
c_uint32_t sgw_s5u_teid;
|
||||
c_uint32_t sgw_s5u_addr;
|
||||
c_uint32_t pgw_s5u_teid;
|
||||
|
|
Loading…
Reference in New Issue