mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 13:20:08 +00:00
Add AUSF, UDM, and UDR
This commit is contained in:
parent
0c0241d5e5
commit
72370ff0b2
1151 changed files with 140173 additions and 24799 deletions
104
lib/sbi/openapi/model/iptv_config_data_patch.c
Normal file
104
lib/sbi/openapi/model/iptv_config_data_patch.c
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "iptv_config_data_patch.h"
|
||||
|
||||
OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_create(
|
||||
OpenAPI_list_t* multi_acc_ctrls
|
||||
)
|
||||
{
|
||||
OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_iptv_config_data_patch_t));
|
||||
if (!iptv_config_data_patch_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
iptv_config_data_patch_local_var->multi_acc_ctrls = multi_acc_ctrls;
|
||||
|
||||
return iptv_config_data_patch_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_iptv_config_data_patch_free(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch)
|
||||
{
|
||||
if (NULL == iptv_config_data_patch) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
OpenAPI_multicast_access_control_free(localKeyValue->value);
|
||||
ogs_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(iptv_config_data_patch->multi_acc_ctrls);
|
||||
ogs_free(iptv_config_data_patch);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_iptv_config_data_patch_convertToJSON(OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (iptv_config_data_patch == NULL) {
|
||||
ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [IptvConfigDataPatch]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (iptv_config_data_patch->multi_acc_ctrls) {
|
||||
cJSON *multi_acc_ctrls = cJSON_AddObjectToObject(item, "multiAccCtrls");
|
||||
if (multi_acc_ctrls == NULL) {
|
||||
ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [multi_acc_ctrls]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = multi_acc_ctrls;
|
||||
OpenAPI_lnode_t *multi_acc_ctrls_node;
|
||||
if (iptv_config_data_patch->multi_acc_ctrls) {
|
||||
OpenAPI_list_for_each(iptv_config_data_patch->multi_acc_ctrls, multi_acc_ctrls_node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)multi_acc_ctrls_node->data;
|
||||
cJSON *itemLocal = OpenAPI_multicast_access_control_convertToJSON(localKeyValue->value);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_iptv_config_data_patch_convertToJSON() failed [multi_acc_ctrls]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(multi_acc_ctrls, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_iptv_config_data_patch_t *OpenAPI_iptv_config_data_patch_parseFromJSON(cJSON *iptv_config_data_patchJSON)
|
||||
{
|
||||
OpenAPI_iptv_config_data_patch_t *iptv_config_data_patch_local_var = NULL;
|
||||
cJSON *multi_acc_ctrls = cJSON_GetObjectItemCaseSensitive(iptv_config_data_patchJSON, "multiAccCtrls");
|
||||
|
||||
OpenAPI_list_t *multi_acc_ctrlsList;
|
||||
if (multi_acc_ctrls) {
|
||||
cJSON *multi_acc_ctrls_local_map;
|
||||
if (!cJSON_IsObject(multi_acc_ctrls)) {
|
||||
ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [multi_acc_ctrls]");
|
||||
goto end;
|
||||
}
|
||||
multi_acc_ctrlsList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(multi_acc_ctrls_local_map, multi_acc_ctrls) {
|
||||
cJSON *localMapObject = multi_acc_ctrls_local_map;
|
||||
if (!cJSON_IsObject(multi_acc_ctrls_local_map)) {
|
||||
ogs_error("OpenAPI_iptv_config_data_patch_parseFromJSON() failed [multi_acc_ctrls]");
|
||||
goto end;
|
||||
}
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
localMapObject->string, OpenAPI_multicast_access_control_parseFromJSON(localMapObject));
|
||||
OpenAPI_list_add(multi_acc_ctrlsList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
|
||||
iptv_config_data_patch_local_var = OpenAPI_iptv_config_data_patch_create (
|
||||
multi_acc_ctrls ? multi_acc_ctrlsList : NULL
|
||||
);
|
||||
|
||||
return iptv_config_data_patch_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue