Coverage Report

Created: 2026-08-17 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/open5gs/lib/sbi/openapi/model/ue_context.c
Line
Count
Source
1
2
#include <stdlib.h>
3
#include <string.h>
4
#include <stdio.h>
5
#include "ue_context.h"
6
7
OpenAPI_ue_context_t *OpenAPI_ue_context_create(
8
    char *supi,
9
    bool is_supi_unauth_ind,
10
    int supi_unauth_ind,
11
    OpenAPI_list_t *gpsi_list,
12
    char *pei,
13
    char *udm_group_id,
14
    char *ausf_group_id,
15
    char *pcf_group_id,
16
    char *routing_indicator,
17
    bool is_h_nw_pub_key_id,
18
    int h_nw_pub_key_id,
19
    OpenAPI_list_t *group_list,
20
    char *drx_parameter,
21
    bool is_sub_rfsp,
22
    int sub_rfsp,
23
    bool is_pcf_rfsp,
24
    int pcf_rfsp,
25
    char *chf_group_id,
26
    bool is_used_rfsp,
27
    int used_rfsp,
28
    OpenAPI_ambr_t *sub_ue_ambr,
29
    OpenAPI_ambr_t *pcf_ue_ambr,
30
    OpenAPI_list_t* sub_ue_slice_mbr_list,
31
    char *smsf_id,
32
    OpenAPI_seaf_data_t *seaf_data,
33
    char *_5g_mm_capability,
34
    char *pcf_id,
35
    char *pcf_set_id,
36
    char *pcf_amp_service_set_id,
37
    char *pcf_uep_service_set_id,
38
    OpenAPI_sbi_binding_level_e pcf_binding,
39
    char *pcf_am_policy_uri,
40
    OpenAPI_list_t *am_policy_req_trigger_list,
41
    char *pcf_ue_policy_uri,
42
    OpenAPI_list_t *ue_policy_req_trigger_list,
43
    char *hpcf_id,
44
    char *hpcf_set_id,
45
    OpenAPI_list_t *restricted_rat_list,
46
    OpenAPI_list_t *forbidden_area_list,
47
    OpenAPI_service_area_restriction_t *service_area_restriction,
48
    OpenAPI_list_t *restricted_core_nw_type_list,
49
    OpenAPI_list_t *event_subscription_list,
50
    OpenAPI_list_t *mm_context_list,
51
    OpenAPI_list_t *session_context_list,
52
    OpenAPI_eps_interworking_info_t *eps_interworking_info,
53
    bool is_trace_data_null,
54
    OpenAPI_trace_data_t *trace_data,
55
    char *service_gap_expiry_time,
56
    char *stn_sr,
57
    char *c_msisdn,
58
    char *ms_classmark2,
59
    OpenAPI_list_t *supported_codec_list,
60
    OpenAPI_list_t *small_data_rate_status_infos,
61
    OpenAPI_list_t *restricted_primary_rat_list,
62
    OpenAPI_list_t *restricted_secondary_rat_list,
63
    OpenAPI_v2x_context_t *v2x_context,
64
    bool is_lte_cat_m_ind,
65
    int lte_cat_m_ind,
66
    bool is_red_cap_ind,
67
    int red_cap_ind,
68
    bool is_e_red_cap_ind,
69
    int e_red_cap_ind,
70
    OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter,
71
    OpenAPI_cag_data_t *cag_data,
72
    bool is_management_mdt_ind,
73
    int management_mdt_ind,
74
    OpenAPI_list_t* adjacen_plmn_mngt_mdt_inds,
75
    OpenAPI_immediate_mdt_conf_t *immediate_mdt_conf,
76
    OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb,
77
    bool is_ec_restriction_data_nb,
78
    int ec_restriction_data_nb,
79
    bool is_iab_operation_allowed,
80
    int iab_operation_allowed,
81
    OpenAPI_prose_context_t *prose_context,
82
    OpenAPI_list_t *analytics_subscription_list,
83
    char *pcf_amp_binding_info,
84
    char *pcf_uep_binding_info,
85
    OpenAPI_service_area_restriction_t *used_service_area_restriction,
86
    OpenAPI_list_t* pra_in_am_policy,
87
    OpenAPI_list_t* pra_in_ue_policy,
88
    OpenAPI_updp_subscription_data_t *updp_subscription_data,
89
    OpenAPI_list_t *sm_policy_notify_pdu_list,
90
    bool is_pcf_ue_callback_info_null,
91
    OpenAPI_pcf_ue_callback_info_t *pcf_ue_callback_info,
92
    char *ue_positioning_cap,
93
    bool is_asti_distribution_indication,
94
    int asti_distribution_indication,
95
    bool is_ts_error_budget,
96
    int ts_error_budget,
97
    bool is_snpn_onboard_ind,
98
    int snpn_onboard_ind,
99
    bool is_smf_sel_info_null,
100
    OpenAPI_smf_selection_data_t *smf_sel_info,
101
    OpenAPI_list_t* pcf_ue_slice_mbr_list,
102
    char *smsf_set_id,
103
    char *smsf_service_set_id,
104
    char *smsf_binding_info,
105
    bool is_disaster_roaming_ind,
106
    int disaster_roaming_ind,
107
    OpenAPI_plmn_id_t *disaster_plmn,
108
    OpenAPI_satellite_backhaul_category_e satellite_backhaul_cat,
109
    OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res,
110
    bool is_as_time_dis_param_null,
111
    OpenAPI_as_time_distribution_param_t *as_time_dis_param,
112
    OpenAPI_am_policy_info_container_t *am_policy_info_container,
113
    OpenAPI_a2x_context_t *a2x_context,
114
    OpenAPI_mbsr_operation_allowed_t *mbsr_operation_allowed,
115
    OpenAPI_lcs_up_context_t *lcs_up_context,
116
    OpenAPI_list_t *lcs_up_context_list,
117
    bool is_reconnect_ind,
118
    int reconnect_ind,
119
    char *ue_policy_container,
120
    bool is_am_policy_ind,
121
    int am_policy_ind,
122
    bool is_ue_policy_ind,
123
    int ue_policy_ind,
124
    bool is_energy_saving_ind,
125
    int energy_saving_ind
126
)
127
0
{
128
0
    OpenAPI_ue_context_t *ue_context_local_var = ogs_malloc(sizeof(OpenAPI_ue_context_t));
129
0
    ogs_assert(ue_context_local_var);
130
131
0
    ue_context_local_var->supi = supi;
132
0
    ue_context_local_var->is_supi_unauth_ind = is_supi_unauth_ind;
133
0
    ue_context_local_var->supi_unauth_ind = supi_unauth_ind;
134
0
    ue_context_local_var->gpsi_list = gpsi_list;
135
0
    ue_context_local_var->pei = pei;
136
0
    ue_context_local_var->udm_group_id = udm_group_id;
137
0
    ue_context_local_var->ausf_group_id = ausf_group_id;
138
0
    ue_context_local_var->pcf_group_id = pcf_group_id;
139
0
    ue_context_local_var->routing_indicator = routing_indicator;
140
0
    ue_context_local_var->is_h_nw_pub_key_id = is_h_nw_pub_key_id;
141
0
    ue_context_local_var->h_nw_pub_key_id = h_nw_pub_key_id;
142
0
    ue_context_local_var->group_list = group_list;
143
0
    ue_context_local_var->drx_parameter = drx_parameter;
144
0
    ue_context_local_var->is_sub_rfsp = is_sub_rfsp;
145
0
    ue_context_local_var->sub_rfsp = sub_rfsp;
146
0
    ue_context_local_var->is_pcf_rfsp = is_pcf_rfsp;
147
0
    ue_context_local_var->pcf_rfsp = pcf_rfsp;
148
0
    ue_context_local_var->chf_group_id = chf_group_id;
149
0
    ue_context_local_var->is_used_rfsp = is_used_rfsp;
150
0
    ue_context_local_var->used_rfsp = used_rfsp;
151
0
    ue_context_local_var->sub_ue_ambr = sub_ue_ambr;
152
0
    ue_context_local_var->pcf_ue_ambr = pcf_ue_ambr;
153
0
    ue_context_local_var->sub_ue_slice_mbr_list = sub_ue_slice_mbr_list;
154
0
    ue_context_local_var->smsf_id = smsf_id;
155
0
    ue_context_local_var->seaf_data = seaf_data;
156
0
    ue_context_local_var->_5g_mm_capability = _5g_mm_capability;
157
0
    ue_context_local_var->pcf_id = pcf_id;
158
0
    ue_context_local_var->pcf_set_id = pcf_set_id;
159
0
    ue_context_local_var->pcf_amp_service_set_id = pcf_amp_service_set_id;
160
0
    ue_context_local_var->pcf_uep_service_set_id = pcf_uep_service_set_id;
161
0
    ue_context_local_var->pcf_binding = pcf_binding;
162
0
    ue_context_local_var->pcf_am_policy_uri = pcf_am_policy_uri;
163
0
    ue_context_local_var->am_policy_req_trigger_list = am_policy_req_trigger_list;
164
0
    ue_context_local_var->pcf_ue_policy_uri = pcf_ue_policy_uri;
165
0
    ue_context_local_var->ue_policy_req_trigger_list = ue_policy_req_trigger_list;
166
0
    ue_context_local_var->hpcf_id = hpcf_id;
167
0
    ue_context_local_var->hpcf_set_id = hpcf_set_id;
168
0
    ue_context_local_var->restricted_rat_list = restricted_rat_list;
169
0
    ue_context_local_var->forbidden_area_list = forbidden_area_list;
170
0
    ue_context_local_var->service_area_restriction = service_area_restriction;
171
0
    ue_context_local_var->restricted_core_nw_type_list = restricted_core_nw_type_list;
172
0
    ue_context_local_var->event_subscription_list = event_subscription_list;
173
0
    ue_context_local_var->mm_context_list = mm_context_list;
174
0
    ue_context_local_var->session_context_list = session_context_list;
175
0
    ue_context_local_var->eps_interworking_info = eps_interworking_info;
176
0
    ue_context_local_var->is_trace_data_null = is_trace_data_null;
177
0
    ue_context_local_var->trace_data = trace_data;
178
0
    ue_context_local_var->service_gap_expiry_time = service_gap_expiry_time;
179
0
    ue_context_local_var->stn_sr = stn_sr;
180
0
    ue_context_local_var->c_msisdn = c_msisdn;
181
0
    ue_context_local_var->ms_classmark2 = ms_classmark2;
182
0
    ue_context_local_var->supported_codec_list = supported_codec_list;
183
0
    ue_context_local_var->small_data_rate_status_infos = small_data_rate_status_infos;
184
0
    ue_context_local_var->restricted_primary_rat_list = restricted_primary_rat_list;
185
0
    ue_context_local_var->restricted_secondary_rat_list = restricted_secondary_rat_list;
186
0
    ue_context_local_var->v2x_context = v2x_context;
187
0
    ue_context_local_var->is_lte_cat_m_ind = is_lte_cat_m_ind;
188
0
    ue_context_local_var->lte_cat_m_ind = lte_cat_m_ind;
189
0
    ue_context_local_var->is_red_cap_ind = is_red_cap_ind;
190
0
    ue_context_local_var->red_cap_ind = red_cap_ind;
191
0
    ue_context_local_var->is_e_red_cap_ind = is_e_red_cap_ind;
192
0
    ue_context_local_var->e_red_cap_ind = e_red_cap_ind;
193
0
    ue_context_local_var->mo_exp_data_counter = mo_exp_data_counter;
194
0
    ue_context_local_var->cag_data = cag_data;
195
0
    ue_context_local_var->is_management_mdt_ind = is_management_mdt_ind;
196
0
    ue_context_local_var->management_mdt_ind = management_mdt_ind;
197
0
    ue_context_local_var->adjacen_plmn_mngt_mdt_inds = adjacen_plmn_mngt_mdt_inds;
198
0
    ue_context_local_var->immediate_mdt_conf = immediate_mdt_conf;
199
0
    ue_context_local_var->ec_restriction_data_wb = ec_restriction_data_wb;
200
0
    ue_context_local_var->is_ec_restriction_data_nb = is_ec_restriction_data_nb;
201
0
    ue_context_local_var->ec_restriction_data_nb = ec_restriction_data_nb;
202
0
    ue_context_local_var->is_iab_operation_allowed = is_iab_operation_allowed;
203
0
    ue_context_local_var->iab_operation_allowed = iab_operation_allowed;
204
0
    ue_context_local_var->prose_context = prose_context;
205
0
    ue_context_local_var->analytics_subscription_list = analytics_subscription_list;
206
0
    ue_context_local_var->pcf_amp_binding_info = pcf_amp_binding_info;
207
0
    ue_context_local_var->pcf_uep_binding_info = pcf_uep_binding_info;
208
0
    ue_context_local_var->used_service_area_restriction = used_service_area_restriction;
209
0
    ue_context_local_var->pra_in_am_policy = pra_in_am_policy;
210
0
    ue_context_local_var->pra_in_ue_policy = pra_in_ue_policy;
211
0
    ue_context_local_var->updp_subscription_data = updp_subscription_data;
212
0
    ue_context_local_var->sm_policy_notify_pdu_list = sm_policy_notify_pdu_list;
213
0
    ue_context_local_var->is_pcf_ue_callback_info_null = is_pcf_ue_callback_info_null;
214
0
    ue_context_local_var->pcf_ue_callback_info = pcf_ue_callback_info;
215
0
    ue_context_local_var->ue_positioning_cap = ue_positioning_cap;
216
0
    ue_context_local_var->is_asti_distribution_indication = is_asti_distribution_indication;
217
0
    ue_context_local_var->asti_distribution_indication = asti_distribution_indication;
218
0
    ue_context_local_var->is_ts_error_budget = is_ts_error_budget;
219
0
    ue_context_local_var->ts_error_budget = ts_error_budget;
220
0
    ue_context_local_var->is_snpn_onboard_ind = is_snpn_onboard_ind;
221
0
    ue_context_local_var->snpn_onboard_ind = snpn_onboard_ind;
222
0
    ue_context_local_var->is_smf_sel_info_null = is_smf_sel_info_null;
223
0
    ue_context_local_var->smf_sel_info = smf_sel_info;
224
0
    ue_context_local_var->pcf_ue_slice_mbr_list = pcf_ue_slice_mbr_list;
225
0
    ue_context_local_var->smsf_set_id = smsf_set_id;
226
0
    ue_context_local_var->smsf_service_set_id = smsf_service_set_id;
227
0
    ue_context_local_var->smsf_binding_info = smsf_binding_info;
228
0
    ue_context_local_var->is_disaster_roaming_ind = is_disaster_roaming_ind;
229
0
    ue_context_local_var->disaster_roaming_ind = disaster_roaming_ind;
230
0
    ue_context_local_var->disaster_plmn = disaster_plmn;
231
0
    ue_context_local_var->satellite_backhaul_cat = satellite_backhaul_cat;
232
0
    ue_context_local_var->wl_serv_area_res = wl_serv_area_res;
233
0
    ue_context_local_var->is_as_time_dis_param_null = is_as_time_dis_param_null;
234
0
    ue_context_local_var->as_time_dis_param = as_time_dis_param;
235
0
    ue_context_local_var->am_policy_info_container = am_policy_info_container;
236
0
    ue_context_local_var->a2x_context = a2x_context;
237
0
    ue_context_local_var->mbsr_operation_allowed = mbsr_operation_allowed;
238
0
    ue_context_local_var->lcs_up_context = lcs_up_context;
239
0
    ue_context_local_var->lcs_up_context_list = lcs_up_context_list;
240
0
    ue_context_local_var->is_reconnect_ind = is_reconnect_ind;
241
0
    ue_context_local_var->reconnect_ind = reconnect_ind;
242
0
    ue_context_local_var->ue_policy_container = ue_policy_container;
243
0
    ue_context_local_var->is_am_policy_ind = is_am_policy_ind;
244
0
    ue_context_local_var->am_policy_ind = am_policy_ind;
245
0
    ue_context_local_var->is_ue_policy_ind = is_ue_policy_ind;
246
0
    ue_context_local_var->ue_policy_ind = ue_policy_ind;
247
0
    ue_context_local_var->is_energy_saving_ind = is_energy_saving_ind;
248
0
    ue_context_local_var->energy_saving_ind = energy_saving_ind;
249
250
0
    return ue_context_local_var;
251
0
}
252
253
void OpenAPI_ue_context_free(OpenAPI_ue_context_t *ue_context)
254
0
{
255
0
    OpenAPI_lnode_t *node = NULL;
256
257
0
    if (NULL == ue_context) {
258
0
        return;
259
0
    }
260
0
    if (ue_context->supi) {
261
0
        ogs_free(ue_context->supi);
262
0
        ue_context->supi = NULL;
263
0
    }
264
0
    if (ue_context->gpsi_list) {
265
0
        OpenAPI_list_for_each(ue_context->gpsi_list, node) {
266
0
            ogs_free(node->data);
267
0
        }
268
0
        OpenAPI_list_free(ue_context->gpsi_list);
269
0
        ue_context->gpsi_list = NULL;
270
0
    }
271
0
    if (ue_context->pei) {
272
0
        ogs_free(ue_context->pei);
273
0
        ue_context->pei = NULL;
274
0
    }
275
0
    if (ue_context->udm_group_id) {
276
0
        ogs_free(ue_context->udm_group_id);
277
0
        ue_context->udm_group_id = NULL;
278
0
    }
279
0
    if (ue_context->ausf_group_id) {
280
0
        ogs_free(ue_context->ausf_group_id);
281
0
        ue_context->ausf_group_id = NULL;
282
0
    }
283
0
    if (ue_context->pcf_group_id) {
284
0
        ogs_free(ue_context->pcf_group_id);
285
0
        ue_context->pcf_group_id = NULL;
286
0
    }
287
0
    if (ue_context->routing_indicator) {
288
0
        ogs_free(ue_context->routing_indicator);
289
0
        ue_context->routing_indicator = NULL;
290
0
    }
291
0
    if (ue_context->group_list) {
292
0
        OpenAPI_list_for_each(ue_context->group_list, node) {
293
0
            ogs_free(node->data);
294
0
        }
295
0
        OpenAPI_list_free(ue_context->group_list);
296
0
        ue_context->group_list = NULL;
297
0
    }
298
0
    if (ue_context->drx_parameter) {
299
0
        ogs_free(ue_context->drx_parameter);
300
0
        ue_context->drx_parameter = NULL;
301
0
    }
302
0
    if (ue_context->chf_group_id) {
303
0
        ogs_free(ue_context->chf_group_id);
304
0
        ue_context->chf_group_id = NULL;
305
0
    }
306
0
    if (ue_context->sub_ue_ambr) {
307
0
        OpenAPI_ambr_free(ue_context->sub_ue_ambr);
308
0
        ue_context->sub_ue_ambr = NULL;
309
0
    }
310
0
    if (ue_context->pcf_ue_ambr) {
311
0
        OpenAPI_ambr_free(ue_context->pcf_ue_ambr);
312
0
        ue_context->pcf_ue_ambr = NULL;
313
0
    }
314
0
    if (ue_context->sub_ue_slice_mbr_list) {
315
0
        OpenAPI_list_for_each(ue_context->sub_ue_slice_mbr_list, node) {
316
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
317
0
            ogs_free(localKeyValue->key);
318
0
            OpenAPI_slice_mbr_free(localKeyValue->value);
319
0
            OpenAPI_map_free(localKeyValue);
320
0
        }
321
0
        OpenAPI_list_free(ue_context->sub_ue_slice_mbr_list);
322
0
        ue_context->sub_ue_slice_mbr_list = NULL;
323
0
    }
324
0
    if (ue_context->smsf_id) {
325
0
        ogs_free(ue_context->smsf_id);
326
0
        ue_context->smsf_id = NULL;
327
0
    }
328
0
    if (ue_context->seaf_data) {
329
0
        OpenAPI_seaf_data_free(ue_context->seaf_data);
330
0
        ue_context->seaf_data = NULL;
331
0
    }
332
0
    if (ue_context->_5g_mm_capability) {
333
0
        ogs_free(ue_context->_5g_mm_capability);
334
0
        ue_context->_5g_mm_capability = NULL;
335
0
    }
336
0
    if (ue_context->pcf_id) {
337
0
        ogs_free(ue_context->pcf_id);
338
0
        ue_context->pcf_id = NULL;
339
0
    }
340
0
    if (ue_context->pcf_set_id) {
341
0
        ogs_free(ue_context->pcf_set_id);
342
0
        ue_context->pcf_set_id = NULL;
343
0
    }
344
0
    if (ue_context->pcf_amp_service_set_id) {
345
0
        ogs_free(ue_context->pcf_amp_service_set_id);
346
0
        ue_context->pcf_amp_service_set_id = NULL;
347
0
    }
348
0
    if (ue_context->pcf_uep_service_set_id) {
349
0
        ogs_free(ue_context->pcf_uep_service_set_id);
350
0
        ue_context->pcf_uep_service_set_id = NULL;
351
0
    }
352
0
    if (ue_context->pcf_am_policy_uri) {
353
0
        ogs_free(ue_context->pcf_am_policy_uri);
354
0
        ue_context->pcf_am_policy_uri = NULL;
355
0
    }
356
0
    if (ue_context->am_policy_req_trigger_list) {
357
0
        OpenAPI_list_free(ue_context->am_policy_req_trigger_list);
358
0
        ue_context->am_policy_req_trigger_list = NULL;
359
0
    }
360
0
    if (ue_context->pcf_ue_policy_uri) {
361
0
        ogs_free(ue_context->pcf_ue_policy_uri);
362
0
        ue_context->pcf_ue_policy_uri = NULL;
363
0
    }
364
0
    if (ue_context->ue_policy_req_trigger_list) {
365
0
        OpenAPI_list_free(ue_context->ue_policy_req_trigger_list);
366
0
        ue_context->ue_policy_req_trigger_list = NULL;
367
0
    }
368
0
    if (ue_context->hpcf_id) {
369
0
        ogs_free(ue_context->hpcf_id);
370
0
        ue_context->hpcf_id = NULL;
371
0
    }
372
0
    if (ue_context->hpcf_set_id) {
373
0
        ogs_free(ue_context->hpcf_set_id);
374
0
        ue_context->hpcf_set_id = NULL;
375
0
    }
376
0
    if (ue_context->restricted_rat_list) {
377
0
        OpenAPI_list_free(ue_context->restricted_rat_list);
378
0
        ue_context->restricted_rat_list = NULL;
379
0
    }
380
0
    if (ue_context->forbidden_area_list) {
381
0
        OpenAPI_list_for_each(ue_context->forbidden_area_list, node) {
382
0
            OpenAPI_area_free(node->data);
383
0
        }
384
0
        OpenAPI_list_free(ue_context->forbidden_area_list);
385
0
        ue_context->forbidden_area_list = NULL;
386
0
    }
387
0
    if (ue_context->service_area_restriction) {
388
0
        OpenAPI_service_area_restriction_free(ue_context->service_area_restriction);
389
0
        ue_context->service_area_restriction = NULL;
390
0
    }
391
0
    if (ue_context->restricted_core_nw_type_list) {
392
0
        OpenAPI_list_free(ue_context->restricted_core_nw_type_list);
393
0
        ue_context->restricted_core_nw_type_list = NULL;
394
0
    }
395
0
    if (ue_context->event_subscription_list) {
396
0
        OpenAPI_list_for_each(ue_context->event_subscription_list, node) {
397
0
            OpenAPI_ext_amf_event_subscription_free(node->data);
398
0
        }
399
0
        OpenAPI_list_free(ue_context->event_subscription_list);
400
0
        ue_context->event_subscription_list = NULL;
401
0
    }
402
0
    if (ue_context->mm_context_list) {
403
0
        OpenAPI_list_for_each(ue_context->mm_context_list, node) {
404
0
            OpenAPI_mm_context_free(node->data);
405
0
        }
406
0
        OpenAPI_list_free(ue_context->mm_context_list);
407
0
        ue_context->mm_context_list = NULL;
408
0
    }
409
0
    if (ue_context->session_context_list) {
410
0
        OpenAPI_list_for_each(ue_context->session_context_list, node) {
411
0
            OpenAPI_pdu_session_context_free(node->data);
412
0
        }
413
0
        OpenAPI_list_free(ue_context->session_context_list);
414
0
        ue_context->session_context_list = NULL;
415
0
    }
416
0
    if (ue_context->eps_interworking_info) {
417
0
        OpenAPI_eps_interworking_info_free(ue_context->eps_interworking_info);
418
0
        ue_context->eps_interworking_info = NULL;
419
0
    }
420
0
    if (ue_context->trace_data) {
421
0
        OpenAPI_trace_data_free(ue_context->trace_data);
422
0
        ue_context->trace_data = NULL;
423
0
    }
424
0
    if (ue_context->service_gap_expiry_time) {
425
0
        ogs_free(ue_context->service_gap_expiry_time);
426
0
        ue_context->service_gap_expiry_time = NULL;
427
0
    }
428
0
    if (ue_context->stn_sr) {
429
0
        ogs_free(ue_context->stn_sr);
430
0
        ue_context->stn_sr = NULL;
431
0
    }
432
0
    if (ue_context->c_msisdn) {
433
0
        ogs_free(ue_context->c_msisdn);
434
0
        ue_context->c_msisdn = NULL;
435
0
    }
436
0
    if (ue_context->ms_classmark2) {
437
0
        ogs_free(ue_context->ms_classmark2);
438
0
        ue_context->ms_classmark2 = NULL;
439
0
    }
440
0
    if (ue_context->supported_codec_list) {
441
0
        OpenAPI_list_for_each(ue_context->supported_codec_list, node) {
442
0
            ogs_free(node->data);
443
0
        }
444
0
        OpenAPI_list_free(ue_context->supported_codec_list);
445
0
        ue_context->supported_codec_list = NULL;
446
0
    }
447
0
    if (ue_context->small_data_rate_status_infos) {
448
0
        OpenAPI_list_for_each(ue_context->small_data_rate_status_infos, node) {
449
0
            OpenAPI_small_data_rate_status_info_free(node->data);
450
0
        }
451
0
        OpenAPI_list_free(ue_context->small_data_rate_status_infos);
452
0
        ue_context->small_data_rate_status_infos = NULL;
453
0
    }
454
0
    if (ue_context->restricted_primary_rat_list) {
455
0
        OpenAPI_list_free(ue_context->restricted_primary_rat_list);
456
0
        ue_context->restricted_primary_rat_list = NULL;
457
0
    }
458
0
    if (ue_context->restricted_secondary_rat_list) {
459
0
        OpenAPI_list_free(ue_context->restricted_secondary_rat_list);
460
0
        ue_context->restricted_secondary_rat_list = NULL;
461
0
    }
462
0
    if (ue_context->v2x_context) {
463
0
        OpenAPI_v2x_context_free(ue_context->v2x_context);
464
0
        ue_context->v2x_context = NULL;
465
0
    }
466
0
    if (ue_context->mo_exp_data_counter) {
467
0
        OpenAPI_mo_exp_data_counter_free(ue_context->mo_exp_data_counter);
468
0
        ue_context->mo_exp_data_counter = NULL;
469
0
    }
470
0
    if (ue_context->cag_data) {
471
0
        OpenAPI_cag_data_free(ue_context->cag_data);
472
0
        ue_context->cag_data = NULL;
473
0
    }
474
0
    if (ue_context->adjacen_plmn_mngt_mdt_inds) {
475
0
        OpenAPI_list_for_each(ue_context->adjacen_plmn_mngt_mdt_inds, node) {
476
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
477
0
            ogs_free(localKeyValue->key);
478
0
            ogs_free(localKeyValue->value);
479
0
            OpenAPI_map_free(localKeyValue);
480
0
        }
481
0
        OpenAPI_list_free(ue_context->adjacen_plmn_mngt_mdt_inds);
482
0
        ue_context->adjacen_plmn_mngt_mdt_inds = NULL;
483
0
    }
484
0
    if (ue_context->immediate_mdt_conf) {
485
0
        OpenAPI_immediate_mdt_conf_free(ue_context->immediate_mdt_conf);
486
0
        ue_context->immediate_mdt_conf = NULL;
487
0
    }
488
0
    if (ue_context->ec_restriction_data_wb) {
489
0
        OpenAPI_ec_restriction_data_wb_free(ue_context->ec_restriction_data_wb);
490
0
        ue_context->ec_restriction_data_wb = NULL;
491
0
    }
492
0
    if (ue_context->prose_context) {
493
0
        OpenAPI_prose_context_free(ue_context->prose_context);
494
0
        ue_context->prose_context = NULL;
495
0
    }
496
0
    if (ue_context->analytics_subscription_list) {
497
0
        OpenAPI_list_for_each(ue_context->analytics_subscription_list, node) {
498
0
            OpenAPI_analytics_subscription_free(node->data);
499
0
        }
500
0
        OpenAPI_list_free(ue_context->analytics_subscription_list);
501
0
        ue_context->analytics_subscription_list = NULL;
502
0
    }
503
0
    if (ue_context->pcf_amp_binding_info) {
504
0
        ogs_free(ue_context->pcf_amp_binding_info);
505
0
        ue_context->pcf_amp_binding_info = NULL;
506
0
    }
507
0
    if (ue_context->pcf_uep_binding_info) {
508
0
        ogs_free(ue_context->pcf_uep_binding_info);
509
0
        ue_context->pcf_uep_binding_info = NULL;
510
0
    }
511
0
    if (ue_context->used_service_area_restriction) {
512
0
        OpenAPI_service_area_restriction_free(ue_context->used_service_area_restriction);
513
0
        ue_context->used_service_area_restriction = NULL;
514
0
    }
515
0
    if (ue_context->pra_in_am_policy) {
516
0
        OpenAPI_list_for_each(ue_context->pra_in_am_policy, node) {
517
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
518
0
            ogs_free(localKeyValue->key);
519
0
            OpenAPI_presence_info_free(localKeyValue->value);
520
0
            OpenAPI_map_free(localKeyValue);
521
0
        }
522
0
        OpenAPI_list_free(ue_context->pra_in_am_policy);
523
0
        ue_context->pra_in_am_policy = NULL;
524
0
    }
525
0
    if (ue_context->pra_in_ue_policy) {
526
0
        OpenAPI_list_for_each(ue_context->pra_in_ue_policy, node) {
527
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
528
0
            ogs_free(localKeyValue->key);
529
0
            OpenAPI_presence_info_free(localKeyValue->value);
530
0
            OpenAPI_map_free(localKeyValue);
531
0
        }
532
0
        OpenAPI_list_free(ue_context->pra_in_ue_policy);
533
0
        ue_context->pra_in_ue_policy = NULL;
534
0
    }
535
0
    if (ue_context->updp_subscription_data) {
536
0
        OpenAPI_updp_subscription_data_free(ue_context->updp_subscription_data);
537
0
        ue_context->updp_subscription_data = NULL;
538
0
    }
539
0
    if (ue_context->sm_policy_notify_pdu_list) {
540
0
        OpenAPI_list_for_each(ue_context->sm_policy_notify_pdu_list, node) {
541
0
            OpenAPI_pdu_session_info_free(node->data);
542
0
        }
543
0
        OpenAPI_list_free(ue_context->sm_policy_notify_pdu_list);
544
0
        ue_context->sm_policy_notify_pdu_list = NULL;
545
0
    }
546
0
    if (ue_context->pcf_ue_callback_info) {
547
0
        OpenAPI_pcf_ue_callback_info_free(ue_context->pcf_ue_callback_info);
548
0
        ue_context->pcf_ue_callback_info = NULL;
549
0
    }
550
0
    if (ue_context->ue_positioning_cap) {
551
0
        ogs_free(ue_context->ue_positioning_cap);
552
0
        ue_context->ue_positioning_cap = NULL;
553
0
    }
554
0
    if (ue_context->smf_sel_info) {
555
0
        OpenAPI_smf_selection_data_free(ue_context->smf_sel_info);
556
0
        ue_context->smf_sel_info = NULL;
557
0
    }
558
0
    if (ue_context->pcf_ue_slice_mbr_list) {
559
0
        OpenAPI_list_for_each(ue_context->pcf_ue_slice_mbr_list, node) {
560
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
561
0
            ogs_free(localKeyValue->key);
562
0
            OpenAPI_slice_mbr_free(localKeyValue->value);
563
0
            OpenAPI_map_free(localKeyValue);
564
0
        }
565
0
        OpenAPI_list_free(ue_context->pcf_ue_slice_mbr_list);
566
0
        ue_context->pcf_ue_slice_mbr_list = NULL;
567
0
    }
568
0
    if (ue_context->smsf_set_id) {
569
0
        ogs_free(ue_context->smsf_set_id);
570
0
        ue_context->smsf_set_id = NULL;
571
0
    }
572
0
    if (ue_context->smsf_service_set_id) {
573
0
        ogs_free(ue_context->smsf_service_set_id);
574
0
        ue_context->smsf_service_set_id = NULL;
575
0
    }
576
0
    if (ue_context->smsf_binding_info) {
577
0
        ogs_free(ue_context->smsf_binding_info);
578
0
        ue_context->smsf_binding_info = NULL;
579
0
    }
580
0
    if (ue_context->disaster_plmn) {
581
0
        OpenAPI_plmn_id_free(ue_context->disaster_plmn);
582
0
        ue_context->disaster_plmn = NULL;
583
0
    }
584
0
    if (ue_context->wl_serv_area_res) {
585
0
        OpenAPI_wireline_service_area_restriction_free(ue_context->wl_serv_area_res);
586
0
        ue_context->wl_serv_area_res = NULL;
587
0
    }
588
0
    if (ue_context->as_time_dis_param) {
589
0
        OpenAPI_as_time_distribution_param_free(ue_context->as_time_dis_param);
590
0
        ue_context->as_time_dis_param = NULL;
591
0
    }
592
0
    if (ue_context->am_policy_info_container) {
593
0
        OpenAPI_am_policy_info_container_free(ue_context->am_policy_info_container);
594
0
        ue_context->am_policy_info_container = NULL;
595
0
    }
596
0
    if (ue_context->a2x_context) {
597
0
        OpenAPI_a2x_context_free(ue_context->a2x_context);
598
0
        ue_context->a2x_context = NULL;
599
0
    }
600
0
    if (ue_context->mbsr_operation_allowed) {
601
0
        OpenAPI_mbsr_operation_allowed_free(ue_context->mbsr_operation_allowed);
602
0
        ue_context->mbsr_operation_allowed = NULL;
603
0
    }
604
0
    if (ue_context->lcs_up_context) {
605
0
        OpenAPI_lcs_up_context_free(ue_context->lcs_up_context);
606
0
        ue_context->lcs_up_context = NULL;
607
0
    }
608
0
    if (ue_context->lcs_up_context_list) {
609
0
        OpenAPI_list_for_each(ue_context->lcs_up_context_list, node) {
610
0
            OpenAPI_lcs_up_context_free(node->data);
611
0
        }
612
0
        OpenAPI_list_free(ue_context->lcs_up_context_list);
613
0
        ue_context->lcs_up_context_list = NULL;
614
0
    }
615
0
    if (ue_context->ue_policy_container) {
616
0
        ogs_free(ue_context->ue_policy_container);
617
0
        ue_context->ue_policy_container = NULL;
618
0
    }
619
0
    ogs_free(ue_context);
620
0
}
621
622
cJSON *OpenAPI_ue_context_convertToJSON(OpenAPI_ue_context_t *ue_context)
623
0
{
624
0
    cJSON *item = NULL;
625
0
    OpenAPI_lnode_t *node = NULL;
626
627
0
    if (ue_context == NULL) {
628
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [UeContext]");
629
0
        return NULL;
630
0
    }
631
632
0
    item = cJSON_CreateObject();
633
0
    if (ue_context->supi) {
634
0
    if (cJSON_AddStringToObject(item, "supi", ue_context->supi) == NULL) {
635
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [supi]");
636
0
        goto end;
637
0
    }
638
0
    }
639
640
0
    if (ue_context->is_supi_unauth_ind) {
641
0
    if (cJSON_AddBoolToObject(item, "supiUnauthInd", ue_context->supi_unauth_ind) == NULL) {
642
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [supi_unauth_ind]");
643
0
        goto end;
644
0
    }
645
0
    }
646
647
0
    if (ue_context->gpsi_list) {
648
0
    cJSON *gpsi_listList = cJSON_AddArrayToObject(item, "gpsiList");
649
0
    if (gpsi_listList == NULL) {
650
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [gpsi_list]");
651
0
        goto end;
652
0
    }
653
0
    OpenAPI_list_for_each(ue_context->gpsi_list, node) {
654
0
        if (cJSON_AddStringToObject(gpsi_listList, "", (char*)node->data) == NULL) {
655
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [gpsi_list]");
656
0
            goto end;
657
0
        }
658
0
    }
659
0
    }
660
661
0
    if (ue_context->pei) {
662
0
    if (cJSON_AddStringToObject(item, "pei", ue_context->pei) == NULL) {
663
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pei]");
664
0
        goto end;
665
0
    }
666
0
    }
667
668
0
    if (ue_context->udm_group_id) {
669
0
    if (cJSON_AddStringToObject(item, "udmGroupId", ue_context->udm_group_id) == NULL) {
670
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [udm_group_id]");
671
0
        goto end;
672
0
    }
673
0
    }
674
675
0
    if (ue_context->ausf_group_id) {
676
0
    if (cJSON_AddStringToObject(item, "ausfGroupId", ue_context->ausf_group_id) == NULL) {
677
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ausf_group_id]");
678
0
        goto end;
679
0
    }
680
0
    }
681
682
0
    if (ue_context->pcf_group_id) {
683
0
    if (cJSON_AddStringToObject(item, "pcfGroupId", ue_context->pcf_group_id) == NULL) {
684
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_group_id]");
685
0
        goto end;
686
0
    }
687
0
    }
688
689
0
    if (ue_context->routing_indicator) {
690
0
    if (cJSON_AddStringToObject(item, "routingIndicator", ue_context->routing_indicator) == NULL) {
691
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [routing_indicator]");
692
0
        goto end;
693
0
    }
694
0
    }
695
696
0
    if (ue_context->is_h_nw_pub_key_id) {
697
0
    if (cJSON_AddNumberToObject(item, "hNwPubKeyId", ue_context->h_nw_pub_key_id) == NULL) {
698
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [h_nw_pub_key_id]");
699
0
        goto end;
700
0
    }
701
0
    }
702
703
0
    if (ue_context->group_list) {
704
0
    cJSON *group_listList = cJSON_AddArrayToObject(item, "groupList");
705
0
    if (group_listList == NULL) {
706
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [group_list]");
707
0
        goto end;
708
0
    }
709
0
    OpenAPI_list_for_each(ue_context->group_list, node) {
710
0
        if (cJSON_AddStringToObject(group_listList, "", (char*)node->data) == NULL) {
711
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [group_list]");
712
0
            goto end;
713
0
        }
714
0
    }
715
0
    }
716
717
0
    if (ue_context->drx_parameter) {
718
0
    if (cJSON_AddStringToObject(item, "drxParameter", ue_context->drx_parameter) == NULL) {
719
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [drx_parameter]");
720
0
        goto end;
721
0
    }
722
0
    }
723
724
0
    if (ue_context->is_sub_rfsp) {
725
0
    if (cJSON_AddNumberToObject(item, "subRfsp", ue_context->sub_rfsp) == NULL) {
726
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [sub_rfsp]");
727
0
        goto end;
728
0
    }
729
0
    }
730
731
0
    if (ue_context->is_pcf_rfsp) {
732
0
    if (cJSON_AddNumberToObject(item, "pcfRfsp", ue_context->pcf_rfsp) == NULL) {
733
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_rfsp]");
734
0
        goto end;
735
0
    }
736
0
    }
737
738
0
    if (ue_context->chf_group_id) {
739
0
    if (cJSON_AddStringToObject(item, "chfGroupId", ue_context->chf_group_id) == NULL) {
740
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [chf_group_id]");
741
0
        goto end;
742
0
    }
743
0
    }
744
745
0
    if (ue_context->is_used_rfsp) {
746
0
    if (cJSON_AddNumberToObject(item, "usedRfsp", ue_context->used_rfsp) == NULL) {
747
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [used_rfsp]");
748
0
        goto end;
749
0
    }
750
0
    }
751
752
0
    if (ue_context->sub_ue_ambr) {
753
0
    cJSON *sub_ue_ambr_local_JSON = OpenAPI_ambr_convertToJSON(ue_context->sub_ue_ambr);
754
0
    if (sub_ue_ambr_local_JSON == NULL) {
755
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [sub_ue_ambr]");
756
0
        goto end;
757
0
    }
758
0
    cJSON_AddItemToObject(item, "subUeAmbr", sub_ue_ambr_local_JSON);
759
0
    if (item->child == NULL) {
760
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [sub_ue_ambr]");
761
0
        goto end;
762
0
    }
763
0
    }
764
765
0
    if (ue_context->pcf_ue_ambr) {
766
0
    cJSON *pcf_ue_ambr_local_JSON = OpenAPI_ambr_convertToJSON(ue_context->pcf_ue_ambr);
767
0
    if (pcf_ue_ambr_local_JSON == NULL) {
768
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_ambr]");
769
0
        goto end;
770
0
    }
771
0
    cJSON_AddItemToObject(item, "pcfUeAmbr", pcf_ue_ambr_local_JSON);
772
0
    if (item->child == NULL) {
773
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_ambr]");
774
0
        goto end;
775
0
    }
776
0
    }
777
778
0
    if (ue_context->sub_ue_slice_mbr_list) {
779
0
    cJSON *sub_ue_slice_mbr_list = cJSON_AddObjectToObject(item, "subUeSliceMbrList");
780
0
    if (sub_ue_slice_mbr_list == NULL) {
781
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [sub_ue_slice_mbr_list]");
782
0
        goto end;
783
0
    }
784
0
    cJSON *localMapObject = sub_ue_slice_mbr_list;
785
0
    if (ue_context->sub_ue_slice_mbr_list) {
786
0
        OpenAPI_list_for_each(ue_context->sub_ue_slice_mbr_list, node) {
787
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
788
0
            if (localKeyValue == NULL) {
789
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [sub_ue_slice_mbr_list]");
790
0
                goto end;
791
0
            }
792
0
            if (localKeyValue->key == NULL) {
793
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [sub_ue_slice_mbr_list]");
794
0
                goto end;
795
0
            }
796
0
            cJSON *itemLocal = localKeyValue->value ?
797
0
                OpenAPI_slice_mbr_convertToJSON(localKeyValue->value) :
798
0
                cJSON_CreateNull();
799
0
            if (itemLocal == NULL) {
800
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [inner]");
801
0
                goto end;
802
0
            }
803
0
            cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
804
0
        }
805
0
    }
806
0
    }
807
808
0
    if (ue_context->smsf_id) {
809
0
    if (cJSON_AddStringToObject(item, "smsfId", ue_context->smsf_id) == NULL) {
810
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [smsf_id]");
811
0
        goto end;
812
0
    }
813
0
    }
814
815
0
    if (ue_context->seaf_data) {
816
0
    cJSON *seaf_data_local_JSON = OpenAPI_seaf_data_convertToJSON(ue_context->seaf_data);
817
0
    if (seaf_data_local_JSON == NULL) {
818
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [seaf_data]");
819
0
        goto end;
820
0
    }
821
0
    cJSON_AddItemToObject(item, "seafData", seaf_data_local_JSON);
822
0
    if (item->child == NULL) {
823
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [seaf_data]");
824
0
        goto end;
825
0
    }
826
0
    }
827
828
0
    if (ue_context->_5g_mm_capability) {
829
0
    if (cJSON_AddStringToObject(item, "5gMmCapability", ue_context->_5g_mm_capability) == NULL) {
830
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [_5g_mm_capability]");
831
0
        goto end;
832
0
    }
833
0
    }
834
835
0
    if (ue_context->pcf_id) {
836
0
    if (cJSON_AddStringToObject(item, "pcfId", ue_context->pcf_id) == NULL) {
837
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_id]");
838
0
        goto end;
839
0
    }
840
0
    }
841
842
0
    if (ue_context->pcf_set_id) {
843
0
    if (cJSON_AddStringToObject(item, "pcfSetId", ue_context->pcf_set_id) == NULL) {
844
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_set_id]");
845
0
        goto end;
846
0
    }
847
0
    }
848
849
0
    if (ue_context->pcf_amp_service_set_id) {
850
0
    if (cJSON_AddStringToObject(item, "pcfAmpServiceSetId", ue_context->pcf_amp_service_set_id) == NULL) {
851
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_amp_service_set_id]");
852
0
        goto end;
853
0
    }
854
0
    }
855
856
0
    if (ue_context->pcf_uep_service_set_id) {
857
0
    if (cJSON_AddStringToObject(item, "pcfUepServiceSetId", ue_context->pcf_uep_service_set_id) == NULL) {
858
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_uep_service_set_id]");
859
0
        goto end;
860
0
    }
861
0
    }
862
863
0
    if (ue_context->pcf_binding != OpenAPI_sbi_binding_level_NULL) {
864
0
    if (cJSON_AddStringToObject(item, "pcfBinding", OpenAPI_sbi_binding_level_ToString(ue_context->pcf_binding)) == NULL) {
865
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_binding]");
866
0
        goto end;
867
0
    }
868
0
    }
869
870
0
    if (ue_context->pcf_am_policy_uri) {
871
0
    if (cJSON_AddStringToObject(item, "pcfAmPolicyUri", ue_context->pcf_am_policy_uri) == NULL) {
872
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_am_policy_uri]");
873
0
        goto end;
874
0
    }
875
0
    }
876
877
0
    if (ue_context->am_policy_req_trigger_list != OpenAPI_policy_req_trigger_NULL) {
878
0
    cJSON *am_policy_req_trigger_listList = cJSON_AddArrayToObject(item, "amPolicyReqTriggerList");
879
0
    if (am_policy_req_trigger_listList == NULL) {
880
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [am_policy_req_trigger_list]");
881
0
        goto end;
882
0
    }
883
0
    OpenAPI_list_for_each(ue_context->am_policy_req_trigger_list, node) {
884
0
        if (cJSON_AddStringToObject(am_policy_req_trigger_listList, "", OpenAPI_policy_req_trigger_ToString((intptr_t)node->data)) == NULL) {
885
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [am_policy_req_trigger_list]");
886
0
            goto end;
887
0
        }
888
0
    }
889
0
    }
890
891
0
    if (ue_context->pcf_ue_policy_uri) {
892
0
    if (cJSON_AddStringToObject(item, "pcfUePolicyUri", ue_context->pcf_ue_policy_uri) == NULL) {
893
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_policy_uri]");
894
0
        goto end;
895
0
    }
896
0
    }
897
898
0
    if (ue_context->ue_policy_req_trigger_list != OpenAPI_policy_req_trigger_NULL) {
899
0
    cJSON *ue_policy_req_trigger_listList = cJSON_AddArrayToObject(item, "uePolicyReqTriggerList");
900
0
    if (ue_policy_req_trigger_listList == NULL) {
901
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ue_policy_req_trigger_list]");
902
0
        goto end;
903
0
    }
904
0
    OpenAPI_list_for_each(ue_context->ue_policy_req_trigger_list, node) {
905
0
        if (cJSON_AddStringToObject(ue_policy_req_trigger_listList, "", OpenAPI_policy_req_trigger_ToString((intptr_t)node->data)) == NULL) {
906
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [ue_policy_req_trigger_list]");
907
0
            goto end;
908
0
        }
909
0
    }
910
0
    }
911
912
0
    if (ue_context->hpcf_id) {
913
0
    if (cJSON_AddStringToObject(item, "hpcfId", ue_context->hpcf_id) == NULL) {
914
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [hpcf_id]");
915
0
        goto end;
916
0
    }
917
0
    }
918
919
0
    if (ue_context->hpcf_set_id) {
920
0
    if (cJSON_AddStringToObject(item, "hpcfSetId", ue_context->hpcf_set_id) == NULL) {
921
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [hpcf_set_id]");
922
0
        goto end;
923
0
    }
924
0
    }
925
926
0
    if (ue_context->restricted_rat_list != OpenAPI_rat_type_NULL) {
927
0
    cJSON *restricted_rat_listList = cJSON_AddArrayToObject(item, "restrictedRatList");
928
0
    if (restricted_rat_listList == NULL) {
929
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_rat_list]");
930
0
        goto end;
931
0
    }
932
0
    OpenAPI_list_for_each(ue_context->restricted_rat_list, node) {
933
0
        if (cJSON_AddStringToObject(restricted_rat_listList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) {
934
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_rat_list]");
935
0
            goto end;
936
0
        }
937
0
    }
938
0
    }
939
940
0
    if (ue_context->forbidden_area_list) {
941
0
    cJSON *forbidden_area_listList = cJSON_AddArrayToObject(item, "forbiddenAreaList");
942
0
    if (forbidden_area_listList == NULL) {
943
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [forbidden_area_list]");
944
0
        goto end;
945
0
    }
946
0
    OpenAPI_list_for_each(ue_context->forbidden_area_list, node) {
947
0
        cJSON *itemLocal = OpenAPI_area_convertToJSON(node->data);
948
0
        if (itemLocal == NULL) {
949
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [forbidden_area_list]");
950
0
            goto end;
951
0
        }
952
0
        cJSON_AddItemToArray(forbidden_area_listList, itemLocal);
953
0
    }
954
0
    }
955
956
0
    if (ue_context->service_area_restriction) {
957
0
    cJSON *service_area_restriction_local_JSON = OpenAPI_service_area_restriction_convertToJSON(ue_context->service_area_restriction);
958
0
    if (service_area_restriction_local_JSON == NULL) {
959
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [service_area_restriction]");
960
0
        goto end;
961
0
    }
962
0
    cJSON_AddItemToObject(item, "serviceAreaRestriction", service_area_restriction_local_JSON);
963
0
    if (item->child == NULL) {
964
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [service_area_restriction]");
965
0
        goto end;
966
0
    }
967
0
    }
968
969
0
    if (ue_context->restricted_core_nw_type_list != OpenAPI_core_network_type_NULL) {
970
0
    cJSON *restricted_core_nw_type_listList = cJSON_AddArrayToObject(item, "restrictedCoreNwTypeList");
971
0
    if (restricted_core_nw_type_listList == NULL) {
972
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_core_nw_type_list]");
973
0
        goto end;
974
0
    }
975
0
    OpenAPI_list_for_each(ue_context->restricted_core_nw_type_list, node) {
976
0
        if (cJSON_AddStringToObject(restricted_core_nw_type_listList, "", OpenAPI_core_network_type_ToString((intptr_t)node->data)) == NULL) {
977
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_core_nw_type_list]");
978
0
            goto end;
979
0
        }
980
0
    }
981
0
    }
982
983
0
    if (ue_context->event_subscription_list) {
984
0
    cJSON *event_subscription_listList = cJSON_AddArrayToObject(item, "eventSubscriptionList");
985
0
    if (event_subscription_listList == NULL) {
986
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [event_subscription_list]");
987
0
        goto end;
988
0
    }
989
0
    OpenAPI_list_for_each(ue_context->event_subscription_list, node) {
990
0
        cJSON *itemLocal = OpenAPI_ext_amf_event_subscription_convertToJSON(node->data);
991
0
        if (itemLocal == NULL) {
992
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [event_subscription_list]");
993
0
            goto end;
994
0
        }
995
0
        cJSON_AddItemToArray(event_subscription_listList, itemLocal);
996
0
    }
997
0
    }
998
999
0
    if (ue_context->mm_context_list) {
1000
0
    cJSON *mm_context_listList = cJSON_AddArrayToObject(item, "mmContextList");
1001
0
    if (mm_context_listList == NULL) {
1002
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [mm_context_list]");
1003
0
        goto end;
1004
0
    }
1005
0
    OpenAPI_list_for_each(ue_context->mm_context_list, node) {
1006
0
        cJSON *itemLocal = OpenAPI_mm_context_convertToJSON(node->data);
1007
0
        if (itemLocal == NULL) {
1008
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [mm_context_list]");
1009
0
            goto end;
1010
0
        }
1011
0
        cJSON_AddItemToArray(mm_context_listList, itemLocal);
1012
0
    }
1013
0
    }
1014
1015
0
    if (ue_context->session_context_list) {
1016
0
    cJSON *session_context_listList = cJSON_AddArrayToObject(item, "sessionContextList");
1017
0
    if (session_context_listList == NULL) {
1018
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [session_context_list]");
1019
0
        goto end;
1020
0
    }
1021
0
    OpenAPI_list_for_each(ue_context->session_context_list, node) {
1022
0
        cJSON *itemLocal = OpenAPI_pdu_session_context_convertToJSON(node->data);
1023
0
        if (itemLocal == NULL) {
1024
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [session_context_list]");
1025
0
            goto end;
1026
0
        }
1027
0
        cJSON_AddItemToArray(session_context_listList, itemLocal);
1028
0
    }
1029
0
    }
1030
1031
0
    if (ue_context->eps_interworking_info) {
1032
0
    cJSON *eps_interworking_info_local_JSON = OpenAPI_eps_interworking_info_convertToJSON(ue_context->eps_interworking_info);
1033
0
    if (eps_interworking_info_local_JSON == NULL) {
1034
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [eps_interworking_info]");
1035
0
        goto end;
1036
0
    }
1037
0
    cJSON_AddItemToObject(item, "epsInterworkingInfo", eps_interworking_info_local_JSON);
1038
0
    if (item->child == NULL) {
1039
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [eps_interworking_info]");
1040
0
        goto end;
1041
0
    }
1042
0
    }
1043
1044
0
    if (ue_context->trace_data) {
1045
0
    cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(ue_context->trace_data);
1046
0
    if (trace_data_local_JSON == NULL) {
1047
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [trace_data]");
1048
0
        goto end;
1049
0
    }
1050
0
    cJSON_AddItemToObject(item, "traceData", trace_data_local_JSON);
1051
0
    if (item->child == NULL) {
1052
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [trace_data]");
1053
0
        goto end;
1054
0
    }
1055
0
    } else if (ue_context->is_trace_data_null) {
1056
0
        if (cJSON_AddNullToObject(item, "traceData") == NULL) {
1057
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [trace_data]");
1058
0
            goto end;
1059
0
        }
1060
0
    }
1061
1062
0
    if (ue_context->service_gap_expiry_time) {
1063
0
    if (cJSON_AddStringToObject(item, "serviceGapExpiryTime", ue_context->service_gap_expiry_time) == NULL) {
1064
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [service_gap_expiry_time]");
1065
0
        goto end;
1066
0
    }
1067
0
    }
1068
1069
0
    if (ue_context->stn_sr) {
1070
0
    if (cJSON_AddStringToObject(item, "stnSr", ue_context->stn_sr) == NULL) {
1071
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [stn_sr]");
1072
0
        goto end;
1073
0
    }
1074
0
    }
1075
1076
0
    if (ue_context->c_msisdn) {
1077
0
    if (cJSON_AddStringToObject(item, "cMsisdn", ue_context->c_msisdn) == NULL) {
1078
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [c_msisdn]");
1079
0
        goto end;
1080
0
    }
1081
0
    }
1082
1083
0
    if (ue_context->ms_classmark2) {
1084
0
    if (cJSON_AddStringToObject(item, "msClassmark2", ue_context->ms_classmark2) == NULL) {
1085
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ms_classmark2]");
1086
0
        goto end;
1087
0
    }
1088
0
    }
1089
1090
0
    if (ue_context->supported_codec_list) {
1091
0
    cJSON *supported_codec_listList = cJSON_AddArrayToObject(item, "supportedCodecList");
1092
0
    if (supported_codec_listList == NULL) {
1093
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [supported_codec_list]");
1094
0
        goto end;
1095
0
    }
1096
0
    OpenAPI_list_for_each(ue_context->supported_codec_list, node) {
1097
0
        if (cJSON_AddStringToObject(supported_codec_listList, "", (char*)node->data) == NULL) {
1098
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [supported_codec_list]");
1099
0
            goto end;
1100
0
        }
1101
0
    }
1102
0
    }
1103
1104
0
    if (ue_context->small_data_rate_status_infos) {
1105
0
    cJSON *small_data_rate_status_infosList = cJSON_AddArrayToObject(item, "smallDataRateStatusInfos");
1106
0
    if (small_data_rate_status_infosList == NULL) {
1107
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [small_data_rate_status_infos]");
1108
0
        goto end;
1109
0
    }
1110
0
    OpenAPI_list_for_each(ue_context->small_data_rate_status_infos, node) {
1111
0
        cJSON *itemLocal = OpenAPI_small_data_rate_status_info_convertToJSON(node->data);
1112
0
        if (itemLocal == NULL) {
1113
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [small_data_rate_status_infos]");
1114
0
            goto end;
1115
0
        }
1116
0
        cJSON_AddItemToArray(small_data_rate_status_infosList, itemLocal);
1117
0
    }
1118
0
    }
1119
1120
0
    if (ue_context->restricted_primary_rat_list != OpenAPI_rat_type_NULL) {
1121
0
    cJSON *restricted_primary_rat_listList = cJSON_AddArrayToObject(item, "restrictedPrimaryRatList");
1122
0
    if (restricted_primary_rat_listList == NULL) {
1123
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_primary_rat_list]");
1124
0
        goto end;
1125
0
    }
1126
0
    OpenAPI_list_for_each(ue_context->restricted_primary_rat_list, node) {
1127
0
        if (cJSON_AddStringToObject(restricted_primary_rat_listList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) {
1128
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_primary_rat_list]");
1129
0
            goto end;
1130
0
        }
1131
0
    }
1132
0
    }
1133
1134
0
    if (ue_context->restricted_secondary_rat_list != OpenAPI_rat_type_NULL) {
1135
0
    cJSON *restricted_secondary_rat_listList = cJSON_AddArrayToObject(item, "restrictedSecondaryRatList");
1136
0
    if (restricted_secondary_rat_listList == NULL) {
1137
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_secondary_rat_list]");
1138
0
        goto end;
1139
0
    }
1140
0
    OpenAPI_list_for_each(ue_context->restricted_secondary_rat_list, node) {
1141
0
        if (cJSON_AddStringToObject(restricted_secondary_rat_listList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) {
1142
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [restricted_secondary_rat_list]");
1143
0
            goto end;
1144
0
        }
1145
0
    }
1146
0
    }
1147
1148
0
    if (ue_context->v2x_context) {
1149
0
    cJSON *v2x_context_local_JSON = OpenAPI_v2x_context_convertToJSON(ue_context->v2x_context);
1150
0
    if (v2x_context_local_JSON == NULL) {
1151
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [v2x_context]");
1152
0
        goto end;
1153
0
    }
1154
0
    cJSON_AddItemToObject(item, "v2xContext", v2x_context_local_JSON);
1155
0
    if (item->child == NULL) {
1156
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [v2x_context]");
1157
0
        goto end;
1158
0
    }
1159
0
    }
1160
1161
0
    if (ue_context->is_lte_cat_m_ind) {
1162
0
    if (cJSON_AddBoolToObject(item, "lteCatMInd", ue_context->lte_cat_m_ind) == NULL) {
1163
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [lte_cat_m_ind]");
1164
0
        goto end;
1165
0
    }
1166
0
    }
1167
1168
0
    if (ue_context->is_red_cap_ind) {
1169
0
    if (cJSON_AddBoolToObject(item, "redCapInd", ue_context->red_cap_ind) == NULL) {
1170
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [red_cap_ind]");
1171
0
        goto end;
1172
0
    }
1173
0
    }
1174
1175
0
    if (ue_context->is_e_red_cap_ind) {
1176
0
    if (cJSON_AddBoolToObject(item, "eRedCapInd", ue_context->e_red_cap_ind) == NULL) {
1177
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [e_red_cap_ind]");
1178
0
        goto end;
1179
0
    }
1180
0
    }
1181
1182
0
    if (ue_context->mo_exp_data_counter) {
1183
0
    cJSON *mo_exp_data_counter_local_JSON = OpenAPI_mo_exp_data_counter_convertToJSON(ue_context->mo_exp_data_counter);
1184
0
    if (mo_exp_data_counter_local_JSON == NULL) {
1185
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [mo_exp_data_counter]");
1186
0
        goto end;
1187
0
    }
1188
0
    cJSON_AddItemToObject(item, "moExpDataCounter", mo_exp_data_counter_local_JSON);
1189
0
    if (item->child == NULL) {
1190
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [mo_exp_data_counter]");
1191
0
        goto end;
1192
0
    }
1193
0
    }
1194
1195
0
    if (ue_context->cag_data) {
1196
0
    cJSON *cag_data_local_JSON = OpenAPI_cag_data_convertToJSON(ue_context->cag_data);
1197
0
    if (cag_data_local_JSON == NULL) {
1198
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [cag_data]");
1199
0
        goto end;
1200
0
    }
1201
0
    cJSON_AddItemToObject(item, "cagData", cag_data_local_JSON);
1202
0
    if (item->child == NULL) {
1203
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [cag_data]");
1204
0
        goto end;
1205
0
    }
1206
0
    }
1207
1208
0
    if (ue_context->is_management_mdt_ind) {
1209
0
    if (cJSON_AddBoolToObject(item, "managementMdtInd", ue_context->management_mdt_ind) == NULL) {
1210
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [management_mdt_ind]");
1211
0
        goto end;
1212
0
    }
1213
0
    }
1214
1215
0
    if (ue_context->adjacen_plmn_mngt_mdt_inds) {
1216
0
    cJSON *adjacen_plmn_mngt_mdt_inds = cJSON_AddObjectToObject(item, "adjacenPlmnMngtMdtInds");
1217
0
    if (adjacen_plmn_mngt_mdt_inds == NULL) {
1218
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [adjacen_plmn_mngt_mdt_inds]");
1219
0
        goto end;
1220
0
    }
1221
0
    cJSON *localMapObject = adjacen_plmn_mngt_mdt_inds;
1222
0
    if (ue_context->adjacen_plmn_mngt_mdt_inds) {
1223
0
        OpenAPI_list_for_each(ue_context->adjacen_plmn_mngt_mdt_inds, node) {
1224
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
1225
0
            if (localKeyValue == NULL) {
1226
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [adjacen_plmn_mngt_mdt_inds]");
1227
0
                goto end;
1228
0
            }
1229
0
            if (localKeyValue->key == NULL) {
1230
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [adjacen_plmn_mngt_mdt_inds]");
1231
0
                goto end;
1232
0
            }
1233
0
            if (cJSON_AddBoolToObject(localMapObject, localKeyValue->key, (uintptr_t)localKeyValue->value) == NULL) {
1234
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [inner]");
1235
0
                goto end;
1236
0
            }
1237
0
        }
1238
0
    }
1239
0
    }
1240
1241
0
    if (ue_context->immediate_mdt_conf) {
1242
0
    cJSON *immediate_mdt_conf_local_JSON = OpenAPI_immediate_mdt_conf_convertToJSON(ue_context->immediate_mdt_conf);
1243
0
    if (immediate_mdt_conf_local_JSON == NULL) {
1244
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [immediate_mdt_conf]");
1245
0
        goto end;
1246
0
    }
1247
0
    cJSON_AddItemToObject(item, "immediateMdtConf", immediate_mdt_conf_local_JSON);
1248
0
    if (item->child == NULL) {
1249
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [immediate_mdt_conf]");
1250
0
        goto end;
1251
0
    }
1252
0
    }
1253
1254
0
    if (ue_context->ec_restriction_data_wb) {
1255
0
    cJSON *ec_restriction_data_wb_local_JSON = OpenAPI_ec_restriction_data_wb_convertToJSON(ue_context->ec_restriction_data_wb);
1256
0
    if (ec_restriction_data_wb_local_JSON == NULL) {
1257
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ec_restriction_data_wb]");
1258
0
        goto end;
1259
0
    }
1260
0
    cJSON_AddItemToObject(item, "ecRestrictionDataWb", ec_restriction_data_wb_local_JSON);
1261
0
    if (item->child == NULL) {
1262
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ec_restriction_data_wb]");
1263
0
        goto end;
1264
0
    }
1265
0
    }
1266
1267
0
    if (ue_context->is_ec_restriction_data_nb) {
1268
0
    if (cJSON_AddBoolToObject(item, "ecRestrictionDataNb", ue_context->ec_restriction_data_nb) == NULL) {
1269
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ec_restriction_data_nb]");
1270
0
        goto end;
1271
0
    }
1272
0
    }
1273
1274
0
    if (ue_context->is_iab_operation_allowed) {
1275
0
    if (cJSON_AddBoolToObject(item, "iabOperationAllowed", ue_context->iab_operation_allowed) == NULL) {
1276
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [iab_operation_allowed]");
1277
0
        goto end;
1278
0
    }
1279
0
    }
1280
1281
0
    if (ue_context->prose_context) {
1282
0
    cJSON *prose_context_local_JSON = OpenAPI_prose_context_convertToJSON(ue_context->prose_context);
1283
0
    if (prose_context_local_JSON == NULL) {
1284
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [prose_context]");
1285
0
        goto end;
1286
0
    }
1287
0
    cJSON_AddItemToObject(item, "proseContext", prose_context_local_JSON);
1288
0
    if (item->child == NULL) {
1289
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [prose_context]");
1290
0
        goto end;
1291
0
    }
1292
0
    }
1293
1294
0
    if (ue_context->analytics_subscription_list) {
1295
0
    cJSON *analytics_subscription_listList = cJSON_AddArrayToObject(item, "analyticsSubscriptionList");
1296
0
    if (analytics_subscription_listList == NULL) {
1297
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [analytics_subscription_list]");
1298
0
        goto end;
1299
0
    }
1300
0
    OpenAPI_list_for_each(ue_context->analytics_subscription_list, node) {
1301
0
        cJSON *itemLocal = OpenAPI_analytics_subscription_convertToJSON(node->data);
1302
0
        if (itemLocal == NULL) {
1303
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [analytics_subscription_list]");
1304
0
            goto end;
1305
0
        }
1306
0
        cJSON_AddItemToArray(analytics_subscription_listList, itemLocal);
1307
0
    }
1308
0
    }
1309
1310
0
    if (ue_context->pcf_amp_binding_info) {
1311
0
    if (cJSON_AddStringToObject(item, "pcfAmpBindingInfo", ue_context->pcf_amp_binding_info) == NULL) {
1312
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_amp_binding_info]");
1313
0
        goto end;
1314
0
    }
1315
0
    }
1316
1317
0
    if (ue_context->pcf_uep_binding_info) {
1318
0
    if (cJSON_AddStringToObject(item, "pcfUepBindingInfo", ue_context->pcf_uep_binding_info) == NULL) {
1319
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_uep_binding_info]");
1320
0
        goto end;
1321
0
    }
1322
0
    }
1323
1324
0
    if (ue_context->used_service_area_restriction) {
1325
0
    cJSON *used_service_area_restriction_local_JSON = OpenAPI_service_area_restriction_convertToJSON(ue_context->used_service_area_restriction);
1326
0
    if (used_service_area_restriction_local_JSON == NULL) {
1327
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [used_service_area_restriction]");
1328
0
        goto end;
1329
0
    }
1330
0
    cJSON_AddItemToObject(item, "usedServiceAreaRestriction", used_service_area_restriction_local_JSON);
1331
0
    if (item->child == NULL) {
1332
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [used_service_area_restriction]");
1333
0
        goto end;
1334
0
    }
1335
0
    }
1336
1337
0
    if (ue_context->pra_in_am_policy) {
1338
0
    cJSON *pra_in_am_policy = cJSON_AddObjectToObject(item, "praInAmPolicy");
1339
0
    if (pra_in_am_policy == NULL) {
1340
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pra_in_am_policy]");
1341
0
        goto end;
1342
0
    }
1343
0
    cJSON *localMapObject = pra_in_am_policy;
1344
0
    if (ue_context->pra_in_am_policy) {
1345
0
        OpenAPI_list_for_each(ue_context->pra_in_am_policy, node) {
1346
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
1347
0
            if (localKeyValue == NULL) {
1348
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [pra_in_am_policy]");
1349
0
                goto end;
1350
0
            }
1351
0
            if (localKeyValue->key == NULL) {
1352
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [pra_in_am_policy]");
1353
0
                goto end;
1354
0
            }
1355
0
            cJSON *itemLocal = localKeyValue->value ?
1356
0
                OpenAPI_presence_info_convertToJSON(localKeyValue->value) :
1357
0
                cJSON_CreateNull();
1358
0
            if (itemLocal == NULL) {
1359
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [inner]");
1360
0
                goto end;
1361
0
            }
1362
0
            cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
1363
0
        }
1364
0
    }
1365
0
    }
1366
1367
0
    if (ue_context->pra_in_ue_policy) {
1368
0
    cJSON *pra_in_ue_policy = cJSON_AddObjectToObject(item, "praInUePolicy");
1369
0
    if (pra_in_ue_policy == NULL) {
1370
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pra_in_ue_policy]");
1371
0
        goto end;
1372
0
    }
1373
0
    cJSON *localMapObject = pra_in_ue_policy;
1374
0
    if (ue_context->pra_in_ue_policy) {
1375
0
        OpenAPI_list_for_each(ue_context->pra_in_ue_policy, node) {
1376
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
1377
0
            if (localKeyValue == NULL) {
1378
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [pra_in_ue_policy]");
1379
0
                goto end;
1380
0
            }
1381
0
            if (localKeyValue->key == NULL) {
1382
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [pra_in_ue_policy]");
1383
0
                goto end;
1384
0
            }
1385
0
            cJSON *itemLocal = localKeyValue->value ?
1386
0
                OpenAPI_presence_info_convertToJSON(localKeyValue->value) :
1387
0
                cJSON_CreateNull();
1388
0
            if (itemLocal == NULL) {
1389
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [inner]");
1390
0
                goto end;
1391
0
            }
1392
0
            cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
1393
0
        }
1394
0
    }
1395
0
    }
1396
1397
0
    if (ue_context->updp_subscription_data) {
1398
0
    cJSON *updp_subscription_data_local_JSON = OpenAPI_updp_subscription_data_convertToJSON(ue_context->updp_subscription_data);
1399
0
    if (updp_subscription_data_local_JSON == NULL) {
1400
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [updp_subscription_data]");
1401
0
        goto end;
1402
0
    }
1403
0
    cJSON_AddItemToObject(item, "updpSubscriptionData", updp_subscription_data_local_JSON);
1404
0
    if (item->child == NULL) {
1405
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [updp_subscription_data]");
1406
0
        goto end;
1407
0
    }
1408
0
    }
1409
1410
0
    if (ue_context->sm_policy_notify_pdu_list) {
1411
0
    cJSON *sm_policy_notify_pdu_listList = cJSON_AddArrayToObject(item, "smPolicyNotifyPduList");
1412
0
    if (sm_policy_notify_pdu_listList == NULL) {
1413
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [sm_policy_notify_pdu_list]");
1414
0
        goto end;
1415
0
    }
1416
0
    OpenAPI_list_for_each(ue_context->sm_policy_notify_pdu_list, node) {
1417
0
        cJSON *itemLocal = OpenAPI_pdu_session_info_convertToJSON(node->data);
1418
0
        if (itemLocal == NULL) {
1419
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [sm_policy_notify_pdu_list]");
1420
0
            goto end;
1421
0
        }
1422
0
        cJSON_AddItemToArray(sm_policy_notify_pdu_listList, itemLocal);
1423
0
    }
1424
0
    }
1425
1426
0
    if (ue_context->pcf_ue_callback_info) {
1427
0
    cJSON *pcf_ue_callback_info_local_JSON = OpenAPI_pcf_ue_callback_info_convertToJSON(ue_context->pcf_ue_callback_info);
1428
0
    if (pcf_ue_callback_info_local_JSON == NULL) {
1429
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_callback_info]");
1430
0
        goto end;
1431
0
    }
1432
0
    cJSON_AddItemToObject(item, "pcfUeCallbackInfo", pcf_ue_callback_info_local_JSON);
1433
0
    if (item->child == NULL) {
1434
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_callback_info]");
1435
0
        goto end;
1436
0
    }
1437
0
    } else if (ue_context->is_pcf_ue_callback_info_null) {
1438
0
        if (cJSON_AddNullToObject(item, "pcfUeCallbackInfo") == NULL) {
1439
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_callback_info]");
1440
0
            goto end;
1441
0
        }
1442
0
    }
1443
1444
0
    if (ue_context->ue_positioning_cap) {
1445
0
    if (cJSON_AddStringToObject(item, "uePositioningCap", ue_context->ue_positioning_cap) == NULL) {
1446
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ue_positioning_cap]");
1447
0
        goto end;
1448
0
    }
1449
0
    }
1450
1451
0
    if (ue_context->is_asti_distribution_indication) {
1452
0
    if (cJSON_AddBoolToObject(item, "astiDistributionIndication", ue_context->asti_distribution_indication) == NULL) {
1453
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [asti_distribution_indication]");
1454
0
        goto end;
1455
0
    }
1456
0
    }
1457
1458
0
    if (ue_context->is_ts_error_budget) {
1459
0
    if (cJSON_AddNumberToObject(item, "tsErrorBudget", ue_context->ts_error_budget) == NULL) {
1460
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ts_error_budget]");
1461
0
        goto end;
1462
0
    }
1463
0
    }
1464
1465
0
    if (ue_context->is_snpn_onboard_ind) {
1466
0
    if (cJSON_AddBoolToObject(item, "snpnOnboardInd", ue_context->snpn_onboard_ind) == NULL) {
1467
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [snpn_onboard_ind]");
1468
0
        goto end;
1469
0
    }
1470
0
    }
1471
1472
0
    if (ue_context->smf_sel_info) {
1473
0
    cJSON *smf_sel_info_local_JSON = OpenAPI_smf_selection_data_convertToJSON(ue_context->smf_sel_info);
1474
0
    if (smf_sel_info_local_JSON == NULL) {
1475
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [smf_sel_info]");
1476
0
        goto end;
1477
0
    }
1478
0
    cJSON_AddItemToObject(item, "smfSelInfo", smf_sel_info_local_JSON);
1479
0
    if (item->child == NULL) {
1480
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [smf_sel_info]");
1481
0
        goto end;
1482
0
    }
1483
0
    } else if (ue_context->is_smf_sel_info_null) {
1484
0
        if (cJSON_AddNullToObject(item, "smfSelInfo") == NULL) {
1485
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [smf_sel_info]");
1486
0
            goto end;
1487
0
        }
1488
0
    }
1489
1490
0
    if (ue_context->pcf_ue_slice_mbr_list) {
1491
0
    cJSON *pcf_ue_slice_mbr_list = cJSON_AddObjectToObject(item, "pcfUeSliceMbrList");
1492
0
    if (pcf_ue_slice_mbr_list == NULL) {
1493
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_slice_mbr_list]");
1494
0
        goto end;
1495
0
    }
1496
0
    cJSON *localMapObject = pcf_ue_slice_mbr_list;
1497
0
    if (ue_context->pcf_ue_slice_mbr_list) {
1498
0
        OpenAPI_list_for_each(ue_context->pcf_ue_slice_mbr_list, node) {
1499
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
1500
0
            if (localKeyValue == NULL) {
1501
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_slice_mbr_list]");
1502
0
                goto end;
1503
0
            }
1504
0
            if (localKeyValue->key == NULL) {
1505
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [pcf_ue_slice_mbr_list]");
1506
0
                goto end;
1507
0
            }
1508
0
            cJSON *itemLocal = localKeyValue->value ?
1509
0
                OpenAPI_slice_mbr_convertToJSON(localKeyValue->value) :
1510
0
                cJSON_CreateNull();
1511
0
            if (itemLocal == NULL) {
1512
0
                ogs_error("OpenAPI_ue_context_convertToJSON() failed [inner]");
1513
0
                goto end;
1514
0
            }
1515
0
            cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
1516
0
        }
1517
0
    }
1518
0
    }
1519
1520
0
    if (ue_context->smsf_set_id) {
1521
0
    if (cJSON_AddStringToObject(item, "smsfSetId", ue_context->smsf_set_id) == NULL) {
1522
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [smsf_set_id]");
1523
0
        goto end;
1524
0
    }
1525
0
    }
1526
1527
0
    if (ue_context->smsf_service_set_id) {
1528
0
    if (cJSON_AddStringToObject(item, "smsfServiceSetId", ue_context->smsf_service_set_id) == NULL) {
1529
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [smsf_service_set_id]");
1530
0
        goto end;
1531
0
    }
1532
0
    }
1533
1534
0
    if (ue_context->smsf_binding_info) {
1535
0
    if (cJSON_AddStringToObject(item, "smsfBindingInfo", ue_context->smsf_binding_info) == NULL) {
1536
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [smsf_binding_info]");
1537
0
        goto end;
1538
0
    }
1539
0
    }
1540
1541
0
    if (ue_context->is_disaster_roaming_ind) {
1542
0
    if (cJSON_AddBoolToObject(item, "disasterRoamingInd", ue_context->disaster_roaming_ind) == NULL) {
1543
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [disaster_roaming_ind]");
1544
0
        goto end;
1545
0
    }
1546
0
    }
1547
1548
0
    if (ue_context->disaster_plmn) {
1549
0
    cJSON *disaster_plmn_local_JSON = OpenAPI_plmn_id_convertToJSON(ue_context->disaster_plmn);
1550
0
    if (disaster_plmn_local_JSON == NULL) {
1551
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [disaster_plmn]");
1552
0
        goto end;
1553
0
    }
1554
0
    cJSON_AddItemToObject(item, "disasterPlmn", disaster_plmn_local_JSON);
1555
0
    if (item->child == NULL) {
1556
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [disaster_plmn]");
1557
0
        goto end;
1558
0
    }
1559
0
    }
1560
1561
0
    if (ue_context->satellite_backhaul_cat != OpenAPI_satellite_backhaul_category_NULL) {
1562
0
    if (cJSON_AddStringToObject(item, "satelliteBackhaulCat", OpenAPI_satellite_backhaul_category_ToString(ue_context->satellite_backhaul_cat)) == NULL) {
1563
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [satellite_backhaul_cat]");
1564
0
        goto end;
1565
0
    }
1566
0
    }
1567
1568
0
    if (ue_context->wl_serv_area_res) {
1569
0
    cJSON *wl_serv_area_res_local_JSON = OpenAPI_wireline_service_area_restriction_convertToJSON(ue_context->wl_serv_area_res);
1570
0
    if (wl_serv_area_res_local_JSON == NULL) {
1571
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [wl_serv_area_res]");
1572
0
        goto end;
1573
0
    }
1574
0
    cJSON_AddItemToObject(item, "wlServAreaRes", wl_serv_area_res_local_JSON);
1575
0
    if (item->child == NULL) {
1576
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [wl_serv_area_res]");
1577
0
        goto end;
1578
0
    }
1579
0
    }
1580
1581
0
    if (ue_context->as_time_dis_param) {
1582
0
    cJSON *as_time_dis_param_local_JSON = OpenAPI_as_time_distribution_param_convertToJSON(ue_context->as_time_dis_param);
1583
0
    if (as_time_dis_param_local_JSON == NULL) {
1584
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [as_time_dis_param]");
1585
0
        goto end;
1586
0
    }
1587
0
    cJSON_AddItemToObject(item, "asTimeDisParam", as_time_dis_param_local_JSON);
1588
0
    if (item->child == NULL) {
1589
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [as_time_dis_param]");
1590
0
        goto end;
1591
0
    }
1592
0
    } else if (ue_context->is_as_time_dis_param_null) {
1593
0
        if (cJSON_AddNullToObject(item, "asTimeDisParam") == NULL) {
1594
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [as_time_dis_param]");
1595
0
            goto end;
1596
0
        }
1597
0
    }
1598
1599
0
    if (ue_context->am_policy_info_container) {
1600
0
    cJSON *am_policy_info_container_local_JSON = OpenAPI_am_policy_info_container_convertToJSON(ue_context->am_policy_info_container);
1601
0
    if (am_policy_info_container_local_JSON == NULL) {
1602
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [am_policy_info_container]");
1603
0
        goto end;
1604
0
    }
1605
0
    cJSON_AddItemToObject(item, "amPolicyInfoContainer", am_policy_info_container_local_JSON);
1606
0
    if (item->child == NULL) {
1607
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [am_policy_info_container]");
1608
0
        goto end;
1609
0
    }
1610
0
    }
1611
1612
0
    if (ue_context->a2x_context) {
1613
0
    cJSON *a2x_context_local_JSON = OpenAPI_a2x_context_convertToJSON(ue_context->a2x_context);
1614
0
    if (a2x_context_local_JSON == NULL) {
1615
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [a2x_context]");
1616
0
        goto end;
1617
0
    }
1618
0
    cJSON_AddItemToObject(item, "a2xContext", a2x_context_local_JSON);
1619
0
    if (item->child == NULL) {
1620
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [a2x_context]");
1621
0
        goto end;
1622
0
    }
1623
0
    }
1624
1625
0
    if (ue_context->mbsr_operation_allowed) {
1626
0
    cJSON *mbsr_operation_allowed_local_JSON = OpenAPI_mbsr_operation_allowed_convertToJSON(ue_context->mbsr_operation_allowed);
1627
0
    if (mbsr_operation_allowed_local_JSON == NULL) {
1628
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [mbsr_operation_allowed]");
1629
0
        goto end;
1630
0
    }
1631
0
    cJSON_AddItemToObject(item, "mbsrOperationAllowed", mbsr_operation_allowed_local_JSON);
1632
0
    if (item->child == NULL) {
1633
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [mbsr_operation_allowed]");
1634
0
        goto end;
1635
0
    }
1636
0
    }
1637
1638
0
    if (ue_context->lcs_up_context) {
1639
0
    cJSON *lcs_up_context_local_JSON = OpenAPI_lcs_up_context_convertToJSON(ue_context->lcs_up_context);
1640
0
    if (lcs_up_context_local_JSON == NULL) {
1641
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [lcs_up_context]");
1642
0
        goto end;
1643
0
    }
1644
0
    cJSON_AddItemToObject(item, "lcsUpContext", lcs_up_context_local_JSON);
1645
0
    if (item->child == NULL) {
1646
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [lcs_up_context]");
1647
0
        goto end;
1648
0
    }
1649
0
    }
1650
1651
0
    if (ue_context->lcs_up_context_list) {
1652
0
    cJSON *lcs_up_context_listList = cJSON_AddArrayToObject(item, "lcsUpContextList");
1653
0
    if (lcs_up_context_listList == NULL) {
1654
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [lcs_up_context_list]");
1655
0
        goto end;
1656
0
    }
1657
0
    OpenAPI_list_for_each(ue_context->lcs_up_context_list, node) {
1658
0
        cJSON *itemLocal = OpenAPI_lcs_up_context_convertToJSON(node->data);
1659
0
        if (itemLocal == NULL) {
1660
0
            ogs_error("OpenAPI_ue_context_convertToJSON() failed [lcs_up_context_list]");
1661
0
            goto end;
1662
0
        }
1663
0
        cJSON_AddItemToArray(lcs_up_context_listList, itemLocal);
1664
0
    }
1665
0
    }
1666
1667
0
    if (ue_context->is_reconnect_ind) {
1668
0
    if (cJSON_AddBoolToObject(item, "reconnectInd", ue_context->reconnect_ind) == NULL) {
1669
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [reconnect_ind]");
1670
0
        goto end;
1671
0
    }
1672
0
    }
1673
1674
0
    if (ue_context->ue_policy_container) {
1675
0
    if (cJSON_AddStringToObject(item, "uePolicyContainer", ue_context->ue_policy_container) == NULL) {
1676
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ue_policy_container]");
1677
0
        goto end;
1678
0
    }
1679
0
    }
1680
1681
0
    if (ue_context->is_am_policy_ind) {
1682
0
    if (cJSON_AddBoolToObject(item, "amPolicyInd", ue_context->am_policy_ind) == NULL) {
1683
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [am_policy_ind]");
1684
0
        goto end;
1685
0
    }
1686
0
    }
1687
1688
0
    if (ue_context->is_ue_policy_ind) {
1689
0
    if (cJSON_AddBoolToObject(item, "uePolicyInd", ue_context->ue_policy_ind) == NULL) {
1690
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [ue_policy_ind]");
1691
0
        goto end;
1692
0
    }
1693
0
    }
1694
1695
0
    if (ue_context->is_energy_saving_ind) {
1696
0
    if (cJSON_AddNumberToObject(item, "energySavingInd", ue_context->energy_saving_ind) == NULL) {
1697
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed [energy_saving_ind]");
1698
0
        goto end;
1699
0
    }
1700
0
    }
1701
1702
0
end:
1703
0
    return item;
1704
0
}
1705
1706
OpenAPI_ue_context_t *OpenAPI_ue_context_parseFromJSON(cJSON *ue_contextJSON)
1707
0
{
1708
0
    OpenAPI_ue_context_t *ue_context_local_var = NULL;
1709
0
    OpenAPI_lnode_t *node = NULL;
1710
0
    cJSON *supi = NULL;
1711
0
    cJSON *supi_unauth_ind = NULL;
1712
0
    cJSON *gpsi_list = NULL;
1713
0
    OpenAPI_list_t *gpsi_listList = NULL;
1714
0
    cJSON *pei = NULL;
1715
0
    cJSON *udm_group_id = NULL;
1716
0
    cJSON *ausf_group_id = NULL;
1717
0
    cJSON *pcf_group_id = NULL;
1718
0
    cJSON *routing_indicator = NULL;
1719
0
    cJSON *h_nw_pub_key_id = NULL;
1720
0
    cJSON *group_list = NULL;
1721
0
    OpenAPI_list_t *group_listList = NULL;
1722
0
    cJSON *drx_parameter = NULL;
1723
0
    cJSON *sub_rfsp = NULL;
1724
0
    cJSON *pcf_rfsp = NULL;
1725
0
    cJSON *chf_group_id = NULL;
1726
0
    cJSON *used_rfsp = NULL;
1727
0
    cJSON *sub_ue_ambr = NULL;
1728
0
    OpenAPI_ambr_t *sub_ue_ambr_local_nonprim = NULL;
1729
0
    cJSON *pcf_ue_ambr = NULL;
1730
0
    OpenAPI_ambr_t *pcf_ue_ambr_local_nonprim = NULL;
1731
0
    cJSON *sub_ue_slice_mbr_list = NULL;
1732
0
    OpenAPI_list_t *sub_ue_slice_mbr_listList = NULL;
1733
0
    cJSON *smsf_id = NULL;
1734
0
    cJSON *seaf_data = NULL;
1735
0
    OpenAPI_seaf_data_t *seaf_data_local_nonprim = NULL;
1736
0
    cJSON *_5g_mm_capability = NULL;
1737
0
    cJSON *pcf_id = NULL;
1738
0
    cJSON *pcf_set_id = NULL;
1739
0
    cJSON *pcf_amp_service_set_id = NULL;
1740
0
    cJSON *pcf_uep_service_set_id = NULL;
1741
0
    cJSON *pcf_binding = NULL;
1742
0
    OpenAPI_sbi_binding_level_e pcf_bindingVariable = 0;
1743
0
    cJSON *pcf_am_policy_uri = NULL;
1744
0
    cJSON *am_policy_req_trigger_list = NULL;
1745
0
    OpenAPI_list_t *am_policy_req_trigger_listList = NULL;
1746
0
    cJSON *pcf_ue_policy_uri = NULL;
1747
0
    cJSON *ue_policy_req_trigger_list = NULL;
1748
0
    OpenAPI_list_t *ue_policy_req_trigger_listList = NULL;
1749
0
    cJSON *hpcf_id = NULL;
1750
0
    cJSON *hpcf_set_id = NULL;
1751
0
    cJSON *restricted_rat_list = NULL;
1752
0
    OpenAPI_list_t *restricted_rat_listList = NULL;
1753
0
    cJSON *forbidden_area_list = NULL;
1754
0
    OpenAPI_list_t *forbidden_area_listList = NULL;
1755
0
    cJSON *service_area_restriction = NULL;
1756
0
    OpenAPI_service_area_restriction_t *service_area_restriction_local_nonprim = NULL;
1757
0
    cJSON *restricted_core_nw_type_list = NULL;
1758
0
    OpenAPI_list_t *restricted_core_nw_type_listList = NULL;
1759
0
    cJSON *event_subscription_list = NULL;
1760
0
    OpenAPI_list_t *event_subscription_listList = NULL;
1761
0
    cJSON *mm_context_list = NULL;
1762
0
    OpenAPI_list_t *mm_context_listList = NULL;
1763
0
    cJSON *session_context_list = NULL;
1764
0
    OpenAPI_list_t *session_context_listList = NULL;
1765
0
    cJSON *eps_interworking_info = NULL;
1766
0
    OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL;
1767
0
    cJSON *trace_data = NULL;
1768
0
    OpenAPI_trace_data_t *trace_data_local_nonprim = NULL;
1769
0
    cJSON *service_gap_expiry_time = NULL;
1770
0
    cJSON *stn_sr = NULL;
1771
0
    cJSON *c_msisdn = NULL;
1772
0
    cJSON *ms_classmark2 = NULL;
1773
0
    cJSON *supported_codec_list = NULL;
1774
0
    OpenAPI_list_t *supported_codec_listList = NULL;
1775
0
    cJSON *small_data_rate_status_infos = NULL;
1776
0
    OpenAPI_list_t *small_data_rate_status_infosList = NULL;
1777
0
    cJSON *restricted_primary_rat_list = NULL;
1778
0
    OpenAPI_list_t *restricted_primary_rat_listList = NULL;
1779
0
    cJSON *restricted_secondary_rat_list = NULL;
1780
0
    OpenAPI_list_t *restricted_secondary_rat_listList = NULL;
1781
0
    cJSON *v2x_context = NULL;
1782
0
    OpenAPI_v2x_context_t *v2x_context_local_nonprim = NULL;
1783
0
    cJSON *lte_cat_m_ind = NULL;
1784
0
    cJSON *red_cap_ind = NULL;
1785
0
    cJSON *e_red_cap_ind = NULL;
1786
0
    cJSON *mo_exp_data_counter = NULL;
1787
0
    OpenAPI_mo_exp_data_counter_t *mo_exp_data_counter_local_nonprim = NULL;
1788
0
    cJSON *cag_data = NULL;
1789
0
    OpenAPI_cag_data_t *cag_data_local_nonprim = NULL;
1790
0
    cJSON *management_mdt_ind = NULL;
1791
0
    cJSON *adjacen_plmn_mngt_mdt_inds = NULL;
1792
0
    OpenAPI_list_t *adjacen_plmn_mngt_mdt_indsList = NULL;
1793
0
    cJSON *immediate_mdt_conf = NULL;
1794
0
    OpenAPI_immediate_mdt_conf_t *immediate_mdt_conf_local_nonprim = NULL;
1795
0
    cJSON *ec_restriction_data_wb = NULL;
1796
0
    OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL;
1797
0
    cJSON *ec_restriction_data_nb = NULL;
1798
0
    cJSON *iab_operation_allowed = NULL;
1799
0
    cJSON *prose_context = NULL;
1800
0
    OpenAPI_prose_context_t *prose_context_local_nonprim = NULL;
1801
0
    cJSON *analytics_subscription_list = NULL;
1802
0
    OpenAPI_list_t *analytics_subscription_listList = NULL;
1803
0
    cJSON *pcf_amp_binding_info = NULL;
1804
0
    cJSON *pcf_uep_binding_info = NULL;
1805
0
    cJSON *used_service_area_restriction = NULL;
1806
0
    OpenAPI_service_area_restriction_t *used_service_area_restriction_local_nonprim = NULL;
1807
0
    cJSON *pra_in_am_policy = NULL;
1808
0
    OpenAPI_list_t *pra_in_am_policyList = NULL;
1809
0
    cJSON *pra_in_ue_policy = NULL;
1810
0
    OpenAPI_list_t *pra_in_ue_policyList = NULL;
1811
0
    cJSON *updp_subscription_data = NULL;
1812
0
    OpenAPI_updp_subscription_data_t *updp_subscription_data_local_nonprim = NULL;
1813
0
    cJSON *sm_policy_notify_pdu_list = NULL;
1814
0
    OpenAPI_list_t *sm_policy_notify_pdu_listList = NULL;
1815
0
    cJSON *pcf_ue_callback_info = NULL;
1816
0
    OpenAPI_pcf_ue_callback_info_t *pcf_ue_callback_info_local_nonprim = NULL;
1817
0
    cJSON *ue_positioning_cap = NULL;
1818
0
    cJSON *asti_distribution_indication = NULL;
1819
0
    cJSON *ts_error_budget = NULL;
1820
0
    cJSON *snpn_onboard_ind = NULL;
1821
0
    cJSON *smf_sel_info = NULL;
1822
0
    OpenAPI_smf_selection_data_t *smf_sel_info_local_nonprim = NULL;
1823
0
    cJSON *pcf_ue_slice_mbr_list = NULL;
1824
0
    OpenAPI_list_t *pcf_ue_slice_mbr_listList = NULL;
1825
0
    cJSON *smsf_set_id = NULL;
1826
0
    cJSON *smsf_service_set_id = NULL;
1827
0
    cJSON *smsf_binding_info = NULL;
1828
0
    cJSON *disaster_roaming_ind = NULL;
1829
0
    cJSON *disaster_plmn = NULL;
1830
0
    OpenAPI_plmn_id_t *disaster_plmn_local_nonprim = NULL;
1831
0
    cJSON *satellite_backhaul_cat = NULL;
1832
0
    OpenAPI_satellite_backhaul_category_e satellite_backhaul_catVariable = 0;
1833
0
    cJSON *wl_serv_area_res = NULL;
1834
0
    OpenAPI_wireline_service_area_restriction_t *wl_serv_area_res_local_nonprim = NULL;
1835
0
    cJSON *as_time_dis_param = NULL;
1836
0
    OpenAPI_as_time_distribution_param_t *as_time_dis_param_local_nonprim = NULL;
1837
0
    cJSON *am_policy_info_container = NULL;
1838
0
    OpenAPI_am_policy_info_container_t *am_policy_info_container_local_nonprim = NULL;
1839
0
    cJSON *a2x_context = NULL;
1840
0
    OpenAPI_a2x_context_t *a2x_context_local_nonprim = NULL;
1841
0
    cJSON *mbsr_operation_allowed = NULL;
1842
0
    OpenAPI_mbsr_operation_allowed_t *mbsr_operation_allowed_local_nonprim = NULL;
1843
0
    cJSON *lcs_up_context = NULL;
1844
0
    OpenAPI_lcs_up_context_t *lcs_up_context_local_nonprim = NULL;
1845
0
    cJSON *lcs_up_context_list = NULL;
1846
0
    OpenAPI_list_t *lcs_up_context_listList = NULL;
1847
0
    cJSON *reconnect_ind = NULL;
1848
0
    cJSON *ue_policy_container = NULL;
1849
0
    cJSON *am_policy_ind = NULL;
1850
0
    cJSON *ue_policy_ind = NULL;
1851
0
    cJSON *energy_saving_ind = NULL;
1852
0
    supi = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supi");
1853
0
    if (supi) {
1854
0
    if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
1855
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supi]");
1856
0
        goto end;
1857
0
    }
1858
0
    }
1859
1860
0
    supi_unauth_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supiUnauthInd");
1861
0
    if (supi_unauth_ind) {
1862
0
    if (!cJSON_IsBool(supi_unauth_ind)) {
1863
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supi_unauth_ind]");
1864
0
        goto end;
1865
0
    }
1866
0
    }
1867
1868
0
    gpsi_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "gpsiList");
1869
0
    if (gpsi_list) {
1870
0
        cJSON *gpsi_list_local = NULL;
1871
0
        if (!cJSON_IsArray(gpsi_list)) {
1872
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [gpsi_list]");
1873
0
            goto end;
1874
0
        }
1875
1876
0
        gpsi_listList = OpenAPI_list_create();
1877
1878
0
        cJSON_ArrayForEach(gpsi_list_local, gpsi_list) {
1879
0
            double *localDouble = NULL;
1880
0
            int *localInt = NULL;
1881
0
            if (!cJSON_IsString(gpsi_list_local)) {
1882
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [gpsi_list]");
1883
0
                goto end;
1884
0
            }
1885
0
            OpenAPI_list_add(gpsi_listList, ogs_strdup(gpsi_list_local->valuestring));
1886
0
        }
1887
0
    }
1888
1889
0
    pei = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pei");
1890
0
    if (pei) {
1891
0
    if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) {
1892
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pei]");
1893
0
        goto end;
1894
0
    }
1895
0
    }
1896
1897
0
    udm_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "udmGroupId");
1898
0
    if (udm_group_id) {
1899
0
    if (!cJSON_IsString(udm_group_id) && !cJSON_IsNull(udm_group_id)) {
1900
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [udm_group_id]");
1901
0
        goto end;
1902
0
    }
1903
0
    }
1904
1905
0
    ausf_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ausfGroupId");
1906
0
    if (ausf_group_id) {
1907
0
    if (!cJSON_IsString(ausf_group_id) && !cJSON_IsNull(ausf_group_id)) {
1908
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ausf_group_id]");
1909
0
        goto end;
1910
0
    }
1911
0
    }
1912
1913
0
    pcf_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfGroupId");
1914
0
    if (pcf_group_id) {
1915
0
    if (!cJSON_IsString(pcf_group_id) && !cJSON_IsNull(pcf_group_id)) {
1916
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_group_id]");
1917
0
        goto end;
1918
0
    }
1919
0
    }
1920
1921
0
    routing_indicator = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "routingIndicator");
1922
0
    if (routing_indicator) {
1923
0
    if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) {
1924
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [routing_indicator]");
1925
0
        goto end;
1926
0
    }
1927
0
    }
1928
1929
0
    h_nw_pub_key_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "hNwPubKeyId");
1930
0
    if (h_nw_pub_key_id) {
1931
0
    if (!cJSON_IsNumber(h_nw_pub_key_id)) {
1932
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [h_nw_pub_key_id]");
1933
0
        goto end;
1934
0
    }
1935
0
    }
1936
1937
0
    group_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "groupList");
1938
0
    if (group_list) {
1939
0
        cJSON *group_list_local = NULL;
1940
0
        if (!cJSON_IsArray(group_list)) {
1941
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [group_list]");
1942
0
            goto end;
1943
0
        }
1944
1945
0
        group_listList = OpenAPI_list_create();
1946
1947
0
        cJSON_ArrayForEach(group_list_local, group_list) {
1948
0
            double *localDouble = NULL;
1949
0
            int *localInt = NULL;
1950
0
            if (!cJSON_IsString(group_list_local)) {
1951
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [group_list]");
1952
0
                goto end;
1953
0
            }
1954
0
            OpenAPI_list_add(group_listList, ogs_strdup(group_list_local->valuestring));
1955
0
        }
1956
0
    }
1957
1958
0
    drx_parameter = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "drxParameter");
1959
0
    if (drx_parameter) {
1960
0
    if (!cJSON_IsString(drx_parameter) && !cJSON_IsNull(drx_parameter)) {
1961
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [drx_parameter]");
1962
0
        goto end;
1963
0
    }
1964
0
    }
1965
1966
0
    sub_rfsp = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "subRfsp");
1967
0
    if (sub_rfsp) {
1968
0
    if (!cJSON_IsNumber(sub_rfsp)) {
1969
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [sub_rfsp]");
1970
0
        goto end;
1971
0
    }
1972
0
    }
1973
1974
0
    pcf_rfsp = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfRfsp");
1975
0
    if (pcf_rfsp) {
1976
0
    if (!cJSON_IsNumber(pcf_rfsp)) {
1977
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_rfsp]");
1978
0
        goto end;
1979
0
    }
1980
0
    }
1981
1982
0
    chf_group_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "chfGroupId");
1983
0
    if (chf_group_id) {
1984
0
    if (!cJSON_IsString(chf_group_id) && !cJSON_IsNull(chf_group_id)) {
1985
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [chf_group_id]");
1986
0
        goto end;
1987
0
    }
1988
0
    }
1989
1990
0
    used_rfsp = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "usedRfsp");
1991
0
    if (used_rfsp) {
1992
0
    if (!cJSON_IsNumber(used_rfsp)) {
1993
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [used_rfsp]");
1994
0
        goto end;
1995
0
    }
1996
0
    }
1997
1998
0
    sub_ue_ambr = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "subUeAmbr");
1999
0
    if (sub_ue_ambr) {
2000
0
    sub_ue_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(sub_ue_ambr);
2001
0
    if (!sub_ue_ambr_local_nonprim) {
2002
0
        ogs_error("OpenAPI_ambr_parseFromJSON failed [sub_ue_ambr]");
2003
0
        goto end;
2004
0
    }
2005
0
    }
2006
2007
0
    pcf_ue_ambr = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUeAmbr");
2008
0
    if (pcf_ue_ambr) {
2009
0
    pcf_ue_ambr_local_nonprim = OpenAPI_ambr_parseFromJSON(pcf_ue_ambr);
2010
0
    if (!pcf_ue_ambr_local_nonprim) {
2011
0
        ogs_error("OpenAPI_ambr_parseFromJSON failed [pcf_ue_ambr]");
2012
0
        goto end;
2013
0
    }
2014
0
    }
2015
2016
0
    sub_ue_slice_mbr_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "subUeSliceMbrList");
2017
0
    if (sub_ue_slice_mbr_list) {
2018
0
        cJSON *sub_ue_slice_mbr_list_local_map = NULL;
2019
0
        if (!cJSON_IsObject(sub_ue_slice_mbr_list) && !cJSON_IsNull(sub_ue_slice_mbr_list)) {
2020
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [sub_ue_slice_mbr_list]");
2021
0
            goto end;
2022
0
        }
2023
0
        if (cJSON_IsObject(sub_ue_slice_mbr_list)) {
2024
0
            sub_ue_slice_mbr_listList = OpenAPI_list_create();
2025
0
            OpenAPI_map_t *localMapKeyPair = NULL;
2026
0
            cJSON_ArrayForEach(sub_ue_slice_mbr_list_local_map, sub_ue_slice_mbr_list) {
2027
0
                cJSON *localMapObject = sub_ue_slice_mbr_list_local_map;
2028
0
                if (cJSON_IsObject(localMapObject)) {
2029
0
                    localMapKeyPair = OpenAPI_map_create(
2030
0
                        ogs_strdup(localMapObject->string), OpenAPI_slice_mbr_parseFromJSON(localMapObject));
2031
0
                } else if (cJSON_IsNull(localMapObject)) {
2032
0
                    localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
2033
0
                } else {
2034
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [inner]");
2035
0
                    goto end;
2036
0
                }
2037
0
                if (localMapKeyPair == NULL) {
2038
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [sub_ue_slice_mbr_list]");
2039
0
                    goto end;
2040
0
                }
2041
0
                OpenAPI_list_add(sub_ue_slice_mbr_listList, localMapKeyPair);
2042
0
            }
2043
0
        }
2044
0
    }
2045
2046
0
    smsf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smsfId");
2047
0
    if (smsf_id) {
2048
0
    if (!cJSON_IsString(smsf_id) && !cJSON_IsNull(smsf_id)) {
2049
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [smsf_id]");
2050
0
        goto end;
2051
0
    }
2052
0
    }
2053
2054
0
    seaf_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "seafData");
2055
0
    if (seaf_data) {
2056
0
    seaf_data_local_nonprim = OpenAPI_seaf_data_parseFromJSON(seaf_data);
2057
0
    if (!seaf_data_local_nonprim) {
2058
0
        ogs_error("OpenAPI_seaf_data_parseFromJSON failed [seaf_data]");
2059
0
        goto end;
2060
0
    }
2061
0
    }
2062
2063
0
    _5g_mm_capability = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "5gMmCapability");
2064
0
    if (_5g_mm_capability) {
2065
0
    if (!cJSON_IsString(_5g_mm_capability) && !cJSON_IsNull(_5g_mm_capability)) {
2066
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [_5g_mm_capability]");
2067
0
        goto end;
2068
0
    }
2069
0
    }
2070
2071
0
    pcf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfId");
2072
0
    if (pcf_id) {
2073
0
    if (!cJSON_IsString(pcf_id) && !cJSON_IsNull(pcf_id)) {
2074
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_id]");
2075
0
        goto end;
2076
0
    }
2077
0
    }
2078
2079
0
    pcf_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfSetId");
2080
0
    if (pcf_set_id) {
2081
0
    if (!cJSON_IsString(pcf_set_id) && !cJSON_IsNull(pcf_set_id)) {
2082
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_set_id]");
2083
0
        goto end;
2084
0
    }
2085
0
    }
2086
2087
0
    pcf_amp_service_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfAmpServiceSetId");
2088
0
    if (pcf_amp_service_set_id) {
2089
0
    if (!cJSON_IsString(pcf_amp_service_set_id) && !cJSON_IsNull(pcf_amp_service_set_id)) {
2090
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_amp_service_set_id]");
2091
0
        goto end;
2092
0
    }
2093
0
    }
2094
2095
0
    pcf_uep_service_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUepServiceSetId");
2096
0
    if (pcf_uep_service_set_id) {
2097
0
    if (!cJSON_IsString(pcf_uep_service_set_id) && !cJSON_IsNull(pcf_uep_service_set_id)) {
2098
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_uep_service_set_id]");
2099
0
        goto end;
2100
0
    }
2101
0
    }
2102
2103
0
    pcf_binding = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfBinding");
2104
0
    if (pcf_binding) {
2105
0
    if (!cJSON_IsString(pcf_binding)) {
2106
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_binding]");
2107
0
        goto end;
2108
0
    }
2109
0
    pcf_bindingVariable = OpenAPI_sbi_binding_level_FromString(pcf_binding->valuestring);
2110
0
    }
2111
2112
0
    pcf_am_policy_uri = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfAmPolicyUri");
2113
0
    if (pcf_am_policy_uri) {
2114
0
    if (!cJSON_IsString(pcf_am_policy_uri) && !cJSON_IsNull(pcf_am_policy_uri)) {
2115
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_am_policy_uri]");
2116
0
        goto end;
2117
0
    }
2118
0
    }
2119
2120
0
    am_policy_req_trigger_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "amPolicyReqTriggerList");
2121
0
    if (am_policy_req_trigger_list) {
2122
0
        cJSON *am_policy_req_trigger_list_local = NULL;
2123
0
        if (!cJSON_IsArray(am_policy_req_trigger_list)) {
2124
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [am_policy_req_trigger_list]");
2125
0
            goto end;
2126
0
        }
2127
2128
0
        am_policy_req_trigger_listList = OpenAPI_list_create();
2129
2130
0
        cJSON_ArrayForEach(am_policy_req_trigger_list_local, am_policy_req_trigger_list) {
2131
0
            OpenAPI_policy_req_trigger_e localEnum = OpenAPI_policy_req_trigger_NULL;
2132
0
            if (!cJSON_IsString(am_policy_req_trigger_list_local)) {
2133
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [am_policy_req_trigger_list]");
2134
0
                goto end;
2135
0
            }
2136
0
            localEnum = OpenAPI_policy_req_trigger_FromString(am_policy_req_trigger_list_local->valuestring);
2137
0
            if (!localEnum) {
2138
0
                ogs_info("Enum value \"%s\" for field \"am_policy_req_trigger_list\" is not supported. Ignoring it ...",
2139
0
                         am_policy_req_trigger_list_local->valuestring);
2140
0
            } else {
2141
0
                OpenAPI_list_add(am_policy_req_trigger_listList, (void *)localEnum);
2142
0
            }
2143
0
        }
2144
0
        if (am_policy_req_trigger_listList->count == 0) {
2145
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed: Expected am_policy_req_trigger_listList to not be empty (after ignoring unsupported enum values).");
2146
0
            goto end;
2147
0
        }
2148
0
    }
2149
2150
0
    pcf_ue_policy_uri = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUePolicyUri");
2151
0
    if (pcf_ue_policy_uri) {
2152
0
    if (!cJSON_IsString(pcf_ue_policy_uri) && !cJSON_IsNull(pcf_ue_policy_uri)) {
2153
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_ue_policy_uri]");
2154
0
        goto end;
2155
0
    }
2156
0
    }
2157
2158
0
    ue_policy_req_trigger_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "uePolicyReqTriggerList");
2159
0
    if (ue_policy_req_trigger_list) {
2160
0
        cJSON *ue_policy_req_trigger_list_local = NULL;
2161
0
        if (!cJSON_IsArray(ue_policy_req_trigger_list)) {
2162
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_policy_req_trigger_list]");
2163
0
            goto end;
2164
0
        }
2165
2166
0
        ue_policy_req_trigger_listList = OpenAPI_list_create();
2167
2168
0
        cJSON_ArrayForEach(ue_policy_req_trigger_list_local, ue_policy_req_trigger_list) {
2169
0
            OpenAPI_policy_req_trigger_e localEnum = OpenAPI_policy_req_trigger_NULL;
2170
0
            if (!cJSON_IsString(ue_policy_req_trigger_list_local)) {
2171
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_policy_req_trigger_list]");
2172
0
                goto end;
2173
0
            }
2174
0
            localEnum = OpenAPI_policy_req_trigger_FromString(ue_policy_req_trigger_list_local->valuestring);
2175
0
            if (!localEnum) {
2176
0
                ogs_info("Enum value \"%s\" for field \"ue_policy_req_trigger_list\" is not supported. Ignoring it ...",
2177
0
                         ue_policy_req_trigger_list_local->valuestring);
2178
0
            } else {
2179
0
                OpenAPI_list_add(ue_policy_req_trigger_listList, (void *)localEnum);
2180
0
            }
2181
0
        }
2182
0
        if (ue_policy_req_trigger_listList->count == 0) {
2183
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed: Expected ue_policy_req_trigger_listList to not be empty (after ignoring unsupported enum values).");
2184
0
            goto end;
2185
0
        }
2186
0
    }
2187
2188
0
    hpcf_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "hpcfId");
2189
0
    if (hpcf_id) {
2190
0
    if (!cJSON_IsString(hpcf_id) && !cJSON_IsNull(hpcf_id)) {
2191
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [hpcf_id]");
2192
0
        goto end;
2193
0
    }
2194
0
    }
2195
2196
0
    hpcf_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "hpcfSetId");
2197
0
    if (hpcf_set_id) {
2198
0
    if (!cJSON_IsString(hpcf_set_id) && !cJSON_IsNull(hpcf_set_id)) {
2199
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [hpcf_set_id]");
2200
0
        goto end;
2201
0
    }
2202
0
    }
2203
2204
0
    restricted_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedRatList");
2205
0
    if (restricted_rat_list) {
2206
0
        cJSON *restricted_rat_list_local = NULL;
2207
0
        if (!cJSON_IsArray(restricted_rat_list)) {
2208
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_rat_list]");
2209
0
            goto end;
2210
0
        }
2211
2212
0
        restricted_rat_listList = OpenAPI_list_create();
2213
2214
0
        cJSON_ArrayForEach(restricted_rat_list_local, restricted_rat_list) {
2215
0
            OpenAPI_rat_type_e localEnum = OpenAPI_rat_type_NULL;
2216
0
            if (!cJSON_IsString(restricted_rat_list_local)) {
2217
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_rat_list]");
2218
0
                goto end;
2219
0
            }
2220
0
            localEnum = OpenAPI_rat_type_FromString(restricted_rat_list_local->valuestring);
2221
0
            if (!localEnum) {
2222
0
                ogs_info("Enum value \"%s\" for field \"restricted_rat_list\" is not supported. Ignoring it ...",
2223
0
                         restricted_rat_list_local->valuestring);
2224
0
            } else {
2225
0
                OpenAPI_list_add(restricted_rat_listList, (void *)localEnum);
2226
0
            }
2227
0
        }
2228
0
        if (restricted_rat_listList->count == 0) {
2229
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed: Expected restricted_rat_listList to not be empty (after ignoring unsupported enum values).");
2230
0
            goto end;
2231
0
        }
2232
0
    }
2233
2234
0
    forbidden_area_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "forbiddenAreaList");
2235
0
    if (forbidden_area_list) {
2236
0
        cJSON *forbidden_area_list_local = NULL;
2237
0
        if (!cJSON_IsArray(forbidden_area_list)) {
2238
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [forbidden_area_list]");
2239
0
            goto end;
2240
0
        }
2241
2242
0
        forbidden_area_listList = OpenAPI_list_create();
2243
2244
0
        cJSON_ArrayForEach(forbidden_area_list_local, forbidden_area_list) {
2245
0
            if (!cJSON_IsObject(forbidden_area_list_local)) {
2246
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [forbidden_area_list]");
2247
0
                goto end;
2248
0
            }
2249
0
            OpenAPI_area_t *forbidden_area_listItem = OpenAPI_area_parseFromJSON(forbidden_area_list_local);
2250
0
            if (!forbidden_area_listItem) {
2251
0
                ogs_error("No forbidden_area_listItem");
2252
0
                goto end;
2253
0
            }
2254
0
            OpenAPI_list_add(forbidden_area_listList, forbidden_area_listItem);
2255
0
        }
2256
0
    }
2257
2258
0
    service_area_restriction = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "serviceAreaRestriction");
2259
0
    if (service_area_restriction) {
2260
0
    service_area_restriction_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(service_area_restriction);
2261
0
    if (!service_area_restriction_local_nonprim) {
2262
0
        ogs_error("OpenAPI_service_area_restriction_parseFromJSON failed [service_area_restriction]");
2263
0
        goto end;
2264
0
    }
2265
0
    }
2266
2267
0
    restricted_core_nw_type_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedCoreNwTypeList");
2268
0
    if (restricted_core_nw_type_list) {
2269
0
        cJSON *restricted_core_nw_type_list_local = NULL;
2270
0
        if (!cJSON_IsArray(restricted_core_nw_type_list)) {
2271
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_core_nw_type_list]");
2272
0
            goto end;
2273
0
        }
2274
2275
0
        restricted_core_nw_type_listList = OpenAPI_list_create();
2276
2277
0
        cJSON_ArrayForEach(restricted_core_nw_type_list_local, restricted_core_nw_type_list) {
2278
0
            OpenAPI_core_network_type_e localEnum = OpenAPI_core_network_type_NULL;
2279
0
            if (!cJSON_IsString(restricted_core_nw_type_list_local)) {
2280
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_core_nw_type_list]");
2281
0
                goto end;
2282
0
            }
2283
0
            localEnum = OpenAPI_core_network_type_FromString(restricted_core_nw_type_list_local->valuestring);
2284
0
            if (!localEnum) {
2285
0
                ogs_info("Enum value \"%s\" for field \"restricted_core_nw_type_list\" is not supported. Ignoring it ...",
2286
0
                         restricted_core_nw_type_list_local->valuestring);
2287
0
            } else {
2288
0
                OpenAPI_list_add(restricted_core_nw_type_listList, (void *)localEnum);
2289
0
            }
2290
0
        }
2291
0
        if (restricted_core_nw_type_listList->count == 0) {
2292
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed: Expected restricted_core_nw_type_listList to not be empty (after ignoring unsupported enum values).");
2293
0
            goto end;
2294
0
        }
2295
0
    }
2296
2297
0
    event_subscription_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "eventSubscriptionList");
2298
0
    if (event_subscription_list) {
2299
0
        cJSON *event_subscription_list_local = NULL;
2300
0
        if (!cJSON_IsArray(event_subscription_list)) {
2301
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [event_subscription_list]");
2302
0
            goto end;
2303
0
        }
2304
2305
0
        event_subscription_listList = OpenAPI_list_create();
2306
2307
0
        cJSON_ArrayForEach(event_subscription_list_local, event_subscription_list) {
2308
0
            if (!cJSON_IsObject(event_subscription_list_local)) {
2309
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [event_subscription_list]");
2310
0
                goto end;
2311
0
            }
2312
0
            OpenAPI_ext_amf_event_subscription_t *event_subscription_listItem = OpenAPI_ext_amf_event_subscription_parseFromJSON(event_subscription_list_local);
2313
0
            if (!event_subscription_listItem) {
2314
0
                ogs_error("No event_subscription_listItem");
2315
0
                goto end;
2316
0
            }
2317
0
            OpenAPI_list_add(event_subscription_listList, event_subscription_listItem);
2318
0
        }
2319
0
    }
2320
2321
0
    mm_context_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "mmContextList");
2322
0
    if (mm_context_list) {
2323
0
        cJSON *mm_context_list_local = NULL;
2324
0
        if (!cJSON_IsArray(mm_context_list)) {
2325
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [mm_context_list]");
2326
0
            goto end;
2327
0
        }
2328
2329
0
        mm_context_listList = OpenAPI_list_create();
2330
2331
0
        cJSON_ArrayForEach(mm_context_list_local, mm_context_list) {
2332
0
            if (!cJSON_IsObject(mm_context_list_local)) {
2333
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [mm_context_list]");
2334
0
                goto end;
2335
0
            }
2336
0
            OpenAPI_mm_context_t *mm_context_listItem = OpenAPI_mm_context_parseFromJSON(mm_context_list_local);
2337
0
            if (!mm_context_listItem) {
2338
0
                ogs_error("No mm_context_listItem");
2339
0
                goto end;
2340
0
            }
2341
0
            OpenAPI_list_add(mm_context_listList, mm_context_listItem);
2342
0
        }
2343
0
    }
2344
2345
0
    session_context_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "sessionContextList");
2346
0
    if (session_context_list) {
2347
0
        cJSON *session_context_list_local = NULL;
2348
0
        if (!cJSON_IsArray(session_context_list)) {
2349
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [session_context_list]");
2350
0
            goto end;
2351
0
        }
2352
2353
0
        session_context_listList = OpenAPI_list_create();
2354
2355
0
        cJSON_ArrayForEach(session_context_list_local, session_context_list) {
2356
0
            if (!cJSON_IsObject(session_context_list_local)) {
2357
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [session_context_list]");
2358
0
                goto end;
2359
0
            }
2360
0
            OpenAPI_pdu_session_context_t *session_context_listItem = OpenAPI_pdu_session_context_parseFromJSON(session_context_list_local);
2361
0
            if (!session_context_listItem) {
2362
0
                ogs_error("No session_context_listItem");
2363
0
                goto end;
2364
0
            }
2365
0
            OpenAPI_list_add(session_context_listList, session_context_listItem);
2366
0
        }
2367
0
    }
2368
2369
0
    eps_interworking_info = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "epsInterworkingInfo");
2370
0
    if (eps_interworking_info) {
2371
0
    eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info);
2372
0
    if (!eps_interworking_info_local_nonprim) {
2373
0
        ogs_error("OpenAPI_eps_interworking_info_parseFromJSON failed [eps_interworking_info]");
2374
0
        goto end;
2375
0
    }
2376
0
    }
2377
2378
0
    trace_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "traceData");
2379
0
    if (trace_data) {
2380
0
    if (!cJSON_IsNull(trace_data)) {
2381
0
    trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data);
2382
0
    if (!trace_data_local_nonprim) {
2383
0
        ogs_error("OpenAPI_trace_data_parseFromJSON failed [trace_data]");
2384
0
        goto end;
2385
0
    }
2386
0
    }
2387
0
    }
2388
2389
0
    service_gap_expiry_time = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "serviceGapExpiryTime");
2390
0
    if (service_gap_expiry_time) {
2391
0
    if (!cJSON_IsString(service_gap_expiry_time) && !cJSON_IsNull(service_gap_expiry_time)) {
2392
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [service_gap_expiry_time]");
2393
0
        goto end;
2394
0
    }
2395
0
    }
2396
2397
0
    stn_sr = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "stnSr");
2398
0
    if (stn_sr) {
2399
0
    if (!cJSON_IsString(stn_sr) && !cJSON_IsNull(stn_sr)) {
2400
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [stn_sr]");
2401
0
        goto end;
2402
0
    }
2403
0
    }
2404
2405
0
    c_msisdn = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "cMsisdn");
2406
0
    if (c_msisdn) {
2407
0
    if (!cJSON_IsString(c_msisdn) && !cJSON_IsNull(c_msisdn)) {
2408
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [c_msisdn]");
2409
0
        goto end;
2410
0
    }
2411
0
    }
2412
2413
0
    ms_classmark2 = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "msClassmark2");
2414
0
    if (ms_classmark2) {
2415
0
    if (!cJSON_IsString(ms_classmark2) && !cJSON_IsNull(ms_classmark2)) {
2416
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ms_classmark2]");
2417
0
        goto end;
2418
0
    }
2419
0
    }
2420
2421
0
    supported_codec_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "supportedCodecList");
2422
0
    if (supported_codec_list) {
2423
0
        cJSON *supported_codec_list_local = NULL;
2424
0
        if (!cJSON_IsArray(supported_codec_list)) {
2425
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supported_codec_list]");
2426
0
            goto end;
2427
0
        }
2428
2429
0
        supported_codec_listList = OpenAPI_list_create();
2430
2431
0
        cJSON_ArrayForEach(supported_codec_list_local, supported_codec_list) {
2432
0
            double *localDouble = NULL;
2433
0
            int *localInt = NULL;
2434
0
            if (!cJSON_IsString(supported_codec_list_local)) {
2435
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [supported_codec_list]");
2436
0
                goto end;
2437
0
            }
2438
0
            OpenAPI_list_add(supported_codec_listList, ogs_strdup(supported_codec_list_local->valuestring));
2439
0
        }
2440
0
    }
2441
2442
0
    small_data_rate_status_infos = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smallDataRateStatusInfos");
2443
0
    if (small_data_rate_status_infos) {
2444
0
        cJSON *small_data_rate_status_infos_local = NULL;
2445
0
        if (!cJSON_IsArray(small_data_rate_status_infos)) {
2446
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [small_data_rate_status_infos]");
2447
0
            goto end;
2448
0
        }
2449
2450
0
        small_data_rate_status_infosList = OpenAPI_list_create();
2451
2452
0
        cJSON_ArrayForEach(small_data_rate_status_infos_local, small_data_rate_status_infos) {
2453
0
            if (!cJSON_IsObject(small_data_rate_status_infos_local)) {
2454
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [small_data_rate_status_infos]");
2455
0
                goto end;
2456
0
            }
2457
0
            OpenAPI_small_data_rate_status_info_t *small_data_rate_status_infosItem = OpenAPI_small_data_rate_status_info_parseFromJSON(small_data_rate_status_infos_local);
2458
0
            if (!small_data_rate_status_infosItem) {
2459
0
                ogs_error("No small_data_rate_status_infosItem");
2460
0
                goto end;
2461
0
            }
2462
0
            OpenAPI_list_add(small_data_rate_status_infosList, small_data_rate_status_infosItem);
2463
0
        }
2464
0
    }
2465
2466
0
    restricted_primary_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedPrimaryRatList");
2467
0
    if (restricted_primary_rat_list) {
2468
0
        cJSON *restricted_primary_rat_list_local = NULL;
2469
0
        if (!cJSON_IsArray(restricted_primary_rat_list)) {
2470
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_primary_rat_list]");
2471
0
            goto end;
2472
0
        }
2473
2474
0
        restricted_primary_rat_listList = OpenAPI_list_create();
2475
2476
0
        cJSON_ArrayForEach(restricted_primary_rat_list_local, restricted_primary_rat_list) {
2477
0
            OpenAPI_rat_type_e localEnum = OpenAPI_rat_type_NULL;
2478
0
            if (!cJSON_IsString(restricted_primary_rat_list_local)) {
2479
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_primary_rat_list]");
2480
0
                goto end;
2481
0
            }
2482
0
            localEnum = OpenAPI_rat_type_FromString(restricted_primary_rat_list_local->valuestring);
2483
0
            if (!localEnum) {
2484
0
                ogs_info("Enum value \"%s\" for field \"restricted_primary_rat_list\" is not supported. Ignoring it ...",
2485
0
                         restricted_primary_rat_list_local->valuestring);
2486
0
            } else {
2487
0
                OpenAPI_list_add(restricted_primary_rat_listList, (void *)localEnum);
2488
0
            }
2489
0
        }
2490
0
        if (restricted_primary_rat_listList->count == 0) {
2491
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed: Expected restricted_primary_rat_listList to not be empty (after ignoring unsupported enum values).");
2492
0
            goto end;
2493
0
        }
2494
0
    }
2495
2496
0
    restricted_secondary_rat_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "restrictedSecondaryRatList");
2497
0
    if (restricted_secondary_rat_list) {
2498
0
        cJSON *restricted_secondary_rat_list_local = NULL;
2499
0
        if (!cJSON_IsArray(restricted_secondary_rat_list)) {
2500
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_secondary_rat_list]");
2501
0
            goto end;
2502
0
        }
2503
2504
0
        restricted_secondary_rat_listList = OpenAPI_list_create();
2505
2506
0
        cJSON_ArrayForEach(restricted_secondary_rat_list_local, restricted_secondary_rat_list) {
2507
0
            OpenAPI_rat_type_e localEnum = OpenAPI_rat_type_NULL;
2508
0
            if (!cJSON_IsString(restricted_secondary_rat_list_local)) {
2509
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [restricted_secondary_rat_list]");
2510
0
                goto end;
2511
0
            }
2512
0
            localEnum = OpenAPI_rat_type_FromString(restricted_secondary_rat_list_local->valuestring);
2513
0
            if (!localEnum) {
2514
0
                ogs_info("Enum value \"%s\" for field \"restricted_secondary_rat_list\" is not supported. Ignoring it ...",
2515
0
                         restricted_secondary_rat_list_local->valuestring);
2516
0
            } else {
2517
0
                OpenAPI_list_add(restricted_secondary_rat_listList, (void *)localEnum);
2518
0
            }
2519
0
        }
2520
0
        if (restricted_secondary_rat_listList->count == 0) {
2521
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed: Expected restricted_secondary_rat_listList to not be empty (after ignoring unsupported enum values).");
2522
0
            goto end;
2523
0
        }
2524
0
    }
2525
2526
0
    v2x_context = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "v2xContext");
2527
0
    if (v2x_context) {
2528
0
    v2x_context_local_nonprim = OpenAPI_v2x_context_parseFromJSON(v2x_context);
2529
0
    if (!v2x_context_local_nonprim) {
2530
0
        ogs_error("OpenAPI_v2x_context_parseFromJSON failed [v2x_context]");
2531
0
        goto end;
2532
0
    }
2533
0
    }
2534
2535
0
    lte_cat_m_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "lteCatMInd");
2536
0
    if (lte_cat_m_ind) {
2537
0
    if (!cJSON_IsBool(lte_cat_m_ind)) {
2538
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [lte_cat_m_ind]");
2539
0
        goto end;
2540
0
    }
2541
0
    }
2542
2543
0
    red_cap_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "redCapInd");
2544
0
    if (red_cap_ind) {
2545
0
    if (!cJSON_IsBool(red_cap_ind)) {
2546
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [red_cap_ind]");
2547
0
        goto end;
2548
0
    }
2549
0
    }
2550
2551
0
    e_red_cap_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "eRedCapInd");
2552
0
    if (e_red_cap_ind) {
2553
0
    if (!cJSON_IsBool(e_red_cap_ind)) {
2554
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [e_red_cap_ind]");
2555
0
        goto end;
2556
0
    }
2557
0
    }
2558
2559
0
    mo_exp_data_counter = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "moExpDataCounter");
2560
0
    if (mo_exp_data_counter) {
2561
0
    mo_exp_data_counter_local_nonprim = OpenAPI_mo_exp_data_counter_parseFromJSON(mo_exp_data_counter);
2562
0
    if (!mo_exp_data_counter_local_nonprim) {
2563
0
        ogs_error("OpenAPI_mo_exp_data_counter_parseFromJSON failed [mo_exp_data_counter]");
2564
0
        goto end;
2565
0
    }
2566
0
    }
2567
2568
0
    cag_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "cagData");
2569
0
    if (cag_data) {
2570
0
    cag_data_local_nonprim = OpenAPI_cag_data_parseFromJSON(cag_data);
2571
0
    if (!cag_data_local_nonprim) {
2572
0
        ogs_error("OpenAPI_cag_data_parseFromJSON failed [cag_data]");
2573
0
        goto end;
2574
0
    }
2575
0
    }
2576
2577
0
    management_mdt_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "managementMdtInd");
2578
0
    if (management_mdt_ind) {
2579
0
    if (!cJSON_IsBool(management_mdt_ind)) {
2580
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [management_mdt_ind]");
2581
0
        goto end;
2582
0
    }
2583
0
    }
2584
2585
0
    adjacen_plmn_mngt_mdt_inds = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "adjacenPlmnMngtMdtInds");
2586
0
    if (adjacen_plmn_mngt_mdt_inds) {
2587
0
        cJSON *adjacen_plmn_mngt_mdt_inds_local_map = NULL;
2588
0
        if (!cJSON_IsObject(adjacen_plmn_mngt_mdt_inds) && !cJSON_IsNull(adjacen_plmn_mngt_mdt_inds)) {
2589
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [adjacen_plmn_mngt_mdt_inds]");
2590
0
            goto end;
2591
0
        }
2592
0
        if (cJSON_IsObject(adjacen_plmn_mngt_mdt_inds)) {
2593
0
            adjacen_plmn_mngt_mdt_indsList = OpenAPI_list_create();
2594
0
            OpenAPI_map_t *localMapKeyPair = NULL;
2595
0
            cJSON_ArrayForEach(adjacen_plmn_mngt_mdt_inds_local_map, adjacen_plmn_mngt_mdt_inds) {
2596
0
                cJSON *localMapObject = adjacen_plmn_mngt_mdt_inds_local_map;
2597
0
                double *localDouble = NULL;
2598
0
                int *localInt = NULL;
2599
0
                if (!cJSON_IsBool(localMapObject)) {
2600
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [inner]");
2601
0
                    goto end;
2602
0
                }
2603
0
                localInt = (int *)ogs_calloc(1, sizeof(int));
2604
0
                if (!localInt) {
2605
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [inner]");
2606
0
                    goto end;
2607
0
                }
2608
0
                *localInt = localMapObject->valueint;
2609
0
                localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), localInt);
2610
0
                if (localMapKeyPair == NULL) {
2611
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [adjacen_plmn_mngt_mdt_inds]");
2612
0
                    goto end;
2613
0
                }
2614
0
                OpenAPI_list_add(adjacen_plmn_mngt_mdt_indsList, localMapKeyPair);
2615
0
            }
2616
0
        }
2617
0
    }
2618
2619
0
    immediate_mdt_conf = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "immediateMdtConf");
2620
0
    if (immediate_mdt_conf) {
2621
0
    immediate_mdt_conf_local_nonprim = OpenAPI_immediate_mdt_conf_parseFromJSON(immediate_mdt_conf);
2622
0
    if (!immediate_mdt_conf_local_nonprim) {
2623
0
        ogs_error("OpenAPI_immediate_mdt_conf_parseFromJSON failed [immediate_mdt_conf]");
2624
0
        goto end;
2625
0
    }
2626
0
    }
2627
2628
0
    ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ecRestrictionDataWb");
2629
0
    if (ec_restriction_data_wb) {
2630
0
    ec_restriction_data_wb_local_nonprim = OpenAPI_ec_restriction_data_wb_parseFromJSON(ec_restriction_data_wb);
2631
0
    if (!ec_restriction_data_wb_local_nonprim) {
2632
0
        ogs_error("OpenAPI_ec_restriction_data_wb_parseFromJSON failed [ec_restriction_data_wb]");
2633
0
        goto end;
2634
0
    }
2635
0
    }
2636
2637
0
    ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "ecRestrictionDataNb");
2638
0
    if (ec_restriction_data_nb) {
2639
0
    if (!cJSON_IsBool(ec_restriction_data_nb)) {
2640
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ec_restriction_data_nb]");
2641
0
        goto end;
2642
0
    }
2643
0
    }
2644
2645
0
    iab_operation_allowed = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "iabOperationAllowed");
2646
0
    if (iab_operation_allowed) {
2647
0
    if (!cJSON_IsBool(iab_operation_allowed)) {
2648
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [iab_operation_allowed]");
2649
0
        goto end;
2650
0
    }
2651
0
    }
2652
2653
0
    prose_context = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "proseContext");
2654
0
    if (prose_context) {
2655
0
    prose_context_local_nonprim = OpenAPI_prose_context_parseFromJSON(prose_context);
2656
0
    if (!prose_context_local_nonprim) {
2657
0
        ogs_error("OpenAPI_prose_context_parseFromJSON failed [prose_context]");
2658
0
        goto end;
2659
0
    }
2660
0
    }
2661
2662
0
    analytics_subscription_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "analyticsSubscriptionList");
2663
0
    if (analytics_subscription_list) {
2664
0
        cJSON *analytics_subscription_list_local = NULL;
2665
0
        if (!cJSON_IsArray(analytics_subscription_list)) {
2666
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [analytics_subscription_list]");
2667
0
            goto end;
2668
0
        }
2669
2670
0
        analytics_subscription_listList = OpenAPI_list_create();
2671
2672
0
        cJSON_ArrayForEach(analytics_subscription_list_local, analytics_subscription_list) {
2673
0
            if (!cJSON_IsObject(analytics_subscription_list_local)) {
2674
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [analytics_subscription_list]");
2675
0
                goto end;
2676
0
            }
2677
0
            OpenAPI_analytics_subscription_t *analytics_subscription_listItem = OpenAPI_analytics_subscription_parseFromJSON(analytics_subscription_list_local);
2678
0
            if (!analytics_subscription_listItem) {
2679
0
                ogs_error("No analytics_subscription_listItem");
2680
0
                goto end;
2681
0
            }
2682
0
            OpenAPI_list_add(analytics_subscription_listList, analytics_subscription_listItem);
2683
0
        }
2684
0
    }
2685
2686
0
    pcf_amp_binding_info = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfAmpBindingInfo");
2687
0
    if (pcf_amp_binding_info) {
2688
0
    if (!cJSON_IsString(pcf_amp_binding_info) && !cJSON_IsNull(pcf_amp_binding_info)) {
2689
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_amp_binding_info]");
2690
0
        goto end;
2691
0
    }
2692
0
    }
2693
2694
0
    pcf_uep_binding_info = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUepBindingInfo");
2695
0
    if (pcf_uep_binding_info) {
2696
0
    if (!cJSON_IsString(pcf_uep_binding_info) && !cJSON_IsNull(pcf_uep_binding_info)) {
2697
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_uep_binding_info]");
2698
0
        goto end;
2699
0
    }
2700
0
    }
2701
2702
0
    used_service_area_restriction = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "usedServiceAreaRestriction");
2703
0
    if (used_service_area_restriction) {
2704
0
    used_service_area_restriction_local_nonprim = OpenAPI_service_area_restriction_parseFromJSON(used_service_area_restriction);
2705
0
    if (!used_service_area_restriction_local_nonprim) {
2706
0
        ogs_error("OpenAPI_service_area_restriction_parseFromJSON failed [used_service_area_restriction]");
2707
0
        goto end;
2708
0
    }
2709
0
    }
2710
2711
0
    pra_in_am_policy = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "praInAmPolicy");
2712
0
    if (pra_in_am_policy) {
2713
0
        cJSON *pra_in_am_policy_local_map = NULL;
2714
0
        if (!cJSON_IsObject(pra_in_am_policy) && !cJSON_IsNull(pra_in_am_policy)) {
2715
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pra_in_am_policy]");
2716
0
            goto end;
2717
0
        }
2718
0
        if (cJSON_IsObject(pra_in_am_policy)) {
2719
0
            pra_in_am_policyList = OpenAPI_list_create();
2720
0
            OpenAPI_map_t *localMapKeyPair = NULL;
2721
0
            cJSON_ArrayForEach(pra_in_am_policy_local_map, pra_in_am_policy) {
2722
0
                cJSON *localMapObject = pra_in_am_policy_local_map;
2723
0
                if (cJSON_IsObject(localMapObject)) {
2724
0
                    localMapKeyPair = OpenAPI_map_create(
2725
0
                        ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject));
2726
0
                } else if (cJSON_IsNull(localMapObject)) {
2727
0
                    localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
2728
0
                } else {
2729
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [inner]");
2730
0
                    goto end;
2731
0
                }
2732
0
                if (localMapKeyPair == NULL) {
2733
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pra_in_am_policy]");
2734
0
                    goto end;
2735
0
                }
2736
0
                OpenAPI_list_add(pra_in_am_policyList, localMapKeyPair);
2737
0
            }
2738
0
        }
2739
0
    }
2740
2741
0
    pra_in_ue_policy = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "praInUePolicy");
2742
0
    if (pra_in_ue_policy) {
2743
0
        cJSON *pra_in_ue_policy_local_map = NULL;
2744
0
        if (!cJSON_IsObject(pra_in_ue_policy) && !cJSON_IsNull(pra_in_ue_policy)) {
2745
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pra_in_ue_policy]");
2746
0
            goto end;
2747
0
        }
2748
0
        if (cJSON_IsObject(pra_in_ue_policy)) {
2749
0
            pra_in_ue_policyList = OpenAPI_list_create();
2750
0
            OpenAPI_map_t *localMapKeyPair = NULL;
2751
0
            cJSON_ArrayForEach(pra_in_ue_policy_local_map, pra_in_ue_policy) {
2752
0
                cJSON *localMapObject = pra_in_ue_policy_local_map;
2753
0
                if (cJSON_IsObject(localMapObject)) {
2754
0
                    localMapKeyPair = OpenAPI_map_create(
2755
0
                        ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject));
2756
0
                } else if (cJSON_IsNull(localMapObject)) {
2757
0
                    localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
2758
0
                } else {
2759
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [inner]");
2760
0
                    goto end;
2761
0
                }
2762
0
                if (localMapKeyPair == NULL) {
2763
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pra_in_ue_policy]");
2764
0
                    goto end;
2765
0
                }
2766
0
                OpenAPI_list_add(pra_in_ue_policyList, localMapKeyPair);
2767
0
            }
2768
0
        }
2769
0
    }
2770
2771
0
    updp_subscription_data = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "updpSubscriptionData");
2772
0
    if (updp_subscription_data) {
2773
0
    updp_subscription_data_local_nonprim = OpenAPI_updp_subscription_data_parseFromJSON(updp_subscription_data);
2774
0
    if (!updp_subscription_data_local_nonprim) {
2775
0
        ogs_error("OpenAPI_updp_subscription_data_parseFromJSON failed [updp_subscription_data]");
2776
0
        goto end;
2777
0
    }
2778
0
    }
2779
2780
0
    sm_policy_notify_pdu_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smPolicyNotifyPduList");
2781
0
    if (sm_policy_notify_pdu_list) {
2782
0
        cJSON *sm_policy_notify_pdu_list_local = NULL;
2783
0
        if (!cJSON_IsArray(sm_policy_notify_pdu_list)) {
2784
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [sm_policy_notify_pdu_list]");
2785
0
            goto end;
2786
0
        }
2787
2788
0
        sm_policy_notify_pdu_listList = OpenAPI_list_create();
2789
2790
0
        cJSON_ArrayForEach(sm_policy_notify_pdu_list_local, sm_policy_notify_pdu_list) {
2791
0
            if (!cJSON_IsObject(sm_policy_notify_pdu_list_local)) {
2792
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [sm_policy_notify_pdu_list]");
2793
0
                goto end;
2794
0
            }
2795
0
            OpenAPI_pdu_session_info_t *sm_policy_notify_pdu_listItem = OpenAPI_pdu_session_info_parseFromJSON(sm_policy_notify_pdu_list_local);
2796
0
            if (!sm_policy_notify_pdu_listItem) {
2797
0
                ogs_error("No sm_policy_notify_pdu_listItem");
2798
0
                goto end;
2799
0
            }
2800
0
            OpenAPI_list_add(sm_policy_notify_pdu_listList, sm_policy_notify_pdu_listItem);
2801
0
        }
2802
0
    }
2803
2804
0
    pcf_ue_callback_info = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUeCallbackInfo");
2805
0
    if (pcf_ue_callback_info) {
2806
0
    if (!cJSON_IsNull(pcf_ue_callback_info)) {
2807
0
    pcf_ue_callback_info_local_nonprim = OpenAPI_pcf_ue_callback_info_parseFromJSON(pcf_ue_callback_info);
2808
0
    if (!pcf_ue_callback_info_local_nonprim) {
2809
0
        ogs_error("OpenAPI_pcf_ue_callback_info_parseFromJSON failed [pcf_ue_callback_info]");
2810
0
        goto end;
2811
0
    }
2812
0
    }
2813
0
    }
2814
2815
0
    ue_positioning_cap = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "uePositioningCap");
2816
0
    if (ue_positioning_cap) {
2817
0
    if (!cJSON_IsString(ue_positioning_cap) && !cJSON_IsNull(ue_positioning_cap)) {
2818
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_positioning_cap]");
2819
0
        goto end;
2820
0
    }
2821
0
    }
2822
2823
0
    asti_distribution_indication = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "astiDistributionIndication");
2824
0
    if (asti_distribution_indication) {
2825
0
    if (!cJSON_IsBool(asti_distribution_indication)) {
2826
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [asti_distribution_indication]");
2827
0
        goto end;
2828
0
    }
2829
0
    }
2830
2831
0
    ts_error_budget = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "tsErrorBudget");
2832
0
    if (ts_error_budget) {
2833
0
    if (!cJSON_IsNumber(ts_error_budget)) {
2834
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ts_error_budget]");
2835
0
        goto end;
2836
0
    }
2837
0
    }
2838
2839
0
    snpn_onboard_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "snpnOnboardInd");
2840
0
    if (snpn_onboard_ind) {
2841
0
    if (!cJSON_IsBool(snpn_onboard_ind)) {
2842
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [snpn_onboard_ind]");
2843
0
        goto end;
2844
0
    }
2845
0
    }
2846
2847
0
    smf_sel_info = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smfSelInfo");
2848
0
    if (smf_sel_info) {
2849
0
    if (!cJSON_IsNull(smf_sel_info)) {
2850
0
    smf_sel_info_local_nonprim = OpenAPI_smf_selection_data_parseFromJSON(smf_sel_info);
2851
0
    if (!smf_sel_info_local_nonprim) {
2852
0
        ogs_error("OpenAPI_smf_selection_data_parseFromJSON failed [smf_sel_info]");
2853
0
        goto end;
2854
0
    }
2855
0
    }
2856
0
    }
2857
2858
0
    pcf_ue_slice_mbr_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "pcfUeSliceMbrList");
2859
0
    if (pcf_ue_slice_mbr_list) {
2860
0
        cJSON *pcf_ue_slice_mbr_list_local_map = NULL;
2861
0
        if (!cJSON_IsObject(pcf_ue_slice_mbr_list) && !cJSON_IsNull(pcf_ue_slice_mbr_list)) {
2862
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_ue_slice_mbr_list]");
2863
0
            goto end;
2864
0
        }
2865
0
        if (cJSON_IsObject(pcf_ue_slice_mbr_list)) {
2866
0
            pcf_ue_slice_mbr_listList = OpenAPI_list_create();
2867
0
            OpenAPI_map_t *localMapKeyPair = NULL;
2868
0
            cJSON_ArrayForEach(pcf_ue_slice_mbr_list_local_map, pcf_ue_slice_mbr_list) {
2869
0
                cJSON *localMapObject = pcf_ue_slice_mbr_list_local_map;
2870
0
                if (cJSON_IsObject(localMapObject)) {
2871
0
                    localMapKeyPair = OpenAPI_map_create(
2872
0
                        ogs_strdup(localMapObject->string), OpenAPI_slice_mbr_parseFromJSON(localMapObject));
2873
0
                } else if (cJSON_IsNull(localMapObject)) {
2874
0
                    localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
2875
0
                } else {
2876
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [inner]");
2877
0
                    goto end;
2878
0
                }
2879
0
                if (localMapKeyPair == NULL) {
2880
0
                    ogs_error("OpenAPI_ue_context_parseFromJSON() failed [pcf_ue_slice_mbr_list]");
2881
0
                    goto end;
2882
0
                }
2883
0
                OpenAPI_list_add(pcf_ue_slice_mbr_listList, localMapKeyPair);
2884
0
            }
2885
0
        }
2886
0
    }
2887
2888
0
    smsf_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smsfSetId");
2889
0
    if (smsf_set_id) {
2890
0
    if (!cJSON_IsString(smsf_set_id) && !cJSON_IsNull(smsf_set_id)) {
2891
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [smsf_set_id]");
2892
0
        goto end;
2893
0
    }
2894
0
    }
2895
2896
0
    smsf_service_set_id = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smsfServiceSetId");
2897
0
    if (smsf_service_set_id) {
2898
0
    if (!cJSON_IsString(smsf_service_set_id) && !cJSON_IsNull(smsf_service_set_id)) {
2899
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [smsf_service_set_id]");
2900
0
        goto end;
2901
0
    }
2902
0
    }
2903
2904
0
    smsf_binding_info = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "smsfBindingInfo");
2905
0
    if (smsf_binding_info) {
2906
0
    if (!cJSON_IsString(smsf_binding_info) && !cJSON_IsNull(smsf_binding_info)) {
2907
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [smsf_binding_info]");
2908
0
        goto end;
2909
0
    }
2910
0
    }
2911
2912
0
    disaster_roaming_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "disasterRoamingInd");
2913
0
    if (disaster_roaming_ind) {
2914
0
    if (!cJSON_IsBool(disaster_roaming_ind)) {
2915
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [disaster_roaming_ind]");
2916
0
        goto end;
2917
0
    }
2918
0
    }
2919
2920
0
    disaster_plmn = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "disasterPlmn");
2921
0
    if (disaster_plmn) {
2922
0
    disaster_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(disaster_plmn);
2923
0
    if (!disaster_plmn_local_nonprim) {
2924
0
        ogs_error("OpenAPI_plmn_id_parseFromJSON failed [disaster_plmn]");
2925
0
        goto end;
2926
0
    }
2927
0
    }
2928
2929
0
    satellite_backhaul_cat = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "satelliteBackhaulCat");
2930
0
    if (satellite_backhaul_cat) {
2931
0
    if (!cJSON_IsString(satellite_backhaul_cat)) {
2932
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [satellite_backhaul_cat]");
2933
0
        goto end;
2934
0
    }
2935
0
    satellite_backhaul_catVariable = OpenAPI_satellite_backhaul_category_FromString(satellite_backhaul_cat->valuestring);
2936
0
    }
2937
2938
0
    wl_serv_area_res = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "wlServAreaRes");
2939
0
    if (wl_serv_area_res) {
2940
0
    wl_serv_area_res_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wl_serv_area_res);
2941
0
    if (!wl_serv_area_res_local_nonprim) {
2942
0
        ogs_error("OpenAPI_wireline_service_area_restriction_parseFromJSON failed [wl_serv_area_res]");
2943
0
        goto end;
2944
0
    }
2945
0
    }
2946
2947
0
    as_time_dis_param = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "asTimeDisParam");
2948
0
    if (as_time_dis_param) {
2949
0
    if (!cJSON_IsNull(as_time_dis_param)) {
2950
0
    as_time_dis_param_local_nonprim = OpenAPI_as_time_distribution_param_parseFromJSON(as_time_dis_param);
2951
0
    if (!as_time_dis_param_local_nonprim) {
2952
0
        ogs_error("OpenAPI_as_time_distribution_param_parseFromJSON failed [as_time_dis_param]");
2953
0
        goto end;
2954
0
    }
2955
0
    }
2956
0
    }
2957
2958
0
    am_policy_info_container = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "amPolicyInfoContainer");
2959
0
    if (am_policy_info_container) {
2960
0
    am_policy_info_container_local_nonprim = OpenAPI_am_policy_info_container_parseFromJSON(am_policy_info_container);
2961
0
    if (!am_policy_info_container_local_nonprim) {
2962
0
        ogs_error("OpenAPI_am_policy_info_container_parseFromJSON failed [am_policy_info_container]");
2963
0
        goto end;
2964
0
    }
2965
0
    }
2966
2967
0
    a2x_context = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "a2xContext");
2968
0
    if (a2x_context) {
2969
0
    a2x_context_local_nonprim = OpenAPI_a2x_context_parseFromJSON(a2x_context);
2970
0
    if (!a2x_context_local_nonprim) {
2971
0
        ogs_error("OpenAPI_a2x_context_parseFromJSON failed [a2x_context]");
2972
0
        goto end;
2973
0
    }
2974
0
    }
2975
2976
0
    mbsr_operation_allowed = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "mbsrOperationAllowed");
2977
0
    if (mbsr_operation_allowed) {
2978
0
    mbsr_operation_allowed_local_nonprim = OpenAPI_mbsr_operation_allowed_parseFromJSON(mbsr_operation_allowed);
2979
0
    if (!mbsr_operation_allowed_local_nonprim) {
2980
0
        ogs_error("OpenAPI_mbsr_operation_allowed_parseFromJSON failed [mbsr_operation_allowed]");
2981
0
        goto end;
2982
0
    }
2983
0
    }
2984
2985
0
    lcs_up_context = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "lcsUpContext");
2986
0
    if (lcs_up_context) {
2987
0
    lcs_up_context_local_nonprim = OpenAPI_lcs_up_context_parseFromJSON(lcs_up_context);
2988
0
    if (!lcs_up_context_local_nonprim) {
2989
0
        ogs_error("OpenAPI_lcs_up_context_parseFromJSON failed [lcs_up_context]");
2990
0
        goto end;
2991
0
    }
2992
0
    }
2993
2994
0
    lcs_up_context_list = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "lcsUpContextList");
2995
0
    if (lcs_up_context_list) {
2996
0
        cJSON *lcs_up_context_list_local = NULL;
2997
0
        if (!cJSON_IsArray(lcs_up_context_list)) {
2998
0
            ogs_error("OpenAPI_ue_context_parseFromJSON() failed [lcs_up_context_list]");
2999
0
            goto end;
3000
0
        }
3001
3002
0
        lcs_up_context_listList = OpenAPI_list_create();
3003
3004
0
        cJSON_ArrayForEach(lcs_up_context_list_local, lcs_up_context_list) {
3005
0
            if (!cJSON_IsObject(lcs_up_context_list_local)) {
3006
0
                ogs_error("OpenAPI_ue_context_parseFromJSON() failed [lcs_up_context_list]");
3007
0
                goto end;
3008
0
            }
3009
0
            OpenAPI_lcs_up_context_t *lcs_up_context_listItem = OpenAPI_lcs_up_context_parseFromJSON(lcs_up_context_list_local);
3010
0
            if (!lcs_up_context_listItem) {
3011
0
                ogs_error("No lcs_up_context_listItem");
3012
0
                goto end;
3013
0
            }
3014
0
            OpenAPI_list_add(lcs_up_context_listList, lcs_up_context_listItem);
3015
0
        }
3016
0
    }
3017
3018
0
    reconnect_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "reconnectInd");
3019
0
    if (reconnect_ind) {
3020
0
    if (!cJSON_IsBool(reconnect_ind)) {
3021
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [reconnect_ind]");
3022
0
        goto end;
3023
0
    }
3024
0
    }
3025
3026
0
    ue_policy_container = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "uePolicyContainer");
3027
0
    if (ue_policy_container) {
3028
0
    if (!cJSON_IsString(ue_policy_container) && !cJSON_IsNull(ue_policy_container)) {
3029
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_policy_container]");
3030
0
        goto end;
3031
0
    }
3032
0
    }
3033
3034
0
    am_policy_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "amPolicyInd");
3035
0
    if (am_policy_ind) {
3036
0
    if (!cJSON_IsBool(am_policy_ind)) {
3037
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [am_policy_ind]");
3038
0
        goto end;
3039
0
    }
3040
0
    }
3041
3042
0
    ue_policy_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "uePolicyInd");
3043
0
    if (ue_policy_ind) {
3044
0
    if (!cJSON_IsBool(ue_policy_ind)) {
3045
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [ue_policy_ind]");
3046
0
        goto end;
3047
0
    }
3048
0
    }
3049
3050
0
    energy_saving_ind = cJSON_GetObjectItemCaseSensitive(ue_contextJSON, "energySavingInd");
3051
0
    if (energy_saving_ind) {
3052
0
    if (!cJSON_IsNumber(energy_saving_ind)) {
3053
0
        ogs_error("OpenAPI_ue_context_parseFromJSON() failed [energy_saving_ind]");
3054
0
        goto end;
3055
0
    }
3056
0
    }
3057
3058
0
    ue_context_local_var = OpenAPI_ue_context_create (
3059
0
        supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL,
3060
0
        supi_unauth_ind ? true : false,
3061
0
        supi_unauth_ind ? supi_unauth_ind->valueint : 0,
3062
0
        gpsi_list ? gpsi_listList : NULL,
3063
0
        pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
3064
0
        udm_group_id && !cJSON_IsNull(udm_group_id) ? ogs_strdup(udm_group_id->valuestring) : NULL,
3065
0
        ausf_group_id && !cJSON_IsNull(ausf_group_id) ? ogs_strdup(ausf_group_id->valuestring) : NULL,
3066
0
        pcf_group_id && !cJSON_IsNull(pcf_group_id) ? ogs_strdup(pcf_group_id->valuestring) : NULL,
3067
0
        routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL,
3068
0
        h_nw_pub_key_id ? true : false,
3069
0
        h_nw_pub_key_id ? h_nw_pub_key_id->valuedouble : 0,
3070
0
        group_list ? group_listList : NULL,
3071
0
        drx_parameter && !cJSON_IsNull(drx_parameter) ? ogs_strdup(drx_parameter->valuestring) : NULL,
3072
0
        sub_rfsp ? true : false,
3073
0
        sub_rfsp ? sub_rfsp->valuedouble : 0,
3074
0
        pcf_rfsp ? true : false,
3075
0
        pcf_rfsp ? pcf_rfsp->valuedouble : 0,
3076
0
        chf_group_id && !cJSON_IsNull(chf_group_id) ? ogs_strdup(chf_group_id->valuestring) : NULL,
3077
0
        used_rfsp ? true : false,
3078
0
        used_rfsp ? used_rfsp->valuedouble : 0,
3079
0
        sub_ue_ambr ? sub_ue_ambr_local_nonprim : NULL,
3080
0
        pcf_ue_ambr ? pcf_ue_ambr_local_nonprim : NULL,
3081
0
        sub_ue_slice_mbr_list ? sub_ue_slice_mbr_listList : NULL,
3082
0
        smsf_id && !cJSON_IsNull(smsf_id) ? ogs_strdup(smsf_id->valuestring) : NULL,
3083
0
        seaf_data ? seaf_data_local_nonprim : NULL,
3084
0
        _5g_mm_capability && !cJSON_IsNull(_5g_mm_capability) ? ogs_strdup(_5g_mm_capability->valuestring) : NULL,
3085
0
        pcf_id && !cJSON_IsNull(pcf_id) ? ogs_strdup(pcf_id->valuestring) : NULL,
3086
0
        pcf_set_id && !cJSON_IsNull(pcf_set_id) ? ogs_strdup(pcf_set_id->valuestring) : NULL,
3087
0
        pcf_amp_service_set_id && !cJSON_IsNull(pcf_amp_service_set_id) ? ogs_strdup(pcf_amp_service_set_id->valuestring) : NULL,
3088
0
        pcf_uep_service_set_id && !cJSON_IsNull(pcf_uep_service_set_id) ? ogs_strdup(pcf_uep_service_set_id->valuestring) : NULL,
3089
0
        pcf_binding ? pcf_bindingVariable : 0,
3090
0
        pcf_am_policy_uri && !cJSON_IsNull(pcf_am_policy_uri) ? ogs_strdup(pcf_am_policy_uri->valuestring) : NULL,
3091
0
        am_policy_req_trigger_list ? am_policy_req_trigger_listList : NULL,
3092
0
        pcf_ue_policy_uri && !cJSON_IsNull(pcf_ue_policy_uri) ? ogs_strdup(pcf_ue_policy_uri->valuestring) : NULL,
3093
0
        ue_policy_req_trigger_list ? ue_policy_req_trigger_listList : NULL,
3094
0
        hpcf_id && !cJSON_IsNull(hpcf_id) ? ogs_strdup(hpcf_id->valuestring) : NULL,
3095
0
        hpcf_set_id && !cJSON_IsNull(hpcf_set_id) ? ogs_strdup(hpcf_set_id->valuestring) : NULL,
3096
0
        restricted_rat_list ? restricted_rat_listList : NULL,
3097
0
        forbidden_area_list ? forbidden_area_listList : NULL,
3098
0
        service_area_restriction ? service_area_restriction_local_nonprim : NULL,
3099
0
        restricted_core_nw_type_list ? restricted_core_nw_type_listList : NULL,
3100
0
        event_subscription_list ? event_subscription_listList : NULL,
3101
0
        mm_context_list ? mm_context_listList : NULL,
3102
0
        session_context_list ? session_context_listList : NULL,
3103
0
        eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
3104
0
        trace_data && cJSON_IsNull(trace_data) ? true : false,
3105
0
        trace_data ? trace_data_local_nonprim : NULL,
3106
0
        service_gap_expiry_time && !cJSON_IsNull(service_gap_expiry_time) ? ogs_strdup(service_gap_expiry_time->valuestring) : NULL,
3107
0
        stn_sr && !cJSON_IsNull(stn_sr) ? ogs_strdup(stn_sr->valuestring) : NULL,
3108
0
        c_msisdn && !cJSON_IsNull(c_msisdn) ? ogs_strdup(c_msisdn->valuestring) : NULL,
3109
0
        ms_classmark2 && !cJSON_IsNull(ms_classmark2) ? ogs_strdup(ms_classmark2->valuestring) : NULL,
3110
0
        supported_codec_list ? supported_codec_listList : NULL,
3111
0
        small_data_rate_status_infos ? small_data_rate_status_infosList : NULL,
3112
0
        restricted_primary_rat_list ? restricted_primary_rat_listList : NULL,
3113
0
        restricted_secondary_rat_list ? restricted_secondary_rat_listList : NULL,
3114
0
        v2x_context ? v2x_context_local_nonprim : NULL,
3115
0
        lte_cat_m_ind ? true : false,
3116
0
        lte_cat_m_ind ? lte_cat_m_ind->valueint : 0,
3117
0
        red_cap_ind ? true : false,
3118
0
        red_cap_ind ? red_cap_ind->valueint : 0,
3119
0
        e_red_cap_ind ? true : false,
3120
0
        e_red_cap_ind ? e_red_cap_ind->valueint : 0,
3121
0
        mo_exp_data_counter ? mo_exp_data_counter_local_nonprim : NULL,
3122
0
        cag_data ? cag_data_local_nonprim : NULL,
3123
0
        management_mdt_ind ? true : false,
3124
0
        management_mdt_ind ? management_mdt_ind->valueint : 0,
3125
0
        adjacen_plmn_mngt_mdt_inds ? adjacen_plmn_mngt_mdt_indsList : NULL,
3126
0
        immediate_mdt_conf ? immediate_mdt_conf_local_nonprim : NULL,
3127
0
        ec_restriction_data_wb ? ec_restriction_data_wb_local_nonprim : NULL,
3128
0
        ec_restriction_data_nb ? true : false,
3129
0
        ec_restriction_data_nb ? ec_restriction_data_nb->valueint : 0,
3130
0
        iab_operation_allowed ? true : false,
3131
0
        iab_operation_allowed ? iab_operation_allowed->valueint : 0,
3132
0
        prose_context ? prose_context_local_nonprim : NULL,
3133
0
        analytics_subscription_list ? analytics_subscription_listList : NULL,
3134
0
        pcf_amp_binding_info && !cJSON_IsNull(pcf_amp_binding_info) ? ogs_strdup(pcf_amp_binding_info->valuestring) : NULL,
3135
0
        pcf_uep_binding_info && !cJSON_IsNull(pcf_uep_binding_info) ? ogs_strdup(pcf_uep_binding_info->valuestring) : NULL,
3136
0
        used_service_area_restriction ? used_service_area_restriction_local_nonprim : NULL,
3137
0
        pra_in_am_policy ? pra_in_am_policyList : NULL,
3138
0
        pra_in_ue_policy ? pra_in_ue_policyList : NULL,
3139
0
        updp_subscription_data ? updp_subscription_data_local_nonprim : NULL,
3140
0
        sm_policy_notify_pdu_list ? sm_policy_notify_pdu_listList : NULL,
3141
0
        pcf_ue_callback_info && cJSON_IsNull(pcf_ue_callback_info) ? true : false,
3142
0
        pcf_ue_callback_info ? pcf_ue_callback_info_local_nonprim : NULL,
3143
0
        ue_positioning_cap && !cJSON_IsNull(ue_positioning_cap) ? ogs_strdup(ue_positioning_cap->valuestring) : NULL,
3144
0
        asti_distribution_indication ? true : false,
3145
0
        asti_distribution_indication ? asti_distribution_indication->valueint : 0,
3146
0
        ts_error_budget ? true : false,
3147
0
        ts_error_budget ? ts_error_budget->valuedouble : 0,
3148
0
        snpn_onboard_ind ? true : false,
3149
0
        snpn_onboard_ind ? snpn_onboard_ind->valueint : 0,
3150
0
        smf_sel_info && cJSON_IsNull(smf_sel_info) ? true : false,
3151
0
        smf_sel_info ? smf_sel_info_local_nonprim : NULL,
3152
0
        pcf_ue_slice_mbr_list ? pcf_ue_slice_mbr_listList : NULL,
3153
0
        smsf_set_id && !cJSON_IsNull(smsf_set_id) ? ogs_strdup(smsf_set_id->valuestring) : NULL,
3154
0
        smsf_service_set_id && !cJSON_IsNull(smsf_service_set_id) ? ogs_strdup(smsf_service_set_id->valuestring) : NULL,
3155
0
        smsf_binding_info && !cJSON_IsNull(smsf_binding_info) ? ogs_strdup(smsf_binding_info->valuestring) : NULL,
3156
0
        disaster_roaming_ind ? true : false,
3157
0
        disaster_roaming_ind ? disaster_roaming_ind->valueint : 0,
3158
0
        disaster_plmn ? disaster_plmn_local_nonprim : NULL,
3159
0
        satellite_backhaul_cat ? satellite_backhaul_catVariable : 0,
3160
0
        wl_serv_area_res ? wl_serv_area_res_local_nonprim : NULL,
3161
0
        as_time_dis_param && cJSON_IsNull(as_time_dis_param) ? true : false,
3162
0
        as_time_dis_param ? as_time_dis_param_local_nonprim : NULL,
3163
0
        am_policy_info_container ? am_policy_info_container_local_nonprim : NULL,
3164
0
        a2x_context ? a2x_context_local_nonprim : NULL,
3165
0
        mbsr_operation_allowed ? mbsr_operation_allowed_local_nonprim : NULL,
3166
0
        lcs_up_context ? lcs_up_context_local_nonprim : NULL,
3167
0
        lcs_up_context_list ? lcs_up_context_listList : NULL,
3168
0
        reconnect_ind ? true : false,
3169
0
        reconnect_ind ? reconnect_ind->valueint : 0,
3170
0
        ue_policy_container && !cJSON_IsNull(ue_policy_container) ? ogs_strdup(ue_policy_container->valuestring) : NULL,
3171
0
        am_policy_ind ? true : false,
3172
0
        am_policy_ind ? am_policy_ind->valueint : 0,
3173
0
        ue_policy_ind ? true : false,
3174
0
        ue_policy_ind ? ue_policy_ind->valueint : 0,
3175
0
        energy_saving_ind ? true : false,
3176
0
        energy_saving_ind ? energy_saving_ind->valuedouble : 0
3177
0
    );
3178
3179
0
    return ue_context_local_var;
3180
0
end:
3181
0
    if (gpsi_listList) {
3182
0
        OpenAPI_list_for_each(gpsi_listList, node) {
3183
0
            ogs_free(node->data);
3184
0
        }
3185
0
        OpenAPI_list_free(gpsi_listList);
3186
0
        gpsi_listList = NULL;
3187
0
    }
3188
0
    if (group_listList) {
3189
0
        OpenAPI_list_for_each(group_listList, node) {
3190
0
            ogs_free(node->data);
3191
0
        }
3192
0
        OpenAPI_list_free(group_listList);
3193
0
        group_listList = NULL;
3194
0
    }
3195
0
    if (sub_ue_ambr_local_nonprim) {
3196
0
        OpenAPI_ambr_free(sub_ue_ambr_local_nonprim);
3197
0
        sub_ue_ambr_local_nonprim = NULL;
3198
0
    }
3199
0
    if (pcf_ue_ambr_local_nonprim) {
3200
0
        OpenAPI_ambr_free(pcf_ue_ambr_local_nonprim);
3201
0
        pcf_ue_ambr_local_nonprim = NULL;
3202
0
    }
3203
0
    if (sub_ue_slice_mbr_listList) {
3204
0
        OpenAPI_list_for_each(sub_ue_slice_mbr_listList, node) {
3205
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
3206
0
            ogs_free(localKeyValue->key);
3207
0
            OpenAPI_slice_mbr_free(localKeyValue->value);
3208
0
            OpenAPI_map_free(localKeyValue);
3209
0
        }
3210
0
        OpenAPI_list_free(sub_ue_slice_mbr_listList);
3211
0
        sub_ue_slice_mbr_listList = NULL;
3212
0
    }
3213
0
    if (seaf_data_local_nonprim) {
3214
0
        OpenAPI_seaf_data_free(seaf_data_local_nonprim);
3215
0
        seaf_data_local_nonprim = NULL;
3216
0
    }
3217
0
    if (am_policy_req_trigger_listList) {
3218
0
        OpenAPI_list_free(am_policy_req_trigger_listList);
3219
0
        am_policy_req_trigger_listList = NULL;
3220
0
    }
3221
0
    if (ue_policy_req_trigger_listList) {
3222
0
        OpenAPI_list_free(ue_policy_req_trigger_listList);
3223
0
        ue_policy_req_trigger_listList = NULL;
3224
0
    }
3225
0
    if (restricted_rat_listList) {
3226
0
        OpenAPI_list_free(restricted_rat_listList);
3227
0
        restricted_rat_listList = NULL;
3228
0
    }
3229
0
    if (forbidden_area_listList) {
3230
0
        OpenAPI_list_for_each(forbidden_area_listList, node) {
3231
0
            OpenAPI_area_free(node->data);
3232
0
        }
3233
0
        OpenAPI_list_free(forbidden_area_listList);
3234
0
        forbidden_area_listList = NULL;
3235
0
    }
3236
0
    if (service_area_restriction_local_nonprim) {
3237
0
        OpenAPI_service_area_restriction_free(service_area_restriction_local_nonprim);
3238
0
        service_area_restriction_local_nonprim = NULL;
3239
0
    }
3240
0
    if (restricted_core_nw_type_listList) {
3241
0
        OpenAPI_list_free(restricted_core_nw_type_listList);
3242
0
        restricted_core_nw_type_listList = NULL;
3243
0
    }
3244
0
    if (event_subscription_listList) {
3245
0
        OpenAPI_list_for_each(event_subscription_listList, node) {
3246
0
            OpenAPI_ext_amf_event_subscription_free(node->data);
3247
0
        }
3248
0
        OpenAPI_list_free(event_subscription_listList);
3249
0
        event_subscription_listList = NULL;
3250
0
    }
3251
0
    if (mm_context_listList) {
3252
0
        OpenAPI_list_for_each(mm_context_listList, node) {
3253
0
            OpenAPI_mm_context_free(node->data);
3254
0
        }
3255
0
        OpenAPI_list_free(mm_context_listList);
3256
0
        mm_context_listList = NULL;
3257
0
    }
3258
0
    if (session_context_listList) {
3259
0
        OpenAPI_list_for_each(session_context_listList, node) {
3260
0
            OpenAPI_pdu_session_context_free(node->data);
3261
0
        }
3262
0
        OpenAPI_list_free(session_context_listList);
3263
0
        session_context_listList = NULL;
3264
0
    }
3265
0
    if (eps_interworking_info_local_nonprim) {
3266
0
        OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim);
3267
0
        eps_interworking_info_local_nonprim = NULL;
3268
0
    }
3269
0
    if (trace_data_local_nonprim) {
3270
0
        OpenAPI_trace_data_free(trace_data_local_nonprim);
3271
0
        trace_data_local_nonprim = NULL;
3272
0
    }
3273
0
    if (supported_codec_listList) {
3274
0
        OpenAPI_list_for_each(supported_codec_listList, node) {
3275
0
            ogs_free(node->data);
3276
0
        }
3277
0
        OpenAPI_list_free(supported_codec_listList);
3278
0
        supported_codec_listList = NULL;
3279
0
    }
3280
0
    if (small_data_rate_status_infosList) {
3281
0
        OpenAPI_list_for_each(small_data_rate_status_infosList, node) {
3282
0
            OpenAPI_small_data_rate_status_info_free(node->data);
3283
0
        }
3284
0
        OpenAPI_list_free(small_data_rate_status_infosList);
3285
0
        small_data_rate_status_infosList = NULL;
3286
0
    }
3287
0
    if (restricted_primary_rat_listList) {
3288
0
        OpenAPI_list_free(restricted_primary_rat_listList);
3289
0
        restricted_primary_rat_listList = NULL;
3290
0
    }
3291
0
    if (restricted_secondary_rat_listList) {
3292
0
        OpenAPI_list_free(restricted_secondary_rat_listList);
3293
0
        restricted_secondary_rat_listList = NULL;
3294
0
    }
3295
0
    if (v2x_context_local_nonprim) {
3296
0
        OpenAPI_v2x_context_free(v2x_context_local_nonprim);
3297
0
        v2x_context_local_nonprim = NULL;
3298
0
    }
3299
0
    if (mo_exp_data_counter_local_nonprim) {
3300
0
        OpenAPI_mo_exp_data_counter_free(mo_exp_data_counter_local_nonprim);
3301
0
        mo_exp_data_counter_local_nonprim = NULL;
3302
0
    }
3303
0
    if (cag_data_local_nonprim) {
3304
0
        OpenAPI_cag_data_free(cag_data_local_nonprim);
3305
0
        cag_data_local_nonprim = NULL;
3306
0
    }
3307
0
    if (adjacen_plmn_mngt_mdt_indsList) {
3308
0
        OpenAPI_list_for_each(adjacen_plmn_mngt_mdt_indsList, node) {
3309
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
3310
0
            ogs_free(localKeyValue->key);
3311
0
            ogs_free(localKeyValue->value);
3312
0
            OpenAPI_map_free(localKeyValue);
3313
0
        }
3314
0
        OpenAPI_list_free(adjacen_plmn_mngt_mdt_indsList);
3315
0
        adjacen_plmn_mngt_mdt_indsList = NULL;
3316
0
    }
3317
0
    if (immediate_mdt_conf_local_nonprim) {
3318
0
        OpenAPI_immediate_mdt_conf_free(immediate_mdt_conf_local_nonprim);
3319
0
        immediate_mdt_conf_local_nonprim = NULL;
3320
0
    }
3321
0
    if (ec_restriction_data_wb_local_nonprim) {
3322
0
        OpenAPI_ec_restriction_data_wb_free(ec_restriction_data_wb_local_nonprim);
3323
0
        ec_restriction_data_wb_local_nonprim = NULL;
3324
0
    }
3325
0
    if (prose_context_local_nonprim) {
3326
0
        OpenAPI_prose_context_free(prose_context_local_nonprim);
3327
0
        prose_context_local_nonprim = NULL;
3328
0
    }
3329
0
    if (analytics_subscription_listList) {
3330
0
        OpenAPI_list_for_each(analytics_subscription_listList, node) {
3331
0
            OpenAPI_analytics_subscription_free(node->data);
3332
0
        }
3333
0
        OpenAPI_list_free(analytics_subscription_listList);
3334
0
        analytics_subscription_listList = NULL;
3335
0
    }
3336
0
    if (used_service_area_restriction_local_nonprim) {
3337
0
        OpenAPI_service_area_restriction_free(used_service_area_restriction_local_nonprim);
3338
0
        used_service_area_restriction_local_nonprim = NULL;
3339
0
    }
3340
0
    if (pra_in_am_policyList) {
3341
0
        OpenAPI_list_for_each(pra_in_am_policyList, node) {
3342
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
3343
0
            ogs_free(localKeyValue->key);
3344
0
            OpenAPI_presence_info_free(localKeyValue->value);
3345
0
            OpenAPI_map_free(localKeyValue);
3346
0
        }
3347
0
        OpenAPI_list_free(pra_in_am_policyList);
3348
0
        pra_in_am_policyList = NULL;
3349
0
    }
3350
0
    if (pra_in_ue_policyList) {
3351
0
        OpenAPI_list_for_each(pra_in_ue_policyList, node) {
3352
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
3353
0
            ogs_free(localKeyValue->key);
3354
0
            OpenAPI_presence_info_free(localKeyValue->value);
3355
0
            OpenAPI_map_free(localKeyValue);
3356
0
        }
3357
0
        OpenAPI_list_free(pra_in_ue_policyList);
3358
0
        pra_in_ue_policyList = NULL;
3359
0
    }
3360
0
    if (updp_subscription_data_local_nonprim) {
3361
0
        OpenAPI_updp_subscription_data_free(updp_subscription_data_local_nonprim);
3362
0
        updp_subscription_data_local_nonprim = NULL;
3363
0
    }
3364
0
    if (sm_policy_notify_pdu_listList) {
3365
0
        OpenAPI_list_for_each(sm_policy_notify_pdu_listList, node) {
3366
0
            OpenAPI_pdu_session_info_free(node->data);
3367
0
        }
3368
0
        OpenAPI_list_free(sm_policy_notify_pdu_listList);
3369
0
        sm_policy_notify_pdu_listList = NULL;
3370
0
    }
3371
0
    if (pcf_ue_callback_info_local_nonprim) {
3372
0
        OpenAPI_pcf_ue_callback_info_free(pcf_ue_callback_info_local_nonprim);
3373
0
        pcf_ue_callback_info_local_nonprim = NULL;
3374
0
    }
3375
0
    if (smf_sel_info_local_nonprim) {
3376
0
        OpenAPI_smf_selection_data_free(smf_sel_info_local_nonprim);
3377
0
        smf_sel_info_local_nonprim = NULL;
3378
0
    }
3379
0
    if (pcf_ue_slice_mbr_listList) {
3380
0
        OpenAPI_list_for_each(pcf_ue_slice_mbr_listList, node) {
3381
0
            OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
3382
0
            ogs_free(localKeyValue->key);
3383
0
            OpenAPI_slice_mbr_free(localKeyValue->value);
3384
0
            OpenAPI_map_free(localKeyValue);
3385
0
        }
3386
0
        OpenAPI_list_free(pcf_ue_slice_mbr_listList);
3387
0
        pcf_ue_slice_mbr_listList = NULL;
3388
0
    }
3389
0
    if (disaster_plmn_local_nonprim) {
3390
0
        OpenAPI_plmn_id_free(disaster_plmn_local_nonprim);
3391
0
        disaster_plmn_local_nonprim = NULL;
3392
0
    }
3393
0
    if (wl_serv_area_res_local_nonprim) {
3394
0
        OpenAPI_wireline_service_area_restriction_free(wl_serv_area_res_local_nonprim);
3395
0
        wl_serv_area_res_local_nonprim = NULL;
3396
0
    }
3397
0
    if (as_time_dis_param_local_nonprim) {
3398
0
        OpenAPI_as_time_distribution_param_free(as_time_dis_param_local_nonprim);
3399
0
        as_time_dis_param_local_nonprim = NULL;
3400
0
    }
3401
0
    if (am_policy_info_container_local_nonprim) {
3402
0
        OpenAPI_am_policy_info_container_free(am_policy_info_container_local_nonprim);
3403
0
        am_policy_info_container_local_nonprim = NULL;
3404
0
    }
3405
0
    if (a2x_context_local_nonprim) {
3406
0
        OpenAPI_a2x_context_free(a2x_context_local_nonprim);
3407
0
        a2x_context_local_nonprim = NULL;
3408
0
    }
3409
0
    if (mbsr_operation_allowed_local_nonprim) {
3410
0
        OpenAPI_mbsr_operation_allowed_free(mbsr_operation_allowed_local_nonprim);
3411
0
        mbsr_operation_allowed_local_nonprim = NULL;
3412
0
    }
3413
0
    if (lcs_up_context_local_nonprim) {
3414
0
        OpenAPI_lcs_up_context_free(lcs_up_context_local_nonprim);
3415
0
        lcs_up_context_local_nonprim = NULL;
3416
0
    }
3417
0
    if (lcs_up_context_listList) {
3418
0
        OpenAPI_list_for_each(lcs_up_context_listList, node) {
3419
0
            OpenAPI_lcs_up_context_free(node->data);
3420
0
        }
3421
0
        OpenAPI_list_free(lcs_up_context_listList);
3422
0
        lcs_up_context_listList = NULL;
3423
0
    }
3424
0
    return NULL;
3425
0
}
3426
3427
OpenAPI_ue_context_t *OpenAPI_ue_context_copy(OpenAPI_ue_context_t *dst, OpenAPI_ue_context_t *src)
3428
0
{
3429
0
    cJSON *item = NULL;
3430
0
    char *content = NULL;
3431
3432
0
    ogs_assert(src);
3433
0
    item = OpenAPI_ue_context_convertToJSON(src);
3434
0
    if (!item) {
3435
0
        ogs_error("OpenAPI_ue_context_convertToJSON() failed");
3436
0
        return NULL;
3437
0
    }
3438
3439
0
    content = cJSON_Print(item);
3440
0
    cJSON_Delete(item);
3441
3442
0
    if (!content) {
3443
0
        ogs_error("cJSON_Print() failed");
3444
0
        return NULL;
3445
0
    }
3446
3447
0
    item = cJSON_Parse(content);
3448
0
    ogs_free(content);
3449
0
    if (!item) {
3450
0
        ogs_error("cJSON_Parse() failed");
3451
0
        return NULL;
3452
0
    }
3453
3454
0
    OpenAPI_ue_context_free(dst);
3455
0
    dst = OpenAPI_ue_context_parseFromJSON(item);
3456
0
    cJSON_Delete(item);
3457
3458
0
    return dst;
3459
0
}
3460