update it

This commit is contained in:
Sukchan Lee 2017-04-11 21:38:24 +09:00
parent d53b30449f
commit 20195b67cf
6 changed files with 38 additions and 6 deletions

View File

@ -749,7 +749,7 @@ ED2(c_uint8_t paging_time_window:4;,
* O TLV 3-102 */
typedef struct _nas_access_point_name_t {
c_uint8_t length;
c_uint8_t access_point_name_value[MAX_APN_LEN];
c_int8_t apn[MAX_APN_LEN];
} __attribute__ ((packed)) nas_access_point_name_t;
/* 9.9.4.4 ESM cause

View File

@ -64,7 +64,8 @@ status_t hss_context_init(void)
pdn = hss_pdn_add();
d_assert(pdn, return -1, "Profile context add failed");
strcpy(pdn->apn, "Internet");
pdn->apn[0] = 0x08;
strcpy(pdn->apn+1, "internet");
pdn->type = PDN_TYPE_IPV4;

View File

@ -28,6 +28,15 @@ void esm_handle_information_response(mme_esm_t *esm,
pkbuf_t *pkbuf = NULL;
status_t rv;
if (esm_information_response->presencemask &
NAS_ESM_INFORMATION_RESPONSE_ACCESS_POINT_NAME_PRESENT)
{
esm->pdn = mme_pdn_find_by_apn(
esm_information_response->access_point_name.apn);
d_assert(esm->pdn, return, "No PDN Context[APN:%s])",
esm_information_response->access_point_name.apn);
}
rv = mme_s11_build_create_session_req(&pkbuf, esm);
d_assert(rv == CORE_OK, return, "S11 build error");

View File

@ -345,6 +345,22 @@ pdn_t* mme_pdn_find_by_id(pdn_id_t id)
return pdn;
}
pdn_t* mme_pdn_find_by_apn(c_int8_t *apn)
{
pdn_t *pdn = NULL;
pdn = list_first(&self.pdn_list);
while (pdn)
{
if (strcmp(pdn->apn, apn) == 0)
break;
pdn = list_next(pdn);
}
return pdn;
}
pdn_t* mme_pdn_first()
{
return list_first(&self.pdn_list);

View File

@ -166,8 +166,10 @@ typedef struct _mme_esm_t {
c_uint8_t pti; /** Procedure Trasaction Identity */
mme_ue_t *ue;
mme_sgw_t *sgw;
pdn_t *pdn;
mme_ue_t *ue;
} mme_esm_t;
CORE_DECLARE(status_t) mme_context_init(void);
@ -194,6 +196,7 @@ CORE_DECLARE(pdn_t*) mme_pdn_add(pdn_id_t id);
CORE_DECLARE(status_t) mme_pdn_remove(pdn_t *pdn);
CORE_DECLARE(status_t) mme_pdn_remove_all(void);
CORE_DECLARE(pdn_t*) mme_pdn_find_by_id(pdn_id_t id);
CORE_DECLARE(pdn_t*) mme_pdn_find_by_apn(c_int8_t *apn);
CORE_DECLARE(pdn_t*) mme_pdn_first(void);
CORE_DECLARE(pdn_t*) mme_pdn_next(pdn_t *pdn);

View File

@ -11,8 +11,9 @@
status_t mme_s11_build_create_session_req(pkbuf_t **pkbuf, mme_esm_t *esm)
{
status_t rv;
mme_ue_t *ue = NULL;
pdn_t *pdn = NULL;
mme_sgw_t *sgw = NULL;
mme_ue_t *ue = NULL;
gtp_message_t gtp_message;
gtp_create_session_request_t *req = &gtp_message.create_session_request;
@ -28,10 +29,12 @@ status_t mme_s11_build_create_session_req(pkbuf_t **pkbuf, mme_esm_t *esm)
gtp_ue_timezone_t ue_timezone;
d_assert(esm, return CORE_ERROR, "Null param");
ue = esm->ue;
d_assert(ue, return CORE_ERROR, "Null param");
pdn = esm->pdn;
d_assert(pdn, return CORE_ERROR, "Null param");
sgw = esm->sgw;
d_assert(sgw, return CORE_ERROR, "Null param");
ue = esm->ue;
d_assert(ue, return CORE_ERROR, "Null param");
memset(&gtp_message, 0, sizeof(gtp_message_t));