mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +00:00
simple 5GC registration is done
This commit is contained in:
parent
bcd02b1f33
commit
b35c2277be
213 changed files with 7713 additions and 5445 deletions
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "max_integrity_protected_data_rate.h"
|
||||
|
||||
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_create(
|
||||
)
|
||||
char* OpenAPI_max_integrity_protected_data_rate_ToString(OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate)
|
||||
{
|
||||
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate_local_var = OpenAPI_malloc(sizeof(OpenAPI_max_integrity_protected_data_rate_t));
|
||||
if (!max_integrity_protected_data_rate_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return max_integrity_protected_data_rate_local_var;
|
||||
const char *max_integrity_protected_data_rateArray[] = { "NULL", "_64_KBPS", "MAX_UE_RATE" };
|
||||
size_t sizeofArray = sizeof(max_integrity_protected_data_rateArray) / sizeof(max_integrity_protected_data_rateArray[0]);
|
||||
if (max_integrity_protected_data_rate < sizeofArray)
|
||||
return (char *)max_integrity_protected_data_rateArray[max_integrity_protected_data_rate];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_max_integrity_protected_data_rate_free(OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate)
|
||||
OpenAPI_max_integrity_protected_data_rate_e OpenAPI_max_integrity_protected_data_rate_FromString(char* max_integrity_protected_data_rate)
|
||||
{
|
||||
if (NULL == max_integrity_protected_data_rate) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *max_integrity_protected_data_rateArray[] = { "NULL", "_64_KBPS", "MAX_UE_RATE" };
|
||||
size_t sizeofArray = sizeof(max_integrity_protected_data_rateArray) / sizeof(max_integrity_protected_data_rateArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(max_integrity_protected_data_rate, max_integrity_protected_data_rateArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(max_integrity_protected_data_rate);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_max_integrity_protected_data_rate_convertToJSON(OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (max_integrity_protected_data_rate == NULL) {
|
||||
ogs_error("OpenAPI_max_integrity_protected_data_rate_convertToJSON() failed [MaxIntegrityProtectedDataRate]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_parseFromJSON(cJSON *max_integrity_protected_data_rateJSON)
|
||||
{
|
||||
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate_local_var = NULL;
|
||||
max_integrity_protected_data_rate_local_var = OpenAPI_max_integrity_protected_data_rate_create (
|
||||
);
|
||||
|
||||
return max_integrity_protected_data_rate_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_copy(OpenAPI_max_integrity_protected_data_rate_t *dst, OpenAPI_max_integrity_protected_data_rate_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_max_integrity_protected_data_rate_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_max_integrity_protected_data_rate_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_max_integrity_protected_data_rate_free(dst);
|
||||
dst = OpenAPI_max_integrity_protected_data_rate_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue