Coverage Report

Created: 2026-06-30 06:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/open5gs/lib/sbi/openapi/model/pp_data.c
Line
Count
Source
1
2
#include <stdlib.h>
3
#include <string.h>
4
#include <stdio.h>
5
#include "pp_data.h"
6
7
OpenAPI_pp_data_t *OpenAPI_pp_data_create(
8
    bool is_communication_characteristics_null,
9
    OpenAPI_communication_characteristics_t *communication_characteristics,
10
    char *supported_features,
11
    bool is_expected_ue_behaviour_parameters_null,
12
    OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters,
13
    bool is_expected_ue_behaviour_extension_null,
14
    OpenAPI_expected_ue_behaviour_extension_t *expected_ue_behaviour_extension,
15
    bool is_ec_restriction_null,
16
    OpenAPI_ec_restriction_t *ec_restriction,
17
    bool is_acs_info_null,
18
    OpenAPI_acs_info_rm_t *acs_info,
19
    bool is_stn_sr_null,
20
    char *stn_sr,
21
    bool is_lcs_privacy_null,
22
    OpenAPI_lcs_privacy_t *lcs_privacy,
23
    OpenAPI_sor_info_t *sor_info,
24
    bool is__5mbs_authorization_info_null,
25
    OpenAPI_model_5_mbs_authorization_info_t *_5mbs_authorization_info,
26
    bool is_dnn_snssai_specific_group_null,
27
    OpenAPI_dnn_snssai_specific_group_t *dnn_snssai_specific_group,
28
    OpenAPI_mbs_assistance_info_t *mbs_assistance_info,
29
    bool is_app_specific_expected_ue_behaviour_null,
30
    OpenAPI_app_specific_expected_ue_behaviour_t *app_specific_expected_ue_behaviour,
31
    OpenAPI_list_t *slice_usage_control_infos,
32
    bool is_ranging_sl_privacy_null,
33
    OpenAPI_ranging_sl_privacy_t *ranging_sl_privacy,
34
    OpenAPI_cag_provision_information_t *cag_provision_info,
35
    OpenAPI_list_t *static_ue_ip_address_params
36
)
37
0
{
38
0
    OpenAPI_pp_data_t *pp_data_local_var = ogs_malloc(sizeof(OpenAPI_pp_data_t));
39
0
    ogs_assert(pp_data_local_var);
40
41
0
    pp_data_local_var->is_communication_characteristics_null = is_communication_characteristics_null;
42
0
    pp_data_local_var->communication_characteristics = communication_characteristics;
43
0
    pp_data_local_var->supported_features = supported_features;
44
0
    pp_data_local_var->is_expected_ue_behaviour_parameters_null = is_expected_ue_behaviour_parameters_null;
45
0
    pp_data_local_var->expected_ue_behaviour_parameters = expected_ue_behaviour_parameters;
46
0
    pp_data_local_var->is_expected_ue_behaviour_extension_null = is_expected_ue_behaviour_extension_null;
47
0
    pp_data_local_var->expected_ue_behaviour_extension = expected_ue_behaviour_extension;
48
0
    pp_data_local_var->is_ec_restriction_null = is_ec_restriction_null;
49
0
    pp_data_local_var->ec_restriction = ec_restriction;
50
0
    pp_data_local_var->is_acs_info_null = is_acs_info_null;
51
0
    pp_data_local_var->acs_info = acs_info;
52
0
    pp_data_local_var->is_stn_sr_null = is_stn_sr_null;
53
0
    pp_data_local_var->stn_sr = stn_sr;
54
0
    pp_data_local_var->is_lcs_privacy_null = is_lcs_privacy_null;
55
0
    pp_data_local_var->lcs_privacy = lcs_privacy;
56
0
    pp_data_local_var->sor_info = sor_info;
57
0
    pp_data_local_var->is__5mbs_authorization_info_null = is__5mbs_authorization_info_null;
58
0
    pp_data_local_var->_5mbs_authorization_info = _5mbs_authorization_info;
59
0
    pp_data_local_var->is_dnn_snssai_specific_group_null = is_dnn_snssai_specific_group_null;
60
0
    pp_data_local_var->dnn_snssai_specific_group = dnn_snssai_specific_group;
61
0
    pp_data_local_var->mbs_assistance_info = mbs_assistance_info;
62
0
    pp_data_local_var->is_app_specific_expected_ue_behaviour_null = is_app_specific_expected_ue_behaviour_null;
63
0
    pp_data_local_var->app_specific_expected_ue_behaviour = app_specific_expected_ue_behaviour;
64
0
    pp_data_local_var->slice_usage_control_infos = slice_usage_control_infos;
65
0
    pp_data_local_var->is_ranging_sl_privacy_null = is_ranging_sl_privacy_null;
66
0
    pp_data_local_var->ranging_sl_privacy = ranging_sl_privacy;
67
0
    pp_data_local_var->cag_provision_info = cag_provision_info;
68
0
    pp_data_local_var->static_ue_ip_address_params = static_ue_ip_address_params;
69
70
0
    return pp_data_local_var;
71
0
}
72
73
void OpenAPI_pp_data_free(OpenAPI_pp_data_t *pp_data)
74
0
{
75
0
    OpenAPI_lnode_t *node = NULL;
76
77
0
    if (NULL == pp_data) {
78
0
        return;
79
0
    }
80
0
    if (pp_data->communication_characteristics) {
81
0
        OpenAPI_communication_characteristics_free(pp_data->communication_characteristics);
82
0
        pp_data->communication_characteristics = NULL;
83
0
    }
84
0
    if (pp_data->supported_features) {
85
0
        ogs_free(pp_data->supported_features);
86
0
        pp_data->supported_features = NULL;
87
0
    }
88
0
    if (pp_data->expected_ue_behaviour_parameters) {
89
0
        OpenAPI_expected_ue_behaviour_free(pp_data->expected_ue_behaviour_parameters);
90
0
        pp_data->expected_ue_behaviour_parameters = NULL;
91
0
    }
92
0
    if (pp_data->expected_ue_behaviour_extension) {
93
0
        OpenAPI_expected_ue_behaviour_extension_free(pp_data->expected_ue_behaviour_extension);
94
0
        pp_data->expected_ue_behaviour_extension = NULL;
95
0
    }
96
0
    if (pp_data->ec_restriction) {
97
0
        OpenAPI_ec_restriction_free(pp_data->ec_restriction);
98
0
        pp_data->ec_restriction = NULL;
99
0
    }
100
0
    if (pp_data->acs_info) {
101
0
        OpenAPI_acs_info_rm_free(pp_data->acs_info);
102
0
        pp_data->acs_info = NULL;
103
0
    }
104
0
    if (pp_data->stn_sr) {
105
0
        ogs_free(pp_data->stn_sr);
106
0
        pp_data->stn_sr = NULL;
107
0
    }
108
0
    if (pp_data->lcs_privacy) {
109
0
        OpenAPI_lcs_privacy_free(pp_data->lcs_privacy);
110
0
        pp_data->lcs_privacy = NULL;
111
0
    }
112
0
    if (pp_data->sor_info) {
113
0
        OpenAPI_sor_info_free(pp_data->sor_info);
114
0
        pp_data->sor_info = NULL;
115
0
    }
116
0
    if (pp_data->_5mbs_authorization_info) {
117
0
        OpenAPI_model_5_mbs_authorization_info_free(pp_data->_5mbs_authorization_info);
118
0
        pp_data->_5mbs_authorization_info = NULL;
119
0
    }
120
0
    if (pp_data->dnn_snssai_specific_group) {
121
0
        OpenAPI_dnn_snssai_specific_group_free(pp_data->dnn_snssai_specific_group);
122
0
        pp_data->dnn_snssai_specific_group = NULL;
123
0
    }
124
0
    if (pp_data->mbs_assistance_info) {
125
0
        OpenAPI_mbs_assistance_info_free(pp_data->mbs_assistance_info);
126
0
        pp_data->mbs_assistance_info = NULL;
127
0
    }
128
0
    if (pp_data->app_specific_expected_ue_behaviour) {
129
0
        OpenAPI_app_specific_expected_ue_behaviour_free(pp_data->app_specific_expected_ue_behaviour);
130
0
        pp_data->app_specific_expected_ue_behaviour = NULL;
131
0
    }
132
0
    if (pp_data->slice_usage_control_infos) {
133
0
        OpenAPI_list_for_each(pp_data->slice_usage_control_infos, node) {
134
0
            OpenAPI_slice_usage_control_info_free(node->data);
135
0
        }
136
0
        OpenAPI_list_free(pp_data->slice_usage_control_infos);
137
0
        pp_data->slice_usage_control_infos = NULL;
138
0
    }
139
0
    if (pp_data->ranging_sl_privacy) {
140
0
        OpenAPI_ranging_sl_privacy_free(pp_data->ranging_sl_privacy);
141
0
        pp_data->ranging_sl_privacy = NULL;
142
0
    }
143
0
    if (pp_data->cag_provision_info) {
144
0
        OpenAPI_cag_provision_information_free(pp_data->cag_provision_info);
145
0
        pp_data->cag_provision_info = NULL;
146
0
    }
147
0
    if (pp_data->static_ue_ip_address_params) {
148
0
        OpenAPI_list_for_each(pp_data->static_ue_ip_address_params, node) {
149
0
            OpenAPI_static_ue_ip_address_params_free(node->data);
150
0
        }
151
0
        OpenAPI_list_free(pp_data->static_ue_ip_address_params);
152
0
        pp_data->static_ue_ip_address_params = NULL;
153
0
    }
154
0
    ogs_free(pp_data);
155
0
}
156
157
cJSON *OpenAPI_pp_data_convertToJSON(OpenAPI_pp_data_t *pp_data)
158
0
{
159
0
    cJSON *item = NULL;
160
0
    OpenAPI_lnode_t *node = NULL;
161
162
0
    if (pp_data == NULL) {
163
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [PpData]");
164
0
        return NULL;
165
0
    }
166
167
0
    item = cJSON_CreateObject();
168
0
    if (pp_data->communication_characteristics) {
169
0
    cJSON *communication_characteristics_local_JSON = OpenAPI_communication_characteristics_convertToJSON(pp_data->communication_characteristics);
170
0
    if (communication_characteristics_local_JSON == NULL) {
171
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [communication_characteristics]");
172
0
        goto end;
173
0
    }
174
0
    cJSON_AddItemToObject(item, "communicationCharacteristics", communication_characteristics_local_JSON);
175
0
    if (item->child == NULL) {
176
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [communication_characteristics]");
177
0
        goto end;
178
0
    }
179
0
    } else if (pp_data->is_communication_characteristics_null) {
180
0
        if (cJSON_AddNullToObject(item, "communicationCharacteristics") == NULL) {
181
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [communication_characteristics]");
182
0
            goto end;
183
0
        }
184
0
    }
185
186
0
    if (pp_data->supported_features) {
187
0
    if (cJSON_AddStringToObject(item, "supportedFeatures", pp_data->supported_features) == NULL) {
188
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [supported_features]");
189
0
        goto end;
190
0
    }
191
0
    }
192
193
0
    if (pp_data->expected_ue_behaviour_parameters) {
194
0
    cJSON *expected_ue_behaviour_parameters_local_JSON = OpenAPI_expected_ue_behaviour_convertToJSON(pp_data->expected_ue_behaviour_parameters);
195
0
    if (expected_ue_behaviour_parameters_local_JSON == NULL) {
196
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_parameters]");
197
0
        goto end;
198
0
    }
199
0
    cJSON_AddItemToObject(item, "expectedUeBehaviourParameters", expected_ue_behaviour_parameters_local_JSON);
200
0
    if (item->child == NULL) {
201
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_parameters]");
202
0
        goto end;
203
0
    }
204
0
    } else if (pp_data->is_expected_ue_behaviour_parameters_null) {
205
0
        if (cJSON_AddNullToObject(item, "expectedUeBehaviourParameters") == NULL) {
206
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_parameters]");
207
0
            goto end;
208
0
        }
209
0
    }
210
211
0
    if (pp_data->expected_ue_behaviour_extension) {
212
0
    cJSON *expected_ue_behaviour_extension_local_JSON = OpenAPI_expected_ue_behaviour_extension_convertToJSON(pp_data->expected_ue_behaviour_extension);
213
0
    if (expected_ue_behaviour_extension_local_JSON == NULL) {
214
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_extension]");
215
0
        goto end;
216
0
    }
217
0
    cJSON_AddItemToObject(item, "expectedUeBehaviourExtension", expected_ue_behaviour_extension_local_JSON);
218
0
    if (item->child == NULL) {
219
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_extension]");
220
0
        goto end;
221
0
    }
222
0
    } else if (pp_data->is_expected_ue_behaviour_extension_null) {
223
0
        if (cJSON_AddNullToObject(item, "expectedUeBehaviourExtension") == NULL) {
224
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [expected_ue_behaviour_extension]");
225
0
            goto end;
226
0
        }
227
0
    }
228
229
0
    if (pp_data->ec_restriction) {
230
0
    cJSON *ec_restriction_local_JSON = OpenAPI_ec_restriction_convertToJSON(pp_data->ec_restriction);
231
0
    if (ec_restriction_local_JSON == NULL) {
232
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [ec_restriction]");
233
0
        goto end;
234
0
    }
235
0
    cJSON_AddItemToObject(item, "ecRestriction", ec_restriction_local_JSON);
236
0
    if (item->child == NULL) {
237
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [ec_restriction]");
238
0
        goto end;
239
0
    }
240
0
    } else if (pp_data->is_ec_restriction_null) {
241
0
        if (cJSON_AddNullToObject(item, "ecRestriction") == NULL) {
242
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [ec_restriction]");
243
0
            goto end;
244
0
        }
245
0
    }
246
247
0
    if (pp_data->acs_info) {
248
0
    cJSON *acs_info_local_JSON = OpenAPI_acs_info_rm_convertToJSON(pp_data->acs_info);
249
0
    if (acs_info_local_JSON == NULL) {
250
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [acs_info]");
251
0
        goto end;
252
0
    }
253
0
    cJSON_AddItemToObject(item, "acsInfo", acs_info_local_JSON);
254
0
    if (item->child == NULL) {
255
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [acs_info]");
256
0
        goto end;
257
0
    }
258
0
    } else if (pp_data->is_acs_info_null) {
259
0
        if (cJSON_AddNullToObject(item, "acsInfo") == NULL) {
260
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [acs_info]");
261
0
            goto end;
262
0
        }
263
0
    }
264
265
0
    if (pp_data->stn_sr) {
266
0
    if (cJSON_AddStringToObject(item, "stnSr", pp_data->stn_sr) == NULL) {
267
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [stn_sr]");
268
0
        goto end;
269
0
    }
270
0
    } else if (pp_data->is_stn_sr_null) {
271
0
        if (cJSON_AddNullToObject(item, "stnSr") == NULL) {
272
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [stn_sr]");
273
0
            goto end;
274
0
        }
275
0
    }
276
277
0
    if (pp_data->lcs_privacy) {
278
0
    cJSON *lcs_privacy_local_JSON = OpenAPI_lcs_privacy_convertToJSON(pp_data->lcs_privacy);
279
0
    if (lcs_privacy_local_JSON == NULL) {
280
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [lcs_privacy]");
281
0
        goto end;
282
0
    }
283
0
    cJSON_AddItemToObject(item, "lcsPrivacy", lcs_privacy_local_JSON);
284
0
    if (item->child == NULL) {
285
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [lcs_privacy]");
286
0
        goto end;
287
0
    }
288
0
    } else if (pp_data->is_lcs_privacy_null) {
289
0
        if (cJSON_AddNullToObject(item, "lcsPrivacy") == NULL) {
290
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [lcs_privacy]");
291
0
            goto end;
292
0
        }
293
0
    }
294
295
0
    if (pp_data->sor_info) {
296
0
    cJSON *sor_info_local_JSON = OpenAPI_sor_info_convertToJSON(pp_data->sor_info);
297
0
    if (sor_info_local_JSON == NULL) {
298
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [sor_info]");
299
0
        goto end;
300
0
    }
301
0
    cJSON_AddItemToObject(item, "sorInfo", sor_info_local_JSON);
302
0
    if (item->child == NULL) {
303
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [sor_info]");
304
0
        goto end;
305
0
    }
306
0
    }
307
308
0
    if (pp_data->_5mbs_authorization_info) {
309
0
    cJSON *_5mbs_authorization_info_local_JSON = OpenAPI_model_5_mbs_authorization_info_convertToJSON(pp_data->_5mbs_authorization_info);
310
0
    if (_5mbs_authorization_info_local_JSON == NULL) {
311
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [_5mbs_authorization_info]");
312
0
        goto end;
313
0
    }
314
0
    cJSON_AddItemToObject(item, "5mbsAuthorizationInfo", _5mbs_authorization_info_local_JSON);
315
0
    if (item->child == NULL) {
316
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [_5mbs_authorization_info]");
317
0
        goto end;
318
0
    }
319
0
    } else if (pp_data->is__5mbs_authorization_info_null) {
320
0
        if (cJSON_AddNullToObject(item, "5mbsAuthorizationInfo") == NULL) {
321
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [_5mbs_authorization_info]");
322
0
            goto end;
323
0
        }
324
0
    }
325
326
0
    if (pp_data->dnn_snssai_specific_group) {
327
0
    cJSON *dnn_snssai_specific_group_local_JSON = OpenAPI_dnn_snssai_specific_group_convertToJSON(pp_data->dnn_snssai_specific_group);
328
0
    if (dnn_snssai_specific_group_local_JSON == NULL) {
329
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [dnn_snssai_specific_group]");
330
0
        goto end;
331
0
    }
332
0
    cJSON_AddItemToObject(item, "dnnSnssaiSpecificGroup", dnn_snssai_specific_group_local_JSON);
333
0
    if (item->child == NULL) {
334
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [dnn_snssai_specific_group]");
335
0
        goto end;
336
0
    }
337
0
    } else if (pp_data->is_dnn_snssai_specific_group_null) {
338
0
        if (cJSON_AddNullToObject(item, "dnnSnssaiSpecificGroup") == NULL) {
339
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [dnn_snssai_specific_group]");
340
0
            goto end;
341
0
        }
342
0
    }
343
344
0
    if (pp_data->mbs_assistance_info) {
345
0
    cJSON *mbs_assistance_info_local_JSON = OpenAPI_mbs_assistance_info_convertToJSON(pp_data->mbs_assistance_info);
346
0
    if (mbs_assistance_info_local_JSON == NULL) {
347
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [mbs_assistance_info]");
348
0
        goto end;
349
0
    }
350
0
    cJSON_AddItemToObject(item, "mbsAssistanceInfo", mbs_assistance_info_local_JSON);
351
0
    if (item->child == NULL) {
352
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [mbs_assistance_info]");
353
0
        goto end;
354
0
    }
355
0
    }
356
357
0
    if (pp_data->app_specific_expected_ue_behaviour) {
358
0
    cJSON *app_specific_expected_ue_behaviour_local_JSON = OpenAPI_app_specific_expected_ue_behaviour_convertToJSON(pp_data->app_specific_expected_ue_behaviour);
359
0
    if (app_specific_expected_ue_behaviour_local_JSON == NULL) {
360
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [app_specific_expected_ue_behaviour]");
361
0
        goto end;
362
0
    }
363
0
    cJSON_AddItemToObject(item, "appSpecificExpectedUeBehaviour", app_specific_expected_ue_behaviour_local_JSON);
364
0
    if (item->child == NULL) {
365
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [app_specific_expected_ue_behaviour]");
366
0
        goto end;
367
0
    }
368
0
    } else if (pp_data->is_app_specific_expected_ue_behaviour_null) {
369
0
        if (cJSON_AddNullToObject(item, "appSpecificExpectedUeBehaviour") == NULL) {
370
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [app_specific_expected_ue_behaviour]");
371
0
            goto end;
372
0
        }
373
0
    }
374
375
0
    if (pp_data->slice_usage_control_infos) {
376
0
    cJSON *slice_usage_control_infosList = cJSON_AddArrayToObject(item, "sliceUsageControlInfos");
377
0
    if (slice_usage_control_infosList == NULL) {
378
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [slice_usage_control_infos]");
379
0
        goto end;
380
0
    }
381
0
    OpenAPI_list_for_each(pp_data->slice_usage_control_infos, node) {
382
0
        cJSON *itemLocal = OpenAPI_slice_usage_control_info_convertToJSON(node->data);
383
0
        if (itemLocal == NULL) {
384
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [slice_usage_control_infos]");
385
0
            goto end;
386
0
        }
387
0
        cJSON_AddItemToArray(slice_usage_control_infosList, itemLocal);
388
0
    }
389
0
    }
390
391
0
    if (pp_data->ranging_sl_privacy) {
392
0
    cJSON *ranging_sl_privacy_local_JSON = OpenAPI_ranging_sl_privacy_convertToJSON(pp_data->ranging_sl_privacy);
393
0
    if (ranging_sl_privacy_local_JSON == NULL) {
394
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [ranging_sl_privacy]");
395
0
        goto end;
396
0
    }
397
0
    cJSON_AddItemToObject(item, "rangingSlPrivacy", ranging_sl_privacy_local_JSON);
398
0
    if (item->child == NULL) {
399
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [ranging_sl_privacy]");
400
0
        goto end;
401
0
    }
402
0
    } else if (pp_data->is_ranging_sl_privacy_null) {
403
0
        if (cJSON_AddNullToObject(item, "rangingSlPrivacy") == NULL) {
404
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [ranging_sl_privacy]");
405
0
            goto end;
406
0
        }
407
0
    }
408
409
0
    if (pp_data->cag_provision_info) {
410
0
    cJSON *cag_provision_info_local_JSON = OpenAPI_cag_provision_information_convertToJSON(pp_data->cag_provision_info);
411
0
    if (cag_provision_info_local_JSON == NULL) {
412
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [cag_provision_info]");
413
0
        goto end;
414
0
    }
415
0
    cJSON_AddItemToObject(item, "cagProvisionInfo", cag_provision_info_local_JSON);
416
0
    if (item->child == NULL) {
417
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [cag_provision_info]");
418
0
        goto end;
419
0
    }
420
0
    }
421
422
0
    if (pp_data->static_ue_ip_address_params) {
423
0
    cJSON *static_ue_ip_address_paramsList = cJSON_AddArrayToObject(item, "staticUeIpAddressParams");
424
0
    if (static_ue_ip_address_paramsList == NULL) {
425
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed [static_ue_ip_address_params]");
426
0
        goto end;
427
0
    }
428
0
    OpenAPI_list_for_each(pp_data->static_ue_ip_address_params, node) {
429
0
        cJSON *itemLocal = OpenAPI_static_ue_ip_address_params_convertToJSON(node->data);
430
0
        if (itemLocal == NULL) {
431
0
            ogs_error("OpenAPI_pp_data_convertToJSON() failed [static_ue_ip_address_params]");
432
0
            goto end;
433
0
        }
434
0
        cJSON_AddItemToArray(static_ue_ip_address_paramsList, itemLocal);
435
0
    }
436
0
    }
437
438
0
end:
439
0
    return item;
440
0
}
441
442
OpenAPI_pp_data_t *OpenAPI_pp_data_parseFromJSON(cJSON *pp_dataJSON)
443
0
{
444
0
    OpenAPI_pp_data_t *pp_data_local_var = NULL;
445
0
    OpenAPI_lnode_t *node = NULL;
446
0
    cJSON *communication_characteristics = NULL;
447
0
    OpenAPI_communication_characteristics_t *communication_characteristics_local_nonprim = NULL;
448
0
    cJSON *supported_features = NULL;
449
0
    cJSON *expected_ue_behaviour_parameters = NULL;
450
0
    OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_parameters_local_nonprim = NULL;
451
0
    cJSON *expected_ue_behaviour_extension = NULL;
452
0
    OpenAPI_expected_ue_behaviour_extension_t *expected_ue_behaviour_extension_local_nonprim = NULL;
453
0
    cJSON *ec_restriction = NULL;
454
0
    OpenAPI_ec_restriction_t *ec_restriction_local_nonprim = NULL;
455
0
    cJSON *acs_info = NULL;
456
0
    OpenAPI_acs_info_rm_t *acs_info_local_nonprim = NULL;
457
0
    cJSON *stn_sr = NULL;
458
0
    cJSON *lcs_privacy = NULL;
459
0
    OpenAPI_lcs_privacy_t *lcs_privacy_local_nonprim = NULL;
460
0
    cJSON *sor_info = NULL;
461
0
    OpenAPI_sor_info_t *sor_info_local_nonprim = NULL;
462
0
    cJSON *_5mbs_authorization_info = NULL;
463
0
    OpenAPI_model_5_mbs_authorization_info_t *_5mbs_authorization_info_local_nonprim = NULL;
464
0
    cJSON *dnn_snssai_specific_group = NULL;
465
0
    OpenAPI_dnn_snssai_specific_group_t *dnn_snssai_specific_group_local_nonprim = NULL;
466
0
    cJSON *mbs_assistance_info = NULL;
467
0
    OpenAPI_mbs_assistance_info_t *mbs_assistance_info_local_nonprim = NULL;
468
0
    cJSON *app_specific_expected_ue_behaviour = NULL;
469
0
    OpenAPI_app_specific_expected_ue_behaviour_t *app_specific_expected_ue_behaviour_local_nonprim = NULL;
470
0
    cJSON *slice_usage_control_infos = NULL;
471
0
    OpenAPI_list_t *slice_usage_control_infosList = NULL;
472
0
    cJSON *ranging_sl_privacy = NULL;
473
0
    OpenAPI_ranging_sl_privacy_t *ranging_sl_privacy_local_nonprim = NULL;
474
0
    cJSON *cag_provision_info = NULL;
475
0
    OpenAPI_cag_provision_information_t *cag_provision_info_local_nonprim = NULL;
476
0
    cJSON *static_ue_ip_address_params = NULL;
477
0
    OpenAPI_list_t *static_ue_ip_address_paramsList = NULL;
478
0
    communication_characteristics = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "communicationCharacteristics");
479
0
    if (communication_characteristics) {
480
0
    if (!cJSON_IsNull(communication_characteristics)) {
481
0
    communication_characteristics_local_nonprim = OpenAPI_communication_characteristics_parseFromJSON(communication_characteristics);
482
0
    if (!communication_characteristics_local_nonprim) {
483
0
        ogs_error("OpenAPI_communication_characteristics_parseFromJSON failed [communication_characteristics]");
484
0
        goto end;
485
0
    }
486
0
    }
487
0
    }
488
489
0
    supported_features = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "supportedFeatures");
490
0
    if (supported_features) {
491
0
    if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
492
0
        ogs_error("OpenAPI_pp_data_parseFromJSON() failed [supported_features]");
493
0
        goto end;
494
0
    }
495
0
    }
496
497
0
    expected_ue_behaviour_parameters = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "expectedUeBehaviourParameters");
498
0
    if (expected_ue_behaviour_parameters) {
499
0
    if (!cJSON_IsNull(expected_ue_behaviour_parameters)) {
500
0
    expected_ue_behaviour_parameters_local_nonprim = OpenAPI_expected_ue_behaviour_parseFromJSON(expected_ue_behaviour_parameters);
501
0
    if (!expected_ue_behaviour_parameters_local_nonprim) {
502
0
        ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON failed [expected_ue_behaviour_parameters]");
503
0
        goto end;
504
0
    }
505
0
    }
506
0
    }
507
508
0
    expected_ue_behaviour_extension = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "expectedUeBehaviourExtension");
509
0
    if (expected_ue_behaviour_extension) {
510
0
    if (!cJSON_IsNull(expected_ue_behaviour_extension)) {
511
0
    expected_ue_behaviour_extension_local_nonprim = OpenAPI_expected_ue_behaviour_extension_parseFromJSON(expected_ue_behaviour_extension);
512
0
    if (!expected_ue_behaviour_extension_local_nonprim) {
513
0
        ogs_error("OpenAPI_expected_ue_behaviour_extension_parseFromJSON failed [expected_ue_behaviour_extension]");
514
0
        goto end;
515
0
    }
516
0
    }
517
0
    }
518
519
0
    ec_restriction = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "ecRestriction");
520
0
    if (ec_restriction) {
521
0
    if (!cJSON_IsNull(ec_restriction)) {
522
0
    ec_restriction_local_nonprim = OpenAPI_ec_restriction_parseFromJSON(ec_restriction);
523
0
    if (!ec_restriction_local_nonprim) {
524
0
        ogs_error("OpenAPI_ec_restriction_parseFromJSON failed [ec_restriction]");
525
0
        goto end;
526
0
    }
527
0
    }
528
0
    }
529
530
0
    acs_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "acsInfo");
531
0
    if (acs_info) {
532
0
    if (!cJSON_IsNull(acs_info)) {
533
0
    acs_info_local_nonprim = OpenAPI_acs_info_rm_parseFromJSON(acs_info);
534
0
    if (!acs_info_local_nonprim) {
535
0
        ogs_error("OpenAPI_acs_info_rm_parseFromJSON failed [acs_info]");
536
0
        goto end;
537
0
    }
538
0
    }
539
0
    }
540
541
0
    stn_sr = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "stnSr");
542
0
    if (stn_sr) {
543
0
    if (!cJSON_IsNull(stn_sr)) {
544
0
    if (!cJSON_IsString(stn_sr) && !cJSON_IsNull(stn_sr)) {
545
0
        ogs_error("OpenAPI_pp_data_parseFromJSON() failed [stn_sr]");
546
0
        goto end;
547
0
    }
548
0
    }
549
0
    }
550
551
0
    lcs_privacy = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "lcsPrivacy");
552
0
    if (lcs_privacy) {
553
0
    if (!cJSON_IsNull(lcs_privacy)) {
554
0
    lcs_privacy_local_nonprim = OpenAPI_lcs_privacy_parseFromJSON(lcs_privacy);
555
0
    if (!lcs_privacy_local_nonprim) {
556
0
        ogs_error("OpenAPI_lcs_privacy_parseFromJSON failed [lcs_privacy]");
557
0
        goto end;
558
0
    }
559
0
    }
560
0
    }
561
562
0
    sor_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "sorInfo");
563
0
    if (sor_info) {
564
0
    sor_info_local_nonprim = OpenAPI_sor_info_parseFromJSON(sor_info);
565
0
    if (!sor_info_local_nonprim) {
566
0
        ogs_error("OpenAPI_sor_info_parseFromJSON failed [sor_info]");
567
0
        goto end;
568
0
    }
569
0
    }
570
571
0
    _5mbs_authorization_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "5mbsAuthorizationInfo");
572
0
    if (_5mbs_authorization_info) {
573
0
    if (!cJSON_IsNull(_5mbs_authorization_info)) {
574
0
    _5mbs_authorization_info_local_nonprim = OpenAPI_model_5_mbs_authorization_info_parseFromJSON(_5mbs_authorization_info);
575
0
    if (!_5mbs_authorization_info_local_nonprim) {
576
0
        ogs_error("OpenAPI_model_5_mbs_authorization_info_parseFromJSON failed [_5mbs_authorization_info]");
577
0
        goto end;
578
0
    }
579
0
    }
580
0
    }
581
582
0
    dnn_snssai_specific_group = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "dnnSnssaiSpecificGroup");
583
0
    if (dnn_snssai_specific_group) {
584
0
    if (!cJSON_IsNull(dnn_snssai_specific_group)) {
585
0
    dnn_snssai_specific_group_local_nonprim = OpenAPI_dnn_snssai_specific_group_parseFromJSON(dnn_snssai_specific_group);
586
0
    if (!dnn_snssai_specific_group_local_nonprim) {
587
0
        ogs_error("OpenAPI_dnn_snssai_specific_group_parseFromJSON failed [dnn_snssai_specific_group]");
588
0
        goto end;
589
0
    }
590
0
    }
591
0
    }
592
593
0
    mbs_assistance_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "mbsAssistanceInfo");
594
0
    if (mbs_assistance_info) {
595
0
    mbs_assistance_info_local_nonprim = OpenAPI_mbs_assistance_info_parseFromJSON(mbs_assistance_info);
596
0
    if (!mbs_assistance_info_local_nonprim) {
597
0
        ogs_error("OpenAPI_mbs_assistance_info_parseFromJSON failed [mbs_assistance_info]");
598
0
        goto end;
599
0
    }
600
0
    }
601
602
0
    app_specific_expected_ue_behaviour = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "appSpecificExpectedUeBehaviour");
603
0
    if (app_specific_expected_ue_behaviour) {
604
0
    if (!cJSON_IsNull(app_specific_expected_ue_behaviour)) {
605
0
    app_specific_expected_ue_behaviour_local_nonprim = OpenAPI_app_specific_expected_ue_behaviour_parseFromJSON(app_specific_expected_ue_behaviour);
606
0
    if (!app_specific_expected_ue_behaviour_local_nonprim) {
607
0
        ogs_error("OpenAPI_app_specific_expected_ue_behaviour_parseFromJSON failed [app_specific_expected_ue_behaviour]");
608
0
        goto end;
609
0
    }
610
0
    }
611
0
    }
612
613
0
    slice_usage_control_infos = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "sliceUsageControlInfos");
614
0
    if (slice_usage_control_infos) {
615
0
        cJSON *slice_usage_control_infos_local = NULL;
616
0
        if (!cJSON_IsArray(slice_usage_control_infos)) {
617
0
            ogs_error("OpenAPI_pp_data_parseFromJSON() failed [slice_usage_control_infos]");
618
0
            goto end;
619
0
        }
620
621
0
        slice_usage_control_infosList = OpenAPI_list_create();
622
623
0
        cJSON_ArrayForEach(slice_usage_control_infos_local, slice_usage_control_infos) {
624
0
            if (!cJSON_IsObject(slice_usage_control_infos_local)) {
625
0
                ogs_error("OpenAPI_pp_data_parseFromJSON() failed [slice_usage_control_infos]");
626
0
                goto end;
627
0
            }
628
0
            OpenAPI_slice_usage_control_info_t *slice_usage_control_infosItem = OpenAPI_slice_usage_control_info_parseFromJSON(slice_usage_control_infos_local);
629
0
            if (!slice_usage_control_infosItem) {
630
0
                ogs_error("No slice_usage_control_infosItem");
631
0
                goto end;
632
0
            }
633
0
            OpenAPI_list_add(slice_usage_control_infosList, slice_usage_control_infosItem);
634
0
        }
635
0
    }
636
637
0
    ranging_sl_privacy = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "rangingSlPrivacy");
638
0
    if (ranging_sl_privacy) {
639
0
    if (!cJSON_IsNull(ranging_sl_privacy)) {
640
0
    ranging_sl_privacy_local_nonprim = OpenAPI_ranging_sl_privacy_parseFromJSON(ranging_sl_privacy);
641
0
    if (!ranging_sl_privacy_local_nonprim) {
642
0
        ogs_error("OpenAPI_ranging_sl_privacy_parseFromJSON failed [ranging_sl_privacy]");
643
0
        goto end;
644
0
    }
645
0
    }
646
0
    }
647
648
0
    cag_provision_info = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "cagProvisionInfo");
649
0
    if (cag_provision_info) {
650
0
    cag_provision_info_local_nonprim = OpenAPI_cag_provision_information_parseFromJSON(cag_provision_info);
651
0
    if (!cag_provision_info_local_nonprim) {
652
0
        ogs_error("OpenAPI_cag_provision_information_parseFromJSON failed [cag_provision_info]");
653
0
        goto end;
654
0
    }
655
0
    }
656
657
0
    static_ue_ip_address_params = cJSON_GetObjectItemCaseSensitive(pp_dataJSON, "staticUeIpAddressParams");
658
0
    if (static_ue_ip_address_params) {
659
0
        cJSON *static_ue_ip_address_params_local = NULL;
660
0
        if (!cJSON_IsArray(static_ue_ip_address_params)) {
661
0
            ogs_error("OpenAPI_pp_data_parseFromJSON() failed [static_ue_ip_address_params]");
662
0
            goto end;
663
0
        }
664
665
0
        static_ue_ip_address_paramsList = OpenAPI_list_create();
666
667
0
        cJSON_ArrayForEach(static_ue_ip_address_params_local, static_ue_ip_address_params) {
668
0
            if (!cJSON_IsObject(static_ue_ip_address_params_local)) {
669
0
                ogs_error("OpenAPI_pp_data_parseFromJSON() failed [static_ue_ip_address_params]");
670
0
                goto end;
671
0
            }
672
0
            OpenAPI_static_ue_ip_address_params_t *static_ue_ip_address_paramsItem = OpenAPI_static_ue_ip_address_params_parseFromJSON(static_ue_ip_address_params_local);
673
0
            if (!static_ue_ip_address_paramsItem) {
674
0
                ogs_error("No static_ue_ip_address_paramsItem");
675
0
                goto end;
676
0
            }
677
0
            OpenAPI_list_add(static_ue_ip_address_paramsList, static_ue_ip_address_paramsItem);
678
0
        }
679
0
    }
680
681
0
    pp_data_local_var = OpenAPI_pp_data_create (
682
0
        communication_characteristics && cJSON_IsNull(communication_characteristics) ? true : false,
683
0
        communication_characteristics ? communication_characteristics_local_nonprim : NULL,
684
0
        supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
685
0
        expected_ue_behaviour_parameters && cJSON_IsNull(expected_ue_behaviour_parameters) ? true : false,
686
0
        expected_ue_behaviour_parameters ? expected_ue_behaviour_parameters_local_nonprim : NULL,
687
0
        expected_ue_behaviour_extension && cJSON_IsNull(expected_ue_behaviour_extension) ? true : false,
688
0
        expected_ue_behaviour_extension ? expected_ue_behaviour_extension_local_nonprim : NULL,
689
0
        ec_restriction && cJSON_IsNull(ec_restriction) ? true : false,
690
0
        ec_restriction ? ec_restriction_local_nonprim : NULL,
691
0
        acs_info && cJSON_IsNull(acs_info) ? true : false,
692
0
        acs_info ? acs_info_local_nonprim : NULL,
693
0
        stn_sr && cJSON_IsNull(stn_sr) ? true : false,
694
0
        stn_sr && !cJSON_IsNull(stn_sr) ? ogs_strdup(stn_sr->valuestring) : NULL,
695
0
        lcs_privacy && cJSON_IsNull(lcs_privacy) ? true : false,
696
0
        lcs_privacy ? lcs_privacy_local_nonprim : NULL,
697
0
        sor_info ? sor_info_local_nonprim : NULL,
698
0
        _5mbs_authorization_info && cJSON_IsNull(_5mbs_authorization_info) ? true : false,
699
0
        _5mbs_authorization_info ? _5mbs_authorization_info_local_nonprim : NULL,
700
0
        dnn_snssai_specific_group && cJSON_IsNull(dnn_snssai_specific_group) ? true : false,
701
0
        dnn_snssai_specific_group ? dnn_snssai_specific_group_local_nonprim : NULL,
702
0
        mbs_assistance_info ? mbs_assistance_info_local_nonprim : NULL,
703
0
        app_specific_expected_ue_behaviour && cJSON_IsNull(app_specific_expected_ue_behaviour) ? true : false,
704
0
        app_specific_expected_ue_behaviour ? app_specific_expected_ue_behaviour_local_nonprim : NULL,
705
0
        slice_usage_control_infos ? slice_usage_control_infosList : NULL,
706
0
        ranging_sl_privacy && cJSON_IsNull(ranging_sl_privacy) ? true : false,
707
0
        ranging_sl_privacy ? ranging_sl_privacy_local_nonprim : NULL,
708
0
        cag_provision_info ? cag_provision_info_local_nonprim : NULL,
709
0
        static_ue_ip_address_params ? static_ue_ip_address_paramsList : NULL
710
0
    );
711
712
0
    return pp_data_local_var;
713
0
end:
714
0
    if (communication_characteristics_local_nonprim) {
715
0
        OpenAPI_communication_characteristics_free(communication_characteristics_local_nonprim);
716
0
        communication_characteristics_local_nonprim = NULL;
717
0
    }
718
0
    if (expected_ue_behaviour_parameters_local_nonprim) {
719
0
        OpenAPI_expected_ue_behaviour_free(expected_ue_behaviour_parameters_local_nonprim);
720
0
        expected_ue_behaviour_parameters_local_nonprim = NULL;
721
0
    }
722
0
    if (expected_ue_behaviour_extension_local_nonprim) {
723
0
        OpenAPI_expected_ue_behaviour_extension_free(expected_ue_behaviour_extension_local_nonprim);
724
0
        expected_ue_behaviour_extension_local_nonprim = NULL;
725
0
    }
726
0
    if (ec_restriction_local_nonprim) {
727
0
        OpenAPI_ec_restriction_free(ec_restriction_local_nonprim);
728
0
        ec_restriction_local_nonprim = NULL;
729
0
    }
730
0
    if (acs_info_local_nonprim) {
731
0
        OpenAPI_acs_info_rm_free(acs_info_local_nonprim);
732
0
        acs_info_local_nonprim = NULL;
733
0
    }
734
0
    if (lcs_privacy_local_nonprim) {
735
0
        OpenAPI_lcs_privacy_free(lcs_privacy_local_nonprim);
736
0
        lcs_privacy_local_nonprim = NULL;
737
0
    }
738
0
    if (sor_info_local_nonprim) {
739
0
        OpenAPI_sor_info_free(sor_info_local_nonprim);
740
0
        sor_info_local_nonprim = NULL;
741
0
    }
742
0
    if (_5mbs_authorization_info_local_nonprim) {
743
0
        OpenAPI_model_5_mbs_authorization_info_free(_5mbs_authorization_info_local_nonprim);
744
0
        _5mbs_authorization_info_local_nonprim = NULL;
745
0
    }
746
0
    if (dnn_snssai_specific_group_local_nonprim) {
747
0
        OpenAPI_dnn_snssai_specific_group_free(dnn_snssai_specific_group_local_nonprim);
748
0
        dnn_snssai_specific_group_local_nonprim = NULL;
749
0
    }
750
0
    if (mbs_assistance_info_local_nonprim) {
751
0
        OpenAPI_mbs_assistance_info_free(mbs_assistance_info_local_nonprim);
752
0
        mbs_assistance_info_local_nonprim = NULL;
753
0
    }
754
0
    if (app_specific_expected_ue_behaviour_local_nonprim) {
755
0
        OpenAPI_app_specific_expected_ue_behaviour_free(app_specific_expected_ue_behaviour_local_nonprim);
756
0
        app_specific_expected_ue_behaviour_local_nonprim = NULL;
757
0
    }
758
0
    if (slice_usage_control_infosList) {
759
0
        OpenAPI_list_for_each(slice_usage_control_infosList, node) {
760
0
            OpenAPI_slice_usage_control_info_free(node->data);
761
0
        }
762
0
        OpenAPI_list_free(slice_usage_control_infosList);
763
0
        slice_usage_control_infosList = NULL;
764
0
    }
765
0
    if (ranging_sl_privacy_local_nonprim) {
766
0
        OpenAPI_ranging_sl_privacy_free(ranging_sl_privacy_local_nonprim);
767
0
        ranging_sl_privacy_local_nonprim = NULL;
768
0
    }
769
0
    if (cag_provision_info_local_nonprim) {
770
0
        OpenAPI_cag_provision_information_free(cag_provision_info_local_nonprim);
771
0
        cag_provision_info_local_nonprim = NULL;
772
0
    }
773
0
    if (static_ue_ip_address_paramsList) {
774
0
        OpenAPI_list_for_each(static_ue_ip_address_paramsList, node) {
775
0
            OpenAPI_static_ue_ip_address_params_free(node->data);
776
0
        }
777
0
        OpenAPI_list_free(static_ue_ip_address_paramsList);
778
0
        static_ue_ip_address_paramsList = NULL;
779
0
    }
780
0
    return NULL;
781
0
}
782
783
OpenAPI_pp_data_t *OpenAPI_pp_data_copy(OpenAPI_pp_data_t *dst, OpenAPI_pp_data_t *src)
784
0
{
785
0
    cJSON *item = NULL;
786
0
    char *content = NULL;
787
788
0
    ogs_assert(src);
789
0
    item = OpenAPI_pp_data_convertToJSON(src);
790
0
    if (!item) {
791
0
        ogs_error("OpenAPI_pp_data_convertToJSON() failed");
792
0
        return NULL;
793
0
    }
794
795
0
    content = cJSON_Print(item);
796
0
    cJSON_Delete(item);
797
798
0
    if (!content) {
799
0
        ogs_error("cJSON_Print() failed");
800
0
        return NULL;
801
0
    }
802
803
0
    item = cJSON_Parse(content);
804
0
    ogs_free(content);
805
0
    if (!item) {
806
0
        ogs_error("cJSON_Parse() failed");
807
0
        return NULL;
808
0
    }
809
810
0
    OpenAPI_pp_data_free(dst);
811
0
    dst = OpenAPI_pp_data_parseFromJSON(item);
812
0
    cJSON_Delete(item);
813
814
0
    return dst;
815
0
}
816