Commit ab87fabe authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Apply Google style format for all the rest files

parent fad9103e

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

This diff is collapsed.
...@@ -5,17 +5,17 @@ ...@@ -5,17 +5,17 @@
#ifndef ASN_TYPE_ANY_H #ifndef ASN_TYPE_ANY_H
#define ASN_TYPE_ANY_H #define ASN_TYPE_ANY_H
#include <OCTET_STRING.h> /* Implemented via OCTET STRING type */ #include <OCTET_STRING.h> /* Implemented via OCTET STRING type */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct ANY { typedef struct ANY {
uint8_t *buf; /* BER-encoded ANY contents */ uint8_t* buf; /* BER-encoded ANY contents */
int size; /* Size of the above buffer */ int size; /* Size of the above buffer */
asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} ANY_t; } ANY_t;
extern asn_TYPE_descriptor_t asn_DEF_ANY; extern asn_TYPE_descriptor_t asn_DEF_ANY;
...@@ -32,34 +32,34 @@ per_type_encoder_f ANY_encode_uper; ...@@ -32,34 +32,34 @@ per_type_encoder_f ANY_encode_uper;
per_type_decoder_f ANY_decode_aper; per_type_decoder_f ANY_decode_aper;
per_type_encoder_f ANY_encode_aper; per_type_encoder_f ANY_encode_aper;
#define ANY_free OCTET_STRING_free #define ANY_free OCTET_STRING_free
#define ANY_print OCTET_STRING_print #define ANY_print OCTET_STRING_print
#define ANY_compare OCTET_STRING_compare #define ANY_compare OCTET_STRING_compare
#define ANY_constraint asn_generic_no_constraint #define ANY_constraint asn_generic_no_constraint
#define ANY_decode_ber OCTET_STRING_decode_ber #define ANY_decode_ber OCTET_STRING_decode_ber
#define ANY_encode_der OCTET_STRING_encode_der #define ANY_encode_der OCTET_STRING_encode_der
#define ANY_decode_xer OCTET_STRING_decode_xer_hex #define ANY_decode_xer OCTET_STRING_decode_xer_hex
/****************************** /******************************
* Handy conversion routines. * * Handy conversion routines. *
******************************/ ******************************/
/* Convert another ASN.1 type into the ANY. This implies DER encoding. */ /* Convert another ASN.1 type into the ANY. This implies DER encoding. */
int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr); int ANY_fromType(ANY_t*, asn_TYPE_descriptor_t* td, void* struct_ptr);
int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr); int ANY_fromType_aper(ANY_t* st, asn_TYPE_descriptor_t* td, void* sptr);
ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr); ANY_t* ANY_new_fromType(asn_TYPE_descriptor_t* td, void* struct_ptr);
ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr); ANY_t* ANY_new_fromType_aper(asn_TYPE_descriptor_t* td, void* sptr);
/* Convert the contents of the ANY type into the specified type. */ /* Convert the contents of the ANY type into the specified type. */
int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); int ANY_to_type(ANY_t*, asn_TYPE_descriptor_t* td, void** struct_ptr);
int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr); int ANY_to_type_aper(ANY_t*, asn_TYPE_descriptor_t* td, void** struct_ptr);
#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size)) #define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \ #define ANY_new_fromBuf(buf, size) \
&asn_DEF_ANY, (buf), (size)) OCTET_STRING_new_fromBuf(&asn_DEF_ANY, (buf), (size))
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* ASN_TYPE_ANY_H */ #endif /* ASN_TYPE_ANY_H */
This diff is collapsed.
...@@ -2,29 +2,29 @@ ...@@ -2,29 +2,29 @@
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved. * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license. * Redistribution and modifications are permitted subject to BSD license.
*/ */
#ifndef _BIT_STRING_H_ #ifndef _BIT_STRING_H_
#define _BIT_STRING_H_ #define _BIT_STRING_H_
#include <OCTET_STRING.h> /* Some help from OCTET STRING */ #include <OCTET_STRING.h> /* Some help from OCTET STRING */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
typedef struct BIT_STRING_s { typedef struct BIT_STRING_s {
uint8_t *buf; /* BIT STRING body */ uint8_t* buf; /* BIT STRING body */
size_t size; /* Size of the above buffer */ size_t size; /* Size of the above buffer */
int bits_unused;/* Unused trailing bits in the last octet (0..7) */ int bits_unused; /* Unused trailing bits in the last octet (0..7) */
asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */ asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
} BIT_STRING_t; } BIT_STRING_t;
extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING; extern asn_TYPE_descriptor_t asn_DEF_BIT_STRING;
extern asn_TYPE_operation_t asn_OP_BIT_STRING; extern asn_TYPE_operation_t asn_OP_BIT_STRING;
extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs; extern asn_OCTET_STRING_specifics_t asn_SPC_BIT_STRING_specs;
asn_struct_print_f BIT_STRING_print; /* Human-readable output */ asn_struct_print_f BIT_STRING_print; /* Human-readable output */
asn_struct_compare_f BIT_STRING_compare; asn_struct_compare_f BIT_STRING_compare;
asn_constr_check_f BIT_STRING_constraint; asn_constr_check_f BIT_STRING_constraint;
xer_type_encoder_f BIT_STRING_encode_xer; xer_type_encoder_f BIT_STRING_encode_xer;
...@@ -32,17 +32,17 @@ oer_type_decoder_f BIT_STRING_decode_oer; ...@@ -32,17 +32,17 @@ oer_type_decoder_f BIT_STRING_decode_oer;
oer_type_encoder_f BIT_STRING_encode_oer; oer_type_encoder_f BIT_STRING_encode_oer;
per_type_decoder_f BIT_STRING_decode_uper; per_type_decoder_f BIT_STRING_decode_uper;
per_type_encoder_f BIT_STRING_encode_uper; per_type_encoder_f BIT_STRING_encode_uper;
asn_random_fill_f BIT_STRING_random_fill; asn_random_fill_f BIT_STRING_random_fill;
#define BIT_STRING_free OCTET_STRING_free #define BIT_STRING_free OCTET_STRING_free
#define BIT_STRING_decode_ber OCTET_STRING_decode_ber #define BIT_STRING_decode_ber OCTET_STRING_decode_ber
#define BIT_STRING_encode_der OCTET_STRING_encode_der #define BIT_STRING_encode_der OCTET_STRING_encode_der
#define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary #define BIT_STRING_decode_xer OCTET_STRING_decode_xer_binary
#define BIT_STRING_decode_aper OCTET_STRING_decode_aper #define BIT_STRING_decode_aper OCTET_STRING_decode_aper
#define BIT_STRING_encode_aper OCTET_STRING_encode_aper #define BIT_STRING_encode_aper OCTET_STRING_encode_aper
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _BIT_STRING_H_ */ #endif /* _BIT_STRING_H_ */
...@@ -9,166 +9,164 @@ ...@@ -9,166 +9,164 @@
#include <BIT_STRING.h> #include <BIT_STRING.h>
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t BIT_STRING_decode_oer(
BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, const asn_codec_ctx_t* opt_codec_ctx, const asn_TYPE_descriptor_t* td,
const asn_TYPE_descriptor_t *td, const asn_oer_constraints_t* constraints, void** sptr, const void* ptr,
const asn_oer_constraints_t *constraints, void **sptr, size_t size) {
const void *ptr, size_t size) { BIT_STRING_t* st = (BIT_STRING_t*) *sptr;
BIT_STRING_t *st = (BIT_STRING_t *)*sptr; const asn_oer_constraints_t* cts =
const asn_oer_constraints_t *cts = constraints ? constraints : td->encoding_constraints.oer_constraints;
constraints ? constraints : td->encoding_constraints.oer_constraints; ssize_t ct_size = cts ? cts->size : -1;
ssize_t ct_size = cts ? cts->size : -1; asn_dec_rval_t rval = {RC_OK, 0};
asn_dec_rval_t rval = {RC_OK, 0}; size_t expected_length = 0;
size_t expected_length = 0;
(void) opt_codec_ctx;
(void)opt_codec_ctx;
if (!st) {
if(!st) { st = (BIT_STRING_t*) (*sptr = CALLOC(1, sizeof(*st)));
st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st))); if (!st) ASN__DECODE_FAILED;
if(!st) ASN__DECODE_FAILED; }
if (ct_size >= 0) {
expected_length = (ct_size + 7) >> 3;
st->bits_unused = (8 - (ct_size & 7)) & 7;
} else {
/*
* X.696 (08/2015) #13.3.1
* Encode length determinant as _number of octets_, but only
* if upper bound is not equal to lower bound.
*/
ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
if (len_len > 0) {
ptr = (const char*) ptr + len_len;
size -= len_len;
} else if (len_len == 0) {
ASN__DECODE_STARVED;
} else if (len_len < 0) {
ASN__DECODE_FAILED;
} }
if(ct_size >= 0) { if (expected_length < 1) {
expected_length = (ct_size + 7) >> 3; ASN__DECODE_FAILED;
st->bits_unused = (8 - (ct_size & 7)) & 7; } else if (expected_length > size) {
} else { ASN__DECODE_STARVED;
/*
* X.696 (08/2015) #13.3.1
* Encode length determinant as _number of octets_, but only
* if upper bound is not equal to lower bound.
*/
ssize_t len_len = oer_fetch_length(ptr, size, &expected_length);
if(len_len > 0) {
ptr = (const char *)ptr + len_len;
size -= len_len;
} else if(len_len == 0) {
ASN__DECODE_STARVED;
} else if(len_len < 0) {
ASN__DECODE_FAILED;
}
if(expected_length < 1) {
ASN__DECODE_FAILED;
} else if(expected_length > size) {
ASN__DECODE_STARVED;
}
st->bits_unused = ((const uint8_t *)ptr)[0];
if(st->bits_unused & ~7) {
ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name);
ASN__DECODE_FAILED;
}
ptr = (const char *)ptr + 1;
size--;
expected_length--;
rval.consumed = len_len + 1;
} }
if(size < expected_length) { st->bits_unused = ((const uint8_t*) ptr)[0];
ASN__DECODE_STARVED; if (st->bits_unused & ~7) {
ASN_DEBUG("%s: unused bits outside of 0..7 range", td->name);
ASN__DECODE_FAILED;
}
ptr = (const char*) ptr + 1;
size--;
expected_length--;
rval.consumed = len_len + 1;
}
if (size < expected_length) {
ASN__DECODE_STARVED;
} else {
uint8_t* buf = MALLOC(expected_length + 1);
if (buf == NULL) {
ASN__DECODE_FAILED;
} else { } else {
uint8_t *buf = MALLOC(expected_length + 1); memcpy(buf, ptr, expected_length);
if(buf == NULL) { buf[expected_length] = '\0';
ASN__DECODE_FAILED; }
} else { FREEMEM(st->buf);
memcpy(buf, ptr, expected_length); st->buf = buf;
buf[expected_length] = '\0'; st->size = expected_length;
} if (expected_length > 0) {
FREEMEM(st->buf); buf[expected_length - 1] &= (0xff << st->bits_unused);
st->buf = buf;
st->size = expected_length;
if(expected_length > 0) {
buf[expected_length - 1] &= (0xff << st->bits_unused);
}
rval.consumed += expected_length;
return rval;
} }
rval.consumed += expected_length;
return rval;
}
} }
/* /*
* Encode as Canonical OER. * Encode as Canonical OER.
*/ */
asn_enc_rval_t asn_enc_rval_t BIT_STRING_encode_oer(
BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td, const asn_TYPE_descriptor_t* td, const asn_oer_constraints_t* constraints,
const asn_oer_constraints_t *constraints, const void* sptr, asn_app_consume_bytes_f* cb, void* app_key) {
const void *sptr, asn_app_consume_bytes_f *cb, const BIT_STRING_t* st = (const BIT_STRING_t*) sptr;
void *app_key) { asn_enc_rval_t erval = {0, 0, 0};
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; const asn_oer_constraints_t* cts =
asn_enc_rval_t erval = {0, 0, 0}; constraints ? constraints : td->encoding_constraints.oer_constraints;
const asn_oer_constraints_t *cts = ssize_t ct_size = cts ? cts->size : -1;
constraints ? constraints : td->encoding_constraints.oer_constraints; size_t trailing_zeros = 0;
ssize_t ct_size = cts ? cts->size : -1; int fix_last_byte = 0;
size_t trailing_zeros = 0;
int fix_last_byte = 0; if (!st) ASN__ENCODE_FAILED;
if(!st) ASN__ENCODE_FAILED; if (st->bits_unused & ~7) {
ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range", st->bits_unused);
if(st->bits_unused & ~7) { ASN__ENCODE_FAILED;
ASN_DEBUG("BIT STRING unused bits %d out of 0..7 range", }
st->bits_unused); if (st->bits_unused && !(st->size && st->buf)) {
ASN__ENCODE_FAILED; ASN_DEBUG(
} "BIT STRING %s size 0 can't support unused bits %d", td->name,
if(st->bits_unused && !(st->size && st->buf)) { st->bits_unused);
ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name, ASN__ENCODE_FAILED;
st->bits_unused); }
ASN__ENCODE_FAILED;
if (ct_size >= 0) {
size_t ct_bytes = (ct_size + 7) >> 3;
if (st->size > ct_bytes) {
ASN_DEBUG(
"More bits in BIT STRING %s (%" ASN_PRI_SSIZE
") than constrained %" ASN_PRI_SSIZE "",
td->name, 8 * st->size - st->bits_unused, ct_size);
ASN__ENCODE_FAILED;
} }
trailing_zeros = ct_bytes - st->size; /* Allow larger constraint */
if(ct_size >= 0) { } else {
size_t ct_bytes = (ct_size + 7) >> 3; uint8_t ub = st->bits_unused & 7;
if(st->size > ct_bytes) { ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key);
ASN_DEBUG("More bits in BIT STRING %s (%" ASN_PRI_SSIZE ") than constrained %" ASN_PRI_SSIZE "", if (len_len < 0) ASN__ENCODE_FAILED;
td->name, 8 * st->size - st->bits_unused, ct_size); if (cb(&ub, 1, app_key) < 0) {
ASN__ENCODE_FAILED; ASN__ENCODE_FAILED;
}
trailing_zeros = ct_bytes - st->size; /* Allow larger constraint */
} else {
uint8_t ub = st->bits_unused & 7;
ssize_t len_len = oer_serialize_length(1 + st->size, cb, app_key);
if(len_len < 0) ASN__ENCODE_FAILED;
if(cb(&ub, 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
erval.encoded += len_len + 1;
} }
erval.encoded += len_len + 1;
}
if(st->bits_unused) { if (st->bits_unused) {
if(st->buf[st->size - 1] & (0xff << st->bits_unused)) { if (st->buf[st->size - 1] & (0xff << st->bits_unused)) {
fix_last_byte = 1; fix_last_byte = 1;
}
} }
}
if(cb(st->buf, st->size - fix_last_byte, app_key) < 0) { if (cb(st->buf, st->size - fix_last_byte, app_key) < 0) {
ASN__ENCODE_FAILED; ASN__ENCODE_FAILED;
} }
if(fix_last_byte) { if (fix_last_byte) {
uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused); uint8_t b = st->buf[st->size - 1] & (0xff << st->bits_unused);
if(cb(&b, 1, app_key) < 0) { if (cb(&b, 1, app_key) < 0) {
ASN__ENCODE_FAILED; ASN__ENCODE_FAILED;
}
} }
}
erval.encoded += st->size;
erval.encoded += st->size;
if(trailing_zeros) {
static uint8_t zeros[16]; if (trailing_zeros) {
while(trailing_zeros > 0) { static uint8_t zeros[16];
int ret; while (trailing_zeros > 0) {
if(trailing_zeros < sizeof(zeros)) { int ret;
ret = cb(zeros, trailing_zeros, app_key); if (trailing_zeros < sizeof(zeros)) {
erval.encoded += trailing_zeros; ret = cb(zeros, trailing_zeros, app_key);
} else { erval.encoded += trailing_zeros;
ret = cb(zeros, sizeof(zeros), app_key); } else {
erval.encoded += sizeof(zeros); ret = cb(zeros, sizeof(zeros), app_key);
} erval.encoded += sizeof(zeros);
if(ret < 0) ASN__ENCODE_FAILED; }
} if (ret < 0) ASN__ENCODE_FAILED;
} }
}
return erval; return erval;
} }
#endif /* ASN_DISABLE_OER_SUPPORT */
#endif /* ASN_DISABLE_OER_SUPPORT */
This diff is collapsed.
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved. * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license. * Redistribution and modifications are permitted subject to BSD license.
*/ */
#ifndef _INTEGER_H_ #ifndef _INTEGER_H_
#define _INTEGER_H_ #define _INTEGER_H_
#include <asn_application.h> #include <asn_application.h>
#include <asn_codecs_prim.h> #include <asn_codecs_prim.h>
...@@ -19,25 +19,25 @@ extern asn_TYPE_operation_t asn_OP_INTEGER; ...@@ -19,25 +19,25 @@ extern asn_TYPE_operation_t asn_OP_INTEGER;
/* Map with <tag> to integer value association */ /* Map with <tag> to integer value association */
typedef struct asn_INTEGER_enum_map_s { typedef struct asn_INTEGER_enum_map_s {
long nat_value; /* associated native integer value */ long nat_value; /* associated native integer value */
size_t enum_len; /* strlen("tag") */ size_t enum_len; /* strlen("tag") */
const char *enum_name; /* "tag" */ const char* enum_name; /* "tag" */
} asn_INTEGER_enum_map_t; } asn_INTEGER_enum_map_t;
/* This type describes an enumeration for INTEGER and ENUMERATED types */ /* This type describes an enumeration for INTEGER and ENUMERATED types */
typedef struct asn_INTEGER_specifics_s { typedef struct asn_INTEGER_specifics_s {
const asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */ const asn_INTEGER_enum_map_t* value2enum; /* N -> "tag"; sorted by N */
const unsigned int *enum2value; /* "tag" => N; sorted by tag */ const unsigned int* enum2value; /* "tag" => N; sorted by tag */
int map_count; /* Elements in either map */ int map_count; /* Elements in either map */
int extension; /* This map is extensible */ int extension; /* This map is extensible */
int strict_enumeration; /* Enumeration set is fixed */ int strict_enumeration; /* Enumeration set is fixed */
int field_width; /* Size of native integer */ int field_width; /* Size of native integer */
int field_unsigned; /* Signed=0, unsigned=1 */ int field_unsigned; /* Signed=0, unsigned=1 */
} asn_INTEGER_specifics_t; } asn_INTEGER_specifics_t;
#define INTEGER_free ASN__PRIMITIVE_TYPE_free #define INTEGER_free ASN__PRIMITIVE_TYPE_free
#define INTEGER_decode_ber ber_decode_primitive #define INTEGER_decode_ber ber_decode_primitive
#define INTEGER_constraint asn_generic_no_constraint #define INTEGER_constraint asn_generic_no_constraint
asn_struct_print_f INTEGER_print; asn_struct_print_f INTEGER_print;
asn_struct_compare_f INTEGER_compare; asn_struct_compare_f INTEGER_compare;
der_type_encoder_f INTEGER_encode_der; der_type_encoder_f INTEGER_encode_der;
...@@ -49,7 +49,7 @@ per_type_decoder_f INTEGER_decode_uper; ...@@ -49,7 +49,7 @@ per_type_decoder_f INTEGER_decode_uper;
per_type_encoder_f INTEGER_encode_uper; per_type_encoder_f INTEGER_encode_uper;
per_type_decoder_f INTEGER_decode_aper; per_type_decoder_f INTEGER_decode_aper;
per_type_encoder_f INTEGER_encode_aper; per_type_encoder_f INTEGER_encode_aper;
asn_random_fill_f INTEGER_random_fill; asn_random_fill_f INTEGER_random_fill;
/*********************************** /***********************************
* Some handy conversion routines. * * Some handy conversion routines. *
...@@ -63,46 +63,47 @@ asn_random_fill_f INTEGER_random_fill; ...@@ -63,46 +63,47 @@ asn_random_fill_f INTEGER_random_fill;
* -1/ERANGE: Value encoded is out of range for long representation * -1/ERANGE: Value encoded is out of range for long representation
* -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()). * -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()).
*/ */
int asn_INTEGER2imax(const INTEGER_t *i, intmax_t *l); int asn_INTEGER2imax(const INTEGER_t* i, intmax_t* l);
int asn_INTEGER2umax(const INTEGER_t *i, uintmax_t *l); int asn_INTEGER2umax(const INTEGER_t* i, uintmax_t* l);
int asn_imax2INTEGER(INTEGER_t *i, intmax_t l); int asn_imax2INTEGER(INTEGER_t* i, intmax_t l);
int asn_umax2INTEGER(INTEGER_t *i, uintmax_t l); int asn_umax2INTEGER(INTEGER_t* i, uintmax_t l);
/* /*
* Size-specific conversion helpers. * Size-specific conversion helpers.
*/ */
int asn_INTEGER2long(const INTEGER_t *i, long *l); int asn_INTEGER2long(const INTEGER_t* i, long* l);
int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l); int asn_INTEGER2ulong(const INTEGER_t* i, unsigned long* l);
int asn_long2INTEGER(INTEGER_t *i, long l); int asn_long2INTEGER(INTEGER_t* i, long l);
int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l); int asn_ulong2INTEGER(INTEGER_t* i, unsigned long l);
int asn_int642INTEGER(INTEGER_t *i, int64_t l); int asn_int642INTEGER(INTEGER_t* i, int64_t l);
int asn_uint642INTEGER(INTEGER_t *i, uint64_t l); int asn_uint642INTEGER(INTEGER_t* i, uint64_t l);
/* A version of strtol/strtoimax(3) with nicer error reporting. */ /* A version of strtol/strtoimax(3) with nicer error reporting. */
enum asn_strtox_result_e { enum asn_strtox_result_e {
ASN_STRTOX_ERROR_RANGE = -3, /* Input outside of supported numeric range */ ASN_STRTOX_ERROR_RANGE = -3, /* Input outside of supported numeric range */
ASN_STRTOX_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */ ASN_STRTOX_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */
ASN_STRTOX_EXPECT_MORE = -1, /* More data expected (e.g. "+") */ ASN_STRTOX_EXPECT_MORE = -1, /* More data expected (e.g. "+") */
ASN_STRTOX_OK = 0, /* Conversion succeded, number ends at (*end) */ ASN_STRTOX_OK = 0, /* Conversion succeded, number ends at (*end) */
ASN_STRTOX_EXTRA_DATA = 1 /* Conversion succeded, but the string has extra stuff */ ASN_STRTOX_EXTRA_DATA =
1 /* Conversion succeded, but the string has extra stuff */
}; };
enum asn_strtox_result_e asn_strtol_lim(const char *str, const char **end, enum asn_strtox_result_e asn_strtol_lim(
long *l); const char* str, const char** end, long* l);
enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end, enum asn_strtox_result_e asn_strtoul_lim(
unsigned long *l); const char* str, const char** end, unsigned long* l);
enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end, enum asn_strtox_result_e asn_strtoimax_lim(
intmax_t *l); const char* str, const char** end, intmax_t* l);
enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end, enum asn_strtox_result_e asn_strtoumax_lim(
uintmax_t *l); const char* str, const char** end, uintmax_t* l);
/* /*
* Convert the integer value into the corresponding enumeration map entry. * Convert the integer value into the corresponding enumeration map entry.
*/ */
const asn_INTEGER_enum_map_t *INTEGER_map_value2enum( const asn_INTEGER_enum_map_t* INTEGER_map_value2enum(
const asn_INTEGER_specifics_t *specs, long value); const asn_INTEGER_specifics_t* specs, long value);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _INTEGER_H_ */ #endif /* _INTEGER_H_ */
...@@ -9,171 +9,169 @@ ...@@ -9,171 +9,169 @@
#include <INTEGER.h> #include <INTEGER.h>
#include <errno.h> #include <errno.h>
asn_dec_rval_t asn_dec_rval_t INTEGER_decode_oer(
INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, const asn_codec_ctx_t* opt_codec_ctx, const asn_TYPE_descriptor_t* td,
const asn_TYPE_descriptor_t *td, const asn_oer_constraints_t* constraints, void** sptr, const void* ptr,
const asn_oer_constraints_t *constraints, void **sptr, size_t size) {
const void *ptr, size_t size) { const asn_INTEGER_specifics_t* specs =
const asn_INTEGER_specifics_t *specs = (const asn_INTEGER_specifics_t*) td->specifics;
(const asn_INTEGER_specifics_t *)td->specifics; asn_dec_rval_t rval = {RC_OK, 0};
asn_dec_rval_t rval = {RC_OK, 0}; INTEGER_t* st = (INTEGER_t*) *sptr;
INTEGER_t *st = (INTEGER_t *)*sptr; struct asn_oer_constraint_number_s ct = {0, 0};
struct asn_oer_constraint_number_s ct = {0, 0}; size_t req_bytes;
size_t req_bytes;
(void) opt_codec_ctx;
(void)opt_codec_ctx; (void) specs;
(void)specs;
if (!st) {
if(!st) { st = (INTEGER_t*) (*sptr = CALLOC(1, sizeof(*st)));
st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st))); if (!st) ASN__DECODE_FAILED;
if(!st) ASN__DECODE_FAILED; }
FREEMEM(st->buf);
st->buf = 0;
st->size = 0;
if (!constraints) constraints = td->encoding_constraints.oer_constraints;
if (constraints) ct = constraints->value;
if (ct.width) {
req_bytes = ct.width;
} else {
/* No lower bound and no upper bound, effectively */
ssize_t consumed = oer_fetch_length(ptr, size, &req_bytes);
if (consumed == 0) {
ASN__DECODE_STARVED;
} else if (consumed == -1) {
ASN__DECODE_FAILED;
} }
rval.consumed += consumed;
FREEMEM(st->buf); ptr = (const char*) ptr + consumed;
st->buf = 0; size -= consumed;
st->size = 0; }
if(!constraints) constraints = td->encoding_constraints.oer_constraints; if (req_bytes > size) {
if(constraints) ct = constraints->value; ASN__DECODE_STARVED;
}
if(ct.width) {
req_bytes = ct.width; if (ct.positive) {
} else { /* X.969 08/2015 10.2(a) */
/* No lower bound and no upper bound, effectively */ unsigned msb; /* Most significant bit */
size_t useful_size;
ssize_t consumed = oer_fetch_length(ptr, size, &req_bytes);
if(consumed == 0) { /* Check most significant bit */
ASN__DECODE_STARVED; msb = *(const uint8_t*) ptr >> 7; /* yields 0 or 1 */
} else if(consumed == -1) { useful_size = msb + req_bytes;
ASN__DECODE_FAILED; st->buf = (uint8_t*) MALLOC(useful_size + 1);
} if (!st->buf) {
rval.consumed += consumed; ASN__DECODE_FAILED;
ptr = (const char *)ptr + consumed;
size -= consumed;
} }
if(req_bytes > size) { /*
ASN__DECODE_STARVED; * Record a large unsigned in a way not to confuse it
* with signed value.
*/
st->buf[0] = '\0';
memcpy(st->buf + msb, ptr, req_bytes);
st->buf[useful_size] = '\0'; /* Just in case, 0-terminate */
st->size = useful_size;
rval.consumed += req_bytes;
return rval;
} else {
/* X.969 08/2015 10.2(b) */
st->buf = (uint8_t*) MALLOC(req_bytes + 1);
if (!st->buf) {
ASN__DECODE_FAILED;
} }
if(ct.positive) { memcpy(st->buf, ptr, req_bytes);
/* X.969 08/2015 10.2(a) */ st->buf[req_bytes] = '\0'; /* Just in case, 0-terminate */
unsigned msb; /* Most significant bit */ st->size = req_bytes;
size_t useful_size;
rval.consumed += req_bytes;
/* Check most significant bit */ return rval;
msb = *(const uint8_t *)ptr >> 7; /* yields 0 or 1 */ }
useful_size = msb + req_bytes;
st->buf = (uint8_t *)MALLOC(useful_size + 1);
if(!st->buf) {
ASN__DECODE_FAILED;
}
/*
* Record a large unsigned in a way not to confuse it
* with signed value.
*/
st->buf[0] = '\0';
memcpy(st->buf + msb, ptr, req_bytes);
st->buf[useful_size] = '\0'; /* Just in case, 0-terminate */
st->size = useful_size;
rval.consumed += req_bytes;
return rval;
} else {
/* X.969 08/2015 10.2(b) */
st->buf = (uint8_t *)MALLOC(req_bytes + 1);
if(!st->buf) {
ASN__DECODE_FAILED;
}
memcpy(st->buf, ptr, req_bytes);
st->buf[req_bytes] = '\0'; /* Just in case, 0-terminate */
st->size = req_bytes;
rval.consumed += req_bytes;
return rval;
}
} }
/* /*
* Encode as Canonical OER. * Encode as Canonical OER.
*/ */
asn_enc_rval_t asn_enc_rval_t INTEGER_encode_oer(
INTEGER_encode_oer(const asn_TYPE_descriptor_t *td, const asn_TYPE_descriptor_t* td, const asn_oer_constraints_t* constraints,
const asn_oer_constraints_t *constraints, const void *sptr, const void* sptr, asn_app_consume_bytes_f* cb, void* app_key) {
asn_app_consume_bytes_f *cb, void *app_key) { const INTEGER_t* st = sptr;
const INTEGER_t *st = sptr; asn_enc_rval_t er;
asn_enc_rval_t er; struct asn_oer_constraint_number_s ct = {0, 0};
struct asn_oer_constraint_number_s ct = {0, 0}; const uint8_t* buf;
const uint8_t *buf; const uint8_t* end;
const uint8_t *end; size_t useful_bytes;
size_t useful_bytes; size_t req_bytes = 0;
size_t req_bytes = 0; int sign = 0;
int sign = 0;
if (!st || st->size == 0) ASN__ENCODE_FAILED;
if(!st || st->size == 0) ASN__ENCODE_FAILED;
if (!constraints) constraints = td->encoding_constraints.oer_constraints;
if(!constraints) constraints = td->encoding_constraints.oer_constraints; if (constraints) ct = constraints->value;
if(constraints) ct = constraints->value;
er.encoded = 0;
er.encoded = 0;
buf = st->buf;
buf = st->buf; end = buf + st->size;
end = buf + st->size;
sign = (buf && buf < end) ? buf[0] & 0x80 : 0;
sign = (buf && buf < end) ? buf[0] & 0x80 : 0;
/* Ignore 9 leading zeroes or ones */
/* Ignore 9 leading zeroes or ones */ if (ct.positive) {
if(ct.positive) { if (sign) {
if(sign) { /* The value given is a signed value. Can't proceed. */
/* The value given is a signed value. Can't proceed. */ ASN__ENCODE_FAILED;
ASN__ENCODE_FAILED;
}
/* Remove leading zeros. */
for(; buf + 1 < end; buf++) {
if(buf[0] != 0x0) break;
}
} else {
for(; buf + 1 < end; buf++) {
if(buf[0] == 0x0 && (buf[1] & 0x80) == 0) {
continue;
} else if(buf[0] == 0xff && (buf[1] & 0x80) != 0) {
continue;
}
break;
}
} }
/* Remove leading zeros. */
useful_bytes = end - buf; for (; buf + 1 < end; buf++) {
if(ct.width) { if (buf[0] != 0x0) break;
req_bytes = ct.width;
} else {
ssize_t r = oer_serialize_length(useful_bytes, cb, app_key);
if(r < 0) {
ASN__ENCODE_FAILED;
}
er.encoded += r;
req_bytes = useful_bytes;
} }
} else {
if(req_bytes < useful_bytes) { for (; buf + 1 < end; buf++) {
ASN__ENCODE_FAILED; if (buf[0] == 0x0 && (buf[1] & 0x80) == 0) {
continue;
} else if (buf[0] == 0xff && (buf[1] & 0x80) != 0) {
continue;
}
break;
}
}
useful_bytes = end - buf;
if (ct.width) {
req_bytes = ct.width;
} else {
ssize_t r = oer_serialize_length(useful_bytes, cb, app_key);
if (r < 0) {
ASN__ENCODE_FAILED;
} }
er.encoded += r;
req_bytes = useful_bytes;
}
er.encoded += req_bytes; if (req_bytes < useful_bytes) {
ASN__ENCODE_FAILED;
}
for(; req_bytes > useful_bytes; req_bytes--) { er.encoded += req_bytes;
if(cb(sign?"\xff":"\0", 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
}
if(cb(buf, useful_bytes, app_key) < 0) { for (; req_bytes > useful_bytes; req_bytes--) {
ASN__ENCODE_FAILED; if (cb(sign ? "\xff" : "\0", 1, app_key) < 0) {
ASN__ENCODE_FAILED;
} }
}
if (cb(buf, useful_bytes, app_key) < 0) {
ASN__ENCODE_FAILED;
}
ASN__ENCODED_OK(er); ASN__ENCODED_OK(er);
} }
#endif /* ASN_DISABLE_OER_SUPPORT */ #endif /* ASN_DISABLE_OER_SUPPORT */
This diff is collapsed.
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* will do). * will do).
* This type may be used when integer range is limited by subtype constraints. * This type may be used when integer range is limited by subtype constraints.
*/ */
#ifndef _NativeEnumerated_H_ #ifndef _NativeEnumerated_H_
#define _NativeEnumerated_H_ #define _NativeEnumerated_H_
#include <NativeInteger.h> #include <NativeInteger.h>
...@@ -29,9 +29,9 @@ per_type_encoder_f NativeEnumerated_encode_uper; ...@@ -29,9 +29,9 @@ per_type_encoder_f NativeEnumerated_encode_uper;
per_type_decoder_f NativeEnumerated_decode_aper; per_type_decoder_f NativeEnumerated_decode_aper;
per_type_encoder_f NativeEnumerated_encode_aper; per_type_encoder_f NativeEnumerated_encode_aper;
#define NativeEnumerated_free NativeInteger_free #define NativeEnumerated_free NativeInteger_free
#define NativeEnumerated_print NativeInteger_print #define NativeEnumerated_print NativeInteger_print
#define NativeEnumerated_compare NativeInteger_compare #define NativeEnumerated_compare NativeInteger_compare
#define NativeEnumerated_random_fill NativeInteger_random_fill #define NativeEnumerated_random_fill NativeInteger_random_fill
#define NativeEnumerated_constraint asn_generic_no_constraint #define NativeEnumerated_constraint asn_generic_no_constraint
#define NativeEnumerated_decode_ber NativeInteger_decode_ber #define NativeEnumerated_decode_ber NativeInteger_decode_ber
...@@ -42,4 +42,4 @@ per_type_encoder_f NativeEnumerated_encode_aper; ...@@ -42,4 +42,4 @@ per_type_encoder_f NativeEnumerated_encode_aper;
} }
#endif #endif
#endif /* _NativeEnumerated_H_ */ #endif /* _NativeEnumerated_H_ */
...@@ -9,141 +9,138 @@ ...@@ -9,141 +9,138 @@
#include <NativeEnumerated.h> #include <NativeEnumerated.h>
#include <errno.h> #include <errno.h>
static long static long asn__nativeenumerated_convert(
asn__nativeenumerated_convert(const uint8_t *b, const uint8_t *end) { const uint8_t* b, const uint8_t* end) {
unsigned long value; unsigned long value;
/* Perform the sign initialization */ /* Perform the sign initialization */
/* Actually value = -(*b >> 7); gains nothing, yet unreadable! */ /* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
if((*b >> 7)) { if ((*b >> 7)) {
value = (unsigned long)(-1); value = (unsigned long) (-1);
} else { } else {
value = 0; value = 0;
} }
/* Conversion engine */ /* Conversion engine */
for(; b < end; b++) { for (; b < end; b++) {
value = (value << 8) | *b; value = (value << 8) | *b;
} }
return value; return value;
} }
asn_dec_rval_t asn_dec_rval_t NativeEnumerated_decode_oer(
NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx, const asn_codec_ctx_t* opt_codec_ctx, const asn_TYPE_descriptor_t* td,
const asn_TYPE_descriptor_t *td, const asn_oer_constraints_t* constraints, void** nint_ptr, const void* ptr,
const asn_oer_constraints_t *constraints, size_t size) {
void **nint_ptr, const void *ptr, size_t size) { asn_dec_rval_t rval = {RC_OK, 0};
asn_dec_rval_t rval = {RC_OK, 0}; long* native = (long*) *nint_ptr;
long *native = (long *)*nint_ptr; const uint8_t* b = ptr;
const uint8_t *b = ptr;
(void) opt_codec_ctx;
(void)opt_codec_ctx; (void) constraints;
(void)constraints;
if (size < 1) {
if(size < 1) { ASN__DECODE_STARVED;
ASN__DECODE_STARVED; }
if ((*b & 0x80) == 0) {
/*
* X.696 (08/2015) #11.2 Short form for Enumerated.
*/
if (!native) {
native = (long*) (*nint_ptr = CALLOC(1, sizeof(*native)));
if (!native) ASN__DECODE_FAILED;
} }
if((*b & 0x80) == 0) { *native = *b;
/* rval.consumed = 1;
* X.696 (08/2015) #11.2 Short form for Enumerated. } else {
*/ /*
if(!native) { * X.696 (08/2015) #11.4 Long form for Enumerated.
native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); */
if(!native) ASN__DECODE_FAILED; size_t length = *b & 0x7f;
} const uint8_t* bend;
long value;
*native = *b;
rval.consumed = 1; if (length < 1 || length > sizeof(*native)) {
} else { ASN__DECODE_FAILED;
/* }
* X.696 (08/2015) #11.4 Long form for Enumerated. if ((1 + length) > size) {
*/ ASN__DECODE_STARVED;
size_t length = *b & 0x7f; }
const uint8_t *bend; b++;
long value; bend = b + length;
if(length < 1 || length > sizeof(*native)) { value = asn__nativeenumerated_convert(b, bend);
ASN__DECODE_FAILED; if (value < 0) {
} const asn_INTEGER_specifics_t* specs =
if((1 + length) > size) { (const asn_INTEGER_specifics_t*) td->specifics;
ASN__DECODE_STARVED; if (specs && specs->field_unsigned) {
} ASN__DECODE_FAILED;
b++; }
bend = b + length; }
value = asn__nativeenumerated_convert(b, bend);
if(value < 0) {
const asn_INTEGER_specifics_t *specs =
(const asn_INTEGER_specifics_t *)td->specifics;
if(specs && specs->field_unsigned) {
ASN__DECODE_FAILED;
}
}
if(!native) { if (!native) {
native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native))); native = (long*) (*nint_ptr = CALLOC(1, sizeof(*native)));
if(!native) ASN__DECODE_FAILED; if (!native) ASN__DECODE_FAILED;
} }
*native = value; *native = value;
rval.consumed = (1 + length); rval.consumed = (1 + length);
} }
return rval; return rval;
} }
/* /*
* Encode as Canonical OER. * Encode as Canonical OER.
*/ */
asn_enc_rval_t asn_enc_rval_t NativeEnumerated_encode_oer(
NativeEnumerated_encode_oer(const asn_TYPE_descriptor_t *td, const asn_TYPE_descriptor_t* td, const asn_oer_constraints_t* constraints,
const asn_oer_constraints_t *constraints, const void* sptr, asn_app_consume_bytes_f* cb, void* app_key) {
const void *sptr, asn_app_consume_bytes_f *cb, asn_enc_rval_t er;
void *app_key) { long native;
asn_enc_rval_t er;
long native; (void) constraints;
(void)constraints; if (!sptr) ASN__ENCODE_FAILED;
if(!sptr) ASN__ENCODE_FAILED; native = *(const long*) sptr;
native = *(const long *)sptr; if (native >= 0 && native <= 127) {
/* #11.2 Short form */
if(native >= 0 && native <= 127) { uint8_t b = native;
/* #11.2 Short form */ er.encoded = 1;
uint8_t b = native; if (cb(&b, er.encoded, app_key) < 0) {
er.encoded = 1; ASN__ENCODE_FAILED;
if(cb(&b, er.encoded, app_key) < 0) { }
ASN__ENCODE_FAILED; ASN__ENCODED_OK(er);
} } else {
ASN__ENCODED_OK(er); /* #11.2 Long form */
} else { uint8_t buf[1 + sizeof(native)];
/* #11.2 Long form */ uint8_t* b = &buf[sizeof(native)]; /* Last addressable */
uint8_t buf[1 + sizeof(native)]; long final_pattern = -1 * (native < 0);
uint8_t *b = &buf[sizeof(native)]; /* Last addressable */
long final_pattern = -1 * (native < 0); for (;;) {
*b-- = native;
for(;;) { native >>= 8;
*b-- = native; if (native == final_pattern) {
native >>= 8; if (final_pattern) {
if(native == final_pattern) { if ((b[1] & 0x80)) break;
if(final_pattern) { } else {
if((b[1] & 0x80)) break; if (!(b[1] & 0x80)) break;
} else {
if(!(b[1] & 0x80)) break;
}
}
}
*b = 0x80 | (&buf[sizeof(native)] - b);
er.encoded = 1 + (&buf[sizeof(native)] - b);
if(cb(b, er.encoded, app_key) < 0) {
ASN__ENCODE_FAILED;
} }
ASN__ENCODED_OK(er); }
}
*b = 0x80 | (&buf[sizeof(native)] - b);
er.encoded = 1 + (&buf[sizeof(native)] - b);
if (cb(b, er.encoded, app_key) < 0) {
ASN__ENCODE_FAILED;
} }
ASN__ENCODED_OK(er);
}
} }
#endif /* ASN_DISABLE_OER_SUPPORT */ #endif /* ASN_DISABLE_OER_SUPPORT */
This diff is collapsed.
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
* will do). * will do).
* This type may be used when integer range is limited by subtype constraints. * This type may be used when integer range is limited by subtype constraints.
*/ */
#ifndef _NativeInteger_H_ #ifndef _NativeInteger_H_
#define _NativeInteger_H_ #define _NativeInteger_H_
#include <asn_application.h> #include <asn_application.h>
#include <INTEGER.h> #include <INTEGER.h>
...@@ -22,7 +22,7 @@ extern "C" { ...@@ -22,7 +22,7 @@ extern "C" {
extern asn_TYPE_descriptor_t asn_DEF_NativeInteger; extern asn_TYPE_descriptor_t asn_DEF_NativeInteger;
extern asn_TYPE_operation_t asn_OP_NativeInteger; extern asn_TYPE_operation_t asn_OP_NativeInteger;
asn_struct_free_f NativeInteger_free; asn_struct_free_f NativeInteger_free;
asn_struct_print_f NativeInteger_print; asn_struct_print_f NativeInteger_print;
asn_struct_compare_f NativeInteger_compare; asn_struct_compare_f NativeInteger_compare;
ber_type_decoder_f NativeInteger_decode_ber; ber_type_decoder_f NativeInteger_decode_ber;
...@@ -35,12 +35,12 @@ per_type_decoder_f NativeInteger_decode_uper; ...@@ -35,12 +35,12 @@ per_type_decoder_f NativeInteger_decode_uper;
per_type_encoder_f NativeInteger_encode_uper; per_type_encoder_f NativeInteger_encode_uper;
per_type_decoder_f NativeInteger_decode_aper; per_type_decoder_f NativeInteger_decode_aper;
per_type_encoder_f NativeInteger_encode_aper; per_type_encoder_f NativeInteger_encode_aper;
asn_random_fill_f NativeInteger_random_fill; asn_random_fill_f NativeInteger_random_fill;
#define NativeInteger_constraint asn_generic_no_constraint #define NativeInteger_constraint asn_generic_no_constraint
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _NativeInteger_H_ */ #endif /* _NativeInteger_H_ */
This diff is collapsed.
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs" * From ASN.1 module "NGAP-IEs"
* found in "asn.1/Information Element Definitions.asn1" * found in "asn.1/Information Element Definitions.asn1"
* `asn1c -pdu=all -fcompound-names -fno-include-deps -findirect-choice -gen-PER -D src` * `asn1c -pdu=all -fcompound-names -fno-include-deps -findirect-choice
* -gen-PER -D src`
*/ */
#ifndef _Ngap_AMF_TNLAssociationSetupItem_H_ #ifndef _Ngap_AMF_TNLAssociationSetupItem_H_
#define _Ngap_AMF_TNLAssociationSetupItem_H_ #define _Ngap_AMF_TNLAssociationSetupItem_H_
#include <asn_application.h> #include <asn_application.h>
...@@ -24,25 +24,26 @@ struct Ngap_ProtocolExtensionContainer; ...@@ -24,25 +24,26 @@ struct Ngap_ProtocolExtensionContainer;
/* Ngap_AMF-TNLAssociationSetupItem */ /* Ngap_AMF-TNLAssociationSetupItem */
typedef struct Ngap_AMF_TNLAssociationSetupItem { typedef struct Ngap_AMF_TNLAssociationSetupItem {
Ngap_CPTransportLayerInformation_t aMF_TNLAssociationAddress; Ngap_CPTransportLayerInformation_t aMF_TNLAssociationAddress;
struct Ngap_ProtocolExtensionContainer *iE_Extensions; /* OPTIONAL */ struct Ngap_ProtocolExtensionContainer* iE_Extensions; /* OPTIONAL */
/* /*
* This type is extensible, * This type is extensible,
* possible extensions are below. * possible extensions are below.
*/ */
/* Context for parsing across buffer boundaries */ /* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
} Ngap_AMF_TNLAssociationSetupItem_t; } Ngap_AMF_TNLAssociationSetupItem_t;
/* Implementation */ /* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationSetupItem; extern asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationSetupItem;
extern asn_SEQUENCE_specifics_t asn_SPC_Ngap_AMF_TNLAssociationSetupItem_specs_1; extern asn_SEQUENCE_specifics_t
asn_SPC_Ngap_AMF_TNLAssociationSetupItem_specs_1;
extern asn_TYPE_member_t asn_MBR_Ngap_AMF_TNLAssociationSetupItem_1[2]; extern asn_TYPE_member_t asn_MBR_Ngap_AMF_TNLAssociationSetupItem_1[2];
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _Ngap_AMF_TNLAssociationSetupItem_H_ */ #endif /* _Ngap_AMF_TNLAssociationSetupItem_H_ */
#include <asn_internal.h> #include <asn_internal.h>
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c) * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs" * From ASN.1 module "NGAP-IEs"
* found in "asn.1/Information Element Definitions.asn1" * found in "asn.1/Information Element Definitions.asn1"
* `asn1c -pdu=all -fcompound-names -fno-include-deps -findirect-choice -gen-PER -D src` * `asn1c -pdu=all -fcompound-names -fno-include-deps -findirect-choice
* -gen-PER -D src`
*/ */
#ifndef _Ngap_AMF_TNLAssociationSetupList_H_ #ifndef _Ngap_AMF_TNLAssociationSetupList_H_
#define _Ngap_AMF_TNLAssociationSetupList_H_ #define _Ngap_AMF_TNLAssociationSetupList_H_
#include <asn_application.h> #include <asn_application.h>
...@@ -24,21 +24,22 @@ struct Ngap_AMF_TNLAssociationSetupItem; ...@@ -24,21 +24,22 @@ struct Ngap_AMF_TNLAssociationSetupItem;
/* Ngap_AMF-TNLAssociationSetupList */ /* Ngap_AMF-TNLAssociationSetupList */
typedef struct Ngap_AMF_TNLAssociationSetupList { typedef struct Ngap_AMF_TNLAssociationSetupList {
A_SEQUENCE_OF(struct Ngap_AMF_TNLAssociationSetupItem) list; A_SEQUENCE_OF(struct Ngap_AMF_TNLAssociationSetupItem) list;
/* Context for parsing across buffer boundaries */ /* Context for parsing across buffer boundaries */
asn_struct_ctx_t _asn_ctx; asn_struct_ctx_t _asn_ctx;
} Ngap_AMF_TNLAssociationSetupList_t; } Ngap_AMF_TNLAssociationSetupList_t;
/* Implementation */ /* Implementation */
extern asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationSetupList; extern asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationSetupList;
extern asn_SET_OF_specifics_t asn_SPC_Ngap_AMF_TNLAssociationSetupList_specs_1; extern asn_SET_OF_specifics_t asn_SPC_Ngap_AMF_TNLAssociationSetupList_specs_1;
extern asn_TYPE_member_t asn_MBR_Ngap_AMF_TNLAssociationSetupList_1[1]; extern asn_TYPE_member_t asn_MBR_Ngap_AMF_TNLAssociationSetupList_1[1];
extern asn_per_constraints_t asn_PER_type_Ngap_AMF_TNLAssociationSetupList_constr_1; extern asn_per_constraints_t
asn_PER_type_Ngap_AMF_TNLAssociationSetupList_constr_1;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* _Ngap_AMF_TNLAssociationSetupList_H_ */ #endif /* _Ngap_AMF_TNLAssociationSetupList_H_ */
#include <asn_internal.h> #include <asn_internal.h>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment