ISSUE ID:- RICAPP-216
[ric-app/bouncer.git] / Bouncer / e2sm_kpm / lib / E2SM-KPM-IndicationHeader-Format1.c
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "E2SM-KPM-IEs"
4  *      found in "kpmv2.asn"
5  *      `asn1c -pdu=auto -fincludes-quoted -fcompound-names -findirect-choice -fno-include-deps -gen-PER -no-gen-OER -no-gen-example`
6  */
7
8 #include "E2SM-KPM-IndicationHeader-Format1.h"
9
10 static const int permitted_alphabet_table_3[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_3[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_3(const void *sptr) {
29         const int *table = permitted_alphabet_table_3;
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_4[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_4[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_4(const void *sptr) {
61         const int *table = permitted_alphabet_table_4;
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_5[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_5[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_5(const void *sptr) {
93         const int *table = permitted_alphabet_table_5;
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 const int permitted_alphabet_table_6[256] = {
107  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
108  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,        /*                  */
109  1, 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, 5, 6, 7, 8, 9,        /* .      '() +,-./ */
110 10,11,12,13,14,15,16,17,18,19,20, 0, 0,21, 0,22,        /* 0123456789:  = ? */
111  0,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,        /*  ABCDEFGHIJKLMNO */
112 38,39,40,41,42,43,44,45,46,47,48, 0, 0, 0, 0, 0,        /* PQRSTUVWXYZ      */
113  0,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,        /*  abcdefghijklmno */
114 64,65,66,67,68,69,70,71,72,73,74, 0, 0, 0, 0, 0,        /* pqrstuvwxyz      */
115 };
116 static const int permitted_alphabet_code2value_6[74] = {
117 32,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,
118 55,56,57,58,61,63,65,66,67,68,69,70,71,72,73,74,
119 75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,
120 97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,
121 113,114,115,116,117,118,119,120,121,122,};
122
123
124 static int check_permitted_alphabet_6(const void *sptr) {
125         const int *table = permitted_alphabet_table_6;
126         /* The underlying type is PrintableString */
127         const PrintableString_t *st = (const PrintableString_t *)sptr;
128         const uint8_t *ch = st->buf;
129         const uint8_t *end = ch + st->size;
130         
131         for(; ch < end; ch++) {
132                 uint8_t cv = *ch;
133                 if(!table[cv]) return -1;
134         }
135         return 0;
136 }
137
138 static int
139 memb_fileFormatversion_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
140                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
141         const PrintableString_t *st = (const PrintableString_t *)sptr;
142         size_t size;
143         
144         if(!sptr) {
145                 ASN__CTFAIL(app_key, td, sptr,
146                         "%s: value not given (%s:%d)",
147                         td->name, __FILE__, __LINE__);
148                 return -1;
149         }
150         
151         size = st->size;
152         
153         if((size <= 15)
154                  && !check_permitted_alphabet_3(st)) {
155                 /* Constraint check succeeded */
156                 return 0;
157         } else {
158                 ASN__CTFAIL(app_key, td, sptr,
159                         "%s: constraint failed (%s:%d)",
160                         td->name, __FILE__, __LINE__);
161                 return -1;
162         }
163 }
164
165 static int asn_PER_MAP_fileFormatversion_3_v2c(unsigned int value) {
166         if(value >= sizeof(permitted_alphabet_table_3)/sizeof(permitted_alphabet_table_3[0]))
167                 return -1;
168         return permitted_alphabet_table_3[value] - 1;
169 }
170 static int asn_PER_MAP_fileFormatversion_3_c2v(unsigned int code) {
171         if(code >= sizeof(permitted_alphabet_code2value_3)/sizeof(permitted_alphabet_code2value_3[0]))
172                 return -1;
173         return permitted_alphabet_code2value_3[code];
174 }
175 static int
176 memb_senderName_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
177                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
178         const PrintableString_t *st = (const PrintableString_t *)sptr;
179         size_t size;
180         
181         if(!sptr) {
182                 ASN__CTFAIL(app_key, td, sptr,
183                         "%s: value not given (%s:%d)",
184                         td->name, __FILE__, __LINE__);
185                 return -1;
186         }
187         
188         size = st->size;
189         
190         if((size <= 400)
191                  && !check_permitted_alphabet_4(st)) {
192                 /* Constraint check succeeded */
193                 return 0;
194         } else {
195                 ASN__CTFAIL(app_key, td, sptr,
196                         "%s: constraint failed (%s:%d)",
197                         td->name, __FILE__, __LINE__);
198                 return -1;
199         }
200 }
201
202 static int asn_PER_MAP_senderName_4_v2c(unsigned int value) {
203         if(value >= sizeof(permitted_alphabet_table_4)/sizeof(permitted_alphabet_table_4[0]))
204                 return -1;
205         return permitted_alphabet_table_4[value] - 1;
206 }
207 static int asn_PER_MAP_senderName_4_c2v(unsigned int code) {
208         if(code >= sizeof(permitted_alphabet_code2value_4)/sizeof(permitted_alphabet_code2value_4[0]))
209                 return -1;
210         return permitted_alphabet_code2value_4[code];
211 }
212 static int
213 memb_senderType_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
214                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
215         const PrintableString_t *st = (const PrintableString_t *)sptr;
216         size_t size;
217         
218         if(!sptr) {
219                 ASN__CTFAIL(app_key, td, sptr,
220                         "%s: value not given (%s:%d)",
221                         td->name, __FILE__, __LINE__);
222                 return -1;
223         }
224         
225         size = st->size;
226         
227         if((size <= 8)
228                  && !check_permitted_alphabet_5(st)) {
229                 /* Constraint check succeeded */
230                 return 0;
231         } else {
232                 ASN__CTFAIL(app_key, td, sptr,
233                         "%s: constraint failed (%s:%d)",
234                         td->name, __FILE__, __LINE__);
235                 return -1;
236         }
237 }
238
239 static int asn_PER_MAP_senderType_5_v2c(unsigned int value) {
240         if(value >= sizeof(permitted_alphabet_table_5)/sizeof(permitted_alphabet_table_5[0]))
241                 return -1;
242         return permitted_alphabet_table_5[value] - 1;
243 }
244 static int asn_PER_MAP_senderType_5_c2v(unsigned int code) {
245         if(code >= sizeof(permitted_alphabet_code2value_5)/sizeof(permitted_alphabet_code2value_5[0]))
246                 return -1;
247         return permitted_alphabet_code2value_5[code];
248 }
249 static int
250 memb_vendorName_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
251                         asn_app_constraint_failed_f *ctfailcb, void *app_key) {
252         const PrintableString_t *st = (const PrintableString_t *)sptr;
253         size_t size;
254         
255         if(!sptr) {
256                 ASN__CTFAIL(app_key, td, sptr,
257                         "%s: value not given (%s:%d)",
258                         td->name, __FILE__, __LINE__);
259                 return -1;
260         }
261         
262         size = st->size;
263         
264         if((size <= 32)
265                  && !check_permitted_alphabet_6(st)) {
266                 /* Constraint check succeeded */
267                 return 0;
268         } else {
269                 ASN__CTFAIL(app_key, td, sptr,
270                         "%s: constraint failed (%s:%d)",
271                         td->name, __FILE__, __LINE__);
272                 return -1;
273         }
274 }
275
276 static int asn_PER_MAP_vendorName_6_v2c(unsigned int value) {
277         if(value >= sizeof(permitted_alphabet_table_6)/sizeof(permitted_alphabet_table_6[0]))
278                 return -1;
279         return permitted_alphabet_table_6[value] - 1;
280 }
281 static int asn_PER_MAP_vendorName_6_c2v(unsigned int code) {
282         if(code >= sizeof(permitted_alphabet_code2value_6)/sizeof(permitted_alphabet_code2value_6[0]))
283                 return -1;
284         return permitted_alphabet_code2value_6[code];
285 }
286 static asn_per_constraints_t asn_PER_memb_fileFormatversion_constr_3 CC_NOTUSED = {
287         { APC_CONSTRAINED,       7,  7,  32,  122 }     /* (32..122) */,
288         { APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  15 }   /* (SIZE(0..15,...)) */,
289         asn_PER_MAP_fileFormatversion_3_v2c,    /* Value to PER code map */
290         asn_PER_MAP_fileFormatversion_3_c2v     /* PER code to value map */
291 };
292 static asn_per_constraints_t asn_PER_memb_senderName_constr_4 CC_NOTUSED = {
293         { APC_CONSTRAINED,       7,  7,  32,  122 }     /* (32..122) */,
294         { APC_CONSTRAINED | APC_EXTENSIBLE,  9,  9,  0,  400 }  /* (SIZE(0..400,...)) */,
295         asn_PER_MAP_senderName_4_v2c,   /* Value to PER code map */
296         asn_PER_MAP_senderName_4_c2v    /* PER code to value map */
297 };
298 static asn_per_constraints_t asn_PER_memb_senderType_constr_5 CC_NOTUSED = {
299         { APC_CONSTRAINED,       7,  7,  32,  122 }     /* (32..122) */,
300         { APC_CONSTRAINED | APC_EXTENSIBLE,  4,  4,  0,  8 }    /* (SIZE(0..8,...)) */,
301         asn_PER_MAP_senderType_5_v2c,   /* Value to PER code map */
302         asn_PER_MAP_senderType_5_c2v    /* PER code to value map */
303 };
304 static asn_per_constraints_t asn_PER_memb_vendorName_constr_6 CC_NOTUSED = {
305         { APC_CONSTRAINED,       7,  7,  32,  122 }     /* (32..122) */,
306         { APC_CONSTRAINED | APC_EXTENSIBLE,  6,  6,  0,  32 }   /* (SIZE(0..32,...)) */,
307         asn_PER_MAP_vendorName_6_v2c,   /* Value to PER code map */
308         asn_PER_MAP_vendorName_6_c2v    /* PER code to value map */
309 };
310 asn_TYPE_member_t asn_MBR_E2SM_KPM_IndicationHeader_Format1_1[] = {
311         { ATF_NOFLAGS, 0, offsetof(struct E2SM_KPM_IndicationHeader_Format1, colletStartTime),
312                 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
313                 -1,     /* IMPLICIT tag at current level */
314                 &asn_DEF_TimeStamp,
315                 0,
316                 { 0, 0, 0 },
317                 0, 0, /* No default value */
318                 "colletStartTime"
319                 },
320         { ATF_POINTER, 4, offsetof(struct E2SM_KPM_IndicationHeader_Format1, fileFormatversion),
321                 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
322                 -1,     /* IMPLICIT tag at current level */
323                 &asn_DEF_PrintableString,
324                 0,
325                 { 0, &asn_PER_memb_fileFormatversion_constr_3,  memb_fileFormatversion_constraint_1 },
326                 0, 0, /* No default value */
327                 "fileFormatversion"
328                 },
329         { ATF_POINTER, 3, offsetof(struct E2SM_KPM_IndicationHeader_Format1, senderName),
330                 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
331                 -1,     /* IMPLICIT tag at current level */
332                 &asn_DEF_PrintableString,
333                 0,
334                 { 0, &asn_PER_memb_senderName_constr_4,  memb_senderName_constraint_1 },
335                 0, 0, /* No default value */
336                 "senderName"
337                 },
338         { ATF_POINTER, 2, offsetof(struct E2SM_KPM_IndicationHeader_Format1, senderType),
339                 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
340                 -1,     /* IMPLICIT tag at current level */
341                 &asn_DEF_PrintableString,
342                 0,
343                 { 0, &asn_PER_memb_senderType_constr_5,  memb_senderType_constraint_1 },
344                 0, 0, /* No default value */
345                 "senderType"
346                 },
347         { ATF_POINTER, 1, offsetof(struct E2SM_KPM_IndicationHeader_Format1, vendorName),
348                 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
349                 -1,     /* IMPLICIT tag at current level */
350                 &asn_DEF_PrintableString,
351                 0,
352                 { 0, &asn_PER_memb_vendorName_constr_6,  memb_vendorName_constraint_1 },
353                 0, 0, /* No default value */
354                 "vendorName"
355                 },
356 };
357 static const int asn_MAP_E2SM_KPM_IndicationHeader_Format1_oms_1[] = { 1, 2, 3, 4 };
358 static const ber_tlv_tag_t asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1[] = {
359         (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
360 };
361 static const asn_TYPE_tag2member_t asn_MAP_E2SM_KPM_IndicationHeader_Format1_tag2el_1[] = {
362     { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* colletStartTime */
363     { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* fileFormatversion */
364     { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* senderName */
365     { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* senderType */
366     { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* vendorName */
367 };
368 asn_SEQUENCE_specifics_t asn_SPC_E2SM_KPM_IndicationHeader_Format1_specs_1 = {
369         sizeof(struct E2SM_KPM_IndicationHeader_Format1),
370         offsetof(struct E2SM_KPM_IndicationHeader_Format1, _asn_ctx),
371         asn_MAP_E2SM_KPM_IndicationHeader_Format1_tag2el_1,
372         5,      /* Count of tags in the map */
373         asn_MAP_E2SM_KPM_IndicationHeader_Format1_oms_1,        /* Optional members */
374         4, 0,   /* Root/Additions */
375         5,      /* First extension addition */
376 };
377 asn_TYPE_descriptor_t asn_DEF_E2SM_KPM_IndicationHeader_Format1 = {
378         "E2SM-KPM-IndicationHeader-Format1",
379         "E2SM-KPM-IndicationHeader-Format1",
380         &asn_OP_SEQUENCE,
381         asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1,
382         sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1)
383                 /sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1[0]), /* 1 */
384         asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1,       /* Same as above */
385         sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1)
386                 /sizeof(asn_DEF_E2SM_KPM_IndicationHeader_Format1_tags_1[0]), /* 1 */
387         { 0, 0, SEQUENCE_constraint },
388         asn_MBR_E2SM_KPM_IndicationHeader_Format1_1,
389         5,      /* Elements count */
390         &asn_SPC_E2SM_KPM_IndicationHeader_Format1_specs_1      /* Additional specs */
391 };
392