forked from acouzens/open5gs
Compare commits
2 Commits
8484a5af60
...
bbdfca29bf
Author | SHA1 | Date |
---|---|---|
Sukchan Lee | bbdfca29bf | |
Pau Espin | e078b33f0c |
|
@ -799,9 +799,23 @@ void sgwc_s11_handle_create_bearer_response(
|
||||||
|
|
||||||
/* Find the Tunnel by SGW-S1U-TEID */
|
/* Find the Tunnel by SGW-S1U-TEID */
|
||||||
ul_tunnel = sgwc_tunnel_find_by_teid(sgwc_ue, be32toh(sgw_s1u_teid->teid));
|
ul_tunnel = sgwc_tunnel_find_by_teid(sgwc_ue, be32toh(sgw_s1u_teid->teid));
|
||||||
ogs_assert(ul_tunnel);
|
if (!ul_tunnel) {
|
||||||
|
ogs_error("No UL-tunnel [EBI:%d, TEID:0x%x]",
|
||||||
|
bearer->ebi, be32toh(sgw_s1u_teid->teid));
|
||||||
|
ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0,
|
||||||
|
OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE,
|
||||||
|
OGS_GTP2_CAUSE_GRE_KEY_NOT_FOUND);
|
||||||
|
return;
|
||||||
|
}
|
||||||
dl_tunnel = sgwc_dl_tunnel_in_bearer(bearer);
|
dl_tunnel = sgwc_dl_tunnel_in_bearer(bearer);
|
||||||
ogs_assert(dl_tunnel);
|
if (!dl_tunnel) {
|
||||||
|
ogs_error("No DL-tunnel [EBI:%d, TEID:0x%x]",
|
||||||
|
bearer->ebi, be32toh(sgw_s1u_teid->teid));
|
||||||
|
ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0,
|
||||||
|
OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE,
|
||||||
|
OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set EBI */
|
/* Set EBI */
|
||||||
bearer->ebi = rsp->bearer_contexts.eps_bearer_id.u8;
|
bearer->ebi = rsp->bearer_contexts.eps_bearer_id.u8;
|
||||||
|
|
|
@ -142,7 +142,7 @@ void sgwu_sxa_handle_session_establishment_request(
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
ogs_pfcp_sess_clear(&sess->pfcp);
|
ogs_pfcp_sess_clear(&sess->pfcp);
|
||||||
ogs_pfcp_send_error_message(xact, sess ? sess->sgwu_sxa_seid : 0,
|
ogs_pfcp_send_error_message(xact, sess ? sess->sgwc_sxa_f_seid.seid : 0,
|
||||||
OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE,
|
OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE,
|
||||||
cause_value, offending_ie_value);
|
cause_value, offending_ie_value);
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ void sgwu_sxa_handle_session_modification_request(
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
ogs_pfcp_sess_clear(&sess->pfcp);
|
ogs_pfcp_sess_clear(&sess->pfcp);
|
||||||
ogs_pfcp_send_error_message(xact, sess ? sess->sgwu_sxa_seid : 0,
|
ogs_pfcp_send_error_message(xact, sess ? sess->sgwc_sxa_f_seid.seid : 0,
|
||||||
OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE,
|
OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE,
|
||||||
cause_value, offending_ie_value);
|
cause_value, offending_ie_value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,12 +47,14 @@ static void urr_update_volume(smf_sess_t *sess, ogs_pfcp_urr_t *urr, ogs_diam_gy
|
||||||
urr->vol_quota.total_volume = 0;
|
urr->vol_quota.total_volume = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Volume Threshold */
|
/* Volume Threshold, requires Volume Quota for calculations */
|
||||||
if (gy_message->cca.volume_threshold) {
|
if (gy_message->cca.volume_threshold &&
|
||||||
|
gy_message->cca.granted.cc_total_octets >= gy_message->cca.volume_threshold) {
|
||||||
ogs_debug("Adding Volume Threshold total_octets=%" PRIu32, gy_message->cca.volume_threshold);
|
ogs_debug("Adding Volume Threshold total_octets=%" PRIu32, gy_message->cca.volume_threshold);
|
||||||
urr->rep_triggers.volume_threshold = 1;
|
urr->rep_triggers.volume_threshold = 1;
|
||||||
urr->vol_threshold.tovol = 1;
|
urr->vol_threshold.tovol = 1;
|
||||||
urr->vol_threshold.total_volume = gy_message->cca.volume_threshold;
|
urr->vol_threshold.total_volume = (gy_message->cca.granted.cc_total_octets -
|
||||||
|
gy_message->cca.volume_threshold);
|
||||||
} else {
|
} else {
|
||||||
urr->rep_triggers.volume_threshold = 0;
|
urr->rep_triggers.volume_threshold = 0;
|
||||||
urr->vol_threshold.tovol = 0;
|
urr->vol_threshold.tovol = 0;
|
||||||
|
@ -94,6 +96,7 @@ static void urr_update_time(smf_sess_t *sess, ogs_pfcp_urr_t *urr, ogs_diam_gy_m
|
||||||
urr->meas_method &= ~OGS_PFCP_MEASUREMENT_METHOD_DURATION;
|
urr->meas_method &= ~OGS_PFCP_MEASUREMENT_METHOD_DURATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Time Quota */
|
||||||
if (time_quota) {
|
if (time_quota) {
|
||||||
ogs_debug("Adding Time Quota secs=%" PRIu32, time_quota);
|
ogs_debug("Adding Time Quota secs=%" PRIu32, time_quota);
|
||||||
urr->rep_triggers.time_quota = 1;
|
urr->rep_triggers.time_quota = 1;
|
||||||
|
@ -103,10 +106,12 @@ static void urr_update_time(smf_sess_t *sess, ogs_pfcp_urr_t *urr, ogs_diam_gy_m
|
||||||
urr->time_quota = 0;
|
urr->time_quota = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gy_message->cca.time_threshold) {
|
/* Time Threshold, requires Time Quota for calculations */
|
||||||
|
if (gy_message->cca.time_threshold &&
|
||||||
|
time_quota >= gy_message->cca.time_threshold) {
|
||||||
ogs_debug("Adding Time Threshold secs=%" PRIu32, gy_message->cca.time_threshold);
|
ogs_debug("Adding Time Threshold secs=%" PRIu32, gy_message->cca.time_threshold);
|
||||||
urr->rep_triggers.time_threshold = 1;
|
urr->rep_triggers.time_threshold = 1;
|
||||||
urr->time_threshold = gy_message->cca.time_threshold;
|
urr->time_threshold = (time_quota - gy_message->cca.time_threshold);
|
||||||
} else {
|
} else {
|
||||||
urr->rep_triggers.time_threshold = 0;
|
urr->rep_triggers.time_threshold = 0;
|
||||||
urr->time_threshold = 0;
|
urr->time_threshold = 0;
|
||||||
|
|
|
@ -50,6 +50,14 @@ static void pfcp_sess_timeout(ogs_pfcp_xact_t *xact, void *data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ogs_inline uint32_t get_sender_f_teid(
|
||||||
|
smf_sess_t *sess, ogs_gtp2_sender_f_teid_t *sender_f_teid)
|
||||||
|
{
|
||||||
|
return sess ? sess->sgw_s5c_teid :
|
||||||
|
sender_f_teid && sender_f_teid->teid_presence == true ?
|
||||||
|
sender_f_teid->teid : 0;
|
||||||
|
}
|
||||||
|
|
||||||
void smf_s5c_handle_echo_request(
|
void smf_s5c_handle_echo_request(
|
||||||
ogs_gtp_xact_t *xact, ogs_gtp2_echo_request_t *req)
|
ogs_gtp_xact_t *xact, ogs_gtp2_echo_request_t *req)
|
||||||
{
|
{
|
||||||
|
@ -507,10 +515,8 @@ void smf_s5c_handle_modify_bearer_request(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
||||||
ogs_gtp2_send_error_message(gtp_xact,
|
ogs_gtp2_send_error_message(
|
||||||
sess ? sess->sgw_s5c_teid :
|
gtp_xact, get_sender_f_teid(sess, sender_f_teid),
|
||||||
sender_f_teid->teid_presence == true ?
|
|
||||||
sender_f_teid->teid : 0,
|
|
||||||
OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value);
|
OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1194,10 +1200,8 @@ void smf_s5c_handle_bearer_resource_command(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
||||||
ogs_gtp2_send_error_message(xact,
|
ogs_gtp2_send_error_message(
|
||||||
sess ? sess->sgw_s5c_teid :
|
xact, get_sender_f_teid(sess, sender_f_teid),
|
||||||
sender_f_teid->teid_presence == true ?
|
|
||||||
sender_f_teid->teid : 0,
|
|
||||||
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value);
|
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1222,7 +1226,8 @@ void smf_s5c_handle_bearer_resource_command(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) {
|
||||||
ogs_gtp2_send_error_message(xact, sess ? sess->sgw_s5c_teid : 0,
|
ogs_gtp2_send_error_message(
|
||||||
|
xact, get_sender_f_teid(sess, sender_f_teid),
|
||||||
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value);
|
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE, cause_value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1252,7 +1257,7 @@ void smf_s5c_handle_bearer_resource_command(
|
||||||
if (pf) {
|
if (pf) {
|
||||||
if (reconfigure_packet_filter(pf, &tft, i) < 0) {
|
if (reconfigure_packet_filter(pf, &tft, i) < 0) {
|
||||||
ogs_gtp2_send_error_message(
|
ogs_gtp2_send_error_message(
|
||||||
xact, sess ? sess->sgw_s5c_teid : 0,
|
xact, get_sender_f_teid(sess, sender_f_teid),
|
||||||
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE,
|
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE,
|
||||||
OGS_GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER);
|
OGS_GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER);
|
||||||
return;
|
return;
|
||||||
|
@ -1321,7 +1326,7 @@ void smf_s5c_handle_bearer_resource_command(
|
||||||
|
|
||||||
if (reconfigure_packet_filter(pf, &tft, i) < 0) {
|
if (reconfigure_packet_filter(pf, &tft, i) < 0) {
|
||||||
ogs_gtp2_send_error_message(
|
ogs_gtp2_send_error_message(
|
||||||
xact, sess ? sess->sgw_s5c_teid : 0,
|
xact, get_sender_f_teid(sess, sender_f_teid),
|
||||||
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE,
|
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE,
|
||||||
OGS_GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER);
|
OGS_GTP2_CAUSE_SEMANTIC_ERRORS_IN_PACKET_FILTER);
|
||||||
return;
|
return;
|
||||||
|
@ -1407,7 +1412,8 @@ void smf_s5c_handle_bearer_resource_command(
|
||||||
|
|
||||||
if (tft_update == 0 && tft_delete == 0 && qos_update == 0) {
|
if (tft_update == 0 && tft_delete == 0 && qos_update == 0) {
|
||||||
/* No modification */
|
/* No modification */
|
||||||
ogs_gtp2_send_error_message(xact, sess ? sess->sgw_s5c_teid : 0,
|
ogs_gtp2_send_error_message(
|
||||||
|
xact, get_sender_f_teid(sess, sender_f_teid),
|
||||||
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE,
|
OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE,
|
||||||
OGS_GTP2_CAUSE_SERVICE_NOT_SUPPORTED);
|
OGS_GTP2_CAUSE_SERVICE_NOT_SUPPORTED);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3068,6 +3068,329 @@ static void test7_func(abts_case *tc, void *data)
|
||||||
test_ue_remove(test_ue);
|
test_ue_remove(test_ue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
static void test_issues3109_func(abts_case *tc, void *data)
|
||||||
|
{
|
||||||
|
int rv;
|
||||||
|
ogs_socknode_t *s1ap;
|
||||||
|
ogs_socknode_t *gtpu;
|
||||||
|
ogs_pkbuf_t *emmbuf;
|
||||||
|
ogs_pkbuf_t *esmbuf;
|
||||||
|
ogs_pkbuf_t *sendbuf;
|
||||||
|
ogs_pkbuf_t *recvbuf;
|
||||||
|
ogs_s1ap_message_t message;
|
||||||
|
|
||||||
|
uint8_t *rx_sid = NULL;
|
||||||
|
|
||||||
|
ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci;
|
||||||
|
test_ue_t *test_ue = NULL;
|
||||||
|
test_sess_t *sess = NULL;
|
||||||
|
test_bearer_t *bearer = NULL;
|
||||||
|
|
||||||
|
uint32_t enb_ue_s1ap_id;
|
||||||
|
uint64_t mme_ue_s1ap_id;
|
||||||
|
|
||||||
|
bson_t *doc = NULL;
|
||||||
|
|
||||||
|
/* Setup Test UE & Session Context */
|
||||||
|
memset(&mobile_identity_suci, 0, sizeof(mobile_identity_suci));
|
||||||
|
|
||||||
|
mobile_identity_suci.h.supi_format = OGS_NAS_5GS_SUPI_FORMAT_IMSI;
|
||||||
|
mobile_identity_suci.h.type = OGS_NAS_5GS_MOBILE_IDENTITY_SUCI;
|
||||||
|
mobile_identity_suci.routing_indicator1 = 0;
|
||||||
|
mobile_identity_suci.routing_indicator2 = 0xf;
|
||||||
|
mobile_identity_suci.routing_indicator3 = 0xf;
|
||||||
|
mobile_identity_suci.routing_indicator4 = 0xf;
|
||||||
|
mobile_identity_suci.protection_scheme_id = OGS_PROTECTION_SCHEME_NULL;
|
||||||
|
mobile_identity_suci.home_network_pki_value = 0;
|
||||||
|
|
||||||
|
test_ue = test_ue_add_by_suci(&mobile_identity_suci, "1032548691");
|
||||||
|
ogs_assert(test_ue);
|
||||||
|
|
||||||
|
test_ue->e_cgi.cell_id = 0x1079baf;
|
||||||
|
test_ue->nas.ksi = 0;
|
||||||
|
test_ue->nas.value = OGS_NAS_ATTACH_TYPE_COMBINED_EPS_IMSI_ATTACH;
|
||||||
|
|
||||||
|
test_ue->k_string = "465b5ce8b199b49faa5f0a2ee238a6bc";
|
||||||
|
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
|
||||||
|
|
||||||
|
sess = test_sess_add_by_apn(test_ue, "internet", OGS_GTP2_RAT_TYPE_EUTRAN);
|
||||||
|
ogs_assert(sess);
|
||||||
|
|
||||||
|
/* eNB connects to MME */
|
||||||
|
s1ap = tests1ap_client(AF_INET);
|
||||||
|
ABTS_PTR_NOTNULL(tc, s1ap);
|
||||||
|
|
||||||
|
/* eNB connects to SGW */
|
||||||
|
gtpu = test_gtpu_server(1, AF_INET);
|
||||||
|
ABTS_PTR_NOTNULL(tc, gtpu);
|
||||||
|
|
||||||
|
/* Send S1-Setup Reqeust */
|
||||||
|
sendbuf = test_s1ap_build_s1_setup_request(
|
||||||
|
S1AP_ENB_ID_PR_macroENB_ID, 0x54f64);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive S1-Setup Response */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(NULL, recvbuf);
|
||||||
|
|
||||||
|
/********** Insert Subscriber in Database */
|
||||||
|
doc = test_db_new_ims(test_ue);
|
||||||
|
ABTS_PTR_NOTNULL(tc, doc);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, test_db_insert_ue(test_ue, doc));
|
||||||
|
|
||||||
|
/* Send Attach Request */
|
||||||
|
memset(&sess->pdn_connectivity_param,
|
||||||
|
0, sizeof(sess->pdn_connectivity_param));
|
||||||
|
sess->pdn_connectivity_param.eit = 1;
|
||||||
|
sess->pdn_connectivity_param.request_type =
|
||||||
|
OGS_NAS_EPS_REQUEST_TYPE_INITIAL;
|
||||||
|
esmbuf = testesm_build_pdn_connectivity_request(sess, false);
|
||||||
|
ABTS_PTR_NOTNULL(tc, esmbuf);
|
||||||
|
|
||||||
|
memset(&test_ue->attach_request_param,
|
||||||
|
0, sizeof(test_ue->attach_request_param));
|
||||||
|
test_ue->attach_request_param.drx_parameter = 1;
|
||||||
|
test_ue->attach_request_param.ms_network_capability = 1;
|
||||||
|
test_ue->attach_request_param.tmsi_status = 1;
|
||||||
|
test_ue->attach_request_param.mobile_station_classmark_2 = 1;
|
||||||
|
test_ue->attach_request_param.ue_usage_setting = 1;
|
||||||
|
emmbuf = testemm_build_attach_request(test_ue, esmbuf, true, false);
|
||||||
|
ABTS_PTR_NOTNULL(tc, emmbuf);
|
||||||
|
|
||||||
|
memset(&test_ue->initial_ue_param, 0, sizeof(test_ue->initial_ue_param));
|
||||||
|
sendbuf = test_s1ap_build_initial_ue_message(
|
||||||
|
test_ue, emmbuf, S1AP_RRC_Establishment_Cause_mo_Signalling, false);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive Authentication Request */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
|
||||||
|
/* Send Authentication response */
|
||||||
|
emmbuf = testemm_build_authentication_response(test_ue);
|
||||||
|
ABTS_PTR_NOTNULL(tc, emmbuf);
|
||||||
|
sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, emmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive Security mode Command */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
|
||||||
|
/* Send Security mode complete */
|
||||||
|
test_ue->mobile_identity_imeisv_presence = true;
|
||||||
|
emmbuf = testemm_build_security_mode_complete(test_ue);
|
||||||
|
ABTS_PTR_NOTNULL(tc, emmbuf);
|
||||||
|
sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, emmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive ESM Information Request */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
|
||||||
|
/* Send ESM Information Response */
|
||||||
|
sess->esm_information_param.pco = 1;
|
||||||
|
esmbuf = testesm_build_esm_information_response(sess);
|
||||||
|
ABTS_PTR_NOTNULL(tc, esmbuf);
|
||||||
|
sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, esmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive InitialContextSetupRequest +
|
||||||
|
* Attach Accept +
|
||||||
|
* Activate Default Bearer Context Request */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
|
||||||
|
/* Send UE Capability Info Indication */
|
||||||
|
sendbuf = tests1ap_build_ue_radio_capability_info_indication(test_ue);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Send InitialContextSetupResponse */
|
||||||
|
sendbuf = test_s1ap_build_initial_context_setup_response(test_ue);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Send Attach Complete + Activate default EPS bearer cotext accept */
|
||||||
|
test_ue->nr_cgi.cell_id = 0x1234502;
|
||||||
|
bearer = test_bearer_find_by_ue_ebi(test_ue, 5);
|
||||||
|
ogs_assert(bearer);
|
||||||
|
esmbuf = testesm_build_activate_default_eps_bearer_context_accept(
|
||||||
|
bearer, false);
|
||||||
|
ABTS_PTR_NOTNULL(tc, esmbuf);
|
||||||
|
emmbuf = testemm_build_attach_complete(test_ue, esmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, emmbuf);
|
||||||
|
sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, emmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive EMM information */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
|
||||||
|
/* Send GTP-U ICMP Packet */
|
||||||
|
rv = test_gtpu_send_ping(gtpu, bearer, TEST_PING_IPV4);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive GTP-U ICMP Packet */
|
||||||
|
recvbuf = test_gtpu_read(gtpu);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
ogs_pkbuf_free(recvbuf);
|
||||||
|
|
||||||
|
/* Send PDN Connectivity Request */
|
||||||
|
sess = test_sess_add_by_apn(test_ue, "ims", OGS_GTP2_RAT_TYPE_EUTRAN);
|
||||||
|
ogs_assert(sess);
|
||||||
|
sess->pti = 5;
|
||||||
|
|
||||||
|
sess->pdn_connectivity_param.apn = 1;
|
||||||
|
sess->pdn_connectivity_param.pco = 1;
|
||||||
|
sess->pdn_connectivity_param.request_type =
|
||||||
|
OGS_NAS_EPS_REQUEST_TYPE_INITIAL;
|
||||||
|
esmbuf = testesm_build_pdn_connectivity_request(sess, true);
|
||||||
|
ABTS_PTR_NOTNULL(tc, esmbuf);
|
||||||
|
sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, esmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive E-RABSetupRequest +
|
||||||
|
* Activate default EPS bearer context request */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
ABTS_INT_EQUAL(tc,
|
||||||
|
S1AP_ProcedureCode_id_E_RABSetup,
|
||||||
|
test_ue->s1ap_procedure_code);
|
||||||
|
|
||||||
|
/* Send E-RABSetupResponse */
|
||||||
|
bearer = test_bearer_find_by_ue_ebi(test_ue, 6);
|
||||||
|
ogs_assert(bearer);
|
||||||
|
sendbuf = test_s1ap_build_e_rab_setup_response(bearer);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Send Activate default EPS bearer context accept */
|
||||||
|
esmbuf = testesm_build_activate_default_eps_bearer_context_accept(
|
||||||
|
bearer, true);
|
||||||
|
ABTS_PTR_NOTNULL(tc, esmbuf);
|
||||||
|
sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, esmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Send GTP-U ICMP Packet */
|
||||||
|
rv = test_gtpu_send_ping(gtpu, bearer, TEST_PING_IPV4);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive GTP-U ICMP Packet */
|
||||||
|
recvbuf = test_gtpu_read(gtpu);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
ogs_pkbuf_free(recvbuf);
|
||||||
|
|
||||||
|
/* Send AA-Request */
|
||||||
|
test_rx_send_aar_audio(&rx_sid, sess,
|
||||||
|
OGS_DIAM_RX_SUBSCRIPTION_ID_TYPE_END_USER_IMSI, 1, 1);
|
||||||
|
|
||||||
|
/* Receive E-RABSetupRequest +
|
||||||
|
* Activate dedicated EPS bearer context request */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
ABTS_INT_EQUAL(tc,
|
||||||
|
S1AP_ProcedureCode_id_E_RABSetup,
|
||||||
|
test_ue->s1ap_procedure_code);
|
||||||
|
|
||||||
|
/* Send E-RABSetupResponse */
|
||||||
|
bearer = test_bearer_find_by_ue_ebi(test_ue, 7);
|
||||||
|
ogs_assert(bearer);
|
||||||
|
sendbuf = test_s1ap_build_e_rab_setup_response(bearer);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Send Session-Termination-Request */
|
||||||
|
test_rx_send_str(rx_sid);
|
||||||
|
|
||||||
|
ogs_msleep(100);
|
||||||
|
|
||||||
|
/* Send Activate dedicated EPS bearer context accept */
|
||||||
|
esmbuf = testesm_build_activate_dedicated_eps_bearer_context_accept(bearer);
|
||||||
|
ABTS_PTR_NOTNULL(tc, esmbuf);
|
||||||
|
sendbuf = test_s1ap_build_uplink_nas_transport(test_ue, esmbuf);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Send Detach Request */
|
||||||
|
emmbuf = testemm_build_detach_request(test_ue, 1, true, false);
|
||||||
|
ABTS_PTR_NOTNULL(tc, emmbuf);
|
||||||
|
sendbuf = test_s1ap_build_initial_ue_message(
|
||||||
|
test_ue, emmbuf, S1AP_RRC_Establishment_Cause_mo_Signalling, true);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
/* Receive OLD UEContextReleaseCommand */
|
||||||
|
enb_ue_s1ap_id = test_ue->enb_ue_s1ap_id;
|
||||||
|
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
|
||||||
|
/* Send OLD UEContextReleaseComplete */
|
||||||
|
sendbuf = test_s1ap_build_ue_context_release_complete(test_ue);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
test_ue->enb_ue_s1ap_id = enb_ue_s1ap_id;
|
||||||
|
|
||||||
|
/* Receive UEContextReleaseCommand */
|
||||||
|
recvbuf = testenb_s1ap_read(s1ap);
|
||||||
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
|
tests1ap_recv(test_ue, recvbuf);
|
||||||
|
|
||||||
|
/* Send UEContextReleaseComplete */
|
||||||
|
sendbuf = test_s1ap_build_ue_context_release_complete(test_ue);
|
||||||
|
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||||
|
rv = testenb_s1ap_send(s1ap, sendbuf);
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
|
ogs_msleep(300);
|
||||||
|
|
||||||
|
/********** Remove Subscriber in Database */
|
||||||
|
ABTS_INT_EQUAL(tc, OGS_OK, test_db_remove_ue(test_ue));
|
||||||
|
|
||||||
|
/* eNB disonncect from MME */
|
||||||
|
testenb_s1ap_close(s1ap);
|
||||||
|
|
||||||
|
/* eNB disonncect from SGW */
|
||||||
|
test_gtpu_close(gtpu);
|
||||||
|
|
||||||
|
test_ue_remove(test_ue);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
abts_suite *test_rx(abts_suite *suite)
|
abts_suite *test_rx(abts_suite *suite)
|
||||||
{
|
{
|
||||||
suite = ADD_SUITE(suite)
|
suite = ADD_SUITE(suite)
|
||||||
|
@ -3079,6 +3402,9 @@ abts_suite *test_rx(abts_suite *suite)
|
||||||
abts_run_test(suite, test5_func, NULL);
|
abts_run_test(suite, test5_func, NULL);
|
||||||
abts_run_test(suite, test6_func, NULL);
|
abts_run_test(suite, test6_func, NULL);
|
||||||
abts_run_test(suite, test7_func, NULL);
|
abts_run_test(suite, test7_func, NULL);
|
||||||
|
#if 0 /* disable this issues3109 test because of a lot of ERROR messages. */
|
||||||
|
abts_run_test(suite, test_issues3109_func, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue