add attach test scenario from jinyoung's today work.
This commit is contained in:
parent
3af0174682
commit
a3ead1361c
|
@ -88,6 +88,9 @@ status_t hss_context_init(void)
|
|||
#define UE3_IMSI "001010123456819"
|
||||
#define UE3_RAND "20080c3818183b52 2614162c07601d0d"
|
||||
|
||||
#define UE4_IMSI "001010123456826"
|
||||
#define UE4_RAND "2ae4fc021dd4d1c2 e0a277c2317c2e67"
|
||||
|
||||
ue = hss_ue_add(profile_id, UE1_IMSI);
|
||||
d_assert(ue, return -1, "UE context add failed");
|
||||
ue->pdn[0] = pdn;
|
||||
|
@ -102,10 +105,16 @@ status_t hss_context_init(void)
|
|||
d_assert(ue, return -1, "UE context add failed");
|
||||
ue->pdn[0] = pdn;
|
||||
ue->num_of_pdn = 1;
|
||||
|
||||
memcpy(ue->rand, CORE_HEX(UE3_RAND, strlen(UE3_RAND), buf),
|
||||
RAND_LEN);
|
||||
|
||||
ue = hss_ue_add(profile_id, UE4_IMSI);
|
||||
d_assert(ue, return -1, "UE context add failed");
|
||||
ue->pdn[0] = pdn;
|
||||
ue->num_of_pdn = 1;
|
||||
memcpy(ue->rand, CORE_HEX(UE4_RAND, strlen(UE4_RAND), buf),
|
||||
RAND_LEN);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -309,7 +309,14 @@ void emm_handle_attach_complete(
|
|||
rv = s1ap_build_downlink_nas_transport(&s1apbuf, ue, emmbuf);
|
||||
d_assert(rv == CORE_OK && s1apbuf,
|
||||
pkbuf_free(emmbuf); return, "s1ap build error");
|
||||
d_print_hex(s1apbuf->payload, s1apbuf->len);
|
||||
|
||||
d_assert(s1ap_send_to_enb(enb, s1apbuf) == CORE_OK,, "s1ap send error");
|
||||
}
|
||||
|
||||
void emm_handle_emm_status(mme_ue_t *ue, nas_emm_status_t *emm_status)
|
||||
{
|
||||
d_assert(ue, return, "Null param");
|
||||
|
||||
d_warn("[NAS] EMM status(%d) : UE[%s] --> EMM",
|
||||
emm_status->emm_cause, ue->imsi_bcd);
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ CORE_DECLARE(void) emm_handle_authentication_response(
|
|||
CORE_DECLARE(void) emm_handle_create_session_response(mme_bearer_t *bearer);
|
||||
CORE_DECLARE(void) emm_handle_attach_complete(
|
||||
mme_ue_t *ue, nas_attach_complete_t *attach_complete);
|
||||
void emm_handle_emm_status(mme_ue_t *ue, nas_emm_status_t *emm_status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -148,6 +148,11 @@ void emm_state_operational(fsm_t *s, event_t *e)
|
|||
ue, &message->emm.attach_complete);
|
||||
break;
|
||||
}
|
||||
case NAS_EMM_STATUS:
|
||||
{
|
||||
emm_handle_emm_status(ue, &message->emm.emm_status);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
d_warn("Not implemented(type:%d)",
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
#include "testutil.h"
|
||||
#include "tests1ap.h"
|
||||
|
||||
/**************************************************************
|
||||
* eNB : MACRO
|
||||
* UE : IMSI
|
||||
* Protocol Configuration Options in ESM information response */
|
||||
static void nas_sm_test1(abts_case *tc, void *data)
|
||||
{
|
||||
status_t rv;
|
||||
|
@ -17,6 +21,7 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
s1ap_message_t message;
|
||||
int rc;
|
||||
int i;
|
||||
int msgindex = 0;
|
||||
|
||||
c_uint8_t tmp[MAX_SDU_LEN];
|
||||
char *_authentication_request =
|
||||
|
@ -38,11 +43,12 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
"00004900203311c6 03c6a6d67f695e5a c02bb75b381b693c 3893a6d932fd9182"
|
||||
"3544e3e79b";
|
||||
|
||||
d_log_set_level(D_MSG_TO_STDOUT, D_LOG_LEVEL_ERROR);
|
||||
|
||||
/* eNB connects to MME */
|
||||
sock = tests1ap_enb_connect();
|
||||
ABTS_PTR_NOTNULL(tc, sock);
|
||||
|
||||
d_log_set_level(D_MSG_TO_STDOUT, D_LOG_LEVEL_FULL);
|
||||
/* Send S1-Setup Reqeust */
|
||||
rv = tests1ap_build_setup_req(&sendbuf, 0x54f64);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -60,7 +66,7 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
|
||||
/* Send Initial-UE Message */
|
||||
mme_self()->mme_ue_s1ap_id = 16777372;
|
||||
rv = tests1ap_build_initial_ue_msg(&sendbuf);
|
||||
rv = tests1ap_build_initial_ue_msg(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -76,7 +82,7 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send Authentication Response */
|
||||
rv = tests1ap_build_authentication_response(&sendbuf);
|
||||
rv = tests1ap_build_authentication_response(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -92,7 +98,7 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send Security mode Complete */
|
||||
rv = tests1ap_build_security_mode_complete(&sendbuf);
|
||||
rv = tests1ap_build_security_mode_complete(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -107,7 +113,7 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send ESM Information Response */
|
||||
rv = tests1ap_build_esm_information_response(&sendbuf);
|
||||
rv = tests1ap_build_esm_information_response(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -127,7 +133,7 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send UE Capability Info Indication */
|
||||
rv = tests1ap_build_ue_capability_info_indication(&sendbuf);
|
||||
rv = tests1ap_build_ue_capability_info_indication(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -135,13 +141,13 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
core_sleep(time_from_msec(300));
|
||||
|
||||
/* Send Initial Context Setup Response */
|
||||
rv = tests1ap_build_initial_context_setup_response(&sendbuf);
|
||||
rv = tests1ap_build_initial_context_setup_response(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Send Attach Complete + Activate default EPS bearer cotext accept */
|
||||
rv = tests1ap_build_attach_complete(&sendbuf);
|
||||
rv = tests1ap_build_attach_complete(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -158,7 +164,125 @@ static void nas_sm_test1(abts_case *tc, void *data)
|
|||
#endif
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* eNB disonncect from MME */
|
||||
rv = tests1ap_enb_close(sock);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
core_sleep(time_from_msec(300));
|
||||
d_log_set_level(D_MSG_TO_STDOUT, D_LOG_LEVEL_FULL);
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
* eNB : HOME
|
||||
* UE : IMSI
|
||||
* Protocol Configuration Options in PDN Connectivity Request */
|
||||
static void nas_sm_test2(abts_case *tc, void *data)
|
||||
{
|
||||
status_t rv;
|
||||
net_sock_t *sock;
|
||||
pkbuf_t *sendbuf;
|
||||
pkbuf_t *recvbuf;
|
||||
s1ap_message_t message;
|
||||
int rc;
|
||||
int i;
|
||||
int msgindex = 1;
|
||||
|
||||
d_log_set_level(D_MSG_TO_STDOUT, D_LOG_LEVEL_ERROR);
|
||||
|
||||
c_uint8_t tmp[MAX_SDU_LEN];
|
||||
/* eNB connects to MME */
|
||||
sock = tests1ap_enb_connect();
|
||||
ABTS_PTR_NOTNULL(tc, sock);
|
||||
|
||||
/* Send S1-Setup Reqeust */
|
||||
rv = tests1ap_build_setup_req(&sendbuf, 0x002343d);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive S1-Setup Response */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
rv = s1ap_decode_pdu(&message, recvbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
s1ap_free_pdu(&message);
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send Initial-UE Message */
|
||||
rv = tests1ap_build_initial_ue_msg(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive Authentication Request */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
recvbuf->len = 60;
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send Authentication Response */
|
||||
rv = tests1ap_build_authentication_response(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive Security mode Command */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock, recvbuf);
|
||||
recvbuf->len = 40;
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send Security mode Complete */
|
||||
rv = tests1ap_build_security_mode_complete(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive ESM Information Request */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock, recvbuf);
|
||||
recvbuf->len = 33;
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send ESM Information Response */
|
||||
rv = tests1ap_build_esm_information_response(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive Initial Context Setup Request +
|
||||
* Attach Accept +
|
||||
* Activate Default Bearer Context Request */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock, recvbuf);
|
||||
recvbuf->len = 208;
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* Send UE Capability Info Indication */
|
||||
rv = tests1ap_build_ue_capability_info_indication(&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 Initial Context Setup Response */
|
||||
rv = tests1ap_build_initial_context_setup_response(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Send EMM Status */
|
||||
rv = tests1ap_build_emm_status(&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));
|
||||
|
||||
/* eNB disonncect from MME */
|
||||
rv = tests1ap_enb_close(sock);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
@ -172,6 +296,7 @@ abts_suite *test_nas_sm(abts_suite *suite)
|
|||
suite = ADD_SUITE(suite)
|
||||
|
||||
abts_run_test(suite, nas_sm_test1, NULL);
|
||||
abts_run_test(suite, nas_sm_test2, NULL);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
|
173
test/tests1ap.c
173
test/tests1ap.c
|
@ -110,136 +110,215 @@ status_t tests1ap_build_setup_req(pkbuf_t **pkbuf, c_uint32_t enb_id)
|
|||
return CORE_OK;
|
||||
}
|
||||
|
||||
#define TESTS1AP_MAX_MESSAGE 10
|
||||
|
||||
status_t tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf)
|
||||
status_t tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload =
|
||||
"000c405800000500 0800020001001a00"
|
||||
"302f177ca0b38802 0741020809101010"
|
||||
"3254869104e060c0 4000050221d011d1"
|
||||
"5c0a003103e5e034 9011035758a65d01"
|
||||
"00004300060000f1 105ba00064400800"
|
||||
"00f1101079baf000 86400130";
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"000c405800000500 0800020001001a00 302f177ca0b38802 0741020809101010"
|
||||
"3254869104e060c0 4000050221d011d1 5c0a003103e5e034 9011035758a65d01"
|
||||
"00004300060000f1 105ba00064400800 00f1101079baf000 86400130",
|
||||
|
||||
"000c406800000500 080002001f001a00 403f074172080910 10103254866202e0"
|
||||
"600021023cd011d1 271a808021100100 0010810600000000 830600000000000d"
|
||||
"00000a005c0a0090 11034f18a6f15d01 00004300060000f1 1030390064400800"
|
||||
"00f110002343d000 86400130",
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
92,
|
||||
108,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
if (!(*pkbuf)) return CORE_ERROR;
|
||||
|
||||
(*pkbuf)->len = 92;
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload, strlen(payload), hexbuf),
|
||||
(*pkbuf)->len = len[i];
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
|
||||
(*pkbuf)->len);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t tests1ap_build_authentication_response(pkbuf_t **pkbuf)
|
||||
status_t tests1ap_build_authentication_response(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload =
|
||||
"000d403e00000500 000005c00100009d"
|
||||
"000800020001001a 001211177c0bca9d"
|
||||
"030753086a91970e 838fd07900644008"
|
||||
"0000f1101079baf0 004340060000f110"
|
||||
"5ba0";
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"000d403e00000500 000005c00100009d 000800020001001a 001211177c0bca9d"
|
||||
"030753086a91970e 838fd07900644008 0000f1101079baf0 004340060000f110"
|
||||
"5ba0",
|
||||
|
||||
"000d403500000500 0000020001000800 02001f001a000c0b 07530831c964f076"
|
||||
"1378760064400800 00f110002343d000 4340060000f11030 39"
|
||||
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
66,
|
||||
57,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
if (!(*pkbuf)) return CORE_ERROR;
|
||||
|
||||
(*pkbuf)->len = 66;
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload, strlen(payload), hexbuf),
|
||||
(*pkbuf)->len = len[i];
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
|
||||
(*pkbuf)->len);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t tests1ap_build_security_mode_complete(pkbuf_t **pkbuf)
|
||||
status_t tests1ap_build_security_mode_complete(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload =
|
||||
"000d403500000500 000005c00100009d"
|
||||
"000800020001001a 000908476b8f5f64"
|
||||
"00075e0064400800 00f1101079baf000"
|
||||
"4340060000f1105b a0";
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"000d403500000500 000005c00100009d 000800020001001a 000908476b8f5f64"
|
||||
"00075e0064400800 00f1101079baf000 4340060000f1105b a0",
|
||||
|
||||
"000d403200000500 0000020001000800 02001f001a000908 473c0c819e00075e"
|
||||
"006440080000f110 002343d000434006 0000f1103039",
|
||||
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
57,
|
||||
54,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
if (!(*pkbuf)) return CORE_ERROR;
|
||||
|
||||
(*pkbuf)->len = 57;
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload, strlen(payload), hexbuf),
|
||||
(*pkbuf)->len = len[i];
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
|
||||
(*pkbuf)->len);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t tests1ap_build_esm_information_response(pkbuf_t **pkbuf)
|
||||
status_t tests1ap_build_esm_information_response(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload =
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"000d40808d000005 00000005c0010000 9d00080002000100 1a006160275c0667"
|
||||
"58010221da280908 696e7465726e6574 274a80c223150100 001510c09a2626c0"
|
||||
"9a2626c09a2626c0 9a2626c223150200 0015103d3dda5c72 4cc497354ae64653"
|
||||
"45a8088021100100 0010810600000000 830600000000000d 00000a0000644008"
|
||||
"0000f1101079baf0 004340060000f110 5ba0";
|
||||
"0000f1101079baf0 004340060000f110 5ba0",
|
||||
|
||||
"000d403e00000500 0000020001000800 02001f001a001514 27505a0b5301023c"
|
||||
"da280908696e7465 726e657400644008 0000f110002343d0 004340060000f110"
|
||||
"3039"
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
146,
|
||||
66,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
if (!(*pkbuf)) return CORE_ERROR;
|
||||
|
||||
(*pkbuf)->len = 146;
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload, strlen(payload), hexbuf),
|
||||
(*pkbuf)->len = len[i];
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
|
||||
(*pkbuf)->len);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t tests1ap_build_ue_capability_info_indication(pkbuf_t **pkbuf)
|
||||
status_t tests1ap_build_ue_capability_info_indication(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload = "0016"
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"0016"
|
||||
"40809c0000030000 0005c00100009d00 0800020001004a40 8085808304040003"
|
||||
"04ec598007000820 81839b4e1e3ff8ff f1ffc7ff8ffe3ffc 7ff1ffe3ff8fff1f"
|
||||
"fc7ff8ffe3ffc7ff 1ffdfd3ffa7a2060 090e194e9525c8c2 fd80000000e03fe7"
|
||||
"ff5f60000000384f e9ffd3d800000002 1033035758a66014 042f6513b8800d2f"
|
||||
"0831c1a53432b259 ef989007000cdd9c 6331200e0019a332 c662401c003200";
|
||||
"0831c1a53432b259 ef989007000cdd9c 6331200e0019a332 c662401c003200",
|
||||
|
||||
"0016402d00000300 0000020001000800 02001f004a401a19 00b801014c598080"
|
||||
"9c000bf06ec4d001 40302c0000000000 000000"
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
161,
|
||||
51,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
if (!(*pkbuf)) return CORE_ERROR;
|
||||
|
||||
(*pkbuf)->len = 161;
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload, strlen(payload), hexbuf),
|
||||
(*pkbuf)->len = len[i];
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
|
||||
(*pkbuf)->len);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t tests1ap_build_initial_context_setup_response(pkbuf_t **pkbuf)
|
||||
status_t tests1ap_build_initial_context_setup_response(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload = "2009"
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"2009"
|
||||
"0025000003000040 05c00100009d0008 400200010033400f 000032400a0a1f0a"
|
||||
"012d2801000008";
|
||||
"012d2801000008",
|
||||
|
||||
"2009002200000300 0040020001000840 02001f0033400f00 0032400a0a1f0a01"
|
||||
"23c501000508",
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
41,
|
||||
38,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
if (!(*pkbuf)) return CORE_ERROR;
|
||||
|
||||
(*pkbuf)->len = 41;
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload, strlen(payload), hexbuf),
|
||||
(*pkbuf)->len = len[i];
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
|
||||
(*pkbuf)->len);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t tests1ap_build_attach_complete(pkbuf_t **pkbuf)
|
||||
status_t tests1ap_build_attach_complete(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload = "000d"
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = { "000d"
|
||||
"403a000005000000 05c00100009d0008 00020001001a000e 0d27c183eb950207"
|
||||
"4300035200c20064 40080000f1101079 baf0004340060000 f1105ba0";
|
||||
"4300035200c20064 40080000f1101079 baf0004340060000 f1105ba0",
|
||||
"",
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
62,
|
||||
0,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
*pkbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
if (!(*pkbuf)) return CORE_ERROR;
|
||||
|
||||
(*pkbuf)->len = 62;
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload, strlen(payload), hexbuf),
|
||||
(*pkbuf)->len = len[i];
|
||||
memcpy((*pkbuf)->payload, CORE_HEX(payload[i], strlen(payload[i]), hexbuf),
|
||||
(*pkbuf)->len);
|
||||
|
||||
return CORE_OK;
|
||||
}
|
||||
|
||||
status_t tests1ap_build_emm_status(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
char *payload[TESTS1AP_MAX_MESSAGE] = {
|
||||
"",
|
||||
|
||||
"000d403300000500 0000020001000800 02001f001a000a09 27574292cc020760"
|
||||
"65006440080000f1 10002343d0004340 060000f1103039",
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
0,
|
||||
55,
|
||||
};
|
||||
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;
|
||||
|
|
|
@ -14,15 +14,19 @@ CORE_DECLARE(int) tests1ap_enb_read(net_sock_t *sock, pkbuf_t *recvbuf);
|
|||
|
||||
CORE_DECLARE(status_t) tests1ap_build_setup_req(
|
||||
pkbuf_t **pkbuf, c_uint32_t enb_id);
|
||||
CORE_DECLARE(status_t) tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf);
|
||||
CORE_DECLARE(status_t) tests1ap_build_authentication_response(pkbuf_t **pkbuf);
|
||||
CORE_DECLARE(status_t) tests1ap_build_security_mode_complete(pkbuf_t **pkbuf);
|
||||
CORE_DECLARE(status_t) tests1ap_build_esm_information_response(pkbuf_t **pkbuf);
|
||||
CORE_DECLARE(status_t) tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_authentication_response(
|
||||
pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_security_mode_complete(
|
||||
pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_esm_information_response(
|
||||
pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_ue_capability_info_indication(
|
||||
pkbuf_t **pkbuf);
|
||||
pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_initial_context_setup_response(
|
||||
pkbuf_t **pkbuf);
|
||||
CORE_DECLARE(status_t) tests1ap_build_attach_complete(pkbuf_t **pkbuf);
|
||||
pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_attach_complete(pkbuf_t **pkbuf, int i);
|
||||
CORE_DECLARE(status_t) tests1ap_build_emm_status(pkbuf_t **pkbuf, int i);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue