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
80
lib/sbi/openapi/model/gad_shape.c
Normal file
80
lib/sbi/openapi/model/gad_shape.c
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "gad_shape.h"
|
||||
|
||||
OpenAPI_gad_shape_t *OpenAPI_gad_shape_create(
|
||||
OpenAPI_supported_gad_shapes_t *shape
|
||||
)
|
||||
{
|
||||
OpenAPI_gad_shape_t *gad_shape_local_var = OpenAPI_malloc(sizeof(OpenAPI_gad_shape_t));
|
||||
if (!gad_shape_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
gad_shape_local_var->shape = shape;
|
||||
|
||||
return gad_shape_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_gad_shape_free(OpenAPI_gad_shape_t *gad_shape)
|
||||
{
|
||||
if (NULL == gad_shape) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_supported_gad_shapes_free(gad_shape->shape);
|
||||
ogs_free(gad_shape);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_gad_shape_convertToJSON(OpenAPI_gad_shape_t *gad_shape)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (gad_shape == NULL) {
|
||||
ogs_error("OpenAPI_gad_shape_convertToJSON() failed [GADShape]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!gad_shape->shape) {
|
||||
ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *shape_local_JSON = OpenAPI_supported_gad_shapes_convertToJSON(gad_shape->shape);
|
||||
if (shape_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "shape", shape_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_gad_shape_convertToJSON() failed [shape]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_gad_shape_t *OpenAPI_gad_shape_parseFromJSON(cJSON *gad_shapeJSON)
|
||||
{
|
||||
OpenAPI_gad_shape_t *gad_shape_local_var = NULL;
|
||||
cJSON *shape = cJSON_GetObjectItemCaseSensitive(gad_shapeJSON, "shape");
|
||||
if (!shape) {
|
||||
ogs_error("OpenAPI_gad_shape_parseFromJSON() failed [shape]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_supported_gad_shapes_t *shape_local_nonprim = NULL;
|
||||
|
||||
shape_local_nonprim = OpenAPI_supported_gad_shapes_parseFromJSON(shape);
|
||||
|
||||
gad_shape_local_var = OpenAPI_gad_shape_create (
|
||||
shape_local_nonprim
|
||||
);
|
||||
|
||||
return gad_shape_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue