mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +00:00
[Release-17] Upgrade SBI to v17.x.0
This commit is contained in:
parent
969c116e77
commit
4d44b1843e
1687 changed files with 121604 additions and 9310 deletions
|
|
@ -12,7 +12,9 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
|
|||
bool is_rep_period,
|
||||
int rep_period,
|
||||
bool is_samp_ratio,
|
||||
int samp_ratio
|
||||
int samp_ratio,
|
||||
OpenAPI_list_t *partitioning_criteria,
|
||||
OpenAPI_notification_flag_e notif_flag
|
||||
)
|
||||
{
|
||||
OpenAPI_amf_event_mode_t *amf_event_mode_local_var = ogs_malloc(sizeof(OpenAPI_amf_event_mode_t));
|
||||
|
|
@ -26,6 +28,8 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
|
|||
amf_event_mode_local_var->rep_period = rep_period;
|
||||
amf_event_mode_local_var->is_samp_ratio = is_samp_ratio;
|
||||
amf_event_mode_local_var->samp_ratio = samp_ratio;
|
||||
amf_event_mode_local_var->partitioning_criteria = partitioning_criteria;
|
||||
amf_event_mode_local_var->notif_flag = notif_flag;
|
||||
|
||||
return amf_event_mode_local_var;
|
||||
}
|
||||
|
|
@ -45,6 +49,10 @@ void OpenAPI_amf_event_mode_free(OpenAPI_amf_event_mode_t *amf_event_mode)
|
|||
ogs_free(amf_event_mode->expiry);
|
||||
amf_event_mode->expiry = NULL;
|
||||
}
|
||||
if (amf_event_mode->partitioning_criteria) {
|
||||
OpenAPI_list_free(amf_event_mode->partitioning_criteria);
|
||||
amf_event_mode->partitioning_criteria = NULL;
|
||||
}
|
||||
ogs_free(amf_event_mode);
|
||||
}
|
||||
|
||||
|
|
@ -102,6 +110,27 @@ cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_event_mode->partitioning_criteria != OpenAPI_partitioning_criteria_NULL) {
|
||||
cJSON *partitioning_criteriaList = cJSON_AddArrayToObject(item, "partitioningCriteria");
|
||||
if (partitioning_criteriaList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event_mode->partitioning_criteria, node) {
|
||||
if (cJSON_AddStringToObject(partitioning_criteriaList, "", OpenAPI_partitioning_criteria_ToString((intptr_t)node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_mode->notif_flag != OpenAPI_notification_flag_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "notifFlag", OpenAPI_notification_flag_ToString(amf_event_mode->notif_flag)) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [notif_flag]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -116,6 +145,10 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
|
|||
cJSON *expiry = NULL;
|
||||
cJSON *rep_period = NULL;
|
||||
cJSON *samp_ratio = NULL;
|
||||
cJSON *partitioning_criteria = NULL;
|
||||
OpenAPI_list_t *partitioning_criteriaList = NULL;
|
||||
cJSON *notif_flag = NULL;
|
||||
OpenAPI_notification_flag_e notif_flagVariable = 0;
|
||||
trigger = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "trigger");
|
||||
if (!trigger) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [trigger]");
|
||||
|
|
@ -155,6 +188,34 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
|
|||
}
|
||||
}
|
||||
|
||||
partitioning_criteria = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "partitioningCriteria");
|
||||
if (partitioning_criteria) {
|
||||
cJSON *partitioning_criteria_local = NULL;
|
||||
if (!cJSON_IsArray(partitioning_criteria)) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
partitioning_criteriaList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(partitioning_criteria_local, partitioning_criteria) {
|
||||
if (!cJSON_IsString(partitioning_criteria_local)) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(partitioning_criteriaList, (void *)OpenAPI_partitioning_criteria_FromString(partitioning_criteria_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
notif_flag = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "notifFlag");
|
||||
if (notif_flag) {
|
||||
if (!cJSON_IsString(notif_flag)) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [notif_flag]");
|
||||
goto end;
|
||||
}
|
||||
notif_flagVariable = OpenAPI_notification_flag_FromString(notif_flag->valuestring);
|
||||
}
|
||||
|
||||
amf_event_mode_local_var = OpenAPI_amf_event_mode_create (
|
||||
trigger_local_nonprim,
|
||||
max_reports ? true : false,
|
||||
|
|
@ -163,7 +224,9 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
|
|||
rep_period ? true : false,
|
||||
rep_period ? rep_period->valuedouble : 0,
|
||||
samp_ratio ? true : false,
|
||||
samp_ratio ? samp_ratio->valuedouble : 0
|
||||
samp_ratio ? samp_ratio->valuedouble : 0,
|
||||
partitioning_criteria ? partitioning_criteriaList : NULL,
|
||||
notif_flag ? notif_flagVariable : 0
|
||||
);
|
||||
|
||||
return amf_event_mode_local_var;
|
||||
|
|
@ -172,6 +235,10 @@ end:
|
|||
OpenAPI_amf_event_trigger_free(trigger_local_nonprim);
|
||||
trigger_local_nonprim = NULL;
|
||||
}
|
||||
if (partitioning_criteriaList) {
|
||||
OpenAPI_list_free(partitioning_criteriaList);
|
||||
partitioning_criteriaList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue