forked from acouzens/open5gs
HO message is added
This commit is contained in:
parent
a68e5462ba
commit
287a7ca76c
|
@ -128,6 +128,13 @@ static int s1ap_decode_initiating(s1ap_message_t *message,
|
|||
s1ap_xer__print2sp, message);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverPreparation:
|
||||
ret = s1ap_decode_s1ap_handoverrequiredies(
|
||||
&message->s1ap_HandoverRequiredIEs, &initiating_p->value);
|
||||
s1ap_decode_xer_print_message(s1ap_xer_print_s1ap_handoverrequired,
|
||||
s1ap_xer__print2sp, message);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_NASNonDeliveryIndication:
|
||||
ret = s1ap_decode_s1ap_nasnondeliveryindication_ies(
|
||||
&message->s1ap_NASNonDeliveryIndication_IEs,
|
||||
|
@ -196,6 +203,15 @@ static int s1ap_decode_successfull_outcome(s1ap_message_t *message,
|
|||
s1ap_xer__print2sp, message);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverResourceAllocation:
|
||||
ret = s1ap_decode_s1ap_handoverrequestacknowledgeies(
|
||||
&message->s1ap_HandoverRequestAcknowledgeIEs,
|
||||
&successfullOutcome_p->value);
|
||||
s1ap_decode_xer_print_message(
|
||||
s1ap_xer_print_s1ap_handoverrequestacknowledge,
|
||||
s1ap_xer__print2sp, message);
|
||||
break;
|
||||
|
||||
default:
|
||||
d_error("Unknown procedure ID (%ld) for successfull "
|
||||
"outcome message", successfullOutcome_p->procedureCode);
|
||||
|
@ -231,6 +247,16 @@ static int s1ap_decode_unsuccessfull_outcome(s1ap_message_t *message,
|
|||
s1ap_xer_print_s1ap_initialcontextsetupfailure,
|
||||
s1ap_xer__print2sp, message);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverResourceAllocation:
|
||||
ret = s1ap_decode_s1ap_handoverfailureies(
|
||||
&message->s1ap_HandoverFailureIEs,
|
||||
&unSuccessfulOutcome_p->value);
|
||||
s1ap_decode_xer_print_message(
|
||||
s1ap_xer_print_s1ap_handoverfailure,
|
||||
s1ap_xer__print2sp, message);
|
||||
break;
|
||||
|
||||
default:
|
||||
d_error("Unknown procedure ID (%d) for "
|
||||
"unsuccessfull outcome message",
|
||||
|
|
|
@ -35,6 +35,12 @@ static inline int s1ap_encode_path_switch_ack(
|
|||
s1ap_message_t *message_p, pkbuf_t *pkbuf);
|
||||
static inline int s1ap_encode_path_switch_failure(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf);
|
||||
static inline int s1ap_encode_handover_request(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf);
|
||||
static inline int s1ap_encode_handover_command(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf);
|
||||
static inline int s1ap_encode_handover_preparation_failure(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf);
|
||||
|
||||
static void s1ap_encode_xer_print_message(
|
||||
asn_enc_rval_t (*func)(asn_app_consume_bytes_f *cb,
|
||||
|
@ -126,10 +132,15 @@ static inline int s1ap_encode_initiating_message(
|
|||
ret = s1ap_encode_ue_context_release_command(message_p, pkbuf);
|
||||
break;
|
||||
case S1ap_ProcedureCode_id_Paging:
|
||||
s1ap_encode_xer_print_message(
|
||||
s1ap_xer_print_s1ap_paging, s1ap_xer__print2sp, message_p);
|
||||
s1ap_encode_xer_print_message(s1ap_xer_print_s1ap_paging,
|
||||
s1ap_xer__print2sp, message_p);
|
||||
ret = s1ap_encode_paging(message_p, pkbuf);
|
||||
break;
|
||||
case S1ap_ProcedureCode_id_HandoverResourceAllocation:
|
||||
s1ap_encode_xer_print_message(s1ap_xer_print_s1ap_handoverrequest,
|
||||
s1ap_xer__print2sp, message_p);
|
||||
ret = s1ap_encode_handover_request(message_p, pkbuf);
|
||||
break;
|
||||
default:
|
||||
d_warn("Unknown procedure ID (%d) for initiating message_p\n",
|
||||
(int)message_p->procedureCode);
|
||||
|
@ -157,6 +168,12 @@ static inline int s1ap_encode_successfull_outcome(
|
|||
s1ap_xer__print2sp, message_p);
|
||||
ret = s1ap_encode_path_switch_ack(message_p, pkbuf);
|
||||
break;
|
||||
case S1ap_ProcedureCode_id_HandoverPreparation:
|
||||
s1ap_encode_xer_print_message(
|
||||
s1ap_xer_print_s1ap_handovercommand,
|
||||
s1ap_xer__print2sp, message_p);
|
||||
ret = s1ap_encode_handover_command(message_p, pkbuf);
|
||||
break;
|
||||
default:
|
||||
d_warn("Unknown procedure ID (%d) for successfull "
|
||||
"outcome message\n", (int)message_p->procedureCode);
|
||||
|
@ -184,6 +201,11 @@ static inline int s1ap_encode_unsuccessfull_outcome(
|
|||
s1ap_xer__print2sp, message_p);
|
||||
ret = s1ap_encode_path_switch_failure(message_p, pkbuf);
|
||||
break;
|
||||
case S1ap_ProcedureCode_id_HandoverPreparation:
|
||||
s1ap_encode_xer_print_message(
|
||||
s1ap_xer_print_s1ap_handoverpreparationfailure,
|
||||
s1ap_xer__print2sp, message_p);
|
||||
ret = s1ap_encode_handover_preparation_failure(message_p, pkbuf);
|
||||
default:
|
||||
d_warn("Unknown procedure ID (%d) for unsuccessfull "
|
||||
"outcome message\n", (int)message_p->procedureCode);
|
||||
|
@ -506,11 +528,8 @@ static inline int s1ap_encode_paging(s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
|||
S1ap_Paging_t paging;
|
||||
asn_TYPE_descriptor_t *td = &asn_DEF_S1ap_Paging;
|
||||
|
||||
memset(&paging, 0,
|
||||
sizeof(S1ap_Paging_t));
|
||||
if (s1ap_encode_s1ap_pagingies(
|
||||
&paging,
|
||||
&message_p->s1ap_PagingIEs) < 0)
|
||||
memset(&paging, 0, sizeof(S1ap_Paging_t));
|
||||
if (s1ap_encode_s1ap_pagingies(&paging, &message_p->s1ap_PagingIEs) < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
return -1;
|
||||
|
@ -520,8 +539,7 @@ static inline int s1ap_encode_paging(s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
|||
pdu.present = S1AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage.procedureCode = message_p->procedureCode;
|
||||
pdu.choice.initiatingMessage.criticality = S1ap_Criticality_ignore;
|
||||
ANY_fromType_aper(&pdu.choice.initiatingMessage.value,
|
||||
td, &paging);
|
||||
ANY_fromType_aper(&pdu.choice.initiatingMessage.value, td, &paging);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(&asn_DEF_S1AP_PDU,
|
||||
&pdu, pkbuf->payload, MAX_SDU_LEN);
|
||||
|
@ -538,7 +556,7 @@ static inline int s1ap_encode_paging(s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
|||
}
|
||||
|
||||
static inline int s1ap_encode_path_switch_ack(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
|
||||
|
@ -546,7 +564,7 @@ static inline int s1ap_encode_path_switch_ack(
|
|||
S1ap_PathSwitchRequestAcknowledge_t ack;
|
||||
asn_TYPE_descriptor_t *td = &asn_DEF_S1ap_PathSwitchRequestAcknowledge;
|
||||
|
||||
memset(&ack, 0, sizeof (S1ap_PathSwitchRequestAcknowledge_t));
|
||||
memset(&ack, 0, sizeof(S1ap_PathSwitchRequestAcknowledge_t));
|
||||
if (s1ap_encode_s1ap_pathswitchrequestacknowledgeies(
|
||||
&ack, &message_p->s1ap_PathSwitchRequestAcknowledgeIEs) < 0)
|
||||
{
|
||||
|
@ -583,7 +601,7 @@ static inline int s1ap_encode_path_switch_failure(
|
|||
S1ap_PathSwitchRequestFailure_t failure;
|
||||
asn_TYPE_descriptor_t *td = &asn_DEF_S1ap_PathSwitchRequestFailure;
|
||||
|
||||
memset(&failure, 0, sizeof (S1ap_PathSwitchRequestFailure_t));
|
||||
memset(&failure, 0, sizeof(S1ap_PathSwitchRequestFailure_t));
|
||||
if (s1ap_encode_s1ap_pathswitchrequestfailureies(
|
||||
&failure, &message_p->s1ap_PathSwitchRequestFailureIEs) < 0)
|
||||
{
|
||||
|
@ -611,6 +629,115 @@ static inline int s1ap_encode_path_switch_failure(
|
|||
return enc_ret.encoded;
|
||||
}
|
||||
|
||||
static inline int s1ap_encode_handover_request(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
|
||||
S1AP_PDU_t pdu;
|
||||
S1ap_HandoverRequest_t request;
|
||||
asn_TYPE_descriptor_t *td = &asn_DEF_S1ap_HandoverRequest;
|
||||
|
||||
memset(&request, 0, sizeof(S1ap_HandoverRequest_t));
|
||||
if (s1ap_encode_s1ap_handoverrequesties(
|
||||
&request, &message_p->s1ap_HandoverRequestIEs) < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&pdu, 0, sizeof (S1AP_PDU_t));
|
||||
pdu.present = S1AP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage.procedureCode = message_p->procedureCode;
|
||||
pdu.choice.initiatingMessage.criticality = S1ap_Criticality_reject;
|
||||
ANY_fromType_aper(&pdu.choice.initiatingMessage.value, td, &request);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(&asn_DEF_S1AP_PDU,
|
||||
&pdu, pkbuf->payload, MAX_SDU_LEN);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, &request);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1AP_PDU, &pdu);
|
||||
|
||||
if (enc_ret.encoded < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
}
|
||||
|
||||
return enc_ret.encoded;
|
||||
}
|
||||
static inline int s1ap_encode_handover_command(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
|
||||
S1AP_PDU_t pdu;
|
||||
S1ap_HandoverCommand_t command;
|
||||
asn_TYPE_descriptor_t *td = &asn_DEF_S1ap_HandoverCommand;
|
||||
|
||||
memset(&command, 0, sizeof(S1ap_HandoverCommand_t));
|
||||
if (s1ap_encode_s1ap_handovercommandies(
|
||||
&command, &message_p->s1ap_HandoverCommandIEs) < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&pdu, 0, sizeof (S1AP_PDU_t));
|
||||
pdu.present = S1AP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome.procedureCode = message_p->procedureCode;
|
||||
pdu.choice.successfulOutcome.criticality = S1ap_Criticality_reject;
|
||||
ANY_fromType_aper(&pdu.choice.successfulOutcome.value, td, &command);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(&asn_DEF_S1AP_PDU,
|
||||
&pdu, pkbuf->payload, MAX_SDU_LEN);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, &command);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1AP_PDU, &pdu);
|
||||
|
||||
if (enc_ret.encoded < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
}
|
||||
|
||||
return enc_ret.encoded;
|
||||
}
|
||||
static inline int s1ap_encode_handover_preparation_failure(
|
||||
s1ap_message_t *message_p, pkbuf_t *pkbuf)
|
||||
{
|
||||
asn_enc_rval_t enc_ret = {0};
|
||||
|
||||
S1AP_PDU_t pdu;
|
||||
S1ap_HandoverPreparationFailure_t failure;
|
||||
asn_TYPE_descriptor_t *td = &asn_DEF_S1ap_HandoverPreparationFailure;
|
||||
|
||||
memset(&failure, 0, sizeof(S1ap_HandoverPreparationFailure_t));
|
||||
if (s1ap_encode_s1ap_handoverpreparationfailureies(
|
||||
&failure, &message_p->s1ap_HandoverPreparationFailureIEs) < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&pdu, 0, sizeof (S1AP_PDU_t));
|
||||
pdu.present = S1AP_PDU_PR_unsuccessfulOutcome;
|
||||
pdu.choice.unsuccessfulOutcome.procedureCode = message_p->procedureCode;
|
||||
pdu.choice.unsuccessfulOutcome.criticality = S1ap_Criticality_reject;
|
||||
ANY_fromType_aper(&pdu.choice.unsuccessfulOutcome.value, td, &failure);
|
||||
|
||||
enc_ret = aper_encode_to_buffer(&asn_DEF_S1AP_PDU,
|
||||
&pdu, pkbuf->payload, MAX_SDU_LEN);
|
||||
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(*td, &failure);
|
||||
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_S1AP_PDU, &pdu);
|
||||
|
||||
if (enc_ret.encoded < 0)
|
||||
{
|
||||
d_error("Encoding of %s failed", td->name);
|
||||
}
|
||||
|
||||
return enc_ret.encoded;
|
||||
}
|
||||
|
||||
static void s1ap_encode_xer_print_message(
|
||||
asn_enc_rval_t (*func)(asn_app_consume_bytes_f *cb,
|
||||
void *app_key, s1ap_message_t *message_p),
|
||||
|
|
|
@ -95,6 +95,16 @@ static inline int s1ap_free_initiating_message(s1ap_message_t *message)
|
|||
&message->s1ap_PathSwitchRequestIEs);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverPreparation:
|
||||
s1ap_free_s1ap_handoverrequiredies(
|
||||
&message->s1ap_HandoverRequiredIEs);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverResourceAllocation:
|
||||
s1ap_free_s1ap_handoverrequesties(
|
||||
&message->s1ap_HandoverRequestIEs);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_NASNonDeliveryIndication:
|
||||
s1ap_free_s1ap_nasnondeliveryindication_ies(
|
||||
&message->s1ap_NASNonDeliveryIndication_IEs);
|
||||
|
@ -143,6 +153,16 @@ static inline int s1ap_free_successfull_outcome(s1ap_message_t *message)
|
|||
&message->s1ap_PathSwitchRequestAcknowledgeIEs);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverResourceAllocation:
|
||||
s1ap_free_s1ap_handoverrequestacknowledgeies(
|
||||
&message->s1ap_HandoverRequestAcknowledgeIEs);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverPreparation:
|
||||
s1ap_free_s1ap_handovercommandies(
|
||||
&message->s1ap_HandoverCommandIEs);
|
||||
break;
|
||||
|
||||
default:
|
||||
d_warn("Unknown procedure ID (%d) for successfull "
|
||||
"outcome message\n", (int)message->procedureCode);
|
||||
|
@ -171,6 +191,16 @@ static inline int s1ap_free_unsuccessfull_outcome(s1ap_message_t *message)
|
|||
&message->s1ap_PathSwitchRequestFailureIEs);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverResourceAllocation:
|
||||
s1ap_free_s1ap_handoverfailureies(
|
||||
&message->s1ap_HandoverFailureIEs);
|
||||
break;
|
||||
|
||||
case S1ap_ProcedureCode_id_HandoverPreparation:
|
||||
s1ap_free_s1ap_handoverpreparationfailureies(
|
||||
&message->s1ap_HandoverPreparationFailureIEs);
|
||||
break;
|
||||
|
||||
default:
|
||||
d_warn("Unknown procedure ID (%d) for unsuccessfull "
|
||||
"outcome message\n", (int)message->procedureCode);
|
||||
|
|
|
@ -305,11 +305,222 @@ static void handover_test1(abts_case *tc, void *data)
|
|||
core_sleep(time_from_msec(300));
|
||||
}
|
||||
|
||||
static void handover_test2(abts_case *tc, void *data)
|
||||
{
|
||||
status_t rv;
|
||||
net_sock_t *sock1, *sock2;
|
||||
pkbuf_t *sendbuf;
|
||||
pkbuf_t *recvbuf;
|
||||
s1ap_message_t message;
|
||||
int rc;
|
||||
int i;
|
||||
int msgindex = 10;
|
||||
|
||||
mongoc_collection_t *collection = NULL;
|
||||
bson_t *doc = NULL;
|
||||
c_int64_t count = 0;
|
||||
bson_error_t error;
|
||||
const char *json =
|
||||
"{"
|
||||
"\"_id\" : { \"$oid\" : \"597223158b8861d7605378c6\" }, "
|
||||
"\"imsi\" : \"405866000000972\", "
|
||||
"\"pdn\" : ["
|
||||
"{"
|
||||
"\"apn\" : \"internet\", "
|
||||
"\"_id\" : { \"$oid\" : \"597223158b8861d7605378c7\" }, "
|
||||
"\"ambr\" : {"
|
||||
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
|
||||
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
|
||||
"},"
|
||||
"\"qos\" : { "
|
||||
"\"qci\" : 9, "
|
||||
"\"arp\" : { "
|
||||
"\"priority_level\" : 8,"
|
||||
"\"pre_emption_vulnerability\" : 1, "
|
||||
"\"pre_emption_capability\" : 1"
|
||||
"} "
|
||||
"}, "
|
||||
"\"type\" : 0"
|
||||
"}"
|
||||
"],"
|
||||
"\"ambr\" : { "
|
||||
"\"uplink\" : { \"$numberLong\" : \"1024000\" }, "
|
||||
"\"downlink\" : { \"$numberLong\" : \"1024000\" } "
|
||||
"},"
|
||||
"\"subscribed_rau_tau_timer\" : 12,"
|
||||
"\"network_access_mode\" : 2, "
|
||||
"\"subscriber_status\" : 0, "
|
||||
"\"access_restriction_data\" : 32, "
|
||||
"\"security\" : { "
|
||||
"\"k\" : \"465B5CE8 B199B49F AA5F0A2E E238A6BC\", "
|
||||
"\"op\" : \"5F1D289C 5D354D0A 140C2548 F5F3E3BA\", "
|
||||
"\"amf\" : \"8000\", "
|
||||
"\"sqn\" : { \"$numberLong\" : \"64\" }, "
|
||||
"\"rand\" : \"E596BAB8 00000000 7AAFC796 00000000\" "
|
||||
"}, "
|
||||
"\"__v\" : 0 "
|
||||
"}";
|
||||
|
||||
mme_self()->mme_ue_s1ap_id = 20675;
|
||||
|
||||
/* Two eNB connects to MME */
|
||||
sock1 = tests1ap_enb_connect();
|
||||
ABTS_PTR_NOTNULL(tc, sock1);
|
||||
|
||||
sock2 = tests1ap_enb_connect();
|
||||
ABTS_PTR_NOTNULL(tc, sock2);
|
||||
|
||||
/* S1-Setup Reqeust/Response for Source eNB */
|
||||
rv = tests1ap_build_setup_req(
|
||||
&sendbuf, S1ap_ENB_ID_PR_macroENB_ID, 0x54f64);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock1, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
/* S1-Setup Reqeust/Response for Target eNB */
|
||||
rv = tests1ap_build_setup_req(
|
||||
&sendbuf, S1ap_ENB_ID_PR_macroENB_ID, 0x54f65);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock2, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock2, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
collection = mongoc_client_get_collection(
|
||||
context_self()->db_client,
|
||||
context_self()->db_name, "subscribers");
|
||||
ABTS_PTR_NOTNULL(tc, collection);
|
||||
|
||||
doc = bson_new_from_json((const uint8_t *)json, -1, &error);;
|
||||
ABTS_PTR_NOTNULL(tc, doc);
|
||||
ABTS_TRUE(tc, mongoc_collection_insert(collection,
|
||||
MONGOC_INSERT_NONE, doc, NULL, &error));
|
||||
bson_destroy(doc);
|
||||
|
||||
doc = BCON_NEW("imsi", BCON_UTF8("405866000000972"));
|
||||
ABTS_PTR_NOTNULL(tc, doc);
|
||||
do
|
||||
{
|
||||
count = mongoc_collection_count (
|
||||
collection, MONGOC_QUERY_NONE, doc, 0, 0, NULL, &error);
|
||||
} while (count == 0);
|
||||
bson_destroy(doc);
|
||||
|
||||
/***********************************************************************
|
||||
* Attach Request : Known IMSI, No Security Context
|
||||
* Send Initial-UE Message + Attach Request + PDN Connectivity */
|
||||
rv = tests1ap_build_initial_ue_msg(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive Authentication Request */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock1, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
pkbuf_free(recvbuf);
|
||||
|
||||
#if 0
|
||||
/* Send Authentication Response */
|
||||
rv = tests1ap_build_authentication_response(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive Security mode Command */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock1, recvbuf);
|
||||
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(sock1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive ESM Information Request */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock1, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
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(sock1, 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(sock1, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
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(sock1, 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(sock1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Send Attach Complete + Activate default EPS bearer cotext accept */
|
||||
rv = tests1ap_build_attach_complete(&sendbuf, msgindex);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
rv = tests1ap_enb_send(sock1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
/* Receive EMM information */
|
||||
recvbuf = pkbuf_alloc(0, MAX_SDU_LEN);
|
||||
rc = tests1ap_enb_read(sock1, recvbuf);
|
||||
ABTS_INT_NEQUAL(tc, 0, rc);
|
||||
pkbuf_free(recvbuf);
|
||||
#endif
|
||||
|
||||
/********** Remove Subscriber in Database */
|
||||
doc = BCON_NEW("imsi", BCON_UTF8("405866000000972"));
|
||||
ABTS_PTR_NOTNULL(tc, doc);
|
||||
ABTS_TRUE(tc, mongoc_collection_remove(collection,
|
||||
MONGOC_REMOVE_SINGLE_REMOVE, doc, NULL, &error))
|
||||
bson_destroy(doc);
|
||||
|
||||
mongoc_collection_destroy(collection);
|
||||
|
||||
/* Two eNB disonncect from MME */
|
||||
rv = tests1ap_enb_close(sock1);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
rv = tests1ap_enb_close(sock2);
|
||||
ABTS_INT_EQUAL(tc, CORE_OK, rv);
|
||||
|
||||
core_sleep(time_from_msec(300));
|
||||
}
|
||||
|
||||
abts_suite *test_handover(abts_suite *suite)
|
||||
{
|
||||
suite = ADD_SUITE(suite)
|
||||
|
||||
abts_run_test(suite, handover_test1, NULL);
|
||||
#if 0
|
||||
abts_run_test(suite, handover_test2, NULL);
|
||||
#endif
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ status_t tests1ap_build_setup_req(
|
|||
return CORE_OK;
|
||||
}
|
||||
|
||||
#define TESTS1AP_MAX_MESSAGE 10
|
||||
#define TESTS1AP_MAX_MESSAGE 32
|
||||
|
||||
status_t tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf, int i)
|
||||
{
|
||||
|
@ -163,6 +163,12 @@ status_t tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf, int i)
|
|||
"210207d011d1271a 8080211001000010 8106000000008306 00000000000d0000"
|
||||
"0a005c0a00901103 4f18a6f15d010000 4300060000f1105b a0006440080000f1"
|
||||
"1004615380008640 0130",
|
||||
|
||||
"000c"
|
||||
"406b000005000800 020002001a004342 0741710849506806 0000902702e06000"
|
||||
"2d0201d031d12726 8080211001000010 8106000000008306 00000000000d0000"
|
||||
"0300000100000c00 000a000010005c0a 00c1004300060004 9699000200644008"
|
||||
"0004969904f00000 0086400130",
|
||||
};
|
||||
c_uint16_t len[TESTS1AP_MAX_MESSAGE] = {
|
||||
92,
|
||||
|
@ -178,6 +184,7 @@ status_t tests1ap_build_initial_ue_msg(pkbuf_t **pkbuf, int i)
|
|||
0,
|
||||
|
||||
108,
|
||||
111,
|
||||
};
|
||||
char hexbuf[MAX_SDU_LEN];
|
||||
|
||||
|
|
Loading…
Reference in New Issue