mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +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
89
lib/sbi/openapi/model/ec_restriction_data.c
Normal file
89
lib/sbi/openapi/model/ec_restriction_data.c
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "ec_restriction_data.h"
|
||||
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_create(
|
||||
int ec_mode_a_restricted,
|
||||
int ec_mode_b_restricted
|
||||
)
|
||||
{
|
||||
OpenAPI_ec_restriction_data_t *ec_restriction_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_ec_restriction_data_t));
|
||||
if (!ec_restriction_data_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
ec_restriction_data_local_var->ec_mode_a_restricted = ec_mode_a_restricted;
|
||||
ec_restriction_data_local_var->ec_mode_b_restricted = ec_mode_b_restricted;
|
||||
|
||||
return ec_restriction_data_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_ec_restriction_data_free(OpenAPI_ec_restriction_data_t *ec_restriction_data)
|
||||
{
|
||||
if (NULL == ec_restriction_data) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(ec_restriction_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_ec_restriction_data_convertToJSON(OpenAPI_ec_restriction_data_t *ec_restriction_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (ec_restriction_data == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_convertToJSON() failed [EcRestrictionData]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (ec_restriction_data->ec_mode_a_restricted >= 0) {
|
||||
if (cJSON_AddBoolToObject(item, "ecModeARestricted", ec_restriction_data->ec_mode_a_restricted) == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_convertToJSON() failed [ec_mode_a_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ec_restriction_data->ec_mode_b_restricted >= 0) {
|
||||
if (cJSON_AddBoolToObject(item, "ecModeBRestricted", ec_restriction_data->ec_mode_b_restricted) == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_convertToJSON() failed [ec_mode_b_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_parseFromJSON(cJSON *ec_restriction_dataJSON)
|
||||
{
|
||||
OpenAPI_ec_restriction_data_t *ec_restriction_data_local_var = NULL;
|
||||
cJSON *ec_mode_a_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_dataJSON, "ecModeARestricted");
|
||||
|
||||
if (ec_mode_a_restricted) {
|
||||
if (!cJSON_IsBool(ec_mode_a_restricted)) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_parseFromJSON() failed [ec_mode_a_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *ec_mode_b_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_dataJSON, "ecModeBRestricted");
|
||||
|
||||
if (ec_mode_b_restricted) {
|
||||
if (!cJSON_IsBool(ec_mode_b_restricted)) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_parseFromJSON() failed [ec_mode_b_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ec_restriction_data_local_var = OpenAPI_ec_restriction_data_create (
|
||||
ec_mode_a_restricted ? ec_mode_a_restricted->valueint : 0,
|
||||
ec_mode_b_restricted ? ec_mode_b_restricted->valueint : 0
|
||||
);
|
||||
|
||||
return ec_restriction_data_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue