blob: 7faf96405f25317bffe35f98237eab4d63846eef [file] [log] [blame]
Lev Walkin64d99e92005-01-30 18:34:07 +00001
2/*** <<< INCLUDES [T] >>> ***/
3
4#include <INTEGER.h>
5#include <OCTET_STRING.h>
6#include <REAL.h>
7#include <constr_SET.h>
8#include <constr_SEQUENCE.h>
9
10/*** <<< DEPS [T] >>> ***/
11
12
13/*
14 * Method of determining the components presence
15 */
16typedef enum class_PR {
17} class_PR;
Lev Walkin64d99e92005-01-30 18:34:07 +000018
19/*** <<< TYPE-DECLS [T] >>> ***/
20
Lev Walkin64d99e92005-01-30 18:34:07 +000021typedef struct T {
22 INTEGER_t Int;
23 OCTET_STRING_t Char;
24 struct Class {
25 /*
26 * This type is extensible,
27 * possible extensions are below.
28 */
29
30 /* Presence bitmask: ASN_SET_ISPRESENT(pclass, class_PR_x) */
31 unsigned int _presence_map
32 [((0+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
33
34 /* Context for parsing across buffer boundaries */
35 asn_struct_ctx_t _asn_ctx;
36 } Class;
37 REAL_t Double;
38
39 /* Context for parsing across buffer boundaries */
40 asn_struct_ctx_t _asn_ctx;
41} T_t;
42
Lev Walkinc8285712005-03-04 22:18:20 +000043/*** <<< FUNC-DECLS [T] >>> ***/
44
45extern asn_TYPE_descriptor_t asn_DEF_T;
46
Lev Walkin64d99e92005-01-30 18:34:07 +000047/*** <<< CODE [T] >>> ***/
48
49static int
Lev Walkin59b176e2005-11-26 11:25:14 +000050memb_char_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
Lev Walkin1eded352006-07-13 11:19:01 +000051 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin8a7af0e2005-02-15 03:40:07 +000052 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
Lev Walkin64d99e92005-01-30 18:34:07 +000053 size_t size;
54
55 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070056 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin64d99e92005-01-30 18:34:07 +000057 "%s: value not given (%s:%d)",
58 td->name, __FILE__, __LINE__);
59 return -1;
60 }
61
62 size = st->size;
63
64 if((size == 1)) {
65 /* Constraint check succeeded */
66 return 0;
67 } else {
Lev Walkin7c1dc052016-03-14 03:08:15 -070068 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin64d99e92005-01-30 18:34:07 +000069 "%s: constraint failed (%s:%d)",
70 td->name, __FILE__, __LINE__);
71 return -1;
72 }
73}
74
75
76/*** <<< STAT-DEFS [T] >>> ***/
77
Lev Walkina7591b52014-10-12 18:37:35 -070078static const ber_tlv_tag_t asn_DEF_class_tags_4[] = {
Lev Walkin64d99e92005-01-30 18:34:07 +000079 (ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
80};
Lev Walkina7591b52014-10-12 18:37:35 -070081static const uint8_t asn_MAP_class_mmap_4[(0 + (8 * sizeof(unsigned int)) - 1) / 8] = {
Lev Walkin64d99e92005-01-30 18:34:07 +000082 0
83};
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080084static
85asn_SET_specifics_t asn_SPC_class_specs_4 = {
Lev Walkin64d99e92005-01-30 18:34:07 +000086 sizeof(struct Class),
87 offsetof(struct Class, _asn_ctx),
88 offsetof(struct Class, _presence_map),
Lev Walkine3917082017-08-23 10:29:38 -070089 0, /* No top level tags */
90 0, /* No tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +000091 asn_MAP_class_tag2el_4, /* Same as above */
Lev Walkinf82138b2005-02-25 08:20:32 +000092 0, /* Count of tags in the CXER map */
Lev Walkin64d99e92005-01-30 18:34:07 +000093 1, /* Whether extensible */
Lev Walkin46ef3f32017-07-06 08:47:53 -070094 (const unsigned int *)asn_MAP_class_mmap_4 /* Mandatory elements map */
Lev Walkin64d99e92005-01-30 18:34:07 +000095};
96static /* Use -fall-defs-global to expose */
Lev Walkine8318b82005-03-06 09:29:03 +000097asn_TYPE_descriptor_t asn_DEF_class_4 = {
Lev Walkin64d99e92005-01-30 18:34:07 +000098 "class",
99 "class",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800100 &asn_OP_SET,
Lev Walkin64d99e92005-01-30 18:34:07 +0000101 SET_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000102 asn_DEF_class_tags_4,
103 sizeof(asn_DEF_class_tags_4)
104 /sizeof(asn_DEF_class_tags_4[0]), /* 1 */
105 asn_DEF_class_tags_4, /* Same as above */
106 sizeof(asn_DEF_class_tags_4)
107 /sizeof(asn_DEF_class_tags_4[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400108 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000109 0, /* No PER visible constraints */
Lev Walkin64d99e92005-01-30 18:34:07 +0000110 0, 0, /* No members */
Lev Walkin59b176e2005-11-26 11:25:14 +0000111 &asn_SPC_class_specs_4 /* Additional specs */
Lev Walkin64d99e92005-01-30 18:34:07 +0000112};
113
Lev Walkine0272aa2005-03-04 11:26:08 +0000114static asn_TYPE_member_t asn_MBR_T_1[] = {
Lev Walkin64d99e92005-01-30 18:34:07 +0000115 { ATF_NOFLAGS, 0, offsetof(struct T, Int),
116 .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
117 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000118 .type = &asn_DEF_INTEGER,
Lev Walkin67a30122017-08-10 05:48:54 -0700119 .type_selector = 0,
Lev Walkin64d99e92005-01-30 18:34:07 +0000120 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400121 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000122 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
123 .default_value = 0,
Lev Walkin64d99e92005-01-30 18:34:07 +0000124 .name = "int"
125 },
126 { ATF_NOFLAGS, 0, offsetof(struct T, Char),
127 .tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)),
128 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000129 .type = &asn_DEF_OCTET_STRING,
Lev Walkin67a30122017-08-10 05:48:54 -0700130 .type_selector = 0,
Lev Walkin59b176e2005-11-26 11:25:14 +0000131 .memb_constraints = memb_char_constraint_1,
Lev Walkinb33425f2017-07-14 14:59:52 +0400132 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000133 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
134 .default_value = 0,
Lev Walkin64d99e92005-01-30 18:34:07 +0000135 .name = "char"
136 },
137 { ATF_NOFLAGS, 0, offsetof(struct T, Class),
138 .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),
139 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000140 .type = &asn_DEF_class_4,
Lev Walkin67a30122017-08-10 05:48:54 -0700141 .type_selector = 0,
Lev Walkin64d99e92005-01-30 18:34:07 +0000142 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400143 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000144 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
145 .default_value = 0,
Lev Walkin64d99e92005-01-30 18:34:07 +0000146 .name = "class"
147 },
148 { ATF_NOFLAGS, 0, offsetof(struct T, Double),
149 .tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)),
150 .tag_mode = 0,
Lev Walkinae7bf3f2005-08-29 10:31:14 +0000151 .type = &asn_DEF_REAL,
Lev Walkin67a30122017-08-10 05:48:54 -0700152 .type_selector = 0,
Lev Walkin64d99e92005-01-30 18:34:07 +0000153 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +0400154 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin59b176e2005-11-26 11:25:14 +0000155 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
156 .default_value = 0,
Lev Walkin64d99e92005-01-30 18:34:07 +0000157 .name = "double"
158 },
159};
Lev Walkina7591b52014-10-12 18:37:35 -0700160static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
Lev Walkin64d99e92005-01-30 18:34:07 +0000161 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
162};
Lev Walkina7591b52014-10-12 18:37:35 -0700163static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -0700164 { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int */
165 { (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* char */
166 { (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 3, 0, 0 }, /* double */
167 { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* class */
Lev Walkin64d99e92005-01-30 18:34:07 +0000168};
Lev Walkin59b176e2005-11-26 11:25:14 +0000169static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = {
Lev Walkin64d99e92005-01-30 18:34:07 +0000170 sizeof(struct T),
171 offsetof(struct T, _asn_ctx),
Lev Walkine3917082017-08-23 10:29:38 -0700172 .tag2el = asn_MAP_T_tag2el_1,
173 .tag2el_count = 4, /* Count of tags in the map */
Lev Walkin59b176e2005-11-26 11:25:14 +0000174 0, 0, 0, /* Optional elements (not needed) */
Lev Walkin64d99e92005-01-30 18:34:07 +0000175 -1, /* Start extensions */
176 -1 /* Stop extensions */
177};
178asn_TYPE_descriptor_t asn_DEF_T = {
179 "T",
180 "T",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +0800181 &asn_OP_SEQUENCE,
Lev Walkin64d99e92005-01-30 18:34:07 +0000182 SEQUENCE_constraint,
Lev Walkin59b176e2005-11-26 11:25:14 +0000183 asn_DEF_T_tags_1,
184 sizeof(asn_DEF_T_tags_1)
185 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
186 asn_DEF_T_tags_1, /* Same as above */
187 sizeof(asn_DEF_T_tags_1)
188 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400189 0, /* No OER visible constraints */
Lev Walkin59b176e2005-11-26 11:25:14 +0000190 0, /* No PER visible constraints */
Lev Walkine0272aa2005-03-04 11:26:08 +0000191 asn_MBR_T_1,
Lev Walkin64d99e92005-01-30 18:34:07 +0000192 4, /* Elements count */
Lev Walkin59b176e2005-11-26 11:25:14 +0000193 &asn_SPC_T_specs_1 /* Additional specs */
Lev Walkin64d99e92005-01-30 18:34:07 +0000194};
195