mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
Add only one 5GC scenario (call-flow)
This commit is contained in:
parent
20008b6a13
commit
dbee687a75
1415 changed files with 86635 additions and 5877 deletions
114
lib/sbi/openapi/model/pdu_session_notify_item.c
Normal file
114
lib/sbi/openapi/model/pdu_session_notify_item.c
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "pdu_session_notify_item.h"
|
||||
|
||||
OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_create(
|
||||
OpenAPI_notification_cause_t *notification_cause
|
||||
)
|
||||
{
|
||||
OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_notify_item_t));
|
||||
if (!pdu_session_notify_item_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
pdu_session_notify_item_local_var->notification_cause = notification_cause;
|
||||
|
||||
return pdu_session_notify_item_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_pdu_session_notify_item_free(OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item)
|
||||
{
|
||||
if (NULL == pdu_session_notify_item) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_notification_cause_free(pdu_session_notify_item->notification_cause);
|
||||
ogs_free(pdu_session_notify_item);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_pdu_session_notify_item_convertToJSON(OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (pdu_session_notify_item == NULL) {
|
||||
ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [PduSessionNotifyItem]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!pdu_session_notify_item->notification_cause) {
|
||||
ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [notification_cause]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *notification_cause_local_JSON = OpenAPI_notification_cause_convertToJSON(pdu_session_notify_item->notification_cause);
|
||||
if (notification_cause_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [notification_cause]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "notificationCause", notification_cause_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [notification_cause]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_parseFromJSON(cJSON *pdu_session_notify_itemJSON)
|
||||
{
|
||||
OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item_local_var = NULL;
|
||||
cJSON *notification_cause = cJSON_GetObjectItemCaseSensitive(pdu_session_notify_itemJSON, "notificationCause");
|
||||
if (!notification_cause) {
|
||||
ogs_error("OpenAPI_pdu_session_notify_item_parseFromJSON() failed [notification_cause]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_notification_cause_t *notification_cause_local_nonprim = NULL;
|
||||
|
||||
notification_cause_local_nonprim = OpenAPI_notification_cause_parseFromJSON(notification_cause);
|
||||
|
||||
pdu_session_notify_item_local_var = OpenAPI_pdu_session_notify_item_create (
|
||||
notification_cause_local_nonprim
|
||||
);
|
||||
|
||||
return pdu_session_notify_item_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_copy(OpenAPI_pdu_session_notify_item_t *dst, OpenAPI_pdu_session_notify_item_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_pdu_session_notify_item_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_pdu_session_notify_item_free(dst);
|
||||
dst = OpenAPI_pdu_session_notify_item_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue