Upstreaming version 0.10.7
[ric-plt/submgr.git] / e2ap / lib / ScheduledCommunicationTime.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "X2AP-IEs"
4  *      found in "X2AP-15-4-0.asn1"
5  *      `asn1c -D ./asn1_n1 -pdu=auto -fno-include-deps -fcompound-names -findirect-choice -gen-PER -gen-OER -no-gen-example`
6  */
7
8 #include "ScheduledCommunicationTime.h"
9
10 #include "ProtocolExtensionContainer.h"
11 static int
12 memb_dayofWeek_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 == 7)) {
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_timeofDayStart_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 <= 86399)) {
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 int
68 memb_timeofDayEnd_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
69                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
70         long value;
71         
72         if(!sptr) {
73                 ASN__CTFAIL(app_key, td, sptr,
74                         "%s: value not given (%s:%d)",
75                         td->name, __FILE__, __LINE__);
76                 return -1;
77         }
78         
79         value = *(const long *)sptr;
80         
81         if((value >= 0 && value <= 86399)) {
82                 /* Constraint check succeeded */
83                 return 0;
84         } else {
85                 ASN__CTFAIL(app_key, td, sptr,
86                         "%s: constraint failed (%s:%d)",
87                         td->name, __FILE__, __LINE__);
88                 return -1;
89         }
90 }
91
92 static asn_oer_constraints_t asn_OER_memb_dayofWeek_constr_2 CC_NOTUSED = {
93         { 0, 0 },
94         7       /* (SIZE(7..7)) */};
95 static asn_per_constraints_t asn_PER_memb_dayofWeek_constr_2 CC_NOTUSED = {
96         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
97         { APC_CONSTRAINED,       0,  0,  7,  7 }        /* (SIZE(7..7)) */,
98         0, 0    /* No PER value map */
99 };
100 static asn_oer_constraints_t asn_OER_memb_timeofDayStart_constr_3 CC_NOTUSED = {
101         { 0, 0 },
102         -1};
103 static asn_per_constraints_t asn_PER_memb_timeofDayStart_constr_3 CC_NOTUSED = {
104         { APC_CONSTRAINED | APC_EXTENSIBLE,  17, -1,  0,  86399 }       /* (0..86399,...) */,
105         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
106         0, 0    /* No PER value map */
107 };
108 static asn_oer_constraints_t asn_OER_memb_timeofDayEnd_constr_4 CC_NOTUSED = {
109         { 0, 0 },
110         -1};
111 static asn_per_constraints_t asn_PER_memb_timeofDayEnd_constr_4 CC_NOTUSED = {
112         { APC_CONSTRAINED | APC_EXTENSIBLE,  17, -1,  0,  86399 }       /* (0..86399,...) */,
113         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
114         0, 0    /* No PER value map */
115 };
116 asn_TYPE_member_t asn_MBR_ScheduledCommunicationTime_1[] = {
117         { ATF_POINTER, 4, offsetof(struct ScheduledCommunicationTime, dayofWeek),
118                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
119                 -1,     /* IMPLICIT tag at current level */
120                 &asn_DEF_BIT_STRING,
121                 0,
122                 { &asn_OER_memb_dayofWeek_constr_2, &asn_PER_memb_dayofWeek_constr_2,  memb_dayofWeek_constraint_1 },
123                 0, 0, /* No default value */
124                 "dayofWeek"
125                 },
126         { ATF_POINTER, 3, offsetof(struct ScheduledCommunicationTime, timeofDayStart),
127                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
128                 -1,     /* IMPLICIT tag at current level */
129                 &asn_DEF_NativeInteger,
130                 0,
131                 { &asn_OER_memb_timeofDayStart_constr_3, &asn_PER_memb_timeofDayStart_constr_3,  memb_timeofDayStart_constraint_1 },
132                 0, 0, /* No default value */
133                 "timeofDayStart"
134                 },
135         { ATF_POINTER, 2, offsetof(struct ScheduledCommunicationTime, timeofDayEnd),
136                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
137                 -1,     /* IMPLICIT tag at current level */
138                 &asn_DEF_NativeInteger,
139                 0,
140                 { &asn_OER_memb_timeofDayEnd_constr_4, &asn_PER_memb_timeofDayEnd_constr_4,  memb_timeofDayEnd_constraint_1 },
141                 0, 0, /* No default value */
142                 "timeofDayEnd"
143                 },
144         { ATF_POINTER, 1, offsetof(struct ScheduledCommunicationTime, iE_Extensions),
145                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
146                 -1,     /* IMPLICIT tag at current level */
147                 &asn_DEF_ProtocolExtensionContainer_7683P197,
148                 0,
149                 { 0, 0, 0 },
150                 0, 0, /* No default value */
151                 "iE-Extensions"
152                 },
153 };
154 static const int asn_MAP_ScheduledCommunicationTime_oms_1[] = { 0, 1, 2, 3 };
155 static const ber_tlv_tag_t asn_DEF_ScheduledCommunicationTime_tags_1[] = {
156         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
157 };
158 static const asn_TYPE_tag2member_t asn_MAP_ScheduledCommunicationTime_tag2el_1[] = {
159     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* dayofWeek */
160     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* timeofDayStart */
161     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* timeofDayEnd */
162     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* iE-Extensions */
163 };
164 asn_SEQUENCE_specifics_t asn_SPC_ScheduledCommunicationTime_specs_1 = {
165         sizeof(struct ScheduledCommunicationTime),
166         offsetof(struct ScheduledCommunicationTime, _asn_ctx),
167         asn_MAP_ScheduledCommunicationTime_tag2el_1,
168         4,      /* Count of tags in the map */
169         asn_MAP_ScheduledCommunicationTime_oms_1,       /* Optional members */
170         4, 0,   /* Root/Additions */
171         4,      /* First extension addition */
172 };
173 asn_TYPE_descriptor_t asn_DEF_ScheduledCommunicationTime = {
174         "ScheduledCommunicationTime",
175         "ScheduledCommunicationTime",
176         &asn_OP_SEQUENCE,
177         asn_DEF_ScheduledCommunicationTime_tags_1,
178         sizeof(asn_DEF_ScheduledCommunicationTime_tags_1)
179                 /sizeof(asn_DEF_ScheduledCommunicationTime_tags_1[0]), /* 1 */
180         asn_DEF_ScheduledCommunicationTime_tags_1,      /* Same as above */
181         sizeof(asn_DEF_ScheduledCommunicationTime_tags_1)
182                 /sizeof(asn_DEF_ScheduledCommunicationTime_tags_1[0]), /* 1 */
183         { 0, 0, SEQUENCE_constraint },
184         asn_MBR_ScheduledCommunicationTime_1,
185         4,      /* Elements count */
186         &asn_SPC_ScheduledCommunicationTime_specs_1     /* Additional specs */
187 };
188