[Release-17] Upgrade SBI to v17.x.0

This commit is contained in:
Sukchan Lee 2023-03-01 19:56:49 +09:00
parent 969c116e77
commit 4d44b1843e
1687 changed files with 121604 additions and 9310 deletions

View file

@ -16,10 +16,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_create(
bool is_report_ue_reachable,
int report_ue_reachable,
OpenAPI_reachability_filter_t *reachability_filter,
bool is_udm_detect_ind,
int udm_detect_ind,
bool is_max_reports,
int max_reports,
OpenAPI_list_t* presence_info_list,
bool is_max_response_time,
int max_response_time
int max_response_time,
OpenAPI_target_area_t *target_area,
OpenAPI_list_t *snssai_filter,
OpenAPI_ue_in_area_filter_t *ue_in_area_filter,
bool is_min_interval,
int min_interval,
char *next_report,
bool is_idle_status_ind,
int idle_status_ind,
OpenAPI_dispersion_area_t *dispersion_area
)
{
OpenAPI_amf_event_t *amf_event_local_var = ogs_malloc(sizeof(OpenAPI_amf_event_t));
@ -36,10 +48,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_create(
amf_event_local_var->is_report_ue_reachable = is_report_ue_reachable;
amf_event_local_var->report_ue_reachable = report_ue_reachable;
amf_event_local_var->reachability_filter = reachability_filter;
amf_event_local_var->is_udm_detect_ind = is_udm_detect_ind;
amf_event_local_var->udm_detect_ind = udm_detect_ind;
amf_event_local_var->is_max_reports = is_max_reports;
amf_event_local_var->max_reports = max_reports;
amf_event_local_var->presence_info_list = presence_info_list;
amf_event_local_var->is_max_response_time = is_max_response_time;
amf_event_local_var->max_response_time = max_response_time;
amf_event_local_var->target_area = target_area;
amf_event_local_var->snssai_filter = snssai_filter;
amf_event_local_var->ue_in_area_filter = ue_in_area_filter;
amf_event_local_var->is_min_interval = is_min_interval;
amf_event_local_var->min_interval = min_interval;
amf_event_local_var->next_report = next_report;
amf_event_local_var->is_idle_status_ind = is_idle_status_ind;
amf_event_local_var->idle_status_ind = idle_status_ind;
amf_event_local_var->dispersion_area = dispersion_area;
return amf_event_local_var;
}
@ -80,6 +104,39 @@ void OpenAPI_amf_event_free(OpenAPI_amf_event_t *amf_event)
OpenAPI_reachability_filter_free(amf_event->reachability_filter);
amf_event->reachability_filter = NULL;
}
if (amf_event->presence_info_list) {
OpenAPI_list_for_each(amf_event->presence_info_list, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_presence_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(amf_event->presence_info_list);
amf_event->presence_info_list = NULL;
}
if (amf_event->target_area) {
OpenAPI_target_area_free(amf_event->target_area);
amf_event->target_area = NULL;
}
if (amf_event->snssai_filter) {
OpenAPI_list_for_each(amf_event->snssai_filter, node) {
OpenAPI_ext_snssai_free(node->data);
}
OpenAPI_list_free(amf_event->snssai_filter);
amf_event->snssai_filter = NULL;
}
if (amf_event->ue_in_area_filter) {
OpenAPI_ue_in_area_filter_free(amf_event->ue_in_area_filter);
amf_event->ue_in_area_filter = NULL;
}
if (amf_event->next_report) {
ogs_free(amf_event->next_report);
amf_event->next_report = NULL;
}
if (amf_event->dispersion_area) {
OpenAPI_dispersion_area_free(amf_event->dispersion_area);
amf_event->dispersion_area = NULL;
}
ogs_free(amf_event);
}
@ -191,6 +248,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
}
}
if (amf_event->is_udm_detect_ind) {
if (cJSON_AddBoolToObject(item, "udmDetectInd", amf_event->udm_detect_ind) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [udm_detect_ind]");
goto end;
}
}
if (amf_event->is_max_reports) {
if (cJSON_AddNumberToObject(item, "maxReports", amf_event->max_reports) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [max_reports]");
@ -198,6 +262,28 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
}
}
if (amf_event->presence_info_list) {
cJSON *presence_info_list = cJSON_AddObjectToObject(item, "presenceInfoList");
if (presence_info_list == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [presence_info_list]");
goto end;
}
cJSON *localMapObject = presence_info_list;
if (amf_event->presence_info_list) {
OpenAPI_list_for_each(amf_event->presence_info_list, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_presence_info_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
}
}
}
if (amf_event->is_max_response_time) {
if (cJSON_AddNumberToObject(item, "maxResponseTime", amf_event->max_response_time) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [max_response_time]");
@ -205,6 +291,82 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
}
}
if (amf_event->target_area) {
cJSON *target_area_local_JSON = OpenAPI_target_area_convertToJSON(amf_event->target_area);
if (target_area_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [target_area]");
goto end;
}
cJSON_AddItemToObject(item, "targetArea", target_area_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [target_area]");
goto end;
}
}
if (amf_event->snssai_filter) {
cJSON *snssai_filterList = cJSON_AddArrayToObject(item, "snssaiFilter");
if (snssai_filterList == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [snssai_filter]");
goto end;
}
OpenAPI_list_for_each(amf_event->snssai_filter, node) {
cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [snssai_filter]");
goto end;
}
cJSON_AddItemToArray(snssai_filterList, itemLocal);
}
}
if (amf_event->ue_in_area_filter) {
cJSON *ue_in_area_filter_local_JSON = OpenAPI_ue_in_area_filter_convertToJSON(amf_event->ue_in_area_filter);
if (ue_in_area_filter_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [ue_in_area_filter]");
goto end;
}
cJSON_AddItemToObject(item, "ueInAreaFilter", ue_in_area_filter_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [ue_in_area_filter]");
goto end;
}
}
if (amf_event->is_min_interval) {
if (cJSON_AddNumberToObject(item, "minInterval", amf_event->min_interval) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [min_interval]");
goto end;
}
}
if (amf_event->next_report) {
if (cJSON_AddStringToObject(item, "nextReport", amf_event->next_report) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [next_report]");
goto end;
}
}
if (amf_event->is_idle_status_ind) {
if (cJSON_AddBoolToObject(item, "idleStatusInd", amf_event->idle_status_ind) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [idle_status_ind]");
goto end;
}
}
if (amf_event->dispersion_area) {
cJSON *dispersion_area_local_JSON = OpenAPI_dispersion_area_convertToJSON(amf_event->dispersion_area);
if (dispersion_area_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [dispersion_area]");
goto end;
}
cJSON_AddItemToObject(item, "dispersionArea", dispersion_area_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [dispersion_area]");
goto end;
}
}
end:
return item;
}
@ -226,8 +388,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
cJSON *report_ue_reachable = NULL;
cJSON *reachability_filter = NULL;
OpenAPI_reachability_filter_t *reachability_filter_local_nonprim = NULL;
cJSON *udm_detect_ind = NULL;
cJSON *max_reports = NULL;
cJSON *presence_info_list = NULL;
OpenAPI_list_t *presence_info_listList = NULL;
cJSON *max_response_time = NULL;
cJSON *target_area = NULL;
OpenAPI_target_area_t *target_area_local_nonprim = NULL;
cJSON *snssai_filter = NULL;
OpenAPI_list_t *snssai_filterList = NULL;
cJSON *ue_in_area_filter = NULL;
OpenAPI_ue_in_area_filter_t *ue_in_area_filter_local_nonprim = NULL;
cJSON *min_interval = NULL;
cJSON *next_report = NULL;
cJSON *idle_status_ind = NULL;
cJSON *dispersion_area = NULL;
OpenAPI_dispersion_area_t *dispersion_area_local_nonprim = NULL;
type = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "type");
if (!type) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [type]");
@ -339,6 +515,14 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
reachability_filter_local_nonprim = OpenAPI_reachability_filter_parseFromJSON(reachability_filter);
}
udm_detect_ind = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "udmDetectInd");
if (udm_detect_ind) {
if (!cJSON_IsBool(udm_detect_ind)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [udm_detect_ind]");
goto end;
}
}
max_reports = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxReports");
if (max_reports) {
if (!cJSON_IsNumber(max_reports)) {
@ -347,6 +531,32 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
}
}
presence_info_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "presenceInfoList");
if (presence_info_list) {
cJSON *presence_info_list_local_map = NULL;
if (!cJSON_IsObject(presence_info_list) && !cJSON_IsNull(presence_info_list)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [presence_info_list]");
goto end;
}
if (cJSON_IsObject(presence_info_list)) {
presence_info_listList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(presence_info_list_local_map, presence_info_list) {
cJSON *localMapObject = presence_info_list_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [inner]");
goto end;
}
OpenAPI_list_add(presence_info_listList, localMapKeyPair);
}
}
}
max_response_time = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxResponseTime");
if (max_response_time) {
if (!cJSON_IsNumber(max_response_time)) {
@ -355,6 +565,70 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
}
}
target_area = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "targetArea");
if (target_area) {
target_area_local_nonprim = OpenAPI_target_area_parseFromJSON(target_area);
}
snssai_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "snssaiFilter");
if (snssai_filter) {
cJSON *snssai_filter_local = NULL;
if (!cJSON_IsArray(snssai_filter)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [snssai_filter]");
goto end;
}
snssai_filterList = OpenAPI_list_create();
cJSON_ArrayForEach(snssai_filter_local, snssai_filter) {
if (!cJSON_IsObject(snssai_filter_local)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [snssai_filter]");
goto end;
}
OpenAPI_ext_snssai_t *snssai_filterItem = OpenAPI_ext_snssai_parseFromJSON(snssai_filter_local);
if (!snssai_filterItem) {
ogs_error("No snssai_filterItem");
OpenAPI_list_free(snssai_filterList);
goto end;
}
OpenAPI_list_add(snssai_filterList, snssai_filterItem);
}
}
ue_in_area_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "ueInAreaFilter");
if (ue_in_area_filter) {
ue_in_area_filter_local_nonprim = OpenAPI_ue_in_area_filter_parseFromJSON(ue_in_area_filter);
}
min_interval = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "minInterval");
if (min_interval) {
if (!cJSON_IsNumber(min_interval)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [min_interval]");
goto end;
}
}
next_report = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "nextReport");
if (next_report) {
if (!cJSON_IsString(next_report) && !cJSON_IsNull(next_report)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [next_report]");
goto end;
}
}
idle_status_ind = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "idleStatusInd");
if (idle_status_ind) {
if (!cJSON_IsBool(idle_status_ind)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [idle_status_ind]");
goto end;
}
}
dispersion_area = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "dispersionArea");
if (dispersion_area) {
dispersion_area_local_nonprim = OpenAPI_dispersion_area_parseFromJSON(dispersion_area);
}
amf_event_local_var = OpenAPI_amf_event_create (
type_local_nonprim,
immediate_flag ? true : false,
@ -367,10 +641,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
report_ue_reachable ? true : false,
report_ue_reachable ? report_ue_reachable->valueint : 0,
reachability_filter ? reachability_filter_local_nonprim : NULL,
udm_detect_ind ? true : false,
udm_detect_ind ? udm_detect_ind->valueint : 0,
max_reports ? true : false,
max_reports ? max_reports->valuedouble : 0,
presence_info_list ? presence_info_listList : NULL,
max_response_time ? true : false,
max_response_time ? max_response_time->valuedouble : 0
max_response_time ? max_response_time->valuedouble : 0,
target_area ? target_area_local_nonprim : NULL,
snssai_filter ? snssai_filterList : NULL,
ue_in_area_filter ? ue_in_area_filter_local_nonprim : NULL,
min_interval ? true : false,
min_interval ? min_interval->valuedouble : 0,
next_report && !cJSON_IsNull(next_report) ? ogs_strdup(next_report->valuestring) : NULL,
idle_status_ind ? true : false,
idle_status_ind ? idle_status_ind->valueint : 0,
dispersion_area ? dispersion_area_local_nonprim : NULL
);
return amf_event_local_var;
@ -404,6 +690,35 @@ end:
OpenAPI_reachability_filter_free(reachability_filter_local_nonprim);
reachability_filter_local_nonprim = NULL;
}
if (presence_info_listList) {
OpenAPI_list_for_each(presence_info_listList, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
ogs_free(localKeyValue->key);
OpenAPI_presence_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(presence_info_listList);
presence_info_listList = NULL;
}
if (target_area_local_nonprim) {
OpenAPI_target_area_free(target_area_local_nonprim);
target_area_local_nonprim = NULL;
}
if (snssai_filterList) {
OpenAPI_list_for_each(snssai_filterList, node) {
OpenAPI_ext_snssai_free(node->data);
}
OpenAPI_list_free(snssai_filterList);
snssai_filterList = NULL;
}
if (ue_in_area_filter_local_nonprim) {
OpenAPI_ue_in_area_filter_free(ue_in_area_filter_local_nonprim);
ue_in_area_filter_local_nonprim = NULL;
}
if (dispersion_area_local_nonprim) {
OpenAPI_dispersion_area_free(dispersion_area_local_nonprim);
dispersion_area_local_nonprim = NULL;
}
return NULL;
}