forked from acouzens/open5gs
[Release-17] Upgrade SBI to v17.x.0
This commit is contained in:
parent
969c116e77
commit
4d44b1843e
|
@ -653,7 +653,7 @@ static OpenAPI_smf_info_t *build_smf_info(ogs_sbi_nf_info_t *nf_info)
|
|||
|
||||
OpenAPI_list_t *sNssaiSmfInfoList = NULL;
|
||||
OpenAPI_snssai_smf_info_item_t *sNssaiSmfInfoItem = NULL;
|
||||
OpenAPI_snssai_t *sNssai = NULL;
|
||||
OpenAPI_ext_snssai_t *sNssai = NULL;
|
||||
OpenAPI_list_t *DnnSmfInfoList = NULL;
|
||||
OpenAPI_dnn_smf_info_item_t *DnnSmfInfoItem = NULL;
|
||||
|
||||
|
@ -1045,7 +1045,7 @@ static void free_smf_info(OpenAPI_smf_info_t *SmfInfo)
|
|||
{
|
||||
OpenAPI_list_t *sNssaiSmfInfoList = NULL;
|
||||
OpenAPI_snssai_smf_info_item_t *sNssaiSmfInfoItem = NULL;
|
||||
OpenAPI_snssai_t *sNssai = NULL;
|
||||
OpenAPI_ext_snssai_t *sNssai = NULL;
|
||||
OpenAPI_list_t *DnnSmfInfoList = NULL;
|
||||
OpenAPI_dnn_smf_info_item_t *DnnSmfInfoItem = NULL;
|
||||
|
||||
|
@ -1309,7 +1309,7 @@ ogs_sbi_request_t *ogs_nnrf_nfm_build_status_subscribe(
|
|||
ogs_sbi_server_t *server = NULL;
|
||||
|
||||
OpenAPI_subscription_data_t *SubscriptionData = NULL;
|
||||
OpenAPI_subscription_data_subscr_cond_t SubscrCond;
|
||||
OpenAPI_subscr_cond_t SubscrCond;
|
||||
|
||||
ogs_assert(subscription_data);
|
||||
ogs_assert(subscription_data->req_nf_type);
|
||||
|
|
|
@ -332,7 +332,7 @@ static void handle_smf_info(
|
|||
|
||||
OpenAPI_list_t *sNssaiSmfInfoList = NULL;
|
||||
OpenAPI_snssai_smf_info_item_t *sNssaiSmfInfoItem = NULL;
|
||||
OpenAPI_snssai_t *sNssai = NULL;
|
||||
OpenAPI_ext_snssai_t *sNssai = NULL;
|
||||
OpenAPI_list_t *DnnSmfInfoList = NULL;
|
||||
OpenAPI_dnn_smf_info_item_t *DnnSmfInfoItem = NULL;
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,141 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "aanf_info.h"
|
||||
|
||||
OpenAPI_aanf_info_t *OpenAPI_aanf_info_create(
|
||||
OpenAPI_list_t *routing_indicators
|
||||
)
|
||||
{
|
||||
OpenAPI_aanf_info_t *aanf_info_local_var = ogs_malloc(sizeof(OpenAPI_aanf_info_t));
|
||||
ogs_assert(aanf_info_local_var);
|
||||
|
||||
aanf_info_local_var->routing_indicators = routing_indicators;
|
||||
|
||||
return aanf_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_aanf_info_free(OpenAPI_aanf_info_t *aanf_info)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == aanf_info) {
|
||||
return;
|
||||
}
|
||||
if (aanf_info->routing_indicators) {
|
||||
OpenAPI_list_for_each(aanf_info->routing_indicators, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(aanf_info->routing_indicators);
|
||||
aanf_info->routing_indicators = NULL;
|
||||
}
|
||||
ogs_free(aanf_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_aanf_info_convertToJSON(OpenAPI_aanf_info_t *aanf_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (aanf_info == NULL) {
|
||||
ogs_error("OpenAPI_aanf_info_convertToJSON() failed [AanfInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (aanf_info->routing_indicators) {
|
||||
cJSON *routing_indicatorsList = cJSON_AddArrayToObject(item, "routingIndicators");
|
||||
if (routing_indicatorsList == NULL) {
|
||||
ogs_error("OpenAPI_aanf_info_convertToJSON() failed [routing_indicators]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(aanf_info->routing_indicators, node) {
|
||||
if (cJSON_AddStringToObject(routing_indicatorsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_aanf_info_convertToJSON() failed [routing_indicators]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_aanf_info_t *OpenAPI_aanf_info_parseFromJSON(cJSON *aanf_infoJSON)
|
||||
{
|
||||
OpenAPI_aanf_info_t *aanf_info_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *routing_indicators = NULL;
|
||||
OpenAPI_list_t *routing_indicatorsList = NULL;
|
||||
routing_indicators = cJSON_GetObjectItemCaseSensitive(aanf_infoJSON, "routingIndicators");
|
||||
if (routing_indicators) {
|
||||
cJSON *routing_indicators_local = NULL;
|
||||
if (!cJSON_IsArray(routing_indicators)) {
|
||||
ogs_error("OpenAPI_aanf_info_parseFromJSON() failed [routing_indicators]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
routing_indicatorsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(routing_indicators_local, routing_indicators) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(routing_indicators_local)) {
|
||||
ogs_error("OpenAPI_aanf_info_parseFromJSON() failed [routing_indicators]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(routing_indicatorsList, ogs_strdup(routing_indicators_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
aanf_info_local_var = OpenAPI_aanf_info_create (
|
||||
routing_indicators ? routing_indicatorsList : NULL
|
||||
);
|
||||
|
||||
return aanf_info_local_var;
|
||||
end:
|
||||
if (routing_indicatorsList) {
|
||||
OpenAPI_list_for_each(routing_indicatorsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(routing_indicatorsList);
|
||||
routing_indicatorsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_aanf_info_t *OpenAPI_aanf_info_copy(OpenAPI_aanf_info_t *dst, OpenAPI_aanf_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_aanf_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_aanf_info_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_aanf_info_free(dst);
|
||||
dst = OpenAPI_aanf_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* aanf_info.h
|
||||
*
|
||||
* Represents the information relative to an AAnF NF Instance.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_aanf_info_H_
|
||||
#define _OpenAPI_aanf_info_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_aanf_info_s OpenAPI_aanf_info_t;
|
||||
typedef struct OpenAPI_aanf_info_s {
|
||||
OpenAPI_list_t *routing_indicators;
|
||||
} OpenAPI_aanf_info_t;
|
||||
|
||||
OpenAPI_aanf_info_t *OpenAPI_aanf_info_create(
|
||||
OpenAPI_list_t *routing_indicators
|
||||
);
|
||||
void OpenAPI_aanf_info_free(OpenAPI_aanf_info_t *aanf_info);
|
||||
OpenAPI_aanf_info_t *OpenAPI_aanf_info_parseFromJSON(cJSON *aanf_infoJSON);
|
||||
cJSON *OpenAPI_aanf_info_convertToJSON(OpenAPI_aanf_info_t *aanf_info);
|
||||
OpenAPI_aanf_info_t *OpenAPI_aanf_info_copy(OpenAPI_aanf_info_t *dst, OpenAPI_aanf_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_aanf_info_H_ */
|
||||
|
|
@ -0,0 +1,305 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "abnormal_behaviour.h"
|
||||
|
||||
OpenAPI_abnormal_behaviour_t *OpenAPI_abnormal_behaviour_create(
|
||||
OpenAPI_list_t *supis,
|
||||
OpenAPI_exception_t *excep,
|
||||
char *dnn,
|
||||
OpenAPI_snssai_t *snssai,
|
||||
bool is_ratio,
|
||||
int ratio,
|
||||
bool is_confidence,
|
||||
int confidence,
|
||||
OpenAPI_additional_measurement_t *addt_meas_info
|
||||
)
|
||||
{
|
||||
OpenAPI_abnormal_behaviour_t *abnormal_behaviour_local_var = ogs_malloc(sizeof(OpenAPI_abnormal_behaviour_t));
|
||||
ogs_assert(abnormal_behaviour_local_var);
|
||||
|
||||
abnormal_behaviour_local_var->supis = supis;
|
||||
abnormal_behaviour_local_var->excep = excep;
|
||||
abnormal_behaviour_local_var->dnn = dnn;
|
||||
abnormal_behaviour_local_var->snssai = snssai;
|
||||
abnormal_behaviour_local_var->is_ratio = is_ratio;
|
||||
abnormal_behaviour_local_var->ratio = ratio;
|
||||
abnormal_behaviour_local_var->is_confidence = is_confidence;
|
||||
abnormal_behaviour_local_var->confidence = confidence;
|
||||
abnormal_behaviour_local_var->addt_meas_info = addt_meas_info;
|
||||
|
||||
return abnormal_behaviour_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_abnormal_behaviour_free(OpenAPI_abnormal_behaviour_t *abnormal_behaviour)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == abnormal_behaviour) {
|
||||
return;
|
||||
}
|
||||
if (abnormal_behaviour->supis) {
|
||||
OpenAPI_list_for_each(abnormal_behaviour->supis, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(abnormal_behaviour->supis);
|
||||
abnormal_behaviour->supis = NULL;
|
||||
}
|
||||
if (abnormal_behaviour->excep) {
|
||||
OpenAPI_exception_free(abnormal_behaviour->excep);
|
||||
abnormal_behaviour->excep = NULL;
|
||||
}
|
||||
if (abnormal_behaviour->dnn) {
|
||||
ogs_free(abnormal_behaviour->dnn);
|
||||
abnormal_behaviour->dnn = NULL;
|
||||
}
|
||||
if (abnormal_behaviour->snssai) {
|
||||
OpenAPI_snssai_free(abnormal_behaviour->snssai);
|
||||
abnormal_behaviour->snssai = NULL;
|
||||
}
|
||||
if (abnormal_behaviour->addt_meas_info) {
|
||||
OpenAPI_additional_measurement_free(abnormal_behaviour->addt_meas_info);
|
||||
abnormal_behaviour->addt_meas_info = NULL;
|
||||
}
|
||||
ogs_free(abnormal_behaviour);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_abnormal_behaviour_convertToJSON(OpenAPI_abnormal_behaviour_t *abnormal_behaviour)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (abnormal_behaviour == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [AbnormalBehaviour]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (abnormal_behaviour->supis) {
|
||||
cJSON *supisList = cJSON_AddArrayToObject(item, "supis");
|
||||
if (supisList == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [supis]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(abnormal_behaviour->supis, node) {
|
||||
if (cJSON_AddStringToObject(supisList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [supis]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!abnormal_behaviour->excep) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [excep]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *excep_local_JSON = OpenAPI_exception_convertToJSON(abnormal_behaviour->excep);
|
||||
if (excep_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [excep]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "excep", excep_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [excep]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (abnormal_behaviour->dnn) {
|
||||
if (cJSON_AddStringToObject(item, "dnn", abnormal_behaviour->dnn) == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [dnn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (abnormal_behaviour->snssai) {
|
||||
cJSON *snssai_local_JSON = OpenAPI_snssai_convertToJSON(abnormal_behaviour->snssai);
|
||||
if (snssai_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [snssai]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "snssai", snssai_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [snssai]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (abnormal_behaviour->is_ratio) {
|
||||
if (cJSON_AddNumberToObject(item, "ratio", abnormal_behaviour->ratio) == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [ratio]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (abnormal_behaviour->is_confidence) {
|
||||
if (cJSON_AddNumberToObject(item, "confidence", abnormal_behaviour->confidence) == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [confidence]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (abnormal_behaviour->addt_meas_info) {
|
||||
cJSON *addt_meas_info_local_JSON = OpenAPI_additional_measurement_convertToJSON(abnormal_behaviour->addt_meas_info);
|
||||
if (addt_meas_info_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [addt_meas_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "addtMeasInfo", addt_meas_info_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_convertToJSON() failed [addt_meas_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_abnormal_behaviour_t *OpenAPI_abnormal_behaviour_parseFromJSON(cJSON *abnormal_behaviourJSON)
|
||||
{
|
||||
OpenAPI_abnormal_behaviour_t *abnormal_behaviour_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *supis = NULL;
|
||||
OpenAPI_list_t *supisList = NULL;
|
||||
cJSON *excep = NULL;
|
||||
OpenAPI_exception_t *excep_local_nonprim = NULL;
|
||||
cJSON *dnn = NULL;
|
||||
cJSON *snssai = NULL;
|
||||
OpenAPI_snssai_t *snssai_local_nonprim = NULL;
|
||||
cJSON *ratio = NULL;
|
||||
cJSON *confidence = NULL;
|
||||
cJSON *addt_meas_info = NULL;
|
||||
OpenAPI_additional_measurement_t *addt_meas_info_local_nonprim = NULL;
|
||||
supis = cJSON_GetObjectItemCaseSensitive(abnormal_behaviourJSON, "supis");
|
||||
if (supis) {
|
||||
cJSON *supis_local = NULL;
|
||||
if (!cJSON_IsArray(supis)) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_parseFromJSON() failed [supis]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
supisList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(supis_local, supis) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(supis_local)) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_parseFromJSON() failed [supis]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(supisList, ogs_strdup(supis_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
excep = cJSON_GetObjectItemCaseSensitive(abnormal_behaviourJSON, "excep");
|
||||
if (!excep) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_parseFromJSON() failed [excep]");
|
||||
goto end;
|
||||
}
|
||||
excep_local_nonprim = OpenAPI_exception_parseFromJSON(excep);
|
||||
|
||||
dnn = cJSON_GetObjectItemCaseSensitive(abnormal_behaviourJSON, "dnn");
|
||||
if (dnn) {
|
||||
if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_parseFromJSON() failed [dnn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
snssai = cJSON_GetObjectItemCaseSensitive(abnormal_behaviourJSON, "snssai");
|
||||
if (snssai) {
|
||||
snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(snssai);
|
||||
}
|
||||
|
||||
ratio = cJSON_GetObjectItemCaseSensitive(abnormal_behaviourJSON, "ratio");
|
||||
if (ratio) {
|
||||
if (!cJSON_IsNumber(ratio)) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_parseFromJSON() failed [ratio]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
confidence = cJSON_GetObjectItemCaseSensitive(abnormal_behaviourJSON, "confidence");
|
||||
if (confidence) {
|
||||
if (!cJSON_IsNumber(confidence)) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_parseFromJSON() failed [confidence]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
addt_meas_info = cJSON_GetObjectItemCaseSensitive(abnormal_behaviourJSON, "addtMeasInfo");
|
||||
if (addt_meas_info) {
|
||||
addt_meas_info_local_nonprim = OpenAPI_additional_measurement_parseFromJSON(addt_meas_info);
|
||||
}
|
||||
|
||||
abnormal_behaviour_local_var = OpenAPI_abnormal_behaviour_create (
|
||||
supis ? supisList : NULL,
|
||||
excep_local_nonprim,
|
||||
dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL,
|
||||
snssai ? snssai_local_nonprim : NULL,
|
||||
ratio ? true : false,
|
||||
ratio ? ratio->valuedouble : 0,
|
||||
confidence ? true : false,
|
||||
confidence ? confidence->valuedouble : 0,
|
||||
addt_meas_info ? addt_meas_info_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return abnormal_behaviour_local_var;
|
||||
end:
|
||||
if (supisList) {
|
||||
OpenAPI_list_for_each(supisList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(supisList);
|
||||
supisList = NULL;
|
||||
}
|
||||
if (excep_local_nonprim) {
|
||||
OpenAPI_exception_free(excep_local_nonprim);
|
||||
excep_local_nonprim = NULL;
|
||||
}
|
||||
if (snssai_local_nonprim) {
|
||||
OpenAPI_snssai_free(snssai_local_nonprim);
|
||||
snssai_local_nonprim = NULL;
|
||||
}
|
||||
if (addt_meas_info_local_nonprim) {
|
||||
OpenAPI_additional_measurement_free(addt_meas_info_local_nonprim);
|
||||
addt_meas_info_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_abnormal_behaviour_t *OpenAPI_abnormal_behaviour_copy(OpenAPI_abnormal_behaviour_t *dst, OpenAPI_abnormal_behaviour_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_abnormal_behaviour_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_abnormal_behaviour_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_abnormal_behaviour_free(dst);
|
||||
dst = OpenAPI_abnormal_behaviour_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* abnormal_behaviour.h
|
||||
*
|
||||
* Represents the abnormal behaviour information.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_abnormal_behaviour_H_
|
||||
#define _OpenAPI_abnormal_behaviour_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "additional_measurement.h"
|
||||
#include "exception.h"
|
||||
#include "snssai.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_abnormal_behaviour_s OpenAPI_abnormal_behaviour_t;
|
||||
typedef struct OpenAPI_abnormal_behaviour_s {
|
||||
OpenAPI_list_t *supis;
|
||||
struct OpenAPI_exception_s *excep;
|
||||
char *dnn;
|
||||
struct OpenAPI_snssai_s *snssai;
|
||||
bool is_ratio;
|
||||
int ratio;
|
||||
bool is_confidence;
|
||||
int confidence;
|
||||
struct OpenAPI_additional_measurement_s *addt_meas_info;
|
||||
} OpenAPI_abnormal_behaviour_t;
|
||||
|
||||
OpenAPI_abnormal_behaviour_t *OpenAPI_abnormal_behaviour_create(
|
||||
OpenAPI_list_t *supis,
|
||||
OpenAPI_exception_t *excep,
|
||||
char *dnn,
|
||||
OpenAPI_snssai_t *snssai,
|
||||
bool is_ratio,
|
||||
int ratio,
|
||||
bool is_confidence,
|
||||
int confidence,
|
||||
OpenAPI_additional_measurement_t *addt_meas_info
|
||||
);
|
||||
void OpenAPI_abnormal_behaviour_free(OpenAPI_abnormal_behaviour_t *abnormal_behaviour);
|
||||
OpenAPI_abnormal_behaviour_t *OpenAPI_abnormal_behaviour_parseFromJSON(cJSON *abnormal_behaviourJSON);
|
||||
cJSON *OpenAPI_abnormal_behaviour_convertToJSON(OpenAPI_abnormal_behaviour_t *abnormal_behaviour);
|
||||
OpenAPI_abnormal_behaviour_t *OpenAPI_abnormal_behaviour_copy(OpenAPI_abnormal_behaviour_t *dst, OpenAPI_abnormal_behaviour_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_abnormal_behaviour_H_ */
|
||||
|
|
@ -5,7 +5,9 @@
|
|||
#include "acc_net_ch_id.h"
|
||||
|
||||
OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_create(
|
||||
bool is_acc_net_cha_id_value,
|
||||
int acc_net_cha_id_value,
|
||||
char *acc_net_charg_id,
|
||||
OpenAPI_list_t *ref_pcc_rule_ids,
|
||||
bool is_session_ch_scope,
|
||||
int session_ch_scope
|
||||
|
@ -14,7 +16,9 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_create(
|
|||
OpenAPI_acc_net_ch_id_t *acc_net_ch_id_local_var = ogs_malloc(sizeof(OpenAPI_acc_net_ch_id_t));
|
||||
ogs_assert(acc_net_ch_id_local_var);
|
||||
|
||||
acc_net_ch_id_local_var->is_acc_net_cha_id_value = is_acc_net_cha_id_value;
|
||||
acc_net_ch_id_local_var->acc_net_cha_id_value = acc_net_cha_id_value;
|
||||
acc_net_ch_id_local_var->acc_net_charg_id = acc_net_charg_id;
|
||||
acc_net_ch_id_local_var->ref_pcc_rule_ids = ref_pcc_rule_ids;
|
||||
acc_net_ch_id_local_var->is_session_ch_scope = is_session_ch_scope;
|
||||
acc_net_ch_id_local_var->session_ch_scope = session_ch_scope;
|
||||
|
@ -29,6 +33,10 @@ void OpenAPI_acc_net_ch_id_free(OpenAPI_acc_net_ch_id_t *acc_net_ch_id)
|
|||
if (NULL == acc_net_ch_id) {
|
||||
return;
|
||||
}
|
||||
if (acc_net_ch_id->acc_net_charg_id) {
|
||||
ogs_free(acc_net_ch_id->acc_net_charg_id);
|
||||
acc_net_ch_id->acc_net_charg_id = NULL;
|
||||
}
|
||||
if (acc_net_ch_id->ref_pcc_rule_ids) {
|
||||
OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, node) {
|
||||
ogs_free(node->data);
|
||||
|
@ -50,10 +58,19 @@ cJSON *OpenAPI_acc_net_ch_id_convertToJSON(OpenAPI_acc_net_ch_id_t *acc_net_ch_i
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (acc_net_ch_id->is_acc_net_cha_id_value) {
|
||||
if (cJSON_AddNumberToObject(item, "accNetChaIdValue", acc_net_ch_id->acc_net_cha_id_value) == NULL) {
|
||||
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [acc_net_cha_id_value]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (acc_net_ch_id->acc_net_charg_id) {
|
||||
if (cJSON_AddStringToObject(item, "accNetChargId", acc_net_ch_id->acc_net_charg_id) == NULL) {
|
||||
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [acc_net_charg_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (acc_net_ch_id->ref_pcc_rule_ids) {
|
||||
cJSON *ref_pcc_rule_idsList = cJSON_AddArrayToObject(item, "refPccRuleIds");
|
||||
|
@ -85,18 +102,25 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_i
|
|||
OpenAPI_acc_net_ch_id_t *acc_net_ch_id_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *acc_net_cha_id_value = NULL;
|
||||
cJSON *acc_net_charg_id = NULL;
|
||||
cJSON *ref_pcc_rule_ids = NULL;
|
||||
OpenAPI_list_t *ref_pcc_rule_idsList = NULL;
|
||||
cJSON *session_ch_scope = NULL;
|
||||
acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "accNetChaIdValue");
|
||||
if (!acc_net_cha_id_value) {
|
||||
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [acc_net_cha_id_value]");
|
||||
goto end;
|
||||
}
|
||||
if (acc_net_cha_id_value) {
|
||||
if (!cJSON_IsNumber(acc_net_cha_id_value)) {
|
||||
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [acc_net_cha_id_value]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
acc_net_charg_id = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "accNetChargId");
|
||||
if (acc_net_charg_id) {
|
||||
if (!cJSON_IsString(acc_net_charg_id) && !cJSON_IsNull(acc_net_charg_id)) {
|
||||
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [acc_net_charg_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "refPccRuleIds");
|
||||
if (ref_pcc_rule_ids) {
|
||||
|
@ -128,8 +152,9 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_i
|
|||
}
|
||||
|
||||
acc_net_ch_id_local_var = OpenAPI_acc_net_ch_id_create (
|
||||
|
||||
acc_net_cha_id_value->valuedouble,
|
||||
acc_net_cha_id_value ? true : false,
|
||||
acc_net_cha_id_value ? acc_net_cha_id_value->valuedouble : 0,
|
||||
acc_net_charg_id && !cJSON_IsNull(acc_net_charg_id) ? ogs_strdup(acc_net_charg_id->valuestring) : NULL,
|
||||
ref_pcc_rule_ids ? ref_pcc_rule_idsList : NULL,
|
||||
session_ch_scope ? true : false,
|
||||
session_ch_scope ? session_ch_scope->valueint : 0
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* acc_net_ch_id.h
|
||||
*
|
||||
*
|
||||
* Contains the access network charging identifier for the PCC rule(s) or for the whole PDU session.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_acc_net_ch_id_H_
|
||||
|
@ -19,14 +19,18 @@ extern "C" {
|
|||
|
||||
typedef struct OpenAPI_acc_net_ch_id_s OpenAPI_acc_net_ch_id_t;
|
||||
typedef struct OpenAPI_acc_net_ch_id_s {
|
||||
bool is_acc_net_cha_id_value;
|
||||
int acc_net_cha_id_value;
|
||||
char *acc_net_charg_id;
|
||||
OpenAPI_list_t *ref_pcc_rule_ids;
|
||||
bool is_session_ch_scope;
|
||||
int session_ch_scope;
|
||||
} OpenAPI_acc_net_ch_id_t;
|
||||
|
||||
OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_create(
|
||||
bool is_acc_net_cha_id_value,
|
||||
int acc_net_cha_id_value,
|
||||
char *acc_net_charg_id,
|
||||
OpenAPI_list_t *ref_pcc_rule_ids,
|
||||
bool is_session_ch_scope,
|
||||
int session_ch_scope
|
||||
|
|
|
@ -25,7 +25,8 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
|
|||
char *current_plmn_ts,
|
||||
OpenAPI_list_t *rat_type,
|
||||
char *rat_types_ts,
|
||||
char *supp_feat
|
||||
char *supp_feat,
|
||||
OpenAPI_list_t *reset_ids
|
||||
)
|
||||
{
|
||||
OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_var = ogs_malloc(sizeof(OpenAPI_access_and_mobility_data_t));
|
||||
|
@ -52,6 +53,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
|
|||
access_and_mobility_data_local_var->rat_type = rat_type;
|
||||
access_and_mobility_data_local_var->rat_types_ts = rat_types_ts;
|
||||
access_and_mobility_data_local_var->supp_feat = supp_feat;
|
||||
access_and_mobility_data_local_var->reset_ids = reset_ids;
|
||||
|
||||
return access_and_mobility_data_local_var;
|
||||
}
|
||||
|
@ -137,6 +139,13 @@ void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *a
|
|||
ogs_free(access_and_mobility_data->supp_feat);
|
||||
access_and_mobility_data->supp_feat = NULL;
|
||||
}
|
||||
if (access_and_mobility_data->reset_ids) {
|
||||
OpenAPI_list_for_each(access_and_mobility_data->reset_ids, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_data->reset_ids);
|
||||
access_and_mobility_data->reset_ids = NULL;
|
||||
}
|
||||
ogs_free(access_and_mobility_data);
|
||||
}
|
||||
|
||||
|
@ -334,6 +343,20 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_data->reset_ids) {
|
||||
cJSON *reset_idsList = cJSON_AddArrayToObject(item, "resetIds");
|
||||
if (reset_idsList == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(access_and_mobility_data->reset_ids, node) {
|
||||
if (cJSON_AddStringToObject(reset_idsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -370,6 +393,8 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
|
|||
OpenAPI_list_t *rat_typeList = NULL;
|
||||
cJSON *rat_types_ts = NULL;
|
||||
cJSON *supp_feat = NULL;
|
||||
cJSON *reset_ids = NULL;
|
||||
OpenAPI_list_t *reset_idsList = NULL;
|
||||
location = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "location");
|
||||
if (location) {
|
||||
location_local_nonprim = OpenAPI_user_location_parseFromJSON(location);
|
||||
|
@ -568,6 +593,27 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
|
|||
}
|
||||
}
|
||||
|
||||
reset_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "resetIds");
|
||||
if (reset_ids) {
|
||||
cJSON *reset_ids_local = NULL;
|
||||
if (!cJSON_IsArray(reset_ids)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
reset_idsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(reset_ids_local, reset_ids) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(reset_ids_local)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(reset_idsList, ogs_strdup(reset_ids_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
access_and_mobility_data_local_var = OpenAPI_access_and_mobility_data_create (
|
||||
location ? location_local_nonprim : NULL,
|
||||
location_ts && !cJSON_IsNull(location_ts) ? ogs_strdup(location_ts->valuestring) : NULL,
|
||||
|
@ -589,7 +635,8 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
|
|||
current_plmn_ts && !cJSON_IsNull(current_plmn_ts) ? ogs_strdup(current_plmn_ts->valuestring) : NULL,
|
||||
rat_type ? rat_typeList : NULL,
|
||||
rat_types_ts && !cJSON_IsNull(rat_types_ts) ? ogs_strdup(rat_types_ts->valuestring) : NULL,
|
||||
supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL
|
||||
supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL,
|
||||
reset_ids ? reset_idsList : NULL
|
||||
);
|
||||
|
||||
return access_and_mobility_data_local_var;
|
||||
|
@ -624,6 +671,13 @@ end:
|
|||
OpenAPI_list_free(rat_typeList);
|
||||
rat_typeList = NULL;
|
||||
}
|
||||
if (reset_idsList) {
|
||||
OpenAPI_list_for_each(reset_idsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(reset_idsList);
|
||||
reset_idsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* access_and_mobility_data.h
|
||||
*
|
||||
*
|
||||
* Represents Access and Mobility data for a UE.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_access_and_mobility_data_H_
|
||||
|
@ -48,6 +48,7 @@ typedef struct OpenAPI_access_and_mobility_data_s {
|
|||
OpenAPI_list_t *rat_type;
|
||||
char *rat_types_ts;
|
||||
char *supp_feat;
|
||||
OpenAPI_list_t *reset_ids;
|
||||
} OpenAPI_access_and_mobility_data_t;
|
||||
|
||||
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
|
||||
|
@ -71,7 +72,8 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
|
|||
char *current_plmn_ts,
|
||||
OpenAPI_list_t *rat_type,
|
||||
char *rat_types_ts,
|
||||
char *supp_feat
|
||||
char *supp_feat,
|
||||
OpenAPI_list_t *reset_ids
|
||||
);
|
||||
void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data);
|
||||
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON);
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_create(
|
||||
char *supported_features,
|
||||
OpenAPI_list_t *gpsis,
|
||||
char *hss_group_id,
|
||||
OpenAPI_list_t *internal_group_ids,
|
||||
OpenAPI_list_t* shared_vn_group_data_ids,
|
||||
OpenAPI_ambr_rm_t *subscribed_ue_ambr,
|
||||
OpenAPI_nssai_t *nssai,
|
||||
OpenAPI_list_t *rat_restrictions,
|
||||
OpenAPI_set_t *rat_restrictions,
|
||||
OpenAPI_list_t *forbidden_areas,
|
||||
OpenAPI_service_area_restriction_t *service_area_restriction,
|
||||
OpenAPI_list_t *core_network_type_restrictions,
|
||||
|
@ -34,6 +35,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
int soraf_retrieval,
|
||||
OpenAPI_list_t *sor_update_indicator_list,
|
||||
OpenAPI_upu_info_t *upu_info,
|
||||
char *routing_indicator,
|
||||
bool is_mico_allowed,
|
||||
int mico_allowed,
|
||||
OpenAPI_list_t *shared_am_data_ids,
|
||||
|
@ -56,14 +58,20 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
bool is_ec_restriction_data_nb,
|
||||
int ec_restriction_data_nb,
|
||||
OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_list,
|
||||
OpenAPI_list_t *primary_rat_restrictions,
|
||||
OpenAPI_list_t *secondary_rat_restrictions,
|
||||
OpenAPI_set_t *primary_rat_restrictions,
|
||||
OpenAPI_set_t *secondary_rat_restrictions,
|
||||
OpenAPI_list_t *edrx_parameters_list,
|
||||
OpenAPI_list_t *ptw_parameters_list,
|
||||
bool is_iab_operation_allowed,
|
||||
int iab_operation_allowed,
|
||||
OpenAPI_list_t* adjacent_plmn_restrictions,
|
||||
OpenAPI_list_t *wireline_forbidden_areas,
|
||||
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction
|
||||
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction,
|
||||
OpenAPI_list_t *pcf_selection_assistance_infos,
|
||||
OpenAPI_aerial_ue_subscription_info_t *aerial_ue_sub_info,
|
||||
OpenAPI_roaming_restrictions_t *roaming_restrictions,
|
||||
bool is_remote_prov_ind,
|
||||
int remote_prov_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data_local_var = ogs_malloc(sizeof(OpenAPI_access_and_mobility_subscription_data_t));
|
||||
|
@ -71,6 +79,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
|
||||
access_and_mobility_subscription_data_local_var->supported_features = supported_features;
|
||||
access_and_mobility_subscription_data_local_var->gpsis = gpsis;
|
||||
access_and_mobility_subscription_data_local_var->hss_group_id = hss_group_id;
|
||||
access_and_mobility_subscription_data_local_var->internal_group_ids = internal_group_ids;
|
||||
access_and_mobility_subscription_data_local_var->shared_vn_group_data_ids = shared_vn_group_data_ids;
|
||||
access_and_mobility_subscription_data_local_var->subscribed_ue_ambr = subscribed_ue_ambr;
|
||||
|
@ -98,6 +107,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
access_and_mobility_subscription_data_local_var->soraf_retrieval = soraf_retrieval;
|
||||
access_and_mobility_subscription_data_local_var->sor_update_indicator_list = sor_update_indicator_list;
|
||||
access_and_mobility_subscription_data_local_var->upu_info = upu_info;
|
||||
access_and_mobility_subscription_data_local_var->routing_indicator = routing_indicator;
|
||||
access_and_mobility_subscription_data_local_var->is_mico_allowed = is_mico_allowed;
|
||||
access_and_mobility_subscription_data_local_var->mico_allowed = mico_allowed;
|
||||
access_and_mobility_subscription_data_local_var->shared_am_data_ids = shared_am_data_ids;
|
||||
|
@ -126,8 +136,14 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
access_and_mobility_subscription_data_local_var->ptw_parameters_list = ptw_parameters_list;
|
||||
access_and_mobility_subscription_data_local_var->is_iab_operation_allowed = is_iab_operation_allowed;
|
||||
access_and_mobility_subscription_data_local_var->iab_operation_allowed = iab_operation_allowed;
|
||||
access_and_mobility_subscription_data_local_var->adjacent_plmn_restrictions = adjacent_plmn_restrictions;
|
||||
access_and_mobility_subscription_data_local_var->wireline_forbidden_areas = wireline_forbidden_areas;
|
||||
access_and_mobility_subscription_data_local_var->wireline_service_area_restriction = wireline_service_area_restriction;
|
||||
access_and_mobility_subscription_data_local_var->pcf_selection_assistance_infos = pcf_selection_assistance_infos;
|
||||
access_and_mobility_subscription_data_local_var->aerial_ue_sub_info = aerial_ue_sub_info;
|
||||
access_and_mobility_subscription_data_local_var->roaming_restrictions = roaming_restrictions;
|
||||
access_and_mobility_subscription_data_local_var->is_remote_prov_ind = is_remote_prov_ind;
|
||||
access_and_mobility_subscription_data_local_var->remote_prov_ind = remote_prov_ind;
|
||||
|
||||
return access_and_mobility_subscription_data_local_var;
|
||||
}
|
||||
|
@ -150,6 +166,10 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
OpenAPI_list_free(access_and_mobility_subscription_data->gpsis);
|
||||
access_and_mobility_subscription_data->gpsis = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->hss_group_id) {
|
||||
ogs_free(access_and_mobility_subscription_data->hss_group_id);
|
||||
access_and_mobility_subscription_data->hss_group_id = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->internal_group_ids) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->internal_group_ids, node) {
|
||||
ogs_free(node->data);
|
||||
|
@ -206,6 +226,10 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
OpenAPI_upu_info_free(access_and_mobility_subscription_data->upu_info);
|
||||
access_and_mobility_subscription_data->upu_info = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->routing_indicator) {
|
||||
ogs_free(access_and_mobility_subscription_data->routing_indicator);
|
||||
access_and_mobility_subscription_data->routing_indicator = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->shared_am_data_ids) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_am_data_ids, node) {
|
||||
ogs_free(node->data);
|
||||
|
@ -274,6 +298,16 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
OpenAPI_list_free(access_and_mobility_subscription_data->ptw_parameters_list);
|
||||
access_and_mobility_subscription_data->ptw_parameters_list = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->adjacent_plmn_restrictions) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->adjacent_plmn_restrictions, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_plmn_restriction_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->adjacent_plmn_restrictions);
|
||||
access_and_mobility_subscription_data->adjacent_plmn_restrictions = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->wireline_forbidden_areas) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->wireline_forbidden_areas, node) {
|
||||
OpenAPI_wireline_area_free(node->data);
|
||||
|
@ -285,6 +319,21 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
OpenAPI_wireline_service_area_restriction_free(access_and_mobility_subscription_data->wireline_service_area_restriction);
|
||||
access_and_mobility_subscription_data->wireline_service_area_restriction = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->pcf_selection_assistance_infos) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->pcf_selection_assistance_infos, node) {
|
||||
OpenAPI_pcf_selection_assistance_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->pcf_selection_assistance_infos);
|
||||
access_and_mobility_subscription_data->pcf_selection_assistance_infos = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->aerial_ue_sub_info) {
|
||||
OpenAPI_aerial_ue_subscription_info_free(access_and_mobility_subscription_data->aerial_ue_sub_info);
|
||||
access_and_mobility_subscription_data->aerial_ue_sub_info = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data->roaming_restrictions) {
|
||||
OpenAPI_roaming_restrictions_free(access_and_mobility_subscription_data->roaming_restrictions);
|
||||
access_and_mobility_subscription_data->roaming_restrictions = NULL;
|
||||
}
|
||||
ogs_free(access_and_mobility_subscription_data);
|
||||
}
|
||||
|
||||
|
@ -320,6 +369,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->hss_group_id) {
|
||||
if (cJSON_AddStringToObject(item, "hssGroupId", access_and_mobility_subscription_data->hss_group_id) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [hss_group_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->internal_group_ids) {
|
||||
cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds");
|
||||
if (internal_group_idsList == NULL) {
|
||||
|
@ -531,6 +587,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->routing_indicator) {
|
||||
if (cJSON_AddStringToObject(item, "routingIndicator", access_and_mobility_subscription_data->routing_indicator) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [routing_indicator]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->is_mico_allowed) {
|
||||
if (cJSON_AddBoolToObject(item, "micoAllowed", access_and_mobility_subscription_data->mico_allowed) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mico_allowed]");
|
||||
|
@ -761,6 +824,28 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->adjacent_plmn_restrictions) {
|
||||
cJSON *adjacent_plmn_restrictions = cJSON_AddObjectToObject(item, "adjacentPlmnRestrictions");
|
||||
if (adjacent_plmn_restrictions == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [adjacent_plmn_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = adjacent_plmn_restrictions;
|
||||
if (access_and_mobility_subscription_data->adjacent_plmn_restrictions) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->adjacent_plmn_restrictions, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
cJSON *itemLocal = localKeyValue->value ?
|
||||
OpenAPI_plmn_restriction_convertToJSON(localKeyValue->value) :
|
||||
cJSON_CreateNull();
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->wireline_forbidden_areas) {
|
||||
cJSON *wireline_forbidden_areasList = cJSON_AddArrayToObject(item, "wirelineForbiddenAreas");
|
||||
if (wireline_forbidden_areasList == NULL) {
|
||||
|
@ -790,6 +875,55 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->pcf_selection_assistance_infos) {
|
||||
cJSON *pcf_selection_assistance_infosList = cJSON_AddArrayToObject(item, "pcfSelectionAssistanceInfos");
|
||||
if (pcf_selection_assistance_infosList == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->pcf_selection_assistance_infos, node) {
|
||||
cJSON *itemLocal = OpenAPI_pcf_selection_assistance_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(pcf_selection_assistance_infosList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->aerial_ue_sub_info) {
|
||||
cJSON *aerial_ue_sub_info_local_JSON = OpenAPI_aerial_ue_subscription_info_convertToJSON(access_and_mobility_subscription_data->aerial_ue_sub_info);
|
||||
if (aerial_ue_sub_info_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [aerial_ue_sub_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "aerialUeSubInfo", aerial_ue_sub_info_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [aerial_ue_sub_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->roaming_restrictions) {
|
||||
cJSON *roaming_restrictions_local_JSON = OpenAPI_roaming_restrictions_convertToJSON(access_and_mobility_subscription_data->roaming_restrictions);
|
||||
if (roaming_restrictions_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [roaming_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "roamingRestrictions", roaming_restrictions_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [roaming_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->is_remote_prov_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "remoteProvInd", access_and_mobility_subscription_data->remote_prov_ind) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [remote_prov_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -801,6 +935,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
cJSON *supported_features = NULL;
|
||||
cJSON *gpsis = NULL;
|
||||
OpenAPI_list_t *gpsisList = NULL;
|
||||
cJSON *hss_group_id = NULL;
|
||||
cJSON *internal_group_ids = NULL;
|
||||
OpenAPI_list_t *internal_group_idsList = NULL;
|
||||
cJSON *shared_vn_group_data_ids = NULL;
|
||||
|
@ -831,6 +966,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
OpenAPI_list_t *sor_update_indicator_listList = NULL;
|
||||
cJSON *upu_info = NULL;
|
||||
OpenAPI_upu_info_t *upu_info_local_nonprim = NULL;
|
||||
cJSON *routing_indicator = NULL;
|
||||
cJSON *mico_allowed = NULL;
|
||||
cJSON *shared_am_data_ids = NULL;
|
||||
OpenAPI_list_t *shared_am_data_idsList = NULL;
|
||||
|
@ -866,10 +1002,19 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
cJSON *ptw_parameters_list = NULL;
|
||||
OpenAPI_list_t *ptw_parameters_listList = NULL;
|
||||
cJSON *iab_operation_allowed = NULL;
|
||||
cJSON *adjacent_plmn_restrictions = NULL;
|
||||
OpenAPI_list_t *adjacent_plmn_restrictionsList = NULL;
|
||||
cJSON *wireline_forbidden_areas = NULL;
|
||||
OpenAPI_list_t *wireline_forbidden_areasList = NULL;
|
||||
cJSON *wireline_service_area_restriction = NULL;
|
||||
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction_local_nonprim = NULL;
|
||||
cJSON *pcf_selection_assistance_infos = NULL;
|
||||
OpenAPI_list_t *pcf_selection_assistance_infosList = NULL;
|
||||
cJSON *aerial_ue_sub_info = NULL;
|
||||
OpenAPI_aerial_ue_subscription_info_t *aerial_ue_sub_info_local_nonprim = NULL;
|
||||
cJSON *roaming_restrictions = NULL;
|
||||
OpenAPI_roaming_restrictions_t *roaming_restrictions_local_nonprim = NULL;
|
||||
cJSON *remote_prov_ind = NULL;
|
||||
supported_features = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "supportedFeatures");
|
||||
if (supported_features) {
|
||||
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
|
||||
|
@ -899,6 +1044,14 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
}
|
||||
}
|
||||
|
||||
hss_group_id = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "hssGroupId");
|
||||
if (hss_group_id) {
|
||||
if (!cJSON_IsString(hss_group_id) && !cJSON_IsNull(hss_group_id)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [hss_group_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
internal_group_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "internalGroupIds");
|
||||
if (internal_group_ids) {
|
||||
cJSON *internal_group_ids_local = NULL;
|
||||
|
@ -1115,6 +1268,14 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
upu_info_local_nonprim = OpenAPI_upu_info_parseFromJSON(upu_info);
|
||||
}
|
||||
|
||||
routing_indicator = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "routingIndicator");
|
||||
if (routing_indicator) {
|
||||
if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [routing_indicator]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
mico_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "micoAllowed");
|
||||
if (mico_allowed) {
|
||||
if (!cJSON_IsBool(mico_allowed)) {
|
||||
|
@ -1360,6 +1521,32 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
}
|
||||
}
|
||||
|
||||
adjacent_plmn_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "adjacentPlmnRestrictions");
|
||||
if (adjacent_plmn_restrictions) {
|
||||
cJSON *adjacent_plmn_restrictions_local_map = NULL;
|
||||
if (!cJSON_IsObject(adjacent_plmn_restrictions) && !cJSON_IsNull(adjacent_plmn_restrictions)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [adjacent_plmn_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_IsObject(adjacent_plmn_restrictions)) {
|
||||
adjacent_plmn_restrictionsList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(adjacent_plmn_restrictions_local_map, adjacent_plmn_restrictions) {
|
||||
cJSON *localMapObject = adjacent_plmn_restrictions_local_map;
|
||||
if (cJSON_IsObject(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
ogs_strdup(localMapObject->string), OpenAPI_plmn_restriction_parseFromJSON(localMapObject));
|
||||
} else if (cJSON_IsNull(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
|
||||
} else {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(adjacent_plmn_restrictionsList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wireline_forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "wirelineForbiddenAreas");
|
||||
if (wireline_forbidden_areas) {
|
||||
cJSON *wireline_forbidden_areas_local = NULL;
|
||||
|
@ -1390,9 +1577,53 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
wireline_service_area_restriction_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wireline_service_area_restriction);
|
||||
}
|
||||
|
||||
pcf_selection_assistance_infos = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "pcfSelectionAssistanceInfos");
|
||||
if (pcf_selection_assistance_infos) {
|
||||
cJSON *pcf_selection_assistance_infos_local = NULL;
|
||||
if (!cJSON_IsArray(pcf_selection_assistance_infos)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
pcf_selection_assistance_infosList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(pcf_selection_assistance_infos_local, pcf_selection_assistance_infos) {
|
||||
if (!cJSON_IsObject(pcf_selection_assistance_infos_local)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_pcf_selection_assistance_info_t *pcf_selection_assistance_infosItem = OpenAPI_pcf_selection_assistance_info_parseFromJSON(pcf_selection_assistance_infos_local);
|
||||
if (!pcf_selection_assistance_infosItem) {
|
||||
ogs_error("No pcf_selection_assistance_infosItem");
|
||||
OpenAPI_list_free(pcf_selection_assistance_infosList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(pcf_selection_assistance_infosList, pcf_selection_assistance_infosItem);
|
||||
}
|
||||
}
|
||||
|
||||
aerial_ue_sub_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "aerialUeSubInfo");
|
||||
if (aerial_ue_sub_info) {
|
||||
aerial_ue_sub_info_local_nonprim = OpenAPI_aerial_ue_subscription_info_parseFromJSON(aerial_ue_sub_info);
|
||||
}
|
||||
|
||||
roaming_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "roamingRestrictions");
|
||||
if (roaming_restrictions) {
|
||||
roaming_restrictions_local_nonprim = OpenAPI_roaming_restrictions_parseFromJSON(roaming_restrictions);
|
||||
}
|
||||
|
||||
remote_prov_ind = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "remoteProvInd");
|
||||
if (remote_prov_ind) {
|
||||
if (!cJSON_IsBool(remote_prov_ind)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [remote_prov_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
access_and_mobility_subscription_data_local_var = OpenAPI_access_and_mobility_subscription_data_create (
|
||||
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
gpsis ? gpsisList : NULL,
|
||||
hss_group_id && !cJSON_IsNull(hss_group_id) ? ogs_strdup(hss_group_id->valuestring) : NULL,
|
||||
internal_group_ids ? internal_group_idsList : NULL,
|
||||
shared_vn_group_data_ids ? shared_vn_group_data_idsList : NULL,
|
||||
subscribed_ue_ambr ? subscribed_ue_ambr_local_nonprim : NULL,
|
||||
|
@ -1420,6 +1651,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
soraf_retrieval ? soraf_retrieval->valueint : 0,
|
||||
sor_update_indicator_list ? sor_update_indicator_listList : NULL,
|
||||
upu_info ? upu_info_local_nonprim : NULL,
|
||||
routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL,
|
||||
mico_allowed ? true : false,
|
||||
mico_allowed ? mico_allowed->valueint : 0,
|
||||
shared_am_data_ids ? shared_am_data_idsList : NULL,
|
||||
|
@ -1448,8 +1680,14 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
ptw_parameters_list ? ptw_parameters_listList : NULL,
|
||||
iab_operation_allowed ? true : false,
|
||||
iab_operation_allowed ? iab_operation_allowed->valueint : 0,
|
||||
adjacent_plmn_restrictions ? adjacent_plmn_restrictionsList : NULL,
|
||||
wireline_forbidden_areas ? wireline_forbidden_areasList : NULL,
|
||||
wireline_service_area_restriction ? wireline_service_area_restriction_local_nonprim : NULL
|
||||
wireline_service_area_restriction ? wireline_service_area_restriction_local_nonprim : NULL,
|
||||
pcf_selection_assistance_infos ? pcf_selection_assistance_infosList : NULL,
|
||||
aerial_ue_sub_info ? aerial_ue_sub_info_local_nonprim : NULL,
|
||||
roaming_restrictions ? roaming_restrictions_local_nonprim : NULL,
|
||||
remote_prov_ind ? true : false,
|
||||
remote_prov_ind ? remote_prov_ind->valueint : 0
|
||||
);
|
||||
|
||||
return access_and_mobility_subscription_data_local_var;
|
||||
|
@ -1573,6 +1811,16 @@ end:
|
|||
OpenAPI_list_free(ptw_parameters_listList);
|
||||
ptw_parameters_listList = NULL;
|
||||
}
|
||||
if (adjacent_plmn_restrictionsList) {
|
||||
OpenAPI_list_for_each(adjacent_plmn_restrictionsList, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_plmn_restriction_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(adjacent_plmn_restrictionsList);
|
||||
adjacent_plmn_restrictionsList = NULL;
|
||||
}
|
||||
if (wireline_forbidden_areasList) {
|
||||
OpenAPI_list_for_each(wireline_forbidden_areasList, node) {
|
||||
OpenAPI_wireline_area_free(node->data);
|
||||
|
@ -1584,6 +1832,21 @@ end:
|
|||
OpenAPI_wireline_service_area_restriction_free(wireline_service_area_restriction_local_nonprim);
|
||||
wireline_service_area_restriction_local_nonprim = NULL;
|
||||
}
|
||||
if (pcf_selection_assistance_infosList) {
|
||||
OpenAPI_list_for_each(pcf_selection_assistance_infosList, node) {
|
||||
OpenAPI_pcf_selection_assistance_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(pcf_selection_assistance_infosList);
|
||||
pcf_selection_assistance_infosList = NULL;
|
||||
}
|
||||
if (aerial_ue_sub_info_local_nonprim) {
|
||||
OpenAPI_aerial_ue_subscription_info_free(aerial_ue_sub_info_local_nonprim);
|
||||
aerial_ue_sub_info_local_nonprim = NULL;
|
||||
}
|
||||
if (roaming_restrictions_local_nonprim) {
|
||||
OpenAPI_roaming_restrictions_free(roaming_restrictions_local_nonprim);
|
||||
roaming_restrictions_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "aerial_ue_subscription_info.h"
|
||||
#include "ambr_rm.h"
|
||||
#include "area.h"
|
||||
#include "cag_data.h"
|
||||
|
@ -23,9 +24,13 @@
|
|||
#include "mdt_user_consent.h"
|
||||
#include "nssai.h"
|
||||
#include "odb_packet_services.h"
|
||||
#include "pcf_selection_assistance_info.h"
|
||||
#include "plmn_restriction.h"
|
||||
#include "ptw_parameters.h"
|
||||
#include "rat_type.h"
|
||||
#include "roaming_restrictions.h"
|
||||
#include "service_area_restriction.h"
|
||||
#include "set.h"
|
||||
#include "sor_info.h"
|
||||
#include "sor_update_indicator.h"
|
||||
#include "trace_data.h"
|
||||
|
@ -41,11 +46,12 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s OpenAPI_access_an
|
|||
typedef struct OpenAPI_access_and_mobility_subscription_data_s {
|
||||
char *supported_features;
|
||||
OpenAPI_list_t *gpsis;
|
||||
char *hss_group_id;
|
||||
OpenAPI_list_t *internal_group_ids;
|
||||
OpenAPI_list_t* shared_vn_group_data_ids;
|
||||
struct OpenAPI_ambr_rm_s *subscribed_ue_ambr;
|
||||
struct OpenAPI_nssai_s *nssai;
|
||||
OpenAPI_list_t *rat_restrictions;
|
||||
OpenAPI_set_t *rat_restrictions;
|
||||
OpenAPI_list_t *forbidden_areas;
|
||||
struct OpenAPI_service_area_restriction_s *service_area_restriction;
|
||||
OpenAPI_list_t *core_network_type_restrictions;
|
||||
|
@ -68,6 +74,7 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s {
|
|||
int soraf_retrieval;
|
||||
OpenAPI_list_t *sor_update_indicator_list;
|
||||
struct OpenAPI_upu_info_s *upu_info;
|
||||
char *routing_indicator;
|
||||
bool is_mico_allowed;
|
||||
int mico_allowed;
|
||||
OpenAPI_list_t *shared_am_data_ids;
|
||||
|
@ -90,24 +97,31 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s {
|
|||
bool is_ec_restriction_data_nb;
|
||||
int ec_restriction_data_nb;
|
||||
struct OpenAPI_expected_ue_behaviour_data_s *expected_ue_behaviour_list;
|
||||
OpenAPI_list_t *primary_rat_restrictions;
|
||||
OpenAPI_list_t *secondary_rat_restrictions;
|
||||
OpenAPI_set_t *primary_rat_restrictions;
|
||||
OpenAPI_set_t *secondary_rat_restrictions;
|
||||
OpenAPI_list_t *edrx_parameters_list;
|
||||
OpenAPI_list_t *ptw_parameters_list;
|
||||
bool is_iab_operation_allowed;
|
||||
int iab_operation_allowed;
|
||||
OpenAPI_list_t* adjacent_plmn_restrictions;
|
||||
OpenAPI_list_t *wireline_forbidden_areas;
|
||||
struct OpenAPI_wireline_service_area_restriction_s *wireline_service_area_restriction;
|
||||
OpenAPI_list_t *pcf_selection_assistance_infos;
|
||||
struct OpenAPI_aerial_ue_subscription_info_s *aerial_ue_sub_info;
|
||||
struct OpenAPI_roaming_restrictions_s *roaming_restrictions;
|
||||
bool is_remote_prov_ind;
|
||||
int remote_prov_ind;
|
||||
} OpenAPI_access_and_mobility_subscription_data_t;
|
||||
|
||||
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_create(
|
||||
char *supported_features,
|
||||
OpenAPI_list_t *gpsis,
|
||||
char *hss_group_id,
|
||||
OpenAPI_list_t *internal_group_ids,
|
||||
OpenAPI_list_t* shared_vn_group_data_ids,
|
||||
OpenAPI_ambr_rm_t *subscribed_ue_ambr,
|
||||
OpenAPI_nssai_t *nssai,
|
||||
OpenAPI_list_t *rat_restrictions,
|
||||
OpenAPI_set_t *rat_restrictions,
|
||||
OpenAPI_list_t *forbidden_areas,
|
||||
OpenAPI_service_area_restriction_t *service_area_restriction,
|
||||
OpenAPI_list_t *core_network_type_restrictions,
|
||||
|
@ -130,6 +144,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
int soraf_retrieval,
|
||||
OpenAPI_list_t *sor_update_indicator_list,
|
||||
OpenAPI_upu_info_t *upu_info,
|
||||
char *routing_indicator,
|
||||
bool is_mico_allowed,
|
||||
int mico_allowed,
|
||||
OpenAPI_list_t *shared_am_data_ids,
|
||||
|
@ -152,14 +167,20 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
bool is_ec_restriction_data_nb,
|
||||
int ec_restriction_data_nb,
|
||||
OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_list,
|
||||
OpenAPI_list_t *primary_rat_restrictions,
|
||||
OpenAPI_list_t *secondary_rat_restrictions,
|
||||
OpenAPI_set_t *primary_rat_restrictions,
|
||||
OpenAPI_set_t *secondary_rat_restrictions,
|
||||
OpenAPI_list_t *edrx_parameters_list,
|
||||
OpenAPI_list_t *ptw_parameters_list,
|
||||
bool is_iab_operation_allowed,
|
||||
int iab_operation_allowed,
|
||||
OpenAPI_list_t* adjacent_plmn_restrictions,
|
||||
OpenAPI_list_t *wireline_forbidden_areas,
|
||||
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction
|
||||
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction,
|
||||
OpenAPI_list_t *pcf_selection_assistance_infos,
|
||||
OpenAPI_aerial_ue_subscription_info_t *aerial_ue_sub_info,
|
||||
OpenAPI_roaming_restrictions_t *roaming_restrictions,
|
||||
bool is_remote_prov_ind,
|
||||
int remote_prov_ind
|
||||
);
|
||||
void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data);
|
||||
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_parseFromJSON(cJSON *access_and_mobility_subscription_dataJSON);
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_subscription_data_1_create(
|
||||
char *supported_features,
|
||||
OpenAPI_list_t *gpsis,
|
||||
char *hss_group_id,
|
||||
OpenAPI_list_t *internal_group_ids,
|
||||
OpenAPI_list_t* shared_vn_group_data_ids,
|
||||
OpenAPI_ambr_rm_t *subscribed_ue_ambr,
|
||||
OpenAPI_nssai_1_t *nssai,
|
||||
OpenAPI_list_t *rat_restrictions,
|
||||
OpenAPI_set_t *rat_restrictions,
|
||||
OpenAPI_list_t *forbidden_areas,
|
||||
OpenAPI_service_area_restriction_1_t *service_area_restriction,
|
||||
OpenAPI_list_t *core_network_type_restrictions,
|
||||
|
@ -34,6 +35,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
int soraf_retrieval,
|
||||
OpenAPI_list_t *sor_update_indicator_list,
|
||||
OpenAPI_upu_info_1_t *upu_info,
|
||||
char *routing_indicator,
|
||||
bool is_mico_allowed,
|
||||
int mico_allowed,
|
||||
OpenAPI_list_t *shared_am_data_ids,
|
||||
|
@ -56,14 +58,20 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
bool is_ec_restriction_data_nb,
|
||||
int ec_restriction_data_nb,
|
||||
OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_list,
|
||||
OpenAPI_list_t *primary_rat_restrictions,
|
||||
OpenAPI_list_t *secondary_rat_restrictions,
|
||||
OpenAPI_set_t *primary_rat_restrictions,
|
||||
OpenAPI_set_t *secondary_rat_restrictions,
|
||||
OpenAPI_list_t *edrx_parameters_list,
|
||||
OpenAPI_list_t *ptw_parameters_list,
|
||||
bool is_iab_operation_allowed,
|
||||
int iab_operation_allowed,
|
||||
OpenAPI_list_t* adjacent_plmn_restrictions,
|
||||
OpenAPI_list_t *wireline_forbidden_areas,
|
||||
OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction
|
||||
OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction,
|
||||
OpenAPI_list_t *pcf_selection_assistance_infos,
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_sub_info,
|
||||
OpenAPI_roaming_restrictions_t *roaming_restrictions,
|
||||
bool is_remote_prov_ind,
|
||||
int remote_prov_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_access_and_mobility_subscription_data_1_t *access_and_mobility_subscription_data_1_local_var = ogs_malloc(sizeof(OpenAPI_access_and_mobility_subscription_data_1_t));
|
||||
|
@ -71,6 +79,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
|
||||
access_and_mobility_subscription_data_1_local_var->supported_features = supported_features;
|
||||
access_and_mobility_subscription_data_1_local_var->gpsis = gpsis;
|
||||
access_and_mobility_subscription_data_1_local_var->hss_group_id = hss_group_id;
|
||||
access_and_mobility_subscription_data_1_local_var->internal_group_ids = internal_group_ids;
|
||||
access_and_mobility_subscription_data_1_local_var->shared_vn_group_data_ids = shared_vn_group_data_ids;
|
||||
access_and_mobility_subscription_data_1_local_var->subscribed_ue_ambr = subscribed_ue_ambr;
|
||||
|
@ -98,6 +107,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
access_and_mobility_subscription_data_1_local_var->soraf_retrieval = soraf_retrieval;
|
||||
access_and_mobility_subscription_data_1_local_var->sor_update_indicator_list = sor_update_indicator_list;
|
||||
access_and_mobility_subscription_data_1_local_var->upu_info = upu_info;
|
||||
access_and_mobility_subscription_data_1_local_var->routing_indicator = routing_indicator;
|
||||
access_and_mobility_subscription_data_1_local_var->is_mico_allowed = is_mico_allowed;
|
||||
access_and_mobility_subscription_data_1_local_var->mico_allowed = mico_allowed;
|
||||
access_and_mobility_subscription_data_1_local_var->shared_am_data_ids = shared_am_data_ids;
|
||||
|
@ -126,8 +136,14 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
access_and_mobility_subscription_data_1_local_var->ptw_parameters_list = ptw_parameters_list;
|
||||
access_and_mobility_subscription_data_1_local_var->is_iab_operation_allowed = is_iab_operation_allowed;
|
||||
access_and_mobility_subscription_data_1_local_var->iab_operation_allowed = iab_operation_allowed;
|
||||
access_and_mobility_subscription_data_1_local_var->adjacent_plmn_restrictions = adjacent_plmn_restrictions;
|
||||
access_and_mobility_subscription_data_1_local_var->wireline_forbidden_areas = wireline_forbidden_areas;
|
||||
access_and_mobility_subscription_data_1_local_var->wireline_service_area_restriction = wireline_service_area_restriction;
|
||||
access_and_mobility_subscription_data_1_local_var->pcf_selection_assistance_infos = pcf_selection_assistance_infos;
|
||||
access_and_mobility_subscription_data_1_local_var->aerial_ue_sub_info = aerial_ue_sub_info;
|
||||
access_and_mobility_subscription_data_1_local_var->roaming_restrictions = roaming_restrictions;
|
||||
access_and_mobility_subscription_data_1_local_var->is_remote_prov_ind = is_remote_prov_ind;
|
||||
access_and_mobility_subscription_data_1_local_var->remote_prov_ind = remote_prov_ind;
|
||||
|
||||
return access_and_mobility_subscription_data_1_local_var;
|
||||
}
|
||||
|
@ -150,6 +166,10 @@ void OpenAPI_access_and_mobility_subscription_data_1_free(OpenAPI_access_and_mob
|
|||
OpenAPI_list_free(access_and_mobility_subscription_data_1->gpsis);
|
||||
access_and_mobility_subscription_data_1->gpsis = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->hss_group_id) {
|
||||
ogs_free(access_and_mobility_subscription_data_1->hss_group_id);
|
||||
access_and_mobility_subscription_data_1->hss_group_id = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->internal_group_ids) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data_1->internal_group_ids, node) {
|
||||
ogs_free(node->data);
|
||||
|
@ -206,6 +226,10 @@ void OpenAPI_access_and_mobility_subscription_data_1_free(OpenAPI_access_and_mob
|
|||
OpenAPI_upu_info_1_free(access_and_mobility_subscription_data_1->upu_info);
|
||||
access_and_mobility_subscription_data_1->upu_info = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->routing_indicator) {
|
||||
ogs_free(access_and_mobility_subscription_data_1->routing_indicator);
|
||||
access_and_mobility_subscription_data_1->routing_indicator = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->shared_am_data_ids) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data_1->shared_am_data_ids, node) {
|
||||
ogs_free(node->data);
|
||||
|
@ -274,6 +298,16 @@ void OpenAPI_access_and_mobility_subscription_data_1_free(OpenAPI_access_and_mob
|
|||
OpenAPI_list_free(access_and_mobility_subscription_data_1->ptw_parameters_list);
|
||||
access_and_mobility_subscription_data_1->ptw_parameters_list = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->adjacent_plmn_restrictions) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data_1->adjacent_plmn_restrictions, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_plmn_restriction_1_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data_1->adjacent_plmn_restrictions);
|
||||
access_and_mobility_subscription_data_1->adjacent_plmn_restrictions = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->wireline_forbidden_areas) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data_1->wireline_forbidden_areas, node) {
|
||||
OpenAPI_wireline_area_1_free(node->data);
|
||||
|
@ -285,6 +319,21 @@ void OpenAPI_access_and_mobility_subscription_data_1_free(OpenAPI_access_and_mob
|
|||
OpenAPI_wireline_service_area_restriction_1_free(access_and_mobility_subscription_data_1->wireline_service_area_restriction);
|
||||
access_and_mobility_subscription_data_1->wireline_service_area_restriction = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->pcf_selection_assistance_infos) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data_1->pcf_selection_assistance_infos, node) {
|
||||
OpenAPI_pcf_selection_assistance_info_1_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data_1->pcf_selection_assistance_infos);
|
||||
access_and_mobility_subscription_data_1->pcf_selection_assistance_infos = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->aerial_ue_sub_info) {
|
||||
OpenAPI_aerial_ue_subscription_info_1_free(access_and_mobility_subscription_data_1->aerial_ue_sub_info);
|
||||
access_and_mobility_subscription_data_1->aerial_ue_sub_info = NULL;
|
||||
}
|
||||
if (access_and_mobility_subscription_data_1->roaming_restrictions) {
|
||||
OpenAPI_roaming_restrictions_free(access_and_mobility_subscription_data_1->roaming_restrictions);
|
||||
access_and_mobility_subscription_data_1->roaming_restrictions = NULL;
|
||||
}
|
||||
ogs_free(access_and_mobility_subscription_data_1);
|
||||
}
|
||||
|
||||
|
@ -320,6 +369,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->hss_group_id) {
|
||||
if (cJSON_AddStringToObject(item, "hssGroupId", access_and_mobility_subscription_data_1->hss_group_id) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [hss_group_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->internal_group_ids) {
|
||||
cJSON *internal_group_idsList = cJSON_AddArrayToObject(item, "internalGroupIds");
|
||||
if (internal_group_idsList == NULL) {
|
||||
|
@ -531,6 +587,13 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->routing_indicator) {
|
||||
if (cJSON_AddStringToObject(item, "routingIndicator", access_and_mobility_subscription_data_1->routing_indicator) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [routing_indicator]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->is_mico_allowed) {
|
||||
if (cJSON_AddBoolToObject(item, "micoAllowed", access_and_mobility_subscription_data_1->mico_allowed) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [mico_allowed]");
|
||||
|
@ -761,6 +824,28 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->adjacent_plmn_restrictions) {
|
||||
cJSON *adjacent_plmn_restrictions = cJSON_AddObjectToObject(item, "adjacentPlmnRestrictions");
|
||||
if (adjacent_plmn_restrictions == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [adjacent_plmn_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = adjacent_plmn_restrictions;
|
||||
if (access_and_mobility_subscription_data_1->adjacent_plmn_restrictions) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data_1->adjacent_plmn_restrictions, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
cJSON *itemLocal = localKeyValue->value ?
|
||||
OpenAPI_plmn_restriction_1_convertToJSON(localKeyValue->value) :
|
||||
cJSON_CreateNull();
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->wireline_forbidden_areas) {
|
||||
cJSON *wireline_forbidden_areasList = cJSON_AddArrayToObject(item, "wirelineForbiddenAreas");
|
||||
if (wireline_forbidden_areasList == NULL) {
|
||||
|
@ -790,6 +875,55 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_acc
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->pcf_selection_assistance_infos) {
|
||||
cJSON *pcf_selection_assistance_infosList = cJSON_AddArrayToObject(item, "pcfSelectionAssistanceInfos");
|
||||
if (pcf_selection_assistance_infosList == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data_1->pcf_selection_assistance_infos, node) {
|
||||
cJSON *itemLocal = OpenAPI_pcf_selection_assistance_info_1_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(pcf_selection_assistance_infosList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->aerial_ue_sub_info) {
|
||||
cJSON *aerial_ue_sub_info_local_JSON = OpenAPI_aerial_ue_subscription_info_1_convertToJSON(access_and_mobility_subscription_data_1->aerial_ue_sub_info);
|
||||
if (aerial_ue_sub_info_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [aerial_ue_sub_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "aerialUeSubInfo", aerial_ue_sub_info_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [aerial_ue_sub_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->roaming_restrictions) {
|
||||
cJSON *roaming_restrictions_local_JSON = OpenAPI_roaming_restrictions_convertToJSON(access_and_mobility_subscription_data_1->roaming_restrictions);
|
||||
if (roaming_restrictions_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [roaming_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "roamingRestrictions", roaming_restrictions_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [roaming_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data_1->is_remote_prov_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "remoteProvInd", access_and_mobility_subscription_data_1->remote_prov_ind) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_convertToJSON() failed [remote_prov_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -801,6 +935,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
cJSON *supported_features = NULL;
|
||||
cJSON *gpsis = NULL;
|
||||
OpenAPI_list_t *gpsisList = NULL;
|
||||
cJSON *hss_group_id = NULL;
|
||||
cJSON *internal_group_ids = NULL;
|
||||
OpenAPI_list_t *internal_group_idsList = NULL;
|
||||
cJSON *shared_vn_group_data_ids = NULL;
|
||||
|
@ -831,6 +966,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
OpenAPI_list_t *sor_update_indicator_listList = NULL;
|
||||
cJSON *upu_info = NULL;
|
||||
OpenAPI_upu_info_1_t *upu_info_local_nonprim = NULL;
|
||||
cJSON *routing_indicator = NULL;
|
||||
cJSON *mico_allowed = NULL;
|
||||
cJSON *shared_am_data_ids = NULL;
|
||||
OpenAPI_list_t *shared_am_data_idsList = NULL;
|
||||
|
@ -866,10 +1002,19 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
cJSON *ptw_parameters_list = NULL;
|
||||
OpenAPI_list_t *ptw_parameters_listList = NULL;
|
||||
cJSON *iab_operation_allowed = NULL;
|
||||
cJSON *adjacent_plmn_restrictions = NULL;
|
||||
OpenAPI_list_t *adjacent_plmn_restrictionsList = NULL;
|
||||
cJSON *wireline_forbidden_areas = NULL;
|
||||
OpenAPI_list_t *wireline_forbidden_areasList = NULL;
|
||||
cJSON *wireline_service_area_restriction = NULL;
|
||||
OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction_local_nonprim = NULL;
|
||||
cJSON *pcf_selection_assistance_infos = NULL;
|
||||
OpenAPI_list_t *pcf_selection_assistance_infosList = NULL;
|
||||
cJSON *aerial_ue_sub_info = NULL;
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_sub_info_local_nonprim = NULL;
|
||||
cJSON *roaming_restrictions = NULL;
|
||||
OpenAPI_roaming_restrictions_t *roaming_restrictions_local_nonprim = NULL;
|
||||
cJSON *remote_prov_ind = NULL;
|
||||
supported_features = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "supportedFeatures");
|
||||
if (supported_features) {
|
||||
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
|
||||
|
@ -899,6 +1044,14 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
}
|
||||
}
|
||||
|
||||
hss_group_id = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "hssGroupId");
|
||||
if (hss_group_id) {
|
||||
if (!cJSON_IsString(hss_group_id) && !cJSON_IsNull(hss_group_id)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [hss_group_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
internal_group_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "internalGroupIds");
|
||||
if (internal_group_ids) {
|
||||
cJSON *internal_group_ids_local = NULL;
|
||||
|
@ -1115,6 +1268,14 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
upu_info_local_nonprim = OpenAPI_upu_info_1_parseFromJSON(upu_info);
|
||||
}
|
||||
|
||||
routing_indicator = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "routingIndicator");
|
||||
if (routing_indicator) {
|
||||
if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [routing_indicator]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
mico_allowed = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "micoAllowed");
|
||||
if (mico_allowed) {
|
||||
if (!cJSON_IsBool(mico_allowed)) {
|
||||
|
@ -1360,6 +1521,32 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
}
|
||||
}
|
||||
|
||||
adjacent_plmn_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "adjacentPlmnRestrictions");
|
||||
if (adjacent_plmn_restrictions) {
|
||||
cJSON *adjacent_plmn_restrictions_local_map = NULL;
|
||||
if (!cJSON_IsObject(adjacent_plmn_restrictions) && !cJSON_IsNull(adjacent_plmn_restrictions)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [adjacent_plmn_restrictions]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_IsObject(adjacent_plmn_restrictions)) {
|
||||
adjacent_plmn_restrictionsList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(adjacent_plmn_restrictions_local_map, adjacent_plmn_restrictions) {
|
||||
cJSON *localMapObject = adjacent_plmn_restrictions_local_map;
|
||||
if (cJSON_IsObject(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
ogs_strdup(localMapObject->string), OpenAPI_plmn_restriction_1_parseFromJSON(localMapObject));
|
||||
} else if (cJSON_IsNull(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
|
||||
} else {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(adjacent_plmn_restrictionsList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wireline_forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "wirelineForbiddenAreas");
|
||||
if (wireline_forbidden_areas) {
|
||||
cJSON *wireline_forbidden_areas_local = NULL;
|
||||
|
@ -1390,9 +1577,53 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
wireline_service_area_restriction_local_nonprim = OpenAPI_wireline_service_area_restriction_1_parseFromJSON(wireline_service_area_restriction);
|
||||
}
|
||||
|
||||
pcf_selection_assistance_infos = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "pcfSelectionAssistanceInfos");
|
||||
if (pcf_selection_assistance_infos) {
|
||||
cJSON *pcf_selection_assistance_infos_local = NULL;
|
||||
if (!cJSON_IsArray(pcf_selection_assistance_infos)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
pcf_selection_assistance_infosList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(pcf_selection_assistance_infos_local, pcf_selection_assistance_infos) {
|
||||
if (!cJSON_IsObject(pcf_selection_assistance_infos_local)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [pcf_selection_assistance_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_pcf_selection_assistance_info_1_t *pcf_selection_assistance_infosItem = OpenAPI_pcf_selection_assistance_info_1_parseFromJSON(pcf_selection_assistance_infos_local);
|
||||
if (!pcf_selection_assistance_infosItem) {
|
||||
ogs_error("No pcf_selection_assistance_infosItem");
|
||||
OpenAPI_list_free(pcf_selection_assistance_infosList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(pcf_selection_assistance_infosList, pcf_selection_assistance_infosItem);
|
||||
}
|
||||
}
|
||||
|
||||
aerial_ue_sub_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "aerialUeSubInfo");
|
||||
if (aerial_ue_sub_info) {
|
||||
aerial_ue_sub_info_local_nonprim = OpenAPI_aerial_ue_subscription_info_1_parseFromJSON(aerial_ue_sub_info);
|
||||
}
|
||||
|
||||
roaming_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "roamingRestrictions");
|
||||
if (roaming_restrictions) {
|
||||
roaming_restrictions_local_nonprim = OpenAPI_roaming_restrictions_parseFromJSON(roaming_restrictions);
|
||||
}
|
||||
|
||||
remote_prov_ind = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_data_1JSON, "remoteProvInd");
|
||||
if (remote_prov_ind) {
|
||||
if (!cJSON_IsBool(remote_prov_ind)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON() failed [remote_prov_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
access_and_mobility_subscription_data_1_local_var = OpenAPI_access_and_mobility_subscription_data_1_create (
|
||||
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
gpsis ? gpsisList : NULL,
|
||||
hss_group_id && !cJSON_IsNull(hss_group_id) ? ogs_strdup(hss_group_id->valuestring) : NULL,
|
||||
internal_group_ids ? internal_group_idsList : NULL,
|
||||
shared_vn_group_data_ids ? shared_vn_group_data_idsList : NULL,
|
||||
subscribed_ue_ambr ? subscribed_ue_ambr_local_nonprim : NULL,
|
||||
|
@ -1420,6 +1651,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
soraf_retrieval ? soraf_retrieval->valueint : 0,
|
||||
sor_update_indicator_list ? sor_update_indicator_listList : NULL,
|
||||
upu_info ? upu_info_local_nonprim : NULL,
|
||||
routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL,
|
||||
mico_allowed ? true : false,
|
||||
mico_allowed ? mico_allowed->valueint : 0,
|
||||
shared_am_data_ids ? shared_am_data_idsList : NULL,
|
||||
|
@ -1448,8 +1680,14 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
ptw_parameters_list ? ptw_parameters_listList : NULL,
|
||||
iab_operation_allowed ? true : false,
|
||||
iab_operation_allowed ? iab_operation_allowed->valueint : 0,
|
||||
adjacent_plmn_restrictions ? adjacent_plmn_restrictionsList : NULL,
|
||||
wireline_forbidden_areas ? wireline_forbidden_areasList : NULL,
|
||||
wireline_service_area_restriction ? wireline_service_area_restriction_local_nonprim : NULL
|
||||
wireline_service_area_restriction ? wireline_service_area_restriction_local_nonprim : NULL,
|
||||
pcf_selection_assistance_infos ? pcf_selection_assistance_infosList : NULL,
|
||||
aerial_ue_sub_info ? aerial_ue_sub_info_local_nonprim : NULL,
|
||||
roaming_restrictions ? roaming_restrictions_local_nonprim : NULL,
|
||||
remote_prov_ind ? true : false,
|
||||
remote_prov_ind ? remote_prov_ind->valueint : 0
|
||||
);
|
||||
|
||||
return access_and_mobility_subscription_data_1_local_var;
|
||||
|
@ -1573,6 +1811,16 @@ end:
|
|||
OpenAPI_list_free(ptw_parameters_listList);
|
||||
ptw_parameters_listList = NULL;
|
||||
}
|
||||
if (adjacent_plmn_restrictionsList) {
|
||||
OpenAPI_list_for_each(adjacent_plmn_restrictionsList, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_plmn_restriction_1_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(adjacent_plmn_restrictionsList);
|
||||
adjacent_plmn_restrictionsList = NULL;
|
||||
}
|
||||
if (wireline_forbidden_areasList) {
|
||||
OpenAPI_list_for_each(wireline_forbidden_areasList, node) {
|
||||
OpenAPI_wireline_area_1_free(node->data);
|
||||
|
@ -1584,6 +1832,21 @@ end:
|
|||
OpenAPI_wireline_service_area_restriction_1_free(wireline_service_area_restriction_local_nonprim);
|
||||
wireline_service_area_restriction_local_nonprim = NULL;
|
||||
}
|
||||
if (pcf_selection_assistance_infosList) {
|
||||
OpenAPI_list_for_each(pcf_selection_assistance_infosList, node) {
|
||||
OpenAPI_pcf_selection_assistance_info_1_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(pcf_selection_assistance_infosList);
|
||||
pcf_selection_assistance_infosList = NULL;
|
||||
}
|
||||
if (aerial_ue_sub_info_local_nonprim) {
|
||||
OpenAPI_aerial_ue_subscription_info_1_free(aerial_ue_sub_info_local_nonprim);
|
||||
aerial_ue_sub_info_local_nonprim = NULL;
|
||||
}
|
||||
if (roaming_restrictions_local_nonprim) {
|
||||
OpenAPI_roaming_restrictions_free(roaming_restrictions_local_nonprim);
|
||||
roaming_restrictions_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "aerial_ue_subscription_info_1.h"
|
||||
#include "ambr_rm.h"
|
||||
#include "area_1.h"
|
||||
#include "cag_data_1.h"
|
||||
|
@ -23,9 +24,13 @@
|
|||
#include "mdt_user_consent.h"
|
||||
#include "nssai_1.h"
|
||||
#include "odb_packet_services.h"
|
||||
#include "pcf_selection_assistance_info_1.h"
|
||||
#include "plmn_restriction_1.h"
|
||||
#include "ptw_parameters_1.h"
|
||||
#include "rat_type.h"
|
||||
#include "roaming_restrictions.h"
|
||||
#include "service_area_restriction_1.h"
|
||||
#include "set.h"
|
||||
#include "sor_info_1.h"
|
||||
#include "sor_update_indicator.h"
|
||||
#include "trace_data.h"
|
||||
|
@ -41,11 +46,12 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_1_s OpenAPI_access_
|
|||
typedef struct OpenAPI_access_and_mobility_subscription_data_1_s {
|
||||
char *supported_features;
|
||||
OpenAPI_list_t *gpsis;
|
||||
char *hss_group_id;
|
||||
OpenAPI_list_t *internal_group_ids;
|
||||
OpenAPI_list_t* shared_vn_group_data_ids;
|
||||
struct OpenAPI_ambr_rm_s *subscribed_ue_ambr;
|
||||
struct OpenAPI_nssai_1_s *nssai;
|
||||
OpenAPI_list_t *rat_restrictions;
|
||||
OpenAPI_set_t *rat_restrictions;
|
||||
OpenAPI_list_t *forbidden_areas;
|
||||
struct OpenAPI_service_area_restriction_1_s *service_area_restriction;
|
||||
OpenAPI_list_t *core_network_type_restrictions;
|
||||
|
@ -68,6 +74,7 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_1_s {
|
|||
int soraf_retrieval;
|
||||
OpenAPI_list_t *sor_update_indicator_list;
|
||||
struct OpenAPI_upu_info_1_s *upu_info;
|
||||
char *routing_indicator;
|
||||
bool is_mico_allowed;
|
||||
int mico_allowed;
|
||||
OpenAPI_list_t *shared_am_data_ids;
|
||||
|
@ -90,24 +97,31 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_1_s {
|
|||
bool is_ec_restriction_data_nb;
|
||||
int ec_restriction_data_nb;
|
||||
struct OpenAPI_expected_ue_behaviour_data_1_s *expected_ue_behaviour_list;
|
||||
OpenAPI_list_t *primary_rat_restrictions;
|
||||
OpenAPI_list_t *secondary_rat_restrictions;
|
||||
OpenAPI_set_t *primary_rat_restrictions;
|
||||
OpenAPI_set_t *secondary_rat_restrictions;
|
||||
OpenAPI_list_t *edrx_parameters_list;
|
||||
OpenAPI_list_t *ptw_parameters_list;
|
||||
bool is_iab_operation_allowed;
|
||||
int iab_operation_allowed;
|
||||
OpenAPI_list_t* adjacent_plmn_restrictions;
|
||||
OpenAPI_list_t *wireline_forbidden_areas;
|
||||
struct OpenAPI_wireline_service_area_restriction_1_s *wireline_service_area_restriction;
|
||||
OpenAPI_list_t *pcf_selection_assistance_infos;
|
||||
struct OpenAPI_aerial_ue_subscription_info_1_s *aerial_ue_sub_info;
|
||||
struct OpenAPI_roaming_restrictions_s *roaming_restrictions;
|
||||
bool is_remote_prov_ind;
|
||||
int remote_prov_ind;
|
||||
} OpenAPI_access_and_mobility_subscription_data_1_t;
|
||||
|
||||
OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_subscription_data_1_create(
|
||||
char *supported_features,
|
||||
OpenAPI_list_t *gpsis,
|
||||
char *hss_group_id,
|
||||
OpenAPI_list_t *internal_group_ids,
|
||||
OpenAPI_list_t* shared_vn_group_data_ids,
|
||||
OpenAPI_ambr_rm_t *subscribed_ue_ambr,
|
||||
OpenAPI_nssai_1_t *nssai,
|
||||
OpenAPI_list_t *rat_restrictions,
|
||||
OpenAPI_set_t *rat_restrictions,
|
||||
OpenAPI_list_t *forbidden_areas,
|
||||
OpenAPI_service_area_restriction_1_t *service_area_restriction,
|
||||
OpenAPI_list_t *core_network_type_restrictions,
|
||||
|
@ -130,6 +144,7 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
int soraf_retrieval,
|
||||
OpenAPI_list_t *sor_update_indicator_list,
|
||||
OpenAPI_upu_info_1_t *upu_info,
|
||||
char *routing_indicator,
|
||||
bool is_mico_allowed,
|
||||
int mico_allowed,
|
||||
OpenAPI_list_t *shared_am_data_ids,
|
||||
|
@ -152,14 +167,20 @@ OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_s
|
|||
bool is_ec_restriction_data_nb,
|
||||
int ec_restriction_data_nb,
|
||||
OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_list,
|
||||
OpenAPI_list_t *primary_rat_restrictions,
|
||||
OpenAPI_list_t *secondary_rat_restrictions,
|
||||
OpenAPI_set_t *primary_rat_restrictions,
|
||||
OpenAPI_set_t *secondary_rat_restrictions,
|
||||
OpenAPI_list_t *edrx_parameters_list,
|
||||
OpenAPI_list_t *ptw_parameters_list,
|
||||
bool is_iab_operation_allowed,
|
||||
int iab_operation_allowed,
|
||||
OpenAPI_list_t* adjacent_plmn_restrictions,
|
||||
OpenAPI_list_t *wireline_forbidden_areas,
|
||||
OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction
|
||||
OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction,
|
||||
OpenAPI_list_t *pcf_selection_assistance_infos,
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_sub_info,
|
||||
OpenAPI_roaming_restrictions_t *roaming_restrictions,
|
||||
bool is_remote_prov_ind,
|
||||
int remote_prov_ind
|
||||
);
|
||||
void OpenAPI_access_and_mobility_subscription_data_1_free(OpenAPI_access_and_mobility_subscription_data_1_t *access_and_mobility_subscription_data_1);
|
||||
OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON(cJSON *access_and_mobility_subscription_data_1JSON);
|
||||
|
|
|
@ -5,14 +5,18 @@
|
|||
#include "access_net_charging_identifier.h"
|
||||
|
||||
OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_create(
|
||||
bool is_acc_net_cha_id_value,
|
||||
int acc_net_cha_id_value,
|
||||
char *acc_net_charg_id_string,
|
||||
OpenAPI_list_t *flows
|
||||
)
|
||||
{
|
||||
OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier_local_var = ogs_malloc(sizeof(OpenAPI_access_net_charging_identifier_t));
|
||||
ogs_assert(access_net_charging_identifier_local_var);
|
||||
|
||||
access_net_charging_identifier_local_var->is_acc_net_cha_id_value = is_acc_net_cha_id_value;
|
||||
access_net_charging_identifier_local_var->acc_net_cha_id_value = acc_net_cha_id_value;
|
||||
access_net_charging_identifier_local_var->acc_net_charg_id_string = acc_net_charg_id_string;
|
||||
access_net_charging_identifier_local_var->flows = flows;
|
||||
|
||||
return access_net_charging_identifier_local_var;
|
||||
|
@ -25,6 +29,10 @@ void OpenAPI_access_net_charging_identifier_free(OpenAPI_access_net_charging_ide
|
|||
if (NULL == access_net_charging_identifier) {
|
||||
return;
|
||||
}
|
||||
if (access_net_charging_identifier->acc_net_charg_id_string) {
|
||||
ogs_free(access_net_charging_identifier->acc_net_charg_id_string);
|
||||
access_net_charging_identifier->acc_net_charg_id_string = NULL;
|
||||
}
|
||||
if (access_net_charging_identifier->flows) {
|
||||
OpenAPI_list_for_each(access_net_charging_identifier->flows, node) {
|
||||
OpenAPI_flows_free(node->data);
|
||||
|
@ -46,10 +54,19 @@ cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_c
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (access_net_charging_identifier->is_acc_net_cha_id_value) {
|
||||
if (cJSON_AddNumberToObject(item, "accNetChaIdValue", access_net_charging_identifier->acc_net_cha_id_value) == NULL) {
|
||||
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [acc_net_cha_id_value]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_net_charging_identifier->acc_net_charg_id_string) {
|
||||
if (cJSON_AddStringToObject(item, "accNetChargIdString", access_net_charging_identifier->acc_net_charg_id_string) == NULL) {
|
||||
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [acc_net_charg_id_string]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_net_charging_identifier->flows) {
|
||||
cJSON *flowsList = cJSON_AddArrayToObject(item, "flows");
|
||||
|
@ -76,17 +93,24 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
|
|||
OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *acc_net_cha_id_value = NULL;
|
||||
cJSON *acc_net_charg_id_string = NULL;
|
||||
cJSON *flows = NULL;
|
||||
OpenAPI_list_t *flowsList = NULL;
|
||||
acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChaIdValue");
|
||||
if (!acc_net_cha_id_value) {
|
||||
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]");
|
||||
goto end;
|
||||
}
|
||||
if (acc_net_cha_id_value) {
|
||||
if (!cJSON_IsNumber(acc_net_cha_id_value)) {
|
||||
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
acc_net_charg_id_string = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChargIdString");
|
||||
if (acc_net_charg_id_string) {
|
||||
if (!cJSON_IsString(acc_net_charg_id_string) && !cJSON_IsNull(acc_net_charg_id_string)) {
|
||||
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_charg_id_string]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows");
|
||||
if (flows) {
|
||||
|
@ -114,8 +138,9 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
|
|||
}
|
||||
|
||||
access_net_charging_identifier_local_var = OpenAPI_access_net_charging_identifier_create (
|
||||
|
||||
acc_net_cha_id_value->valuedouble,
|
||||
acc_net_cha_id_value ? true : false,
|
||||
acc_net_cha_id_value ? acc_net_cha_id_value->valuedouble : 0,
|
||||
acc_net_charg_id_string && !cJSON_IsNull(acc_net_charg_id_string) ? ogs_strdup(acc_net_charg_id_string->valuestring) : NULL,
|
||||
flows ? flowsList : NULL
|
||||
);
|
||||
|
||||
|
|
|
@ -20,12 +20,16 @@ extern "C" {
|
|||
|
||||
typedef struct OpenAPI_access_net_charging_identifier_s OpenAPI_access_net_charging_identifier_t;
|
||||
typedef struct OpenAPI_access_net_charging_identifier_s {
|
||||
bool is_acc_net_cha_id_value;
|
||||
int acc_net_cha_id_value;
|
||||
char *acc_net_charg_id_string;
|
||||
OpenAPI_list_t *flows;
|
||||
} OpenAPI_access_net_charging_identifier_t;
|
||||
|
||||
OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_create(
|
||||
bool is_acc_net_cha_id_value,
|
||||
int acc_net_cha_id_value,
|
||||
char *acc_net_charg_id_string,
|
||||
OpenAPI_list_t *flows
|
||||
);
|
||||
void OpenAPI_access_net_charging_identifier_free(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* access_right_status.h
|
||||
*
|
||||
* Possible values are - FULLY_ALLOWED: The User is fully allowed to access to the channel. - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. - NO_ALLOWED: The User is not allowed to access to the channel.
|
||||
* Possible values are: - FULLY_ALLOWED: The User is fully allowed to access to the channel. - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. - NO_ALLOWED: The User is not allowed to access to the channel.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_access_right_status_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* access_tech.h
|
||||
*
|
||||
*
|
||||
* Represents the access technology
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_access_tech_H_
|
||||
|
|
|
@ -40,10 +40,13 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_create(
|
|||
char *requester_fqdn,
|
||||
OpenAPI_list_t *requester_snpn_list,
|
||||
OpenAPI_plmn_id_t *target_plmn,
|
||||
OpenAPI_plmn_id_nid_t *target_snpn,
|
||||
OpenAPI_list_t *target_snssai_list,
|
||||
OpenAPI_list_t *target_nsi_list,
|
||||
char *target_nf_set_id,
|
||||
char *target_nf_service_set_id
|
||||
char *target_nf_service_set_id,
|
||||
char *hnrf_access_token_uri,
|
||||
char *source_nf_instance_id
|
||||
)
|
||||
{
|
||||
OpenAPI_access_token_req_t *access_token_req_local_var = ogs_malloc(sizeof(OpenAPI_access_token_req_t));
|
||||
|
@ -61,10 +64,13 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_create(
|
|||
access_token_req_local_var->requester_fqdn = requester_fqdn;
|
||||
access_token_req_local_var->requester_snpn_list = requester_snpn_list;
|
||||
access_token_req_local_var->target_plmn = target_plmn;
|
||||
access_token_req_local_var->target_snpn = target_snpn;
|
||||
access_token_req_local_var->target_snssai_list = target_snssai_list;
|
||||
access_token_req_local_var->target_nsi_list = target_nsi_list;
|
||||
access_token_req_local_var->target_nf_set_id = target_nf_set_id;
|
||||
access_token_req_local_var->target_nf_service_set_id = target_nf_service_set_id;
|
||||
access_token_req_local_var->hnrf_access_token_uri = hnrf_access_token_uri;
|
||||
access_token_req_local_var->source_nf_instance_id = source_nf_instance_id;
|
||||
|
||||
return access_token_req_local_var;
|
||||
}
|
||||
|
@ -121,6 +127,10 @@ void OpenAPI_access_token_req_free(OpenAPI_access_token_req_t *access_token_req)
|
|||
OpenAPI_plmn_id_free(access_token_req->target_plmn);
|
||||
access_token_req->target_plmn = NULL;
|
||||
}
|
||||
if (access_token_req->target_snpn) {
|
||||
OpenAPI_plmn_id_nid_free(access_token_req->target_snpn);
|
||||
access_token_req->target_snpn = NULL;
|
||||
}
|
||||
if (access_token_req->target_snssai_list) {
|
||||
OpenAPI_list_for_each(access_token_req->target_snssai_list, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
|
@ -143,6 +153,14 @@ void OpenAPI_access_token_req_free(OpenAPI_access_token_req_t *access_token_req)
|
|||
ogs_free(access_token_req->target_nf_service_set_id);
|
||||
access_token_req->target_nf_service_set_id = NULL;
|
||||
}
|
||||
if (access_token_req->hnrf_access_token_uri) {
|
||||
ogs_free(access_token_req->hnrf_access_token_uri);
|
||||
access_token_req->hnrf_access_token_uri = NULL;
|
||||
}
|
||||
if (access_token_req->source_nf_instance_id) {
|
||||
ogs_free(access_token_req->source_nf_instance_id);
|
||||
access_token_req->source_nf_instance_id = NULL;
|
||||
}
|
||||
ogs_free(access_token_req);
|
||||
}
|
||||
|
||||
|
@ -286,6 +304,19 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access
|
|||
}
|
||||
}
|
||||
|
||||
if (access_token_req->target_snpn) {
|
||||
cJSON *target_snpn_local_JSON = OpenAPI_plmn_id_nid_convertToJSON(access_token_req->target_snpn);
|
||||
if (target_snpn_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snpn]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "targetSnpn", target_snpn_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snpn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_token_req->target_snssai_list) {
|
||||
cJSON *target_snssai_listList = cJSON_AddArrayToObject(item, "targetSnssaiList");
|
||||
if (target_snssai_listList == NULL) {
|
||||
|
@ -330,6 +361,20 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access
|
|||
}
|
||||
}
|
||||
|
||||
if (access_token_req->hnrf_access_token_uri) {
|
||||
if (cJSON_AddStringToObject(item, "hnrfAccessTokenUri", access_token_req->hnrf_access_token_uri) == NULL) {
|
||||
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [hnrf_access_token_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_token_req->source_nf_instance_id) {
|
||||
if (cJSON_AddStringToObject(item, "sourceNfInstanceId", access_token_req->source_nf_instance_id) == NULL) {
|
||||
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [source_nf_instance_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -358,12 +403,16 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access
|
|||
OpenAPI_list_t *requester_snpn_listList = NULL;
|
||||
cJSON *target_plmn = NULL;
|
||||
OpenAPI_plmn_id_t *target_plmn_local_nonprim = NULL;
|
||||
cJSON *target_snpn = NULL;
|
||||
OpenAPI_plmn_id_nid_t *target_snpn_local_nonprim = NULL;
|
||||
cJSON *target_snssai_list = NULL;
|
||||
OpenAPI_list_t *target_snssai_listList = NULL;
|
||||
cJSON *target_nsi_list = NULL;
|
||||
OpenAPI_list_t *target_nsi_listList = NULL;
|
||||
cJSON *target_nf_set_id = NULL;
|
||||
cJSON *target_nf_service_set_id = NULL;
|
||||
cJSON *hnrf_access_token_uri = NULL;
|
||||
cJSON *source_nf_instance_id = NULL;
|
||||
grant_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "grant_type");
|
||||
if (!grant_type) {
|
||||
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [grant_type]");
|
||||
|
@ -514,6 +563,11 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access
|
|||
target_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(target_plmn);
|
||||
}
|
||||
|
||||
target_snpn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetSnpn");
|
||||
if (target_snpn) {
|
||||
target_snpn_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(target_snpn);
|
||||
}
|
||||
|
||||
target_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetSnssaiList");
|
||||
if (target_snssai_list) {
|
||||
cJSON *target_snssai_list_local = NULL;
|
||||
|
@ -576,6 +630,22 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access
|
|||
}
|
||||
}
|
||||
|
||||
hnrf_access_token_uri = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "hnrfAccessTokenUri");
|
||||
if (hnrf_access_token_uri) {
|
||||
if (!cJSON_IsString(hnrf_access_token_uri) && !cJSON_IsNull(hnrf_access_token_uri)) {
|
||||
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [hnrf_access_token_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
source_nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "sourceNfInstanceId");
|
||||
if (source_nf_instance_id) {
|
||||
if (!cJSON_IsString(source_nf_instance_id) && !cJSON_IsNull(source_nf_instance_id)) {
|
||||
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [source_nf_instance_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
access_token_req_local_var = OpenAPI_access_token_req_create (
|
||||
grant_typeVariable,
|
||||
ogs_strdup(nf_instance_id->valuestring),
|
||||
|
@ -589,10 +659,13 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access
|
|||
requester_fqdn && !cJSON_IsNull(requester_fqdn) ? ogs_strdup(requester_fqdn->valuestring) : NULL,
|
||||
requester_snpn_list ? requester_snpn_listList : NULL,
|
||||
target_plmn ? target_plmn_local_nonprim : NULL,
|
||||
target_snpn ? target_snpn_local_nonprim : NULL,
|
||||
target_snssai_list ? target_snssai_listList : NULL,
|
||||
target_nsi_list ? target_nsi_listList : NULL,
|
||||
target_nf_set_id && !cJSON_IsNull(target_nf_set_id) ? ogs_strdup(target_nf_set_id->valuestring) : NULL,
|
||||
target_nf_service_set_id && !cJSON_IsNull(target_nf_service_set_id) ? ogs_strdup(target_nf_service_set_id->valuestring) : NULL
|
||||
target_nf_service_set_id && !cJSON_IsNull(target_nf_service_set_id) ? ogs_strdup(target_nf_service_set_id->valuestring) : NULL,
|
||||
hnrf_access_token_uri && !cJSON_IsNull(hnrf_access_token_uri) ? ogs_strdup(hnrf_access_token_uri->valuestring) : NULL,
|
||||
source_nf_instance_id && !cJSON_IsNull(source_nf_instance_id) ? ogs_strdup(source_nf_instance_id->valuestring) : NULL
|
||||
);
|
||||
|
||||
return access_token_req_local_var;
|
||||
|
@ -626,6 +699,10 @@ end:
|
|||
OpenAPI_plmn_id_free(target_plmn_local_nonprim);
|
||||
target_plmn_local_nonprim = NULL;
|
||||
}
|
||||
if (target_snpn_local_nonprim) {
|
||||
OpenAPI_plmn_id_nid_free(target_snpn_local_nonprim);
|
||||
target_snpn_local_nonprim = NULL;
|
||||
}
|
||||
if (target_snssai_listList) {
|
||||
OpenAPI_list_for_each(target_snssai_listList, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
|
|
|
@ -40,10 +40,13 @@ typedef struct OpenAPI_access_token_req_s {
|
|||
char *requester_fqdn;
|
||||
OpenAPI_list_t *requester_snpn_list;
|
||||
struct OpenAPI_plmn_id_s *target_plmn;
|
||||
struct OpenAPI_plmn_id_nid_s *target_snpn;
|
||||
OpenAPI_list_t *target_snssai_list;
|
||||
OpenAPI_list_t *target_nsi_list;
|
||||
char *target_nf_set_id;
|
||||
char *target_nf_service_set_id;
|
||||
char *hnrf_access_token_uri;
|
||||
char *source_nf_instance_id;
|
||||
} OpenAPI_access_token_req_t;
|
||||
|
||||
OpenAPI_access_token_req_t *OpenAPI_access_token_req_create(
|
||||
|
@ -59,10 +62,13 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_create(
|
|||
char *requester_fqdn,
|
||||
OpenAPI_list_t *requester_snpn_list,
|
||||
OpenAPI_plmn_id_t *target_plmn,
|
||||
OpenAPI_plmn_id_nid_t *target_snpn,
|
||||
OpenAPI_list_t *target_snssai_list,
|
||||
OpenAPI_list_t *target_nsi_list,
|
||||
char *target_nf_set_id,
|
||||
char *target_nf_service_set_id
|
||||
char *target_nf_service_set_id,
|
||||
char *hnrf_access_token_uri,
|
||||
char *source_nf_instance_id
|
||||
);
|
||||
void OpenAPI_access_token_req_free(OpenAPI_access_token_req_t *access_token_req);
|
||||
OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access_token_reqJSON);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* access_type.h
|
||||
*
|
||||
*
|
||||
* Indicates whether the access is via 3GPP or via non-3GPP.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_access_type_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* access_type_rm.h
|
||||
*
|
||||
*
|
||||
* Indicates wether the access is via 3GPP or via non-3GPP but with the OpenAPI 'nullable: true' property.\"
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_access_type_rm_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* accu_usage_report.h
|
||||
*
|
||||
*
|
||||
* Contains the accumulated usage report information.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_accu_usage_report_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* accumulated_usage.h
|
||||
*
|
||||
*
|
||||
* Represents an accumulated usage.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_accumulated_usage_H_
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "accuracy.h"
|
||||
|
||||
OpenAPI_accuracy_t *OpenAPI_accuracy_create(
|
||||
)
|
||||
{
|
||||
OpenAPI_accuracy_t *accuracy_local_var = ogs_malloc(sizeof(OpenAPI_accuracy_t));
|
||||
ogs_assert(accuracy_local_var);
|
||||
|
||||
|
||||
return accuracy_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_accuracy_free(OpenAPI_accuracy_t *accuracy)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == accuracy) {
|
||||
return;
|
||||
}
|
||||
ogs_free(accuracy);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_accuracy_convertToJSON(OpenAPI_accuracy_t *accuracy)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (accuracy == NULL) {
|
||||
ogs_error("OpenAPI_accuracy_convertToJSON() failed [Accuracy]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_accuracy_t *OpenAPI_accuracy_parseFromJSON(cJSON *accuracyJSON)
|
||||
{
|
||||
OpenAPI_accuracy_t *accuracy_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
accuracy_local_var = OpenAPI_accuracy_create (
|
||||
);
|
||||
|
||||
return accuracy_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_accuracy_t *OpenAPI_accuracy_copy(OpenAPI_accuracy_t *dst, OpenAPI_accuracy_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_accuracy_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_accuracy_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_accuracy_free(dst);
|
||||
dst = OpenAPI_accuracy_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* accuracy.h
|
||||
*
|
||||
* Possible values are: - LOW: Low accuracy. - HIGH: High accuracy.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_accuracy_H_
|
||||
#define _OpenAPI_accuracy_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "accuracy_any_of.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_accuracy_s OpenAPI_accuracy_t;
|
||||
typedef struct OpenAPI_accuracy_s {
|
||||
} OpenAPI_accuracy_t;
|
||||
|
||||
OpenAPI_accuracy_t *OpenAPI_accuracy_create(
|
||||
);
|
||||
void OpenAPI_accuracy_free(OpenAPI_accuracy_t *accuracy);
|
||||
OpenAPI_accuracy_t *OpenAPI_accuracy_parseFromJSON(cJSON *accuracyJSON);
|
||||
cJSON *OpenAPI_accuracy_convertToJSON(OpenAPI_accuracy_t *accuracy);
|
||||
OpenAPI_accuracy_t *OpenAPI_accuracy_copy(OpenAPI_accuracy_t *dst, OpenAPI_accuracy_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_accuracy_H_ */
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "accuracy_any_of.h"
|
||||
|
||||
char* OpenAPI_accuracy_any_of_ToString(OpenAPI_accuracy_any_of_e accuracy_any_of)
|
||||
{
|
||||
const char *accuracy_any_ofArray[] = { "NULL", "LOW", "HIGH" };
|
||||
size_t sizeofArray = sizeof(accuracy_any_ofArray) / sizeof(accuracy_any_ofArray[0]);
|
||||
if (accuracy_any_of < sizeofArray)
|
||||
return (char *)accuracy_any_ofArray[accuracy_any_of];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_accuracy_any_of_e OpenAPI_accuracy_any_of_FromString(char* accuracy_any_of)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *accuracy_any_ofArray[] = { "NULL", "LOW", "HIGH" };
|
||||
size_t sizeofArray = sizeof(accuracy_any_ofArray) / sizeof(accuracy_any_ofArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(accuracy_any_of, accuracy_any_ofArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* accuracy_any_of.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_accuracy_any_of_H_
|
||||
#define _OpenAPI_accuracy_any_of_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum { OpenAPI_accuracy_any_of_NULL = 0, OpenAPI_accuracy_any_of_LOW, OpenAPI_accuracy_any_of_HIGH } OpenAPI_accuracy_any_of_e;
|
||||
|
||||
char* OpenAPI_accuracy_any_of_ToString(OpenAPI_accuracy_any_of_e accuracy_any_of);
|
||||
|
||||
OpenAPI_accuracy_any_of_e OpenAPI_accuracy_any_of_FromString(char* accuracy_any_of);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_accuracy_any_of_H_ */
|
||||
|
|
@ -7,10 +7,11 @@
|
|||
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
|
||||
char *sor_mac_iue,
|
||||
char *upu_mac_iue,
|
||||
char *secured_packet,
|
||||
char *provisioning_time,
|
||||
char *sor_transparent_container,
|
||||
bool is_ue_not_reachable,
|
||||
int ue_not_reachable
|
||||
int ue_not_reachable,
|
||||
char *upu_transparent_container
|
||||
)
|
||||
{
|
||||
OpenAPI_acknowledge_info_t *acknowledge_info_local_var = ogs_malloc(sizeof(OpenAPI_acknowledge_info_t));
|
||||
|
@ -18,10 +19,11 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
|
|||
|
||||
acknowledge_info_local_var->sor_mac_iue = sor_mac_iue;
|
||||
acknowledge_info_local_var->upu_mac_iue = upu_mac_iue;
|
||||
acknowledge_info_local_var->secured_packet = secured_packet;
|
||||
acknowledge_info_local_var->provisioning_time = provisioning_time;
|
||||
acknowledge_info_local_var->sor_transparent_container = sor_transparent_container;
|
||||
acknowledge_info_local_var->is_ue_not_reachable = is_ue_not_reachable;
|
||||
acknowledge_info_local_var->ue_not_reachable = ue_not_reachable;
|
||||
acknowledge_info_local_var->upu_transparent_container = upu_transparent_container;
|
||||
|
||||
return acknowledge_info_local_var;
|
||||
}
|
||||
|
@ -41,14 +43,18 @@ void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info)
|
|||
ogs_free(acknowledge_info->upu_mac_iue);
|
||||
acknowledge_info->upu_mac_iue = NULL;
|
||||
}
|
||||
if (acknowledge_info->secured_packet) {
|
||||
ogs_free(acknowledge_info->secured_packet);
|
||||
acknowledge_info->secured_packet = NULL;
|
||||
}
|
||||
if (acknowledge_info->provisioning_time) {
|
||||
ogs_free(acknowledge_info->provisioning_time);
|
||||
acknowledge_info->provisioning_time = NULL;
|
||||
}
|
||||
if (acknowledge_info->sor_transparent_container) {
|
||||
ogs_free(acknowledge_info->sor_transparent_container);
|
||||
acknowledge_info->sor_transparent_container = NULL;
|
||||
}
|
||||
if (acknowledge_info->upu_transparent_container) {
|
||||
ogs_free(acknowledge_info->upu_transparent_container);
|
||||
acknowledge_info->upu_transparent_container = NULL;
|
||||
}
|
||||
ogs_free(acknowledge_info);
|
||||
}
|
||||
|
||||
|
@ -77,13 +83,6 @@ cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknow
|
|||
}
|
||||
}
|
||||
|
||||
if (acknowledge_info->secured_packet) {
|
||||
if (cJSON_AddStringToObject(item, "securedPacket", acknowledge_info->secured_packet) == NULL) {
|
||||
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [secured_packet]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (!acknowledge_info->provisioning_time) {
|
||||
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [provisioning_time]");
|
||||
return NULL;
|
||||
|
@ -93,6 +92,13 @@ cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknow
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (acknowledge_info->sor_transparent_container) {
|
||||
if (cJSON_AddStringToObject(item, "sorTransparentContainer", acknowledge_info->sor_transparent_container) == NULL) {
|
||||
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [sor_transparent_container]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (acknowledge_info->is_ue_not_reachable) {
|
||||
if (cJSON_AddBoolToObject(item, "ueNotReachable", acknowledge_info->ue_not_reachable) == NULL) {
|
||||
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [ue_not_reachable]");
|
||||
|
@ -100,6 +106,13 @@ cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknow
|
|||
}
|
||||
}
|
||||
|
||||
if (acknowledge_info->upu_transparent_container) {
|
||||
if (cJSON_AddStringToObject(item, "upuTransparentContainer", acknowledge_info->upu_transparent_container) == NULL) {
|
||||
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [upu_transparent_container]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -110,9 +123,10 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow
|
|||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *sor_mac_iue = NULL;
|
||||
cJSON *upu_mac_iue = NULL;
|
||||
cJSON *secured_packet = NULL;
|
||||
cJSON *provisioning_time = NULL;
|
||||
cJSON *sor_transparent_container = NULL;
|
||||
cJSON *ue_not_reachable = NULL;
|
||||
cJSON *upu_transparent_container = NULL;
|
||||
sor_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorMacIue");
|
||||
if (sor_mac_iue) {
|
||||
if (!cJSON_IsString(sor_mac_iue) && !cJSON_IsNull(sor_mac_iue)) {
|
||||
|
@ -129,14 +143,6 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow
|
|||
}
|
||||
}
|
||||
|
||||
secured_packet = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "securedPacket");
|
||||
if (secured_packet) {
|
||||
if (!cJSON_IsString(secured_packet) && !cJSON_IsNull(secured_packet)) {
|
||||
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [secured_packet]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
provisioning_time = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "provisioningTime");
|
||||
if (!provisioning_time) {
|
||||
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]");
|
||||
|
@ -147,6 +153,14 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow
|
|||
goto end;
|
||||
}
|
||||
|
||||
sor_transparent_container = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorTransparentContainer");
|
||||
if (sor_transparent_container) {
|
||||
if (!cJSON_IsString(sor_transparent_container) && !cJSON_IsNull(sor_transparent_container)) {
|
||||
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [sor_transparent_container]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ue_not_reachable = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "ueNotReachable");
|
||||
if (ue_not_reachable) {
|
||||
if (!cJSON_IsBool(ue_not_reachable)) {
|
||||
|
@ -155,13 +169,22 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow
|
|||
}
|
||||
}
|
||||
|
||||
upu_transparent_container = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "upuTransparentContainer");
|
||||
if (upu_transparent_container) {
|
||||
if (!cJSON_IsString(upu_transparent_container) && !cJSON_IsNull(upu_transparent_container)) {
|
||||
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [upu_transparent_container]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
acknowledge_info_local_var = OpenAPI_acknowledge_info_create (
|
||||
sor_mac_iue && !cJSON_IsNull(sor_mac_iue) ? ogs_strdup(sor_mac_iue->valuestring) : NULL,
|
||||
upu_mac_iue && !cJSON_IsNull(upu_mac_iue) ? ogs_strdup(upu_mac_iue->valuestring) : NULL,
|
||||
secured_packet && !cJSON_IsNull(secured_packet) ? ogs_strdup(secured_packet->valuestring) : NULL,
|
||||
ogs_strdup(provisioning_time->valuestring),
|
||||
sor_transparent_container && !cJSON_IsNull(sor_transparent_container) ? ogs_strdup(sor_transparent_container->valuestring) : NULL,
|
||||
ue_not_reachable ? true : false,
|
||||
ue_not_reachable ? ue_not_reachable->valueint : 0
|
||||
ue_not_reachable ? ue_not_reachable->valueint : 0,
|
||||
upu_transparent_container && !cJSON_IsNull(upu_transparent_container) ? ogs_strdup(upu_transparent_container->valuestring) : NULL
|
||||
);
|
||||
|
||||
return acknowledge_info_local_var;
|
||||
|
|
|
@ -21,19 +21,21 @@ typedef struct OpenAPI_acknowledge_info_s OpenAPI_acknowledge_info_t;
|
|||
typedef struct OpenAPI_acknowledge_info_s {
|
||||
char *sor_mac_iue;
|
||||
char *upu_mac_iue;
|
||||
char *secured_packet;
|
||||
char *provisioning_time;
|
||||
char *sor_transparent_container;
|
||||
bool is_ue_not_reachable;
|
||||
int ue_not_reachable;
|
||||
char *upu_transparent_container;
|
||||
} OpenAPI_acknowledge_info_t;
|
||||
|
||||
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
|
||||
char *sor_mac_iue,
|
||||
char *upu_mac_iue,
|
||||
char *secured_packet,
|
||||
char *provisioning_time,
|
||||
char *sor_transparent_container,
|
||||
bool is_ue_not_reachable,
|
||||
int ue_not_reachable
|
||||
int ue_not_reachable,
|
||||
char *upu_transparent_container
|
||||
);
|
||||
void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info);
|
||||
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* acs_info.h
|
||||
*
|
||||
*
|
||||
* The ACS information for the 5G-RG is defined in BBF TR-069 [42] or in BBF TR-369
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_acs_info_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* acs_info_1.h
|
||||
*
|
||||
*
|
||||
* The ACS information for the 5G-RG is defined in BBF TR-069 [42] or in BBF TR-369
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_acs_info_1_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* acs_info_rm.h
|
||||
*
|
||||
*
|
||||
* This data type is defined in the same way as the 'AcsInfo' data type, but with the OpenAPI 'nullable: true' property.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_acs_info_rm_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* additional_access_info.h
|
||||
*
|
||||
*
|
||||
* Indicates the combination of additional Access Type and RAT Type for a MA PDU session.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_additional_access_info_H_
|
||||
|
|
|
@ -0,0 +1,209 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "additional_ee_subs_info.h"
|
||||
|
||||
OpenAPI_additional_ee_subs_info_t *OpenAPI_additional_ee_subs_info_create(
|
||||
OpenAPI_list_t *amf_subscription_info_list,
|
||||
OpenAPI_smf_subscription_info_t *smf_subscription_info,
|
||||
OpenAPI_hss_subscription_info_t *hss_subscription_info
|
||||
)
|
||||
{
|
||||
OpenAPI_additional_ee_subs_info_t *additional_ee_subs_info_local_var = ogs_malloc(sizeof(OpenAPI_additional_ee_subs_info_t));
|
||||
ogs_assert(additional_ee_subs_info_local_var);
|
||||
|
||||
additional_ee_subs_info_local_var->amf_subscription_info_list = amf_subscription_info_list;
|
||||
additional_ee_subs_info_local_var->smf_subscription_info = smf_subscription_info;
|
||||
additional_ee_subs_info_local_var->hss_subscription_info = hss_subscription_info;
|
||||
|
||||
return additional_ee_subs_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_additional_ee_subs_info_free(OpenAPI_additional_ee_subs_info_t *additional_ee_subs_info)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == additional_ee_subs_info) {
|
||||
return;
|
||||
}
|
||||
if (additional_ee_subs_info->amf_subscription_info_list) {
|
||||
OpenAPI_list_for_each(additional_ee_subs_info->amf_subscription_info_list, node) {
|
||||
OpenAPI_amf_subscription_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(additional_ee_subs_info->amf_subscription_info_list);
|
||||
additional_ee_subs_info->amf_subscription_info_list = NULL;
|
||||
}
|
||||
if (additional_ee_subs_info->smf_subscription_info) {
|
||||
OpenAPI_smf_subscription_info_free(additional_ee_subs_info->smf_subscription_info);
|
||||
additional_ee_subs_info->smf_subscription_info = NULL;
|
||||
}
|
||||
if (additional_ee_subs_info->hss_subscription_info) {
|
||||
OpenAPI_hss_subscription_info_free(additional_ee_subs_info->hss_subscription_info);
|
||||
additional_ee_subs_info->hss_subscription_info = NULL;
|
||||
}
|
||||
ogs_free(additional_ee_subs_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_additional_ee_subs_info_convertToJSON(OpenAPI_additional_ee_subs_info_t *additional_ee_subs_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (additional_ee_subs_info == NULL) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_convertToJSON() failed [AdditionalEeSubsInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (additional_ee_subs_info->amf_subscription_info_list) {
|
||||
cJSON *amf_subscription_info_listList = cJSON_AddArrayToObject(item, "amfSubscriptionInfoList");
|
||||
if (amf_subscription_info_listList == NULL) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_convertToJSON() failed [amf_subscription_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(additional_ee_subs_info->amf_subscription_info_list, node) {
|
||||
cJSON *itemLocal = OpenAPI_amf_subscription_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_convertToJSON() failed [amf_subscription_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(amf_subscription_info_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_ee_subs_info->smf_subscription_info) {
|
||||
cJSON *smf_subscription_info_local_JSON = OpenAPI_smf_subscription_info_convertToJSON(additional_ee_subs_info->smf_subscription_info);
|
||||
if (smf_subscription_info_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_convertToJSON() failed [smf_subscription_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "smfSubscriptionInfo", smf_subscription_info_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_convertToJSON() failed [smf_subscription_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_ee_subs_info->hss_subscription_info) {
|
||||
cJSON *hss_subscription_info_local_JSON = OpenAPI_hss_subscription_info_convertToJSON(additional_ee_subs_info->hss_subscription_info);
|
||||
if (hss_subscription_info_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_convertToJSON() failed [hss_subscription_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "hssSubscriptionInfo", hss_subscription_info_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_convertToJSON() failed [hss_subscription_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_additional_ee_subs_info_t *OpenAPI_additional_ee_subs_info_parseFromJSON(cJSON *additional_ee_subs_infoJSON)
|
||||
{
|
||||
OpenAPI_additional_ee_subs_info_t *additional_ee_subs_info_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *amf_subscription_info_list = NULL;
|
||||
OpenAPI_list_t *amf_subscription_info_listList = NULL;
|
||||
cJSON *smf_subscription_info = NULL;
|
||||
OpenAPI_smf_subscription_info_t *smf_subscription_info_local_nonprim = NULL;
|
||||
cJSON *hss_subscription_info = NULL;
|
||||
OpenAPI_hss_subscription_info_t *hss_subscription_info_local_nonprim = NULL;
|
||||
amf_subscription_info_list = cJSON_GetObjectItemCaseSensitive(additional_ee_subs_infoJSON, "amfSubscriptionInfoList");
|
||||
if (amf_subscription_info_list) {
|
||||
cJSON *amf_subscription_info_list_local = NULL;
|
||||
if (!cJSON_IsArray(amf_subscription_info_list)) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_parseFromJSON() failed [amf_subscription_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
amf_subscription_info_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(amf_subscription_info_list_local, amf_subscription_info_list) {
|
||||
if (!cJSON_IsObject(amf_subscription_info_list_local)) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_parseFromJSON() failed [amf_subscription_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_amf_subscription_info_t *amf_subscription_info_listItem = OpenAPI_amf_subscription_info_parseFromJSON(amf_subscription_info_list_local);
|
||||
if (!amf_subscription_info_listItem) {
|
||||
ogs_error("No amf_subscription_info_listItem");
|
||||
OpenAPI_list_free(amf_subscription_info_listList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(amf_subscription_info_listList, amf_subscription_info_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
smf_subscription_info = cJSON_GetObjectItemCaseSensitive(additional_ee_subs_infoJSON, "smfSubscriptionInfo");
|
||||
if (smf_subscription_info) {
|
||||
smf_subscription_info_local_nonprim = OpenAPI_smf_subscription_info_parseFromJSON(smf_subscription_info);
|
||||
}
|
||||
|
||||
hss_subscription_info = cJSON_GetObjectItemCaseSensitive(additional_ee_subs_infoJSON, "hssSubscriptionInfo");
|
||||
if (hss_subscription_info) {
|
||||
hss_subscription_info_local_nonprim = OpenAPI_hss_subscription_info_parseFromJSON(hss_subscription_info);
|
||||
}
|
||||
|
||||
additional_ee_subs_info_local_var = OpenAPI_additional_ee_subs_info_create (
|
||||
amf_subscription_info_list ? amf_subscription_info_listList : NULL,
|
||||
smf_subscription_info ? smf_subscription_info_local_nonprim : NULL,
|
||||
hss_subscription_info ? hss_subscription_info_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return additional_ee_subs_info_local_var;
|
||||
end:
|
||||
if (amf_subscription_info_listList) {
|
||||
OpenAPI_list_for_each(amf_subscription_info_listList, node) {
|
||||
OpenAPI_amf_subscription_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_subscription_info_listList);
|
||||
amf_subscription_info_listList = NULL;
|
||||
}
|
||||
if (smf_subscription_info_local_nonprim) {
|
||||
OpenAPI_smf_subscription_info_free(smf_subscription_info_local_nonprim);
|
||||
smf_subscription_info_local_nonprim = NULL;
|
||||
}
|
||||
if (hss_subscription_info_local_nonprim) {
|
||||
OpenAPI_hss_subscription_info_free(hss_subscription_info_local_nonprim);
|
||||
hss_subscription_info_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_ee_subs_info_t *OpenAPI_additional_ee_subs_info_copy(OpenAPI_additional_ee_subs_info_t *dst, OpenAPI_additional_ee_subs_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_additional_ee_subs_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_additional_ee_subs_info_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_additional_ee_subs_info_free(dst);
|
||||
dst = OpenAPI_additional_ee_subs_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* additional_ee_subs_info.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_additional_ee_subs_info_H_
|
||||
#define _OpenAPI_additional_ee_subs_info_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "amf_subscription_info.h"
|
||||
#include "hss_subscription_info.h"
|
||||
#include "smf_subscription_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_additional_ee_subs_info_s OpenAPI_additional_ee_subs_info_t;
|
||||
typedef struct OpenAPI_additional_ee_subs_info_s {
|
||||
OpenAPI_list_t *amf_subscription_info_list;
|
||||
struct OpenAPI_smf_subscription_info_s *smf_subscription_info;
|
||||
struct OpenAPI_hss_subscription_info_s *hss_subscription_info;
|
||||
} OpenAPI_additional_ee_subs_info_t;
|
||||
|
||||
OpenAPI_additional_ee_subs_info_t *OpenAPI_additional_ee_subs_info_create(
|
||||
OpenAPI_list_t *amf_subscription_info_list,
|
||||
OpenAPI_smf_subscription_info_t *smf_subscription_info,
|
||||
OpenAPI_hss_subscription_info_t *hss_subscription_info
|
||||
);
|
||||
void OpenAPI_additional_ee_subs_info_free(OpenAPI_additional_ee_subs_info_t *additional_ee_subs_info);
|
||||
OpenAPI_additional_ee_subs_info_t *OpenAPI_additional_ee_subs_info_parseFromJSON(cJSON *additional_ee_subs_infoJSON);
|
||||
cJSON *OpenAPI_additional_ee_subs_info_convertToJSON(OpenAPI_additional_ee_subs_info_t *additional_ee_subs_info);
|
||||
OpenAPI_additional_ee_subs_info_t *OpenAPI_additional_ee_subs_info_copy(OpenAPI_additional_ee_subs_info_t *dst, OpenAPI_additional_ee_subs_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_additional_ee_subs_info_H_ */
|
||||
|
|
@ -0,0 +1,345 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "additional_measurement.h"
|
||||
|
||||
OpenAPI_additional_measurement_t *OpenAPI_additional_measurement_create(
|
||||
OpenAPI_network_area_info_t *unexp_loc,
|
||||
OpenAPI_list_t *unexp_flow_teps,
|
||||
OpenAPI_list_t *unexp_wakes,
|
||||
OpenAPI_address_list_t *ddos_attack,
|
||||
OpenAPI_address_list_t *wrg_dest,
|
||||
OpenAPI_list_t *circums
|
||||
)
|
||||
{
|
||||
OpenAPI_additional_measurement_t *additional_measurement_local_var = ogs_malloc(sizeof(OpenAPI_additional_measurement_t));
|
||||
ogs_assert(additional_measurement_local_var);
|
||||
|
||||
additional_measurement_local_var->unexp_loc = unexp_loc;
|
||||
additional_measurement_local_var->unexp_flow_teps = unexp_flow_teps;
|
||||
additional_measurement_local_var->unexp_wakes = unexp_wakes;
|
||||
additional_measurement_local_var->ddos_attack = ddos_attack;
|
||||
additional_measurement_local_var->wrg_dest = wrg_dest;
|
||||
additional_measurement_local_var->circums = circums;
|
||||
|
||||
return additional_measurement_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_additional_measurement_free(OpenAPI_additional_measurement_t *additional_measurement)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == additional_measurement) {
|
||||
return;
|
||||
}
|
||||
if (additional_measurement->unexp_loc) {
|
||||
OpenAPI_network_area_info_free(additional_measurement->unexp_loc);
|
||||
additional_measurement->unexp_loc = NULL;
|
||||
}
|
||||
if (additional_measurement->unexp_flow_teps) {
|
||||
OpenAPI_list_for_each(additional_measurement->unexp_flow_teps, node) {
|
||||
OpenAPI_ip_eth_flow_description_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(additional_measurement->unexp_flow_teps);
|
||||
additional_measurement->unexp_flow_teps = NULL;
|
||||
}
|
||||
if (additional_measurement->unexp_wakes) {
|
||||
OpenAPI_list_for_each(additional_measurement->unexp_wakes, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(additional_measurement->unexp_wakes);
|
||||
additional_measurement->unexp_wakes = NULL;
|
||||
}
|
||||
if (additional_measurement->ddos_attack) {
|
||||
OpenAPI_address_list_free(additional_measurement->ddos_attack);
|
||||
additional_measurement->ddos_attack = NULL;
|
||||
}
|
||||
if (additional_measurement->wrg_dest) {
|
||||
OpenAPI_address_list_free(additional_measurement->wrg_dest);
|
||||
additional_measurement->wrg_dest = NULL;
|
||||
}
|
||||
if (additional_measurement->circums) {
|
||||
OpenAPI_list_for_each(additional_measurement->circums, node) {
|
||||
OpenAPI_circumstance_description_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(additional_measurement->circums);
|
||||
additional_measurement->circums = NULL;
|
||||
}
|
||||
ogs_free(additional_measurement);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_additional_measurement_convertToJSON(OpenAPI_additional_measurement_t *additional_measurement)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (additional_measurement == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [AdditionalMeasurement]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (additional_measurement->unexp_loc) {
|
||||
cJSON *unexp_loc_local_JSON = OpenAPI_network_area_info_convertToJSON(additional_measurement->unexp_loc);
|
||||
if (unexp_loc_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [unexp_loc]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "unexpLoc", unexp_loc_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [unexp_loc]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_measurement->unexp_flow_teps) {
|
||||
cJSON *unexp_flow_tepsList = cJSON_AddArrayToObject(item, "unexpFlowTeps");
|
||||
if (unexp_flow_tepsList == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [unexp_flow_teps]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(additional_measurement->unexp_flow_teps, node) {
|
||||
cJSON *itemLocal = OpenAPI_ip_eth_flow_description_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [unexp_flow_teps]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(unexp_flow_tepsList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_measurement->unexp_wakes) {
|
||||
cJSON *unexp_wakesList = cJSON_AddArrayToObject(item, "unexpWakes");
|
||||
if (unexp_wakesList == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [unexp_wakes]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(additional_measurement->unexp_wakes, node) {
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_measurement->ddos_attack) {
|
||||
cJSON *ddos_attack_local_JSON = OpenAPI_address_list_convertToJSON(additional_measurement->ddos_attack);
|
||||
if (ddos_attack_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [ddos_attack]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "ddosAttack", ddos_attack_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [ddos_attack]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_measurement->wrg_dest) {
|
||||
cJSON *wrg_dest_local_JSON = OpenAPI_address_list_convertToJSON(additional_measurement->wrg_dest);
|
||||
if (wrg_dest_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [wrg_dest]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "wrgDest", wrg_dest_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [wrg_dest]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_measurement->circums) {
|
||||
cJSON *circumsList = cJSON_AddArrayToObject(item, "circums");
|
||||
if (circumsList == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [circums]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(additional_measurement->circums, node) {
|
||||
cJSON *itemLocal = OpenAPI_circumstance_description_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_additional_measurement_convertToJSON() failed [circums]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(circumsList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_additional_measurement_t *OpenAPI_additional_measurement_parseFromJSON(cJSON *additional_measurementJSON)
|
||||
{
|
||||
OpenAPI_additional_measurement_t *additional_measurement_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *unexp_loc = NULL;
|
||||
OpenAPI_network_area_info_t *unexp_loc_local_nonprim = NULL;
|
||||
cJSON *unexp_flow_teps = NULL;
|
||||
OpenAPI_list_t *unexp_flow_tepsList = NULL;
|
||||
cJSON *unexp_wakes = NULL;
|
||||
OpenAPI_list_t *unexp_wakesList = NULL;
|
||||
cJSON *ddos_attack = NULL;
|
||||
OpenAPI_address_list_t *ddos_attack_local_nonprim = NULL;
|
||||
cJSON *wrg_dest = NULL;
|
||||
OpenAPI_address_list_t *wrg_dest_local_nonprim = NULL;
|
||||
cJSON *circums = NULL;
|
||||
OpenAPI_list_t *circumsList = NULL;
|
||||
unexp_loc = cJSON_GetObjectItemCaseSensitive(additional_measurementJSON, "unexpLoc");
|
||||
if (unexp_loc) {
|
||||
unexp_loc_local_nonprim = OpenAPI_network_area_info_parseFromJSON(unexp_loc);
|
||||
}
|
||||
|
||||
unexp_flow_teps = cJSON_GetObjectItemCaseSensitive(additional_measurementJSON, "unexpFlowTeps");
|
||||
if (unexp_flow_teps) {
|
||||
cJSON *unexp_flow_teps_local = NULL;
|
||||
if (!cJSON_IsArray(unexp_flow_teps)) {
|
||||
ogs_error("OpenAPI_additional_measurement_parseFromJSON() failed [unexp_flow_teps]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
unexp_flow_tepsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(unexp_flow_teps_local, unexp_flow_teps) {
|
||||
if (!cJSON_IsObject(unexp_flow_teps_local)) {
|
||||
ogs_error("OpenAPI_additional_measurement_parseFromJSON() failed [unexp_flow_teps]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_ip_eth_flow_description_t *unexp_flow_tepsItem = OpenAPI_ip_eth_flow_description_parseFromJSON(unexp_flow_teps_local);
|
||||
if (!unexp_flow_tepsItem) {
|
||||
ogs_error("No unexp_flow_tepsItem");
|
||||
OpenAPI_list_free(unexp_flow_tepsList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(unexp_flow_tepsList, unexp_flow_tepsItem);
|
||||
}
|
||||
}
|
||||
|
||||
unexp_wakes = cJSON_GetObjectItemCaseSensitive(additional_measurementJSON, "unexpWakes");
|
||||
if (unexp_wakes) {
|
||||
cJSON *unexp_wakes_local = NULL;
|
||||
if (!cJSON_IsArray(unexp_wakes)) {
|
||||
ogs_error("OpenAPI_additional_measurement_parseFromJSON() failed [unexp_wakes]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
unexp_wakesList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(unexp_wakes_local, unexp_wakes) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ddos_attack = cJSON_GetObjectItemCaseSensitive(additional_measurementJSON, "ddosAttack");
|
||||
if (ddos_attack) {
|
||||
ddos_attack_local_nonprim = OpenAPI_address_list_parseFromJSON(ddos_attack);
|
||||
}
|
||||
|
||||
wrg_dest = cJSON_GetObjectItemCaseSensitive(additional_measurementJSON, "wrgDest");
|
||||
if (wrg_dest) {
|
||||
wrg_dest_local_nonprim = OpenAPI_address_list_parseFromJSON(wrg_dest);
|
||||
}
|
||||
|
||||
circums = cJSON_GetObjectItemCaseSensitive(additional_measurementJSON, "circums");
|
||||
if (circums) {
|
||||
cJSON *circums_local = NULL;
|
||||
if (!cJSON_IsArray(circums)) {
|
||||
ogs_error("OpenAPI_additional_measurement_parseFromJSON() failed [circums]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
circumsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(circums_local, circums) {
|
||||
if (!cJSON_IsObject(circums_local)) {
|
||||
ogs_error("OpenAPI_additional_measurement_parseFromJSON() failed [circums]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_circumstance_description_t *circumsItem = OpenAPI_circumstance_description_parseFromJSON(circums_local);
|
||||
if (!circumsItem) {
|
||||
ogs_error("No circumsItem");
|
||||
OpenAPI_list_free(circumsList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(circumsList, circumsItem);
|
||||
}
|
||||
}
|
||||
|
||||
additional_measurement_local_var = OpenAPI_additional_measurement_create (
|
||||
unexp_loc ? unexp_loc_local_nonprim : NULL,
|
||||
unexp_flow_teps ? unexp_flow_tepsList : NULL,
|
||||
unexp_wakes ? unexp_wakesList : NULL,
|
||||
ddos_attack ? ddos_attack_local_nonprim : NULL,
|
||||
wrg_dest ? wrg_dest_local_nonprim : NULL,
|
||||
circums ? circumsList : NULL
|
||||
);
|
||||
|
||||
return additional_measurement_local_var;
|
||||
end:
|
||||
if (unexp_loc_local_nonprim) {
|
||||
OpenAPI_network_area_info_free(unexp_loc_local_nonprim);
|
||||
unexp_loc_local_nonprim = NULL;
|
||||
}
|
||||
if (unexp_flow_tepsList) {
|
||||
OpenAPI_list_for_each(unexp_flow_tepsList, node) {
|
||||
OpenAPI_ip_eth_flow_description_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(unexp_flow_tepsList);
|
||||
unexp_flow_tepsList = NULL;
|
||||
}
|
||||
if (unexp_wakesList) {
|
||||
OpenAPI_list_for_each(unexp_wakesList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(unexp_wakesList);
|
||||
unexp_wakesList = NULL;
|
||||
}
|
||||
if (ddos_attack_local_nonprim) {
|
||||
OpenAPI_address_list_free(ddos_attack_local_nonprim);
|
||||
ddos_attack_local_nonprim = NULL;
|
||||
}
|
||||
if (wrg_dest_local_nonprim) {
|
||||
OpenAPI_address_list_free(wrg_dest_local_nonprim);
|
||||
wrg_dest_local_nonprim = NULL;
|
||||
}
|
||||
if (circumsList) {
|
||||
OpenAPI_list_for_each(circumsList, node) {
|
||||
OpenAPI_circumstance_description_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(circumsList);
|
||||
circumsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_measurement_t *OpenAPI_additional_measurement_copy(OpenAPI_additional_measurement_t *dst, OpenAPI_additional_measurement_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_additional_measurement_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_additional_measurement_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_additional_measurement_free(dst);
|
||||
dst = OpenAPI_additional_measurement_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
* additional_measurement.h
|
||||
*
|
||||
* Represents additional measurement information.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_additional_measurement_H_
|
||||
#define _OpenAPI_additional_measurement_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "address_list.h"
|
||||
#include "circumstance_description.h"
|
||||
#include "ip_eth_flow_description.h"
|
||||
#include "network_area_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_additional_measurement_s OpenAPI_additional_measurement_t;
|
||||
typedef struct OpenAPI_additional_measurement_s {
|
||||
struct OpenAPI_network_area_info_s *unexp_loc;
|
||||
OpenAPI_list_t *unexp_flow_teps;
|
||||
OpenAPI_list_t *unexp_wakes;
|
||||
struct OpenAPI_address_list_s *ddos_attack;
|
||||
struct OpenAPI_address_list_s *wrg_dest;
|
||||
OpenAPI_list_t *circums;
|
||||
} OpenAPI_additional_measurement_t;
|
||||
|
||||
OpenAPI_additional_measurement_t *OpenAPI_additional_measurement_create(
|
||||
OpenAPI_network_area_info_t *unexp_loc,
|
||||
OpenAPI_list_t *unexp_flow_teps,
|
||||
OpenAPI_list_t *unexp_wakes,
|
||||
OpenAPI_address_list_t *ddos_attack,
|
||||
OpenAPI_address_list_t *wrg_dest,
|
||||
OpenAPI_list_t *circums
|
||||
);
|
||||
void OpenAPI_additional_measurement_free(OpenAPI_additional_measurement_t *additional_measurement);
|
||||
OpenAPI_additional_measurement_t *OpenAPI_additional_measurement_parseFromJSON(cJSON *additional_measurementJSON);
|
||||
cJSON *OpenAPI_additional_measurement_convertToJSON(OpenAPI_additional_measurement_t *additional_measurement);
|
||||
OpenAPI_additional_measurement_t *OpenAPI_additional_measurement_copy(OpenAPI_additional_measurement_t *dst, OpenAPI_additional_measurement_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_additional_measurement_H_ */
|
||||
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
|
||||
bool is_required_authn_authz,
|
||||
int required_authn_authz
|
||||
int required_authn_authz,
|
||||
OpenAPI_slice_mbr_rm_t *subscribed_ue_slice_mbr,
|
||||
OpenAPI_list_t *subscribed_ns_srg_list
|
||||
)
|
||||
{
|
||||
OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = ogs_malloc(sizeof(OpenAPI_additional_snssai_data_t));
|
||||
|
@ -14,6 +16,8 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
|
|||
|
||||
additional_snssai_data_local_var->is_required_authn_authz = is_required_authn_authz;
|
||||
additional_snssai_data_local_var->required_authn_authz = required_authn_authz;
|
||||
additional_snssai_data_local_var->subscribed_ue_slice_mbr = subscribed_ue_slice_mbr;
|
||||
additional_snssai_data_local_var->subscribed_ns_srg_list = subscribed_ns_srg_list;
|
||||
|
||||
return additional_snssai_data_local_var;
|
||||
}
|
||||
|
@ -25,6 +29,17 @@ void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *addit
|
|||
if (NULL == additional_snssai_data) {
|
||||
return;
|
||||
}
|
||||
if (additional_snssai_data->subscribed_ue_slice_mbr) {
|
||||
OpenAPI_slice_mbr_rm_free(additional_snssai_data->subscribed_ue_slice_mbr);
|
||||
additional_snssai_data->subscribed_ue_slice_mbr = NULL;
|
||||
}
|
||||
if (additional_snssai_data->subscribed_ns_srg_list) {
|
||||
OpenAPI_list_for_each(additional_snssai_data->subscribed_ns_srg_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(additional_snssai_data->subscribed_ns_srg_list);
|
||||
additional_snssai_data->subscribed_ns_srg_list = NULL;
|
||||
}
|
||||
ogs_free(additional_snssai_data);
|
||||
}
|
||||
|
||||
|
@ -46,6 +61,33 @@ cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_da
|
|||
}
|
||||
}
|
||||
|
||||
if (additional_snssai_data->subscribed_ue_slice_mbr) {
|
||||
cJSON *subscribed_ue_slice_mbr_local_JSON = OpenAPI_slice_mbr_rm_convertToJSON(additional_snssai_data->subscribed_ue_slice_mbr);
|
||||
if (subscribed_ue_slice_mbr_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [subscribed_ue_slice_mbr]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "subscribedUeSliceMbr", subscribed_ue_slice_mbr_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [subscribed_ue_slice_mbr]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_snssai_data->subscribed_ns_srg_list) {
|
||||
cJSON *subscribed_ns_srg_listList = cJSON_AddArrayToObject(item, "subscribedNsSrgList");
|
||||
if (subscribed_ns_srg_listList == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(additional_snssai_data->subscribed_ns_srg_list, node) {
|
||||
if (cJSON_AddStringToObject(subscribed_ns_srg_listList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -55,6 +97,10 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(c
|
|||
OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *required_authn_authz = NULL;
|
||||
cJSON *subscribed_ue_slice_mbr = NULL;
|
||||
OpenAPI_slice_mbr_rm_t *subscribed_ue_slice_mbr_local_nonprim = NULL;
|
||||
cJSON *subscribed_ns_srg_list = NULL;
|
||||
OpenAPI_list_t *subscribed_ns_srg_listList = NULL;
|
||||
required_authn_authz = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "requiredAuthnAuthz");
|
||||
if (required_authn_authz) {
|
||||
if (!cJSON_IsBool(required_authn_authz)) {
|
||||
|
@ -63,13 +109,52 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(c
|
|||
}
|
||||
}
|
||||
|
||||
subscribed_ue_slice_mbr = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "subscribedUeSliceMbr");
|
||||
if (subscribed_ue_slice_mbr) {
|
||||
subscribed_ue_slice_mbr_local_nonprim = OpenAPI_slice_mbr_rm_parseFromJSON(subscribed_ue_slice_mbr);
|
||||
}
|
||||
|
||||
subscribed_ns_srg_list = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "subscribedNsSrgList");
|
||||
if (subscribed_ns_srg_list) {
|
||||
cJSON *subscribed_ns_srg_list_local = NULL;
|
||||
if (!cJSON_IsArray(subscribed_ns_srg_list)) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_parseFromJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
subscribed_ns_srg_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(subscribed_ns_srg_list_local, subscribed_ns_srg_list) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(subscribed_ns_srg_list_local)) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_parseFromJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(subscribed_ns_srg_listList, ogs_strdup(subscribed_ns_srg_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
additional_snssai_data_local_var = OpenAPI_additional_snssai_data_create (
|
||||
required_authn_authz ? true : false,
|
||||
required_authn_authz ? required_authn_authz->valueint : 0
|
||||
required_authn_authz ? required_authn_authz->valueint : 0,
|
||||
subscribed_ue_slice_mbr ? subscribed_ue_slice_mbr_local_nonprim : NULL,
|
||||
subscribed_ns_srg_list ? subscribed_ns_srg_listList : NULL
|
||||
);
|
||||
|
||||
return additional_snssai_data_local_var;
|
||||
end:
|
||||
if (subscribed_ue_slice_mbr_local_nonprim) {
|
||||
OpenAPI_slice_mbr_rm_free(subscribed_ue_slice_mbr_local_nonprim);
|
||||
subscribed_ue_slice_mbr_local_nonprim = NULL;
|
||||
}
|
||||
if (subscribed_ns_srg_listList) {
|
||||
OpenAPI_list_for_each(subscribed_ns_srg_listList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(subscribed_ns_srg_listList);
|
||||
subscribed_ns_srg_listList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "slice_mbr_rm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -21,11 +22,15 @@ typedef struct OpenAPI_additional_snssai_data_s OpenAPI_additional_snssai_data_t
|
|||
typedef struct OpenAPI_additional_snssai_data_s {
|
||||
bool is_required_authn_authz;
|
||||
int required_authn_authz;
|
||||
struct OpenAPI_slice_mbr_rm_s *subscribed_ue_slice_mbr;
|
||||
OpenAPI_list_t *subscribed_ns_srg_list;
|
||||
} OpenAPI_additional_snssai_data_t;
|
||||
|
||||
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
|
||||
bool is_required_authn_authz,
|
||||
int required_authn_authz
|
||||
int required_authn_authz,
|
||||
OpenAPI_slice_mbr_rm_t *subscribed_ue_slice_mbr,
|
||||
OpenAPI_list_t *subscribed_ns_srg_list
|
||||
);
|
||||
void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data);
|
||||
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON);
|
||||
|
|
|
@ -0,0 +1,194 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "additional_snssai_data_1.h"
|
||||
|
||||
OpenAPI_additional_snssai_data_1_t *OpenAPI_additional_snssai_data_1_create(
|
||||
bool is_required_authn_authz,
|
||||
int required_authn_authz,
|
||||
OpenAPI_slice_mbr_rm_t *subscribed_ue_slice_mbr,
|
||||
OpenAPI_list_t *subscribed_ns_srg_list
|
||||
)
|
||||
{
|
||||
OpenAPI_additional_snssai_data_1_t *additional_snssai_data_1_local_var = ogs_malloc(sizeof(OpenAPI_additional_snssai_data_1_t));
|
||||
ogs_assert(additional_snssai_data_1_local_var);
|
||||
|
||||
additional_snssai_data_1_local_var->is_required_authn_authz = is_required_authn_authz;
|
||||
additional_snssai_data_1_local_var->required_authn_authz = required_authn_authz;
|
||||
additional_snssai_data_1_local_var->subscribed_ue_slice_mbr = subscribed_ue_slice_mbr;
|
||||
additional_snssai_data_1_local_var->subscribed_ns_srg_list = subscribed_ns_srg_list;
|
||||
|
||||
return additional_snssai_data_1_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_additional_snssai_data_1_free(OpenAPI_additional_snssai_data_1_t *additional_snssai_data_1)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == additional_snssai_data_1) {
|
||||
return;
|
||||
}
|
||||
if (additional_snssai_data_1->subscribed_ue_slice_mbr) {
|
||||
OpenAPI_slice_mbr_rm_free(additional_snssai_data_1->subscribed_ue_slice_mbr);
|
||||
additional_snssai_data_1->subscribed_ue_slice_mbr = NULL;
|
||||
}
|
||||
if (additional_snssai_data_1->subscribed_ns_srg_list) {
|
||||
OpenAPI_list_for_each(additional_snssai_data_1->subscribed_ns_srg_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(additional_snssai_data_1->subscribed_ns_srg_list);
|
||||
additional_snssai_data_1->subscribed_ns_srg_list = NULL;
|
||||
}
|
||||
ogs_free(additional_snssai_data_1);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_additional_snssai_data_1_convertToJSON(OpenAPI_additional_snssai_data_1_t *additional_snssai_data_1)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (additional_snssai_data_1 == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_convertToJSON() failed [AdditionalSnssaiData_1]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (additional_snssai_data_1->is_required_authn_authz) {
|
||||
if (cJSON_AddBoolToObject(item, "requiredAuthnAuthz", additional_snssai_data_1->required_authn_authz) == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_convertToJSON() failed [required_authn_authz]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_snssai_data_1->subscribed_ue_slice_mbr) {
|
||||
cJSON *subscribed_ue_slice_mbr_local_JSON = OpenAPI_slice_mbr_rm_convertToJSON(additional_snssai_data_1->subscribed_ue_slice_mbr);
|
||||
if (subscribed_ue_slice_mbr_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_convertToJSON() failed [subscribed_ue_slice_mbr]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "subscribedUeSliceMbr", subscribed_ue_slice_mbr_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_convertToJSON() failed [subscribed_ue_slice_mbr]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (additional_snssai_data_1->subscribed_ns_srg_list) {
|
||||
cJSON *subscribed_ns_srg_listList = cJSON_AddArrayToObject(item, "subscribedNsSrgList");
|
||||
if (subscribed_ns_srg_listList == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_convertToJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(additional_snssai_data_1->subscribed_ns_srg_list, node) {
|
||||
if (cJSON_AddStringToObject(subscribed_ns_srg_listList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_convertToJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_additional_snssai_data_1_t *OpenAPI_additional_snssai_data_1_parseFromJSON(cJSON *additional_snssai_data_1JSON)
|
||||
{
|
||||
OpenAPI_additional_snssai_data_1_t *additional_snssai_data_1_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *required_authn_authz = NULL;
|
||||
cJSON *subscribed_ue_slice_mbr = NULL;
|
||||
OpenAPI_slice_mbr_rm_t *subscribed_ue_slice_mbr_local_nonprim = NULL;
|
||||
cJSON *subscribed_ns_srg_list = NULL;
|
||||
OpenAPI_list_t *subscribed_ns_srg_listList = NULL;
|
||||
required_authn_authz = cJSON_GetObjectItemCaseSensitive(additional_snssai_data_1JSON, "requiredAuthnAuthz");
|
||||
if (required_authn_authz) {
|
||||
if (!cJSON_IsBool(required_authn_authz)) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_parseFromJSON() failed [required_authn_authz]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
subscribed_ue_slice_mbr = cJSON_GetObjectItemCaseSensitive(additional_snssai_data_1JSON, "subscribedUeSliceMbr");
|
||||
if (subscribed_ue_slice_mbr) {
|
||||
subscribed_ue_slice_mbr_local_nonprim = OpenAPI_slice_mbr_rm_parseFromJSON(subscribed_ue_slice_mbr);
|
||||
}
|
||||
|
||||
subscribed_ns_srg_list = cJSON_GetObjectItemCaseSensitive(additional_snssai_data_1JSON, "subscribedNsSrgList");
|
||||
if (subscribed_ns_srg_list) {
|
||||
cJSON *subscribed_ns_srg_list_local = NULL;
|
||||
if (!cJSON_IsArray(subscribed_ns_srg_list)) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_parseFromJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
subscribed_ns_srg_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(subscribed_ns_srg_list_local, subscribed_ns_srg_list) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(subscribed_ns_srg_list_local)) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_parseFromJSON() failed [subscribed_ns_srg_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(subscribed_ns_srg_listList, ogs_strdup(subscribed_ns_srg_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
additional_snssai_data_1_local_var = OpenAPI_additional_snssai_data_1_create (
|
||||
required_authn_authz ? true : false,
|
||||
required_authn_authz ? required_authn_authz->valueint : 0,
|
||||
subscribed_ue_slice_mbr ? subscribed_ue_slice_mbr_local_nonprim : NULL,
|
||||
subscribed_ns_srg_list ? subscribed_ns_srg_listList : NULL
|
||||
);
|
||||
|
||||
return additional_snssai_data_1_local_var;
|
||||
end:
|
||||
if (subscribed_ue_slice_mbr_local_nonprim) {
|
||||
OpenAPI_slice_mbr_rm_free(subscribed_ue_slice_mbr_local_nonprim);
|
||||
subscribed_ue_slice_mbr_local_nonprim = NULL;
|
||||
}
|
||||
if (subscribed_ns_srg_listList) {
|
||||
OpenAPI_list_for_each(subscribed_ns_srg_listList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(subscribed_ns_srg_listList);
|
||||
subscribed_ns_srg_listList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_snssai_data_1_t *OpenAPI_additional_snssai_data_1_copy(OpenAPI_additional_snssai_data_1_t *dst, OpenAPI_additional_snssai_data_1_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_additional_snssai_data_1_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_additional_snssai_data_1_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_additional_snssai_data_1_free(dst);
|
||||
dst = OpenAPI_additional_snssai_data_1_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* additional_snssai_data_1.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_additional_snssai_data_1_H_
|
||||
#define _OpenAPI_additional_snssai_data_1_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "slice_mbr_rm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_additional_snssai_data_1_s OpenAPI_additional_snssai_data_1_t;
|
||||
typedef struct OpenAPI_additional_snssai_data_1_s {
|
||||
bool is_required_authn_authz;
|
||||
int required_authn_authz;
|
||||
struct OpenAPI_slice_mbr_rm_s *subscribed_ue_slice_mbr;
|
||||
OpenAPI_list_t *subscribed_ns_srg_list;
|
||||
} OpenAPI_additional_snssai_data_1_t;
|
||||
|
||||
OpenAPI_additional_snssai_data_1_t *OpenAPI_additional_snssai_data_1_create(
|
||||
bool is_required_authn_authz,
|
||||
int required_authn_authz,
|
||||
OpenAPI_slice_mbr_rm_t *subscribed_ue_slice_mbr,
|
||||
OpenAPI_list_t *subscribed_ns_srg_list
|
||||
);
|
||||
void OpenAPI_additional_snssai_data_1_free(OpenAPI_additional_snssai_data_1_t *additional_snssai_data_1);
|
||||
OpenAPI_additional_snssai_data_1_t *OpenAPI_additional_snssai_data_1_parseFromJSON(cJSON *additional_snssai_data_1JSON);
|
||||
cJSON *OpenAPI_additional_snssai_data_1_convertToJSON(OpenAPI_additional_snssai_data_1_t *additional_snssai_data_1);
|
||||
OpenAPI_additional_snssai_data_1_t *OpenAPI_additional_snssai_data_1_copy(OpenAPI_additional_snssai_data_1_t *dst, OpenAPI_additional_snssai_data_1_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_additional_snssai_data_1_H_ */
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "addr_fqdn.h"
|
||||
|
||||
OpenAPI_addr_fqdn_t *OpenAPI_addr_fqdn_create(
|
||||
OpenAPI_ip_addr_t *ip_addr,
|
||||
char *fqdn
|
||||
)
|
||||
{
|
||||
OpenAPI_addr_fqdn_t *addr_fqdn_local_var = ogs_malloc(sizeof(OpenAPI_addr_fqdn_t));
|
||||
ogs_assert(addr_fqdn_local_var);
|
||||
|
||||
addr_fqdn_local_var->ip_addr = ip_addr;
|
||||
addr_fqdn_local_var->fqdn = fqdn;
|
||||
|
||||
return addr_fqdn_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_addr_fqdn_free(OpenAPI_addr_fqdn_t *addr_fqdn)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == addr_fqdn) {
|
||||
return;
|
||||
}
|
||||
if (addr_fqdn->ip_addr) {
|
||||
OpenAPI_ip_addr_free(addr_fqdn->ip_addr);
|
||||
addr_fqdn->ip_addr = NULL;
|
||||
}
|
||||
if (addr_fqdn->fqdn) {
|
||||
ogs_free(addr_fqdn->fqdn);
|
||||
addr_fqdn->fqdn = NULL;
|
||||
}
|
||||
ogs_free(addr_fqdn);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_addr_fqdn_convertToJSON(OpenAPI_addr_fqdn_t *addr_fqdn)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (addr_fqdn == NULL) {
|
||||
ogs_error("OpenAPI_addr_fqdn_convertToJSON() failed [AddrFqdn]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (addr_fqdn->ip_addr) {
|
||||
cJSON *ip_addr_local_JSON = OpenAPI_ip_addr_convertToJSON(addr_fqdn->ip_addr);
|
||||
if (ip_addr_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_addr_fqdn_convertToJSON() failed [ip_addr]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "ipAddr", ip_addr_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_addr_fqdn_convertToJSON() failed [ip_addr]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (addr_fqdn->fqdn) {
|
||||
if (cJSON_AddStringToObject(item, "fqdn", addr_fqdn->fqdn) == NULL) {
|
||||
ogs_error("OpenAPI_addr_fqdn_convertToJSON() failed [fqdn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_addr_fqdn_t *OpenAPI_addr_fqdn_parseFromJSON(cJSON *addr_fqdnJSON)
|
||||
{
|
||||
OpenAPI_addr_fqdn_t *addr_fqdn_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *ip_addr = NULL;
|
||||
OpenAPI_ip_addr_t *ip_addr_local_nonprim = NULL;
|
||||
cJSON *fqdn = NULL;
|
||||
ip_addr = cJSON_GetObjectItemCaseSensitive(addr_fqdnJSON, "ipAddr");
|
||||
if (ip_addr) {
|
||||
ip_addr_local_nonprim = OpenAPI_ip_addr_parseFromJSON(ip_addr);
|
||||
}
|
||||
|
||||
fqdn = cJSON_GetObjectItemCaseSensitive(addr_fqdnJSON, "fqdn");
|
||||
if (fqdn) {
|
||||
if (!cJSON_IsString(fqdn) && !cJSON_IsNull(fqdn)) {
|
||||
ogs_error("OpenAPI_addr_fqdn_parseFromJSON() failed [fqdn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
addr_fqdn_local_var = OpenAPI_addr_fqdn_create (
|
||||
ip_addr ? ip_addr_local_nonprim : NULL,
|
||||
fqdn && !cJSON_IsNull(fqdn) ? ogs_strdup(fqdn->valuestring) : NULL
|
||||
);
|
||||
|
||||
return addr_fqdn_local_var;
|
||||
end:
|
||||
if (ip_addr_local_nonprim) {
|
||||
OpenAPI_ip_addr_free(ip_addr_local_nonprim);
|
||||
ip_addr_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_addr_fqdn_t *OpenAPI_addr_fqdn_copy(OpenAPI_addr_fqdn_t *dst, OpenAPI_addr_fqdn_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_addr_fqdn_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_addr_fqdn_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_addr_fqdn_free(dst);
|
||||
dst = OpenAPI_addr_fqdn_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* addr_fqdn.h
|
||||
*
|
||||
* IP address and/or FQDN.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_addr_fqdn_H_
|
||||
#define _OpenAPI_addr_fqdn_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "ip_addr.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_addr_fqdn_s OpenAPI_addr_fqdn_t;
|
||||
typedef struct OpenAPI_addr_fqdn_s {
|
||||
struct OpenAPI_ip_addr_s *ip_addr;
|
||||
char *fqdn;
|
||||
} OpenAPI_addr_fqdn_t;
|
||||
|
||||
OpenAPI_addr_fqdn_t *OpenAPI_addr_fqdn_create(
|
||||
OpenAPI_ip_addr_t *ip_addr,
|
||||
char *fqdn
|
||||
);
|
||||
void OpenAPI_addr_fqdn_free(OpenAPI_addr_fqdn_t *addr_fqdn);
|
||||
OpenAPI_addr_fqdn_t *OpenAPI_addr_fqdn_parseFromJSON(cJSON *addr_fqdnJSON);
|
||||
cJSON *OpenAPI_addr_fqdn_convertToJSON(OpenAPI_addr_fqdn_t *addr_fqdn);
|
||||
OpenAPI_addr_fqdn_t *OpenAPI_addr_fqdn_copy(OpenAPI_addr_fqdn_t *dst, OpenAPI_addr_fqdn_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_addr_fqdn_H_ */
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "address_list.h"
|
||||
|
||||
OpenAPI_address_list_t *OpenAPI_address_list_create(
|
||||
OpenAPI_list_t *ipv4_addrs,
|
||||
OpenAPI_list_t *ipv6_addrs
|
||||
)
|
||||
{
|
||||
OpenAPI_address_list_t *address_list_local_var = ogs_malloc(sizeof(OpenAPI_address_list_t));
|
||||
ogs_assert(address_list_local_var);
|
||||
|
||||
address_list_local_var->ipv4_addrs = ipv4_addrs;
|
||||
address_list_local_var->ipv6_addrs = ipv6_addrs;
|
||||
|
||||
return address_list_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_address_list_free(OpenAPI_address_list_t *address_list)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == address_list) {
|
||||
return;
|
||||
}
|
||||
if (address_list->ipv4_addrs) {
|
||||
OpenAPI_list_for_each(address_list->ipv4_addrs, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(address_list->ipv4_addrs);
|
||||
address_list->ipv4_addrs = NULL;
|
||||
}
|
||||
if (address_list->ipv6_addrs) {
|
||||
OpenAPI_list_for_each(address_list->ipv6_addrs, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(address_list->ipv6_addrs);
|
||||
address_list->ipv6_addrs = NULL;
|
||||
}
|
||||
ogs_free(address_list);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_address_list_convertToJSON(OpenAPI_address_list_t *address_list)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (address_list == NULL) {
|
||||
ogs_error("OpenAPI_address_list_convertToJSON() failed [AddressList]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (address_list->ipv4_addrs) {
|
||||
cJSON *ipv4_addrsList = cJSON_AddArrayToObject(item, "ipv4Addrs");
|
||||
if (ipv4_addrsList == NULL) {
|
||||
ogs_error("OpenAPI_address_list_convertToJSON() failed [ipv4_addrs]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(address_list->ipv4_addrs, node) {
|
||||
if (cJSON_AddStringToObject(ipv4_addrsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_address_list_convertToJSON() failed [ipv4_addrs]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (address_list->ipv6_addrs) {
|
||||
cJSON *ipv6_addrsList = cJSON_AddArrayToObject(item, "ipv6Addrs");
|
||||
if (ipv6_addrsList == NULL) {
|
||||
ogs_error("OpenAPI_address_list_convertToJSON() failed [ipv6_addrs]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(address_list->ipv6_addrs, node) {
|
||||
if (cJSON_AddStringToObject(ipv6_addrsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_address_list_convertToJSON() failed [ipv6_addrs]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_address_list_t *OpenAPI_address_list_parseFromJSON(cJSON *address_listJSON)
|
||||
{
|
||||
OpenAPI_address_list_t *address_list_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *ipv4_addrs = NULL;
|
||||
OpenAPI_list_t *ipv4_addrsList = NULL;
|
||||
cJSON *ipv6_addrs = NULL;
|
||||
OpenAPI_list_t *ipv6_addrsList = NULL;
|
||||
ipv4_addrs = cJSON_GetObjectItemCaseSensitive(address_listJSON, "ipv4Addrs");
|
||||
if (ipv4_addrs) {
|
||||
cJSON *ipv4_addrs_local = NULL;
|
||||
if (!cJSON_IsArray(ipv4_addrs)) {
|
||||
ogs_error("OpenAPI_address_list_parseFromJSON() failed [ipv4_addrs]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ipv4_addrsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ipv4_addrs_local, ipv4_addrs) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(ipv4_addrs_local)) {
|
||||
ogs_error("OpenAPI_address_list_parseFromJSON() failed [ipv4_addrs]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(ipv4_addrsList, ogs_strdup(ipv4_addrs_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
ipv6_addrs = cJSON_GetObjectItemCaseSensitive(address_listJSON, "ipv6Addrs");
|
||||
if (ipv6_addrs) {
|
||||
cJSON *ipv6_addrs_local = NULL;
|
||||
if (!cJSON_IsArray(ipv6_addrs)) {
|
||||
ogs_error("OpenAPI_address_list_parseFromJSON() failed [ipv6_addrs]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ipv6_addrsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ipv6_addrs_local, ipv6_addrs) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(ipv6_addrs_local)) {
|
||||
ogs_error("OpenAPI_address_list_parseFromJSON() failed [ipv6_addrs]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(ipv6_addrsList, ogs_strdup(ipv6_addrs_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
address_list_local_var = OpenAPI_address_list_create (
|
||||
ipv4_addrs ? ipv4_addrsList : NULL,
|
||||
ipv6_addrs ? ipv6_addrsList : NULL
|
||||
);
|
||||
|
||||
return address_list_local_var;
|
||||
end:
|
||||
if (ipv4_addrsList) {
|
||||
OpenAPI_list_for_each(ipv4_addrsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ipv4_addrsList);
|
||||
ipv4_addrsList = NULL;
|
||||
}
|
||||
if (ipv6_addrsList) {
|
||||
OpenAPI_list_for_each(ipv6_addrsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ipv6_addrsList);
|
||||
ipv6_addrsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_address_list_t *OpenAPI_address_list_copy(OpenAPI_address_list_t *dst, OpenAPI_address_list_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_address_list_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_address_list_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_address_list_free(dst);
|
||||
dst = OpenAPI_address_list_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* address_list.h
|
||||
*
|
||||
* Represents a list of IPv4 and/or IPv6 addresses.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_address_list_H_
|
||||
#define _OpenAPI_address_list_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_address_list_s OpenAPI_address_list_t;
|
||||
typedef struct OpenAPI_address_list_s {
|
||||
OpenAPI_list_t *ipv4_addrs;
|
||||
OpenAPI_list_t *ipv6_addrs;
|
||||
} OpenAPI_address_list_t;
|
||||
|
||||
OpenAPI_address_list_t *OpenAPI_address_list_create(
|
||||
OpenAPI_list_t *ipv4_addrs,
|
||||
OpenAPI_list_t *ipv6_addrs
|
||||
);
|
||||
void OpenAPI_address_list_free(OpenAPI_address_list_t *address_list);
|
||||
OpenAPI_address_list_t *OpenAPI_address_list_parseFromJSON(cJSON *address_listJSON);
|
||||
cJSON *OpenAPI_address_list_convertToJSON(OpenAPI_address_list_t *address_list);
|
||||
OpenAPI_address_list_t *OpenAPI_address_list_copy(OpenAPI_address_list_t *dst, OpenAPI_address_list_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_address_list_H_ */
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "aerial_ue_indication.h"
|
||||
|
||||
char* OpenAPI_aerial_ue_indication_ToString(OpenAPI_aerial_ue_indication_e aerial_ue_indication)
|
||||
{
|
||||
const char *aerial_ue_indicationArray[] = { "NULL", "AERIAL_UE_ALLOWED", "AERIAL_UE_NOT_ALLOWED" };
|
||||
size_t sizeofArray = sizeof(aerial_ue_indicationArray) / sizeof(aerial_ue_indicationArray[0]);
|
||||
if (aerial_ue_indication < sizeofArray)
|
||||
return (char *)aerial_ue_indicationArray[aerial_ue_indication];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_aerial_ue_indication_e OpenAPI_aerial_ue_indication_FromString(char* aerial_ue_indication)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *aerial_ue_indicationArray[] = { "NULL", "AERIAL_UE_ALLOWED", "AERIAL_UE_NOT_ALLOWED" };
|
||||
size_t sizeofArray = sizeof(aerial_ue_indicationArray) / sizeof(aerial_ue_indicationArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(aerial_ue_indication, aerial_ue_indicationArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* aerial_ue_indication.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_aerial_ue_indication_H_
|
||||
#define _OpenAPI_aerial_ue_indication_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum { OpenAPI_aerial_ue_indication_NULL = 0, OpenAPI_aerial_ue_indication_AERIAL_UE_ALLOWED, OpenAPI_aerial_ue_indication_AERIAL_UE_NOT_ALLOWED } OpenAPI_aerial_ue_indication_e;
|
||||
|
||||
char* OpenAPI_aerial_ue_indication_ToString(OpenAPI_aerial_ue_indication_e aerial_ue_indication);
|
||||
|
||||
OpenAPI_aerial_ue_indication_e OpenAPI_aerial_ue_indication_FromString(char* aerial_ue_indication);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_aerial_ue_indication_H_ */
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "aerial_ue_subscription_info.h"
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_t *OpenAPI_aerial_ue_subscription_info_create(
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_ind,
|
||||
char *_3gpp_uav_id
|
||||
)
|
||||
{
|
||||
OpenAPI_aerial_ue_subscription_info_t *aerial_ue_subscription_info_local_var = ogs_malloc(sizeof(OpenAPI_aerial_ue_subscription_info_t));
|
||||
ogs_assert(aerial_ue_subscription_info_local_var);
|
||||
|
||||
aerial_ue_subscription_info_local_var->aerial_ue_ind = aerial_ue_ind;
|
||||
aerial_ue_subscription_info_local_var->_3gpp_uav_id = _3gpp_uav_id;
|
||||
|
||||
return aerial_ue_subscription_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_aerial_ue_subscription_info_free(OpenAPI_aerial_ue_subscription_info_t *aerial_ue_subscription_info)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == aerial_ue_subscription_info) {
|
||||
return;
|
||||
}
|
||||
if (aerial_ue_subscription_info->_3gpp_uav_id) {
|
||||
ogs_free(aerial_ue_subscription_info->_3gpp_uav_id);
|
||||
aerial_ue_subscription_info->_3gpp_uav_id = NULL;
|
||||
}
|
||||
ogs_free(aerial_ue_subscription_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_aerial_ue_subscription_info_convertToJSON(OpenAPI_aerial_ue_subscription_info_t *aerial_ue_subscription_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (aerial_ue_subscription_info == NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_convertToJSON() failed [AerialUeSubscriptionInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (aerial_ue_subscription_info->aerial_ue_ind == OpenAPI_aerial_ue_indication_NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_convertToJSON() failed [aerial_ue_ind]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "aerialUeInd", OpenAPI_aerial_ue_indication_ToString(aerial_ue_subscription_info->aerial_ue_ind)) == NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_convertToJSON() failed [aerial_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (aerial_ue_subscription_info->_3gpp_uav_id) {
|
||||
if (cJSON_AddStringToObject(item, "3gppUavId", aerial_ue_subscription_info->_3gpp_uav_id) == NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_convertToJSON() failed [_3gpp_uav_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_t *OpenAPI_aerial_ue_subscription_info_parseFromJSON(cJSON *aerial_ue_subscription_infoJSON)
|
||||
{
|
||||
OpenAPI_aerial_ue_subscription_info_t *aerial_ue_subscription_info_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *aerial_ue_ind = NULL;
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_indVariable = 0;
|
||||
cJSON *_3gpp_uav_id = NULL;
|
||||
aerial_ue_ind = cJSON_GetObjectItemCaseSensitive(aerial_ue_subscription_infoJSON, "aerialUeInd");
|
||||
if (!aerial_ue_ind) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_parseFromJSON() failed [aerial_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
if (!cJSON_IsString(aerial_ue_ind)) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_parseFromJSON() failed [aerial_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
aerial_ue_indVariable = OpenAPI_aerial_ue_indication_FromString(aerial_ue_ind->valuestring);
|
||||
|
||||
_3gpp_uav_id = cJSON_GetObjectItemCaseSensitive(aerial_ue_subscription_infoJSON, "3gppUavId");
|
||||
if (_3gpp_uav_id) {
|
||||
if (!cJSON_IsString(_3gpp_uav_id) && !cJSON_IsNull(_3gpp_uav_id)) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_parseFromJSON() failed [_3gpp_uav_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
aerial_ue_subscription_info_local_var = OpenAPI_aerial_ue_subscription_info_create (
|
||||
aerial_ue_indVariable,
|
||||
_3gpp_uav_id && !cJSON_IsNull(_3gpp_uav_id) ? ogs_strdup(_3gpp_uav_id->valuestring) : NULL
|
||||
);
|
||||
|
||||
return aerial_ue_subscription_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_t *OpenAPI_aerial_ue_subscription_info_copy(OpenAPI_aerial_ue_subscription_info_t *dst, OpenAPI_aerial_ue_subscription_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_aerial_ue_subscription_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_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_aerial_ue_subscription_info_free(dst);
|
||||
dst = OpenAPI_aerial_ue_subscription_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* aerial_ue_subscription_info.h
|
||||
*
|
||||
* Contains the Aerial UE Subscription Information, it at least contains the Aerial UE Indication.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_aerial_ue_subscription_info_H_
|
||||
#define _OpenAPI_aerial_ue_subscription_info_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "aerial_ue_indication.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_aerial_ue_subscription_info_s OpenAPI_aerial_ue_subscription_info_t;
|
||||
typedef struct OpenAPI_aerial_ue_subscription_info_s {
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_ind;
|
||||
char *_3gpp_uav_id;
|
||||
} OpenAPI_aerial_ue_subscription_info_t;
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_t *OpenAPI_aerial_ue_subscription_info_create(
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_ind,
|
||||
char *_3gpp_uav_id
|
||||
);
|
||||
void OpenAPI_aerial_ue_subscription_info_free(OpenAPI_aerial_ue_subscription_info_t *aerial_ue_subscription_info);
|
||||
OpenAPI_aerial_ue_subscription_info_t *OpenAPI_aerial_ue_subscription_info_parseFromJSON(cJSON *aerial_ue_subscription_infoJSON);
|
||||
cJSON *OpenAPI_aerial_ue_subscription_info_convertToJSON(OpenAPI_aerial_ue_subscription_info_t *aerial_ue_subscription_info);
|
||||
OpenAPI_aerial_ue_subscription_info_t *OpenAPI_aerial_ue_subscription_info_copy(OpenAPI_aerial_ue_subscription_info_t *dst, OpenAPI_aerial_ue_subscription_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_aerial_ue_subscription_info_H_ */
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "aerial_ue_subscription_info_1.h"
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *OpenAPI_aerial_ue_subscription_info_1_create(
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_ind,
|
||||
char *_3gpp_uav_id
|
||||
)
|
||||
{
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_subscription_info_1_local_var = ogs_malloc(sizeof(OpenAPI_aerial_ue_subscription_info_1_t));
|
||||
ogs_assert(aerial_ue_subscription_info_1_local_var);
|
||||
|
||||
aerial_ue_subscription_info_1_local_var->aerial_ue_ind = aerial_ue_ind;
|
||||
aerial_ue_subscription_info_1_local_var->_3gpp_uav_id = _3gpp_uav_id;
|
||||
|
||||
return aerial_ue_subscription_info_1_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_aerial_ue_subscription_info_1_free(OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_subscription_info_1)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == aerial_ue_subscription_info_1) {
|
||||
return;
|
||||
}
|
||||
if (aerial_ue_subscription_info_1->_3gpp_uav_id) {
|
||||
ogs_free(aerial_ue_subscription_info_1->_3gpp_uav_id);
|
||||
aerial_ue_subscription_info_1->_3gpp_uav_id = NULL;
|
||||
}
|
||||
ogs_free(aerial_ue_subscription_info_1);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_aerial_ue_subscription_info_1_convertToJSON(OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_subscription_info_1)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (aerial_ue_subscription_info_1 == NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_convertToJSON() failed [AerialUeSubscriptionInfo_1]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (aerial_ue_subscription_info_1->aerial_ue_ind == OpenAPI_aerial_ue_indication_NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_convertToJSON() failed [aerial_ue_ind]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "aerialUeInd", OpenAPI_aerial_ue_indication_ToString(aerial_ue_subscription_info_1->aerial_ue_ind)) == NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_convertToJSON() failed [aerial_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (aerial_ue_subscription_info_1->_3gpp_uav_id) {
|
||||
if (cJSON_AddStringToObject(item, "3gppUavId", aerial_ue_subscription_info_1->_3gpp_uav_id) == NULL) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_convertToJSON() failed [_3gpp_uav_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *OpenAPI_aerial_ue_subscription_info_1_parseFromJSON(cJSON *aerial_ue_subscription_info_1JSON)
|
||||
{
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_subscription_info_1_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *aerial_ue_ind = NULL;
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_indVariable = 0;
|
||||
cJSON *_3gpp_uav_id = NULL;
|
||||
aerial_ue_ind = cJSON_GetObjectItemCaseSensitive(aerial_ue_subscription_info_1JSON, "aerialUeInd");
|
||||
if (!aerial_ue_ind) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_parseFromJSON() failed [aerial_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
if (!cJSON_IsString(aerial_ue_ind)) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_parseFromJSON() failed [aerial_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
aerial_ue_indVariable = OpenAPI_aerial_ue_indication_FromString(aerial_ue_ind->valuestring);
|
||||
|
||||
_3gpp_uav_id = cJSON_GetObjectItemCaseSensitive(aerial_ue_subscription_info_1JSON, "3gppUavId");
|
||||
if (_3gpp_uav_id) {
|
||||
if (!cJSON_IsString(_3gpp_uav_id) && !cJSON_IsNull(_3gpp_uav_id)) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_parseFromJSON() failed [_3gpp_uav_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
aerial_ue_subscription_info_1_local_var = OpenAPI_aerial_ue_subscription_info_1_create (
|
||||
aerial_ue_indVariable,
|
||||
_3gpp_uav_id && !cJSON_IsNull(_3gpp_uav_id) ? ogs_strdup(_3gpp_uav_id->valuestring) : NULL
|
||||
);
|
||||
|
||||
return aerial_ue_subscription_info_1_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *OpenAPI_aerial_ue_subscription_info_1_copy(OpenAPI_aerial_ue_subscription_info_1_t *dst, OpenAPI_aerial_ue_subscription_info_1_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_aerial_ue_subscription_info_1_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_aerial_ue_subscription_info_1_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_aerial_ue_subscription_info_1_free(dst);
|
||||
dst = OpenAPI_aerial_ue_subscription_info_1_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* aerial_ue_subscription_info_1.h
|
||||
*
|
||||
* Contains the Aerial UE Subscription Information, it at least contains the Aerial UE Indication.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_aerial_ue_subscription_info_1_H_
|
||||
#define _OpenAPI_aerial_ue_subscription_info_1_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "aerial_ue_indication.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_aerial_ue_subscription_info_1_s OpenAPI_aerial_ue_subscription_info_1_t;
|
||||
typedef struct OpenAPI_aerial_ue_subscription_info_1_s {
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_ind;
|
||||
char *_3gpp_uav_id;
|
||||
} OpenAPI_aerial_ue_subscription_info_1_t;
|
||||
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *OpenAPI_aerial_ue_subscription_info_1_create(
|
||||
OpenAPI_aerial_ue_indication_e aerial_ue_ind,
|
||||
char *_3gpp_uav_id
|
||||
);
|
||||
void OpenAPI_aerial_ue_subscription_info_1_free(OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_subscription_info_1);
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *OpenAPI_aerial_ue_subscription_info_1_parseFromJSON(cJSON *aerial_ue_subscription_info_1JSON);
|
||||
cJSON *OpenAPI_aerial_ue_subscription_info_1_convertToJSON(OpenAPI_aerial_ue_subscription_info_1_t *aerial_ue_subscription_info_1);
|
||||
OpenAPI_aerial_ue_subscription_info_1_t *OpenAPI_aerial_ue_subscription_info_1_copy(OpenAPI_aerial_ue_subscription_info_1_t *dst, OpenAPI_aerial_ue_subscription_info_1_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_aerial_ue_subscription_info_1_H_ */
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "af_coordination_info.h"
|
||||
|
||||
OpenAPI_af_coordination_info_t *OpenAPI_af_coordination_info_create(
|
||||
char *source_dnai,
|
||||
char *source_ue_ipv4_addr,
|
||||
char *source_ue_ipv6_prefix,
|
||||
OpenAPI_list_t *notification_info_list
|
||||
)
|
||||
{
|
||||
OpenAPI_af_coordination_info_t *af_coordination_info_local_var = ogs_malloc(sizeof(OpenAPI_af_coordination_info_t));
|
||||
ogs_assert(af_coordination_info_local_var);
|
||||
|
||||
af_coordination_info_local_var->source_dnai = source_dnai;
|
||||
af_coordination_info_local_var->source_ue_ipv4_addr = source_ue_ipv4_addr;
|
||||
af_coordination_info_local_var->source_ue_ipv6_prefix = source_ue_ipv6_prefix;
|
||||
af_coordination_info_local_var->notification_info_list = notification_info_list;
|
||||
|
||||
return af_coordination_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_af_coordination_info_free(OpenAPI_af_coordination_info_t *af_coordination_info)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == af_coordination_info) {
|
||||
return;
|
||||
}
|
||||
if (af_coordination_info->source_dnai) {
|
||||
ogs_free(af_coordination_info->source_dnai);
|
||||
af_coordination_info->source_dnai = NULL;
|
||||
}
|
||||
if (af_coordination_info->source_ue_ipv4_addr) {
|
||||
ogs_free(af_coordination_info->source_ue_ipv4_addr);
|
||||
af_coordination_info->source_ue_ipv4_addr = NULL;
|
||||
}
|
||||
if (af_coordination_info->source_ue_ipv6_prefix) {
|
||||
ogs_free(af_coordination_info->source_ue_ipv6_prefix);
|
||||
af_coordination_info->source_ue_ipv6_prefix = NULL;
|
||||
}
|
||||
if (af_coordination_info->notification_info_list) {
|
||||
OpenAPI_list_for_each(af_coordination_info->notification_info_list, node) {
|
||||
OpenAPI_notification_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(af_coordination_info->notification_info_list);
|
||||
af_coordination_info->notification_info_list = NULL;
|
||||
}
|
||||
ogs_free(af_coordination_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_af_coordination_info_convertToJSON(OpenAPI_af_coordination_info_t *af_coordination_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (af_coordination_info == NULL) {
|
||||
ogs_error("OpenAPI_af_coordination_info_convertToJSON() failed [AfCoordinationInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (af_coordination_info->source_dnai) {
|
||||
if (cJSON_AddStringToObject(item, "sourceDnai", af_coordination_info->source_dnai) == NULL) {
|
||||
ogs_error("OpenAPI_af_coordination_info_convertToJSON() failed [source_dnai]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_coordination_info->source_ue_ipv4_addr) {
|
||||
if (cJSON_AddStringToObject(item, "sourceUeIpv4Addr", af_coordination_info->source_ue_ipv4_addr) == NULL) {
|
||||
ogs_error("OpenAPI_af_coordination_info_convertToJSON() failed [source_ue_ipv4_addr]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_coordination_info->source_ue_ipv6_prefix) {
|
||||
if (cJSON_AddStringToObject(item, "sourceUeIpv6Prefix", af_coordination_info->source_ue_ipv6_prefix) == NULL) {
|
||||
ogs_error("OpenAPI_af_coordination_info_convertToJSON() failed [source_ue_ipv6_prefix]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_coordination_info->notification_info_list) {
|
||||
cJSON *notification_info_listList = cJSON_AddArrayToObject(item, "notificationInfoList");
|
||||
if (notification_info_listList == NULL) {
|
||||
ogs_error("OpenAPI_af_coordination_info_convertToJSON() failed [notification_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(af_coordination_info->notification_info_list, node) {
|
||||
cJSON *itemLocal = OpenAPI_notification_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_af_coordination_info_convertToJSON() failed [notification_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(notification_info_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_af_coordination_info_t *OpenAPI_af_coordination_info_parseFromJSON(cJSON *af_coordination_infoJSON)
|
||||
{
|
||||
OpenAPI_af_coordination_info_t *af_coordination_info_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *source_dnai = NULL;
|
||||
cJSON *source_ue_ipv4_addr = NULL;
|
||||
cJSON *source_ue_ipv6_prefix = NULL;
|
||||
cJSON *notification_info_list = NULL;
|
||||
OpenAPI_list_t *notification_info_listList = NULL;
|
||||
source_dnai = cJSON_GetObjectItemCaseSensitive(af_coordination_infoJSON, "sourceDnai");
|
||||
if (source_dnai) {
|
||||
if (!cJSON_IsString(source_dnai) && !cJSON_IsNull(source_dnai)) {
|
||||
ogs_error("OpenAPI_af_coordination_info_parseFromJSON() failed [source_dnai]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
source_ue_ipv4_addr = cJSON_GetObjectItemCaseSensitive(af_coordination_infoJSON, "sourceUeIpv4Addr");
|
||||
if (source_ue_ipv4_addr) {
|
||||
if (!cJSON_IsString(source_ue_ipv4_addr) && !cJSON_IsNull(source_ue_ipv4_addr)) {
|
||||
ogs_error("OpenAPI_af_coordination_info_parseFromJSON() failed [source_ue_ipv4_addr]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
source_ue_ipv6_prefix = cJSON_GetObjectItemCaseSensitive(af_coordination_infoJSON, "sourceUeIpv6Prefix");
|
||||
if (source_ue_ipv6_prefix) {
|
||||
if (!cJSON_IsString(source_ue_ipv6_prefix) && !cJSON_IsNull(source_ue_ipv6_prefix)) {
|
||||
ogs_error("OpenAPI_af_coordination_info_parseFromJSON() failed [source_ue_ipv6_prefix]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
notification_info_list = cJSON_GetObjectItemCaseSensitive(af_coordination_infoJSON, "notificationInfoList");
|
||||
if (notification_info_list) {
|
||||
cJSON *notification_info_list_local = NULL;
|
||||
if (!cJSON_IsArray(notification_info_list)) {
|
||||
ogs_error("OpenAPI_af_coordination_info_parseFromJSON() failed [notification_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
notification_info_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(notification_info_list_local, notification_info_list) {
|
||||
if (!cJSON_IsObject(notification_info_list_local)) {
|
||||
ogs_error("OpenAPI_af_coordination_info_parseFromJSON() failed [notification_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_notification_info_t *notification_info_listItem = OpenAPI_notification_info_parseFromJSON(notification_info_list_local);
|
||||
if (!notification_info_listItem) {
|
||||
ogs_error("No notification_info_listItem");
|
||||
OpenAPI_list_free(notification_info_listList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(notification_info_listList, notification_info_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
af_coordination_info_local_var = OpenAPI_af_coordination_info_create (
|
||||
source_dnai && !cJSON_IsNull(source_dnai) ? ogs_strdup(source_dnai->valuestring) : NULL,
|
||||
source_ue_ipv4_addr && !cJSON_IsNull(source_ue_ipv4_addr) ? ogs_strdup(source_ue_ipv4_addr->valuestring) : NULL,
|
||||
source_ue_ipv6_prefix && !cJSON_IsNull(source_ue_ipv6_prefix) ? ogs_strdup(source_ue_ipv6_prefix->valuestring) : NULL,
|
||||
notification_info_list ? notification_info_listList : NULL
|
||||
);
|
||||
|
||||
return af_coordination_info_local_var;
|
||||
end:
|
||||
if (notification_info_listList) {
|
||||
OpenAPI_list_for_each(notification_info_listList, node) {
|
||||
OpenAPI_notification_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(notification_info_listList);
|
||||
notification_info_listList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_coordination_info_t *OpenAPI_af_coordination_info_copy(OpenAPI_af_coordination_info_t *dst, OpenAPI_af_coordination_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_af_coordination_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_af_coordination_info_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_coordination_info_free(dst);
|
||||
dst = OpenAPI_af_coordination_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* af_coordination_info.h
|
||||
*
|
||||
* AF Coordination Information
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_af_coordination_info_H_
|
||||
#define _OpenAPI_af_coordination_info_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "notification_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_af_coordination_info_s OpenAPI_af_coordination_info_t;
|
||||
typedef struct OpenAPI_af_coordination_info_s {
|
||||
char *source_dnai;
|
||||
char *source_ue_ipv4_addr;
|
||||
char *source_ue_ipv6_prefix;
|
||||
OpenAPI_list_t *notification_info_list;
|
||||
} OpenAPI_af_coordination_info_t;
|
||||
|
||||
OpenAPI_af_coordination_info_t *OpenAPI_af_coordination_info_create(
|
||||
char *source_dnai,
|
||||
char *source_ue_ipv4_addr,
|
||||
char *source_ue_ipv6_prefix,
|
||||
OpenAPI_list_t *notification_info_list
|
||||
);
|
||||
void OpenAPI_af_coordination_info_free(OpenAPI_af_coordination_info_t *af_coordination_info);
|
||||
OpenAPI_af_coordination_info_t *OpenAPI_af_coordination_info_parseFromJSON(cJSON *af_coordination_infoJSON);
|
||||
cJSON *OpenAPI_af_coordination_info_convertToJSON(OpenAPI_af_coordination_info_t *af_coordination_info);
|
||||
OpenAPI_af_coordination_info_t *OpenAPI_af_coordination_info_copy(OpenAPI_af_coordination_info_t *dst, OpenAPI_af_coordination_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_af_coordination_info_H_ */
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event)
|
||||
{
|
||||
const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS" };
|
||||
const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS", "USER_DATA_CONGESTION", "PERF_DATA", "DISPERSION", "COLLECTIVE_BEHAVIOUR", "MS_QOE_METRICS", "MS_CONSUMPTION", "MS_NET_ASSIST_INVOCATION", "MS_DYN_POLICY_INVOCATION", "MS_ACCESS_ACTIVITY" };
|
||||
size_t sizeofArray = sizeof(af_eventArray) / sizeof(af_eventArray[0]);
|
||||
if (af_event < sizeofArray)
|
||||
return (char *)af_eventArray[af_event];
|
||||
|
@ -17,7 +17,7 @@ char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event)
|
|||
OpenAPI_af_event_e OpenAPI_af_event_FromString(char* af_event)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS" };
|
||||
const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS", "USER_DATA_CONGESTION", "PERF_DATA", "DISPERSION", "COLLECTIVE_BEHAVIOUR", "MS_QOE_METRICS", "MS_CONSUMPTION", "MS_NET_ASSIST_INVOCATION", "MS_DYN_POLICY_INVOCATION", "MS_ACCESS_ACTIVITY" };
|
||||
size_t sizeofArray = sizeof(af_eventArray) / sizeof(af_eventArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(af_event, af_eventArray[stringToReturn]) == 0) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum { OpenAPI_af_event_NULL = 0, OpenAPI_af_event_SVC_EXPERIENCE, OpenAPI_af_event_UE_MOBILITY, OpenAPI_af_event_UE_COMM, OpenAPI_af_event_EXCEPTIONS } OpenAPI_af_event_e;
|
||||
typedef enum { OpenAPI_af_event_NULL = 0, OpenAPI_af_event_SVC_EXPERIENCE, OpenAPI_af_event_UE_MOBILITY, OpenAPI_af_event_UE_COMM, OpenAPI_af_event_EXCEPTIONS, OpenAPI_af_event_USER_DATA_CONGESTION, OpenAPI_af_event_PERF_DATA, OpenAPI_af_event_DISPERSION, OpenAPI_af_event_COLLECTIVE_BEHAVIOUR, OpenAPI_af_event_MS_QOE_METRICS, OpenAPI_af_event_MS_CONSUMPTION, OpenAPI_af_event_MS_NET_ASSIST_INVOCATION, OpenAPI_af_event_MS_DYN_POLICY_INVOCATION, OpenAPI_af_event_MS_ACCESS_ACTIVITY } OpenAPI_af_event_e;
|
||||
|
||||
char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* af_event_notification.h
|
||||
*
|
||||
* describes the event information delivered in the notification
|
||||
* Describes the event information delivered in the notification.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_af_event_notification_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* af_event_subscription.h
|
||||
*
|
||||
* describes the event information delivered in the subscription
|
||||
* Describes the event information delivered in the subscription.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_af_event_subscription_H_
|
||||
|
|
|
@ -12,7 +12,16 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create(
|
|||
OpenAPI_list_t *temp_vals,
|
||||
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
|
||||
bool is_addr_preser_ind,
|
||||
int addr_preser_ind
|
||||
int addr_preser_ind,
|
||||
bool is_sim_conn_ind,
|
||||
int sim_conn_ind,
|
||||
bool is_sim_conn_term,
|
||||
int sim_conn_term,
|
||||
OpenAPI_list_t *eas_ip_replace_infos,
|
||||
bool is_eas_redis_ind,
|
||||
int eas_redis_ind,
|
||||
bool is_max_allowed_up_lat,
|
||||
int max_allowed_up_lat
|
||||
)
|
||||
{
|
||||
OpenAPI_af_routing_requirement_t *af_routing_requirement_local_var = ogs_malloc(sizeof(OpenAPI_af_routing_requirement_t));
|
||||
|
@ -26,6 +35,15 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create(
|
|||
af_routing_requirement_local_var->up_path_chg_sub = up_path_chg_sub;
|
||||
af_routing_requirement_local_var->is_addr_preser_ind = is_addr_preser_ind;
|
||||
af_routing_requirement_local_var->addr_preser_ind = addr_preser_ind;
|
||||
af_routing_requirement_local_var->is_sim_conn_ind = is_sim_conn_ind;
|
||||
af_routing_requirement_local_var->sim_conn_ind = sim_conn_ind;
|
||||
af_routing_requirement_local_var->is_sim_conn_term = is_sim_conn_term;
|
||||
af_routing_requirement_local_var->sim_conn_term = sim_conn_term;
|
||||
af_routing_requirement_local_var->eas_ip_replace_infos = eas_ip_replace_infos;
|
||||
af_routing_requirement_local_var->is_eas_redis_ind = is_eas_redis_ind;
|
||||
af_routing_requirement_local_var->eas_redis_ind = eas_redis_ind;
|
||||
af_routing_requirement_local_var->is_max_allowed_up_lat = is_max_allowed_up_lat;
|
||||
af_routing_requirement_local_var->max_allowed_up_lat = max_allowed_up_lat;
|
||||
|
||||
return af_routing_requirement_local_var;
|
||||
}
|
||||
|
@ -59,6 +77,13 @@ void OpenAPI_af_routing_requirement_free(OpenAPI_af_routing_requirement_t *af_ro
|
|||
OpenAPI_up_path_chg_event_free(af_routing_requirement->up_path_chg_sub);
|
||||
af_routing_requirement->up_path_chg_sub = NULL;
|
||||
}
|
||||
if (af_routing_requirement->eas_ip_replace_infos) {
|
||||
OpenAPI_list_for_each(af_routing_requirement->eas_ip_replace_infos, node) {
|
||||
OpenAPI_eas_ip_replacement_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(af_routing_requirement->eas_ip_replace_infos);
|
||||
af_routing_requirement->eas_ip_replace_infos = NULL;
|
||||
}
|
||||
ogs_free(af_routing_requirement);
|
||||
}
|
||||
|
||||
|
@ -145,6 +170,50 @@ cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requireme
|
|||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement->is_sim_conn_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "simConnInd", af_routing_requirement->sim_conn_ind) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [sim_conn_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement->is_sim_conn_term) {
|
||||
if (cJSON_AddNumberToObject(item, "simConnTerm", af_routing_requirement->sim_conn_term) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [sim_conn_term]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement->eas_ip_replace_infos) {
|
||||
cJSON *eas_ip_replace_infosList = cJSON_AddArrayToObject(item, "easIpReplaceInfos");
|
||||
if (eas_ip_replace_infosList == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(af_routing_requirement->eas_ip_replace_infos, node) {
|
||||
cJSON *itemLocal = OpenAPI_eas_ip_replacement_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(eas_ip_replace_infosList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement->is_eas_redis_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "easRedisInd", af_routing_requirement->eas_redis_ind) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [eas_redis_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement->is_max_allowed_up_lat) {
|
||||
if (cJSON_AddNumberToObject(item, "maxAllowedUpLat", af_routing_requirement->max_allowed_up_lat) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [max_allowed_up_lat]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -163,6 +232,12 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c
|
|||
cJSON *up_path_chg_sub = NULL;
|
||||
OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL;
|
||||
cJSON *addr_preser_ind = NULL;
|
||||
cJSON *sim_conn_ind = NULL;
|
||||
cJSON *sim_conn_term = NULL;
|
||||
cJSON *eas_ip_replace_infos = NULL;
|
||||
OpenAPI_list_t *eas_ip_replace_infosList = NULL;
|
||||
cJSON *eas_redis_ind = NULL;
|
||||
cJSON *max_allowed_up_lat = NULL;
|
||||
app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "appReloc");
|
||||
if (app_reloc) {
|
||||
if (!cJSON_IsBool(app_reloc)) {
|
||||
|
@ -239,6 +314,63 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c
|
|||
}
|
||||
}
|
||||
|
||||
sim_conn_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "simConnInd");
|
||||
if (sim_conn_ind) {
|
||||
if (!cJSON_IsBool(sim_conn_ind)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [sim_conn_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
sim_conn_term = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "simConnTerm");
|
||||
if (sim_conn_term) {
|
||||
if (!cJSON_IsNumber(sim_conn_term)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [sim_conn_term]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
eas_ip_replace_infos = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "easIpReplaceInfos");
|
||||
if (eas_ip_replace_infos) {
|
||||
cJSON *eas_ip_replace_infos_local = NULL;
|
||||
if (!cJSON_IsArray(eas_ip_replace_infos)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
eas_ip_replace_infosList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(eas_ip_replace_infos_local, eas_ip_replace_infos) {
|
||||
if (!cJSON_IsObject(eas_ip_replace_infos_local)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_eas_ip_replacement_info_t *eas_ip_replace_infosItem = OpenAPI_eas_ip_replacement_info_parseFromJSON(eas_ip_replace_infos_local);
|
||||
if (!eas_ip_replace_infosItem) {
|
||||
ogs_error("No eas_ip_replace_infosItem");
|
||||
OpenAPI_list_free(eas_ip_replace_infosList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(eas_ip_replace_infosList, eas_ip_replace_infosItem);
|
||||
}
|
||||
}
|
||||
|
||||
eas_redis_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "easRedisInd");
|
||||
if (eas_redis_ind) {
|
||||
if (!cJSON_IsBool(eas_redis_ind)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [eas_redis_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
max_allowed_up_lat = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "maxAllowedUpLat");
|
||||
if (max_allowed_up_lat) {
|
||||
if (!cJSON_IsNumber(max_allowed_up_lat)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [max_allowed_up_lat]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
af_routing_requirement_local_var = OpenAPI_af_routing_requirement_create (
|
||||
app_reloc ? true : false,
|
||||
app_reloc ? app_reloc->valueint : 0,
|
||||
|
@ -247,7 +379,16 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c
|
|||
temp_vals ? temp_valsList : NULL,
|
||||
up_path_chg_sub ? up_path_chg_sub_local_nonprim : NULL,
|
||||
addr_preser_ind ? true : false,
|
||||
addr_preser_ind ? addr_preser_ind->valueint : 0
|
||||
addr_preser_ind ? addr_preser_ind->valueint : 0,
|
||||
sim_conn_ind ? true : false,
|
||||
sim_conn_ind ? sim_conn_ind->valueint : 0,
|
||||
sim_conn_term ? true : false,
|
||||
sim_conn_term ? sim_conn_term->valuedouble : 0,
|
||||
eas_ip_replace_infos ? eas_ip_replace_infosList : NULL,
|
||||
eas_redis_ind ? true : false,
|
||||
eas_redis_ind ? eas_redis_ind->valueint : 0,
|
||||
max_allowed_up_lat ? true : false,
|
||||
max_allowed_up_lat ? max_allowed_up_lat->valuedouble : 0
|
||||
);
|
||||
|
||||
return af_routing_requirement_local_var;
|
||||
|
@ -274,6 +415,13 @@ end:
|
|||
OpenAPI_up_path_chg_event_free(up_path_chg_sub_local_nonprim);
|
||||
up_path_chg_sub_local_nonprim = NULL;
|
||||
}
|
||||
if (eas_ip_replace_infosList) {
|
||||
OpenAPI_list_for_each(eas_ip_replace_infosList, node) {
|
||||
OpenAPI_eas_ip_replacement_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(eas_ip_replace_infosList);
|
||||
eas_ip_replace_infosList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* af_routing_requirement.h
|
||||
*
|
||||
* describes the event information delivered in the subscription
|
||||
* Describes the event information delivered in the subscription.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_af_routing_requirement_H_
|
||||
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "eas_ip_replacement_info.h"
|
||||
#include "route_to_location.h"
|
||||
#include "spatial_validity.h"
|
||||
#include "temporal_validity.h"
|
||||
|
@ -31,6 +32,15 @@ typedef struct OpenAPI_af_routing_requirement_s {
|
|||
struct OpenAPI_up_path_chg_event_s *up_path_chg_sub;
|
||||
bool is_addr_preser_ind;
|
||||
int addr_preser_ind;
|
||||
bool is_sim_conn_ind;
|
||||
int sim_conn_ind;
|
||||
bool is_sim_conn_term;
|
||||
int sim_conn_term;
|
||||
OpenAPI_list_t *eas_ip_replace_infos;
|
||||
bool is_eas_redis_ind;
|
||||
int eas_redis_ind;
|
||||
bool is_max_allowed_up_lat;
|
||||
int max_allowed_up_lat;
|
||||
} OpenAPI_af_routing_requirement_t;
|
||||
|
||||
OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create(
|
||||
|
@ -41,7 +51,16 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create(
|
|||
OpenAPI_list_t *temp_vals,
|
||||
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
|
||||
bool is_addr_preser_ind,
|
||||
int addr_preser_ind
|
||||
int addr_preser_ind,
|
||||
bool is_sim_conn_ind,
|
||||
int sim_conn_ind,
|
||||
bool is_sim_conn_term,
|
||||
int sim_conn_term,
|
||||
OpenAPI_list_t *eas_ip_replace_infos,
|
||||
bool is_eas_redis_ind,
|
||||
int eas_redis_ind,
|
||||
bool is_max_allowed_up_lat,
|
||||
int max_allowed_up_lat
|
||||
);
|
||||
void OpenAPI_af_routing_requirement_free(OpenAPI_af_routing_requirement_t *af_routing_requirement);
|
||||
OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(cJSON *af_routing_requirementJSON);
|
||||
|
|
|
@ -12,7 +12,16 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create(
|
|||
OpenAPI_list_t *temp_vals,
|
||||
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
|
||||
bool is_addr_preser_ind,
|
||||
int addr_preser_ind
|
||||
int addr_preser_ind,
|
||||
bool is_sim_conn_ind,
|
||||
int sim_conn_ind,
|
||||
bool is_sim_conn_term,
|
||||
int sim_conn_term,
|
||||
OpenAPI_list_t *eas_ip_replace_infos,
|
||||
bool is_eas_redis_ind,
|
||||
int eas_redis_ind,
|
||||
bool is_max_allowed_up_lat,
|
||||
int max_allowed_up_lat
|
||||
)
|
||||
{
|
||||
OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm_local_var = ogs_malloc(sizeof(OpenAPI_af_routing_requirement_rm_t));
|
||||
|
@ -26,6 +35,15 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create(
|
|||
af_routing_requirement_rm_local_var->up_path_chg_sub = up_path_chg_sub;
|
||||
af_routing_requirement_rm_local_var->is_addr_preser_ind = is_addr_preser_ind;
|
||||
af_routing_requirement_rm_local_var->addr_preser_ind = addr_preser_ind;
|
||||
af_routing_requirement_rm_local_var->is_sim_conn_ind = is_sim_conn_ind;
|
||||
af_routing_requirement_rm_local_var->sim_conn_ind = sim_conn_ind;
|
||||
af_routing_requirement_rm_local_var->is_sim_conn_term = is_sim_conn_term;
|
||||
af_routing_requirement_rm_local_var->sim_conn_term = sim_conn_term;
|
||||
af_routing_requirement_rm_local_var->eas_ip_replace_infos = eas_ip_replace_infos;
|
||||
af_routing_requirement_rm_local_var->is_eas_redis_ind = is_eas_redis_ind;
|
||||
af_routing_requirement_rm_local_var->eas_redis_ind = eas_redis_ind;
|
||||
af_routing_requirement_rm_local_var->is_max_allowed_up_lat = is_max_allowed_up_lat;
|
||||
af_routing_requirement_rm_local_var->max_allowed_up_lat = max_allowed_up_lat;
|
||||
|
||||
return af_routing_requirement_rm_local_var;
|
||||
}
|
||||
|
@ -59,6 +77,13 @@ void OpenAPI_af_routing_requirement_rm_free(OpenAPI_af_routing_requirement_rm_t
|
|||
OpenAPI_up_path_chg_event_free(af_routing_requirement_rm->up_path_chg_sub);
|
||||
af_routing_requirement_rm->up_path_chg_sub = NULL;
|
||||
}
|
||||
if (af_routing_requirement_rm->eas_ip_replace_infos) {
|
||||
OpenAPI_list_for_each(af_routing_requirement_rm->eas_ip_replace_infos, node) {
|
||||
OpenAPI_eas_ip_replacement_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(af_routing_requirement_rm->eas_ip_replace_infos);
|
||||
af_routing_requirement_rm->eas_ip_replace_infos = NULL;
|
||||
}
|
||||
ogs_free(af_routing_requirement_rm);
|
||||
}
|
||||
|
||||
|
@ -145,6 +170,50 @@ cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requir
|
|||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement_rm->is_sim_conn_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "simConnInd", af_routing_requirement_rm->sim_conn_ind) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [sim_conn_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement_rm->is_sim_conn_term) {
|
||||
if (cJSON_AddNumberToObject(item, "simConnTerm", af_routing_requirement_rm->sim_conn_term) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [sim_conn_term]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement_rm->eas_ip_replace_infos) {
|
||||
cJSON *eas_ip_replace_infosList = cJSON_AddArrayToObject(item, "easIpReplaceInfos");
|
||||
if (eas_ip_replace_infosList == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(af_routing_requirement_rm->eas_ip_replace_infos, node) {
|
||||
cJSON *itemLocal = OpenAPI_eas_ip_replacement_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(eas_ip_replace_infosList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement_rm->is_eas_redis_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "easRedisInd", af_routing_requirement_rm->eas_redis_ind) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [eas_redis_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_routing_requirement_rm->is_max_allowed_up_lat) {
|
||||
if (cJSON_AddNumberToObject(item, "maxAllowedUpLat", af_routing_requirement_rm->max_allowed_up_lat) == NULL) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [max_allowed_up_lat]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -163,6 +232,12 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom
|
|||
cJSON *up_path_chg_sub = NULL;
|
||||
OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL;
|
||||
cJSON *addr_preser_ind = NULL;
|
||||
cJSON *sim_conn_ind = NULL;
|
||||
cJSON *sim_conn_term = NULL;
|
||||
cJSON *eas_ip_replace_infos = NULL;
|
||||
OpenAPI_list_t *eas_ip_replace_infosList = NULL;
|
||||
cJSON *eas_redis_ind = NULL;
|
||||
cJSON *max_allowed_up_lat = NULL;
|
||||
app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "appReloc");
|
||||
if (app_reloc) {
|
||||
if (!cJSON_IsBool(app_reloc)) {
|
||||
|
@ -239,6 +314,63 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom
|
|||
}
|
||||
}
|
||||
|
||||
sim_conn_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "simConnInd");
|
||||
if (sim_conn_ind) {
|
||||
if (!cJSON_IsBool(sim_conn_ind)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [sim_conn_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
sim_conn_term = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "simConnTerm");
|
||||
if (sim_conn_term) {
|
||||
if (!cJSON_IsNumber(sim_conn_term)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [sim_conn_term]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
eas_ip_replace_infos = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "easIpReplaceInfos");
|
||||
if (eas_ip_replace_infos) {
|
||||
cJSON *eas_ip_replace_infos_local = NULL;
|
||||
if (!cJSON_IsArray(eas_ip_replace_infos)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
eas_ip_replace_infosList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(eas_ip_replace_infos_local, eas_ip_replace_infos) {
|
||||
if (!cJSON_IsObject(eas_ip_replace_infos_local)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [eas_ip_replace_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_eas_ip_replacement_info_t *eas_ip_replace_infosItem = OpenAPI_eas_ip_replacement_info_parseFromJSON(eas_ip_replace_infos_local);
|
||||
if (!eas_ip_replace_infosItem) {
|
||||
ogs_error("No eas_ip_replace_infosItem");
|
||||
OpenAPI_list_free(eas_ip_replace_infosList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(eas_ip_replace_infosList, eas_ip_replace_infosItem);
|
||||
}
|
||||
}
|
||||
|
||||
eas_redis_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "easRedisInd");
|
||||
if (eas_redis_ind) {
|
||||
if (!cJSON_IsBool(eas_redis_ind)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [eas_redis_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
max_allowed_up_lat = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "maxAllowedUpLat");
|
||||
if (max_allowed_up_lat) {
|
||||
if (!cJSON_IsNumber(max_allowed_up_lat)) {
|
||||
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [max_allowed_up_lat]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
af_routing_requirement_rm_local_var = OpenAPI_af_routing_requirement_rm_create (
|
||||
app_reloc ? true : false,
|
||||
app_reloc ? app_reloc->valueint : 0,
|
||||
|
@ -247,7 +379,16 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom
|
|||
temp_vals ? temp_valsList : NULL,
|
||||
up_path_chg_sub ? up_path_chg_sub_local_nonprim : NULL,
|
||||
addr_preser_ind ? true : false,
|
||||
addr_preser_ind ? addr_preser_ind->valueint : 0
|
||||
addr_preser_ind ? addr_preser_ind->valueint : 0,
|
||||
sim_conn_ind ? true : false,
|
||||
sim_conn_ind ? sim_conn_ind->valueint : 0,
|
||||
sim_conn_term ? true : false,
|
||||
sim_conn_term ? sim_conn_term->valuedouble : 0,
|
||||
eas_ip_replace_infos ? eas_ip_replace_infosList : NULL,
|
||||
eas_redis_ind ? true : false,
|
||||
eas_redis_ind ? eas_redis_ind->valueint : 0,
|
||||
max_allowed_up_lat ? true : false,
|
||||
max_allowed_up_lat ? max_allowed_up_lat->valuedouble : 0
|
||||
);
|
||||
|
||||
return af_routing_requirement_rm_local_var;
|
||||
|
@ -274,6 +415,13 @@ end:
|
|||
OpenAPI_up_path_chg_event_free(up_path_chg_sub_local_nonprim);
|
||||
up_path_chg_sub_local_nonprim = NULL;
|
||||
}
|
||||
if (eas_ip_replace_infosList) {
|
||||
OpenAPI_list_for_each(eas_ip_replace_infosList, node) {
|
||||
OpenAPI_eas_ip_replacement_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(eas_ip_replace_infosList);
|
||||
eas_ip_replace_infosList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* af_routing_requirement_rm.h
|
||||
*
|
||||
* this data type is defined in the same way as the AfRoutingRequirement data type, but with the OpenAPI nullable property set to true and the spVal and tempVals attributes defined as removable.
|
||||
* This data type is defined in the same way as the AfRoutingRequirement data type, but with the OpenAPI nullable property set to true and the spVal and tempVals attributes defined as removable.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_af_routing_requirement_rm_H_
|
||||
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "eas_ip_replacement_info.h"
|
||||
#include "route_to_location.h"
|
||||
#include "spatial_validity_rm.h"
|
||||
#include "temporal_validity.h"
|
||||
|
@ -31,6 +32,15 @@ typedef struct OpenAPI_af_routing_requirement_rm_s {
|
|||
struct OpenAPI_up_path_chg_event_s *up_path_chg_sub;
|
||||
bool is_addr_preser_ind;
|
||||
int addr_preser_ind;
|
||||
bool is_sim_conn_ind;
|
||||
int sim_conn_ind;
|
||||
bool is_sim_conn_term;
|
||||
int sim_conn_term;
|
||||
OpenAPI_list_t *eas_ip_replace_infos;
|
||||
bool is_eas_redis_ind;
|
||||
int eas_redis_ind;
|
||||
bool is_max_allowed_up_lat;
|
||||
int max_allowed_up_lat;
|
||||
} OpenAPI_af_routing_requirement_rm_t;
|
||||
|
||||
OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create(
|
||||
|
@ -41,7 +51,16 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create(
|
|||
OpenAPI_list_t *temp_vals,
|
||||
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
|
||||
bool is_addr_preser_ind,
|
||||
int addr_preser_ind
|
||||
int addr_preser_ind,
|
||||
bool is_sim_conn_ind,
|
||||
int sim_conn_ind,
|
||||
bool is_sim_conn_term,
|
||||
int sim_conn_term,
|
||||
OpenAPI_list_t *eas_ip_replace_infos,
|
||||
bool is_eas_redis_ind,
|
||||
int eas_redis_ind,
|
||||
bool is_max_allowed_up_lat,
|
||||
int max_allowed_up_lat
|
||||
);
|
||||
void OpenAPI_af_routing_requirement_rm_free(OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm);
|
||||
OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFromJSON(cJSON *af_routing_requirement_rmJSON);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* allowed_nssai.h
|
||||
*
|
||||
*
|
||||
* Contains an array of allowed S-NSSAI that constitute the allowed NSSAI information for the authorized network slice information
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_allowed_nssai_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* allowed_snssai.h
|
||||
*
|
||||
*
|
||||
* Contains the authorized S-NSSAI and optional mapped home S-NSSAI and network slice instance information
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_allowed_snssai_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* alternative_qos_profile.h
|
||||
*
|
||||
*
|
||||
* Alternative QoS Profile
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_alternative_qos_profile_H_
|
||||
|
|
|
@ -0,0 +1,182 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "alternative_service_requirements_data.h"
|
||||
|
||||
OpenAPI_alternative_service_requirements_data_t *OpenAPI_alternative_service_requirements_data_create(
|
||||
char *alt_qos_param_set_ref,
|
||||
char *gbr_ul,
|
||||
char *gbr_dl,
|
||||
bool is_pdb,
|
||||
int pdb
|
||||
)
|
||||
{
|
||||
OpenAPI_alternative_service_requirements_data_t *alternative_service_requirements_data_local_var = ogs_malloc(sizeof(OpenAPI_alternative_service_requirements_data_t));
|
||||
ogs_assert(alternative_service_requirements_data_local_var);
|
||||
|
||||
alternative_service_requirements_data_local_var->alt_qos_param_set_ref = alt_qos_param_set_ref;
|
||||
alternative_service_requirements_data_local_var->gbr_ul = gbr_ul;
|
||||
alternative_service_requirements_data_local_var->gbr_dl = gbr_dl;
|
||||
alternative_service_requirements_data_local_var->is_pdb = is_pdb;
|
||||
alternative_service_requirements_data_local_var->pdb = pdb;
|
||||
|
||||
return alternative_service_requirements_data_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_alternative_service_requirements_data_free(OpenAPI_alternative_service_requirements_data_t *alternative_service_requirements_data)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == alternative_service_requirements_data) {
|
||||
return;
|
||||
}
|
||||
if (alternative_service_requirements_data->alt_qos_param_set_ref) {
|
||||
ogs_free(alternative_service_requirements_data->alt_qos_param_set_ref);
|
||||
alternative_service_requirements_data->alt_qos_param_set_ref = NULL;
|
||||
}
|
||||
if (alternative_service_requirements_data->gbr_ul) {
|
||||
ogs_free(alternative_service_requirements_data->gbr_ul);
|
||||
alternative_service_requirements_data->gbr_ul = NULL;
|
||||
}
|
||||
if (alternative_service_requirements_data->gbr_dl) {
|
||||
ogs_free(alternative_service_requirements_data->gbr_dl);
|
||||
alternative_service_requirements_data->gbr_dl = NULL;
|
||||
}
|
||||
ogs_free(alternative_service_requirements_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_alternative_service_requirements_data_convertToJSON(OpenAPI_alternative_service_requirements_data_t *alternative_service_requirements_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (alternative_service_requirements_data == NULL) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_convertToJSON() failed [AlternativeServiceRequirementsData]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!alternative_service_requirements_data->alt_qos_param_set_ref) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_convertToJSON() failed [alt_qos_param_set_ref]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "altQosParamSetRef", alternative_service_requirements_data->alt_qos_param_set_ref) == NULL) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_convertToJSON() failed [alt_qos_param_set_ref]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (alternative_service_requirements_data->gbr_ul) {
|
||||
if (cJSON_AddStringToObject(item, "gbrUl", alternative_service_requirements_data->gbr_ul) == NULL) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_convertToJSON() failed [gbr_ul]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (alternative_service_requirements_data->gbr_dl) {
|
||||
if (cJSON_AddStringToObject(item, "gbrDl", alternative_service_requirements_data->gbr_dl) == NULL) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_convertToJSON() failed [gbr_dl]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (alternative_service_requirements_data->is_pdb) {
|
||||
if (cJSON_AddNumberToObject(item, "pdb", alternative_service_requirements_data->pdb) == NULL) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_convertToJSON() failed [pdb]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_alternative_service_requirements_data_t *OpenAPI_alternative_service_requirements_data_parseFromJSON(cJSON *alternative_service_requirements_dataJSON)
|
||||
{
|
||||
OpenAPI_alternative_service_requirements_data_t *alternative_service_requirements_data_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *alt_qos_param_set_ref = NULL;
|
||||
cJSON *gbr_ul = NULL;
|
||||
cJSON *gbr_dl = NULL;
|
||||
cJSON *pdb = NULL;
|
||||
alt_qos_param_set_ref = cJSON_GetObjectItemCaseSensitive(alternative_service_requirements_dataJSON, "altQosParamSetRef");
|
||||
if (!alt_qos_param_set_ref) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_parseFromJSON() failed [alt_qos_param_set_ref]");
|
||||
goto end;
|
||||
}
|
||||
if (!cJSON_IsString(alt_qos_param_set_ref)) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_parseFromJSON() failed [alt_qos_param_set_ref]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
gbr_ul = cJSON_GetObjectItemCaseSensitive(alternative_service_requirements_dataJSON, "gbrUl");
|
||||
if (gbr_ul) {
|
||||
if (!cJSON_IsString(gbr_ul) && !cJSON_IsNull(gbr_ul)) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_parseFromJSON() failed [gbr_ul]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
gbr_dl = cJSON_GetObjectItemCaseSensitive(alternative_service_requirements_dataJSON, "gbrDl");
|
||||
if (gbr_dl) {
|
||||
if (!cJSON_IsString(gbr_dl) && !cJSON_IsNull(gbr_dl)) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_parseFromJSON() failed [gbr_dl]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
pdb = cJSON_GetObjectItemCaseSensitive(alternative_service_requirements_dataJSON, "pdb");
|
||||
if (pdb) {
|
||||
if (!cJSON_IsNumber(pdb)) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_parseFromJSON() failed [pdb]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
alternative_service_requirements_data_local_var = OpenAPI_alternative_service_requirements_data_create (
|
||||
ogs_strdup(alt_qos_param_set_ref->valuestring),
|
||||
gbr_ul && !cJSON_IsNull(gbr_ul) ? ogs_strdup(gbr_ul->valuestring) : NULL,
|
||||
gbr_dl && !cJSON_IsNull(gbr_dl) ? ogs_strdup(gbr_dl->valuestring) : NULL,
|
||||
pdb ? true : false,
|
||||
pdb ? pdb->valuedouble : 0
|
||||
);
|
||||
|
||||
return alternative_service_requirements_data_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_alternative_service_requirements_data_t *OpenAPI_alternative_service_requirements_data_copy(OpenAPI_alternative_service_requirements_data_t *dst, OpenAPI_alternative_service_requirements_data_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_alternative_service_requirements_data_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_alternative_service_requirements_data_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_alternative_service_requirements_data_free(dst);
|
||||
dst = OpenAPI_alternative_service_requirements_data_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* alternative_service_requirements_data.h
|
||||
*
|
||||
* Contains an alternative QoS related parameter set.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_alternative_service_requirements_data_H_
|
||||
#define _OpenAPI_alternative_service_requirements_data_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_alternative_service_requirements_data_s OpenAPI_alternative_service_requirements_data_t;
|
||||
typedef struct OpenAPI_alternative_service_requirements_data_s {
|
||||
char *alt_qos_param_set_ref;
|
||||
char *gbr_ul;
|
||||
char *gbr_dl;
|
||||
bool is_pdb;
|
||||
int pdb;
|
||||
} OpenAPI_alternative_service_requirements_data_t;
|
||||
|
||||
OpenAPI_alternative_service_requirements_data_t *OpenAPI_alternative_service_requirements_data_create(
|
||||
char *alt_qos_param_set_ref,
|
||||
char *gbr_ul,
|
||||
char *gbr_dl,
|
||||
bool is_pdb,
|
||||
int pdb
|
||||
);
|
||||
void OpenAPI_alternative_service_requirements_data_free(OpenAPI_alternative_service_requirements_data_t *alternative_service_requirements_data);
|
||||
OpenAPI_alternative_service_requirements_data_t *OpenAPI_alternative_service_requirements_data_parseFromJSON(cJSON *alternative_service_requirements_dataJSON);
|
||||
cJSON *OpenAPI_alternative_service_requirements_data_convertToJSON(OpenAPI_alternative_service_requirements_data_t *alternative_service_requirements_data);
|
||||
OpenAPI_alternative_service_requirements_data_t *OpenAPI_alternative_service_requirements_data_copy(OpenAPI_alternative_service_requirements_data_t *dst, OpenAPI_alternative_service_requirements_data_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_alternative_service_requirements_data_H_ */
|
||||
|
|
@ -0,0 +1,633 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "am_influ_data.h"
|
||||
|
||||
OpenAPI_am_influ_data_t *OpenAPI_am_influ_data_create(
|
||||
OpenAPI_list_t *app_ids,
|
||||
OpenAPI_list_t *dnn_snssai_infos,
|
||||
char *inter_group_id,
|
||||
char *supi,
|
||||
bool is_any_ue_ind,
|
||||
int any_ue_ind,
|
||||
bool is_policy_duration,
|
||||
int policy_duration,
|
||||
OpenAPI_list_t *ev_subs,
|
||||
char *notif_uri,
|
||||
char *notif_corr_id,
|
||||
OpenAPI_list_t *headers,
|
||||
bool is_thru_req,
|
||||
int thru_req,
|
||||
OpenAPI_list_t *cov_req,
|
||||
char *supported_features,
|
||||
char *res_uri,
|
||||
OpenAPI_list_t *reset_ids
|
||||
)
|
||||
{
|
||||
OpenAPI_am_influ_data_t *am_influ_data_local_var = ogs_malloc(sizeof(OpenAPI_am_influ_data_t));
|
||||
ogs_assert(am_influ_data_local_var);
|
||||
|
||||
am_influ_data_local_var->app_ids = app_ids;
|
||||
am_influ_data_local_var->dnn_snssai_infos = dnn_snssai_infos;
|
||||
am_influ_data_local_var->inter_group_id = inter_group_id;
|
||||
am_influ_data_local_var->supi = supi;
|
||||
am_influ_data_local_var->is_any_ue_ind = is_any_ue_ind;
|
||||
am_influ_data_local_var->any_ue_ind = any_ue_ind;
|
||||
am_influ_data_local_var->is_policy_duration = is_policy_duration;
|
||||
am_influ_data_local_var->policy_duration = policy_duration;
|
||||
am_influ_data_local_var->ev_subs = ev_subs;
|
||||
am_influ_data_local_var->notif_uri = notif_uri;
|
||||
am_influ_data_local_var->notif_corr_id = notif_corr_id;
|
||||
am_influ_data_local_var->headers = headers;
|
||||
am_influ_data_local_var->is_thru_req = is_thru_req;
|
||||
am_influ_data_local_var->thru_req = thru_req;
|
||||
am_influ_data_local_var->cov_req = cov_req;
|
||||
am_influ_data_local_var->supported_features = supported_features;
|
||||
am_influ_data_local_var->res_uri = res_uri;
|
||||
am_influ_data_local_var->reset_ids = reset_ids;
|
||||
|
||||
return am_influ_data_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_am_influ_data_free(OpenAPI_am_influ_data_t *am_influ_data)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == am_influ_data) {
|
||||
return;
|
||||
}
|
||||
if (am_influ_data->app_ids) {
|
||||
OpenAPI_list_for_each(am_influ_data->app_ids, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_influ_data->app_ids);
|
||||
am_influ_data->app_ids = NULL;
|
||||
}
|
||||
if (am_influ_data->dnn_snssai_infos) {
|
||||
OpenAPI_list_for_each(am_influ_data->dnn_snssai_infos, node) {
|
||||
OpenAPI_dnn_snssai_information_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_influ_data->dnn_snssai_infos);
|
||||
am_influ_data->dnn_snssai_infos = NULL;
|
||||
}
|
||||
if (am_influ_data->inter_group_id) {
|
||||
ogs_free(am_influ_data->inter_group_id);
|
||||
am_influ_data->inter_group_id = NULL;
|
||||
}
|
||||
if (am_influ_data->supi) {
|
||||
ogs_free(am_influ_data->supi);
|
||||
am_influ_data->supi = NULL;
|
||||
}
|
||||
if (am_influ_data->ev_subs) {
|
||||
OpenAPI_list_for_each(am_influ_data->ev_subs, node) {
|
||||
OpenAPI_am_influ_event_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_influ_data->ev_subs);
|
||||
am_influ_data->ev_subs = NULL;
|
||||
}
|
||||
if (am_influ_data->notif_uri) {
|
||||
ogs_free(am_influ_data->notif_uri);
|
||||
am_influ_data->notif_uri = NULL;
|
||||
}
|
||||
if (am_influ_data->notif_corr_id) {
|
||||
ogs_free(am_influ_data->notif_corr_id);
|
||||
am_influ_data->notif_corr_id = NULL;
|
||||
}
|
||||
if (am_influ_data->headers) {
|
||||
OpenAPI_list_for_each(am_influ_data->headers, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_influ_data->headers);
|
||||
am_influ_data->headers = NULL;
|
||||
}
|
||||
if (am_influ_data->cov_req) {
|
||||
OpenAPI_list_for_each(am_influ_data->cov_req, node) {
|
||||
OpenAPI_service_area_coverage_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_influ_data->cov_req);
|
||||
am_influ_data->cov_req = NULL;
|
||||
}
|
||||
if (am_influ_data->supported_features) {
|
||||
ogs_free(am_influ_data->supported_features);
|
||||
am_influ_data->supported_features = NULL;
|
||||
}
|
||||
if (am_influ_data->res_uri) {
|
||||
ogs_free(am_influ_data->res_uri);
|
||||
am_influ_data->res_uri = NULL;
|
||||
}
|
||||
if (am_influ_data->reset_ids) {
|
||||
OpenAPI_list_for_each(am_influ_data->reset_ids, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_influ_data->reset_ids);
|
||||
am_influ_data->reset_ids = NULL;
|
||||
}
|
||||
ogs_free(am_influ_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_am_influ_data_convertToJSON(OpenAPI_am_influ_data_t *am_influ_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (am_influ_data == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [AmInfluData]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (am_influ_data->app_ids) {
|
||||
cJSON *app_idsList = cJSON_AddArrayToObject(item, "appIds");
|
||||
if (app_idsList == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [app_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_influ_data->app_ids, node) {
|
||||
if (cJSON_AddStringToObject(app_idsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [app_ids]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->dnn_snssai_infos) {
|
||||
cJSON *dnn_snssai_infosList = cJSON_AddArrayToObject(item, "dnnSnssaiInfos");
|
||||
if (dnn_snssai_infosList == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [dnn_snssai_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_influ_data->dnn_snssai_infos, node) {
|
||||
cJSON *itemLocal = OpenAPI_dnn_snssai_information_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [dnn_snssai_infos]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(dnn_snssai_infosList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->inter_group_id) {
|
||||
if (cJSON_AddStringToObject(item, "interGroupId", am_influ_data->inter_group_id) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [inter_group_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->supi) {
|
||||
if (cJSON_AddStringToObject(item, "supi", am_influ_data->supi) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [supi]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->is_any_ue_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "anyUeInd", am_influ_data->any_ue_ind) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [any_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->is_policy_duration) {
|
||||
if (cJSON_AddNumberToObject(item, "policyDuration", am_influ_data->policy_duration) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [policy_duration]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->ev_subs) {
|
||||
cJSON *ev_subsList = cJSON_AddArrayToObject(item, "evSubs");
|
||||
if (ev_subsList == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [ev_subs]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_influ_data->ev_subs, node) {
|
||||
cJSON *itemLocal = OpenAPI_am_influ_event_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [ev_subs]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ev_subsList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->notif_uri) {
|
||||
if (cJSON_AddStringToObject(item, "notifUri", am_influ_data->notif_uri) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [notif_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->notif_corr_id) {
|
||||
if (cJSON_AddStringToObject(item, "notifCorrId", am_influ_data->notif_corr_id) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [notif_corr_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->headers) {
|
||||
cJSON *headersList = cJSON_AddArrayToObject(item, "headers");
|
||||
if (headersList == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [headers]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_influ_data->headers, node) {
|
||||
if (cJSON_AddStringToObject(headersList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [headers]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->is_thru_req) {
|
||||
if (cJSON_AddBoolToObject(item, "thruReq", am_influ_data->thru_req) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [thru_req]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->cov_req) {
|
||||
cJSON *cov_reqList = cJSON_AddArrayToObject(item, "covReq");
|
||||
if (cov_reqList == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [cov_req]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_influ_data->cov_req, node) {
|
||||
cJSON *itemLocal = OpenAPI_service_area_coverage_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [cov_req]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(cov_reqList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->supported_features) {
|
||||
if (cJSON_AddStringToObject(item, "supportedFeatures", am_influ_data->supported_features) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->res_uri) {
|
||||
if (cJSON_AddStringToObject(item, "resUri", am_influ_data->res_uri) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [res_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_influ_data->reset_ids) {
|
||||
cJSON *reset_idsList = cJSON_AddArrayToObject(item, "resetIds");
|
||||
if (reset_idsList == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_influ_data->reset_ids, node) {
|
||||
if (cJSON_AddStringToObject(reset_idsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_data_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_am_influ_data_t *OpenAPI_am_influ_data_parseFromJSON(cJSON *am_influ_dataJSON)
|
||||
{
|
||||
OpenAPI_am_influ_data_t *am_influ_data_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *app_ids = NULL;
|
||||
OpenAPI_list_t *app_idsList = NULL;
|
||||
cJSON *dnn_snssai_infos = NULL;
|
||||
OpenAPI_list_t *dnn_snssai_infosList = NULL;
|
||||
cJSON *inter_group_id = NULL;
|
||||
cJSON *supi = NULL;
|
||||
cJSON *any_ue_ind = NULL;
|
||||
cJSON *policy_duration = NULL;
|
||||
cJSON *ev_subs = NULL;
|
||||
OpenAPI_list_t *ev_subsList = NULL;
|
||||
cJSON *notif_uri = NULL;
|
||||
cJSON *notif_corr_id = NULL;
|
||||
cJSON *headers = NULL;
|
||||
OpenAPI_list_t *headersList = NULL;
|
||||
cJSON *thru_req = NULL;
|
||||
cJSON *cov_req = NULL;
|
||||
OpenAPI_list_t *cov_reqList = NULL;
|
||||
cJSON *supported_features = NULL;
|
||||
cJSON *res_uri = NULL;
|
||||
cJSON *reset_ids = NULL;
|
||||
OpenAPI_list_t *reset_idsList = NULL;
|
||||
app_ids = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "appIds");
|
||||
if (app_ids) {
|
||||
cJSON *app_ids_local = NULL;
|
||||
if (!cJSON_IsArray(app_ids)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [app_ids]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
app_idsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(app_ids_local, app_ids) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(app_ids_local)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [app_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
dnn_snssai_infos = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "dnnSnssaiInfos");
|
||||
if (dnn_snssai_infos) {
|
||||
cJSON *dnn_snssai_infos_local = NULL;
|
||||
if (!cJSON_IsArray(dnn_snssai_infos)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [dnn_snssai_infos]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
dnn_snssai_infosList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(dnn_snssai_infos_local, dnn_snssai_infos) {
|
||||
if (!cJSON_IsObject(dnn_snssai_infos_local)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [dnn_snssai_infos]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_dnn_snssai_information_t *dnn_snssai_infosItem = OpenAPI_dnn_snssai_information_parseFromJSON(dnn_snssai_infos_local);
|
||||
if (!dnn_snssai_infosItem) {
|
||||
ogs_error("No dnn_snssai_infosItem");
|
||||
OpenAPI_list_free(dnn_snssai_infosList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(dnn_snssai_infosList, dnn_snssai_infosItem);
|
||||
}
|
||||
}
|
||||
|
||||
inter_group_id = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "interGroupId");
|
||||
if (inter_group_id) {
|
||||
if (!cJSON_IsString(inter_group_id) && !cJSON_IsNull(inter_group_id)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [inter_group_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
supi = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "supi");
|
||||
if (supi) {
|
||||
if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [supi]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
any_ue_ind = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "anyUeInd");
|
||||
if (any_ue_ind) {
|
||||
if (!cJSON_IsBool(any_ue_ind)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [any_ue_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
policy_duration = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "policyDuration");
|
||||
if (policy_duration) {
|
||||
if (!cJSON_IsNumber(policy_duration)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [policy_duration]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ev_subs = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "evSubs");
|
||||
if (ev_subs) {
|
||||
cJSON *ev_subs_local = NULL;
|
||||
if (!cJSON_IsArray(ev_subs)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [ev_subs]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ev_subsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ev_subs_local, ev_subs) {
|
||||
if (!cJSON_IsObject(ev_subs_local)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [ev_subs]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_am_influ_event_t *ev_subsItem = OpenAPI_am_influ_event_parseFromJSON(ev_subs_local);
|
||||
if (!ev_subsItem) {
|
||||
ogs_error("No ev_subsItem");
|
||||
OpenAPI_list_free(ev_subsList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(ev_subsList, ev_subsItem);
|
||||
}
|
||||
}
|
||||
|
||||
notif_uri = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "notifUri");
|
||||
if (notif_uri) {
|
||||
if (!cJSON_IsString(notif_uri) && !cJSON_IsNull(notif_uri)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [notif_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
notif_corr_id = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "notifCorrId");
|
||||
if (notif_corr_id) {
|
||||
if (!cJSON_IsString(notif_corr_id) && !cJSON_IsNull(notif_corr_id)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [notif_corr_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
headers = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "headers");
|
||||
if (headers) {
|
||||
cJSON *headers_local = NULL;
|
||||
if (!cJSON_IsArray(headers)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [headers]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
headersList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(headers_local, headers) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(headers_local)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [headers]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(headersList, ogs_strdup(headers_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
thru_req = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "thruReq");
|
||||
if (thru_req) {
|
||||
if (!cJSON_IsBool(thru_req)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [thru_req]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cov_req = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "covReq");
|
||||
if (cov_req) {
|
||||
cJSON *cov_req_local = NULL;
|
||||
if (!cJSON_IsArray(cov_req)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [cov_req]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cov_reqList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(cov_req_local, cov_req) {
|
||||
if (!cJSON_IsObject(cov_req_local)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [cov_req]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_service_area_coverage_info_t *cov_reqItem = OpenAPI_service_area_coverage_info_parseFromJSON(cov_req_local);
|
||||
if (!cov_reqItem) {
|
||||
ogs_error("No cov_reqItem");
|
||||
OpenAPI_list_free(cov_reqList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(cov_reqList, cov_reqItem);
|
||||
}
|
||||
}
|
||||
|
||||
supported_features = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "supportedFeatures");
|
||||
if (supported_features) {
|
||||
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
res_uri = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "resUri");
|
||||
if (res_uri) {
|
||||
if (!cJSON_IsString(res_uri) && !cJSON_IsNull(res_uri)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [res_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
reset_ids = cJSON_GetObjectItemCaseSensitive(am_influ_dataJSON, "resetIds");
|
||||
if (reset_ids) {
|
||||
cJSON *reset_ids_local = NULL;
|
||||
if (!cJSON_IsArray(reset_ids)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
reset_idsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(reset_ids_local, reset_ids) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(reset_ids_local)) {
|
||||
ogs_error("OpenAPI_am_influ_data_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(reset_idsList, ogs_strdup(reset_ids_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
am_influ_data_local_var = OpenAPI_am_influ_data_create (
|
||||
app_ids ? app_idsList : NULL,
|
||||
dnn_snssai_infos ? dnn_snssai_infosList : NULL,
|
||||
inter_group_id && !cJSON_IsNull(inter_group_id) ? ogs_strdup(inter_group_id->valuestring) : NULL,
|
||||
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL,
|
||||
any_ue_ind ? true : false,
|
||||
any_ue_ind ? any_ue_ind->valueint : 0,
|
||||
policy_duration ? true : false,
|
||||
policy_duration ? policy_duration->valuedouble : 0,
|
||||
ev_subs ? ev_subsList : NULL,
|
||||
notif_uri && !cJSON_IsNull(notif_uri) ? ogs_strdup(notif_uri->valuestring) : NULL,
|
||||
notif_corr_id && !cJSON_IsNull(notif_corr_id) ? ogs_strdup(notif_corr_id->valuestring) : NULL,
|
||||
headers ? headersList : NULL,
|
||||
thru_req ? true : false,
|
||||
thru_req ? thru_req->valueint : 0,
|
||||
cov_req ? cov_reqList : NULL,
|
||||
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
res_uri && !cJSON_IsNull(res_uri) ? ogs_strdup(res_uri->valuestring) : NULL,
|
||||
reset_ids ? reset_idsList : NULL
|
||||
);
|
||||
|
||||
return am_influ_data_local_var;
|
||||
end:
|
||||
if (app_idsList) {
|
||||
OpenAPI_list_for_each(app_idsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(app_idsList);
|
||||
app_idsList = NULL;
|
||||
}
|
||||
if (dnn_snssai_infosList) {
|
||||
OpenAPI_list_for_each(dnn_snssai_infosList, node) {
|
||||
OpenAPI_dnn_snssai_information_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(dnn_snssai_infosList);
|
||||
dnn_snssai_infosList = NULL;
|
||||
}
|
||||
if (ev_subsList) {
|
||||
OpenAPI_list_for_each(ev_subsList, node) {
|
||||
OpenAPI_am_influ_event_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ev_subsList);
|
||||
ev_subsList = NULL;
|
||||
}
|
||||
if (headersList) {
|
||||
OpenAPI_list_for_each(headersList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(headersList);
|
||||
headersList = NULL;
|
||||
}
|
||||
if (cov_reqList) {
|
||||
OpenAPI_list_for_each(cov_reqList, node) {
|
||||
OpenAPI_service_area_coverage_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(cov_reqList);
|
||||
cov_reqList = NULL;
|
||||
}
|
||||
if (reset_idsList) {
|
||||
OpenAPI_list_for_each(reset_idsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(reset_idsList);
|
||||
reset_idsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_am_influ_data_t *OpenAPI_am_influ_data_copy(OpenAPI_am_influ_data_t *dst, OpenAPI_am_influ_data_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_am_influ_data_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_am_influ_data_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_am_influ_data_free(dst);
|
||||
dst = OpenAPI_am_influ_data_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* am_influ_data.h
|
||||
*
|
||||
* Represents the AM Influence Data.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_am_influ_data_H_
|
||||
#define _OpenAPI_am_influ_data_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "am_influ_event.h"
|
||||
#include "dnn_snssai_information.h"
|
||||
#include "service_area_coverage_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_am_influ_data_s OpenAPI_am_influ_data_t;
|
||||
typedef struct OpenAPI_am_influ_data_s {
|
||||
OpenAPI_list_t *app_ids;
|
||||
OpenAPI_list_t *dnn_snssai_infos;
|
||||
char *inter_group_id;
|
||||
char *supi;
|
||||
bool is_any_ue_ind;
|
||||
int any_ue_ind;
|
||||
bool is_policy_duration;
|
||||
int policy_duration;
|
||||
OpenAPI_list_t *ev_subs;
|
||||
char *notif_uri;
|
||||
char *notif_corr_id;
|
||||
OpenAPI_list_t *headers;
|
||||
bool is_thru_req;
|
||||
int thru_req;
|
||||
OpenAPI_list_t *cov_req;
|
||||
char *supported_features;
|
||||
char *res_uri;
|
||||
OpenAPI_list_t *reset_ids;
|
||||
} OpenAPI_am_influ_data_t;
|
||||
|
||||
OpenAPI_am_influ_data_t *OpenAPI_am_influ_data_create(
|
||||
OpenAPI_list_t *app_ids,
|
||||
OpenAPI_list_t *dnn_snssai_infos,
|
||||
char *inter_group_id,
|
||||
char *supi,
|
||||
bool is_any_ue_ind,
|
||||
int any_ue_ind,
|
||||
bool is_policy_duration,
|
||||
int policy_duration,
|
||||
OpenAPI_list_t *ev_subs,
|
||||
char *notif_uri,
|
||||
char *notif_corr_id,
|
||||
OpenAPI_list_t *headers,
|
||||
bool is_thru_req,
|
||||
int thru_req,
|
||||
OpenAPI_list_t *cov_req,
|
||||
char *supported_features,
|
||||
char *res_uri,
|
||||
OpenAPI_list_t *reset_ids
|
||||
);
|
||||
void OpenAPI_am_influ_data_free(OpenAPI_am_influ_data_t *am_influ_data);
|
||||
OpenAPI_am_influ_data_t *OpenAPI_am_influ_data_parseFromJSON(cJSON *am_influ_dataJSON);
|
||||
cJSON *OpenAPI_am_influ_data_convertToJSON(OpenAPI_am_influ_data_t *am_influ_data);
|
||||
OpenAPI_am_influ_data_t *OpenAPI_am_influ_data_copy(OpenAPI_am_influ_data_t *dst, OpenAPI_am_influ_data_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_am_influ_data_H_ */
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "am_influ_event.h"
|
||||
|
||||
OpenAPI_am_influ_event_t *OpenAPI_am_influ_event_create(
|
||||
)
|
||||
{
|
||||
OpenAPI_am_influ_event_t *am_influ_event_local_var = ogs_malloc(sizeof(OpenAPI_am_influ_event_t));
|
||||
ogs_assert(am_influ_event_local_var);
|
||||
|
||||
|
||||
return am_influ_event_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_am_influ_event_free(OpenAPI_am_influ_event_t *am_influ_event)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == am_influ_event) {
|
||||
return;
|
||||
}
|
||||
ogs_free(am_influ_event);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_am_influ_event_convertToJSON(OpenAPI_am_influ_event_t *am_influ_event)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (am_influ_event == NULL) {
|
||||
ogs_error("OpenAPI_am_influ_event_convertToJSON() failed [AmInfluEvent]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_am_influ_event_t *OpenAPI_am_influ_event_parseFromJSON(cJSON *am_influ_eventJSON)
|
||||
{
|
||||
OpenAPI_am_influ_event_t *am_influ_event_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
am_influ_event_local_var = OpenAPI_am_influ_event_create (
|
||||
);
|
||||
|
||||
return am_influ_event_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_am_influ_event_t *OpenAPI_am_influ_event_copy(OpenAPI_am_influ_event_t *dst, OpenAPI_am_influ_event_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_am_influ_event_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_am_influ_event_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_am_influ_event_free(dst);
|
||||
dst = OpenAPI_am_influ_event_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* am_influ_event.h
|
||||
*
|
||||
* Represents the service area coverage outcome event.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_am_influ_event_H_
|
||||
#define _OpenAPI_am_influ_event_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "am_influ_event_any_of.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_am_influ_event_s OpenAPI_am_influ_event_t;
|
||||
typedef struct OpenAPI_am_influ_event_s {
|
||||
} OpenAPI_am_influ_event_t;
|
||||
|
||||
OpenAPI_am_influ_event_t *OpenAPI_am_influ_event_create(
|
||||
);
|
||||
void OpenAPI_am_influ_event_free(OpenAPI_am_influ_event_t *am_influ_event);
|
||||
OpenAPI_am_influ_event_t *OpenAPI_am_influ_event_parseFromJSON(cJSON *am_influ_eventJSON);
|
||||
cJSON *OpenAPI_am_influ_event_convertToJSON(OpenAPI_am_influ_event_t *am_influ_event);
|
||||
OpenAPI_am_influ_event_t *OpenAPI_am_influ_event_copy(OpenAPI_am_influ_event_t *dst, OpenAPI_am_influ_event_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_am_influ_event_H_ */
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "am_influ_event_any_of.h"
|
||||
|
||||
char* OpenAPI_am_influ_event_any_of_ToString(OpenAPI_am_influ_event_any_of_e am_influ_event_any_of)
|
||||
{
|
||||
const char *am_influ_event_any_ofArray[] = { "NULL", "SERVICE_AREA_COVRG_OUTCOME" };
|
||||
size_t sizeofArray = sizeof(am_influ_event_any_ofArray) / sizeof(am_influ_event_any_ofArray[0]);
|
||||
if (am_influ_event_any_of < sizeofArray)
|
||||
return (char *)am_influ_event_any_ofArray[am_influ_event_any_of];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_am_influ_event_any_of_e OpenAPI_am_influ_event_any_of_FromString(char* am_influ_event_any_of)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *am_influ_event_any_ofArray[] = { "NULL", "SERVICE_AREA_COVRG_OUTCOME" };
|
||||
size_t sizeofArray = sizeof(am_influ_event_any_ofArray) / sizeof(am_influ_event_any_ofArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(am_influ_event_any_of, am_influ_event_any_ofArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* am_influ_event_any_of.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_am_influ_event_any_of_H_
|
||||
#define _OpenAPI_am_influ_event_any_of_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum { OpenAPI_am_influ_event_any_of_NULL = 0, OpenAPI_am_influ_event_any_of_SERVICE_AREA_COVRG_OUTCOME } OpenAPI_am_influ_event_any_of_e;
|
||||
|
||||
char* OpenAPI_am_influ_event_any_of_ToString(OpenAPI_am_influ_event_any_of_e am_influ_event_any_of);
|
||||
|
||||
OpenAPI_am_influ_event_any_of_e OpenAPI_am_influ_event_any_of_FromString(char* am_influ_event_any_of);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_am_influ_event_any_of_H_ */
|
||||
|
|
@ -0,0 +1,403 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "am_requested_value_rep.h"
|
||||
|
||||
OpenAPI_am_requested_value_rep_t *OpenAPI_am_requested_value_rep_create(
|
||||
OpenAPI_user_location_t *user_loc,
|
||||
OpenAPI_list_t* pra_statuses,
|
||||
OpenAPI_list_t *access_types,
|
||||
OpenAPI_list_t *rat_types,
|
||||
OpenAPI_list_t *allowed_snssais,
|
||||
OpenAPI_list_t *n3g_allowed_snssais
|
||||
)
|
||||
{
|
||||
OpenAPI_am_requested_value_rep_t *am_requested_value_rep_local_var = ogs_malloc(sizeof(OpenAPI_am_requested_value_rep_t));
|
||||
ogs_assert(am_requested_value_rep_local_var);
|
||||
|
||||
am_requested_value_rep_local_var->user_loc = user_loc;
|
||||
am_requested_value_rep_local_var->pra_statuses = pra_statuses;
|
||||
am_requested_value_rep_local_var->access_types = access_types;
|
||||
am_requested_value_rep_local_var->rat_types = rat_types;
|
||||
am_requested_value_rep_local_var->allowed_snssais = allowed_snssais;
|
||||
am_requested_value_rep_local_var->n3g_allowed_snssais = n3g_allowed_snssais;
|
||||
|
||||
return am_requested_value_rep_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_am_requested_value_rep_free(OpenAPI_am_requested_value_rep_t *am_requested_value_rep)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == am_requested_value_rep) {
|
||||
return;
|
||||
}
|
||||
if (am_requested_value_rep->user_loc) {
|
||||
OpenAPI_user_location_free(am_requested_value_rep->user_loc);
|
||||
am_requested_value_rep->user_loc = NULL;
|
||||
}
|
||||
if (am_requested_value_rep->pra_statuses) {
|
||||
OpenAPI_list_for_each(am_requested_value_rep->pra_statuses, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_presence_info_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(am_requested_value_rep->pra_statuses);
|
||||
am_requested_value_rep->pra_statuses = NULL;
|
||||
}
|
||||
if (am_requested_value_rep->access_types) {
|
||||
OpenAPI_list_free(am_requested_value_rep->access_types);
|
||||
am_requested_value_rep->access_types = NULL;
|
||||
}
|
||||
if (am_requested_value_rep->rat_types) {
|
||||
OpenAPI_list_free(am_requested_value_rep->rat_types);
|
||||
am_requested_value_rep->rat_types = NULL;
|
||||
}
|
||||
if (am_requested_value_rep->allowed_snssais) {
|
||||
OpenAPI_list_for_each(am_requested_value_rep->allowed_snssais, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_requested_value_rep->allowed_snssais);
|
||||
am_requested_value_rep->allowed_snssais = NULL;
|
||||
}
|
||||
if (am_requested_value_rep->n3g_allowed_snssais) {
|
||||
OpenAPI_list_for_each(am_requested_value_rep->n3g_allowed_snssais, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(am_requested_value_rep->n3g_allowed_snssais);
|
||||
am_requested_value_rep->n3g_allowed_snssais = NULL;
|
||||
}
|
||||
ogs_free(am_requested_value_rep);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_am_requested_value_rep_convertToJSON(OpenAPI_am_requested_value_rep_t *am_requested_value_rep)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (am_requested_value_rep == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [AmRequestedValueRep]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (am_requested_value_rep->user_loc) {
|
||||
cJSON *user_loc_local_JSON = OpenAPI_user_location_convertToJSON(am_requested_value_rep->user_loc);
|
||||
if (user_loc_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [user_loc]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "userLoc", user_loc_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [user_loc]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (am_requested_value_rep->pra_statuses) {
|
||||
cJSON *pra_statuses = cJSON_AddObjectToObject(item, "praStatuses");
|
||||
if (pra_statuses == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [pra_statuses]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = pra_statuses;
|
||||
if (am_requested_value_rep->pra_statuses) {
|
||||
OpenAPI_list_for_each(am_requested_value_rep->pra_statuses, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
cJSON *itemLocal = localKeyValue->value ?
|
||||
OpenAPI_presence_info_convertToJSON(localKeyValue->value) :
|
||||
cJSON_CreateNull();
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (am_requested_value_rep->access_types != OpenAPI_access_type_NULL) {
|
||||
cJSON *access_typesList = cJSON_AddArrayToObject(item, "accessTypes");
|
||||
if (access_typesList == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [access_types]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_requested_value_rep->access_types, node) {
|
||||
if (cJSON_AddStringToObject(access_typesList, "", OpenAPI_access_type_ToString((intptr_t)node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [access_types]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (am_requested_value_rep->rat_types != OpenAPI_rat_type_NULL) {
|
||||
cJSON *rat_typesList = cJSON_AddArrayToObject(item, "ratTypes");
|
||||
if (rat_typesList == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [rat_types]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_requested_value_rep->rat_types, node) {
|
||||
if (cJSON_AddStringToObject(rat_typesList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [rat_types]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (am_requested_value_rep->allowed_snssais) {
|
||||
cJSON *allowed_snssaisList = cJSON_AddArrayToObject(item, "allowedSnssais");
|
||||
if (allowed_snssaisList == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_requested_value_rep->allowed_snssais, node) {
|
||||
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(allowed_snssaisList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (am_requested_value_rep->n3g_allowed_snssais) {
|
||||
cJSON *n3g_allowed_snssaisList = cJSON_AddArrayToObject(item, "n3gAllowedSnssais");
|
||||
if (n3g_allowed_snssaisList == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [n3g_allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(am_requested_value_rep->n3g_allowed_snssais, node) {
|
||||
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_convertToJSON() failed [n3g_allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(n3g_allowed_snssaisList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_am_requested_value_rep_t *OpenAPI_am_requested_value_rep_parseFromJSON(cJSON *am_requested_value_repJSON)
|
||||
{
|
||||
OpenAPI_am_requested_value_rep_t *am_requested_value_rep_local_var = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *user_loc = NULL;
|
||||
OpenAPI_user_location_t *user_loc_local_nonprim = NULL;
|
||||
cJSON *pra_statuses = NULL;
|
||||
OpenAPI_list_t *pra_statusesList = NULL;
|
||||
cJSON *access_types = NULL;
|
||||
OpenAPI_list_t *access_typesList = NULL;
|
||||
cJSON *rat_types = NULL;
|
||||
OpenAPI_list_t *rat_typesList = NULL;
|
||||
cJSON *allowed_snssais = NULL;
|
||||
OpenAPI_list_t *allowed_snssaisList = NULL;
|
||||
cJSON *n3g_allowed_snssais = NULL;
|
||||
OpenAPI_list_t *n3g_allowed_snssaisList = NULL;
|
||||
user_loc = cJSON_GetObjectItemCaseSensitive(am_requested_value_repJSON, "userLoc");
|
||||
if (user_loc) {
|
||||
user_loc_local_nonprim = OpenAPI_user_location_parseFromJSON(user_loc);
|
||||
}
|
||||
|
||||
pra_statuses = cJSON_GetObjectItemCaseSensitive(am_requested_value_repJSON, "praStatuses");
|
||||
if (pra_statuses) {
|
||||
cJSON *pra_statuses_local_map = NULL;
|
||||
if (!cJSON_IsObject(pra_statuses) && !cJSON_IsNull(pra_statuses)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [pra_statuses]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_IsObject(pra_statuses)) {
|
||||
pra_statusesList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(pra_statuses_local_map, pra_statuses) {
|
||||
cJSON *localMapObject = pra_statuses_local_map;
|
||||
if (cJSON_IsObject(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject));
|
||||
} else if (cJSON_IsNull(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
|
||||
} else {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(pra_statusesList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
access_types = cJSON_GetObjectItemCaseSensitive(am_requested_value_repJSON, "accessTypes");
|
||||
if (access_types) {
|
||||
cJSON *access_types_local = NULL;
|
||||
if (!cJSON_IsArray(access_types)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [access_types]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
access_typesList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(access_types_local, access_types) {
|
||||
if (!cJSON_IsString(access_types_local)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [access_types]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(access_typesList, (void *)OpenAPI_access_type_FromString(access_types_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
rat_types = cJSON_GetObjectItemCaseSensitive(am_requested_value_repJSON, "ratTypes");
|
||||
if (rat_types) {
|
||||
cJSON *rat_types_local = NULL;
|
||||
if (!cJSON_IsArray(rat_types)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [rat_types]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
rat_typesList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(rat_types_local, rat_types) {
|
||||
if (!cJSON_IsString(rat_types_local)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [rat_types]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(rat_typesList, (void *)OpenAPI_rat_type_FromString(rat_types_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
allowed_snssais = cJSON_GetObjectItemCaseSensitive(am_requested_value_repJSON, "allowedSnssais");
|
||||
if (allowed_snssais) {
|
||||
cJSON *allowed_snssais_local = NULL;
|
||||
if (!cJSON_IsArray(allowed_snssais)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
allowed_snssaisList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(allowed_snssais_local, allowed_snssais) {
|
||||
if (!cJSON_IsObject(allowed_snssais_local)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_snssai_t *allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(allowed_snssais_local);
|
||||
if (!allowed_snssaisItem) {
|
||||
ogs_error("No allowed_snssaisItem");
|
||||
OpenAPI_list_free(allowed_snssaisList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(allowed_snssaisList, allowed_snssaisItem);
|
||||
}
|
||||
}
|
||||
|
||||
n3g_allowed_snssais = cJSON_GetObjectItemCaseSensitive(am_requested_value_repJSON, "n3gAllowedSnssais");
|
||||
if (n3g_allowed_snssais) {
|
||||
cJSON *n3g_allowed_snssais_local = NULL;
|
||||
if (!cJSON_IsArray(n3g_allowed_snssais)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [n3g_allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
n3g_allowed_snssaisList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(n3g_allowed_snssais_local, n3g_allowed_snssais) {
|
||||
if (!cJSON_IsObject(n3g_allowed_snssais_local)) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_parseFromJSON() failed [n3g_allowed_snssais]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_snssai_t *n3g_allowed_snssaisItem = OpenAPI_snssai_parseFromJSON(n3g_allowed_snssais_local);
|
||||
if (!n3g_allowed_snssaisItem) {
|
||||
ogs_error("No n3g_allowed_snssaisItem");
|
||||
OpenAPI_list_free(n3g_allowed_snssaisList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(n3g_allowed_snssaisList, n3g_allowed_snssaisItem);
|
||||
}
|
||||
}
|
||||
|
||||
am_requested_value_rep_local_var = OpenAPI_am_requested_value_rep_create (
|
||||
user_loc ? user_loc_local_nonprim : NULL,
|
||||
pra_statuses ? pra_statusesList : NULL,
|
||||
access_types ? access_typesList : NULL,
|
||||
rat_types ? rat_typesList : NULL,
|
||||
allowed_snssais ? allowed_snssaisList : NULL,
|
||||
n3g_allowed_snssais ? n3g_allowed_snssaisList : NULL
|
||||
);
|
||||
|
||||
return am_requested_value_rep_local_var;
|
||||
end:
|
||||
if (user_loc_local_nonprim) {
|
||||
OpenAPI_user_location_free(user_loc_local_nonprim);
|
||||
user_loc_local_nonprim = NULL;
|
||||
}
|
||||
if (pra_statusesList) {
|
||||
OpenAPI_list_for_each(pra_statusesList, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_presence_info_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(pra_statusesList);
|
||||
pra_statusesList = NULL;
|
||||
}
|
||||
if (access_typesList) {
|
||||
OpenAPI_list_free(access_typesList);
|
||||
access_typesList = NULL;
|
||||
}
|
||||
if (rat_typesList) {
|
||||
OpenAPI_list_free(rat_typesList);
|
||||
rat_typesList = NULL;
|
||||
}
|
||||
if (allowed_snssaisList) {
|
||||
OpenAPI_list_for_each(allowed_snssaisList, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(allowed_snssaisList);
|
||||
allowed_snssaisList = NULL;
|
||||
}
|
||||
if (n3g_allowed_snssaisList) {
|
||||
OpenAPI_list_for_each(n3g_allowed_snssaisList, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(n3g_allowed_snssaisList);
|
||||
n3g_allowed_snssaisList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_am_requested_value_rep_t *OpenAPI_am_requested_value_rep_copy(OpenAPI_am_requested_value_rep_t *dst, OpenAPI_am_requested_value_rep_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_am_requested_value_rep_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_am_requested_value_rep_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_am_requested_value_rep_free(dst);
|
||||
dst = OpenAPI_am_requested_value_rep_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* am_requested_value_rep.h
|
||||
*
|
||||
* Represents the current applicable values corresponding to the policy control request triggers.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_am_requested_value_rep_H_
|
||||
#define _OpenAPI_am_requested_value_rep_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "access_type.h"
|
||||
#include "presence_info.h"
|
||||
#include "rat_type.h"
|
||||
#include "snssai.h"
|
||||
#include "user_location.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_am_requested_value_rep_s OpenAPI_am_requested_value_rep_t;
|
||||
typedef struct OpenAPI_am_requested_value_rep_s {
|
||||
struct OpenAPI_user_location_s *user_loc;
|
||||
OpenAPI_list_t* pra_statuses;
|
||||
OpenAPI_list_t *access_types;
|
||||
OpenAPI_list_t *rat_types;
|
||||
OpenAPI_list_t *allowed_snssais;
|
||||
OpenAPI_list_t *n3g_allowed_snssais;
|
||||
} OpenAPI_am_requested_value_rep_t;
|
||||
|
||||
OpenAPI_am_requested_value_rep_t *OpenAPI_am_requested_value_rep_create(
|
||||
OpenAPI_user_location_t *user_loc,
|
||||
OpenAPI_list_t* pra_statuses,
|
||||
OpenAPI_list_t *access_types,
|
||||
OpenAPI_list_t *rat_types,
|
||||
OpenAPI_list_t *allowed_snssais,
|
||||
OpenAPI_list_t *n3g_allowed_snssais
|
||||
);
|
||||
void OpenAPI_am_requested_value_rep_free(OpenAPI_am_requested_value_rep_t *am_requested_value_rep);
|
||||
OpenAPI_am_requested_value_rep_t *OpenAPI_am_requested_value_rep_parseFromJSON(cJSON *am_requested_value_repJSON);
|
||||
cJSON *OpenAPI_am_requested_value_rep_convertToJSON(OpenAPI_am_requested_value_rep_t *am_requested_value_rep);
|
||||
OpenAPI_am_requested_value_rep_t *OpenAPI_am_requested_value_rep_copy(OpenAPI_am_requested_value_rep_t *dst, OpenAPI_am_requested_value_rep_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_am_requested_value_rep_H_ */
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* ambr.h
|
||||
*
|
||||
*
|
||||
* Contains the maximum aggregated uplink and downlink bit rates.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ambr_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* ambr_1.h
|
||||
*
|
||||
*
|
||||
* Contains the maximum aggregated uplink and downlink bit rates.
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ambr_1_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* ambr_rm.h
|
||||
*
|
||||
*
|
||||
* This data type is defined in the same way as the 'Ambr' data type, but with the OpenAPI 'nullable: true' property.\"
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ambr_rm_H_
|
||||
|
|
|
@ -17,6 +17,8 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
char *amf_service_name_pcscf_rest,
|
||||
bool is_initial_registration_ind,
|
||||
int initial_registration_ind,
|
||||
bool is_emergency_registration_ind,
|
||||
int emergency_registration_ind,
|
||||
OpenAPI_guami_t *guami,
|
||||
OpenAPI_list_t *backup_amf_info,
|
||||
bool is_dr_flag,
|
||||
|
@ -33,7 +35,23 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
OpenAPI_context_info_t *context_info,
|
||||
bool is_no_ee_subscription_ind,
|
||||
int no_ee_subscription_ind,
|
||||
char *supi
|
||||
char *supi,
|
||||
OpenAPI_ue_reachable_ind_e ue_reachable_ind,
|
||||
bool is_re_registration_required,
|
||||
int re_registration_required,
|
||||
bool is_admin_dereg_sub_withdrawn,
|
||||
int admin_dereg_sub_withdrawn,
|
||||
char *data_restoration_callback_uri,
|
||||
OpenAPI_list_t *reset_ids,
|
||||
bool is_disaster_roaming_ind,
|
||||
int disaster_roaming_ind,
|
||||
bool is_ue_mint_capability,
|
||||
int ue_mint_capability,
|
||||
bool is_sor_snpn_si_supported,
|
||||
int sor_snpn_si_supported,
|
||||
bool is_udr_restart_ind,
|
||||
int udr_restart_ind,
|
||||
char *last_synchronization_time
|
||||
)
|
||||
{
|
||||
OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration_local_var = ogs_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_t));
|
||||
|
@ -51,6 +69,8 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
amf3_gpp_access_registration_local_var->amf_service_name_pcscf_rest = amf_service_name_pcscf_rest;
|
||||
amf3_gpp_access_registration_local_var->is_initial_registration_ind = is_initial_registration_ind;
|
||||
amf3_gpp_access_registration_local_var->initial_registration_ind = initial_registration_ind;
|
||||
amf3_gpp_access_registration_local_var->is_emergency_registration_ind = is_emergency_registration_ind;
|
||||
amf3_gpp_access_registration_local_var->emergency_registration_ind = emergency_registration_ind;
|
||||
amf3_gpp_access_registration_local_var->guami = guami;
|
||||
amf3_gpp_access_registration_local_var->backup_amf_info = backup_amf_info;
|
||||
amf3_gpp_access_registration_local_var->is_dr_flag = is_dr_flag;
|
||||
|
@ -68,6 +88,22 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
amf3_gpp_access_registration_local_var->is_no_ee_subscription_ind = is_no_ee_subscription_ind;
|
||||
amf3_gpp_access_registration_local_var->no_ee_subscription_ind = no_ee_subscription_ind;
|
||||
amf3_gpp_access_registration_local_var->supi = supi;
|
||||
amf3_gpp_access_registration_local_var->ue_reachable_ind = ue_reachable_ind;
|
||||
amf3_gpp_access_registration_local_var->is_re_registration_required = is_re_registration_required;
|
||||
amf3_gpp_access_registration_local_var->re_registration_required = re_registration_required;
|
||||
amf3_gpp_access_registration_local_var->is_admin_dereg_sub_withdrawn = is_admin_dereg_sub_withdrawn;
|
||||
amf3_gpp_access_registration_local_var->admin_dereg_sub_withdrawn = admin_dereg_sub_withdrawn;
|
||||
amf3_gpp_access_registration_local_var->data_restoration_callback_uri = data_restoration_callback_uri;
|
||||
amf3_gpp_access_registration_local_var->reset_ids = reset_ids;
|
||||
amf3_gpp_access_registration_local_var->is_disaster_roaming_ind = is_disaster_roaming_ind;
|
||||
amf3_gpp_access_registration_local_var->disaster_roaming_ind = disaster_roaming_ind;
|
||||
amf3_gpp_access_registration_local_var->is_ue_mint_capability = is_ue_mint_capability;
|
||||
amf3_gpp_access_registration_local_var->ue_mint_capability = ue_mint_capability;
|
||||
amf3_gpp_access_registration_local_var->is_sor_snpn_si_supported = is_sor_snpn_si_supported;
|
||||
amf3_gpp_access_registration_local_var->sor_snpn_si_supported = sor_snpn_si_supported;
|
||||
amf3_gpp_access_registration_local_var->is_udr_restart_ind = is_udr_restart_ind;
|
||||
amf3_gpp_access_registration_local_var->udr_restart_ind = udr_restart_ind;
|
||||
amf3_gpp_access_registration_local_var->last_synchronization_time = last_synchronization_time;
|
||||
|
||||
return amf3_gpp_access_registration_local_var;
|
||||
}
|
||||
|
@ -142,6 +178,21 @@ void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registrat
|
|||
ogs_free(amf3_gpp_access_registration->supi);
|
||||
amf3_gpp_access_registration->supi = NULL;
|
||||
}
|
||||
if (amf3_gpp_access_registration->data_restoration_callback_uri) {
|
||||
ogs_free(amf3_gpp_access_registration->data_restoration_callback_uri);
|
||||
amf3_gpp_access_registration->data_restoration_callback_uri = NULL;
|
||||
}
|
||||
if (amf3_gpp_access_registration->reset_ids) {
|
||||
OpenAPI_list_for_each(amf3_gpp_access_registration->reset_ids, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf3_gpp_access_registration->reset_ids);
|
||||
amf3_gpp_access_registration->reset_ids = NULL;
|
||||
}
|
||||
if (amf3_gpp_access_registration->last_synchronization_time) {
|
||||
ogs_free(amf3_gpp_access_registration->last_synchronization_time);
|
||||
amf3_gpp_access_registration->last_synchronization_time = NULL;
|
||||
}
|
||||
ogs_free(amf3_gpp_access_registration);
|
||||
}
|
||||
|
||||
|
@ -230,6 +281,13 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->is_emergency_registration_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "emergencyRegistrationInd", amf3_gpp_access_registration->emergency_registration_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [emergency_registration_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (!amf3_gpp_access_registration->guami) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]");
|
||||
return NULL;
|
||||
|
@ -358,6 +416,83 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->ue_reachable_ind != OpenAPI_ue_reachable_ind_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "ueReachableInd", OpenAPI_ue_reachable_ind_ToString(amf3_gpp_access_registration->ue_reachable_ind)) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ue_reachable_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->is_re_registration_required) {
|
||||
if (cJSON_AddBoolToObject(item, "reRegistrationRequired", amf3_gpp_access_registration->re_registration_required) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [re_registration_required]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->is_admin_dereg_sub_withdrawn) {
|
||||
if (cJSON_AddBoolToObject(item, "adminDeregSubWithdrawn", amf3_gpp_access_registration->admin_dereg_sub_withdrawn) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [admin_dereg_sub_withdrawn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->data_restoration_callback_uri) {
|
||||
if (cJSON_AddStringToObject(item, "dataRestorationCallbackUri", amf3_gpp_access_registration->data_restoration_callback_uri) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [data_restoration_callback_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->reset_ids) {
|
||||
cJSON *reset_idsList = cJSON_AddArrayToObject(item, "resetIds");
|
||||
if (reset_idsList == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf3_gpp_access_registration->reset_ids, node) {
|
||||
if (cJSON_AddStringToObject(reset_idsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->is_disaster_roaming_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "disasterRoamingInd", amf3_gpp_access_registration->disaster_roaming_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [disaster_roaming_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->is_ue_mint_capability) {
|
||||
if (cJSON_AddBoolToObject(item, "ueMINTCapability", amf3_gpp_access_registration->ue_mint_capability) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ue_mint_capability]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->is_sor_snpn_si_supported) {
|
||||
if (cJSON_AddBoolToObject(item, "sorSnpnSiSupported", amf3_gpp_access_registration->sor_snpn_si_supported) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [sor_snpn_si_supported]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->is_udr_restart_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "udrRestartInd", amf3_gpp_access_registration->udr_restart_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [udr_restart_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->last_synchronization_time) {
|
||||
if (cJSON_AddStringToObject(item, "lastSynchronizationTime", amf3_gpp_access_registration->last_synchronization_time) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [last_synchronization_time]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -377,6 +512,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
cJSON *pcscf_restoration_callback_uri = NULL;
|
||||
cJSON *amf_service_name_pcscf_rest = NULL;
|
||||
cJSON *initial_registration_ind = NULL;
|
||||
cJSON *emergency_registration_ind = NULL;
|
||||
cJSON *guami = NULL;
|
||||
OpenAPI_guami_t *guami_local_nonprim = NULL;
|
||||
cJSON *backup_amf_info = NULL;
|
||||
|
@ -396,6 +532,18 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
|
||||
cJSON *no_ee_subscription_ind = NULL;
|
||||
cJSON *supi = NULL;
|
||||
cJSON *ue_reachable_ind = NULL;
|
||||
OpenAPI_ue_reachable_ind_e ue_reachable_indVariable = 0;
|
||||
cJSON *re_registration_required = NULL;
|
||||
cJSON *admin_dereg_sub_withdrawn = NULL;
|
||||
cJSON *data_restoration_callback_uri = NULL;
|
||||
cJSON *reset_ids = NULL;
|
||||
OpenAPI_list_t *reset_idsList = NULL;
|
||||
cJSON *disaster_roaming_ind = NULL;
|
||||
cJSON *ue_mint_capability = NULL;
|
||||
cJSON *sor_snpn_si_supported = NULL;
|
||||
cJSON *udr_restart_ind = NULL;
|
||||
cJSON *last_synchronization_time = NULL;
|
||||
amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfInstanceId");
|
||||
if (!amf_instance_id) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]");
|
||||
|
@ -481,6 +629,14 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
}
|
||||
}
|
||||
|
||||
emergency_registration_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "emergencyRegistrationInd");
|
||||
if (emergency_registration_ind) {
|
||||
if (!cJSON_IsBool(emergency_registration_ind)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [emergency_registration_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "guami");
|
||||
if (!guami) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [guami]");
|
||||
|
@ -595,6 +751,100 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
}
|
||||
}
|
||||
|
||||
ue_reachable_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueReachableInd");
|
||||
if (ue_reachable_ind) {
|
||||
if (!cJSON_IsString(ue_reachable_ind)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ue_reachable_ind]");
|
||||
goto end;
|
||||
}
|
||||
ue_reachable_indVariable = OpenAPI_ue_reachable_ind_FromString(ue_reachable_ind->valuestring);
|
||||
}
|
||||
|
||||
re_registration_required = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "reRegistrationRequired");
|
||||
if (re_registration_required) {
|
||||
if (!cJSON_IsBool(re_registration_required)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [re_registration_required]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
admin_dereg_sub_withdrawn = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "adminDeregSubWithdrawn");
|
||||
if (admin_dereg_sub_withdrawn) {
|
||||
if (!cJSON_IsBool(admin_dereg_sub_withdrawn)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [admin_dereg_sub_withdrawn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
data_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "dataRestorationCallbackUri");
|
||||
if (data_restoration_callback_uri) {
|
||||
if (!cJSON_IsString(data_restoration_callback_uri) && !cJSON_IsNull(data_restoration_callback_uri)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [data_restoration_callback_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
reset_ids = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "resetIds");
|
||||
if (reset_ids) {
|
||||
cJSON *reset_ids_local = NULL;
|
||||
if (!cJSON_IsArray(reset_ids)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
reset_idsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(reset_ids_local, reset_ids) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(reset_ids_local)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(reset_idsList, ogs_strdup(reset_ids_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
disaster_roaming_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "disasterRoamingInd");
|
||||
if (disaster_roaming_ind) {
|
||||
if (!cJSON_IsBool(disaster_roaming_ind)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [disaster_roaming_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ue_mint_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueMINTCapability");
|
||||
if (ue_mint_capability) {
|
||||
if (!cJSON_IsBool(ue_mint_capability)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ue_mint_capability]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
sor_snpn_si_supported = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "sorSnpnSiSupported");
|
||||
if (sor_snpn_si_supported) {
|
||||
if (!cJSON_IsBool(sor_snpn_si_supported)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [sor_snpn_si_supported]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
udr_restart_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "udrRestartInd");
|
||||
if (udr_restart_ind) {
|
||||
if (!cJSON_IsBool(udr_restart_ind)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [udr_restart_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
last_synchronization_time = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "lastSynchronizationTime");
|
||||
if (last_synchronization_time) {
|
||||
if (!cJSON_IsString(last_synchronization_time) && !cJSON_IsNull(last_synchronization_time)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [last_synchronization_time]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
amf3_gpp_access_registration_local_var = OpenAPI_amf3_gpp_access_registration_create (
|
||||
ogs_strdup(amf_instance_id->valuestring),
|
||||
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
|
@ -608,6 +858,8 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
amf_service_name_pcscf_rest && !cJSON_IsNull(amf_service_name_pcscf_rest) ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL,
|
||||
initial_registration_ind ? true : false,
|
||||
initial_registration_ind ? initial_registration_ind->valueint : 0,
|
||||
emergency_registration_ind ? true : false,
|
||||
emergency_registration_ind ? emergency_registration_ind->valueint : 0,
|
||||
guami_local_nonprim,
|
||||
backup_amf_info ? backup_amf_infoList : NULL,
|
||||
dr_flag ? true : false,
|
||||
|
@ -624,7 +876,23 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
context_info ? context_info_local_nonprim : NULL,
|
||||
no_ee_subscription_ind ? true : false,
|
||||
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0,
|
||||
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL
|
||||
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL,
|
||||
ue_reachable_ind ? ue_reachable_indVariable : 0,
|
||||
re_registration_required ? true : false,
|
||||
re_registration_required ? re_registration_required->valueint : 0,
|
||||
admin_dereg_sub_withdrawn ? true : false,
|
||||
admin_dereg_sub_withdrawn ? admin_dereg_sub_withdrawn->valueint : 0,
|
||||
data_restoration_callback_uri && !cJSON_IsNull(data_restoration_callback_uri) ? ogs_strdup(data_restoration_callback_uri->valuestring) : NULL,
|
||||
reset_ids ? reset_idsList : NULL,
|
||||
disaster_roaming_ind ? true : false,
|
||||
disaster_roaming_ind ? disaster_roaming_ind->valueint : 0,
|
||||
ue_mint_capability ? true : false,
|
||||
ue_mint_capability ? ue_mint_capability->valueint : 0,
|
||||
sor_snpn_si_supported ? true : false,
|
||||
sor_snpn_si_supported ? sor_snpn_si_supported->valueint : 0,
|
||||
udr_restart_ind ? true : false,
|
||||
udr_restart_ind ? udr_restart_ind->valueint : 0,
|
||||
last_synchronization_time && !cJSON_IsNull(last_synchronization_time) ? ogs_strdup(last_synchronization_time->valuestring) : NULL
|
||||
);
|
||||
|
||||
return amf3_gpp_access_registration_local_var;
|
||||
|
@ -652,6 +920,13 @@ end:
|
|||
OpenAPI_context_info_free(context_info_local_nonprim);
|
||||
context_info_local_nonprim = NULL;
|
||||
}
|
||||
if (reset_idsList) {
|
||||
OpenAPI_list_for_each(reset_idsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(reset_idsList);
|
||||
reset_idsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "guami.h"
|
||||
#include "ims_vo_ps.h"
|
||||
#include "rat_type.h"
|
||||
#include "ue_reachable_ind.h"
|
||||
#include "vgmlc_address.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -38,6 +39,8 @@ typedef struct OpenAPI_amf3_gpp_access_registration_s {
|
|||
char *amf_service_name_pcscf_rest;
|
||||
bool is_initial_registration_ind;
|
||||
int initial_registration_ind;
|
||||
bool is_emergency_registration_ind;
|
||||
int emergency_registration_ind;
|
||||
struct OpenAPI_guami_s *guami;
|
||||
OpenAPI_list_t *backup_amf_info;
|
||||
bool is_dr_flag;
|
||||
|
@ -55,6 +58,22 @@ typedef struct OpenAPI_amf3_gpp_access_registration_s {
|
|||
bool is_no_ee_subscription_ind;
|
||||
int no_ee_subscription_ind;
|
||||
char *supi;
|
||||
OpenAPI_ue_reachable_ind_e ue_reachable_ind;
|
||||
bool is_re_registration_required;
|
||||
int re_registration_required;
|
||||
bool is_admin_dereg_sub_withdrawn;
|
||||
int admin_dereg_sub_withdrawn;
|
||||
char *data_restoration_callback_uri;
|
||||
OpenAPI_list_t *reset_ids;
|
||||
bool is_disaster_roaming_ind;
|
||||
int disaster_roaming_ind;
|
||||
bool is_ue_mint_capability;
|
||||
int ue_mint_capability;
|
||||
bool is_sor_snpn_si_supported;
|
||||
int sor_snpn_si_supported;
|
||||
bool is_udr_restart_ind;
|
||||
int udr_restart_ind;
|
||||
char *last_synchronization_time;
|
||||
} OpenAPI_amf3_gpp_access_registration_t;
|
||||
|
||||
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_create(
|
||||
|
@ -70,6 +89,8 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
char *amf_service_name_pcscf_rest,
|
||||
bool is_initial_registration_ind,
|
||||
int initial_registration_ind,
|
||||
bool is_emergency_registration_ind,
|
||||
int emergency_registration_ind,
|
||||
OpenAPI_guami_t *guami,
|
||||
OpenAPI_list_t *backup_amf_info,
|
||||
bool is_dr_flag,
|
||||
|
@ -86,7 +107,23 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
OpenAPI_context_info_t *context_info,
|
||||
bool is_no_ee_subscription_ind,
|
||||
int no_ee_subscription_ind,
|
||||
char *supi
|
||||
char *supi,
|
||||
OpenAPI_ue_reachable_ind_e ue_reachable_ind,
|
||||
bool is_re_registration_required,
|
||||
int re_registration_required,
|
||||
bool is_admin_dereg_sub_withdrawn,
|
||||
int admin_dereg_sub_withdrawn,
|
||||
char *data_restoration_callback_uri,
|
||||
OpenAPI_list_t *reset_ids,
|
||||
bool is_disaster_roaming_ind,
|
||||
int disaster_roaming_ind,
|
||||
bool is_ue_mint_capability,
|
||||
int ue_mint_capability,
|
||||
bool is_sor_snpn_si_supported,
|
||||
int sor_snpn_si_supported,
|
||||
bool is_udr_restart_ind,
|
||||
int udr_restart_ind,
|
||||
char *last_synchronization_time
|
||||
);
|
||||
void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration);
|
||||
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_parseFromJSON(cJSON *amf3_gpp_access_registrationJSON);
|
||||
|
|
|
@ -13,7 +13,9 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
OpenAPI_list_t *backup_amf_info,
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info,
|
||||
bool is_ue_srvcc_capability,
|
||||
int ue_srvcc_capability
|
||||
int ue_srvcc_capability,
|
||||
bool is_ue_mint_capability,
|
||||
int ue_mint_capability
|
||||
)
|
||||
{
|
||||
OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification_local_var = ogs_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_modification_t));
|
||||
|
@ -28,6 +30,8 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
amf3_gpp_access_registration_modification_local_var->eps_interworking_info = eps_interworking_info;
|
||||
amf3_gpp_access_registration_modification_local_var->is_ue_srvcc_capability = is_ue_srvcc_capability;
|
||||
amf3_gpp_access_registration_modification_local_var->ue_srvcc_capability = ue_srvcc_capability;
|
||||
amf3_gpp_access_registration_modification_local_var->is_ue_mint_capability = is_ue_mint_capability;
|
||||
amf3_gpp_access_registration_modification_local_var->ue_mint_capability = ue_mint_capability;
|
||||
|
||||
return amf3_gpp_access_registration_modification_local_var;
|
||||
}
|
||||
|
@ -144,6 +148,13 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
|
|||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration_modification->is_ue_mint_capability) {
|
||||
if (cJSON_AddBoolToObject(item, "ueMINTCapability", amf3_gpp_access_registration_modification->ue_mint_capability) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ue_mint_capability]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -163,6 +174,7 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
cJSON *eps_interworking_info = NULL;
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL;
|
||||
cJSON *ue_srvcc_capability = NULL;
|
||||
cJSON *ue_mint_capability = NULL;
|
||||
guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "guami");
|
||||
if (!guami) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [guami]");
|
||||
|
@ -233,6 +245,14 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
}
|
||||
}
|
||||
|
||||
ue_mint_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "ueMINTCapability");
|
||||
if (ue_mint_capability) {
|
||||
if (!cJSON_IsBool(ue_mint_capability)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ue_mint_capability]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
amf3_gpp_access_registration_modification_local_var = OpenAPI_amf3_gpp_access_registration_modification_create (
|
||||
guami_local_nonprim,
|
||||
purge_flag ? true : false,
|
||||
|
@ -242,7 +262,9 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
backup_amf_info ? backup_amf_infoList : NULL,
|
||||
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
|
||||
ue_srvcc_capability ? true : false,
|
||||
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0
|
||||
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0,
|
||||
ue_mint_capability ? true : false,
|
||||
ue_mint_capability ? ue_mint_capability->valueint : 0
|
||||
);
|
||||
|
||||
return amf3_gpp_access_registration_modification_local_var;
|
||||
|
|
|
@ -32,6 +32,8 @@ typedef struct OpenAPI_amf3_gpp_access_registration_modification_s {
|
|||
struct OpenAPI_eps_interworking_info_s *eps_interworking_info;
|
||||
bool is_ue_srvcc_capability;
|
||||
int ue_srvcc_capability;
|
||||
bool is_ue_mint_capability;
|
||||
int ue_mint_capability;
|
||||
} OpenAPI_amf3_gpp_access_registration_modification_t;
|
||||
|
||||
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_create(
|
||||
|
@ -43,7 +45,9 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
OpenAPI_list_t *backup_amf_info,
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info,
|
||||
bool is_ue_srvcc_capability,
|
||||
int ue_srvcc_capability
|
||||
int ue_srvcc_capability,
|
||||
bool is_ue_mint_capability,
|
||||
int ue_mint_capability
|
||||
);
|
||||
void OpenAPI_amf3_gpp_access_registration_modification_free(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification);
|
||||
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(cJSON *amf3_gpp_access_registration_modificationJSON);
|
||||
|
|
|
@ -16,10 +16,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_create(
|
|||
bool is_report_ue_reachable,
|
||||
int report_ue_reachable,
|
||||
OpenAPI_reachability_filter_t *reachability_filter,
|
||||
bool is_udm_detect_ind,
|
||||
int udm_detect_ind,
|
||||
bool is_max_reports,
|
||||
int max_reports,
|
||||
OpenAPI_list_t* presence_info_list,
|
||||
bool is_max_response_time,
|
||||
int max_response_time
|
||||
int max_response_time,
|
||||
OpenAPI_target_area_t *target_area,
|
||||
OpenAPI_list_t *snssai_filter,
|
||||
OpenAPI_ue_in_area_filter_t *ue_in_area_filter,
|
||||
bool is_min_interval,
|
||||
int min_interval,
|
||||
char *next_report,
|
||||
bool is_idle_status_ind,
|
||||
int idle_status_ind,
|
||||
OpenAPI_dispersion_area_t *dispersion_area
|
||||
)
|
||||
{
|
||||
OpenAPI_amf_event_t *amf_event_local_var = ogs_malloc(sizeof(OpenAPI_amf_event_t));
|
||||
|
@ -36,10 +48,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_create(
|
|||
amf_event_local_var->is_report_ue_reachable = is_report_ue_reachable;
|
||||
amf_event_local_var->report_ue_reachable = report_ue_reachable;
|
||||
amf_event_local_var->reachability_filter = reachability_filter;
|
||||
amf_event_local_var->is_udm_detect_ind = is_udm_detect_ind;
|
||||
amf_event_local_var->udm_detect_ind = udm_detect_ind;
|
||||
amf_event_local_var->is_max_reports = is_max_reports;
|
||||
amf_event_local_var->max_reports = max_reports;
|
||||
amf_event_local_var->presence_info_list = presence_info_list;
|
||||
amf_event_local_var->is_max_response_time = is_max_response_time;
|
||||
amf_event_local_var->max_response_time = max_response_time;
|
||||
amf_event_local_var->target_area = target_area;
|
||||
amf_event_local_var->snssai_filter = snssai_filter;
|
||||
amf_event_local_var->ue_in_area_filter = ue_in_area_filter;
|
||||
amf_event_local_var->is_min_interval = is_min_interval;
|
||||
amf_event_local_var->min_interval = min_interval;
|
||||
amf_event_local_var->next_report = next_report;
|
||||
amf_event_local_var->is_idle_status_ind = is_idle_status_ind;
|
||||
amf_event_local_var->idle_status_ind = idle_status_ind;
|
||||
amf_event_local_var->dispersion_area = dispersion_area;
|
||||
|
||||
return amf_event_local_var;
|
||||
}
|
||||
|
@ -80,6 +104,39 @@ void OpenAPI_amf_event_free(OpenAPI_amf_event_t *amf_event)
|
|||
OpenAPI_reachability_filter_free(amf_event->reachability_filter);
|
||||
amf_event->reachability_filter = NULL;
|
||||
}
|
||||
if (amf_event->presence_info_list) {
|
||||
OpenAPI_list_for_each(amf_event->presence_info_list, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_presence_info_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(amf_event->presence_info_list);
|
||||
amf_event->presence_info_list = NULL;
|
||||
}
|
||||
if (amf_event->target_area) {
|
||||
OpenAPI_target_area_free(amf_event->target_area);
|
||||
amf_event->target_area = NULL;
|
||||
}
|
||||
if (amf_event->snssai_filter) {
|
||||
OpenAPI_list_for_each(amf_event->snssai_filter, node) {
|
||||
OpenAPI_ext_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_event->snssai_filter);
|
||||
amf_event->snssai_filter = NULL;
|
||||
}
|
||||
if (amf_event->ue_in_area_filter) {
|
||||
OpenAPI_ue_in_area_filter_free(amf_event->ue_in_area_filter);
|
||||
amf_event->ue_in_area_filter = NULL;
|
||||
}
|
||||
if (amf_event->next_report) {
|
||||
ogs_free(amf_event->next_report);
|
||||
amf_event->next_report = NULL;
|
||||
}
|
||||
if (amf_event->dispersion_area) {
|
||||
OpenAPI_dispersion_area_free(amf_event->dispersion_area);
|
||||
amf_event->dispersion_area = NULL;
|
||||
}
|
||||
ogs_free(amf_event);
|
||||
}
|
||||
|
||||
|
@ -191,6 +248,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_event->is_udm_detect_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "udmDetectInd", amf_event->udm_detect_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [udm_detect_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->is_max_reports) {
|
||||
if (cJSON_AddNumberToObject(item, "maxReports", amf_event->max_reports) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [max_reports]");
|
||||
|
@ -198,6 +262,28 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_event->presence_info_list) {
|
||||
cJSON *presence_info_list = cJSON_AddObjectToObject(item, "presenceInfoList");
|
||||
if (presence_info_list == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [presence_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = presence_info_list;
|
||||
if (amf_event->presence_info_list) {
|
||||
OpenAPI_list_for_each(amf_event->presence_info_list, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
cJSON *itemLocal = localKeyValue->value ?
|
||||
OpenAPI_presence_info_convertToJSON(localKeyValue->value) :
|
||||
cJSON_CreateNull();
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->is_max_response_time) {
|
||||
if (cJSON_AddNumberToObject(item, "maxResponseTime", amf_event->max_response_time) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [max_response_time]");
|
||||
|
@ -205,6 +291,82 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_event->target_area) {
|
||||
cJSON *target_area_local_JSON = OpenAPI_target_area_convertToJSON(amf_event->target_area);
|
||||
if (target_area_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [target_area]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "targetArea", target_area_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [target_area]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->snssai_filter) {
|
||||
cJSON *snssai_filterList = cJSON_AddArrayToObject(item, "snssaiFilter");
|
||||
if (snssai_filterList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [snssai_filter]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event->snssai_filter, node) {
|
||||
cJSON *itemLocal = OpenAPI_ext_snssai_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [snssai_filter]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(snssai_filterList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->ue_in_area_filter) {
|
||||
cJSON *ue_in_area_filter_local_JSON = OpenAPI_ue_in_area_filter_convertToJSON(amf_event->ue_in_area_filter);
|
||||
if (ue_in_area_filter_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [ue_in_area_filter]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "ueInAreaFilter", ue_in_area_filter_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [ue_in_area_filter]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->is_min_interval) {
|
||||
if (cJSON_AddNumberToObject(item, "minInterval", amf_event->min_interval) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [min_interval]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->next_report) {
|
||||
if (cJSON_AddStringToObject(item, "nextReport", amf_event->next_report) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [next_report]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->is_idle_status_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "idleStatusInd", amf_event->idle_status_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [idle_status_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event->dispersion_area) {
|
||||
cJSON *dispersion_area_local_JSON = OpenAPI_dispersion_area_convertToJSON(amf_event->dispersion_area);
|
||||
if (dispersion_area_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [dispersion_area]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "dispersionArea", dispersion_area_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_convertToJSON() failed [dispersion_area]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -226,8 +388,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
|
|||
cJSON *report_ue_reachable = NULL;
|
||||
cJSON *reachability_filter = NULL;
|
||||
OpenAPI_reachability_filter_t *reachability_filter_local_nonprim = NULL;
|
||||
cJSON *udm_detect_ind = NULL;
|
||||
cJSON *max_reports = NULL;
|
||||
cJSON *presence_info_list = NULL;
|
||||
OpenAPI_list_t *presence_info_listList = NULL;
|
||||
cJSON *max_response_time = NULL;
|
||||
cJSON *target_area = NULL;
|
||||
OpenAPI_target_area_t *target_area_local_nonprim = NULL;
|
||||
cJSON *snssai_filter = NULL;
|
||||
OpenAPI_list_t *snssai_filterList = NULL;
|
||||
cJSON *ue_in_area_filter = NULL;
|
||||
OpenAPI_ue_in_area_filter_t *ue_in_area_filter_local_nonprim = NULL;
|
||||
cJSON *min_interval = NULL;
|
||||
cJSON *next_report = NULL;
|
||||
cJSON *idle_status_ind = NULL;
|
||||
cJSON *dispersion_area = NULL;
|
||||
OpenAPI_dispersion_area_t *dispersion_area_local_nonprim = NULL;
|
||||
type = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "type");
|
||||
if (!type) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [type]");
|
||||
|
@ -339,6 +515,14 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
|
|||
reachability_filter_local_nonprim = OpenAPI_reachability_filter_parseFromJSON(reachability_filter);
|
||||
}
|
||||
|
||||
udm_detect_ind = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "udmDetectInd");
|
||||
if (udm_detect_ind) {
|
||||
if (!cJSON_IsBool(udm_detect_ind)) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [udm_detect_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
max_reports = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxReports");
|
||||
if (max_reports) {
|
||||
if (!cJSON_IsNumber(max_reports)) {
|
||||
|
@ -347,6 +531,32 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
|
|||
}
|
||||
}
|
||||
|
||||
presence_info_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "presenceInfoList");
|
||||
if (presence_info_list) {
|
||||
cJSON *presence_info_list_local_map = NULL;
|
||||
if (!cJSON_IsObject(presence_info_list) && !cJSON_IsNull(presence_info_list)) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [presence_info_list]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_IsObject(presence_info_list)) {
|
||||
presence_info_listList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(presence_info_list_local_map, presence_info_list) {
|
||||
cJSON *localMapObject = presence_info_list_local_map;
|
||||
if (cJSON_IsObject(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject));
|
||||
} else if (cJSON_IsNull(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
|
||||
} else {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(presence_info_listList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
max_response_time = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxResponseTime");
|
||||
if (max_response_time) {
|
||||
if (!cJSON_IsNumber(max_response_time)) {
|
||||
|
@ -355,6 +565,70 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
|
|||
}
|
||||
}
|
||||
|
||||
target_area = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "targetArea");
|
||||
if (target_area) {
|
||||
target_area_local_nonprim = OpenAPI_target_area_parseFromJSON(target_area);
|
||||
}
|
||||
|
||||
snssai_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "snssaiFilter");
|
||||
if (snssai_filter) {
|
||||
cJSON *snssai_filter_local = NULL;
|
||||
if (!cJSON_IsArray(snssai_filter)) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [snssai_filter]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
snssai_filterList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(snssai_filter_local, snssai_filter) {
|
||||
if (!cJSON_IsObject(snssai_filter_local)) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [snssai_filter]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_ext_snssai_t *snssai_filterItem = OpenAPI_ext_snssai_parseFromJSON(snssai_filter_local);
|
||||
if (!snssai_filterItem) {
|
||||
ogs_error("No snssai_filterItem");
|
||||
OpenAPI_list_free(snssai_filterList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(snssai_filterList, snssai_filterItem);
|
||||
}
|
||||
}
|
||||
|
||||
ue_in_area_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "ueInAreaFilter");
|
||||
if (ue_in_area_filter) {
|
||||
ue_in_area_filter_local_nonprim = OpenAPI_ue_in_area_filter_parseFromJSON(ue_in_area_filter);
|
||||
}
|
||||
|
||||
min_interval = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "minInterval");
|
||||
if (min_interval) {
|
||||
if (!cJSON_IsNumber(min_interval)) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [min_interval]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
next_report = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "nextReport");
|
||||
if (next_report) {
|
||||
if (!cJSON_IsString(next_report) && !cJSON_IsNull(next_report)) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [next_report]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
idle_status_ind = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "idleStatusInd");
|
||||
if (idle_status_ind) {
|
||||
if (!cJSON_IsBool(idle_status_ind)) {
|
||||
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [idle_status_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
dispersion_area = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "dispersionArea");
|
||||
if (dispersion_area) {
|
||||
dispersion_area_local_nonprim = OpenAPI_dispersion_area_parseFromJSON(dispersion_area);
|
||||
}
|
||||
|
||||
amf_event_local_var = OpenAPI_amf_event_create (
|
||||
type_local_nonprim,
|
||||
immediate_flag ? true : false,
|
||||
|
@ -367,10 +641,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
|
|||
report_ue_reachable ? true : false,
|
||||
report_ue_reachable ? report_ue_reachable->valueint : 0,
|
||||
reachability_filter ? reachability_filter_local_nonprim : NULL,
|
||||
udm_detect_ind ? true : false,
|
||||
udm_detect_ind ? udm_detect_ind->valueint : 0,
|
||||
max_reports ? true : false,
|
||||
max_reports ? max_reports->valuedouble : 0,
|
||||
presence_info_list ? presence_info_listList : NULL,
|
||||
max_response_time ? true : false,
|
||||
max_response_time ? max_response_time->valuedouble : 0
|
||||
max_response_time ? max_response_time->valuedouble : 0,
|
||||
target_area ? target_area_local_nonprim : NULL,
|
||||
snssai_filter ? snssai_filterList : NULL,
|
||||
ue_in_area_filter ? ue_in_area_filter_local_nonprim : NULL,
|
||||
min_interval ? true : false,
|
||||
min_interval ? min_interval->valuedouble : 0,
|
||||
next_report && !cJSON_IsNull(next_report) ? ogs_strdup(next_report->valuestring) : NULL,
|
||||
idle_status_ind ? true : false,
|
||||
idle_status_ind ? idle_status_ind->valueint : 0,
|
||||
dispersion_area ? dispersion_area_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return amf_event_local_var;
|
||||
|
@ -404,6 +690,35 @@ end:
|
|||
OpenAPI_reachability_filter_free(reachability_filter_local_nonprim);
|
||||
reachability_filter_local_nonprim = NULL;
|
||||
}
|
||||
if (presence_info_listList) {
|
||||
OpenAPI_list_for_each(presence_info_listList, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_presence_info_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(presence_info_listList);
|
||||
presence_info_listList = NULL;
|
||||
}
|
||||
if (target_area_local_nonprim) {
|
||||
OpenAPI_target_area_free(target_area_local_nonprim);
|
||||
target_area_local_nonprim = NULL;
|
||||
}
|
||||
if (snssai_filterList) {
|
||||
OpenAPI_list_for_each(snssai_filterList, node) {
|
||||
OpenAPI_ext_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(snssai_filterList);
|
||||
snssai_filterList = NULL;
|
||||
}
|
||||
if (ue_in_area_filter_local_nonprim) {
|
||||
OpenAPI_ue_in_area_filter_free(ue_in_area_filter_local_nonprim);
|
||||
ue_in_area_filter_local_nonprim = NULL;
|
||||
}
|
||||
if (dispersion_area_local_nonprim) {
|
||||
OpenAPI_dispersion_area_free(dispersion_area_local_nonprim);
|
||||
dispersion_area_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* amf_event.h
|
||||
*
|
||||
*
|
||||
* Describes an event to be subscribed
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_amf_event_H_
|
||||
|
@ -14,9 +14,14 @@
|
|||
#include "../include/binary.h"
|
||||
#include "amf_event_area.h"
|
||||
#include "amf_event_type.h"
|
||||
#include "dispersion_area.h"
|
||||
#include "ext_snssai.h"
|
||||
#include "location_filter.h"
|
||||
#include "presence_info.h"
|
||||
#include "reachability_filter.h"
|
||||
#include "target_area.h"
|
||||
#include "traffic_descriptor.h"
|
||||
#include "ue_in_area_filter.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -35,10 +40,22 @@ typedef struct OpenAPI_amf_event_s {
|
|||
bool is_report_ue_reachable;
|
||||
int report_ue_reachable;
|
||||
struct OpenAPI_reachability_filter_s *reachability_filter;
|
||||
bool is_udm_detect_ind;
|
||||
int udm_detect_ind;
|
||||
bool is_max_reports;
|
||||
int max_reports;
|
||||
OpenAPI_list_t* presence_info_list;
|
||||
bool is_max_response_time;
|
||||
int max_response_time;
|
||||
struct OpenAPI_target_area_s *target_area;
|
||||
OpenAPI_list_t *snssai_filter;
|
||||
struct OpenAPI_ue_in_area_filter_s *ue_in_area_filter;
|
||||
bool is_min_interval;
|
||||
int min_interval;
|
||||
char *next_report;
|
||||
bool is_idle_status_ind;
|
||||
int idle_status_ind;
|
||||
struct OpenAPI_dispersion_area_s *dispersion_area;
|
||||
} OpenAPI_amf_event_t;
|
||||
|
||||
OpenAPI_amf_event_t *OpenAPI_amf_event_create(
|
||||
|
@ -53,10 +70,22 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_create(
|
|||
bool is_report_ue_reachable,
|
||||
int report_ue_reachable,
|
||||
OpenAPI_reachability_filter_t *reachability_filter,
|
||||
bool is_udm_detect_ind,
|
||||
int udm_detect_ind,
|
||||
bool is_max_reports,
|
||||
int max_reports,
|
||||
OpenAPI_list_t* presence_info_list,
|
||||
bool is_max_response_time,
|
||||
int max_response_time
|
||||
int max_response_time,
|
||||
OpenAPI_target_area_t *target_area,
|
||||
OpenAPI_list_t *snssai_filter,
|
||||
OpenAPI_ue_in_area_filter_t *ue_in_area_filter,
|
||||
bool is_min_interval,
|
||||
int min_interval,
|
||||
char *next_report,
|
||||
bool is_idle_status_ind,
|
||||
int idle_status_ind,
|
||||
OpenAPI_dispersion_area_t *dispersion_area
|
||||
);
|
||||
void OpenAPI_amf_event_free(OpenAPI_amf_event_t *amf_event);
|
||||
OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* amf_event_area.h
|
||||
*
|
||||
*
|
||||
* Represents an area to be monitored by an AMF event
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_amf_event_area_H_
|
||||
|
|
|
@ -12,7 +12,9 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
|
|||
bool is_rep_period,
|
||||
int rep_period,
|
||||
bool is_samp_ratio,
|
||||
int samp_ratio
|
||||
int samp_ratio,
|
||||
OpenAPI_list_t *partitioning_criteria,
|
||||
OpenAPI_notification_flag_e notif_flag
|
||||
)
|
||||
{
|
||||
OpenAPI_amf_event_mode_t *amf_event_mode_local_var = ogs_malloc(sizeof(OpenAPI_amf_event_mode_t));
|
||||
|
@ -26,6 +28,8 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
|
|||
amf_event_mode_local_var->rep_period = rep_period;
|
||||
amf_event_mode_local_var->is_samp_ratio = is_samp_ratio;
|
||||
amf_event_mode_local_var->samp_ratio = samp_ratio;
|
||||
amf_event_mode_local_var->partitioning_criteria = partitioning_criteria;
|
||||
amf_event_mode_local_var->notif_flag = notif_flag;
|
||||
|
||||
return amf_event_mode_local_var;
|
||||
}
|
||||
|
@ -45,6 +49,10 @@ void OpenAPI_amf_event_mode_free(OpenAPI_amf_event_mode_t *amf_event_mode)
|
|||
ogs_free(amf_event_mode->expiry);
|
||||
amf_event_mode->expiry = NULL;
|
||||
}
|
||||
if (amf_event_mode->partitioning_criteria) {
|
||||
OpenAPI_list_free(amf_event_mode->partitioning_criteria);
|
||||
amf_event_mode->partitioning_criteria = NULL;
|
||||
}
|
||||
ogs_free(amf_event_mode);
|
||||
}
|
||||
|
||||
|
@ -102,6 +110,27 @@ cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_event_mode->partitioning_criteria != OpenAPI_partitioning_criteria_NULL) {
|
||||
cJSON *partitioning_criteriaList = cJSON_AddArrayToObject(item, "partitioningCriteria");
|
||||
if (partitioning_criteriaList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event_mode->partitioning_criteria, node) {
|
||||
if (cJSON_AddStringToObject(partitioning_criteriaList, "", OpenAPI_partitioning_criteria_ToString((intptr_t)node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_mode->notif_flag != OpenAPI_notification_flag_NULL) {
|
||||
if (cJSON_AddStringToObject(item, "notifFlag", OpenAPI_notification_flag_ToString(amf_event_mode->notif_flag)) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [notif_flag]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -116,6 +145,10 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
|
|||
cJSON *expiry = NULL;
|
||||
cJSON *rep_period = NULL;
|
||||
cJSON *samp_ratio = NULL;
|
||||
cJSON *partitioning_criteria = NULL;
|
||||
OpenAPI_list_t *partitioning_criteriaList = NULL;
|
||||
cJSON *notif_flag = NULL;
|
||||
OpenAPI_notification_flag_e notif_flagVariable = 0;
|
||||
trigger = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "trigger");
|
||||
if (!trigger) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [trigger]");
|
||||
|
@ -155,6 +188,34 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
|
|||
}
|
||||
}
|
||||
|
||||
partitioning_criteria = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "partitioningCriteria");
|
||||
if (partitioning_criteria) {
|
||||
cJSON *partitioning_criteria_local = NULL;
|
||||
if (!cJSON_IsArray(partitioning_criteria)) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
partitioning_criteriaList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(partitioning_criteria_local, partitioning_criteria) {
|
||||
if (!cJSON_IsString(partitioning_criteria_local)) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [partitioning_criteria]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(partitioning_criteriaList, (void *)OpenAPI_partitioning_criteria_FromString(partitioning_criteria_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
notif_flag = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "notifFlag");
|
||||
if (notif_flag) {
|
||||
if (!cJSON_IsString(notif_flag)) {
|
||||
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [notif_flag]");
|
||||
goto end;
|
||||
}
|
||||
notif_flagVariable = OpenAPI_notification_flag_FromString(notif_flag->valuestring);
|
||||
}
|
||||
|
||||
amf_event_mode_local_var = OpenAPI_amf_event_mode_create (
|
||||
trigger_local_nonprim,
|
||||
max_reports ? true : false,
|
||||
|
@ -163,7 +224,9 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
|
|||
rep_period ? true : false,
|
||||
rep_period ? rep_period->valuedouble : 0,
|
||||
samp_ratio ? true : false,
|
||||
samp_ratio ? samp_ratio->valuedouble : 0
|
||||
samp_ratio ? samp_ratio->valuedouble : 0,
|
||||
partitioning_criteria ? partitioning_criteriaList : NULL,
|
||||
notif_flag ? notif_flagVariable : 0
|
||||
);
|
||||
|
||||
return amf_event_mode_local_var;
|
||||
|
@ -172,6 +235,10 @@ end:
|
|||
OpenAPI_amf_event_trigger_free(trigger_local_nonprim);
|
||||
trigger_local_nonprim = NULL;
|
||||
}
|
||||
if (partitioning_criteriaList) {
|
||||
OpenAPI_list_free(partitioning_criteriaList);
|
||||
partitioning_criteriaList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* amf_event_mode.h
|
||||
*
|
||||
*
|
||||
* Describes how the reports shall be generated by a subscribed event
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_amf_event_mode_H_
|
||||
|
@ -13,6 +13,8 @@
|
|||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "amf_event_trigger.h"
|
||||
#include "notification_flag.h"
|
||||
#include "partitioning_criteria.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -28,6 +30,8 @@ typedef struct OpenAPI_amf_event_mode_s {
|
|||
int rep_period;
|
||||
bool is_samp_ratio;
|
||||
int samp_ratio;
|
||||
OpenAPI_list_t *partitioning_criteria;
|
||||
OpenAPI_notification_flag_e notif_flag;
|
||||
} OpenAPI_amf_event_mode_t;
|
||||
|
||||
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
|
||||
|
@ -38,7 +42,9 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
|
|||
bool is_rep_period,
|
||||
int rep_period,
|
||||
bool is_samp_ratio,
|
||||
int samp_ratio
|
||||
int samp_ratio,
|
||||
OpenAPI_list_t *partitioning_criteria,
|
||||
OpenAPI_notification_flag_e notif_flag
|
||||
);
|
||||
void OpenAPI_amf_event_mode_free(OpenAPI_amf_event_mode_t *amf_event_mode);
|
||||
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_modeJSON);
|
||||
|
|
|
@ -13,6 +13,10 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_create(
|
|||
char *subs_change_notify_correlation_id,
|
||||
char *supi,
|
||||
char *group_id,
|
||||
OpenAPI_list_t *exclude_supi_list,
|
||||
OpenAPI_list_t *exclude_gpsi_list,
|
||||
OpenAPI_list_t *include_supi_list,
|
||||
OpenAPI_list_t *include_gpsi_list,
|
||||
char *gpsi,
|
||||
char *pei,
|
||||
bool is_any_ue,
|
||||
|
@ -32,6 +36,10 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_create(
|
|||
amf_event_subscription_local_var->subs_change_notify_correlation_id = subs_change_notify_correlation_id;
|
||||
amf_event_subscription_local_var->supi = supi;
|
||||
amf_event_subscription_local_var->group_id = group_id;
|
||||
amf_event_subscription_local_var->exclude_supi_list = exclude_supi_list;
|
||||
amf_event_subscription_local_var->exclude_gpsi_list = exclude_gpsi_list;
|
||||
amf_event_subscription_local_var->include_supi_list = include_supi_list;
|
||||
amf_event_subscription_local_var->include_gpsi_list = include_gpsi_list;
|
||||
amf_event_subscription_local_var->gpsi = gpsi;
|
||||
amf_event_subscription_local_var->pei = pei;
|
||||
amf_event_subscription_local_var->is_any_ue = is_any_ue;
|
||||
|
@ -84,6 +92,34 @@ void OpenAPI_amf_event_subscription_free(OpenAPI_amf_event_subscription_t *amf_e
|
|||
ogs_free(amf_event_subscription->group_id);
|
||||
amf_event_subscription->group_id = NULL;
|
||||
}
|
||||
if (amf_event_subscription->exclude_supi_list) {
|
||||
OpenAPI_list_for_each(amf_event_subscription->exclude_supi_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_event_subscription->exclude_supi_list);
|
||||
amf_event_subscription->exclude_supi_list = NULL;
|
||||
}
|
||||
if (amf_event_subscription->exclude_gpsi_list) {
|
||||
OpenAPI_list_for_each(amf_event_subscription->exclude_gpsi_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_event_subscription->exclude_gpsi_list);
|
||||
amf_event_subscription->exclude_gpsi_list = NULL;
|
||||
}
|
||||
if (amf_event_subscription->include_supi_list) {
|
||||
OpenAPI_list_for_each(amf_event_subscription->include_supi_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_event_subscription->include_supi_list);
|
||||
amf_event_subscription->include_supi_list = NULL;
|
||||
}
|
||||
if (amf_event_subscription->include_gpsi_list) {
|
||||
OpenAPI_list_for_each(amf_event_subscription->include_gpsi_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_event_subscription->include_gpsi_list);
|
||||
amf_event_subscription->include_gpsi_list = NULL;
|
||||
}
|
||||
if (amf_event_subscription->gpsi) {
|
||||
ogs_free(amf_event_subscription->gpsi);
|
||||
amf_event_subscription->gpsi = NULL;
|
||||
|
@ -183,6 +219,62 @@ cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscripti
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription->exclude_supi_list) {
|
||||
cJSON *exclude_supi_listList = cJSON_AddArrayToObject(item, "excludeSupiList");
|
||||
if (exclude_supi_listList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [exclude_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event_subscription->exclude_supi_list, node) {
|
||||
if (cJSON_AddStringToObject(exclude_supi_listList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [exclude_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription->exclude_gpsi_list) {
|
||||
cJSON *exclude_gpsi_listList = cJSON_AddArrayToObject(item, "excludeGpsiList");
|
||||
if (exclude_gpsi_listList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [exclude_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event_subscription->exclude_gpsi_list, node) {
|
||||
if (cJSON_AddStringToObject(exclude_gpsi_listList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [exclude_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription->include_supi_list) {
|
||||
cJSON *include_supi_listList = cJSON_AddArrayToObject(item, "includeSupiList");
|
||||
if (include_supi_listList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [include_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event_subscription->include_supi_list, node) {
|
||||
if (cJSON_AddStringToObject(include_supi_listList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [include_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription->include_gpsi_list) {
|
||||
cJSON *include_gpsi_listList = cJSON_AddArrayToObject(item, "includeGpsiList");
|
||||
if (include_gpsi_listList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [include_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event_subscription->include_gpsi_list, node) {
|
||||
if (cJSON_AddStringToObject(include_gpsi_listList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [include_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription->gpsi) {
|
||||
if (cJSON_AddStringToObject(item, "gpsi", amf_event_subscription->gpsi) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [gpsi]");
|
||||
|
@ -241,6 +333,14 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c
|
|||
cJSON *subs_change_notify_correlation_id = NULL;
|
||||
cJSON *supi = NULL;
|
||||
cJSON *group_id = NULL;
|
||||
cJSON *exclude_supi_list = NULL;
|
||||
OpenAPI_list_t *exclude_supi_listList = NULL;
|
||||
cJSON *exclude_gpsi_list = NULL;
|
||||
OpenAPI_list_t *exclude_gpsi_listList = NULL;
|
||||
cJSON *include_supi_list = NULL;
|
||||
OpenAPI_list_t *include_supi_listList = NULL;
|
||||
cJSON *include_gpsi_list = NULL;
|
||||
OpenAPI_list_t *include_gpsi_listList = NULL;
|
||||
cJSON *gpsi = NULL;
|
||||
cJSON *pei = NULL;
|
||||
cJSON *any_ue = NULL;
|
||||
|
@ -337,6 +437,90 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c
|
|||
}
|
||||
}
|
||||
|
||||
exclude_supi_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "excludeSupiList");
|
||||
if (exclude_supi_list) {
|
||||
cJSON *exclude_supi_list_local = NULL;
|
||||
if (!cJSON_IsArray(exclude_supi_list)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [exclude_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
exclude_supi_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(exclude_supi_list_local, exclude_supi_list) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(exclude_supi_list_local)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [exclude_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(exclude_supi_listList, ogs_strdup(exclude_supi_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
exclude_gpsi_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "excludeGpsiList");
|
||||
if (exclude_gpsi_list) {
|
||||
cJSON *exclude_gpsi_list_local = NULL;
|
||||
if (!cJSON_IsArray(exclude_gpsi_list)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [exclude_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
exclude_gpsi_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(exclude_gpsi_list_local, exclude_gpsi_list) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(exclude_gpsi_list_local)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [exclude_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(exclude_gpsi_listList, ogs_strdup(exclude_gpsi_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
include_supi_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "includeSupiList");
|
||||
if (include_supi_list) {
|
||||
cJSON *include_supi_list_local = NULL;
|
||||
if (!cJSON_IsArray(include_supi_list)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [include_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
include_supi_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(include_supi_list_local, include_supi_list) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(include_supi_list_local)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [include_supi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(include_supi_listList, ogs_strdup(include_supi_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
include_gpsi_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "includeGpsiList");
|
||||
if (include_gpsi_list) {
|
||||
cJSON *include_gpsi_list_local = NULL;
|
||||
if (!cJSON_IsArray(include_gpsi_list)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [include_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
include_gpsi_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(include_gpsi_list_local, include_gpsi_list) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(include_gpsi_list_local)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [include_gpsi_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(include_gpsi_listList, ogs_strdup(include_gpsi_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
gpsi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "gpsi");
|
||||
if (gpsi) {
|
||||
if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) {
|
||||
|
@ -384,6 +568,10 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c
|
|||
subs_change_notify_correlation_id && !cJSON_IsNull(subs_change_notify_correlation_id) ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL,
|
||||
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL,
|
||||
group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL,
|
||||
exclude_supi_list ? exclude_supi_listList : NULL,
|
||||
exclude_gpsi_list ? exclude_gpsi_listList : NULL,
|
||||
include_supi_list ? include_supi_listList : NULL,
|
||||
include_gpsi_list ? include_gpsi_listList : NULL,
|
||||
gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL,
|
||||
pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
|
||||
any_ue ? true : false,
|
||||
|
@ -401,6 +589,34 @@ end:
|
|||
OpenAPI_list_free(event_listList);
|
||||
event_listList = NULL;
|
||||
}
|
||||
if (exclude_supi_listList) {
|
||||
OpenAPI_list_for_each(exclude_supi_listList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(exclude_supi_listList);
|
||||
exclude_supi_listList = NULL;
|
||||
}
|
||||
if (exclude_gpsi_listList) {
|
||||
OpenAPI_list_for_each(exclude_gpsi_listList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(exclude_gpsi_listList);
|
||||
exclude_gpsi_listList = NULL;
|
||||
}
|
||||
if (include_supi_listList) {
|
||||
OpenAPI_list_for_each(include_supi_listList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(include_supi_listList);
|
||||
include_supi_listList = NULL;
|
||||
}
|
||||
if (include_gpsi_listList) {
|
||||
OpenAPI_list_for_each(include_gpsi_listList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(include_gpsi_listList);
|
||||
include_gpsi_listList = NULL;
|
||||
}
|
||||
if (options_local_nonprim) {
|
||||
OpenAPI_amf_event_mode_free(options_local_nonprim);
|
||||
options_local_nonprim = NULL;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* amf_event_subscription.h
|
||||
*
|
||||
*
|
||||
* Represents an individual event subscription resource on AMF
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_amf_event_subscription_H_
|
||||
|
@ -30,6 +30,10 @@ typedef struct OpenAPI_amf_event_subscription_s {
|
|||
char *subs_change_notify_correlation_id;
|
||||
char *supi;
|
||||
char *group_id;
|
||||
OpenAPI_list_t *exclude_supi_list;
|
||||
OpenAPI_list_t *exclude_gpsi_list;
|
||||
OpenAPI_list_t *include_supi_list;
|
||||
OpenAPI_list_t *include_gpsi_list;
|
||||
char *gpsi;
|
||||
char *pei;
|
||||
bool is_any_ue;
|
||||
|
@ -47,6 +51,10 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_create(
|
|||
char *subs_change_notify_correlation_id,
|
||||
char *supi,
|
||||
char *group_id,
|
||||
OpenAPI_list_t *exclude_supi_list,
|
||||
OpenAPI_list_t *exclude_gpsi_list,
|
||||
OpenAPI_list_t *include_supi_list,
|
||||
OpenAPI_list_t *include_gpsi_list,
|
||||
char *gpsi,
|
||||
char *pei,
|
||||
bool is_any_ue,
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_info_create(
|
||||
OpenAPI_list_t *binding_info,
|
||||
OpenAPI_nf_type_e subscribing_nf_type
|
||||
OpenAPI_nf_type_e subscribing_nf_type,
|
||||
bool is_event_sync_ind,
|
||||
int event_sync_ind,
|
||||
OpenAPI_list_t *nf_consumer_info,
|
||||
OpenAPI_list_t* aoi_state_list
|
||||
)
|
||||
{
|
||||
OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info_local_var = ogs_malloc(sizeof(OpenAPI_amf_event_subscription_add_info_t));
|
||||
|
@ -14,6 +18,10 @@ OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_in
|
|||
|
||||
amf_event_subscription_add_info_local_var->binding_info = binding_info;
|
||||
amf_event_subscription_add_info_local_var->subscribing_nf_type = subscribing_nf_type;
|
||||
amf_event_subscription_add_info_local_var->is_event_sync_ind = is_event_sync_ind;
|
||||
amf_event_subscription_add_info_local_var->event_sync_ind = event_sync_ind;
|
||||
amf_event_subscription_add_info_local_var->nf_consumer_info = nf_consumer_info;
|
||||
amf_event_subscription_add_info_local_var->aoi_state_list = aoi_state_list;
|
||||
|
||||
return amf_event_subscription_add_info_local_var;
|
||||
}
|
||||
|
@ -32,6 +40,23 @@ void OpenAPI_amf_event_subscription_add_info_free(OpenAPI_amf_event_subscription
|
|||
OpenAPI_list_free(amf_event_subscription_add_info->binding_info);
|
||||
amf_event_subscription_add_info->binding_info = NULL;
|
||||
}
|
||||
if (amf_event_subscription_add_info->nf_consumer_info) {
|
||||
OpenAPI_list_for_each(amf_event_subscription_add_info->nf_consumer_info, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_event_subscription_add_info->nf_consumer_info);
|
||||
amf_event_subscription_add_info->nf_consumer_info = NULL;
|
||||
}
|
||||
if (amf_event_subscription_add_info->aoi_state_list) {
|
||||
OpenAPI_list_for_each(amf_event_subscription_add_info->aoi_state_list, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_area_of_interest_event_state_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(amf_event_subscription_add_info->aoi_state_list);
|
||||
amf_event_subscription_add_info->aoi_state_list = NULL;
|
||||
}
|
||||
ogs_free(amf_event_subscription_add_info);
|
||||
}
|
||||
|
||||
|
@ -67,6 +92,49 @@ cJSON *OpenAPI_amf_event_subscription_add_info_convertToJSON(OpenAPI_amf_event_s
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription_add_info->is_event_sync_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "eventSyncInd", amf_event_subscription_add_info->event_sync_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [event_sync_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription_add_info->nf_consumer_info) {
|
||||
cJSON *nf_consumer_infoList = cJSON_AddArrayToObject(item, "nfConsumerInfo");
|
||||
if (nf_consumer_infoList == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [nf_consumer_info]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_event_subscription_add_info->nf_consumer_info, node) {
|
||||
if (cJSON_AddStringToObject(nf_consumer_infoList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [nf_consumer_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_event_subscription_add_info->aoi_state_list) {
|
||||
cJSON *aoi_state_list = cJSON_AddObjectToObject(item, "aoiStateList");
|
||||
if (aoi_state_list == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [aoi_state_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = aoi_state_list;
|
||||
if (amf_event_subscription_add_info->aoi_state_list) {
|
||||
OpenAPI_list_for_each(amf_event_subscription_add_info->aoi_state_list, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
cJSON *itemLocal = localKeyValue->value ?
|
||||
OpenAPI_area_of_interest_event_state_convertToJSON(localKeyValue->value) :
|
||||
cJSON_CreateNull();
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -79,6 +147,11 @@ OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_in
|
|||
OpenAPI_list_t *binding_infoList = NULL;
|
||||
cJSON *subscribing_nf_type = NULL;
|
||||
OpenAPI_nf_type_e subscribing_nf_typeVariable = 0;
|
||||
cJSON *event_sync_ind = NULL;
|
||||
cJSON *nf_consumer_info = NULL;
|
||||
OpenAPI_list_t *nf_consumer_infoList = NULL;
|
||||
cJSON *aoi_state_list = NULL;
|
||||
OpenAPI_list_t *aoi_state_listList = NULL;
|
||||
binding_info = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "bindingInfo");
|
||||
if (binding_info) {
|
||||
cJSON *binding_info_local = NULL;
|
||||
|
@ -109,9 +182,68 @@ OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_in
|
|||
subscribing_nf_typeVariable = OpenAPI_nf_type_FromString(subscribing_nf_type->valuestring);
|
||||
}
|
||||
|
||||
event_sync_ind = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "eventSyncInd");
|
||||
if (event_sync_ind) {
|
||||
if (!cJSON_IsBool(event_sync_ind)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [event_sync_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
nf_consumer_info = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "nfConsumerInfo");
|
||||
if (nf_consumer_info) {
|
||||
cJSON *nf_consumer_info_local = NULL;
|
||||
if (!cJSON_IsArray(nf_consumer_info)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [nf_consumer_info]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
nf_consumer_infoList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(nf_consumer_info_local, nf_consumer_info) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(nf_consumer_info_local)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [nf_consumer_info]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(nf_consumer_infoList, ogs_strdup(nf_consumer_info_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
aoi_state_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "aoiStateList");
|
||||
if (aoi_state_list) {
|
||||
cJSON *aoi_state_list_local_map = NULL;
|
||||
if (!cJSON_IsObject(aoi_state_list) && !cJSON_IsNull(aoi_state_list)) {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [aoi_state_list]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_IsObject(aoi_state_list)) {
|
||||
aoi_state_listList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(aoi_state_list_local_map, aoi_state_list) {
|
||||
cJSON *localMapObject = aoi_state_list_local_map;
|
||||
if (cJSON_IsObject(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
ogs_strdup(localMapObject->string), OpenAPI_area_of_interest_event_state_parseFromJSON(localMapObject));
|
||||
} else if (cJSON_IsNull(localMapObject)) {
|
||||
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
|
||||
} else {
|
||||
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [inner]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(aoi_state_listList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
amf_event_subscription_add_info_local_var = OpenAPI_amf_event_subscription_add_info_create (
|
||||
binding_info ? binding_infoList : NULL,
|
||||
subscribing_nf_type ? subscribing_nf_typeVariable : 0
|
||||
subscribing_nf_type ? subscribing_nf_typeVariable : 0,
|
||||
event_sync_ind ? true : false,
|
||||
event_sync_ind ? event_sync_ind->valueint : 0,
|
||||
nf_consumer_info ? nf_consumer_infoList : NULL,
|
||||
aoi_state_list ? aoi_state_listList : NULL
|
||||
);
|
||||
|
||||
return amf_event_subscription_add_info_local_var;
|
||||
|
@ -123,6 +255,23 @@ end:
|
|||
OpenAPI_list_free(binding_infoList);
|
||||
binding_infoList = NULL;
|
||||
}
|
||||
if (nf_consumer_infoList) {
|
||||
OpenAPI_list_for_each(nf_consumer_infoList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(nf_consumer_infoList);
|
||||
nf_consumer_infoList = NULL;
|
||||
}
|
||||
if (aoi_state_listList) {
|
||||
OpenAPI_list_for_each(aoi_state_listList, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
|
||||
ogs_free(localKeyValue->key);
|
||||
OpenAPI_area_of_interest_event_state_free(localKeyValue->value);
|
||||
OpenAPI_map_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(aoi_state_listList);
|
||||
aoi_state_listList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* amf_event_subscription_add_info.h
|
||||
*
|
||||
*
|
||||
* Additional information received for an AMF event subscription, e.g. binding indications
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_amf_event_subscription_add_info_H_
|
||||
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "area_of_interest_event_state.h"
|
||||
#include "nf_type.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -22,11 +23,19 @@ typedef struct OpenAPI_amf_event_subscription_add_info_s OpenAPI_amf_event_subsc
|
|||
typedef struct OpenAPI_amf_event_subscription_add_info_s {
|
||||
OpenAPI_list_t *binding_info;
|
||||
OpenAPI_nf_type_e subscribing_nf_type;
|
||||
bool is_event_sync_ind;
|
||||
int event_sync_ind;
|
||||
OpenAPI_list_t *nf_consumer_info;
|
||||
OpenAPI_list_t* aoi_state_list;
|
||||
} OpenAPI_amf_event_subscription_add_info_t;
|
||||
|
||||
OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_info_create(
|
||||
OpenAPI_list_t *binding_info,
|
||||
OpenAPI_nf_type_e subscribing_nf_type
|
||||
OpenAPI_nf_type_e subscribing_nf_type,
|
||||
bool is_event_sync_ind,
|
||||
int event_sync_ind,
|
||||
OpenAPI_list_t *nf_consumer_info,
|
||||
OpenAPI_list_t* aoi_state_list
|
||||
);
|
||||
void OpenAPI_amf_event_subscription_add_info_free(OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info);
|
||||
OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_info_parseFromJSON(cJSON *amf_event_subscription_add_infoJSON);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* amf_event_trigger.h
|
||||
*
|
||||
*
|
||||
* Describes how AMF should generate the report for the event
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_amf_event_trigger_H_
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* amf_event_type.h
|
||||
*
|
||||
*
|
||||
* Describes the supported event types of Namf_EventExposure Service
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_amf_event_type_H_
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
char* OpenAPI_amf_event_type_any_of_ToString(OpenAPI_amf_event_type_any_of_e amf_event_type_any_of)
|
||||
{
|
||||
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" };
|
||||
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT", "SNSSAI_TA_MAPPING_REPORT", "UE_LOCATION_TRENDS", "UE_ACCESS_BEHAVIOR_TRENDS", "UE_MM_TRANSACTION_REPORT" };
|
||||
size_t sizeofArray = sizeof(amf_event_type_any_ofArray) / sizeof(amf_event_type_any_ofArray[0]);
|
||||
if (amf_event_type_any_of < sizeofArray)
|
||||
return (char *)amf_event_type_any_ofArray[amf_event_type_any_of];
|
||||
|
@ -17,7 +17,7 @@ char* OpenAPI_amf_event_type_any_of_ToString(OpenAPI_amf_event_type_any_of_e amf
|
|||
OpenAPI_amf_event_type_any_of_e OpenAPI_amf_event_type_any_of_FromString(char* amf_event_type_any_of)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" };
|
||||
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT", "SNSSAI_TA_MAPPING_REPORT", "UE_LOCATION_TRENDS", "UE_ACCESS_BEHAVIOR_TRENDS", "UE_MM_TRANSACTION_REPORT" };
|
||||
size_t sizeofArray = sizeof(amf_event_type_any_ofArray) / sizeof(amf_event_type_any_ofArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(amf_event_type_any_of, amf_event_type_any_ofArray[stringToReturn]) == 0) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum { OpenAPI_amf_event_type_any_of_NULL = 0, OpenAPI_amf_event_type_any_of_LOCATION_REPORT, OpenAPI_amf_event_type_any_of_PRESENCE_IN_AOI_REPORT, OpenAPI_amf_event_type_any_of_TIMEZONE_REPORT, OpenAPI_amf_event_type_any_of_ACCESS_TYPE_REPORT, OpenAPI_amf_event_type_any_of_REGISTRATION_STATE_REPORT, OpenAPI_amf_event_type_any_of_CONNECTIVITY_STATE_REPORT, OpenAPI_amf_event_type_any_of_REACHABILITY_REPORT, OpenAPI_amf_event_type_any_of_COMMUNICATION_FAILURE_REPORT, OpenAPI_amf_event_type_any_of_UES_IN_AREA_REPORT, OpenAPI_amf_event_type_any_of_SUBSCRIPTION_ID_CHANGE, OpenAPI_amf_event_type_any_of_SUBSCRIPTION_ID_ADDITION, OpenAPI_amf_event_type_any_of_LOSS_OF_CONNECTIVITY, OpenAPI_amf_event_type_any_of__5GS_USER_STATE_REPORT, OpenAPI_amf_event_type_any_of_AVAILABILITY_AFTER_DDN_FAILURE, OpenAPI_amf_event_type_any_of_TYPE_ALLOCATION_CODE_REPORT, OpenAPI_amf_event_type_any_of_FREQUENT_MOBILITY_REGISTRATION_REPORT } OpenAPI_amf_event_type_any_of_e;
|
||||
typedef enum { OpenAPI_amf_event_type_any_of_NULL = 0, OpenAPI_amf_event_type_any_of_LOCATION_REPORT, OpenAPI_amf_event_type_any_of_PRESENCE_IN_AOI_REPORT, OpenAPI_amf_event_type_any_of_TIMEZONE_REPORT, OpenAPI_amf_event_type_any_of_ACCESS_TYPE_REPORT, OpenAPI_amf_event_type_any_of_REGISTRATION_STATE_REPORT, OpenAPI_amf_event_type_any_of_CONNECTIVITY_STATE_REPORT, OpenAPI_amf_event_type_any_of_REACHABILITY_REPORT, OpenAPI_amf_event_type_any_of_COMMUNICATION_FAILURE_REPORT, OpenAPI_amf_event_type_any_of_UES_IN_AREA_REPORT, OpenAPI_amf_event_type_any_of_SUBSCRIPTION_ID_CHANGE, OpenAPI_amf_event_type_any_of_SUBSCRIPTION_ID_ADDITION, OpenAPI_amf_event_type_any_of_LOSS_OF_CONNECTIVITY, OpenAPI_amf_event_type_any_of__5GS_USER_STATE_REPORT, OpenAPI_amf_event_type_any_of_AVAILABILITY_AFTER_DDN_FAILURE, OpenAPI_amf_event_type_any_of_TYPE_ALLOCATION_CODE_REPORT, OpenAPI_amf_event_type_any_of_FREQUENT_MOBILITY_REGISTRATION_REPORT, OpenAPI_amf_event_type_any_of_SNSSAI_TA_MAPPING_REPORT, OpenAPI_amf_event_type_any_of_UE_LOCATION_TRENDS, OpenAPI_amf_event_type_any_of_UE_ACCESS_BEHAVIOR_TRENDS, OpenAPI_amf_event_type_any_of_UE_MM_TRANSACTION_REPORT } OpenAPI_amf_event_type_any_of_e;
|
||||
|
||||
char* OpenAPI_amf_event_type_any_of_ToString(OpenAPI_amf_event_type_any_of_e amf_event_type_any_of);
|
||||
|
||||
|
|
|
@ -12,7 +12,9 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_create(
|
|||
OpenAPI_list_t *tai_range_list,
|
||||
OpenAPI_list_t *backup_info_amf_failure,
|
||||
OpenAPI_list_t *backup_info_amf_removal,
|
||||
OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info
|
||||
OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info,
|
||||
bool is_amf_onboarding_capability,
|
||||
int amf_onboarding_capability
|
||||
)
|
||||
{
|
||||
OpenAPI_amf_info_t *amf_info_local_var = ogs_malloc(sizeof(OpenAPI_amf_info_t));
|
||||
|
@ -26,6 +28,8 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_create(
|
|||
amf_info_local_var->backup_info_amf_failure = backup_info_amf_failure;
|
||||
amf_info_local_var->backup_info_amf_removal = backup_info_amf_removal;
|
||||
amf_info_local_var->n2_interface_amf_info = n2_interface_amf_info;
|
||||
amf_info_local_var->is_amf_onboarding_capability = is_amf_onboarding_capability;
|
||||
amf_info_local_var->amf_onboarding_capability = amf_onboarding_capability;
|
||||
|
||||
return amf_info_local_var;
|
||||
}
|
||||
|
@ -211,6 +215,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info)
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_info->is_amf_onboarding_capability) {
|
||||
if (cJSON_AddBoolToObject(item, "amfOnboardingCapability", amf_info->amf_onboarding_capability) == NULL) {
|
||||
ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_onboarding_capability]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -233,6 +244,7 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON)
|
|||
OpenAPI_list_t *backup_info_amf_removalList = NULL;
|
||||
cJSON *n2_interface_amf_info = NULL;
|
||||
OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info_local_nonprim = NULL;
|
||||
cJSON *amf_onboarding_capability = NULL;
|
||||
amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfSetId");
|
||||
if (!amf_set_id) {
|
||||
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_set_id]");
|
||||
|
@ -385,6 +397,14 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON)
|
|||
n2_interface_amf_info_local_nonprim = OpenAPI_n2_interface_amf_info_parseFromJSON(n2_interface_amf_info);
|
||||
}
|
||||
|
||||
amf_onboarding_capability = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfOnboardingCapability");
|
||||
if (amf_onboarding_capability) {
|
||||
if (!cJSON_IsBool(amf_onboarding_capability)) {
|
||||
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_onboarding_capability]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
amf_info_local_var = OpenAPI_amf_info_create (
|
||||
ogs_strdup(amf_set_id->valuestring),
|
||||
ogs_strdup(amf_region_id->valuestring),
|
||||
|
@ -393,7 +413,9 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON)
|
|||
tai_range_list ? tai_range_listList : NULL,
|
||||
backup_info_amf_failure ? backup_info_amf_failureList : NULL,
|
||||
backup_info_amf_removal ? backup_info_amf_removalList : NULL,
|
||||
n2_interface_amf_info ? n2_interface_amf_info_local_nonprim : NULL
|
||||
n2_interface_amf_info ? n2_interface_amf_info_local_nonprim : NULL,
|
||||
amf_onboarding_capability ? true : false,
|
||||
amf_onboarding_capability ? amf_onboarding_capability->valueint : 0
|
||||
);
|
||||
|
||||
return amf_info_local_var;
|
||||
|
|
|
@ -31,6 +31,8 @@ typedef struct OpenAPI_amf_info_s {
|
|||
OpenAPI_list_t *backup_info_amf_failure;
|
||||
OpenAPI_list_t *backup_info_amf_removal;
|
||||
struct OpenAPI_n2_interface_amf_info_s *n2_interface_amf_info;
|
||||
bool is_amf_onboarding_capability;
|
||||
int amf_onboarding_capability;
|
||||
} OpenAPI_amf_info_t;
|
||||
|
||||
OpenAPI_amf_info_t *OpenAPI_amf_info_create(
|
||||
|
@ -41,7 +43,9 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_create(
|
|||
OpenAPI_list_t *tai_range_list,
|
||||
OpenAPI_list_t *backup_info_amf_failure,
|
||||
OpenAPI_list_t *backup_info_amf_removal,
|
||||
OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info
|
||||
OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info,
|
||||
bool is_amf_onboarding_capability,
|
||||
int amf_onboarding_capability
|
||||
);
|
||||
void OpenAPI_amf_info_free(OpenAPI_amf_info_t *amf_info);
|
||||
OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON);
|
||||
|
|
|
@ -26,7 +26,20 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
OpenAPI_context_info_t *context_info,
|
||||
bool is_no_ee_subscription_ind,
|
||||
int no_ee_subscription_ind,
|
||||
char *supi
|
||||
char *supi,
|
||||
bool is_re_registration_required,
|
||||
int re_registration_required,
|
||||
bool is_admin_dereg_sub_withdrawn,
|
||||
int admin_dereg_sub_withdrawn,
|
||||
char *data_restoration_callback_uri,
|
||||
OpenAPI_list_t *reset_ids,
|
||||
bool is_disaster_roaming_ind,
|
||||
int disaster_roaming_ind,
|
||||
bool is_sor_snpn_si_supported,
|
||||
int sor_snpn_si_supported,
|
||||
bool is_udr_restart_ind,
|
||||
int udr_restart_ind,
|
||||
char *last_synchronization_time
|
||||
)
|
||||
{
|
||||
OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration_local_var = ogs_malloc(sizeof(OpenAPI_amf_non3_gpp_access_registration_t));
|
||||
|
@ -54,6 +67,19 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
amf_non3_gpp_access_registration_local_var->is_no_ee_subscription_ind = is_no_ee_subscription_ind;
|
||||
amf_non3_gpp_access_registration_local_var->no_ee_subscription_ind = no_ee_subscription_ind;
|
||||
amf_non3_gpp_access_registration_local_var->supi = supi;
|
||||
amf_non3_gpp_access_registration_local_var->is_re_registration_required = is_re_registration_required;
|
||||
amf_non3_gpp_access_registration_local_var->re_registration_required = re_registration_required;
|
||||
amf_non3_gpp_access_registration_local_var->is_admin_dereg_sub_withdrawn = is_admin_dereg_sub_withdrawn;
|
||||
amf_non3_gpp_access_registration_local_var->admin_dereg_sub_withdrawn = admin_dereg_sub_withdrawn;
|
||||
amf_non3_gpp_access_registration_local_var->data_restoration_callback_uri = data_restoration_callback_uri;
|
||||
amf_non3_gpp_access_registration_local_var->reset_ids = reset_ids;
|
||||
amf_non3_gpp_access_registration_local_var->is_disaster_roaming_ind = is_disaster_roaming_ind;
|
||||
amf_non3_gpp_access_registration_local_var->disaster_roaming_ind = disaster_roaming_ind;
|
||||
amf_non3_gpp_access_registration_local_var->is_sor_snpn_si_supported = is_sor_snpn_si_supported;
|
||||
amf_non3_gpp_access_registration_local_var->sor_snpn_si_supported = sor_snpn_si_supported;
|
||||
amf_non3_gpp_access_registration_local_var->is_udr_restart_ind = is_udr_restart_ind;
|
||||
amf_non3_gpp_access_registration_local_var->udr_restart_ind = udr_restart_ind;
|
||||
amf_non3_gpp_access_registration_local_var->last_synchronization_time = last_synchronization_time;
|
||||
|
||||
return amf_non3_gpp_access_registration_local_var;
|
||||
}
|
||||
|
@ -124,6 +150,21 @@ void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_r
|
|||
ogs_free(amf_non3_gpp_access_registration->supi);
|
||||
amf_non3_gpp_access_registration->supi = NULL;
|
||||
}
|
||||
if (amf_non3_gpp_access_registration->data_restoration_callback_uri) {
|
||||
ogs_free(amf_non3_gpp_access_registration->data_restoration_callback_uri);
|
||||
amf_non3_gpp_access_registration->data_restoration_callback_uri = NULL;
|
||||
}
|
||||
if (amf_non3_gpp_access_registration->reset_ids) {
|
||||
OpenAPI_list_for_each(amf_non3_gpp_access_registration->reset_ids, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_non3_gpp_access_registration->reset_ids);
|
||||
amf_non3_gpp_access_registration->reset_ids = NULL;
|
||||
}
|
||||
if (amf_non3_gpp_access_registration->last_synchronization_time) {
|
||||
ogs_free(amf_non3_gpp_access_registration->last_synchronization_time);
|
||||
amf_non3_gpp_access_registration->last_synchronization_time = NULL;
|
||||
}
|
||||
ogs_free(amf_non3_gpp_access_registration);
|
||||
}
|
||||
|
||||
|
@ -308,6 +349,69 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->is_re_registration_required) {
|
||||
if (cJSON_AddBoolToObject(item, "reRegistrationRequired", amf_non3_gpp_access_registration->re_registration_required) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [re_registration_required]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->is_admin_dereg_sub_withdrawn) {
|
||||
if (cJSON_AddBoolToObject(item, "adminDeregSubWithdrawn", amf_non3_gpp_access_registration->admin_dereg_sub_withdrawn) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [admin_dereg_sub_withdrawn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->data_restoration_callback_uri) {
|
||||
if (cJSON_AddStringToObject(item, "dataRestorationCallbackUri", amf_non3_gpp_access_registration->data_restoration_callback_uri) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [data_restoration_callback_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->reset_ids) {
|
||||
cJSON *reset_idsList = cJSON_AddArrayToObject(item, "resetIds");
|
||||
if (reset_idsList == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(amf_non3_gpp_access_registration->reset_ids, node) {
|
||||
if (cJSON_AddStringToObject(reset_idsList, "", (char*)node->data) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->is_disaster_roaming_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "disasterRoamingInd", amf_non3_gpp_access_registration->disaster_roaming_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [disaster_roaming_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->is_sor_snpn_si_supported) {
|
||||
if (cJSON_AddBoolToObject(item, "sorSnpnSiSupported", amf_non3_gpp_access_registration->sor_snpn_si_supported) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [sor_snpn_si_supported]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->is_udr_restart_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "udrRestartInd", amf_non3_gpp_access_registration->udr_restart_ind) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [udr_restart_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->last_synchronization_time) {
|
||||
if (cJSON_AddStringToObject(item, "lastSynchronizationTime", amf_non3_gpp_access_registration->last_synchronization_time) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [last_synchronization_time]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
@ -341,6 +445,15 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
|
||||
cJSON *no_ee_subscription_ind = NULL;
|
||||
cJSON *supi = NULL;
|
||||
cJSON *re_registration_required = NULL;
|
||||
cJSON *admin_dereg_sub_withdrawn = NULL;
|
||||
cJSON *data_restoration_callback_uri = NULL;
|
||||
cJSON *reset_ids = NULL;
|
||||
OpenAPI_list_t *reset_idsList = NULL;
|
||||
cJSON *disaster_roaming_ind = NULL;
|
||||
cJSON *sor_snpn_si_supported = NULL;
|
||||
cJSON *udr_restart_ind = NULL;
|
||||
cJSON *last_synchronization_time = NULL;
|
||||
amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfInstanceId");
|
||||
if (!amf_instance_id) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]");
|
||||
|
@ -513,6 +626,83 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
}
|
||||
}
|
||||
|
||||
re_registration_required = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "reRegistrationRequired");
|
||||
if (re_registration_required) {
|
||||
if (!cJSON_IsBool(re_registration_required)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [re_registration_required]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
admin_dereg_sub_withdrawn = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "adminDeregSubWithdrawn");
|
||||
if (admin_dereg_sub_withdrawn) {
|
||||
if (!cJSON_IsBool(admin_dereg_sub_withdrawn)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [admin_dereg_sub_withdrawn]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
data_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "dataRestorationCallbackUri");
|
||||
if (data_restoration_callback_uri) {
|
||||
if (!cJSON_IsString(data_restoration_callback_uri) && !cJSON_IsNull(data_restoration_callback_uri)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [data_restoration_callback_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
reset_ids = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "resetIds");
|
||||
if (reset_ids) {
|
||||
cJSON *reset_ids_local = NULL;
|
||||
if (!cJSON_IsArray(reset_ids)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
reset_idsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(reset_ids_local, reset_ids) {
|
||||
double *localDouble = NULL;
|
||||
int *localInt = NULL;
|
||||
if (!cJSON_IsString(reset_ids_local)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [reset_ids]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(reset_idsList, ogs_strdup(reset_ids_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
disaster_roaming_ind = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "disasterRoamingInd");
|
||||
if (disaster_roaming_ind) {
|
||||
if (!cJSON_IsBool(disaster_roaming_ind)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [disaster_roaming_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
sor_snpn_si_supported = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "sorSnpnSiSupported");
|
||||
if (sor_snpn_si_supported) {
|
||||
if (!cJSON_IsBool(sor_snpn_si_supported)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [sor_snpn_si_supported]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
udr_restart_ind = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "udrRestartInd");
|
||||
if (udr_restart_ind) {
|
||||
if (!cJSON_IsBool(udr_restart_ind)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [udr_restart_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
last_synchronization_time = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "lastSynchronizationTime");
|
||||
if (last_synchronization_time) {
|
||||
if (!cJSON_IsString(last_synchronization_time) && !cJSON_IsNull(last_synchronization_time)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [last_synchronization_time]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
amf_non3_gpp_access_registration_local_var = OpenAPI_amf_non3_gpp_access_registration_create (
|
||||
ogs_strdup(amf_instance_id->valuestring),
|
||||
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
|
@ -535,7 +725,20 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
context_info ? context_info_local_nonprim : NULL,
|
||||
no_ee_subscription_ind ? true : false,
|
||||
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0,
|
||||
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL
|
||||
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL,
|
||||
re_registration_required ? true : false,
|
||||
re_registration_required ? re_registration_required->valueint : 0,
|
||||
admin_dereg_sub_withdrawn ? true : false,
|
||||
admin_dereg_sub_withdrawn ? admin_dereg_sub_withdrawn->valueint : 0,
|
||||
data_restoration_callback_uri && !cJSON_IsNull(data_restoration_callback_uri) ? ogs_strdup(data_restoration_callback_uri->valuestring) : NULL,
|
||||
reset_ids ? reset_idsList : NULL,
|
||||
disaster_roaming_ind ? true : false,
|
||||
disaster_roaming_ind ? disaster_roaming_ind->valueint : 0,
|
||||
sor_snpn_si_supported ? true : false,
|
||||
sor_snpn_si_supported ? sor_snpn_si_supported->valueint : 0,
|
||||
udr_restart_ind ? true : false,
|
||||
udr_restart_ind ? udr_restart_ind->valueint : 0,
|
||||
last_synchronization_time && !cJSON_IsNull(last_synchronization_time) ? ogs_strdup(last_synchronization_time->valuestring) : NULL
|
||||
);
|
||||
|
||||
return amf_non3_gpp_access_registration_local_var;
|
||||
|
@ -559,6 +762,13 @@ end:
|
|||
OpenAPI_context_info_free(context_info_local_nonprim);
|
||||
context_info_local_nonprim = NULL;
|
||||
}
|
||||
if (reset_idsList) {
|
||||
OpenAPI_list_for_each(reset_idsList, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(reset_idsList);
|
||||
reset_idsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,19 @@ typedef struct OpenAPI_amf_non3_gpp_access_registration_s {
|
|||
bool is_no_ee_subscription_ind;
|
||||
int no_ee_subscription_ind;
|
||||
char *supi;
|
||||
bool is_re_registration_required;
|
||||
int re_registration_required;
|
||||
bool is_admin_dereg_sub_withdrawn;
|
||||
int admin_dereg_sub_withdrawn;
|
||||
char *data_restoration_callback_uri;
|
||||
OpenAPI_list_t *reset_ids;
|
||||
bool is_disaster_roaming_ind;
|
||||
int disaster_roaming_ind;
|
||||
bool is_sor_snpn_si_supported;
|
||||
int sor_snpn_si_supported;
|
||||
bool is_udr_restart_ind;
|
||||
int udr_restart_ind;
|
||||
char *last_synchronization_time;
|
||||
} OpenAPI_amf_non3_gpp_access_registration_t;
|
||||
|
||||
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_create(
|
||||
|
@ -71,7 +84,20 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
OpenAPI_context_info_t *context_info,
|
||||
bool is_no_ee_subscription_ind,
|
||||
int no_ee_subscription_ind,
|
||||
char *supi
|
||||
char *supi,
|
||||
bool is_re_registration_required,
|
||||
int re_registration_required,
|
||||
bool is_admin_dereg_sub_withdrawn,
|
||||
int admin_dereg_sub_withdrawn,
|
||||
char *data_restoration_callback_uri,
|
||||
OpenAPI_list_t *reset_ids,
|
||||
bool is_disaster_roaming_ind,
|
||||
int disaster_roaming_ind,
|
||||
bool is_sor_snpn_si_supported,
|
||||
int sor_snpn_si_supported,
|
||||
bool is_udr_restart_ind,
|
||||
int udr_restart_ind,
|
||||
char *last_synchronization_time
|
||||
);
|
||||
void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration);
|
||||
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(cJSON *amf_non3_gpp_access_registrationJSON);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue