mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 07:08:11 +00:00
arch: DB schema Changes (#796)
- New function : NSSF - New feature : SMF selection
This commit is contained in:
parent
c6bfbed922
commit
9af4268bab
691 changed files with 40727 additions and 18985 deletions
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "trace_depth.h"
|
||||
|
||||
OpenAPI_trace_depth_t *OpenAPI_trace_depth_create(
|
||||
)
|
||||
char* OpenAPI_trace_depth_ToString(OpenAPI_trace_depth_e trace_depth)
|
||||
{
|
||||
OpenAPI_trace_depth_t *trace_depth_local_var = OpenAPI_malloc(sizeof(OpenAPI_trace_depth_t));
|
||||
if (!trace_depth_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return trace_depth_local_var;
|
||||
const char *trace_depthArray[] = { "NULL", "MINIMUM", "MEDIUM", "MAXIMUM", "MINIMUM_WO_VENDOR_EXTENSION", "MEDIUM_WO_VENDOR_EXTENSION", "MAXIMUM_WO_VENDOR_EXTENSION" };
|
||||
size_t sizeofArray = sizeof(trace_depthArray) / sizeof(trace_depthArray[0]);
|
||||
if (trace_depth < sizeofArray)
|
||||
return (char *)trace_depthArray[trace_depth];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_trace_depth_free(OpenAPI_trace_depth_t *trace_depth)
|
||||
OpenAPI_trace_depth_e OpenAPI_trace_depth_FromString(char* trace_depth)
|
||||
{
|
||||
if (NULL == trace_depth) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *trace_depthArray[] = { "NULL", "MINIMUM", "MEDIUM", "MAXIMUM", "MINIMUM_WO_VENDOR_EXTENSION", "MEDIUM_WO_VENDOR_EXTENSION", "MAXIMUM_WO_VENDOR_EXTENSION" };
|
||||
size_t sizeofArray = sizeof(trace_depthArray) / sizeof(trace_depthArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(trace_depth, trace_depthArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(trace_depth);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_trace_depth_convertToJSON(OpenAPI_trace_depth_t *trace_depth)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (trace_depth == NULL) {
|
||||
ogs_error("OpenAPI_trace_depth_convertToJSON() failed [TraceDepth]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_trace_depth_t *OpenAPI_trace_depth_parseFromJSON(cJSON *trace_depthJSON)
|
||||
{
|
||||
OpenAPI_trace_depth_t *trace_depth_local_var = NULL;
|
||||
trace_depth_local_var = OpenAPI_trace_depth_create (
|
||||
);
|
||||
|
||||
return trace_depth_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_trace_depth_t *OpenAPI_trace_depth_copy(OpenAPI_trace_depth_t *dst, OpenAPI_trace_depth_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_trace_depth_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_trace_depth_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_trace_depth_free(dst);
|
||||
dst = OpenAPI_trace_depth_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue