[5GC] Added BSF(Binding Support Function)

This commit is contained in:
Sukchan Lee 2021-05-29 15:56:12 +09:00
parent 611986794b
commit fe89f7cd11
293 changed files with 24988 additions and 1507 deletions

View file

@ -5,7 +5,7 @@
#include "qos_monitoring_report.h"
OpenAPI_qos_monitoring_report_t *OpenAPI_qos_monitoring_report_create(
OpenAPI_list_t *ref_pcc_rule_ids,
OpenAPI_list_t *flows,
OpenAPI_list_t *ul_delays,
OpenAPI_list_t *dl_delays,
OpenAPI_list_t *rt_delays
@ -15,7 +15,7 @@ OpenAPI_qos_monitoring_report_t *OpenAPI_qos_monitoring_report_create(
if (!qos_monitoring_report_local_var) {
return NULL;
}
qos_monitoring_report_local_var->ref_pcc_rule_ids = ref_pcc_rule_ids;
qos_monitoring_report_local_var->flows = flows;
qos_monitoring_report_local_var->ul_delays = ul_delays;
qos_monitoring_report_local_var->dl_delays = dl_delays;
qos_monitoring_report_local_var->rt_delays = rt_delays;
@ -29,10 +29,10 @@ void OpenAPI_qos_monitoring_report_free(OpenAPI_qos_monitoring_report_t *qos_mon
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(qos_monitoring_report->ref_pcc_rule_ids, node) {
ogs_free(node->data);
OpenAPI_list_for_each(qos_monitoring_report->flows, node) {
OpenAPI_flows_free(node->data);
}
OpenAPI_list_free(qos_monitoring_report->ref_pcc_rule_ids);
OpenAPI_list_free(qos_monitoring_report->flows);
OpenAPI_list_for_each(qos_monitoring_report->ul_delays, node) {
ogs_free(node->data);
}
@ -58,18 +58,24 @@ cJSON *OpenAPI_qos_monitoring_report_convertToJSON(OpenAPI_qos_monitoring_report
}
item = cJSON_CreateObject();
cJSON *ref_pcc_rule_ids = cJSON_AddArrayToObject(item, "refPccRuleIds");
if (ref_pcc_rule_ids == NULL) {
ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [ref_pcc_rule_ids]");
goto end;
}
OpenAPI_lnode_t *ref_pcc_rule_ids_node;
OpenAPI_list_for_each(qos_monitoring_report->ref_pcc_rule_ids, ref_pcc_rule_ids_node) {
if (cJSON_AddStringToObject(ref_pcc_rule_ids, "", (char*)ref_pcc_rule_ids_node->data) == NULL) {
ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [ref_pcc_rule_ids]");
if (qos_monitoring_report->flows) {
cJSON *flowsList = cJSON_AddArrayToObject(item, "flows");
if (flowsList == NULL) {
ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [flows]");
goto end;
}
OpenAPI_lnode_t *flows_node;
if (qos_monitoring_report->flows) {
OpenAPI_list_for_each(qos_monitoring_report->flows, flows_node) {
cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_qos_monitoring_report_convertToJSON() failed [flows]");
goto end;
}
cJSON_AddItemToArray(flowsList, itemLocal);
}
}
}
if (qos_monitoring_report->ul_delays) {
@ -127,27 +133,27 @@ end:
OpenAPI_qos_monitoring_report_t *OpenAPI_qos_monitoring_report_parseFromJSON(cJSON *qos_monitoring_reportJSON)
{
OpenAPI_qos_monitoring_report_t *qos_monitoring_report_local_var = NULL;
cJSON *ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "refPccRuleIds");
if (!ref_pcc_rule_ids) {
ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ref_pcc_rule_ids]");
goto end;
}
cJSON *flows = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "flows");
OpenAPI_list_t *ref_pcc_rule_idsList;
cJSON *ref_pcc_rule_ids_local;
if (!cJSON_IsArray(ref_pcc_rule_ids)) {
ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ref_pcc_rule_ids]");
goto end;
}
ref_pcc_rule_idsList = OpenAPI_list_create();
cJSON_ArrayForEach(ref_pcc_rule_ids_local, ref_pcc_rule_ids) {
if (!cJSON_IsString(ref_pcc_rule_ids_local)) {
ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [ref_pcc_rule_ids]");
OpenAPI_list_t *flowsList;
if (flows) {
cJSON *flows_local_nonprimitive;
if (!cJSON_IsArray(flows)) {
ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_list_add(ref_pcc_rule_idsList, ogs_strdup(ref_pcc_rule_ids_local->valuestring));
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local_nonprimitive, flows ) {
if (!cJSON_IsObject(flows_local_nonprimitive)) {
ogs_error("OpenAPI_qos_monitoring_report_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
OpenAPI_list_add(flowsList, flowsItem);
}
}
cJSON *ul_delays = cJSON_GetObjectItemCaseSensitive(qos_monitoring_reportJSON, "ulDelays");
@ -211,7 +217,7 @@ OpenAPI_qos_monitoring_report_t *OpenAPI_qos_monitoring_report_parseFromJSON(cJS
}
qos_monitoring_report_local_var = OpenAPI_qos_monitoring_report_create (
ref_pcc_rule_idsList,
flows ? flowsList : NULL,
ul_delays ? ul_delaysList : NULL,
dl_delays ? dl_delaysList : NULL,
rt_delays ? rt_delaysList : NULL