mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
Add PCF(Policy Control Function)
This commit is contained in:
parent
fb95725ca4
commit
198abc6e8b
299 changed files with 29050 additions and 1075 deletions
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "stationary_indication.h"
|
||||
|
||||
OpenAPI_stationary_indication_t *OpenAPI_stationary_indication_create(
|
||||
)
|
||||
char* OpenAPI_stationary_indication_ToString(OpenAPI_stationary_indication_e stationary_indication)
|
||||
{
|
||||
OpenAPI_stationary_indication_t *stationary_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_stationary_indication_t));
|
||||
if (!stationary_indication_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return stationary_indication_local_var;
|
||||
const char *stationary_indicationArray[] = { "NULL", "STATIONARY", "MOBILE" };
|
||||
size_t sizeofArray = sizeof(stationary_indicationArray) / sizeof(stationary_indicationArray[0]);
|
||||
if (stationary_indication < sizeofArray)
|
||||
return (char *)stationary_indicationArray[stationary_indication];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_stationary_indication_free(OpenAPI_stationary_indication_t *stationary_indication)
|
||||
OpenAPI_stationary_indication_e OpenAPI_stationary_indication_FromString(char* stationary_indication)
|
||||
{
|
||||
if (NULL == stationary_indication) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *stationary_indicationArray[] = { "NULL", "STATIONARY", "MOBILE" };
|
||||
size_t sizeofArray = sizeof(stationary_indicationArray) / sizeof(stationary_indicationArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(stationary_indication, stationary_indicationArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(stationary_indication);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_stationary_indication_convertToJSON(OpenAPI_stationary_indication_t *stationary_indication)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (stationary_indication == NULL) {
|
||||
ogs_error("OpenAPI_stationary_indication_convertToJSON() failed [StationaryIndication]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_stationary_indication_t *OpenAPI_stationary_indication_parseFromJSON(cJSON *stationary_indicationJSON)
|
||||
{
|
||||
OpenAPI_stationary_indication_t *stationary_indication_local_var = NULL;
|
||||
stationary_indication_local_var = OpenAPI_stationary_indication_create (
|
||||
);
|
||||
|
||||
return stationary_indication_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_stationary_indication_t *OpenAPI_stationary_indication_copy(OpenAPI_stationary_indication_t *dst, OpenAPI_stationary_indication_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_stationary_indication_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_stationary_indication_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_stationary_indication_free(dst);
|
||||
dst = OpenAPI_stationary_indication_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue