mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-03 05:40:09 +00:00
Add only one 5GC scenario (call-flow)
This commit is contained in:
parent
20008b6a13
commit
dbee687a75
1415 changed files with 86635 additions and 5877 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
OpenAPI_map_t *OpenAPI_map_create(char *key, void *value)
|
||||
{
|
||||
OpenAPI_map_t *OpenAPI_map = ogs_malloc(sizeof(OpenAPI_map_t));
|
||||
OpenAPI_map_t *OpenAPI_map = ogs_malloc(sizeof(OpenAPI_map_t));
|
||||
OpenAPI_map->key = key;
|
||||
OpenAPI_map->value = value;
|
||||
return OpenAPI_map;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len)
|
||||
{
|
||||
binary_t* ret = malloc(sizeof(struct binary_t));
|
||||
OpenAPI_binary_t* ret = malloc(sizeof(OpenAPI_binary_t));
|
||||
|
||||
ret->len=len;
|
||||
ret->data = malloc(len);
|
||||
|
|
@ -35,7 +35,7 @@ char *OpenAPI_base64encode(const void *b64_encode_this,
|
|||
(*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail.
|
||||
return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct).
|
||||
#else // OPENSSL
|
||||
#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library.
|
||||
//#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library.
|
||||
return NULL;
|
||||
#endif // OPENSSL
|
||||
}
|
||||
|
|
@ -59,7 +59,7 @@ char *OpenAPI_base64decode(const void *b64_decode_this,
|
|||
*decoded_bytes = decoded_byte_index;
|
||||
return base64_decoded; //Returns base-64 decoded data with trailing null terminator.
|
||||
#else // OPENSSL
|
||||
#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library.
|
||||
//#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library.
|
||||
return NULL;
|
||||
#endif // OPENSSL
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
typedef struct OpenAPI_binary_s {
|
||||
uint8_t* data;
|
||||
unsigned int len;
|
||||
char* data;
|
||||
int len;
|
||||
} OpenAPI_binary_t;
|
||||
|
||||
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len);
|
||||
|
|
|
|||
|
|
@ -236,12 +236,7 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}
|
|||
{{/isBoolean}}
|
||||
{{/required}}
|
||||
{{^required}}
|
||||
{{#isBoolean}}
|
||||
if ({{{classname}}}->{{{name}}} >= 0) {
|
||||
{{/isBoolean}}
|
||||
{{^isBoolean}}
|
||||
if ({{{classname}}}->{{{name}}}) {
|
||||
{{/isBoolean}}
|
||||
if ({{{classname}}}->{{{name}}}) {
|
||||
{{/required}}
|
||||
{{^isContainer}}
|
||||
{{#isPrimitiveType}}
|
||||
|
|
@ -522,7 +517,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}
|
|||
}
|
||||
{{/isByteArray}}
|
||||
{{#isBinary}}
|
||||
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(struct binary_t));
|
||||
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(OpenAPI_binary_t));
|
||||
{{^required}}if ({{{name}}}) { {{/required}}
|
||||
if (!cJSON_IsString({{{name}}})) {
|
||||
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
|
||||
|
|
@ -789,5 +784,39 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}
|
|||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_{{classname}}_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_{{classname}}_free(dst);
|
||||
dst = OpenAPI_{{classname}}_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{/model}}{{/models}}
|
||||
|
|
|
|||
|
|
@ -171,6 +171,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create(
|
|||
void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}});
|
||||
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON);
|
||||
cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}});
|
||||
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src);
|
||||
{{/isEnum}}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue