SIM-115: update simulator to use latest E2SM KPM version 3
[sim/e2-interface.git] / e2sim / asn1c / RANfunction-Name.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2SM-COMMON-IEs"
4  *      found in "e2sm-v03.01.asn"
5  *      `asn1c -pdu=auto -fincludes-quoted -fcompound-names -findirect-choice -fno-include-deps -no-gen-example -no-gen-OER -D /tmp/workspace/oransim-gerrit/e2sim/asn1c/`
6  */
7
8 #include "RANfunction-Name.h"
9
10 static const int permitted_alphabet_table_2[256] = {
11  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
12  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
13  1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,        /* .      '() +,-./ */
14 10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,        /* 0123456789:  = ? */
15  0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,        /*  ABCDEFGHIJKLMNO */
16 38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,        /* PQRSTUVWXYZ      */
17  0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,        /*  abcdefghijklmno */
18 64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,        /* pqrstuvwxyz      */
19 };
20 static const int permitted_alphabet_code2value_2[74] = {
21 32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
22 55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
23 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
24 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
25 113,114,115,116,117,118,119,120,121,122,};
26
27
28 static int check_permitted_alphabet_2(const void *sptr) {
29         const int *table = permitted_alphabet_table_2;
30         /* The underlying type is PrintableString */
31         const PrintableString_t *st = (const PrintableString_t *)sptr;
32         const uint8_t *ch = st->buf;
33         const uint8_t *end = ch + st->size;
34         
35         for(; ch < end; ch++) {
36                 uint8_t cv = *ch;
37                 if(!table[cv]) return -1;
38         }
39         return 0;
40 }
41
42 static const int permitted_alphabet_table_3[256] = {
43  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
44  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
45  1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,        /* .      '() +,-./ */
46 10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,        /* 0123456789:  = ? */
47  0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,        /*  ABCDEFGHIJKLMNO */
48 38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,        /* PQRSTUVWXYZ      */
49  0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,        /*  abcdefghijklmno */
50 64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,        /* pqrstuvwxyz      */
51 };
52 static const int permitted_alphabet_code2value_3[74] = {
53 32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
54 55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
55 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
56 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
57 113,114,115,116,117,118,119,120,121,122,};
58
59
60 static int check_permitted_alphabet_3(const void *sptr) {
61         const int *table = permitted_alphabet_table_3;
62         /* The underlying type is PrintableString */
63         const PrintableString_t *st = (const PrintableString_t *)sptr;
64         const uint8_t *ch = st->buf;
65         const uint8_t *end = ch + st->size;
66         
67         for(; ch < end; ch++) {
68                 uint8_t cv = *ch;
69                 if(!table[cv]) return -1;
70         }
71         return 0;
72 }
73
74 static const int permitted_alphabet_table_4[256] = {
75  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
76  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
77  1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,        /* .      '() +,-./ */
78 10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,        /* 0123456789:  = ? */
79  0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,        /*  ABCDEFGHIJKLMNO */
80 38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,        /* PQRSTUVWXYZ      */
81  0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,        /*  abcdefghijklmno */
82 64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,        /* pqrstuvwxyz      */
83 };
84 static const int permitted_alphabet_code2value_4[74] = {
85 32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
86 55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
87 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
88 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
89 113,114,115,116,117,118,119,120,121,122,};
90
91
92 static int check_permitted_alphabet_4(const void *sptr) {
93         const int *table = permitted_alphabet_table_4;
94         /* The underlying type is PrintableString */
95         const PrintableString_t *st = (const PrintableString_t *)sptr;
96         const uint8_t *ch = st->buf;
97         const uint8_t *end = ch + st->size;
98         
99         for(; ch < end; ch++) {
100                 uint8_t cv = *ch;
101                 if(!table[cv]) return -1;
102         }
103         return 0;
104 }
105
106 static int
107 memb_ranFunction_ShortName_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
108                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
109         const PrintableString_t *st = (const PrintableString_t *)sptr;
110         size_t size;
111         
112         if(!sptr) {
113                 ASN__CTFAIL(app_key, td, sptr,
114                         "%s: value not given (%s:%d)",
115                         td->name, __FILE__, __LINE__);
116                 return -1;
117         }
118         
119         size = st->size;
120         
121         if((size >= 1UL && size <= 150UL)
122                  && !check_permitted_alphabet_2(st)) {
123                 /* Constraint check succeeded */
124                 return 0;
125         } else {
126                 ASN__CTFAIL(app_key, td, sptr,
127                         "%s: constraint failed (%s:%d)",
128                         td->name, __FILE__, __LINE__);
129                 return -1;
130         }
131 }
132
133 static int asn_PER_MAP_ranFunction_ShortName_2_v2c(unsigned int value) {
134         if(value >= sizeof(permitted_alphabet_table_2)/sizeof(permitted_alphabet_table_2[0]))
135                 return -1;
136         return permitted_alphabet_table_2[value] - 1;
137 }
138 static int asn_PER_MAP_ranFunction_ShortName_2_c2v(unsigned int code) {
139         if(code >= sizeof(permitted_alphabet_code2value_2)/sizeof(permitted_alphabet_code2value_2[0]))
140                 return -1;
141         return permitted_alphabet_code2value_2[code];
142 }
143 static int
144 memb_ranFunction_E2SM_OID_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
145                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
146         const PrintableString_t *st = (const PrintableString_t *)sptr;
147         size_t size;
148         
149         if(!sptr) {
150                 ASN__CTFAIL(app_key, td, sptr,
151                         "%s: value not given (%s:%d)",
152                         td->name, __FILE__, __LINE__);
153                 return -1;
154         }
155         
156         size = st->size;
157         
158         if((size >= 1UL && size <= 1000UL)
159                  && !check_permitted_alphabet_3(st)) {
160                 /* Constraint check succeeded */
161                 return 0;
162         } else {
163                 ASN__CTFAIL(app_key, td, sptr,
164                         "%s: constraint failed (%s:%d)",
165                         td->name, __FILE__, __LINE__);
166                 return -1;
167         }
168 }
169
170 static int asn_PER_MAP_ranFunction_E2SM_OID_3_v2c(unsigned int value) {
171         if(value >= sizeof(permitted_alphabet_table_3)/sizeof(permitted_alphabet_table_3[0]))
172                 return -1;
173         return permitted_alphabet_table_3[value] - 1;
174 }
175 static int asn_PER_MAP_ranFunction_E2SM_OID_3_c2v(unsigned int code) {
176         if(code >= sizeof(permitted_alphabet_code2value_3)/sizeof(permitted_alphabet_code2value_3[0]))
177                 return -1;
178         return permitted_alphabet_code2value_3[code];
179 }
180 static int
181 memb_ranFunction_Description_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
182                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
183         const PrintableString_t *st = (const PrintableString_t *)sptr;
184         size_t size;
185         
186         if(!sptr) {
187                 ASN__CTFAIL(app_key, td, sptr,
188                         "%s: value not given (%s:%d)",
189                         td->name, __FILE__, __LINE__);
190                 return -1;
191         }
192         
193         size = st->size;
194         
195         if((size >= 1UL && size <= 150UL)
196                  && !check_permitted_alphabet_4(st)) {
197                 /* Constraint check succeeded */
198                 return 0;
199         } else {
200                 ASN__CTFAIL(app_key, td, sptr,
201                         "%s: constraint failed (%s:%d)",
202                         td->name, __FILE__, __LINE__);
203                 return -1;
204         }
205 }
206
207 static int asn_PER_MAP_ranFunction_Description_4_v2c(unsigned int value) {
208         if(value >= sizeof(permitted_alphabet_table_4)/sizeof(permitted_alphabet_table_4[0]))
209                 return -1;
210         return permitted_alphabet_table_4[value] - 1;
211 }
212 static int asn_PER_MAP_ranFunction_Description_4_c2v(unsigned int code) {
213         if(code >= sizeof(permitted_alphabet_code2value_4)/sizeof(permitted_alphabet_code2value_4[0]))
214                 return -1;
215         return permitted_alphabet_code2value_4[code];
216 }
217 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
218 static asn_per_constraints_t asn_PER_memb_ranFunction_ShortName_constr_2 CC_NOTUSED = {
219         { APC_CONSTRAINED,       7,  7,  32,  122 }     /* (32..122) */,
220         { APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }  /* (SIZE(1..150,...)) */,
221         asn_PER_MAP_ranFunction_ShortName_2_v2c,        /* Value to PER code map */
222         asn_PER_MAP_ranFunction_ShortName_2_c2v /* PER code to value map */
223 };
224 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
225 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
226 static asn_per_constraints_t asn_PER_memb_ranFunction_E2SM_OID_constr_3 CC_NOTUSED = {
227         { APC_CONSTRAINED,       7,  7,  32,  122 }     /* (32..122) */,
228         { APC_CONSTRAINED | APC_EXTENSIBLE,  10,  10,  1,  1000 }       /* (SIZE(1..1000,...)) */,
229         asn_PER_MAP_ranFunction_E2SM_OID_3_v2c, /* Value to PER code map */
230         asn_PER_MAP_ranFunction_E2SM_OID_3_c2v  /* PER code to value map */
231 };
232 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
233 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
234 static asn_per_constraints_t asn_PER_memb_ranFunction_Description_constr_4 CC_NOTUSED = {
235         { APC_CONSTRAINED,       7,  7,  32,  122 }     /* (32..122) */,
236         { APC_CONSTRAINED | APC_EXTENSIBLE,  8,  8,  1,  150 }  /* (SIZE(1..150,...)) */,
237         asn_PER_MAP_ranFunction_Description_4_v2c,      /* Value to PER code map */
238         asn_PER_MAP_ranFunction_Description_4_c2v       /* PER code to value map */
239 };
240 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
241 asn_TYPE_member_t asn_MBR_RANfunction_Name_1[] = {
242         { ATF_NOFLAGS, 0, offsetof(struct RANfunction_Name, ranFunction_ShortName),
243                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
244                 -1,     /* IMPLICIT tag at current level */
245                 &asn_DEF_PrintableString,
246                 0,
247                 {
248 #if !defined(ASN_DISABLE_OER_SUPPORT)
249                         0,
250 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
251 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
252                         &asn_PER_memb_ranFunction_ShortName_constr_2,
253 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
254                         memb_ranFunction_ShortName_constraint_1
255                 },
256                 0, 0, /* No default value */
257                 "ranFunction-ShortName"
258                 },
259         { ATF_NOFLAGS, 0, offsetof(struct RANfunction_Name, ranFunction_E2SM_OID),
260                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
261                 -1,     /* IMPLICIT tag at current level */
262                 &asn_DEF_PrintableString,
263                 0,
264                 {
265 #if !defined(ASN_DISABLE_OER_SUPPORT)
266                         0,
267 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
268 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
269                         &asn_PER_memb_ranFunction_E2SM_OID_constr_3,
270 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
271                         memb_ranFunction_E2SM_OID_constraint_1
272                 },
273                 0, 0, /* No default value */
274                 "ranFunction-E2SM-OID"
275                 },
276         { ATF_NOFLAGS, 0, offsetof(struct RANfunction_Name, ranFunction_Description),
277                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
278                 -1,     /* IMPLICIT tag at current level */
279                 &asn_DEF_PrintableString,
280                 0,
281                 {
282 #if !defined(ASN_DISABLE_OER_SUPPORT)
283                         0,
284 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
285 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
286                         &asn_PER_memb_ranFunction_Description_constr_4,
287 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
288                         memb_ranFunction_Description_constraint_1
289                 },
290                 0, 0, /* No default value */
291                 "ranFunction-Description"
292                 },
293         { ATF_POINTER, 1, offsetof(struct RANfunction_Name, ranFunction_Instance),
294                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
295                 -1,     /* IMPLICIT tag at current level */
296                 &asn_DEF_NativeInteger,
297                 0,
298                 {
299 #if !defined(ASN_DISABLE_OER_SUPPORT)
300                         0,
301 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
302 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
303                         0,
304 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
305                         0
306                 },
307                 0, 0, /* No default value */
308                 "ranFunction-Instance"
309                 },
310 };
311 static const int asn_MAP_RANfunction_Name_oms_1[] = { 3 };
312 static const ber_tlv_tag_t asn_DEF_RANfunction_Name_tags_1[] = {
313         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
314 };
315 static const asn_TYPE_tag2member_t asn_MAP_RANfunction_Name_tag2el_1[] = {
316     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* ranFunction-ShortName */
317     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* ranFunction-E2SM-OID */
318     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* ranFunction-Description */
319     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* ranFunction-Instance */
320 };
321 asn_SEQUENCE_specifics_t asn_SPC_RANfunction_Name_specs_1 = {
322         sizeof(struct RANfunction_Name),
323         offsetof(struct RANfunction_Name, _asn_ctx),
324         asn_MAP_RANfunction_Name_tag2el_1,
325         4,      /* Count of tags in the map */
326         asn_MAP_RANfunction_Name_oms_1, /* Optional members */
327         1, 0,   /* Root/Additions */
328         4,      /* First extension addition */
329 };
330 asn_TYPE_descriptor_t asn_DEF_RANfunction_Name = {
331         "RANfunction-Name",
332         "RANfunction-Name",
333         &asn_OP_SEQUENCE,
334         asn_DEF_RANfunction_Name_tags_1,
335         sizeof(asn_DEF_RANfunction_Name_tags_1)
336                 /sizeof(asn_DEF_RANfunction_Name_tags_1[0]), /* 1 */
337         asn_DEF_RANfunction_Name_tags_1,        /* Same as above */
338         sizeof(asn_DEF_RANfunction_Name_tags_1)
339                 /sizeof(asn_DEF_RANfunction_Name_tags_1[0]), /* 1 */
340         {
341 #if !defined(ASN_DISABLE_OER_SUPPORT)
342                 0,
343 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
344 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
345                 0,
346 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
347                 SEQUENCE_constraint
348         },
349         asn_MBR_RANfunction_Name_1,
350         4,      /* Elements count */
351         &asn_SPC_RANfunction_Name_specs_1       /* Additional specs */
352 };
353