2fbf8f126c7e85ad8ca246ee5e3f99da576be786
[ric-app/admin.git] / asn1c_defs / X2N_ReservedSubframePattern.c
1 /*
2  * Generated by asn1c-0.9.29 n1 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "../../asn_defs/asn1/x2ap-15-04.asn"
5  *      `asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER -no-gen-OER`
6  */
7
8 #include "X2N_ReservedSubframePattern.h"
9
10 #include "X2N_ProtocolExtensionContainer.h"
11 static int
12 memb_X2N_reservedSubframePattern_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
13                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
14         const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
15         size_t size;
16         
17         if(!sptr) {
18                 ASN__CTFAIL(app_key, td, sptr,
19                         "%s: value not given (%s:%d)",
20                         td->name, __FILE__, __LINE__);
21                 return -1;
22         }
23         
24         if(st->size > 0) {
25                 /* Size in bits */
26                 size = 8 * st->size - (st->bits_unused & 0x07);
27         } else {
28                 size = 0;
29         }
30         
31         if((size >= 10 && size <= 160)) {
32                 /* Constraint check succeeded */
33                 return 0;
34         } else {
35                 ASN__CTFAIL(app_key, td, sptr,
36                         "%s: constraint failed (%s:%d)",
37                         td->name, __FILE__, __LINE__);
38                 return -1;
39         }
40 }
41
42 static int
43 memb_X2N_mBSFNControlRegionLength_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
44                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
45         long value;
46         
47         if(!sptr) {
48                 ASN__CTFAIL(app_key, td, sptr,
49                         "%s: value not given (%s:%d)",
50                         td->name, __FILE__, __LINE__);
51                 return -1;
52         }
53         
54         value = *(const long *)sptr;
55         
56         if((value >= 0 && value <= 3)) {
57                 /* Constraint check succeeded */
58                 return 0;
59         } else {
60                 ASN__CTFAIL(app_key, td, sptr,
61                         "%s: constraint failed (%s:%d)",
62                         td->name, __FILE__, __LINE__);
63                 return -1;
64         }
65 }
66
67 static asn_per_constraints_t asn_PER_memb_X2N_reservedSubframePattern_constr_3 CC_NOTUSED = {
68         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
69         { APC_CONSTRAINED,       8,  8,  10,  160 }     /* (SIZE(10..160)) */,
70         0, 0    /* No PER value map */
71 };
72 static asn_per_constraints_t asn_PER_memb_X2N_mBSFNControlRegionLength_constr_4 CC_NOTUSED = {
73         { APC_CONSTRAINED,       2,  2,  0,  3 }        /* (0..3) */,
74         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
75         0, 0    /* No PER value map */
76 };
77 asn_TYPE_member_t asn_MBR_X2N_ReservedSubframePattern_1[] = {
78         { ATF_NOFLAGS, 0, offsetof(struct X2N_ReservedSubframePattern, subframeType),
79                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
80                 -1,     /* IMPLICIT tag at current level */
81                 &asn_DEF_X2N_SubframeType,
82                 0,
83                 { 0, 0, 0 },
84                 0, 0, /* No default value */
85                 "subframeType"
86                 },
87         { ATF_NOFLAGS, 0, offsetof(struct X2N_ReservedSubframePattern, reservedSubframePattern),
88                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
89                 -1,     /* IMPLICIT tag at current level */
90                 &asn_DEF_BIT_STRING,
91                 0,
92                 { 0, &asn_PER_memb_X2N_reservedSubframePattern_constr_3,  memb_X2N_reservedSubframePattern_constraint_1 },
93                 0, 0, /* No default value */
94                 "reservedSubframePattern"
95                 },
96         { ATF_NOFLAGS, 0, offsetof(struct X2N_ReservedSubframePattern, mBSFNControlRegionLength),
97                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
98                 -1,     /* IMPLICIT tag at current level */
99                 &asn_DEF_NativeInteger,
100                 0,
101                 { 0, &asn_PER_memb_X2N_mBSFNControlRegionLength_constr_4,  memb_X2N_mBSFNControlRegionLength_constraint_1 },
102                 0, 0, /* No default value */
103                 "mBSFNControlRegionLength"
104                 },
105         { ATF_POINTER, 1, offsetof(struct X2N_ReservedSubframePattern, iE_Extensions),
106                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
107                 -1,     /* IMPLICIT tag at current level */
108                 &asn_DEF_X2N_ProtocolExtensionContainer_8231P185,
109                 0,
110                 { 0, 0, 0 },
111                 0, 0, /* No default value */
112                 "iE-Extensions"
113                 },
114 };
115 static const int asn_MAP_X2N_ReservedSubframePattern_oms_1[] = { 3 };
116 static const ber_tlv_tag_t asn_DEF_X2N_ReservedSubframePattern_tags_1[] = {
117         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
118 };
119 static const asn_TYPE_tag2member_t asn_MAP_X2N_ReservedSubframePattern_tag2el_1[] = {
120     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* subframeType */
121     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* reservedSubframePattern */
122     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* mBSFNControlRegionLength */
123     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
124 };
125 asn_SEQUENCE_specifics_t asn_SPC_X2N_ReservedSubframePattern_specs_1 = {
126         sizeof(struct X2N_ReservedSubframePattern),
127         offsetof(struct X2N_ReservedSubframePattern, _asn_ctx),
128         asn_MAP_X2N_ReservedSubframePattern_tag2el_1,
129         4,      /* Count of tags in the map */
130         asn_MAP_X2N_ReservedSubframePattern_oms_1,      /* Optional members */
131         1, 0,   /* Root/Additions */
132         4,      /* First extension addition */
133 };
134 asn_TYPE_descriptor_t asn_DEF_X2N_ReservedSubframePattern = {
135         "ReservedSubframePattern",
136         "ReservedSubframePattern",
137         &asn_OP_SEQUENCE,
138         asn_DEF_X2N_ReservedSubframePattern_tags_1,
139         sizeof(asn_DEF_X2N_ReservedSubframePattern_tags_1)
140                 /sizeof(asn_DEF_X2N_ReservedSubframePattern_tags_1[0]), /* 1 */
141         asn_DEF_X2N_ReservedSubframePattern_tags_1,     /* Same as above */
142         sizeof(asn_DEF_X2N_ReservedSubframePattern_tags_1)
143                 /sizeof(asn_DEF_X2N_ReservedSubframePattern_tags_1[0]), /* 1 */
144         { 0, 0, SEQUENCE_constraint },
145         asn_MBR_X2N_ReservedSubframePattern_1,
146         4,      /* Elements count */
147         &asn_SPC_X2N_ReservedSubframePattern_specs_1    /* Additional specs */
148 };
149