mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-02 13:03:31 +00:00
fix: Derive ESM cause from GTP-Cause (#755)
This commit is contained in:
@@ -210,7 +210,6 @@ typedef struct test_service_request_param_s {
|
||||
};
|
||||
uint8_t value;
|
||||
};
|
||||
uint8_t service_type;
|
||||
struct {
|
||||
uint16_t pdu_session_status;
|
||||
uint16_t uplink_data_status;
|
||||
|
||||
@@ -231,7 +231,7 @@ ogs_pkbuf_t *testgmm_build_registration_complete(test_ue_t *test_ue)
|
||||
}
|
||||
|
||||
ogs_pkbuf_t *testgmm_build_service_request(
|
||||
test_ue_t *test_ue, ogs_pkbuf_t *nasbuf)
|
||||
test_ue_t *test_ue, uint8_t service_type, ogs_pkbuf_t *nasbuf)
|
||||
{
|
||||
ogs_nas_5gs_message_t message;
|
||||
ogs_pkbuf_t *pkbuf = NULL;
|
||||
@@ -268,7 +268,7 @@ ogs_pkbuf_t *testgmm_build_service_request(
|
||||
OGS_NAS_EXTENDED_PROTOCOL_DISCRIMINATOR_5GMM;
|
||||
message.gmm.h.message_type = OGS_NAS_5GS_SERVICE_REQUEST;
|
||||
|
||||
service_request->ngksi.type = test_ue->service_request_param.service_type;
|
||||
service_request->ngksi.type = service_type;
|
||||
service_request->ngksi.tsc = test_ue->nas.tsc;
|
||||
service_request->ngksi.value = test_ue->nas.ksi;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ ogs_pkbuf_t *testgmm_build_registration_request(
|
||||
ogs_pkbuf_t *testgmm_build_registration_complete(test_ue_t *test_ue);
|
||||
|
||||
ogs_pkbuf_t *testgmm_build_service_request(
|
||||
test_ue_t *test_ue, ogs_pkbuf_t *nasbuf);
|
||||
test_ue_t *test_ue, uint8_t service_type, ogs_pkbuf_t *nasbuf);
|
||||
|
||||
ogs_pkbuf_t *testgmm_build_de_registration_request(
|
||||
test_ue_t *test_ue, bool switch_off);
|
||||
|
||||
@@ -324,14 +324,15 @@ static void test1_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
test_ue->service_request_param.psimask.pdu_session_status =
|
||||
1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
test_ue->service_request_param.psimask.pdu_session_status = 1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
@@ -400,16 +401,17 @@ static void test1_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.
|
||||
psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
@@ -733,12 +735,14 @@ static void test2_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
ABTS_PTR_NOTNULL(tc, sendbuf);
|
||||
@@ -1085,18 +1089,18 @@ static void test3_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.psimask.uplink_data_status =
|
||||
1 << sess->psi;
|
||||
test_ue->service_request_param.psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
test_ue->service_request_param.psimask.pdu_session_status =
|
||||
1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
test_ue->service_request_param.psimask.pdu_session_status = 1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
@@ -1149,9 +1153,9 @@ static void test3_func(abts_case *tc, void *data)
|
||||
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 =
|
||||
1 << sess->psi;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
test_ue->service_request_param.psimask.uplink_data_status = 1 << sess->psi;
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf);
|
||||
@@ -1488,12 +1492,14 @@ static void test4_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, false);
|
||||
@@ -1565,18 +1571,18 @@ static void test4_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.psimask.uplink_data_status =
|
||||
1 << sess->psi;
|
||||
test_ue->service_request_param.psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
test_ue->service_request_param.psimask.pdu_session_status =
|
||||
1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
test_ue->service_request_param.psimask.pdu_session_status = 1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
@@ -1632,7 +1638,8 @@ static void test4_func(abts_case *tc, void *data)
|
||||
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);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf);
|
||||
@@ -1682,7 +1689,8 @@ static void test4_func(abts_case *tc, void *data)
|
||||
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);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf);
|
||||
@@ -2041,12 +2049,14 @@ static void test5_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
@@ -2497,16 +2507,17 @@ static void test6_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.
|
||||
psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
|
||||
@@ -1386,14 +1386,15 @@ static void test4_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 1;
|
||||
test_ue->service_request_param.psimask.pdu_session_status =
|
||||
1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
test_ue->service_request_param.psimask.pdu_session_status = 1 << sess->psi;
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_SIGNALLING, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, false);
|
||||
@@ -1441,16 +1442,17 @@ static void test4_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.
|
||||
psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, false);
|
||||
|
||||
@@ -418,16 +418,17 @@ static void test1_func(abts_case *tc, void *data)
|
||||
*/
|
||||
test_ue->service_request_param.integrity_protected = 0;
|
||||
test_ue->service_request_param.uplink_data_status = 1;
|
||||
test_ue->service_request_param.
|
||||
psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.psimask.uplink_data_status = 1 << sess->psi;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
|
||||
@@ -464,13 +464,15 @@ static void test1_func(abts_case *tc, void *data)
|
||||
test_ue->service_request_param.
|
||||
psimask.uplink_data_status = (1 << 5 | 1 << 6);
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
nasbuf = testgmm_build_service_request(test_ue, NULL);
|
||||
nasbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, NULL);
|
||||
ABTS_PTR_NOTNULL(tc, nasbuf);
|
||||
|
||||
test_ue->service_request_param.integrity_protected = 1;
|
||||
test_ue->service_request_param.uplink_data_status = 0;
|
||||
test_ue->service_request_param.pdu_session_status = 0;
|
||||
gmmbuf = testgmm_build_service_request(test_ue, nasbuf);
|
||||
gmmbuf = testgmm_build_service_request(
|
||||
test_ue, OGS_NAS_SERVICE_TYPE_DATA, nasbuf);
|
||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||
|
||||
sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, true, true);
|
||||
|
||||
Reference in New Issue
Block a user