NAS modify bearer request/accept is done

This commit is contained in:
Sukchan Lee 2018-01-17 15:41:45 +09:00
parent c12e76e32d
commit fffd654391
20 changed files with 544 additions and 3 deletions

View file

@ -1104,6 +1104,48 @@ status_t tests1ap_build_e_rab_setup_response(
return CORE_OK;
}
status_t tests1ap_build_e_rab_modify_response(pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
"2006"
"001b000003000040 0480000001000840 020001001f400600 002500010e",
"",
"",
"",
"",
"",
"",
"",
"",
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
31,
0,
0,
0,
0,
0,
0,
0,
0,
};
char hexbuf[MAX_SDU_LEN];
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
if (!(*pkbuf)) return CORE_ERROR;
(*pkbuf)->len = len[i];
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
(*pkbuf)->len);
return CORE_OK;
}
status_t tests1ap_build_e_rab_release_response(pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
@ -1247,6 +1289,57 @@ status_t tests1ap_build_activate_dedicated_bearer_accept(
return CORE_OK;
}
status_t tests1ap_build_modify_bearer_accept(
pkbuf_t **pkbuf, int i)
{
char *payload[TESTS1AP_MAX_MESSAGE] = {
"000d"
"4035000005000000 0480000001000800 020001001a000a09 27a5c0d564067200"
"ca006440080064f0 430020a000004340 060064f043020a",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
};
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
57,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
};
char hexbuf[MAX_SDU_LEN];
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
if (!(*pkbuf)) return CORE_ERROR;
(*pkbuf)->len = len[i];
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
(*pkbuf)->len);
return CORE_OK;
}
status_t tests1ap_build_deactivate_bearer_accept(
pkbuf_t **pkbuf, int i)
{

View file

@ -53,12 +53,16 @@ CORE_DECLARE(status_t) tests1ap_build_e_rab_setup_response(
pkbuf_t **pkbuf,
c_uint32_t mme_ue_s1ap_id, c_uint32_t enb_ue_s1ap_id,
c_uint8_t ebi, c_uint32_t teid);
CORE_DECLARE(status_t) tests1ap_build_e_rab_modify_response(
pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_e_rab_release_response(
pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_activate_default_bearer_accept(
pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_activate_dedicated_bearer_accept(
pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_modify_bearer_accept(
pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_deactivate_bearer_accept(
pkbuf_t **pkbuf, int i);
CORE_DECLARE(status_t) tests1ap_build_path_switch_request(

View file

@ -237,7 +237,7 @@ static void volte_test1(abts_case *tc, void *data)
core_sleep(time_from_msec(300));
/* Send AA-Request */
pcscf_rx_send_aar(&rx_sid, "45.45.0.3", 1, 1);
pcscf_rx_send_aar(&rx_sid, "45.45.0.3", 0, 1);
/* Receive E-RAB Setup Request +
* Activate dedicated EPS bearer context request */
@ -265,6 +265,27 @@ static void volte_test1(abts_case *tc, void *data)
/* Send AA-Request without Flow */
pcscf_rx_send_aar(&rx_sid, "45.45.0.3", 1, 0);
/* Receive E-RAB Modify Request +
* Modify EPS bearer context request */
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
rv = tests1ap_enb_read(sock, recvbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
pkbuf_free(recvbuf);
/* Send E-RAB Modify Response */
rv = tests1ap_build_e_rab_modify_response(&sendbuf, msgindex);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(300));
/* Send Modify EPS bearer context accept */
rv = tests1ap_build_modify_bearer_accept(&sendbuf, msgindex);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
rv = tests1ap_enb_send(sock, sendbuf);
ABTS_INT_EQUAL(tc, CORE_OK, rv);
core_sleep(time_from_msec(1000));
#if 0