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
76
lib/sbi/openapi/model/hfc_node_id.c
Normal file
76
lib/sbi/openapi/model/hfc_node_id.c
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "hfc_node_id.h"
|
||||
|
||||
OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_create(
|
||||
char *hfc_n_id
|
||||
)
|
||||
{
|
||||
OpenAPI_hfc_node_id_t *hfc_node_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_hfc_node_id_t));
|
||||
if (!hfc_node_id_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
hfc_node_id_local_var->hfc_n_id = hfc_n_id;
|
||||
|
||||
return hfc_node_id_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_hfc_node_id_free(OpenAPI_hfc_node_id_t *hfc_node_id)
|
||||
{
|
||||
if (NULL == hfc_node_id) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(hfc_node_id->hfc_n_id);
|
||||
ogs_free(hfc_node_id);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_hfc_node_id_convertToJSON(OpenAPI_hfc_node_id_t *hfc_node_id)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (hfc_node_id == NULL) {
|
||||
ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [HfcNodeId]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!hfc_node_id->hfc_n_id) {
|
||||
ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_n_id]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "hfcNId", hfc_node_id->hfc_n_id) == NULL) {
|
||||
ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_n_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_parseFromJSON(cJSON *hfc_node_idJSON)
|
||||
{
|
||||
OpenAPI_hfc_node_id_t *hfc_node_id_local_var = NULL;
|
||||
cJSON *hfc_n_id = cJSON_GetObjectItemCaseSensitive(hfc_node_idJSON, "hfcNId");
|
||||
if (!hfc_n_id) {
|
||||
ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_n_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsString(hfc_n_id)) {
|
||||
ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_n_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
hfc_node_id_local_var = OpenAPI_hfc_node_id_create (
|
||||
ogs_strdup(hfc_n_id->valuestring)
|
||||
);
|
||||
|
||||
return hfc_node_id_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue