simple 5GC registration is done

This commit is contained in:
Sukchan Lee 2020-06-21 23:07:14 -04:00
parent bcd02b1f33
commit b35c2277be
213 changed files with 7713 additions and 5445 deletions

100
configs/5gc-sample.yaml.in Normal file
View File

@ -0,0 +1,100 @@
db_uri: mongodb://localhost/open5gs
logger:
parameter:
amf:
sbi:
- addr: 127.0.0.2
port: 7777
ngap:
- addr: 127.0.0.2
guami:
- plmn_id:
mcc: 901
mnc: 70
amf_id:
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
mnc: 70
tac: 1
plmn:
- plmn_id:
mcc: 901
mnc: 70
s_nssai:
- sst: 1
security:
integrity_order : [ NIA1, NIA2, NIA0 ]
ciphering_order : [ NEA0, NEA1, NEA2 ]
network_name:
full: Open5GS
amf_name: open5gs-amf0
smf:
sbi:
- addr: 127.0.0.3
port: 7777
gtpc:
- addr: 127.0.0.3
- addr: ::1
pfcp:
- addr: 127.0.0.3
pdn:
- addr: 10.45.0.1/16
- addr: cafe::1/64
dns:
- 8.8.8.8
- 8.8.4.4
- 2001:4860:4860::8888
- 2001:4860:4860::8844
mtu: 1400
freeDiameter:
identity: pgw.open-ims.test
realm: open-ims.test
listen_on: 127.0.0.3
load_extension:
- module: @freediameter_extensions_builddir@/dbg_msg_dumps.fdx
conf: 0x8888
- module: @freediameter_extensions_builddir@/dict_rfc5777.fdx
- module: @freediameter_extensions_builddir@/dict_mip6i.fdx
- module: @freediameter_extensions_builddir@/dict_nasreq.fdx
- module: @freediameter_extensions_builddir@/dict_nas_mipv6.fdx
- module: @freediameter_extensions_builddir@/dict_dcca.fdx
- module: @freediameter_extensions_builddir@/dict_dcca_3gpp.fdx
connect:
- identity: pcrf.open-ims.test
addr: 127.0.0.5
upf:
pfcp:
- addr: 127.0.0.4
gtpu:
- addr:
- 127.0.0.4
- ::1
pdn:
ausf:
sbi:
- addr: 127.0.0.5
port: 7777
udm:
sbi:
- addr: 127.0.0.6
port: 7777
udr:
sbi:
- addr: 127.0.0.7
port: 7777
nrf:
sbi:
- addr:
- 127.0.0.1
- ::1
port: 7777

View File

@ -11,11 +11,11 @@ amf:
ngap:
guami:
- plmn_id:
mcc: 208
mnc: 93
mcc: 901
mnc: 70
amf_id:
region: 202
set: 1016
region: 2
set: 1
tai:
- plmn_id:
mcc: 901
@ -72,9 +72,6 @@ upf:
pfcp:
addr: 127.0.0.4
gtpu:
- addr:
- 127.0.0.4
- ::1
pdn:
ausf:

View File

@ -35,6 +35,7 @@ endif
example_conf = '''
5gc.yaml
5gc-sample.yaml
minimal.yaml
epc.yaml
epc-fdconf.yaml

View File

@ -9,7 +9,7 @@ amf:
- addr: 127.0.0.2
port: 7777
ngap:
- addr: 127.0.0.1
- addr: 127.0.0.2
guami:
- plmn_id:
mcc: 208

View File

@ -61,9 +61,6 @@ upf:
pfcp:
- addr: 127.0.0.4
gtpu:
- addr:
- 127.0.0.4
- ::1
pdn:
#

View File

@ -130,6 +130,8 @@ int ogs_asn_BIT_STRING_to_ip(BIT_STRING_t *bit_string, ogs_ip_t *ip)
ogs_assert(bit_string);
ogs_assert(ip);
memset(ip, 0, sizeof(*ip));
if (bit_string->size == OGS_IPV4V6_LEN) {
ip->ipv4 = 1;
ip->ipv6 = 1;

View File

@ -159,10 +159,6 @@ uint8_t ogs_amf_pointer(ogs_amf_id_t *amf_id)
ogs_amf_id_t *ogs_amf_id_build(ogs_amf_id_t *amf_id,
uint8_t region, uint16_t set, uint8_t pointer)
{
ogs_assert(amf_id);
ogs_assert(region);
ogs_assert(set);
amf_id->region = region;
amf_id->set1 = set >> 2;
amf_id->set2 = set & 0x3;

View File

@ -217,10 +217,10 @@ ogs_uint24_t ogs_s_nssai_sd_from_string(const char *hex);
typedef struct ogs_ip_s {
uint32_t addr;
uint8_t addr6[OGS_IPV6_LEN];
uint32_t len;
ED3(uint8_t ipv4:1;,
uint8_t ipv6:1;,
uint8_t reserved:6;)
uint32_t len;
ED3(uint8_t ipv4:1;,
uint8_t ipv6:1;,
uint8_t reserved:6;)
} ogs_ip_t;
int ogs_ip_to_sockaddr(ogs_ip_t *ip, uint16_t port, ogs_sockaddr_t **list);

View File

@ -51,6 +51,7 @@ extern "C" {
#define OGS_AUTN_LEN 16
#define OGS_AUTS_LEN 14
#define OGS_MAX_RES_LEN 16
#define OGS_MAC_S_LEN 8
#define OGS_SQN_XOR_AK_LEN 6
#define OGS_AK_LEN 6

View File

@ -306,3 +306,32 @@ void ogs_kdf_nas_eps(uint8_t algorithm_type_distinguishers,
memcpy(knas, output+16, 16);
}
/*
* TS33.102
* 6.3.3 Authentication and key agreement
* Re-use and re-transmission of (RAND, AUTN)
*/
void ogs_auc_sqn(
const uint8_t *opc, const uint8_t *k,
const uint8_t *rand, const uint8_t *conc_sqn_ms,
uint8_t *sqn_ms, uint8_t *mac_s)
{
int i;
uint8_t ak[OGS_AK_LEN];
/*
* The AMF used to calculate MAC-S assumes a dummy value of
* all zeros so that it does not need to be transmitted in the clear
* in the re-synch message.
*/
uint8_t amf[2] = { 0, 0 };
ogs_assert(opc);
ogs_assert(k);
ogs_assert(rand);
ogs_assert(conc_sqn_ms);
milenage_f2345(opc, k, rand, NULL, NULL, NULL, NULL, ak);
for (i = 0; i < OGS_SQN_LEN; i++)
sqn_ms[i] = ak[i] ^ conc_sqn_ms[i];
milenage_f1(opc, k, rand, sqn_ms, amf, NULL, mac_s);
}

View File

@ -88,6 +88,16 @@ void ogs_kdf_nas_eps(uint8_t algorithm_type_distinguishers,
uint8_t algorithm_identity, uint8_t *kasme, uint8_t *knas);
/*
* TS33.102
* 6.3.3 Authentication and key agreement
* Re-use and re-transmission of (RAND, AUTN)
*/
void ogs_auc_sqn(
const uint8_t *opc, const uint8_t *k,
const uint8_t *rand, const uint8_t *conc_sqn_ms,
uint8_t *sqn_ms, uint8_t *mac_s);
#ifdef __cplusplus
}
#endif

View File

@ -22,7 +22,7 @@
void ogs_nas_5gs_imsi_to_bcd(
ogs_nas_5gs_mobile_identity_t *mobile_identity, char *imsi_bcd)
{
ogs_nas_5gs_mobile_identity_imsi_t *mobile_identity_imsi = NULL;
ogs_nas_5gs_mobile_identity_suci_t *mobile_identity_suci = NULL;
ogs_plmn_id_t plmn_id;
char tmp[OGS_MAX_IMSI_BCD_LEN+1];
char *p, *last;
@ -33,11 +33,11 @@ void ogs_nas_5gs_imsi_to_bcd(
p = imsi_bcd;
last = imsi_bcd + OGS_MAX_IMSI_BCD_LEN + 1;
mobile_identity_imsi =
(ogs_nas_5gs_mobile_identity_imsi_t *)mobile_identity->buffer;
ogs_assert(mobile_identity_imsi);
mobile_identity_suci =
(ogs_nas_5gs_mobile_identity_suci_t *)mobile_identity->buffer;
ogs_assert(mobile_identity_suci);
ogs_nas_to_plmn_id(&plmn_id, &mobile_identity_imsi->nas_plmn_id);
ogs_nas_to_plmn_id(&plmn_id, &mobile_identity_suci->nas_plmn_id);
if (ogs_plmn_id_mnc_len(&plmn_id) == 2)
p = ogs_slprintf(p, last, "%03d%02d",
ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id));
@ -46,7 +46,7 @@ void ogs_nas_5gs_imsi_to_bcd(
ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id));
ogs_assert(mobile_identity->length > 8);
ogs_buffer_to_bcd(mobile_identity_imsi->scheme_output,
ogs_buffer_to_bcd(mobile_identity_suci->scheme_output,
mobile_identity->length - 8, tmp);
p = ogs_slprintf(p, last, "%s", tmp);
}
@ -54,7 +54,7 @@ void ogs_nas_5gs_imsi_to_bcd(
char *ogs_nas_5gs_suci_from_mobile_identity(
ogs_nas_5gs_mobile_identity_t *mobile_identity)
{
ogs_nas_5gs_mobile_identity_imsi_t *mobile_identity_imsi = NULL;
ogs_nas_5gs_mobile_identity_suci_t *mobile_identity_suci = NULL;
ogs_plmn_id_t plmn_id;
char tmp[OGS_MAX_IMSI_BCD_LEN+1];
char routing_indicator[5];
@ -62,14 +62,14 @@ char *ogs_nas_5gs_suci_from_mobile_identity(
ogs_assert(mobile_identity);
mobile_identity_imsi =
(ogs_nas_5gs_mobile_identity_imsi_t *)mobile_identity->buffer;
ogs_assert(mobile_identity_imsi);
mobile_identity_suci =
(ogs_nas_5gs_mobile_identity_suci_t *)mobile_identity->buffer;
ogs_assert(mobile_identity_suci);
suci = ogs_msprintf("suci-%d-", mobile_identity_imsi->h.supi_format);
suci = ogs_msprintf("suci-%d-", mobile_identity_suci->h.supi_format);
ogs_assert(suci);
ogs_nas_to_plmn_id(&plmn_id, &mobile_identity_imsi->nas_plmn_id);
ogs_nas_to_plmn_id(&plmn_id, &mobile_identity_suci->nas_plmn_id);
if (ogs_plmn_id_mnc_len(&plmn_id) == 2) {
suci = ogs_mstrcatf(suci, "%03d-%02d-",
ogs_plmn_id_mcc(&plmn_id), ogs_plmn_id_mnc(&plmn_id));
@ -81,31 +81,65 @@ char *ogs_nas_5gs_suci_from_mobile_identity(
}
memset(routing_indicator, 0, sizeof(routing_indicator));
if (mobile_identity_imsi->routing_indicator1 != 0xf) {
if (mobile_identity_suci->routing_indicator1 != 0xf) {
routing_indicator[0] =
mobile_identity_imsi->routing_indicator1 + '0';
if (mobile_identity_imsi->routing_indicator2 != 0xf) {
mobile_identity_suci->routing_indicator1 + '0';
if (mobile_identity_suci->routing_indicator2 != 0xf) {
routing_indicator[1] =
mobile_identity_imsi->routing_indicator2 + '0';
if (mobile_identity_imsi->routing_indicator3 != 0xf) {
mobile_identity_suci->routing_indicator2 + '0';
if (mobile_identity_suci->routing_indicator3 != 0xf) {
routing_indicator[2] =
mobile_identity_imsi->routing_indicator3 + '0';
if (mobile_identity_imsi->routing_indicator4 != 0xf)
mobile_identity_suci->routing_indicator3 + '0';
if (mobile_identity_suci->routing_indicator4 != 0xf)
routing_indicator[3] =
mobile_identity_imsi->routing_indicator4 + '0';
mobile_identity_suci->routing_indicator4 + '0';
}
}
}
ogs_assert(mobile_identity->length > 8);
ogs_buffer_to_bcd(mobile_identity_imsi->scheme_output,
ogs_buffer_to_bcd(mobile_identity_suci->scheme_output,
mobile_identity->length - 8, tmp);
suci = ogs_mstrcatf(suci, "%s-%d-%d-%s",
routing_indicator,
mobile_identity_imsi->protection_scheme_id,
mobile_identity_imsi->home_network_pki_value,
mobile_identity_suci->protection_scheme_id,
mobile_identity_suci->home_network_pki_value,
tmp);
return suci;
}
void ogs_nas_5gs_mobile_identity_guti_to_nas_guti(
ogs_nas_5gs_mobile_identity_guti_t *mobile_identity_guti,
ogs_nas_5gs_guti_t *nas_guti)
{
ogs_assert(mobile_identity_guti);
ogs_assert(nas_guti);
memset(nas_guti, 0, sizeof(*nas_guti));
memcpy(&nas_guti->nas_plmn_id,
&mobile_identity_guti->nas_plmn_id, OGS_PLMN_ID_LEN);
memcpy(&nas_guti->amf_id,
&mobile_identity_guti->amf_id, sizeof(ogs_amf_id_t));
nas_guti->m_tmsi = be32toh(mobile_identity_guti->m_tmsi);
}
void ogs_nas_5gs_nas_guti_to_mobilty_identity_guti(
ogs_nas_5gs_guti_t *nas_guti,
ogs_nas_5gs_mobile_identity_guti_t *mobile_identity_guti)
{
ogs_assert(nas_guti);
ogs_assert(mobile_identity_guti);
memset(mobile_identity_guti, 0, sizeof(*mobile_identity_guti));
mobile_identity_guti->h.type = OGS_NAS_5GS_MOBILE_IDENTITY_GUTI;
memcpy(&mobile_identity_guti->nas_plmn_id,
&nas_guti->nas_plmn_id, OGS_PLMN_ID_LEN);
memcpy(&mobile_identity_guti->amf_id,
&nas_guti->amf_id, sizeof(ogs_amf_id_t));
mobile_identity_guti->m_tmsi = htobe32(nas_guti->m_tmsi);
}

View File

@ -36,6 +36,13 @@ void ogs_nas_5gs_imsi_to_bcd(
char *ogs_nas_5gs_suci_from_mobile_identity(
ogs_nas_5gs_mobile_identity_t *mobile_identity);
void ogs_nas_5gs_mobile_identity_guti_to_nas_guti(
ogs_nas_5gs_mobile_identity_guti_t *mobile_identity_guti,
ogs_nas_5gs_guti_t *nas_guti);
void ogs_nas_5gs_nas_guti_to_mobilty_identity_guti(
ogs_nas_5gs_guti_t *nas_guti,
ogs_nas_5gs_mobile_identity_guti_t *mobile_identity_guti);
#ifdef __cplusplus
}
#endif

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-06-15 13:46:04.094836 by acetcom
* Created on: 2020-06-19 19:55:35.949469 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-06-15 13:46:04.105762 by acetcom
* Created on: 2020-06-19 19:55:35.960740 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-06-15 13:46:04.075315 by acetcom
* Created on: 2020-06-19 19:55:35.932346 by acetcom
* from 24501-g41.docx
******************************************************************************/
@ -473,6 +473,8 @@ int ogs_nas_5gs_decode_allowed_pdu_session_status(ogs_nas_allowed_pdu_session_st
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(allowed_pdu_session_status, pkbuf->data - size, size);
allowed_pdu_session_status->psi = be16toh(allowed_pdu_session_status->psi);
ogs_trace(" ALLOWED_PDU_SESSION_STATUS - ");
ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);
@ -485,6 +487,8 @@ int ogs_nas_5gs_encode_allowed_pdu_session_status(ogs_pkbuf_t *pkbuf, ogs_nas_al
ogs_nas_allowed_pdu_session_status_t target;
memcpy(&target, allowed_pdu_session_status, sizeof(ogs_nas_allowed_pdu_session_status_t));
target.psi = htobe16(allowed_pdu_session_status->psi);
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(pkbuf->data - size, &target, size);
@ -1861,6 +1865,8 @@ int ogs_nas_5gs_decode_pdu_session_reactivation_result(ogs_nas_pdu_session_react
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(pdu_session_reactivation_result, pkbuf->data - size, size);
pdu_session_reactivation_result->psi = be16toh(pdu_session_reactivation_result->psi);
ogs_trace(" PDU_SESSION_REACTIVATION_RESULT - ");
ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);
@ -1873,6 +1879,8 @@ int ogs_nas_5gs_encode_pdu_session_reactivation_result(ogs_pkbuf_t *pkbuf, ogs_n
ogs_nas_pdu_session_reactivation_result_t target;
memcpy(&target, pdu_session_reactivation_result, sizeof(ogs_nas_pdu_session_reactivation_result_t));
target.psi = htobe16(pdu_session_reactivation_result->psi);
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(pkbuf->data - size, &target, size);
@ -1937,6 +1945,8 @@ int ogs_nas_5gs_decode_pdu_session_status(ogs_nas_pdu_session_status_t *pdu_sess
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(pdu_session_status, pkbuf->data - size, size);
pdu_session_status->psi = be16toh(pdu_session_status->psi);
ogs_trace(" PDU_SESSION_STATUS - ");
ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);
@ -1949,6 +1959,8 @@ int ogs_nas_5gs_encode_pdu_session_status(ogs_pkbuf_t *pkbuf, ogs_nas_pdu_sessio
ogs_nas_pdu_session_status_t target;
memcpy(&target, pdu_session_status, sizeof(ogs_nas_pdu_session_status_t));
target.psi = htobe16(pdu_session_status->psi);
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(pkbuf->data - size, &target, size);
@ -2497,6 +2509,8 @@ int ogs_nas_5gs_decode_uplink_data_status(ogs_nas_uplink_data_status_t *uplink_d
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(uplink_data_status, pkbuf->data - size, size);
uplink_data_status->psi = be16toh(uplink_data_status->psi);
ogs_trace(" UPLINK_DATA_STATUS - ");
ogs_log_hexdump(OGS_LOG_TRACE, pkbuf->data - size, size);
@ -2509,6 +2523,8 @@ int ogs_nas_5gs_encode_uplink_data_status(ogs_pkbuf_t *pkbuf, ogs_nas_uplink_dat
ogs_nas_uplink_data_status_t target;
memcpy(&target, uplink_data_status, sizeof(ogs_nas_uplink_data_status_t));
target.psi = htobe16(uplink_data_status->psi);
ogs_assert(ogs_pkbuf_pull(pkbuf, size));
memcpy(pkbuf->data - size, &target, size);

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-06-15 13:46:04.070975 by acetcom
* Created on: 2020-06-19 19:55:35.929537 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -28,7 +28,7 @@
/*******************************************************************************
* This file had been created by nas-message.py script v0.2.0
* Please do not modify this file but regenerate it via script.
* Created on: 2020-06-15 13:46:04.086829 by acetcom
* Created on: 2020-06-19 19:55:35.941362 by acetcom
* from 24501-g41.docx
******************************************************************************/

View File

@ -44,3 +44,20 @@ type_list["Session-AMBR"]["decode"] = \
type_list["Session-AMBR"]["encode"] = \
" target.downlink.bitrate = htobe16(session_ambr->downlink.bitrate);\n" \
" target.uplink.bitrate = htobe16(session_ambr->uplink.bitrate);\n\n"
type_list["Uplink data status"]["decode"] = \
" uplink_data_status->psi = be16toh(uplink_data_status->psi);\n\n"
type_list["Uplink data status"]["encode"] = \
" target.psi = htobe16(uplink_data_status->psi);\n\n"
type_list["Allowed PDU session status"]["decode"] = \
" allowed_pdu_session_status->psi = be16toh(allowed_pdu_session_status->psi);\n\n"
type_list["Allowed PDU session status"]["encode"] = \
" target.psi = htobe16(allowed_pdu_session_status->psi);\n\n"
type_list["PDU session status"]["decode"] = \
" pdu_session_status->psi = be16toh(pdu_session_status->psi);\n\n"
type_list["PDU session status"]["encode"] = \
" target.psi = htobe16(pdu_session_status->psi);\n\n"
type_list["PDU session reactivation result"]["decode"] = \
" pdu_session_reactivation_result->psi = be16toh(pdu_session_reactivation_result->psi);\n\n"
type_list["PDU session reactivation result"]["encode"] = \
" target.psi = htobe16(pdu_session_reactivation_result->psi);\n\n"

View File

@ -149,7 +149,7 @@ ED4(uint8_t spare1:1;,
uint8_t odd_even:1;,
uint8_t type:3;)
} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_header_t;
typedef struct ogs_nas_5gs_mobile_identity_imsi_s {
typedef struct ogs_nas_5gs_mobile_identity_suci_s {
ogs_nas_5gs_mobile_identity_header_t h;
ogs_nas_plmn_id_t nas_plmn_id;
ED2(uint8_t routing_indicator2:4;,
@ -163,7 +163,7 @@ ED2(uint8_t spare3:4;,
uint8_t protection_scheme_id:4;)
uint8_t home_network_pki_value;
uint8_t scheme_output[OGS_NAS_MAX_SCHEME_OUTPUT_LEN];
} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_imsi_t;
} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_suci_t;
typedef struct ogs_nas_5gs_mobile_identity_guti_s {
ogs_nas_5gs_mobile_identity_header_t h;
ogs_nas_plmn_id_t nas_plmn_id;
@ -172,7 +172,9 @@ typedef struct ogs_nas_5gs_mobile_identity_guti_s {
} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_guti_t;
typedef struct ogs_nas_5gs_mobile_identity_s_tmsi_s {
ogs_nas_5gs_mobile_identity_header_t h;
ogs_amf_id_t amf_id;
uint8_t set1;
ED2(uint8_t set2:2;,
uint8_t pointer:6;)
uint32_t m_tmsi;
} __attribute__ ((packed)) ogs_nas_5gs_mobile_identity_s_tmsi_t;
typedef struct ogs_nas_5gs_mobile_identity_s {
@ -321,22 +323,7 @@ ED2(uint8_t spare:7;,
* O TLV 4-34 */
typedef struct ogs_nas_allowed_pdu_session_status_s {
uint8_t length;
ED8(uint8_t psi7:1;,
uint8_t psi6:1;,
uint8_t psi5:1;,
uint8_t psi4:1;,
uint8_t psi3:1;,
uint8_t psi2:1;,
uint8_t psi1:1;,
uint8_t hdr0:1;)
ED8(uint8_t psi15:1;,
uint8_t psi14:1;,
uint8_t psi13:1;,
uint8_t psi12:1;,
uint8_t psi11:1;,
uint8_t psi10:1;,
uint8_t psi9:1;,
uint8_t psi8:1;)
uint16_t psi;
} __attribute__ ((packed)) ogs_nas_allowed_pdu_session_status_t;
/* 9.11.3.18 Configuration update indication
@ -386,10 +373,11 @@ ED3(uint8_t type:4;,
/* 9.11.3.20 De-registration type
* M V 1/2 */
typedef struct ogs_nas_de_registration_type_s {
ED4(uint8_t type:4;,
ED5(uint8_t tsc:1;,
uint8_t ksi:3;,
uint8_t switch_off:1;,
uint8_t re_registration_required:1;,
uint8_t value:1;)
uint8_t access_type:2;)
} __attribute__ ((packed)) ogs_nas_de_registration_type_t;
/* 9.11.3.24 EPS NAS message container

View File

@ -19,66 +19,6 @@
#include "ogs-nas-common.h"
void ogs_nas_eps_imsi_to_bcd(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len, char *bcd)
{
int bcd_len;
bcd[0] = '0' + imsi->digit1;
bcd[1] = '0' + imsi->digit2;
bcd[2] = '0' + imsi->digit3;
bcd[3] = '0' + imsi->digit4;
bcd[4] = '0' + imsi->digit5;
bcd[5] = '0' + imsi->digit6;
bcd[6] = '0' + imsi->digit7;
bcd[7] = '0' + imsi->digit8;
bcd[8] = '0' + imsi->digit9;
bcd[9] = '0' + imsi->digit10;
bcd[10] = '0' + imsi->digit11;
bcd[11] = '0' + imsi->digit12;
bcd[12] = '0' + imsi->digit13;
bcd[13] = '0' + imsi->digit14;
bcd[14] = '0' + imsi->digit15;
bcd_len = imsi_len * 2 - 1;
if (!imsi->odd_even) { /* if bcd length is even */
if (imsi->digit15 != 0xf)
ogs_warn("Spec warning : bcd[%d] = 0x%x, 0x%x",
bcd_len-1, imsi->digit15, bcd[bcd_len-1]);
(bcd_len)--;
}
bcd[bcd_len] = 0;
}
void ogs_nas_imsi_to_buffer(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len,
uint8_t *buf, uint8_t *buf_len)
{
buf[0] = ((('0' + imsi->digit2) << 4) & 0xf0) |
(('0' + imsi->digit1) & 0x0f);
buf[1] = ((('0' + imsi->digit4) << 4) & 0xf0) |
(('0' + imsi->digit3) & 0x0f);
buf[2] = ((('0' + imsi->digit6) << 4) & 0xf0) |
(('0' + imsi->digit5) & 0x0f);
buf[3] = ((('0' + imsi->digit8) << 4) & 0xf0) |
(('0' + imsi->digit7) & 0x0f);
buf[4] = ((('0' + imsi->digit10) << 4) & 0xf0) |
(('0' + imsi->digit9) & 0x0f);
buf[5] = ((('0' + imsi->digit12) << 4) & 0xf0) |
(('0' + imsi->digit11) & 0x0f);
buf[6] = ((('0' + imsi->digit14) << 4) & 0xf0) |
(('0' + imsi->digit13) & 0x0f);
buf[7] = ((('0' + imsi->digit15)) & 0x0f);
*buf_len = imsi_len;
if (!imsi->odd_even) { /* if imsi length is even */
(*buf_len)--;
if ((buf[*buf_len] & 0xf) != 0xf)
ogs_warn("Spec warning : buf[%d] = 0x%x", *buf_len, buf[*buf_len]);
}
}
void ogs_nas_imeisv_to_bcd(
ogs_nas_mobile_identity_imeisv_t *imeisv, uint8_t imeisv_len, char *bcd)
{

View File

@ -30,13 +30,6 @@
extern "C" {
#endif
void ogs_nas_imsi_to_buffer(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len,
uint8_t *buf, uint8_t *buf_len);
void ogs_nas_eps_imsi_to_bcd(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len, char *bcd);
void ogs_nas_imeisv_to_bcd(
ogs_nas_mobile_identity_imeisv_t *imeisv, uint8_t imeisv_len, char *bcd);

View File

@ -127,59 +127,6 @@ ED8(uint8_t ebi15:1;,
uint8_t ebi8:1;)
} __attribute__ ((packed)) ogs_nas_eps_bearer_context_status_t;
/* 9.9.2.3 Mobile identity
* See subclause 10.5.1.4 in 3GPP TS 24.008 [13].
* O TLV 7-10 */
#define OGS_NAS_MOBILE_IDENTITY_NONE 0
#define OGS_NAS_MOBILE_IDENTITY_IMSI 1
#define OGS_NAS_MOBILE_IDENTITY_IMEI 2
#define OGS_NAS_MOBILE_IDENTITY_IMEISV 3
#define OGS_NAS_MOBILE_IDENTITY_TMSI 4
#define OGS_NAS_MOBILE_IDENTITY_TMGI 5
#define OGS_NAS_MOBILE_IDENTITY_GUTI 6
#define OGS_NAS_MOBILE_IDENTITY_EVEN 0
#define OGS_NAS_MOBILE_IDENTITY_ODD 1
typedef struct ogs_nas_mobile_identity_imsi_s {
ED3(uint8_t digit1:4;,
uint8_t odd_even:1;,
uint8_t type:3;)
ED2(uint8_t digit3:4;,
uint8_t digit2:4;)
ED2(uint8_t digit5:4;,
uint8_t digit4:4;)
ED2(uint8_t digit7:4;,
uint8_t digit6:4;)
ED2(uint8_t digit9:4;,
uint8_t digit8:4;)
ED2(uint8_t digit11:4;,
uint8_t digit10:4;)
ED2(uint8_t digit13:4;,
uint8_t digit12:4;)
ED2(uint8_t digit15:4;,
uint8_t digit14:4;)
} __attribute__ ((packed)) ogs_nas_mobile_identity_imsi_t;
typedef ogs_nas_mobile_identity_imsi_t ogs_nas_mobile_identity_imei_t;
typedef struct ogs_nas_mobile_identity_tmsi_s {
ED3(uint8_t spare:4;,
uint8_t odd_even:1;,
uint8_t type:3;)
uint32_t tmsi;
} __attribute__ ((packed)) ogs_nas_mobile_identity_tmsi_t;
typedef struct ogs_nas_mobile_identity_tmgi_s {
ED5(uint8_t spare:2;,
uint8_t mbms_session_id:1;,
uint8_t mcc_mnc:1;,
uint8_t odd_even:1;,
uint8_t type:3;)
uint8_t mbms_servicec_id[3];
ogs_nas_plmn_id_t nas_plmn_id;
uint8_t mbms_session_identity;
} __attribute__ ((packed)) ogs_nas_mobile_identity_tmgi_t;
typedef struct ogs_nas_mobile_identity_imeisv_s {
ED3(uint8_t digit1:4;,
uint8_t odd_even:1;,
@ -202,16 +149,6 @@ ED2(uint8_t digit17:4;,
uint8_t digit16:4;)
} __attribute__ ((packed)) ogs_nas_mobile_identity_imeisv_t;
typedef struct ogs_nas_mobile_identity_s {
uint8_t length;
union {
ogs_nas_mobile_identity_imsi_t imsi;
ogs_nas_mobile_identity_tmsi_t tmsi;
ogs_nas_mobile_identity_tmgi_t tmgi;
ogs_nas_mobile_identity_imeisv_t imeisv;
};
} ogs_nas_mobile_identity_t;
/* 9.9.2.4 Mobile station classmark 2
* See subclause 10.5.1.6 in 3GPP TS 24.008
* O TLV 5 */

80
lib/nas/eps/conv.c Normal file
View File

@ -0,0 +1,80 @@
/*
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ogs-nas-eps.h"
void ogs_nas_eps_imsi_to_bcd(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len, char *bcd)
{
int bcd_len;
bcd[0] = '0' + imsi->digit1;
bcd[1] = '0' + imsi->digit2;
bcd[2] = '0' + imsi->digit3;
bcd[3] = '0' + imsi->digit4;
bcd[4] = '0' + imsi->digit5;
bcd[5] = '0' + imsi->digit6;
bcd[6] = '0' + imsi->digit7;
bcd[7] = '0' + imsi->digit8;
bcd[8] = '0' + imsi->digit9;
bcd[9] = '0' + imsi->digit10;
bcd[10] = '0' + imsi->digit11;
bcd[11] = '0' + imsi->digit12;
bcd[12] = '0' + imsi->digit13;
bcd[13] = '0' + imsi->digit14;
bcd[14] = '0' + imsi->digit15;
bcd_len = imsi_len * 2 - 1;
if (!imsi->odd_even) { /* if bcd length is even */
if (imsi->digit15 != 0xf)
ogs_warn("Spec warning : bcd[%d] = 0x%x, 0x%x",
bcd_len-1, imsi->digit15, bcd[bcd_len-1]);
(bcd_len)--;
}
bcd[bcd_len] = 0;
}
void ogs_nas_imsi_to_buffer(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len,
uint8_t *buf, uint8_t *buf_len)
{
buf[0] = ((('0' + imsi->digit2) << 4) & 0xf0) |
(('0' + imsi->digit1) & 0x0f);
buf[1] = ((('0' + imsi->digit4) << 4) & 0xf0) |
(('0' + imsi->digit3) & 0x0f);
buf[2] = ((('0' + imsi->digit6) << 4) & 0xf0) |
(('0' + imsi->digit5) & 0x0f);
buf[3] = ((('0' + imsi->digit8) << 4) & 0xf0) |
(('0' + imsi->digit7) & 0x0f);
buf[4] = ((('0' + imsi->digit10) << 4) & 0xf0) |
(('0' + imsi->digit9) & 0x0f);
buf[5] = ((('0' + imsi->digit12) << 4) & 0xf0) |
(('0' + imsi->digit11) & 0x0f);
buf[6] = ((('0' + imsi->digit14) << 4) & 0xf0) |
(('0' + imsi->digit13) & 0x0f);
buf[7] = ((('0' + imsi->digit15)) & 0x0f);
*buf_len = imsi_len;
if (!imsi->odd_even) { /* if imsi length is even */
(*buf_len)--;
if ((buf[*buf_len] & 0xf) != 0xf)
ogs_warn("Spec warning : buf[%d] = 0x%x", *buf_len, buf[*buf_len]);
}
}

45
lib/nas/eps/conv.h Normal file
View File

@ -0,0 +1,45 @@
/*
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#if !defined(OGS_NAS_INSIDE) && !defined(OGS_NAS_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_NAS_EPS_CONV_H
#define OGS_NAS_EPS_CONV_H
#include "ogs-nas-common.h"
#ifdef __cplusplus
extern "C" {
#endif
void ogs_nas_imsi_to_buffer(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len,
uint8_t *buf, uint8_t *buf_len);
void ogs_nas_eps_imsi_to_bcd(
ogs_nas_mobile_identity_imsi_t *imsi, uint8_t imsi_len, char *bcd);
#ifdef __cplusplus
}
#endif
#endif /* OGS_NAS_EPS_CONV_H */

View File

@ -17,6 +17,7 @@
libnas_eps_sources = files('''
types.c
conv.c
ies.c
decoder.c
encoder.c

View File

@ -25,6 +25,7 @@
#define OGS_NAS_INSIDE
#include "nas/eps/types.h"
#include "nas/eps/conv.h"
#include "nas/eps/ies.h"
#include "nas/eps/message.h"

View File

@ -56,6 +56,69 @@ typedef struct ogs_nas_location_area_identification_s {
typedef ogs_nas_location_area_identification_t ogs_nas_lai_t;
/* 9.9.2.3 Mobile identity
* See subclause 10.5.1.4 in 3GPP TS 24.008 [13].
* O TLV 7-10 */
#define OGS_NAS_MOBILE_IDENTITY_NONE 0
#define OGS_NAS_MOBILE_IDENTITY_IMSI 1
#define OGS_NAS_MOBILE_IDENTITY_IMEI 2
#define OGS_NAS_MOBILE_IDENTITY_IMEISV 3
#define OGS_NAS_MOBILE_IDENTITY_TMSI 4
#define OGS_NAS_MOBILE_IDENTITY_TMGI 5
#define OGS_NAS_MOBILE_IDENTITY_GUTI 6
#define OGS_NAS_MOBILE_IDENTITY_EVEN 0
#define OGS_NAS_MOBILE_IDENTITY_ODD 1
typedef struct ogs_nas_mobile_identity_imsi_s {
ED3(uint8_t digit1:4;,
uint8_t odd_even:1;,
uint8_t type:3;)
ED2(uint8_t digit3:4;,
uint8_t digit2:4;)
ED2(uint8_t digit5:4;,
uint8_t digit4:4;)
ED2(uint8_t digit7:4;,
uint8_t digit6:4;)
ED2(uint8_t digit9:4;,
uint8_t digit8:4;)
ED2(uint8_t digit11:4;,
uint8_t digit10:4;)
ED2(uint8_t digit13:4;,
uint8_t digit12:4;)
ED2(uint8_t digit15:4;,
uint8_t digit14:4;)
} __attribute__ ((packed)) ogs_nas_mobile_identity_imsi_t;
typedef ogs_nas_mobile_identity_imsi_t ogs_nas_mobile_identity_imei_t;
typedef struct ogs_nas_mobile_identity_tmsi_s {
ED3(uint8_t spare:4;,
uint8_t odd_even:1;,
uint8_t type:3;)
uint32_t tmsi;
} __attribute__ ((packed)) ogs_nas_mobile_identity_tmsi_t;
typedef struct ogs_nas_mobile_identity_tmgi_s {
ED5(uint8_t spare:2;,
uint8_t mbms_session_id:1;,
uint8_t mcc_mnc:1;,
uint8_t odd_even:1;,
uint8_t type:3;)
uint8_t mbms_servicec_id[3];
ogs_nas_plmn_id_t nas_plmn_id;
uint8_t mbms_session_identity;
} __attribute__ ((packed)) ogs_nas_mobile_identity_tmgi_t;
typedef struct ogs_nas_mobile_identity_s {
uint8_t length;
union {
ogs_nas_mobile_identity_imsi_t imsi;
ogs_nas_mobile_identity_tmsi_t tmsi;
ogs_nas_mobile_identity_tmgi_t tmgi;
ogs_nas_mobile_identity_imeisv_t imeisv;
};
} ogs_nas_mobile_identity_t;
/*9.9.2.5 Mobile station classmark 3
* See subclause 10.5.1.7 in 3GPP TS 24.008 [13].
* O TLV 2-34 */

View File

@ -112,6 +112,8 @@ typedef struct ogs_sbi_object_s {
ogs_time_t duration;
} client_wait;
bool running;
OpenAPI_nf_type_e nf_type;
ogs_sbi_request_t *request;

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "cause.h"
OpenAPI_cause_t *OpenAPI_cause_create(
)
char* OpenAPI_cause_ToString(OpenAPI_cause_e cause)
{
OpenAPI_cause_t *cause_local_var = OpenAPI_malloc(sizeof(OpenAPI_cause_t));
if (!cause_local_var) {
return NULL;
}
return cause_local_var;
const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS" };
size_t sizeofArray = sizeof(causeArray) / sizeof(causeArray[0]);
if (cause < sizeofArray)
return (char *)causeArray[cause];
else
return (char *)"Unknown";
}
void OpenAPI_cause_free(OpenAPI_cause_t *cause)
OpenAPI_cause_e OpenAPI_cause_FromString(char* cause)
{
if (NULL == cause) {
return;
int stringToReturn = 0;
const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS" };
size_t sizeofArray = sizeof(causeArray) / sizeof(causeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(cause, causeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(cause);
}
cJSON *OpenAPI_cause_convertToJSON(OpenAPI_cause_t *cause)
{
cJSON *item = NULL;
if (cause == NULL) {
ogs_error("OpenAPI_cause_convertToJSON() failed [Cause]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_cause_t *OpenAPI_cause_parseFromJSON(cJSON *causeJSON)
{
OpenAPI_cause_t *cause_local_var = NULL;
cause_local_var = OpenAPI_cause_create (
);
return cause_local_var;
end:
return NULL;
}
OpenAPI_cause_t *OpenAPI_cause_copy(OpenAPI_cause_t *dst, OpenAPI_cause_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_cause_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_cause_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_cause_free(dst);
dst = OpenAPI_cause_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* cause.h
*
* Possible values are - REL_DUE_TO_HO - EPS_FALLBACK - REL_DUE_TO_UP_SEC - DNN_CONGESTION - S_NSSAI_CONGESTION - REL_DUE_TO_REACTIVATION - 5G_AN_NOT_RESPONDING - REL_DUE_TO_SLICE_NOT_AVAILABLE - REL_DUE_TO_DUPLICATE_SESSION_ID - PDU_SESSION_STATUS_MISMATCH - HO_FAILURE - INSUFFICIENT_UP_RESOURCES - PDU_SESSION_HANDED_OVER - PDU_SESSION_RESUMED - CN_ASSISTED_RAN_PARAMETER_TUNING - ISMF_CONTEXT_TRANSFER - SMF_CONTEXT_TRANSFER - REL_DUE_TO_PS_TO_CS_HO - REL_DUE_TO_SUBSCRIPTION_CHANGE - HO_CANCEL - REL_DUE_TO_SLICE_NOT_AUTHORIZED - PDU_SESSION_HAND_OVER_FAILURE - DDN_FAILURE_STATUS
*
*/
#ifndef _OpenAPI_cause_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_cause_s OpenAPI_cause_t;
typedef struct OpenAPI_cause_s {
} OpenAPI_cause_t;
typedef enum { OpenAPI_cause_NULL = 0, OpenAPI_cause_REL_DUE_TO_HO, OpenAPI_cause_EPS_FALLBACK, OpenAPI_cause_REL_DUE_TO_UP_SEC, OpenAPI_cause_DNN_CONGESTION, OpenAPI_cause_S_NSSAI_CONGESTION, OpenAPI_cause_REL_DUE_TO_REACTIVATION, OpenAPI_cause__5G_AN_NOT_RESPONDING, OpenAPI_cause_REL_DUE_TO_SLICE_NOT_AVAILABLE, OpenAPI_cause_REL_DUE_TO_DUPLICATE_SESSION_ID, OpenAPI_cause_PDU_SESSION_STATUS_MISMATCH, OpenAPI_cause_HO_FAILURE, OpenAPI_cause_INSUFFICIENT_UP_RESOURCES, OpenAPI_cause_PDU_SESSION_HANDED_OVER, OpenAPI_cause_PDU_SESSION_RESUMED, OpenAPI_cause_CN_ASSISTED_RAN_PARAMETER_TUNING, OpenAPI_cause_ISMF_CONTEXT_TRANSFER, OpenAPI_cause_SMF_CONTEXT_TRANSFER, OpenAPI_cause_REL_DUE_TO_PS_TO_CS_HO, OpenAPI_cause_REL_DUE_TO_SUBSCRIPTION_CHANGE, OpenAPI_cause_HO_CANCEL, OpenAPI_cause_REL_DUE_TO_SLICE_NOT_AUTHORIZED, OpenAPI_cause_PDU_SESSION_HAND_OVER_FAILURE, OpenAPI_cause_DDN_FAILURE_STATUS } OpenAPI_cause_e;
OpenAPI_cause_t *OpenAPI_cause_create(
);
void OpenAPI_cause_free(OpenAPI_cause_t *cause);
OpenAPI_cause_t *OpenAPI_cause_parseFromJSON(cJSON *causeJSON);
cJSON *OpenAPI_cause_convertToJSON(OpenAPI_cause_t *cause);
OpenAPI_cause_t *OpenAPI_cause_copy(OpenAPI_cause_t *dst, OpenAPI_cause_t *src);
char* OpenAPI_cause_ToString(OpenAPI_cause_e cause);
OpenAPI_cause_e OpenAPI_cause_FromString(char* cause);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "dnn_selection_mode.h"
OpenAPI_dnn_selection_mode_t *OpenAPI_dnn_selection_mode_create(
)
char* OpenAPI_dnn_selection_mode_ToString(OpenAPI_dnn_selection_mode_e dnn_selection_mode)
{
OpenAPI_dnn_selection_mode_t *dnn_selection_mode_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnn_selection_mode_t));
if (!dnn_selection_mode_local_var) {
return NULL;
}
return dnn_selection_mode_local_var;
const char *dnn_selection_modeArray[] = { "NULL", "VERIFIED", "UE_DNN_NOT_VERIFIED", "NW_DNN_NOT_VERIFIED" };
size_t sizeofArray = sizeof(dnn_selection_modeArray) / sizeof(dnn_selection_modeArray[0]);
if (dnn_selection_mode < sizeofArray)
return (char *)dnn_selection_modeArray[dnn_selection_mode];
else
return (char *)"Unknown";
}
void OpenAPI_dnn_selection_mode_free(OpenAPI_dnn_selection_mode_t *dnn_selection_mode)
OpenAPI_dnn_selection_mode_e OpenAPI_dnn_selection_mode_FromString(char* dnn_selection_mode)
{
if (NULL == dnn_selection_mode) {
return;
int stringToReturn = 0;
const char *dnn_selection_modeArray[] = { "NULL", "VERIFIED", "UE_DNN_NOT_VERIFIED", "NW_DNN_NOT_VERIFIED" };
size_t sizeofArray = sizeof(dnn_selection_modeArray) / sizeof(dnn_selection_modeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(dnn_selection_mode, dnn_selection_modeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(dnn_selection_mode);
}
cJSON *OpenAPI_dnn_selection_mode_convertToJSON(OpenAPI_dnn_selection_mode_t *dnn_selection_mode)
{
cJSON *item = NULL;
if (dnn_selection_mode == NULL) {
ogs_error("OpenAPI_dnn_selection_mode_convertToJSON() failed [DnnSelectionMode]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_dnn_selection_mode_t *OpenAPI_dnn_selection_mode_parseFromJSON(cJSON *dnn_selection_modeJSON)
{
OpenAPI_dnn_selection_mode_t *dnn_selection_mode_local_var = NULL;
dnn_selection_mode_local_var = OpenAPI_dnn_selection_mode_create (
);
return dnn_selection_mode_local_var;
end:
return NULL;
}
OpenAPI_dnn_selection_mode_t *OpenAPI_dnn_selection_mode_copy(OpenAPI_dnn_selection_mode_t *dst, OpenAPI_dnn_selection_mode_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_dnn_selection_mode_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_dnn_selection_mode_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_dnn_selection_mode_free(dst);
dst = OpenAPI_dnn_selection_mode_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* dnn_selection_mode.h
*
* Possible values are - VERIFIED - UE_DNN_NOT_VERIFIED - NW_DNN_NOT_VERIFIED
*
*/
#ifndef _OpenAPI_dnn_selection_mode_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_dnn_selection_mode_s OpenAPI_dnn_selection_mode_t;
typedef struct OpenAPI_dnn_selection_mode_s {
} OpenAPI_dnn_selection_mode_t;
typedef enum { OpenAPI_dnn_selection_mode_NULL = 0, OpenAPI_dnn_selection_mode_VERIFIED, OpenAPI_dnn_selection_mode_UE_DNN_NOT_VERIFIED, OpenAPI_dnn_selection_mode_NW_DNN_NOT_VERIFIED } OpenAPI_dnn_selection_mode_e;
OpenAPI_dnn_selection_mode_t *OpenAPI_dnn_selection_mode_create(
);
void OpenAPI_dnn_selection_mode_free(OpenAPI_dnn_selection_mode_t *dnn_selection_mode);
OpenAPI_dnn_selection_mode_t *OpenAPI_dnn_selection_mode_parseFromJSON(cJSON *dnn_selection_modeJSON);
cJSON *OpenAPI_dnn_selection_mode_convertToJSON(OpenAPI_dnn_selection_mode_t *dnn_selection_mode);
OpenAPI_dnn_selection_mode_t *OpenAPI_dnn_selection_mode_copy(OpenAPI_dnn_selection_mode_t *dst, OpenAPI_dnn_selection_mode_t *src);
char* OpenAPI_dnn_selection_mode_ToString(OpenAPI_dnn_selection_mode_e dnn_selection_mode);
OpenAPI_dnn_selection_mode_e OpenAPI_dnn_selection_mode_FromString(char* dnn_selection_mode);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "eps_interworking_indication.h"
OpenAPI_eps_interworking_indication_t *OpenAPI_eps_interworking_indication_create(
)
char* OpenAPI_eps_interworking_indication_ToString(OpenAPI_eps_interworking_indication_e eps_interworking_indication)
{
OpenAPI_eps_interworking_indication_t *eps_interworking_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_eps_interworking_indication_t));
if (!eps_interworking_indication_local_var) {
return NULL;
}
return eps_interworking_indication_local_var;
const char *eps_interworking_indicationArray[] = { "NULL", "NONE", "WITH_N26", "WITHOUT_N26", "IWK_NON_3GPP" };
size_t sizeofArray = sizeof(eps_interworking_indicationArray) / sizeof(eps_interworking_indicationArray[0]);
if (eps_interworking_indication < sizeofArray)
return (char *)eps_interworking_indicationArray[eps_interworking_indication];
else
return (char *)"Unknown";
}
void OpenAPI_eps_interworking_indication_free(OpenAPI_eps_interworking_indication_t *eps_interworking_indication)
OpenAPI_eps_interworking_indication_e OpenAPI_eps_interworking_indication_FromString(char* eps_interworking_indication)
{
if (NULL == eps_interworking_indication) {
return;
int stringToReturn = 0;
const char *eps_interworking_indicationArray[] = { "NULL", "NONE", "WITH_N26", "WITHOUT_N26", "IWK_NON_3GPP" };
size_t sizeofArray = sizeof(eps_interworking_indicationArray) / sizeof(eps_interworking_indicationArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(eps_interworking_indication, eps_interworking_indicationArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(eps_interworking_indication);
}
cJSON *OpenAPI_eps_interworking_indication_convertToJSON(OpenAPI_eps_interworking_indication_t *eps_interworking_indication)
{
cJSON *item = NULL;
if (eps_interworking_indication == NULL) {
ogs_error("OpenAPI_eps_interworking_indication_convertToJSON() failed [EpsInterworkingIndication]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_eps_interworking_indication_t *OpenAPI_eps_interworking_indication_parseFromJSON(cJSON *eps_interworking_indicationJSON)
{
OpenAPI_eps_interworking_indication_t *eps_interworking_indication_local_var = NULL;
eps_interworking_indication_local_var = OpenAPI_eps_interworking_indication_create (
);
return eps_interworking_indication_local_var;
end:
return NULL;
}
OpenAPI_eps_interworking_indication_t *OpenAPI_eps_interworking_indication_copy(OpenAPI_eps_interworking_indication_t *dst, OpenAPI_eps_interworking_indication_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_eps_interworking_indication_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_eps_interworking_indication_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_eps_interworking_indication_free(dst);
dst = OpenAPI_eps_interworking_indication_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* eps_interworking_indication.h
*
* Possible values are - NONE - WITH_N26 - WITHOUT_N26 - IWK_NON_3GPP
*
*/
#ifndef _OpenAPI_eps_interworking_indication_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_eps_interworking_indication_s OpenAPI_eps_interworking_indication_t;
typedef struct OpenAPI_eps_interworking_indication_s {
} OpenAPI_eps_interworking_indication_t;
typedef enum { OpenAPI_eps_interworking_indication_NULL = 0, OpenAPI_eps_interworking_indication_NONE, OpenAPI_eps_interworking_indication_WITH_N26, OpenAPI_eps_interworking_indication_WITHOUT_N26, OpenAPI_eps_interworking_indication_IWK_NON_3GPP } OpenAPI_eps_interworking_indication_e;
OpenAPI_eps_interworking_indication_t *OpenAPI_eps_interworking_indication_create(
);
void OpenAPI_eps_interworking_indication_free(OpenAPI_eps_interworking_indication_t *eps_interworking_indication);
OpenAPI_eps_interworking_indication_t *OpenAPI_eps_interworking_indication_parseFromJSON(cJSON *eps_interworking_indicationJSON);
cJSON *OpenAPI_eps_interworking_indication_convertToJSON(OpenAPI_eps_interworking_indication_t *eps_interworking_indication);
OpenAPI_eps_interworking_indication_t *OpenAPI_eps_interworking_indication_copy(OpenAPI_eps_interworking_indication_t *dst, OpenAPI_eps_interworking_indication_t *src);
char* OpenAPI_eps_interworking_indication_ToString(OpenAPI_eps_interworking_indication_e eps_interworking_indication);
OpenAPI_eps_interworking_indication_e OpenAPI_eps_interworking_indication_FromString(char* eps_interworking_indication);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "ho_state.h"
OpenAPI_ho_state_t *OpenAPI_ho_state_create(
)
char* OpenAPI_ho_state_ToString(OpenAPI_ho_state_e ho_state)
{
OpenAPI_ho_state_t *ho_state_local_var = OpenAPI_malloc(sizeof(OpenAPI_ho_state_t));
if (!ho_state_local_var) {
return NULL;
}
return ho_state_local_var;
const char *ho_stateArray[] = { "NULL", "NONE", "PREPARING", "PREPARED", "COMPLETED", "CANCELLED" };
size_t sizeofArray = sizeof(ho_stateArray) / sizeof(ho_stateArray[0]);
if (ho_state < sizeofArray)
return (char *)ho_stateArray[ho_state];
else
return (char *)"Unknown";
}
void OpenAPI_ho_state_free(OpenAPI_ho_state_t *ho_state)
OpenAPI_ho_state_e OpenAPI_ho_state_FromString(char* ho_state)
{
if (NULL == ho_state) {
return;
int stringToReturn = 0;
const char *ho_stateArray[] = { "NULL", "NONE", "PREPARING", "PREPARED", "COMPLETED", "CANCELLED" };
size_t sizeofArray = sizeof(ho_stateArray) / sizeof(ho_stateArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(ho_state, ho_stateArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(ho_state);
}
cJSON *OpenAPI_ho_state_convertToJSON(OpenAPI_ho_state_t *ho_state)
{
cJSON *item = NULL;
if (ho_state == NULL) {
ogs_error("OpenAPI_ho_state_convertToJSON() failed [HoState]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_ho_state_t *OpenAPI_ho_state_parseFromJSON(cJSON *ho_stateJSON)
{
OpenAPI_ho_state_t *ho_state_local_var = NULL;
ho_state_local_var = OpenAPI_ho_state_create (
);
return ho_state_local_var;
end:
return NULL;
}
OpenAPI_ho_state_t *OpenAPI_ho_state_copy(OpenAPI_ho_state_t *dst, OpenAPI_ho_state_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_ho_state_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_ho_state_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_ho_state_free(dst);
dst = OpenAPI_ho_state_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* ho_state.h
*
* Possible values are - NONE - PREPARING - PREPARED - COMPLETED - CANCELLED
*
*/
#ifndef _OpenAPI_ho_state_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_ho_state_s OpenAPI_ho_state_t;
typedef struct OpenAPI_ho_state_s {
} OpenAPI_ho_state_t;
typedef enum { OpenAPI_ho_state_NULL = 0, OpenAPI_ho_state_NONE, OpenAPI_ho_state_PREPARING, OpenAPI_ho_state_PREPARED, OpenAPI_ho_state_COMPLETED, OpenAPI_ho_state_CANCELLED } OpenAPI_ho_state_e;
OpenAPI_ho_state_t *OpenAPI_ho_state_create(
);
void OpenAPI_ho_state_free(OpenAPI_ho_state_t *ho_state);
OpenAPI_ho_state_t *OpenAPI_ho_state_parseFromJSON(cJSON *ho_stateJSON);
cJSON *OpenAPI_ho_state_convertToJSON(OpenAPI_ho_state_t *ho_state);
OpenAPI_ho_state_t *OpenAPI_ho_state_copy(OpenAPI_ho_state_t *dst, OpenAPI_ho_state_t *src);
char* OpenAPI_ho_state_ToString(OpenAPI_ho_state_e ho_state);
OpenAPI_ho_state_e OpenAPI_ho_state_FromString(char* ho_state);
#ifdef __cplusplus
}

View File

@ -5,7 +5,7 @@
#include "hsmf_update_data.h"
OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_create(
OpenAPI_request_indication_t *request_indication,
OpenAPI_request_indication_e request_indication,
char *pei,
OpenAPI_tunnel_info_t *vcn_tunnel_info,
OpenAPI_tunnel_info_t *icn_tunnel_info,
@ -27,18 +27,18 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_create(
OpenAPI_list_t *eps_bearer_id,
int ho_preparation_indication,
OpenAPI_list_t *revoke_ebi_list,
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
int always_on_requested,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
OpenAPI_list_t *secondary_rat_usage_report,
OpenAPI_list_t *secondary_rat_usage_info,
int an_type_can_be_changed,
OpenAPI_ma_release_indication_t *ma_release_ind,
OpenAPI_ma_release_indication_e ma_release_ind,
int ma_nw_upgrade_ind,
int ma_request_ind,
OpenAPI_unavailable_access_indication_t *unavailable_access_ind,
OpenAPI_unavailable_access_indication_e unavailable_access_ind,
OpenAPI_list_t *psa_info,
OpenAPI_ulcl_bp_information_t *ulcl_bp_info,
OpenAPI_n4_information_t *n4_info,
@ -127,7 +127,6 @@ void OpenAPI_hsmf_update_data_free(OpenAPI_hsmf_update_data_t *hsmf_update_data)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_request_indication_free(hsmf_update_data->request_indication);
ogs_free(hsmf_update_data->pei);
OpenAPI_tunnel_info_free(hsmf_update_data->vcn_tunnel_info);
OpenAPI_tunnel_info_free(hsmf_update_data->icn_tunnel_info);
@ -158,9 +157,7 @@ void OpenAPI_hsmf_update_data_free(OpenAPI_hsmf_update_data_t *hsmf_update_data)
ogs_free(node->data);
}
OpenAPI_list_free(hsmf_update_data->revoke_ebi_list);
OpenAPI_cause_free(hsmf_update_data->cause);
OpenAPI_ng_ap_cause_free(hsmf_update_data->ng_ap_cause);
OpenAPI_eps_interworking_indication_free(hsmf_update_data->eps_interworking_ind);
OpenAPI_list_for_each(hsmf_update_data->secondary_rat_usage_report, node) {
OpenAPI_secondary_rat_usage_report_free(node->data);
}
@ -169,8 +166,6 @@ void OpenAPI_hsmf_update_data_free(OpenAPI_hsmf_update_data_t *hsmf_update_data)
OpenAPI_secondary_rat_usage_info_free(node->data);
}
OpenAPI_list_free(hsmf_update_data->secondary_rat_usage_info);
OpenAPI_ma_release_indication_free(hsmf_update_data->ma_release_ind);
OpenAPI_unavailable_access_indication_free(hsmf_update_data->unavailable_access_ind);
OpenAPI_list_for_each(hsmf_update_data->psa_info, node) {
OpenAPI_psa_information_free(node->data);
}
@ -212,13 +207,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [request_indication]");
goto end;
}
cJSON *request_indication_local_JSON = OpenAPI_request_indication_convertToJSON(hsmf_update_data->request_indication);
if (request_indication_local_JSON == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [request_indication]");
goto end;
}
cJSON_AddItemToObject(item, "requestIndication", request_indication_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "requestIndication", OpenAPI_request_indication_ToString(hsmf_update_data->request_indication)) == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [request_indication]");
goto end;
}
@ -476,13 +465,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u
}
if (hsmf_update_data->cause) {
cJSON *cause_local_JSON = OpenAPI_cause_convertToJSON(hsmf_update_data->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(hsmf_update_data->cause)) == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [cause]");
goto end;
}
@ -516,13 +499,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u
}
if (hsmf_update_data->eps_interworking_ind) {
cJSON *eps_interworking_ind_local_JSON = OpenAPI_eps_interworking_indication_convertToJSON(hsmf_update_data->eps_interworking_ind);
if (eps_interworking_ind_local_JSON == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInd", eps_interworking_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(hsmf_update_data->eps_interworking_ind)) == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
@ -576,13 +553,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u
}
if (hsmf_update_data->ma_release_ind) {
cJSON *ma_release_ind_local_JSON = OpenAPI_ma_release_indication_convertToJSON(hsmf_update_data->ma_release_ind);
if (ma_release_ind_local_JSON == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [ma_release_ind]");
goto end;
}
cJSON_AddItemToObject(item, "maReleaseInd", ma_release_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "maReleaseInd", OpenAPI_ma_release_indication_ToString(hsmf_update_data->ma_release_ind)) == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [ma_release_ind]");
goto end;
}
@ -603,13 +574,7 @@ cJSON *OpenAPI_hsmf_update_data_convertToJSON(OpenAPI_hsmf_update_data_t *hsmf_u
}
if (hsmf_update_data->unavailable_access_ind) {
cJSON *unavailable_access_ind_local_JSON = OpenAPI_unavailable_access_indication_convertToJSON(hsmf_update_data->unavailable_access_ind);
if (unavailable_access_ind_local_JSON == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [unavailable_access_ind]");
goto end;
}
cJSON_AddItemToObject(item, "unavailableAccessInd", unavailable_access_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "unavailableAccessInd", OpenAPI_unavailable_access_indication_ToString(hsmf_update_data->unavailable_access_ind)) == NULL) {
ogs_error("OpenAPI_hsmf_update_data_convertToJSON() failed [unavailable_access_ind]");
goto end;
}
@ -837,9 +802,13 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u
goto end;
}
OpenAPI_request_indication_t *request_indication_local_nonprim = NULL;
OpenAPI_request_indication_e request_indicationVariable;
request_indication_local_nonprim = OpenAPI_request_indication_parseFromJSON(request_indication);
if (!cJSON_IsString(request_indication)) {
ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [request_indication]");
goto end;
}
request_indicationVariable = OpenAPI_request_indication_FromString(request_indication->valuestring);
cJSON *pei = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "pei");
@ -1086,9 +1055,13 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u
cJSON *cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "cause");
OpenAPI_cause_t *cause_local_nonprim = NULL;
OpenAPI_cause_e causeVariable;
if (cause) {
cause_local_nonprim = OpenAPI_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_cause_FromString(cause->valuestring);
}
cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "ngApCause");
@ -1118,9 +1091,13 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u
cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "epsInterworkingInd");
OpenAPI_eps_interworking_indication_t *eps_interworking_ind_local_nonprim = NULL;
OpenAPI_eps_interworking_indication_e eps_interworking_indVariable;
if (eps_interworking_ind) {
eps_interworking_ind_local_nonprim = OpenAPI_eps_interworking_indication_parseFromJSON(eps_interworking_ind);
if (!cJSON_IsString(eps_interworking_ind)) {
ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [eps_interworking_ind]");
goto end;
}
eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring);
}
cJSON *secondary_rat_usage_report = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "secondaryRatUsageReport");
@ -1180,9 +1157,13 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u
cJSON *ma_release_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maReleaseInd");
OpenAPI_ma_release_indication_t *ma_release_ind_local_nonprim = NULL;
OpenAPI_ma_release_indication_e ma_release_indVariable;
if (ma_release_ind) {
ma_release_ind_local_nonprim = OpenAPI_ma_release_indication_parseFromJSON(ma_release_ind);
if (!cJSON_IsString(ma_release_ind)) {
ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [ma_release_ind]");
goto end;
}
ma_release_indVariable = OpenAPI_ma_release_indication_FromString(ma_release_ind->valuestring);
}
cJSON *ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "maNwUpgradeInd");
@ -1205,9 +1186,13 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u
cJSON *unavailable_access_ind = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "unavailableAccessInd");
OpenAPI_unavailable_access_indication_t *unavailable_access_ind_local_nonprim = NULL;
OpenAPI_unavailable_access_indication_e unavailable_access_indVariable;
if (unavailable_access_ind) {
unavailable_access_ind_local_nonprim = OpenAPI_unavailable_access_indication_parseFromJSON(unavailable_access_ind);
if (!cJSON_IsString(unavailable_access_ind)) {
ogs_error("OpenAPI_hsmf_update_data_parseFromJSON() failed [unavailable_access_ind]");
goto end;
}
unavailable_access_indVariable = OpenAPI_unavailable_access_indication_FromString(unavailable_access_ind->valuestring);
}
cJSON *psa_info = cJSON_GetObjectItemCaseSensitive(hsmf_update_dataJSON, "psaInfo");
@ -1389,7 +1374,7 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u
}
hsmf_update_data_local_var = OpenAPI_hsmf_update_data_create (
request_indication_local_nonprim,
request_indicationVariable,
pei ? ogs_strdup(pei->valuestring) : NULL,
vcn_tunnel_info ? vcn_tunnel_info_local_nonprim : NULL,
icn_tunnel_info ? icn_tunnel_info_local_nonprim : NULL,
@ -1411,18 +1396,18 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_parseFromJSON(cJSON *hsmf_u
eps_bearer_id ? eps_bearer_idList : NULL,
ho_preparation_indication ? ho_preparation_indication->valueint : 0,
revoke_ebi_list ? revoke_ebi_listList : NULL,
cause ? cause_local_nonprim : NULL,
cause ? causeVariable : 0,
ng_ap_cause ? ng_ap_cause_local_nonprim : NULL,
_5g_mm_cause_value ? _5g_mm_cause_value->valuedouble : 0,
always_on_requested ? always_on_requested->valueint : 0,
eps_interworking_ind ? eps_interworking_ind_local_nonprim : NULL,
eps_interworking_ind ? eps_interworking_indVariable : 0,
secondary_rat_usage_report ? secondary_rat_usage_reportList : NULL,
secondary_rat_usage_info ? secondary_rat_usage_infoList : NULL,
an_type_can_be_changed ? an_type_can_be_changed->valueint : 0,
ma_release_ind ? ma_release_ind_local_nonprim : NULL,
ma_release_ind ? ma_release_indVariable : 0,
ma_nw_upgrade_ind ? ma_nw_upgrade_ind->valueint : 0,
ma_request_ind ? ma_request_ind->valueint : 0,
unavailable_access_ind ? unavailable_access_ind_local_nonprim : NULL,
unavailable_access_ind ? unavailable_access_indVariable : 0,
psa_info ? psa_infoList : NULL,
ulcl_bp_info ? ulcl_bp_info_local_nonprim : NULL,
n4_info ? n4_info_local_nonprim : NULL,

View File

@ -44,7 +44,7 @@ extern "C" {
typedef struct OpenAPI_hsmf_update_data_s OpenAPI_hsmf_update_data_t;
typedef struct OpenAPI_hsmf_update_data_s {
struct OpenAPI_request_indication_s *request_indication;
OpenAPI_request_indication_e request_indication;
char *pei;
struct OpenAPI_tunnel_info_s *vcn_tunnel_info;
struct OpenAPI_tunnel_info_s *icn_tunnel_info;
@ -66,18 +66,18 @@ typedef struct OpenAPI_hsmf_update_data_s {
OpenAPI_list_t *eps_bearer_id;
int ho_preparation_indication;
OpenAPI_list_t *revoke_ebi_list;
struct OpenAPI_cause_s *cause;
OpenAPI_cause_e cause;
struct OpenAPI_ng_ap_cause_s *ng_ap_cause;
int _5g_mm_cause_value;
int always_on_requested;
struct OpenAPI_eps_interworking_indication_s *eps_interworking_ind;
OpenAPI_eps_interworking_indication_e eps_interworking_ind;
OpenAPI_list_t *secondary_rat_usage_report;
OpenAPI_list_t *secondary_rat_usage_info;
int an_type_can_be_changed;
struct OpenAPI_ma_release_indication_s *ma_release_ind;
OpenAPI_ma_release_indication_e ma_release_ind;
int ma_nw_upgrade_ind;
int ma_request_ind;
struct OpenAPI_unavailable_access_indication_s *unavailable_access_ind;
OpenAPI_unavailable_access_indication_e unavailable_access_ind;
OpenAPI_list_t *psa_info;
struct OpenAPI_ulcl_bp_information_s *ulcl_bp_info;
struct OpenAPI_n4_information_s *n4_info;
@ -100,7 +100,7 @@ typedef struct OpenAPI_hsmf_update_data_s {
} OpenAPI_hsmf_update_data_t;
OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_create(
OpenAPI_request_indication_t *request_indication,
OpenAPI_request_indication_e request_indication,
char *pei,
OpenAPI_tunnel_info_t *vcn_tunnel_info,
OpenAPI_tunnel_info_t *icn_tunnel_info,
@ -122,18 +122,18 @@ OpenAPI_hsmf_update_data_t *OpenAPI_hsmf_update_data_create(
OpenAPI_list_t *eps_bearer_id,
int ho_preparation_indication,
OpenAPI_list_t *revoke_ebi_list,
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
int always_on_requested,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
OpenAPI_list_t *secondary_rat_usage_report,
OpenAPI_list_t *secondary_rat_usage_info,
int an_type_can_be_changed,
OpenAPI_ma_release_indication_t *ma_release_ind,
OpenAPI_ma_release_indication_e ma_release_ind,
int ma_nw_upgrade_ind,
int ma_request_ind,
OpenAPI_unavailable_access_indication_t *unavailable_access_ind,
OpenAPI_unavailable_access_indication_e unavailable_access_ind,
OpenAPI_list_t *psa_info,
OpenAPI_ulcl_bp_information_t *ulcl_bp_info,
OpenAPI_n4_information_t *n4_info,

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "ma_release_indication.h"
OpenAPI_ma_release_indication_t *OpenAPI_ma_release_indication_create(
)
char* OpenAPI_ma_release_indication_ToString(OpenAPI_ma_release_indication_e ma_release_indication)
{
OpenAPI_ma_release_indication_t *ma_release_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_ma_release_indication_t));
if (!ma_release_indication_local_var) {
return NULL;
}
return ma_release_indication_local_var;
const char *ma_release_indicationArray[] = { "NULL", "REL_MAPDU_OVER_3GPP", "REL_MAPDU_OVER_N3GPP" };
size_t sizeofArray = sizeof(ma_release_indicationArray) / sizeof(ma_release_indicationArray[0]);
if (ma_release_indication < sizeofArray)
return (char *)ma_release_indicationArray[ma_release_indication];
else
return (char *)"Unknown";
}
void OpenAPI_ma_release_indication_free(OpenAPI_ma_release_indication_t *ma_release_indication)
OpenAPI_ma_release_indication_e OpenAPI_ma_release_indication_FromString(char* ma_release_indication)
{
if (NULL == ma_release_indication) {
return;
int stringToReturn = 0;
const char *ma_release_indicationArray[] = { "NULL", "REL_MAPDU_OVER_3GPP", "REL_MAPDU_OVER_N3GPP" };
size_t sizeofArray = sizeof(ma_release_indicationArray) / sizeof(ma_release_indicationArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(ma_release_indication, ma_release_indicationArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(ma_release_indication);
}
cJSON *OpenAPI_ma_release_indication_convertToJSON(OpenAPI_ma_release_indication_t *ma_release_indication)
{
cJSON *item = NULL;
if (ma_release_indication == NULL) {
ogs_error("OpenAPI_ma_release_indication_convertToJSON() failed [MaReleaseIndication]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_ma_release_indication_t *OpenAPI_ma_release_indication_parseFromJSON(cJSON *ma_release_indicationJSON)
{
OpenAPI_ma_release_indication_t *ma_release_indication_local_var = NULL;
ma_release_indication_local_var = OpenAPI_ma_release_indication_create (
);
return ma_release_indication_local_var;
end:
return NULL;
}
OpenAPI_ma_release_indication_t *OpenAPI_ma_release_indication_copy(OpenAPI_ma_release_indication_t *dst, OpenAPI_ma_release_indication_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_ma_release_indication_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_ma_release_indication_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_ma_release_indication_free(dst);
dst = OpenAPI_ma_release_indication_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* ma_release_indication.h
*
* Possible values are - REL_MAPDU_OVER_3GPP - REL_MAPDU_OVER_N3GPP
*
*/
#ifndef _OpenAPI_ma_release_indication_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_ma_release_indication_s OpenAPI_ma_release_indication_t;
typedef struct OpenAPI_ma_release_indication_s {
} OpenAPI_ma_release_indication_t;
typedef enum { OpenAPI_ma_release_indication_NULL = 0, OpenAPI_ma_release_indication_REL_MAPDU_OVER_3GPP, OpenAPI_ma_release_indication_REL_MAPDU_OVER_N3GPP } OpenAPI_ma_release_indication_e;
OpenAPI_ma_release_indication_t *OpenAPI_ma_release_indication_create(
);
void OpenAPI_ma_release_indication_free(OpenAPI_ma_release_indication_t *ma_release_indication);
OpenAPI_ma_release_indication_t *OpenAPI_ma_release_indication_parseFromJSON(cJSON *ma_release_indicationJSON);
cJSON *OpenAPI_ma_release_indication_convertToJSON(OpenAPI_ma_release_indication_t *ma_release_indication);
OpenAPI_ma_release_indication_t *OpenAPI_ma_release_indication_copy(OpenAPI_ma_release_indication_t *dst, OpenAPI_ma_release_indication_t *src);
char* OpenAPI_ma_release_indication_ToString(OpenAPI_ma_release_indication_e ma_release_indication);
OpenAPI_ma_release_indication_e OpenAPI_ma_release_indication_FromString(char* ma_release_indication);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "max_integrity_protected_data_rate.h"
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_create(
)
char* OpenAPI_max_integrity_protected_data_rate_ToString(OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate)
{
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate_local_var = OpenAPI_malloc(sizeof(OpenAPI_max_integrity_protected_data_rate_t));
if (!max_integrity_protected_data_rate_local_var) {
return NULL;
}
return max_integrity_protected_data_rate_local_var;
const char *max_integrity_protected_data_rateArray[] = { "NULL", "_64_KBPS", "MAX_UE_RATE" };
size_t sizeofArray = sizeof(max_integrity_protected_data_rateArray) / sizeof(max_integrity_protected_data_rateArray[0]);
if (max_integrity_protected_data_rate < sizeofArray)
return (char *)max_integrity_protected_data_rateArray[max_integrity_protected_data_rate];
else
return (char *)"Unknown";
}
void OpenAPI_max_integrity_protected_data_rate_free(OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate)
OpenAPI_max_integrity_protected_data_rate_e OpenAPI_max_integrity_protected_data_rate_FromString(char* max_integrity_protected_data_rate)
{
if (NULL == max_integrity_protected_data_rate) {
return;
int stringToReturn = 0;
const char *max_integrity_protected_data_rateArray[] = { "NULL", "_64_KBPS", "MAX_UE_RATE" };
size_t sizeofArray = sizeof(max_integrity_protected_data_rateArray) / sizeof(max_integrity_protected_data_rateArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(max_integrity_protected_data_rate, max_integrity_protected_data_rateArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(max_integrity_protected_data_rate);
}
cJSON *OpenAPI_max_integrity_protected_data_rate_convertToJSON(OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate)
{
cJSON *item = NULL;
if (max_integrity_protected_data_rate == NULL) {
ogs_error("OpenAPI_max_integrity_protected_data_rate_convertToJSON() failed [MaxIntegrityProtectedDataRate]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_parseFromJSON(cJSON *max_integrity_protected_data_rateJSON)
{
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate_local_var = NULL;
max_integrity_protected_data_rate_local_var = OpenAPI_max_integrity_protected_data_rate_create (
);
return max_integrity_protected_data_rate_local_var;
end:
return NULL;
}
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_copy(OpenAPI_max_integrity_protected_data_rate_t *dst, OpenAPI_max_integrity_protected_data_rate_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_max_integrity_protected_data_rate_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_max_integrity_protected_data_rate_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_max_integrity_protected_data_rate_free(dst);
dst = OpenAPI_max_integrity_protected_data_rate_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* max_integrity_protected_data_rate.h
*
* Possible values are - 64_KBPS - MAX_UE_RATE
*
*/
#ifndef _OpenAPI_max_integrity_protected_data_rate_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_max_integrity_protected_data_rate_s OpenAPI_max_integrity_protected_data_rate_t;
typedef struct OpenAPI_max_integrity_protected_data_rate_s {
} OpenAPI_max_integrity_protected_data_rate_t;
typedef enum { OpenAPI_max_integrity_protected_data_rate_NULL = 0, OpenAPI_max_integrity_protected_data_rate__64_KBPS, OpenAPI_max_integrity_protected_data_rate_MAX_UE_RATE } OpenAPI_max_integrity_protected_data_rate_e;
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_create(
);
void OpenAPI_max_integrity_protected_data_rate_free(OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate);
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_parseFromJSON(cJSON *max_integrity_protected_data_rateJSON);
cJSON *OpenAPI_max_integrity_protected_data_rate_convertToJSON(OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate);
OpenAPI_max_integrity_protected_data_rate_t *OpenAPI_max_integrity_protected_data_rate_copy(OpenAPI_max_integrity_protected_data_rate_t *dst, OpenAPI_max_integrity_protected_data_rate_t *src);
char* OpenAPI_max_integrity_protected_data_rate_ToString(OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate);
OpenAPI_max_integrity_protected_data_rate_e OpenAPI_max_integrity_protected_data_rate_FromString(char* max_integrity_protected_data_rate);
#ifdef __cplusplus
}

View File

@ -5,7 +5,7 @@
#include "n4_information.h"
OpenAPI_n4_information_t *OpenAPI_n4_information_create(
OpenAPI_n4_message_type_t *n4_message_type,
OpenAPI_n4_message_type_e n4_message_type,
OpenAPI_ref_to_binary_data_t *n4_message_payload,
OpenAPI_dnai_information_t *n4_dnai_info
)
@ -27,7 +27,6 @@ void OpenAPI_n4_information_free(OpenAPI_n4_information_t *n4_information)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_n4_message_type_free(n4_information->n4_message_type);
OpenAPI_ref_to_binary_data_free(n4_information->n4_message_payload);
OpenAPI_dnai_information_free(n4_information->n4_dnai_info);
ogs_free(n4_information);
@ -47,13 +46,7 @@ cJSON *OpenAPI_n4_information_convertToJSON(OpenAPI_n4_information_t *n4_informa
ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_type]");
goto end;
}
cJSON *n4_message_type_local_JSON = OpenAPI_n4_message_type_convertToJSON(n4_information->n4_message_type);
if (n4_message_type_local_JSON == NULL) {
ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_type]");
goto end;
}
cJSON_AddItemToObject(item, "n4MessageType", n4_message_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "n4MessageType", OpenAPI_n4_message_type_ToString(n4_information->n4_message_type)) == NULL) {
ogs_error("OpenAPI_n4_information_convertToJSON() failed [n4_message_type]");
goto end;
}
@ -99,9 +92,13 @@ OpenAPI_n4_information_t *OpenAPI_n4_information_parseFromJSON(cJSON *n4_informa
goto end;
}
OpenAPI_n4_message_type_t *n4_message_type_local_nonprim = NULL;
OpenAPI_n4_message_type_e n4_message_typeVariable;
n4_message_type_local_nonprim = OpenAPI_n4_message_type_parseFromJSON(n4_message_type);
if (!cJSON_IsString(n4_message_type)) {
ogs_error("OpenAPI_n4_information_parseFromJSON() failed [n4_message_type]");
goto end;
}
n4_message_typeVariable = OpenAPI_n4_message_type_FromString(n4_message_type->valuestring);
cJSON *n4_message_payload = cJSON_GetObjectItemCaseSensitive(n4_informationJSON, "n4MessagePayload");
if (!n4_message_payload) {
@ -121,7 +118,7 @@ OpenAPI_n4_information_t *OpenAPI_n4_information_parseFromJSON(cJSON *n4_informa
}
n4_information_local_var = OpenAPI_n4_information_create (
n4_message_type_local_nonprim,
n4_message_typeVariable,
n4_message_payload_local_nonprim,
n4_dnai_info ? n4_dnai_info_local_nonprim : NULL
);

View File

@ -22,13 +22,13 @@ extern "C" {
typedef struct OpenAPI_n4_information_s OpenAPI_n4_information_t;
typedef struct OpenAPI_n4_information_s {
struct OpenAPI_n4_message_type_s *n4_message_type;
OpenAPI_n4_message_type_e n4_message_type;
struct OpenAPI_ref_to_binary_data_s *n4_message_payload;
struct OpenAPI_dnai_information_s *n4_dnai_info;
} OpenAPI_n4_information_t;
OpenAPI_n4_information_t *OpenAPI_n4_information_create(
OpenAPI_n4_message_type_t *n4_message_type,
OpenAPI_n4_message_type_e n4_message_type,
OpenAPI_ref_to_binary_data_t *n4_message_payload,
OpenAPI_dnai_information_t *n4_dnai_info
);

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "n4_message_type.h"
OpenAPI_n4_message_type_t *OpenAPI_n4_message_type_create(
)
char* OpenAPI_n4_message_type_ToString(OpenAPI_n4_message_type_e n4_message_type)
{
OpenAPI_n4_message_type_t *n4_message_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_n4_message_type_t));
if (!n4_message_type_local_var) {
return NULL;
}
return n4_message_type_local_var;
const char *n4_message_typeArray[] = { "NULL", "PFCP_SES_EST_REQ", "PFCP_SES_EST_RSP", "PFCP_SES_MOD_REQ", "PFCP_SES_MOD_RSP", "PFCP_SES_DEL_REQ", "PFCP_SES_DEL_RSP", "PFCP_SES_REP_REQ", "PFCP_SES_REP_RSP" };
size_t sizeofArray = sizeof(n4_message_typeArray) / sizeof(n4_message_typeArray[0]);
if (n4_message_type < sizeofArray)
return (char *)n4_message_typeArray[n4_message_type];
else
return (char *)"Unknown";
}
void OpenAPI_n4_message_type_free(OpenAPI_n4_message_type_t *n4_message_type)
OpenAPI_n4_message_type_e OpenAPI_n4_message_type_FromString(char* n4_message_type)
{
if (NULL == n4_message_type) {
return;
int stringToReturn = 0;
const char *n4_message_typeArray[] = { "NULL", "PFCP_SES_EST_REQ", "PFCP_SES_EST_RSP", "PFCP_SES_MOD_REQ", "PFCP_SES_MOD_RSP", "PFCP_SES_DEL_REQ", "PFCP_SES_DEL_RSP", "PFCP_SES_REP_REQ", "PFCP_SES_REP_RSP" };
size_t sizeofArray = sizeof(n4_message_typeArray) / sizeof(n4_message_typeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(n4_message_type, n4_message_typeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(n4_message_type);
}
cJSON *OpenAPI_n4_message_type_convertToJSON(OpenAPI_n4_message_type_t *n4_message_type)
{
cJSON *item = NULL;
if (n4_message_type == NULL) {
ogs_error("OpenAPI_n4_message_type_convertToJSON() failed [N4MessageType]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_n4_message_type_t *OpenAPI_n4_message_type_parseFromJSON(cJSON *n4_message_typeJSON)
{
OpenAPI_n4_message_type_t *n4_message_type_local_var = NULL;
n4_message_type_local_var = OpenAPI_n4_message_type_create (
);
return n4_message_type_local_var;
end:
return NULL;
}
OpenAPI_n4_message_type_t *OpenAPI_n4_message_type_copy(OpenAPI_n4_message_type_t *dst, OpenAPI_n4_message_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_n4_message_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_n4_message_type_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_n4_message_type_free(dst);
dst = OpenAPI_n4_message_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* n4_message_type.h
*
* Possible values are - PFCP_SES_EST_REQ - PFCP_SES_EST_RSP - PFCP_SES_MOD_REQ - PFCP_SES_MOD_RSP - PFCP_SES_DEL_REQ - PFCP_SES_DEL_RSP - PFCP_SES_REP_REQ - PFCP_SES_REP_RSP
*
*/
#ifndef _OpenAPI_n4_message_type_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_n4_message_type_s OpenAPI_n4_message_type_t;
typedef struct OpenAPI_n4_message_type_s {
} OpenAPI_n4_message_type_t;
typedef enum { OpenAPI_n4_message_type_NULL = 0, OpenAPI_n4_message_type_PFCP_SES_EST_REQ, OpenAPI_n4_message_type_PFCP_SES_EST_RSP, OpenAPI_n4_message_type_PFCP_SES_MOD_REQ, OpenAPI_n4_message_type_PFCP_SES_MOD_RSP, OpenAPI_n4_message_type_PFCP_SES_DEL_REQ, OpenAPI_n4_message_type_PFCP_SES_DEL_RSP, OpenAPI_n4_message_type_PFCP_SES_REP_REQ, OpenAPI_n4_message_type_PFCP_SES_REP_RSP } OpenAPI_n4_message_type_e;
OpenAPI_n4_message_type_t *OpenAPI_n4_message_type_create(
);
void OpenAPI_n4_message_type_free(OpenAPI_n4_message_type_t *n4_message_type);
OpenAPI_n4_message_type_t *OpenAPI_n4_message_type_parseFromJSON(cJSON *n4_message_typeJSON);
cJSON *OpenAPI_n4_message_type_convertToJSON(OpenAPI_n4_message_type_t *n4_message_type);
OpenAPI_n4_message_type_t *OpenAPI_n4_message_type_copy(OpenAPI_n4_message_type_t *dst, OpenAPI_n4_message_type_t *src);
char* OpenAPI_n4_message_type_ToString(OpenAPI_n4_message_type_e n4_message_type);
OpenAPI_n4_message_type_e OpenAPI_n4_message_type_FromString(char* n4_message_type);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "notification_cause.h"
OpenAPI_notification_cause_t *OpenAPI_notification_cause_create(
)
char* OpenAPI_notification_cause_ToString(OpenAPI_notification_cause_e notification_cause)
{
OpenAPI_notification_cause_t *notification_cause_local_var = OpenAPI_malloc(sizeof(OpenAPI_notification_cause_t));
if (!notification_cause_local_var) {
return NULL;
}
return notification_cause_local_var;
const char *notification_causeArray[] = { "NULL", "QOS_FULFILLED", "QOS_NOT_FULFILLED", "UP_SEC_FULFILLED", "UP_SEC_NOT_FULFILLED" };
size_t sizeofArray = sizeof(notification_causeArray) / sizeof(notification_causeArray[0]);
if (notification_cause < sizeofArray)
return (char *)notification_causeArray[notification_cause];
else
return (char *)"Unknown";
}
void OpenAPI_notification_cause_free(OpenAPI_notification_cause_t *notification_cause)
OpenAPI_notification_cause_e OpenAPI_notification_cause_FromString(char* notification_cause)
{
if (NULL == notification_cause) {
return;
int stringToReturn = 0;
const char *notification_causeArray[] = { "NULL", "QOS_FULFILLED", "QOS_NOT_FULFILLED", "UP_SEC_FULFILLED", "UP_SEC_NOT_FULFILLED" };
size_t sizeofArray = sizeof(notification_causeArray) / sizeof(notification_causeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(notification_cause, notification_causeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(notification_cause);
}
cJSON *OpenAPI_notification_cause_convertToJSON(OpenAPI_notification_cause_t *notification_cause)
{
cJSON *item = NULL;
if (notification_cause == NULL) {
ogs_error("OpenAPI_notification_cause_convertToJSON() failed [NotificationCause]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_notification_cause_t *OpenAPI_notification_cause_parseFromJSON(cJSON *notification_causeJSON)
{
OpenAPI_notification_cause_t *notification_cause_local_var = NULL;
notification_cause_local_var = OpenAPI_notification_cause_create (
);
return notification_cause_local_var;
end:
return NULL;
}
OpenAPI_notification_cause_t *OpenAPI_notification_cause_copy(OpenAPI_notification_cause_t *dst, OpenAPI_notification_cause_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_notification_cause_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_notification_cause_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_notification_cause_free(dst);
dst = OpenAPI_notification_cause_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* notification_cause.h
*
* Possible values are - QOS_FULFILLED - QOS_NOT_FULFILLED - UP_SEC_FULFILLED - UP_SEC_NOT_FULFILLED
*
*/
#ifndef _OpenAPI_notification_cause_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_notification_cause_s OpenAPI_notification_cause_t;
typedef struct OpenAPI_notification_cause_s {
} OpenAPI_notification_cause_t;
typedef enum { OpenAPI_notification_cause_NULL = 0, OpenAPI_notification_cause_QOS_FULFILLED, OpenAPI_notification_cause_QOS_NOT_FULFILLED, OpenAPI_notification_cause_UP_SEC_FULFILLED, OpenAPI_notification_cause_UP_SEC_NOT_FULFILLED } OpenAPI_notification_cause_e;
OpenAPI_notification_cause_t *OpenAPI_notification_cause_create(
);
void OpenAPI_notification_cause_free(OpenAPI_notification_cause_t *notification_cause);
OpenAPI_notification_cause_t *OpenAPI_notification_cause_parseFromJSON(cJSON *notification_causeJSON);
cJSON *OpenAPI_notification_cause_convertToJSON(OpenAPI_notification_cause_t *notification_cause);
OpenAPI_notification_cause_t *OpenAPI_notification_cause_copy(OpenAPI_notification_cause_t *dst, OpenAPI_notification_cause_t *src);
char* OpenAPI_notification_cause_ToString(OpenAPI_notification_cause_e notification_cause);
OpenAPI_notification_cause_e OpenAPI_notification_cause_FromString(char* notification_cause);
#ifdef __cplusplus
}

View File

@ -14,7 +14,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_create(
char *vsmf_id,
char *ismf_id,
OpenAPI_plmn_id_nid_t *serving_network,
OpenAPI_request_type_t *request_type,
OpenAPI_request_type_e request_type,
OpenAPI_list_t *eps_bearer_id,
char pgw_s8c_fteid,
char *vsmf_pdu_session_uri,
@ -38,11 +38,11 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_create(
char *pcf_group_id,
char *pcf_set_id,
int ho_preparation_indication,
OpenAPI_dnn_selection_mode_t *sel_mode,
OpenAPI_dnn_selection_mode_e sel_mode,
int always_on_requested,
char *udm_group_id,
char *routing_indicator,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
char *v_smf_service_instance_id,
char *i_smf_service_instance_id,
char *recovery_time,
@ -144,7 +144,6 @@ void OpenAPI_pdu_session_create_data_free(OpenAPI_pdu_session_create_data_t *pdu
ogs_free(pdu_session_create_data->vsmf_id);
ogs_free(pdu_session_create_data->ismf_id);
OpenAPI_plmn_id_nid_free(pdu_session_create_data->serving_network);
OpenAPI_request_type_free(pdu_session_create_data->request_type);
OpenAPI_list_for_each(pdu_session_create_data->eps_bearer_id, node) {
ogs_free(node->data);
}
@ -166,10 +165,8 @@ void OpenAPI_pdu_session_create_data_free(OpenAPI_pdu_session_create_data_t *pdu
ogs_free(pdu_session_create_data->pcf_id);
ogs_free(pdu_session_create_data->pcf_group_id);
ogs_free(pdu_session_create_data->pcf_set_id);
OpenAPI_dnn_selection_mode_free(pdu_session_create_data->sel_mode);
ogs_free(pdu_session_create_data->udm_group_id);
ogs_free(pdu_session_create_data->routing_indicator);
OpenAPI_eps_interworking_indication_free(pdu_session_create_data->eps_interworking_ind);
ogs_free(pdu_session_create_data->v_smf_service_instance_id);
ogs_free(pdu_session_create_data->i_smf_service_instance_id);
ogs_free(pdu_session_create_data->recovery_time);
@ -282,13 +279,7 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_
}
if (pdu_session_create_data->request_type) {
cJSON *request_type_local_JSON = OpenAPI_request_type_convertToJSON(pdu_session_create_data->request_type);
if (request_type_local_JSON == NULL) {
ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [request_type]");
goto end;
}
cJSON_AddItemToObject(item, "requestType", request_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "requestType", OpenAPI_request_type_ToString(pdu_session_create_data->request_type)) == NULL) {
ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [request_type]");
goto end;
}
@ -515,13 +506,7 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_
}
if (pdu_session_create_data->sel_mode) {
cJSON *sel_mode_local_JSON = OpenAPI_dnn_selection_mode_convertToJSON(pdu_session_create_data->sel_mode);
if (sel_mode_local_JSON == NULL) {
ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [sel_mode]");
goto end;
}
cJSON_AddItemToObject(item, "selMode", sel_mode_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "selMode", OpenAPI_dnn_selection_mode_ToString(pdu_session_create_data->sel_mode)) == NULL) {
ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [sel_mode]");
goto end;
}
@ -549,13 +534,7 @@ cJSON *OpenAPI_pdu_session_create_data_convertToJSON(OpenAPI_pdu_session_create_
}
if (pdu_session_create_data->eps_interworking_ind) {
cJSON *eps_interworking_ind_local_JSON = OpenAPI_eps_interworking_indication_convertToJSON(pdu_session_create_data->eps_interworking_ind);
if (eps_interworking_ind_local_JSON == NULL) {
ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInd", eps_interworking_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(pdu_session_create_data->eps_interworking_ind)) == NULL) {
ogs_error("OpenAPI_pdu_session_create_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
@ -845,9 +824,13 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON
cJSON *request_type = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "requestType");
OpenAPI_request_type_t *request_type_local_nonprim = NULL;
OpenAPI_request_type_e request_typeVariable;
if (request_type) {
request_type_local_nonprim = OpenAPI_request_type_parseFromJSON(request_type);
if (!cJSON_IsString(request_type)) {
ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [request_type]");
goto end;
}
request_typeVariable = OpenAPI_request_type_FromString(request_type->valuestring);
}
cJSON *eps_bearer_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsBearerId");
@ -1063,9 +1046,13 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON
cJSON *sel_mode = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "selMode");
OpenAPI_dnn_selection_mode_t *sel_mode_local_nonprim = NULL;
OpenAPI_dnn_selection_mode_e sel_modeVariable;
if (sel_mode) {
sel_mode_local_nonprim = OpenAPI_dnn_selection_mode_parseFromJSON(sel_mode);
if (!cJSON_IsString(sel_mode)) {
ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [sel_mode]");
goto end;
}
sel_modeVariable = OpenAPI_dnn_selection_mode_FromString(sel_mode->valuestring);
}
cJSON *always_on_requested = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "alwaysOnRequested");
@ -1097,9 +1084,13 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON
cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "epsInterworkingInd");
OpenAPI_eps_interworking_indication_t *eps_interworking_ind_local_nonprim = NULL;
OpenAPI_eps_interworking_indication_e eps_interworking_indVariable;
if (eps_interworking_ind) {
eps_interworking_ind_local_nonprim = OpenAPI_eps_interworking_indication_parseFromJSON(eps_interworking_ind);
if (!cJSON_IsString(eps_interworking_ind)) {
ogs_error("OpenAPI_pdu_session_create_data_parseFromJSON() failed [eps_interworking_ind]");
goto end;
}
eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring);
}
cJSON *v_smf_service_instance_id = cJSON_GetObjectItemCaseSensitive(pdu_session_create_dataJSON, "vSmfServiceInstanceId");
@ -1307,7 +1298,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON
vsmf_id ? ogs_strdup(vsmf_id->valuestring) : NULL,
ismf_id ? ogs_strdup(ismf_id->valuestring) : NULL,
serving_network_local_nonprim,
request_type ? request_type_local_nonprim : NULL,
request_type ? request_typeVariable : 0,
eps_bearer_id ? eps_bearer_idList : NULL,
pgw_s8c_fteid ? pgw_s8c_fteid->valueint : 0,
vsmf_pdu_session_uri ? ogs_strdup(vsmf_pdu_session_uri->valuestring) : NULL,
@ -1331,11 +1322,11 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_parseFromJSON
pcf_group_id ? ogs_strdup(pcf_group_id->valuestring) : NULL,
pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL,
ho_preparation_indication ? ho_preparation_indication->valueint : 0,
sel_mode ? sel_mode_local_nonprim : NULL,
sel_mode ? sel_modeVariable : 0,
always_on_requested ? always_on_requested->valueint : 0,
udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL,
routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL,
eps_interworking_ind ? eps_interworking_ind_local_nonprim : NULL,
eps_interworking_ind ? eps_interworking_indVariable : 0,
v_smf_service_instance_id ? ogs_strdup(v_smf_service_instance_id->valuestring) : NULL,
i_smf_service_instance_id ? ogs_strdup(i_smf_service_instance_id->valuestring) : NULL,
recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL,

View File

@ -44,7 +44,7 @@ typedef struct OpenAPI_pdu_session_create_data_s {
char *vsmf_id;
char *ismf_id;
struct OpenAPI_plmn_id_nid_s *serving_network;
struct OpenAPI_request_type_s *request_type;
OpenAPI_request_type_e request_type;
OpenAPI_list_t *eps_bearer_id;
char pgw_s8c_fteid;
char *vsmf_pdu_session_uri;
@ -68,11 +68,11 @@ typedef struct OpenAPI_pdu_session_create_data_s {
char *pcf_group_id;
char *pcf_set_id;
int ho_preparation_indication;
struct OpenAPI_dnn_selection_mode_s *sel_mode;
OpenAPI_dnn_selection_mode_e sel_mode;
int always_on_requested;
char *udm_group_id;
char *routing_indicator;
struct OpenAPI_eps_interworking_indication_s *eps_interworking_ind;
OpenAPI_eps_interworking_indication_e eps_interworking_ind;
char *v_smf_service_instance_id;
char *i_smf_service_instance_id;
char *recovery_time;
@ -105,7 +105,7 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_create(
char *vsmf_id,
char *ismf_id,
OpenAPI_plmn_id_nid_t *serving_network,
OpenAPI_request_type_t *request_type,
OpenAPI_request_type_e request_type,
OpenAPI_list_t *eps_bearer_id,
char pgw_s8c_fteid,
char *vsmf_pdu_session_uri,
@ -129,11 +129,11 @@ OpenAPI_pdu_session_create_data_t *OpenAPI_pdu_session_create_data_create(
char *pcf_group_id,
char *pcf_set_id,
int ho_preparation_indication,
OpenAPI_dnn_selection_mode_t *sel_mode,
OpenAPI_dnn_selection_mode_e sel_mode,
int always_on_requested,
char *udm_group_id,
char *routing_indicator,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
char *v_smf_service_instance_id,
char *i_smf_service_instance_id,
char *recovery_time,

View File

@ -23,7 +23,7 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_create(
OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info,
OpenAPI_list_t *eps_bearer_info,
char *supported_features,
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate,
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate,
int always_on_granted,
char *gpsi,
OpenAPI_up_security_t *up_security,
@ -104,7 +104,6 @@ void OpenAPI_pdu_session_created_data_free(OpenAPI_pdu_session_created_data_t *p
}
OpenAPI_list_free(pdu_session_created_data->eps_bearer_info);
ogs_free(pdu_session_created_data->supported_features);
OpenAPI_max_integrity_protected_data_rate_free(pdu_session_created_data->max_integrity_protected_data_rate);
ogs_free(pdu_session_created_data->gpsi);
OpenAPI_up_security_free(pdu_session_created_data->up_security);
OpenAPI_roaming_charging_profile_free(pdu_session_created_data->roaming_charging_profile);
@ -328,13 +327,7 @@ cJSON *OpenAPI_pdu_session_created_data_convertToJSON(OpenAPI_pdu_session_create
}
if (pdu_session_created_data->max_integrity_protected_data_rate) {
cJSON *max_integrity_protected_data_rate_local_JSON = OpenAPI_max_integrity_protected_data_rate_convertToJSON(pdu_session_created_data->max_integrity_protected_data_rate);
if (max_integrity_protected_data_rate_local_JSON == NULL) {
ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [max_integrity_protected_data_rate]");
goto end;
}
cJSON_AddItemToObject(item, "maxIntegrityProtectedDataRate", max_integrity_protected_data_rate_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRate", OpenAPI_max_integrity_protected_data_rate_ToString(pdu_session_created_data->max_integrity_protected_data_rate)) == NULL) {
ogs_error("OpenAPI_pdu_session_created_data_convertToJSON() failed [max_integrity_protected_data_rate]");
goto end;
}
@ -638,9 +631,13 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS
cJSON *max_integrity_protected_data_rate = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "maxIntegrityProtectedDataRate");
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate_local_nonprim = NULL;
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rateVariable;
if (max_integrity_protected_data_rate) {
max_integrity_protected_data_rate_local_nonprim = OpenAPI_max_integrity_protected_data_rate_parseFromJSON(max_integrity_protected_data_rate);
if (!cJSON_IsString(max_integrity_protected_data_rate)) {
ogs_error("OpenAPI_pdu_session_created_data_parseFromJSON() failed [max_integrity_protected_data_rate]");
goto end;
}
max_integrity_protected_data_rateVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate->valuestring);
}
cJSON *always_on_granted = cJSON_GetObjectItemCaseSensitive(pdu_session_created_dataJSON, "alwaysOnGranted");
@ -777,7 +774,7 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_parseFromJS
eps_pdn_cnx_info ? eps_pdn_cnx_info_local_nonprim : NULL,
eps_bearer_info ? eps_bearer_infoList : NULL,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
max_integrity_protected_data_rate ? max_integrity_protected_data_rate_local_nonprim : NULL,
max_integrity_protected_data_rate ? max_integrity_protected_data_rateVariable : 0,
always_on_granted ? always_on_granted->valueint : 0,
gpsi ? ogs_strdup(gpsi->valuestring) : NULL,
up_security ? up_security_local_nonprim : NULL,

View File

@ -48,7 +48,7 @@ typedef struct OpenAPI_pdu_session_created_data_s {
struct OpenAPI_eps_pdn_cnx_info_s *eps_pdn_cnx_info;
OpenAPI_list_t *eps_bearer_info;
char *supported_features;
struct OpenAPI_max_integrity_protected_data_rate_s *max_integrity_protected_data_rate;
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate;
int always_on_granted;
char *gpsi;
struct OpenAPI_up_security_s *up_security;
@ -82,7 +82,7 @@ OpenAPI_pdu_session_created_data_t *OpenAPI_pdu_session_created_data_create(
OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info,
OpenAPI_list_t *eps_bearer_info,
char *supported_features,
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate,
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate,
int always_on_granted,
char *gpsi,
OpenAPI_up_security_t *up_security,

View File

@ -5,7 +5,7 @@
#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_notification_cause_e notification_cause
)
{
OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_pdu_session_notify_item_t));
@ -23,7 +23,6 @@ void OpenAPI_pdu_session_notify_item_free(OpenAPI_pdu_session_notify_item_t *pdu
return;
}
OpenAPI_lnode_t *node;
OpenAPI_notification_cause_free(pdu_session_notify_item->notification_cause);
ogs_free(pdu_session_notify_item);
}
@ -41,13 +40,7 @@ cJSON *OpenAPI_pdu_session_notify_item_convertToJSON(OpenAPI_pdu_session_notify_
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) {
if (cJSON_AddStringToObject(item, "notificationCause", OpenAPI_notification_cause_ToString(pdu_session_notify_item->notification_cause)) == NULL) {
ogs_error("OpenAPI_pdu_session_notify_item_convertToJSON() failed [notification_cause]");
goto end;
}
@ -65,12 +58,16 @@ OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_parseFromJSON
goto end;
}
OpenAPI_notification_cause_t *notification_cause_local_nonprim = NULL;
OpenAPI_notification_cause_e notification_causeVariable;
notification_cause_local_nonprim = OpenAPI_notification_cause_parseFromJSON(notification_cause);
if (!cJSON_IsString(notification_cause)) {
ogs_error("OpenAPI_pdu_session_notify_item_parseFromJSON() failed [notification_cause]");
goto end;
}
notification_causeVariable = OpenAPI_notification_cause_FromString(notification_cause->valuestring);
pdu_session_notify_item_local_var = OpenAPI_pdu_session_notify_item_create (
notification_cause_local_nonprim
notification_causeVariable
);
return pdu_session_notify_item_local_var;

View File

@ -20,11 +20,11 @@ extern "C" {
typedef struct OpenAPI_pdu_session_notify_item_s OpenAPI_pdu_session_notify_item_t;
typedef struct OpenAPI_pdu_session_notify_item_s {
struct OpenAPI_notification_cause_s *notification_cause;
OpenAPI_notification_cause_e notification_cause;
} OpenAPI_pdu_session_notify_item_t;
OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_create(
OpenAPI_notification_cause_t *notification_cause
OpenAPI_notification_cause_e notification_cause
);
void OpenAPI_pdu_session_notify_item_free(OpenAPI_pdu_session_notify_item_t *pdu_session_notify_item);
OpenAPI_pdu_session_notify_item_t *OpenAPI_pdu_session_notify_item_parseFromJSON(cJSON *pdu_session_notify_itemJSON);

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "psa_indication.h"
OpenAPI_psa_indication_t *OpenAPI_psa_indication_create(
)
char* OpenAPI_psa_indication_ToString(OpenAPI_psa_indication_e psa_indication)
{
OpenAPI_psa_indication_t *psa_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_psa_indication_t));
if (!psa_indication_local_var) {
return NULL;
}
return psa_indication_local_var;
const char *psa_indicationArray[] = { "NULL", "PSA_INSERTED", "PSA_REMOVED" };
size_t sizeofArray = sizeof(psa_indicationArray) / sizeof(psa_indicationArray[0]);
if (psa_indication < sizeofArray)
return (char *)psa_indicationArray[psa_indication];
else
return (char *)"Unknown";
}
void OpenAPI_psa_indication_free(OpenAPI_psa_indication_t *psa_indication)
OpenAPI_psa_indication_e OpenAPI_psa_indication_FromString(char* psa_indication)
{
if (NULL == psa_indication) {
return;
int stringToReturn = 0;
const char *psa_indicationArray[] = { "NULL", "PSA_INSERTED", "PSA_REMOVED" };
size_t sizeofArray = sizeof(psa_indicationArray) / sizeof(psa_indicationArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(psa_indication, psa_indicationArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(psa_indication);
}
cJSON *OpenAPI_psa_indication_convertToJSON(OpenAPI_psa_indication_t *psa_indication)
{
cJSON *item = NULL;
if (psa_indication == NULL) {
ogs_error("OpenAPI_psa_indication_convertToJSON() failed [PsaIndication]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_psa_indication_t *OpenAPI_psa_indication_parseFromJSON(cJSON *psa_indicationJSON)
{
OpenAPI_psa_indication_t *psa_indication_local_var = NULL;
psa_indication_local_var = OpenAPI_psa_indication_create (
);
return psa_indication_local_var;
end:
return NULL;
}
OpenAPI_psa_indication_t *OpenAPI_psa_indication_copy(OpenAPI_psa_indication_t *dst, OpenAPI_psa_indication_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_psa_indication_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_psa_indication_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_psa_indication_free(dst);
dst = OpenAPI_psa_indication_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* psa_indication.h
*
* Possible values are - PSA_INSERTED - PSA_REMOVED
*
*/
#ifndef _OpenAPI_psa_indication_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_psa_indication_s OpenAPI_psa_indication_t;
typedef struct OpenAPI_psa_indication_s {
} OpenAPI_psa_indication_t;
typedef enum { OpenAPI_psa_indication_NULL = 0, OpenAPI_psa_indication_PSA_INSERTED, OpenAPI_psa_indication_PSA_REMOVED } OpenAPI_psa_indication_e;
OpenAPI_psa_indication_t *OpenAPI_psa_indication_create(
);
void OpenAPI_psa_indication_free(OpenAPI_psa_indication_t *psa_indication);
OpenAPI_psa_indication_t *OpenAPI_psa_indication_parseFromJSON(cJSON *psa_indicationJSON);
cJSON *OpenAPI_psa_indication_convertToJSON(OpenAPI_psa_indication_t *psa_indication);
OpenAPI_psa_indication_t *OpenAPI_psa_indication_copy(OpenAPI_psa_indication_t *dst, OpenAPI_psa_indication_t *src);
char* OpenAPI_psa_indication_ToString(OpenAPI_psa_indication_e psa_indication);
OpenAPI_psa_indication_e OpenAPI_psa_indication_FromString(char* psa_indication);
#ifdef __cplusplus
}

View File

@ -5,7 +5,7 @@
#include "psa_information.h"
OpenAPI_psa_information_t *OpenAPI_psa_information_create(
OpenAPI_psa_indication_t *psa_ind,
OpenAPI_psa_indication_e psa_ind,
OpenAPI_list_t *dnai_list,
char *ue_ipv6_prefix,
char *psa_upf_id
@ -29,7 +29,6 @@ void OpenAPI_psa_information_free(OpenAPI_psa_information_t *psa_information)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_psa_indication_free(psa_information->psa_ind);
OpenAPI_list_for_each(psa_information->dnai_list, node) {
ogs_free(node->data);
}
@ -50,13 +49,7 @@ cJSON *OpenAPI_psa_information_convertToJSON(OpenAPI_psa_information_t *psa_info
item = cJSON_CreateObject();
if (psa_information->psa_ind) {
cJSON *psa_ind_local_JSON = OpenAPI_psa_indication_convertToJSON(psa_information->psa_ind);
if (psa_ind_local_JSON == NULL) {
ogs_error("OpenAPI_psa_information_convertToJSON() failed [psa_ind]");
goto end;
}
cJSON_AddItemToObject(item, "psaInd", psa_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "psaInd", OpenAPI_psa_indication_ToString(psa_information->psa_ind)) == NULL) {
ogs_error("OpenAPI_psa_information_convertToJSON() failed [psa_ind]");
goto end;
}
@ -101,9 +94,13 @@ OpenAPI_psa_information_t *OpenAPI_psa_information_parseFromJSON(cJSON *psa_info
OpenAPI_psa_information_t *psa_information_local_var = NULL;
cJSON *psa_ind = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "psaInd");
OpenAPI_psa_indication_t *psa_ind_local_nonprim = NULL;
OpenAPI_psa_indication_e psa_indVariable;
if (psa_ind) {
psa_ind_local_nonprim = OpenAPI_psa_indication_parseFromJSON(psa_ind);
if (!cJSON_IsString(psa_ind)) {
ogs_error("OpenAPI_psa_information_parseFromJSON() failed [psa_ind]");
goto end;
}
psa_indVariable = OpenAPI_psa_indication_FromString(psa_ind->valuestring);
}
cJSON *dnai_list = cJSON_GetObjectItemCaseSensitive(psa_informationJSON, "dnaiList");
@ -145,7 +142,7 @@ OpenAPI_psa_information_t *OpenAPI_psa_information_parseFromJSON(cJSON *psa_info
}
psa_information_local_var = OpenAPI_psa_information_create (
psa_ind ? psa_ind_local_nonprim : NULL,
psa_ind ? psa_indVariable : 0,
dnai_list ? dnai_listList : NULL,
ue_ipv6_prefix ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL,
psa_upf_id ? ogs_strdup(psa_upf_id->valuestring) : NULL

View File

@ -20,14 +20,14 @@ extern "C" {
typedef struct OpenAPI_psa_information_s OpenAPI_psa_information_t;
typedef struct OpenAPI_psa_information_s {
struct OpenAPI_psa_indication_s *psa_ind;
OpenAPI_psa_indication_e psa_ind;
OpenAPI_list_t *dnai_list;
char *ue_ipv6_prefix;
char *psa_upf_id;
} OpenAPI_psa_information_t;
OpenAPI_psa_information_t *OpenAPI_psa_information_create(
OpenAPI_psa_indication_t *psa_ind,
OpenAPI_psa_indication_e psa_ind,
OpenAPI_list_t *dnai_list,
char *ue_ipv6_prefix,
char *psa_upf_id

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "qos_flow_access_type.h"
OpenAPI_qos_flow_access_type_t *OpenAPI_qos_flow_access_type_create(
)
char* OpenAPI_qos_flow_access_type_ToString(OpenAPI_qos_flow_access_type_e qos_flow_access_type)
{
OpenAPI_qos_flow_access_type_t *qos_flow_access_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_qos_flow_access_type_t));
if (!qos_flow_access_type_local_var) {
return NULL;
}
return qos_flow_access_type_local_var;
const char *qos_flow_access_typeArray[] = { "NULL", "_3GPP", "NON_3GPP", "_3GPP_AND_NON_3GPP" };
size_t sizeofArray = sizeof(qos_flow_access_typeArray) / sizeof(qos_flow_access_typeArray[0]);
if (qos_flow_access_type < sizeofArray)
return (char *)qos_flow_access_typeArray[qos_flow_access_type];
else
return (char *)"Unknown";
}
void OpenAPI_qos_flow_access_type_free(OpenAPI_qos_flow_access_type_t *qos_flow_access_type)
OpenAPI_qos_flow_access_type_e OpenAPI_qos_flow_access_type_FromString(char* qos_flow_access_type)
{
if (NULL == qos_flow_access_type) {
return;
int stringToReturn = 0;
const char *qos_flow_access_typeArray[] = { "NULL", "_3GPP", "NON_3GPP", "_3GPP_AND_NON_3GPP" };
size_t sizeofArray = sizeof(qos_flow_access_typeArray) / sizeof(qos_flow_access_typeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(qos_flow_access_type, qos_flow_access_typeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(qos_flow_access_type);
}
cJSON *OpenAPI_qos_flow_access_type_convertToJSON(OpenAPI_qos_flow_access_type_t *qos_flow_access_type)
{
cJSON *item = NULL;
if (qos_flow_access_type == NULL) {
ogs_error("OpenAPI_qos_flow_access_type_convertToJSON() failed [QosFlowAccessType]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_qos_flow_access_type_t *OpenAPI_qos_flow_access_type_parseFromJSON(cJSON *qos_flow_access_typeJSON)
{
OpenAPI_qos_flow_access_type_t *qos_flow_access_type_local_var = NULL;
qos_flow_access_type_local_var = OpenAPI_qos_flow_access_type_create (
);
return qos_flow_access_type_local_var;
end:
return NULL;
}
OpenAPI_qos_flow_access_type_t *OpenAPI_qos_flow_access_type_copy(OpenAPI_qos_flow_access_type_t *dst, OpenAPI_qos_flow_access_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_qos_flow_access_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_qos_flow_access_type_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_qos_flow_access_type_free(dst);
dst = OpenAPI_qos_flow_access_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* qos_flow_access_type.h
*
* Possible values are - 3GPP - NON_3GPP - 3GPP_AND_NON_3GPP
*
*/
#ifndef _OpenAPI_qos_flow_access_type_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_qos_flow_access_type_s OpenAPI_qos_flow_access_type_t;
typedef struct OpenAPI_qos_flow_access_type_s {
} OpenAPI_qos_flow_access_type_t;
typedef enum { OpenAPI_qos_flow_access_type_NULL = 0, OpenAPI_qos_flow_access_type__3GPP, OpenAPI_qos_flow_access_type_NON_3GPP, OpenAPI_qos_flow_access_type__3GPP_AND_NON_3GPP } OpenAPI_qos_flow_access_type_e;
OpenAPI_qos_flow_access_type_t *OpenAPI_qos_flow_access_type_create(
);
void OpenAPI_qos_flow_access_type_free(OpenAPI_qos_flow_access_type_t *qos_flow_access_type);
OpenAPI_qos_flow_access_type_t *OpenAPI_qos_flow_access_type_parseFromJSON(cJSON *qos_flow_access_typeJSON);
cJSON *OpenAPI_qos_flow_access_type_convertToJSON(OpenAPI_qos_flow_access_type_t *qos_flow_access_type);
OpenAPI_qos_flow_access_type_t *OpenAPI_qos_flow_access_type_copy(OpenAPI_qos_flow_access_type_t *dst, OpenAPI_qos_flow_access_type_t *src);
char* OpenAPI_qos_flow_access_type_ToString(OpenAPI_qos_flow_access_type_e qos_flow_access_type);
OpenAPI_qos_flow_access_type_e OpenAPI_qos_flow_access_type_FromString(char* qos_flow_access_type);
#ifdef __cplusplus
}

View File

@ -10,7 +10,7 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_
char qos_rules,
char qos_flow_description,
OpenAPI_qos_flow_profile_t *qos_flow_profile,
OpenAPI_qos_flow_access_type_t *associated_an_type
OpenAPI_qos_flow_access_type_e associated_an_type
)
{
OpenAPI_qos_flow_add_modify_request_item_t *qos_flow_add_modify_request_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_qos_flow_add_modify_request_item_t));
@ -34,7 +34,6 @@ void OpenAPI_qos_flow_add_modify_request_item_free(OpenAPI_qos_flow_add_modify_r
}
OpenAPI_lnode_t *node;
OpenAPI_qos_flow_profile_free(qos_flow_add_modify_request_item->qos_flow_profile);
OpenAPI_qos_flow_access_type_free(qos_flow_add_modify_request_item->associated_an_type);
ogs_free(qos_flow_add_modify_request_item);
}
@ -92,13 +91,7 @@ cJSON *OpenAPI_qos_flow_add_modify_request_item_convertToJSON(OpenAPI_qos_flow_a
}
if (qos_flow_add_modify_request_item->associated_an_type) {
cJSON *associated_an_type_local_JSON = OpenAPI_qos_flow_access_type_convertToJSON(qos_flow_add_modify_request_item->associated_an_type);
if (associated_an_type_local_JSON == NULL) {
ogs_error("OpenAPI_qos_flow_add_modify_request_item_convertToJSON() failed [associated_an_type]");
goto end;
}
cJSON_AddItemToObject(item, "associatedAnType", associated_an_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "associatedAnType", OpenAPI_qos_flow_access_type_ToString(qos_flow_add_modify_request_item->associated_an_type)) == NULL) {
ogs_error("OpenAPI_qos_flow_add_modify_request_item_convertToJSON() failed [associated_an_type]");
goto end;
}
@ -159,9 +152,13 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_
cJSON *associated_an_type = cJSON_GetObjectItemCaseSensitive(qos_flow_add_modify_request_itemJSON, "associatedAnType");
OpenAPI_qos_flow_access_type_t *associated_an_type_local_nonprim = NULL;
OpenAPI_qos_flow_access_type_e associated_an_typeVariable;
if (associated_an_type) {
associated_an_type_local_nonprim = OpenAPI_qos_flow_access_type_parseFromJSON(associated_an_type);
if (!cJSON_IsString(associated_an_type)) {
ogs_error("OpenAPI_qos_flow_add_modify_request_item_parseFromJSON() failed [associated_an_type]");
goto end;
}
associated_an_typeVariable = OpenAPI_qos_flow_access_type_FromString(associated_an_type->valuestring);
}
qos_flow_add_modify_request_item_local_var = OpenAPI_qos_flow_add_modify_request_item_create (
@ -170,7 +167,7 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_
qos_rules ? qos_rules->valueint : 0,
qos_flow_description ? qos_flow_description->valueint : 0,
qos_flow_profile ? qos_flow_profile_local_nonprim : NULL,
associated_an_type ? associated_an_type_local_nonprim : NULL
associated_an_type ? associated_an_typeVariable : 0
);
return qos_flow_add_modify_request_item_local_var;

View File

@ -26,7 +26,7 @@ typedef struct OpenAPI_qos_flow_add_modify_request_item_s {
char qos_rules;
char qos_flow_description;
struct OpenAPI_qos_flow_profile_s *qos_flow_profile;
struct OpenAPI_qos_flow_access_type_s *associated_an_type;
OpenAPI_qos_flow_access_type_e associated_an_type;
} OpenAPI_qos_flow_add_modify_request_item_t;
OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_item_create(
@ -35,7 +35,7 @@ OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_
char qos_rules,
char qos_flow_description,
OpenAPI_qos_flow_profile_t *qos_flow_profile,
OpenAPI_qos_flow_access_type_t *associated_an_type
OpenAPI_qos_flow_access_type_e associated_an_type
);
void OpenAPI_qos_flow_add_modify_request_item_free(OpenAPI_qos_flow_add_modify_request_item_t *qos_flow_add_modify_request_item);
OpenAPI_qos_flow_add_modify_request_item_t *OpenAPI_qos_flow_add_modify_request_item_parseFromJSON(cJSON *qos_flow_add_modify_request_itemJSON);

View File

@ -6,7 +6,7 @@
OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_create(
int qfi,
OpenAPI_cause_t *cause
OpenAPI_cause_e cause
)
{
OpenAPI_qos_flow_item_t *qos_flow_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_qos_flow_item_t));
@ -25,7 +25,6 @@ void OpenAPI_qos_flow_item_free(OpenAPI_qos_flow_item_t *qos_flow_item)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_cause_free(qos_flow_item->cause);
ogs_free(qos_flow_item);
}
@ -49,13 +48,7 @@ cJSON *OpenAPI_qos_flow_item_convertToJSON(OpenAPI_qos_flow_item_t *qos_flow_ite
}
if (qos_flow_item->cause) {
cJSON *cause_local_JSON = OpenAPI_cause_convertToJSON(qos_flow_item->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_qos_flow_item_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(qos_flow_item->cause)) == NULL) {
ogs_error("OpenAPI_qos_flow_item_convertToJSON() failed [cause]");
goto end;
}
@ -82,14 +75,18 @@ OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_parseFromJSON(cJSON *qos_flow_ite
cJSON *cause = cJSON_GetObjectItemCaseSensitive(qos_flow_itemJSON, "cause");
OpenAPI_cause_t *cause_local_nonprim = NULL;
OpenAPI_cause_e causeVariable;
if (cause) {
cause_local_nonprim = OpenAPI_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_qos_flow_item_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_cause_FromString(cause->valuestring);
}
qos_flow_item_local_var = OpenAPI_qos_flow_item_create (
qfi->valuedouble,
cause ? cause_local_nonprim : NULL
cause ? causeVariable : 0
);
return qos_flow_item_local_var;

View File

@ -21,12 +21,12 @@ extern "C" {
typedef struct OpenAPI_qos_flow_item_s OpenAPI_qos_flow_item_t;
typedef struct OpenAPI_qos_flow_item_s {
int qfi;
struct OpenAPI_cause_s *cause;
OpenAPI_cause_e cause;
} OpenAPI_qos_flow_item_t;
OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_create(
int qfi,
OpenAPI_cause_t *cause
OpenAPI_cause_e cause
);
void OpenAPI_qos_flow_item_free(OpenAPI_qos_flow_item_t *qos_flow_item);
OpenAPI_qos_flow_item_t *OpenAPI_qos_flow_item_parseFromJSON(cJSON *qos_flow_itemJSON);

View File

@ -6,7 +6,7 @@
OpenAPI_qos_flow_notify_item_t *OpenAPI_qos_flow_notify_item_create(
int qfi,
OpenAPI_notification_cause_t *notification_cause
OpenAPI_notification_cause_e notification_cause
)
{
OpenAPI_qos_flow_notify_item_t *qos_flow_notify_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_qos_flow_notify_item_t));
@ -25,7 +25,6 @@ void OpenAPI_qos_flow_notify_item_free(OpenAPI_qos_flow_notify_item_t *qos_flow_
return;
}
OpenAPI_lnode_t *node;
OpenAPI_notification_cause_free(qos_flow_notify_item->notification_cause);
ogs_free(qos_flow_notify_item);
}
@ -52,13 +51,7 @@ cJSON *OpenAPI_qos_flow_notify_item_convertToJSON(OpenAPI_qos_flow_notify_item_t
ogs_error("OpenAPI_qos_flow_notify_item_convertToJSON() failed [notification_cause]");
goto end;
}
cJSON *notification_cause_local_JSON = OpenAPI_notification_cause_convertToJSON(qos_flow_notify_item->notification_cause);
if (notification_cause_local_JSON == NULL) {
ogs_error("OpenAPI_qos_flow_notify_item_convertToJSON() failed [notification_cause]");
goto end;
}
cJSON_AddItemToObject(item, "notificationCause", notification_cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "notificationCause", OpenAPI_notification_cause_ToString(qos_flow_notify_item->notification_cause)) == NULL) {
ogs_error("OpenAPI_qos_flow_notify_item_convertToJSON() failed [notification_cause]");
goto end;
}
@ -88,13 +81,17 @@ OpenAPI_qos_flow_notify_item_t *OpenAPI_qos_flow_notify_item_parseFromJSON(cJSON
goto end;
}
OpenAPI_notification_cause_t *notification_cause_local_nonprim = NULL;
OpenAPI_notification_cause_e notification_causeVariable;
notification_cause_local_nonprim = OpenAPI_notification_cause_parseFromJSON(notification_cause);
if (!cJSON_IsString(notification_cause)) {
ogs_error("OpenAPI_qos_flow_notify_item_parseFromJSON() failed [notification_cause]");
goto end;
}
notification_causeVariable = OpenAPI_notification_cause_FromString(notification_cause->valuestring);
qos_flow_notify_item_local_var = OpenAPI_qos_flow_notify_item_create (
qfi->valuedouble,
notification_cause_local_nonprim
notification_causeVariable
);
return qos_flow_notify_item_local_var;

View File

@ -21,12 +21,12 @@ extern "C" {
typedef struct OpenAPI_qos_flow_notify_item_s OpenAPI_qos_flow_notify_item_t;
typedef struct OpenAPI_qos_flow_notify_item_s {
int qfi;
struct OpenAPI_notification_cause_s *notification_cause;
OpenAPI_notification_cause_e notification_cause;
} OpenAPI_qos_flow_notify_item_t;
OpenAPI_qos_flow_notify_item_t *OpenAPI_qos_flow_notify_item_create(
int qfi,
OpenAPI_notification_cause_t *notification_cause
OpenAPI_notification_cause_e notification_cause
);
void OpenAPI_qos_flow_notify_item_free(OpenAPI_qos_flow_notify_item_t *qos_flow_notify_item);
OpenAPI_qos_flow_notify_item_t *OpenAPI_qos_flow_notify_item_parseFromJSON(cJSON *qos_flow_notify_itemJSON);

View File

@ -10,7 +10,7 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_create(
int ebi,
char qos_flow_description,
OpenAPI_qos_flow_profile_t *qos_flow_profile,
OpenAPI_qos_flow_access_type_t *associated_an_type
OpenAPI_qos_flow_access_type_e associated_an_type
)
{
OpenAPI_qos_flow_setup_item_t *qos_flow_setup_item_local_var = OpenAPI_malloc(sizeof(OpenAPI_qos_flow_setup_item_t));
@ -34,7 +34,6 @@ void OpenAPI_qos_flow_setup_item_free(OpenAPI_qos_flow_setup_item_t *qos_flow_se
}
OpenAPI_lnode_t *node;
OpenAPI_qos_flow_profile_free(qos_flow_setup_item->qos_flow_profile);
OpenAPI_qos_flow_access_type_free(qos_flow_setup_item->associated_an_type);
ogs_free(qos_flow_setup_item);
}
@ -94,13 +93,7 @@ cJSON *OpenAPI_qos_flow_setup_item_convertToJSON(OpenAPI_qos_flow_setup_item_t *
}
if (qos_flow_setup_item->associated_an_type) {
cJSON *associated_an_type_local_JSON = OpenAPI_qos_flow_access_type_convertToJSON(qos_flow_setup_item->associated_an_type);
if (associated_an_type_local_JSON == NULL) {
ogs_error("OpenAPI_qos_flow_setup_item_convertToJSON() failed [associated_an_type]");
goto end;
}
cJSON_AddItemToObject(item, "associatedAnType", associated_an_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "associatedAnType", OpenAPI_qos_flow_access_type_ToString(qos_flow_setup_item->associated_an_type)) == NULL) {
ogs_error("OpenAPI_qos_flow_setup_item_convertToJSON() failed [associated_an_type]");
goto end;
}
@ -164,9 +157,13 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_parseFromJSON(cJSON *
cJSON *associated_an_type = cJSON_GetObjectItemCaseSensitive(qos_flow_setup_itemJSON, "associatedAnType");
OpenAPI_qos_flow_access_type_t *associated_an_type_local_nonprim = NULL;
OpenAPI_qos_flow_access_type_e associated_an_typeVariable;
if (associated_an_type) {
associated_an_type_local_nonprim = OpenAPI_qos_flow_access_type_parseFromJSON(associated_an_type);
if (!cJSON_IsString(associated_an_type)) {
ogs_error("OpenAPI_qos_flow_setup_item_parseFromJSON() failed [associated_an_type]");
goto end;
}
associated_an_typeVariable = OpenAPI_qos_flow_access_type_FromString(associated_an_type->valuestring);
}
qos_flow_setup_item_local_var = OpenAPI_qos_flow_setup_item_create (
@ -175,7 +172,7 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_parseFromJSON(cJSON *
ebi ? ebi->valuedouble : 0,
qos_flow_description ? qos_flow_description->valueint : 0,
qos_flow_profile ? qos_flow_profile_local_nonprim : NULL,
associated_an_type ? associated_an_type_local_nonprim : NULL
associated_an_type ? associated_an_typeVariable : 0
);
return qos_flow_setup_item_local_var;

View File

@ -26,7 +26,7 @@ typedef struct OpenAPI_qos_flow_setup_item_s {
int ebi;
char qos_flow_description;
struct OpenAPI_qos_flow_profile_s *qos_flow_profile;
struct OpenAPI_qos_flow_access_type_s *associated_an_type;
OpenAPI_qos_flow_access_type_e associated_an_type;
} OpenAPI_qos_flow_setup_item_t;
OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_create(
@ -35,7 +35,7 @@ OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_create(
int ebi,
char qos_flow_description,
OpenAPI_qos_flow_profile_t *qos_flow_profile,
OpenAPI_qos_flow_access_type_t *associated_an_type
OpenAPI_qos_flow_access_type_e associated_an_type
);
void OpenAPI_qos_flow_setup_item_free(OpenAPI_qos_flow_setup_item_t *qos_flow_setup_item);
OpenAPI_qos_flow_setup_item_t *OpenAPI_qos_flow_setup_item_parseFromJSON(cJSON *qos_flow_setup_itemJSON);

View File

@ -5,7 +5,7 @@
#include "release_data.h"
OpenAPI_release_data_t *OpenAPI_release_data_create(
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
OpenAPI_user_location_t *ue_location,
@ -37,7 +37,6 @@ void OpenAPI_release_data_free(OpenAPI_release_data_t *release_data)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_cause_free(release_data->cause);
OpenAPI_ng_ap_cause_free(release_data->ng_ap_cause);
OpenAPI_user_location_free(release_data->ue_location);
ogs_free(release_data->ue_time_zone);
@ -64,13 +63,7 @@ cJSON *OpenAPI_release_data_convertToJSON(OpenAPI_release_data_t *release_data)
item = cJSON_CreateObject();
if (release_data->cause) {
cJSON *cause_local_JSON = OpenAPI_cause_convertToJSON(release_data->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_release_data_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(release_data->cause)) == NULL) {
ogs_error("OpenAPI_release_data_convertToJSON() failed [cause]");
goto end;
}
@ -178,9 +171,13 @@ OpenAPI_release_data_t *OpenAPI_release_data_parseFromJSON(cJSON *release_dataJS
OpenAPI_release_data_t *release_data_local_var = NULL;
cJSON *cause = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "cause");
OpenAPI_cause_t *cause_local_nonprim = NULL;
OpenAPI_cause_e causeVariable;
if (cause) {
cause_local_nonprim = OpenAPI_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_release_data_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_cause_FromString(cause->valuestring);
}
cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(release_dataJSON, "ngApCause");
@ -269,7 +266,7 @@ OpenAPI_release_data_t *OpenAPI_release_data_parseFromJSON(cJSON *release_dataJS
}
release_data_local_var = OpenAPI_release_data_create (
cause ? cause_local_nonprim : NULL,
cause ? causeVariable : 0,
ng_ap_cause ? ng_ap_cause_local_nonprim : NULL,
_5g_mm_cause_value ? _5g_mm_cause_value->valuedouble : 0,
ue_location ? ue_location_local_nonprim : NULL,

View File

@ -24,7 +24,7 @@ extern "C" {
typedef struct OpenAPI_release_data_s OpenAPI_release_data_t;
typedef struct OpenAPI_release_data_s {
struct OpenAPI_cause_s *cause;
OpenAPI_cause_e cause;
struct OpenAPI_ng_ap_cause_s *ng_ap_cause;
int _5g_mm_cause_value;
struct OpenAPI_user_location_s *ue_location;
@ -35,7 +35,7 @@ typedef struct OpenAPI_release_data_s {
} OpenAPI_release_data_t;
OpenAPI_release_data_t *OpenAPI_release_data_create(
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
OpenAPI_user_location_t *ue_location,

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "request_indication.h"
OpenAPI_request_indication_t *OpenAPI_request_indication_create(
)
char* OpenAPI_request_indication_ToString(OpenAPI_request_indication_e request_indication)
{
OpenAPI_request_indication_t *request_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_request_indication_t));
if (!request_indication_local_var) {
return NULL;
}
return request_indication_local_var;
const char *request_indicationArray[] = { "NULL", "UE_REQ_PDU_SES_MOD", "UE_REQ_PDU_SES_REL", "PDU_SES_MOB", "NW_REQ_PDU_SES_AUTH", "NW_REQ_PDU_SES_MOD", "NW_REQ_PDU_SES_REL", "EBI_ASSIGNMENT_REQ" };
size_t sizeofArray = sizeof(request_indicationArray) / sizeof(request_indicationArray[0]);
if (request_indication < sizeofArray)
return (char *)request_indicationArray[request_indication];
else
return (char *)"Unknown";
}
void OpenAPI_request_indication_free(OpenAPI_request_indication_t *request_indication)
OpenAPI_request_indication_e OpenAPI_request_indication_FromString(char* request_indication)
{
if (NULL == request_indication) {
return;
int stringToReturn = 0;
const char *request_indicationArray[] = { "NULL", "UE_REQ_PDU_SES_MOD", "UE_REQ_PDU_SES_REL", "PDU_SES_MOB", "NW_REQ_PDU_SES_AUTH", "NW_REQ_PDU_SES_MOD", "NW_REQ_PDU_SES_REL", "EBI_ASSIGNMENT_REQ" };
size_t sizeofArray = sizeof(request_indicationArray) / sizeof(request_indicationArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(request_indication, request_indicationArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(request_indication);
}
cJSON *OpenAPI_request_indication_convertToJSON(OpenAPI_request_indication_t *request_indication)
{
cJSON *item = NULL;
if (request_indication == NULL) {
ogs_error("OpenAPI_request_indication_convertToJSON() failed [RequestIndication]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_request_indication_t *OpenAPI_request_indication_parseFromJSON(cJSON *request_indicationJSON)
{
OpenAPI_request_indication_t *request_indication_local_var = NULL;
request_indication_local_var = OpenAPI_request_indication_create (
);
return request_indication_local_var;
end:
return NULL;
}
OpenAPI_request_indication_t *OpenAPI_request_indication_copy(OpenAPI_request_indication_t *dst, OpenAPI_request_indication_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_request_indication_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_request_indication_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_request_indication_free(dst);
dst = OpenAPI_request_indication_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* request_indication.h
*
* Possible values are - UE_REQ_PDU_SES_MOD - UE_REQ_PDU_SES_REL - PDU_SES_MOB - NW_REQ_PDU_SES_AUTH - NW_REQ_PDU_SES_MOD - NW_REQ_PDU_SES_REL - EBI_ASSIGNMENT_REQ
*
*/
#ifndef _OpenAPI_request_indication_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_request_indication_s OpenAPI_request_indication_t;
typedef struct OpenAPI_request_indication_s {
} OpenAPI_request_indication_t;
typedef enum { OpenAPI_request_indication_NULL = 0, OpenAPI_request_indication_UE_REQ_PDU_SES_MOD, OpenAPI_request_indication_UE_REQ_PDU_SES_REL, OpenAPI_request_indication_PDU_SES_MOB, OpenAPI_request_indication_NW_REQ_PDU_SES_AUTH, OpenAPI_request_indication_NW_REQ_PDU_SES_MOD, OpenAPI_request_indication_NW_REQ_PDU_SES_REL, OpenAPI_request_indication_EBI_ASSIGNMENT_REQ } OpenAPI_request_indication_e;
OpenAPI_request_indication_t *OpenAPI_request_indication_create(
);
void OpenAPI_request_indication_free(OpenAPI_request_indication_t *request_indication);
OpenAPI_request_indication_t *OpenAPI_request_indication_parseFromJSON(cJSON *request_indicationJSON);
cJSON *OpenAPI_request_indication_convertToJSON(OpenAPI_request_indication_t *request_indication);
OpenAPI_request_indication_t *OpenAPI_request_indication_copy(OpenAPI_request_indication_t *dst, OpenAPI_request_indication_t *src);
char* OpenAPI_request_indication_ToString(OpenAPI_request_indication_e request_indication);
OpenAPI_request_indication_e OpenAPI_request_indication_FromString(char* request_indication);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "request_type.h"
OpenAPI_request_type_t *OpenAPI_request_type_create(
)
char* OpenAPI_request_type_ToString(OpenAPI_request_type_e request_type)
{
OpenAPI_request_type_t *request_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_request_type_t));
if (!request_type_local_var) {
return NULL;
}
return request_type_local_var;
const char *request_typeArray[] = { "NULL", "INITIAL_REQUEST", "EXISTING_PDU_SESSION", "INITIAL_EMERGENCY_REQUEST", "EXISTING_EMERGENCY_PDU_SESSION" };
size_t sizeofArray = sizeof(request_typeArray) / sizeof(request_typeArray[0]);
if (request_type < sizeofArray)
return (char *)request_typeArray[request_type];
else
return (char *)"Unknown";
}
void OpenAPI_request_type_free(OpenAPI_request_type_t *request_type)
OpenAPI_request_type_e OpenAPI_request_type_FromString(char* request_type)
{
if (NULL == request_type) {
return;
int stringToReturn = 0;
const char *request_typeArray[] = { "NULL", "INITIAL_REQUEST", "EXISTING_PDU_SESSION", "INITIAL_EMERGENCY_REQUEST", "EXISTING_EMERGENCY_PDU_SESSION" };
size_t sizeofArray = sizeof(request_typeArray) / sizeof(request_typeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(request_type, request_typeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(request_type);
}
cJSON *OpenAPI_request_type_convertToJSON(OpenAPI_request_type_t *request_type)
{
cJSON *item = NULL;
if (request_type == NULL) {
ogs_error("OpenAPI_request_type_convertToJSON() failed [RequestType]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_request_type_t *OpenAPI_request_type_parseFromJSON(cJSON *request_typeJSON)
{
OpenAPI_request_type_t *request_type_local_var = NULL;
request_type_local_var = OpenAPI_request_type_create (
);
return request_type_local_var;
end:
return NULL;
}
OpenAPI_request_type_t *OpenAPI_request_type_copy(OpenAPI_request_type_t *dst, OpenAPI_request_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_request_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_request_type_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_request_type_free(dst);
dst = OpenAPI_request_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* request_type.h
*
* Possible values are - INITIAL_REQUEST - EXISTING_PDU_SESSION - INITIAL_EMERGENCY_REQUEST - EXISTING_EMERGENCY_PDU_SESSION
*
*/
#ifndef _OpenAPI_request_type_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_request_type_s OpenAPI_request_type_t;
typedef struct OpenAPI_request_type_s {
} OpenAPI_request_type_t;
typedef enum { OpenAPI_request_type_NULL = 0, OpenAPI_request_type_INITIAL_REQUEST, OpenAPI_request_type_EXISTING_PDU_SESSION, OpenAPI_request_type_INITIAL_EMERGENCY_REQUEST, OpenAPI_request_type_EXISTING_EMERGENCY_PDU_SESSION } OpenAPI_request_type_e;
OpenAPI_request_type_t *OpenAPI_request_type_create(
);
void OpenAPI_request_type_free(OpenAPI_request_type_t *request_type);
OpenAPI_request_type_t *OpenAPI_request_type_parseFromJSON(cJSON *request_typeJSON);
cJSON *OpenAPI_request_type_convertToJSON(OpenAPI_request_type_t *request_type);
OpenAPI_request_type_t *OpenAPI_request_type_copy(OpenAPI_request_type_t *dst, OpenAPI_request_type_t *src);
char* OpenAPI_request_type_ToString(OpenAPI_request_type_e request_type);
OpenAPI_request_type_e OpenAPI_request_type_FromString(char* request_type);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "resource_status.h"
OpenAPI_resource_status_t *OpenAPI_resource_status_create(
)
char* OpenAPI_resource_status_ToString(OpenAPI_resource_status_e resource_status)
{
OpenAPI_resource_status_t *resource_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_resource_status_t));
if (!resource_status_local_var) {
return NULL;
}
return resource_status_local_var;
const char *resource_statusArray[] = { "NULL", "RELEASED", "UNCHANGED", "TRANSFERRED", "UPDATED" };
size_t sizeofArray = sizeof(resource_statusArray) / sizeof(resource_statusArray[0]);
if (resource_status < sizeofArray)
return (char *)resource_statusArray[resource_status];
else
return (char *)"Unknown";
}
void OpenAPI_resource_status_free(OpenAPI_resource_status_t *resource_status)
OpenAPI_resource_status_e OpenAPI_resource_status_FromString(char* resource_status)
{
if (NULL == resource_status) {
return;
int stringToReturn = 0;
const char *resource_statusArray[] = { "NULL", "RELEASED", "UNCHANGED", "TRANSFERRED", "UPDATED" };
size_t sizeofArray = sizeof(resource_statusArray) / sizeof(resource_statusArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(resource_status, resource_statusArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(resource_status);
}
cJSON *OpenAPI_resource_status_convertToJSON(OpenAPI_resource_status_t *resource_status)
{
cJSON *item = NULL;
if (resource_status == NULL) {
ogs_error("OpenAPI_resource_status_convertToJSON() failed [ResourceStatus]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_resource_status_t *OpenAPI_resource_status_parseFromJSON(cJSON *resource_statusJSON)
{
OpenAPI_resource_status_t *resource_status_local_var = NULL;
resource_status_local_var = OpenAPI_resource_status_create (
);
return resource_status_local_var;
end:
return NULL;
}
OpenAPI_resource_status_t *OpenAPI_resource_status_copy(OpenAPI_resource_status_t *dst, OpenAPI_resource_status_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_resource_status_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_resource_status_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_resource_status_free(dst);
dst = OpenAPI_resource_status_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* resource_status.h
*
* Possible values are - RELEASED - UNCHANGED - UPDATED
*
*/
#ifndef _OpenAPI_resource_status_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_resource_status_s OpenAPI_resource_status_t;
typedef struct OpenAPI_resource_status_s {
} OpenAPI_resource_status_t;
typedef enum { OpenAPI_resource_status_NULL = 0, OpenAPI_resource_status_RELEASED, OpenAPI_resource_status_UNCHANGED, OpenAPI_resource_status_TRANSFERRED, OpenAPI_resource_status_UPDATED } OpenAPI_resource_status_e;
OpenAPI_resource_status_t *OpenAPI_resource_status_create(
);
void OpenAPI_resource_status_free(OpenAPI_resource_status_t *resource_status);
OpenAPI_resource_status_t *OpenAPI_resource_status_parseFromJSON(cJSON *resource_statusJSON);
cJSON *OpenAPI_resource_status_convertToJSON(OpenAPI_resource_status_t *resource_status);
OpenAPI_resource_status_t *OpenAPI_resource_status_copy(OpenAPI_resource_status_t *dst, OpenAPI_resource_status_t *src);
char* OpenAPI_resource_status_ToString(OpenAPI_resource_status_e resource_status);
OpenAPI_resource_status_e OpenAPI_resource_status_FromString(char* resource_status);
#ifdef __cplusplus
}

View File

@ -17,7 +17,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_create(
char *pcf_id,
char *pcf_group_id,
char *pcf_set_id,
OpenAPI_dnn_selection_mode_t *sel_mode,
OpenAPI_dnn_selection_mode_e sel_mode,
char *udm_group_id,
char *routing_indicator,
OpenAPI_ambr_t *session_ambr,
@ -29,7 +29,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_create(
char *ue_ipv6_prefix,
OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info,
OpenAPI_list_t *eps_bearer_info,
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate,
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate,
int always_on_granted,
OpenAPI_up_security_t *up_security,
char *h_smf_service_instance_id,
@ -103,7 +103,6 @@ void OpenAPI_sm_context_free(OpenAPI_sm_context_t *sm_context)
ogs_free(sm_context->pcf_id);
ogs_free(sm_context->pcf_group_id);
ogs_free(sm_context->pcf_set_id);
OpenAPI_dnn_selection_mode_free(sm_context->sel_mode);
ogs_free(sm_context->udm_group_id);
ogs_free(sm_context->routing_indicator);
OpenAPI_ambr_free(sm_context->session_ambr);
@ -120,7 +119,6 @@ void OpenAPI_sm_context_free(OpenAPI_sm_context_t *sm_context)
OpenAPI_eps_bearer_info_free(node->data);
}
OpenAPI_list_free(sm_context->eps_bearer_info);
OpenAPI_max_integrity_protected_data_rate_free(sm_context->max_integrity_protected_data_rate);
OpenAPI_up_security_free(sm_context->up_security);
ogs_free(sm_context->h_smf_service_instance_id);
ogs_free(sm_context->smf_service_instance_id);
@ -247,13 +245,7 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context)
}
if (sm_context->sel_mode) {
cJSON *sel_mode_local_JSON = OpenAPI_dnn_selection_mode_convertToJSON(sm_context->sel_mode);
if (sel_mode_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_convertToJSON() failed [sel_mode]");
goto end;
}
cJSON_AddItemToObject(item, "selMode", sel_mode_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "selMode", OpenAPI_dnn_selection_mode_ToString(sm_context->sel_mode)) == NULL) {
ogs_error("OpenAPI_sm_context_convertToJSON() failed [sel_mode]");
goto end;
}
@ -379,13 +371,7 @@ cJSON *OpenAPI_sm_context_convertToJSON(OpenAPI_sm_context_t *sm_context)
}
if (sm_context->max_integrity_protected_data_rate) {
cJSON *max_integrity_protected_data_rate_local_JSON = OpenAPI_max_integrity_protected_data_rate_convertToJSON(sm_context->max_integrity_protected_data_rate);
if (max_integrity_protected_data_rate_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_convertToJSON() failed [max_integrity_protected_data_rate]");
goto end;
}
cJSON_AddItemToObject(item, "maxIntegrityProtectedDataRate", max_integrity_protected_data_rate_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "maxIntegrityProtectedDataRate", OpenAPI_max_integrity_protected_data_rate_ToString(sm_context->max_integrity_protected_data_rate)) == NULL) {
ogs_error("OpenAPI_sm_context_convertToJSON() failed [max_integrity_protected_data_rate]");
goto end;
}
@ -619,9 +605,13 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON)
cJSON *sel_mode = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "selMode");
OpenAPI_dnn_selection_mode_t *sel_mode_local_nonprim = NULL;
OpenAPI_dnn_selection_mode_e sel_modeVariable;
if (sel_mode) {
sel_mode_local_nonprim = OpenAPI_dnn_selection_mode_parseFromJSON(sel_mode);
if (!cJSON_IsString(sel_mode)) {
ogs_error("OpenAPI_sm_context_parseFromJSON() failed [sel_mode]");
goto end;
}
sel_modeVariable = OpenAPI_dnn_selection_mode_FromString(sel_mode->valuestring);
}
cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "udmGroupId");
@ -755,9 +745,13 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON)
cJSON *max_integrity_protected_data_rate = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "maxIntegrityProtectedDataRate");
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate_local_nonprim = NULL;
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rateVariable;
if (max_integrity_protected_data_rate) {
max_integrity_protected_data_rate_local_nonprim = OpenAPI_max_integrity_protected_data_rate_parseFromJSON(max_integrity_protected_data_rate);
if (!cJSON_IsString(max_integrity_protected_data_rate)) {
ogs_error("OpenAPI_sm_context_parseFromJSON() failed [max_integrity_protected_data_rate]");
goto end;
}
max_integrity_protected_data_rateVariable = OpenAPI_max_integrity_protected_data_rate_FromString(max_integrity_protected_data_rate->valuestring);
}
cJSON *always_on_granted = cJSON_GetObjectItemCaseSensitive(sm_contextJSON, "alwaysOnGranted");
@ -864,7 +858,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON)
pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL,
pcf_group_id ? ogs_strdup(pcf_group_id->valuestring) : NULL,
pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL,
sel_mode ? sel_mode_local_nonprim : NULL,
sel_mode ? sel_modeVariable : 0,
udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL,
routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL,
session_ambr_local_nonprim,
@ -876,7 +870,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_parseFromJSON(cJSON *sm_contextJSON)
ue_ipv6_prefix ? ogs_strdup(ue_ipv6_prefix->valuestring) : NULL,
eps_pdn_cnx_info ? eps_pdn_cnx_info_local_nonprim : NULL,
eps_bearer_info ? eps_bearer_infoList : NULL,
max_integrity_protected_data_rate ? max_integrity_protected_data_rate_local_nonprim : NULL,
max_integrity_protected_data_rate ? max_integrity_protected_data_rateVariable : 0,
always_on_granted ? always_on_granted->valueint : 0,
up_security ? up_security_local_nonprim : NULL,
h_smf_service_instance_id ? ogs_strdup(h_smf_service_instance_id->valuestring) : NULL,

View File

@ -43,7 +43,7 @@ typedef struct OpenAPI_sm_context_s {
char *pcf_id;
char *pcf_group_id;
char *pcf_set_id;
struct OpenAPI_dnn_selection_mode_s *sel_mode;
OpenAPI_dnn_selection_mode_e sel_mode;
char *udm_group_id;
char *routing_indicator;
struct OpenAPI_ambr_s *session_ambr;
@ -55,7 +55,7 @@ typedef struct OpenAPI_sm_context_s {
char *ue_ipv6_prefix;
struct OpenAPI_eps_pdn_cnx_info_s *eps_pdn_cnx_info;
OpenAPI_list_t *eps_bearer_info;
struct OpenAPI_max_integrity_protected_data_rate_s *max_integrity_protected_data_rate;
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate;
int always_on_granted;
struct OpenAPI_up_security_s *up_security;
char *h_smf_service_instance_id;
@ -82,7 +82,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_create(
char *pcf_id,
char *pcf_group_id,
char *pcf_set_id,
OpenAPI_dnn_selection_mode_t *sel_mode,
OpenAPI_dnn_selection_mode_e sel_mode,
char *udm_group_id,
char *routing_indicator,
OpenAPI_ambr_t *session_ambr,
@ -94,7 +94,7 @@ OpenAPI_sm_context_t *OpenAPI_sm_context_create(
char *ue_ipv6_prefix,
OpenAPI_eps_pdn_cnx_info_t *eps_pdn_cnx_info,
OpenAPI_list_t *eps_bearer_info,
OpenAPI_max_integrity_protected_data_rate_t *max_integrity_protected_data_rate,
OpenAPI_max_integrity_protected_data_rate_e max_integrity_protected_data_rate,
int always_on_granted,
OpenAPI_up_security_t *up_security,
char *h_smf_service_instance_id,

View File

@ -17,7 +17,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_create(
OpenAPI_guami_t *guami,
char *service_name,
OpenAPI_plmn_id_nid_t *serving_network,
OpenAPI_request_type_t *request_type,
OpenAPI_request_type_e request_type,
OpenAPI_ref_to_binary_data_t *n1_sm_msg,
OpenAPI_access_type_e an_type,
OpenAPI_access_type_e additional_an_type,
@ -34,18 +34,18 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_create(
int old_pdu_session_id,
OpenAPI_list_t *pdu_sessions_activate_list,
char *ue_eps_pdn_connection,
OpenAPI_ho_state_t *ho_state,
OpenAPI_ho_state_e ho_state,
char *pcf_id,
char *pcf_group_id,
char *pcf_set_id,
char *nrf_uri,
char *supported_features,
OpenAPI_dnn_selection_mode_t *sel_mode,
OpenAPI_dnn_selection_mode_e sel_mode,
OpenAPI_list_t *backup_amf_info,
OpenAPI_trace_data_t *trace_data,
char *udm_group_id,
char *routing_indicator,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
int indirect_forwarding_flag,
OpenAPI_ng_ran_target_id_t *target_id,
char *eps_bearer_ctx_status,
@ -59,7 +59,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_create(
OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1,
OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1,
char *sm_context_ref,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_small_data_rate_status_t *small_data_rate_status,
OpenAPI_apn_rate_status_t *apn_rate_status,
int extended_nas_sm_timer_ind,
@ -163,7 +163,6 @@ void OpenAPI_sm_context_create_data_free(OpenAPI_sm_context_create_data_t *sm_co
OpenAPI_guami_free(sm_context_create_data->guami);
ogs_free(sm_context_create_data->service_name);
OpenAPI_plmn_id_nid_free(sm_context_create_data->serving_network);
OpenAPI_request_type_free(sm_context_create_data->request_type);
OpenAPI_ref_to_binary_data_free(sm_context_create_data->n1_sm_msg);
OpenAPI_presence_state_free(sm_context_create_data->presence_in_ladn);
OpenAPI_user_location_free(sm_context_create_data->ue_location);
@ -185,13 +184,11 @@ void OpenAPI_sm_context_create_data_free(OpenAPI_sm_context_create_data_t *sm_co
}
OpenAPI_list_free(sm_context_create_data->pdu_sessions_activate_list);
ogs_free(sm_context_create_data->ue_eps_pdn_connection);
OpenAPI_ho_state_free(sm_context_create_data->ho_state);
ogs_free(sm_context_create_data->pcf_id);
ogs_free(sm_context_create_data->pcf_group_id);
ogs_free(sm_context_create_data->pcf_set_id);
ogs_free(sm_context_create_data->nrf_uri);
ogs_free(sm_context_create_data->supported_features);
OpenAPI_dnn_selection_mode_free(sm_context_create_data->sel_mode);
OpenAPI_list_for_each(sm_context_create_data->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
}
@ -199,13 +196,11 @@ void OpenAPI_sm_context_create_data_free(OpenAPI_sm_context_create_data_t *sm_co
OpenAPI_trace_data_free(sm_context_create_data->trace_data);
ogs_free(sm_context_create_data->udm_group_id);
ogs_free(sm_context_create_data->routing_indicator);
OpenAPI_eps_interworking_indication_free(sm_context_create_data->eps_interworking_ind);
OpenAPI_ng_ran_target_id_free(sm_context_create_data->target_id);
ogs_free(sm_context_create_data->eps_bearer_ctx_status);
OpenAPI_ref_to_binary_data_free(sm_context_create_data->n2_sm_info);
OpenAPI_ref_to_binary_data_free(sm_context_create_data->n2_sm_info_ext1);
ogs_free(sm_context_create_data->sm_context_ref);
OpenAPI_up_cnx_state_free(sm_context_create_data->up_cnx_state);
OpenAPI_small_data_rate_status_free(sm_context_create_data->small_data_rate_status);
OpenAPI_apn_rate_status_free(sm_context_create_data->apn_rate_status);
OpenAPI_ddn_failure_subs_free(sm_context_create_data->ddn_failure_subs);
@ -340,13 +335,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da
}
if (sm_context_create_data->request_type) {
cJSON *request_type_local_JSON = OpenAPI_request_type_convertToJSON(sm_context_create_data->request_type);
if (request_type_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [request_type]");
goto end;
}
cJSON_AddItemToObject(item, "requestType", request_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "requestType", OpenAPI_request_type_ToString(sm_context_create_data->request_type)) == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [request_type]");
goto end;
}
@ -520,13 +509,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da
}
if (sm_context_create_data->ho_state) {
cJSON *ho_state_local_JSON = OpenAPI_ho_state_convertToJSON(sm_context_create_data->ho_state);
if (ho_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [ho_state]");
goto end;
}
cJSON_AddItemToObject(item, "hoState", ho_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_create_data->ho_state)) == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [ho_state]");
goto end;
}
@ -568,13 +551,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da
}
if (sm_context_create_data->sel_mode) {
cJSON *sel_mode_local_JSON = OpenAPI_dnn_selection_mode_convertToJSON(sm_context_create_data->sel_mode);
if (sel_mode_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [sel_mode]");
goto end;
}
cJSON_AddItemToObject(item, "selMode", sel_mode_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "selMode", OpenAPI_dnn_selection_mode_ToString(sm_context_create_data->sel_mode)) == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [sel_mode]");
goto end;
}
@ -628,13 +605,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da
}
if (sm_context_create_data->eps_interworking_ind) {
cJSON *eps_interworking_ind_local_JSON = OpenAPI_eps_interworking_indication_convertToJSON(sm_context_create_data->eps_interworking_ind);
if (eps_interworking_ind_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInd", eps_interworking_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(sm_context_create_data->eps_interworking_ind)) == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
@ -750,13 +721,7 @@ cJSON *OpenAPI_sm_context_create_data_convertToJSON(OpenAPI_sm_context_create_da
}
if (sm_context_create_data->up_cnx_state) {
cJSON *up_cnx_state_local_JSON = OpenAPI_up_cnx_state_convertToJSON(sm_context_create_data->up_cnx_state);
if (up_cnx_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
cJSON_AddItemToObject(item, "upCnxState", up_cnx_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_create_data->up_cnx_state)) == NULL) {
ogs_error("OpenAPI_sm_context_create_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
@ -990,9 +955,13 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
cJSON *request_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "requestType");
OpenAPI_request_type_t *request_type_local_nonprim = NULL;
OpenAPI_request_type_e request_typeVariable;
if (request_type) {
request_type_local_nonprim = OpenAPI_request_type_parseFromJSON(request_type);
if (!cJSON_IsString(request_type)) {
ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [request_type]");
goto end;
}
request_typeVariable = OpenAPI_request_type_FromString(request_type->valuestring);
}
cJSON *n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "n1SmMsg");
@ -1178,9 +1147,13 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "hoState");
OpenAPI_ho_state_t *ho_state_local_nonprim = NULL;
OpenAPI_ho_state_e ho_stateVariable;
if (ho_state) {
ho_state_local_nonprim = OpenAPI_ho_state_parseFromJSON(ho_state);
if (!cJSON_IsString(ho_state)) {
ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [ho_state]");
goto end;
}
ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring);
}
cJSON *pcf_id = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "pcfId");
@ -1230,9 +1203,13 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
cJSON *sel_mode = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "selMode");
OpenAPI_dnn_selection_mode_t *sel_mode_local_nonprim = NULL;
OpenAPI_dnn_selection_mode_e sel_modeVariable;
if (sel_mode) {
sel_mode_local_nonprim = OpenAPI_dnn_selection_mode_parseFromJSON(sel_mode);
if (!cJSON_IsString(sel_mode)) {
ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [sel_mode]");
goto end;
}
sel_modeVariable = OpenAPI_dnn_selection_mode_FromString(sel_mode->valuestring);
}
cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "backupAmfInfo");
@ -1285,9 +1262,13 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "epsInterworkingInd");
OpenAPI_eps_interworking_indication_t *eps_interworking_ind_local_nonprim = NULL;
OpenAPI_eps_interworking_indication_e eps_interworking_indVariable;
if (eps_interworking_ind) {
eps_interworking_ind_local_nonprim = OpenAPI_eps_interworking_indication_parseFromJSON(eps_interworking_ind);
if (!cJSON_IsString(eps_interworking_ind)) {
ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [eps_interworking_ind]");
goto end;
}
eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring);
}
cJSON *indirect_forwarding_flag = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "indirectForwardingFlag");
@ -1407,9 +1388,13 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "upCnxState");
OpenAPI_up_cnx_state_t *up_cnx_state_local_nonprim = NULL;
OpenAPI_up_cnx_state_e up_cnx_stateVariable;
if (up_cnx_state) {
up_cnx_state_local_nonprim = OpenAPI_up_cnx_state_parseFromJSON(up_cnx_state);
if (!cJSON_IsString(up_cnx_state)) {
ogs_error("OpenAPI_sm_context_create_data_parseFromJSON() failed [up_cnx_state]");
goto end;
}
up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring);
}
cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(sm_context_create_dataJSON, "smallDataRateStatus");
@ -1512,7 +1497,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
guami ? guami_local_nonprim : NULL,
service_name ? ogs_strdup(service_name->valuestring) : NULL,
serving_network_local_nonprim,
request_type ? request_type_local_nonprim : NULL,
request_type ? request_typeVariable : 0,
n1_sm_msg ? n1_sm_msg_local_nonprim : NULL,
an_typeVariable,
additional_an_type ? additional_an_typeVariable : 0,
@ -1529,18 +1514,18 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
old_pdu_session_id ? old_pdu_session_id->valuedouble : 0,
pdu_sessions_activate_list ? pdu_sessions_activate_listList : NULL,
ue_eps_pdn_connection ? ogs_strdup(ue_eps_pdn_connection->valuestring) : NULL,
ho_state ? ho_state_local_nonprim : NULL,
ho_state ? ho_stateVariable : 0,
pcf_id ? ogs_strdup(pcf_id->valuestring) : NULL,
pcf_group_id ? ogs_strdup(pcf_group_id->valuestring) : NULL,
pcf_set_id ? ogs_strdup(pcf_set_id->valuestring) : NULL,
nrf_uri ? ogs_strdup(nrf_uri->valuestring) : NULL,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
sel_mode ? sel_mode_local_nonprim : NULL,
sel_mode ? sel_modeVariable : 0,
backup_amf_info ? backup_amf_infoList : NULL,
trace_data ? trace_data_local_nonprim : NULL,
udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL,
routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL,
eps_interworking_ind ? eps_interworking_ind_local_nonprim : NULL,
eps_interworking_ind ? eps_interworking_indVariable : 0,
indirect_forwarding_flag ? indirect_forwarding_flag->valueint : 0,
target_id ? target_id_local_nonprim : NULL,
eps_bearer_ctx_status ? ogs_strdup(eps_bearer_ctx_status->valuestring) : NULL,
@ -1554,7 +1539,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_parseFromJSON(c
n2_sm_info_ext1 ? n2_sm_info_ext1_local_nonprim : NULL,
n2_sm_info_type_ext1 ? n2_sm_info_type_ext1Variable : 0,
sm_context_ref ? ogs_strdup(sm_context_ref->valuestring) : NULL,
up_cnx_state ? up_cnx_state_local_nonprim : NULL,
up_cnx_state ? up_cnx_stateVariable : 0,
small_data_rate_status ? small_data_rate_status_local_nonprim : NULL,
apn_rate_status ? apn_rate_status_local_nonprim : NULL,
extended_nas_sm_timer_ind ? extended_nas_sm_timer_ind->valueint : 0,

View File

@ -54,7 +54,7 @@ typedef struct OpenAPI_sm_context_create_data_s {
struct OpenAPI_guami_s *guami;
char *service_name;
struct OpenAPI_plmn_id_nid_s *serving_network;
struct OpenAPI_request_type_s *request_type;
OpenAPI_request_type_e request_type;
struct OpenAPI_ref_to_binary_data_s *n1_sm_msg;
OpenAPI_access_type_e an_type;
OpenAPI_access_type_e additional_an_type;
@ -71,18 +71,18 @@ typedef struct OpenAPI_sm_context_create_data_s {
int old_pdu_session_id;
OpenAPI_list_t *pdu_sessions_activate_list;
char *ue_eps_pdn_connection;
struct OpenAPI_ho_state_s *ho_state;
OpenAPI_ho_state_e ho_state;
char *pcf_id;
char *pcf_group_id;
char *pcf_set_id;
char *nrf_uri;
char *supported_features;
struct OpenAPI_dnn_selection_mode_s *sel_mode;
OpenAPI_dnn_selection_mode_e sel_mode;
OpenAPI_list_t *backup_amf_info;
struct OpenAPI_trace_data_s *trace_data;
char *udm_group_id;
char *routing_indicator;
struct OpenAPI_eps_interworking_indication_s *eps_interworking_ind;
OpenAPI_eps_interworking_indication_e eps_interworking_ind;
int indirect_forwarding_flag;
struct OpenAPI_ng_ran_target_id_s *target_id;
char *eps_bearer_ctx_status;
@ -96,7 +96,7 @@ typedef struct OpenAPI_sm_context_create_data_s {
struct OpenAPI_ref_to_binary_data_s *n2_sm_info_ext1;
OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1;
char *sm_context_ref;
struct OpenAPI_up_cnx_state_s *up_cnx_state;
OpenAPI_up_cnx_state_e up_cnx_state;
struct OpenAPI_small_data_rate_status_s *small_data_rate_status;
struct OpenAPI_apn_rate_status_s *apn_rate_status;
int extended_nas_sm_timer_ind;
@ -123,7 +123,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_create(
OpenAPI_guami_t *guami,
char *service_name,
OpenAPI_plmn_id_nid_t *serving_network,
OpenAPI_request_type_t *request_type,
OpenAPI_request_type_e request_type,
OpenAPI_ref_to_binary_data_t *n1_sm_msg,
OpenAPI_access_type_e an_type,
OpenAPI_access_type_e additional_an_type,
@ -140,18 +140,18 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_create(
int old_pdu_session_id,
OpenAPI_list_t *pdu_sessions_activate_list,
char *ue_eps_pdn_connection,
OpenAPI_ho_state_t *ho_state,
OpenAPI_ho_state_e ho_state,
char *pcf_id,
char *pcf_group_id,
char *pcf_set_id,
char *nrf_uri,
char *supported_features,
OpenAPI_dnn_selection_mode_t *sel_mode,
OpenAPI_dnn_selection_mode_e sel_mode,
OpenAPI_list_t *backup_amf_info,
OpenAPI_trace_data_t *trace_data,
char *udm_group_id,
char *routing_indicator,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
int indirect_forwarding_flag,
OpenAPI_ng_ran_target_id_t *target_id,
char *eps_bearer_ctx_status,
@ -165,7 +165,7 @@ OpenAPI_sm_context_create_data_t *OpenAPI_sm_context_create_data_create(
OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1,
OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1,
char *sm_context_ref,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_small_data_rate_status_t *small_data_rate_status,
OpenAPI_apn_rate_status_t *apn_rate_status,
int extended_nas_sm_timer_ind,

View File

@ -9,11 +9,11 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_create(
char *smf_uri,
int pdu_session_id,
OpenAPI_snssai_t *s_nssai,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_ref_to_binary_data_t *n2_sm_info,
OpenAPI_n2_sm_info_type_e n2_sm_info_type,
OpenAPI_list_t *allocated_ebi_list,
OpenAPI_ho_state_t *ho_state,
OpenAPI_ho_state_e ho_state,
char *gpsi,
char *smf_service_instance_id,
char *recovery_time,
@ -50,13 +50,11 @@ void OpenAPI_sm_context_created_data_free(OpenAPI_sm_context_created_data_t *sm_
ogs_free(sm_context_created_data->h_smf_uri);
ogs_free(sm_context_created_data->smf_uri);
OpenAPI_snssai_free(sm_context_created_data->s_nssai);
OpenAPI_up_cnx_state_free(sm_context_created_data->up_cnx_state);
OpenAPI_ref_to_binary_data_free(sm_context_created_data->n2_sm_info);
OpenAPI_list_for_each(sm_context_created_data->allocated_ebi_list, node) {
OpenAPI_ebi_arp_mapping_free(node->data);
}
OpenAPI_list_free(sm_context_created_data->allocated_ebi_list);
OpenAPI_ho_state_free(sm_context_created_data->ho_state);
ogs_free(sm_context_created_data->gpsi);
ogs_free(sm_context_created_data->smf_service_instance_id);
ogs_free(sm_context_created_data->recovery_time);
@ -109,13 +107,7 @@ cJSON *OpenAPI_sm_context_created_data_convertToJSON(OpenAPI_sm_context_created_
}
if (sm_context_created_data->up_cnx_state) {
cJSON *up_cnx_state_local_JSON = OpenAPI_up_cnx_state_convertToJSON(sm_context_created_data->up_cnx_state);
if (up_cnx_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
cJSON_AddItemToObject(item, "upCnxState", up_cnx_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_created_data->up_cnx_state)) == NULL) {
ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
@ -162,13 +154,7 @@ cJSON *OpenAPI_sm_context_created_data_convertToJSON(OpenAPI_sm_context_created_
}
if (sm_context_created_data->ho_state) {
cJSON *ho_state_local_JSON = OpenAPI_ho_state_convertToJSON(sm_context_created_data->ho_state);
if (ho_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [ho_state]");
goto end;
}
cJSON_AddItemToObject(item, "hoState", ho_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_created_data->ho_state)) == NULL) {
ogs_error("OpenAPI_sm_context_created_data_convertToJSON() failed [ho_state]");
goto end;
}
@ -245,9 +231,13 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON
cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "upCnxState");
OpenAPI_up_cnx_state_t *up_cnx_state_local_nonprim = NULL;
OpenAPI_up_cnx_state_e up_cnx_stateVariable;
if (up_cnx_state) {
up_cnx_state_local_nonprim = OpenAPI_up_cnx_state_parseFromJSON(up_cnx_state);
if (!cJSON_IsString(up_cnx_state)) {
ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [up_cnx_state]");
goto end;
}
up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring);
}
cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "n2SmInfo");
@ -293,9 +283,13 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON
cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "hoState");
OpenAPI_ho_state_t *ho_state_local_nonprim = NULL;
OpenAPI_ho_state_e ho_stateVariable;
if (ho_state) {
ho_state_local_nonprim = OpenAPI_ho_state_parseFromJSON(ho_state);
if (!cJSON_IsString(ho_state)) {
ogs_error("OpenAPI_sm_context_created_data_parseFromJSON() failed [ho_state]");
goto end;
}
ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring);
}
cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(sm_context_created_dataJSON, "gpsi");
@ -339,11 +333,11 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_parseFromJSON
smf_uri ? ogs_strdup(smf_uri->valuestring) : NULL,
pdu_session_id ? pdu_session_id->valuedouble : 0,
s_nssai ? s_nssai_local_nonprim : NULL,
up_cnx_state ? up_cnx_state_local_nonprim : NULL,
up_cnx_state ? up_cnx_stateVariable : 0,
n2_sm_info ? n2_sm_info_local_nonprim : NULL,
n2_sm_info_type ? n2_sm_info_typeVariable : 0,
allocated_ebi_list ? allocated_ebi_listList : NULL,
ho_state ? ho_state_local_nonprim : NULL,
ho_state ? ho_stateVariable : 0,
gpsi ? ogs_strdup(gpsi->valuestring) : NULL,
smf_service_instance_id ? ogs_strdup(smf_service_instance_id->valuestring) : NULL,
recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL,

View File

@ -29,11 +29,11 @@ typedef struct OpenAPI_sm_context_created_data_s {
char *smf_uri;
int pdu_session_id;
struct OpenAPI_snssai_s *s_nssai;
struct OpenAPI_up_cnx_state_s *up_cnx_state;
OpenAPI_up_cnx_state_e up_cnx_state;
struct OpenAPI_ref_to_binary_data_s *n2_sm_info;
OpenAPI_n2_sm_info_type_e n2_sm_info_type;
OpenAPI_list_t *allocated_ebi_list;
struct OpenAPI_ho_state_s *ho_state;
OpenAPI_ho_state_e ho_state;
char *gpsi;
char *smf_service_instance_id;
char *recovery_time;
@ -45,11 +45,11 @@ OpenAPI_sm_context_created_data_t *OpenAPI_sm_context_created_data_create(
char *smf_uri,
int pdu_session_id,
OpenAPI_snssai_t *s_nssai,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_ref_to_binary_data_t *n2_sm_info,
OpenAPI_n2_sm_info_type_e n2_sm_info_type,
OpenAPI_list_t *allocated_ebi_list,
OpenAPI_ho_state_t *ho_state,
OpenAPI_ho_state_e ho_state,
char *gpsi,
char *smf_service_instance_id,
char *recovery_time,

View File

@ -5,7 +5,7 @@
#include "sm_context_release_data.h"
OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_create(
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
OpenAPI_user_location_t *ue_location,
@ -41,7 +41,6 @@ void OpenAPI_sm_context_release_data_free(OpenAPI_sm_context_release_data_t *sm_
return;
}
OpenAPI_lnode_t *node;
OpenAPI_cause_free(sm_context_release_data->cause);
OpenAPI_ng_ap_cause_free(sm_context_release_data->ng_ap_cause);
OpenAPI_user_location_free(sm_context_release_data->ue_location);
ogs_free(sm_context_release_data->ue_time_zone);
@ -61,13 +60,7 @@ cJSON *OpenAPI_sm_context_release_data_convertToJSON(OpenAPI_sm_context_release_
item = cJSON_CreateObject();
if (sm_context_release_data->cause) {
cJSON *cause_local_JSON = OpenAPI_cause_convertToJSON(sm_context_release_data->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_release_data_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(sm_context_release_data->cause)) == NULL) {
ogs_error("OpenAPI_sm_context_release_data_convertToJSON() failed [cause]");
goto end;
}
@ -169,9 +162,13 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON
OpenAPI_sm_context_release_data_t *sm_context_release_data_local_var = NULL;
cJSON *cause = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "cause");
OpenAPI_cause_t *cause_local_nonprim = NULL;
OpenAPI_cause_e causeVariable;
if (cause) {
cause_local_nonprim = OpenAPI_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_sm_context_release_data_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_cause_FromString(cause->valuestring);
}
cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(sm_context_release_dataJSON, "ngApCause");
@ -250,7 +247,7 @@ OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_parseFromJSON
}
sm_context_release_data_local_var = OpenAPI_sm_context_release_data_create (
cause ? cause_local_nonprim : NULL,
cause ? causeVariable : 0,
ng_ap_cause ? ng_ap_cause_local_nonprim : NULL,
_5g_mm_cause_value ? _5g_mm_cause_value->valuedouble : 0,
ue_location ? ue_location_local_nonprim : NULL,

View File

@ -24,7 +24,7 @@ extern "C" {
typedef struct OpenAPI_sm_context_release_data_s OpenAPI_sm_context_release_data_t;
typedef struct OpenAPI_sm_context_release_data_s {
struct OpenAPI_cause_s *cause;
OpenAPI_cause_e cause;
struct OpenAPI_ng_ap_cause_s *ng_ap_cause;
int _5g_mm_cause_value;
struct OpenAPI_user_location_s *ue_location;
@ -37,7 +37,7 @@ typedef struct OpenAPI_sm_context_release_data_s {
} OpenAPI_sm_context_release_data_t;
OpenAPI_sm_context_release_data_t *OpenAPI_sm_context_release_data_create(
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
OpenAPI_user_location_t *ue_location,

View File

@ -6,7 +6,7 @@
OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_create(
OpenAPI_mme_capabilities_t *target_mme_cap,
OpenAPI_sm_context_type_t *sm_context_type,
OpenAPI_sm_context_type_e sm_context_type,
OpenAPI_plmn_id_t *serving_network,
OpenAPI_list_t *not_to_transfer_ebi_list
)
@ -30,7 +30,6 @@ void OpenAPI_sm_context_retrieve_data_free(OpenAPI_sm_context_retrieve_data_t *s
}
OpenAPI_lnode_t *node;
OpenAPI_mme_capabilities_free(sm_context_retrieve_data->target_mme_cap);
OpenAPI_sm_context_type_free(sm_context_retrieve_data->sm_context_type);
OpenAPI_plmn_id_free(sm_context_retrieve_data->serving_network);
OpenAPI_list_for_each(sm_context_retrieve_data->not_to_transfer_ebi_list, node) {
ogs_free(node->data);
@ -63,13 +62,7 @@ cJSON *OpenAPI_sm_context_retrieve_data_convertToJSON(OpenAPI_sm_context_retriev
}
if (sm_context_retrieve_data->sm_context_type) {
cJSON *sm_context_type_local_JSON = OpenAPI_sm_context_type_convertToJSON(sm_context_retrieve_data->sm_context_type);
if (sm_context_type_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_retrieve_data_convertToJSON() failed [sm_context_type]");
goto end;
}
cJSON_AddItemToObject(item, "smContextType", sm_context_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "smContextType", OpenAPI_sm_context_type_ToString(sm_context_retrieve_data->sm_context_type)) == NULL) {
ogs_error("OpenAPI_sm_context_retrieve_data_convertToJSON() failed [sm_context_type]");
goto end;
}
@ -120,9 +113,13 @@ OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_parseFromJS
cJSON *sm_context_type = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "smContextType");
OpenAPI_sm_context_type_t *sm_context_type_local_nonprim = NULL;
OpenAPI_sm_context_type_e sm_context_typeVariable;
if (sm_context_type) {
sm_context_type_local_nonprim = OpenAPI_sm_context_type_parseFromJSON(sm_context_type);
if (!cJSON_IsString(sm_context_type)) {
ogs_error("OpenAPI_sm_context_retrieve_data_parseFromJSON() failed [sm_context_type]");
goto end;
}
sm_context_typeVariable = OpenAPI_sm_context_type_FromString(sm_context_type->valuestring);
}
cJSON *serving_network = cJSON_GetObjectItemCaseSensitive(sm_context_retrieve_dataJSON, "servingNetwork");
@ -154,7 +151,7 @@ OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_parseFromJS
sm_context_retrieve_data_local_var = OpenAPI_sm_context_retrieve_data_create (
target_mme_cap ? target_mme_cap_local_nonprim : NULL,
sm_context_type ? sm_context_type_local_nonprim : NULL,
sm_context_type ? sm_context_typeVariable : 0,
serving_network ? serving_network_local_nonprim : NULL,
not_to_transfer_ebi_list ? not_to_transfer_ebi_listList : NULL
);

View File

@ -23,14 +23,14 @@ extern "C" {
typedef struct OpenAPI_sm_context_retrieve_data_s OpenAPI_sm_context_retrieve_data_t;
typedef struct OpenAPI_sm_context_retrieve_data_s {
struct OpenAPI_mme_capabilities_s *target_mme_cap;
struct OpenAPI_sm_context_type_s *sm_context_type;
OpenAPI_sm_context_type_e sm_context_type;
struct OpenAPI_plmn_id_s *serving_network;
OpenAPI_list_t *not_to_transfer_ebi_list;
} OpenAPI_sm_context_retrieve_data_t;
OpenAPI_sm_context_retrieve_data_t *OpenAPI_sm_context_retrieve_data_create(
OpenAPI_mme_capabilities_t *target_mme_cap,
OpenAPI_sm_context_type_t *sm_context_type,
OpenAPI_sm_context_type_e sm_context_type,
OpenAPI_plmn_id_t *serving_network,
OpenAPI_list_t *not_to_transfer_ebi_list
);

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "sm_context_type.h"
OpenAPI_sm_context_type_t *OpenAPI_sm_context_type_create(
)
char* OpenAPI_sm_context_type_ToString(OpenAPI_sm_context_type_e sm_context_type)
{
OpenAPI_sm_context_type_t *sm_context_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_sm_context_type_t));
if (!sm_context_type_local_var) {
return NULL;
}
return sm_context_type_local_var;
const char *sm_context_typeArray[] = { "NULL", "EPS_PDN_CONNECTION", "SM_CONTEXT" };
size_t sizeofArray = sizeof(sm_context_typeArray) / sizeof(sm_context_typeArray[0]);
if (sm_context_type < sizeofArray)
return (char *)sm_context_typeArray[sm_context_type];
else
return (char *)"Unknown";
}
void OpenAPI_sm_context_type_free(OpenAPI_sm_context_type_t *sm_context_type)
OpenAPI_sm_context_type_e OpenAPI_sm_context_type_FromString(char* sm_context_type)
{
if (NULL == sm_context_type) {
return;
int stringToReturn = 0;
const char *sm_context_typeArray[] = { "NULL", "EPS_PDN_CONNECTION", "SM_CONTEXT" };
size_t sizeofArray = sizeof(sm_context_typeArray) / sizeof(sm_context_typeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(sm_context_type, sm_context_typeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(sm_context_type);
}
cJSON *OpenAPI_sm_context_type_convertToJSON(OpenAPI_sm_context_type_t *sm_context_type)
{
cJSON *item = NULL;
if (sm_context_type == NULL) {
ogs_error("OpenAPI_sm_context_type_convertToJSON() failed [SmContextType]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_sm_context_type_t *OpenAPI_sm_context_type_parseFromJSON(cJSON *sm_context_typeJSON)
{
OpenAPI_sm_context_type_t *sm_context_type_local_var = NULL;
sm_context_type_local_var = OpenAPI_sm_context_type_create (
);
return sm_context_type_local_var;
end:
return NULL;
}
OpenAPI_sm_context_type_t *OpenAPI_sm_context_type_copy(OpenAPI_sm_context_type_t *dst, OpenAPI_sm_context_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_sm_context_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_sm_context_type_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_sm_context_type_free(dst);
dst = OpenAPI_sm_context_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* sm_context_type.h
*
* Possible values are - EPS_PDN_CONNECTION - SM_CONTEXT
*
*/
#ifndef _OpenAPI_sm_context_type_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_sm_context_type_s OpenAPI_sm_context_type_t;
typedef struct OpenAPI_sm_context_type_s {
} OpenAPI_sm_context_type_t;
typedef enum { OpenAPI_sm_context_type_NULL = 0, OpenAPI_sm_context_type_EPS_PDN_CONNECTION, OpenAPI_sm_context_type_SM_CONTEXT } OpenAPI_sm_context_type_e;
OpenAPI_sm_context_type_t *OpenAPI_sm_context_type_create(
);
void OpenAPI_sm_context_type_free(OpenAPI_sm_context_type_t *sm_context_type);
OpenAPI_sm_context_type_t *OpenAPI_sm_context_type_parseFromJSON(cJSON *sm_context_typeJSON);
cJSON *OpenAPI_sm_context_type_convertToJSON(OpenAPI_sm_context_type_t *sm_context_type);
OpenAPI_sm_context_type_t *OpenAPI_sm_context_type_copy(OpenAPI_sm_context_type_t *dst, OpenAPI_sm_context_type_t *src);
char* OpenAPI_sm_context_type_ToString(OpenAPI_sm_context_type_e sm_context_type);
OpenAPI_sm_context_type_e OpenAPI_sm_context_type_FromString(char* sm_context_type);
#ifdef __cplusplus
}

View File

@ -17,8 +17,8 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_create(
OpenAPI_user_location_t *ue_location,
char *ue_time_zone,
OpenAPI_user_location_t *add_ue_location,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_ho_state_t *ho_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_ho_state_e ho_state,
int to_be_switched,
int failed_to_be_switched,
OpenAPI_ref_to_binary_data_t *n1_sm_msg,
@ -34,16 +34,16 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_create(
OpenAPI_list_t *eps_bearer_setup,
OpenAPI_list_t *revoke_ebi_list,
int release,
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
OpenAPI_snssai_t *s_nssai,
OpenAPI_trace_data_t *trace_data,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
int an_type_can_be_changed,
OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1,
OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1,
OpenAPI_ma_release_indication_t *ma_release_ind,
OpenAPI_ma_release_indication_e ma_release_ind,
int ma_nw_upgrade_ind,
int ma_request_ind,
OpenAPI_exemption_ind_t *exemption_ind,
@ -131,8 +131,6 @@ void OpenAPI_sm_context_update_data_free(OpenAPI_sm_context_update_data_t *sm_co
OpenAPI_user_location_free(sm_context_update_data->ue_location);
ogs_free(sm_context_update_data->ue_time_zone);
OpenAPI_user_location_free(sm_context_update_data->add_ue_location);
OpenAPI_up_cnx_state_free(sm_context_update_data->up_cnx_state);
OpenAPI_ho_state_free(sm_context_update_data->ho_state);
OpenAPI_ref_to_binary_data_free(sm_context_update_data->n1_sm_msg);
OpenAPI_ref_to_binary_data_free(sm_context_update_data->n2_sm_info);
OpenAPI_ng_ran_target_id_free(sm_context_update_data->target_id);
@ -155,13 +153,10 @@ void OpenAPI_sm_context_update_data_free(OpenAPI_sm_context_update_data_t *sm_co
ogs_free(node->data);
}
OpenAPI_list_free(sm_context_update_data->revoke_ebi_list);
OpenAPI_cause_free(sm_context_update_data->cause);
OpenAPI_ng_ap_cause_free(sm_context_update_data->ng_ap_cause);
OpenAPI_snssai_free(sm_context_update_data->s_nssai);
OpenAPI_trace_data_free(sm_context_update_data->trace_data);
OpenAPI_eps_interworking_indication_free(sm_context_update_data->eps_interworking_ind);
OpenAPI_ref_to_binary_data_free(sm_context_update_data->n2_sm_info_ext1);
OpenAPI_ma_release_indication_free(sm_context_update_data->ma_release_ind);
OpenAPI_exemption_ind_free(sm_context_update_data->exemption_ind);
ogs_free(sm_context_update_data->supported_features);
OpenAPI_mo_exception_data_flag_free(sm_context_update_data->mo_exp_data_ind);
@ -312,26 +307,14 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da
}
if (sm_context_update_data->up_cnx_state) {
cJSON *up_cnx_state_local_JSON = OpenAPI_up_cnx_state_convertToJSON(sm_context_update_data->up_cnx_state);
if (up_cnx_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
cJSON_AddItemToObject(item, "upCnxState", up_cnx_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_update_data->up_cnx_state)) == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
}
if (sm_context_update_data->ho_state) {
cJSON *ho_state_local_JSON = OpenAPI_ho_state_convertToJSON(sm_context_update_data->ho_state);
if (ho_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [ho_state]");
goto end;
}
cJSON_AddItemToObject(item, "hoState", ho_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_update_data->ho_state)) == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [ho_state]");
goto end;
}
@ -511,13 +494,7 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da
}
if (sm_context_update_data->cause) {
cJSON *cause_local_JSON = OpenAPI_cause_convertToJSON(sm_context_update_data->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(sm_context_update_data->cause)) == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [cause]");
goto end;
}
@ -570,13 +547,7 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da
}
if (sm_context_update_data->eps_interworking_ind) {
cJSON *eps_interworking_ind_local_JSON = OpenAPI_eps_interworking_indication_convertToJSON(sm_context_update_data->eps_interworking_ind);
if (eps_interworking_ind_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInd", eps_interworking_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "epsInterworkingInd", OpenAPI_eps_interworking_indication_ToString(sm_context_update_data->eps_interworking_ind)) == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [eps_interworking_ind]");
goto end;
}
@ -610,13 +581,7 @@ cJSON *OpenAPI_sm_context_update_data_convertToJSON(OpenAPI_sm_context_update_da
}
if (sm_context_update_data->ma_release_ind) {
cJSON *ma_release_ind_local_JSON = OpenAPI_ma_release_indication_convertToJSON(sm_context_update_data->ma_release_ind);
if (ma_release_ind_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [ma_release_ind]");
goto end;
}
cJSON_AddItemToObject(item, "maReleaseInd", ma_release_ind_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "maReleaseInd", OpenAPI_ma_release_indication_ToString(sm_context_update_data->ma_release_ind)) == NULL) {
ogs_error("OpenAPI_sm_context_update_data_convertToJSON() failed [ma_release_ind]");
goto end;
}
@ -852,16 +817,24 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c
cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "upCnxState");
OpenAPI_up_cnx_state_t *up_cnx_state_local_nonprim = NULL;
OpenAPI_up_cnx_state_e up_cnx_stateVariable;
if (up_cnx_state) {
up_cnx_state_local_nonprim = OpenAPI_up_cnx_state_parseFromJSON(up_cnx_state);
if (!cJSON_IsString(up_cnx_state)) {
ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [up_cnx_state]");
goto end;
}
up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring);
}
cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "hoState");
OpenAPI_ho_state_t *ho_state_local_nonprim = NULL;
OpenAPI_ho_state_e ho_stateVariable;
if (ho_state) {
ho_state_local_nonprim = OpenAPI_ho_state_parseFromJSON(ho_state);
if (!cJSON_IsString(ho_state)) {
ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [ho_state]");
goto end;
}
ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring);
}
cJSON *to_be_switched = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "toBeSwitched");
@ -1045,9 +1018,13 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c
cJSON *cause = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "cause");
OpenAPI_cause_t *cause_local_nonprim = NULL;
OpenAPI_cause_e causeVariable;
if (cause) {
cause_local_nonprim = OpenAPI_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_cause_FromString(cause->valuestring);
}
cJSON *ng_ap_cause = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "ngApCause");
@ -1082,9 +1059,13 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c
cJSON *eps_interworking_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "epsInterworkingInd");
OpenAPI_eps_interworking_indication_t *eps_interworking_ind_local_nonprim = NULL;
OpenAPI_eps_interworking_indication_e eps_interworking_indVariable;
if (eps_interworking_ind) {
eps_interworking_ind_local_nonprim = OpenAPI_eps_interworking_indication_parseFromJSON(eps_interworking_ind);
if (!cJSON_IsString(eps_interworking_ind)) {
ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [eps_interworking_ind]");
goto end;
}
eps_interworking_indVariable = OpenAPI_eps_interworking_indication_FromString(eps_interworking_ind->valuestring);
}
cJSON *an_type_can_be_changed = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "anTypeCanBeChanged");
@ -1116,9 +1097,13 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c
cJSON *ma_release_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maReleaseInd");
OpenAPI_ma_release_indication_t *ma_release_ind_local_nonprim = NULL;
OpenAPI_ma_release_indication_e ma_release_indVariable;
if (ma_release_ind) {
ma_release_ind_local_nonprim = OpenAPI_ma_release_indication_parseFromJSON(ma_release_ind);
if (!cJSON_IsString(ma_release_ind)) {
ogs_error("OpenAPI_sm_context_update_data_parseFromJSON() failed [ma_release_ind]");
goto end;
}
ma_release_indVariable = OpenAPI_ma_release_indication_FromString(ma_release_ind->valuestring);
}
cJSON *ma_nw_upgrade_ind = cJSON_GetObjectItemCaseSensitive(sm_context_update_dataJSON, "maNwUpgradeInd");
@ -1227,8 +1212,8 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c
ue_location ? ue_location_local_nonprim : NULL,
ue_time_zone ? ogs_strdup(ue_time_zone->valuestring) : NULL,
add_ue_location ? add_ue_location_local_nonprim : NULL,
up_cnx_state ? up_cnx_state_local_nonprim : NULL,
ho_state ? ho_state_local_nonprim : NULL,
up_cnx_state ? up_cnx_stateVariable : 0,
ho_state ? ho_stateVariable : 0,
to_be_switched ? to_be_switched->valueint : 0,
failed_to_be_switched ? failed_to_be_switched->valueint : 0,
n1_sm_msg ? n1_sm_msg_local_nonprim : NULL,
@ -1244,16 +1229,16 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_parseFromJSON(c
eps_bearer_setup ? eps_bearer_setupList : NULL,
revoke_ebi_list ? revoke_ebi_listList : NULL,
release ? release->valueint : 0,
cause ? cause_local_nonprim : NULL,
cause ? causeVariable : 0,
ng_ap_cause ? ng_ap_cause_local_nonprim : NULL,
_5g_mm_cause_value ? _5g_mm_cause_value->valuedouble : 0,
s_nssai ? s_nssai_local_nonprim : NULL,
trace_data ? trace_data_local_nonprim : NULL,
eps_interworking_ind ? eps_interworking_ind_local_nonprim : NULL,
eps_interworking_ind ? eps_interworking_indVariable : 0,
an_type_can_be_changed ? an_type_can_be_changed->valueint : 0,
n2_sm_info_ext1 ? n2_sm_info_ext1_local_nonprim : NULL,
n2_sm_info_type_ext1 ? n2_sm_info_type_ext1Variable : 0,
ma_release_ind ? ma_release_ind_local_nonprim : NULL,
ma_release_ind ? ma_release_indVariable : 0,
ma_nw_upgrade_ind ? ma_nw_upgrade_ind->valueint : 0,
ma_request_ind ? ma_request_ind->valueint : 0,
exemption_ind ? exemption_ind_local_nonprim : NULL,

View File

@ -55,8 +55,8 @@ typedef struct OpenAPI_sm_context_update_data_s {
struct OpenAPI_user_location_s *ue_location;
char *ue_time_zone;
struct OpenAPI_user_location_s *add_ue_location;
struct OpenAPI_up_cnx_state_s *up_cnx_state;
struct OpenAPI_ho_state_s *ho_state;
OpenAPI_up_cnx_state_e up_cnx_state;
OpenAPI_ho_state_e ho_state;
int to_be_switched;
int failed_to_be_switched;
struct OpenAPI_ref_to_binary_data_s *n1_sm_msg;
@ -72,16 +72,16 @@ typedef struct OpenAPI_sm_context_update_data_s {
OpenAPI_list_t *eps_bearer_setup;
OpenAPI_list_t *revoke_ebi_list;
int release;
struct OpenAPI_cause_s *cause;
OpenAPI_cause_e cause;
struct OpenAPI_ng_ap_cause_s *ng_ap_cause;
int _5g_mm_cause_value;
struct OpenAPI_snssai_s *s_nssai;
struct OpenAPI_trace_data_s *trace_data;
struct OpenAPI_eps_interworking_indication_s *eps_interworking_ind;
OpenAPI_eps_interworking_indication_e eps_interworking_ind;
int an_type_can_be_changed;
struct OpenAPI_ref_to_binary_data_s *n2_sm_info_ext1;
OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1;
struct OpenAPI_ma_release_indication_s *ma_release_ind;
OpenAPI_ma_release_indication_e ma_release_ind;
int ma_nw_upgrade_ind;
int ma_request_ind;
struct OpenAPI_exemption_ind_s *exemption_ind;
@ -107,8 +107,8 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_create(
OpenAPI_user_location_t *ue_location,
char *ue_time_zone,
OpenAPI_user_location_t *add_ue_location,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_ho_state_t *ho_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_ho_state_e ho_state,
int to_be_switched,
int failed_to_be_switched,
OpenAPI_ref_to_binary_data_t *n1_sm_msg,
@ -124,16 +124,16 @@ OpenAPI_sm_context_update_data_t *OpenAPI_sm_context_update_data_create(
OpenAPI_list_t *eps_bearer_setup,
OpenAPI_list_t *revoke_ebi_list,
int release,
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
OpenAPI_ng_ap_cause_t *ng_ap_cause,
int _5g_mm_cause_value,
OpenAPI_snssai_t *s_nssai,
OpenAPI_trace_data_t *trace_data,
OpenAPI_eps_interworking_indication_t *eps_interworking_ind,
OpenAPI_eps_interworking_indication_e eps_interworking_ind,
int an_type_can_be_changed,
OpenAPI_ref_to_binary_data_t *n2_sm_info_ext1,
OpenAPI_n2_sm_info_type_e n2_sm_info_type_ext1,
OpenAPI_ma_release_indication_t *ma_release_ind,
OpenAPI_ma_release_indication_e ma_release_ind,
int ma_nw_upgrade_ind,
int ma_request_ind,
OpenAPI_exemption_ind_t *exemption_ind,

View File

@ -9,7 +9,7 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_create(
OpenAPI_ref_to_binary_data_t *n1_sm_msg,
OpenAPI_ref_to_binary_data_t *n2_sm_info,
OpenAPI_n2_sm_info_type_e n2_sm_info_type,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_up_cnx_state_e up_cnx_state,
char *recovery_time
)
{
@ -36,7 +36,6 @@ void OpenAPI_sm_context_update_error_free(OpenAPI_sm_context_update_error_t *sm_
OpenAPI_problem_details_free(sm_context_update_error->error);
OpenAPI_ref_to_binary_data_free(sm_context_update_error->n1_sm_msg);
OpenAPI_ref_to_binary_data_free(sm_context_update_error->n2_sm_info);
OpenAPI_up_cnx_state_free(sm_context_update_error->up_cnx_state);
ogs_free(sm_context_update_error->recovery_time);
ogs_free(sm_context_update_error);
}
@ -100,13 +99,7 @@ cJSON *OpenAPI_sm_context_update_error_convertToJSON(OpenAPI_sm_context_update_e
}
if (sm_context_update_error->up_cnx_state) {
cJSON *up_cnx_state_local_JSON = OpenAPI_up_cnx_state_convertToJSON(sm_context_update_error->up_cnx_state);
if (up_cnx_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_update_error_convertToJSON() failed [up_cnx_state]");
goto end;
}
cJSON_AddItemToObject(item, "upCnxState", up_cnx_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_update_error->up_cnx_state)) == NULL) {
ogs_error("OpenAPI_sm_context_update_error_convertToJSON() failed [up_cnx_state]");
goto end;
}
@ -163,9 +156,13 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_parseFromJSON
cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "upCnxState");
OpenAPI_up_cnx_state_t *up_cnx_state_local_nonprim = NULL;
OpenAPI_up_cnx_state_e up_cnx_stateVariable;
if (up_cnx_state) {
up_cnx_state_local_nonprim = OpenAPI_up_cnx_state_parseFromJSON(up_cnx_state);
if (!cJSON_IsString(up_cnx_state)) {
ogs_error("OpenAPI_sm_context_update_error_parseFromJSON() failed [up_cnx_state]");
goto end;
}
up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring);
}
cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_update_errorJSON, "recoveryTime");
@ -182,7 +179,7 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_parseFromJSON
n1_sm_msg ? n1_sm_msg_local_nonprim : NULL,
n2_sm_info ? n2_sm_info_local_nonprim : NULL,
n2_sm_info_type ? n2_sm_info_typeVariable : 0,
up_cnx_state ? up_cnx_state_local_nonprim : NULL,
up_cnx_state ? up_cnx_stateVariable : 0,
recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL
);

View File

@ -27,7 +27,7 @@ typedef struct OpenAPI_sm_context_update_error_s {
struct OpenAPI_ref_to_binary_data_s *n1_sm_msg;
struct OpenAPI_ref_to_binary_data_s *n2_sm_info;
OpenAPI_n2_sm_info_type_e n2_sm_info_type;
struct OpenAPI_up_cnx_state_s *up_cnx_state;
OpenAPI_up_cnx_state_e up_cnx_state;
char *recovery_time;
} OpenAPI_sm_context_update_error_t;
@ -36,7 +36,7 @@ OpenAPI_sm_context_update_error_t *OpenAPI_sm_context_update_error_create(
OpenAPI_ref_to_binary_data_t *n1_sm_msg,
OpenAPI_ref_to_binary_data_t *n2_sm_info,
OpenAPI_n2_sm_info_type_e n2_sm_info_type,
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_up_cnx_state_e up_cnx_state,
char *recovery_time
);
void OpenAPI_sm_context_update_error_free(OpenAPI_sm_context_update_error_t *sm_context_update_error);

View File

@ -5,8 +5,8 @@
#include "sm_context_updated_data.h"
OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_create(
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_ho_state_t *ho_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_ho_state_e ho_state,
OpenAPI_list_t *release_ebi_list,
OpenAPI_list_t *allocated_ebi_list,
OpenAPI_list_t *modified_ebi_list,
@ -17,7 +17,7 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_create(
int data_forwarding,
OpenAPI_list_t *n3_dl_forwarding_tnl_list,
OpenAPI_list_t *n3_ul_forwarding_tnl_list,
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
int ma_accepted_ind,
char *supported_features,
char forwarding_f_teid,
@ -55,8 +55,6 @@ void OpenAPI_sm_context_updated_data_free(OpenAPI_sm_context_updated_data_t *sm_
return;
}
OpenAPI_lnode_t *node;
OpenAPI_up_cnx_state_free(sm_context_updated_data->up_cnx_state);
OpenAPI_ho_state_free(sm_context_updated_data->ho_state);
OpenAPI_list_for_each(sm_context_updated_data->release_ebi_list, node) {
ogs_free(node->data);
}
@ -83,7 +81,6 @@ void OpenAPI_sm_context_updated_data_free(OpenAPI_sm_context_updated_data_t *sm_
OpenAPI_indirect_data_forwarding_tunnel_info_free(node->data);
}
OpenAPI_list_free(sm_context_updated_data->n3_ul_forwarding_tnl_list);
OpenAPI_cause_free(sm_context_updated_data->cause);
ogs_free(sm_context_updated_data->supported_features);
OpenAPI_list_for_each(sm_context_updated_data->forwarding_bearer_contexts, node) {
ogs_free(node->data);
@ -103,26 +100,14 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_
item = cJSON_CreateObject();
if (sm_context_updated_data->up_cnx_state) {
cJSON *up_cnx_state_local_JSON = OpenAPI_up_cnx_state_convertToJSON(sm_context_updated_data->up_cnx_state);
if (up_cnx_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
cJSON_AddItemToObject(item, "upCnxState", up_cnx_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "upCnxState", OpenAPI_up_cnx_state_ToString(sm_context_updated_data->up_cnx_state)) == NULL) {
ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [up_cnx_state]");
goto end;
}
}
if (sm_context_updated_data->ho_state) {
cJSON *ho_state_local_JSON = OpenAPI_ho_state_convertToJSON(sm_context_updated_data->ho_state);
if (ho_state_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [ho_state]");
goto end;
}
cJSON_AddItemToObject(item, "hoState", ho_state_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "hoState", OpenAPI_ho_state_ToString(sm_context_updated_data->ho_state)) == NULL) {
ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [ho_state]");
goto end;
}
@ -281,13 +266,7 @@ cJSON *OpenAPI_sm_context_updated_data_convertToJSON(OpenAPI_sm_context_updated_
}
if (sm_context_updated_data->cause) {
cJSON *cause_local_JSON = OpenAPI_cause_convertToJSON(sm_context_updated_data->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(sm_context_updated_data->cause)) == NULL) {
ogs_error("OpenAPI_sm_context_updated_data_convertToJSON() failed [cause]");
goto end;
}
@ -339,16 +318,24 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON
OpenAPI_sm_context_updated_data_t *sm_context_updated_data_local_var = NULL;
cJSON *up_cnx_state = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "upCnxState");
OpenAPI_up_cnx_state_t *up_cnx_state_local_nonprim = NULL;
OpenAPI_up_cnx_state_e up_cnx_stateVariable;
if (up_cnx_state) {
up_cnx_state_local_nonprim = OpenAPI_up_cnx_state_parseFromJSON(up_cnx_state);
if (!cJSON_IsString(up_cnx_state)) {
ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [up_cnx_state]");
goto end;
}
up_cnx_stateVariable = OpenAPI_up_cnx_state_FromString(up_cnx_state->valuestring);
}
cJSON *ho_state = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "hoState");
OpenAPI_ho_state_t *ho_state_local_nonprim = NULL;
OpenAPI_ho_state_e ho_stateVariable;
if (ho_state) {
ho_state_local_nonprim = OpenAPI_ho_state_parseFromJSON(ho_state);
if (!cJSON_IsString(ho_state)) {
ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [ho_state]");
goto end;
}
ho_stateVariable = OpenAPI_ho_state_FromString(ho_state->valuestring);
}
cJSON *release_ebi_list = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "releaseEbiList");
@ -519,9 +506,13 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON
cJSON *cause = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "cause");
OpenAPI_cause_t *cause_local_nonprim = NULL;
OpenAPI_cause_e causeVariable;
if (cause) {
cause_local_nonprim = OpenAPI_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_sm_context_updated_data_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_cause_FromString(cause->valuestring);
}
cJSON *ma_accepted_ind = cJSON_GetObjectItemCaseSensitive(sm_context_updated_dataJSON, "maAcceptedInd");
@ -572,8 +563,8 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON
}
sm_context_updated_data_local_var = OpenAPI_sm_context_updated_data_create (
up_cnx_state ? up_cnx_state_local_nonprim : NULL,
ho_state ? ho_state_local_nonprim : NULL,
up_cnx_state ? up_cnx_stateVariable : 0,
ho_state ? ho_stateVariable : 0,
release_ebi_list ? release_ebi_listList : NULL,
allocated_ebi_list ? allocated_ebi_listList : NULL,
modified_ebi_list ? modified_ebi_listList : NULL,
@ -584,7 +575,7 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_parseFromJSON
data_forwarding ? data_forwarding->valueint : 0,
n3_dl_forwarding_tnl_list ? n3_dl_forwarding_tnl_listList : NULL,
n3_ul_forwarding_tnl_list ? n3_ul_forwarding_tnl_listList : NULL,
cause ? cause_local_nonprim : NULL,
cause ? causeVariable : 0,
ma_accepted_ind ? ma_accepted_ind->valueint : 0,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
forwarding_f_teid ? forwarding_f_teid->valueint : 0,

View File

@ -26,8 +26,8 @@ extern "C" {
typedef struct OpenAPI_sm_context_updated_data_s OpenAPI_sm_context_updated_data_t;
typedef struct OpenAPI_sm_context_updated_data_s {
struct OpenAPI_up_cnx_state_s *up_cnx_state;
struct OpenAPI_ho_state_s *ho_state;
OpenAPI_up_cnx_state_e up_cnx_state;
OpenAPI_ho_state_e ho_state;
OpenAPI_list_t *release_ebi_list;
OpenAPI_list_t *allocated_ebi_list;
OpenAPI_list_t *modified_ebi_list;
@ -38,7 +38,7 @@ typedef struct OpenAPI_sm_context_updated_data_s {
int data_forwarding;
OpenAPI_list_t *n3_dl_forwarding_tnl_list;
OpenAPI_list_t *n3_ul_forwarding_tnl_list;
struct OpenAPI_cause_s *cause;
OpenAPI_cause_e cause;
int ma_accepted_ind;
char *supported_features;
char forwarding_f_teid;
@ -46,8 +46,8 @@ typedef struct OpenAPI_sm_context_updated_data_s {
} OpenAPI_sm_context_updated_data_t;
OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_create(
OpenAPI_up_cnx_state_t *up_cnx_state,
OpenAPI_ho_state_t *ho_state,
OpenAPI_up_cnx_state_e up_cnx_state,
OpenAPI_ho_state_e ho_state,
OpenAPI_list_t *release_ebi_list,
OpenAPI_list_t *allocated_ebi_list,
OpenAPI_list_t *modified_ebi_list,
@ -58,7 +58,7 @@ OpenAPI_sm_context_updated_data_t *OpenAPI_sm_context_updated_data_create(
int data_forwarding,
OpenAPI_list_t *n3_dl_forwarding_tnl_list,
OpenAPI_list_t *n3_ul_forwarding_tnl_list,
OpenAPI_cause_t *cause,
OpenAPI_cause_e cause,
int ma_accepted_ind,
char *supported_features,
char forwarding_f_teid,

View File

@ -5,8 +5,8 @@
#include "status_info.h"
OpenAPI_status_info_t *OpenAPI_status_info_create(
OpenAPI_resource_status_t *resource_status,
OpenAPI_cause_t *cause,
OpenAPI_resource_status_e resource_status,
OpenAPI_cause_e cause,
OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para,
OpenAPI_access_type_e an_type
)
@ -29,8 +29,6 @@ void OpenAPI_status_info_free(OpenAPI_status_info_t *status_info)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_resource_status_free(status_info->resource_status);
OpenAPI_cause_free(status_info->cause);
OpenAPI_cn_assisted_ran_para_free(status_info->cn_assisted_ran_para);
ogs_free(status_info);
}
@ -49,25 +47,13 @@ cJSON *OpenAPI_status_info_convertToJSON(OpenAPI_status_info_t *status_info)
ogs_error("OpenAPI_status_info_convertToJSON() failed [resource_status]");
goto end;
}
cJSON *resource_status_local_JSON = OpenAPI_resource_status_convertToJSON(status_info->resource_status);
if (resource_status_local_JSON == NULL) {
ogs_error("OpenAPI_status_info_convertToJSON() failed [resource_status]");
goto end;
}
cJSON_AddItemToObject(item, "resourceStatus", resource_status_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "resourceStatus", OpenAPI_resource_status_ToString(status_info->resource_status)) == NULL) {
ogs_error("OpenAPI_status_info_convertToJSON() failed [resource_status]");
goto end;
}
if (status_info->cause) {
cJSON *cause_local_JSON = OpenAPI_cause_convertToJSON(status_info->cause);
if (cause_local_JSON == NULL) {
ogs_error("OpenAPI_status_info_convertToJSON() failed [cause]");
goto end;
}
cJSON_AddItemToObject(item, "cause", cause_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "cause", OpenAPI_cause_ToString(status_info->cause)) == NULL) {
ogs_error("OpenAPI_status_info_convertToJSON() failed [cause]");
goto end;
}
@ -106,15 +92,23 @@ OpenAPI_status_info_t *OpenAPI_status_info_parseFromJSON(cJSON *status_infoJSON)
goto end;
}
OpenAPI_resource_status_t *resource_status_local_nonprim = NULL;
OpenAPI_resource_status_e resource_statusVariable;
resource_status_local_nonprim = OpenAPI_resource_status_parseFromJSON(resource_status);
if (!cJSON_IsString(resource_status)) {
ogs_error("OpenAPI_status_info_parseFromJSON() failed [resource_status]");
goto end;
}
resource_statusVariable = OpenAPI_resource_status_FromString(resource_status->valuestring);
cJSON *cause = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "cause");
OpenAPI_cause_t *cause_local_nonprim = NULL;
OpenAPI_cause_e causeVariable;
if (cause) {
cause_local_nonprim = OpenAPI_cause_parseFromJSON(cause);
if (!cJSON_IsString(cause)) {
ogs_error("OpenAPI_status_info_parseFromJSON() failed [cause]");
goto end;
}
causeVariable = OpenAPI_cause_FromString(cause->valuestring);
}
cJSON *cn_assisted_ran_para = cJSON_GetObjectItemCaseSensitive(status_infoJSON, "cnAssistedRanPara");
@ -136,8 +130,8 @@ OpenAPI_status_info_t *OpenAPI_status_info_parseFromJSON(cJSON *status_infoJSON)
}
status_info_local_var = OpenAPI_status_info_create (
resource_status_local_nonprim,
cause ? cause_local_nonprim : NULL,
resource_statusVariable,
cause ? causeVariable : 0,
cn_assisted_ran_para ? cn_assisted_ran_para_local_nonprim : NULL,
an_type ? an_typeVariable : 0
);

View File

@ -23,15 +23,15 @@ extern "C" {
typedef struct OpenAPI_status_info_s OpenAPI_status_info_t;
typedef struct OpenAPI_status_info_s {
struct OpenAPI_resource_status_s *resource_status;
struct OpenAPI_cause_s *cause;
OpenAPI_resource_status_e resource_status;
OpenAPI_cause_e cause;
struct OpenAPI_cn_assisted_ran_para_s *cn_assisted_ran_para;
OpenAPI_access_type_e an_type;
} OpenAPI_status_info_t;
OpenAPI_status_info_t *OpenAPI_status_info_create(
OpenAPI_resource_status_t *resource_status,
OpenAPI_cause_t *cause,
OpenAPI_resource_status_e resource_status,
OpenAPI_cause_e cause,
OpenAPI_cn_assisted_ran_para_t *cn_assisted_ran_para,
OpenAPI_access_type_e an_type
);

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "unavailable_access_indication.h"
OpenAPI_unavailable_access_indication_t *OpenAPI_unavailable_access_indication_create(
)
char* OpenAPI_unavailable_access_indication_ToString(OpenAPI_unavailable_access_indication_e unavailable_access_indication)
{
OpenAPI_unavailable_access_indication_t *unavailable_access_indication_local_var = OpenAPI_malloc(sizeof(OpenAPI_unavailable_access_indication_t));
if (!unavailable_access_indication_local_var) {
return NULL;
}
return unavailable_access_indication_local_var;
const char *unavailable_access_indicationArray[] = { "NULL", "_3GA_UNAVAILABLE", "N3GA_UNAVAILABLE" };
size_t sizeofArray = sizeof(unavailable_access_indicationArray) / sizeof(unavailable_access_indicationArray[0]);
if (unavailable_access_indication < sizeofArray)
return (char *)unavailable_access_indicationArray[unavailable_access_indication];
else
return (char *)"Unknown";
}
void OpenAPI_unavailable_access_indication_free(OpenAPI_unavailable_access_indication_t *unavailable_access_indication)
OpenAPI_unavailable_access_indication_e OpenAPI_unavailable_access_indication_FromString(char* unavailable_access_indication)
{
if (NULL == unavailable_access_indication) {
return;
int stringToReturn = 0;
const char *unavailable_access_indicationArray[] = { "NULL", "_3GA_UNAVAILABLE", "N3GA_UNAVAILABLE" };
size_t sizeofArray = sizeof(unavailable_access_indicationArray) / sizeof(unavailable_access_indicationArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(unavailable_access_indication, unavailable_access_indicationArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(unavailable_access_indication);
}
cJSON *OpenAPI_unavailable_access_indication_convertToJSON(OpenAPI_unavailable_access_indication_t *unavailable_access_indication)
{
cJSON *item = NULL;
if (unavailable_access_indication == NULL) {
ogs_error("OpenAPI_unavailable_access_indication_convertToJSON() failed [UnavailableAccessIndication]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_unavailable_access_indication_t *OpenAPI_unavailable_access_indication_parseFromJSON(cJSON *unavailable_access_indicationJSON)
{
OpenAPI_unavailable_access_indication_t *unavailable_access_indication_local_var = NULL;
unavailable_access_indication_local_var = OpenAPI_unavailable_access_indication_create (
);
return unavailable_access_indication_local_var;
end:
return NULL;
}
OpenAPI_unavailable_access_indication_t *OpenAPI_unavailable_access_indication_copy(OpenAPI_unavailable_access_indication_t *dst, OpenAPI_unavailable_access_indication_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_unavailable_access_indication_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_unavailable_access_indication_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_unavailable_access_indication_free(dst);
dst = OpenAPI_unavailable_access_indication_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* unavailable_access_indication.h
*
* Possible values are - 3GA_UNAVAILABLE - N3GA_UNAVAILABLE
*
*/
#ifndef _OpenAPI_unavailable_access_indication_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_unavailable_access_indication_s OpenAPI_unavailable_access_indication_t;
typedef struct OpenAPI_unavailable_access_indication_s {
} OpenAPI_unavailable_access_indication_t;
typedef enum { OpenAPI_unavailable_access_indication_NULL = 0, OpenAPI_unavailable_access_indication__3GA_UNAVAILABLE, OpenAPI_unavailable_access_indication_N3GA_UNAVAILABLE } OpenAPI_unavailable_access_indication_e;
OpenAPI_unavailable_access_indication_t *OpenAPI_unavailable_access_indication_create(
);
void OpenAPI_unavailable_access_indication_free(OpenAPI_unavailable_access_indication_t *unavailable_access_indication);
OpenAPI_unavailable_access_indication_t *OpenAPI_unavailable_access_indication_parseFromJSON(cJSON *unavailable_access_indicationJSON);
cJSON *OpenAPI_unavailable_access_indication_convertToJSON(OpenAPI_unavailable_access_indication_t *unavailable_access_indication);
OpenAPI_unavailable_access_indication_t *OpenAPI_unavailable_access_indication_copy(OpenAPI_unavailable_access_indication_t *dst, OpenAPI_unavailable_access_indication_t *src);
char* OpenAPI_unavailable_access_indication_ToString(OpenAPI_unavailable_access_indication_e unavailable_access_indication);
OpenAPI_unavailable_access_indication_e OpenAPI_unavailable_access_indication_FromString(char* unavailable_access_indication);
#ifdef __cplusplus
}

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "up_cnx_state.h"
OpenAPI_up_cnx_state_t *OpenAPI_up_cnx_state_create(
)
char* OpenAPI_up_cnx_state_ToString(OpenAPI_up_cnx_state_e up_cnx_state)
{
OpenAPI_up_cnx_state_t *up_cnx_state_local_var = OpenAPI_malloc(sizeof(OpenAPI_up_cnx_state_t));
if (!up_cnx_state_local_var) {
return NULL;
}
return up_cnx_state_local_var;
const char *up_cnx_stateArray[] = { "NULL", "ACTIVATED", "DEACTIVATED", "ACTIVATING", "SUSPENDED" };
size_t sizeofArray = sizeof(up_cnx_stateArray) / sizeof(up_cnx_stateArray[0]);
if (up_cnx_state < sizeofArray)
return (char *)up_cnx_stateArray[up_cnx_state];
else
return (char *)"Unknown";
}
void OpenAPI_up_cnx_state_free(OpenAPI_up_cnx_state_t *up_cnx_state)
OpenAPI_up_cnx_state_e OpenAPI_up_cnx_state_FromString(char* up_cnx_state)
{
if (NULL == up_cnx_state) {
return;
int stringToReturn = 0;
const char *up_cnx_stateArray[] = { "NULL", "ACTIVATED", "DEACTIVATED", "ACTIVATING", "SUSPENDED" };
size_t sizeofArray = sizeof(up_cnx_stateArray) / sizeof(up_cnx_stateArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(up_cnx_state, up_cnx_stateArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(up_cnx_state);
}
cJSON *OpenAPI_up_cnx_state_convertToJSON(OpenAPI_up_cnx_state_t *up_cnx_state)
{
cJSON *item = NULL;
if (up_cnx_state == NULL) {
ogs_error("OpenAPI_up_cnx_state_convertToJSON() failed [UpCnxState]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_up_cnx_state_t *OpenAPI_up_cnx_state_parseFromJSON(cJSON *up_cnx_stateJSON)
{
OpenAPI_up_cnx_state_t *up_cnx_state_local_var = NULL;
up_cnx_state_local_var = OpenAPI_up_cnx_state_create (
);
return up_cnx_state_local_var;
end:
return NULL;
}
OpenAPI_up_cnx_state_t *OpenAPI_up_cnx_state_copy(OpenAPI_up_cnx_state_t *dst, OpenAPI_up_cnx_state_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_up_cnx_state_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_up_cnx_state_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_up_cnx_state_free(dst);
dst = OpenAPI_up_cnx_state_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

Some files were not shown because too many files have changed in this diff Show More