Commit 47dd428a authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Apply Google style format for all the rest files

parent a8079223

Too many changes to show.

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

This diff is collapsed.
......@@ -12,7 +12,7 @@ extern "C" {
#endif
typedef struct ANY {
uint8_t *buf; /* BER-encoded ANY contents */
uint8_t* buf; /* BER-encoded ANY contents */
int size; /* Size of the above buffer */
asn_struct_ctx_t _asn_ctx; /* Parsing across buffer boundaries */
......@@ -45,18 +45,18 @@ per_type_encoder_f ANY_encode_aper;
******************************/
/* 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_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_aper(asn_TYPE_descriptor_t *td, void *sptr);
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);
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);
/* 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_aper(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);
#define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
#define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
&asn_DEF_ANY, (buf), (size))
#define ANY_new_fromBuf(buf, size) \
OCTET_STRING_new_fromBuf(&asn_DEF_ANY, (buf), (size))
#ifdef __cplusplus
}
......
This diff is collapsed.
......@@ -12,10 +12,10 @@ extern "C" {
#endif
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 */
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 */
} BIT_STRING_t;
......
......@@ -9,26 +9,25 @@
#include <BIT_STRING.h>
#include <errno.h>
asn_dec_rval_t
BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) {
BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
const asn_oer_constraints_t *cts =
asn_dec_rval_t BIT_STRING_decode_oer(
const asn_codec_ctx_t* opt_codec_ctx, const asn_TYPE_descriptor_t* td,
const asn_oer_constraints_t* constraints, void** sptr, const void* ptr,
size_t size) {
BIT_STRING_t* st = (BIT_STRING_t*) *sptr;
const asn_oer_constraints_t* cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
ssize_t ct_size = cts ? cts->size : -1;
asn_dec_rval_t rval = {RC_OK, 0};
size_t expected_length = 0;
(void)opt_codec_ctx;
(void) opt_codec_ctx;
if(!st) {
st = (BIT_STRING_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
if (!st) {
st = (BIT_STRING_t*) (*sptr = CALLOC(1, sizeof(*st)));
if (!st) ASN__DECODE_FAILED;
}
if(ct_size >= 0) {
if (ct_size >= 0) {
expected_length = (ct_size + 7) >> 3;
st->bits_unused = (8 - (ct_size & 7)) & 7;
} else {
......@@ -38,37 +37,37 @@ BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
* 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;
if (len_len > 0) {
ptr = (const char*) ptr + len_len;
size -= len_len;
} else if(len_len == 0) {
} else if (len_len == 0) {
ASN__DECODE_STARVED;
} else if(len_len < 0) {
} else if (len_len < 0) {
ASN__DECODE_FAILED;
}
if(expected_length < 1) {
if (expected_length < 1) {
ASN__DECODE_FAILED;
} else if(expected_length > size) {
} else if (expected_length > size) {
ASN__DECODE_STARVED;
}
st->bits_unused = ((const uint8_t *)ptr)[0];
if(st->bits_unused & ~7) {
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;
ptr = (const char*) ptr + 1;
size--;
expected_length--;
rval.consumed = len_len + 1;
}
if(size < expected_length) {
if (size < expected_length) {
ASN__DECODE_STARVED;
} else {
uint8_t *buf = MALLOC(expected_length + 1);
if(buf == NULL) {
uint8_t* buf = MALLOC(expected_length + 1);
if (buf == NULL) {
ASN__DECODE_FAILED;
} else {
memcpy(buf, ptr, expected_length);
......@@ -77,7 +76,7 @@ BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
FREEMEM(st->buf);
st->buf = buf;
st->size = expected_length;
if(expected_length > 0) {
if (expected_length > 0) {
buf[expected_length - 1] &= (0xff << st->bits_unused);
}
......@@ -89,36 +88,36 @@ BIT_STRING_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
/*
* Encode as Canonical OER.
*/
asn_enc_rval_t
BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints,
const void *sptr, asn_app_consume_bytes_f *cb,
void *app_key) {
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
asn_enc_rval_t BIT_STRING_encode_oer(
const asn_TYPE_descriptor_t* td, const asn_oer_constraints_t* constraints,
const void* sptr, asn_app_consume_bytes_f* cb, void* app_key) {
const BIT_STRING_t* st = (const BIT_STRING_t*) sptr;
asn_enc_rval_t erval = {0, 0, 0};
const asn_oer_constraints_t *cts =
const asn_oer_constraints_t* cts =
constraints ? constraints : td->encoding_constraints.oer_constraints;
ssize_t ct_size = cts ? cts->size : -1;
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_DEBUG("BIT STRING unused bits %d out of 0..7 range", st->bits_unused);
ASN__ENCODE_FAILED;
}
if(st->bits_unused && !(st->size && st->buf)) {
ASN_DEBUG("BIT STRING %s size 0 can't support unused bits %d", td->name,
if (st->bits_unused && !(st->size && st->buf)) {
ASN_DEBUG(
"BIT STRING %s size 0 can't support unused bits %d", td->name,
st->bits_unused);
ASN__ENCODE_FAILED;
}
if(ct_size >= 0) {
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 "",
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;
}
......@@ -126,49 +125,48 @@ BIT_STRING_encode_oer(const asn_TYPE_descriptor_t *td,
} 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) {
if (len_len < 0) ASN__ENCODE_FAILED;
if (cb(&ub, 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
erval.encoded += len_len + 1;
}
if(st->bits_unused) {
if(st->buf[st->size - 1] & (0xff << st->bits_unused)) {
if (st->bits_unused) {
if (st->buf[st->size - 1] & (0xff << st->bits_unused)) {
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;
}
if(fix_last_byte) {
if (fix_last_byte) {
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;
}
}
erval.encoded += st->size;
if(trailing_zeros) {
if (trailing_zeros) {
static uint8_t zeros[16];
while(trailing_zeros > 0) {
while (trailing_zeros > 0) {
int ret;
if(trailing_zeros < sizeof(zeros)) {
if (trailing_zeros < sizeof(zeros)) {
ret = cb(zeros, trailing_zeros, app_key);
erval.encoded += trailing_zeros;
} else {
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;
}
#endif /* ASN_DISABLE_OER_SUPPORT */
This diff is collapsed.
......@@ -21,13 +21,13 @@ extern asn_TYPE_operation_t asn_OP_INTEGER;
typedef struct asn_INTEGER_enum_map_s {
long nat_value; /* associated native integer value */
size_t enum_len; /* strlen("tag") */
const char *enum_name; /* "tag" */
const char* enum_name; /* "tag" */
} asn_INTEGER_enum_map_t;
/* This type describes an enumeration for INTEGER and ENUMERATED types */
typedef struct asn_INTEGER_specifics_s {
const asn_INTEGER_enum_map_t *value2enum; /* N -> "tag"; sorted by N */
const unsigned int *enum2value; /* "tag" => N; sorted by tag */
const asn_INTEGER_enum_map_t* value2enum; /* N -> "tag"; sorted by N */
const unsigned int* enum2value; /* "tag" => N; sorted by tag */
int map_count; /* Elements in either map */
int extension; /* This map is extensible */
int strict_enumeration; /* Enumeration set is fixed */
......@@ -63,20 +63,20 @@ asn_random_fill_f INTEGER_random_fill;
* -1/ERANGE: Value encoded is out of range for long representation
* -1/ENOMEM: Memory allocation failed (in asn_*2INTEGER()).
*/
int asn_INTEGER2imax(const INTEGER_t *i, intmax_t *l);
int asn_INTEGER2umax(const INTEGER_t *i, uintmax_t *l);
int asn_imax2INTEGER(INTEGER_t *i, intmax_t l);
int asn_umax2INTEGER(INTEGER_t *i, uintmax_t l);
int asn_INTEGER2imax(const INTEGER_t* i, intmax_t* l);
int asn_INTEGER2umax(const INTEGER_t* i, uintmax_t* l);
int asn_imax2INTEGER(INTEGER_t* i, intmax_t l);
int asn_umax2INTEGER(INTEGER_t* i, uintmax_t l);
/*
* Size-specific conversion helpers.
*/
int asn_INTEGER2long(const INTEGER_t *i, long *l);
int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l);
int asn_long2INTEGER(INTEGER_t *i, long l);
int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l);
int asn_int642INTEGER(INTEGER_t *i, int64_t l);
int asn_uint642INTEGER(INTEGER_t *i, uint64_t l);
int asn_INTEGER2long(const INTEGER_t* i, long* l);
int asn_INTEGER2ulong(const INTEGER_t* i, unsigned long* l);
int asn_long2INTEGER(INTEGER_t* i, long l);
int asn_ulong2INTEGER(INTEGER_t* i, unsigned long l);
int asn_int642INTEGER(INTEGER_t* i, int64_t l);
int asn_uint642INTEGER(INTEGER_t* i, uint64_t l);
/* A version of strtol/strtoimax(3) with nicer error reporting. */
enum asn_strtox_result_e {
......@@ -84,22 +84,23 @@ enum asn_strtox_result_e {
ASN_STRTOX_ERROR_INVAL = -2, /* Invalid data encountered (e.g., "+-") */
ASN_STRTOX_EXPECT_MORE = -1, /* More data expected (e.g. "+") */
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,
long *l);
enum asn_strtox_result_e asn_strtoul_lim(const char *str, const char **end,
unsigned long *l);
enum asn_strtox_result_e asn_strtoimax_lim(const char *str, const char **end,
intmax_t *l);
enum asn_strtox_result_e asn_strtoumax_lim(const char *str, const char **end,
uintmax_t *l);
enum asn_strtox_result_e asn_strtol_lim(
const char* str, const char** end, long* l);
enum asn_strtox_result_e asn_strtoul_lim(
const char* str, const char** end, unsigned long* l);
enum asn_strtox_result_e asn_strtoimax_lim(
const char* str, const char** end, intmax_t* l);
enum asn_strtox_result_e asn_strtoumax_lim(
const char* str, const char** end, uintmax_t* l);
/*
* Convert the integer value into the corresponding enumeration map entry.
*/
const asn_INTEGER_enum_map_t *INTEGER_map_value2enum(
const asn_INTEGER_specifics_t *specs, long value);
const asn_INTEGER_enum_map_t* INTEGER_map_value2enum(
const asn_INTEGER_specifics_t* specs, long value);
#ifdef __cplusplus
}
......
......@@ -9,63 +9,62 @@
#include <INTEGER.h>
#include <errno.h>
asn_dec_rval_t
INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, void **sptr,
const void *ptr, size_t size) {
const asn_INTEGER_specifics_t *specs =
(const asn_INTEGER_specifics_t *)td->specifics;
asn_dec_rval_t INTEGER_decode_oer(
const asn_codec_ctx_t* opt_codec_ctx, const asn_TYPE_descriptor_t* td,
const asn_oer_constraints_t* constraints, void** sptr, const void* ptr,
size_t size) {
const asn_INTEGER_specifics_t* specs =
(const asn_INTEGER_specifics_t*) td->specifics;
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};
size_t req_bytes;
(void)opt_codec_ctx;
(void)specs;
(void) opt_codec_ctx;
(void) specs;
if(!st) {
st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
if(!st) ASN__DECODE_FAILED;
if (!st) {
st = (INTEGER_t*) (*sptr = CALLOC(1, sizeof(*st)));
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 (!constraints) constraints = td->encoding_constraints.oer_constraints;
if (constraints) ct = constraints->value;
if(ct.width) {
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) {
if (consumed == 0) {
ASN__DECODE_STARVED;
} else if(consumed == -1) {
} else if (consumed == -1) {
ASN__DECODE_FAILED;
}
rval.consumed += consumed;
ptr = (const char *)ptr + consumed;
ptr = (const char*) ptr + consumed;
size -= consumed;
}
if(req_bytes > size) {
if (req_bytes > size) {
ASN__DECODE_STARVED;
}
if(ct.positive) {
if (ct.positive) {
/* X.969 08/2015 10.2(a) */
unsigned msb; /* Most significant bit */
size_t useful_size;
/* Check most significant bit */
msb = *(const uint8_t *)ptr >> 7; /* yields 0 or 1 */
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) {
st->buf = (uint8_t*) MALLOC(useful_size + 1);
if (!st->buf) {
ASN__DECODE_FAILED;
}
......@@ -82,8 +81,8 @@ INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
return rval;
} else {
/* X.969 08/2015 10.2(b) */
st->buf = (uint8_t *)MALLOC(req_bytes + 1);
if(!st->buf) {
st->buf = (uint8_t*) MALLOC(req_bytes + 1);
if (!st->buf) {
ASN__DECODE_FAILED;
}
......@@ -99,23 +98,22 @@ INTEGER_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
/*
* Encode as Canonical OER.
*/
asn_enc_rval_t
INTEGER_encode_oer(const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints, const void *sptr,
asn_app_consume_bytes_f *cb, void *app_key) {
const INTEGER_t *st = sptr;
asn_enc_rval_t INTEGER_encode_oer(
const asn_TYPE_descriptor_t* td, const asn_oer_constraints_t* constraints,
const void* sptr, asn_app_consume_bytes_f* cb, void* app_key) {
const INTEGER_t* st = sptr;
asn_enc_rval_t er;
struct asn_oer_constraint_number_s ct = {0, 0};
const uint8_t *buf;
const uint8_t *end;
const uint8_t* buf;
const uint8_t* end;
size_t useful_bytes;
size_t req_bytes = 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) ct = constraints->value;
if (!constraints) constraints = td->encoding_constraints.oer_constraints;
if (constraints) ct = constraints->value;
er.encoded = 0;
......@@ -125,20 +123,20 @@ INTEGER_encode_oer(const asn_TYPE_descriptor_t *td,
sign = (buf && buf < end) ? buf[0] & 0x80 : 0;
/* Ignore 9 leading zeroes or ones */
if(ct.positive) {
if(sign) {
if (ct.positive) {
if (sign) {
/* The value given is a signed value. Can't proceed. */
ASN__ENCODE_FAILED;
}
/* Remove leading zeros. */
for(; buf + 1 < end; buf++) {
if(buf[0] != 0x0) break;
for (; buf + 1 < end; buf++) {
if (buf[0] != 0x0) break;
}
} else {
for(; buf + 1 < end; buf++) {
if(buf[0] == 0x0 && (buf[1] & 0x80) == 0) {
for (; buf + 1 < end; buf++) {
if (buf[0] == 0x0 && (buf[1] & 0x80) == 0) {
continue;
} else if(buf[0] == 0xff && (buf[1] & 0x80) != 0) {
} else if (buf[0] == 0xff && (buf[1] & 0x80) != 0) {
continue;
}
break;
......@@ -146,30 +144,30 @@ INTEGER_encode_oer(const asn_TYPE_descriptor_t *td,
}
useful_bytes = end - buf;
if(ct.width) {
if (ct.width) {
req_bytes = ct.width;
} else {
ssize_t r = oer_serialize_length(useful_bytes, cb, app_key);
if(r < 0) {
if (r < 0) {
ASN__ENCODE_FAILED;
}
er.encoded += r;
req_bytes = useful_bytes;
}
if(req_bytes < useful_bytes) {
if (req_bytes < useful_bytes) {
ASN__ENCODE_FAILED;
}
er.encoded += req_bytes;
for(; req_bytes > useful_bytes; req_bytes--) {
if(cb(sign?"\xff":"\0", 1, app_key) < 0) {
for (; req_bytes > useful_bytes; req_bytes--) {
if (cb(sign ? "\xff" : "\0", 1, app_key) < 0) {
ASN__ENCODE_FAILED;
}
}
if(cb(buf, useful_bytes, app_key) < 0) {
if (cb(buf, useful_bytes, app_key) < 0) {
ASN__ENCODE_FAILED;
}
......
This diff is collapsed.
......@@ -9,49 +9,48 @@
#include <NativeEnumerated.h>
#include <errno.h>
static long
asn__nativeenumerated_convert(const uint8_t *b, const uint8_t *end) {
static long asn__nativeenumerated_convert(
const uint8_t* b, const uint8_t* end) {
unsigned long value;
/* Perform the sign initialization */
/* Actually value = -(*b >> 7); gains nothing, yet unreadable! */
if((*b >> 7)) {
value = (unsigned long)(-1);
if ((*b >> 7)) {
value = (unsigned long) (-1);
} else {
value = 0;
}
/* Conversion engine */
for(; b < end; b++) {
for (; b < end; b++) {
value = (value << 8) | *b;
}
return value;
}
asn_dec_rval_t
NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints,
void **nint_ptr, const void *ptr, size_t size) {
asn_dec_rval_t NativeEnumerated_decode_oer(
const asn_codec_ctx_t* opt_codec_ctx, const asn_TYPE_descriptor_t* td,
const asn_oer_constraints_t* constraints, void** nint_ptr, const void* ptr,
size_t size) {
asn_dec_rval_t rval = {RC_OK, 0};
long *native = (long *)*nint_ptr;
const uint8_t *b = ptr;
long* native = (long*) *nint_ptr;
const uint8_t* b = ptr;
(void)opt_codec_ctx;
(void)constraints;
(void) opt_codec_ctx;
(void) constraints;
if(size < 1) {
if (size < 1) {
ASN__DECODE_STARVED;
}
if((*b & 0x80) == 0) {
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 (!native) {
native = (long*) (*nint_ptr = CALLOC(1, sizeof(*native)));
if (!native) ASN__DECODE_FAILED;
}
*native = *b;
......@@ -61,30 +60,30 @@ NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
* X.696 (08/2015) #11.4 Long form for Enumerated.
*/
size_t length = *b & 0x7f;
const uint8_t *bend;
const uint8_t* bend;
long value;
if(length < 1 || length > sizeof(*native)) {
if (length < 1 || length > sizeof(*native)) {
ASN__DECODE_FAILED;
}
if((1 + length) > size) {
if ((1 + length) > size) {
ASN__DECODE_STARVED;
}
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) {
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) {
native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
if(!native) ASN__DECODE_FAILED;
if (!native) {
native = (long*) (*nint_ptr = CALLOC(1, sizeof(*native)));
if (!native) ASN__DECODE_FAILED;
}
*native = value;
......@@ -98,48 +97,46 @@ NativeEnumerated_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
/*
* Encode as Canonical OER.
*/
asn_enc_rval_t
NativeEnumerated_encode_oer(const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints,
const void *sptr, asn_app_consume_bytes_f *cb,
void *app_key) {
asn_enc_rval_t NativeEnumerated_encode_oer(
const asn_TYPE_descriptor_t* td, const asn_oer_constraints_t* constraints,
const void* sptr, asn_app_consume_bytes_f* cb, void* app_key) {
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) {
if (native >= 0 && native <= 127) {
/* #11.2 Short form */
uint8_t b = native;
er.encoded = 1;
if(cb(&b, er.encoded, app_key) < 0) {
if (cb(&b, er.encoded, app_key) < 0) {
ASN__ENCODE_FAILED;
}
ASN__ENCODED_OK(er);
} else {
/* #11.2 Long form */
uint8_t buf[1 + sizeof(native)];
uint8_t *b = &buf[sizeof(native)]; /* Last addressable */
uint8_t* b = &buf[sizeof(native)]; /* Last addressable */
long final_pattern = -1 * (native < 0);
for(;;) {
for (;;) {
*b-- = native;
native >>= 8;
if(native == final_pattern) {
if(final_pattern) {
if((b[1] & 0x80)) break;
if (native == final_pattern) {
if (final_pattern) {
if ((b[1] & 0x80)) break;
} else {
if(!(b[1] & 0x80)) break;
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) {
if (cb(b, er.encoded, app_key) < 0) {
ASN__ENCODE_FAILED;
}
ASN__ENCODED_OK(er);
......
This diff is collapsed.
......@@ -9,41 +9,40 @@
#include <NativeInteger.h>
#include <errno.h>
asn_dec_rval_t
NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints,
void **nint_ptr, const void *ptr, size_t size) {
const asn_INTEGER_specifics_t *specs =
(const asn_INTEGER_specifics_t *)td->specifics;
asn_dec_rval_t NativeInteger_decode_oer(
const asn_codec_ctx_t* opt_codec_ctx, const asn_TYPE_descriptor_t* td,
const asn_oer_constraints_t* constraints, void** nint_ptr, const void* ptr,
size_t size) {
const asn_INTEGER_specifics_t* specs =
(const asn_INTEGER_specifics_t*) td->specifics;
asn_dec_rval_t rval = {RC_OK, 0};
long *native = (long *)*nint_ptr;
long* native = (long*) *nint_ptr;
INTEGER_t tmpint;
INTEGER_t *tmpintptr = &tmpint;
INTEGER_t* tmpintptr = &tmpint;
memset(&tmpint, 0, sizeof(tmpint));
if(!native) {
native = (long *)(*nint_ptr = CALLOC(1, sizeof(*native)));
if(!native) ASN__DECODE_FAILED;
if (!native) {
native = (long*) (*nint_ptr = CALLOC(1, sizeof(*native)));
if (!native) ASN__DECODE_FAILED;
}
/*
* OPTIMIZATION: Encode directly rather than passing through INTEGER.
* Saves a memory allocation.
*/
rval = INTEGER_decode_oer(opt_codec_ctx, td, constraints,
(void **)&tmpintptr, ptr, size);
if(rval.code != RC_OK) {
rval = INTEGER_decode_oer(
opt_codec_ctx, td, constraints, (void**) &tmpintptr, ptr, size);
if (rval.code != RC_OK) {
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
return rval;
}
if(specs && specs->field_unsigned) {
if (specs && specs->field_unsigned) {
unsigned long ul;
int ok = asn_INTEGER2ulong(&tmpint, &ul) == 0;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
if(ok) {
if (ok) {
*native = ul;
} else {
rval.code = RC_FAIL;
......@@ -53,7 +52,7 @@ NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
long l;
int ok = asn_INTEGER2long(&tmpint, &l) == 0;
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
if(ok) {
if (ok) {
*native = l;
} else {
rval.code = RC_FAIL;
......@@ -67,25 +66,23 @@ NativeInteger_decode_oer(const asn_codec_ctx_t *opt_codec_ctx,
/*
* Encode as Canonical OER.
*/
asn_enc_rval_t
NativeInteger_encode_oer(const asn_TYPE_descriptor_t *td,
const asn_oer_constraints_t *constraints,
const void *sptr, asn_app_consume_bytes_f *cb,
void *app_key) {
const asn_INTEGER_specifics_t *specs =
(const asn_INTEGER_specifics_t *)td->specifics;
asn_enc_rval_t NativeInteger_encode_oer(
const asn_TYPE_descriptor_t* td, const asn_oer_constraints_t* constraints,
const void* sptr, asn_app_consume_bytes_f* cb, void* app_key) {
const asn_INTEGER_specifics_t* specs =
(const asn_INTEGER_specifics_t*) td->specifics;
INTEGER_t tmpint;
long native;
if(!sptr) ASN__ENCODE_FAILED;
if (!sptr) ASN__ENCODE_FAILED;
native = *(const long *)sptr;
native = *(const long*) sptr;
memset(&tmpint, 0, sizeof(tmpint));
ASN_DEBUG("Encoding %s %ld as NativeInteger", td ? td->name : "", native);
if((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native)
: asn_long2INTEGER(&tmpint, native)) {
if ((specs && specs->field_unsigned) ? asn_ulong2INTEGER(&tmpint, native) :
asn_long2INTEGER(&tmpint, native)) {
ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
ASN__ENCODE_FAILED;
} else {
......
......@@ -2,39 +2,46 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* 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`
*/
#include "Ngap_AMF-TNLAssociationSetupItem.h"
#include "Ngap_ProtocolExtensionContainer.h"
asn_TYPE_member_t asn_MBR_Ngap_AMF_TNLAssociationSetupItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Ngap_AMF_TNLAssociationSetupItem, aMF_TNLAssociationAddress),
{ATF_NOFLAGS,
0,
offsetof(
struct Ngap_AMF_TNLAssociationSetupItem, aMF_TNLAssociationAddress),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_Ngap_CPTransportLayerInformation,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"aMF-TNLAssociationAddress"
},
{ ATF_POINTER, 1, offsetof(struct Ngap_AMF_TNLAssociationSetupItem, iE_Extensions),
{0, 0, 0},
0,
0, /* No default value */
"aMF-TNLAssociationAddress"},
{ATF_POINTER,
1,
offsetof(struct Ngap_AMF_TNLAssociationSetupItem, iE_Extensions),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_Ngap_ProtocolExtensionContainer_175P2,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"iE-Extensions"
},
{0, 0, 0},
0,
0, /* No default value */
"iE-Extensions"},
};
static const int asn_MAP_Ngap_AMF_TNLAssociationSetupItem_oms_1[] = { 1 };
static const int asn_MAP_Ngap_AMF_TNLAssociationSetupItem_oms_1[] = {1};
static const ber_tlv_tag_t asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Ngap_AMF_TNLAssociationSetupItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* aMF-TNLAssociationAddress */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* iE-Extensions */
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};
static const asn_TYPE_tag2member_t
asn_MAP_Ngap_AMF_TNLAssociationSetupItem_tag2el_1[] = {
{(ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0,
0}, /* aMF-TNLAssociationAddress */
{(ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0} /* iE-Extensions */
};
asn_SEQUENCE_specifics_t asn_SPC_Ngap_AMF_TNLAssociationSetupItem_specs_1 = {
sizeof(struct Ngap_AMF_TNLAssociationSetupItem),
......@@ -42,7 +49,8 @@ asn_SEQUENCE_specifics_t asn_SPC_Ngap_AMF_TNLAssociationSetupItem_specs_1 = {
asn_MAP_Ngap_AMF_TNLAssociationSetupItem_tag2el_1,
2, /* Count of tags in the map */
asn_MAP_Ngap_AMF_TNLAssociationSetupItem_oms_1, /* Optional members */
1, 0, /* Root/Additions */
1,
0, /* Root/Additions */
2, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationSetupItem = {
......@@ -50,14 +58,13 @@ asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationSetupItem = {
"AMF-TNLAssociationSetupItem",
&asn_OP_SEQUENCE,
asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1,
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1)
/sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1[0]), /* 1 */
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1) /
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1[0]), /* 1 */
asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1, /* Same as above */
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1)
/sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1) /
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupItem_tags_1[0]), /* 1 */
{0, 0, SEQUENCE_constraint},
asn_MBR_Ngap_AMF_TNLAssociationSetupItem_1,
2, /* Elements count */
&asn_SPC_Ngap_AMF_TNLAssociationSetupItem_specs_1 /* Additional specs */
};
......@@ -2,13 +2,13 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* 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_
#define _Ngap_AMF_TNLAssociationSetupItem_H_
#include <asn_application.h>
/* Including external dependencies */
......@@ -25,7 +25,7 @@ struct Ngap_ProtocolExtensionContainer;
/* Ngap_AMF-TNLAssociationSetupItem */
typedef struct Ngap_AMF_TNLAssociationSetupItem {
Ngap_CPTransportLayerInformation_t aMF_TNLAssociationAddress;
struct Ngap_ProtocolExtensionContainer *iE_Extensions; /* OPTIONAL */
struct Ngap_ProtocolExtensionContainer* iE_Extensions; /* OPTIONAL */
/*
* This type is extensible,
* possible extensions are below.
......@@ -37,7 +37,8 @@ typedef struct Ngap_AMF_TNLAssociationSetupItem {
/* Implementation */
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];
#ifdef __cplusplus
......
......@@ -2,34 +2,39 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* 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`
*/
#include "Ngap_AMF-TNLAssociationSetupList.h"
#include "Ngap_AMF-TNLAssociationSetupItem.h"
static asn_oer_constraints_t asn_OER_type_Ngap_AMF_TNLAssociationSetupList_constr_1 CC_NOTUSED = {
{ 0, 0 },
static asn_oer_constraints_t
asn_OER_type_Ngap_AMF_TNLAssociationSetupList_constr_1 CC_NOTUSED = {
{0, 0},
-1 /* (SIZE(1..32)) */};
asn_per_constraints_t asn_PER_type_Ngap_AMF_TNLAssociationSetupList_constr_1 CC_NOTUSED = {
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
0, 0 /* No PER value map */
asn_per_constraints_t asn_PER_type_Ngap_AMF_TNLAssociationSetupList_constr_1
CC_NOTUSED = {
{APC_UNCONSTRAINED, -1, -1, 0, 0},
{APC_CONSTRAINED, 5, 5, 1, 32} /* (SIZE(1..32)) */,
0,
0 /* No PER value map */
};
asn_TYPE_member_t asn_MBR_Ngap_AMF_TNLAssociationSetupList_1[] = {
{ ATF_POINTER, 0, 0,
{ATF_POINTER,
0,
0,
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
0,
&asn_DEF_Ngap_AMF_TNLAssociationSetupItem,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
""
},
{0, 0, 0},
0,
0, /* No default value */
""},
};
static const ber_tlv_tag_t asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};
asn_SET_OF_specifics_t asn_SPC_Ngap_AMF_TNLAssociationSetupList_specs_1 = {
sizeof(struct Ngap_AMF_TNLAssociationSetupList),
offsetof(struct Ngap_AMF_TNLAssociationSetupList, _asn_ctx),
......@@ -40,14 +45,15 @@ asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationSetupList = {
"AMF-TNLAssociationSetupList",
&asn_OP_SEQUENCE_OF,
asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1,
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1)
/sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1[0]), /* 1 */
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1) /
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1[0]), /* 1 */
asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1, /* Same as above */
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1)
/sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1[0]), /* 1 */
{ &asn_OER_type_Ngap_AMF_TNLAssociationSetupList_constr_1, &asn_PER_type_Ngap_AMF_TNLAssociationSetupList_constr_1, SEQUENCE_OF_constraint },
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1) /
sizeof(asn_DEF_Ngap_AMF_TNLAssociationSetupList_tags_1[0]), /* 1 */
{&asn_OER_type_Ngap_AMF_TNLAssociationSetupList_constr_1,
&asn_PER_type_Ngap_AMF_TNLAssociationSetupList_constr_1,
SEQUENCE_OF_constraint},
asn_MBR_Ngap_AMF_TNLAssociationSetupList_1,
1, /* Single element */
&asn_SPC_Ngap_AMF_TNLAssociationSetupList_specs_1 /* Additional specs */
};
......@@ -2,13 +2,13 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* 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_
#define _Ngap_AMF_TNLAssociationSetupList_H_
#include <asn_application.h>
/* Including external dependencies */
......@@ -34,7 +34,8 @@ typedef struct 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_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
}
......
......@@ -2,59 +2,71 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* 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`
*/
#include "Ngap_AMF-TNLAssociationToAddItem.h"
#include "Ngap_ProtocolExtensionContainer.h"
asn_TYPE_member_t asn_MBR_Ngap_AMF_TNLAssociationToAddItem_1[] = {
{ ATF_NOFLAGS, 0, offsetof(struct Ngap_AMF_TNLAssociationToAddItem, aMF_TNLAssociationAddress),
{ATF_NOFLAGS,
0,
offsetof(
struct Ngap_AMF_TNLAssociationToAddItem, aMF_TNLAssociationAddress),
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
+1, /* EXPLICIT tag at current level */
&asn_DEF_Ngap_CPTransportLayerInformation,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"aMF-TNLAssociationAddress"
},
{ ATF_POINTER, 1, offsetof(struct Ngap_AMF_TNLAssociationToAddItem, tNLAssociationUsage),
{0, 0, 0},
0,
0, /* No default value */
"aMF-TNLAssociationAddress"},
{ATF_POINTER,
1,
offsetof(struct Ngap_AMF_TNLAssociationToAddItem, tNLAssociationUsage),
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_Ngap_TNLAssociationUsage,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"tNLAssociationUsage"
},
{ ATF_NOFLAGS, 0, offsetof(struct Ngap_AMF_TNLAssociationToAddItem, tNLAddressWeightFactor),
{0, 0, 0},
0,
0, /* No default value */
"tNLAssociationUsage"},
{ATF_NOFLAGS,
0,
offsetof(struct Ngap_AMF_TNLAssociationToAddItem, tNLAddressWeightFactor),
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_Ngap_TNLAddressWeightFactor,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"tNLAddressWeightFactor"
},
{ ATF_POINTER, 1, offsetof(struct Ngap_AMF_TNLAssociationToAddItem, iE_Extensions),
{0, 0, 0},
0,
0, /* No default value */
"tNLAddressWeightFactor"},
{ATF_POINTER,
1,
offsetof(struct Ngap_AMF_TNLAssociationToAddItem, iE_Extensions),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
-1, /* IMPLICIT tag at current level */
&asn_DEF_Ngap_ProtocolExtensionContainer_175P3,
0,
{ 0, 0, 0 },
0, 0, /* No default value */
"iE-Extensions"
},
{0, 0, 0},
0,
0, /* No default value */
"iE-Extensions"},
};
static const int asn_MAP_Ngap_AMF_TNLAssociationToAddItem_oms_1[] = { 1, 3 };
static const int asn_MAP_Ngap_AMF_TNLAssociationToAddItem_oms_1[] = {1, 3};
static const ber_tlv_tag_t asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static const asn_TYPE_tag2member_t asn_MAP_Ngap_AMF_TNLAssociationToAddItem_tag2el_1[] = {
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* aMF-TNLAssociationAddress */
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* tNLAssociationUsage */
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* tNLAddressWeightFactor */
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};
static const asn_TYPE_tag2member_t
asn_MAP_Ngap_AMF_TNLAssociationToAddItem_tag2el_1[] = {
{(ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0,
0}, /* aMF-TNLAssociationAddress */
{(ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0}, /* tNLAssociationUsage */
{(ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0,
0}, /* tNLAddressWeightFactor */
{(ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0} /* iE-Extensions */
};
asn_SEQUENCE_specifics_t asn_SPC_Ngap_AMF_TNLAssociationToAddItem_specs_1 = {
sizeof(struct Ngap_AMF_TNLAssociationToAddItem),
......@@ -62,7 +74,8 @@ asn_SEQUENCE_specifics_t asn_SPC_Ngap_AMF_TNLAssociationToAddItem_specs_1 = {
asn_MAP_Ngap_AMF_TNLAssociationToAddItem_tag2el_1,
4, /* Count of tags in the map */
asn_MAP_Ngap_AMF_TNLAssociationToAddItem_oms_1, /* Optional members */
2, 0, /* Root/Additions */
2,
0, /* Root/Additions */
4, /* First extension addition */
};
asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationToAddItem = {
......@@ -70,14 +83,13 @@ asn_TYPE_descriptor_t asn_DEF_Ngap_AMF_TNLAssociationToAddItem = {
"AMF-TNLAssociationToAddItem",
&asn_OP_SEQUENCE,
asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1,
sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1)
/sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1[0]), /* 1 */
sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1) /
sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1[0]), /* 1 */
asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1, /* Same as above */
sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1)
/sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1[0]), /* 1 */
{ 0, 0, SEQUENCE_constraint },
sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1) /
sizeof(asn_DEF_Ngap_AMF_TNLAssociationToAddItem_tags_1[0]), /* 1 */
{0, 0, SEQUENCE_constraint},
asn_MBR_Ngap_AMF_TNLAssociationToAddItem_1,
4, /* Elements count */
&asn_SPC_Ngap_AMF_TNLAssociationToAddItem_specs_1 /* Additional specs */
};
This diff is collapsed.
......@@ -2,13 +2,13 @@
* Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
* From ASN.1 module "NGAP-IEs"
* 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_UE_NGAP_ID_H_
#define _Ngap_AMF_UE_NGAP_ID_H_
#include <asn_application.h>
/* Including external dependencies */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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