parent
ced37a6201
commit
12c656efd0
|
@ -669,26 +669,6 @@ ogs_slice_data_t *ogs_slice_find_by_s_nssai(
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ogs_slice_data_t *ogs_slice_find_by_dnn(
|
|
||||||
ogs_slice_data_t *slice_data, int num_of_slice_data, char *dnn)
|
|
||||||
{
|
|
||||||
int i, j;
|
|
||||||
|
|
||||||
ogs_assert(slice_data);
|
|
||||||
ogs_assert(num_of_slice_data);
|
|
||||||
ogs_assert(dnn);
|
|
||||||
|
|
||||||
/* Compare DNN */
|
|
||||||
for (i = 0; i < num_of_slice_data; i++) {
|
|
||||||
for (j = 0; j < slice_data[i].num_of_session; j++) {
|
|
||||||
if (strcmp(slice_data[i].session[j].name, dnn) == 0)
|
|
||||||
return slice_data + i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ogs_subscription_data_free(ogs_subscription_data_t *subscription_data)
|
void ogs_subscription_data_free(ogs_subscription_data_t *subscription_data)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
|
@ -653,8 +653,6 @@ typedef struct ogs_slice_data_s {
|
||||||
ogs_slice_data_t *ogs_slice_find_by_s_nssai(
|
ogs_slice_data_t *ogs_slice_find_by_s_nssai(
|
||||||
ogs_slice_data_t *slice_data, int num_of_slice_data,
|
ogs_slice_data_t *slice_data, int num_of_slice_data,
|
||||||
ogs_s_nssai_t *s_nssai);
|
ogs_s_nssai_t *s_nssai);
|
||||||
ogs_slice_data_t *ogs_slice_find_by_dnn(
|
|
||||||
ogs_slice_data_t *slice_data, int num_of_slice_data, char *dnn);
|
|
||||||
|
|
||||||
typedef struct ogs_subscription_data_s {
|
typedef struct ogs_subscription_data_s {
|
||||||
#define OGS_ACCESS_RESTRICTION_UTRAN_NOT_ALLOWED (1)
|
#define OGS_ACCESS_RESTRICTION_UTRAN_NOT_ALLOWED (1)
|
||||||
|
|
|
@ -951,11 +951,6 @@ int gmm_handle_ul_nas_transport(amf_ue_t *amf_ue,
|
||||||
|
|
||||||
switch (payload_container_type->value) {
|
switch (payload_container_type->value) {
|
||||||
case OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION:
|
case OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION:
|
||||||
nas_s_nssai = &ul_nas_transport->s_nssai;
|
|
||||||
ogs_assert(nas_s_nssai);
|
|
||||||
dnn = &ul_nas_transport->dnn;
|
|
||||||
ogs_assert(dnn);
|
|
||||||
|
|
||||||
gsm_header = (ogs_nas_5gsm_header_t *)payload_container->buffer;
|
gsm_header = (ogs_nas_5gsm_header_t *)payload_container->buffer;
|
||||||
ogs_assert(gsm_header);
|
ogs_assert(gsm_header);
|
||||||
|
|
||||||
|
@ -991,43 +986,78 @@ int gmm_handle_ul_nas_transport(amf_ue_t *amf_ue,
|
||||||
if (gsm_header->message_type ==
|
if (gsm_header->message_type ==
|
||||||
OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST) {
|
OGS_NAS_5GS_PDU_SESSION_ESTABLISHMENT_REQUEST) {
|
||||||
|
|
||||||
if (ul_nas_transport->presencemask &
|
int i, j, k;
|
||||||
OGS_NAS_5GS_UL_NAS_TRANSPORT_S_NSSAI_PRESENT) {
|
|
||||||
ogs_nas_s_nssai_ie_t ie;
|
nas_s_nssai = &ul_nas_transport->s_nssai;
|
||||||
if (ogs_nas_parse_s_nssai(&ie, nas_s_nssai) != 0) {
|
ogs_assert(nas_s_nssai);
|
||||||
selected_slice = ogs_slice_find_by_s_nssai(
|
dnn = &ul_nas_transport->dnn;
|
||||||
amf_ue->slice, amf_ue->num_of_slice,
|
ogs_assert(dnn);
|
||||||
(ogs_s_nssai_t *)&ie);
|
|
||||||
|
|
||||||
|
for (i = 0; i < amf_ue->num_of_slice; i++) {
|
||||||
|
if (ul_nas_transport->presencemask &
|
||||||
|
OGS_NAS_5GS_UL_NAS_TRANSPORT_S_NSSAI_PRESENT) {
|
||||||
|
ogs_nas_s_nssai_ie_t ie;
|
||||||
|
if (ogs_nas_parse_s_nssai(&ie, nas_s_nssai) != 0) {
|
||||||
|
if (ie.sst == amf_ue->slice[i].s_nssai.sst &&
|
||||||
|
ie.sd.v == amf_ue->slice[i].s_nssai.sd.v) {
|
||||||
|
|
||||||
|
/* PASS */
|
||||||
|
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
for (j = 0; j < amf_ue->allowed_nssai.num_of_s_nssai; j++) {
|
||||||
|
if (amf_ue->slice[i].s_nssai.sst ==
|
||||||
|
amf_ue->allowed_nssai.s_nssai[j].sst &&
|
||||||
|
amf_ue->slice[i].s_nssai.sd.v ==
|
||||||
|
amf_ue->allowed_nssai.s_nssai[j].sd.v) {
|
||||||
|
|
||||||
if (ul_nas_transport->presencemask &
|
if (ul_nas_transport->presencemask &
|
||||||
OGS_NAS_5GS_UL_NAS_TRANSPORT_DNN_PRESENT) {
|
OGS_NAS_5GS_UL_NAS_TRANSPORT_DNN_PRESENT) {
|
||||||
if (sess->dnn)
|
|
||||||
ogs_free(sess->dnn);
|
|
||||||
sess->dnn = ogs_strdup(dnn->value);
|
|
||||||
ogs_assert(sess->dnn);
|
|
||||||
|
|
||||||
if (!selected_slice) {
|
for (k = 0;
|
||||||
selected_slice = ogs_slice_find_by_dnn(
|
k < amf_ue->slice[i].num_of_session; k++) {
|
||||||
amf_ue->slice, amf_ue->num_of_slice, sess->dnn);
|
if (!strcmp(dnn->value,
|
||||||
}
|
amf_ue->slice[i].session[k].name)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (!selected_slice) {
|
selected_slice = amf_ue->slice + i;
|
||||||
int i;
|
ogs_assert(selected_slice);
|
||||||
for (i = 0; i < amf_ue->num_of_slice; i++) {
|
|
||||||
if (amf_ue->slice[i].default_indicator == true) {
|
if (sess->dnn)
|
||||||
selected_slice = &amf_ue->slice[i];
|
ogs_free(sess->dnn);
|
||||||
|
sess->dnn = ogs_strdup(dnn->value);
|
||||||
|
ogs_assert(sess->dnn);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
selected_slice = amf_ue->slice + i;
|
||||||
|
ogs_assert(selected_slice);
|
||||||
|
|
||||||
|
if (selected_slice->num_of_session) {
|
||||||
|
if (sess->dnn)
|
||||||
|
ogs_free(sess->dnn);
|
||||||
|
sess->dnn = ogs_strdup(
|
||||||
|
selected_slice->session[0].name);
|
||||||
|
ogs_assert(sess->dnn);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!selected_slice) {
|
if (!selected_slice || !sess->dnn) {
|
||||||
ogs_error("[%s] No S-NSSAI", amf_ue->supi);
|
ogs_warn("[%s] DNN Not Supporetd OR "
|
||||||
|
"Not Subscribed in the Slice", amf_ue->supi);
|
||||||
ogs_assert(OGS_OK ==
|
ogs_assert(OGS_OK ==
|
||||||
nas_5gs_send_gmm_status(amf_ue,
|
nas_5gs_send_gmm_status(amf_ue, OGS_5GMM_CAUSE_DNN_NOT_SUPPORTED_OR_NOT_SUBSCRIBED_IN_THE_SLICE));
|
||||||
OGS_5GMM_CAUSE_INSUFFICIENT_RESOURCES_FOR_SPECIFIC_SLICE));
|
|
||||||
return OGS_ERROR;
|
return OGS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1035,20 +1065,6 @@ int gmm_handle_ul_nas_transport(amf_ue_t *amf_ue,
|
||||||
sess->s_nssai.sst = selected_slice->s_nssai.sst;
|
sess->s_nssai.sst = selected_slice->s_nssai.sst;
|
||||||
sess->s_nssai.sd.v = selected_slice->s_nssai.sd.v;
|
sess->s_nssai.sd.v = selected_slice->s_nssai.sd.v;
|
||||||
|
|
||||||
if (!sess->dnn) {
|
|
||||||
if (selected_slice->num_of_session) {
|
|
||||||
sess->dnn = ogs_strdup(selected_slice->session[0].name);
|
|
||||||
ogs_assert(sess->dnn);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!sess->dnn) {
|
|
||||||
ogs_error("[%s] No DNN", amf_ue->supi);
|
|
||||||
ogs_assert(OGS_OK ==
|
|
||||||
nas_5gs_send_gmm_status(amf_ue, OGS_5GMM_CAUSE_DNN_NOT_SUPPORTED_OR_NOT_SUBSCRIBED_IN_THE_SLICE));
|
|
||||||
return OGS_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
ogs_info("UE SUPI[%s] DNN[%s] S_NSSAI[SST:%d SD:0x%x]",
|
ogs_info("UE SUPI[%s] DNN[%s] S_NSSAI[SST:%d SD:0x%x]",
|
||||||
amf_ue->supi, sess->dnn, sess->s_nssai.sst, sess->s_nssai.sd.v);
|
amf_ue->supi, sess->dnn, sess->s_nssai.sst, sess->s_nssai.sd.v);
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ void testgmm_recv(test_ue_t *test_ue, ogs_pkbuf_t *pkbuf)
|
||||||
case OGS_NAS_5GS_DL_NAS_TRANSPORT:
|
case OGS_NAS_5GS_DL_NAS_TRANSPORT:
|
||||||
testgmm_handle_dl_nas_transport(test_ue, &message.gmm.dl_nas_transport);
|
testgmm_handle_dl_nas_transport(test_ue, &message.gmm.dl_nas_transport);
|
||||||
break;
|
break;
|
||||||
|
case OGS_NAS_5GS_5GMM_STATUS:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ogs_error("Unknown message[%d]", message.gmm.h.message_type);
|
ogs_error("Unknown message[%d]", message.gmm.h.message_type);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1923,10 +1923,16 @@ static void test5_func(abts_case *tc, void *data)
|
||||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
/* Receive PDU session establishment reject */
|
/* Receive 5GMM Status */
|
||||||
recvbuf = testgnb_ngap_read(ngap);
|
recvbuf = testgnb_ngap_read(ngap);
|
||||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
testngap_recv(test_ue, recvbuf);
|
testngap_recv(test_ue, recvbuf);
|
||||||
|
ABTS_INT_EQUAL(tc,
|
||||||
|
NGAP_ProcedureCode_id_DownlinkNASTransport,
|
||||||
|
test_ue->ngap_procedure_code);
|
||||||
|
ABTS_INT_EQUAL(tc,
|
||||||
|
OGS_NAS_5GS_5GMM_STATUS,
|
||||||
|
test_ue->gmm_message_type);
|
||||||
|
|
||||||
/* Send De-registration request */
|
/* Send De-registration request */
|
||||||
gmmbuf = testgmm_build_de_registration_request(test_ue, 1, true, true);
|
gmmbuf = testgmm_build_de_registration_request(test_ue, 1, true, true);
|
||||||
|
@ -2194,10 +2200,16 @@ static void test6_func(abts_case *tc, void *data)
|
||||||
rv = testgnb_ngap_send(ngap, sendbuf);
|
rv = testgnb_ngap_send(ngap, sendbuf);
|
||||||
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
ABTS_INT_EQUAL(tc, OGS_OK, rv);
|
||||||
|
|
||||||
/* Receive PDU session establishment reject */
|
/* Receive 5GMM Status */
|
||||||
recvbuf = testgnb_ngap_read(ngap);
|
recvbuf = testgnb_ngap_read(ngap);
|
||||||
ABTS_PTR_NOTNULL(tc, recvbuf);
|
ABTS_PTR_NOTNULL(tc, recvbuf);
|
||||||
testngap_recv(test_ue, recvbuf);
|
testngap_recv(test_ue, recvbuf);
|
||||||
|
ABTS_INT_EQUAL(tc,
|
||||||
|
NGAP_ProcedureCode_id_DownlinkNASTransport,
|
||||||
|
test_ue->ngap_procedure_code);
|
||||||
|
ABTS_INT_EQUAL(tc,
|
||||||
|
OGS_NAS_5GS_5GMM_STATUS,
|
||||||
|
test_ue->gmm_message_type);
|
||||||
|
|
||||||
/* Remove All Test Session */
|
/* Remove All Test Session */
|
||||||
test_sess_remove(sess6);
|
test_sess_remove(sess6);
|
||||||
|
|
Loading…
Reference in New Issue