blob: 83bbe0f6ade7504ddfc09d6cd11db76ac5adc605 [file] [log] [blame]
Harald Welted523a692015-08-30 23:11:19 +02001/*
2 * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
3 * From ASN.1 module "HNBAP-IEs"
4 * found in "../../asn1/hnbap/HNBAP-IEs.asn"
Harald Welteff4750f2015-08-31 09:55:28 +02005 * `asn1c -gen-PER`
Harald Welted523a692015-08-30 23:11:19 +02006 */
7
Neels Hofmeyrf1f2d7c2016-01-05 12:00:06 +01008#include <osmocom/hnbap/TMSILAI.h>
Harald Welted523a692015-08-30 23:11:19 +02009
10static int
11memb_tMSI_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
14 size_t size;
15
16 if(!sptr) {
17 _ASN_CTFAIL(app_key, td, sptr,
18 "%s: value not given (%s:%d)",
19 td->name, __FILE__, __LINE__);
20 return -1;
21 }
22
23 if(st->size > 0) {
24 /* Size in bits */
25 size = 8 * st->size - (st->bits_unused & 0x07);
26 } else {
27 size = 0;
28 }
29
30 if((size == 32l)) {
31 /* Constraint check succeeded */
32 return 0;
33 } else {
34 _ASN_CTFAIL(app_key, td, sptr,
35 "%s: constraint failed (%s:%d)",
36 td->name, __FILE__, __LINE__);
37 return -1;
38 }
39}
40
41static asn_per_constraints_t asn_PER_memb_tMSI_constr_2 GCC_NOTUSED = {
42 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
43 { APC_CONSTRAINED, 0, 0, 32l, 32l } /* (SIZE(32..32)) */,
44 0, 0 /* No PER value map */
45};
46static asn_TYPE_member_t asn_MBR_TMSILAI_1[] = {
47 { ATF_NOFLAGS, 0, offsetof(struct TMSILAI, tMSI),
48 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
49 -1, /* IMPLICIT tag at current level */
50 &asn_DEF_BIT_STRING,
51 memb_tMSI_constraint_1,
52 &asn_PER_memb_tMSI_constr_2,
53 0,
54 "tMSI"
55 },
56 { ATF_NOFLAGS, 0, offsetof(struct TMSILAI, lAI),
57 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
58 -1, /* IMPLICIT tag at current level */
59 &asn_DEF_LAI,
60 0, /* Defer constraints checking to the member type */
61 0, /* No PER visible constraints */
62 0,
63 "lAI"
64 },
65};
66static const ber_tlv_tag_t asn_DEF_TMSILAI_tags_1[] = {
67 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
68};
69static const asn_TYPE_tag2member_t asn_MAP_TMSILAI_tag2el_1[] = {
70 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* tMSI */
71 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* lAI */
72};
73static asn_SEQUENCE_specifics_t asn_SPC_TMSILAI_specs_1 = {
74 sizeof(struct TMSILAI),
75 offsetof(struct TMSILAI, _asn_ctx),
76 asn_MAP_TMSILAI_tag2el_1,
77 2, /* Count of tags in the map */
78 0, 0, 0, /* Optional elements (not needed) */
79 -1, /* Start extensions */
80 -1 /* Stop extensions */
81};
82asn_TYPE_descriptor_t asn_DEF_TMSILAI = {
83 "TMSILAI",
84 "TMSILAI",
85 SEQUENCE_free,
86 SEQUENCE_print,
87 SEQUENCE_constraint,
88 SEQUENCE_decode_ber,
89 SEQUENCE_encode_der,
90 SEQUENCE_decode_xer,
91 SEQUENCE_encode_xer,
92 SEQUENCE_decode_uper,
93 SEQUENCE_encode_uper,
94 SEQUENCE_decode_aper,
95 SEQUENCE_encode_aper,
96 0, /* Use generic outmost tag fetcher */
97 asn_DEF_TMSILAI_tags_1,
98 sizeof(asn_DEF_TMSILAI_tags_1)
99 /sizeof(asn_DEF_TMSILAI_tags_1[0]), /* 1 */
100 asn_DEF_TMSILAI_tags_1, /* Same as above */
101 sizeof(asn_DEF_TMSILAI_tags_1)
102 /sizeof(asn_DEF_TMSILAI_tags_1[0]), /* 1 */
103 0, /* No PER visible constraints */
104 asn_MBR_TMSILAI_1,
105 2, /* Elements count */
106 &asn_SPC_TMSILAI_specs_1 /* Additional specs */
107};
108