mirror of https://github.com/pvnis/srsRAN_4G.git
Addes SIB1 packing/unpacking to RRC
parent
2de8610ccf
commit
d033204137
@ -0,0 +1,282 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#include <asn_internal.h>
|
||||
#include <asn_codecs_prim.h>
|
||||
#include <BOOLEAN.h>
|
||||
|
||||
/*
|
||||
* BOOLEAN basic type description.
|
||||
*/
|
||||
static const ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (1 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
|
||||
"BOOLEAN",
|
||||
"BOOLEAN",
|
||||
BOOLEAN_free,
|
||||
BOOLEAN_print,
|
||||
asn_generic_no_constraint,
|
||||
BOOLEAN_decode_ber,
|
||||
BOOLEAN_encode_der,
|
||||
BOOLEAN_decode_xer,
|
||||
BOOLEAN_encode_xer,
|
||||
BOOLEAN_decode_uper, /* Unaligned PER decoder */
|
||||
BOOLEAN_encode_uper, /* Unaligned PER encoder */
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_BOOLEAN_tags,
|
||||
sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
|
||||
asn_DEF_BOOLEAN_tags, /* Same as above */
|
||||
sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
|
||||
0, /* No PER visible constraints */
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
||||
/*
|
||||
* Decode BOOLEAN type.
|
||||
*/
|
||||
asn_dec_rval_t
|
||||
BOOLEAN_decode_ber(asn_codec_ctx_t *opt_codec_ctx,
|
||||
asn_TYPE_descriptor_t *td,
|
||||
void **bool_value, const void *buf_ptr, size_t size,
|
||||
int tag_mode) {
|
||||
BOOLEAN_t *st = (BOOLEAN_t *)*bool_value;
|
||||
asn_dec_rval_t rval;
|
||||
ber_tlv_len_t length;
|
||||
ber_tlv_len_t lidx;
|
||||
|
||||
if(st == NULL) {
|
||||
st = (BOOLEAN_t *)(*bool_value = CALLOC(1, sizeof(*st)));
|
||||
if(st == NULL) {
|
||||
rval.code = RC_FAIL;
|
||||
rval.consumed = 0;
|
||||
return rval;
|
||||
}
|
||||
}
|
||||
|
||||
ASN_DEBUG("Decoding %s as BOOLEAN (tm=%d)",
|
||||
td->name, tag_mode);
|
||||
|
||||
/*
|
||||
* Check tags.
|
||||
*/
|
||||
rval = ber_check_tags(opt_codec_ctx, td, 0, buf_ptr, size,
|
||||
tag_mode, 0, &length, 0);
|
||||
if(rval.code != RC_OK)
|
||||
return rval;
|
||||
|
||||
ASN_DEBUG("Boolean length is %d bytes", (int)length);
|
||||
|
||||
buf_ptr = ((const char *)buf_ptr) + rval.consumed;
|
||||
size -= rval.consumed;
|
||||
if(length > (ber_tlv_len_t)size) {
|
||||
rval.code = RC_WMORE;
|
||||
rval.consumed = 0;
|
||||
return rval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute boolean value.
|
||||
*/
|
||||
for(*st = 0, lidx = 0;
|
||||
(lidx < length) && *st == 0; lidx++) {
|
||||
/*
|
||||
* Very simple approach: read bytes until the end or
|
||||
* value is already TRUE.
|
||||
* BOOLEAN is not supposed to contain meaningful data anyway.
|
||||
*/
|
||||
*st |= ((const uint8_t *)buf_ptr)[lidx];
|
||||
}
|
||||
|
||||
rval.code = RC_OK;
|
||||
rval.consumed += length;
|
||||
|
||||
ASN_DEBUG("Took %ld/%ld bytes to encode %s, value=%d",
|
||||
(long)rval.consumed, (long)length,
|
||||
td->name, *st);
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
BOOLEAN_encode_der(asn_TYPE_descriptor_t *td, void *sptr,
|
||||
int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
asn_enc_rval_t erval;
|
||||
BOOLEAN_t *st = (BOOLEAN_t *)sptr;
|
||||
|
||||
erval.encoded = der_write_tags(td, 1, tag_mode, 0, tag, cb, app_key);
|
||||
if(erval.encoded == -1) {
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = sptr;
|
||||
return erval;
|
||||
}
|
||||
|
||||
if(cb) {
|
||||
uint8_t bool_value;
|
||||
|
||||
bool_value = *st ? 0xff : 0; /* 0xff mandated by DER */
|
||||
|
||||
if(cb(&bool_value, 1, app_key) < 0) {
|
||||
erval.encoded = -1;
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = sptr;
|
||||
return erval;
|
||||
}
|
||||
}
|
||||
|
||||
erval.encoded += 1;
|
||||
|
||||
_ASN_ENCODED_OK(erval);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Decode the chunk of XML text encoding INTEGER.
|
||||
*/
|
||||
static enum xer_pbd_rval
|
||||
BOOLEAN__xer_body_decode(asn_TYPE_descriptor_t *td, void *sptr, const void *chunk_buf, size_t chunk_size) {
|
||||
BOOLEAN_t *st = (BOOLEAN_t *)sptr;
|
||||
const char *p = (const char *)chunk_buf;
|
||||
|
||||
(void)td;
|
||||
|
||||
if(chunk_size && p[0] == 0x3c /* '<' */) {
|
||||
switch(xer_check_tag(chunk_buf, chunk_size, "false")) {
|
||||
case XCT_BOTH:
|
||||
/* "<false/>" */
|
||||
*st = 0;
|
||||
break;
|
||||
case XCT_UNKNOWN_BO:
|
||||
if(xer_check_tag(chunk_buf, chunk_size, "true")
|
||||
!= XCT_BOTH)
|
||||
return XPBD_BROKEN_ENCODING;
|
||||
/* "<true/>" */
|
||||
*st = 1; /* Or 0xff as in DER?.. */
|
||||
break;
|
||||
default:
|
||||
return XPBD_BROKEN_ENCODING;
|
||||
}
|
||||
return XPBD_BODY_CONSUMED;
|
||||
} else {
|
||||
return XPBD_BROKEN_ENCODING;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
asn_dec_rval_t
|
||||
BOOLEAN_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
|
||||
asn_TYPE_descriptor_t *td, void **sptr, const char *opt_mname,
|
||||
const void *buf_ptr, size_t size) {
|
||||
|
||||
return xer_decode_primitive(opt_codec_ctx, td,
|
||||
sptr, sizeof(BOOLEAN_t), opt_mname, buf_ptr, size,
|
||||
BOOLEAN__xer_body_decode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
BOOLEAN_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
|
||||
asn_enc_rval_t er;
|
||||
|
||||
(void)ilevel;
|
||||
(void)flags;
|
||||
|
||||
if(!st) _ASN_ENCODE_FAILED;
|
||||
|
||||
if(*st) {
|
||||
_ASN_CALLBACK("<true/>", 7);
|
||||
er.encoded = 7;
|
||||
} else {
|
||||
_ASN_CALLBACK("<false/>", 8);
|
||||
er.encoded = 8;
|
||||
}
|
||||
|
||||
_ASN_ENCODED_OK(er);
|
||||
cb_failed:
|
||||
_ASN_ENCODE_FAILED;
|
||||
}
|
||||
|
||||
int
|
||||
BOOLEAN_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
|
||||
const char *buf;
|
||||
size_t buflen;
|
||||
|
||||
(void)td; /* Unused argument */
|
||||
(void)ilevel; /* Unused argument */
|
||||
|
||||
if(st) {
|
||||
if(*st) {
|
||||
buf = "TRUE";
|
||||
buflen = 4;
|
||||
} else {
|
||||
buf = "FALSE";
|
||||
buflen = 5;
|
||||
}
|
||||
} else {
|
||||
buf = "<absent>";
|
||||
buflen = 8;
|
||||
}
|
||||
|
||||
return (cb(buf, buflen, app_key) < 0) ? -1 : 0;
|
||||
}
|
||||
|
||||
void
|
||||
BOOLEAN_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
|
||||
if(td && ptr && !contents_only) {
|
||||
FREEMEM(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
BOOLEAN_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
|
||||
asn_dec_rval_t rv;
|
||||
BOOLEAN_t *st = (BOOLEAN_t *)*sptr;
|
||||
|
||||
(void)opt_codec_ctx;
|
||||
(void)constraints;
|
||||
|
||||
if(!st) {
|
||||
st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st)));
|
||||
if(!st) _ASN_DECODE_FAILED;
|
||||
}
|
||||
|
||||
/*
|
||||
* Extract a single bit
|
||||
*/
|
||||
switch(per_get_few_bits(pd, 1)) {
|
||||
case 1: *st = 1; break;
|
||||
case 0: *st = 0; break;
|
||||
case -1: default: _ASN_DECODE_STARVED;
|
||||
}
|
||||
|
||||
ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE");
|
||||
|
||||
rv.code = RC_OK;
|
||||
rv.consumed = 1;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
asn_enc_rval_t
|
||||
BOOLEAN_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
|
||||
const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
|
||||
asn_enc_rval_t er = { 0, 0, 0 };
|
||||
|
||||
(void)constraints;
|
||||
|
||||
if(!st) _ASN_ENCODE_FAILED;
|
||||
|
||||
if(per_put_few_bits(po, *st ? 1 : 0, 1))
|
||||
_ASN_ENCODE_FAILED;
|
||||
|
||||
_ASN_ENCODED_OK(er);
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
/*-
|
||||
* Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#ifndef _BOOLEAN_H_
|
||||
#define _BOOLEAN_H_
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The underlying integer may contain various values, but everything
|
||||
* non-zero is capped to 0xff by the DER encoder. The BER decoder may
|
||||
* yield non-zero values different from 1, beware.
|
||||
*/
|
||||
typedef int BOOLEAN_t;
|
||||
|
||||
extern asn_TYPE_descriptor_t asn_DEF_BOOLEAN;
|
||||
|
||||
asn_struct_free_f BOOLEAN_free;
|
||||
asn_struct_print_f BOOLEAN_print;
|
||||
ber_type_decoder_f BOOLEAN_decode_ber;
|
||||
der_type_encoder_f BOOLEAN_encode_der;
|
||||
xer_type_decoder_f BOOLEAN_decode_xer;
|
||||
xer_type_encoder_f BOOLEAN_encode_xer;
|
||||
per_type_decoder_f BOOLEAN_decode_uper;
|
||||
per_type_encoder_f BOOLEAN_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _BOOLEAN_H_ */
|
@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "CSG-Identity.h"
|
||||
|
||||
int
|
||||
CSG_Identity_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
|
||||
size_t size;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(st->size > 0) {
|
||||
/* Size in bits */
|
||||
size = 8 * st->size - (st->bits_unused & 0x07);
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
if((size == 27)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using BIT_STRING,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_BIT_STRING.free_struct;
|
||||
td->print_struct = asn_DEF_BIT_STRING.print_struct;
|
||||
td->check_constraints = asn_DEF_BIT_STRING.check_constraints;
|
||||
td->ber_decoder = asn_DEF_BIT_STRING.ber_decoder;
|
||||
td->der_encoder = asn_DEF_BIT_STRING.der_encoder;
|
||||
td->xer_decoder = asn_DEF_BIT_STRING.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_BIT_STRING.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_BIT_STRING.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_BIT_STRING.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_BIT_STRING.per_constraints;
|
||||
td->elements = asn_DEF_BIT_STRING.elements;
|
||||
td->elements_count = asn_DEF_BIT_STRING.elements_count;
|
||||
td->specifics = asn_DEF_BIT_STRING.specifics;
|
||||
}
|
||||
|
||||
void
|
||||
CSG_Identity_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
CSG_Identity_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
CSG_Identity_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
CSG_Identity_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
CSG_Identity_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
CSG_Identity_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
CSG_Identity_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
CSG_Identity_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
CSG_Identity_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_CSG_Identity_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 0, 0, 27, 27 } /* (SIZE(27..27)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_CSG_Identity_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_CSG_Identity = {
|
||||
"CSG-Identity",
|
||||
"CSG-Identity",
|
||||
CSG_Identity_free,
|
||||
CSG_Identity_print,
|
||||
CSG_Identity_constraint,
|
||||
CSG_Identity_decode_ber,
|
||||
CSG_Identity_encode_der,
|
||||
CSG_Identity_decode_xer,
|
||||
CSG_Identity_encode_xer,
|
||||
CSG_Identity_decode_uper,
|
||||
CSG_Identity_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_CSG_Identity_tags_1,
|
||||
sizeof(asn_DEF_CSG_Identity_tags_1)
|
||||
/sizeof(asn_DEF_CSG_Identity_tags_1[0]), /* 1 */
|
||||
asn_DEF_CSG_Identity_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_CSG_Identity_tags_1)
|
||||
/sizeof(asn_DEF_CSG_Identity_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_CSG_Identity_constr_1,
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _CSG_Identity_H_
|
||||
#define _CSG_Identity_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <BIT_STRING.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* CSG-Identity */
|
||||
typedef BIT_STRING_t CSG_Identity_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_CSG_Identity;
|
||||
asn_struct_free_f CSG_Identity_free;
|
||||
asn_struct_print_f CSG_Identity_print;
|
||||
asn_constr_check_f CSG_Identity_constraint;
|
||||
ber_type_decoder_f CSG_Identity_decode_ber;
|
||||
der_type_encoder_f CSG_Identity_encode_der;
|
||||
xer_type_decoder_f CSG_Identity_decode_xer;
|
||||
xer_type_encoder_f CSG_Identity_encode_xer;
|
||||
per_type_decoder_f CSG_Identity_decode_uper;
|
||||
per_type_encoder_f CSG_Identity_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CSG_Identity_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "CellIdentity.h"
|
||||
|
||||
int
|
||||
CellIdentity_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
|
||||
size_t size;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(st->size > 0) {
|
||||
/* Size in bits */
|
||||
size = 8 * st->size - (st->bits_unused & 0x07);
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
if((size == 28)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using BIT_STRING,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
CellIdentity_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_BIT_STRING.free_struct;
|
||||
td->print_struct = asn_DEF_BIT_STRING.print_struct;
|
||||
td->check_constraints = asn_DEF_BIT_STRING.check_constraints;
|
||||
td->ber_decoder = asn_DEF_BIT_STRING.ber_decoder;
|
||||
td->der_encoder = asn_DEF_BIT_STRING.der_encoder;
|
||||
td->xer_decoder = asn_DEF_BIT_STRING.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_BIT_STRING.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_BIT_STRING.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_BIT_STRING.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_BIT_STRING.per_constraints;
|
||||
td->elements = asn_DEF_BIT_STRING.elements;
|
||||
td->elements_count = asn_DEF_BIT_STRING.elements_count;
|
||||
td->specifics = asn_DEF_BIT_STRING.specifics;
|
||||
}
|
||||
|
||||
void
|
||||
CellIdentity_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
CellIdentity_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
CellIdentity_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
CellIdentity_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
CellIdentity_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
CellIdentity_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
CellIdentity_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
CellIdentity_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
CellIdentity_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_CellIdentity_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 0, 0, 28, 28 } /* (SIZE(28..28)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_CellIdentity_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_CellIdentity = {
|
||||
"CellIdentity",
|
||||
"CellIdentity",
|
||||
CellIdentity_free,
|
||||
CellIdentity_print,
|
||||
CellIdentity_constraint,
|
||||
CellIdentity_decode_ber,
|
||||
CellIdentity_encode_der,
|
||||
CellIdentity_decode_xer,
|
||||
CellIdentity_encode_xer,
|
||||
CellIdentity_decode_uper,
|
||||
CellIdentity_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_CellIdentity_tags_1,
|
||||
sizeof(asn_DEF_CellIdentity_tags_1)
|
||||
/sizeof(asn_DEF_CellIdentity_tags_1[0]), /* 1 */
|
||||
asn_DEF_CellIdentity_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_CellIdentity_tags_1)
|
||||
/sizeof(asn_DEF_CellIdentity_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_CellIdentity_constr_1,
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _CellIdentity_H_
|
||||
#define _CellIdentity_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <BIT_STRING.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* CellIdentity */
|
||||
typedef BIT_STRING_t CellIdentity_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_CellIdentity;
|
||||
asn_struct_free_f CellIdentity_free;
|
||||
asn_struct_print_f CellIdentity_print;
|
||||
asn_constr_check_f CellIdentity_constraint;
|
||||
ber_type_decoder_f CellIdentity_decode_ber;
|
||||
der_type_encoder_f CellIdentity_encode_der;
|
||||
xer_type_decoder_f CellIdentity_decode_xer;
|
||||
xer_type_encoder_f CellIdentity_encode_xer;
|
||||
per_type_decoder_f CellIdentity_decode_uper;
|
||||
per_type_encoder_f CellIdentity_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CellIdentity_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "CellSelectionInfo-v920.h"
|
||||
|
||||
static int
|
||||
memb_q_QualMinOffset_r9_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= 1 && value <= 8)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_memb_q_QualMinOffset_r9_constr_3 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 3, 3, 1, 8 } /* (1..8) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_TYPE_member_t asn_MBR_CellSelectionInfo_v920_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct CellSelectionInfo_v920, q_QualMin_r9),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_Q_QualMin_r9,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"q-QualMin-r9"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct CellSelectionInfo_v920, q_QualMinOffset_r9),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_NativeInteger,
|
||||
memb_q_QualMinOffset_r9_constraint_1,
|
||||
&asn_PER_memb_q_QualMinOffset_r9_constr_3,
|
||||
0,
|
||||
"q-QualMinOffset-r9"
|
||||
},
|
||||
};
|
||||
static const int asn_MAP_CellSelectionInfo_v920_oms_1[] = { 1 };
|
||||
static const ber_tlv_tag_t asn_DEF_CellSelectionInfo_v920_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_CellSelectionInfo_v920_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* q-QualMin-r9 */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* q-QualMinOffset-r9 */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_CellSelectionInfo_v920_specs_1 = {
|
||||
sizeof(struct CellSelectionInfo_v920),
|
||||
offsetof(struct CellSelectionInfo_v920, _asn_ctx),
|
||||
asn_MAP_CellSelectionInfo_v920_tag2el_1,
|
||||
2, /* Count of tags in the map */
|
||||
asn_MAP_CellSelectionInfo_v920_oms_1, /* Optional members */
|
||||
1, 0, /* Root/Additions */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_CellSelectionInfo_v920 = {
|
||||
"CellSelectionInfo-v920",
|
||||
"CellSelectionInfo-v920",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_CellSelectionInfo_v920_tags_1,
|
||||
sizeof(asn_DEF_CellSelectionInfo_v920_tags_1)
|
||||
/sizeof(asn_DEF_CellSelectionInfo_v920_tags_1[0]), /* 1 */
|
||||
asn_DEF_CellSelectionInfo_v920_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_CellSelectionInfo_v920_tags_1)
|
||||
/sizeof(asn_DEF_CellSelectionInfo_v920_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_CellSelectionInfo_v920_1,
|
||||
2, /* Elements count */
|
||||
&asn_SPC_CellSelectionInfo_v920_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _CellSelectionInfo_v920_H_
|
||||
#define _CellSelectionInfo_v920_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include "Q-QualMin-r9.h"
|
||||
#include <NativeInteger.h>
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* CellSelectionInfo-v920 */
|
||||
typedef struct CellSelectionInfo_v920 {
|
||||
Q_QualMin_r9_t q_QualMin_r9;
|
||||
long *q_QualMinOffset_r9 /* OPTIONAL */;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} CellSelectionInfo_v920_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_CellSelectionInfo_v920;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CellSelectionInfo_v920_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "MCC-MNC-Digit.h"
|
||||
|
||||
int
|
||||
MCC_MNC_Digit_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= 0 && value <= 9)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeInteger,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeInteger.free_struct;
|
||||
td->print_struct = asn_DEF_NativeInteger.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeInteger.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeInteger.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeInteger.per_constraints;
|
||||
td->elements = asn_DEF_NativeInteger.elements;
|
||||
td->elements_count = asn_DEF_NativeInteger.elements_count;
|
||||
td->specifics = asn_DEF_NativeInteger.specifics;
|
||||
}
|
||||
|
||||
void
|
||||
MCC_MNC_Digit_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
MCC_MNC_Digit_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
MCC_MNC_Digit_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
MCC_MNC_Digit_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
MCC_MNC_Digit_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
MCC_MNC_Digit_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
MCC_MNC_Digit_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
MCC_MNC_Digit_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
MCC_MNC_Digit_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_MCC_MNC_Digit_constr_1 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 4, 4, 0, 9 } /* (0..9) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_MCC_MNC_Digit_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_MCC_MNC_Digit = {
|
||||
"MCC-MNC-Digit",
|
||||
"MCC-MNC-Digit",
|
||||
MCC_MNC_Digit_free,
|
||||
MCC_MNC_Digit_print,
|
||||
MCC_MNC_Digit_constraint,
|
||||
MCC_MNC_Digit_decode_ber,
|
||||
MCC_MNC_Digit_encode_der,
|
||||
MCC_MNC_Digit_decode_xer,
|
||||
MCC_MNC_Digit_encode_xer,
|
||||
MCC_MNC_Digit_decode_uper,
|
||||
MCC_MNC_Digit_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_MCC_MNC_Digit_tags_1,
|
||||
sizeof(asn_DEF_MCC_MNC_Digit_tags_1)
|
||||
/sizeof(asn_DEF_MCC_MNC_Digit_tags_1[0]), /* 1 */
|
||||
asn_DEF_MCC_MNC_Digit_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_MCC_MNC_Digit_tags_1)
|
||||
/sizeof(asn_DEF_MCC_MNC_Digit_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_MCC_MNC_Digit_constr_1,
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _MCC_MNC_Digit_H_
|
||||
#define _MCC_MNC_Digit_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeInteger.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* MCC-MNC-Digit */
|
||||
typedef long MCC_MNC_Digit_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_MCC_MNC_Digit;
|
||||
asn_struct_free_f MCC_MNC_Digit_free;
|
||||
asn_struct_print_f MCC_MNC_Digit_print;
|
||||
asn_constr_check_f MCC_MNC_Digit_constraint;
|
||||
ber_type_decoder_f MCC_MNC_Digit_decode_ber;
|
||||
der_type_encoder_f MCC_MNC_Digit_encode_der;
|
||||
xer_type_decoder_f MCC_MNC_Digit_decode_xer;
|
||||
xer_type_encoder_f MCC_MNC_Digit_encode_xer;
|
||||
per_type_decoder_f MCC_MNC_Digit_decode_uper;
|
||||
per_type_encoder_f MCC_MNC_Digit_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _MCC_MNC_Digit_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "MCC.h"
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_MCC_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 0, 0, 3, 3 } /* (SIZE(3..3)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_TYPE_member_t asn_MBR_MCC_1[] = {
|
||||
{ ATF_POINTER, 0, 0,
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
|
||||
0,
|
||||
&asn_DEF_MCC_MNC_Digit,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
""
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_MCC_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static asn_SET_OF_specifics_t asn_SPC_MCC_specs_1 = {
|
||||
sizeof(struct MCC),
|
||||
offsetof(struct MCC, _asn_ctx),
|
||||
0, /* XER encoding is XMLDelimitedItemList */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_MCC = {
|
||||
"MCC",
|
||||
"MCC",
|
||||
SEQUENCE_OF_free,
|
||||
SEQUENCE_OF_print,
|
||||
SEQUENCE_OF_constraint,
|
||||
SEQUENCE_OF_decode_ber,
|
||||
SEQUENCE_OF_encode_der,
|
||||
SEQUENCE_OF_decode_xer,
|
||||
SEQUENCE_OF_encode_xer,
|
||||
SEQUENCE_OF_decode_uper,
|
||||
SEQUENCE_OF_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_MCC_tags_1,
|
||||
sizeof(asn_DEF_MCC_tags_1)
|
||||
/sizeof(asn_DEF_MCC_tags_1[0]), /* 1 */
|
||||
asn_DEF_MCC_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_MCC_tags_1)
|
||||
/sizeof(asn_DEF_MCC_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_MCC_constr_1,
|
||||
asn_MBR_MCC_1,
|
||||
1, /* Single element */
|
||||
&asn_SPC_MCC_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _MCC_H_
|
||||
#define _MCC_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include "MCC-MNC-Digit.h"
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
#include <constr_SEQUENCE_OF.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* MCC */
|
||||
typedef struct MCC {
|
||||
A_SEQUENCE_OF(MCC_MNC_Digit_t) list;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} MCC_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_MCC;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _MCC_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "MNC.h"
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_MNC_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 1, 1, 2, 3 } /* (SIZE(2..3)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_TYPE_member_t asn_MBR_MNC_1[] = {
|
||||
{ ATF_POINTER, 0, 0,
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
|
||||
0,
|
||||
&asn_DEF_MCC_MNC_Digit,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
""
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_MNC_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static asn_SET_OF_specifics_t asn_SPC_MNC_specs_1 = {
|
||||
sizeof(struct MNC),
|
||||
offsetof(struct MNC, _asn_ctx),
|
||||
0, /* XER encoding is XMLDelimitedItemList */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_MNC = {
|
||||
"MNC",
|
||||
"MNC",
|
||||
SEQUENCE_OF_free,
|
||||
SEQUENCE_OF_print,
|
||||
SEQUENCE_OF_constraint,
|
||||
SEQUENCE_OF_decode_ber,
|
||||
SEQUENCE_OF_encode_der,
|
||||
SEQUENCE_OF_decode_xer,
|
||||
SEQUENCE_OF_encode_xer,
|
||||
SEQUENCE_OF_decode_uper,
|
||||
SEQUENCE_OF_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_MNC_tags_1,
|
||||
sizeof(asn_DEF_MNC_tags_1)
|
||||
/sizeof(asn_DEF_MNC_tags_1[0]), /* 1 */
|
||||
asn_DEF_MNC_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_MNC_tags_1)
|
||||
/sizeof(asn_DEF_MNC_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_MNC_constr_1,
|
||||
asn_MBR_MNC_1,
|
||||
1, /* Single element */
|
||||
&asn_SPC_MNC_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _MNC_H_
|
||||
#define _MNC_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include "MCC-MNC-Digit.h"
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
#include <constr_SEQUENCE_OF.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* MNC */
|
||||
typedef struct MNC {
|
||||
A_SEQUENCE_OF(MCC_MNC_Digit_t) list;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} MNC_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_MNC;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _MNC_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "P-Max.h"
|
||||
|
||||
int
|
||||
P_Max_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= -30 && value <= 33)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeInteger,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
P_Max_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeInteger.free_struct;
|
||||
td->print_struct = asn_DEF_NativeInteger.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeInteger.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeInteger.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeInteger.per_constraints;
|
||||
td->elements = asn_DEF_NativeInteger.elements;
|
||||
td->elements_count = asn_DEF_NativeInteger.elements_count;
|
||||
td->specifics = asn_DEF_NativeInteger.specifics;
|
||||
}
|
||||
|
||||
void
|
||||
P_Max_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
P_Max_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
P_Max_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
P_Max_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
P_Max_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
P_Max_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
P_Max_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
P_Max_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
P_Max_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_P_Max_constr_1 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 6, 6, -30, 33 } /* (-30..33) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_P_Max_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_P_Max = {
|
||||
"P-Max",
|
||||
"P-Max",
|
||||
P_Max_free,
|
||||
P_Max_print,
|
||||
P_Max_constraint,
|
||||
P_Max_decode_ber,
|
||||
P_Max_encode_der,
|
||||
P_Max_decode_xer,
|
||||
P_Max_encode_xer,
|
||||
P_Max_decode_uper,
|
||||
P_Max_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_P_Max_tags_1,
|
||||
sizeof(asn_DEF_P_Max_tags_1)
|
||||
/sizeof(asn_DEF_P_Max_tags_1[0]), /* 1 */
|
||||
asn_DEF_P_Max_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_P_Max_tags_1)
|
||||
/sizeof(asn_DEF_P_Max_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_P_Max_constr_1,
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _P_Max_H_
|
||||
#define _P_Max_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeInteger.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* P-Max */
|
||||
typedef long P_Max_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_P_Max;
|
||||
asn_struct_free_f P_Max_free;
|
||||
asn_struct_print_f P_Max_print;
|
||||
asn_constr_check_f P_Max_constraint;
|
||||
ber_type_decoder_f P_Max_decode_ber;
|
||||
der_type_encoder_f P_Max_encode_der;
|
||||
xer_type_decoder_f P_Max_decode_xer;
|
||||
xer_type_encoder_f P_Max_encode_xer;
|
||||
per_type_decoder_f P_Max_decode_uper;
|
||||
per_type_encoder_f P_Max_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _P_Max_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "PLMN-Identity.h"
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_PLMN_Identity_1[] = {
|
||||
{ ATF_POINTER, 1, offsetof(struct PLMN_Identity, mcc),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_MCC,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"mcc"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct PLMN_Identity, mnc),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_MNC,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"mnc"
|
||||
},
|
||||
};
|
||||
static const int asn_MAP_PLMN_Identity_oms_1[] = { 0 };
|
||||
static const ber_tlv_tag_t asn_DEF_PLMN_Identity_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_PLMN_Identity_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* mcc */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* mnc */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_PLMN_Identity_specs_1 = {
|
||||
sizeof(struct PLMN_Identity),
|
||||
offsetof(struct PLMN_Identity, _asn_ctx),
|
||||
asn_MAP_PLMN_Identity_tag2el_1,
|
||||
2, /* Count of tags in the map */
|
||||
asn_MAP_PLMN_Identity_oms_1, /* Optional members */
|
||||
1, 0, /* Root/Additions */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_PLMN_Identity = {
|
||||
"PLMN-Identity",
|
||||
"PLMN-Identity",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_PLMN_Identity_tags_1,
|
||||
sizeof(asn_DEF_PLMN_Identity_tags_1)
|
||||
/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
|
||||
asn_DEF_PLMN_Identity_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_PLMN_Identity_tags_1)
|
||||
/sizeof(asn_DEF_PLMN_Identity_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_PLMN_Identity_1,
|
||||
2, /* Elements count */
|
||||
&asn_SPC_PLMN_Identity_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _PLMN_Identity_H_
|
||||
#define _PLMN_Identity_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include "MNC.h"
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct MCC;
|
||||
|
||||
/* PLMN-Identity */
|
||||
typedef struct PLMN_Identity {
|
||||
struct MCC *mcc /* OPTIONAL */;
|
||||
MNC_t mnc;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} PLMN_Identity_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_PLMN_Identity;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Referred external types */
|
||||
#include "MCC.h"
|
||||
|
||||
#endif /* _PLMN_Identity_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,209 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "PLMN-IdentityInfo.h"
|
||||
|
||||
static int
|
||||
cellReservedForOperatorUse_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
cellReservedForOperatorUse_3_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
cellReservedForOperatorUse_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
cellReservedForOperatorUse_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
cellReservedForOperatorUse_3_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
cellReservedForOperatorUse_3_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
cellReservedForOperatorUse_3_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
cellReservedForOperatorUse_3_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
cellReservedForOperatorUse_3_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
cellReservedForOperatorUse_3_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_cellReservedForOperatorUse_constr_3 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_cellReservedForOperatorUse_value2enum_3[] = {
|
||||
{ 0, 8, "reserved" },
|
||||
{ 1, 11, "notReserved" }
|
||||
};
|
||||
static const unsigned int asn_MAP_cellReservedForOperatorUse_enum2value_3[] = {
|
||||
1, /* notReserved(1) */
|
||||
0 /* reserved(0) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_cellReservedForOperatorUse_specs_3 = {
|
||||
asn_MAP_cellReservedForOperatorUse_value2enum_3, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_cellReservedForOperatorUse_enum2value_3, /* N => "tag"; sorted by N */
|
||||
2, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_cellReservedForOperatorUse_tags_3[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_cellReservedForOperatorUse_3 = {
|
||||
"cellReservedForOperatorUse",
|
||||
"cellReservedForOperatorUse",
|
||||
cellReservedForOperatorUse_3_free,
|
||||
cellReservedForOperatorUse_3_print,
|
||||
cellReservedForOperatorUse_3_constraint,
|
||||
cellReservedForOperatorUse_3_decode_ber,
|
||||
cellReservedForOperatorUse_3_encode_der,
|
||||
cellReservedForOperatorUse_3_decode_xer,
|
||||
cellReservedForOperatorUse_3_encode_xer,
|
||||
cellReservedForOperatorUse_3_decode_uper,
|
||||
cellReservedForOperatorUse_3_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_cellReservedForOperatorUse_tags_3,
|
||||
sizeof(asn_DEF_cellReservedForOperatorUse_tags_3)
|
||||
/sizeof(asn_DEF_cellReservedForOperatorUse_tags_3[0]) - 1, /* 1 */
|
||||
asn_DEF_cellReservedForOperatorUse_tags_3, /* Same as above */
|
||||
sizeof(asn_DEF_cellReservedForOperatorUse_tags_3)
|
||||
/sizeof(asn_DEF_cellReservedForOperatorUse_tags_3[0]), /* 2 */
|
||||
&asn_PER_type_cellReservedForOperatorUse_constr_3,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_cellReservedForOperatorUse_specs_3 /* Additional specs */
|
||||
};
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_PLMN_IdentityInfo_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct PLMN_IdentityInfo, plmn_Identity),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_PLMN_Identity,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"plmn-Identity"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct PLMN_IdentityInfo, cellReservedForOperatorUse),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_cellReservedForOperatorUse_3,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"cellReservedForOperatorUse"
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_PLMN_IdentityInfo_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_PLMN_IdentityInfo_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-Identity */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* cellReservedForOperatorUse */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_PLMN_IdentityInfo_specs_1 = {
|
||||
sizeof(struct PLMN_IdentityInfo),
|
||||
offsetof(struct PLMN_IdentityInfo, _asn_ctx),
|
||||
asn_MAP_PLMN_IdentityInfo_tag2el_1,
|
||||
2, /* Count of tags in the map */
|
||||
0, 0, 0, /* Optional elements (not needed) */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_PLMN_IdentityInfo = {
|
||||
"PLMN-IdentityInfo",
|
||||
"PLMN-IdentityInfo",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_PLMN_IdentityInfo_tags_1,
|
||||
sizeof(asn_DEF_PLMN_IdentityInfo_tags_1)
|
||||
/sizeof(asn_DEF_PLMN_IdentityInfo_tags_1[0]), /* 1 */
|
||||
asn_DEF_PLMN_IdentityInfo_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_PLMN_IdentityInfo_tags_1)
|
||||
/sizeof(asn_DEF_PLMN_IdentityInfo_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_PLMN_IdentityInfo_1,
|
||||
2, /* Elements count */
|
||||
&asn_SPC_PLMN_IdentityInfo_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _PLMN_IdentityInfo_H_
|
||||
#define _PLMN_IdentityInfo_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include "PLMN-Identity.h"
|
||||
#include <NativeEnumerated.h>
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Dependencies */
|
||||
typedef enum cellReservedForOperatorUse {
|
||||
cellReservedForOperatorUse_reserved = 0,
|
||||
cellReservedForOperatorUse_notReserved = 1
|
||||
} e_cellReservedForOperatorUse;
|
||||
|
||||
/* PLMN-IdentityInfo */
|
||||
typedef struct PLMN_IdentityInfo {
|
||||
PLMN_Identity_t plmn_Identity;
|
||||
long cellReservedForOperatorUse;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} PLMN_IdentityInfo_t;
|
||||
|
||||
/* Implementation */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_cellReservedForOperatorUse_3; // (Use -fall-defs-global to expose) */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_PLMN_IdentityInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _PLMN_IdentityInfo_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "PLMN-IdentityList.h"
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_PLMN_IdentityList_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 3, 3, 1, 6 } /* (SIZE(1..6)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_TYPE_member_t asn_MBR_PLMN_IdentityList_1[] = {
|
||||
{ ATF_POINTER, 0, 0,
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
|
||||
0,
|
||||
&asn_DEF_PLMN_IdentityInfo,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
""
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_PLMN_IdentityList_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static asn_SET_OF_specifics_t asn_SPC_PLMN_IdentityList_specs_1 = {
|
||||
sizeof(struct PLMN_IdentityList),
|
||||
offsetof(struct PLMN_IdentityList, _asn_ctx),
|
||||
0, /* XER encoding is XMLDelimitedItemList */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_PLMN_IdentityList = {
|
||||
"PLMN-IdentityList",
|
||||
"PLMN-IdentityList",
|
||||
SEQUENCE_OF_free,
|
||||
SEQUENCE_OF_print,
|
||||
SEQUENCE_OF_constraint,
|
||||
SEQUENCE_OF_decode_ber,
|
||||
SEQUENCE_OF_encode_der,
|
||||
SEQUENCE_OF_decode_xer,
|
||||
SEQUENCE_OF_encode_xer,
|
||||
SEQUENCE_OF_decode_uper,
|
||||
SEQUENCE_OF_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_PLMN_IdentityList_tags_1,
|
||||
sizeof(asn_DEF_PLMN_IdentityList_tags_1)
|
||||
/sizeof(asn_DEF_PLMN_IdentityList_tags_1[0]), /* 1 */
|
||||
asn_DEF_PLMN_IdentityList_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_PLMN_IdentityList_tags_1)
|
||||
/sizeof(asn_DEF_PLMN_IdentityList_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_PLMN_IdentityList_constr_1,
|
||||
asn_MBR_PLMN_IdentityList_1,
|
||||
1, /* Single element */
|
||||
&asn_SPC_PLMN_IdentityList_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _PLMN_IdentityList_H_
|
||||
#define _PLMN_IdentityList_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
#include <constr_SEQUENCE_OF.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct PLMN_IdentityInfo;
|
||||
|
||||
/* PLMN-IdentityList */
|
||||
typedef struct PLMN_IdentityList {
|
||||
A_SEQUENCE_OF(struct PLMN_IdentityInfo) list;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} PLMN_IdentityList_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_PLMN_IdentityList;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Referred external types */
|
||||
#include "PLMN-IdentityInfo.h"
|
||||
|
||||
#endif /* _PLMN_IdentityList_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "Q-QualMin-r9.h"
|
||||
|
||||
int
|
||||
Q_QualMin_r9_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= -34 && value <= -3)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeInteger,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeInteger.free_struct;
|
||||
td->print_struct = asn_DEF_NativeInteger.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeInteger.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeInteger.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeInteger.per_constraints;
|
||||
td->elements = asn_DEF_NativeInteger.elements;
|
||||
td->elements_count = asn_DEF_NativeInteger.elements_count;
|
||||
td->specifics = asn_DEF_NativeInteger.specifics;
|
||||
}
|
||||
|
||||
void
|
||||
Q_QualMin_r9_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
Q_QualMin_r9_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
Q_QualMin_r9_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
Q_QualMin_r9_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
Q_QualMin_r9_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
Q_QualMin_r9_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
Q_QualMin_r9_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
Q_QualMin_r9_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
Q_QualMin_r9_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_Q_QualMin_r9_constr_1 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 5, 5, -34, -3 } /* (-34..-3) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_Q_QualMin_r9_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_Q_QualMin_r9 = {
|
||||
"Q-QualMin-r9",
|
||||
"Q-QualMin-r9",
|
||||
Q_QualMin_r9_free,
|
||||
Q_QualMin_r9_print,
|
||||
Q_QualMin_r9_constraint,
|
||||
Q_QualMin_r9_decode_ber,
|
||||
Q_QualMin_r9_encode_der,
|
||||
Q_QualMin_r9_decode_xer,
|
||||
Q_QualMin_r9_encode_xer,
|
||||
Q_QualMin_r9_decode_uper,
|
||||
Q_QualMin_r9_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_Q_QualMin_r9_tags_1,
|
||||
sizeof(asn_DEF_Q_QualMin_r9_tags_1)
|
||||
/sizeof(asn_DEF_Q_QualMin_r9_tags_1[0]), /* 1 */
|
||||
asn_DEF_Q_QualMin_r9_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_Q_QualMin_r9_tags_1)
|
||||
/sizeof(asn_DEF_Q_QualMin_r9_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_Q_QualMin_r9_constr_1,
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _Q_QualMin_r9_H_
|
||||
#define _Q_QualMin_r9_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeInteger.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Q-QualMin-r9 */
|
||||
typedef long Q_QualMin_r9_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_Q_QualMin_r9;
|
||||
asn_struct_free_f Q_QualMin_r9_free;
|
||||
asn_struct_print_f Q_QualMin_r9_print;
|
||||
asn_constr_check_f Q_QualMin_r9_constraint;
|
||||
ber_type_decoder_f Q_QualMin_r9_decode_ber;
|
||||
der_type_encoder_f Q_QualMin_r9_encode_der;
|
||||
xer_type_decoder_f Q_QualMin_r9_decode_xer;
|
||||
xer_type_encoder_f Q_QualMin_r9_encode_xer;
|
||||
per_type_decoder_f Q_QualMin_r9_decode_uper;
|
||||
per_type_encoder_f Q_QualMin_r9_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Q_QualMin_r9_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "Q-RxLevMin.h"
|
||||
|
||||
int
|
||||
Q_RxLevMin_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= -70 && value <= -22)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeInteger,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeInteger.free_struct;
|
||||
td->print_struct = asn_DEF_NativeInteger.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeInteger.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeInteger.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeInteger.per_constraints;
|
||||
td->elements = asn_DEF_NativeInteger.elements;
|
||||
td->elements_count = asn_DEF_NativeInteger.elements_count;
|
||||
td->specifics = asn_DEF_NativeInteger.specifics;
|
||||
}
|
||||
|
||||
void
|
||||
Q_RxLevMin_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
Q_RxLevMin_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
Q_RxLevMin_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
Q_RxLevMin_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
Q_RxLevMin_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
Q_RxLevMin_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
Q_RxLevMin_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
Q_RxLevMin_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
Q_RxLevMin_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_Q_RxLevMin_constr_1 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 6, 6, -70, -22 } /* (-70..-22) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_Q_RxLevMin_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_Q_RxLevMin = {
|
||||
"Q-RxLevMin",
|
||||
"Q-RxLevMin",
|
||||
Q_RxLevMin_free,
|
||||
Q_RxLevMin_print,
|
||||
Q_RxLevMin_constraint,
|
||||
Q_RxLevMin_decode_ber,
|
||||
Q_RxLevMin_encode_der,
|
||||
Q_RxLevMin_decode_xer,
|
||||
Q_RxLevMin_encode_xer,
|
||||
Q_RxLevMin_decode_uper,
|
||||
Q_RxLevMin_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_Q_RxLevMin_tags_1,
|
||||
sizeof(asn_DEF_Q_RxLevMin_tags_1)
|
||||
/sizeof(asn_DEF_Q_RxLevMin_tags_1[0]), /* 1 */
|
||||
asn_DEF_Q_RxLevMin_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_Q_RxLevMin_tags_1)
|
||||
/sizeof(asn_DEF_Q_RxLevMin_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_Q_RxLevMin_constr_1,
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _Q_RxLevMin_H_
|
||||
#define _Q_RxLevMin_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeInteger.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Q-RxLevMin */
|
||||
typedef long Q_RxLevMin_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_Q_RxLevMin;
|
||||
asn_struct_free_f Q_RxLevMin_free;
|
||||
asn_struct_print_f Q_RxLevMin_print;
|
||||
asn_constr_check_f Q_RxLevMin_constraint;
|
||||
ber_type_decoder_f Q_RxLevMin_decode_ber;
|
||||
der_type_encoder_f Q_RxLevMin_encode_der;
|
||||
xer_type_decoder_f Q_RxLevMin_decode_xer;
|
||||
xer_type_encoder_f Q_RxLevMin_encode_xer;
|
||||
per_type_decoder_f Q_RxLevMin_decode_uper;
|
||||
per_type_encoder_f Q_RxLevMin_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _Q_RxLevMin_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "SIB-MappingInfo.h"
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_SIB_MappingInfo_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 5, 5, 0, 31 } /* (SIZE(0..31)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_TYPE_member_t asn_MBR_SIB_MappingInfo_1[] = {
|
||||
{ ATF_POINTER, 0, 0,
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),
|
||||
0,
|
||||
&asn_DEF_SIB_Type,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
""
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_SIB_MappingInfo_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static asn_SET_OF_specifics_t asn_SPC_SIB_MappingInfo_specs_1 = {
|
||||
sizeof(struct SIB_MappingInfo),
|
||||
offsetof(struct SIB_MappingInfo, _asn_ctx),
|
||||
1, /* XER encoding is XMLValueList */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_SIB_MappingInfo = {
|
||||
"SIB-MappingInfo",
|
||||
"SIB-MappingInfo",
|
||||
SEQUENCE_OF_free,
|
||||
SEQUENCE_OF_print,
|
||||
SEQUENCE_OF_constraint,
|
||||
SEQUENCE_OF_decode_ber,
|
||||
SEQUENCE_OF_encode_der,
|
||||
SEQUENCE_OF_decode_xer,
|
||||
SEQUENCE_OF_encode_xer,
|
||||
SEQUENCE_OF_decode_uper,
|
||||
SEQUENCE_OF_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_SIB_MappingInfo_tags_1,
|
||||
sizeof(asn_DEF_SIB_MappingInfo_tags_1)
|
||||
/sizeof(asn_DEF_SIB_MappingInfo_tags_1[0]), /* 1 */
|
||||
asn_DEF_SIB_MappingInfo_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_SIB_MappingInfo_tags_1)
|
||||
/sizeof(asn_DEF_SIB_MappingInfo_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_SIB_MappingInfo_constr_1,
|
||||
asn_MBR_SIB_MappingInfo_1,
|
||||
1, /* Single element */
|
||||
&asn_SPC_SIB_MappingInfo_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _SIB_MappingInfo_H_
|
||||
#define _SIB_MappingInfo_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include "SIB-Type.h"
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
#include <constr_SEQUENCE_OF.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* SIB-MappingInfo */
|
||||
typedef struct SIB_MappingInfo {
|
||||
A_SEQUENCE_OF(SIB_Type_t) list;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} SIB_MappingInfo_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_SIB_MappingInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SIB_MappingInfo_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "SIB-Type.h"
|
||||
|
||||
int
|
||||
SIB_Type_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
SIB_Type_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
void
|
||||
SIB_Type_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
SIB_Type_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
SIB_Type_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
SIB_Type_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
SIB_Type_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
SIB_Type_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
SIB_Type_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
SIB_Type_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
SIB_Type_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_SIB_Type_constr_1 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED | APC_EXTENSIBLE, 4, 4, 0, 15 } /* (0..15,...) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_SIB_Type_value2enum_1[] = {
|
||||
{ 0, 8, "sibType3" },
|
||||
{ 1, 8, "sibType4" },
|
||||
{ 2, 8, "sibType5" },
|
||||
{ 3, 8, "sibType6" },
|
||||
{ 4, 8, "sibType7" },
|
||||
{ 5, 8, "sibType8" },
|
||||
{ 6, 8, "sibType9" },
|
||||
{ 7, 9, "sibType10" },
|
||||
{ 8, 9, "sibType11" },
|
||||
{ 9, 14, "sibType12-v920" },
|
||||
{ 10, 14, "sibType13-v920" },
|
||||
{ 11, 6, "spare5" },
|
||||
{ 12, 6, "spare4" },
|
||||
{ 13, 6, "spare3" },
|
||||
{ 14, 6, "spare2" },
|
||||
{ 15, 6, "spare1" }
|
||||
/* This list is extensible */
|
||||
};
|
||||
static const unsigned int asn_MAP_SIB_Type_enum2value_1[] = {
|
||||
7, /* sibType10(7) */
|
||||
8, /* sibType11(8) */
|
||||
9, /* sibType12-v920(9) */
|
||||
10, /* sibType13-v920(10) */
|
||||
0, /* sibType3(0) */
|
||||
1, /* sibType4(1) */
|
||||
2, /* sibType5(2) */
|
||||
3, /* sibType6(3) */
|
||||
4, /* sibType7(4) */
|
||||
5, /* sibType8(5) */
|
||||
6, /* sibType9(6) */
|
||||
15, /* spare1(15) */
|
||||
14, /* spare2(14) */
|
||||
13, /* spare3(13) */
|
||||
12, /* spare4(12) */
|
||||
11 /* spare5(11) */
|
||||
/* This list is extensible */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_SIB_Type_specs_1 = {
|
||||
asn_MAP_SIB_Type_value2enum_1, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_SIB_Type_enum2value_1, /* N => "tag"; sorted by N */
|
||||
16, /* Number of elements in the maps */
|
||||
17, /* Extensions before this member */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_SIB_Type_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_SIB_Type = {
|
||||
"SIB-Type",
|
||||
"SIB-Type",
|
||||
SIB_Type_free,
|
||||
SIB_Type_print,
|
||||
SIB_Type_constraint,
|
||||
SIB_Type_decode_ber,
|
||||
SIB_Type_encode_der,
|
||||
SIB_Type_decode_xer,
|
||||
SIB_Type_encode_xer,
|
||||
SIB_Type_decode_uper,
|
||||
SIB_Type_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_SIB_Type_tags_1,
|
||||
sizeof(asn_DEF_SIB_Type_tags_1)
|
||||
/sizeof(asn_DEF_SIB_Type_tags_1[0]), /* 1 */
|
||||
asn_DEF_SIB_Type_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_SIB_Type_tags_1)
|
||||
/sizeof(asn_DEF_SIB_Type_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_SIB_Type_constr_1,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_SIB_Type_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _SIB_Type_H_
|
||||
#define _SIB_Type_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeEnumerated.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Dependencies */
|
||||
typedef enum SIB_Type {
|
||||
SIB_Type_sibType3 = 0,
|
||||
SIB_Type_sibType4 = 1,
|
||||
SIB_Type_sibType5 = 2,
|
||||
SIB_Type_sibType6 = 3,
|
||||
SIB_Type_sibType7 = 4,
|
||||
SIB_Type_sibType8 = 5,
|
||||
SIB_Type_sibType9 = 6,
|
||||
SIB_Type_sibType10 = 7,
|
||||
SIB_Type_sibType11 = 8,
|
||||
SIB_Type_sibType12_v920 = 9,
|
||||
SIB_Type_sibType13_v920 = 10,
|
||||
SIB_Type_spare5 = 11,
|
||||
SIB_Type_spare4 = 12,
|
||||
SIB_Type_spare3 = 13,
|
||||
SIB_Type_spare2 = 14,
|
||||
SIB_Type_spare1 = 15
|
||||
/*
|
||||
* Enumeration is extensible
|
||||
*/
|
||||
} e_SIB_Type;
|
||||
|
||||
/* SIB-Type */
|
||||
typedef long SIB_Type_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_SIB_Type;
|
||||
asn_struct_free_f SIB_Type_free;
|
||||
asn_struct_print_f SIB_Type_print;
|
||||
asn_constr_check_f SIB_Type_constraint;
|
||||
ber_type_decoder_f SIB_Type_decode_ber;
|
||||
der_type_encoder_f SIB_Type_encode_der;
|
||||
xer_type_decoder_f SIB_Type_decode_xer;
|
||||
xer_type_encoder_f SIB_Type_encode_xer;
|
||||
per_type_decoder_f SIB_Type_decode_uper;
|
||||
per_type_encoder_f SIB_Type_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SIB_Type_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,219 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "SchedulingInfo.h"
|
||||
|
||||
static int
|
||||
si_Periodicity_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
si_Periodicity_2_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
si_Periodicity_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
si_Periodicity_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
si_Periodicity_2_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
si_Periodicity_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
si_Periodicity_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
si_Periodicity_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
si_Periodicity_2_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
si_Periodicity_2_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_si_Periodicity_constr_2 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 3, 3, 0, 6 } /* (0..6) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_si_Periodicity_value2enum_2[] = {
|
||||
{ 0, 3, "rf8" },
|
||||
{ 1, 4, "rf16" },
|
||||
{ 2, 4, "rf32" },
|
||||
{ 3, 4, "rf64" },
|
||||
{ 4, 5, "rf128" },
|
||||
{ 5, 5, "rf256" },
|
||||
{ 6, 5, "rf512" }
|
||||
};
|
||||
static const unsigned int asn_MAP_si_Periodicity_enum2value_2[] = {
|
||||
4, /* rf128(4) */
|
||||
1, /* rf16(1) */
|
||||
5, /* rf256(5) */
|
||||
2, /* rf32(2) */
|
||||
6, /* rf512(6) */
|
||||
3, /* rf64(3) */
|
||||
0 /* rf8(0) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_si_Periodicity_specs_2 = {
|
||||
asn_MAP_si_Periodicity_value2enum_2, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_si_Periodicity_enum2value_2, /* N => "tag"; sorted by N */
|
||||
7, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_si_Periodicity_tags_2[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_si_Periodicity_2 = {
|
||||
"si-Periodicity",
|
||||
"si-Periodicity",
|
||||
si_Periodicity_2_free,
|
||||
si_Periodicity_2_print,
|
||||
si_Periodicity_2_constraint,
|
||||
si_Periodicity_2_decode_ber,
|
||||
si_Periodicity_2_encode_der,
|
||||
si_Periodicity_2_decode_xer,
|
||||
si_Periodicity_2_encode_xer,
|
||||
si_Periodicity_2_decode_uper,
|
||||
si_Periodicity_2_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_si_Periodicity_tags_2,
|
||||
sizeof(asn_DEF_si_Periodicity_tags_2)
|
||||
/sizeof(asn_DEF_si_Periodicity_tags_2[0]) - 1, /* 1 */
|
||||
asn_DEF_si_Periodicity_tags_2, /* Same as above */
|
||||
sizeof(asn_DEF_si_Periodicity_tags_2)
|
||||
/sizeof(asn_DEF_si_Periodicity_tags_2[0]), /* 2 */
|
||||
&asn_PER_type_si_Periodicity_constr_2,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_si_Periodicity_specs_2 /* Additional specs */
|
||||
};
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_SchedulingInfo_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SchedulingInfo, si_Periodicity),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_si_Periodicity_2,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"si-Periodicity"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SchedulingInfo, sib_MappingInfo),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_SIB_MappingInfo,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"sib-MappingInfo"
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_SchedulingInfo_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_SchedulingInfo_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* si-Periodicity */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* sib-MappingInfo */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_SchedulingInfo_specs_1 = {
|
||||
sizeof(struct SchedulingInfo),
|
||||
offsetof(struct SchedulingInfo, _asn_ctx),
|
||||
asn_MAP_SchedulingInfo_tag2el_1,
|
||||
2, /* Count of tags in the map */
|
||||
0, 0, 0, /* Optional elements (not needed) */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_SchedulingInfo = {
|
||||
"SchedulingInfo",
|
||||
"SchedulingInfo",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_SchedulingInfo_tags_1,
|
||||
sizeof(asn_DEF_SchedulingInfo_tags_1)
|
||||
/sizeof(asn_DEF_SchedulingInfo_tags_1[0]), /* 1 */
|
||||
asn_DEF_SchedulingInfo_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_SchedulingInfo_tags_1)
|
||||
/sizeof(asn_DEF_SchedulingInfo_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_SchedulingInfo_1,
|
||||
2, /* Elements count */
|
||||
&asn_SPC_SchedulingInfo_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _SchedulingInfo_H_
|
||||
#define _SchedulingInfo_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeEnumerated.h>
|
||||
#include "SIB-MappingInfo.h"
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Dependencies */
|
||||
typedef enum si_Periodicity {
|
||||
si_Periodicity_rf8 = 0,
|
||||
si_Periodicity_rf16 = 1,
|
||||
si_Periodicity_rf32 = 2,
|
||||
si_Periodicity_rf64 = 3,
|
||||
si_Periodicity_rf128 = 4,
|
||||
si_Periodicity_rf256 = 5,
|
||||
si_Periodicity_rf512 = 6
|
||||
} e_si_Periodicity;
|
||||
|
||||
/* SchedulingInfo */
|
||||
typedef struct SchedulingInfo {
|
||||
long si_Periodicity;
|
||||
SIB_MappingInfo_t sib_MappingInfo;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} SchedulingInfo_t;
|
||||
|
||||
/* Implementation */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_si_Periodicity_2; // (Use -fall-defs-global to expose) */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_SchedulingInfo;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _SchedulingInfo_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "SchedulingInfoList.h"
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_SchedulingInfoList_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 5, 5, 1, 32 } /* (SIZE(1..32)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_TYPE_member_t asn_MBR_SchedulingInfoList_1[] = {
|
||||
{ ATF_POINTER, 0, 0,
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),
|
||||
0,
|
||||
&asn_DEF_SchedulingInfo,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
""
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_SchedulingInfoList_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static asn_SET_OF_specifics_t asn_SPC_SchedulingInfoList_specs_1 = {
|
||||
sizeof(struct SchedulingInfoList),
|
||||
offsetof(struct SchedulingInfoList, _asn_ctx),
|
||||
0, /* XER encoding is XMLDelimitedItemList */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_SchedulingInfoList = {
|
||||
"SchedulingInfoList",
|
||||
"SchedulingInfoList",
|
||||
SEQUENCE_OF_free,
|
||||
SEQUENCE_OF_print,
|
||||
SEQUENCE_OF_constraint,
|
||||
SEQUENCE_OF_decode_ber,
|
||||
SEQUENCE_OF_encode_der,
|
||||
SEQUENCE_OF_decode_xer,
|
||||
SEQUENCE_OF_encode_xer,
|
||||
SEQUENCE_OF_decode_uper,
|
||||
SEQUENCE_OF_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_SchedulingInfoList_tags_1,
|
||||
sizeof(asn_DEF_SchedulingInfoList_tags_1)
|
||||
/sizeof(asn_DEF_SchedulingInfoList_tags_1[0]), /* 1 */
|
||||
asn_DEF_SchedulingInfoList_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_SchedulingInfoList_tags_1)
|
||||
/sizeof(asn_DEF_SchedulingInfoList_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_SchedulingInfoList_constr_1,
|
||||
asn_MBR_SchedulingInfoList_1,
|
||||
1, /* Single element */
|
||||
&asn_SPC_SchedulingInfoList_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _SchedulingInfoList_H_
|
||||
#define _SchedulingInfoList_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
#include <constr_SEQUENCE_OF.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct SchedulingInfo;
|
||||
|
||||
/* SchedulingInfoList */
|
||||
typedef struct SchedulingInfoList {
|
||||
A_SEQUENCE_OF(struct SchedulingInfo) list;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} SchedulingInfoList_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_SchedulingInfoList;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Referred external types */
|
||||
#include "SchedulingInfo.h"
|
||||
|
||||
#endif /* _SchedulingInfoList_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "SystemInformationBlockType1-v890-IEs.h"
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_SystemInformationBlockType1_v890_IEs_1[] = {
|
||||
{ ATF_POINTER, 2, offsetof(struct SystemInformationBlockType1_v890_IEs, lateNonCriticalExtension),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_OCTET_STRING,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"lateNonCriticalExtension"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct SystemInformationBlockType1_v890_IEs, nonCriticalExtension),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_SystemInformationBlockType1_v920_IEs,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"nonCriticalExtension"
|
||||
},
|
||||
};
|
||||
static const int asn_MAP_SystemInformationBlockType1_v890_IEs_oms_1[] = { 0, 1 };
|
||||
static const ber_tlv_tag_t asn_DEF_SystemInformationBlockType1_v890_IEs_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_SystemInformationBlockType1_v890_IEs_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* lateNonCriticalExtension */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* nonCriticalExtension */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_SystemInformationBlockType1_v890_IEs_specs_1 = {
|
||||
sizeof(struct SystemInformationBlockType1_v890_IEs),
|
||||
offsetof(struct SystemInformationBlockType1_v890_IEs, _asn_ctx),
|
||||
asn_MAP_SystemInformationBlockType1_v890_IEs_tag2el_1,
|
||||
2, /* Count of tags in the map */
|
||||
asn_MAP_SystemInformationBlockType1_v890_IEs_oms_1, /* Optional members */
|
||||
2, 0, /* Root/Additions */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_SystemInformationBlockType1_v890_IEs = {
|
||||
"SystemInformationBlockType1-v890-IEs",
|
||||
"SystemInformationBlockType1-v890-IEs",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_SystemInformationBlockType1_v890_IEs_tags_1,
|
||||
sizeof(asn_DEF_SystemInformationBlockType1_v890_IEs_tags_1)
|
||||
/sizeof(asn_DEF_SystemInformationBlockType1_v890_IEs_tags_1[0]), /* 1 */
|
||||
asn_DEF_SystemInformationBlockType1_v890_IEs_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_SystemInformationBlockType1_v890_IEs_tags_1)
|
||||
/sizeof(asn_DEF_SystemInformationBlockType1_v890_IEs_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_SystemInformationBlockType1_v890_IEs_1,
|
||||
2, /* Elements count */
|
||||
&asn_SPC_SystemInformationBlockType1_v890_IEs_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _SystemInformationBlockType1_v890_IEs_H_
|
||||
#define _SystemInformationBlockType1_v890_IEs_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <OCTET_STRING.h>
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declarations */
|
||||
struct SystemInformationBlockType1_v920_IEs;
|
||||
|
||||
/* SystemInformationBlockType1-v890-IEs */
|
||||
typedef struct SystemInformationBlockType1_v890_IEs {
|
||||
OCTET_STRING_t *lateNonCriticalExtension /* OPTIONAL */;
|
||||
struct SystemInformationBlockType1_v920_IEs *nonCriticalExtension /* OPTIONAL */;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} SystemInformationBlockType1_v890_IEs_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_SystemInformationBlockType1_v890_IEs;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Referred external types */
|
||||
#include "SystemInformationBlockType1-v920-IEs.h"
|
||||
|
||||
#endif /* _SystemInformationBlockType1_v890_IEs_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "SystemInformationBlockType1-v920-IEs.h"
|
||||
|
||||
static int
|
||||
ims_EmergencySupport_r9_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
ims_EmergencySupport_r9_2_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
ims_EmergencySupport_r9_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
ims_EmergencySupport_r9_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
ims_EmergencySupport_r9_2_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
ims_EmergencySupport_r9_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
ims_EmergencySupport_r9_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
ims_EmergencySupport_r9_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
ims_EmergencySupport_r9_2_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
ims_EmergencySupport_r9_2_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_ims_EmergencySupport_r9_constr_2 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 0, 0, 0, 0 } /* (0..0) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_ims_EmergencySupport_r9_value2enum_2[] = {
|
||||
{ 0, 4, "true" }
|
||||
};
|
||||
static const unsigned int asn_MAP_ims_EmergencySupport_r9_enum2value_2[] = {
|
||||
0 /* true(0) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_ims_EmergencySupport_r9_specs_2 = {
|
||||
asn_MAP_ims_EmergencySupport_r9_value2enum_2, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_ims_EmergencySupport_r9_enum2value_2, /* N => "tag"; sorted by N */
|
||||
1, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_ims_EmergencySupport_r9_tags_2[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_ims_EmergencySupport_r9_2 = {
|
||||
"ims-EmergencySupport-r9",
|
||||
"ims-EmergencySupport-r9",
|
||||
ims_EmergencySupport_r9_2_free,
|
||||
ims_EmergencySupport_r9_2_print,
|
||||
ims_EmergencySupport_r9_2_constraint,
|
||||
ims_EmergencySupport_r9_2_decode_ber,
|
||||
ims_EmergencySupport_r9_2_encode_der,
|
||||
ims_EmergencySupport_r9_2_decode_xer,
|
||||
ims_EmergencySupport_r9_2_encode_xer,
|
||||
ims_EmergencySupport_r9_2_decode_uper,
|
||||
ims_EmergencySupport_r9_2_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_ims_EmergencySupport_r9_tags_2,
|
||||
sizeof(asn_DEF_ims_EmergencySupport_r9_tags_2)
|
||||
/sizeof(asn_DEF_ims_EmergencySupport_r9_tags_2[0]) - 1, /* 1 */
|
||||
asn_DEF_ims_EmergencySupport_r9_tags_2, /* Same as above */
|
||||
sizeof(asn_DEF_ims_EmergencySupport_r9_tags_2)
|
||||
/sizeof(asn_DEF_ims_EmergencySupport_r9_tags_2[0]), /* 2 */
|
||||
&asn_PER_type_ims_EmergencySupport_r9_constr_2,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_ims_EmergencySupport_r9_specs_2 /* Additional specs */
|
||||
};
|
||||
|
||||
static const ber_tlv_tag_t asn_DEF_nonCriticalExtension_tags_5[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_nonCriticalExtension_specs_5 = {
|
||||
sizeof(struct nonCriticalExtension),
|
||||
offsetof(struct nonCriticalExtension, _asn_ctx),
|
||||
0, /* No top level tags */
|
||||
0, /* No tags in the map */
|
||||
0, 0, 0, /* Optional elements (not needed) */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_nonCriticalExtension_5 = {
|
||||
"nonCriticalExtension",
|
||||
"nonCriticalExtension",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_nonCriticalExtension_tags_5,
|
||||
sizeof(asn_DEF_nonCriticalExtension_tags_5)
|
||||
/sizeof(asn_DEF_nonCriticalExtension_tags_5[0]) - 1, /* 1 */
|
||||
asn_DEF_nonCriticalExtension_tags_5, /* Same as above */
|
||||
sizeof(asn_DEF_nonCriticalExtension_tags_5)
|
||||
/sizeof(asn_DEF_nonCriticalExtension_tags_5[0]), /* 2 */
|
||||
0, /* No PER visible constraints */
|
||||
0, 0, /* No members */
|
||||
&asn_SPC_nonCriticalExtension_specs_5 /* Additional specs */
|
||||
};
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_SystemInformationBlockType1_v920_IEs_1[] = {
|
||||
{ ATF_POINTER, 3, offsetof(struct SystemInformationBlockType1_v920_IEs, ims_EmergencySupport_r9),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_ims_EmergencySupport_r9_2,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"ims-EmergencySupport-r9"
|
||||
},
|
||||
{ ATF_POINTER, 2, offsetof(struct SystemInformationBlockType1_v920_IEs, cellSelectionInfo_v920),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_CellSelectionInfo_v920,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"cellSelectionInfo-v920"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct SystemInformationBlockType1_v920_IEs, nonCriticalExtension),
|
||||
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
|
||||
0,
|
||||
&asn_DEF_nonCriticalExtension_5,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"nonCriticalExtension"
|
||||
},
|
||||
};
|
||||
static const int asn_MAP_SystemInformationBlockType1_v920_IEs_oms_1[] = { 0, 1, 2 };
|
||||
static const ber_tlv_tag_t asn_DEF_SystemInformationBlockType1_v920_IEs_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_SystemInformationBlockType1_v920_IEs_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ims-EmergencySupport-r9 */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* cellSelectionInfo-v920 */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* nonCriticalExtension */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_SystemInformationBlockType1_v920_IEs_specs_1 = {
|
||||
sizeof(struct SystemInformationBlockType1_v920_IEs),
|
||||
offsetof(struct SystemInformationBlockType1_v920_IEs, _asn_ctx),
|
||||
asn_MAP_SystemInformationBlockType1_v920_IEs_tag2el_1,
|
||||
3, /* Count of tags in the map */
|
||||
asn_MAP_SystemInformationBlockType1_v920_IEs_oms_1, /* Optional members */
|
||||
3, 0, /* Root/Additions */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_SystemInformationBlockType1_v920_IEs = {
|
||||
"SystemInformationBlockType1-v920-IEs",
|
||||
"SystemInformationBlockType1-v920-IEs",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_SystemInformationBlockType1_v920_IEs_tags_1,
|
||||
sizeof(asn_DEF_SystemInformationBlockType1_v920_IEs_tags_1)
|
||||
/sizeof(asn_DEF_SystemInformationBlockType1_v920_IEs_tags_1[0]), /* 1 */
|
||||
asn_DEF_SystemInformationBlockType1_v920_IEs_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_SystemInformationBlockType1_v920_IEs_tags_1)
|
||||
/sizeof(asn_DEF_SystemInformationBlockType1_v920_IEs_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_SystemInformationBlockType1_v920_IEs_1,
|
||||
3, /* Elements count */
|
||||
&asn_SPC_SystemInformationBlockType1_v920_IEs_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _SystemInformationBlockType1_v920_IEs_H_
|
||||
#define _SystemInformationBlockType1_v920_IEs_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeEnumerated.h>
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Dependencies */
|
||||
typedef enum ims_EmergencySupport_r9 {
|
||||
ims_EmergencySupport_r9_true = 0
|
||||
} e_ims_EmergencySupport_r9;
|
||||
|
||||
/* Forward declarations */
|
||||
struct CellSelectionInfo_v920;
|
||||
|
||||
/* SystemInformationBlockType1-v920-IEs */
|
||||
typedef struct SystemInformationBlockType1_v920_IEs {
|
||||
long *ims_EmergencySupport_r9 /* OPTIONAL */;
|
||||
struct CellSelectionInfo_v920 *cellSelectionInfo_v920 /* OPTIONAL */;
|
||||
struct nonCriticalExtension {
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} *nonCriticalExtension;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} SystemInformationBlockType1_v920_IEs_t;
|
||||
|
||||
/* Implementation */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_ims_EmergencySupport_r9_2; // (Use -fall-defs-global to expose) */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_SystemInformationBlockType1_v920_IEs;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Referred external types */
|
||||
#include "CellSelectionInfo-v920.h"
|
||||
|
||||
#endif /* _SystemInformationBlockType1_v920_IEs_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,841 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "SystemInformationBlockType1.h"
|
||||
|
||||
static int
|
||||
cellBarred_6_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
cellBarred_6_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
cellBarred_6_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
cellBarred_6_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
cellBarred_6_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
cellBarred_6_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
cellBarred_6_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
cellBarred_6_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
cellBarred_6_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
cellBarred_6_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
cellBarred_6_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static int
|
||||
intraFreqReselection_9_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
intraFreqReselection_9_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
intraFreqReselection_9_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
intraFreqReselection_9_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
intraFreqReselection_9_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
intraFreqReselection_9_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
intraFreqReselection_9_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
intraFreqReselection_9_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
intraFreqReselection_9_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
intraFreqReselection_9_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static int
|
||||
memb_q_RxLevMinOffset_constraint_14(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= 1 && value <= 8)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
si_WindowLength_21_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
si_WindowLength_21_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
si_WindowLength_21_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
si_WindowLength_21_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
si_WindowLength_21_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
si_WindowLength_21_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
si_WindowLength_21_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
si_WindowLength_21_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
si_WindowLength_21_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
si_WindowLength_21_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static int
|
||||
memb_freqBandIndicator_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= 1 && value <= 64)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
memb_systemInfoValueTag_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
long value;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
value = *(const long *)sptr;
|
||||
|
||||
if((value >= 0 && value <= 31)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_cellBarred_constr_6 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_per_constraints_t asn_PER_type_intraFreqReselection_constr_9 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_per_constraints_t asn_PER_memb_q_RxLevMinOffset_constr_16 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 3, 3, 1, 8 } /* (1..8) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_per_constraints_t asn_PER_type_si_WindowLength_constr_21 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 3, 3, 0, 6 } /* (0..6) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_per_constraints_t asn_PER_memb_freqBandIndicator_constr_18 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 6, 6, 1, 64 } /* (1..64) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_per_constraints_t asn_PER_memb_systemInfoValueTag_constr_29 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 5, 5, 0, 31 } /* (0..31) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_cellBarred_value2enum_6[] = {
|
||||
{ 0, 6, "barred" },
|
||||
{ 1, 9, "notBarred" }
|
||||
};
|
||||
static const unsigned int asn_MAP_cellBarred_enum2value_6[] = {
|
||||
0, /* barred(0) */
|
||||
1 /* notBarred(1) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_cellBarred_specs_6 = {
|
||||
asn_MAP_cellBarred_value2enum_6, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_cellBarred_enum2value_6, /* N => "tag"; sorted by N */
|
||||
2, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_cellBarred_tags_6[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_cellBarred_6 = {
|
||||
"cellBarred",
|
||||
"cellBarred",
|
||||
cellBarred_6_free,
|
||||
cellBarred_6_print,
|
||||
cellBarred_6_constraint,
|
||||
cellBarred_6_decode_ber,
|
||||
cellBarred_6_encode_der,
|
||||
cellBarred_6_decode_xer,
|
||||
cellBarred_6_encode_xer,
|
||||
cellBarred_6_decode_uper,
|
||||
cellBarred_6_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_cellBarred_tags_6,
|
||||
sizeof(asn_DEF_cellBarred_tags_6)
|
||||
/sizeof(asn_DEF_cellBarred_tags_6[0]) - 1, /* 1 */
|
||||
asn_DEF_cellBarred_tags_6, /* Same as above */
|
||||
sizeof(asn_DEF_cellBarred_tags_6)
|
||||
/sizeof(asn_DEF_cellBarred_tags_6[0]), /* 2 */
|
||||
&asn_PER_type_cellBarred_constr_6,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_cellBarred_specs_6 /* Additional specs */
|
||||
};
|
||||
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_intraFreqReselection_value2enum_9[] = {
|
||||
{ 0, 7, "allowed" },
|
||||
{ 1, 10, "notAllowed" }
|
||||
};
|
||||
static const unsigned int asn_MAP_intraFreqReselection_enum2value_9[] = {
|
||||
0, /* allowed(0) */
|
||||
1 /* notAllowed(1) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_intraFreqReselection_specs_9 = {
|
||||
asn_MAP_intraFreqReselection_value2enum_9, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_intraFreqReselection_enum2value_9, /* N => "tag"; sorted by N */
|
||||
2, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_intraFreqReselection_tags_9[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_intraFreqReselection_9 = {
|
||||
"intraFreqReselection",
|
||||
"intraFreqReselection",
|
||||
intraFreqReselection_9_free,
|
||||
intraFreqReselection_9_print,
|
||||
intraFreqReselection_9_constraint,
|
||||
intraFreqReselection_9_decode_ber,
|
||||
intraFreqReselection_9_encode_der,
|
||||
intraFreqReselection_9_decode_xer,
|
||||
intraFreqReselection_9_encode_xer,
|
||||
intraFreqReselection_9_decode_uper,
|
||||
intraFreqReselection_9_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_intraFreqReselection_tags_9,
|
||||
sizeof(asn_DEF_intraFreqReselection_tags_9)
|
||||
/sizeof(asn_DEF_intraFreqReselection_tags_9[0]) - 1, /* 1 */
|
||||
asn_DEF_intraFreqReselection_tags_9, /* Same as above */
|
||||
sizeof(asn_DEF_intraFreqReselection_tags_9)
|
||||
/sizeof(asn_DEF_intraFreqReselection_tags_9[0]), /* 2 */
|
||||
&asn_PER_type_intraFreqReselection_constr_9,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_intraFreqReselection_specs_9 /* Additional specs */
|
||||
};
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_cellAccessRelatedInfo_2[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct cellAccessRelatedInfo, plmn_IdentityList),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_PLMN_IdentityList,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"plmn-IdentityList"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct cellAccessRelatedInfo, trackingAreaCode),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_TrackingAreaCode,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"trackingAreaCode"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct cellAccessRelatedInfo, cellIdentity),
|
||||
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_CellIdentity,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"cellIdentity"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct cellAccessRelatedInfo, cellBarred),
|
||||
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_cellBarred_6,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"cellBarred"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct cellAccessRelatedInfo, intraFreqReselection),
|
||||
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_intraFreqReselection_9,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"intraFreqReselection"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct cellAccessRelatedInfo, csg_Indication),
|
||||
(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_BOOLEAN,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"csg-Indication"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct cellAccessRelatedInfo, csg_Identity),
|
||||
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_CSG_Identity,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"csg-Identity"
|
||||
},
|
||||
};
|
||||
static const int asn_MAP_cellAccessRelatedInfo_oms_2[] = { 6 };
|
||||
static const ber_tlv_tag_t asn_DEF_cellAccessRelatedInfo_tags_2[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_cellAccessRelatedInfo_tag2el_2[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* plmn-IdentityList */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* trackingAreaCode */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* cellIdentity */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* cellBarred */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* intraFreqReselection */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* csg-Indication */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 } /* csg-Identity */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_cellAccessRelatedInfo_specs_2 = {
|
||||
sizeof(struct cellAccessRelatedInfo),
|
||||
offsetof(struct cellAccessRelatedInfo, _asn_ctx),
|
||||
asn_MAP_cellAccessRelatedInfo_tag2el_2,
|
||||
7, /* Count of tags in the map */
|
||||
asn_MAP_cellAccessRelatedInfo_oms_2, /* Optional members */
|
||||
1, 0, /* Root/Additions */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_cellAccessRelatedInfo_2 = {
|
||||
"cellAccessRelatedInfo",
|
||||
"cellAccessRelatedInfo",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_cellAccessRelatedInfo_tags_2,
|
||||
sizeof(asn_DEF_cellAccessRelatedInfo_tags_2)
|
||||
/sizeof(asn_DEF_cellAccessRelatedInfo_tags_2[0]) - 1, /* 1 */
|
||||
asn_DEF_cellAccessRelatedInfo_tags_2, /* Same as above */
|
||||
sizeof(asn_DEF_cellAccessRelatedInfo_tags_2)
|
||||
/sizeof(asn_DEF_cellAccessRelatedInfo_tags_2[0]), /* 2 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_cellAccessRelatedInfo_2,
|
||||
7, /* Elements count */
|
||||
&asn_SPC_cellAccessRelatedInfo_specs_2 /* Additional specs */
|
||||
};
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_cellSelectionInfo_14[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct cellSelectionInfo, q_RxLevMin),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_Q_RxLevMin,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"q-RxLevMin"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct cellSelectionInfo, q_RxLevMinOffset),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_NativeInteger,
|
||||
memb_q_RxLevMinOffset_constraint_14,
|
||||
&asn_PER_memb_q_RxLevMinOffset_constr_16,
|
||||
0,
|
||||
"q-RxLevMinOffset"
|
||||
},
|
||||
};
|
||||
static const int asn_MAP_cellSelectionInfo_oms_14[] = { 1 };
|
||||
static const ber_tlv_tag_t asn_DEF_cellSelectionInfo_tags_14[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_cellSelectionInfo_tag2el_14[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* q-RxLevMin */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* q-RxLevMinOffset */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_cellSelectionInfo_specs_14 = {
|
||||
sizeof(struct cellSelectionInfo),
|
||||
offsetof(struct cellSelectionInfo, _asn_ctx),
|
||||
asn_MAP_cellSelectionInfo_tag2el_14,
|
||||
2, /* Count of tags in the map */
|
||||
asn_MAP_cellSelectionInfo_oms_14, /* Optional members */
|
||||
1, 0, /* Root/Additions */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_cellSelectionInfo_14 = {
|
||||
"cellSelectionInfo",
|
||||
"cellSelectionInfo",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_cellSelectionInfo_tags_14,
|
||||
sizeof(asn_DEF_cellSelectionInfo_tags_14)
|
||||
/sizeof(asn_DEF_cellSelectionInfo_tags_14[0]) - 1, /* 1 */
|
||||
asn_DEF_cellSelectionInfo_tags_14, /* Same as above */
|
||||
sizeof(asn_DEF_cellSelectionInfo_tags_14)
|
||||
/sizeof(asn_DEF_cellSelectionInfo_tags_14[0]), /* 2 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_cellSelectionInfo_14,
|
||||
2, /* Elements count */
|
||||
&asn_SPC_cellSelectionInfo_specs_14 /* Additional specs */
|
||||
};
|
||||
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_si_WindowLength_value2enum_21[] = {
|
||||
{ 0, 3, "ms1" },
|
||||
{ 1, 3, "ms2" },
|
||||
{ 2, 3, "ms5" },
|
||||
{ 3, 4, "ms10" },
|
||||
{ 4, 4, "ms15" },
|
||||
{ 5, 4, "ms20" },
|
||||
{ 6, 4, "ms40" }
|
||||
};
|
||||
static const unsigned int asn_MAP_si_WindowLength_enum2value_21[] = {
|
||||
0, /* ms1(0) */
|
||||
3, /* ms10(3) */
|
||||
4, /* ms15(4) */
|
||||
1, /* ms2(1) */
|
||||
5, /* ms20(5) */
|
||||
6, /* ms40(6) */
|
||||
2 /* ms5(2) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_si_WindowLength_specs_21 = {
|
||||
asn_MAP_si_WindowLength_value2enum_21, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_si_WindowLength_enum2value_21, /* N => "tag"; sorted by N */
|
||||
7, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_si_WindowLength_tags_21[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_si_WindowLength_21 = {
|
||||
"si-WindowLength",
|
||||
"si-WindowLength",
|
||||
si_WindowLength_21_free,
|
||||
si_WindowLength_21_print,
|
||||
si_WindowLength_21_constraint,
|
||||
si_WindowLength_21_decode_ber,
|
||||
si_WindowLength_21_encode_der,
|
||||
si_WindowLength_21_decode_xer,
|
||||
si_WindowLength_21_encode_xer,
|
||||
si_WindowLength_21_decode_uper,
|
||||
si_WindowLength_21_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_si_WindowLength_tags_21,
|
||||
sizeof(asn_DEF_si_WindowLength_tags_21)
|
||||
/sizeof(asn_DEF_si_WindowLength_tags_21[0]) - 1, /* 1 */
|
||||
asn_DEF_si_WindowLength_tags_21, /* Same as above */
|
||||
sizeof(asn_DEF_si_WindowLength_tags_21)
|
||||
/sizeof(asn_DEF_si_WindowLength_tags_21[0]), /* 2 */
|
||||
&asn_PER_type_si_WindowLength_constr_21,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_si_WindowLength_specs_21 /* Additional specs */
|
||||
};
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_SystemInformationBlockType1_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SystemInformationBlockType1, cellAccessRelatedInfo),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
0,
|
||||
&asn_DEF_cellAccessRelatedInfo_2,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"cellAccessRelatedInfo"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SystemInformationBlockType1, cellSelectionInfo),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
0,
|
||||
&asn_DEF_cellSelectionInfo_14,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"cellSelectionInfo"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct SystemInformationBlockType1, p_Max),
|
||||
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_P_Max,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"p-Max"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SystemInformationBlockType1, freqBandIndicator),
|
||||
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_NativeInteger,
|
||||
memb_freqBandIndicator_constraint_1,
|
||||
&asn_PER_memb_freqBandIndicator_constr_18,
|
||||
0,
|
||||
"freqBandIndicator"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SystemInformationBlockType1, schedulingInfoList),
|
||||
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_SchedulingInfoList,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"schedulingInfoList"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct SystemInformationBlockType1, tdd_Config),
|
||||
(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_TDD_Config,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"tdd-Config"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SystemInformationBlockType1, si_WindowLength),
|
||||
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_si_WindowLength_21,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"si-WindowLength"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct SystemInformationBlockType1, systemInfoValueTag),
|
||||
(ASN_TAG_CLASS_CONTEXT | (7 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_NativeInteger,
|
||||
memb_systemInfoValueTag_constraint_1,
|
||||
&asn_PER_memb_systemInfoValueTag_constr_29,
|
||||
0,
|
||||
"systemInfoValueTag"
|
||||
},
|
||||
{ ATF_POINTER, 1, offsetof(struct SystemInformationBlockType1, nonCriticalExtension),
|
||||
(ASN_TAG_CLASS_CONTEXT | (8 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_SystemInformationBlockType1_v890_IEs,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"nonCriticalExtension"
|
||||
},
|
||||
};
|
||||
static const int asn_MAP_SystemInformationBlockType1_oms_1[] = { 2, 5, 8 };
|
||||
static const ber_tlv_tag_t asn_DEF_SystemInformationBlockType1_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_SystemInformationBlockType1_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cellAccessRelatedInfo */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* cellSelectionInfo */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* p-Max */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* freqBandIndicator */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* schedulingInfoList */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* tdd-Config */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* si-WindowLength */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 }, /* systemInfoValueTag */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (8 << 2)), 8, 0, 0 } /* nonCriticalExtension */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_SystemInformationBlockType1_specs_1 = {
|
||||
sizeof(struct SystemInformationBlockType1),
|
||||
offsetof(struct SystemInformationBlockType1, _asn_ctx),
|
||||
asn_MAP_SystemInformationBlockType1_tag2el_1,
|
||||
9, /* Count of tags in the map */
|
||||
asn_MAP_SystemInformationBlockType1_oms_1, /* Optional members */
|
||||
3, 0, /* Root/Additions */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_SystemInformationBlockType1 = {
|
||||
"SystemInformationBlockType1",
|
||||
"SystemInformationBlockType1",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_SystemInformationBlockType1_tags_1,
|
||||
sizeof(asn_DEF_SystemInformationBlockType1_tags_1)
|
||||
/sizeof(asn_DEF_SystemInformationBlockType1_tags_1[0]), /* 1 */
|
||||
asn_DEF_SystemInformationBlockType1_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_SystemInformationBlockType1_tags_1)
|
||||
/sizeof(asn_DEF_SystemInformationBlockType1_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_SystemInformationBlockType1_1,
|
||||
9, /* Elements count */
|
||||
&asn_SPC_SystemInformationBlockType1_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _SystemInformationBlockType1_H_
|
||||
#define _SystemInformationBlockType1_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include "P-Max.h"
|
||||
#include <NativeInteger.h>
|
||||
#include "SchedulingInfoList.h"
|
||||
#include <NativeEnumerated.h>
|
||||
#include "PLMN-IdentityList.h"
|
||||
#include "TrackingAreaCode.h"
|
||||
#include "CellIdentity.h"
|
||||
#include <BOOLEAN.h>
|
||||
#include "CSG-Identity.h"
|
||||
#include <constr_SEQUENCE.h>
|
||||
#include "Q-RxLevMin.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Dependencies */
|
||||
typedef enum cellBarred {
|
||||
cellBarred_barred = 0,
|
||||
cellBarred_notBarred = 1
|
||||
} e_cellBarred;
|
||||
typedef enum intraFreqReselection {
|
||||
intraFreqReselection_allowed = 0,
|
||||
intraFreqReselection_notAllowed = 1
|
||||
} e_intraFreqReselection;
|
||||
typedef enum si_WindowLength {
|
||||
si_WindowLength_ms1 = 0,
|
||||
si_WindowLength_ms2 = 1,
|
||||
si_WindowLength_ms5 = 2,
|
||||
si_WindowLength_ms10 = 3,
|
||||
si_WindowLength_ms15 = 4,
|
||||
si_WindowLength_ms20 = 5,
|
||||
si_WindowLength_ms40 = 6
|
||||
} e_si_WindowLength;
|
||||
|
||||
/* Forward declarations */
|
||||
struct TDD_Config;
|
||||
struct SystemInformationBlockType1_v890_IEs;
|
||||
|
||||
/* SystemInformationBlockType1 */
|
||||
typedef struct SystemInformationBlockType1 {
|
||||
struct cellAccessRelatedInfo {
|
||||
PLMN_IdentityList_t plmn_IdentityList;
|
||||
TrackingAreaCode_t trackingAreaCode;
|
||||
CellIdentity_t cellIdentity;
|
||||
long cellBarred;
|
||||
long intraFreqReselection;
|
||||
BOOLEAN_t csg_Indication;
|
||||
CSG_Identity_t *csg_Identity /* OPTIONAL */;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} cellAccessRelatedInfo;
|
||||
struct cellSelectionInfo {
|
||||
Q_RxLevMin_t q_RxLevMin;
|
||||
long *q_RxLevMinOffset /* OPTIONAL */;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} cellSelectionInfo;
|
||||
P_Max_t *p_Max /* OPTIONAL */;
|
||||
long freqBandIndicator;
|
||||
SchedulingInfoList_t schedulingInfoList;
|
||||
struct TDD_Config *tdd_Config /* OPTIONAL */;
|
||||
long si_WindowLength;
|
||||
long systemInfoValueTag;
|
||||
struct SystemInformationBlockType1_v890_IEs *nonCriticalExtension /* OPTIONAL */;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} SystemInformationBlockType1_t;
|
||||
|
||||
/* Implementation */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_cellBarred_6; // (Use -fall-defs-global to expose) */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_intraFreqReselection_9; // (Use -fall-defs-global to expose) */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_si_WindowLength_21; // (Use -fall-defs-global to expose) */
|
||||
LIBLTE_API extern asn_TYPE_descriptor_t asn_DEF_SystemInformationBlockType1;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Referred external types */
|
||||
#include "TDD-Config.h"
|
||||
#include "SystemInformationBlockType1-v890-IEs.h"
|
||||
|
||||
#endif /* _SystemInformationBlockType1_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,373 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "TDD-Config.h"
|
||||
|
||||
static int
|
||||
subframeAssignment_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
subframeAssignment_2_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
subframeAssignment_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
subframeAssignment_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
subframeAssignment_2_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
subframeAssignment_2_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
subframeAssignment_2_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
subframeAssignment_2_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
subframeAssignment_2_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
subframeAssignment_2_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static int
|
||||
specialSubframePatterns_10_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
/* Replace with underlying type checker */
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
return td->check_constraints(td, sptr, ctfailcb, app_key);
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using NativeEnumerated,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_NativeEnumerated.free_struct;
|
||||
td->print_struct = asn_DEF_NativeEnumerated.print_struct;
|
||||
td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
|
||||
td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
|
||||
td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
|
||||
td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
|
||||
td->elements = asn_DEF_NativeEnumerated.elements;
|
||||
td->elements_count = asn_DEF_NativeEnumerated.elements_count;
|
||||
/* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
|
||||
}
|
||||
|
||||
static void
|
||||
specialSubframePatterns_10_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
static int
|
||||
specialSubframePatterns_10_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
specialSubframePatterns_10_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
specialSubframePatterns_10_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
specialSubframePatterns_10_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
specialSubframePatterns_10_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
static asn_dec_rval_t
|
||||
specialSubframePatterns_10_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
static asn_enc_rval_t
|
||||
specialSubframePatterns_10_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
specialSubframePatterns_10_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_subframeAssignment_constr_2 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 3, 3, 0, 6 } /* (0..6) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static asn_per_constraints_t asn_PER_type_specialSubframePatterns_constr_10 GCC_NOTUSED = {
|
||||
{ APC_CONSTRAINED, 4, 4, 0, 8 } /* (0..8) */,
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_subframeAssignment_value2enum_2[] = {
|
||||
{ 0, 3, "sa0" },
|
||||
{ 1, 3, "sa1" },
|
||||
{ 2, 3, "sa2" },
|
||||
{ 3, 3, "sa3" },
|
||||
{ 4, 3, "sa4" },
|
||||
{ 5, 3, "sa5" },
|
||||
{ 6, 3, "sa6" }
|
||||
};
|
||||
static const unsigned int asn_MAP_subframeAssignment_enum2value_2[] = {
|
||||
0, /* sa0(0) */
|
||||
1, /* sa1(1) */
|
||||
2, /* sa2(2) */
|
||||
3, /* sa3(3) */
|
||||
4, /* sa4(4) */
|
||||
5, /* sa5(5) */
|
||||
6 /* sa6(6) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_subframeAssignment_specs_2 = {
|
||||
asn_MAP_subframeAssignment_value2enum_2, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_subframeAssignment_enum2value_2, /* N => "tag"; sorted by N */
|
||||
7, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_subframeAssignment_tags_2[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_subframeAssignment_2 = {
|
||||
"subframeAssignment",
|
||||
"subframeAssignment",
|
||||
subframeAssignment_2_free,
|
||||
subframeAssignment_2_print,
|
||||
subframeAssignment_2_constraint,
|
||||
subframeAssignment_2_decode_ber,
|
||||
subframeAssignment_2_encode_der,
|
||||
subframeAssignment_2_decode_xer,
|
||||
subframeAssignment_2_encode_xer,
|
||||
subframeAssignment_2_decode_uper,
|
||||
subframeAssignment_2_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_subframeAssignment_tags_2,
|
||||
sizeof(asn_DEF_subframeAssignment_tags_2)
|
||||
/sizeof(asn_DEF_subframeAssignment_tags_2[0]) - 1, /* 1 */
|
||||
asn_DEF_subframeAssignment_tags_2, /* Same as above */
|
||||
sizeof(asn_DEF_subframeAssignment_tags_2)
|
||||
/sizeof(asn_DEF_subframeAssignment_tags_2[0]), /* 2 */
|
||||
&asn_PER_type_subframeAssignment_constr_2,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_subframeAssignment_specs_2 /* Additional specs */
|
||||
};
|
||||
|
||||
static const asn_INTEGER_enum_map_t asn_MAP_specialSubframePatterns_value2enum_10[] = {
|
||||
{ 0, 4, "ssp0" },
|
||||
{ 1, 4, "ssp1" },
|
||||
{ 2, 4, "ssp2" },
|
||||
{ 3, 4, "ssp3" },
|
||||
{ 4, 4, "ssp4" },
|
||||
{ 5, 4, "ssp5" },
|
||||
{ 6, 4, "ssp6" },
|
||||
{ 7, 4, "ssp7" },
|
||||
{ 8, 4, "ssp8" }
|
||||
};
|
||||
static const unsigned int asn_MAP_specialSubframePatterns_enum2value_10[] = {
|
||||
0, /* ssp0(0) */
|
||||
1, /* ssp1(1) */
|
||||
2, /* ssp2(2) */
|
||||
3, /* ssp3(3) */
|
||||
4, /* ssp4(4) */
|
||||
5, /* ssp5(5) */
|
||||
6, /* ssp6(6) */
|
||||
7, /* ssp7(7) */
|
||||
8 /* ssp8(8) */
|
||||
};
|
||||
static const asn_INTEGER_specifics_t asn_SPC_specialSubframePatterns_specs_10 = {
|
||||
asn_MAP_specialSubframePatterns_value2enum_10, /* "tag" => N; sorted by tag */
|
||||
asn_MAP_specialSubframePatterns_enum2value_10, /* N => "tag"; sorted by N */
|
||||
9, /* Number of elements in the maps */
|
||||
0, /* Enumeration is not extensible */
|
||||
1, /* Strict enumeration */
|
||||
0, /* Native long size */
|
||||
0
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_specialSubframePatterns_tags_10[] = {
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
|
||||
};
|
||||
static /* Use -fall-defs-global to expose */
|
||||
asn_TYPE_descriptor_t asn_DEF_specialSubframePatterns_10 = {
|
||||
"specialSubframePatterns",
|
||||
"specialSubframePatterns",
|
||||
specialSubframePatterns_10_free,
|
||||
specialSubframePatterns_10_print,
|
||||
specialSubframePatterns_10_constraint,
|
||||
specialSubframePatterns_10_decode_ber,
|
||||
specialSubframePatterns_10_encode_der,
|
||||
specialSubframePatterns_10_decode_xer,
|
||||
specialSubframePatterns_10_encode_xer,
|
||||
specialSubframePatterns_10_decode_uper,
|
||||
specialSubframePatterns_10_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_specialSubframePatterns_tags_10,
|
||||
sizeof(asn_DEF_specialSubframePatterns_tags_10)
|
||||
/sizeof(asn_DEF_specialSubframePatterns_tags_10[0]) - 1, /* 1 */
|
||||
asn_DEF_specialSubframePatterns_tags_10, /* Same as above */
|
||||
sizeof(asn_DEF_specialSubframePatterns_tags_10)
|
||||
/sizeof(asn_DEF_specialSubframePatterns_tags_10[0]), /* 2 */
|
||||
&asn_PER_type_specialSubframePatterns_constr_10,
|
||||
0, 0, /* Defined elsewhere */
|
||||
&asn_SPC_specialSubframePatterns_specs_10 /* Additional specs */
|
||||
};
|
||||
|
||||
static asn_TYPE_member_t asn_MBR_TDD_Config_1[] = {
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct TDD_Config, subframeAssignment),
|
||||
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_subframeAssignment_2,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"subframeAssignment"
|
||||
},
|
||||
{ ATF_NOFLAGS, 0, offsetof(struct TDD_Config, specialSubframePatterns),
|
||||
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
|
||||
-1, /* IMPLICIT tag at current level */
|
||||
&asn_DEF_specialSubframePatterns_10,
|
||||
0, /* Defer constraints checking to the member type */
|
||||
0, /* No PER visible constraints */
|
||||
0,
|
||||
"specialSubframePatterns"
|
||||
},
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_TDD_Config_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
|
||||
};
|
||||
static const asn_TYPE_tag2member_t asn_MAP_TDD_Config_tag2el_1[] = {
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* subframeAssignment */
|
||||
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* specialSubframePatterns */
|
||||
};
|
||||
static asn_SEQUENCE_specifics_t asn_SPC_TDD_Config_specs_1 = {
|
||||
sizeof(struct TDD_Config),
|
||||
offsetof(struct TDD_Config, _asn_ctx),
|
||||
asn_MAP_TDD_Config_tag2el_1,
|
||||
2, /* Count of tags in the map */
|
||||
0, 0, 0, /* Optional elements (not needed) */
|
||||
-1, /* Start extensions */
|
||||
-1 /* Stop extensions */
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_TDD_Config = {
|
||||
"TDD-Config",
|
||||
"TDD-Config",
|
||||
SEQUENCE_free,
|
||||
SEQUENCE_print,
|
||||
SEQUENCE_constraint,
|
||||
SEQUENCE_decode_ber,
|
||||
SEQUENCE_encode_der,
|
||||
SEQUENCE_decode_xer,
|
||||
SEQUENCE_encode_xer,
|
||||
SEQUENCE_decode_uper,
|
||||
SEQUENCE_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_TDD_Config_tags_1,
|
||||
sizeof(asn_DEF_TDD_Config_tags_1)
|
||||
/sizeof(asn_DEF_TDD_Config_tags_1[0]), /* 1 */
|
||||
asn_DEF_TDD_Config_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_TDD_Config_tags_1)
|
||||
/sizeof(asn_DEF_TDD_Config_tags_1[0]), /* 1 */
|
||||
0, /* No PER visible constraints */
|
||||
asn_MBR_TDD_Config_1,
|
||||
2, /* Elements count */
|
||||
&asn_SPC_TDD_Config_specs_1 /* Additional specs */
|
||||
};
|
||||
|
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _TDD_Config_H_
|
||||
#define _TDD_Config_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <NativeEnumerated.h>
|
||||
#include <constr_SEQUENCE.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Dependencies */
|
||||
typedef enum subframeAssignment {
|
||||
subframeAssignment_sa0 = 0,
|
||||
subframeAssignment_sa1 = 1,
|
||||
subframeAssignment_sa2 = 2,
|
||||
subframeAssignment_sa3 = 3,
|
||||
subframeAssignment_sa4 = 4,
|
||||
subframeAssignment_sa5 = 5,
|
||||
subframeAssignment_sa6 = 6
|
||||
} e_subframeAssignment;
|
||||
typedef enum specialSubframePatterns {
|
||||
specialSubframePatterns_ssp0 = 0,
|
||||
specialSubframePatterns_ssp1 = 1,
|
||||
specialSubframePatterns_ssp2 = 2,
|
||||
specialSubframePatterns_ssp3 = 3,
|
||||
specialSubframePatterns_ssp4 = 4,
|
||||
specialSubframePatterns_ssp5 = 5,
|
||||
specialSubframePatterns_ssp6 = 6,
|
||||
specialSubframePatterns_ssp7 = 7,
|
||||
specialSubframePatterns_ssp8 = 8
|
||||
} e_specialSubframePatterns;
|
||||
|
||||
/* TDD-Config */
|
||||
typedef struct TDD_Config {
|
||||
long subframeAssignment;
|
||||
long specialSubframePatterns;
|
||||
|
||||
/* Context for parsing across buffer boundaries */
|
||||
asn_struct_ctx_t _asn_ctx;
|
||||
} TDD_Config_t;
|
||||
|
||||
/* Implementation */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_subframeAssignment_2; // (Use -fall-defs-global to expose) */
|
||||
/* extern asn_TYPE_descriptor_t asn_DEF_specialSubframePatterns_10; // (Use -fall-defs-global to expose) */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_TDD_Config;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TDD_Config_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#include "TrackingAreaCode.h"
|
||||
|
||||
int
|
||||
TrackingAreaCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
|
||||
size_t size;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(st->size > 0) {
|
||||
/* Size in bits */
|
||||
size = 8 * st->size - (st->bits_unused & 0x07);
|
||||
} else {
|
||||
size = 0;
|
||||
}
|
||||
|
||||
if((size == 16)) {
|
||||
/* Constraint check succeeded */
|
||||
return 0;
|
||||
} else {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: constraint failed (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* This type is implemented using BIT_STRING,
|
||||
* so here we adjust the DEF accordingly.
|
||||
*/
|
||||
static void
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
|
||||
td->free_struct = asn_DEF_BIT_STRING.free_struct;
|
||||
td->print_struct = asn_DEF_BIT_STRING.print_struct;
|
||||
td->check_constraints = asn_DEF_BIT_STRING.check_constraints;
|
||||
td->ber_decoder = asn_DEF_BIT_STRING.ber_decoder;
|
||||
td->der_encoder = asn_DEF_BIT_STRING.der_encoder;
|
||||
td->xer_decoder = asn_DEF_BIT_STRING.xer_decoder;
|
||||
td->xer_encoder = asn_DEF_BIT_STRING.xer_encoder;
|
||||
td->uper_decoder = asn_DEF_BIT_STRING.uper_decoder;
|
||||
td->uper_encoder = asn_DEF_BIT_STRING.uper_encoder;
|
||||
if(!td->per_constraints)
|
||||
td->per_constraints = asn_DEF_BIT_STRING.per_constraints;
|
||||
td->elements = asn_DEF_BIT_STRING.elements;
|
||||
td->elements_count = asn_DEF_BIT_STRING.elements_count;
|
||||
td->specifics = asn_DEF_BIT_STRING.specifics;
|
||||
}
|
||||
|
||||
void
|
||||
TrackingAreaCode_free(asn_TYPE_descriptor_t *td,
|
||||
void *struct_ptr, int contents_only) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
td->free_struct(td, struct_ptr, contents_only);
|
||||
}
|
||||
|
||||
int
|
||||
TrackingAreaCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
|
||||
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
TrackingAreaCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const void *bufptr, size_t size, int tag_mode) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
TrackingAreaCode_encode_der(asn_TYPE_descriptor_t *td,
|
||||
void *structure, int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
TrackingAreaCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
TrackingAreaCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
TrackingAreaCode_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
TrackingAreaCode_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints,
|
||||
void *structure, asn_per_outp_t *per_out) {
|
||||
TrackingAreaCode_1_inherit_TYPE_descriptor(td);
|
||||
return td->uper_encoder(td, constraints, structure, per_out);
|
||||
}
|
||||
|
||||
static asn_per_constraints_t asn_PER_type_TrackingAreaCode_constr_1 GCC_NOTUSED = {
|
||||
{ APC_UNCONSTRAINED, -1, -1, 0, 0 },
|
||||
{ APC_CONSTRAINED, 0, 0, 16, 16 } /* (SIZE(16..16)) */,
|
||||
0, 0 /* No PER value map */
|
||||
};
|
||||
static const ber_tlv_tag_t asn_DEF_TrackingAreaCode_tags_1[] = {
|
||||
(ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
|
||||
};
|
||||
asn_TYPE_descriptor_t asn_DEF_TrackingAreaCode = {
|
||||
"TrackingAreaCode",
|
||||
"TrackingAreaCode",
|
||||
TrackingAreaCode_free,
|
||||
TrackingAreaCode_print,
|
||||
TrackingAreaCode_constraint,
|
||||
TrackingAreaCode_decode_ber,
|
||||
TrackingAreaCode_encode_der,
|
||||
TrackingAreaCode_decode_xer,
|
||||
TrackingAreaCode_encode_xer,
|
||||
TrackingAreaCode_decode_uper,
|
||||
TrackingAreaCode_encode_uper,
|
||||
0, /* Use generic outmost tag fetcher */
|
||||
asn_DEF_TrackingAreaCode_tags_1,
|
||||
sizeof(asn_DEF_TrackingAreaCode_tags_1)
|
||||
/sizeof(asn_DEF_TrackingAreaCode_tags_1[0]), /* 1 */
|
||||
asn_DEF_TrackingAreaCode_tags_1, /* Same as above */
|
||||
sizeof(asn_DEF_TrackingAreaCode_tags_1)
|
||||
/sizeof(asn_DEF_TrackingAreaCode_tags_1[0]), /* 1 */
|
||||
&asn_PER_type_TrackingAreaCode_constr_1,
|
||||
0, 0, /* No members */
|
||||
0 /* No specifics */
|
||||
};
|
||||
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
|
||||
* From ASN.1 module "EUTRA-RRC-Definitions"
|
||||
* found in "EUTRA-RRC-Definitions.asn"
|
||||
*/
|
||||
|
||||
#ifndef _TrackingAreaCode_H_
|
||||
#define _TrackingAreaCode_H_
|
||||
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
/* Including external dependencies */
|
||||
#include <BIT_STRING.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* TrackingAreaCode */
|
||||
typedef BIT_STRING_t TrackingAreaCode_t;
|
||||
|
||||
/* Implementation */
|
||||
extern asn_TYPE_descriptor_t asn_DEF_TrackingAreaCode;
|
||||
asn_struct_free_f TrackingAreaCode_free;
|
||||
asn_struct_print_f TrackingAreaCode_print;
|
||||
asn_constr_check_f TrackingAreaCode_constraint;
|
||||
ber_type_decoder_f TrackingAreaCode_decode_ber;
|
||||
der_type_encoder_f TrackingAreaCode_encode_der;
|
||||
xer_type_decoder_f TrackingAreaCode_decode_xer;
|
||||
xer_type_encoder_f TrackingAreaCode_encode_xer;
|
||||
per_type_decoder_f TrackingAreaCode_decode_uper;
|
||||
per_type_encoder_f TrackingAreaCode_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _TrackingAreaCode_H_ */
|
||||
#include <asn_internal.h>
|
@ -0,0 +1,41 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#include <asn_internal.h>
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
|
||||
typedef A_SEQUENCE_OF(void) asn_sequence;
|
||||
|
||||
void
|
||||
asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) {
|
||||
asn_sequence *as = (asn_sequence *)asn_sequence_of_x;
|
||||
|
||||
if(as) {
|
||||
void *ptr;
|
||||
int n;
|
||||
|
||||
if(number < 0 || number >= as->count)
|
||||
return; /* Nothing to delete */
|
||||
|
||||
if(_do_free && as->free) {
|
||||
ptr = as->array[number];
|
||||
} else {
|
||||
ptr = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Shift all elements to the left to hide the gap.
|
||||
*/
|
||||
--as->count;
|
||||
for(n = number; n < as->count; n++)
|
||||
as->array[n] = as->array[n+1];
|
||||
|
||||
/*
|
||||
* Invoke the third-party function only when the state
|
||||
* of the parent structure is consistent.
|
||||
*/
|
||||
if(ptr) as->free(ptr);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#ifndef ASN_SEQUENCE_OF_H
|
||||
#define ASN_SEQUENCE_OF_H
|
||||
|
||||
#include <asn_SET_OF.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* SEQUENCE OF is the same as SET OF with a tiny difference:
|
||||
* the delete operation preserves the initial order of elements
|
||||
* and thus MAY operate in non-constant time.
|
||||
*/
|
||||
#define A_SEQUENCE_OF(type) A_SET_OF(type)
|
||||
|
||||
#define ASN_SEQUENCE_ADD(headptr, ptr) \
|
||||
asn_sequence_add((headptr), (ptr))
|
||||
|
||||
/***********************************************
|
||||
* Implementation of the SEQUENCE OF structure.
|
||||
*/
|
||||
|
||||
#define asn_sequence_add asn_set_add
|
||||
#define asn_sequence_empty asn_set_empty
|
||||
|
||||
/*
|
||||
* Delete the element from the set by its number (base 0).
|
||||
* This is NOT a constant-time operation.
|
||||
* The order of elements is preserved.
|
||||
* If _do_free is given AND the (*free) is initialized, the element
|
||||
* will be freed using the custom (*free) function as well.
|
||||
*/
|
||||
void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free);
|
||||
|
||||
/*
|
||||
* Cope with different conversions requirements to/from void in C and C++.
|
||||
* This is mostly useful for support library.
|
||||
*/
|
||||
typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_;
|
||||
#define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr))
|
||||
#define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ASN_SEQUENCE_OF_H */
|
@ -0,0 +1,88 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#include <asn_internal.h>
|
||||
#include <asn_SET_OF.h>
|
||||
#include <errno.h>
|
||||
|
||||
/*
|
||||
* Add another element into the set.
|
||||
*/
|
||||
int
|
||||
asn_set_add(void *asn_set_of_x, void *ptr) {
|
||||
asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
|
||||
|
||||
if(as == 0 || ptr == 0) {
|
||||
errno = EINVAL; /* Invalid arguments */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure there's enough space to insert an element.
|
||||
*/
|
||||
if(as->count == as->size) {
|
||||
int _newsize = as->size ? (as->size << 1) : 4;
|
||||
void *_new_arr;
|
||||
_new_arr = REALLOC(as->array, _newsize * sizeof(as->array[0]));
|
||||
if(_new_arr) {
|
||||
as->array = (void **)_new_arr;
|
||||
as->size = _newsize;
|
||||
} else {
|
||||
/* ENOMEM */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
as->array[as->count++] = ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
asn_set_del(void *asn_set_of_x, int number, int _do_free) {
|
||||
asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
|
||||
|
||||
if(as) {
|
||||
void *ptr;
|
||||
if(number < 0 || number >= as->count)
|
||||
return;
|
||||
|
||||
if(_do_free && as->free) {
|
||||
ptr = as->array[number];
|
||||
} else {
|
||||
ptr = 0;
|
||||
}
|
||||
|
||||
as->array[number] = as->array[--as->count];
|
||||
|
||||
/*
|
||||
* Invoke the third-party function only when the state
|
||||
* of the parent structure is consistent.
|
||||
*/
|
||||
if(ptr) as->free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the contents of the set, do not free the set itself.
|
||||
*/
|
||||
void
|
||||
asn_set_empty(void *asn_set_of_x) {
|
||||
asn_anonymous_set_ *as = _A_SET_FROM_VOID(asn_set_of_x);
|
||||
|
||||
if(as) {
|
||||
if(as->array) {
|
||||
if(as->free) {
|
||||
while(as->count--)
|
||||
as->free(as->array[as->count]);
|
||||
}
|
||||
FREEMEM(as->array);
|
||||
as->array = 0;
|
||||
}
|
||||
as->count = 0;
|
||||
as->size = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,62 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#ifndef ASN_SET_OF_H
|
||||
#define ASN_SET_OF_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define A_SET_OF(type) \
|
||||
struct { \
|
||||
type **array; \
|
||||
int count; /* Meaningful size */ \
|
||||
int size; /* Allocated size */ \
|
||||
void (*free)(type *); \
|
||||
}
|
||||
|
||||
#define ASN_SET_ADD(headptr, ptr) \
|
||||
asn_set_add((headptr), (ptr))
|
||||
|
||||
/*******************************************
|
||||
* Implementation of the SET OF structure.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Add another structure into the set by its pointer.
|
||||
* RETURN VALUES:
|
||||
* 0 for success and -1/errno for failure.
|
||||
*/
|
||||
LIBLTE_API int asn_set_add(void *asn_set_of_x, void *ptr);
|
||||
|
||||
/*
|
||||
* Delete the element from the set by its number (base 0).
|
||||
* This is a constant-time operation. The order of elements before the
|
||||
* deleted ones is guaranteed, the order of elements after the deleted
|
||||
* one is NOT guaranteed.
|
||||
* If _do_free is given AND the (*free) is initialized, the element
|
||||
* will be freed using the custom (*free) function as well.
|
||||
*/
|
||||
void asn_set_del(void *asn_set_of_x, int number, int _do_free);
|
||||
|
||||
/*
|
||||
* Empty the contents of the set. Will free the elements, if (*free) is given.
|
||||
* Will NOT free the set itself.
|
||||
*/
|
||||
LIBLTE_API void asn_set_empty(void *asn_set_of_x);
|
||||
|
||||
/*
|
||||
* Cope with different conversions requirements to/from void in C and C++.
|
||||
* This is mostly useful for support library.
|
||||
*/
|
||||
typedef A_SET_OF(void) asn_anonymous_set_;
|
||||
#define _A_SET_FROM_VOID(ptr) ((asn_anonymous_set_ *)(ptr))
|
||||
#define _A_CSET_FROM_VOID(ptr) ((const asn_anonymous_set_ *)(ptr))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ASN_SET_OF_H */
|
@ -0,0 +1,208 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004, 2006 Lev Walkin <vlm@lionet.info>.
|
||||
* All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#include <asn_internal.h>
|
||||
#include <constr_SEQUENCE_OF.h>
|
||||
#include <asn_SEQUENCE_OF.h>
|
||||
|
||||
/*
|
||||
* The DER encoder of the SEQUENCE OF type.
|
||||
*/
|
||||
asn_enc_rval_t
|
||||
SEQUENCE_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
|
||||
int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
asn_anonymous_sequence_ *list = _A_SEQUENCE_FROM_VOID(ptr);
|
||||
size_t computed_size = 0;
|
||||
ssize_t encoding_size = 0;
|
||||
asn_enc_rval_t erval;
|
||||
int edx;
|
||||
|
||||
ASN_DEBUG("Estimating size of SEQUENCE OF %s", td->name);
|
||||
|
||||
/*
|
||||
* Gather the length of the underlying members sequence.
|
||||
*/
|
||||
for(edx = 0; edx < list->count; edx++) {
|
||||
void *memb_ptr = list->array[edx];
|
||||
if(!memb_ptr) continue;
|
||||
erval = elm->type->der_encoder(elm->type, memb_ptr,
|
||||
0, elm->tag,
|
||||
0, 0);
|
||||
if(erval.encoded == -1)
|
||||
return erval;
|
||||
computed_size += erval.encoded;
|
||||
}
|
||||
|
||||
/*
|
||||
* Encode the TLV for the sequence itself.
|
||||
*/
|
||||
encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag,
|
||||
cb, app_key);
|
||||
if(encoding_size == -1) {
|
||||
erval.encoded = -1;
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = ptr;
|
||||
return erval;
|
||||
}
|
||||
|
||||
computed_size += encoding_size;
|
||||
if(!cb) {
|
||||
erval.encoded = computed_size;
|
||||
_ASN_ENCODED_OK(erval);
|
||||
}
|
||||
|
||||
ASN_DEBUG("Encoding members of SEQUENCE OF %s", td->name);
|
||||
|
||||
/*
|
||||
* Encode all members.
|
||||
*/
|
||||
for(edx = 0; edx < list->count; edx++) {
|
||||
void *memb_ptr = list->array[edx];
|
||||
if(!memb_ptr) continue;
|
||||
erval = elm->type->der_encoder(elm->type, memb_ptr,
|
||||
0, elm->tag,
|
||||
cb, app_key);
|
||||
if(erval.encoded == -1)
|
||||
return erval;
|
||||
encoding_size += erval.encoded;
|
||||
}
|
||||
|
||||
if(computed_size != (size_t)encoding_size) {
|
||||
/*
|
||||
* Encoded size is not equal to the computed size.
|
||||
*/
|
||||
erval.encoded = -1;
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = ptr;
|
||||
} else {
|
||||
erval.encoded = computed_size;
|
||||
erval.structure_ptr = 0;
|
||||
erval.failed_type = 0;
|
||||
}
|
||||
|
||||
return erval;
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
SEQUENCE_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
asn_enc_rval_t er;
|
||||
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
asn_anonymous_sequence_ *list = _A_SEQUENCE_FROM_VOID(sptr);
|
||||
const char *mname = specs->as_XMLValueList
|
||||
? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag);
|
||||
unsigned int mlen = mname ? strlen(mname) : 0;
|
||||
int xcan = (flags & XER_F_CANONICAL);
|
||||
int i;
|
||||
|
||||
if(!sptr) _ASN_ENCODE_FAILED;
|
||||
|
||||
er.encoded = 0;
|
||||
|
||||
for(i = 0; i < list->count; i++) {
|
||||
asn_enc_rval_t tmper;
|
||||
void *memb_ptr = list->array[i];
|
||||
if(!memb_ptr) continue;
|
||||
|
||||
if(mname) {
|
||||
if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel);
|
||||
_ASN_CALLBACK3("<", 1, mname, mlen, ">", 1);
|
||||
}
|
||||
|
||||
tmper = elm->type->xer_encoder(elm->type, memb_ptr,
|
||||
ilevel + 1, flags, cb, app_key);
|
||||
if(tmper.encoded == -1) return tmper;
|
||||
if(tmper.encoded == 0 && specs->as_XMLValueList) {
|
||||
const char *name = elm->type->xml_tag;
|
||||
size_t len = strlen(name);
|
||||
if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel + 1);
|
||||
_ASN_CALLBACK3("<", 1, name, len, "/>", 2);
|
||||
}
|
||||
|
||||
if(mname) {
|
||||
_ASN_CALLBACK3("</", 2, mname, mlen, ">", 1);
|
||||
er.encoded += 5;
|
||||
}
|
||||
|
||||
er.encoded += (2 * mlen) + tmper.encoded;
|
||||
}
|
||||
|
||||
if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1);
|
||||
|
||||
_ASN_ENCODED_OK(er);
|
||||
cb_failed:
|
||||
_ASN_ENCODE_FAILED;
|
||||
}
|
||||
|
||||
asn_enc_rval_t
|
||||
SEQUENCE_OF_encode_uper(asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
|
||||
asn_anonymous_sequence_ *list;
|
||||
asn_per_constraint_t *ct;
|
||||
asn_enc_rval_t er;
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
int seq;
|
||||
|
||||
if(!sptr) _ASN_ENCODE_FAILED;
|
||||
list = _A_SEQUENCE_FROM_VOID(sptr);
|
||||
|
||||
er.encoded = 0;
|
||||
|
||||
ASN_DEBUG("Encoding %s as SEQUENCE OF (%d)", td->name, list->count);
|
||||
|
||||
if(constraints) ct = &constraints->size;
|
||||
else if(td->per_constraints) ct = &td->per_constraints->size;
|
||||
else ct = 0;
|
||||
|
||||
/* If extensible constraint, check if size is in root */
|
||||
if(ct) {
|
||||
int not_in_root = (list->count < ct->lower_bound
|
||||
|| list->count > ct->upper_bound);
|
||||
ASN_DEBUG("lb %ld ub %ld %s",
|
||||
ct->lower_bound, ct->upper_bound,
|
||||
ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
|
||||
if(ct->flags & APC_EXTENSIBLE) {
|
||||
/* Declare whether size is in extension root */
|
||||
if(per_put_few_bits(po, not_in_root, 1))
|
||||
_ASN_ENCODE_FAILED;
|
||||
if(not_in_root) ct = 0;
|
||||
} else if(not_in_root && ct->effective_bits >= 0)
|
||||
_ASN_ENCODE_FAILED;
|
||||
}
|
||||
|
||||
if(ct && ct->effective_bits >= 0) {
|
||||
/* X.691, #19.5: No length determinant */
|
||||
if(per_put_few_bits(po, list->count - ct->lower_bound,
|
||||
ct->effective_bits))
|
||||
_ASN_ENCODE_FAILED;
|
||||
}
|
||||
|
||||
for(seq = -1; seq < list->count;) {
|
||||
ssize_t mayEncode;
|
||||
if(seq < 0) seq = 0;
|
||||
if(ct && ct->effective_bits >= 0) {
|
||||
mayEncode = list->count;
|
||||
} else {
|
||||
mayEncode = uper_put_length(po, list->count - seq);
|
||||
if(mayEncode < 0) _ASN_ENCODE_FAILED;
|
||||
}
|
||||
|
||||
while(mayEncode--) {
|
||||
void *memb_ptr = list->array[seq++];
|
||||
if(!memb_ptr) _ASN_ENCODE_FAILED;
|
||||
er = elm->type->uper_encoder(elm->type,
|
||||
elm->per_constraints, memb_ptr, po);
|
||||
if(er.encoded == -1)
|
||||
_ASN_ENCODE_FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
_ASN_ENCODED_OK(er);
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#ifndef _CONSTR_SEQUENCE_OF_H_
|
||||
#define _CONSTR_SEQUENCE_OF_H_
|
||||
|
||||
#include <asn_application.h>
|
||||
#include <constr_SET_OF.h> /* Implemented using SET OF */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* A set specialized functions dealing with the SEQUENCE OF type.
|
||||
* Generally implemented using SET OF.
|
||||
*/
|
||||
#define SEQUENCE_OF_free SET_OF_free
|
||||
#define SEQUENCE_OF_print SET_OF_print
|
||||
#define SEQUENCE_OF_constraint SET_OF_constraint
|
||||
#define SEQUENCE_OF_decode_ber SET_OF_decode_ber
|
||||
#define SEQUENCE_OF_decode_xer SET_OF_decode_xer
|
||||
#define SEQUENCE_OF_decode_uper SET_OF_decode_uper
|
||||
der_type_encoder_f SEQUENCE_OF_encode_der;
|
||||
xer_type_encoder_f SEQUENCE_OF_encode_xer;
|
||||
per_type_encoder_f SEQUENCE_OF_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CONSTR_SET_OF_H_ */
|
@ -0,0 +1,953 @@
|
||||
/*-
|
||||
* Copyright (c) 2003, 2004, 2005 Lev Walkin <vlm@lionet.info>.
|
||||
* All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#include <asn_internal.h>
|
||||
#include <constr_SET_OF.h>
|
||||
#include <asn_SET_OF.h>
|
||||
|
||||
/*
|
||||
* Number of bytes left for this structure.
|
||||
* (ctx->left) indicates the number of bytes _transferred_ for the structure.
|
||||
* (size) contains the number of bytes in the buffer passed.
|
||||
*/
|
||||
#define LEFT ((size<(size_t)ctx->left)?size:(size_t)ctx->left)
|
||||
|
||||
/*
|
||||
* If the subprocessor function returns with an indication that it wants
|
||||
* more data, it may well be a fatal decoding problem, because the
|
||||
* size is constrained by the <TLV>'s L, even if the buffer size allows
|
||||
* reading more data.
|
||||
* For example, consider the buffer containing the following TLVs:
|
||||
* <T:5><L:1><V> <T:6>...
|
||||
* The TLV length clearly indicates that one byte is expected in V, but
|
||||
* if the V processor returns with "want more data" even if the buffer
|
||||
* contains way more data than the V processor have seen.
|
||||
*/
|
||||
#define SIZE_VIOLATION (ctx->left >= 0 && (size_t)ctx->left <= size)
|
||||
|
||||
/*
|
||||
* This macro "eats" the part of the buffer which is definitely "consumed",
|
||||
* i.e. was correctly converted into local representation or rightfully skipped.
|
||||
*/
|
||||
#undef ADVANCE
|
||||
#define ADVANCE(num_bytes) do { \
|
||||
size_t num = num_bytes; \
|
||||
ptr = ((const char *)ptr) + num;\
|
||||
size -= num; \
|
||||
if(ctx->left >= 0) \
|
||||
ctx->left -= num; \
|
||||
consumed_myself += num; \
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
* Switch to the next phase of parsing.
|
||||
*/
|
||||
#undef NEXT_PHASE
|
||||
#undef PHASE_OUT
|
||||
#define NEXT_PHASE(ctx) do { \
|
||||
ctx->phase++; \
|
||||
ctx->step = 0; \
|
||||
} while(0)
|
||||
#define PHASE_OUT(ctx) do { ctx->phase = 10; } while(0)
|
||||
|
||||
/*
|
||||
* Return a standardized complex structure.
|
||||
*/
|
||||
#undef RETURN
|
||||
#define RETURN(_code) do { \
|
||||
rval.code = _code; \
|
||||
rval.consumed = consumed_myself;\
|
||||
return rval; \
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
* The decoder of the SET OF type.
|
||||
*/
|
||||
asn_dec_rval_t
|
||||
SET_OF_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **struct_ptr, const void *ptr, size_t size, int tag_mode) {
|
||||
/*
|
||||
* Bring closer parts of structure description.
|
||||
*/
|
||||
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||
asn_TYPE_member_t *elm = td->elements; /* Single one */
|
||||
|
||||
/*
|
||||
* Parts of the structure being constructed.
|
||||
*/
|
||||
void *st = *struct_ptr; /* Target structure. */
|
||||
asn_struct_ctx_t *ctx; /* Decoder context */
|
||||
|
||||
ber_tlv_tag_t tlv_tag; /* T from TLV */
|
||||
asn_dec_rval_t rval; /* Return code from subparsers */
|
||||
|
||||
ssize_t consumed_myself = 0; /* Consumed bytes from ptr */
|
||||
|
||||
ASN_DEBUG("Decoding %s as SET OF", td->name);
|
||||
|
||||
/*
|
||||
* Create the target structure if it is not present already.
|
||||
*/
|
||||
if(st == 0) {
|
||||
st = *struct_ptr = CALLOC(1, specs->struct_size);
|
||||
if(st == 0) {
|
||||
RETURN(RC_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore parsing context.
|
||||
*/
|
||||
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
|
||||
|
||||
/*
|
||||
* Start to parse where left previously
|
||||
*/
|
||||
switch(ctx->phase) {
|
||||
case 0:
|
||||
/*
|
||||
* PHASE 0.
|
||||
* Check that the set of tags associated with given structure
|
||||
* perfectly fits our expectations.
|
||||
*/
|
||||
|
||||
rval = ber_check_tags(opt_codec_ctx, td, ctx, ptr, size,
|
||||
tag_mode, 1, &ctx->left, 0);
|
||||
if(rval.code != RC_OK) {
|
||||
ASN_DEBUG("%s tagging check failed: %d",
|
||||
td->name, rval.code);
|
||||
return rval;
|
||||
}
|
||||
|
||||
if(ctx->left >= 0)
|
||||
ctx->left += rval.consumed; /* ?Substracted below! */
|
||||
ADVANCE(rval.consumed);
|
||||
|
||||
ASN_DEBUG("Structure consumes %ld bytes, "
|
||||
"buffer %ld", (long)ctx->left, (long)size);
|
||||
|
||||
NEXT_PHASE(ctx);
|
||||
/* Fall through */
|
||||
case 1:
|
||||
/*
|
||||
* PHASE 1.
|
||||
* From the place where we've left it previously,
|
||||
* try to decode the next item.
|
||||
*/
|
||||
for(;; ctx->step = 0) {
|
||||
ssize_t tag_len; /* Length of TLV's T */
|
||||
|
||||
if(ctx->step & 1)
|
||||
goto microphase2;
|
||||
|
||||
/*
|
||||
* MICROPHASE 1: Synchronize decoding.
|
||||
*/
|
||||
|
||||
if(ctx->left == 0) {
|
||||
ASN_DEBUG("End of SET OF %s", td->name);
|
||||
/*
|
||||
* No more things to decode.
|
||||
* Exit out of here.
|
||||
*/
|
||||
PHASE_OUT(ctx);
|
||||
RETURN(RC_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetch the T from TLV.
|
||||
*/
|
||||
tag_len = ber_fetch_tag(ptr, LEFT, &tlv_tag);
|
||||
switch(tag_len) {
|
||||
case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
|
||||
/* Fall through */
|
||||
case -1: RETURN(RC_FAIL);
|
||||
}
|
||||
|
||||
if(ctx->left < 0 && ((const uint8_t *)ptr)[0] == 0) {
|
||||
if(LEFT < 2) {
|
||||
if(SIZE_VIOLATION)
|
||||
RETURN(RC_FAIL);
|
||||
else
|
||||
RETURN(RC_WMORE);
|
||||
} else if(((const uint8_t *)ptr)[1] == 0) {
|
||||
/*
|
||||
* Found the terminator of the
|
||||
* indefinite length structure.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Outmost tag may be unknown and cannot be fetched/compared */
|
||||
if(elm->tag != (ber_tlv_tag_t)-1) {
|
||||
if(BER_TAGS_EQUAL(tlv_tag, elm->tag)) {
|
||||
/*
|
||||
* The new list member of expected type has arrived.
|
||||
*/
|
||||
} else {
|
||||
ASN_DEBUG("Unexpected tag %s fixed SET OF %s",
|
||||
ber_tlv_tag_string(tlv_tag), td->name);
|
||||
ASN_DEBUG("%s SET OF has tag %s",
|
||||
td->name, ber_tlv_tag_string(elm->tag));
|
||||
RETURN(RC_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* MICROPHASE 2: Invoke the member-specific decoder.
|
||||
*/
|
||||
ctx->step |= 1; /* Confirm entering next microphase */
|
||||
microphase2:
|
||||
|
||||
/*
|
||||
* Invoke the member fetch routine according to member's type
|
||||
*/
|
||||
rval = elm->type->ber_decoder(opt_codec_ctx,
|
||||
elm->type, &ctx->ptr, ptr, LEFT, 0);
|
||||
ASN_DEBUG("In %s SET OF %s code %d consumed %d",
|
||||
td->name, elm->type->name,
|
||||
rval.code, (int)rval.consumed);
|
||||
switch(rval.code) {
|
||||
case RC_OK:
|
||||
{
|
||||
asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
|
||||
if(ASN_SET_ADD(list, ctx->ptr) != 0)
|
||||
RETURN(RC_FAIL);
|
||||
else
|
||||
ctx->ptr = 0;
|
||||
}
|
||||
break;
|
||||
case RC_WMORE: /* More data expected */
|
||||
if(!SIZE_VIOLATION) {
|
||||
ADVANCE(rval.consumed);
|
||||
RETURN(RC_WMORE);
|
||||
}
|
||||
/* Fall through */
|
||||
case RC_FAIL: /* Fatal error */
|
||||
ASN_STRUCT_FREE(*elm->type, ctx->ptr);
|
||||
ctx->ptr = 0;
|
||||
RETURN(RC_FAIL);
|
||||
} /* switch(rval) */
|
||||
|
||||
ADVANCE(rval.consumed);
|
||||
} /* for(all list members) */
|
||||
|
||||
NEXT_PHASE(ctx);
|
||||
case 2:
|
||||
/*
|
||||
* Read in all "end of content" TLVs.
|
||||
*/
|
||||
while(ctx->left < 0) {
|
||||
if(LEFT < 2) {
|
||||
if(LEFT > 0 && ((const char *)ptr)[0] != 0) {
|
||||
/* Unexpected tag */
|
||||
RETURN(RC_FAIL);
|
||||
} else {
|
||||
RETURN(RC_WMORE);
|
||||
}
|
||||
}
|
||||
if(((const char *)ptr)[0] == 0
|
||||
&& ((const char *)ptr)[1] == 0) {
|
||||
ADVANCE(2);
|
||||
ctx->left++;
|
||||
} else {
|
||||
RETURN(RC_FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
PHASE_OUT(ctx);
|
||||
}
|
||||
|
||||
RETURN(RC_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Internally visible buffer holding a single encoded element.
|
||||
*/
|
||||
struct _el_buffer {
|
||||
uint8_t *buf;
|
||||
size_t length;
|
||||
size_t size;
|
||||
};
|
||||
/* Append bytes to the above structure */
|
||||
static int _el_addbytes(const void *buffer, size_t size, void *el_buf_ptr) {
|
||||
struct _el_buffer *el_buf = (struct _el_buffer *)el_buf_ptr;
|
||||
|
||||
if(el_buf->length + size > el_buf->size)
|
||||
return -1;
|
||||
|
||||
memcpy(el_buf->buf + el_buf->length, buffer, size);
|
||||
|
||||
el_buf->length += size;
|
||||
return 0;
|
||||
}
|
||||
static int _el_buf_cmp(const void *ap, const void *bp) {
|
||||
const struct _el_buffer *a = (const struct _el_buffer *)ap;
|
||||
const struct _el_buffer *b = (const struct _el_buffer *)bp;
|
||||
int ret;
|
||||
size_t common_len;
|
||||
|
||||
if(a->length < b->length)
|
||||
common_len = a->length;
|
||||
else
|
||||
common_len = b->length;
|
||||
|
||||
ret = memcmp(a->buf, b->buf, common_len);
|
||||
if(ret == 0) {
|
||||
if(a->length < b->length)
|
||||
ret = -1;
|
||||
else if(a->length > b->length)
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* The DER encoder of the SET OF type.
|
||||
*/
|
||||
asn_enc_rval_t
|
||||
SET_OF_encode_der(asn_TYPE_descriptor_t *td, void *ptr,
|
||||
int tag_mode, ber_tlv_tag_t tag,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
asn_TYPE_descriptor_t *elm_type = elm->type;
|
||||
der_type_encoder_f *der_encoder = elm_type->der_encoder;
|
||||
asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr);
|
||||
size_t computed_size = 0;
|
||||
ssize_t encoding_size = 0;
|
||||
struct _el_buffer *encoded_els;
|
||||
ssize_t eels_count = 0;
|
||||
size_t max_encoded_len = 1;
|
||||
asn_enc_rval_t erval;
|
||||
int ret;
|
||||
int edx;
|
||||
|
||||
ASN_DEBUG("Estimating size for SET OF %s", td->name);
|
||||
|
||||
/*
|
||||
* Gather the length of the underlying members sequence.
|
||||
*/
|
||||
for(edx = 0; edx < list->count; edx++) {
|
||||
void *memb_ptr = list->array[edx];
|
||||
if(!memb_ptr) continue;
|
||||
erval = der_encoder(elm_type, memb_ptr, 0, elm->tag, 0, 0);
|
||||
if(erval.encoded == -1)
|
||||
return erval;
|
||||
computed_size += erval.encoded;
|
||||
|
||||
/* Compute maximum encoding's size */
|
||||
if(max_encoded_len < (size_t)erval.encoded)
|
||||
max_encoded_len = erval.encoded;
|
||||
}
|
||||
|
||||
/*
|
||||
* Encode the TLV for the sequence itself.
|
||||
*/
|
||||
encoding_size = der_write_tags(td, computed_size, tag_mode, 1, tag,
|
||||
cb, app_key);
|
||||
if(encoding_size == -1) {
|
||||
erval.encoded = -1;
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = ptr;
|
||||
return erval;
|
||||
}
|
||||
computed_size += encoding_size;
|
||||
|
||||
if(!cb || list->count == 0) {
|
||||
erval.encoded = computed_size;
|
||||
_ASN_ENCODED_OK(erval);
|
||||
}
|
||||
|
||||
/*
|
||||
* DER mandates dynamic sorting of the SET OF elements
|
||||
* according to their encodings. Build an array of the
|
||||
* encoded elements.
|
||||
*/
|
||||
encoded_els = (struct _el_buffer *)MALLOC(
|
||||
list->count * sizeof(encoded_els[0]));
|
||||
if(encoded_els == NULL) {
|
||||
erval.encoded = -1;
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = ptr;
|
||||
return erval;
|
||||
}
|
||||
|
||||
ASN_DEBUG("Encoding members of %s SET OF", td->name);
|
||||
|
||||
/*
|
||||
* Encode all members.
|
||||
*/
|
||||
for(edx = 0; edx < list->count; edx++) {
|
||||
void *memb_ptr = list->array[edx];
|
||||
struct _el_buffer *encoded_el = &encoded_els[eels_count];
|
||||
|
||||
if(!memb_ptr) continue;
|
||||
|
||||
/*
|
||||
* Prepare space for encoding.
|
||||
*/
|
||||
encoded_el->buf = (uint8_t *)MALLOC(max_encoded_len);
|
||||
if(encoded_el->buf) {
|
||||
encoded_el->length = 0;
|
||||
encoded_el->size = max_encoded_len;
|
||||
} else {
|
||||
for(edx--; edx >= 0; edx--)
|
||||
FREEMEM(encoded_els[edx].buf);
|
||||
FREEMEM(encoded_els);
|
||||
erval.encoded = -1;
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = ptr;
|
||||
return erval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Encode the member into the prepared space.
|
||||
*/
|
||||
erval = der_encoder(elm_type, memb_ptr, 0, elm->tag,
|
||||
_el_addbytes, encoded_el);
|
||||
if(erval.encoded == -1) {
|
||||
for(; edx >= 0; edx--)
|
||||
FREEMEM(encoded_els[edx].buf);
|
||||
FREEMEM(encoded_els);
|
||||
return erval;
|
||||
}
|
||||
encoding_size += erval.encoded;
|
||||
eels_count++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Sort the encoded elements according to their encoding.
|
||||
*/
|
||||
qsort(encoded_els, eels_count, sizeof(encoded_els[0]), _el_buf_cmp);
|
||||
|
||||
/*
|
||||
* Report encoded elements to the application.
|
||||
* Dispose of temporary sorted members table.
|
||||
*/
|
||||
ret = 0;
|
||||
for(edx = 0; edx < eels_count; edx++) {
|
||||
struct _el_buffer *encoded_el = &encoded_els[edx];
|
||||
/* Report encoded chunks to the application */
|
||||
if(ret == 0
|
||||
&& cb(encoded_el->buf, encoded_el->length, app_key) < 0)
|
||||
ret = -1;
|
||||
FREEMEM(encoded_el->buf);
|
||||
}
|
||||
FREEMEM(encoded_els);
|
||||
|
||||
if(ret || computed_size != (size_t)encoding_size) {
|
||||
/*
|
||||
* Standard callback failed, or
|
||||
* encoded size is not equal to the computed size.
|
||||
*/
|
||||
erval.encoded = -1;
|
||||
erval.failed_type = td;
|
||||
erval.structure_ptr = ptr;
|
||||
} else {
|
||||
erval.encoded = computed_size;
|
||||
}
|
||||
|
||||
_ASN_ENCODED_OK(erval);
|
||||
}
|
||||
|
||||
#undef XER_ADVANCE
|
||||
#define XER_ADVANCE(num_bytes) do { \
|
||||
size_t num = num_bytes; \
|
||||
buf_ptr = ((const char *)buf_ptr) + num;\
|
||||
size -= num; \
|
||||
consumed_myself += num; \
|
||||
} while(0)
|
||||
|
||||
/*
|
||||
* Decode the XER (XML) data.
|
||||
*/
|
||||
asn_dec_rval_t
|
||||
SET_OF_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
void **struct_ptr, const char *opt_mname,
|
||||
const void *buf_ptr, size_t size) {
|
||||
/*
|
||||
* Bring closer parts of structure description.
|
||||
*/
|
||||
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||
asn_TYPE_member_t *element = td->elements;
|
||||
const char *elm_tag;
|
||||
const char *xml_tag = opt_mname ? opt_mname : td->xml_tag;
|
||||
|
||||
/*
|
||||
* ... and parts of the structure being constructed.
|
||||
*/
|
||||
void *st = *struct_ptr; /* Target structure. */
|
||||
asn_struct_ctx_t *ctx; /* Decoder context */
|
||||
|
||||
asn_dec_rval_t rval; /* Return value from a decoder */
|
||||
ssize_t consumed_myself = 0; /* Consumed bytes from ptr */
|
||||
|
||||
/*
|
||||
* Create the target structure if it is not present already.
|
||||
*/
|
||||
if(st == 0) {
|
||||
st = *struct_ptr = CALLOC(1, specs->struct_size);
|
||||
if(st == 0) RETURN(RC_FAIL);
|
||||
}
|
||||
|
||||
/* Which tag is expected for the downstream */
|
||||
if(specs->as_XMLValueList) {
|
||||
elm_tag = (specs->as_XMLValueList == 1) ? 0 : "";
|
||||
} else {
|
||||
elm_tag = (*element->name)
|
||||
? element->name : element->type->xml_tag;
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore parsing context.
|
||||
*/
|
||||
ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
|
||||
|
||||
/*
|
||||
* Phases of XER/XML processing:
|
||||
* Phase 0: Check that the opening tag matches our expectations.
|
||||
* Phase 1: Processing body and reacting on closing tag.
|
||||
* Phase 2: Processing inner type.
|
||||
*/
|
||||
for(; ctx->phase <= 2;) {
|
||||
pxer_chunk_type_e ch_type; /* XER chunk type */
|
||||
ssize_t ch_size; /* Chunk size */
|
||||
xer_check_tag_e tcv; /* Tag check value */
|
||||
|
||||
/*
|
||||
* Go inside the inner member of a set.
|
||||
*/
|
||||
if(ctx->phase == 2) {
|
||||
asn_dec_rval_t tmprval;
|
||||
|
||||
/* Invoke the inner type decoder, m.b. multiple times */
|
||||
ASN_DEBUG("XER/SET OF element [%s]", elm_tag);
|
||||
tmprval = element->type->xer_decoder(opt_codec_ctx,
|
||||
element->type, &ctx->ptr, elm_tag,
|
||||
buf_ptr, size);
|
||||
if(tmprval.code == RC_OK) {
|
||||
asn_anonymous_set_ *list = _A_SET_FROM_VOID(st);
|
||||
if(ASN_SET_ADD(list, ctx->ptr) != 0)
|
||||
RETURN(RC_FAIL);
|
||||
ctx->ptr = 0;
|
||||
XER_ADVANCE(tmprval.consumed);
|
||||
} else {
|
||||
XER_ADVANCE(tmprval.consumed);
|
||||
RETURN(tmprval.code);
|
||||
}
|
||||
ctx->phase = 1; /* Back to body processing */
|
||||
ASN_DEBUG("XER/SET OF phase => %d", ctx->phase);
|
||||
/* Fall through */
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the next part of the XML stream.
|
||||
*/
|
||||
ch_size = xer_next_token(&ctx->context,
|
||||
buf_ptr, size, &ch_type);
|
||||
switch(ch_size) {
|
||||
case -1: RETURN(RC_FAIL);
|
||||
case 0: RETURN(RC_WMORE);
|
||||
default:
|
||||
switch(ch_type) {
|
||||
case PXER_COMMENT: /* Got XML comment */
|
||||
case PXER_TEXT: /* Ignore free-standing text */
|
||||
XER_ADVANCE(ch_size); /* Skip silently */
|
||||
continue;
|
||||
case PXER_TAG:
|
||||
break; /* Check the rest down there */
|
||||
}
|
||||
}
|
||||
|
||||
tcv = xer_check_tag(buf_ptr, ch_size, xml_tag);
|
||||
ASN_DEBUG("XER/SET OF: tcv = %d, ph=%d t=%s",
|
||||
tcv, ctx->phase, xml_tag);
|
||||
switch(tcv) {
|
||||
case XCT_CLOSING:
|
||||
if(ctx->phase == 0) break;
|
||||
ctx->phase = 0;
|
||||
/* Fall through */
|
||||
case XCT_BOTH:
|
||||
if(ctx->phase == 0) {
|
||||
/* No more things to decode */
|
||||
XER_ADVANCE(ch_size);
|
||||
ctx->phase = 3; /* Phase out */
|
||||
RETURN(RC_OK);
|
||||
}
|
||||
/* Fall through */
|
||||
case XCT_OPENING:
|
||||
if(ctx->phase == 0) {
|
||||
XER_ADVANCE(ch_size);
|
||||
ctx->phase = 1; /* Processing body phase */
|
||||
continue;
|
||||
}
|
||||
/* Fall through */
|
||||
case XCT_UNKNOWN_OP:
|
||||
case XCT_UNKNOWN_BO:
|
||||
|
||||
ASN_DEBUG("XER/SET OF: tcv=%d, ph=%d", tcv, ctx->phase);
|
||||
if(ctx->phase == 1) {
|
||||
/*
|
||||
* Process a single possible member.
|
||||
*/
|
||||
ctx->phase = 2;
|
||||
continue;
|
||||
}
|
||||
/* Fall through */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ASN_DEBUG("Unexpected XML tag in SET OF");
|
||||
break;
|
||||
}
|
||||
|
||||
ctx->phase = 3; /* "Phase out" on hard failure */
|
||||
RETURN(RC_FAIL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
typedef struct xer_tmp_enc_s {
|
||||
void *buffer;
|
||||
size_t offset;
|
||||
size_t size;
|
||||
} xer_tmp_enc_t;
|
||||
static int
|
||||
SET_OF_encode_xer_callback(const void *buffer, size_t size, void *key) {
|
||||
xer_tmp_enc_t *t = (xer_tmp_enc_t *)key;
|
||||
if(t->offset + size >= t->size) {
|
||||
size_t newsize = (t->size << 2) + size;
|
||||
void *p = REALLOC(t->buffer, newsize);
|
||||
if(!p) return -1;
|
||||
t->buffer = p;
|
||||
t->size = newsize;
|
||||
}
|
||||
memcpy((char *)t->buffer + t->offset, buffer, size);
|
||||
t->offset += size;
|
||||
return 0;
|
||||
}
|
||||
static int
|
||||
SET_OF_xer_order(const void *aptr, const void *bptr) {
|
||||
const xer_tmp_enc_t *a = (const xer_tmp_enc_t *)aptr;
|
||||
const xer_tmp_enc_t *b = (const xer_tmp_enc_t *)bptr;
|
||||
size_t minlen = a->offset;
|
||||
int ret;
|
||||
if(b->offset < minlen) minlen = b->offset;
|
||||
/* Well-formed UTF-8 has this nice lexicographical property... */
|
||||
ret = memcmp(a->buffer, b->buffer, minlen);
|
||||
if(ret != 0) return ret;
|
||||
if(a->offset == b->offset)
|
||||
return 0;
|
||||
if(a->offset == minlen)
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
asn_enc_rval_t
|
||||
SET_OF_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
|
||||
int ilevel, enum xer_encoder_flags_e flags,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
asn_enc_rval_t er;
|
||||
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
asn_anonymous_set_ *list = _A_SET_FROM_VOID(sptr);
|
||||
const char *mname = specs->as_XMLValueList
|
||||
? 0 : ((*elm->name) ? elm->name : elm->type->xml_tag);
|
||||
size_t mlen = mname ? strlen(mname) : 0;
|
||||
int xcan = (flags & XER_F_CANONICAL);
|
||||
xer_tmp_enc_t *encs = 0;
|
||||
size_t encs_count = 0;
|
||||
void *original_app_key = app_key;
|
||||
asn_app_consume_bytes_f *original_cb = cb;
|
||||
int i;
|
||||
|
||||
if(!sptr) _ASN_ENCODE_FAILED;
|
||||
|
||||
if(xcan) {
|
||||
encs = (xer_tmp_enc_t *)MALLOC(list->count * sizeof(encs[0]));
|
||||
if(!encs) _ASN_ENCODE_FAILED;
|
||||
cb = SET_OF_encode_xer_callback;
|
||||
}
|
||||
|
||||
er.encoded = 0;
|
||||
|
||||
for(i = 0; i < list->count; i++) {
|
||||
asn_enc_rval_t tmper;
|
||||
|
||||
void *memb_ptr = list->array[i];
|
||||
if(!memb_ptr) continue;
|
||||
|
||||
if(encs) {
|
||||
memset(&encs[encs_count], 0, sizeof(encs[0]));
|
||||
app_key = &encs[encs_count];
|
||||
encs_count++;
|
||||
}
|
||||
|
||||
if(mname) {
|
||||
if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel);
|
||||
_ASN_CALLBACK3("<", 1, mname, mlen, ">", 1);
|
||||
}
|
||||
|
||||
if(!xcan && specs->as_XMLValueList == 1)
|
||||
_i_ASN_TEXT_INDENT(1, ilevel + 1);
|
||||
tmper = elm->type->xer_encoder(elm->type, memb_ptr,
|
||||
ilevel + (specs->as_XMLValueList != 2),
|
||||
flags, cb, app_key);
|
||||
if(tmper.encoded == -1) {
|
||||
td = tmper.failed_type;
|
||||
sptr = tmper.structure_ptr;
|
||||
goto cb_failed;
|
||||
}
|
||||
if(tmper.encoded == 0 && specs->as_XMLValueList) {
|
||||
const char *name = elm->type->xml_tag;
|
||||
size_t len = strlen(name);
|
||||
_ASN_CALLBACK3("<", 1, name, len, "/>", 2);
|
||||
}
|
||||
|
||||
if(mname) {
|
||||
_ASN_CALLBACK3("</", 2, mname, mlen, ">", 1);
|
||||
er.encoded += 5;
|
||||
}
|
||||
|
||||
er.encoded += (2 * mlen) + tmper.encoded;
|
||||
}
|
||||
|
||||
if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel - 1);
|
||||
|
||||
if(encs) {
|
||||
xer_tmp_enc_t *enc = encs;
|
||||
xer_tmp_enc_t *end = encs + encs_count;
|
||||
ssize_t control_size = 0;
|
||||
|
||||
cb = original_cb;
|
||||
app_key = original_app_key;
|
||||
qsort(encs, encs_count, sizeof(encs[0]), SET_OF_xer_order);
|
||||
|
||||
for(; enc < end; enc++) {
|
||||
_ASN_CALLBACK(enc->buffer, enc->offset);
|
||||
FREEMEM(enc->buffer);
|
||||
enc->buffer = 0;
|
||||
control_size += enc->offset;
|
||||
}
|
||||
assert(control_size == er.encoded);
|
||||
}
|
||||
|
||||
goto cleanup;
|
||||
cb_failed:
|
||||
er.encoded = -1;
|
||||
er.failed_type = td;
|
||||
er.structure_ptr = sptr;
|
||||
cleanup:
|
||||
if(encs) {
|
||||
while(encs_count-- > 0) {
|
||||
if(encs[encs_count].buffer)
|
||||
FREEMEM(encs[encs_count].buffer);
|
||||
}
|
||||
FREEMEM(encs);
|
||||
}
|
||||
_ASN_ENCODED_OK(er);
|
||||
}
|
||||
|
||||
int
|
||||
SET_OF_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
|
||||
asn_app_consume_bytes_f *cb, void *app_key) {
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
if(!sptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
|
||||
|
||||
/* Dump preamble */
|
||||
if(cb(td->name, strlen(td->name), app_key) < 0
|
||||
|| cb(" ::= {", 6, app_key) < 0)
|
||||
return -1;
|
||||
|
||||
for(i = 0; i < list->count; i++) {
|
||||
const void *memb_ptr = list->array[i];
|
||||
if(!memb_ptr) continue;
|
||||
|
||||
_i_INDENT(1);
|
||||
|
||||
ret = elm->type->print_struct(elm->type, memb_ptr,
|
||||
ilevel + 1, cb, app_key);
|
||||
if(ret) return ret;
|
||||
}
|
||||
|
||||
ilevel--;
|
||||
_i_INDENT(1);
|
||||
|
||||
return (cb("}", 1, app_key) < 0) ? -1 : 0;
|
||||
}
|
||||
|
||||
void
|
||||
SET_OF_free(asn_TYPE_descriptor_t *td, void *ptr, int contents_only) {
|
||||
if(td && ptr) {
|
||||
asn_SET_OF_specifics_t *specs;
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
asn_anonymous_set_ *list = _A_SET_FROM_VOID(ptr);
|
||||
asn_struct_ctx_t *ctx; /* Decoder context */
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Could not use set_of_empty() because of (*free)
|
||||
* incompatibility.
|
||||
*/
|
||||
for(i = 0; i < list->count; i++) {
|
||||
void *memb_ptr = list->array[i];
|
||||
if(memb_ptr)
|
||||
ASN_STRUCT_FREE(*elm->type, memb_ptr);
|
||||
}
|
||||
list->count = 0; /* No meaningful elements left */
|
||||
|
||||
asn_set_empty(list); /* Remove (list->array) */
|
||||
|
||||
specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||
ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
|
||||
if(ctx->ptr) {
|
||||
ASN_STRUCT_FREE(*elm->type, ctx->ptr);
|
||||
ctx->ptr = 0;
|
||||
}
|
||||
|
||||
if(!contents_only) {
|
||||
FREEMEM(ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
SET_OF_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
|
||||
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
|
||||
asn_TYPE_member_t *elm = td->elements;
|
||||
asn_constr_check_f *constr;
|
||||
const asn_anonymous_set_ *list = _A_CSET_FROM_VOID(sptr);
|
||||
int i;
|
||||
|
||||
if(!sptr) {
|
||||
_ASN_CTFAIL(app_key, td, sptr,
|
||||
"%s: value not given (%s:%d)",
|
||||
td->name, __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
constr = elm->memb_constraints;
|
||||
if(!constr) constr = elm->type->check_constraints;
|
||||
|
||||
/*
|
||||
* Iterate over the members of an array.
|
||||
* Validate each in turn, until one fails.
|
||||
*/
|
||||
for(i = 0; i < list->count; i++) {
|
||||
const void *memb_ptr = list->array[i];
|
||||
int ret;
|
||||
|
||||
if(!memb_ptr) continue;
|
||||
|
||||
ret = constr(elm->type, memb_ptr, ctfailcb, app_key);
|
||||
if(ret) return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cannot inherit it eralier:
|
||||
* need to make sure we get the updated version.
|
||||
*/
|
||||
if(!elm->memb_constraints)
|
||||
elm->memb_constraints = elm->type->check_constraints;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
asn_dec_rval_t
|
||||
SET_OF_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
|
||||
asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
|
||||
asn_dec_rval_t rv;
|
||||
asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
|
||||
asn_TYPE_member_t *elm = td->elements; /* Single one */
|
||||
void *st = *sptr;
|
||||
asn_anonymous_set_ *list;
|
||||
asn_per_constraint_t *ct;
|
||||
int repeat = 0;
|
||||
ssize_t nelems;
|
||||
|
||||
if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
|
||||
_ASN_DECODE_FAILED;
|
||||
|
||||
/*
|
||||
* Create the target structure if it is not present already.
|
||||
*/
|
||||
if(!st) {
|
||||
st = *sptr = CALLOC(1, specs->struct_size);
|
||||
if(!st) _ASN_DECODE_FAILED;
|
||||
}
|
||||
list = _A_SET_FROM_VOID(st);
|
||||
|
||||
/* Figure out which constraints to use */
|
||||
if(constraints) ct = &constraints->size;
|
||||
else if(td->per_constraints) ct = &td->per_constraints->size;
|
||||
else ct = 0;
|
||||
|
||||
if(ct && ct->flags & APC_EXTENSIBLE) {
|
||||
int value = per_get_few_bits(pd, 1);
|
||||
if(value < 0) _ASN_DECODE_STARVED;
|
||||
if(value) ct = 0; /* Not restricted! */
|
||||
}
|
||||
|
||||
if(ct && ct->effective_bits >= 0) {
|
||||
/* X.691, #19.5: No length determinant */
|
||||
nelems = per_get_few_bits(pd, ct->effective_bits);
|
||||
ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
|
||||
(long)nelems, ct->lower_bound, td->name);
|
||||
if(nelems < 0) _ASN_DECODE_STARVED;
|
||||
nelems += ct->lower_bound;
|
||||
} else {
|
||||
nelems = -1;
|
||||
}
|
||||
|
||||
do {
|
||||
int i;
|
||||
if(nelems < 0) {
|
||||
nelems = uper_get_length(pd,
|
||||
ct ? ct->effective_bits : -1, &repeat);
|
||||
ASN_DEBUG("Got to decode %d elements (eff %d)",
|
||||
(int)nelems, (int)(ct ? ct->effective_bits : -1));
|
||||
if(nelems < 0) _ASN_DECODE_STARVED;
|
||||
}
|
||||
|
||||
for(i = 0; i < nelems; i++) {
|
||||
void *ptr = 0;
|
||||
ASN_DEBUG("SET OF %s decoding", elm->type->name);
|
||||
rv = elm->type->uper_decoder(opt_codec_ctx, elm->type,
|
||||
elm->per_constraints, &ptr, pd);
|
||||
ASN_DEBUG("%s SET OF %s decoded %d, %p",
|
||||
td->name, elm->type->name, rv.code, ptr);
|
||||
if(rv.code == RC_OK) {
|
||||
if(ASN_SET_ADD(list, ptr) == 0)
|
||||
continue;
|
||||
ASN_DEBUG("Failed to add element into %s",
|
||||
td->name);
|
||||
/* Fall through */
|
||||
rv.code = RC_FAIL;
|
||||
} else {
|
||||
ASN_DEBUG("Failed decoding %s of %s (SET OF)",
|
||||
elm->type->name, td->name);
|
||||
}
|
||||
if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
|
||||
return rv;
|
||||
}
|
||||
|
||||
nelems = -1; /* Allow uper_get_length() */
|
||||
} while(repeat);
|
||||
|
||||
ASN_DEBUG("Decoded %s as SET OF", td->name);
|
||||
|
||||
rv.code = RC_OK;
|
||||
rv.consumed = 0;
|
||||
return rv;
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
/*-
|
||||
* Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved.
|
||||
* Redistribution and modifications are permitted subject to BSD license.
|
||||
*/
|
||||
#ifndef _CONSTR_SET_OF_H_
|
||||
#define _CONSTR_SET_OF_H_
|
||||
|
||||
#include <asn_application.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef const struct asn_SET_OF_specifics_s {
|
||||
/*
|
||||
* Target structure description.
|
||||
*/
|
||||
int struct_size; /* Size of the target structure. */
|
||||
int ctx_offset; /* Offset of the asn_struct_ctx_t member */
|
||||
|
||||
/* XER-specific stuff */
|
||||
int as_XMLValueList; /* The member type must be encoded like this */
|
||||
} asn_SET_OF_specifics_t;
|
||||
|
||||
/*
|
||||
* A set specialized functions dealing with the SET OF type.
|
||||
*/
|
||||
asn_struct_free_f SET_OF_free;
|
||||
asn_struct_print_f SET_OF_print;
|
||||
asn_constr_check_f SET_OF_constraint;
|
||||
ber_type_decoder_f SET_OF_decode_ber;
|
||||
der_type_encoder_f SET_OF_encode_der;
|
||||
xer_type_decoder_f SET_OF_decode_xer;
|
||||
xer_type_encoder_f SET_OF_encode_xer;
|
||||
per_type_decoder_f SET_OF_decode_uper;
|
||||
per_type_encoder_f SET_OF_encode_uper;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _CONSTR_SET_OF_H_ */
|
@ -0,0 +1,102 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2014 The libLTE Developers. See the
|
||||
* COPYRIGHT file at the top-level directory of this distribution.
|
||||
*
|
||||
* \section LICENSE
|
||||
*
|
||||
* This file is part of the libLTE library.
|
||||
*
|
||||
* libLTE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* libLTE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* A copy of the GNU Lesser General Public License can be found in
|
||||
* the LICENSE file in the top-level directory of this distribution
|
||||
* and at http://www.gnu.org/licenses/.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "liblte/rrc/rrc_msg/bcch.h"
|
||||
#include "liblte/phy/utils/bit.h"
|
||||
#include "rrc_asn.h"
|
||||
|
||||
|
||||
void sib1_create_default(SystemInformationBlockType1_t *sib1,
|
||||
MCC_MNC_Digit_t mcc_val[3],
|
||||
MCC_MNC_Digit_t mnc_val[2],
|
||||
uint8_t tac_val[2],
|
||||
uint8_t cid_val[4],
|
||||
int freq_band)
|
||||
{
|
||||
|
||||
|
||||
PLMN_IdentityInfo_t PLMN_identity_info;
|
||||
asn_enc_rval_t enc_rval;
|
||||
SchedulingInfo_t schedulingInfo;
|
||||
SIB_Type_t sib_type;
|
||||
struct MCC mcc;
|
||||
|
||||
bzero(sib1, sizeof(SystemInformationBlockType1_t));
|
||||
bzero(&PLMN_identity_info, sizeof(PLMN_IdentityInfo_t));
|
||||
bzero(&schedulingInfo, sizeof(SchedulingInfo_t));
|
||||
bzero(&sib_type, sizeof(SIB_Type_t));
|
||||
bzero(&mcc, sizeof(struct MCC));
|
||||
|
||||
PLMN_identity_info.plmn_Identity.mcc = &mcc;
|
||||
asn_set_empty(&mcc);
|
||||
for (int i=0;i<3;i++) {
|
||||
ASN_SEQUENCE_ADD(&mcc.list,&mcc_val[i]);
|
||||
}
|
||||
printf("MCC set len: %d\n", mcc.list.count);
|
||||
for (int i=0;i<2;i++) {
|
||||
ASN_SEQUENCE_ADD(&PLMN_identity_info.plmn_Identity.mnc.list,&mnc_val[i]);
|
||||
}
|
||||
PLMN_identity_info.cellReservedForOperatorUse=cellReservedForOperatorUse_reserved;
|
||||
|
||||
ASN_SEQUENCE_ADD(&sib1->cellAccessRelatedInfo.plmn_IdentityList.list,&PLMN_identity_info);
|
||||
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.buf=tac_val;
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.size=2;
|
||||
sib1->cellAccessRelatedInfo.trackingAreaCode.bits_unused=0;
|
||||
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.buf=cid_val;
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.size=4;
|
||||
sib1->cellAccessRelatedInfo.cellIdentity.bits_unused=4;
|
||||
|
||||
sib1->cellAccessRelatedInfo.cellBarred=cellBarred_notBarred;
|
||||
|
||||
sib1->cellAccessRelatedInfo.intraFreqReselection=intraFreqReselection_allowed;
|
||||
sib1->cellAccessRelatedInfo.csg_Indication=0;
|
||||
|
||||
sib1->cellSelectionInfo.q_RxLevMin=-70;
|
||||
sib1->cellSelectionInfo.q_RxLevMinOffset=NULL;
|
||||
|
||||
sib1->freqBandIndicator = (long int) freq_band;
|
||||
|
||||
schedulingInfo.si_Periodicity=si_Periodicity_rf8;
|
||||
|
||||
// assign_enum(&sib_type,SIB_Type_sibType3);
|
||||
sib_type=SIB_Type_sibType3;
|
||||
|
||||
ASN_SEQUENCE_ADD(&schedulingInfo.sib_MappingInfo.list,&sib_type);
|
||||
ASN_SEQUENCE_ADD(&sib1->schedulingInfoList.list,&schedulingInfo);
|
||||
|
||||
sib1->tdd_Config = NULL;
|
||||
|
||||
sib1->si_WindowLength=si_WindowLength_ms10;
|
||||
sib1->systemInfoValueTag=0;
|
||||
|
||||
asn_fprint(stdout, &asn_DEF_SystemInformationBlockType1, (void*)sib1);
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2014 The libLTE Developers. See the
|
||||
* COPYRIGHT file at the top-level directory of this distribution.
|
||||
*
|
||||
* \section LICENSE
|
||||
*
|
||||
* This file is part of the libLTE library.
|
||||
*
|
||||
* libLTE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* libLTE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* A copy of the GNU Lesser General Public License can be found in
|
||||
* the LICENSE file in the top-level directory of this distribution
|
||||
* and at http://www.gnu.org/licenses/.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "liblte/rrc/rrc_msg/bcch.h"
|
||||
#include "liblte/phy/utils/bit.h"
|
||||
#include "rrc_asn.h"
|
||||
|
||||
|
||||
void sib1_create_default(SystemInformationBlockType1_t *sib1,
|
||||
MCC_MNC_Digit_t mcc_val[3],
|
||||
MCC_MNC_Digit_t mnc_val[2],
|
||||
uint8_t tac_val[2],
|
||||
uint8_t cid_val[4],
|
||||
int freq_band);
|
@ -0,0 +1,49 @@
|
||||
/**
|
||||
*
|
||||
* \section COPYRIGHT
|
||||
*
|
||||
* Copyright 2013-2014 The libLTE Developers. See the
|
||||
* COPYRIGHT file at the top-level directory of this distribution.
|
||||
*
|
||||
* \section LICENSE
|
||||
*
|
||||
* This file is part of the libLTE library.
|
||||
*
|
||||
* libLTE is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* libLTE is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* A copy of the GNU Lesser General Public License can be found in
|
||||
* the LICENSE file in the top-level directory of this distribution
|
||||
* and at http://www.gnu.org/licenses/.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "liblte/rrc/rrc.h"
|
||||
#include "rrc_asn.h"
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
//uint8_t buffer[18] = {0x40, 0x48, 0x50, 0x3, 0x2, 0xb, 0x14, 0x4a, 0x30, 0x18, 0x28, 0x20, 0x90, 0x81, 0x84, 0x79, 0x0, 0x0};
|
||||
|
||||
// bzero(buffer, 18);
|
||||
uint8_t buffer[200];
|
||||
bcch_dlsch_sib1_pack(buffer, 144);
|
||||
|
||||
//bcch_dlsch_sib1_unpack(buffer, 144);
|
||||
}
|
||||
|
Loading…
Reference in New Issue