forked from acouzens/open5gs
Handling UEContextRequest of InitialUEMessage
This commit is contained in:
parent
7dd4609c0f
commit
7b29cdf898
|
@ -405,9 +405,20 @@ typedef struct ogs_nas_time_zone_and_time_s {
|
|||
#define OGS_TAI2_TYPE 2
|
||||
|
||||
/* 9.9.3.34 UE network capability
|
||||
* M LV 3-14
|
||||
* M LV 3-14 in Attach request
|
||||
* O TLV 4-15 in TAU request
|
||||
* 9.11.3.48 S1 UE network capability
|
||||
* O TLV 4-15 */
|
||||
* O TLV 4-15 in Registration request
|
||||
*
|
||||
* NOTE 1: For a UE supporting dual connectivity with NR, if the UE supports
|
||||
* one of the encryption algorithms for E-UTRAN (bits 8 to 5 of octet 3),
|
||||
* it shall support the same algorithm for NR-PDCP as specified
|
||||
* in 3GPP TS 33.401 [19]. The NR-PDCP is specified in 3GPP TS 38.323 [53].
|
||||
* NOTE 2: For a UE supporting dual connectivity with NR, if the UE supports
|
||||
* one of the integrity algorithms for E-UTRAN (bits 8 to 5 of octet 4),
|
||||
* it shall support the same algorithm for NR-PDCP as specified
|
||||
* in 3GPP TS 33.401 [19].
|
||||
*/
|
||||
typedef struct ogs_nas_ue_network_capability_s {
|
||||
uint8_t length;
|
||||
union {
|
||||
|
@ -489,9 +500,29 @@ ED8(uint8_t signalling_for_a_maximum_number_of_15_eps_bearer_contexts:1;,
|
|||
} __attribute__ ((packed)) ogs_nas_ue_network_capability_t;
|
||||
|
||||
/* 9.9.3.36 UE security capability
|
||||
* M LV 3-6
|
||||
* 9.11.3.48A UE security capability
|
||||
* O TLV 4-10 */
|
||||
* M LV 3-6 in Security mode command
|
||||
* 9.11.3.48A S1 UE security capability
|
||||
* O TLV 4-7 in Security mode command
|
||||
* 9.11.3.54 UE security capability
|
||||
* M LV 3-9 in Security mode command
|
||||
* O TLV 4-10 in Registration request
|
||||
*
|
||||
* NOTE 1: The code points in octet 3 are used to indicate support
|
||||
* for 5GS encryption algorithms for NAS security in N1 mode and
|
||||
* support for 5GS encryption algorithms for AS security over NR.
|
||||
* NOTE 2: The code points in octet 4 are used to indicate support
|
||||
* for 5GS integrity algorithms for NAS security in N1 mode and support
|
||||
* for 5GS integrity algorithms for AS security over NR.
|
||||
* NOTE 3: The code points in octet 5 are used to indicate support
|
||||
* for EPS encryption algorithms for AS security over E-UTRA connected
|
||||
* to 5GCN.
|
||||
* NOTE 4: The code points in octet 6 are used to indicate support
|
||||
* for EPS integrity algorithms for AS security over E-UTRA connected
|
||||
* to 5GCN.
|
||||
* NOTE 5: The AMF can receive this information element also
|
||||
* from another AMF or MME during N1 mode to N1 mode or
|
||||
* S1 mode to N1 mode handover preparation.
|
||||
*/
|
||||
typedef struct ogs_nas_ue_security_capability_s {
|
||||
uint8_t length;
|
||||
union {
|
||||
|
@ -508,16 +539,16 @@ typedef struct ogs_nas_ue_security_capability_s {
|
|||
uint8_t eea;
|
||||
|
||||
struct {
|
||||
ED8(uint8_t nea0:1;,
|
||||
uint8_t nea1:1;,
|
||||
uint8_t nea2:1;,
|
||||
uint8_t nea3:1;,
|
||||
uint8_t nea4:1;,
|
||||
uint8_t nea5:1;,
|
||||
uint8_t nea6:1;,
|
||||
uint8_t nea7:1;)
|
||||
ED8(uint8_t nr_ea0:1;,
|
||||
uint8_t nr_ea1:1;,
|
||||
uint8_t nr_ea2:1;,
|
||||
uint8_t nr_ea3:1;,
|
||||
uint8_t nr_ea4:1;,
|
||||
uint8_t nr_ea5:1;,
|
||||
uint8_t nr_ea6:1;,
|
||||
uint8_t nr_ea7:1;)
|
||||
};
|
||||
uint8_t nea;
|
||||
uint8_t nr_ea;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
|
@ -533,16 +564,16 @@ typedef struct ogs_nas_ue_security_capability_s {
|
|||
uint8_t eia;
|
||||
|
||||
struct {
|
||||
ED8(uint8_t nia0:1;,
|
||||
uint8_t nia1:1;,
|
||||
uint8_t nia2:1;,
|
||||
uint8_t nia3:1;,
|
||||
uint8_t nia4:1;,
|
||||
uint8_t nia5:1;,
|
||||
uint8_t nia6:1;,
|
||||
uint8_t nia7:1;)
|
||||
ED8(uint8_t nr_ia0:1;,
|
||||
uint8_t nr_ia1:1;,
|
||||
uint8_t nr_ia2:1;,
|
||||
uint8_t nr_ia3:1;,
|
||||
uint8_t nr_ia4:1;,
|
||||
uint8_t nr_ia5:1;,
|
||||
uint8_t nr_ia6:1;,
|
||||
uint8_t nr_ia7:1;)
|
||||
};
|
||||
uint8_t nia;
|
||||
uint8_t nr_ia;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
|
@ -558,16 +589,16 @@ typedef struct ogs_nas_ue_security_capability_s {
|
|||
uint8_t uea;
|
||||
|
||||
struct {
|
||||
ED8(uint8_t eps_ea0:1;,
|
||||
uint8_t eps_ea1:1;,
|
||||
uint8_t eps_ea2:1;,
|
||||
uint8_t eps_ea3:1;,
|
||||
uint8_t eps_ea4:1;,
|
||||
uint8_t eps_ea5:1;,
|
||||
uint8_t eps_ea6:1;,
|
||||
uint8_t eps_ea7:1;)
|
||||
ED8(uint8_t eutra_ea0:1;,
|
||||
uint8_t eutra_ea1:1;,
|
||||
uint8_t eutra_ea2:1;,
|
||||
uint8_t eutra_ea3:1;,
|
||||
uint8_t eutra_ea4:1;,
|
||||
uint8_t eutra_ea5:1;,
|
||||
uint8_t eutra_ea6:1;,
|
||||
uint8_t eutra_ea7:1;)
|
||||
};
|
||||
uint8_t eps_ea;
|
||||
uint8_t eutra_ea;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
|
@ -583,16 +614,16 @@ typedef struct ogs_nas_ue_security_capability_s {
|
|||
uint8_t uia;
|
||||
|
||||
struct {
|
||||
ED8(uint8_t eps_ia0:1;,
|
||||
uint8_t eps_ia1:1;,
|
||||
uint8_t eps_ia2:1;,
|
||||
uint8_t eps_ia3:1;,
|
||||
uint8_t eps_ia4:1;,
|
||||
uint8_t eps_ia5:1;,
|
||||
uint8_t eps_ia6:1;,
|
||||
uint8_t eps_ia7:1;)
|
||||
ED8(uint8_t eutra_ia0:1;,
|
||||
uint8_t eutra_ia1:1;,
|
||||
uint8_t eutra_ia2:1;,
|
||||
uint8_t eutra_ia3:1;,
|
||||
uint8_t eutra_ia4:1;,
|
||||
uint8_t eutra_ia5:1;,
|
||||
uint8_t eutra_ia6:1;,
|
||||
uint8_t eutra_ia7:1;)
|
||||
};
|
||||
uint8_t eps_ia;
|
||||
uint8_t eutra_ia;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
|
|
|
@ -1565,7 +1565,20 @@ int amf_sess_xact_count(amf_ue_t *amf_ue)
|
|||
ogs_list_for_each(&amf_ue->sess_list, sess)
|
||||
xact_count += ogs_list_count(&sess->sbi.xact_list);
|
||||
|
||||
return xact_count;;
|
||||
return xact_count;
|
||||
}
|
||||
|
||||
bool amf_sess_transfer_needed(amf_ue_t *amf_ue)
|
||||
{
|
||||
amf_sess_t *sess = NULL;
|
||||
|
||||
ogs_assert(amf_ue);
|
||||
|
||||
ogs_list_for_each(&amf_ue->sess_list, sess)
|
||||
if (sess->transfer.pdu_session_resource_setup_request)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int amf_find_served_tai(ogs_5gs_tai_t *tai)
|
||||
|
@ -1706,7 +1719,7 @@ uint8_t amf_selected_int_algorithm(amf_ue_t *amf_ue)
|
|||
ogs_assert(amf_ue);
|
||||
|
||||
for (i = 0; i < amf_self()->num_of_integrity_order; i++) {
|
||||
if (amf_ue->ue_security_capability.nia &
|
||||
if (amf_ue->ue_security_capability.nr_ia &
|
||||
(0x80 >> amf_self()->integrity_order[i])) {
|
||||
return amf_self()->integrity_order[i];
|
||||
}
|
||||
|
@ -1722,7 +1735,7 @@ uint8_t amf_selected_enc_algorithm(amf_ue_t *amf_ue)
|
|||
ogs_assert(amf_ue);
|
||||
|
||||
for (i = 0; i < amf_self()->num_of_ciphering_order; i++) {
|
||||
if (amf_ue->ue_security_capability.nea &
|
||||
if (amf_ue->ue_security_capability.nr_ea &
|
||||
(0x80 >> amf_self()->ciphering_order[i])) {
|
||||
return amf_self()->ciphering_order[i];
|
||||
}
|
||||
|
|
|
@ -157,6 +157,10 @@ struct ran_ue_s {
|
|||
|
||||
uint16_t gnb_ostream_id; /* SCTP output stream id for eNB */
|
||||
|
||||
/* UE context */
|
||||
bool ue_context_requested;
|
||||
bool initial_context_setup_request_sent;
|
||||
|
||||
/* Handover Info */
|
||||
NGAP_HandoverType_t handover_type;
|
||||
ran_ue_t *source_ue;
|
||||
|
@ -576,6 +580,9 @@ amf_sess_t *amf_sess_cycle(amf_sess_t *sess);
|
|||
#define SESSION_SYNC_DONE(__aMF) (amf_sess_xact_count(__aMF) == 0)
|
||||
int amf_sess_xact_count(amf_ue_t *amf_ue);
|
||||
|
||||
#define SESSION_TRANSFER_NEEDED(__aMF) (amf_sess_transfer_needed(__aMF) == true)
|
||||
bool amf_sess_transfer_needed(amf_ue_t *amf_ue);
|
||||
|
||||
int amf_find_served_tai(ogs_5gs_tai_t *tai);
|
||||
ogs_s_nssai_t *amf_find_s_nssai(
|
||||
ogs_plmn_id_t *served_plmn_id, ogs_s_nssai_t *s_nssai);
|
||||
|
|
|
@ -388,29 +388,31 @@ ogs_pkbuf_t *gmm_build_security_mode_command(amf_ue_t *amf_ue)
|
|||
ngksi->tsc = amf_ue->nas.tsc;
|
||||
ngksi->value = amf_ue->nas.ksi;
|
||||
|
||||
replayed_ue_security_capabilities->nea = amf_ue->ue_security_capability.nea;
|
||||
replayed_ue_security_capabilities->nia = amf_ue->ue_security_capability.nia;
|
||||
replayed_ue_security_capabilities->eps_ea =
|
||||
amf_ue->ue_security_capability.eps_ea;
|
||||
replayed_ue_security_capabilities->eps_ia =
|
||||
amf_ue->ue_security_capability.eps_ia;
|
||||
replayed_ue_security_capabilities->nr_ea =
|
||||
amf_ue->ue_security_capability.nr_ea;
|
||||
replayed_ue_security_capabilities->nr_ia =
|
||||
amf_ue->ue_security_capability.nr_ia;
|
||||
replayed_ue_security_capabilities->eutra_ea =
|
||||
amf_ue->ue_security_capability.eutra_ea;
|
||||
replayed_ue_security_capabilities->eutra_ia =
|
||||
amf_ue->ue_security_capability.eutra_ia;
|
||||
|
||||
replayed_ue_security_capabilities->length =
|
||||
sizeof(replayed_ue_security_capabilities->nea) +
|
||||
sizeof(replayed_ue_security_capabilities->nia);
|
||||
if (replayed_ue_security_capabilities->eps_ea ||
|
||||
replayed_ue_security_capabilities->eps_ia)
|
||||
sizeof(replayed_ue_security_capabilities->nr_ea) +
|
||||
sizeof(replayed_ue_security_capabilities->nr_ia);
|
||||
if (replayed_ue_security_capabilities->eutra_ea ||
|
||||
replayed_ue_security_capabilities->eutra_ia)
|
||||
replayed_ue_security_capabilities->length =
|
||||
sizeof(replayed_ue_security_capabilities->nea) +
|
||||
sizeof(replayed_ue_security_capabilities->nia) +
|
||||
sizeof(replayed_ue_security_capabilities->eps_ea) +
|
||||
sizeof(replayed_ue_security_capabilities->eps_ia);
|
||||
sizeof(replayed_ue_security_capabilities->nr_ea) +
|
||||
sizeof(replayed_ue_security_capabilities->nr_ia) +
|
||||
sizeof(replayed_ue_security_capabilities->eutra_ea) +
|
||||
sizeof(replayed_ue_security_capabilities->eutra_ia);
|
||||
ogs_debug(" Replayed UE SEC[LEN:%d NEA:0x%x NIA:0x%x EEA:0x%x EIA:0x%x",
|
||||
replayed_ue_security_capabilities->length,
|
||||
replayed_ue_security_capabilities->nea,
|
||||
replayed_ue_security_capabilities->nia,
|
||||
replayed_ue_security_capabilities->eps_ea,
|
||||
replayed_ue_security_capabilities->eps_ia);
|
||||
replayed_ue_security_capabilities->nr_ea,
|
||||
replayed_ue_security_capabilities->nr_ia,
|
||||
replayed_ue_security_capabilities->eutra_ea,
|
||||
replayed_ue_security_capabilities->eutra_ia);
|
||||
ogs_debug(" Selected[Integrity:0x%x Encrypt:0x%x]",
|
||||
amf_ue->selected_int_algorithm, amf_ue->selected_enc_algorithm);
|
||||
|
||||
|
@ -419,8 +421,7 @@ ogs_pkbuf_t *gmm_build_security_mode_command(amf_ue_t *amf_ue)
|
|||
imeisv_request->type = OGS_NAS_IMEISV_TYPE;
|
||||
imeisv_request->value = OGS_NAS_IMEISV_REQUESTED;
|
||||
|
||||
security_mode_command->presencemask |=
|
||||
OGS_NAS_5GS_SECURITY_MODE_COMMAND_ADDITIONAL_5G_SECURITY_INFORMATION_PRESENT;
|
||||
security_mode_command->presencemask |= OGS_NAS_5GS_SECURITY_MODE_COMMAND_ADDITIONAL_5G_SECURITY_INFORMATION_PRESENT;
|
||||
additional_security_information->length = 1;
|
||||
additional_security_information->
|
||||
retransmission_of_initial_nas_message_request = 1;
|
||||
|
@ -447,6 +448,8 @@ ogs_pkbuf_t *gmm_build_configuration_update_command(
|
|||
ogs_nas_5gs_configuration_update_command_t *configuration_update_command =
|
||||
&message.gmm.configuration_update_command;
|
||||
|
||||
ogs_nas_time_zone_t *local_time_zone =
|
||||
&configuration_update_command->local_time_zone;
|
||||
ogs_nas_time_zone_and_time_t *universal_time_and_local_time_zone =
|
||||
&configuration_update_command->universal_time_and_local_time_zone;
|
||||
ogs_nas_daylight_saving_time_t *network_daylight_saving_time =
|
||||
|
@ -482,6 +485,20 @@ ogs_pkbuf_t *gmm_build_configuration_update_command(
|
|||
}
|
||||
|
||||
if (param->nitz) {
|
||||
if (amf_self()->full_name.length) {
|
||||
configuration_update_command->presencemask |=
|
||||
OGS_NAS_5GS_CONFIGURATION_UPDATE_COMMAND_FULL_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&configuration_update_command->full_name_for_network,
|
||||
&amf_self()->full_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
|
||||
if (amf_self()->short_name.length) {
|
||||
configuration_update_command->presencemask |=
|
||||
OGS_NAS_5GS_CONFIGURATION_UPDATE_COMMAND_SHORT_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&configuration_update_command->short_name_for_network,
|
||||
&amf_self()->short_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
|
||||
ogs_gettimeofday(&tv);
|
||||
ogs_gmtime(tv.tv_sec, &gmt);
|
||||
ogs_localtime(tv.tv_sec, &local);
|
||||
|
@ -497,6 +514,16 @@ ogs_pkbuf_t *gmm_build_configuration_update_command(
|
|||
local.tm_hour, local.tm_min, local.tm_sec,
|
||||
(int)local.tm_gmtoff, local.tm_isdst);
|
||||
|
||||
configuration_update_command->presencemask |=
|
||||
OGS_NAS_5GS_CONFIGURATION_UPDATE_COMMAND_LOCAL_TIME_ZONE_PRESENT;
|
||||
if (local.tm_gmtoff >= 0) {
|
||||
*local_time_zone = OGS_NAS_TIME_TO_BCD(local.tm_gmtoff / 900);
|
||||
} else {
|
||||
*local_time_zone = OGS_NAS_TIME_TO_BCD((-local.tm_gmtoff) / 900);
|
||||
*local_time_zone |= 0x08;
|
||||
}
|
||||
ogs_debug(" Timezone:0x%x", *local_time_zone);
|
||||
|
||||
configuration_update_command->presencemask |=
|
||||
OGS_NAS_5GS_CONFIGURATION_UPDATE_COMMAND_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_PRESENT;
|
||||
universal_time_and_local_time_zone->year =
|
||||
|
@ -511,34 +538,11 @@ ogs_pkbuf_t *gmm_build_configuration_update_command(
|
|||
OGS_NAS_TIME_TO_BCD(gmt.tm_min);
|
||||
universal_time_and_local_time_zone->sec =
|
||||
OGS_NAS_TIME_TO_BCD(gmt.tm_sec);
|
||||
if (local.tm_gmtoff >= 0) {
|
||||
universal_time_and_local_time_zone->timezone =
|
||||
OGS_NAS_TIME_TO_BCD(local.tm_gmtoff / 900);
|
||||
} else {
|
||||
universal_time_and_local_time_zone->timezone =
|
||||
OGS_NAS_TIME_TO_BCD((-local.tm_gmtoff) / 900);
|
||||
universal_time_and_local_time_zone->timezone |= 0x08;
|
||||
}
|
||||
ogs_debug(" Timezone:0x%x",
|
||||
universal_time_and_local_time_zone->timezone);
|
||||
universal_time_and_local_time_zone->timezone = *local_time_zone;
|
||||
|
||||
configuration_update_command->presencemask |=
|
||||
OGS_NAS_5GS_CONFIGURATION_UPDATE_COMMAND_NETWORK_DAYLIGHT_SAVING_TIME_PRESENT;
|
||||
network_daylight_saving_time->length = 1;
|
||||
|
||||
if (amf_self()->full_name.length) {
|
||||
configuration_update_command->presencemask |=
|
||||
OGS_NAS_5GS_CONFIGURATION_UPDATE_COMMAND_FULL_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&configuration_update_command->full_name_for_network,
|
||||
&amf_self()->full_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
|
||||
if (amf_self()->short_name.length) {
|
||||
configuration_update_command->presencemask |=
|
||||
OGS_NAS_5GS_CONFIGURATION_UPDATE_COMMAND_SHORT_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&configuration_update_command->short_name_for_network,
|
||||
&amf_self()->short_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
}
|
||||
|
||||
return nas_5gs_security_encode(amf_ue, &message);
|
||||
|
|
|
@ -179,7 +179,7 @@ int gmm_handle_registration_request(amf_ue_t *amf_ue,
|
|||
OGS_NAS_SECURITY_ALGORITHMS_NIA0) {
|
||||
ogs_error("[UE:0x%x:0x%x], NEA0 can be used in Encrypt[0x%x], "
|
||||
"but Integrity[0x%x] cannot be bypassed with NIA0",
|
||||
ue_security_capability->nea, ue_security_capability->nia,
|
||||
ue_security_capability->nr_ea, ue_security_capability->nr_ia,
|
||||
amf_selected_enc_algorithm(amf_ue),
|
||||
amf_selected_int_algorithm(amf_ue));
|
||||
nas_5gs_send_registration_reject(amf_ue,
|
||||
|
|
|
@ -30,6 +30,7 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
|
|||
int status;
|
||||
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
ran_ue_t *ran_ue = NULL;
|
||||
amf_sess_t *sess = NULL;
|
||||
|
||||
ogs_pkbuf_t *n1smbuf = NULL;
|
||||
|
@ -121,6 +122,9 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
|
|||
return OGS_ERROR;
|
||||
}
|
||||
|
||||
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
|
||||
ogs_assert(ran_ue);
|
||||
|
||||
sess = amf_sess_find_by_psi(amf_ue, pdu_session_id);
|
||||
if (!sess) {
|
||||
ogs_error("[%s] No PDU Session Context [%d]",
|
||||
|
@ -166,9 +170,17 @@ int amf_namf_comm_handle_n1_n2_message_transfer(
|
|||
sess->pdu_session_establishment_accept = NULL;
|
||||
}
|
||||
|
||||
ngapbuf = ngap_build_pdu_session_resource_setup_request(
|
||||
sess, gmmbuf, n2smbuf);
|
||||
ogs_assert(ngapbuf);
|
||||
if (ran_ue->initial_context_setup_request_sent == true) {
|
||||
ngapbuf = ngap_sess_build_pdu_session_resource_setup_request(
|
||||
sess, gmmbuf, n2smbuf);
|
||||
ogs_assert(ngapbuf);
|
||||
} else {
|
||||
ngapbuf = ngap_sess_build_initial_context_setup_request(
|
||||
sess, gmmbuf, n2smbuf);
|
||||
ogs_assert(ngapbuf);
|
||||
|
||||
ran_ue->initial_context_setup_request_sent = true;
|
||||
}
|
||||
|
||||
if (SESSION_CONTEXT_IN_SMF(sess)) {
|
||||
/*
|
||||
|
|
|
@ -47,7 +47,8 @@ int nas_5gs_send_to_downlink_nas_transport(amf_ue_t *amf_ue, ogs_pkbuf_t *pkbuf)
|
|||
ogs_pkbuf_free(pkbuf);
|
||||
|
||||
} else {
|
||||
ngapbuf = ngap_build_downlink_nas_transport(ran_ue, pkbuf);
|
||||
ngapbuf = ngap_build_downlink_nas_transport(
|
||||
ran_ue, pkbuf, false, false);
|
||||
if (!ngapbuf) {
|
||||
ogs_error("ngap_build_downlink_nas_transport() failed");
|
||||
return OGS_ERROR;
|
||||
|
@ -65,17 +66,45 @@ int nas_5gs_send_to_downlink_nas_transport(amf_ue_t *amf_ue, ogs_pkbuf_t *pkbuf)
|
|||
void nas_5gs_send_registration_accept(amf_ue_t *amf_ue)
|
||||
{
|
||||
int rv;
|
||||
|
||||
ran_ue_t *ran_ue = NULL;
|
||||
|
||||
ogs_pkbuf_t *ngapbuf = NULL;
|
||||
ogs_pkbuf_t *gmmbuf = NULL;
|
||||
|
||||
ogs_assert(amf_ue);
|
||||
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
|
||||
ogs_assert(ran_ue);
|
||||
|
||||
gmmbuf = gmm_build_registration_accept(amf_ue);
|
||||
ogs_expect_or_return(gmmbuf);
|
||||
|
||||
ngapbuf = ngap_build_initial_context_setup_request(amf_ue, gmmbuf);
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
if (ran_ue->ue_context_requested == true &&
|
||||
ran_ue->initial_context_setup_request_sent == false) {
|
||||
ngapbuf = ngap_ue_build_initial_context_setup_request(amf_ue, gmmbuf);
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
|
||||
ran_ue->initial_context_setup_request_sent = true;
|
||||
} else {
|
||||
if (SESSION_TRANSFER_NEEDED(amf_ue)) {
|
||||
ngapbuf = ngap_ue_build_pdu_session_resource_setup_request(
|
||||
amf_ue, gmmbuf);
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
} else {
|
||||
ngapbuf = ngap_build_downlink_nas_transport(
|
||||
ran_ue, gmmbuf, true, true);
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nas_5gs_send_registration_reject(
|
||||
|
@ -98,32 +127,40 @@ void nas_5gs_send_registration_reject(
|
|||
void nas_5gs_send_service_accept(amf_ue_t *amf_ue)
|
||||
{
|
||||
int rv;
|
||||
ran_ue_t *ran_ue = NULL;
|
||||
|
||||
ogs_pkbuf_t *gmmbuf = NULL;
|
||||
ogs_pkbuf_t *ngapbuf = NULL;
|
||||
|
||||
ogs_assert(amf_ue);
|
||||
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
|
||||
ogs_assert(ran_ue);
|
||||
|
||||
gmmbuf = gmm_build_service_accept(amf_ue);
|
||||
ogs_expect_or_return(gmmbuf);
|
||||
|
||||
switch (amf_ue->nas.ngapProcedureCode) {
|
||||
case NGAP_ProcedureCode_id_InitialUEMessage:
|
||||
ngapbuf = ngap_build_initial_context_setup_request(amf_ue, gmmbuf);
|
||||
if (ran_ue->ue_context_requested == true &&
|
||||
ran_ue->initial_context_setup_request_sent == false) {
|
||||
ngapbuf = ngap_ue_build_initial_context_setup_request(
|
||||
amf_ue, gmmbuf);
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
break;
|
||||
|
||||
case NGAP_ProcedureCode_id_UplinkNASTransport:
|
||||
rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
break;
|
||||
ran_ue->initial_context_setup_request_sent = true;
|
||||
} else {
|
||||
if (SESSION_TRANSFER_NEEDED(amf_ue)) {
|
||||
ngapbuf = ngap_ue_build_pdu_session_resource_setup_request(
|
||||
amf_ue, gmmbuf);
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
default:
|
||||
ogs_error("Invalid NGAP ProcedureCode [%d]",
|
||||
(int)amf_ue->nas.ngapProcedureCode);
|
||||
return;
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
} else {
|
||||
rv = nas_5gs_send_to_downlink_nas_transport(amf_ue, gmmbuf);
|
||||
ogs_expect_or_return(rv == OGS_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,8 +216,10 @@ ogs_pkbuf_t *ngap_build_ng_setup_failure(
|
|||
}
|
||||
|
||||
ogs_pkbuf_t *ngap_build_downlink_nas_transport(
|
||||
ran_ue_t *ran_ue, ogs_pkbuf_t *gmmbuf)
|
||||
ran_ue_t *ran_ue, ogs_pkbuf_t *gmmbuf, bool ue_ambr, bool allowed_nssai)
|
||||
{
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
|
||||
NGAP_NGAP_PDU_t pdu;
|
||||
NGAP_InitiatingMessage_t *initiatingMessage = NULL;
|
||||
NGAP_DownlinkNASTransport_t *DownlinkNASTransport = NULL;
|
||||
|
@ -226,10 +228,14 @@ ogs_pkbuf_t *ngap_build_downlink_nas_transport(
|
|||
NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL;
|
||||
NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL;
|
||||
NGAP_NAS_PDU_t *NAS_PDU = NULL;
|
||||
NGAP_UEAggregateMaximumBitRate_t *UEAggregateMaximumBitRate = NULL;
|
||||
NGAP_AllowedNSSAI_t *AllowedNSSAI = NULL;
|
||||
|
||||
ogs_assert(gmmbuf);
|
||||
ogs_assert(ran_ue);
|
||||
|
||||
amf_ue = ran_ue->amf_ue;
|
||||
|
||||
ogs_debug("DownlinkNASTransport");
|
||||
|
||||
memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t));
|
||||
|
@ -285,10 +291,72 @@ ogs_pkbuf_t *ngap_build_downlink_nas_transport(
|
|||
memcpy(NAS_PDU->buf, gmmbuf->data, NAS_PDU->size);
|
||||
ogs_pkbuf_free(gmmbuf);
|
||||
|
||||
if (ue_ambr && (amf_ue->ue_ambr.downlink || amf_ue->ue_ambr.uplink)) {
|
||||
ogs_assert(amf_ue);
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_DownlinkNASTransport_IEs_t));
|
||||
ASN_SEQUENCE_ADD(&DownlinkNASTransport->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_UEAggregateMaximumBitRate;
|
||||
ie->criticality = NGAP_Criticality_ignore;
|
||||
ie->value.present = NGAP_DownlinkNASTransport_IEs__value_PR_UEAggregateMaximumBitRate;
|
||||
|
||||
UEAggregateMaximumBitRate = &ie->value.choice.UEAggregateMaximumBitRate;
|
||||
|
||||
asn_uint642INTEGER(
|
||||
&UEAggregateMaximumBitRate->uEAggregateMaximumBitRateUL,
|
||||
amf_ue->ue_ambr.uplink);
|
||||
asn_uint642INTEGER(
|
||||
&UEAggregateMaximumBitRate->uEAggregateMaximumBitRateDL,
|
||||
amf_ue->ue_ambr.downlink);
|
||||
}
|
||||
|
||||
if (allowed_nssai) {
|
||||
int i, j;
|
||||
ogs_assert(amf_ue);
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_DownlinkNASTransport_IEs_t));
|
||||
ASN_SEQUENCE_ADD(&DownlinkNASTransport->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_AllowedNSSAI;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_DownlinkNASTransport_IEs__value_PR_AllowedNSSAI;
|
||||
|
||||
AllowedNSSAI = &ie->value.choice.AllowedNSSAI;
|
||||
|
||||
for (i = 0; i < amf_self()->num_of_plmn_support; i++) {
|
||||
if (memcmp(&amf_ue->tai.plmn_id,
|
||||
&amf_self()->plmn_support[i].plmn_id, OGS_PLMN_ID_LEN) != 0)
|
||||
continue;
|
||||
for (j = 0; j < amf_self()->plmn_support[i].num_of_s_nssai; j++) {
|
||||
NGAP_AllowedNSSAI_Item_t *NGAP_AllowedNSSAI_Item = NULL;
|
||||
NGAP_S_NSSAI_t *s_NSSAI = NULL;
|
||||
NGAP_SST_t *sST = NULL;
|
||||
|
||||
NGAP_AllowedNSSAI_Item = (NGAP_AllowedNSSAI_Item_t *)
|
||||
CALLOC(1, sizeof(NGAP_AllowedNSSAI_Item_t));
|
||||
s_NSSAI = &NGAP_AllowedNSSAI_Item->s_NSSAI;
|
||||
sST = &s_NSSAI->sST;
|
||||
|
||||
ogs_asn_uint8_to_OCTET_STRING(
|
||||
amf_self()->plmn_support[i].s_nssai[j].sst, sST);
|
||||
if (amf_self()->plmn_support[i].s_nssai[j].sd.v !=
|
||||
OGS_S_NSSAI_NO_SD_VALUE) {
|
||||
s_NSSAI->sD = CALLOC(1, sizeof(NGAP_SD_t));
|
||||
ogs_asn_uint24_to_OCTET_STRING(
|
||||
amf_self()->plmn_support[i].s_nssai[j].sd, s_NSSAI->sD);
|
||||
}
|
||||
|
||||
ASN_SEQUENCE_ADD(&AllowedNSSAI->list, NGAP_AllowedNSSAI_Item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
||||
ogs_pkbuf_t *ngap_ue_build_initial_context_setup_request(
|
||||
amf_ue_t *amf_ue, ogs_pkbuf_t *gmmbuf)
|
||||
{
|
||||
int i, j;
|
||||
|
@ -360,8 +428,7 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
|||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_UEAggregateMaximumBitRate;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_UEAggregateMaximumBitRate;
|
||||
ie->value.present = NGAP_InitialContextSetupRequestIEs__value_PR_UEAggregateMaximumBitRate;
|
||||
|
||||
UEAggregateMaximumBitRate = &ie->value.choice.UEAggregateMaximumBitRate;
|
||||
|
||||
|
@ -503,7 +570,7 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
|||
nRencryptionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.nea << 1);
|
||||
(amf_ue->ue_security_capability.nr_ea << 1);
|
||||
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.buf =
|
||||
|
@ -511,7 +578,7 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
|||
nRintegrityProtectionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.nia << 1);
|
||||
(amf_ue->ue_security_capability.nr_ia << 1);
|
||||
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.buf =
|
||||
|
@ -519,7 +586,7 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
|||
eUTRAencryptionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.eps_ea << 1);
|
||||
(amf_ue->ue_security_capability.eutra_ea << 1);
|
||||
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.buf =
|
||||
|
@ -527,7 +594,7 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
|||
eUTRAintegrityProtectionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.eps_ia << 1);
|
||||
(amf_ue->ue_security_capability.eutra_ia << 1);
|
||||
|
||||
SecurityKey->size = OGS_SHA256_DIGEST_SIZE;
|
||||
SecurityKey->buf = CALLOC(SecurityKey->size, sizeof(uint8_t));
|
||||
|
@ -591,6 +658,295 @@ ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
|||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *ngap_sess_build_initial_context_setup_request(
|
||||
amf_sess_t *sess, ogs_pkbuf_t *n1smbuf, ogs_pkbuf_t *n2smbuf)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
ran_ue_t *ran_ue = NULL;
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
|
||||
NGAP_NGAP_PDU_t pdu;
|
||||
NGAP_InitiatingMessage_t *initiatingMessage = NULL;
|
||||
NGAP_InitialContextSetupRequest_t *InitialContextSetupRequest = NULL;
|
||||
|
||||
NGAP_InitialContextSetupRequestIEs_t *ie = NULL;
|
||||
NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL;
|
||||
NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL;
|
||||
NGAP_UEAggregateMaximumBitRate_t *UEAggregateMaximumBitRate = NULL;
|
||||
NGAP_PDUSessionResourceSetupListCxtReq_t *PDUSessionList = NULL;
|
||||
NGAP_PDUSessionResourceSetupItemCxtReq_t *PDUSessionItem = NULL;
|
||||
NGAP_GUAMI_t *GUAMI = NULL;
|
||||
NGAP_AllowedNSSAI_t *AllowedNSSAI = NULL;
|
||||
NGAP_UESecurityCapabilities_t *UESecurityCapabilities = NULL;
|
||||
NGAP_SecurityKey_t *SecurityKey = NULL;
|
||||
NGAP_MaskedIMEISV_t *MaskedIMEISV = NULL;
|
||||
|
||||
ogs_assert(sess);
|
||||
amf_ue = sess->amf_ue;
|
||||
ogs_assert(amf_ue);
|
||||
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
|
||||
ogs_assert(ran_ue);
|
||||
|
||||
ogs_debug("Initial context setup request");
|
||||
|
||||
memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t));
|
||||
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t));
|
||||
|
||||
initiatingMessage = pdu.choice.initiatingMessage;
|
||||
initiatingMessage->procedureCode =
|
||||
NGAP_ProcedureCode_id_InitialContextSetup;
|
||||
initiatingMessage->criticality = NGAP_Criticality_reject;
|
||||
initiatingMessage->value.present =
|
||||
NGAP_InitiatingMessage__value_PR_InitialContextSetupRequest;
|
||||
|
||||
InitialContextSetupRequest =
|
||||
&initiatingMessage->value.choice.InitialContextSetupRequest;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_AMF_UE_NGAP_ID;
|
||||
|
||||
AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_RAN_UE_NGAP_ID;
|
||||
|
||||
RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID;
|
||||
|
||||
if (amf_ue->ue_ambr.downlink || amf_ue->ue_ambr.uplink) {
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_UEAggregateMaximumBitRate;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_UEAggregateMaximumBitRate;
|
||||
|
||||
UEAggregateMaximumBitRate = &ie->value.choice.UEAggregateMaximumBitRate;
|
||||
|
||||
asn_uint642INTEGER(
|
||||
&UEAggregateMaximumBitRate->uEAggregateMaximumBitRateUL,
|
||||
amf_ue->ue_ambr.uplink);
|
||||
asn_uint642INTEGER(
|
||||
&UEAggregateMaximumBitRate->uEAggregateMaximumBitRateDL,
|
||||
amf_ue->ue_ambr.downlink);
|
||||
}
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_GUAMI;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present = NGAP_InitialContextSetupRequestIEs__value_PR_GUAMI;
|
||||
|
||||
GUAMI = &ie->value.choice.GUAMI;
|
||||
|
||||
if (n1smbuf && n2smbuf) {
|
||||
NGAP_NAS_PDU_t *nAS_PDU = NULL;
|
||||
OCTET_STRING_t *transfer = NULL;
|
||||
NGAP_S_NSSAI_t *s_NSSAI = NULL;
|
||||
NGAP_SST_t *sST = NULL;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListCxtReq;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present = NGAP_InitialContextSetupRequestIEs__value_PR_PDUSessionResourceSetupListCxtReq;
|
||||
|
||||
PDUSessionList = &ie->value.choice.PDUSessionResourceSetupListCxtReq;
|
||||
|
||||
PDUSessionItem = CALLOC(1,
|
||||
sizeof(struct NGAP_PDUSessionResourceSetupItemCxtReq));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionList->list, PDUSessionItem);
|
||||
|
||||
PDUSessionItem->nAS_PDU = nAS_PDU = CALLOC(1, sizeof(*nAS_PDU));
|
||||
ogs_assert(nAS_PDU);
|
||||
|
||||
nAS_PDU->size = n1smbuf->len;
|
||||
nAS_PDU->buf = CALLOC(nAS_PDU->size, sizeof(uint8_t));
|
||||
memcpy(nAS_PDU->buf, n1smbuf->data, nAS_PDU->size);
|
||||
ogs_pkbuf_free(n1smbuf);
|
||||
|
||||
PDUSessionItem->pDUSessionID = sess->psi;
|
||||
|
||||
s_NSSAI = &PDUSessionItem->s_NSSAI;
|
||||
sST = &s_NSSAI->sST;
|
||||
|
||||
ogs_asn_uint8_to_OCTET_STRING(sess->s_nssai.sst, sST);
|
||||
if (sess->s_nssai.sd.v != OGS_S_NSSAI_NO_SD_VALUE) {
|
||||
s_NSSAI->sD = CALLOC(1, sizeof(NGAP_SD_t));
|
||||
ogs_asn_uint24_to_OCTET_STRING(sess->s_nssai.sd, s_NSSAI->sD);
|
||||
}
|
||||
|
||||
transfer = &PDUSessionItem->pDUSessionResourceSetupRequestTransfer;
|
||||
transfer->size = n2smbuf->len;
|
||||
transfer->buf = CALLOC(transfer->size, sizeof(uint8_t));
|
||||
memcpy(transfer->buf, n2smbuf->data, transfer->size);
|
||||
ogs_pkbuf_free(n2smbuf);
|
||||
}
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_AllowedNSSAI;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_AllowedNSSAI;
|
||||
|
||||
AllowedNSSAI = &ie->value.choice.AllowedNSSAI;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_UESecurityCapabilities;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_UESecurityCapabilities;
|
||||
|
||||
UESecurityCapabilities = &ie->value.choice.UESecurityCapabilities;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_SecurityKey;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_SecurityKey;
|
||||
|
||||
SecurityKey = &ie->value.choice.SecurityKey;
|
||||
|
||||
ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]",
|
||||
ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id);
|
||||
|
||||
asn_uint642INTEGER(AMF_UE_NGAP_ID, ran_ue->amf_ue_ngap_id);
|
||||
*RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id;
|
||||
|
||||
ogs_assert(amf_ue->guami);
|
||||
ogs_asn_buffer_to_OCTET_STRING(&amf_ue->guami->plmn_id, OGS_PLMN_ID_LEN,
|
||||
&GUAMI->pLMNIdentity);
|
||||
ogs_ngap_uint8_to_AMFRegionID(ogs_amf_region_id(&amf_ue->guami->amf_id),
|
||||
&GUAMI->aMFRegionID);
|
||||
ogs_ngap_uint16_to_AMFSetID(ogs_amf_set_id(&amf_ue->guami->amf_id),
|
||||
&GUAMI->aMFSetID);
|
||||
ogs_ngap_uint8_to_AMFPointer(ogs_amf_pointer(&amf_ue->guami->amf_id),
|
||||
&GUAMI->aMFPointer);
|
||||
|
||||
for (i = 0; i < amf_self()->num_of_plmn_support; i++) {
|
||||
if (memcmp(&amf_ue->tai.plmn_id,
|
||||
&amf_self()->plmn_support[i].plmn_id, OGS_PLMN_ID_LEN) != 0)
|
||||
continue;
|
||||
for (j = 0; j < amf_self()->plmn_support[i].num_of_s_nssai; j++) {
|
||||
NGAP_AllowedNSSAI_Item_t *NGAP_AllowedNSSAI_Item = NULL;
|
||||
NGAP_S_NSSAI_t *s_NSSAI = NULL;
|
||||
NGAP_SST_t *sST = NULL;
|
||||
|
||||
NGAP_AllowedNSSAI_Item = (NGAP_AllowedNSSAI_Item_t *)
|
||||
CALLOC(1, sizeof(NGAP_AllowedNSSAI_Item_t));
|
||||
s_NSSAI = &NGAP_AllowedNSSAI_Item->s_NSSAI;
|
||||
sST = &s_NSSAI->sST;
|
||||
|
||||
ogs_asn_uint8_to_OCTET_STRING(
|
||||
amf_self()->plmn_support[i].s_nssai[j].sst, sST);
|
||||
if (amf_self()->plmn_support[i].s_nssai[j].sd.v !=
|
||||
OGS_S_NSSAI_NO_SD_VALUE) {
|
||||
s_NSSAI->sD = CALLOC(1, sizeof(NGAP_SD_t));
|
||||
ogs_asn_uint24_to_OCTET_STRING(
|
||||
amf_self()->plmn_support[i].s_nssai[j].sd, s_NSSAI->sD);
|
||||
}
|
||||
|
||||
ASN_SEQUENCE_ADD(&AllowedNSSAI->list, NGAP_AllowedNSSAI_Item);
|
||||
}
|
||||
}
|
||||
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.buf =
|
||||
CALLOC(UESecurityCapabilities->
|
||||
nRencryptionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.nr_ea << 1);
|
||||
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.buf =
|
||||
CALLOC(UESecurityCapabilities->
|
||||
nRintegrityProtectionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.nr_ia << 1);
|
||||
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.buf =
|
||||
CALLOC(UESecurityCapabilities->
|
||||
eUTRAencryptionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.eutra_ea << 1);
|
||||
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.buf =
|
||||
CALLOC(UESecurityCapabilities->
|
||||
eUTRAintegrityProtectionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.buf[0] =
|
||||
(amf_ue->ue_security_capability.eutra_ia << 1);
|
||||
|
||||
SecurityKey->size = OGS_SHA256_DIGEST_SIZE;
|
||||
SecurityKey->buf = CALLOC(SecurityKey->size, sizeof(uint8_t));
|
||||
SecurityKey->bits_unused = 0;
|
||||
memcpy(SecurityKey->buf, amf_ue->kgnb, SecurityKey->size);
|
||||
|
||||
if (amf_ue->ueRadioCapability.buf && amf_ue->ueRadioCapability.size) {
|
||||
/* Set UeRadioCapability if exists */
|
||||
NGAP_UERadioCapability_t *UERadioCapability = NULL;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_UERadioCapability;
|
||||
ie->criticality = NGAP_Criticality_ignore;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_UERadioCapability;
|
||||
|
||||
UERadioCapability = &ie->value.choice.UERadioCapability;
|
||||
|
||||
ogs_assert(UERadioCapability);
|
||||
ogs_asn_buffer_to_OCTET_STRING(
|
||||
amf_ue->ueRadioCapability.buf, amf_ue->ueRadioCapability.size,
|
||||
UERadioCapability);
|
||||
}
|
||||
|
||||
if (amf_ue->masked_imeisv_len) {
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialContextSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialContextSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_MaskedIMEISV;
|
||||
ie->criticality = NGAP_Criticality_ignore;
|
||||
ie->value.present =
|
||||
NGAP_InitialContextSetupRequestIEs__value_PR_MaskedIMEISV;
|
||||
|
||||
MaskedIMEISV = &ie->value.choice.MaskedIMEISV;
|
||||
|
||||
MaskedIMEISV->size = amf_ue->masked_imeisv_len;
|
||||
MaskedIMEISV->buf = CALLOC(MaskedIMEISV->size, sizeof(uint8_t));
|
||||
MaskedIMEISV->bits_unused = 0;
|
||||
memcpy(MaskedIMEISV->buf, amf_ue->masked_imeisv, MaskedIMEISV->size);
|
||||
}
|
||||
|
||||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
||||
#if 0
|
||||
ogs_pkbuf_t *ngap_build_ue_context_modification_request(amf_ue_t *amf_ue)
|
||||
{
|
||||
|
@ -801,7 +1157,131 @@ ogs_pkbuf_t *ngap_build_ue_context_release_command(
|
|||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *ngap_build_pdu_session_resource_setup_request(
|
||||
ogs_pkbuf_t *ngap_ue_build_pdu_session_resource_setup_request(
|
||||
amf_ue_t *amf_ue, ogs_pkbuf_t *gmmbuf)
|
||||
{
|
||||
ran_ue_t *ran_ue = NULL;
|
||||
amf_sess_t *sess = NULL;
|
||||
|
||||
NGAP_NGAP_PDU_t pdu;
|
||||
NGAP_InitiatingMessage_t *initiatingMessage = NULL;
|
||||
NGAP_PDUSessionResourceSetupRequest_t *PDUSessionResourceSetupRequest;
|
||||
|
||||
NGAP_PDUSessionResourceSetupRequestIEs_t *ie = NULL;
|
||||
NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL;
|
||||
NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL;
|
||||
NGAP_NAS_PDU_t *NAS_PDU = NULL;
|
||||
|
||||
NGAP_PDUSessionResourceSetupListSUReq_t *PDUSessionList = NULL;
|
||||
NGAP_PDUSessionResourceSetupItemSUReq_t *PDUSessionItem = NULL;
|
||||
|
||||
ogs_assert(gmmbuf);
|
||||
ogs_assert(amf_ue);
|
||||
ran_ue = ran_ue_cycle(amf_ue->ran_ue);
|
||||
ogs_assert(ran_ue);
|
||||
|
||||
memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t));
|
||||
pdu.present = NGAP_NGAP_PDU_PR_initiatingMessage;
|
||||
pdu.choice.initiatingMessage = CALLOC(1, sizeof(NGAP_InitiatingMessage_t));
|
||||
|
||||
initiatingMessage = pdu.choice.initiatingMessage;
|
||||
initiatingMessage->procedureCode =
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup;
|
||||
initiatingMessage->criticality = NGAP_Criticality_reject;
|
||||
initiatingMessage->value.present =
|
||||
NGAP_InitiatingMessage__value_PR_PDUSessionResourceSetupRequest;
|
||||
|
||||
PDUSessionResourceSetupRequest =
|
||||
&initiatingMessage->value.choice.PDUSessionResourceSetupRequest;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_PDUSessionResourceSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionResourceSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_PDUSessionResourceSetupRequestIEs__value_PR_AMF_UE_NGAP_ID;
|
||||
|
||||
AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_PDUSessionResourceSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionResourceSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_PDUSessionResourceSetupRequestIEs__value_PR_RAN_UE_NGAP_ID;
|
||||
|
||||
RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID;
|
||||
|
||||
ogs_debug(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld]",
|
||||
ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id);
|
||||
|
||||
asn_uint642INTEGER(AMF_UE_NGAP_ID, ran_ue->amf_ue_ngap_id);
|
||||
*RAN_UE_NGAP_ID = ran_ue->ran_ue_ngap_id;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_PDUSessionResourceSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionResourceSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_NAS_PDU;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present =
|
||||
NGAP_PDUSessionResourceSetupRequestIEs__value_PR_NAS_PDU;
|
||||
|
||||
NAS_PDU = &ie->value.choice.NAS_PDU;
|
||||
|
||||
NAS_PDU->size = gmmbuf->len;
|
||||
NAS_PDU->buf = CALLOC(NAS_PDU->size, sizeof(uint8_t));
|
||||
memcpy(NAS_PDU->buf, gmmbuf->data, NAS_PDU->size);
|
||||
ogs_pkbuf_free(gmmbuf);
|
||||
|
||||
ogs_list_for_each(&amf_ue->sess_list, sess) {
|
||||
NGAP_S_NSSAI_t *s_NSSAI = NULL;
|
||||
NGAP_SST_t *sST = NULL;
|
||||
OCTET_STRING_t *transfer = NULL;
|
||||
|
||||
if (!sess->transfer.pdu_session_resource_setup_request) continue;
|
||||
|
||||
if (!PDUSessionList) {
|
||||
ie = CALLOC(1, sizeof(NGAP_PDUSessionResourceSetupRequestIEs_t));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionResourceSetupRequest->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListSUReq;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present = NGAP_PDUSessionResourceSetupRequestIEs__value_PR_PDUSessionResourceSetupListSUReq;
|
||||
|
||||
PDUSessionList = &ie->value.choice.PDUSessionResourceSetupListSUReq;
|
||||
}
|
||||
|
||||
PDUSessionItem =
|
||||
CALLOC(1, sizeof(struct NGAP_PDUSessionResourceSetupItemSUReq));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionList->list, PDUSessionItem);
|
||||
|
||||
PDUSessionItem->pDUSessionID = sess->psi;
|
||||
|
||||
s_NSSAI = &PDUSessionItem->s_NSSAI;
|
||||
sST = &s_NSSAI->sST;
|
||||
ogs_asn_uint8_to_OCTET_STRING(sess->s_nssai.sst, sST);
|
||||
if (sess->s_nssai.sd.v != OGS_S_NSSAI_NO_SD_VALUE) {
|
||||
s_NSSAI->sD = CALLOC(1, sizeof(NGAP_SD_t));
|
||||
ogs_asn_uint24_to_OCTET_STRING(sess->s_nssai.sd, s_NSSAI->sD);
|
||||
}
|
||||
|
||||
transfer = &PDUSessionItem->pDUSessionResourceSetupRequestTransfer;
|
||||
transfer->size = sess->transfer.pdu_session_resource_setup_request->len;
|
||||
transfer->buf = CALLOC(transfer->size, sizeof(uint8_t));
|
||||
memcpy(transfer->buf,
|
||||
sess->transfer.pdu_session_resource_setup_request->data,
|
||||
transfer->size);
|
||||
}
|
||||
|
||||
ogs_assert(PDUSessionList);
|
||||
ogs_assert(PDUSessionList->list.count);
|
||||
|
||||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *ngap_sess_build_pdu_session_resource_setup_request(
|
||||
amf_sess_t *sess, ogs_pkbuf_t *gmmbuf, ogs_pkbuf_t *n2smbuf)
|
||||
{
|
||||
amf_ue_t *amf_ue = NULL;
|
||||
|
@ -886,8 +1366,8 @@ ogs_pkbuf_t *ngap_build_pdu_session_resource_setup_request(
|
|||
|
||||
PDUSessionItem->pDUSessionID = sess->psi;
|
||||
|
||||
pDUSessionNAS_PDU = CALLOC(1, sizeof(NGAP_NAS_PDU_t));
|
||||
PDUSessionItem->pDUSessionNAS_PDU = pDUSessionNAS_PDU;
|
||||
PDUSessionItem->pDUSessionNAS_PDU =
|
||||
pDUSessionNAS_PDU = CALLOC(1, sizeof(NGAP_NAS_PDU_t));
|
||||
pDUSessionNAS_PDU->size = gmmbuf->len;
|
||||
pDUSessionNAS_PDU->buf = CALLOC(pDUSessionNAS_PDU->size, sizeof(uint8_t));
|
||||
memcpy(pDUSessionNAS_PDU->buf, gmmbuf->data, pDUSessionNAS_PDU->size);
|
||||
|
@ -993,8 +1473,7 @@ ogs_pkbuf_t *ngap_build_pdu_session_resource_modify_request(
|
|||
|
||||
PDUSessionItem->pDUSessionID = sess->psi;
|
||||
|
||||
nAS_PDU = CALLOC(1, sizeof(NGAP_NAS_PDU_t));
|
||||
PDUSessionItem->nAS_PDU = nAS_PDU;
|
||||
PDUSessionItem->nAS_PDU = nAS_PDU = CALLOC(1, sizeof(NGAP_NAS_PDU_t));
|
||||
nAS_PDU->size = gmmbuf->len;
|
||||
nAS_PDU->buf = CALLOC(nAS_PDU->size, sizeof(uint8_t));
|
||||
memcpy(nAS_PDU->buf, gmmbuf->data, nAS_PDU->size);
|
||||
|
|
|
@ -31,15 +31,19 @@ ogs_pkbuf_t *ngap_build_ng_setup_failure(
|
|||
NGAP_Cause_PR group, long cause, long time_to_wait);
|
||||
|
||||
ogs_pkbuf_t *ngap_build_downlink_nas_transport(
|
||||
ran_ue_t *ran_ue, ogs_pkbuf_t *gmmbuf);
|
||||
ran_ue_t *ran_ue, ogs_pkbuf_t *gmmbuf, bool ue_ambr, bool allowed_nssai);
|
||||
|
||||
ogs_pkbuf_t *ngap_build_initial_context_setup_request(
|
||||
ogs_pkbuf_t *ngap_ue_build_initial_context_setup_request(
|
||||
amf_ue_t *amf_ue, ogs_pkbuf_t *gmmbuf);
|
||||
ogs_pkbuf_t *ngap_sess_build_initial_context_setup_request(
|
||||
amf_sess_t *sess, ogs_pkbuf_t *n1smbuf, ogs_pkbuf_t *n2smbuf);
|
||||
ogs_pkbuf_t *ngap_build_ue_context_modification_request(amf_ue_t *amf_ue);
|
||||
ogs_pkbuf_t *ngap_build_ue_context_release_command(
|
||||
ran_ue_t *ran_ue, NGAP_Cause_PR group, long cause);
|
||||
|
||||
ogs_pkbuf_t *ngap_build_pdu_session_resource_setup_request(
|
||||
ogs_pkbuf_t *ngap_ue_build_pdu_session_resource_setup_request(
|
||||
amf_ue_t *amf_ue, ogs_pkbuf_t *gmmbuf);
|
||||
ogs_pkbuf_t *ngap_sess_build_pdu_session_resource_setup_request(
|
||||
amf_sess_t *sess, ogs_pkbuf_t *gmmbuf, ogs_pkbuf_t *n2smbuf);
|
||||
ogs_pkbuf_t *ngap_build_pdu_session_resource_modify_request(
|
||||
amf_sess_t *sess, ogs_pkbuf_t *gmmbuf, ogs_pkbuf_t *n2smbuf);
|
||||
|
|
|
@ -333,7 +333,9 @@ void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message)
|
|||
NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL;
|
||||
NGAP_NAS_PDU_t *NAS_PDU = NULL;
|
||||
NGAP_UserLocationInformation_t *UserLocationInformation = NULL;
|
||||
NGAP_UserLocationInformationNR_t *UserLocationInformationNR = NULL;
|
||||
NGAP_FiveG_S_TMSI_t *FiveG_S_TMSI = NULL;
|
||||
NGAP_UEContextRequest_t *UEContextRequest = NULL;
|
||||
|
||||
ogs_assert(gnb);
|
||||
ogs_assert(gnb->sctp.sock);
|
||||
|
@ -362,6 +364,9 @@ void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message)
|
|||
case NGAP_ProtocolIE_ID_id_FiveG_S_TMSI:
|
||||
FiveG_S_TMSI = &ie->value.choice.FiveG_S_TMSI;
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_UEContextRequest:
|
||||
UEContextRequest = &ie->value.choice.UEContextRequest;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -448,24 +453,8 @@ void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!NAS_PDU) {
|
||||
ogs_error("No NAS_PDU");
|
||||
ngap_send_error_indication(gnb, &ran_ue->ran_ue_ngap_id, NULL,
|
||||
NGAP_Cause_PR_protocol, NGAP_CauseProtocol_semantic_error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (UserLocationInformation->present ==
|
||||
if (UserLocationInformation->present !=
|
||||
NGAP_UserLocationInformation_PR_userLocationInformationNR) {
|
||||
NGAP_UserLocationInformationNR_t *userLocationInformationNR =
|
||||
UserLocationInformation->choice.userLocationInformationNR;
|
||||
|
||||
ogs_ngap_ASN_to_nr_cgi(
|
||||
&userLocationInformationNR->nR_CGI, &ran_ue->saved.nr_cgi);
|
||||
ogs_ngap_ASN_to_5gs_tai(
|
||||
&userLocationInformationNR->tAI, &ran_ue->saved.tai);
|
||||
|
||||
} else {
|
||||
ogs_error("Not implemented UserLocationInformation[%d]",
|
||||
UserLocationInformation->present);
|
||||
ngap_send_error_indication(gnb, &ran_ue->ran_ue_ngap_id, NULL,
|
||||
|
@ -473,13 +462,33 @@ void ngap_handle_initial_ue_message(amf_gnb_t *gnb, ogs_ngap_message_t *message)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!NAS_PDU) {
|
||||
ogs_error("No NAS_PDU");
|
||||
ngap_send_error_indication(gnb, &ran_ue->ran_ue_ngap_id, NULL,
|
||||
NGAP_Cause_PR_protocol, NGAP_CauseProtocol_semantic_error);
|
||||
return;
|
||||
}
|
||||
|
||||
UserLocationInformationNR =
|
||||
UserLocationInformation->choice.userLocationInformationNR;
|
||||
ogs_assert(UserLocationInformationNR);
|
||||
ogs_ngap_ASN_to_nr_cgi(
|
||||
&UserLocationInformationNR->nR_CGI, &ran_ue->saved.nr_cgi);
|
||||
ogs_ngap_ASN_to_5gs_tai(
|
||||
&UserLocationInformationNR->tAI, &ran_ue->saved.tai);
|
||||
|
||||
ogs_info(" RAN_UE_NGAP_ID[%d] AMF_UE_NGAP_ID[%lld] "
|
||||
"TAC[%d] CellID[0x%llx]",
|
||||
ran_ue->ran_ue_ngap_id, (long long)ran_ue->amf_ue_ngap_id,
|
||||
ran_ue->saved.tai.tac.v, (long long)ran_ue->saved.nr_cgi.cell_id);
|
||||
|
||||
ngap_send_to_nas(ran_ue,
|
||||
NGAP_ProcedureCode_id_InitialUEMessage, NAS_PDU);
|
||||
if (UEContextRequest) {
|
||||
if (*UEContextRequest == NGAP_UEContextRequest_requested) {
|
||||
ran_ue->ue_context_requested = true;
|
||||
}
|
||||
}
|
||||
|
||||
ngap_send_to_nas(ran_ue, NGAP_ProcedureCode_id_InitialUEMessage, NAS_PDU);
|
||||
}
|
||||
|
||||
void ngap_handle_uplink_nas_transport(
|
||||
|
@ -1746,8 +1755,8 @@ void ngap_handle_path_switch_request(
|
|||
NGAP_EUTRAencryptionAlgorithms_t *eUTRAencryptionAlgorithms = NULL;
|
||||
NGAP_EUTRAintegrityProtectionAlgorithms_t
|
||||
*eUTRAintegrityProtectionAlgorithms = NULL;
|
||||
uint16_t nea = 0, nia = 0, eps_ea = 0, eps_ia = 0;
|
||||
uint8_t nea0 = 0, nia0 = 0, eps_ea0 = 0, eps_ia0 = 0;
|
||||
uint16_t nr_ea = 0, nr_ia = 0, eutra_ea = 0, eutra_ia = 0;
|
||||
uint8_t nr_ea0 = 0, nr_ia0 = 0, eutra_ea0 = 0, eutra_ia0 = 0;
|
||||
|
||||
NGAP_PDUSessionResourceToBeSwitchedDLItem_t *PDUSessionItem = NULL;
|
||||
OCTET_STRING_t *transfer = NULL;
|
||||
|
@ -1889,29 +1898,30 @@ void ngap_handle_path_switch_request(
|
|||
eUTRAintegrityProtectionAlgorithms =
|
||||
&UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms;
|
||||
|
||||
memcpy(&nea, nRencryptionAlgorithms->buf, sizeof(nea));
|
||||
nea = be16toh(nea);
|
||||
nea0 = amf_ue->ue_security_capability.nea0;
|
||||
amf_ue->ue_security_capability.nea = nea >> 9;
|
||||
amf_ue->ue_security_capability.nea0 = nea0;
|
||||
memcpy(&nr_ea, nRencryptionAlgorithms->buf, sizeof(nr_ea));
|
||||
nr_ea = be16toh(nr_ea);
|
||||
nr_ea0 = amf_ue->ue_security_capability.nr_ea0;
|
||||
amf_ue->ue_security_capability.nr_ea = nr_ea >> 9;
|
||||
amf_ue->ue_security_capability.nr_ea0 = nr_ea0;
|
||||
|
||||
memcpy(&nia, nRintegrityProtectionAlgorithms->buf, sizeof(nia));
|
||||
nia = be16toh(nia);
|
||||
nia0 = amf_ue->ue_security_capability.nia0;
|
||||
amf_ue->ue_security_capability.nia = nia >> 9;
|
||||
amf_ue->ue_security_capability.nia0 = nia0;
|
||||
memcpy(&nr_ia, nRintegrityProtectionAlgorithms->buf, sizeof(nr_ia));
|
||||
nr_ia = be16toh(nr_ia);
|
||||
nr_ia0 = amf_ue->ue_security_capability.nr_ia0;
|
||||
amf_ue->ue_security_capability.nr_ia = nr_ia >> 9;
|
||||
amf_ue->ue_security_capability.nr_ia0 = nr_ia0;
|
||||
|
||||
memcpy(&eps_ea, eUTRAencryptionAlgorithms->buf, sizeof(eps_ea));
|
||||
eps_ea = be16toh(eps_ea);
|
||||
eps_ea0 = amf_ue->ue_security_capability.eps_ea0;
|
||||
amf_ue->ue_security_capability.eps_ea = eps_ea >> 9;
|
||||
amf_ue->ue_security_capability.eps_ea0 = eps_ea0;
|
||||
memcpy(&eutra_ea, eUTRAencryptionAlgorithms->buf, sizeof(eutra_ea));
|
||||
eutra_ea = be16toh(eutra_ea);
|
||||
eutra_ea0 = amf_ue->ue_security_capability.eutra_ea0;
|
||||
amf_ue->ue_security_capability.eutra_ea = eutra_ea >> 9;
|
||||
amf_ue->ue_security_capability.eutra_ea0 = eutra_ea0;
|
||||
|
||||
memcpy(&eps_ia, eUTRAintegrityProtectionAlgorithms->buf, sizeof(eps_ia));
|
||||
eps_ia = be16toh(eps_ia);
|
||||
eps_ia0 = amf_ue->ue_security_capability.eps_ia0;
|
||||
amf_ue->ue_security_capability.eps_ia = eps_ia >> 9;
|
||||
amf_ue->ue_security_capability.eps_ia0 = eps_ia0;
|
||||
memcpy(&eutra_ia,
|
||||
eUTRAintegrityProtectionAlgorithms->buf, sizeof(eutra_ia));
|
||||
eutra_ia = be16toh(eutra_ia);
|
||||
eutra_ia0 = amf_ue->ue_security_capability.eutra_ia0;
|
||||
amf_ue->ue_security_capability.eutra_ia = eutra_ia >> 9;
|
||||
amf_ue->ue_security_capability.eutra_ia0 = eutra_ia0;
|
||||
|
||||
if (!SECURITY_CONTEXT_IS_VALID(amf_ue)) {
|
||||
ogs_error("No Security Context");
|
||||
|
|
|
@ -250,20 +250,6 @@ void ngap_send_ng_setup_failure(
|
|||
ngap_send_to_gnb(gnb, ngap_buffer, NGAP_NON_UE_SIGNALLING));
|
||||
}
|
||||
|
||||
void ngap_send_initial_context_setup_request(amf_ue_t *amf_ue)
|
||||
{
|
||||
int rv;
|
||||
ogs_pkbuf_t *ngapbuf = NULL;
|
||||
|
||||
ogs_assert(amf_ue);
|
||||
|
||||
ngapbuf = ngap_build_initial_context_setup_request(amf_ue, NULL);
|
||||
ogs_expect_or_return(ngapbuf);
|
||||
|
||||
rv = nas_5gs_send_to_gnb(amf_ue, ngapbuf);
|
||||
ogs_expect(rv == OGS_OK);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void ngap_send_ue_context_modification_request(amf_ue_t *amf_ue)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,6 @@ void ngap_send_ng_setup_response(amf_gnb_t *gnb);
|
|||
void ngap_send_ng_setup_failure(
|
||||
amf_gnb_t *gnb, NGAP_Cause_PR group, long cause);
|
||||
|
||||
void ngap_send_initial_context_setup_request(amf_ue_t *amf_ue);
|
||||
void ngap_send_ue_context_modification_request(amf_ue_t *amf_ue);
|
||||
|
||||
void ngap_send_ran_ue_context_release_command(
|
||||
|
|
|
@ -206,6 +206,7 @@ int emm_handle_attach_complete(
|
|||
ogs_nas_eps_message_t message;
|
||||
ogs_nas_eps_emm_information_t *emm_information =
|
||||
&message.emm.emm_information;
|
||||
ogs_nas_time_zone_t *local_time_zone = &emm_information->local_time_zone;
|
||||
ogs_nas_time_zone_and_time_t *universal_time_and_local_time_zone =
|
||||
&emm_information->universal_time_and_local_time_zone;
|
||||
ogs_nas_daylight_saving_time_t *network_daylight_saving_time =
|
||||
|
@ -214,13 +215,14 @@ int emm_handle_attach_complete(
|
|||
struct timeval tv;
|
||||
struct tm gmt, local;
|
||||
|
||||
ogs_assert(mme_ue);
|
||||
|
||||
ogs_info(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
|
||||
ogs_gettimeofday(&tv);
|
||||
ogs_gmtime(tv.tv_sec, &gmt);
|
||||
ogs_localtime(tv.tv_sec, &local);
|
||||
|
||||
ogs_assert(mme_ue);
|
||||
|
||||
ogs_info(" IMSI[%s]", mme_ue->imsi_bcd);
|
||||
ogs_info(" UTC [%04d-%02d-%02dT%02d:%02d:%02d] Timezone[%d]/DST[%d]",
|
||||
gmt.tm_year+1900, gmt.tm_mon+1, gmt.tm_mday,
|
||||
gmt.tm_hour, gmt.tm_min, gmt.tm_sec,
|
||||
|
@ -245,6 +247,31 @@ int emm_handle_attach_complete(
|
|||
message.emm.h.protocol_discriminator = OGS_NAS_PROTOCOL_DISCRIMINATOR_EMM;
|
||||
message.emm.h.message_type = OGS_NAS_EPS_EMM_INFORMATION;
|
||||
|
||||
if (mme_self()->full_name.length) {
|
||||
emm_information->presencemask |=
|
||||
OGS_NAS_EPS_EMM_INFORMATION_FULL_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&emm_information->full_name_for_network,
|
||||
&mme_self()->full_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
|
||||
if (mme_self()->short_name.length) {
|
||||
emm_information->presencemask |=
|
||||
OGS_NAS_EPS_EMM_INFORMATION_SHORT_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&emm_information->short_name_for_network,
|
||||
&mme_self()->short_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
|
||||
emm_information->presencemask |=
|
||||
OGS_NAS_EPS_EMM_INFORMATION_LOCAL_TIME_ZONE_PRESENT;
|
||||
|
||||
if (local.tm_gmtoff >= 0) {
|
||||
*local_time_zone = OGS_NAS_TIME_TO_BCD(local.tm_gmtoff / 900);
|
||||
} else {
|
||||
*local_time_zone = OGS_NAS_TIME_TO_BCD((-local.tm_gmtoff) / 900);
|
||||
*local_time_zone |= 0x08;
|
||||
}
|
||||
ogs_debug(" Timezone:0x%x", *local_time_zone);
|
||||
|
||||
emm_information->presencemask |=
|
||||
OGS_NAS_EPS_EMM_INFORMATION_UNIVERSAL_TIME_AND_LOCAL_TIME_ZONE_PRESENT;
|
||||
universal_time_and_local_time_zone->year =
|
||||
|
@ -259,35 +286,12 @@ int emm_handle_attach_complete(
|
|||
OGS_NAS_TIME_TO_BCD(gmt.tm_min);
|
||||
universal_time_and_local_time_zone->sec =
|
||||
OGS_NAS_TIME_TO_BCD(gmt.tm_sec);
|
||||
if (local.tm_gmtoff >= 0) {
|
||||
universal_time_and_local_time_zone->timezone =
|
||||
OGS_NAS_TIME_TO_BCD(local.tm_gmtoff / 900);
|
||||
} else {
|
||||
universal_time_and_local_time_zone->timezone =
|
||||
OGS_NAS_TIME_TO_BCD((-local.tm_gmtoff) / 900);
|
||||
universal_time_and_local_time_zone->timezone |= 0x08;
|
||||
}
|
||||
ogs_debug(" Timezone:0x%x",
|
||||
universal_time_and_local_time_zone->timezone);
|
||||
universal_time_and_local_time_zone->timezone = *local_time_zone;
|
||||
|
||||
emm_information->presencemask |=
|
||||
OGS_NAS_EPS_EMM_INFORMATION_NETWORK_DAYLIGHT_SAVING_TIME_PRESENT;
|
||||
network_daylight_saving_time->length = 1;
|
||||
|
||||
if (mme_self()->full_name.length) {
|
||||
emm_information->presencemask |=
|
||||
OGS_NAS_EPS_EMM_INFORMATION_FULL_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&emm_information->full_name_for_network,
|
||||
&mme_self()->full_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
|
||||
if (mme_self()->short_name.length) {
|
||||
emm_information->presencemask |=
|
||||
OGS_NAS_EPS_EMM_INFORMATION_SHORT_NAME_FOR_NETWORK_PRESENT;
|
||||
memcpy(&emm_information->short_name_for_network,
|
||||
&mme_self()->short_name, sizeof(ogs_nas_network_name_t));
|
||||
}
|
||||
|
||||
emmbuf = nas_eps_security_encode(mme_ue, &message);
|
||||
if (emmbuf) {
|
||||
rv = nas_eps_send_to_downlink_nas_transport(mme_ue, emmbuf);
|
||||
|
|
|
@ -112,7 +112,7 @@ ogs_pkbuf_t *gsm_build_pdu_session_establishment_accept(smf_sess_t *sess)
|
|||
qos_rule[0].DQR_bit = 1;
|
||||
qos_rule[0].num_of_packet_filter = 1;
|
||||
|
||||
qos_rule[0].pf[0].direction = OGS_NAS_QOS_DIRECTION_UPLINK;
|
||||
qos_rule[0].pf[0].direction = OGS_NAS_QOS_DIRECTION_BIDIRECTIONAL;
|
||||
qos_rule[0].pf[0].identifier = 1;
|
||||
qos_rule[0].pf[0].content.length = 1;
|
||||
qos_rule[0].pf[0].content.num_of_component = 1;
|
||||
|
|
|
@ -874,11 +874,11 @@ test_ue_t *test_ue_add_by_suci(
|
|||
test_ue->nas.access_type = OGS_ACCESS_TYPE_3GPP;
|
||||
test_ue->abba_len = 2;
|
||||
|
||||
test_ue->ue_security_capability.nea = 0xf0;
|
||||
test_ue->ue_security_capability.nia = 0xf0;
|
||||
test_ue->ue_security_capability.nr_ea = 0xf0;
|
||||
test_ue->ue_security_capability.nr_ia = 0xf0;
|
||||
#if 0
|
||||
test_ue->ue_security_capability.eps_ea = 0xf0;
|
||||
test_ue->ue_security_capability.eps_ia = 0xf0;
|
||||
test_ue->ue_security_capability.eutra_ea = 0xf0;
|
||||
test_ue->ue_security_capability.eutra_ia = 0xf0;
|
||||
#endif
|
||||
test_ue->ue_network_capability.eea = 0xf0;
|
||||
test_ue->ue_network_capability.eia = 0xf0;
|
||||
|
|
|
@ -371,14 +371,22 @@ typedef struct test_ue_s {
|
|||
test_registration_request_param_t registration_request_param;
|
||||
test_service_request_param_t service_request_param;
|
||||
test_extended_service_request_param_t extended_service_request_param;
|
||||
uint8_t gmm_message_type; /* Last received 5GMM message type */
|
||||
|
||||
uint16_t pdu_session_status;
|
||||
uint16_t pdu_session_reactivation_result;
|
||||
|
||||
test_attach_request_param_t attach_request_param;
|
||||
test_tau_request_param_t tau_request_param;
|
||||
uint8_t emm_message_type; /* Last received EMM message type */
|
||||
|
||||
/* 5GC: Last received message */
|
||||
S1AP_ProcedureCode_t ngap_procedure_code;
|
||||
uint8_t gmm_message_type;
|
||||
uint8_t gsm_message_type;
|
||||
|
||||
/* EPC: Last received message */
|
||||
S1AP_ProcedureCode_t s1ap_procedure_code;
|
||||
uint8_t emm_message_type;
|
||||
uint8_t esm_message_type;
|
||||
|
||||
test_sess_t *sess;
|
||||
|
||||
|
|
|
@ -133,13 +133,15 @@ ogs_pkbuf_t *testgmm_build_registration_request(
|
|||
registration_request->presencemask |=
|
||||
OGS_NAS_5GS_REGISTRATION_REQUEST_UE_SECURITY_CAPABILITY_PRESENT;
|
||||
ue_security_capability->length = 2;
|
||||
ue_security_capability->nea = test_ue->ue_security_capability.nea;
|
||||
ue_security_capability->nia = test_ue->ue_security_capability.nia;
|
||||
if (test_ue->ue_security_capability.eps_ea ||
|
||||
test_ue->ue_security_capability.eps_ia) {
|
||||
ue_security_capability->nr_ea = test_ue->ue_security_capability.nr_ea;
|
||||
ue_security_capability->nr_ia = test_ue->ue_security_capability.nr_ia;
|
||||
if (test_ue->ue_security_capability.eutra_ea ||
|
||||
test_ue->ue_security_capability.eutra_ia) {
|
||||
ue_security_capability->length = 4;
|
||||
ue_security_capability->eps_ea = test_ue->ue_security_capability.eps_ea;
|
||||
ue_security_capability->eps_ia = test_ue->ue_security_capability.eps_ia;
|
||||
ue_security_capability->eutra_ea =
|
||||
test_ue->ue_security_capability.eutra_ea;
|
||||
ue_security_capability->eutra_ia =
|
||||
test_ue->ue_security_capability.eutra_ia;
|
||||
}
|
||||
|
||||
registration_request->presencemask |=
|
||||
|
|
|
@ -71,9 +71,12 @@ void testgmm_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
void testgsm_recv(test_sess_t *sess, ogs_pkbuf_t *pkbuf)
|
||||
{
|
||||
int rv;
|
||||
test_ue_t *test_ue = NULL;
|
||||
ogs_nas_5gs_message_t message;
|
||||
|
||||
ogs_assert(sess);
|
||||
test_ue = sess->test_ue;
|
||||
ogs_assert(test_ue);
|
||||
ogs_assert(pkbuf);
|
||||
|
||||
rv = ogs_nas_5gsm_decode(&message, pkbuf);
|
||||
|
@ -81,6 +84,7 @@ void testgsm_recv(test_sess_t *sess, ogs_pkbuf_t *pkbuf)
|
|||
|
||||
sess->pti = message.gsm.h.procedure_transaction_identity;
|
||||
|
||||
test_ue->gsm_message_type = message.gsm.h.message_type;
|
||||
switch (message.gsm.h.message_type) {
|
||||
case OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_ACCEPT:
|
||||
testgsm_handle_pdu_session_establishment_accept(sess,
|
||||
|
@ -177,6 +181,7 @@ void testesm_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
rv = ogs_nas_esm_decode(&message, pkbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
test_ue->esm_message_type = message.esm.h.message_type;
|
||||
switch (message.esm.h.message_type) {
|
||||
case OGS_NAS_EPS_ESM_INFORMATION_REQUEST:
|
||||
break;
|
||||
|
|
|
@ -160,7 +160,8 @@ ogs_pkbuf_t *testngap_build_ng_setup_request(uint32_t gnb_id, uint8_t bitsize)
|
|||
}
|
||||
|
||||
ogs_pkbuf_t *testngap_build_initial_ue_message(
|
||||
test_ue_t *test_ue, ogs_pkbuf_t *gmmbuf, bool s_tmsi)
|
||||
test_ue_t *test_ue, ogs_pkbuf_t *gmmbuf,
|
||||
bool s_tmsi, bool ue_context_requested)
|
||||
{
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
int i, j;
|
||||
|
@ -285,17 +286,19 @@ ogs_pkbuf_t *testngap_build_initial_ue_message(
|
|||
test_ue->nas_5gs_guti.m_tmsi, fiveG_TMSI);
|
||||
}
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialUEMessage_IEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialUEMessage->protocolIEs, ie);
|
||||
if (ue_context_requested) {
|
||||
ie = CALLOC(1, sizeof(NGAP_InitialUEMessage_IEs_t));
|
||||
ASN_SEQUENCE_ADD(&InitialUEMessage->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_UEContextRequest;
|
||||
ie->criticality = NGAP_Criticality_ignore;
|
||||
ie->value.present =
|
||||
NGAP_InitialUEMessage_IEs__value_PR_UEContextRequest;
|
||||
ie->id = NGAP_ProtocolIE_ID_id_UEContextRequest;
|
||||
ie->criticality = NGAP_Criticality_ignore;
|
||||
ie->value.present =
|
||||
NGAP_InitialUEMessage_IEs__value_PR_UEContextRequest;
|
||||
|
||||
UEContextRequest = &ie->value.choice.UEContextRequest;
|
||||
UEContextRequest = &ie->value.choice.UEContextRequest;
|
||||
|
||||
*UEContextRequest = NGAP_UEContextRequest_requested;
|
||||
*UEContextRequest = NGAP_UEContextRequest_requested;
|
||||
}
|
||||
|
||||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
@ -789,7 +792,99 @@ ogs_pkbuf_t *testngap_build_ue_context_release_complete(test_ue_t *test_ue)
|
|||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *testngap_build_pdu_session_resource_setup_response(
|
||||
ogs_pkbuf_t *testngap_ue_build_pdu_session_resource_setup_response(
|
||||
test_ue_t *test_ue)
|
||||
{
|
||||
int rv;
|
||||
|
||||
test_sess_t *sess = NULL;
|
||||
|
||||
ogs_pkbuf_t *n2smbuf = NULL;
|
||||
ogs_pkbuf_t *ngapbuf = NULL;
|
||||
|
||||
NGAP_NGAP_PDU_t pdu;
|
||||
NGAP_SuccessfulOutcome_t *successfulOutcome = NULL;
|
||||
NGAP_PDUSessionResourceSetupResponse_t *PDUSessionResourceSetupResponse;
|
||||
|
||||
NGAP_PDUSessionResourceSetupResponseIEs_t *ie = NULL;
|
||||
NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL;
|
||||
NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL;
|
||||
NGAP_PDUSessionResourceSetupListSURes_t *PDUSessionList = NULL;
|
||||
NGAP_PDUSessionResourceSetupItemSURes_t *PDUSessionItem = NULL;
|
||||
OCTET_STRING_t *transfer = NULL;
|
||||
|
||||
ogs_assert(test_ue);
|
||||
|
||||
memset(&pdu, 0, sizeof (NGAP_NGAP_PDU_t));
|
||||
pdu.present = NGAP_NGAP_PDU_PR_successfulOutcome;
|
||||
pdu.choice.successfulOutcome = CALLOC(1, sizeof(NGAP_SuccessfulOutcome_t));
|
||||
|
||||
successfulOutcome = pdu.choice.successfulOutcome;
|
||||
successfulOutcome->procedureCode =
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup;
|
||||
successfulOutcome->criticality = NGAP_Criticality_reject;
|
||||
successfulOutcome->value.present =
|
||||
NGAP_SuccessfulOutcome__value_PR_PDUSessionResourceSetupResponse;
|
||||
|
||||
PDUSessionResourceSetupResponse =
|
||||
&successfulOutcome->value.choice.PDUSessionResourceSetupResponse;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_PDUSessionResourceSetupResponseIEs_t));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionResourceSetupResponse->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
|
||||
ie->criticality = NGAP_Criticality_ignore;
|
||||
ie->value.present =
|
||||
NGAP_PDUSessionResourceSetupResponseIEs__value_PR_AMF_UE_NGAP_ID;
|
||||
|
||||
AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID;
|
||||
|
||||
ie = CALLOC(1, sizeof(NGAP_PDUSessionResourceSetupResponseIEs_t));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionResourceSetupResponse->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
|
||||
ie->criticality = NGAP_Criticality_ignore;
|
||||
ie->value.present =
|
||||
NGAP_PDUSessionResourceSetupResponseIEs__value_PR_RAN_UE_NGAP_ID;
|
||||
|
||||
RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID;
|
||||
|
||||
asn_uint642INTEGER(AMF_UE_NGAP_ID, test_ue->amf_ue_ngap_id);
|
||||
*RAN_UE_NGAP_ID = test_ue->ran_ue_ngap_id;
|
||||
|
||||
ogs_list_for_each(&test_ue->sess_list, sess) {
|
||||
if (!PDUSessionList) {
|
||||
ie = CALLOC(1, sizeof(NGAP_PDUSessionResourceSetupResponseIEs_t));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionResourceSetupResponse->protocolIEs, ie);
|
||||
|
||||
ie->id = NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListSURes;
|
||||
ie->criticality = NGAP_Criticality_reject;
|
||||
ie->value.present = NGAP_PDUSessionResourceSetupResponseIEs__value_PR_PDUSessionResourceSetupListSURes;
|
||||
|
||||
PDUSessionList = &ie->value.choice.PDUSessionResourceSetupListSURes;
|
||||
}
|
||||
|
||||
PDUSessionItem =
|
||||
CALLOC(1, sizeof(struct NGAP_PDUSessionResourceSetupItemSURes));
|
||||
ASN_SEQUENCE_ADD(&PDUSessionList->list, PDUSessionItem);
|
||||
|
||||
PDUSessionItem->pDUSessionID = sess->psi;
|
||||
|
||||
n2smbuf = testngap_build_pdu_session_resource_setup_response_trasfer(
|
||||
sess);
|
||||
ogs_assert(n2smbuf);
|
||||
transfer = &PDUSessionItem->pDUSessionResourceSetupResponseTransfer;
|
||||
|
||||
transfer->size = n2smbuf->len;
|
||||
transfer->buf = CALLOC(transfer->size, sizeof(uint8_t));
|
||||
memcpy(transfer->buf, n2smbuf->data, transfer->size);
|
||||
ogs_pkbuf_free(n2smbuf);
|
||||
}
|
||||
|
||||
return ogs_ngap_encode(&pdu);
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *testngap_sess_build_pdu_session_resource_setup_response(
|
||||
test_sess_t *sess)
|
||||
{
|
||||
int rv;
|
||||
|
@ -1173,7 +1268,7 @@ ogs_pkbuf_t *testngap_build_path_switch_request(test_ue_t *test_ue)
|
|||
nRencryptionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->nRencryptionAlgorithms.buf[0] =
|
||||
(test_ue->ue_security_capability.nea << 1);
|
||||
(test_ue->ue_security_capability.nr_ea << 1);
|
||||
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.buf =
|
||||
|
@ -1181,7 +1276,7 @@ ogs_pkbuf_t *testngap_build_path_switch_request(test_ue_t *test_ue)
|
|||
nRintegrityProtectionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->nRintegrityProtectionAlgorithms.buf[0] =
|
||||
(test_ue->ue_security_capability.nia << 1);
|
||||
(test_ue->ue_security_capability.nr_ia << 1);
|
||||
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.buf =
|
||||
|
@ -1189,7 +1284,7 @@ ogs_pkbuf_t *testngap_build_path_switch_request(test_ue_t *test_ue)
|
|||
eUTRAencryptionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->eUTRAencryptionAlgorithms.buf[0] =
|
||||
(test_ue->ue_security_capability.eps_ea << 1);
|
||||
(test_ue->ue_security_capability.eutra_ea << 1);
|
||||
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.size = 2;
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.buf =
|
||||
|
@ -1197,7 +1292,7 @@ ogs_pkbuf_t *testngap_build_path_switch_request(test_ue_t *test_ue)
|
|||
eUTRAintegrityProtectionAlgorithms.size, sizeof(uint8_t));
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.bits_unused = 0;
|
||||
UESecurityCapabilities->eUTRAintegrityProtectionAlgorithms.buf[0] =
|
||||
(test_ue->ue_security_capability.eps_ia << 1);
|
||||
(test_ue->ue_security_capability.eutra_ia << 1);
|
||||
|
||||
ogs_list_for_each(&test_ue->sess_list, sess) {
|
||||
PDUSessionItem =
|
||||
|
|
|
@ -26,7 +26,8 @@ extern "C" {
|
|||
|
||||
ogs_pkbuf_t *testngap_build_ng_setup_request(uint32_t gnb_id, uint8_t bitsize);
|
||||
ogs_pkbuf_t *testngap_build_initial_ue_message(
|
||||
test_ue_t *test_ue, ogs_pkbuf_t *gmmbuf, bool s_tmsi);
|
||||
test_ue_t *test_ue, ogs_pkbuf_t *gmmbuf,
|
||||
bool s_tmsi, bool ue_context_requested);
|
||||
ogs_pkbuf_t *testngap_build_uplink_nas_transport(
|
||||
test_ue_t *test_ue, ogs_pkbuf_t *gmmbuf);
|
||||
|
||||
|
@ -42,7 +43,9 @@ ogs_pkbuf_t *testngap_build_ue_context_release_request(test_ue_t *test_ue,
|
|||
NGAP_Cause_PR group, long cause, bool pdu_session);
|
||||
ogs_pkbuf_t *testngap_build_ue_context_release_complete(test_ue_t *test_ue);
|
||||
|
||||
ogs_pkbuf_t *testngap_build_pdu_session_resource_setup_response(
|
||||
ogs_pkbuf_t *testngap_ue_build_pdu_session_resource_setup_response(
|
||||
test_ue_t *test_ue);
|
||||
ogs_pkbuf_t *testngap_sess_build_pdu_session_resource_setup_response(
|
||||
test_sess_t *sess);
|
||||
ogs_pkbuf_t *testngap_build_pdu_session_resource_modify_response(
|
||||
test_bearer_t *qos_flow);
|
||||
|
|
|
@ -121,7 +121,9 @@ void testngap_handle_downlink_nas_transport(
|
|||
void testngap_handle_initial_context_setup_request(
|
||||
test_ue_t *test_ue, ogs_ngap_message_t *message)
|
||||
{
|
||||
int i;
|
||||
test_sess_t *sess = NULL;
|
||||
test_bearer_t *qos_flow = NULL;
|
||||
int rv, i, j, k, l;
|
||||
char buf[OGS_ADDRSTRLEN];
|
||||
|
||||
NGAP_NGAP_PDU_t pdu;
|
||||
|
@ -131,6 +133,19 @@ void testngap_handle_initial_context_setup_request(
|
|||
NGAP_InitialContextSetupRequestIEs_t *ie = NULL;
|
||||
NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL;
|
||||
NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL;
|
||||
|
||||
NGAP_PDUSessionResourceSetupListCxtReq_t *PDUSessionList = NULL;
|
||||
NGAP_PDUSessionResourceSetupItemCxtReq_t *PDUSessionItem = NULL;
|
||||
|
||||
NGAP_PDUSessionResourceSetupRequestTransfer_t n2sm_message;
|
||||
NGAP_PDUSessionResourceSetupRequestTransferIEs_t *ie2 = NULL;
|
||||
NGAP_UPTransportLayerInformation_t *UPTransportLayerInformation = NULL;
|
||||
NGAP_GTPTunnel_t *gTPTunnel = NULL;
|
||||
NGAP_QosFlowSetupRequestList_t *QosFlowSetupRequestList = NULL;
|
||||
NGAP_QosFlowSetupRequestItem_t *QosFlowSetupRequestItem = NULL;
|
||||
OCTET_STRING_t *transfer = NULL;
|
||||
ogs_pkbuf_t *n2smbuf = NULL;
|
||||
|
||||
NGAP_NAS_PDU_t *NAS_PDU = NULL;
|
||||
|
||||
ogs_assert(test_ue);
|
||||
|
@ -151,6 +166,10 @@ void testngap_handle_initial_context_setup_request(
|
|||
case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID:
|
||||
RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID;
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListCxtReq:
|
||||
PDUSessionList =
|
||||
&ie->value.choice.PDUSessionResourceSetupListCxtReq;
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_NAS_PDU:
|
||||
NAS_PDU = &ie->value.choice.NAS_PDU;
|
||||
break;
|
||||
|
@ -168,6 +187,79 @@ void testngap_handle_initial_context_setup_request(
|
|||
test_ue->ran_ue_ngap_id = *RAN_UE_NGAP_ID;
|
||||
}
|
||||
|
||||
if (PDUSessionList) {
|
||||
for (j = 0; j < PDUSessionList->list.count; j++) {
|
||||
PDUSessionItem = (NGAP_PDUSessionResourceSetupItemCxtReq_t *)
|
||||
PDUSessionList->list.array[j];
|
||||
ogs_assert(PDUSessionItem);
|
||||
|
||||
sess = test_sess_find_by_psi(
|
||||
test_ue, PDUSessionItem->pDUSessionID);
|
||||
ogs_assert(sess);
|
||||
|
||||
if (PDUSessionItem->nAS_PDU)
|
||||
testngap_send_to_nas(test_ue, PDUSessionItem->nAS_PDU);
|
||||
transfer = &PDUSessionItem->
|
||||
pDUSessionResourceSetupRequestTransfer;
|
||||
ogs_assert(transfer);
|
||||
|
||||
n2smbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_SDU_LEN);
|
||||
ogs_assert(n2smbuf);
|
||||
ogs_pkbuf_put_data(n2smbuf, transfer->buf, transfer->size);
|
||||
|
||||
rv = ogs_asn_decode(
|
||||
&asn_DEF_NGAP_PDUSessionResourceSetupRequestTransfer,
|
||||
&n2sm_message, sizeof(n2sm_message), n2smbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
for (k = 0; k < n2sm_message.protocolIEs.list.count; k++) {
|
||||
ie2 = n2sm_message.protocolIEs.list.array[k];
|
||||
switch (ie2->id) {
|
||||
case NGAP_ProtocolIE_ID_id_QosFlowSetupRequestList:
|
||||
QosFlowSetupRequestList =
|
||||
&ie2->value.choice.QosFlowSetupRequestList;
|
||||
ogs_assert(QosFlowSetupRequestList);
|
||||
for (l = 0;
|
||||
l < QosFlowSetupRequestList->list.count; l++) {
|
||||
QosFlowSetupRequestItem =
|
||||
(struct NGAP_QosFlowSetupRequestItem *)
|
||||
QosFlowSetupRequestList->list.array[l];
|
||||
ogs_assert(QosFlowSetupRequestItem);
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess,
|
||||
QosFlowSetupRequestItem->qosFlowIdentifier);
|
||||
if (!qos_flow)
|
||||
qos_flow = test_qos_flow_add(sess);
|
||||
|
||||
qos_flow->qfi =
|
||||
QosFlowSetupRequestItem->qosFlowIdentifier;
|
||||
}
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLInformation:
|
||||
UPTransportLayerInformation =
|
||||
&ie2->value.choice.UPTransportLayerInformation;
|
||||
gTPTunnel =
|
||||
UPTransportLayerInformation->choice.gTPTunnel;
|
||||
ogs_assert(gTPTunnel);
|
||||
|
||||
ogs_asn_BIT_STRING_to_ip(
|
||||
&gTPTunnel->transportLayerAddress,
|
||||
&sess->upf_n3_ip);
|
||||
ogs_asn_OCTET_STRING_to_uint32(
|
||||
&gTPTunnel->gTP_TEID, &sess->upf_n3_teid);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ogs_asn_free(
|
||||
&asn_DEF_NGAP_PDUSessionResourceSetupRequestTransfer,
|
||||
&n2sm_message);
|
||||
|
||||
ogs_pkbuf_free(n2smbuf);
|
||||
}
|
||||
}
|
||||
|
||||
if (NAS_PDU)
|
||||
testngap_send_to_nas(test_ue, NAS_PDU);
|
||||
}
|
||||
|
@ -232,6 +324,9 @@ void testngap_handle_pdu_session_resource_setup_request(
|
|||
NGAP_InitiatingMessage_t *initiatingMessage = NULL;
|
||||
NGAP_PDUSessionResourceSetupRequest_t *PDUSessionResourceSetupRequest;
|
||||
|
||||
NGAP_AMF_UE_NGAP_ID_t *AMF_UE_NGAP_ID = NULL;
|
||||
NGAP_RAN_UE_NGAP_ID_t *RAN_UE_NGAP_ID = NULL;
|
||||
|
||||
NGAP_PDUSessionResourceSetupListSUReq_t *PDUSessionList = NULL;
|
||||
NGAP_PDUSessionResourceSetupItemSUReq_t *PDUSessionItem = NULL;
|
||||
|
||||
|
@ -242,7 +337,6 @@ void testngap_handle_pdu_session_resource_setup_request(
|
|||
NGAP_PDUSessionResourceSetupRequestTransferIEs_t *ie2 = NULL;
|
||||
NGAP_UPTransportLayerInformation_t *UPTransportLayerInformation = NULL;
|
||||
NGAP_GTPTunnel_t *gTPTunnel = NULL;
|
||||
NGAP_PDUSessionType_t *PDUSessionType = NULL;
|
||||
NGAP_QosFlowSetupRequestList_t *QosFlowSetupRequestList = NULL;
|
||||
NGAP_QosFlowSetupRequestItem_t *QosFlowSetupRequestItem = NULL;
|
||||
OCTET_STRING_t *transfer = NULL;
|
||||
|
@ -261,85 +355,102 @@ void testngap_handle_pdu_session_resource_setup_request(
|
|||
i++) {
|
||||
ie = PDUSessionResourceSetupRequest->protocolIEs.list.array[i];
|
||||
switch (ie->id) {
|
||||
case NGAP_ProtocolIE_ID_id_AMF_UE_NGAP_ID:
|
||||
AMF_UE_NGAP_ID = &ie->value.choice.AMF_UE_NGAP_ID;
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_RAN_UE_NGAP_ID:
|
||||
RAN_UE_NGAP_ID = &ie->value.choice.RAN_UE_NGAP_ID;
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_PDUSessionResourceSetupListSUReq:
|
||||
PDUSessionList = &ie->value.choice.PDUSessionResourceSetupListSUReq;
|
||||
ogs_assert(PDUSessionList);
|
||||
for (j = 0; j < PDUSessionList->list.count; j++) {
|
||||
PDUSessionItem = (NGAP_PDUSessionResourceSetupItemSUReq_t *)
|
||||
PDUSessionList->list.array[j];
|
||||
ogs_assert(PDUSessionItem);
|
||||
|
||||
sess = test_sess_find_by_psi(
|
||||
test_ue, PDUSessionItem->pDUSessionID);
|
||||
ogs_assert(sess);
|
||||
|
||||
if (PDUSessionItem->pDUSessionNAS_PDU)
|
||||
testngap_send_to_nas(
|
||||
test_ue, PDUSessionItem->pDUSessionNAS_PDU);
|
||||
transfer = &PDUSessionItem->
|
||||
pDUSessionResourceSetupRequestTransfer;
|
||||
ogs_assert(transfer);
|
||||
|
||||
n2smbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_SDU_LEN);
|
||||
ogs_assert(n2smbuf);
|
||||
ogs_pkbuf_put_data(n2smbuf, transfer->buf, transfer->size);
|
||||
|
||||
rv = ogs_asn_decode(
|
||||
&asn_DEF_NGAP_PDUSessionResourceSetupRequestTransfer,
|
||||
&n2sm_message, sizeof(n2sm_message), n2smbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
for (k = 0; k < n2sm_message.protocolIEs.list.count; k++) {
|
||||
ie2 = n2sm_message.protocolIEs.list.array[k];
|
||||
switch (ie2->id) {
|
||||
case NGAP_ProtocolIE_ID_id_QosFlowSetupRequestList:
|
||||
QosFlowSetupRequestList =
|
||||
&ie2->value.choice.QosFlowSetupRequestList;
|
||||
ogs_assert(QosFlowSetupRequestList);
|
||||
for (l = 0;
|
||||
l < QosFlowSetupRequestList->list.count; l++) {
|
||||
QosFlowSetupRequestItem =
|
||||
(struct NGAP_QosFlowSetupRequestItem *)
|
||||
QosFlowSetupRequestList->list.array[l];
|
||||
ogs_assert(QosFlowSetupRequestItem);
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess,
|
||||
QosFlowSetupRequestItem->qosFlowIdentifier);
|
||||
if (!qos_flow)
|
||||
qos_flow = test_qos_flow_add(sess);
|
||||
|
||||
qos_flow->qfi =
|
||||
QosFlowSetupRequestItem->qosFlowIdentifier;
|
||||
}
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLInformation:
|
||||
UPTransportLayerInformation =
|
||||
&ie2->value.choice.UPTransportLayerInformation;
|
||||
gTPTunnel =
|
||||
UPTransportLayerInformation->choice.gTPTunnel;
|
||||
ogs_assert(gTPTunnel);
|
||||
|
||||
ogs_asn_BIT_STRING_to_ip(
|
||||
&gTPTunnel->transportLayerAddress,
|
||||
&sess->upf_n3_ip);
|
||||
ogs_asn_OCTET_STRING_to_uint32(
|
||||
&gTPTunnel->gTP_TEID, &sess->upf_n3_teid);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ogs_asn_free(
|
||||
&asn_DEF_NGAP_PDUSessionResourceSetupRequestTransfer,
|
||||
&n2sm_message);
|
||||
|
||||
ogs_pkbuf_free(n2smbuf);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (AMF_UE_NGAP_ID) {
|
||||
uint64_t amf_ue_ngap_id;
|
||||
asn_INTEGER2ulong(AMF_UE_NGAP_ID, (unsigned long *)&amf_ue_ngap_id);
|
||||
test_ue->amf_ue_ngap_id = (uint64_t)amf_ue_ngap_id;
|
||||
}
|
||||
if (RAN_UE_NGAP_ID) {
|
||||
test_ue->ran_ue_ngap_id = *RAN_UE_NGAP_ID;
|
||||
}
|
||||
|
||||
if (PDUSessionList) {
|
||||
for (j = 0; j < PDUSessionList->list.count; j++) {
|
||||
PDUSessionItem = (NGAP_PDUSessionResourceSetupItemSUReq_t *)
|
||||
PDUSessionList->list.array[j];
|
||||
ogs_assert(PDUSessionItem);
|
||||
|
||||
sess = test_sess_find_by_psi(
|
||||
test_ue, PDUSessionItem->pDUSessionID);
|
||||
ogs_assert(sess);
|
||||
|
||||
if (PDUSessionItem->pDUSessionNAS_PDU)
|
||||
testngap_send_to_nas(
|
||||
test_ue, PDUSessionItem->pDUSessionNAS_PDU);
|
||||
transfer = &PDUSessionItem->
|
||||
pDUSessionResourceSetupRequestTransfer;
|
||||
ogs_assert(transfer);
|
||||
|
||||
n2smbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_SDU_LEN);
|
||||
ogs_assert(n2smbuf);
|
||||
ogs_pkbuf_put_data(n2smbuf, transfer->buf, transfer->size);
|
||||
|
||||
rv = ogs_asn_decode(
|
||||
&asn_DEF_NGAP_PDUSessionResourceSetupRequestTransfer,
|
||||
&n2sm_message, sizeof(n2sm_message), n2smbuf);
|
||||
ogs_assert(rv == OGS_OK);
|
||||
|
||||
for (k = 0; k < n2sm_message.protocolIEs.list.count; k++) {
|
||||
ie2 = n2sm_message.protocolIEs.list.array[k];
|
||||
switch (ie2->id) {
|
||||
case NGAP_ProtocolIE_ID_id_QosFlowSetupRequestList:
|
||||
QosFlowSetupRequestList =
|
||||
&ie2->value.choice.QosFlowSetupRequestList;
|
||||
ogs_assert(QosFlowSetupRequestList);
|
||||
for (l = 0;
|
||||
l < QosFlowSetupRequestList->list.count; l++) {
|
||||
QosFlowSetupRequestItem =
|
||||
(struct NGAP_QosFlowSetupRequestItem *)
|
||||
QosFlowSetupRequestList->list.array[l];
|
||||
ogs_assert(QosFlowSetupRequestItem);
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess,
|
||||
QosFlowSetupRequestItem->qosFlowIdentifier);
|
||||
if (!qos_flow)
|
||||
qos_flow = test_qos_flow_add(sess);
|
||||
|
||||
qos_flow->qfi =
|
||||
QosFlowSetupRequestItem->qosFlowIdentifier;
|
||||
}
|
||||
break;
|
||||
case NGAP_ProtocolIE_ID_id_UL_NGU_UP_TNLInformation:
|
||||
UPTransportLayerInformation =
|
||||
&ie2->value.choice.UPTransportLayerInformation;
|
||||
gTPTunnel =
|
||||
UPTransportLayerInformation->choice.gTPTunnel;
|
||||
ogs_assert(gTPTunnel);
|
||||
|
||||
ogs_asn_BIT_STRING_to_ip(
|
||||
&gTPTunnel->transportLayerAddress,
|
||||
&sess->upf_n3_ip);
|
||||
ogs_asn_OCTET_STRING_to_uint32(
|
||||
&gTPTunnel->gTP_TEID, &sess->upf_n3_teid);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ogs_asn_free(
|
||||
&asn_DEF_NGAP_PDUSessionResourceSetupRequestTransfer,
|
||||
&n2sm_message);
|
||||
|
||||
ogs_pkbuf_free(n2smbuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void testngap_handle_pdu_session_resource_modify_request(
|
||||
|
@ -364,7 +475,6 @@ void testngap_handle_pdu_session_resource_modify_request(
|
|||
NGAP_PDUSessionResourceModifyRequestTransferIEs_t *ie2 = NULL;
|
||||
NGAP_UPTransportLayerInformation_t *UPTransportLayerInformation = NULL;
|
||||
NGAP_GTPTunnel_t *gTPTunnel = NULL;
|
||||
NGAP_PDUSessionType_t *PDUSessionType = NULL;
|
||||
NGAP_QosFlowAddOrModifyRequestList_t *QosFlowAddOrModifyRequestList = NULL;
|
||||
NGAP_QosFlowAddOrModifyRequestItem_t *QosFlowAddOrModifyRequestItem = NULL;
|
||||
OCTET_STRING_t *transfer = NULL;
|
||||
|
|
|
@ -43,6 +43,9 @@ void testngap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
initiatingMessage = pdu->choice.initiatingMessage;
|
||||
ogs_assert(initiatingMessage);
|
||||
|
||||
if (test_ue)
|
||||
test_ue->ngap_procedure_code = initiatingMessage->procedureCode;
|
||||
|
||||
switch (initiatingMessage->procedureCode) {
|
||||
case NGAP_ProcedureCode_id_DownlinkNASTransport:
|
||||
testngap_handle_downlink_nas_transport(test_ue, pdu);
|
||||
|
@ -75,6 +78,9 @@ void testngap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
successfulOutcome = pdu->choice.successfulOutcome;
|
||||
ogs_assert(successfulOutcome);
|
||||
|
||||
if (test_ue)
|
||||
test_ue->ngap_procedure_code = successfulOutcome->procedureCode;
|
||||
|
||||
switch (successfulOutcome->procedureCode) {
|
||||
case NGAP_ProcedureCode_id_NGSetup:
|
||||
testngap_handle_ng_setup_response(test_ue, pdu);
|
||||
|
@ -91,6 +97,9 @@ void testngap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
unsuccessfulOutcome = pdu->choice.unsuccessfulOutcome;
|
||||
ogs_assert(unsuccessfulOutcome);
|
||||
|
||||
if (test_ue)
|
||||
test_ue->ngap_procedure_code = unsuccessfulOutcome->procedureCode;
|
||||
|
||||
switch (unsuccessfulOutcome->procedureCode) {
|
||||
case NGAP_ProcedureCode_id_NGSetup:
|
||||
break;
|
||||
|
|
|
@ -42,6 +42,9 @@ void tests1ap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
initiatingMessage = pdu->choice.initiatingMessage;
|
||||
ogs_assert(initiatingMessage);
|
||||
|
||||
if (test_ue)
|
||||
test_ue->s1ap_procedure_code = initiatingMessage->procedureCode;
|
||||
|
||||
switch (initiatingMessage->procedureCode) {
|
||||
case S1AP_ProcedureCode_id_downlinkNASTransport:
|
||||
tests1ap_handle_downlink_nas_transport(test_ue, pdu);
|
||||
|
@ -85,6 +88,9 @@ void tests1ap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
successfulOutcome = pdu->choice.successfulOutcome;
|
||||
ogs_assert(successfulOutcome);
|
||||
|
||||
if (test_ue)
|
||||
test_ue->s1ap_procedure_code = successfulOutcome->procedureCode;
|
||||
|
||||
switch (successfulOutcome->procedureCode) {
|
||||
case S1AP_ProcedureCode_id_S1Setup:
|
||||
tests1ap_handle_s1_setup_response(pdu);
|
||||
|
@ -107,6 +113,9 @@ void tests1ap_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
|||
unsuccessfulOutcome = pdu->choice.unsuccessfulOutcome;
|
||||
ogs_assert(unsuccessfulOutcome);
|
||||
|
||||
if (test_ue)
|
||||
test_ue->s1ap_procedure_code = unsuccessfulOutcome->procedureCode;
|
||||
|
||||
switch (unsuccessfulOutcome->procedureCode) {
|
||||
case S1AP_ProcedureCode_id_S1Setup:
|
||||
break;
|
||||
|
|
|
@ -229,7 +229,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -273,10 +273,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap1);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -322,10 +326,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap1);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -333,8 +342,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu1, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap1, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -171,7 +171,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
test_ue->registration_request_param.gmm_capability = 1;
|
||||
gmmbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -204,10 +204,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -256,10 +260,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -267,8 +276,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -166,7 +166,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
test_ue->registration_request_param.gmm_capability = 1;
|
||||
gmmbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -213,7 +213,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
test_ue->registration_request_param.gmm_capability = 1;
|
||||
gmmbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -178,7 +178,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -209,10 +209,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -268,10 +272,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -279,8 +288,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -497,7 +506,7 @@ static void test2_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -528,10 +537,14 @@ static void test2_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -754,7 +767,7 @@ static void test3_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -785,10 +798,14 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -834,10 +851,15 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -845,8 +867,8 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -946,15 +968,19 @@ static void test3_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_registration_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Registration accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
|
@ -979,10 +1005,15 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -990,8 +1021,8 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1210,7 +1241,8 @@ static void test4_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(
|
||||
test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1241,10 +1273,14 @@ static void test4_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -1287,14 +1323,18 @@ static void test4_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf =
|
||||
testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -174,7 +174,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -205,10 +205,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
|
@ -248,10 +252,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/*
|
||||
* Related to issue #536. When running with VirtualBox 1 Core,
|
||||
|
|
|
@ -175,7 +175,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -219,10 +219,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -268,10 +272,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -279,8 +288,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -310,11 +319,12 @@ static void test1_func(abts_case *tc, void *data)
|
|||
ogs_pkbuf_free(recvbuf);
|
||||
#endif
|
||||
|
||||
/* Update Registration request type */
|
||||
/* Send Registration request
|
||||
* - Update Registration request type
|
||||
* - Uplink Data Status */
|
||||
test_ue->nas.registration.value =
|
||||
OGS_NAS_5GS_REGISTRATION_TYPE_MOBILITY_UPDATING;
|
||||
|
||||
/* Send Registration request : Uplink Data Status */
|
||||
test_ue->registration_request_param.integrity_protected = 0;
|
||||
test_ue->registration_request_param.uplink_data_status = 1;
|
||||
test_ue->registration_request_param.psimask.uplink_data_status =
|
||||
|
@ -327,7 +337,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_registration_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -343,10 +353,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Registration accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
|
@ -380,7 +394,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -426,10 +440,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
|
@ -466,13 +484,18 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -174,7 +174,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -205,10 +205,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -254,13 +258,18 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -276,7 +285,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -292,10 +301,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
|
@ -335,7 +348,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
|
|
@ -174,7 +174,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -205,10 +205,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -254,10 +258,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -265,8 +274,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -309,7 +318,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage +
|
||||
* Service request
|
||||
* - PDU Session Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
|
@ -324,15 +334,19 @@ static void test1_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x2000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
|
@ -380,7 +394,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage +
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
|
@ -397,15 +412,19 @@ static void test1_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
|
@ -623,7 +642,7 @@ static void test2_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -654,10 +673,14 @@ static void test2_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -666,7 +689,7 @@ static void test2_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -704,7 +727,8 @@ static void test2_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage +
|
||||
* Service request
|
||||
* - PDU Session Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
|
@ -716,20 +740,24 @@ static void test2_func(abts_case *tc, void *data)
|
|||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -929,7 +957,7 @@ static void test3_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -960,10 +988,14 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -972,7 +1004,7 @@ static void test3_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1009,10 +1041,15 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -1020,8 +1057,8 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1041,7 +1078,8 @@ static void test3_func(abts_case *tc, void *data)
|
|||
ogs_pkbuf_free(recvbuf);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage +
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
* - PDU Session Status
|
||||
*/
|
||||
|
@ -1061,7 +1099,7 @@ static void test3_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1077,16 +1115,19 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive InitialContextSetupRequest +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x2000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(
|
||||
test_ue, NULL);
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1101,7 +1142,8 @@ static void test3_func(abts_case *tc, void *data)
|
|||
ogs_pkbuf_free(recvbuf);
|
||||
|
||||
/*
|
||||
* Send Service request Using UplinkNASTransport
|
||||
* Send UplinkNASTransport +
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
|
@ -1117,12 +1159,22 @@ static void test3_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive PDUSessionResourceSetupResponse +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1332,7 +1384,7 @@ static void test4_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1376,10 +1428,14 @@ static void test4_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -1388,7 +1444,7 @@ static void test4_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1426,7 +1482,8 @@ static void test4_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage
|
||||
* Service request
|
||||
* - PDU Session Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
|
@ -1439,23 +1496,21 @@ static void test4_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive DownlinkNASTrasnport +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_DownlinkNASTransport,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_status);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session establishment request */
|
||||
sess = test_sess_add_by_dnn_and_psi(test_ue, "internet", 5);
|
||||
ogs_assert(sess);
|
||||
|
@ -1475,13 +1530,18 @@ static void test4_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive InitialContextSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send InitialContextSetupResponse */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1498,7 +1558,8 @@ static void test4_func(abts_case *tc, void *data)
|
|||
ogs_pkbuf_free(recvbuf);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
* - PDU Session Status
|
||||
*/
|
||||
|
@ -1518,7 +1579,7 @@ static void test4_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1534,16 +1595,19 @@ static void test4_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x2000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(
|
||||
test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1559,13 +1623,14 @@ static void test4_func(abts_case *tc, void *data)
|
|||
|
||||
for (i = 0; i < 200; i++) {
|
||||
/*
|
||||
* Send Service request Using UplinkNASTransport
|
||||
* Send UplinkNASTransport +
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.ciphered = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.psimask.uplink_data_status =
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
test_ue->service_request_param.psimask.pdu_session_status =
|
||||
1 << sess->psi;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
@ -1579,6 +1644,9 @@ static void test4_func(abts_case *tc, void *data)
|
|||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_DownlinkNASTransport,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
}
|
||||
|
||||
|
@ -1605,13 +1673,14 @@ static void test4_func(abts_case *tc, void *data)
|
|||
|
||||
for (i = 0; i < 200; i++) {
|
||||
/*
|
||||
* Send Service request Using UplinkNASTransport
|
||||
* Send UplinkNASTransport +
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.ciphered = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.psimask.uplink_data_status =
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
test_ue->service_request_param.psimask.pdu_session_status =
|
||||
1 << sess->psi;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
@ -1625,6 +1694,9 @@ static void test4_func(abts_case *tc, void *data)
|
|||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_DownlinkNASTransport,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
}
|
||||
|
||||
|
@ -1826,7 +1898,7 @@ static void test5_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1857,10 +1929,14 @@ static void test5_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -1869,7 +1945,7 @@ static void test5_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1903,10 +1979,15 @@ static void test5_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -1914,8 +1995,8 @@ static void test5_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -1954,7 +2035,8 @@ static void test5_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage +
|
||||
* Service request
|
||||
* - PDU Session Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
|
@ -1967,20 +2049,24 @@ static void test5_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -2000,17 +2086,22 @@ static void test5_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -2232,7 +2323,7 @@ static void test6_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -2290,10 +2381,14 @@ static void test6_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -2302,7 +2397,7 @@ static void test6_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send Initial context setup response */
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, NULL);
|
||||
sendbuf = testngap_build_initial_context_setup_response(test_ue, false);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -2336,10 +2431,15 @@ static void test6_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -2347,8 +2447,8 @@ static void test6_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -2391,7 +2491,8 @@ static void test6_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage +
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
|
@ -2408,15 +2509,19 @@ static void test6_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -214,7 +214,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -258,10 +258,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -307,10 +311,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -318,8 +327,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -403,7 +412,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/*
|
||||
* Send Service request Using InitialUEMessage
|
||||
* Send InitialUEMessage +
|
||||
* Service request
|
||||
* - Uplink Data Status
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
|
@ -420,15 +430,19 @@ static void test1_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ static void test1_func(abts_case *tc, void *data)
|
|||
nasbuf = testgmm_build_registration_request(test_ue, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, false, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -275,10 +275,14 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Initial context setup request */
|
||||
/* Receive Initial context setup request +
|
||||
* Registration accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send UE radio capability info indication */
|
||||
sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue);
|
||||
|
@ -324,10 +328,15 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive PDU session establishment accept */
|
||||
/* Receive PDUSessionResourceSetupRequest +
|
||||
* DL NAS transport +
|
||||
* PDU session establishment accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_PDUSessionResourceSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
|
||||
/* Send GTP-U ICMP Packet */
|
||||
qos_flow = test_qos_flow_find_by_qfi(sess, 1);
|
||||
|
@ -335,8 +344,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
rv = test_gtpu_send_ping(gtpu, qos_flow, TEST_PING_IPV4);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -379,8 +388,8 @@ static void test1_func(abts_case *tc, void *data)
|
|||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
|
||||
/* Send PDU session resource setup response */
|
||||
sendbuf = testngap_build_pdu_session_resource_setup_response(sess);
|
||||
/* Send PDUSessionResourceSetupResponse */
|
||||
sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
@ -464,15 +473,19 @@ static void test1_func(abts_case *tc, void *data)
|
|||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||
|
||||
/* Receive Service accept */
|
||||
/* Receive Initial context setup request +
|
||||
* Service accept */
|
||||
recvbuf = testgnb_ngap_read(ngap);
|
||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||
testngap_recv(test_ue, recvbuf);
|
||||
ABTS_INT_EQUAL(tc,
|
||||
NGAP_ProcedureCode_id_InitialContextSetup,
|
||||
test_ue->ngap_procedure_code);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_status);
|
||||
ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result);
|
||||
|
||||
|
|
Loading…
Reference in New Issue