mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 15:24:14 +00:00
Add only one 5GC scenario (call-flow)
This commit is contained in:
parent
20008b6a13
commit
dbee687a75
1415 changed files with 86635 additions and 5877 deletions
|
|
@ -4,48 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "preemption_vulnerability.h"
|
||||
|
||||
OpenAPI_preemption_vulnerability_t *OpenAPI_preemption_vulnerability_create(
|
||||
)
|
||||
char* OpenAPI_preemption_vulnerability_ToString(OpenAPI_preemption_vulnerability_e preemption_vulnerability)
|
||||
{
|
||||
OpenAPI_preemption_vulnerability_t *preemption_vulnerability_local_var = OpenAPI_malloc(sizeof(OpenAPI_preemption_vulnerability_t));
|
||||
if (!preemption_vulnerability_local_var) {
|
||||
return NULL;
|
||||
const char *preemption_vulnerabilityArray[] = { "NULL", "NOT_PREEMPTABLE", "PREEMPTABLE" };
|
||||
size_t sizeofArray = sizeof(preemption_vulnerabilityArray) / sizeof(preemption_vulnerabilityArray[0]);
|
||||
if (preemption_vulnerability < sizeofArray)
|
||||
return (char *)preemption_vulnerabilityArray[preemption_vulnerability];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_preemption_vulnerability_e OpenAPI_preemption_vulnerability_FromString(char* preemption_vulnerability)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *preemption_vulnerabilityArray[] = { "NULL", "NOT_PREEMPTABLE", "PREEMPTABLE" };
|
||||
size_t sizeofArray = sizeof(preemption_vulnerabilityArray) / sizeof(preemption_vulnerabilityArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(preemption_vulnerability, preemption_vulnerabilityArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
|
||||
return preemption_vulnerability_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_preemption_vulnerability_free(OpenAPI_preemption_vulnerability_t *preemption_vulnerability)
|
||||
{
|
||||
if (NULL == preemption_vulnerability) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(preemption_vulnerability);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_preemption_vulnerability_convertToJSON(OpenAPI_preemption_vulnerability_t *preemption_vulnerability)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (preemption_vulnerability == NULL) {
|
||||
ogs_error("OpenAPI_preemption_vulnerability_convertToJSON() failed [PreemptionVulnerability]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_preemption_vulnerability_t *OpenAPI_preemption_vulnerability_parseFromJSON(cJSON *preemption_vulnerabilityJSON)
|
||||
{
|
||||
OpenAPI_preemption_vulnerability_t *preemption_vulnerability_local_var = NULL;
|
||||
preemption_vulnerability_local_var = OpenAPI_preemption_vulnerability_create (
|
||||
);
|
||||
|
||||
return preemption_vulnerability_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue