[AMF] Registation status update and tests

This commit is contained in:
Matej Gradisar 2024-05-09 13:13:41 +02:00 committed by Sukchan Lee
parent 5cf92c9851
commit 8c293bc710
49 changed files with 3823 additions and 169 deletions

View file

@ -39,6 +39,7 @@ example_conf = '''
slice.yaml
srsenb.yaml
non3gpp.yaml
transfer.yaml
'''.split()
foreach file : example_conf

View file

@ -189,50 +189,6 @@ amf:
t3512:
value: 540 # 9 mintues * 60 = 540 seconds
# amf #2
amf:
sbi:
server:
- address: 127.0.0.50
port: 7777
client:
scp:
- uri: http://127.0.0.200:7777
ngap:
server:
- address: 127.0.0.50
metrics:
server:
- address: 127.0.0.50
port: 9090
guami:
- plmn_id:
mcc: 999
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 999
mnc: 70
tac: 1
plmn_support:
- plmn_id:
mcc: 999
mnc: 70
s_nssai:
- sst: 1
security:
integrity_order : [ NIA2, NIA1, NIA0 ]
ciphering_order : [ NEA0, NEA1, NEA2 ]
network_name:
full: Open5GS
amf_name: open5gs-amf1
time:
t3512:
value: 540 # 9 mintues * 60 = 540 seconds
sgwu:
pfcp:
server:

View file

@ -28,6 +28,70 @@ global:
no_pcrf: true
no_hss: true
mme:
freeDiameter:
identity: mme.localdomain
realm: localdomain
listen_on: 127.0.0.2
no_fwd: true
load_extension:
- module: @build_subprojects_freeDiameter_extensions_dir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_rfc5777.fdx
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_mip6i.fdx
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nasreq.fdx
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_nas_mipv6.fdx
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca.fdx
- module: @build_subprojects_freeDiameter_extensions_dir@/dict_dcca_3gpp/dict_dcca_3gpp.fdx
connect:
- identity: hss.localdomain
address: 127.0.0.8
s1ap:
server:
- address: 127.0.0.2
gtpc:
server:
- address: 127.0.0.2
client:
sgwc:
- address: 127.0.0.3
smf:
- address: 127.0.0.4
metrics:
server:
- address: 127.0.0.2
port: 9090
gummei:
- plmn_id:
mcc: 999
mnc: 70
mme_gid: 2
mme_code: 1
tai:
- plmn_id:
mcc: 999
mnc: 70
tac: 1
security:
integrity_order : [ EIA2, EIA1, EIA0 ]
ciphering_order : [ EEA0, EEA1, EEA2 ]
network_name:
full: Open5GS
time:
t3412:
value: 540
sgwc:
gtpc:
server:
- address: 127.0.0.3
pfcp:
server:
- address: 127.0.0.3
client:
sgwu:
- address: 127.0.0.6
smf:
sbi:

View file

@ -41,6 +41,7 @@ extern "C" {
#endif
int app_initialize(const char *const argv[]);
int app_initialize_transfer(const char *const argv[]);
void app_terminate(void);
int mme_initialize(void);

View file

@ -193,6 +193,10 @@ void ogs_sbi_message_free(ogs_sbi_message_t *message)
OpenAPI_ue_context_transfer_req_data_free(message->UeContextTransferReqData);
if (message->UeContextTransferRspData)
OpenAPI_ue_context_transfer_rsp_data_free(message->UeContextTransferRspData);
if (message->UeRegStatusUpdateReqData)
OpenAPI_ue_reg_status_update_req_data_free(message->UeRegStatusUpdateReqData);
if (message->UeRegStatusUpdateRspData)
OpenAPI_ue_reg_status_update_rsp_data_free(message->UeRegStatusUpdateRspData);
/* HTTP Part */
for (i = 0; i < message->num_of_part; i++) {
@ -1372,6 +1376,14 @@ static char *build_json(ogs_sbi_message_t *message)
item = OpenAPI_ue_context_transfer_rsp_data_convertToJSON(
message->UeContextTransferRspData);
ogs_assert(item);
} else if (message->UeRegStatusUpdateReqData) {
item = OpenAPI_ue_reg_status_update_req_data_convertToJSON(
message->UeRegStatusUpdateReqData);
ogs_assert(item);
} else if (message->UeRegStatusUpdateRspData) {
item = OpenAPI_ue_reg_status_update_rsp_data_convertToJSON(
message->UeRegStatusUpdateRspData);
ogs_assert(item);
}
if (item) {
@ -2135,6 +2147,27 @@ static int parse_json(ogs_sbi_message_t *message,
}
break;
CASE(OGS_SBI_RESOURCE_NAME_TRANSFER_UPDATE)
if (message->res_status == 0) {
message->UeRegStatusUpdateReqData =
OpenAPI_ue_reg_status_update_req_data_parseFromJSON(item);
if (!message->UeRegStatusUpdateReqData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else if (message->res_status == OGS_SBI_HTTP_STATUS_OK) {
message->UeRegStatusUpdateRspData =
OpenAPI_ue_reg_status_update_rsp_data_parseFromJSON(item);
if (!message->UeRegStatusUpdateRspData) {
rv = OGS_ERROR;
ogs_error("JSON parse error");
}
} else {
ogs_error("HTTP ERROR Status : %d",
message->res_status);
}
break;
DEFAULT
rv = OGS_ERROR;
ogs_error("Unknown resource name [%s]",

View file

@ -125,6 +125,7 @@ extern "C" {
#define OGS_SBI_RESOURCE_NAME_UE_CONTEXTS "ue-contexts"
#define OGS_SBI_RESOURCE_NAME_N1_N2_MESSAGES "n1-n2-messages"
#define OGS_SBI_RESOURCE_NAME_TRANSFER "transfer"
#define OGS_SBI_RESOURCE_NAME_TRANSFER_UPDATE "transfer-update"
#define OGS_SBI_RESOURCE_NAME_SM_CONTEXT_STATUS "sm-context-status"
#define OGS_SBI_RESOURCE_NAME_AM_POLICY_NOTIFY "am-policy-notify"
@ -558,6 +559,8 @@ typedef struct ogs_sbi_message_s {
OpenAPI_sec_negotiate_rsp_data_t *SecNegotiateRspData;
OpenAPI_ue_context_transfer_req_data_t *UeContextTransferReqData;
OpenAPI_ue_context_transfer_rsp_data_t *UeContextTransferRspData;
OpenAPI_ue_reg_status_update_req_data_t *UeRegStatusUpdateReqData;
OpenAPI_ue_reg_status_update_rsp_data_t *UeRegStatusUpdateRspData;
ogs_sbi_links_t *links;

View file

@ -86,6 +86,8 @@
#include "model/ue_authentication_ctx.h"
#include "model/ue_context_transfer_req_data.h"
#include "model/ue_context_transfer_rsp_data.h"
#include "model/ue_reg_status_update_req_data.h"
#include "model/ue_reg_status_update_rsp_data.h"
#include "custom/links.h"

View file

@ -209,6 +209,23 @@ void amf_state_operational(ogs_fsm_t *s, amf_event_t *e)
END
break;
CASE(OGS_SBI_RESOURCE_NAME_TRANSFER_UPDATE)
SWITCH(sbi_message.h.method)
CASE(OGS_SBI_HTTP_METHOD_POST)
amf_namf_comm_handle_registration_status_update_request(
stream, &sbi_message);
break;
DEFAULT
ogs_error("Invalid HTTP method [%s]",
sbi_message.h.method);
ogs_assert(true ==
ogs_sbi_server_send_error(stream,
OGS_SBI_HTTP_STATUS_FORBIDDEN, &sbi_message,
"Invalid HTTP method", sbi_message.h.method,
NULL));
END
break;
DEFAULT
ogs_error("Invalid resource name [%s]",
sbi_message.h.resource.component[2]);

View file

@ -1511,7 +1511,7 @@ void amf_ue_confirm_guti(amf_ue_t *amf_ue)
* by performing the generic UE configuration update procedure.
*/
/* Copying from Current to Next Guti */
/* Copying from Next to Current Guti */
amf_ue->current.m_tmsi = amf_ue->next.m_tmsi;
memcpy(&amf_ue->current.guti,
&amf_ue->next.guti, sizeof(ogs_nas_5gs_guti_t));
@ -1624,6 +1624,7 @@ amf_ue_t *amf_ue_add(ran_ue_t *ran_ue)
OGS_SBI_NPCF_AM_POLICY_CONTROL_UE_AMBR_AUTHORIZATION);
amf_ue->rat_restrictions = OpenAPI_list_create();
amf_ue->to_release_session_list = OpenAPI_list_create();
ogs_list_init(&amf_ue->sess_list);
@ -1663,6 +1664,7 @@ void amf_ue_remove(amf_ue_t *amf_ue)
AMF_UE_CLEAR_5GSM_MESSAGE(amf_ue);
OpenAPI_list_free(amf_ue->rat_restrictions);
OpenAPI_list_free(amf_ue->to_release_session_list);
/* Remove all session context */
amf_sess_remove_all(amf_ue);
@ -3024,3 +3026,34 @@ bool amf_ue_is_rat_restricted(amf_ue_t *amf_ue)
}
return false;
}
void amf_ue_save_to_release_session_list(amf_ue_t *amf_ue)
{
amf_sess_t *sess = NULL;
OpenAPI_list_clear(amf_ue->to_release_session_list);
ogs_list_for_each(&amf_ue->sess_list, sess) {
bool supported_s_nssai = false;
int i;
for (i = 0; i < amf_self()->num_of_plmn_support; i++) {
int j;
for (j = 0; j < amf_self()->plmn_support[i].num_of_s_nssai; j++) {
if (memcmp(&sess->s_nssai,
&amf_self()->plmn_support[i].s_nssai[j],
sizeof(ogs_s_nssai_t)) == 0) {
supported_s_nssai = true;
break;
}
}
if (supported_s_nssai)
break;
}
if (!supported_s_nssai) {
double *psi = ogs_calloc(1, sizeof(*psi));
ogs_assert(psi);
*psi = (double)sess->psi;
OpenAPI_list_add(amf_ue->to_release_session_list, psi);
}
}
}

View file

@ -259,6 +259,8 @@ struct amf_ue_s {
/* UE identity */
#define AMF_UE_HAVE_SUCI(__aMF) \
((__aMF) && ((__aMF)->suci))
#define AMF_UE_HAVE_SUPI(__aMF) \
((__aMF) && ((__aMF)->supi))
char *suci; /* TS33.501 : SUCI */
char *supi; /* TS33.501 : SUPI */
ogs_nas_5gs_mobile_identity_suci_t nas_mobile_identity_suci;
@ -280,7 +282,11 @@ struct amf_ue_s {
ogs_nas_5gs_guti_t guti;
} current, next;
/* UE context transfer and Registration status update */
ogs_nas_5gs_guti_t old_guti;
OpenAPI_ue_context_transfer_status_e transfer_status;
bool send_registration_status_update;
OpenAPI_list_t *to_release_session_list;
/* UE Info */
ogs_guami_t *guami;
@ -996,6 +1002,7 @@ void amf_clear_subscribed_info(amf_ue_t *amf_ue);
bool amf_update_allowed_nssai(amf_ue_t *amf_ue);
bool amf_ue_is_rat_restricted(amf_ue_t *amf_ue);
int amf_instance_get_load(void);
void amf_ue_save_to_release_session_list(amf_ue_t *amf_ue);
#ifdef __cplusplus
}

View file

@ -554,6 +554,10 @@ bool gmm_registration_request_from_old_amf(amf_ue_t *amf_ue,
ogs_assert(amf_ue);
ogs_assert(registration_request);
if (&registration_request->mobile_identity == NULL)
return false;
mobile_identity = &registration_request->mobile_identity;
mobile_identity_header =
(ogs_nas_5gs_mobile_identity_header_t *)mobile_identity->buffer;
@ -1648,3 +1652,11 @@ static uint8_t gmm_cause_from_access_control(ogs_plmn_id_t *plmn_id)
return OGS_5GMM_CAUSE_PLMN_NOT_ALLOWED;
}
int amf_namf_comm_handle_registration_status_update_response(
ogs_sbi_message_t *recvmsg, amf_ue_t *amf_ue) {
/* Nothing to do */
return OGS_OK;
}

View file

@ -563,14 +563,13 @@ void gmm_state_de_registered(ogs_fsm_t *s, amf_event_t *e)
amf_ue->suci, sbi_message->res_status);
}
if (r != OGS_OK) {
if (!AMF_UE_HAVE_SUCI(amf_ue)) {
CLEAR_AMF_UE_TIMER(amf_ue->t3570);
r = nas_5gs_send_identity_request(amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
break;
}
if (!(AMF_UE_HAVE_SUCI(amf_ue) ||
AMF_UE_HAVE_SUPI(amf_ue))) {
CLEAR_AMF_UE_TIMER(amf_ue->t3570);
r = nas_5gs_send_identity_request(amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
break;
}
xact_count = amf_sess_xact_count(amf_ue);
@ -1251,6 +1250,7 @@ static void common_register_state(ogs_fsm_t *s, amf_event_t *e,
if (gmm_registration_request_from_old_amf(amf_ue,
&nas_message->gmm.registration_request) == true) {
/* Send UE context transfer to old AMF */
ogs_sbi_discovery_option_t *discovery_option = NULL;
ogs_guami_t guami;
@ -1274,6 +1274,7 @@ static void common_register_state(ogs_fsm_t *s, amf_event_t *e,
amf_ue, state, nas_message);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
amf_ue->send_registration_status_update = true;
break;
}
@ -1918,6 +1919,7 @@ void gmm_state_security_mode(ogs_fsm_t *s, amf_event_t *e)
ran_ue_t *ran_ue = NULL;
ogs_nas_5gs_message_t *nas_message = NULL;
ogs_nas_security_header_type_t h;
ogs_sbi_message_t *sbi_message = NULL;
ogs_assert(s);
ogs_assert(e);
@ -1998,6 +2000,38 @@ void gmm_state_security_mode(ogs_fsm_t *s, amf_event_t *e)
break;
}
if (amf_ue->send_registration_status_update == true) {
/*
* UE context transfer message has been sent
* to old AMF after Registration request.
* Now Registrations status update needs to be sent.
*/
ogs_sbi_discovery_option_t *discovery_option = NULL;
ogs_guami_t guami;
int state = e->h.sbi.state;
discovery_option = ogs_sbi_discovery_option_new();
ogs_assert(discovery_option);
memcpy(&guami.plmn_id, &amf_ue->home_plmn_id,
sizeof(ogs_plmn_id_t));
memcpy(&guami.amf_id, &amf_ue->old_guti.amf_id,
sizeof(ogs_amf_id_t));
ogs_sbi_discovery_option_set_guami(discovery_option, &guami);
amf_ue->transfer_status =
OpenAPI_ue_context_transfer_status_TRANSFERRED;
r = amf_ue_sbi_discover_and_send(
OGS_SBI_SERVICE_TYPE_NAMF_COMM, discovery_option,
amf_namf_comm_build_registration_status_update,
amf_ue, state, NULL);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
amf_ue->send_registration_status_update = false;
break;
}
ogs_kdf_kgnb_and_kn3iwf(
amf_ue->kamf, amf_ue->ul_count.i32,
amf_ue->nas.access_type, amf_ue->kgnb);
@ -2078,6 +2112,68 @@ void gmm_state_security_mode(ogs_fsm_t *s, amf_event_t *e)
break;
}
break;
case OGS_EVENT_SBI_CLIENT:
sbi_message = e->h.sbi.message;
ogs_assert(sbi_message);
SWITCH(sbi_message->h.service.name)
CASE(OGS_SBI_SERVICE_NAME_NAMF_COMM)
SWITCH(sbi_message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXTS)
SWITCH(sbi_message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_TRANSFER_UPDATE)
if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
ogs_error("[%s] HTTP response error [%d]",
amf_ue->supi, sbi_message->res_status);
}
r = amf_namf_comm_handle_registration_status_update_response(sbi_message, amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
/* Continue with registration */
ogs_kdf_kgnb_and_kn3iwf(
amf_ue->kamf, amf_ue->ul_count.i32,
amf_ue->nas.access_type, amf_ue->kgnb);
ogs_kdf_nh_gnb(amf_ue->kamf, amf_ue->kgnb, amf_ue->nh);
amf_ue->nhcc = 1;
r = amf_ue_sbi_discover_and_send(
OGS_SBI_SERVICE_TYPE_NUDM_UECM, NULL,
amf_nudm_uecm_build_registration, amf_ue, 0, NULL);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
if (amf_ue->nas.message_type == OGS_NAS_5GS_REGISTRATION_REQUEST) {
OGS_FSM_TRAN(s, &gmm_state_initial_context_setup);
} else if (amf_ue->nas.message_type ==
OGS_NAS_5GS_SERVICE_REQUEST) {
OGS_FSM_TRAN(s, &gmm_state_registered);
} else {
ogs_fatal("Invalid OGS_NAS_5GS[%d]", amf_ue->nas.message_type);
ogs_assert_if_reached();
}
break;
DEFAULT
ogs_error("Invalid resource name [%s]",
sbi_message->h.resource.component[2]);
ogs_assert_if_reached();
END
break;
DEFAULT
ogs_error("Invalid resource name [%s]",
sbi_message->h.resource.component[0]);
ogs_assert_if_reached();
END
break;
DEFAULT
ogs_error("Invalid service name [%s]", sbi_message->h.service.name);
ogs_assert_if_reached();
END
break;
case AMF_EVENT_5GMM_TIMER:
switch (e->h.timer_id) {
case AMF_TIMER_T3560:
@ -2508,6 +2604,7 @@ void gmm_state_exception(ogs_fsm_t *s, amf_event_t *e)
ran_ue_t *ran_ue = NULL;
ogs_nas_5gs_message_t *nas_message = NULL;
ogs_nas_security_header_type_t h;
ogs_sbi_message_t *sbi_message = NULL;
ogs_assert(s);
ogs_assert(e);
@ -2530,6 +2627,38 @@ void gmm_state_exception(ogs_fsm_t *s, amf_event_t *e)
AMF_UE_CLEAR_5GSM_MESSAGE(amf_ue);
CLEAR_AMF_UE_ALL_TIMERS(amf_ue);
if (amf_ue->send_registration_status_update == true) {
/*
* UE context transfer message has been sent
* to old AMF after Registration request.
* Now Registrations status update needs to be sent.
*/
ogs_sbi_discovery_option_t *discovery_option = NULL;
ogs_guami_t guami;
int state = e->h.sbi.state;
discovery_option = ogs_sbi_discovery_option_new();
ogs_assert(discovery_option);
memcpy(&guami.plmn_id, &amf_ue->home_plmn_id,
sizeof(ogs_plmn_id_t));
memcpy(&guami.amf_id, &amf_ue->old_guti.amf_id,
sizeof(ogs_amf_id_t));
ogs_sbi_discovery_option_set_guami(discovery_option, &guami);
amf_ue->transfer_status =
OpenAPI_ue_context_transfer_status_NOT_TRANSFERRED;
r = amf_ue_sbi_discover_and_send(
OGS_SBI_SERVICE_TYPE_NAMF_COMM, discovery_option,
amf_namf_comm_build_registration_status_update,
amf_ue, state, NULL);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
amf_ue->send_registration_status_update = false;
break;
}
xact_count = amf_sess_xact_count(amf_ue);
amf_sbi_send_release_all_sessions(
@ -2667,6 +2796,63 @@ void gmm_state_exception(ogs_fsm_t *s, amf_event_t *e)
ogs_error("Unknown message [%d]", nas_message->gmm.h.message_type);
}
break;
case OGS_EVENT_SBI_CLIENT:
sbi_message = e->h.sbi.message;
ogs_assert(sbi_message);
ran_ue_t *ran_ue = ran_ue_find_by_id(amf_ue->ran_ue_id);
ogs_assert(ran_ue);
SWITCH(sbi_message->h.service.name)
CASE(OGS_SBI_SERVICE_NAME_NAMF_COMM)
SWITCH(sbi_message->h.resource.component[0])
CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXTS)
SWITCH(sbi_message->h.resource.component[2])
CASE(OGS_SBI_RESOURCE_NAME_TRANSFER_UPDATE)
if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) {
ogs_error("[%s] HTTP response error [%d]",
amf_ue->supi, sbi_message->res_status);
}
r = amf_namf_comm_handle_registration_status_update_response(sbi_message, amf_ue);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
/* Continue with release command */
xact_count = amf_sess_xact_count(amf_ue);
amf_sbi_send_release_all_sessions(
ran_ue, amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE);
if (!AMF_SESSION_RELEASE_PENDING(amf_ue) &&
amf_sess_xact_count(amf_ue) == xact_count) {
r = ngap_send_ran_ue_context_release_command(
ran_ue_find_by_id(amf_ue->ran_ue_id),
NGAP_Cause_PR_nas, NGAP_CauseNas_normal_release,
NGAP_UE_CTX_REL_UE_CONTEXT_REMOVE, 0);
ogs_expect(r == OGS_OK);
ogs_assert(r != OGS_ERROR);
}
break;
DEFAULT
ogs_error("Invalid resource name [%s]",
sbi_message->h.resource.component[2]);
ogs_assert_if_reached();
END
break;
DEFAULT
ogs_error("Invalid resource name [%s]",
sbi_message->h.resource.component[0]);
ogs_assert_if_reached();
END
break;
DEFAULT
ogs_error("Invalid service name [%s]", sbi_message->h.service.name);
ogs_assert_if_reached();
END
break;
default:
ogs_error("Unknown event[%s]", amf_event_get_name(e));

View file

@ -31,7 +31,6 @@ static char* ogs_guti_to_string(ogs_nas_5gs_guti_t *nas_guti)
memset(&plmn_id, 0, sizeof(plmn_id));
ogs_nas_to_plmn_id(&plmn_id, &nas_guti->nas_plmn_id);
amf_id = ogs_amf_id_to_string(&nas_guti->amf_id);
tmsi = ogs_uint32_to_0string(nas_guti->m_tmsi);
@ -98,3 +97,56 @@ ogs_sbi_request_t *amf_namf_comm_build_ue_context_transfer(
return request;
}
ogs_sbi_request_t *amf_namf_comm_build_registration_status_update(
amf_ue_t *amf_ue, void *data)
{
ogs_sbi_message_t message;
ogs_sbi_request_t *request = NULL;
OpenAPI_ue_reg_status_update_req_data_t UeRegStatusUpdateReqData;
char *ue_context_id = NULL;
ogs_assert(amf_ue);
ue_context_id = ogs_guti_to_string(&amf_ue->old_guti);
ogs_assert(ue_context_id);
memset(&message, 0, sizeof(message));
message.h.method = (char *)OGS_SBI_HTTP_METHOD_POST;
message.h.service.name = (char *)OGS_SBI_SERVICE_NAME_NAMF_COMM;
message.h.api.version = (char *)OGS_SBI_API_V1;
message.h.resource.component[0] =
(char *)OGS_SBI_RESOURCE_NAME_UE_CONTEXTS;
message.h.resource.component[1] = ue_context_id;
message.h.resource.component[2] =
(char *)OGS_SBI_RESOURCE_NAME_TRANSFER_UPDATE;
message.UeRegStatusUpdateReqData = &UeRegStatusUpdateReqData;
memset(&UeRegStatusUpdateReqData, 0, sizeof(UeRegStatusUpdateReqData));
UeRegStatusUpdateReqData.transfer_status = amf_ue->transfer_status;
/*
* TS 29.518
* 5.2.2.2.2 Registration Status Update
* If any network slice(s) become no longer available and there are PDU
* Session(s) associated with them, the target AMF shall include these
* PDU session(s) in the toReleaseSessionList attribute in the payload.
*/
if (amf_ue->transfer_status ==
OpenAPI_ue_context_transfer_status_TRANSFERRED &&
amf_ue->to_release_session_list->count) {
UeRegStatusUpdateReqData.to_release_session_list =
amf_ue->to_release_session_list;
}
request = ogs_sbi_build_request(&message);
ogs_expect(request);
if (ue_context_id)
ogs_free(ue_context_id);
OpenAPI_list_clear(amf_ue->to_release_session_list);
return request;
}

View file

@ -28,6 +28,8 @@ extern "C" {
ogs_sbi_request_t *amf_namf_comm_build_ue_context_transfer(
amf_ue_t *amf_ue, void *data);
ogs_sbi_request_t *amf_namf_comm_build_registration_status_update(
amf_ue_t *amf_ue, void *data);
#ifdef __cplusplus
}

View file

@ -1093,7 +1093,6 @@ int amf_namf_comm_handle_ue_context_transfer_request(
ogs_sbi_response_t *response = NULL;
ogs_sbi_message_t sendmsg;
amf_ue_t *amf_ue = NULL;
ran_ue_t *ran_ue = NULL;
OpenAPI_ambr_t *UeAmbr = NULL;
OpenAPI_list_t *MmContextList = NULL;
@ -1137,7 +1136,7 @@ int amf_namf_comm_handle_ue_context_transfer_request(
amf_ue = amf_ue_find_by_ue_context_id(ue_context_id);
if (!amf_ue) {
status = OGS_SBI_HTTP_STATUS_NOT_FOUND;
strerror = ogs_msprintf("CONTEXT_NOT_FOUND");
strerror = ogs_msprintf("Context not found");
goto cleanup;
}
@ -1212,7 +1211,11 @@ int amf_namf_comm_handle_ue_context_transfer_request(
if (recvmsg->UeContextTransferReqData->reason ==
OpenAPI_transfer_reason_MOBI_REG) {
SessionContextList =
amf_namf_comm_encode_ue_session_context_list(amf_ue);
amf_namf_comm_encode_ue_session_context_list(amf_ue);
if (SessionContextList->count == 0) {
OpenAPI_list_free(SessionContextList);
SessionContextList = NULL;
}
UeContext.session_context_list = SessionContextList;
}
@ -1245,13 +1248,19 @@ int amf_namf_comm_handle_ue_context_transfer_request(
}
/*
* Context TRANSFERRED !!!
* So, we removed UE context.
* Ue context is transfered, but we must keep the UE context until the
* registartion status update is received.
*
* TS 23.502
* 4.2.2.2.2 General Registration
*
* 10. [Conditional] new AMF to old AMF: Namf_Communication_RegistrationStatusUpdate
* (PDU Session ID(s) to be released due to slice not supported).
* If the authentication/security procedure fails, then the Registration shall be
* rejected and the new AMF invokes the Namf_Communication_RegistrationStatusUpdate
* service operation with a reject indication towards the old AMF. The old AMF continues
* as if the UE context transfer service operation was never received.
*/
ran_ue = ran_ue_find_by_id(amf_ue->ran_ue_id);
if (ran_ue)
ran_ue_remove(ran_ue);
amf_ue_remove(amf_ue);
return OGS_OK;
@ -1352,10 +1361,13 @@ int amf_namf_comm_handle_ue_context_transfer_response(
amf_namf_comm_decode_ue_mm_context_list(
amf_ue, UeContext->mm_context_list);
if (UeContext->session_context_list)
if (UeContext->session_context_list) {
amf_namf_comm_decode_ue_session_context_list(
amf_ue, UeContext->session_context_list);
/* Save a list of sessions to be released on old AMF */
if (UeContext->mm_context_list)
amf_ue_save_to_release_session_list(amf_ue);
}
/* TODO ueRadioCapability */
return OGS_OK;
@ -1802,3 +1814,118 @@ static void amf_namf_comm_decode_ue_session_context_list(
ogs_sbi_header_free(&header);
}
}
int amf_namf_comm_handle_registration_status_update_request(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg) {
ogs_sbi_response_t *response = NULL;
ogs_sbi_message_t sendmsg;
amf_ue_t *amf_ue = NULL;
ran_ue_t *ran_ue = NULL;
amf_sess_t *sess = NULL;
OpenAPI_ue_reg_status_update_req_data_t *UeRegStatusUpdateReqData =
recvmsg->UeRegStatusUpdateReqData;
OpenAPI_ue_reg_status_update_rsp_data_t UeRegStatusUpdateRspData;
int status = 0;
char *strerror = NULL;
char *ue_context_id = NULL;
ogs_assert(stream);
ogs_assert(recvmsg);
ue_context_id = recvmsg->h.resource.component[1];
if (!ue_context_id) {
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
strerror = ogs_msprintf("No UE context ID");
goto cleanup;
}
amf_ue = amf_ue_find_by_ue_context_id(ue_context_id);
if (!amf_ue) {
status = OGS_SBI_HTTP_STATUS_NOT_FOUND;
strerror = ogs_msprintf("Context not found");
goto cleanup;
}
memset(&UeRegStatusUpdateRspData, 0, sizeof(UeRegStatusUpdateRspData));
memset(&sendmsg, 0, sizeof(sendmsg));
sendmsg.UeRegStatusUpdateRspData = &UeRegStatusUpdateRspData;
if (UeRegStatusUpdateReqData->transfer_status ==
OpenAPI_ue_context_transfer_status_TRANSFERRED) {
/*
* TS 29.518
* 5.2.2.2.2 Registration Status Update
* Once the update is received, the source AMF shall:
* - remove the individual ueContext resource and release any PDU session(s) in the
* toReleaseSessionList attribute, if the transferStatus attribute included in the
* POST request body is set to "TRANSFERRED" and if the source AMF transferred the
* complete UE Context including all MM contexts and PDU Session Contexts.
*/
UeRegStatusUpdateRspData.reg_status_transfer_complete = 1;
ran_ue = ran_ue_find_by_id(amf_ue->ran_ue_id);
if (ran_ue) {
if (UeRegStatusUpdateReqData->to_release_session_list) {
OpenAPI_lnode_t *node = NULL;
OpenAPI_list_for_each(UeRegStatusUpdateReqData->to_release_session_list, node) {
/* A double must be read */
uint8_t psi = *(double *)node->data;
sess = amf_sess_find_by_psi(amf_ue, psi);
if (SESSION_CONTEXT_IN_SMF(sess)) {
amf_sbi_send_release_session(ran_ue, sess, AMF_RELEASE_SM_CONTEXT_NO_STATE);
} else {
ogs_error("[%s] No Session Context PSI[%d]",
amf_ue->supi, psi);
UeRegStatusUpdateRspData.reg_status_transfer_complete = 0;
}
}
}
}
/* Clear UE context */
CLEAR_NG_CONTEXT(amf_ue);
AMF_UE_CLEAR_PAGING_INFO(amf_ue);
AMF_UE_CLEAR_N2_TRANSFER(amf_ue, pdu_session_resource_setup_request);
AMF_UE_CLEAR_5GSM_MESSAGE(amf_ue);
CLEAR_AMF_UE_ALL_TIMERS(amf_ue);
OGS_ASN_CLEAR_DATA(&amf_ue->ueRadioCapability);
} else if (UeRegStatusUpdateReqData->transfer_status ==
OpenAPI_ue_context_transfer_status_NOT_TRANSFERRED) {
/*
* TS 23.502
* 4.2.2.2.2
* If the authentication/security procedure fails, then the Registration shall be rejected and
* the new AMF invokes the Namf_Communication_RegistrationStatusUpdate service operation with
* a reject indication towards the old AMF. The old AMF continues as if the UE context transfer
* service operation was never received.
*/
UeRegStatusUpdateRspData.reg_status_transfer_complete = 0;
} else {
status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
strerror = ogs_msprintf("Transfer status not supported: [%d]",
UeRegStatusUpdateReqData->transfer_status);
goto cleanup;
}
status = OGS_SBI_HTTP_STATUS_OK;
response = ogs_sbi_build_response(&sendmsg, status);
ogs_assert(response);
ogs_assert(true == ogs_sbi_server_send_response(stream, response));
return OGS_OK;
cleanup:
ogs_assert(strerror);
ogs_error("%s", strerror);
ogs_assert(true == ogs_sbi_server_send_error(stream, status, NULL, strerror, NULL, NULL));
ogs_free(strerror);
return OGS_ERROR;
}

View file

@ -38,6 +38,10 @@ int amf_namf_comm_handle_ue_context_transfer_request(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
int amf_namf_comm_handle_ue_context_transfer_response(
ogs_sbi_message_t *recvmsg, amf_ue_t *amf_ue);
int amf_namf_comm_handle_registration_status_update_request(
ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg);
int amf_namf_comm_handle_registration_status_update_response(
ogs_sbi_message_t *recvmsg, amf_ue_t *amf_ue);
#ifdef __cplusplus
}

View file

@ -45,6 +45,13 @@ ogs_sbi_request_t *amf_nausf_auth_build_authenticate(
OGS_SBI_CONTENT_PROBLEM_TYPE);
memset(&AuthenticationInfo, 0, sizeof(AuthenticationInfo));
ogs_assert(amf_ue->suci || amf_ue->supi);
if (amf_ue->suci) {
AuthenticationInfo.supi_or_suci = amf_ue->suci;
} else {
AuthenticationInfo.supi_or_suci = amf_ue->supi;
}
if (amf_ue->suci)
AuthenticationInfo.supi_or_suci = amf_ue->suci;

View file

@ -36,6 +36,7 @@ static ogs_thread_t *pcf_thread = NULL;
static ogs_thread_t *nssf_thread = NULL;
static ogs_thread_t *bsf_thread = NULL;
static ogs_thread_t *udr_thread = NULL;
static ogs_thread_t *old_amf_thread = NULL;
int app_initialize(const char *const argv[])
{
@ -103,7 +104,7 @@ int app_initialize(const char *const argv[])
*/
ogs_msleep(5000);
return OGS_OK;;
return OGS_OK;
}
void app_terminate(void)
@ -130,6 +131,8 @@ void app_terminate(void)
if (sepp_thread) ogs_thread_destroy(sepp_thread);
if (scp_thread) ogs_thread_destroy(scp_thread);
if (nrf_thread) ogs_thread_destroy(nrf_thread);
if (old_amf_thread) ogs_thread_destroy(old_amf_thread);
}
void test_app_init(void)

View file

@ -77,7 +77,7 @@ void test_app_run(int argc, const char *const argv[],
ogs_assert(rv == OGS_OK);
}
#define MAX_CHILD_PROCESS 16
#define MAX_CHILD_PROCESS 17
#define OGS_ARG_MAX 256
static ogs_proc_t process[MAX_CHILD_PROCESS];
@ -92,6 +92,12 @@ static void child_main(void *data)
int ret = 0, out_return_code = 0;
current = &process[process_num++];
if (process_num > MAX_CHILD_PROCESS) {
ogs_fatal("Process limit reached");
ogs_assert_if_reached();
}
ret = ogs_proc_create(commandLine,
ogs_proc_option_combined_stdout_stderr|
ogs_proc_option_inherit_environment,
@ -132,6 +138,7 @@ ogs_thread_t *test_child_create(const char *name, const char *const argv[])
commandLine[0] = command;
child = ogs_thread_create(child_main, commandLine);
ogs_msleep(50);
return child;

View file

@ -30,8 +30,11 @@ extern "C" {
void test_app_run(int argc, const char *const argv[],
const char *name, void (*init)(const char * const argv[]));
void test_app_run_transfer(int argc, const char *const argv[],
const char *name, void (*init)(const char * const argv[]));
void test_child_terminate(void);
ogs_thread_t *test_child_create(const char *name, const char *const argv[]);
ogs_thread_t *test_child_create_old_amf(const char *name, const char *const argv[]);
#ifdef __cplusplus
}

View file

@ -104,9 +104,19 @@ static int test_context_validation(void)
if (snode) test_self()->s1ap_addr6 = snode->addr;
snode = ogs_list_first(&test_self()->ngap_list);
if (snode) test_self()->ngap_addr = snode->addr;
if (snode) {
test_self()->ngap_addr = snode->addr;
snode = ogs_list_next(snode);
}
if (snode) test_self()->ngap2_addr = snode->addr;
snode = ogs_list_first(&test_self()->ngap_list6);
if (snode) test_self()->ngap_addr6 = snode->addr;
if (snode) {
test_self()->ngap_addr6 = snode->addr;
snode = ogs_list_next(snode);
}
if (snode) test_self()->ngap2_addr6 = snode->addr;
if (test_self()->e_served_tai[index].list2.num) {
memcpy(&test_self()->e_tai,
@ -175,6 +185,7 @@ int test_context_parse_config(void)
while (ogs_yaml_iter_next(&root_iter)) {
const char *root_key = ogs_yaml_iter_key(&root_iter);
ogs_assert(root_key);
if (!strcmp(root_key, "amf")) {
ogs_yaml_iter_t amf_iter;
ogs_yaml_iter_recurse(&root_iter, &amf_iter);

View file

@ -48,7 +48,9 @@ typedef struct test_context_s {
ogs_list_t ngap_list; /* AMF NGAP IPv4 Server List */
ogs_list_t ngap_list6; /* AMF NGAP IPv6 Server List */
ogs_sockaddr_t *ngap_addr; /* AMF NGAP IPv4 Address */
ogs_sockaddr_t *ngap2_addr; /* OLD AMF NGAP IPv4 Address */
ogs_sockaddr_t *ngap_addr6; /* AMF NGAP IPv6 Address */
ogs_sockaddr_t *ngap2_addr6; /* OLD AMF NGAP IPv6 Address */
uint16_t s1ap_port; /* Default S1AP Port */
ogs_list_t s1ap_list; /* MME S1AP IPv4 Server List */

View file

@ -91,19 +91,30 @@ ogs_socknode_t *tests1ap_client(int family)
return node;
}
ogs_socknode_t *testngap_client(int family)
ogs_socknode_t *testngap_client(int index, int family)
{
int rv;
ogs_sockaddr_t *addr = NULL;
ogs_socknode_t *node = NULL;
ogs_sock_t *sock = NULL;
if (family == AF_INET6)
ogs_assert(OGS_OK ==
ogs_copyaddrinfo(&addr, test_self()->ngap_addr6));
else
ogs_assert(OGS_OK ==
ogs_copyaddrinfo(&addr, test_self()->ngap_addr));
if (index == 1) {
if (family == AF_INET6)
ogs_assert(OGS_OK ==
ogs_copyaddrinfo(&addr, test_self()->ngap_addr6));
else
ogs_assert(OGS_OK ==
ogs_copyaddrinfo(&addr, test_self()->ngap_addr));
} else if (index == 2) {
if (family == AF_INET6)
ogs_assert(OGS_OK ==
ogs_copyaddrinfo(&addr, test_self()->ngap2_addr6));
else
ogs_assert(OGS_OK ==
ogs_copyaddrinfo(&addr, test_self()->ngap2_addr));
} else
ogs_assert_if_reached();
ogs_assert(addr);

View file

@ -29,7 +29,7 @@ extern ogs_sockaddr_t ogs_test_sctp_last_addr;
ogs_socknode_t *testsctp_server(const char *ipstr, int port);
ogs_socknode_t *testsctp_client(const char *ipstr, int port);
ogs_socknode_t *tests1ap_client(int family);
ogs_socknode_t *testngap_client(int family);
ogs_socknode_t *testngap_client(int index, int family);
int testsctp_send(ogs_socknode_t *node, ogs_pkbuf_t *pkbuf,
int ppid, uint16_t stream_no, int type);

View file

@ -70,10 +70,10 @@ static void failure_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* Two gNB connects to AMF */
ngap1 = testngap_client(AF_INET);
ngap1 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap1);
ngap2 = testngap_client(AF_INET);
ngap2 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap2);
/* Two gNB connects to UPF */
@ -501,10 +501,10 @@ static void direct_complete_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* Two gNB connects to AMF */
ngap1 = testngap_client(AF_INET);
ngap1 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap1);
ngap2 = testngap_client(AF_INET);
ngap2 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap2);
/* Two gNB connects to UPF */
@ -1115,10 +1115,10 @@ static void direct_cancel_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* Two gNB connects to AMF */
ngap1 = testngap_client(AF_INET);
ngap1 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap1);
ngap2 = testngap_client(AF_INET);
ngap2 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap2);
/* Two gNB connects to UPF */
@ -1529,10 +1529,10 @@ static void indirect_complete_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* Two gNB connects to AMF */
ngap1 = testngap_client(AF_INET);
ngap1 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap1);
ngap2 = testngap_client(AF_INET);
ngap2 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap2);
/* Two gNB connects to UPF */
@ -2182,10 +2182,10 @@ static void indirect_cancel_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* Two gNB connects to AMF */
ngap1 = testngap_client(AF_INET);
ngap1 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap1);
ngap2 = testngap_client(AF_INET);
ngap2 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap2);
/* Two gNB connects to UPF */

View file

@ -70,10 +70,10 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* Two gNB connects to AMF */
ngap1 = testngap_client(AF_INET);
ngap1 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap1);
ngap2 = testngap_client(AF_INET);
ngap2 = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap2);
/* Two gNB connects to UPF */

View file

@ -33,3 +33,4 @@ subdir('csfb')
subdir('310014')
subdir('handover')
subdir('non3gpp')
subdir('transfer')

View file

@ -64,7 +64,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -254,7 +254,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -426,7 +426,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -787,7 +787,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1045,7 +1045,7 @@ static void test4_issues2842_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1409,7 +1409,7 @@ static void test5_func(abts_case *tc, void *data)
ogs_pkbuf_t *recvbuf;
ogs_ngap_message_t message;
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
sendbuf = testngap_build_ng_setup_request(0x4000, 22);

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -306,7 +306,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -513,7 +513,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -963,7 +963,7 @@ static void test4_func(abts_case *tc, void *data)
ogs_assert(sess);
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1254,7 +1254,7 @@ static void test5_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1630,7 +1630,7 @@ static void test6_issues2917_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -71,7 +71,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -276,7 +276,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -496,7 +496,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -702,7 +702,7 @@ static void test4_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -539,8 +539,8 @@ static void test2_func(abts_case *tc, void *data)
test_ue->k_string = "465b5ce8b199b49faa5f0a2ee238a6bc";
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF(default configuration) */
ngap = testngap_client(AF_INET);
/* gNB connects to AMF */
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -997,7 +997,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1269,7 +1269,7 @@ static void test4_issues2839_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -401,7 +401,7 @@ static void pull_3122_v270_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -456,7 +456,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -699,7 +699,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1052,7 +1052,7 @@ static void test4_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1503,7 +1503,7 @@ static void test5_func(abts_case *tc, void *data)
ogs_assert(sess);
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1857,7 +1857,7 @@ static void test6_func(abts_case *tc, void *data)
ogs_assert(sess);
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -42,7 +42,7 @@ static void test1_func(abts_case *tc, void *data)
bson_t *doc = NULL;
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -372,7 +372,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -632,7 +632,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -221,7 +221,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -534,7 +534,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -977,7 +977,7 @@ static void test4_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1347,7 +1347,7 @@ static void test5_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void cm_idle_paging_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -626,7 +626,7 @@ static void cm_connected_paging_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -980,7 +980,7 @@ static void cm_idle_error_indication_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1322,7 +1322,7 @@ static void cm_connected_error_indication_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1596,7 +1596,7 @@ static void cm_context_setup_is_not_established_error_indication_func(
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1953,7 +1953,7 @@ static void vonr_qos_flow_test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -2350,7 +2350,7 @@ static void vonr_session_test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -2841,7 +2841,7 @@ static void registration_ue_context_test4_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -3234,7 +3234,7 @@ static void registration_idle_test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -65,7 +65,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -366,7 +366,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -47,12 +47,7 @@ static void initialize(const char *const argv[])
ogs_assert(rv == OGS_OK);
test_5gc_init();
// matej uredi
ogs_error("MAtej pred boštjanovo funkcijo");
rv = app_initialize(argv);
// rv = app_initialize_transfer(argv);
ogs_assert(rv == OGS_OK);
}
@ -62,9 +57,6 @@ int main(int argc, const char *const argv[])
abts_suite *suite = NULL;
atexit(terminate);
// matej uredi
//test_app_run_transfer(argc, argv, "transfer.yaml", initialize);
test_app_run(argc, argv, "transfer.yaml", initialize);
for (i = 0; alltests[i].func; i++)

File diff suppressed because it is too large Load diff

View file

@ -74,7 +74,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -754,7 +754,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1229,7 +1229,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1684,7 +1684,7 @@ static void test4_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -2310,7 +2310,7 @@ static void test5_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -3027,7 +3027,7 @@ static void test6_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -3564,7 +3564,7 @@ static void test7_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -4017,7 +4017,7 @@ static void test8_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -70,7 +70,7 @@ static void uni_directional_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -462,7 +462,7 @@ static void bi_directional_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -70,7 +70,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -549,7 +549,7 @@ static void test2_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -978,7 +978,7 @@ static void test3_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1393,7 +1393,7 @@ static void test4_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -1736,7 +1736,7 @@ static void test5_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -2014,7 +2014,7 @@ static void test6_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */
@ -2352,7 +2352,7 @@ static void test7_issues2729_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -74,7 +74,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */

View file

@ -74,7 +74,7 @@ static void test1_func(abts_case *tc, void *data)
test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca";
/* gNB connects to AMF */
ngap = testngap_client(AF_INET);
ngap = testngap_client(1, AF_INET);
ABTS_PTR_NOTNULL(tc, ngap);
/* gNB connects to UPF */