feat: Add dedicated QoS flow

This commit is contained in:
Sukchan Lee 2020-12-31 21:07:08 -05:00
parent 65aea5ebf2
commit 235a041b8d
205 changed files with 6053 additions and 3831 deletions

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "af_sig_protocol.h"
OpenAPI_af_sig_protocol_t *OpenAPI_af_sig_protocol_create(
)
char* OpenAPI_af_sig_protocol_ToString(OpenAPI_af_sig_protocol_e af_sig_protocol)
{
OpenAPI_af_sig_protocol_t *af_sig_protocol_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_sig_protocol_t));
if (!af_sig_protocol_local_var) {
return NULL;
}
return af_sig_protocol_local_var;
const char *af_sig_protocolArray[] = { "NULL", "NO_INFORMATION", "SIP" };
size_t sizeofArray = sizeof(af_sig_protocolArray) / sizeof(af_sig_protocolArray[0]);
if (af_sig_protocol < sizeofArray)
return (char *)af_sig_protocolArray[af_sig_protocol];
else
return (char *)"Unknown";
}
void OpenAPI_af_sig_protocol_free(OpenAPI_af_sig_protocol_t *af_sig_protocol)
OpenAPI_af_sig_protocol_e OpenAPI_af_sig_protocol_FromString(char* af_sig_protocol)
{
if (NULL == af_sig_protocol) {
return;
int stringToReturn = 0;
const char *af_sig_protocolArray[] = { "NULL", "NO_INFORMATION", "SIP" };
size_t sizeofArray = sizeof(af_sig_protocolArray) / sizeof(af_sig_protocolArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(af_sig_protocol, af_sig_protocolArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(af_sig_protocol);
}
cJSON *OpenAPI_af_sig_protocol_convertToJSON(OpenAPI_af_sig_protocol_t *af_sig_protocol)
{
cJSON *item = NULL;
if (af_sig_protocol == NULL) {
ogs_error("OpenAPI_af_sig_protocol_convertToJSON() failed [AfSigProtocol]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_af_sig_protocol_t *OpenAPI_af_sig_protocol_parseFromJSON(cJSON *af_sig_protocolJSON)
{
OpenAPI_af_sig_protocol_t *af_sig_protocol_local_var = NULL;
af_sig_protocol_local_var = OpenAPI_af_sig_protocol_create (
);
return af_sig_protocol_local_var;
end:
return NULL;
}
OpenAPI_af_sig_protocol_t *OpenAPI_af_sig_protocol_copy(OpenAPI_af_sig_protocol_t *dst, OpenAPI_af_sig_protocol_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_af_sig_protocol_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_af_sig_protocol_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_af_sig_protocol_free(dst);
dst = OpenAPI_af_sig_protocol_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* af_sig_protocol.h
*
* Possible values are - NO_INFORMATION: Indicate that no information about the AF signalling protocol is being provided. - SIP: Indicate that the signalling protocol is Session Initiation Protocol.
*
*/
#ifndef _OpenAPI_af_sig_protocol_H_
@ -12,22 +12,16 @@
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "null_value.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_af_sig_protocol_s OpenAPI_af_sig_protocol_t;
typedef struct OpenAPI_af_sig_protocol_s {
} OpenAPI_af_sig_protocol_t;
typedef enum { OpenAPI_af_sig_protocol_NULL = 0, OpenAPI_af_sig_protocol_NO_INFORMATION, OpenAPI_af_sig_protocol_SIP } OpenAPI_af_sig_protocol_e;
OpenAPI_af_sig_protocol_t *OpenAPI_af_sig_protocol_create(
);
void OpenAPI_af_sig_protocol_free(OpenAPI_af_sig_protocol_t *af_sig_protocol);
OpenAPI_af_sig_protocol_t *OpenAPI_af_sig_protocol_parseFromJSON(cJSON *af_sig_protocolJSON);
cJSON *OpenAPI_af_sig_protocol_convertToJSON(OpenAPI_af_sig_protocol_t *af_sig_protocol);
OpenAPI_af_sig_protocol_t *OpenAPI_af_sig_protocol_copy(OpenAPI_af_sig_protocol_t *dst, OpenAPI_af_sig_protocol_t *src);
char* OpenAPI_af_sig_protocol_ToString(OpenAPI_af_sig_protocol_e af_sig_protocol);
OpenAPI_af_sig_protocol_e OpenAPI_af_sig_protocol_FromString(char* af_sig_protocol);
#ifdef __cplusplus
}

View file

@ -6,12 +6,12 @@
OpenAPI_charging_data_t *OpenAPI_charging_data_create(
char *chg_id,
OpenAPI_metering_method_t *metering_method,
OpenAPI_metering_method_e metering_method,
int offline,
int online,
int sdf_handl,
int rating_group,
OpenAPI_reporting_level_t *reporting_level,
OpenAPI_reporting_level_e reporting_level,
int service_id,
char *sponsor_id,
char *app_svc_prov_id,
@ -46,8 +46,6 @@ void OpenAPI_charging_data_free(OpenAPI_charging_data_t *charging_data)
}
OpenAPI_lnode_t *node;
ogs_free(charging_data->chg_id);
OpenAPI_metering_method_free(charging_data->metering_method);
OpenAPI_reporting_level_free(charging_data->reporting_level);
ogs_free(charging_data->sponsor_id);
ogs_free(charging_data->app_svc_prov_id);
ogs_free(charging_data->af_charg_id);
@ -74,13 +72,7 @@ cJSON *OpenAPI_charging_data_convertToJSON(OpenAPI_charging_data_t *charging_dat
}
if (charging_data->metering_method) {
cJSON *metering_method_local_JSON = OpenAPI_metering_method_convertToJSON(charging_data->metering_method);
if (metering_method_local_JSON == NULL) {
ogs_error("OpenAPI_charging_data_convertToJSON() failed [metering_method]");
goto end;
}
cJSON_AddItemToObject(item, "meteringMethod", metering_method_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "meteringMethod", OpenAPI_metering_method_ToString(charging_data->metering_method)) == NULL) {
ogs_error("OpenAPI_charging_data_convertToJSON() failed [metering_method]");
goto end;
}
@ -115,13 +107,7 @@ cJSON *OpenAPI_charging_data_convertToJSON(OpenAPI_charging_data_t *charging_dat
}
if (charging_data->reporting_level) {
cJSON *reporting_level_local_JSON = OpenAPI_reporting_level_convertToJSON(charging_data->reporting_level);
if (reporting_level_local_JSON == NULL) {
ogs_error("OpenAPI_charging_data_convertToJSON() failed [reporting_level]");
goto end;
}
cJSON_AddItemToObject(item, "reportingLevel", reporting_level_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "reportingLevel", OpenAPI_reporting_level_ToString(charging_data->reporting_level)) == NULL) {
ogs_error("OpenAPI_charging_data_convertToJSON() failed [reporting_level]");
goto end;
}
@ -183,9 +169,13 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat
cJSON *metering_method = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "meteringMethod");
OpenAPI_metering_method_t *metering_method_local_nonprim = NULL;
OpenAPI_metering_method_e metering_methodVariable;
if (metering_method) {
metering_method_local_nonprim = OpenAPI_metering_method_parseFromJSON(metering_method);
if (!cJSON_IsString(metering_method)) {
ogs_error("OpenAPI_charging_data_parseFromJSON() failed [metering_method]");
goto end;
}
metering_methodVariable = OpenAPI_metering_method_FromString(metering_method->valuestring);
}
cJSON *offline = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "offline");
@ -226,9 +216,13 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat
cJSON *reporting_level = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "reportingLevel");
OpenAPI_reporting_level_t *reporting_level_local_nonprim = NULL;
OpenAPI_reporting_level_e reporting_levelVariable;
if (reporting_level) {
reporting_level_local_nonprim = OpenAPI_reporting_level_parseFromJSON(reporting_level);
if (!cJSON_IsString(reporting_level)) {
ogs_error("OpenAPI_charging_data_parseFromJSON() failed [reporting_level]");
goto end;
}
reporting_levelVariable = OpenAPI_reporting_level_FromString(reporting_level->valuestring);
}
cJSON *service_id = cJSON_GetObjectItemCaseSensitive(charging_dataJSON, "serviceId");
@ -278,12 +272,12 @@ OpenAPI_charging_data_t *OpenAPI_charging_data_parseFromJSON(cJSON *charging_dat
charging_data_local_var = OpenAPI_charging_data_create (
ogs_strdup(chg_id->valuestring),
metering_method ? metering_method_local_nonprim : NULL,
metering_method ? metering_methodVariable : 0,
offline ? offline->valueint : 0,
online ? online->valueint : 0,
sdf_handl ? sdf_handl->valueint : 0,
rating_group ? rating_group->valuedouble : 0,
reporting_level ? reporting_level_local_nonprim : NULL,
reporting_level ? reporting_levelVariable : 0,
service_id ? service_id->valuedouble : 0,
sponsor_id ? ogs_strdup(sponsor_id->valuestring) : NULL,
app_svc_prov_id ? ogs_strdup(app_svc_prov_id->valuestring) : NULL,

View file

@ -22,12 +22,12 @@ extern "C" {
typedef struct OpenAPI_charging_data_s OpenAPI_charging_data_t;
typedef struct OpenAPI_charging_data_s {
char *chg_id;
struct OpenAPI_metering_method_s *metering_method;
OpenAPI_metering_method_e metering_method;
int offline;
int online;
int sdf_handl;
int rating_group;
struct OpenAPI_reporting_level_s *reporting_level;
OpenAPI_reporting_level_e reporting_level;
int service_id;
char *sponsor_id;
char *app_svc_prov_id;
@ -37,12 +37,12 @@ typedef struct OpenAPI_charging_data_s {
OpenAPI_charging_data_t *OpenAPI_charging_data_create(
char *chg_id,
OpenAPI_metering_method_t *metering_method,
OpenAPI_metering_method_e metering_method,
int offline,
int online,
int sdf_handl,
int rating_group,
OpenAPI_reporting_level_t *reporting_level,
OpenAPI_reporting_level_e reporting_level,
int service_id,
char *sponsor_id,
char *app_svc_prov_id,

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "credit_management_status.h"
OpenAPI_credit_management_status_t *OpenAPI_credit_management_status_create(
)
char* OpenAPI_credit_management_status_ToString(OpenAPI_credit_management_status_e credit_management_status)
{
OpenAPI_credit_management_status_t *credit_management_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_credit_management_status_t));
if (!credit_management_status_local_var) {
return NULL;
}
return credit_management_status_local_var;
const char *credit_management_statusArray[] = { "NULL", "END_USER_SER_DENIED", "CREDIT_CTRL_NOT_APP", "AUTH_REJECTED", "USER_UNKNOWN", "RATING_FAILED" };
size_t sizeofArray = sizeof(credit_management_statusArray) / sizeof(credit_management_statusArray[0]);
if (credit_management_status < sizeofArray)
return (char *)credit_management_statusArray[credit_management_status];
else
return (char *)"Unknown";
}
void OpenAPI_credit_management_status_free(OpenAPI_credit_management_status_t *credit_management_status)
OpenAPI_credit_management_status_e OpenAPI_credit_management_status_FromString(char* credit_management_status)
{
if (NULL == credit_management_status) {
return;
int stringToReturn = 0;
const char *credit_management_statusArray[] = { "NULL", "END_USER_SER_DENIED", "CREDIT_CTRL_NOT_APP", "AUTH_REJECTED", "USER_UNKNOWN", "RATING_FAILED" };
size_t sizeofArray = sizeof(credit_management_statusArray) / sizeof(credit_management_statusArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(credit_management_status, credit_management_statusArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(credit_management_status);
}
cJSON *OpenAPI_credit_management_status_convertToJSON(OpenAPI_credit_management_status_t *credit_management_status)
{
cJSON *item = NULL;
if (credit_management_status == NULL) {
ogs_error("OpenAPI_credit_management_status_convertToJSON() failed [CreditManagementStatus]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_credit_management_status_t *OpenAPI_credit_management_status_parseFromJSON(cJSON *credit_management_statusJSON)
{
OpenAPI_credit_management_status_t *credit_management_status_local_var = NULL;
credit_management_status_local_var = OpenAPI_credit_management_status_create (
);
return credit_management_status_local_var;
end:
return NULL;
}
OpenAPI_credit_management_status_t *OpenAPI_credit_management_status_copy(OpenAPI_credit_management_status_t *dst, OpenAPI_credit_management_status_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_credit_management_status_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_credit_management_status_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_credit_management_status_free(dst);
dst = OpenAPI_credit_management_status_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_credit_management_status_s OpenAPI_credit_management_status_t;
typedef struct OpenAPI_credit_management_status_s {
} OpenAPI_credit_management_status_t;
typedef enum { OpenAPI_credit_management_status_NULL = 0, OpenAPI_credit_management_status_END_USER_SER_DENIED, OpenAPI_credit_management_status_CREDIT_CTRL_NOT_APP, OpenAPI_credit_management_status_AUTH_REJECTED, OpenAPI_credit_management_status_USER_UNKNOWN, OpenAPI_credit_management_status_RATING_FAILED } OpenAPI_credit_management_status_e;
OpenAPI_credit_management_status_t *OpenAPI_credit_management_status_create(
);
void OpenAPI_credit_management_status_free(OpenAPI_credit_management_status_t *credit_management_status);
OpenAPI_credit_management_status_t *OpenAPI_credit_management_status_parseFromJSON(cJSON *credit_management_statusJSON);
cJSON *OpenAPI_credit_management_status_convertToJSON(OpenAPI_credit_management_status_t *credit_management_status);
OpenAPI_credit_management_status_t *OpenAPI_credit_management_status_copy(OpenAPI_credit_management_status_t *dst, OpenAPI_credit_management_status_t *src);
char* OpenAPI_credit_management_status_ToString(OpenAPI_credit_management_status_e credit_management_status);
OpenAPI_credit_management_status_e OpenAPI_credit_management_status_FromString(char* credit_management_status);
#ifdef __cplusplus
}

View file

@ -8,7 +8,7 @@ OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_create(
char *dest_mac_addr,
char *eth_type,
char *f_desc,
OpenAPI_flow_direction_t *f_dir,
OpenAPI_flow_direction_e f_dir,
char *source_mac_addr,
OpenAPI_list_t *vlan_tags,
char *src_mac_addr_end,
@ -40,7 +40,6 @@ void OpenAPI_eth_flow_description_free(OpenAPI_eth_flow_description_t *eth_flow_
ogs_free(eth_flow_description->dest_mac_addr);
ogs_free(eth_flow_description->eth_type);
ogs_free(eth_flow_description->f_desc);
OpenAPI_flow_direction_free(eth_flow_description->f_dir);
ogs_free(eth_flow_description->source_mac_addr);
OpenAPI_list_for_each(eth_flow_description->vlan_tags, node) {
ogs_free(node->data);
@ -85,13 +84,7 @@ cJSON *OpenAPI_eth_flow_description_convertToJSON(OpenAPI_eth_flow_description_t
}
if (eth_flow_description->f_dir) {
cJSON *f_dir_local_JSON = OpenAPI_flow_direction_convertToJSON(eth_flow_description->f_dir);
if (f_dir_local_JSON == NULL) {
ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [f_dir]");
goto end;
}
cJSON_AddItemToObject(item, "fDir", f_dir_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "fDir", OpenAPI_flow_direction_ToString(eth_flow_description->f_dir)) == NULL) {
ogs_error("OpenAPI_eth_flow_description_convertToJSON() failed [f_dir]");
goto end;
}
@ -173,9 +166,13 @@ OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_parseFromJSON(cJSON
cJSON *f_dir = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "fDir");
OpenAPI_flow_direction_t *f_dir_local_nonprim = NULL;
OpenAPI_flow_direction_e f_dirVariable;
if (f_dir) {
f_dir_local_nonprim = OpenAPI_flow_direction_parseFromJSON(f_dir);
if (!cJSON_IsString(f_dir)) {
ogs_error("OpenAPI_eth_flow_description_parseFromJSON() failed [f_dir]");
goto end;
}
f_dirVariable = OpenAPI_flow_direction_FromString(f_dir->valuestring);
}
cJSON *source_mac_addr = cJSON_GetObjectItemCaseSensitive(eth_flow_descriptionJSON, "sourceMacAddr");
@ -229,7 +226,7 @@ OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_parseFromJSON(cJSON
dest_mac_addr ? ogs_strdup(dest_mac_addr->valuestring) : NULL,
ogs_strdup(eth_type->valuestring),
f_desc ? ogs_strdup(f_desc->valuestring) : NULL,
f_dir ? f_dir_local_nonprim : NULL,
f_dir ? f_dirVariable : 0,
source_mac_addr ? ogs_strdup(source_mac_addr->valuestring) : NULL,
vlan_tags ? vlan_tagsList : NULL,
src_mac_addr_end ? ogs_strdup(src_mac_addr_end->valuestring) : NULL,

View file

@ -23,7 +23,7 @@ typedef struct OpenAPI_eth_flow_description_s {
char *dest_mac_addr;
char *eth_type;
char *f_desc;
struct OpenAPI_flow_direction_s *f_dir;
OpenAPI_flow_direction_e f_dir;
char *source_mac_addr;
OpenAPI_list_t *vlan_tags;
char *src_mac_addr_end;
@ -34,7 +34,7 @@ OpenAPI_eth_flow_description_t *OpenAPI_eth_flow_description_create(
char *dest_mac_addr,
char *eth_type,
char *f_desc,
OpenAPI_flow_direction_t *f_dir,
OpenAPI_flow_direction_e f_dir,
char *source_mac_addr,
OpenAPI_list_t *vlan_tags,
char *src_mac_addr_end,

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "failure_cause.h"
OpenAPI_failure_cause_t *OpenAPI_failure_cause_create(
)
char* OpenAPI_failure_cause_ToString(OpenAPI_failure_cause_e failure_cause)
{
OpenAPI_failure_cause_t *failure_cause_local_var = OpenAPI_malloc(sizeof(OpenAPI_failure_cause_t));
if (!failure_cause_local_var) {
return NULL;
}
return failure_cause_local_var;
const char *failure_causeArray[] = { "NULL", "PCC_RULE_EVENT", "PCC_QOS_FLOW_EVENT", "RULE_PERMANENT_ERROR", "RULE_TEMPORARY_ERROR" };
size_t sizeofArray = sizeof(failure_causeArray) / sizeof(failure_causeArray[0]);
if (failure_cause < sizeofArray)
return (char *)failure_causeArray[failure_cause];
else
return (char *)"Unknown";
}
void OpenAPI_failure_cause_free(OpenAPI_failure_cause_t *failure_cause)
OpenAPI_failure_cause_e OpenAPI_failure_cause_FromString(char* failure_cause)
{
if (NULL == failure_cause) {
return;
int stringToReturn = 0;
const char *failure_causeArray[] = { "NULL", "PCC_RULE_EVENT", "PCC_QOS_FLOW_EVENT", "RULE_PERMANENT_ERROR", "RULE_TEMPORARY_ERROR" };
size_t sizeofArray = sizeof(failure_causeArray) / sizeof(failure_causeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(failure_cause, failure_causeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(failure_cause);
}
cJSON *OpenAPI_failure_cause_convertToJSON(OpenAPI_failure_cause_t *failure_cause)
{
cJSON *item = NULL;
if (failure_cause == NULL) {
ogs_error("OpenAPI_failure_cause_convertToJSON() failed [FailureCause]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_failure_cause_t *OpenAPI_failure_cause_parseFromJSON(cJSON *failure_causeJSON)
{
OpenAPI_failure_cause_t *failure_cause_local_var = NULL;
failure_cause_local_var = OpenAPI_failure_cause_create (
);
return failure_cause_local_var;
end:
return NULL;
}
OpenAPI_failure_cause_t *OpenAPI_failure_cause_copy(OpenAPI_failure_cause_t *dst, OpenAPI_failure_cause_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_failure_cause_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_failure_cause_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_failure_cause_free(dst);
dst = OpenAPI_failure_cause_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_failure_cause_s OpenAPI_failure_cause_t;
typedef struct OpenAPI_failure_cause_s {
} OpenAPI_failure_cause_t;
typedef enum { OpenAPI_failure_cause_NULL = 0, OpenAPI_failure_cause_PCC_RULE_EVENT, OpenAPI_failure_cause_PCC_QOS_FLOW_EVENT, OpenAPI_failure_cause_RULE_PERMANENT_ERROR, OpenAPI_failure_cause_RULE_TEMPORARY_ERROR } OpenAPI_failure_cause_e;
OpenAPI_failure_cause_t *OpenAPI_failure_cause_create(
);
void OpenAPI_failure_cause_free(OpenAPI_failure_cause_t *failure_cause);
OpenAPI_failure_cause_t *OpenAPI_failure_cause_parseFromJSON(cJSON *failure_causeJSON);
cJSON *OpenAPI_failure_cause_convertToJSON(OpenAPI_failure_cause_t *failure_cause);
OpenAPI_failure_cause_t *OpenAPI_failure_cause_copy(OpenAPI_failure_cause_t *dst, OpenAPI_failure_cause_t *src);
char* OpenAPI_failure_cause_ToString(OpenAPI_failure_cause_e failure_cause);
OpenAPI_failure_cause_e OpenAPI_failure_cause_FromString(char* failure_cause);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "failure_code.h"
OpenAPI_failure_code_t *OpenAPI_failure_code_create(
)
char* OpenAPI_failure_code_ToString(OpenAPI_failure_code_e failure_code)
{
OpenAPI_failure_code_t *failure_code_local_var = OpenAPI_malloc(sizeof(OpenAPI_failure_code_t));
if (!failure_code_local_var) {
return NULL;
}
return failure_code_local_var;
const char *failure_codeArray[] = { "NULL", "UNK_RULE_ID", "RA_GR_ERR", "SER_ID_ERR", "NF_MAL", "RES_LIM", "MAX_NR_QoS_FLOW", "MISS_FLOW_INFO", "RES_ALLO_FAIL", "UNSUCC_QOS_VAL", "INCOR_FLOW_INFO", "PS_TO_CS_HAN", "APP_ID_ERR", "NO_QOS_FLOW_BOUND", "FILTER_RES", "MISS_REDI_SER_ADDR", "CM_END_USER_SER_DENIED", "CM_CREDIT_CON_NOT_APP", "CM_AUTH_REJ", "CM_USER_UNK", "CM_RAT_FAILED", "UE_STA_SUSP" };
size_t sizeofArray = sizeof(failure_codeArray) / sizeof(failure_codeArray[0]);
if (failure_code < sizeofArray)
return (char *)failure_codeArray[failure_code];
else
return (char *)"Unknown";
}
void OpenAPI_failure_code_free(OpenAPI_failure_code_t *failure_code)
OpenAPI_failure_code_e OpenAPI_failure_code_FromString(char* failure_code)
{
if (NULL == failure_code) {
return;
int stringToReturn = 0;
const char *failure_codeArray[] = { "NULL", "UNK_RULE_ID", "RA_GR_ERR", "SER_ID_ERR", "NF_MAL", "RES_LIM", "MAX_NR_QoS_FLOW", "MISS_FLOW_INFO", "RES_ALLO_FAIL", "UNSUCC_QOS_VAL", "INCOR_FLOW_INFO", "PS_TO_CS_HAN", "APP_ID_ERR", "NO_QOS_FLOW_BOUND", "FILTER_RES", "MISS_REDI_SER_ADDR", "CM_END_USER_SER_DENIED", "CM_CREDIT_CON_NOT_APP", "CM_AUTH_REJ", "CM_USER_UNK", "CM_RAT_FAILED", "UE_STA_SUSP" };
size_t sizeofArray = sizeof(failure_codeArray) / sizeof(failure_codeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(failure_code, failure_codeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(failure_code);
}
cJSON *OpenAPI_failure_code_convertToJSON(OpenAPI_failure_code_t *failure_code)
{
cJSON *item = NULL;
if (failure_code == NULL) {
ogs_error("OpenAPI_failure_code_convertToJSON() failed [FailureCode]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_failure_code_t *OpenAPI_failure_code_parseFromJSON(cJSON *failure_codeJSON)
{
OpenAPI_failure_code_t *failure_code_local_var = NULL;
failure_code_local_var = OpenAPI_failure_code_create (
);
return failure_code_local_var;
end:
return NULL;
}
OpenAPI_failure_code_t *OpenAPI_failure_code_copy(OpenAPI_failure_code_t *dst, OpenAPI_failure_code_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_failure_code_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_failure_code_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_failure_code_free(dst);
dst = OpenAPI_failure_code_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* failure_code.h
*
* Possible values are - UNK_RULE_ID: Indicates that the pre-provisioned PCC rule could not be successfully activated because the PCC rule identifier is unknown to the SMF. - RA_GR_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Rating Group specified within the Charging Data policy decision which the PCC rule refers to is unknown or, invalid. - SER_ID_ERR: Indicate that the PCC rule could not be successfully installed or enforced because the Service Identifier specified within the Charging Data policy decision which the PCC rule refers to is invalid, unknown, or not applicable to the service being charged. - NF_MAL: Indicate that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. - RES_LIM: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. - MAX_NR_QoS_FLOW: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to the fact that the maximum number of QoS flows has been reached for the PDU session. - MISS_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or enforced because neither the \&quot;flowInfos\&quot; attribute nor the \&quot;appId\&quot; attribute is specified within the PccRule data structure by the PCF during the first install request of the PCC rule. - RES_ALLO_FAIL: Indicate that the PCC rule could not be successfully installed or maintained since the QoS flow establishment/modification failed, or the QoS flow was released. - UNSUCC_QOS_VAL: indicate that the QoS validation has failed or when Guaranteed Bandwidth &gt; Max-Requested-Bandwidth. - INCOR_FLOW_INFO: Indicate that the PCC rule could not be successfully installed or modified at the SMF because the provided flow information is not supported by the network (e.g. the provided IP address(es) or Ipv6 prefix(es) do not correspond to an IP version applicable for the PDU session). - PS_TO_CS_HAN: Indicate that the PCC rule could not be maintained because of PS to CS handover. - APP_ID_ERR: Indicate that the rule could not be successfully installed or enforced because the Application Identifier is invalid, unknown, or not applicable to the application required for detection. - NO_QOS_FLOW_BOUND: Indicate that there is no QoS flow which the SMF can bind the PCC rule(s) to. - FILTER_RES: Indicate that the Flow Information within the \&quot;flowInfos\&quot; attribute cannot be handled by the SMF because any of the restrictions defined in subclause 5.4.2 of 3GPP TS 29.212 was not met. - MISS_REDI_SER_ADDR: Indicate that the PCC rule could not be successfully installed or enforced at the SMF because there is no valid Redirect Server Address within the Traffic Control Data policy decision which the PCC rule refers to provided by the PCF and no preconfigured redirection address for this PCC rule at the SMF. - CM_END_USER_SER_DENIED: Indicate that the charging system denied the service request due to service restrictions (e.g. terminate rating group) or limitations related to the end-user, for example the end-user&#39;s account could not cover the requested service. - CM_CREDIT_CON_NOT_APP: Indicate that the charging system determined that the service can be granted to the end user but no further credit control is needed for the service (e.g. service is free of charge or is treated for offline charging). - CM_AUTH_REJ: Indicate that the charging system denied the service request in order to terminate the service for which credit is requested. - CM_USER_UNK: Indicate that the specified end user could not be found in the charging system. - CM_RAT_FAILED: Indicate that the charging system cannot rate the service request due to insufficient rating input, incorrect AVP combination or due to an attribute or an attribute value that is not recognized or supported in the rating. - UE_STA_SUSP: Indicates that the UE is in suspend state.
*
*/
#ifndef _OpenAPI_failure_code_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_failure_code_s OpenAPI_failure_code_t;
typedef struct OpenAPI_failure_code_s {
} OpenAPI_failure_code_t;
typedef enum { OpenAPI_failure_code_NULL = 0, OpenAPI_failure_code_UNK_RULE_ID, OpenAPI_failure_code_RA_GR_ERR, OpenAPI_failure_code_SER_ID_ERR, OpenAPI_failure_code_NF_MAL, OpenAPI_failure_code_RES_LIM, OpenAPI_failure_code_MAX_NR_QoS_FLOW, OpenAPI_failure_code_MISS_FLOW_INFO, OpenAPI_failure_code_RES_ALLO_FAIL, OpenAPI_failure_code_UNSUCC_QOS_VAL, OpenAPI_failure_code_INCOR_FLOW_INFO, OpenAPI_failure_code_PS_TO_CS_HAN, OpenAPI_failure_code_APP_ID_ERR, OpenAPI_failure_code_NO_QOS_FLOW_BOUND, OpenAPI_failure_code_FILTER_RES, OpenAPI_failure_code_MISS_REDI_SER_ADDR, OpenAPI_failure_code_CM_END_USER_SER_DENIED, OpenAPI_failure_code_CM_CREDIT_CON_NOT_APP, OpenAPI_failure_code_CM_AUTH_REJ, OpenAPI_failure_code_CM_USER_UNK, OpenAPI_failure_code_CM_RAT_FAILED, OpenAPI_failure_code_UE_STA_SUSP } OpenAPI_failure_code_e;
OpenAPI_failure_code_t *OpenAPI_failure_code_create(
);
void OpenAPI_failure_code_free(OpenAPI_failure_code_t *failure_code);
OpenAPI_failure_code_t *OpenAPI_failure_code_parseFromJSON(cJSON *failure_codeJSON);
cJSON *OpenAPI_failure_code_convertToJSON(OpenAPI_failure_code_t *failure_code);
OpenAPI_failure_code_t *OpenAPI_failure_code_copy(OpenAPI_failure_code_t *dst, OpenAPI_failure_code_t *src);
char* OpenAPI_failure_code_ToString(OpenAPI_failure_code_e failure_code);
OpenAPI_failure_code_e OpenAPI_failure_code_FromString(char* failure_code);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "flow_direction.h"
OpenAPI_flow_direction_t *OpenAPI_flow_direction_create(
)
char* OpenAPI_flow_direction_ToString(OpenAPI_flow_direction_e flow_direction)
{
OpenAPI_flow_direction_t *flow_direction_local_var = OpenAPI_malloc(sizeof(OpenAPI_flow_direction_t));
if (!flow_direction_local_var) {
return NULL;
}
return flow_direction_local_var;
const char *flow_directionArray[] = { "NULL", "DOWNLINK", "UPLINK", "BIDIRECTIONAL", "UNSPECIFIED" };
size_t sizeofArray = sizeof(flow_directionArray) / sizeof(flow_directionArray[0]);
if (flow_direction < sizeofArray)
return (char *)flow_directionArray[flow_direction];
else
return (char *)"Unknown";
}
void OpenAPI_flow_direction_free(OpenAPI_flow_direction_t *flow_direction)
OpenAPI_flow_direction_e OpenAPI_flow_direction_FromString(char* flow_direction)
{
if (NULL == flow_direction) {
return;
int stringToReturn = 0;
const char *flow_directionArray[] = { "NULL", "DOWNLINK", "UPLINK", "BIDIRECTIONAL", "UNSPECIFIED" };
size_t sizeofArray = sizeof(flow_directionArray) / sizeof(flow_directionArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(flow_direction, flow_directionArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(flow_direction);
}
cJSON *OpenAPI_flow_direction_convertToJSON(OpenAPI_flow_direction_t *flow_direction)
{
cJSON *item = NULL;
if (flow_direction == NULL) {
ogs_error("OpenAPI_flow_direction_convertToJSON() failed [FlowDirection]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_flow_direction_t *OpenAPI_flow_direction_parseFromJSON(cJSON *flow_directionJSON)
{
OpenAPI_flow_direction_t *flow_direction_local_var = NULL;
flow_direction_local_var = OpenAPI_flow_direction_create (
);
return flow_direction_local_var;
end:
return NULL;
}
OpenAPI_flow_direction_t *OpenAPI_flow_direction_copy(OpenAPI_flow_direction_t *dst, OpenAPI_flow_direction_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_flow_direction_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_flow_direction_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_flow_direction_free(dst);
dst = OpenAPI_flow_direction_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* flow_direction.h
*
* Possible values are - DOWNLINK: The corresponding filter applies for traffic to the UE. - UPLINK: The corresponding filter applies for traffic from the UE. - BIDIRECTIONAL: The corresponding filter applies for traffic both to and from the UE. - UNSPECIFIED: The corresponding filter applies for traffic to the UE (downlink), but has no specific direction declared. The service data flow detection shall apply the filter for uplink traffic as if the filter was bidirectional. The PCF shall not use the value UNSPECIFIED in filters created by the network in NW-initiated procedures. The PCF shall only include the value UNSPECIFIED in filters in UE-initiated procedures if the same value is received from the SMF.
*
*/
#ifndef _OpenAPI_flow_direction_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_flow_direction_s OpenAPI_flow_direction_t;
typedef struct OpenAPI_flow_direction_s {
} OpenAPI_flow_direction_t;
typedef enum { OpenAPI_flow_direction_NULL = 0, OpenAPI_flow_direction_DOWNLINK, OpenAPI_flow_direction_UPLINK, OpenAPI_flow_direction_BIDIRECTIONAL, OpenAPI_flow_direction_UNSPECIFIED } OpenAPI_flow_direction_e;
OpenAPI_flow_direction_t *OpenAPI_flow_direction_create(
);
void OpenAPI_flow_direction_free(OpenAPI_flow_direction_t *flow_direction);
OpenAPI_flow_direction_t *OpenAPI_flow_direction_parseFromJSON(cJSON *flow_directionJSON);
cJSON *OpenAPI_flow_direction_convertToJSON(OpenAPI_flow_direction_t *flow_direction);
OpenAPI_flow_direction_t *OpenAPI_flow_direction_copy(OpenAPI_flow_direction_t *dst, OpenAPI_flow_direction_t *src);
char* OpenAPI_flow_direction_ToString(OpenAPI_flow_direction_e flow_direction);
OpenAPI_flow_direction_e OpenAPI_flow_direction_FromString(char* flow_direction);
#ifdef __cplusplus
}

View file

@ -12,7 +12,7 @@ OpenAPI_flow_information_t *OpenAPI_flow_information_create(
char *tos_traffic_class,
char *spi,
char *flow_label,
OpenAPI_flow_direction_rm_t *flow_direction
OpenAPI_flow_direction_e flow_direction
)
{
OpenAPI_flow_information_t *flow_information_local_var = OpenAPI_malloc(sizeof(OpenAPI_flow_information_t));
@ -43,7 +43,6 @@ void OpenAPI_flow_information_free(OpenAPI_flow_information_t *flow_information)
ogs_free(flow_information->tos_traffic_class);
ogs_free(flow_information->spi);
ogs_free(flow_information->flow_label);
OpenAPI_flow_direction_rm_free(flow_information->flow_direction);
ogs_free(flow_information);
}
@ -113,13 +112,7 @@ cJSON *OpenAPI_flow_information_convertToJSON(OpenAPI_flow_information_t *flow_i
}
if (flow_information->flow_direction) {
cJSON *flow_direction_local_JSON = OpenAPI_flow_direction_rm_convertToJSON(flow_information->flow_direction);
if (flow_direction_local_JSON == NULL) {
ogs_error("OpenAPI_flow_information_convertToJSON() failed [flow_direction]");
goto end;
}
cJSON_AddItemToObject(item, "flowDirection", flow_direction_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "flowDirection", OpenAPI_flow_direction_ToString(flow_information->flow_direction)) == NULL) {
ogs_error("OpenAPI_flow_information_convertToJSON() failed [flow_direction]");
goto end;
}
@ -195,9 +188,13 @@ OpenAPI_flow_information_t *OpenAPI_flow_information_parseFromJSON(cJSON *flow_i
cJSON *flow_direction = cJSON_GetObjectItemCaseSensitive(flow_informationJSON, "flowDirection");
OpenAPI_flow_direction_rm_t *flow_direction_local_nonprim = NULL;
OpenAPI_flow_direction_e flow_directionVariable;
if (flow_direction) {
flow_direction_local_nonprim = OpenAPI_flow_direction_rm_parseFromJSON(flow_direction);
if (!cJSON_IsString(flow_direction)) {
ogs_error("OpenAPI_flow_information_parseFromJSON() failed [flow_direction]");
goto end;
}
flow_directionVariable = OpenAPI_flow_direction_FromString(flow_direction->valuestring);
}
flow_information_local_var = OpenAPI_flow_information_create (
@ -208,7 +205,7 @@ OpenAPI_flow_information_t *OpenAPI_flow_information_parseFromJSON(cJSON *flow_i
tos_traffic_class ? ogs_strdup(tos_traffic_class->valuestring) : NULL,
spi ? ogs_strdup(spi->valuestring) : NULL,
flow_label ? ogs_strdup(flow_label->valuestring) : NULL,
flow_direction ? flow_direction_local_nonprim : NULL
flow_direction ? flow_directionVariable : 0
);
return flow_information_local_var;

View file

@ -13,7 +13,7 @@
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "eth_flow_description.h"
#include "flow_direction_rm.h"
#include "flow_direction.h"
#ifdef __cplusplus
extern "C" {
@ -28,7 +28,7 @@ typedef struct OpenAPI_flow_information_s {
char *tos_traffic_class;
char *spi;
char *flow_label;
struct OpenAPI_flow_direction_rm_s *flow_direction;
OpenAPI_flow_direction_e flow_direction;
} OpenAPI_flow_information_t;
OpenAPI_flow_information_t *OpenAPI_flow_information_create(
@ -39,7 +39,7 @@ OpenAPI_flow_information_t *OpenAPI_flow_information_create(
char *tos_traffic_class,
char *spi,
char *flow_label,
OpenAPI_flow_direction_rm_t *flow_direction
OpenAPI_flow_direction_e flow_direction
);
void OpenAPI_flow_information_free(OpenAPI_flow_information_t *flow_information);
OpenAPI_flow_information_t *OpenAPI_flow_information_parseFromJSON(cJSON *flow_informationJSON);

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "ma_pdu_indication.h"
OpenAPI_ma_pdu_indication_t *OpenAPI_ma_pdu_indication_create(
)
char* OpenAPI_ma_pdu_indication_ToString(OpenAPI_ma_pdu_indication_e ma_pdu_indication)
{
OpenAPI_ma_pdu_indication_t *ma_pdu_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_ma_pdu_indication_t));
if (!ma_pdu_indication_local_var) {
return NULL;
}
return ma_pdu_indication_local_var;
const char *ma_pdu_indicationArray[] = { "NULL", "MA_PDU_REQUEST", "MA_PDU_NETWORK_UPGRADE_ALLOWED" };
size_t sizeofArray = sizeof(ma_pdu_indicationArray) / sizeof(ma_pdu_indicationArray[0]);
if (ma_pdu_indication < sizeofArray)
return (char *)ma_pdu_indicationArray[ma_pdu_indication];
else
return (char *)"Unknown";
}
void OpenAPI_ma_pdu_indication_free(OpenAPI_ma_pdu_indication_t *ma_pdu_indication)
OpenAPI_ma_pdu_indication_e OpenAPI_ma_pdu_indication_FromString(char* ma_pdu_indication)
{
if (NULL == ma_pdu_indication) {
return;
int stringToReturn = 0;
const char *ma_pdu_indicationArray[] = { "NULL", "MA_PDU_REQUEST", "MA_PDU_NETWORK_UPGRADE_ALLOWED" };
size_t sizeofArray = sizeof(ma_pdu_indicationArray) / sizeof(ma_pdu_indicationArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(ma_pdu_indication, ma_pdu_indicationArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(ma_pdu_indication);
}
cJSON *OpenAPI_ma_pdu_indication_convertToJSON(OpenAPI_ma_pdu_indication_t *ma_pdu_indication)
{
cJSON *item = NULL;
if (ma_pdu_indication == NULL) {
ogs_error("OpenAPI_ma_pdu_indication_convertToJSON() failed [MaPduIndication]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_ma_pdu_indication_t *OpenAPI_ma_pdu_indication_parseFromJSON(cJSON *ma_pdu_indicationJSON)
{
OpenAPI_ma_pdu_indication_t *ma_pdu_indication_local_var = NULL;
ma_pdu_indication_local_var = OpenAPI_ma_pdu_indication_create (
);
return ma_pdu_indication_local_var;
end:
return NULL;
}
OpenAPI_ma_pdu_indication_t *OpenAPI_ma_pdu_indication_copy(OpenAPI_ma_pdu_indication_t *dst, OpenAPI_ma_pdu_indication_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_ma_pdu_indication_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_ma_pdu_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_ma_pdu_indication_free(dst);
dst = OpenAPI_ma_pdu_indication_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_ma_pdu_indication_s OpenAPI_ma_pdu_indication_t;
typedef struct OpenAPI_ma_pdu_indication_s {
} OpenAPI_ma_pdu_indication_t;
typedef enum { OpenAPI_ma_pdu_indication_NULL = 0, OpenAPI_ma_pdu_indication_MA_PDU_REQUEST, OpenAPI_ma_pdu_indication_MA_PDU_NETWORK_UPGRADE_ALLOWED } OpenAPI_ma_pdu_indication_e;
OpenAPI_ma_pdu_indication_t *OpenAPI_ma_pdu_indication_create(
);
void OpenAPI_ma_pdu_indication_free(OpenAPI_ma_pdu_indication_t *ma_pdu_indication);
OpenAPI_ma_pdu_indication_t *OpenAPI_ma_pdu_indication_parseFromJSON(cJSON *ma_pdu_indicationJSON);
cJSON *OpenAPI_ma_pdu_indication_convertToJSON(OpenAPI_ma_pdu_indication_t *ma_pdu_indication);
OpenAPI_ma_pdu_indication_t *OpenAPI_ma_pdu_indication_copy(OpenAPI_ma_pdu_indication_t *dst, OpenAPI_ma_pdu_indication_t *src);
char* OpenAPI_ma_pdu_indication_ToString(OpenAPI_ma_pdu_indication_e ma_pdu_indication);
OpenAPI_ma_pdu_indication_e OpenAPI_ma_pdu_indication_FromString(char* ma_pdu_indication);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "metering_method.h"
OpenAPI_metering_method_t *OpenAPI_metering_method_create(
)
char* OpenAPI_metering_method_ToString(OpenAPI_metering_method_e metering_method)
{
OpenAPI_metering_method_t *metering_method_local_var = OpenAPI_malloc(sizeof(OpenAPI_metering_method_t));
if (!metering_method_local_var) {
return NULL;
}
return metering_method_local_var;
const char *metering_methodArray[] = { "NULL", "DURATION", "VOLUME", "DURATION_VOLUME", "EVENT" };
size_t sizeofArray = sizeof(metering_methodArray) / sizeof(metering_methodArray[0]);
if (metering_method < sizeofArray)
return (char *)metering_methodArray[metering_method];
else
return (char *)"Unknown";
}
void OpenAPI_metering_method_free(OpenAPI_metering_method_t *metering_method)
OpenAPI_metering_method_e OpenAPI_metering_method_FromString(char* metering_method)
{
if (NULL == metering_method) {
return;
int stringToReturn = 0;
const char *metering_methodArray[] = { "NULL", "DURATION", "VOLUME", "DURATION_VOLUME", "EVENT" };
size_t sizeofArray = sizeof(metering_methodArray) / sizeof(metering_methodArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(metering_method, metering_methodArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(metering_method);
}
cJSON *OpenAPI_metering_method_convertToJSON(OpenAPI_metering_method_t *metering_method)
{
cJSON *item = NULL;
if (metering_method == NULL) {
ogs_error("OpenAPI_metering_method_convertToJSON() failed [MeteringMethod]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_metering_method_t *OpenAPI_metering_method_parseFromJSON(cJSON *metering_methodJSON)
{
OpenAPI_metering_method_t *metering_method_local_var = NULL;
metering_method_local_var = OpenAPI_metering_method_create (
);
return metering_method_local_var;
end:
return NULL;
}
OpenAPI_metering_method_t *OpenAPI_metering_method_copy(OpenAPI_metering_method_t *dst, OpenAPI_metering_method_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_metering_method_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_metering_method_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_metering_method_free(dst);
dst = OpenAPI_metering_method_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* metering_method.h
*
* Possible values are - DURATION: Indicates that the duration of the service data flow traffic shall be metered. - VOLUME: Indicates that volume of the service data flow traffic shall be metered. - DURATION_VOLUME: Indicates that the duration and the volume of the service data flow traffic shall be metered. - EVENT: Indicates that events of the service data flow traffic shall be metered.
*
*/
#ifndef _OpenAPI_metering_method_H_
@ -12,22 +12,16 @@
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "null_value.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_metering_method_s OpenAPI_metering_method_t;
typedef struct OpenAPI_metering_method_s {
} OpenAPI_metering_method_t;
typedef enum { OpenAPI_metering_method_NULL = 0, OpenAPI_metering_method_DURATION, OpenAPI_metering_method_VOLUME, OpenAPI_metering_method_DURATION_VOLUME, OpenAPI_metering_method_EVENT } OpenAPI_metering_method_e;
OpenAPI_metering_method_t *OpenAPI_metering_method_create(
);
void OpenAPI_metering_method_free(OpenAPI_metering_method_t *metering_method);
OpenAPI_metering_method_t *OpenAPI_metering_method_parseFromJSON(cJSON *metering_methodJSON);
cJSON *OpenAPI_metering_method_convertToJSON(OpenAPI_metering_method_t *metering_method);
OpenAPI_metering_method_t *OpenAPI_metering_method_copy(OpenAPI_metering_method_t *dst, OpenAPI_metering_method_t *src);
char* OpenAPI_metering_method_ToString(OpenAPI_metering_method_e metering_method);
OpenAPI_metering_method_e OpenAPI_metering_method_FromString(char* metering_method);
#ifdef __cplusplus
}

View file

@ -10,7 +10,7 @@ OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_create(
char *tos_traffic_class,
char *spi,
char *flow_label,
OpenAPI_flow_direction_t *flow_direction
OpenAPI_flow_direction_e flow_direction
)
{
OpenAPI_packet_filter_info_t *packet_filter_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_packet_filter_info_t));
@ -38,7 +38,6 @@ void OpenAPI_packet_filter_info_free(OpenAPI_packet_filter_info_t *packet_filter
ogs_free(packet_filter_info->tos_traffic_class);
ogs_free(packet_filter_info->spi);
ogs_free(packet_filter_info->flow_label);
OpenAPI_flow_direction_free(packet_filter_info->flow_direction);
ogs_free(packet_filter_info);
}
@ -88,13 +87,7 @@ cJSON *OpenAPI_packet_filter_info_convertToJSON(OpenAPI_packet_filter_info_t *pa
}
if (packet_filter_info->flow_direction) {
cJSON *flow_direction_local_JSON = OpenAPI_flow_direction_convertToJSON(packet_filter_info->flow_direction);
if (flow_direction_local_JSON == NULL) {
ogs_error("OpenAPI_packet_filter_info_convertToJSON() failed [flow_direction]");
goto end;
}
cJSON_AddItemToObject(item, "flowDirection", flow_direction_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "flowDirection", OpenAPI_flow_direction_ToString(packet_filter_info->flow_direction)) == NULL) {
ogs_error("OpenAPI_packet_filter_info_convertToJSON() failed [flow_direction]");
goto end;
}
@ -154,9 +147,13 @@ OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_parseFromJSON(cJSON *pa
cJSON *flow_direction = cJSON_GetObjectItemCaseSensitive(packet_filter_infoJSON, "flowDirection");
OpenAPI_flow_direction_t *flow_direction_local_nonprim = NULL;
OpenAPI_flow_direction_e flow_directionVariable;
if (flow_direction) {
flow_direction_local_nonprim = OpenAPI_flow_direction_parseFromJSON(flow_direction);
if (!cJSON_IsString(flow_direction)) {
ogs_error("OpenAPI_packet_filter_info_parseFromJSON() failed [flow_direction]");
goto end;
}
flow_directionVariable = OpenAPI_flow_direction_FromString(flow_direction->valuestring);
}
packet_filter_info_local_var = OpenAPI_packet_filter_info_create (
@ -165,7 +162,7 @@ OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_parseFromJSON(cJSON *pa
tos_traffic_class ? ogs_strdup(tos_traffic_class->valuestring) : NULL,
spi ? ogs_strdup(spi->valuestring) : NULL,
flow_label ? ogs_strdup(flow_label->valuestring) : NULL,
flow_direction ? flow_direction_local_nonprim : NULL
flow_direction ? flow_directionVariable : 0
);
return packet_filter_info_local_var;

View file

@ -25,7 +25,7 @@ typedef struct OpenAPI_packet_filter_info_s {
char *tos_traffic_class;
char *spi;
char *flow_label;
struct OpenAPI_flow_direction_s *flow_direction;
OpenAPI_flow_direction_e flow_direction;
} OpenAPI_packet_filter_info_t;
OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_create(
@ -34,7 +34,7 @@ OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_create(
char *tos_traffic_class,
char *spi,
char *flow_label,
OpenAPI_flow_direction_t *flow_direction
OpenAPI_flow_direction_e flow_direction
);
void OpenAPI_packet_filter_info_free(OpenAPI_packet_filter_info_t *packet_filter_info);
OpenAPI_packet_filter_info_t *OpenAPI_packet_filter_info_parseFromJSON(cJSON *packet_filter_infoJSON);

View file

@ -5,7 +5,7 @@
#include "partial_success_report.h"
OpenAPI_partial_success_report_t *OpenAPI_partial_success_report_create(
OpenAPI_failure_cause_t *failure_cause,
OpenAPI_failure_cause_e failure_cause,
OpenAPI_list_t *rule_reports,
OpenAPI_list_t *sess_rule_reports,
OpenAPI_ue_camping_rep_t *ue_camping_rep
@ -29,7 +29,6 @@ void OpenAPI_partial_success_report_free(OpenAPI_partial_success_report_t *parti
return;
}
OpenAPI_lnode_t *node;
OpenAPI_failure_cause_free(partial_success_report->failure_cause);
OpenAPI_list_for_each(partial_success_report->rule_reports, node) {
OpenAPI_rule_report_free(node->data);
}
@ -56,13 +55,7 @@ cJSON *OpenAPI_partial_success_report_convertToJSON(OpenAPI_partial_success_repo
ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [failure_cause]");
goto end;
}
cJSON *failure_cause_local_JSON = OpenAPI_failure_cause_convertToJSON(partial_success_report->failure_cause);
if (failure_cause_local_JSON == NULL) {
ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [failure_cause]");
goto end;
}
cJSON_AddItemToObject(item, "failureCause", failure_cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "failureCause", OpenAPI_failure_cause_ToString(partial_success_report->failure_cause)) == NULL) {
ogs_error("OpenAPI_partial_success_report_convertToJSON() failed [failure_cause]");
goto end;
}
@ -133,9 +126,13 @@ OpenAPI_partial_success_report_t *OpenAPI_partial_success_report_parseFromJSON(c
goto end;
}
OpenAPI_failure_cause_t *failure_cause_local_nonprim = NULL;
OpenAPI_failure_cause_e failure_causeVariable;
failure_cause_local_nonprim = OpenAPI_failure_cause_parseFromJSON(failure_cause);
if (!cJSON_IsString(failure_cause)) {
ogs_error("OpenAPI_partial_success_report_parseFromJSON() failed [failure_cause]");
goto end;
}
failure_causeVariable = OpenAPI_failure_cause_FromString(failure_cause->valuestring);
cJSON *rule_reports = cJSON_GetObjectItemCaseSensitive(partial_success_reportJSON, "ruleReports");
@ -191,7 +188,7 @@ OpenAPI_partial_success_report_t *OpenAPI_partial_success_report_parseFromJSON(c
}
partial_success_report_local_var = OpenAPI_partial_success_report_create (
failure_cause_local_nonprim,
failure_causeVariable,
rule_reports ? rule_reportsList : NULL,
sess_rule_reports ? sess_rule_reportsList : NULL,
ue_camping_rep ? ue_camping_rep_local_nonprim : NULL

View file

@ -23,14 +23,14 @@ extern "C" {
typedef struct OpenAPI_partial_success_report_s OpenAPI_partial_success_report_t;
typedef struct OpenAPI_partial_success_report_s {
struct OpenAPI_failure_cause_s *failure_cause;
OpenAPI_failure_cause_e failure_cause;
OpenAPI_list_t *rule_reports;
OpenAPI_list_t *sess_rule_reports;
struct OpenAPI_ue_camping_rep_s *ue_camping_rep;
} OpenAPI_partial_success_report_t;
OpenAPI_partial_success_report_t *OpenAPI_partial_success_report_create(
OpenAPI_failure_cause_t *failure_cause,
OpenAPI_failure_cause_e failure_cause,
OpenAPI_list_t *rule_reports,
OpenAPI_list_t *sess_rule_reports,
OpenAPI_ue_camping_rep_t *ue_camping_rep

View file

@ -10,7 +10,7 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_create(
int cont_ver,
char *pcc_rule_id,
int precedence,
OpenAPI_af_sig_protocol_t *af_sig_protocol,
OpenAPI_af_sig_protocol_e af_sig_protocol,
int app_reloc,
OpenAPI_list_t *ref_qos_data,
OpenAPI_list_t *ref_alt_qos_params,
@ -65,7 +65,6 @@ void OpenAPI_pcc_rule_free(OpenAPI_pcc_rule_t *pcc_rule)
OpenAPI_list_free(pcc_rule->flow_infos);
ogs_free(pcc_rule->app_id);
ogs_free(pcc_rule->pcc_rule_id);
OpenAPI_af_sig_protocol_free(pcc_rule->af_sig_protocol);
OpenAPI_list_for_each(pcc_rule->ref_qos_data, node) {
ogs_free(node->data);
}
@ -165,13 +164,7 @@ cJSON *OpenAPI_pcc_rule_convertToJSON(OpenAPI_pcc_rule_t *pcc_rule)
}
if (pcc_rule->af_sig_protocol) {
cJSON *af_sig_protocol_local_JSON = OpenAPI_af_sig_protocol_convertToJSON(pcc_rule->af_sig_protocol);
if (af_sig_protocol_local_JSON == NULL) {
ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [af_sig_protocol]");
goto end;
}
cJSON_AddItemToObject(item, "afSigProtocol", af_sig_protocol_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "afSigProtocol", OpenAPI_af_sig_protocol_ToString(pcc_rule->af_sig_protocol)) == NULL) {
ogs_error("OpenAPI_pcc_rule_convertToJSON() failed [af_sig_protocol]");
goto end;
}
@ -423,9 +416,13 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON)
cJSON *af_sig_protocol = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "afSigProtocol");
OpenAPI_af_sig_protocol_t *af_sig_protocol_local_nonprim = NULL;
OpenAPI_af_sig_protocol_e af_sig_protocolVariable;
if (af_sig_protocol) {
af_sig_protocol_local_nonprim = OpenAPI_af_sig_protocol_parseFromJSON(af_sig_protocol);
if (!cJSON_IsString(af_sig_protocol)) {
ogs_error("OpenAPI_pcc_rule_parseFromJSON() failed [af_sig_protocol]");
goto end;
}
af_sig_protocolVariable = OpenAPI_af_sig_protocol_FromString(af_sig_protocol->valuestring);
}
cJSON *app_reloc = cJSON_GetObjectItemCaseSensitive(pcc_ruleJSON, "appReloc");
@ -635,7 +632,7 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_parseFromJSON(cJSON *pcc_ruleJSON)
cont_ver ? cont_ver->valuedouble : 0,
ogs_strdup(pcc_rule_id->valuestring),
precedence ? precedence->valuedouble : 0,
af_sig_protocol ? af_sig_protocol_local_nonprim : NULL,
af_sig_protocol ? af_sig_protocolVariable : 0,
app_reloc ? app_reloc->valueint : 0,
ref_qos_data ? ref_qos_dataList : NULL,
ref_alt_qos_params ? ref_alt_qos_paramsList : NULL,

View file

@ -27,7 +27,7 @@ typedef struct OpenAPI_pcc_rule_s {
int cont_ver;
char *pcc_rule_id;
int precedence;
struct OpenAPI_af_sig_protocol_s *af_sig_protocol;
OpenAPI_af_sig_protocol_e af_sig_protocol;
int app_reloc;
OpenAPI_list_t *ref_qos_data;
OpenAPI_list_t *ref_alt_qos_params;
@ -49,7 +49,7 @@ OpenAPI_pcc_rule_t *OpenAPI_pcc_rule_create(
int cont_ver,
char *pcc_rule_id,
int precedence,
OpenAPI_af_sig_protocol_t *af_sig_protocol,
OpenAPI_af_sig_protocol_e af_sig_protocol,
int app_reloc,
OpenAPI_list_t *ref_qos_data,
OpenAPI_list_t *ref_alt_qos_params,

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "pdu_session_rel_cause.h"
OpenAPI_pdu_session_rel_cause_t *OpenAPI_pdu_session_rel_cause_create(
)
char* OpenAPI_pdu_session_rel_cause_ToString(OpenAPI_pdu_session_rel_cause_e pdu_session_rel_cause)
{
OpenAPI_pdu_session_rel_cause_t *pdu_session_rel_cause_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_rel_cause_t));
if (!pdu_session_rel_cause_local_var) {
return NULL;
}
return pdu_session_rel_cause_local_var;
const char *pdu_session_rel_causeArray[] = { "NULL", "PS_TO_CS_HO" };
size_t sizeofArray = sizeof(pdu_session_rel_causeArray) / sizeof(pdu_session_rel_causeArray[0]);
if (pdu_session_rel_cause < sizeofArray)
return (char *)pdu_session_rel_causeArray[pdu_session_rel_cause];
else
return (char *)"Unknown";
}
void OpenAPI_pdu_session_rel_cause_free(OpenAPI_pdu_session_rel_cause_t *pdu_session_rel_cause)
OpenAPI_pdu_session_rel_cause_e OpenAPI_pdu_session_rel_cause_FromString(char* pdu_session_rel_cause)
{
if (NULL == pdu_session_rel_cause) {
return;
int stringToReturn = 0;
const char *pdu_session_rel_causeArray[] = { "NULL", "PS_TO_CS_HO" };
size_t sizeofArray = sizeof(pdu_session_rel_causeArray) / sizeof(pdu_session_rel_causeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(pdu_session_rel_cause, pdu_session_rel_causeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(pdu_session_rel_cause);
}
cJSON *OpenAPI_pdu_session_rel_cause_convertToJSON(OpenAPI_pdu_session_rel_cause_t *pdu_session_rel_cause)
{
cJSON *item = NULL;
if (pdu_session_rel_cause == NULL) {
ogs_error("OpenAPI_pdu_session_rel_cause_convertToJSON() failed [PduSessionRelCause]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_pdu_session_rel_cause_t *OpenAPI_pdu_session_rel_cause_parseFromJSON(cJSON *pdu_session_rel_causeJSON)
{
OpenAPI_pdu_session_rel_cause_t *pdu_session_rel_cause_local_var = NULL;
pdu_session_rel_cause_local_var = OpenAPI_pdu_session_rel_cause_create (
);
return pdu_session_rel_cause_local_var;
end:
return NULL;
}
OpenAPI_pdu_session_rel_cause_t *OpenAPI_pdu_session_rel_cause_copy(OpenAPI_pdu_session_rel_cause_t *dst, OpenAPI_pdu_session_rel_cause_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_pdu_session_rel_cause_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_pdu_session_rel_cause_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_pdu_session_rel_cause_free(dst);
dst = OpenAPI_pdu_session_rel_cause_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_pdu_session_rel_cause_s OpenAPI_pdu_session_rel_cause_t;
typedef struct OpenAPI_pdu_session_rel_cause_s {
} OpenAPI_pdu_session_rel_cause_t;
typedef enum { OpenAPI_pdu_session_rel_cause_NULL = 0, OpenAPI_pdu_session_rel_cause_PS_TO_CS_HO } OpenAPI_pdu_session_rel_cause_e;
OpenAPI_pdu_session_rel_cause_t *OpenAPI_pdu_session_rel_cause_create(
);
void OpenAPI_pdu_session_rel_cause_free(OpenAPI_pdu_session_rel_cause_t *pdu_session_rel_cause);
OpenAPI_pdu_session_rel_cause_t *OpenAPI_pdu_session_rel_cause_parseFromJSON(cJSON *pdu_session_rel_causeJSON);
cJSON *OpenAPI_pdu_session_rel_cause_convertToJSON(OpenAPI_pdu_session_rel_cause_t *pdu_session_rel_cause);
OpenAPI_pdu_session_rel_cause_t *OpenAPI_pdu_session_rel_cause_copy(OpenAPI_pdu_session_rel_cause_t *dst, OpenAPI_pdu_session_rel_cause_t *src);
char* OpenAPI_pdu_session_rel_cause_ToString(OpenAPI_pdu_session_rel_cause_e pdu_session_rel_cause);
OpenAPI_pdu_session_rel_cause_e OpenAPI_pdu_session_rel_cause_FromString(char* pdu_session_rel_cause);
#ifdef __cplusplus
}

View file

@ -28,7 +28,7 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_create(
OpenAPI_list_t *mapping_snssais,
OpenAPI_list_t *n3g_allowed_snssais,
OpenAPI_guami_t *guami,
char *servive_name,
char *service_name,
OpenAPI_trace_data_t *trace_req,
char *supp_feat
)
@ -60,7 +60,7 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_create(
policy_association_request_local_var->mapping_snssais = mapping_snssais;
policy_association_request_local_var->n3g_allowed_snssais = n3g_allowed_snssais;
policy_association_request_local_var->guami = guami;
policy_association_request_local_var->servive_name = servive_name;
policy_association_request_local_var->service_name = service_name;
policy_association_request_local_var->trace_req = trace_req;
policy_association_request_local_var->supp_feat = supp_feat;
@ -111,7 +111,7 @@ void OpenAPI_policy_association_request_free(OpenAPI_policy_association_request_
}
OpenAPI_list_free(policy_association_request->n3g_allowed_snssais);
OpenAPI_guami_free(policy_association_request->guami);
ogs_free(policy_association_request->servive_name);
ogs_free(policy_association_request->service_name);
OpenAPI_trace_data_free(policy_association_request->trace_req);
ogs_free(policy_association_request->supp_feat);
ogs_free(policy_association_request);
@ -416,9 +416,9 @@ cJSON *OpenAPI_policy_association_request_convertToJSON(OpenAPI_policy_associati
}
}
if (policy_association_request->servive_name) {
if (cJSON_AddStringToObject(item, "serviveName", policy_association_request->servive_name) == NULL) {
ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [servive_name]");
if (policy_association_request->service_name) {
if (cJSON_AddStringToObject(item, "serviceName", policy_association_request->service_name) == NULL) {
ogs_error("OpenAPI_policy_association_request_convertToJSON() failed [service_name]");
goto end;
}
}
@ -756,11 +756,11 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFr
guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami);
}
cJSON *servive_name = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "serviveName");
cJSON *service_name = cJSON_GetObjectItemCaseSensitive(policy_association_requestJSON, "serviceName");
if (servive_name) {
if (!cJSON_IsString(servive_name)) {
ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [servive_name]");
if (service_name) {
if (!cJSON_IsString(service_name)) {
ogs_error("OpenAPI_policy_association_request_parseFromJSON() failed [service_name]");
goto end;
}
}
@ -808,7 +808,7 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_parseFr
mapping_snssais ? mapping_snssaisList : NULL,
n3g_allowed_snssais ? n3g_allowed_snssaisList : NULL,
guami ? guami_local_nonprim : NULL,
servive_name ? ogs_strdup(servive_name->valuestring) : NULL,
service_name ? ogs_strdup(service_name->valuestring) : NULL,
trace_req ? trace_req_local_nonprim : NULL,
ogs_strdup(supp_feat->valuestring)
);

View file

@ -1,7 +1,7 @@
/*
* policy_association_request.h
*
* Information which the NF service consumer provides when requesting the creation of a policy association. The serviveName property corresponds to the serviceName in the main body of the specification.
* Information which the NF service consumer provides when requesting the creation of a policy association. The serviceName property corresponds to the serviceName in the main body of the specification.
*/
#ifndef _OpenAPI_policy_association_request_H_
@ -53,7 +53,7 @@ typedef struct OpenAPI_policy_association_request_s {
OpenAPI_list_t *mapping_snssais;
OpenAPI_list_t *n3g_allowed_snssais;
struct OpenAPI_guami_s *guami;
char *servive_name;
char *service_name;
struct OpenAPI_trace_data_s *trace_req;
char *supp_feat;
} OpenAPI_policy_association_request_t;
@ -82,7 +82,7 @@ OpenAPI_policy_association_request_t *OpenAPI_policy_association_request_create(
OpenAPI_list_t *mapping_snssais,
OpenAPI_list_t *n3g_allowed_snssais,
OpenAPI_guami_t *guami,
char *servive_name,
char *service_name,
OpenAPI_trace_data_t *trace_req,
char *supp_feat
);

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "policy_control_request_trigger.h"
OpenAPI_policy_control_request_trigger_t *OpenAPI_policy_control_request_trigger_create(
)
char* OpenAPI_policy_control_request_trigger_ToString(OpenAPI_policy_control_request_trigger_e policy_control_request_trigger)
{
OpenAPI_policy_control_request_trigger_t *policy_control_request_trigger_local_var = OpenAPI_malloc(sizeof(OpenAPI_policy_control_request_trigger_t));
if (!policy_control_request_trigger_local_var) {
return NULL;
}
return policy_control_request_trigger_local_var;
const char *policy_control_request_triggerArray[] = { "NULL", "PLMN_CH", "RES_MO_RE", "AC_TY_CH", "UE_IP_CH", "UE_MAC_CH", "AN_CH_COR", "US_RE", "APP_STA", "APP_STO", "AN_INFO", "CM_SES_FAIL", "PS_DA_OFF", "DEF_QOS_CH", "SE_AMBR_CH", "QOS_NOTIF", "NO_CREDIT", "REALLO_OF_CREDIT", "PRA_CH", "SAREA_CH", "SCNN_CH", "RE_TIMEOUT", "RES_RELEASE", "SUCC_RES_ALLO", "RAT_TY_CH", "REF_QOS_IND_CH", "NUM_OF_PACKET_FILTER", "UE_STATUS_RESUME", "UE_TZ_CH", "AUTH_PROF_CH", "QOS_MONITORING", "SCELL_CH", "EPS_FALLBACK", "MA_PDU", "TSN_ETHER_PORT", "TSN_CONTAINER", "_5G_RG_JOIN", "_5G_RG_LEAVE" };
size_t sizeofArray = sizeof(policy_control_request_triggerArray) / sizeof(policy_control_request_triggerArray[0]);
if (policy_control_request_trigger < sizeofArray)
return (char *)policy_control_request_triggerArray[policy_control_request_trigger];
else
return (char *)"Unknown";
}
void OpenAPI_policy_control_request_trigger_free(OpenAPI_policy_control_request_trigger_t *policy_control_request_trigger)
OpenAPI_policy_control_request_trigger_e OpenAPI_policy_control_request_trigger_FromString(char* policy_control_request_trigger)
{
if (NULL == policy_control_request_trigger) {
return;
int stringToReturn = 0;
const char *policy_control_request_triggerArray[] = { "NULL", "PLMN_CH", "RES_MO_RE", "AC_TY_CH", "UE_IP_CH", "UE_MAC_CH", "AN_CH_COR", "US_RE", "APP_STA", "APP_STO", "AN_INFO", "CM_SES_FAIL", "PS_DA_OFF", "DEF_QOS_CH", "SE_AMBR_CH", "QOS_NOTIF", "NO_CREDIT", "REALLO_OF_CREDIT", "PRA_CH", "SAREA_CH", "SCNN_CH", "RE_TIMEOUT", "RES_RELEASE", "SUCC_RES_ALLO", "RAT_TY_CH", "REF_QOS_IND_CH", "NUM_OF_PACKET_FILTER", "UE_STATUS_RESUME", "UE_TZ_CH", "AUTH_PROF_CH", "QOS_MONITORING", "SCELL_CH", "EPS_FALLBACK", "MA_PDU", "TSN_ETHER_PORT", "TSN_CONTAINER", "_5G_RG_JOIN", "_5G_RG_LEAVE" };
size_t sizeofArray = sizeof(policy_control_request_triggerArray) / sizeof(policy_control_request_triggerArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(policy_control_request_trigger, policy_control_request_triggerArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(policy_control_request_trigger);
}
cJSON *OpenAPI_policy_control_request_trigger_convertToJSON(OpenAPI_policy_control_request_trigger_t *policy_control_request_trigger)
{
cJSON *item = NULL;
if (policy_control_request_trigger == NULL) {
ogs_error("OpenAPI_policy_control_request_trigger_convertToJSON() failed [PolicyControlRequestTrigger]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_policy_control_request_trigger_t *OpenAPI_policy_control_request_trigger_parseFromJSON(cJSON *policy_control_request_triggerJSON)
{
OpenAPI_policy_control_request_trigger_t *policy_control_request_trigger_local_var = NULL;
policy_control_request_trigger_local_var = OpenAPI_policy_control_request_trigger_create (
);
return policy_control_request_trigger_local_var;
end:
return NULL;
}
OpenAPI_policy_control_request_trigger_t *OpenAPI_policy_control_request_trigger_copy(OpenAPI_policy_control_request_trigger_t *dst, OpenAPI_policy_control_request_trigger_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_policy_control_request_trigger_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_policy_control_request_trigger_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_policy_control_request_trigger_free(dst);
dst = OpenAPI_policy_control_request_trigger_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* policy_control_request_trigger.h
*
* Possible values are - PLMN_CH: PLMN Change - RES_MO_RE: A request for resource modification has been received by the SMF. The SMF always reports to the PCF. - AC_TY_CH: Access Type Change - UE_IP_CH: UE IP address change. The SMF always reports to the PCF. - UE_MAC_CH: A new UE MAC address is detected or a used UE MAC address is inactive for a specific period - AN_CH_COR: Access Network Charging Correlation Information - US_RE: The PDU Session or the Monitoring key specific resources consumed by a UE either reached the threshold or needs to be reported for other reasons. - APP_STA: The start of application traffic has been detected. - APP_STO: The stop of application traffic has been detected. - AN_INFO: Access Network Information report - CM_SES_FAIL: Credit management session failure - PS_DA_OFF: The SMF reports when the 3GPP PS Data Off status changes. The SMF always reports to the PCF. - DEF_QOS_CH: Default QoS Change. The SMF always reports to the PCF. - SE_AMBR_CH: Session AMBR Change. The SMF always reports to the PCF. - QOS_NOTIF: The SMF notify the PCF when receiving notification from RAN that QoS targets of the QoS Flow cannot be guranteed or gurateed again. - NO_CREDIT: Out of credit - REALLO_OF_CREDIT: Reallocation of credit - PRA_CH: Change of UE presence in Presence Reporting Area - SAREA_CH: Location Change with respect to the Serving Area - SCNN_CH: Location Change with respect to the Serving CN node - RE_TIMEOUT: Indicates the SMF generated the request because there has been a PCC revalidation timeout - RES_RELEASE: Indicate that the SMF can inform the PCF of the outcome of the release of resources for those rules that require so. - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. - RAT_TY_CH: RAT Type Change. - REF_QOS_IND_CH: Reflective QoS indication Change - NUM_OF_PACKET_FILTER: Indicates that the SMF shall report the number of supported packet filter for signalled QoS rules - UE_STATUS_RESUME: Indicates that the UEs status is resumed. - UE_TZ_CH: UE Time Zone Change - AUTH_PROF_CH: The DN-AAA authorization profile index has changed - QOS_MONITORING: Indicate that the SMF notifies the PCF of the QoS Monitoring information. - SCELL_CH: Location Change with respect to the Serving Cell. Only applicable to the interworking scenario as defined in Annex B. - EPS_FALLBACK: EPS Fallback report is enabled in the SMF. - MA_PDU: UE Indicates that the SMF notifies the PCF of the MA PDU session request - TSN_ETHER_PORT: Manageable Ethernet port detected - TSN_CONTAINER: Port management container detected. - 5G_RG_JOIN: The 5G-RG has joined to an IP Multicast Group. - 5G_RG_LEAVE: The 5G-RG has left an IP Multicast Group.
*
*/
#ifndef _OpenAPI_policy_control_request_trigger_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_policy_control_request_trigger_s OpenAPI_policy_control_request_trigger_t;
typedef struct OpenAPI_policy_control_request_trigger_s {
} OpenAPI_policy_control_request_trigger_t;
typedef enum { OpenAPI_policy_control_request_trigger_NULL = 0, OpenAPI_policy_control_request_trigger_PLMN_CH, OpenAPI_policy_control_request_trigger_RES_MO_RE, OpenAPI_policy_control_request_trigger_AC_TY_CH, OpenAPI_policy_control_request_trigger_UE_IP_CH, OpenAPI_policy_control_request_trigger_UE_MAC_CH, OpenAPI_policy_control_request_trigger_AN_CH_COR, OpenAPI_policy_control_request_trigger_US_RE, OpenAPI_policy_control_request_trigger_APP_STA, OpenAPI_policy_control_request_trigger_APP_STO, OpenAPI_policy_control_request_trigger_AN_INFO, OpenAPI_policy_control_request_trigger_CM_SES_FAIL, OpenAPI_policy_control_request_trigger_PS_DA_OFF, OpenAPI_policy_control_request_trigger_DEF_QOS_CH, OpenAPI_policy_control_request_trigger_SE_AMBR_CH, OpenAPI_policy_control_request_trigger_QOS_NOTIF, OpenAPI_policy_control_request_trigger_NO_CREDIT, OpenAPI_policy_control_request_trigger_REALLO_OF_CREDIT, OpenAPI_policy_control_request_trigger_PRA_CH, OpenAPI_policy_control_request_trigger_SAREA_CH, OpenAPI_policy_control_request_trigger_SCNN_CH, OpenAPI_policy_control_request_trigger_RE_TIMEOUT, OpenAPI_policy_control_request_trigger_RES_RELEASE, OpenAPI_policy_control_request_trigger_SUCC_RES_ALLO, OpenAPI_policy_control_request_trigger_RAT_TY_CH, OpenAPI_policy_control_request_trigger_REF_QOS_IND_CH, OpenAPI_policy_control_request_trigger_NUM_OF_PACKET_FILTER, OpenAPI_policy_control_request_trigger_UE_STATUS_RESUME, OpenAPI_policy_control_request_trigger_UE_TZ_CH, OpenAPI_policy_control_request_trigger_AUTH_PROF_CH, OpenAPI_policy_control_request_trigger_QOS_MONITORING, OpenAPI_policy_control_request_trigger_SCELL_CH, OpenAPI_policy_control_request_trigger_EPS_FALLBACK, OpenAPI_policy_control_request_trigger_MA_PDU, OpenAPI_policy_control_request_trigger_TSN_ETHER_PORT, OpenAPI_policy_control_request_trigger_TSN_CONTAINER, OpenAPI_policy_control_request_trigger__5G_RG_JOIN, OpenAPI_policy_control_request_trigger__5G_RG_LEAVE } OpenAPI_policy_control_request_trigger_e;
OpenAPI_policy_control_request_trigger_t *OpenAPI_policy_control_request_trigger_create(
);
void OpenAPI_policy_control_request_trigger_free(OpenAPI_policy_control_request_trigger_t *policy_control_request_trigger);
OpenAPI_policy_control_request_trigger_t *OpenAPI_policy_control_request_trigger_parseFromJSON(cJSON *policy_control_request_triggerJSON);
cJSON *OpenAPI_policy_control_request_trigger_convertToJSON(OpenAPI_policy_control_request_trigger_t *policy_control_request_trigger);
OpenAPI_policy_control_request_trigger_t *OpenAPI_policy_control_request_trigger_copy(OpenAPI_policy_control_request_trigger_t *dst, OpenAPI_policy_control_request_trigger_t *src);
char* OpenAPI_policy_control_request_trigger_ToString(OpenAPI_policy_control_request_trigger_e policy_control_request_trigger);
OpenAPI_policy_control_request_trigger_e OpenAPI_policy_control_request_trigger_FromString(char* policy_control_request_trigger);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "qos_flow_usage.h"
OpenAPI_qos_flow_usage_t *OpenAPI_qos_flow_usage_create(
)
char* OpenAPI_qos_flow_usage_ToString(OpenAPI_qos_flow_usage_e qos_flow_usage)
{
OpenAPI_qos_flow_usage_t *qos_flow_usage_local_var = OpenAPI_malloc(sizeof(OpenAPI_qos_flow_usage_t));
if (!qos_flow_usage_local_var) {
return NULL;
}
return qos_flow_usage_local_var;
const char *qos_flow_usageArray[] = { "NULL", "GENERAL", "IMS_SIG" };
size_t sizeofArray = sizeof(qos_flow_usageArray) / sizeof(qos_flow_usageArray[0]);
if (qos_flow_usage < sizeofArray)
return (char *)qos_flow_usageArray[qos_flow_usage];
else
return (char *)"Unknown";
}
void OpenAPI_qos_flow_usage_free(OpenAPI_qos_flow_usage_t *qos_flow_usage)
OpenAPI_qos_flow_usage_e OpenAPI_qos_flow_usage_FromString(char* qos_flow_usage)
{
if (NULL == qos_flow_usage) {
return;
int stringToReturn = 0;
const char *qos_flow_usageArray[] = { "NULL", "GENERAL", "IMS_SIG" };
size_t sizeofArray = sizeof(qos_flow_usageArray) / sizeof(qos_flow_usageArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(qos_flow_usage, qos_flow_usageArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(qos_flow_usage);
}
cJSON *OpenAPI_qos_flow_usage_convertToJSON(OpenAPI_qos_flow_usage_t *qos_flow_usage)
{
cJSON *item = NULL;
if (qos_flow_usage == NULL) {
ogs_error("OpenAPI_qos_flow_usage_convertToJSON() failed [QosFlowUsage]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_qos_flow_usage_t *OpenAPI_qos_flow_usage_parseFromJSON(cJSON *qos_flow_usageJSON)
{
OpenAPI_qos_flow_usage_t *qos_flow_usage_local_var = NULL;
qos_flow_usage_local_var = OpenAPI_qos_flow_usage_create (
);
return qos_flow_usage_local_var;
end:
return NULL;
}
OpenAPI_qos_flow_usage_t *OpenAPI_qos_flow_usage_copy(OpenAPI_qos_flow_usage_t *dst, OpenAPI_qos_flow_usage_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_qos_flow_usage_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_qos_flow_usage_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_qos_flow_usage_free(dst);
dst = OpenAPI_qos_flow_usage_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* qos_flow_usage.h
*
* Possible values are - GENERAL: Indicate no specific QoS flow usage information is available. - IMS_SIG: Indicate that the QoS flow is used for IMS signalling only.
*
*/
#ifndef _OpenAPI_qos_flow_usage_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_qos_flow_usage_s OpenAPI_qos_flow_usage_t;
typedef struct OpenAPI_qos_flow_usage_s {
} OpenAPI_qos_flow_usage_t;
typedef enum { OpenAPI_qos_flow_usage_NULL = 0, OpenAPI_qos_flow_usage_GENERAL, OpenAPI_qos_flow_usage_IMS_SIG } OpenAPI_qos_flow_usage_e;
OpenAPI_qos_flow_usage_t *OpenAPI_qos_flow_usage_create(
);
void OpenAPI_qos_flow_usage_free(OpenAPI_qos_flow_usage_t *qos_flow_usage);
OpenAPI_qos_flow_usage_t *OpenAPI_qos_flow_usage_parseFromJSON(cJSON *qos_flow_usageJSON);
cJSON *OpenAPI_qos_flow_usage_convertToJSON(OpenAPI_qos_flow_usage_t *qos_flow_usage);
OpenAPI_qos_flow_usage_t *OpenAPI_qos_flow_usage_copy(OpenAPI_qos_flow_usage_t *dst, OpenAPI_qos_flow_usage_t *src);
char* OpenAPI_qos_flow_usage_ToString(OpenAPI_qos_flow_usage_e qos_flow_usage);
OpenAPI_qos_flow_usage_e OpenAPI_qos_flow_usage_FromString(char* qos_flow_usage);
#ifdef __cplusplus
}

View file

@ -42,13 +42,7 @@ void OpenAPI_qos_monitoring_data_free(OpenAPI_qos_monitoring_data_t *qos_monitor
}
OpenAPI_lnode_t *node;
ogs_free(qos_monitoring_data->qm_id);
OpenAPI_list_for_each(qos_monitoring_data->req_qos_mon_params, node) {
OpenAPI_requested_qos_monitoring_parameter_free(node->data);
}
OpenAPI_list_free(qos_monitoring_data->req_qos_mon_params);
OpenAPI_list_for_each(qos_monitoring_data->rep_freqs, node) {
OpenAPI_reporting_frequency_free(node->data);
}
OpenAPI_list_free(qos_monitoring_data->rep_freqs);
ogs_free(qos_monitoring_data->notify_uri);
ogs_free(qos_monitoring_data->notify_corre_id);
@ -75,41 +69,31 @@ cJSON *OpenAPI_qos_monitoring_data_convertToJSON(OpenAPI_qos_monitoring_data_t *
}
if (qos_monitoring_data->req_qos_mon_params) {
cJSON *req_qos_mon_paramsList = cJSON_AddArrayToObject(item, "reqQosMonParams");
if (req_qos_mon_paramsList == NULL) {
cJSON *req_qos_mon_params = cJSON_AddArrayToObject(item, "reqQosMonParams");
if (req_qos_mon_params == NULL) {
ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [req_qos_mon_params]");
goto end;
}
OpenAPI_lnode_t *req_qos_mon_params_node;
if (qos_monitoring_data->req_qos_mon_params) {
OpenAPI_list_for_each(qos_monitoring_data->req_qos_mon_params, req_qos_mon_params_node) {
cJSON *itemLocal = OpenAPI_requested_qos_monitoring_parameter_convertToJSON(req_qos_mon_params_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [req_qos_mon_params]");
goto end;
}
cJSON_AddItemToArray(req_qos_mon_paramsList, itemLocal);
OpenAPI_list_for_each(qos_monitoring_data->req_qos_mon_params, req_qos_mon_params_node) {
if (cJSON_AddStringToObject(req_qos_mon_params, "", OpenAPI_requested_qos_monitoring_parameter_ToString((OpenAPI_requested_qos_monitoring_parameter_e)req_qos_mon_params_node->data)) == NULL) {
ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [req_qos_mon_params]");
goto end;
}
}
}
if (qos_monitoring_data->rep_freqs) {
cJSON *rep_freqsList = cJSON_AddArrayToObject(item, "repFreqs");
if (rep_freqsList == NULL) {
cJSON *rep_freqs = cJSON_AddArrayToObject(item, "repFreqs");
if (rep_freqs == NULL) {
ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [rep_freqs]");
goto end;
}
OpenAPI_lnode_t *rep_freqs_node;
if (qos_monitoring_data->rep_freqs) {
OpenAPI_list_for_each(qos_monitoring_data->rep_freqs, rep_freqs_node) {
cJSON *itemLocal = OpenAPI_reporting_frequency_convertToJSON(rep_freqs_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [rep_freqs]");
goto end;
}
cJSON_AddItemToArray(rep_freqsList, itemLocal);
OpenAPI_list_for_each(qos_monitoring_data->rep_freqs, rep_freqs_node) {
if (cJSON_AddStringToObject(rep_freqs, "", OpenAPI_reporting_frequency_ToString((OpenAPI_reporting_frequency_e)rep_freqs_node->data)) == NULL) {
ogs_error("OpenAPI_qos_monitoring_data_convertToJSON() failed [rep_freqs]");
goto end;
}
}
}
@ -195,13 +179,12 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON *
req_qos_mon_paramsList = OpenAPI_list_create();
cJSON_ArrayForEach(req_qos_mon_params_local_nonprimitive, req_qos_mon_params ) {
if (!cJSON_IsObject(req_qos_mon_params_local_nonprimitive)) {
if (!cJSON_IsString(req_qos_mon_params_local_nonprimitive)) {
ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [req_qos_mon_params]");
goto end;
}
OpenAPI_requested_qos_monitoring_parameter_t *req_qos_mon_paramsItem = OpenAPI_requested_qos_monitoring_parameter_parseFromJSON(req_qos_mon_params_local_nonprimitive);
OpenAPI_list_add(req_qos_mon_paramsList, req_qos_mon_paramsItem);
OpenAPI_list_add(req_qos_mon_paramsList, (void *)OpenAPI_requested_qos_monitoring_parameter_FromString(req_qos_mon_params_local_nonprimitive->valuestring));
}
}
@ -218,13 +201,12 @@ OpenAPI_qos_monitoring_data_t *OpenAPI_qos_monitoring_data_parseFromJSON(cJSON *
rep_freqsList = OpenAPI_list_create();
cJSON_ArrayForEach(rep_freqs_local_nonprimitive, rep_freqs ) {
if (!cJSON_IsObject(rep_freqs_local_nonprimitive)) {
if (!cJSON_IsString(rep_freqs_local_nonprimitive)) {
ogs_error("OpenAPI_qos_monitoring_data_parseFromJSON() failed [rep_freqs]");
goto end;
}
OpenAPI_reporting_frequency_t *rep_freqsItem = OpenAPI_reporting_frequency_parseFromJSON(rep_freqs_local_nonprimitive);
OpenAPI_list_add(rep_freqsList, rep_freqsItem);
OpenAPI_list_add(rep_freqsList, (void *)OpenAPI_reporting_frequency_FromString(rep_freqs_local_nonprimitive->valuestring));
}
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "redirect_address_type.h"
OpenAPI_redirect_address_type_t *OpenAPI_redirect_address_type_create(
)
char* OpenAPI_redirect_address_type_ToString(OpenAPI_redirect_address_type_e redirect_address_type)
{
OpenAPI_redirect_address_type_t *redirect_address_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_redirect_address_type_t));
if (!redirect_address_type_local_var) {
return NULL;
}
return redirect_address_type_local_var;
const char *redirect_address_typeArray[] = { "NULL", "IPV4_ADDR", "IPV6_ADDR", "URL", "SIP_URI" };
size_t sizeofArray = sizeof(redirect_address_typeArray) / sizeof(redirect_address_typeArray[0]);
if (redirect_address_type < sizeofArray)
return (char *)redirect_address_typeArray[redirect_address_type];
else
return (char *)"Unknown";
}
void OpenAPI_redirect_address_type_free(OpenAPI_redirect_address_type_t *redirect_address_type)
OpenAPI_redirect_address_type_e OpenAPI_redirect_address_type_FromString(char* redirect_address_type)
{
if (NULL == redirect_address_type) {
return;
int stringToReturn = 0;
const char *redirect_address_typeArray[] = { "NULL", "IPV4_ADDR", "IPV6_ADDR", "URL", "SIP_URI" };
size_t sizeofArray = sizeof(redirect_address_typeArray) / sizeof(redirect_address_typeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(redirect_address_type, redirect_address_typeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(redirect_address_type);
}
cJSON *OpenAPI_redirect_address_type_convertToJSON(OpenAPI_redirect_address_type_t *redirect_address_type)
{
cJSON *item = NULL;
if (redirect_address_type == NULL) {
ogs_error("OpenAPI_redirect_address_type_convertToJSON() failed [RedirectAddressType]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_redirect_address_type_t *OpenAPI_redirect_address_type_parseFromJSON(cJSON *redirect_address_typeJSON)
{
OpenAPI_redirect_address_type_t *redirect_address_type_local_var = NULL;
redirect_address_type_local_var = OpenAPI_redirect_address_type_create (
);
return redirect_address_type_local_var;
end:
return NULL;
}
OpenAPI_redirect_address_type_t *OpenAPI_redirect_address_type_copy(OpenAPI_redirect_address_type_t *dst, OpenAPI_redirect_address_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_redirect_address_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_redirect_address_type_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_redirect_address_type_free(dst);
dst = OpenAPI_redirect_address_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* redirect_address_type.h
*
* Possible values are - IPV4_ADDR: Indicates that the address type is in the form of \&quot;dotted-decimal\&quot; IPv4 address. - IPV6_ADDR: Indicates that the address type is in the form of IPv6 address. - URL: Indicates that the address type is in the form of Uniform Resource Locator. - SIP_URI: Indicates that the address type is in the form of SIP Uniform Resource Identifier.
*
*/
#ifndef _OpenAPI_redirect_address_type_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_redirect_address_type_s OpenAPI_redirect_address_type_t;
typedef struct OpenAPI_redirect_address_type_s {
} OpenAPI_redirect_address_type_t;
typedef enum { OpenAPI_redirect_address_type_NULL = 0, OpenAPI_redirect_address_type_IPV4_ADDR, OpenAPI_redirect_address_type_IPV6_ADDR, OpenAPI_redirect_address_type_URL, OpenAPI_redirect_address_type_SIP_URI } OpenAPI_redirect_address_type_e;
OpenAPI_redirect_address_type_t *OpenAPI_redirect_address_type_create(
);
void OpenAPI_redirect_address_type_free(OpenAPI_redirect_address_type_t *redirect_address_type);
OpenAPI_redirect_address_type_t *OpenAPI_redirect_address_type_parseFromJSON(cJSON *redirect_address_typeJSON);
cJSON *OpenAPI_redirect_address_type_convertToJSON(OpenAPI_redirect_address_type_t *redirect_address_type);
OpenAPI_redirect_address_type_t *OpenAPI_redirect_address_type_copy(OpenAPI_redirect_address_type_t *dst, OpenAPI_redirect_address_type_t *src);
char* OpenAPI_redirect_address_type_ToString(OpenAPI_redirect_address_type_e redirect_address_type);
OpenAPI_redirect_address_type_e OpenAPI_redirect_address_type_FromString(char* redirect_address_type);
#ifdef __cplusplus
}

View file

@ -6,7 +6,7 @@
OpenAPI_redirect_information_t *OpenAPI_redirect_information_create(
int redirect_enabled,
OpenAPI_redirect_address_type_t *redirect_address_type,
OpenAPI_redirect_address_type_e redirect_address_type,
char *redirect_server_address
)
{
@ -27,7 +27,6 @@ void OpenAPI_redirect_information_free(OpenAPI_redirect_information_t *redirect_
return;
}
OpenAPI_lnode_t *node;
OpenAPI_redirect_address_type_free(redirect_information->redirect_address_type);
ogs_free(redirect_information->redirect_server_address);
ogs_free(redirect_information);
}
@ -50,13 +49,7 @@ cJSON *OpenAPI_redirect_information_convertToJSON(OpenAPI_redirect_information_t
}
if (redirect_information->redirect_address_type) {
cJSON *redirect_address_type_local_JSON = OpenAPI_redirect_address_type_convertToJSON(redirect_information->redirect_address_type);
if (redirect_address_type_local_JSON == NULL) {
ogs_error("OpenAPI_redirect_information_convertToJSON() failed [redirect_address_type]");
goto end;
}
cJSON_AddItemToObject(item, "redirectAddressType", redirect_address_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "redirectAddressType", OpenAPI_redirect_address_type_ToString(redirect_information->redirect_address_type)) == NULL) {
ogs_error("OpenAPI_redirect_information_convertToJSON() failed [redirect_address_type]");
goto end;
}
@ -87,9 +80,13 @@ OpenAPI_redirect_information_t *OpenAPI_redirect_information_parseFromJSON(cJSON
cJSON *redirect_address_type = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectAddressType");
OpenAPI_redirect_address_type_t *redirect_address_type_local_nonprim = NULL;
OpenAPI_redirect_address_type_e redirect_address_typeVariable;
if (redirect_address_type) {
redirect_address_type_local_nonprim = OpenAPI_redirect_address_type_parseFromJSON(redirect_address_type);
if (!cJSON_IsString(redirect_address_type)) {
ogs_error("OpenAPI_redirect_information_parseFromJSON() failed [redirect_address_type]");
goto end;
}
redirect_address_typeVariable = OpenAPI_redirect_address_type_FromString(redirect_address_type->valuestring);
}
cJSON *redirect_server_address = cJSON_GetObjectItemCaseSensitive(redirect_informationJSON, "redirectServerAddress");
@ -103,7 +100,7 @@ OpenAPI_redirect_information_t *OpenAPI_redirect_information_parseFromJSON(cJSON
redirect_information_local_var = OpenAPI_redirect_information_create (
redirect_enabled ? redirect_enabled->valueint : 0,
redirect_address_type ? redirect_address_type_local_nonprim : NULL,
redirect_address_type ? redirect_address_typeVariable : 0,
redirect_server_address ? ogs_strdup(redirect_server_address->valuestring) : NULL
);

View file

@ -21,13 +21,13 @@ extern "C" {
typedef struct OpenAPI_redirect_information_s OpenAPI_redirect_information_t;
typedef struct OpenAPI_redirect_information_s {
int redirect_enabled;
struct OpenAPI_redirect_address_type_s *redirect_address_type;
OpenAPI_redirect_address_type_e redirect_address_type;
char *redirect_server_address;
} OpenAPI_redirect_information_t;
OpenAPI_redirect_information_t *OpenAPI_redirect_information_create(
int redirect_enabled,
OpenAPI_redirect_address_type_t *redirect_address_type,
OpenAPI_redirect_address_type_e redirect_address_type,
char *redirect_server_address
);
void OpenAPI_redirect_information_free(OpenAPI_redirect_information_t *redirect_information);

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "reporting_frequency.h"
OpenAPI_reporting_frequency_t *OpenAPI_reporting_frequency_create(
)
char* OpenAPI_reporting_frequency_ToString(OpenAPI_reporting_frequency_e reporting_frequency)
{
OpenAPI_reporting_frequency_t *reporting_frequency_local_var = OpenAPI_malloc(sizeof(OpenAPI_reporting_frequency_t));
if (!reporting_frequency_local_var) {
return NULL;
}
return reporting_frequency_local_var;
const char *reporting_frequencyArray[] = { "NULL", "EVENT_TRIGGERED", "PERIODIC", "SESSION_RELEASE" };
size_t sizeofArray = sizeof(reporting_frequencyArray) / sizeof(reporting_frequencyArray[0]);
if (reporting_frequency < sizeofArray)
return (char *)reporting_frequencyArray[reporting_frequency];
else
return (char *)"Unknown";
}
void OpenAPI_reporting_frequency_free(OpenAPI_reporting_frequency_t *reporting_frequency)
OpenAPI_reporting_frequency_e OpenAPI_reporting_frequency_FromString(char* reporting_frequency)
{
if (NULL == reporting_frequency) {
return;
int stringToReturn = 0;
const char *reporting_frequencyArray[] = { "NULL", "EVENT_TRIGGERED", "PERIODIC", "SESSION_RELEASE" };
size_t sizeofArray = sizeof(reporting_frequencyArray) / sizeof(reporting_frequencyArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(reporting_frequency, reporting_frequencyArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(reporting_frequency);
}
cJSON *OpenAPI_reporting_frequency_convertToJSON(OpenAPI_reporting_frequency_t *reporting_frequency)
{
cJSON *item = NULL;
if (reporting_frequency == NULL) {
ogs_error("OpenAPI_reporting_frequency_convertToJSON() failed [ReportingFrequency]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_reporting_frequency_t *OpenAPI_reporting_frequency_parseFromJSON(cJSON *reporting_frequencyJSON)
{
OpenAPI_reporting_frequency_t *reporting_frequency_local_var = NULL;
reporting_frequency_local_var = OpenAPI_reporting_frequency_create (
);
return reporting_frequency_local_var;
end:
return NULL;
}
OpenAPI_reporting_frequency_t *OpenAPI_reporting_frequency_copy(OpenAPI_reporting_frequency_t *dst, OpenAPI_reporting_frequency_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_reporting_frequency_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_reporting_frequency_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_reporting_frequency_free(dst);
dst = OpenAPI_reporting_frequency_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_reporting_frequency_s OpenAPI_reporting_frequency_t;
typedef struct OpenAPI_reporting_frequency_s {
} OpenAPI_reporting_frequency_t;
typedef enum { OpenAPI_reporting_frequency_NULL = 0, OpenAPI_reporting_frequency_EVENT_TRIGGERED, OpenAPI_reporting_frequency_PERIODIC, OpenAPI_reporting_frequency_SESSION_RELEASE } OpenAPI_reporting_frequency_e;
OpenAPI_reporting_frequency_t *OpenAPI_reporting_frequency_create(
);
void OpenAPI_reporting_frequency_free(OpenAPI_reporting_frequency_t *reporting_frequency);
OpenAPI_reporting_frequency_t *OpenAPI_reporting_frequency_parseFromJSON(cJSON *reporting_frequencyJSON);
cJSON *OpenAPI_reporting_frequency_convertToJSON(OpenAPI_reporting_frequency_t *reporting_frequency);
OpenAPI_reporting_frequency_t *OpenAPI_reporting_frequency_copy(OpenAPI_reporting_frequency_t *dst, OpenAPI_reporting_frequency_t *src);
char* OpenAPI_reporting_frequency_ToString(OpenAPI_reporting_frequency_e reporting_frequency);
OpenAPI_reporting_frequency_e OpenAPI_reporting_frequency_FromString(char* reporting_frequency);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "reporting_level.h"
OpenAPI_reporting_level_t *OpenAPI_reporting_level_create(
)
char* OpenAPI_reporting_level_ToString(OpenAPI_reporting_level_e reporting_level)
{
OpenAPI_reporting_level_t *reporting_level_local_var = OpenAPI_malloc(sizeof(OpenAPI_reporting_level_t));
if (!reporting_level_local_var) {
return NULL;
}
return reporting_level_local_var;
const char *reporting_levelArray[] = { "NULL", "SER_ID_LEVEL", "RAT_GR_LEVEL", "SPON_CON_LEVEL" };
size_t sizeofArray = sizeof(reporting_levelArray) / sizeof(reporting_levelArray[0]);
if (reporting_level < sizeofArray)
return (char *)reporting_levelArray[reporting_level];
else
return (char *)"Unknown";
}
void OpenAPI_reporting_level_free(OpenAPI_reporting_level_t *reporting_level)
OpenAPI_reporting_level_e OpenAPI_reporting_level_FromString(char* reporting_level)
{
if (NULL == reporting_level) {
return;
int stringToReturn = 0;
const char *reporting_levelArray[] = { "NULL", "SER_ID_LEVEL", "RAT_GR_LEVEL", "SPON_CON_LEVEL" };
size_t sizeofArray = sizeof(reporting_levelArray) / sizeof(reporting_levelArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(reporting_level, reporting_levelArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(reporting_level);
}
cJSON *OpenAPI_reporting_level_convertToJSON(OpenAPI_reporting_level_t *reporting_level)
{
cJSON *item = NULL;
if (reporting_level == NULL) {
ogs_error("OpenAPI_reporting_level_convertToJSON() failed [ReportingLevel]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_reporting_level_t *OpenAPI_reporting_level_parseFromJSON(cJSON *reporting_levelJSON)
{
OpenAPI_reporting_level_t *reporting_level_local_var = NULL;
reporting_level_local_var = OpenAPI_reporting_level_create (
);
return reporting_level_local_var;
end:
return NULL;
}
OpenAPI_reporting_level_t *OpenAPI_reporting_level_copy(OpenAPI_reporting_level_t *dst, OpenAPI_reporting_level_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_reporting_level_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_reporting_level_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_reporting_level_free(dst);
dst = OpenAPI_reporting_level_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* reporting_level.h
*
* Possible values are - SER_ID_LEVEL: Indicates that the usage shall be reported on service id and rating group combination level. - RAT_GR_LEVEL: Indicates that the usage shall be reported on rating group level. - SPON_CON_LEVEL: Indicates that the usage shall be reported on sponsor identity and rating group combination level.
*
*/
#ifndef _OpenAPI_reporting_level_H_
@ -12,22 +12,16 @@
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "null_value.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_reporting_level_s OpenAPI_reporting_level_t;
typedef struct OpenAPI_reporting_level_s {
} OpenAPI_reporting_level_t;
typedef enum { OpenAPI_reporting_level_NULL = 0, OpenAPI_reporting_level_SER_ID_LEVEL, OpenAPI_reporting_level_RAT_GR_LEVEL, OpenAPI_reporting_level_SPON_CON_LEVEL } OpenAPI_reporting_level_e;
OpenAPI_reporting_level_t *OpenAPI_reporting_level_create(
);
void OpenAPI_reporting_level_free(OpenAPI_reporting_level_t *reporting_level);
OpenAPI_reporting_level_t *OpenAPI_reporting_level_parseFromJSON(cJSON *reporting_levelJSON);
cJSON *OpenAPI_reporting_level_convertToJSON(OpenAPI_reporting_level_t *reporting_level);
OpenAPI_reporting_level_t *OpenAPI_reporting_level_copy(OpenAPI_reporting_level_t *dst, OpenAPI_reporting_level_t *src);
char* OpenAPI_reporting_level_ToString(OpenAPI_reporting_level_e reporting_level);
OpenAPI_reporting_level_e OpenAPI_reporting_level_FromString(char* reporting_level);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "requested_qos_monitoring_parameter.h"
OpenAPI_requested_qos_monitoring_parameter_t *OpenAPI_requested_qos_monitoring_parameter_create(
)
char* OpenAPI_requested_qos_monitoring_parameter_ToString(OpenAPI_requested_qos_monitoring_parameter_e requested_qos_monitoring_parameter)
{
OpenAPI_requested_qos_monitoring_parameter_t *requested_qos_monitoring_parameter_local_var = OpenAPI_malloc(sizeof(OpenAPI_requested_qos_monitoring_parameter_t));
if (!requested_qos_monitoring_parameter_local_var) {
return NULL;
}
return requested_qos_monitoring_parameter_local_var;
const char *requested_qos_monitoring_parameterArray[] = { "NULL", "DOWNLINK", "UPLINK", "ROUND_TRIP" };
size_t sizeofArray = sizeof(requested_qos_monitoring_parameterArray) / sizeof(requested_qos_monitoring_parameterArray[0]);
if (requested_qos_monitoring_parameter < sizeofArray)
return (char *)requested_qos_monitoring_parameterArray[requested_qos_monitoring_parameter];
else
return (char *)"Unknown";
}
void OpenAPI_requested_qos_monitoring_parameter_free(OpenAPI_requested_qos_monitoring_parameter_t *requested_qos_monitoring_parameter)
OpenAPI_requested_qos_monitoring_parameter_e OpenAPI_requested_qos_monitoring_parameter_FromString(char* requested_qos_monitoring_parameter)
{
if (NULL == requested_qos_monitoring_parameter) {
return;
int stringToReturn = 0;
const char *requested_qos_monitoring_parameterArray[] = { "NULL", "DOWNLINK", "UPLINK", "ROUND_TRIP" };
size_t sizeofArray = sizeof(requested_qos_monitoring_parameterArray) / sizeof(requested_qos_monitoring_parameterArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(requested_qos_monitoring_parameter, requested_qos_monitoring_parameterArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(requested_qos_monitoring_parameter);
}
cJSON *OpenAPI_requested_qos_monitoring_parameter_convertToJSON(OpenAPI_requested_qos_monitoring_parameter_t *requested_qos_monitoring_parameter)
{
cJSON *item = NULL;
if (requested_qos_monitoring_parameter == NULL) {
ogs_error("OpenAPI_requested_qos_monitoring_parameter_convertToJSON() failed [RequestedQosMonitoringParameter]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_requested_qos_monitoring_parameter_t *OpenAPI_requested_qos_monitoring_parameter_parseFromJSON(cJSON *requested_qos_monitoring_parameterJSON)
{
OpenAPI_requested_qos_monitoring_parameter_t *requested_qos_monitoring_parameter_local_var = NULL;
requested_qos_monitoring_parameter_local_var = OpenAPI_requested_qos_monitoring_parameter_create (
);
return requested_qos_monitoring_parameter_local_var;
end:
return NULL;
}
OpenAPI_requested_qos_monitoring_parameter_t *OpenAPI_requested_qos_monitoring_parameter_copy(OpenAPI_requested_qos_monitoring_parameter_t *dst, OpenAPI_requested_qos_monitoring_parameter_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_requested_qos_monitoring_parameter_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_requested_qos_monitoring_parameter_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_requested_qos_monitoring_parameter_free(dst);
dst = OpenAPI_requested_qos_monitoring_parameter_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_requested_qos_monitoring_parameter_s OpenAPI_requested_qos_monitoring_parameter_t;
typedef struct OpenAPI_requested_qos_monitoring_parameter_s {
} OpenAPI_requested_qos_monitoring_parameter_t;
typedef enum { OpenAPI_requested_qos_monitoring_parameter_NULL = 0, OpenAPI_requested_qos_monitoring_parameter_DOWNLINK, OpenAPI_requested_qos_monitoring_parameter_UPLINK, OpenAPI_requested_qos_monitoring_parameter_ROUND_TRIP } OpenAPI_requested_qos_monitoring_parameter_e;
OpenAPI_requested_qos_monitoring_parameter_t *OpenAPI_requested_qos_monitoring_parameter_create(
);
void OpenAPI_requested_qos_monitoring_parameter_free(OpenAPI_requested_qos_monitoring_parameter_t *requested_qos_monitoring_parameter);
OpenAPI_requested_qos_monitoring_parameter_t *OpenAPI_requested_qos_monitoring_parameter_parseFromJSON(cJSON *requested_qos_monitoring_parameterJSON);
cJSON *OpenAPI_requested_qos_monitoring_parameter_convertToJSON(OpenAPI_requested_qos_monitoring_parameter_t *requested_qos_monitoring_parameter);
OpenAPI_requested_qos_monitoring_parameter_t *OpenAPI_requested_qos_monitoring_parameter_copy(OpenAPI_requested_qos_monitoring_parameter_t *dst, OpenAPI_requested_qos_monitoring_parameter_t *src);
char* OpenAPI_requested_qos_monitoring_parameter_ToString(OpenAPI_requested_qos_monitoring_parameter_e requested_qos_monitoring_parameter);
OpenAPI_requested_qos_monitoring_parameter_e OpenAPI_requested_qos_monitoring_parameter_FromString(char* requested_qos_monitoring_parameter);
#ifdef __cplusplus
}

View file

@ -29,9 +29,6 @@ void OpenAPI_requested_rule_data_free(OpenAPI_requested_rule_data_t *requested_r
ogs_free(node->data);
}
OpenAPI_list_free(requested_rule_data->ref_pcc_rule_ids);
OpenAPI_list_for_each(requested_rule_data->req_data, node) {
OpenAPI_requested_rule_data_type_free(node->data);
}
OpenAPI_list_free(requested_rule_data->req_data);
ogs_free(requested_rule_data);
}
@ -68,21 +65,16 @@ cJSON *OpenAPI_requested_rule_data_convertToJSON(OpenAPI_requested_rule_data_t *
ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [req_data]");
goto end;
}
cJSON *req_dataList = cJSON_AddArrayToObject(item, "reqData");
if (req_dataList == NULL) {
cJSON *req_data = cJSON_AddArrayToObject(item, "reqData");
if (req_data == NULL) {
ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [req_data]");
goto end;
}
OpenAPI_lnode_t *req_data_node;
if (requested_rule_data->req_data) {
OpenAPI_list_for_each(requested_rule_data->req_data, req_data_node) {
cJSON *itemLocal = OpenAPI_requested_rule_data_type_convertToJSON(req_data_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [req_data]");
goto end;
}
cJSON_AddItemToArray(req_dataList, itemLocal);
OpenAPI_list_for_each(requested_rule_data->req_data, req_data_node) {
if (cJSON_AddStringToObject(req_data, "", OpenAPI_requested_rule_data_type_ToString((OpenAPI_requested_rule_data_type_e)req_data_node->data)) == NULL) {
ogs_error("OpenAPI_requested_rule_data_convertToJSON() failed [req_data]");
goto end;
}
}
@ -133,13 +125,12 @@ OpenAPI_requested_rule_data_t *OpenAPI_requested_rule_data_parseFromJSON(cJSON *
req_dataList = OpenAPI_list_create();
cJSON_ArrayForEach(req_data_local_nonprimitive, req_data ) {
if (!cJSON_IsObject(req_data_local_nonprimitive)) {
if (!cJSON_IsString(req_data_local_nonprimitive)) {
ogs_error("OpenAPI_requested_rule_data_parseFromJSON() failed [req_data]");
goto end;
}
OpenAPI_requested_rule_data_type_t *req_dataItem = OpenAPI_requested_rule_data_type_parseFromJSON(req_data_local_nonprimitive);
OpenAPI_list_add(req_dataList, req_dataItem);
OpenAPI_list_add(req_dataList, (void *)OpenAPI_requested_rule_data_type_FromString(req_data_local_nonprimitive->valuestring));
}
requested_rule_data_local_var = OpenAPI_requested_rule_data_create (

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "requested_rule_data_type.h"
OpenAPI_requested_rule_data_type_t *OpenAPI_requested_rule_data_type_create(
)
char* OpenAPI_requested_rule_data_type_ToString(OpenAPI_requested_rule_data_type_e requested_rule_data_type)
{
OpenAPI_requested_rule_data_type_t *requested_rule_data_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_requested_rule_data_type_t));
if (!requested_rule_data_type_local_var) {
return NULL;
}
return requested_rule_data_type_local_var;
const char *requested_rule_data_typeArray[] = { "NULL", "CH_ID", "MS_TIME_ZONE", "USER_LOC_INFO", "RES_RELEASE", "SUCC_RES_ALLO", "EPS_FALLBACK" };
size_t sizeofArray = sizeof(requested_rule_data_typeArray) / sizeof(requested_rule_data_typeArray[0]);
if (requested_rule_data_type < sizeofArray)
return (char *)requested_rule_data_typeArray[requested_rule_data_type];
else
return (char *)"Unknown";
}
void OpenAPI_requested_rule_data_type_free(OpenAPI_requested_rule_data_type_t *requested_rule_data_type)
OpenAPI_requested_rule_data_type_e OpenAPI_requested_rule_data_type_FromString(char* requested_rule_data_type)
{
if (NULL == requested_rule_data_type) {
return;
int stringToReturn = 0;
const char *requested_rule_data_typeArray[] = { "NULL", "CH_ID", "MS_TIME_ZONE", "USER_LOC_INFO", "RES_RELEASE", "SUCC_RES_ALLO", "EPS_FALLBACK" };
size_t sizeofArray = sizeof(requested_rule_data_typeArray) / sizeof(requested_rule_data_typeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(requested_rule_data_type, requested_rule_data_typeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(requested_rule_data_type);
}
cJSON *OpenAPI_requested_rule_data_type_convertToJSON(OpenAPI_requested_rule_data_type_t *requested_rule_data_type)
{
cJSON *item = NULL;
if (requested_rule_data_type == NULL) {
ogs_error("OpenAPI_requested_rule_data_type_convertToJSON() failed [RequestedRuleDataType]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_requested_rule_data_type_t *OpenAPI_requested_rule_data_type_parseFromJSON(cJSON *requested_rule_data_typeJSON)
{
OpenAPI_requested_rule_data_type_t *requested_rule_data_type_local_var = NULL;
requested_rule_data_type_local_var = OpenAPI_requested_rule_data_type_create (
);
return requested_rule_data_type_local_var;
end:
return NULL;
}
OpenAPI_requested_rule_data_type_t *OpenAPI_requested_rule_data_type_copy(OpenAPI_requested_rule_data_type_t *dst, OpenAPI_requested_rule_data_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_requested_rule_data_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_requested_rule_data_type_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_requested_rule_data_type_free(dst);
dst = OpenAPI_requested_rule_data_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* requested_rule_data_type.h
*
* Possible values are - CH_ID: Indicates that the requested rule data is the charging identifier. - MS_TIME_ZONE: Indicates that the requested access network info type is the UE&#39;s timezone. - USER_LOC_INFO: Indicates that the requested access network info type is the UE&#39;s location. - RES_RELEASE: Indicates that the requested rule data is the result of the release of resource. - SUCC_RES_ALLO: Indicates that the requested rule data is the successful resource allocation. - EPS_FALLBACK: Indicates that the requested rule data is the report of QoS flow rejection due to EPS fallback.
*
*/
#ifndef _OpenAPI_requested_rule_data_type_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_requested_rule_data_type_s OpenAPI_requested_rule_data_type_t;
typedef struct OpenAPI_requested_rule_data_type_s {
} OpenAPI_requested_rule_data_type_t;
typedef enum { OpenAPI_requested_rule_data_type_NULL = 0, OpenAPI_requested_rule_data_type_CH_ID, OpenAPI_requested_rule_data_type_MS_TIME_ZONE, OpenAPI_requested_rule_data_type_USER_LOC_INFO, OpenAPI_requested_rule_data_type_RES_RELEASE, OpenAPI_requested_rule_data_type_SUCC_RES_ALLO, OpenAPI_requested_rule_data_type_EPS_FALLBACK } OpenAPI_requested_rule_data_type_e;
OpenAPI_requested_rule_data_type_t *OpenAPI_requested_rule_data_type_create(
);
void OpenAPI_requested_rule_data_type_free(OpenAPI_requested_rule_data_type_t *requested_rule_data_type);
OpenAPI_requested_rule_data_type_t *OpenAPI_requested_rule_data_type_parseFromJSON(cJSON *requested_rule_data_typeJSON);
cJSON *OpenAPI_requested_rule_data_type_convertToJSON(OpenAPI_requested_rule_data_type_t *requested_rule_data_type);
OpenAPI_requested_rule_data_type_t *OpenAPI_requested_rule_data_type_copy(OpenAPI_requested_rule_data_type_t *dst, OpenAPI_requested_rule_data_type_t *src);
char* OpenAPI_requested_rule_data_type_ToString(OpenAPI_requested_rule_data_type_e requested_rule_data_type);
OpenAPI_requested_rule_data_type_e OpenAPI_requested_rule_data_type_FromString(char* requested_rule_data_type);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "rule_operation.h"
OpenAPI_rule_operation_t *OpenAPI_rule_operation_create(
)
char* OpenAPI_rule_operation_ToString(OpenAPI_rule_operation_e rule_operation)
{
OpenAPI_rule_operation_t *rule_operation_local_var = OpenAPI_malloc(sizeof(OpenAPI_rule_operation_t));
if (!rule_operation_local_var) {
return NULL;
}
return rule_operation_local_var;
const char *rule_operationArray[] = { "NULL", "CREATE_PCC_RULE", "DELETE_PCC_RULE", "MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS", "MODIFY_PCC_RULE_AND_REPLACE_PACKET_FILTERS", "MODIFY_PCC_RULE_AND_DELETE_PACKET_FILTERS", "MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS" };
size_t sizeofArray = sizeof(rule_operationArray) / sizeof(rule_operationArray[0]);
if (rule_operation < sizeofArray)
return (char *)rule_operationArray[rule_operation];
else
return (char *)"Unknown";
}
void OpenAPI_rule_operation_free(OpenAPI_rule_operation_t *rule_operation)
OpenAPI_rule_operation_e OpenAPI_rule_operation_FromString(char* rule_operation)
{
if (NULL == rule_operation) {
return;
int stringToReturn = 0;
const char *rule_operationArray[] = { "NULL", "CREATE_PCC_RULE", "DELETE_PCC_RULE", "MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS", "MODIFY_PCC_RULE_AND_REPLACE_PACKET_FILTERS", "MODIFY_PCC_RULE_AND_DELETE_PACKET_FILTERS", "MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS" };
size_t sizeofArray = sizeof(rule_operationArray) / sizeof(rule_operationArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(rule_operation, rule_operationArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(rule_operation);
}
cJSON *OpenAPI_rule_operation_convertToJSON(OpenAPI_rule_operation_t *rule_operation)
{
cJSON *item = NULL;
if (rule_operation == NULL) {
ogs_error("OpenAPI_rule_operation_convertToJSON() failed [RuleOperation]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_rule_operation_t *OpenAPI_rule_operation_parseFromJSON(cJSON *rule_operationJSON)
{
OpenAPI_rule_operation_t *rule_operation_local_var = NULL;
rule_operation_local_var = OpenAPI_rule_operation_create (
);
return rule_operation_local_var;
end:
return NULL;
}
OpenAPI_rule_operation_t *OpenAPI_rule_operation_copy(OpenAPI_rule_operation_t *dst, OpenAPI_rule_operation_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_rule_operation_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_rule_operation_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_rule_operation_free(dst);
dst = OpenAPI_rule_operation_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* rule_operation.h
*
* Possible values are - CREATE_PCC_RULE: Indicates to create a new PCC rule to reserve the resource requested by the UE. - DELETE_PCC_RULE: Indicates to delete a PCC rule corresponding to reserve the resource requested by the UE.. - MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS: Indicates to modify the PCC rule by adding new packet filter(s). - MODIFY_ PCC_RULE_AND_REPLACE_PACKET_FILTERS: Indicates to modify the PCC rule by replacing the existing packet filter(s). - MODIFY_ PCC_RULE_AND_DELETE_PACKET_FILTERS: Indicates to modify the PCC rule by deleting the existing packet filter(s). - MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS: Indicates to modify the PCC rule by modifying the QoS of the PCC rule.
*
*/
#ifndef _OpenAPI_rule_operation_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_rule_operation_s OpenAPI_rule_operation_t;
typedef struct OpenAPI_rule_operation_s {
} OpenAPI_rule_operation_t;
typedef enum { OpenAPI_rule_operation_NULL = 0, OpenAPI_rule_operation_CREATE_PCC_RULE, OpenAPI_rule_operation_DELETE_PCC_RULE, OpenAPI_rule_operation_MODIFY_PCC_RULE_AND_ADD_PACKET_FILTERS, OpenAPI_rule_operation_MODIFY_PCC_RULE_AND_REPLACE_PACKET_FILTERS, OpenAPI_rule_operation_MODIFY_PCC_RULE_AND_DELETE_PACKET_FILTERS, OpenAPI_rule_operation_MODIFY_PCC_RULE_WITHOUT_MODIFY_PACKET_FILTERS } OpenAPI_rule_operation_e;
OpenAPI_rule_operation_t *OpenAPI_rule_operation_create(
);
void OpenAPI_rule_operation_free(OpenAPI_rule_operation_t *rule_operation);
OpenAPI_rule_operation_t *OpenAPI_rule_operation_parseFromJSON(cJSON *rule_operationJSON);
cJSON *OpenAPI_rule_operation_convertToJSON(OpenAPI_rule_operation_t *rule_operation);
OpenAPI_rule_operation_t *OpenAPI_rule_operation_copy(OpenAPI_rule_operation_t *dst, OpenAPI_rule_operation_t *src);
char* OpenAPI_rule_operation_ToString(OpenAPI_rule_operation_e rule_operation);
OpenAPI_rule_operation_e OpenAPI_rule_operation_FromString(char* rule_operation);
#ifdef __cplusplus
}

View file

@ -6,9 +6,9 @@
OpenAPI_rule_report_t *OpenAPI_rule_report_create(
OpenAPI_list_t *pcc_rule_ids,
OpenAPI_rule_status_t *rule_status,
OpenAPI_rule_status_e rule_status,
OpenAPI_list_t *cont_vers,
OpenAPI_failure_code_t *failure_code,
OpenAPI_failure_code_e failure_code,
OpenAPI_final_unit_action_t *fin_unit_act,
OpenAPI_list_t *ran_nas_rel_causes
)
@ -37,12 +37,10 @@ void OpenAPI_rule_report_free(OpenAPI_rule_report_t *rule_report)
ogs_free(node->data);
}
OpenAPI_list_free(rule_report->pcc_rule_ids);
OpenAPI_rule_status_free(rule_report->rule_status);
OpenAPI_list_for_each(rule_report->cont_vers, node) {
ogs_free(node->data);
}
OpenAPI_list_free(rule_report->cont_vers);
OpenAPI_failure_code_free(rule_report->failure_code);
OpenAPI_final_unit_action_free(rule_report->fin_unit_act);
OpenAPI_list_for_each(rule_report->ran_nas_rel_causes, node) {
OpenAPI_ran_nas_rel_cause_free(node->data);
@ -83,13 +81,7 @@ cJSON *OpenAPI_rule_report_convertToJSON(OpenAPI_rule_report_t *rule_report)
ogs_error("OpenAPI_rule_report_convertToJSON() failed [rule_status]");
goto end;
}
cJSON *rule_status_local_JSON = OpenAPI_rule_status_convertToJSON(rule_report->rule_status);
if (rule_status_local_JSON == NULL) {
ogs_error("OpenAPI_rule_report_convertToJSON() failed [rule_status]");
goto end;
}
cJSON_AddItemToObject(item, "ruleStatus", rule_status_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "ruleStatus", OpenAPI_rule_status_ToString(rule_report->rule_status)) == NULL) {
ogs_error("OpenAPI_rule_report_convertToJSON() failed [rule_status]");
goto end;
}
@ -111,13 +103,7 @@ cJSON *OpenAPI_rule_report_convertToJSON(OpenAPI_rule_report_t *rule_report)
}
if (rule_report->failure_code) {
cJSON *failure_code_local_JSON = OpenAPI_failure_code_convertToJSON(rule_report->failure_code);
if (failure_code_local_JSON == NULL) {
ogs_error("OpenAPI_rule_report_convertToJSON() failed [failure_code]");
goto end;
}
cJSON_AddItemToObject(item, "failureCode", failure_code_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "failureCode", OpenAPI_failure_code_ToString(rule_report->failure_code)) == NULL) {
ogs_error("OpenAPI_rule_report_convertToJSON() failed [failure_code]");
goto end;
}
@ -192,9 +178,13 @@ OpenAPI_rule_report_t *OpenAPI_rule_report_parseFromJSON(cJSON *rule_reportJSON)
goto end;
}
OpenAPI_rule_status_t *rule_status_local_nonprim = NULL;
OpenAPI_rule_status_e rule_statusVariable;
rule_status_local_nonprim = OpenAPI_rule_status_parseFromJSON(rule_status);
if (!cJSON_IsString(rule_status)) {
ogs_error("OpenAPI_rule_report_parseFromJSON() failed [rule_status]");
goto end;
}
rule_statusVariable = OpenAPI_rule_status_FromString(rule_status->valuestring);
cJSON *cont_vers = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "contVers");
@ -218,9 +208,13 @@ OpenAPI_rule_report_t *OpenAPI_rule_report_parseFromJSON(cJSON *rule_reportJSON)
cJSON *failure_code = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "failureCode");
OpenAPI_failure_code_t *failure_code_local_nonprim = NULL;
OpenAPI_failure_code_e failure_codeVariable;
if (failure_code) {
failure_code_local_nonprim = OpenAPI_failure_code_parseFromJSON(failure_code);
if (!cJSON_IsString(failure_code)) {
ogs_error("OpenAPI_rule_report_parseFromJSON() failed [failure_code]");
goto end;
}
failure_codeVariable = OpenAPI_failure_code_FromString(failure_code->valuestring);
}
cJSON *fin_unit_act = cJSON_GetObjectItemCaseSensitive(rule_reportJSON, "finUnitAct");
@ -255,9 +249,9 @@ OpenAPI_rule_report_t *OpenAPI_rule_report_parseFromJSON(cJSON *rule_reportJSON)
rule_report_local_var = OpenAPI_rule_report_create (
pcc_rule_idsList,
rule_status_local_nonprim,
rule_statusVariable,
cont_vers ? cont_versList : NULL,
failure_code ? failure_code_local_nonprim : NULL,
failure_code ? failure_codeVariable : 0,
fin_unit_act ? fin_unit_act_local_nonprim : NULL,
ran_nas_rel_causes ? ran_nas_rel_causesList : NULL
);

View file

@ -24,18 +24,18 @@ extern "C" {
typedef struct OpenAPI_rule_report_s OpenAPI_rule_report_t;
typedef struct OpenAPI_rule_report_s {
OpenAPI_list_t *pcc_rule_ids;
struct OpenAPI_rule_status_s *rule_status;
OpenAPI_rule_status_e rule_status;
OpenAPI_list_t *cont_vers;
struct OpenAPI_failure_code_s *failure_code;
OpenAPI_failure_code_e failure_code;
struct OpenAPI_final_unit_action_s *fin_unit_act;
OpenAPI_list_t *ran_nas_rel_causes;
} OpenAPI_rule_report_t;
OpenAPI_rule_report_t *OpenAPI_rule_report_create(
OpenAPI_list_t *pcc_rule_ids,
OpenAPI_rule_status_t *rule_status,
OpenAPI_rule_status_e rule_status,
OpenAPI_list_t *cont_vers,
OpenAPI_failure_code_t *failure_code,
OpenAPI_failure_code_e failure_code,
OpenAPI_final_unit_action_t *fin_unit_act,
OpenAPI_list_t *ran_nas_rel_causes
);

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "rule_status.h"
OpenAPI_rule_status_t *OpenAPI_rule_status_create(
)
char* OpenAPI_rule_status_ToString(OpenAPI_rule_status_e rule_status)
{
OpenAPI_rule_status_t *rule_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_rule_status_t));
if (!rule_status_local_var) {
return NULL;
}
return rule_status_local_var;
const char *rule_statusArray[] = { "NULL", "ACTIVE", "INACTIVE" };
size_t sizeofArray = sizeof(rule_statusArray) / sizeof(rule_statusArray[0]);
if (rule_status < sizeofArray)
return (char *)rule_statusArray[rule_status];
else
return (char *)"Unknown";
}
void OpenAPI_rule_status_free(OpenAPI_rule_status_t *rule_status)
OpenAPI_rule_status_e OpenAPI_rule_status_FromString(char* rule_status)
{
if (NULL == rule_status) {
return;
int stringToReturn = 0;
const char *rule_statusArray[] = { "NULL", "ACTIVE", "INACTIVE" };
size_t sizeofArray = sizeof(rule_statusArray) / sizeof(rule_statusArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(rule_status, rule_statusArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(rule_status);
}
cJSON *OpenAPI_rule_status_convertToJSON(OpenAPI_rule_status_t *rule_status)
{
cJSON *item = NULL;
if (rule_status == NULL) {
ogs_error("OpenAPI_rule_status_convertToJSON() failed [RuleStatus]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_rule_status_t *OpenAPI_rule_status_parseFromJSON(cJSON *rule_statusJSON)
{
OpenAPI_rule_status_t *rule_status_local_var = NULL;
rule_status_local_var = OpenAPI_rule_status_create (
);
return rule_status_local_var;
end:
return NULL;
}
OpenAPI_rule_status_t *OpenAPI_rule_status_copy(OpenAPI_rule_status_t *dst, OpenAPI_rule_status_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_rule_status_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_rule_status_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_rule_status_free(dst);
dst = OpenAPI_rule_status_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* rule_status.h
*
* Possible values are - ACTIVE: Indicates that the PCC rule(s) are successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF), or the session rule(s) are successfully installed - INACTIVE: Indicates that the PCC rule(s) are removed (for those provisioned from PCF) or inactive (for those pre-defined in SMF) or the session rule(s) are removed.
*
*/
#ifndef _OpenAPI_rule_status_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_rule_status_s OpenAPI_rule_status_t;
typedef struct OpenAPI_rule_status_s {
} OpenAPI_rule_status_t;
typedef enum { OpenAPI_rule_status_NULL = 0, OpenAPI_rule_status_ACTIVE, OpenAPI_rule_status_INACTIVE } OpenAPI_rule_status_e;
OpenAPI_rule_status_t *OpenAPI_rule_status_create(
);
void OpenAPI_rule_status_free(OpenAPI_rule_status_t *rule_status);
OpenAPI_rule_status_t *OpenAPI_rule_status_parseFromJSON(cJSON *rule_statusJSON);
cJSON *OpenAPI_rule_status_convertToJSON(OpenAPI_rule_status_t *rule_status);
OpenAPI_rule_status_t *OpenAPI_rule_status_copy(OpenAPI_rule_status_t *dst, OpenAPI_rule_status_t *src);
char* OpenAPI_rule_status_ToString(OpenAPI_rule_status_e rule_status);
OpenAPI_rule_status_e OpenAPI_rule_status_FromString(char* rule_status);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "session_rule_failure_code.h"
OpenAPI_session_rule_failure_code_t *OpenAPI_session_rule_failure_code_create(
)
char* OpenAPI_session_rule_failure_code_ToString(OpenAPI_session_rule_failure_code_e session_rule_failure_code)
{
OpenAPI_session_rule_failure_code_t *session_rule_failure_code_local_var = OpenAPI_malloc(sizeof(OpenAPI_session_rule_failure_code_t));
if (!session_rule_failure_code_local_var) {
return NULL;
}
return session_rule_failure_code_local_var;
const char *session_rule_failure_codeArray[] = { "NULL", "NF_MAL", "RES_LIM", "UNSUCC_QOS_VAL", "UE_STA_SUSP" };
size_t sizeofArray = sizeof(session_rule_failure_codeArray) / sizeof(session_rule_failure_codeArray[0]);
if (session_rule_failure_code < sizeofArray)
return (char *)session_rule_failure_codeArray[session_rule_failure_code];
else
return (char *)"Unknown";
}
void OpenAPI_session_rule_failure_code_free(OpenAPI_session_rule_failure_code_t *session_rule_failure_code)
OpenAPI_session_rule_failure_code_e OpenAPI_session_rule_failure_code_FromString(char* session_rule_failure_code)
{
if (NULL == session_rule_failure_code) {
return;
int stringToReturn = 0;
const char *session_rule_failure_codeArray[] = { "NULL", "NF_MAL", "RES_LIM", "UNSUCC_QOS_VAL", "UE_STA_SUSP" };
size_t sizeofArray = sizeof(session_rule_failure_codeArray) / sizeof(session_rule_failure_codeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(session_rule_failure_code, session_rule_failure_codeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(session_rule_failure_code);
}
cJSON *OpenAPI_session_rule_failure_code_convertToJSON(OpenAPI_session_rule_failure_code_t *session_rule_failure_code)
{
cJSON *item = NULL;
if (session_rule_failure_code == NULL) {
ogs_error("OpenAPI_session_rule_failure_code_convertToJSON() failed [SessionRuleFailureCode]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_session_rule_failure_code_t *OpenAPI_session_rule_failure_code_parseFromJSON(cJSON *session_rule_failure_codeJSON)
{
OpenAPI_session_rule_failure_code_t *session_rule_failure_code_local_var = NULL;
session_rule_failure_code_local_var = OpenAPI_session_rule_failure_code_create (
);
return session_rule_failure_code_local_var;
end:
return NULL;
}
OpenAPI_session_rule_failure_code_t *OpenAPI_session_rule_failure_code_copy(OpenAPI_session_rule_failure_code_t *dst, OpenAPI_session_rule_failure_code_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_session_rule_failure_code_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_session_rule_failure_code_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_session_rule_failure_code_free(dst);
dst = OpenAPI_session_rule_failure_code_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* session_rule_failure_code.h
*
* Possible values are - NF_MAL: Indicate that the PCC rule could not be successfully installed (for those provisioned from the PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to SMF/UPF malfunction. - RES_LIM: Indicate that the PCC rule could not be successfully installed (for those provisioned from PCF) or activated (for those pre-defined in SMF) or enforced (for those already successfully installed) due to a limitation of resources at the SMF/UPF. - UNSUCC_QOS_VAL: indicate that the QoS validation has failed. - UE_STA_SUSP: Indicates that the UE is in suspend state.
*
*/
#ifndef _OpenAPI_session_rule_failure_code_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_session_rule_failure_code_s OpenAPI_session_rule_failure_code_t;
typedef struct OpenAPI_session_rule_failure_code_s {
} OpenAPI_session_rule_failure_code_t;
typedef enum { OpenAPI_session_rule_failure_code_NULL = 0, OpenAPI_session_rule_failure_code_NF_MAL, OpenAPI_session_rule_failure_code_RES_LIM, OpenAPI_session_rule_failure_code_UNSUCC_QOS_VAL, OpenAPI_session_rule_failure_code_UE_STA_SUSP } OpenAPI_session_rule_failure_code_e;
OpenAPI_session_rule_failure_code_t *OpenAPI_session_rule_failure_code_create(
);
void OpenAPI_session_rule_failure_code_free(OpenAPI_session_rule_failure_code_t *session_rule_failure_code);
OpenAPI_session_rule_failure_code_t *OpenAPI_session_rule_failure_code_parseFromJSON(cJSON *session_rule_failure_codeJSON);
cJSON *OpenAPI_session_rule_failure_code_convertToJSON(OpenAPI_session_rule_failure_code_t *session_rule_failure_code);
OpenAPI_session_rule_failure_code_t *OpenAPI_session_rule_failure_code_copy(OpenAPI_session_rule_failure_code_t *dst, OpenAPI_session_rule_failure_code_t *src);
char* OpenAPI_session_rule_failure_code_ToString(OpenAPI_session_rule_failure_code_e session_rule_failure_code);
OpenAPI_session_rule_failure_code_e OpenAPI_session_rule_failure_code_FromString(char* session_rule_failure_code);
#ifdef __cplusplus
}

View file

@ -6,8 +6,8 @@
OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_create(
OpenAPI_list_t *rule_ids,
OpenAPI_rule_status_t *rule_status,
OpenAPI_session_rule_failure_code_t *sess_rule_failure_code
OpenAPI_rule_status_e rule_status,
OpenAPI_session_rule_failure_code_e sess_rule_failure_code
)
{
OpenAPI_session_rule_report_t *session_rule_report_local_var = OpenAPI_malloc(sizeof(OpenAPI_session_rule_report_t));
@ -31,8 +31,6 @@ void OpenAPI_session_rule_report_free(OpenAPI_session_rule_report_t *session_rul
ogs_free(node->data);
}
OpenAPI_list_free(session_rule_report->rule_ids);
OpenAPI_rule_status_free(session_rule_report->rule_status);
OpenAPI_session_rule_failure_code_free(session_rule_report->sess_rule_failure_code);
ogs_free(session_rule_report);
}
@ -68,25 +66,13 @@ cJSON *OpenAPI_session_rule_report_convertToJSON(OpenAPI_session_rule_report_t *
ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_status]");
goto end;
}
cJSON *rule_status_local_JSON = OpenAPI_rule_status_convertToJSON(session_rule_report->rule_status);
if (rule_status_local_JSON == NULL) {
ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_status]");
goto end;
}
cJSON_AddItemToObject(item, "ruleStatus", rule_status_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "ruleStatus", OpenAPI_rule_status_ToString(session_rule_report->rule_status)) == NULL) {
ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [rule_status]");
goto end;
}
if (session_rule_report->sess_rule_failure_code) {
cJSON *sess_rule_failure_code_local_JSON = OpenAPI_session_rule_failure_code_convertToJSON(session_rule_report->sess_rule_failure_code);
if (sess_rule_failure_code_local_JSON == NULL) {
ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [sess_rule_failure_code]");
goto end;
}
cJSON_AddItemToObject(item, "sessRuleFailureCode", sess_rule_failure_code_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "sessRuleFailureCode", OpenAPI_session_rule_failure_code_ToString(session_rule_report->sess_rule_failure_code)) == NULL) {
ogs_error("OpenAPI_session_rule_report_convertToJSON() failed [sess_rule_failure_code]");
goto end;
}
@ -128,21 +114,29 @@ OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_parseFromJSON(cJSON *
goto end;
}
OpenAPI_rule_status_t *rule_status_local_nonprim = NULL;
OpenAPI_rule_status_e rule_statusVariable;
rule_status_local_nonprim = OpenAPI_rule_status_parseFromJSON(rule_status);
if (!cJSON_IsString(rule_status)) {
ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [rule_status]");
goto end;
}
rule_statusVariable = OpenAPI_rule_status_FromString(rule_status->valuestring);
cJSON *sess_rule_failure_code = cJSON_GetObjectItemCaseSensitive(session_rule_reportJSON, "sessRuleFailureCode");
OpenAPI_session_rule_failure_code_t *sess_rule_failure_code_local_nonprim = NULL;
OpenAPI_session_rule_failure_code_e sess_rule_failure_codeVariable;
if (sess_rule_failure_code) {
sess_rule_failure_code_local_nonprim = OpenAPI_session_rule_failure_code_parseFromJSON(sess_rule_failure_code);
if (!cJSON_IsString(sess_rule_failure_code)) {
ogs_error("OpenAPI_session_rule_report_parseFromJSON() failed [sess_rule_failure_code]");
goto end;
}
sess_rule_failure_codeVariable = OpenAPI_session_rule_failure_code_FromString(sess_rule_failure_code->valuestring);
}
session_rule_report_local_var = OpenAPI_session_rule_report_create (
rule_idsList,
rule_status_local_nonprim,
sess_rule_failure_code ? sess_rule_failure_code_local_nonprim : NULL
rule_statusVariable,
sess_rule_failure_code ? sess_rule_failure_codeVariable : 0
);
return session_rule_report_local_var;

View file

@ -22,14 +22,14 @@ extern "C" {
typedef struct OpenAPI_session_rule_report_s OpenAPI_session_rule_report_t;
typedef struct OpenAPI_session_rule_report_s {
OpenAPI_list_t *rule_ids;
struct OpenAPI_rule_status_s *rule_status;
struct OpenAPI_session_rule_failure_code_s *sess_rule_failure_code;
OpenAPI_rule_status_e rule_status;
OpenAPI_session_rule_failure_code_e sess_rule_failure_code;
} OpenAPI_session_rule_report_t;
OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_create(
OpenAPI_list_t *rule_ids,
OpenAPI_rule_status_t *rule_status,
OpenAPI_session_rule_failure_code_t *sess_rule_failure_code
OpenAPI_rule_status_e rule_status,
OpenAPI_session_rule_failure_code_e sess_rule_failure_code
);
void OpenAPI_session_rule_report_free(OpenAPI_session_rule_report_t *session_rule_report);
OpenAPI_session_rule_report_t *OpenAPI_session_rule_report_parseFromJSON(cJSON *session_rule_reportJSON);

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "sm_policy_association_release_cause.h"
OpenAPI_sm_policy_association_release_cause_t *OpenAPI_sm_policy_association_release_cause_create(
)
char* OpenAPI_sm_policy_association_release_cause_ToString(OpenAPI_sm_policy_association_release_cause_e sm_policy_association_release_cause)
{
OpenAPI_sm_policy_association_release_cause_t *sm_policy_association_release_cause_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_association_release_cause_t));
if (!sm_policy_association_release_cause_local_var) {
return NULL;
}
return sm_policy_association_release_cause_local_var;
const char *sm_policy_association_release_causeArray[] = { "NULL", "UNSPECIFIED", "UE_SUBSCRIPTION", "INSUFFICIENT_RES", "VALIDATION_CONDITION_NOT_MET" };
size_t sizeofArray = sizeof(sm_policy_association_release_causeArray) / sizeof(sm_policy_association_release_causeArray[0]);
if (sm_policy_association_release_cause < sizeofArray)
return (char *)sm_policy_association_release_causeArray[sm_policy_association_release_cause];
else
return (char *)"Unknown";
}
void OpenAPI_sm_policy_association_release_cause_free(OpenAPI_sm_policy_association_release_cause_t *sm_policy_association_release_cause)
OpenAPI_sm_policy_association_release_cause_e OpenAPI_sm_policy_association_release_cause_FromString(char* sm_policy_association_release_cause)
{
if (NULL == sm_policy_association_release_cause) {
return;
int stringToReturn = 0;
const char *sm_policy_association_release_causeArray[] = { "NULL", "UNSPECIFIED", "UE_SUBSCRIPTION", "INSUFFICIENT_RES", "VALIDATION_CONDITION_NOT_MET" };
size_t sizeofArray = sizeof(sm_policy_association_release_causeArray) / sizeof(sm_policy_association_release_causeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(sm_policy_association_release_cause, sm_policy_association_release_causeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(sm_policy_association_release_cause);
}
cJSON *OpenAPI_sm_policy_association_release_cause_convertToJSON(OpenAPI_sm_policy_association_release_cause_t *sm_policy_association_release_cause)
{
cJSON *item = NULL;
if (sm_policy_association_release_cause == NULL) {
ogs_error("OpenAPI_sm_policy_association_release_cause_convertToJSON() failed [SmPolicyAssociationReleaseCause]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_sm_policy_association_release_cause_t *OpenAPI_sm_policy_association_release_cause_parseFromJSON(cJSON *sm_policy_association_release_causeJSON)
{
OpenAPI_sm_policy_association_release_cause_t *sm_policy_association_release_cause_local_var = NULL;
sm_policy_association_release_cause_local_var = OpenAPI_sm_policy_association_release_cause_create (
);
return sm_policy_association_release_cause_local_var;
end:
return NULL;
}
OpenAPI_sm_policy_association_release_cause_t *OpenAPI_sm_policy_association_release_cause_copy(OpenAPI_sm_policy_association_release_cause_t *dst, OpenAPI_sm_policy_association_release_cause_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_sm_policy_association_release_cause_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_sm_policy_association_release_cause_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_sm_policy_association_release_cause_free(dst);
dst = OpenAPI_sm_policy_association_release_cause_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_sm_policy_association_release_cause_s OpenAPI_sm_policy_association_release_cause_t;
typedef struct OpenAPI_sm_policy_association_release_cause_s {
} OpenAPI_sm_policy_association_release_cause_t;
typedef enum { OpenAPI_sm_policy_association_release_cause_NULL = 0, OpenAPI_sm_policy_association_release_cause_UNSPECIFIED, OpenAPI_sm_policy_association_release_cause_UE_SUBSCRIPTION, OpenAPI_sm_policy_association_release_cause_INSUFFICIENT_RES, OpenAPI_sm_policy_association_release_cause_VALIDATION_CONDITION_NOT_MET } OpenAPI_sm_policy_association_release_cause_e;
OpenAPI_sm_policy_association_release_cause_t *OpenAPI_sm_policy_association_release_cause_create(
);
void OpenAPI_sm_policy_association_release_cause_free(OpenAPI_sm_policy_association_release_cause_t *sm_policy_association_release_cause);
OpenAPI_sm_policy_association_release_cause_t *OpenAPI_sm_policy_association_release_cause_parseFromJSON(cJSON *sm_policy_association_release_causeJSON);
cJSON *OpenAPI_sm_policy_association_release_cause_convertToJSON(OpenAPI_sm_policy_association_release_cause_t *sm_policy_association_release_cause);
OpenAPI_sm_policy_association_release_cause_t *OpenAPI_sm_policy_association_release_cause_copy(OpenAPI_sm_policy_association_release_cause_t *dst, OpenAPI_sm_policy_association_release_cause_t *src);
char* OpenAPI_sm_policy_association_release_cause_ToString(OpenAPI_sm_policy_association_release_cause_e sm_policy_association_release_cause);
OpenAPI_sm_policy_association_release_cause_e OpenAPI_sm_policy_association_release_cause_FromString(char* sm_policy_association_release_cause);
#ifdef __cplusplus
}

View file

@ -36,12 +36,12 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_create(
int ref_qos_indication,
OpenAPI_trace_data_t *trace_req,
OpenAPI_snssai_t *slice_info,
OpenAPI_qos_flow_usage_t *qos_flow_usage,
OpenAPI_qos_flow_usage_e qos_flow_usage,
OpenAPI_serving_nf_identity_t *serv_nf_id,
char *supp_feat,
char *smf_id,
char *recovery_time,
OpenAPI_ma_pdu_indication_t *ma_pdu_ind,
OpenAPI_ma_pdu_indication_e ma_pdu_ind,
OpenAPI_atsss_capability_t *atsss_capab
)
{
@ -121,12 +121,10 @@ void OpenAPI_sm_policy_context_data_free(OpenAPI_sm_policy_context_data_t *sm_po
OpenAPI_subscribed_default_qos_free(sm_policy_context_data->subs_def_qos);
OpenAPI_trace_data_free(sm_policy_context_data->trace_req);
OpenAPI_snssai_free(sm_policy_context_data->slice_info);
OpenAPI_qos_flow_usage_free(sm_policy_context_data->qos_flow_usage);
OpenAPI_serving_nf_identity_free(sm_policy_context_data->serv_nf_id);
ogs_free(sm_policy_context_data->supp_feat);
ogs_free(sm_policy_context_data->smf_id);
ogs_free(sm_policy_context_data->recovery_time);
OpenAPI_ma_pdu_indication_free(sm_policy_context_data->ma_pdu_ind);
OpenAPI_atsss_capability_free(sm_policy_context_data->atsss_capab);
ogs_free(sm_policy_context_data);
}
@ -434,13 +432,7 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da
}
if (sm_policy_context_data->qos_flow_usage) {
cJSON *qos_flow_usage_local_JSON = OpenAPI_qos_flow_usage_convertToJSON(sm_policy_context_data->qos_flow_usage);
if (qos_flow_usage_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [qos_flow_usage]");
goto end;
}
cJSON_AddItemToObject(item, "qosFlowUsage", qos_flow_usage_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "qosFlowUsage", OpenAPI_qos_flow_usage_ToString(sm_policy_context_data->qos_flow_usage)) == NULL) {
ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [qos_flow_usage]");
goto end;
}
@ -481,13 +473,7 @@ cJSON *OpenAPI_sm_policy_context_data_convertToJSON(OpenAPI_sm_policy_context_da
}
if (sm_policy_context_data->ma_pdu_ind) {
cJSON *ma_pdu_ind_local_JSON = OpenAPI_ma_pdu_indication_convertToJSON(sm_policy_context_data->ma_pdu_ind);
if (ma_pdu_ind_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ma_pdu_ind]");
goto end;
}
cJSON_AddItemToObject(item, "maPduInd", ma_pdu_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "maPduInd", OpenAPI_ma_pdu_indication_ToString(sm_policy_context_data->ma_pdu_ind)) == NULL) {
ogs_error("OpenAPI_sm_policy_context_data_convertToJSON() failed [ma_pdu_ind]");
goto end;
}
@ -813,9 +799,13 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c
cJSON *qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "qosFlowUsage");
OpenAPI_qos_flow_usage_t *qos_flow_usage_local_nonprim = NULL;
OpenAPI_qos_flow_usage_e qos_flow_usageVariable;
if (qos_flow_usage) {
qos_flow_usage_local_nonprim = OpenAPI_qos_flow_usage_parseFromJSON(qos_flow_usage);
if (!cJSON_IsString(qos_flow_usage)) {
ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [qos_flow_usage]");
goto end;
}
qos_flow_usageVariable = OpenAPI_qos_flow_usage_FromString(qos_flow_usage->valuestring);
}
cJSON *serv_nf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "servNfId");
@ -854,9 +844,13 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c
cJSON *ma_pdu_ind = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "maPduInd");
OpenAPI_ma_pdu_indication_t *ma_pdu_ind_local_nonprim = NULL;
OpenAPI_ma_pdu_indication_e ma_pdu_indVariable;
if (ma_pdu_ind) {
ma_pdu_ind_local_nonprim = OpenAPI_ma_pdu_indication_parseFromJSON(ma_pdu_ind);
if (!cJSON_IsString(ma_pdu_ind)) {
ogs_error("OpenAPI_sm_policy_context_data_parseFromJSON() failed [ma_pdu_ind]");
goto end;
}
ma_pdu_indVariable = OpenAPI_ma_pdu_indication_FromString(ma_pdu_ind->valuestring);
}
cJSON *atsss_capab = cJSON_GetObjectItemCaseSensitive(sm_policy_context_dataJSON, "atsssCapab");
@ -898,12 +892,12 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_parseFromJSON(c
ref_qos_indication ? ref_qos_indication->valueint : 0,
trace_req ? trace_req_local_nonprim : NULL,
slice_info_local_nonprim,
qos_flow_usage ? qos_flow_usage_local_nonprim : NULL,
qos_flow_usage ? qos_flow_usageVariable : 0,
serv_nf_id ? serv_nf_id_local_nonprim : NULL,
supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL,
smf_id ? ogs_strdup(smf_id->valuestring) : NULL,
recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL,
ma_pdu_ind ? ma_pdu_ind_local_nonprim : NULL,
ma_pdu_ind ? ma_pdu_indVariable : 0,
atsss_capab ? atsss_capab_local_nonprim : NULL
);

View file

@ -67,12 +67,12 @@ typedef struct OpenAPI_sm_policy_context_data_s {
int ref_qos_indication;
struct OpenAPI_trace_data_s *trace_req;
struct OpenAPI_snssai_s *slice_info;
struct OpenAPI_qos_flow_usage_s *qos_flow_usage;
OpenAPI_qos_flow_usage_e qos_flow_usage;
struct OpenAPI_serving_nf_identity_s *serv_nf_id;
char *supp_feat;
char *smf_id;
char *recovery_time;
struct OpenAPI_ma_pdu_indication_s *ma_pdu_ind;
OpenAPI_ma_pdu_indication_e ma_pdu_ind;
struct OpenAPI_atsss_capability_s *atsss_capab;
} OpenAPI_sm_policy_context_data_t;
@ -108,12 +108,12 @@ OpenAPI_sm_policy_context_data_t *OpenAPI_sm_policy_context_data_create(
int ref_qos_indication,
OpenAPI_trace_data_t *trace_req,
OpenAPI_snssai_t *slice_info,
OpenAPI_qos_flow_usage_t *qos_flow_usage,
OpenAPI_qos_flow_usage_e qos_flow_usage,
OpenAPI_serving_nf_identity_t *serv_nf_id,
char *supp_feat,
char *smf_id,
char *recovery_time,
OpenAPI_ma_pdu_indication_t *ma_pdu_ind,
OpenAPI_ma_pdu_indication_e ma_pdu_ind,
OpenAPI_atsss_capability_t *atsss_capab
);
void OpenAPI_sm_policy_context_data_free(OpenAPI_sm_policy_context_data_t *sm_policy_context_data);

View file

@ -26,8 +26,8 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_create(
OpenAPI_list_t* pra_infos,
int ipv4_index,
int ipv6_index,
OpenAPI_qos_flow_usage_t *qos_flow_usage,
OpenAPI_sm_policy_association_release_cause_t *rel_cause,
OpenAPI_qos_flow_usage_e qos_flow_usage,
OpenAPI_sm_policy_association_release_cause_e rel_cause,
char *supp_feat,
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt,
OpenAPI_list_t *tsn_port_man_cont_nwtts
@ -129,9 +129,6 @@ void OpenAPI_sm_policy_decision_free(OpenAPI_sm_policy_decision_t *sm_policy_dec
}
OpenAPI_list_free(sm_policy_decision->conds);
ogs_free(sm_policy_decision->revalidation_time);
OpenAPI_list_for_each(sm_policy_decision->policy_ctrl_req_triggers, node) {
OpenAPI_policy_control_request_trigger_free(node->data);
}
OpenAPI_list_free(sm_policy_decision->policy_ctrl_req_triggers);
OpenAPI_list_for_each(sm_policy_decision->last_req_rule_data, node) {
OpenAPI_requested_rule_data_free(node->data);
@ -144,8 +141,6 @@ void OpenAPI_sm_policy_decision_free(OpenAPI_sm_policy_decision_t *sm_policy_dec
ogs_free(localKeyValue);
}
OpenAPI_list_free(sm_policy_decision->pra_infos);
OpenAPI_qos_flow_usage_free(sm_policy_decision->qos_flow_usage);
OpenAPI_sm_policy_association_release_cause_free(sm_policy_decision->rel_cause);
ogs_free(sm_policy_decision->supp_feat);
OpenAPI_port_management_container_free(sm_policy_decision->tsn_port_man_cont_dstt);
OpenAPI_list_for_each(sm_policy_decision->tsn_port_man_cont_nwtts, node) {
@ -403,21 +398,16 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm
}
if (sm_policy_decision->policy_ctrl_req_triggers) {
cJSON *policy_ctrl_req_triggersList = cJSON_AddArrayToObject(item, "policyCtrlReqTriggers");
if (policy_ctrl_req_triggersList == NULL) {
cJSON *policy_ctrl_req_triggers = cJSON_AddArrayToObject(item, "policyCtrlReqTriggers");
if (policy_ctrl_req_triggers == NULL) {
ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [policy_ctrl_req_triggers]");
goto end;
}
OpenAPI_lnode_t *policy_ctrl_req_triggers_node;
if (sm_policy_decision->policy_ctrl_req_triggers) {
OpenAPI_list_for_each(sm_policy_decision->policy_ctrl_req_triggers, policy_ctrl_req_triggers_node) {
cJSON *itemLocal = OpenAPI_policy_control_request_trigger_convertToJSON(policy_ctrl_req_triggers_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [policy_ctrl_req_triggers]");
goto end;
}
cJSON_AddItemToArray(policy_ctrl_req_triggersList, itemLocal);
OpenAPI_list_for_each(sm_policy_decision->policy_ctrl_req_triggers, policy_ctrl_req_triggers_node) {
if (cJSON_AddStringToObject(policy_ctrl_req_triggers, "", OpenAPI_policy_control_request_trigger_ToString((OpenAPI_policy_control_request_trigger_e)policy_ctrl_req_triggers_node->data)) == NULL) {
ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [policy_ctrl_req_triggers]");
goto end;
}
}
}
@ -491,26 +481,14 @@ cJSON *OpenAPI_sm_policy_decision_convertToJSON(OpenAPI_sm_policy_decision_t *sm
}
if (sm_policy_decision->qos_flow_usage) {
cJSON *qos_flow_usage_local_JSON = OpenAPI_qos_flow_usage_convertToJSON(sm_policy_decision->qos_flow_usage);
if (qos_flow_usage_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [qos_flow_usage]");
goto end;
}
cJSON_AddItemToObject(item, "qosFlowUsage", qos_flow_usage_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "qosFlowUsage", OpenAPI_qos_flow_usage_ToString(sm_policy_decision->qos_flow_usage)) == NULL) {
ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [qos_flow_usage]");
goto end;
}
}
if (sm_policy_decision->rel_cause) {
cJSON *rel_cause_local_JSON = OpenAPI_sm_policy_association_release_cause_convertToJSON(sm_policy_decision->rel_cause);
if (rel_cause_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [rel_cause]");
goto end;
}
cJSON_AddItemToObject(item, "relCause", rel_cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "relCause", OpenAPI_sm_policy_association_release_cause_ToString(sm_policy_decision->rel_cause)) == NULL) {
ogs_error("OpenAPI_sm_policy_decision_convertToJSON() failed [rel_cause]");
goto end;
}
@ -835,13 +813,12 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm
policy_ctrl_req_triggersList = OpenAPI_list_create();
cJSON_ArrayForEach(policy_ctrl_req_triggers_local_nonprimitive, policy_ctrl_req_triggers ) {
if (!cJSON_IsObject(policy_ctrl_req_triggers_local_nonprimitive)) {
if (!cJSON_IsString(policy_ctrl_req_triggers_local_nonprimitive)) {
ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [policy_ctrl_req_triggers]");
goto end;
}
OpenAPI_policy_control_request_trigger_t *policy_ctrl_req_triggersItem = OpenAPI_policy_control_request_trigger_parseFromJSON(policy_ctrl_req_triggers_local_nonprimitive);
OpenAPI_list_add(policy_ctrl_req_triggersList, policy_ctrl_req_triggersItem);
OpenAPI_list_add(policy_ctrl_req_triggersList, (void *)OpenAPI_policy_control_request_trigger_FromString(policy_ctrl_req_triggers_local_nonprimitive->valuestring));
}
}
@ -918,16 +895,24 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm
cJSON *qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "qosFlowUsage");
OpenAPI_qos_flow_usage_t *qos_flow_usage_local_nonprim = NULL;
OpenAPI_qos_flow_usage_e qos_flow_usageVariable;
if (qos_flow_usage) {
qos_flow_usage_local_nonprim = OpenAPI_qos_flow_usage_parseFromJSON(qos_flow_usage);
if (!cJSON_IsString(qos_flow_usage)) {
ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [qos_flow_usage]");
goto end;
}
qos_flow_usageVariable = OpenAPI_qos_flow_usage_FromString(qos_flow_usage->valuestring);
}
cJSON *rel_cause = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "relCause");
OpenAPI_sm_policy_association_release_cause_t *rel_cause_local_nonprim = NULL;
OpenAPI_sm_policy_association_release_cause_e rel_causeVariable;
if (rel_cause) {
rel_cause_local_nonprim = OpenAPI_sm_policy_association_release_cause_parseFromJSON(rel_cause);
if (!cJSON_IsString(rel_cause)) {
ogs_error("OpenAPI_sm_policy_decision_parseFromJSON() failed [rel_cause]");
goto end;
}
rel_causeVariable = OpenAPI_sm_policy_association_release_cause_FromString(rel_cause->valuestring);
}
cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(sm_policy_decisionJSON, "suppFeat");
@ -991,8 +976,8 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_parseFromJSON(cJSON *sm
pra_infos ? pra_infosList : NULL,
ipv4_index ? ipv4_index->valuedouble : 0,
ipv6_index ? ipv6_index->valuedouble : 0,
qos_flow_usage ? qos_flow_usage_local_nonprim : NULL,
rel_cause ? rel_cause_local_nonprim : NULL,
qos_flow_usage ? qos_flow_usageVariable : 0,
rel_cause ? rel_causeVariable : 0,
supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL,
tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL,
tsn_port_man_cont_nwtts ? tsn_port_man_cont_nwttsList : NULL

View file

@ -57,8 +57,8 @@ typedef struct OpenAPI_sm_policy_decision_s {
OpenAPI_list_t* pra_infos;
int ipv4_index;
int ipv6_index;
struct OpenAPI_qos_flow_usage_s *qos_flow_usage;
struct OpenAPI_sm_policy_association_release_cause_s *rel_cause;
OpenAPI_qos_flow_usage_e qos_flow_usage;
OpenAPI_sm_policy_association_release_cause_e rel_cause;
char *supp_feat;
struct OpenAPI_port_management_container_s *tsn_port_man_cont_dstt;
OpenAPI_list_t *tsn_port_man_cont_nwtts;
@ -86,8 +86,8 @@ OpenAPI_sm_policy_decision_t *OpenAPI_sm_policy_decision_create(
OpenAPI_list_t* pra_infos,
int ipv4_index,
int ipv6_index,
OpenAPI_qos_flow_usage_t *qos_flow_usage,
OpenAPI_sm_policy_association_release_cause_t *rel_cause,
OpenAPI_qos_flow_usage_e qos_flow_usage,
OpenAPI_sm_policy_association_release_cause_e rel_cause,
char *supp_feat,
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt,
OpenAPI_list_t *tsn_port_man_cont_nwtts

View file

@ -11,7 +11,7 @@ OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_create(
char *user_location_info_time,
OpenAPI_list_t *ran_nas_rel_causes,
OpenAPI_list_t *accu_usage_reports,
OpenAPI_pdu_session_rel_cause_t *pdu_sess_rel_cause
OpenAPI_pdu_session_rel_cause_e pdu_sess_rel_cause
)
{
OpenAPI_sm_policy_delete_data_t *sm_policy_delete_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_policy_delete_data_t));
@ -47,7 +47,6 @@ void OpenAPI_sm_policy_delete_data_free(OpenAPI_sm_policy_delete_data_t *sm_poli
OpenAPI_accu_usage_report_free(node->data);
}
OpenAPI_list_free(sm_policy_delete_data->accu_usage_reports);
OpenAPI_pdu_session_rel_cause_free(sm_policy_delete_data->pdu_sess_rel_cause);
ogs_free(sm_policy_delete_data);
}
@ -142,13 +141,7 @@ cJSON *OpenAPI_sm_policy_delete_data_convertToJSON(OpenAPI_sm_policy_delete_data
}
if (sm_policy_delete_data->pdu_sess_rel_cause) {
cJSON *pdu_sess_rel_cause_local_JSON = OpenAPI_pdu_session_rel_cause_convertToJSON(sm_policy_delete_data->pdu_sess_rel_cause);
if (pdu_sess_rel_cause_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [pdu_sess_rel_cause]");
goto end;
}
cJSON_AddItemToObject(item, "pduSessRelCause", pdu_sess_rel_cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "pduSessRelCause", OpenAPI_pdu_session_rel_cause_ToString(sm_policy_delete_data->pdu_sess_rel_cause)) == NULL) {
ogs_error("OpenAPI_sm_policy_delete_data_convertToJSON() failed [pdu_sess_rel_cause]");
goto end;
}
@ -241,9 +234,13 @@ OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_parseFromJSON(cJS
cJSON *pdu_sess_rel_cause = cJSON_GetObjectItemCaseSensitive(sm_policy_delete_dataJSON, "pduSessRelCause");
OpenAPI_pdu_session_rel_cause_t *pdu_sess_rel_cause_local_nonprim = NULL;
OpenAPI_pdu_session_rel_cause_e pdu_sess_rel_causeVariable;
if (pdu_sess_rel_cause) {
pdu_sess_rel_cause_local_nonprim = OpenAPI_pdu_session_rel_cause_parseFromJSON(pdu_sess_rel_cause);
if (!cJSON_IsString(pdu_sess_rel_cause)) {
ogs_error("OpenAPI_sm_policy_delete_data_parseFromJSON() failed [pdu_sess_rel_cause]");
goto end;
}
pdu_sess_rel_causeVariable = OpenAPI_pdu_session_rel_cause_FromString(pdu_sess_rel_cause->valuestring);
}
sm_policy_delete_data_local_var = OpenAPI_sm_policy_delete_data_create (
@ -253,7 +250,7 @@ OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_parseFromJSON(cJS
user_location_info_time ? ogs_strdup(user_location_info_time->valuestring) : NULL,
ran_nas_rel_causes ? ran_nas_rel_causesList : NULL,
accu_usage_reports ? accu_usage_reportsList : NULL,
pdu_sess_rel_cause ? pdu_sess_rel_cause_local_nonprim : NULL
pdu_sess_rel_cause ? pdu_sess_rel_causeVariable : 0
);
return sm_policy_delete_data_local_var;

View file

@ -30,7 +30,7 @@ typedef struct OpenAPI_sm_policy_delete_data_s {
char *user_location_info_time;
OpenAPI_list_t *ran_nas_rel_causes;
OpenAPI_list_t *accu_usage_reports;
struct OpenAPI_pdu_session_rel_cause_s *pdu_sess_rel_cause;
OpenAPI_pdu_session_rel_cause_e pdu_sess_rel_cause;
} OpenAPI_sm_policy_delete_data_t;
OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_create(
@ -40,7 +40,7 @@ OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_create(
char *user_location_info_time,
OpenAPI_list_t *ran_nas_rel_causes,
OpenAPI_list_t *accu_usage_reports,
OpenAPI_pdu_session_rel_cause_t *pdu_sess_rel_cause
OpenAPI_pdu_session_rel_cause_e pdu_sess_rel_cause
);
void OpenAPI_sm_policy_delete_data_free(OpenAPI_sm_policy_delete_data_t *sm_policy_delete_data);
OpenAPI_sm_policy_delete_data_t *OpenAPI_sm_policy_delete_data_parseFromJSON(cJSON *sm_policy_delete_dataJSON);

View file

@ -38,11 +38,11 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_c
OpenAPI_list_t* rep_pra_infos,
OpenAPI_ue_initiated_resource_request_t *ue_init_res_req,
int ref_qos_indication,
OpenAPI_qos_flow_usage_t *qos_flow_usage,
OpenAPI_credit_management_status_t *credit_manage_status,
OpenAPI_qos_flow_usage_e qos_flow_usage,
OpenAPI_credit_management_status_e credit_manage_status,
OpenAPI_serving_nf_identity_t *serv_nf_id,
OpenAPI_trace_data_t *trace_req,
OpenAPI_ma_pdu_indication_t *ma_pdu_ind,
OpenAPI_ma_pdu_indication_e ma_pdu_ind,
OpenAPI_atsss_capability_t *atsss_capab,
OpenAPI_tsn_bridge_info_t *tsn_bridge_info,
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt,
@ -107,9 +107,6 @@ void OpenAPI_sm_policy_update_context_data_free(OpenAPI_sm_policy_update_context
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(sm_policy_update_context_data->rep_policy_ctrl_req_triggers, node) {
OpenAPI_policy_control_request_trigger_free(node->data);
}
OpenAPI_list_free(sm_policy_update_context_data->rep_policy_ctrl_req_triggers);
OpenAPI_list_for_each(sm_policy_update_context_data->acc_net_ch_ids, node) {
OpenAPI_acc_net_ch_id_free(node->data);
@ -164,11 +161,8 @@ void OpenAPI_sm_policy_update_context_data_free(OpenAPI_sm_policy_update_context
}
OpenAPI_list_free(sm_policy_update_context_data->rep_pra_infos);
OpenAPI_ue_initiated_resource_request_free(sm_policy_update_context_data->ue_init_res_req);
OpenAPI_qos_flow_usage_free(sm_policy_update_context_data->qos_flow_usage);
OpenAPI_credit_management_status_free(sm_policy_update_context_data->credit_manage_status);
OpenAPI_serving_nf_identity_free(sm_policy_update_context_data->serv_nf_id);
OpenAPI_trace_data_free(sm_policy_update_context_data->trace_req);
OpenAPI_ma_pdu_indication_free(sm_policy_update_context_data->ma_pdu_ind);
OpenAPI_atsss_capability_free(sm_policy_update_context_data->atsss_capab);
OpenAPI_tsn_bridge_info_free(sm_policy_update_context_data->tsn_bridge_info);
OpenAPI_port_management_container_free(sm_policy_update_context_data->tsn_port_man_cont_dstt);
@ -194,21 +188,16 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd
item = cJSON_CreateObject();
if (sm_policy_update_context_data->rep_policy_ctrl_req_triggers) {
cJSON *rep_policy_ctrl_req_triggersList = cJSON_AddArrayToObject(item, "repPolicyCtrlReqTriggers");
if (rep_policy_ctrl_req_triggersList == NULL) {
cJSON *rep_policy_ctrl_req_triggers = cJSON_AddArrayToObject(item, "repPolicyCtrlReqTriggers");
if (rep_policy_ctrl_req_triggers == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rep_policy_ctrl_req_triggers]");
goto end;
}
OpenAPI_lnode_t *rep_policy_ctrl_req_triggers_node;
if (sm_policy_update_context_data->rep_policy_ctrl_req_triggers) {
OpenAPI_list_for_each(sm_policy_update_context_data->rep_policy_ctrl_req_triggers, rep_policy_ctrl_req_triggers_node) {
cJSON *itemLocal = OpenAPI_policy_control_request_trigger_convertToJSON(rep_policy_ctrl_req_triggers_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rep_policy_ctrl_req_triggers]");
goto end;
}
cJSON_AddItemToArray(rep_policy_ctrl_req_triggersList, itemLocal);
OpenAPI_list_for_each(sm_policy_update_context_data->rep_policy_ctrl_req_triggers, rep_policy_ctrl_req_triggers_node) {
if (cJSON_AddStringToObject(rep_policy_ctrl_req_triggers, "", OpenAPI_policy_control_request_trigger_ToString((OpenAPI_policy_control_request_trigger_e)rep_policy_ctrl_req_triggers_node->data)) == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [rep_policy_ctrl_req_triggers]");
goto end;
}
}
}
@ -585,26 +574,14 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd
}
if (sm_policy_update_context_data->qos_flow_usage) {
cJSON *qos_flow_usage_local_JSON = OpenAPI_qos_flow_usage_convertToJSON(sm_policy_update_context_data->qos_flow_usage);
if (qos_flow_usage_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qos_flow_usage]");
goto end;
}
cJSON_AddItemToObject(item, "qosFlowUsage", qos_flow_usage_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "qosFlowUsage", OpenAPI_qos_flow_usage_ToString(sm_policy_update_context_data->qos_flow_usage)) == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [qos_flow_usage]");
goto end;
}
}
if (sm_policy_update_context_data->credit_manage_status) {
cJSON *credit_manage_status_local_JSON = OpenAPI_credit_management_status_convertToJSON(sm_policy_update_context_data->credit_manage_status);
if (credit_manage_status_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [credit_manage_status]");
goto end;
}
cJSON_AddItemToObject(item, "creditManageStatus", credit_manage_status_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "creditManageStatus", OpenAPI_credit_management_status_ToString(sm_policy_update_context_data->credit_manage_status)) == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [credit_manage_status]");
goto end;
}
@ -637,13 +614,7 @@ cJSON *OpenAPI_sm_policy_update_context_data_convertToJSON(OpenAPI_sm_policy_upd
}
if (sm_policy_update_context_data->ma_pdu_ind) {
cJSON *ma_pdu_ind_local_JSON = OpenAPI_ma_pdu_indication_convertToJSON(sm_policy_update_context_data->ma_pdu_ind);
if (ma_pdu_ind_local_JSON == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [ma_pdu_ind]");
goto end;
}
cJSON_AddItemToObject(item, "maPduInd", ma_pdu_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "maPduInd", OpenAPI_ma_pdu_indication_ToString(sm_policy_update_context_data->ma_pdu_ind)) == NULL) {
ogs_error("OpenAPI_sm_policy_update_context_data_convertToJSON() failed [ma_pdu_ind]");
goto end;
}
@ -748,13 +719,12 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p
rep_policy_ctrl_req_triggersList = OpenAPI_list_create();
cJSON_ArrayForEach(rep_policy_ctrl_req_triggers_local_nonprimitive, rep_policy_ctrl_req_triggers ) {
if (!cJSON_IsObject(rep_policy_ctrl_req_triggers_local_nonprimitive)) {
if (!cJSON_IsString(rep_policy_ctrl_req_triggers_local_nonprimitive)) {
ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [rep_policy_ctrl_req_triggers]");
goto end;
}
OpenAPI_policy_control_request_trigger_t *rep_policy_ctrl_req_triggersItem = OpenAPI_policy_control_request_trigger_parseFromJSON(rep_policy_ctrl_req_triggers_local_nonprimitive);
OpenAPI_list_add(rep_policy_ctrl_req_triggersList, rep_policy_ctrl_req_triggersItem);
OpenAPI_list_add(rep_policy_ctrl_req_triggersList, (void *)OpenAPI_policy_control_request_trigger_FromString(rep_policy_ctrl_req_triggers_local_nonprimitive->valuestring));
}
}
@ -1150,16 +1120,24 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p
cJSON *qos_flow_usage = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "qosFlowUsage");
OpenAPI_qos_flow_usage_t *qos_flow_usage_local_nonprim = NULL;
OpenAPI_qos_flow_usage_e qos_flow_usageVariable;
if (qos_flow_usage) {
qos_flow_usage_local_nonprim = OpenAPI_qos_flow_usage_parseFromJSON(qos_flow_usage);
if (!cJSON_IsString(qos_flow_usage)) {
ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [qos_flow_usage]");
goto end;
}
qos_flow_usageVariable = OpenAPI_qos_flow_usage_FromString(qos_flow_usage->valuestring);
}
cJSON *credit_manage_status = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "creditManageStatus");
OpenAPI_credit_management_status_t *credit_manage_status_local_nonprim = NULL;
OpenAPI_credit_management_status_e credit_manage_statusVariable;
if (credit_manage_status) {
credit_manage_status_local_nonprim = OpenAPI_credit_management_status_parseFromJSON(credit_manage_status);
if (!cJSON_IsString(credit_manage_status)) {
ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [credit_manage_status]");
goto end;
}
credit_manage_statusVariable = OpenAPI_credit_management_status_FromString(credit_manage_status->valuestring);
}
cJSON *serv_nf_id = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "servNfId");
@ -1178,9 +1156,13 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p
cJSON *ma_pdu_ind = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "maPduInd");
OpenAPI_ma_pdu_indication_t *ma_pdu_ind_local_nonprim = NULL;
OpenAPI_ma_pdu_indication_e ma_pdu_indVariable;
if (ma_pdu_ind) {
ma_pdu_ind_local_nonprim = OpenAPI_ma_pdu_indication_parseFromJSON(ma_pdu_ind);
if (!cJSON_IsString(ma_pdu_ind)) {
ogs_error("OpenAPI_sm_policy_update_context_data_parseFromJSON() failed [ma_pdu_ind]");
goto end;
}
ma_pdu_indVariable = OpenAPI_ma_pdu_indication_FromString(ma_pdu_ind->valuestring);
}
cJSON *atsss_capab = cJSON_GetObjectItemCaseSensitive(sm_policy_update_context_dataJSON, "atsssCapab");
@ -1284,11 +1266,11 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_p
rep_pra_infos ? rep_pra_infosList : NULL,
ue_init_res_req ? ue_init_res_req_local_nonprim : NULL,
ref_qos_indication ? ref_qos_indication->valueint : 0,
qos_flow_usage ? qos_flow_usage_local_nonprim : NULL,
credit_manage_status ? credit_manage_status_local_nonprim : NULL,
qos_flow_usage ? qos_flow_usageVariable : 0,
credit_manage_status ? credit_manage_statusVariable : 0,
serv_nf_id ? serv_nf_id_local_nonprim : NULL,
trace_req ? trace_req_local_nonprim : NULL,
ma_pdu_ind ? ma_pdu_ind_local_nonprim : NULL,
ma_pdu_ind ? ma_pdu_indVariable : 0,
atsss_capab ? atsss_capab_local_nonprim : NULL,
tsn_bridge_info ? tsn_bridge_info_local_nonprim : NULL,
tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL,

View file

@ -78,11 +78,11 @@ typedef struct OpenAPI_sm_policy_update_context_data_s {
OpenAPI_list_t* rep_pra_infos;
struct OpenAPI_ue_initiated_resource_request_s *ue_init_res_req;
int ref_qos_indication;
struct OpenAPI_qos_flow_usage_s *qos_flow_usage;
struct OpenAPI_credit_management_status_s *credit_manage_status;
OpenAPI_qos_flow_usage_e qos_flow_usage;
OpenAPI_credit_management_status_e credit_manage_status;
struct OpenAPI_serving_nf_identity_s *serv_nf_id;
struct OpenAPI_trace_data_s *trace_req;
struct OpenAPI_ma_pdu_indication_s *ma_pdu_ind;
OpenAPI_ma_pdu_indication_e ma_pdu_ind;
struct OpenAPI_atsss_capability_s *atsss_capab;
struct OpenAPI_tsn_bridge_info_s *tsn_bridge_info;
struct OpenAPI_port_management_container_s *tsn_port_man_cont_dstt;
@ -124,11 +124,11 @@ OpenAPI_sm_policy_update_context_data_t *OpenAPI_sm_policy_update_context_data_c
OpenAPI_list_t* rep_pra_infos,
OpenAPI_ue_initiated_resource_request_t *ue_init_res_req,
int ref_qos_indication,
OpenAPI_qos_flow_usage_t *qos_flow_usage,
OpenAPI_credit_management_status_t *credit_manage_status,
OpenAPI_qos_flow_usage_e qos_flow_usage,
OpenAPI_credit_management_status_e credit_manage_status,
OpenAPI_serving_nf_identity_t *serv_nf_id,
OpenAPI_trace_data_t *trace_req,
OpenAPI_ma_pdu_indication_t *ma_pdu_ind,
OpenAPI_ma_pdu_indication_e ma_pdu_ind,
OpenAPI_atsss_capability_t *atsss_capab,
OpenAPI_tsn_bridge_info_t *tsn_bridge_info,
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt,

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "steer_mode_value.h"
OpenAPI_steer_mode_value_t *OpenAPI_steer_mode_value_create(
)
char* OpenAPI_steer_mode_value_ToString(OpenAPI_steer_mode_value_e steer_mode_value)
{
OpenAPI_steer_mode_value_t *steer_mode_value_local_var = OpenAPI_malloc(sizeof(OpenAPI_steer_mode_value_t));
if (!steer_mode_value_local_var) {
return NULL;
}
return steer_mode_value_local_var;
const char *steer_mode_valueArray[] = { "NULL", "ACTIVE_STANDBY", "LOAD_BALANCING", "SMALLEST_DELAY", "PRIORITY_BASED" };
size_t sizeofArray = sizeof(steer_mode_valueArray) / sizeof(steer_mode_valueArray[0]);
if (steer_mode_value < sizeofArray)
return (char *)steer_mode_valueArray[steer_mode_value];
else
return (char *)"Unknown";
}
void OpenAPI_steer_mode_value_free(OpenAPI_steer_mode_value_t *steer_mode_value)
OpenAPI_steer_mode_value_e OpenAPI_steer_mode_value_FromString(char* steer_mode_value)
{
if (NULL == steer_mode_value) {
return;
int stringToReturn = 0;
const char *steer_mode_valueArray[] = { "NULL", "ACTIVE_STANDBY", "LOAD_BALANCING", "SMALLEST_DELAY", "PRIORITY_BASED" };
size_t sizeofArray = sizeof(steer_mode_valueArray) / sizeof(steer_mode_valueArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(steer_mode_value, steer_mode_valueArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(steer_mode_value);
}
cJSON *OpenAPI_steer_mode_value_convertToJSON(OpenAPI_steer_mode_value_t *steer_mode_value)
{
cJSON *item = NULL;
if (steer_mode_value == NULL) {
ogs_error("OpenAPI_steer_mode_value_convertToJSON() failed [SteerModeValue]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_steer_mode_value_t *OpenAPI_steer_mode_value_parseFromJSON(cJSON *steer_mode_valueJSON)
{
OpenAPI_steer_mode_value_t *steer_mode_value_local_var = NULL;
steer_mode_value_local_var = OpenAPI_steer_mode_value_create (
);
return steer_mode_value_local_var;
end:
return NULL;
}
OpenAPI_steer_mode_value_t *OpenAPI_steer_mode_value_copy(OpenAPI_steer_mode_value_t *dst, OpenAPI_steer_mode_value_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_steer_mode_value_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_steer_mode_value_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_steer_mode_value_free(dst);
dst = OpenAPI_steer_mode_value_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_steer_mode_value_s OpenAPI_steer_mode_value_t;
typedef struct OpenAPI_steer_mode_value_s {
} OpenAPI_steer_mode_value_t;
typedef enum { OpenAPI_steer_mode_value_NULL = 0, OpenAPI_steer_mode_value_ACTIVE_STANDBY, OpenAPI_steer_mode_value_LOAD_BALANCING, OpenAPI_steer_mode_value_SMALLEST_DELAY, OpenAPI_steer_mode_value_PRIORITY_BASED } OpenAPI_steer_mode_value_e;
OpenAPI_steer_mode_value_t *OpenAPI_steer_mode_value_create(
);
void OpenAPI_steer_mode_value_free(OpenAPI_steer_mode_value_t *steer_mode_value);
OpenAPI_steer_mode_value_t *OpenAPI_steer_mode_value_parseFromJSON(cJSON *steer_mode_valueJSON);
cJSON *OpenAPI_steer_mode_value_convertToJSON(OpenAPI_steer_mode_value_t *steer_mode_value);
OpenAPI_steer_mode_value_t *OpenAPI_steer_mode_value_copy(OpenAPI_steer_mode_value_t *dst, OpenAPI_steer_mode_value_t *src);
char* OpenAPI_steer_mode_value_ToString(OpenAPI_steer_mode_value_e steer_mode_value);
OpenAPI_steer_mode_value_e OpenAPI_steer_mode_value_FromString(char* steer_mode_value);
#ifdef __cplusplus
}

View file

@ -4,82 +4,27 @@
#include <stdio.h>
#include "steering_functionality.h"
OpenAPI_steering_functionality_t *OpenAPI_steering_functionality_create(
)
char* OpenAPI_steering_functionality_ToString(OpenAPI_steering_functionality_e steering_functionality)
{
OpenAPI_steering_functionality_t *steering_functionality_local_var = OpenAPI_malloc(sizeof(OpenAPI_steering_functionality_t));
if (!steering_functionality_local_var) {
return NULL;
}
return steering_functionality_local_var;
const char *steering_functionalityArray[] = { "NULL", "MPTCP", "ATSSS_LL" };
size_t sizeofArray = sizeof(steering_functionalityArray) / sizeof(steering_functionalityArray[0]);
if (steering_functionality < sizeofArray)
return (char *)steering_functionalityArray[steering_functionality];
else
return (char *)"Unknown";
}
void OpenAPI_steering_functionality_free(OpenAPI_steering_functionality_t *steering_functionality)
OpenAPI_steering_functionality_e OpenAPI_steering_functionality_FromString(char* steering_functionality)
{
if (NULL == steering_functionality) {
return;
int stringToReturn = 0;
const char *steering_functionalityArray[] = { "NULL", "MPTCP", "ATSSS_LL" };
size_t sizeofArray = sizeof(steering_functionalityArray) / sizeof(steering_functionalityArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(steering_functionality, steering_functionalityArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(steering_functionality);
}
cJSON *OpenAPI_steering_functionality_convertToJSON(OpenAPI_steering_functionality_t *steering_functionality)
{
cJSON *item = NULL;
if (steering_functionality == NULL) {
ogs_error("OpenAPI_steering_functionality_convertToJSON() failed [SteeringFunctionality]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_steering_functionality_t *OpenAPI_steering_functionality_parseFromJSON(cJSON *steering_functionalityJSON)
{
OpenAPI_steering_functionality_t *steering_functionality_local_var = NULL;
steering_functionality_local_var = OpenAPI_steering_functionality_create (
);
return steering_functionality_local_var;
end:
return NULL;
}
OpenAPI_steering_functionality_t *OpenAPI_steering_functionality_copy(OpenAPI_steering_functionality_t *dst, OpenAPI_steering_functionality_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_steering_functionality_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_steering_functionality_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_steering_functionality_free(dst);
dst = OpenAPI_steering_functionality_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View file

@ -1,7 +1,7 @@
/*
* steering_functionality.h
*
* Possible values are - MPTCP: Indicates that PCF authorizes the MPTCP functionality to support traffic steering, switching and splitting. - ATSSS_LL: Indicates that PCF authorizes the ATSSS-LL functionality to support traffic steering, switching and splitting.
*
*/
#ifndef _OpenAPI_steering_functionality_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_steering_functionality_s OpenAPI_steering_functionality_t;
typedef struct OpenAPI_steering_functionality_s {
} OpenAPI_steering_functionality_t;
typedef enum { OpenAPI_steering_functionality_NULL = 0, OpenAPI_steering_functionality_MPTCP, OpenAPI_steering_functionality_ATSSS_LL } OpenAPI_steering_functionality_e;
OpenAPI_steering_functionality_t *OpenAPI_steering_functionality_create(
);
void OpenAPI_steering_functionality_free(OpenAPI_steering_functionality_t *steering_functionality);
OpenAPI_steering_functionality_t *OpenAPI_steering_functionality_parseFromJSON(cJSON *steering_functionalityJSON);
cJSON *OpenAPI_steering_functionality_convertToJSON(OpenAPI_steering_functionality_t *steering_functionality);
OpenAPI_steering_functionality_t *OpenAPI_steering_functionality_copy(OpenAPI_steering_functionality_t *dst, OpenAPI_steering_functionality_t *src);
char* OpenAPI_steering_functionality_ToString(OpenAPI_steering_functionality_e steering_functionality);
OpenAPI_steering_functionality_e OpenAPI_steering_functionality_FromString(char* steering_functionality);
#ifdef __cplusplus
}

View file

@ -5,7 +5,7 @@
#include "steering_mode.h"
OpenAPI_steering_mode_t *OpenAPI_steering_mode_create(
OpenAPI_steer_mode_value_t *steer_mode_value,
OpenAPI_steer_mode_value_e steer_mode_value,
OpenAPI_access_type_e active,
OpenAPI_access_type_e standby,
int _3g_load,
@ -31,7 +31,6 @@ void OpenAPI_steering_mode_free(OpenAPI_steering_mode_t *steering_mode)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_steer_mode_value_free(steering_mode->steer_mode_value);
ogs_free(steering_mode);
}
@ -49,13 +48,7 @@ cJSON *OpenAPI_steering_mode_convertToJSON(OpenAPI_steering_mode_t *steering_mod
ogs_error("OpenAPI_steering_mode_convertToJSON() failed [steer_mode_value]");
goto end;
}
cJSON *steer_mode_value_local_JSON = OpenAPI_steer_mode_value_convertToJSON(steering_mode->steer_mode_value);
if (steer_mode_value_local_JSON == NULL) {
ogs_error("OpenAPI_steering_mode_convertToJSON() failed [steer_mode_value]");
goto end;
}
cJSON_AddItemToObject(item, "steerModeValue", steer_mode_value_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "steerModeValue", OpenAPI_steer_mode_value_ToString(steering_mode->steer_mode_value)) == NULL) {
ogs_error("OpenAPI_steering_mode_convertToJSON() failed [steer_mode_value]");
goto end;
}
@ -101,9 +94,13 @@ OpenAPI_steering_mode_t *OpenAPI_steering_mode_parseFromJSON(cJSON *steering_mod
goto end;
}
OpenAPI_steer_mode_value_t *steer_mode_value_local_nonprim = NULL;
OpenAPI_steer_mode_value_e steer_mode_valueVariable;
steer_mode_value_local_nonprim = OpenAPI_steer_mode_value_parseFromJSON(steer_mode_value);
if (!cJSON_IsString(steer_mode_value)) {
ogs_error("OpenAPI_steering_mode_parseFromJSON() failed [steer_mode_value]");
goto end;
}
steer_mode_valueVariable = OpenAPI_steer_mode_value_FromString(steer_mode_value->valuestring);
cJSON *active = cJSON_GetObjectItemCaseSensitive(steering_modeJSON, "active");
@ -148,7 +145,7 @@ OpenAPI_steering_mode_t *OpenAPI_steering_mode_parseFromJSON(cJSON *steering_mod
}
steering_mode_local_var = OpenAPI_steering_mode_create (
steer_mode_value_local_nonprim,
steer_mode_valueVariable,
active ? activeVariable : 0,
standby ? standbyVariable : 0,
_3g_load ? _3g_load->valuedouble : 0,

View file

@ -21,7 +21,7 @@ extern "C" {
typedef struct OpenAPI_steering_mode_s OpenAPI_steering_mode_t;
typedef struct OpenAPI_steering_mode_s {
struct OpenAPI_steer_mode_value_s *steer_mode_value;
OpenAPI_steer_mode_value_e steer_mode_value;
OpenAPI_access_type_e active;
OpenAPI_access_type_e standby;
int _3g_load;
@ -29,7 +29,7 @@ typedef struct OpenAPI_steering_mode_s {
} OpenAPI_steering_mode_t;
OpenAPI_steering_mode_t *OpenAPI_steering_mode_create(
OpenAPI_steer_mode_value_t *steer_mode_value,
OpenAPI_steer_mode_value_e steer_mode_value,
OpenAPI_access_type_e active,
OpenAPI_access_type_e standby,
int _3g_load,

View file

@ -6,7 +6,7 @@
OpenAPI_termination_notification_t *OpenAPI_termination_notification_create(
char *resource_uri,
OpenAPI_sm_policy_association_release_cause_t *cause
OpenAPI_sm_policy_association_release_cause_e cause
)
{
OpenAPI_termination_notification_t *termination_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_termination_notification_t));
@ -26,7 +26,6 @@ void OpenAPI_termination_notification_free(OpenAPI_termination_notification_t *t
}
OpenAPI_lnode_t *node;
ogs_free(termination_notification->resource_uri);
OpenAPI_sm_policy_association_release_cause_free(termination_notification->cause);
ogs_free(termination_notification);
}
@ -53,13 +52,7 @@ cJSON *OpenAPI_termination_notification_convertToJSON(OpenAPI_termination_notifi
ogs_error("OpenAPI_termination_notification_convertToJSON() failed [cause]");
goto end;
}
cJSON *cause_local_JSON = OpenAPI_sm_policy_association_release_cause_convertToJSON(termination_notification->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_termination_notification_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_sm_policy_association_release_cause_ToString(termination_notification->cause)) == NULL) {
ogs_error("OpenAPI_termination_notification_convertToJSON() failed [cause]");
goto end;
}
@ -89,13 +82,17 @@ OpenAPI_termination_notification_t *OpenAPI_termination_notification_parseFromJS
goto end;
}
OpenAPI_sm_policy_association_release_cause_t *cause_local_nonprim = NULL;
OpenAPI_sm_policy_association_release_cause_e causeVariable;
cause_local_nonprim = OpenAPI_sm_policy_association_release_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_termination_notification_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_sm_policy_association_release_cause_FromString(cause->valuestring);
termination_notification_local_var = OpenAPI_termination_notification_create (
ogs_strdup(resource_uri->valuestring),
cause_local_nonprim
causeVariable
);
return termination_notification_local_var;

View file

@ -21,12 +21,12 @@ extern "C" {
typedef struct OpenAPI_termination_notification_s OpenAPI_termination_notification_t;
typedef struct OpenAPI_termination_notification_s {
char *resource_uri;
struct OpenAPI_sm_policy_association_release_cause_s *cause;
OpenAPI_sm_policy_association_release_cause_e cause;
} OpenAPI_termination_notification_t;
OpenAPI_termination_notification_t *OpenAPI_termination_notification_create(
char *resource_uri,
OpenAPI_sm_policy_association_release_cause_t *cause
OpenAPI_sm_policy_association_release_cause_e cause
);
void OpenAPI_termination_notification_free(OpenAPI_termination_notification_t *termination_notification);
OpenAPI_termination_notification_t *OpenAPI_termination_notification_parseFromJSON(cJSON *termination_notificationJSON);

View file

@ -15,7 +15,7 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_create(
OpenAPI_list_t *route_to_locs,
int traff_corre_ind,
OpenAPI_up_path_chg_event_t *up_path_chg_event,
OpenAPI_steering_functionality_t *steer_fun,
OpenAPI_steering_functionality_e steer_fun,
OpenAPI_steering_mode_t *steer_mode_dl,
OpenAPI_steering_mode_t *steer_mode_ul,
OpenAPI_multicast_access_control_t *mul_acc_ctrl
@ -63,7 +63,6 @@ void OpenAPI_traffic_control_data_free(OpenAPI_traffic_control_data_t *traffic_c
}
OpenAPI_list_free(traffic_control_data->route_to_locs);
OpenAPI_up_path_chg_event_free(traffic_control_data->up_path_chg_event);
OpenAPI_steering_functionality_free(traffic_control_data->steer_fun);
OpenAPI_steering_mode_free(traffic_control_data->steer_mode_dl);
OpenAPI_steering_mode_free(traffic_control_data->steer_mode_ul);
OpenAPI_multicast_access_control_free(traffic_control_data->mul_acc_ctrl);
@ -197,13 +196,7 @@ cJSON *OpenAPI_traffic_control_data_convertToJSON(OpenAPI_traffic_control_data_t
}
if (traffic_control_data->steer_fun) {
cJSON *steer_fun_local_JSON = OpenAPI_steering_functionality_convertToJSON(traffic_control_data->steer_fun);
if (steer_fun_local_JSON == NULL) {
ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [steer_fun]");
goto end;
}
cJSON_AddItemToObject(item, "steerFun", steer_fun_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "steerFun", OpenAPI_steering_functionality_ToString(traffic_control_data->steer_fun)) == NULL) {
ogs_error("OpenAPI_traffic_control_data_convertToJSON() failed [steer_fun]");
goto end;
}
@ -372,9 +365,13 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON
cJSON *steer_fun = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerFun");
OpenAPI_steering_functionality_t *steer_fun_local_nonprim = NULL;
OpenAPI_steering_functionality_e steer_funVariable;
if (steer_fun) {
steer_fun_local_nonprim = OpenAPI_steering_functionality_parseFromJSON(steer_fun);
if (!cJSON_IsString(steer_fun)) {
ogs_error("OpenAPI_traffic_control_data_parseFromJSON() failed [steer_fun]");
goto end;
}
steer_funVariable = OpenAPI_steering_functionality_FromString(steer_fun->valuestring);
}
cJSON *steer_mode_dl = cJSON_GetObjectItemCaseSensitive(traffic_control_dataJSON, "steerModeDl");
@ -409,7 +406,7 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_parseFromJSON(cJSON
route_to_locs ? route_to_locsList : NULL,
traff_corre_ind ? traff_corre_ind->valueint : 0,
up_path_chg_event ? up_path_chg_event_local_nonprim : NULL,
steer_fun ? steer_fun_local_nonprim : NULL,
steer_fun ? steer_funVariable : 0,
steer_mode_dl ? steer_mode_dl_local_nonprim : NULL,
steer_mode_ul ? steer_mode_ul_local_nonprim : NULL,
mul_acc_ctrl ? mul_acc_ctrl_local_nonprim : NULL

View file

@ -36,7 +36,7 @@ typedef struct OpenAPI_traffic_control_data_s {
OpenAPI_list_t *route_to_locs;
int traff_corre_ind;
struct OpenAPI_up_path_chg_event_s *up_path_chg_event;
struct OpenAPI_steering_functionality_s *steer_fun;
OpenAPI_steering_functionality_e steer_fun;
struct OpenAPI_steering_mode_s *steer_mode_dl;
struct OpenAPI_steering_mode_s *steer_mode_ul;
struct OpenAPI_multicast_access_control_s *mul_acc_ctrl;
@ -53,7 +53,7 @@ OpenAPI_traffic_control_data_t *OpenAPI_traffic_control_data_create(
OpenAPI_list_t *route_to_locs,
int traff_corre_ind,
OpenAPI_up_path_chg_event_t *up_path_chg_event,
OpenAPI_steering_functionality_t *steer_fun,
OpenAPI_steering_functionality_e steer_fun,
OpenAPI_steering_mode_t *steer_mode_dl,
OpenAPI_steering_mode_t *steer_mode_ul,
OpenAPI_multicast_access_control_t *mul_acc_ctrl

View file

@ -6,7 +6,7 @@
OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_create(
char *pcc_rule_id,
OpenAPI_rule_operation_t *rule_op,
OpenAPI_rule_operation_e rule_op,
int precedence,
OpenAPI_list_t *pack_filt_info,
OpenAPI_requested_qos_t *req_qos
@ -32,7 +32,6 @@ void OpenAPI_ue_initiated_resource_request_free(OpenAPI_ue_initiated_resource_re
}
OpenAPI_lnode_t *node;
ogs_free(ue_initiated_resource_request->pcc_rule_id);
OpenAPI_rule_operation_free(ue_initiated_resource_request->rule_op);
OpenAPI_list_for_each(ue_initiated_resource_request->pack_filt_info, node) {
OpenAPI_packet_filter_info_free(node->data);
}
@ -62,13 +61,7 @@ cJSON *OpenAPI_ue_initiated_resource_request_convertToJSON(OpenAPI_ue_initiated_
ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [rule_op]");
goto end;
}
cJSON *rule_op_local_JSON = OpenAPI_rule_operation_convertToJSON(ue_initiated_resource_request->rule_op);
if (rule_op_local_JSON == NULL) {
ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [rule_op]");
goto end;
}
cJSON_AddItemToObject(item, "ruleOp", rule_op_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "ruleOp", OpenAPI_rule_operation_ToString(ue_initiated_resource_request->rule_op)) == NULL) {
ogs_error("OpenAPI_ue_initiated_resource_request_convertToJSON() failed [rule_op]");
goto end;
}
@ -137,9 +130,13 @@ OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_p
goto end;
}
OpenAPI_rule_operation_t *rule_op_local_nonprim = NULL;
OpenAPI_rule_operation_e rule_opVariable;
rule_op_local_nonprim = OpenAPI_rule_operation_parseFromJSON(rule_op);
if (!cJSON_IsString(rule_op)) {
ogs_error("OpenAPI_ue_initiated_resource_request_parseFromJSON() failed [rule_op]");
goto end;
}
rule_opVariable = OpenAPI_rule_operation_FromString(rule_op->valuestring);
cJSON *precedence = cJSON_GetObjectItemCaseSensitive(ue_initiated_resource_requestJSON, "precedence");
@ -185,7 +182,7 @@ OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_p
ue_initiated_resource_request_local_var = OpenAPI_ue_initiated_resource_request_create (
pcc_rule_id ? ogs_strdup(pcc_rule_id->valuestring) : NULL,
rule_op_local_nonprim,
rule_opVariable,
precedence ? precedence->valuedouble : 0,
pack_filt_infoList,
req_qos ? req_qos_local_nonprim : NULL

View file

@ -23,7 +23,7 @@ extern "C" {
typedef struct OpenAPI_ue_initiated_resource_request_s OpenAPI_ue_initiated_resource_request_t;
typedef struct OpenAPI_ue_initiated_resource_request_s {
char *pcc_rule_id;
struct OpenAPI_rule_operation_s *rule_op;
OpenAPI_rule_operation_e rule_op;
int precedence;
OpenAPI_list_t *pack_filt_info;
struct OpenAPI_requested_qos_s *req_qos;
@ -31,7 +31,7 @@ typedef struct OpenAPI_ue_initiated_resource_request_s {
OpenAPI_ue_initiated_resource_request_t *OpenAPI_ue_initiated_resource_request_create(
char *pcc_rule_id,
OpenAPI_rule_operation_t *rule_op,
OpenAPI_rule_operation_e rule_op,
int precedence,
OpenAPI_list_t *pack_filt_info,
OpenAPI_requested_qos_t *req_qos