Updated documentation for mock a1 tool
[ric-app/admin.git] / asn1c_defs / X2N_E-RABUsageReport-Item.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_E-RABUsageReport-Item.h"
9
10 #include "X2N_ProtocolExtensionContainer.h"
11 static int
12 memb_X2N_startTimeStamp_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
13                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
14         const OCTET_STRING_t *st = (const OCTET_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         size = st->size;
25         
26         if((size == 4)) {
27                 /* Constraint check succeeded */
28                 return 0;
29         } else {
30                 ASN__CTFAIL(app_key, td, sptr,
31                         "%s: constraint failed (%s:%d)",
32                         td->name, __FILE__, __LINE__);
33                 return -1;
34         }
35 }
36
37 static int
38 memb_X2N_endTimeStamp_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
39                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
40         const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
41         size_t size;
42         
43         if(!sptr) {
44                 ASN__CTFAIL(app_key, td, sptr,
45                         "%s: value not given (%s:%d)",
46                         td->name, __FILE__, __LINE__);
47                 return -1;
48         }
49         
50         size = st->size;
51         
52         if((size == 4)) {
53                 /* Constraint check succeeded */
54                 return 0;
55         } else {
56                 ASN__CTFAIL(app_key, td, sptr,
57                         "%s: constraint failed (%s:%d)",
58                         td->name, __FILE__, __LINE__);
59                 return -1;
60         }
61 }
62
63 static int
64 memb_X2N_usageCountUL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
65                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
66         const INTEGER_t *st = (const INTEGER_t *)sptr;
67         long value;
68         
69         if(!sptr) {
70                 ASN__CTFAIL(app_key, td, sptr,
71                         "%s: value not given (%s:%d)",
72                         td->name, __FILE__, __LINE__);
73                 return -1;
74         }
75         
76         if(asn_INTEGER2long(st, &value)) {
77                 ASN__CTFAIL(app_key, td, sptr,
78                         "%s: value too large (%s:%d)",
79                         td->name, __FILE__, __LINE__);
80                 return -1;
81         }
82         
83         if((value >= 0 && value <= 18446744073709551615U)) {
84                 /* Constraint check succeeded */
85                 return 0;
86         } else {
87                 ASN__CTFAIL(app_key, td, sptr,
88                         "%s: constraint failed (%s:%d)",
89                         td->name, __FILE__, __LINE__);
90                 return -1;
91         }
92 }
93
94 static int
95 memb_X2N_usageCountDL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
96                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
97         const INTEGER_t *st = (const INTEGER_t *)sptr;
98         long value;
99         
100         if(!sptr) {
101                 ASN__CTFAIL(app_key, td, sptr,
102                         "%s: value not given (%s:%d)",
103                         td->name, __FILE__, __LINE__);
104                 return -1;
105         }
106         
107         if(asn_INTEGER2long(st, &value)) {
108                 ASN__CTFAIL(app_key, td, sptr,
109                         "%s: value too large (%s:%d)",
110                         td->name, __FILE__, __LINE__);
111                 return -1;
112         }
113         
114         if((value >= 0 && value <= 18446744073709551615U)) {
115                 /* Constraint check succeeded */
116                 return 0;
117         } else {
118                 ASN__CTFAIL(app_key, td, sptr,
119                         "%s: constraint failed (%s:%d)",
120                         td->name, __FILE__, __LINE__);
121                 return -1;
122         }
123 }
124
125 static asn_per_constraints_t asn_PER_memb_X2N_startTimeStamp_constr_2 CC_NOTUSED = {
126         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
127         { APC_CONSTRAINED,       0,  0,  4,  4 }        /* (SIZE(4..4)) */,
128         0, 0    /* No PER value map */
129 };
130 static asn_per_constraints_t asn_PER_memb_X2N_endTimeStamp_constr_3 CC_NOTUSED = {
131         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
132         { APC_CONSTRAINED,       0,  0,  4,  4 }        /* (SIZE(4..4)) */,
133         0, 0    /* No PER value map */
134 };
135 static asn_per_constraints_t asn_PER_memb_X2N_usageCountUL_constr_4 CC_NOTUSED = {
136         { APC_CONSTRAINED,       64, -1,  0,  18446744073709551615U }   /* (0..18446744073709551615U) */,
137         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
138         0, 0    /* No PER value map */
139 };
140 static asn_per_constraints_t asn_PER_memb_X2N_usageCountDL_constr_5 CC_NOTUSED = {
141         { APC_CONSTRAINED,       64, -1,  0,  18446744073709551615U }   /* (0..18446744073709551615U) */,
142         { APC_UNCONSTRAINED,    -1, -1,  0,  0 },
143         0, 0    /* No PER value map */
144 };
145 static asn_TYPE_member_t asn_MBR_X2N_E_RABUsageReport_Item_1[] = {
146         { ATF_NOFLAGS, 0, offsetof(struct X2N_E_RABUsageReport_Item, startTimeStamp),
147                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
148                 -1,     /* IMPLICIT tag at current level */
149                 &asn_DEF_OCTET_STRING,
150                 0,
151                 { 0, &asn_PER_memb_X2N_startTimeStamp_constr_2,  memb_X2N_startTimeStamp_constraint_1 },
152                 0, 0, /* No default value */
153                 "startTimeStamp"
154                 },
155         { ATF_NOFLAGS, 0, offsetof(struct X2N_E_RABUsageReport_Item, endTimeStamp),
156                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
157                 -1,     /* IMPLICIT tag at current level */
158                 &asn_DEF_OCTET_STRING,
159                 0,
160                 { 0, &asn_PER_memb_X2N_endTimeStamp_constr_3,  memb_X2N_endTimeStamp_constraint_1 },
161                 0, 0, /* No default value */
162                 "endTimeStamp"
163                 },
164         { ATF_NOFLAGS, 0, offsetof(struct X2N_E_RABUsageReport_Item, usageCountUL),
165                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
166                 -1,     /* IMPLICIT tag at current level */
167                 &asn_DEF_INTEGER,
168                 0,
169                 { 0, &asn_PER_memb_X2N_usageCountUL_constr_4,  memb_X2N_usageCountUL_constraint_1 },
170                 0, 0, /* No default value */
171                 "usageCountUL"
172                 },
173         { ATF_NOFLAGS, 0, offsetof(struct X2N_E_RABUsageReport_Item, usageCountDL),
174                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
175                 -1,     /* IMPLICIT tag at current level */
176                 &asn_DEF_INTEGER,
177                 0,
178                 { 0, &asn_PER_memb_X2N_usageCountDL_constr_5,  memb_X2N_usageCountDL_constraint_1 },
179                 0, 0, /* No default value */
180                 "usageCountDL"
181                 },
182         { ATF_POINTER, 1, offsetof(struct X2N_E_RABUsageReport_Item, iE_Extensions),
183                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
184                 -1,     /* IMPLICIT tag at current level */
185                 &asn_DEF_X2N_ProtocolExtensionContainer_8231P141,
186                 0,
187                 { 0, 0, 0 },
188                 0, 0, /* No default value */
189                 "iE-Extensions"
190                 },
191 };
192 static const int asn_MAP_X2N_E_RABUsageReport_Item_oms_1[] = { 4 };
193 static const ber_tlv_tag_t asn_DEF_X2N_E_RABUsageReport_Item_tags_1[] = {
194         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
195 };
196 static const asn_TYPE_tag2member_t asn_MAP_X2N_E_RABUsageReport_Item_tag2el_1[] = {
197     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* startTimeStamp */
198     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* endTimeStamp */
199     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* usageCountUL */
200     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* usageCountDL */
201     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iE-Extensions */
202 };
203 static asn_SEQUENCE_specifics_t asn_SPC_X2N_E_RABUsageReport_Item_specs_1 = {
204         sizeof(struct X2N_E_RABUsageReport_Item),
205         offsetof(struct X2N_E_RABUsageReport_Item, _asn_ctx),
206         asn_MAP_X2N_E_RABUsageReport_Item_tag2el_1,
207         5,      /* Count of tags in the map */
208         asn_MAP_X2N_E_RABUsageReport_Item_oms_1,        /* Optional members */
209         1, 0,   /* Root/Additions */
210         5,      /* First extension addition */
211 };
212 asn_TYPE_descriptor_t asn_DEF_X2N_E_RABUsageReport_Item = {
213         "E-RABUsageReport-Item",
214         "E-RABUsageReport-Item",
215         &asn_OP_SEQUENCE,
216         asn_DEF_X2N_E_RABUsageReport_Item_tags_1,
217         sizeof(asn_DEF_X2N_E_RABUsageReport_Item_tags_1)
218                 /sizeof(asn_DEF_X2N_E_RABUsageReport_Item_tags_1[0]), /* 1 */
219         asn_DEF_X2N_E_RABUsageReport_Item_tags_1,       /* Same as above */
220         sizeof(asn_DEF_X2N_E_RABUsageReport_Item_tags_1)
221                 /sizeof(asn_DEF_X2N_E_RABUsageReport_Item_tags_1[0]), /* 1 */
222         { 0, 0, SEQUENCE_constraint },
223         asn_MBR_X2N_E_RABUsageReport_Item_1,
224         5,      /* Elements count */
225         &asn_SPC_X2N_E_RABUsageReport_Item_specs_1      /* Additional specs */
226 };
227