Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Choice] >>> ***/ |
| 3 | |
| 4 | #include <RELATIVE-OID.h> |
| 5 | #include <BIT_STRING.h> |
| 6 | #include <BOOLEAN.h> |
| 7 | #include <NULL.h> |
| 8 | #include <INTEGER.h> |
| 9 | #include <constr_CHOICE.h> |
| 10 | |
| 11 | /*** <<< DEPS [Choice] >>> ***/ |
| 12 | |
| 13 | typedef enum Choice_PR { |
| 14 | Choice_PR_NOTHING, /* No components present */ |
| 15 | Choice_PR_roid, |
| 16 | Choice_PR_bitstr, |
| 17 | Choice_PR_ch, |
| 18 | /* Extensions may appear below */ |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 19 | Choice_PR_bool |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 20 | } Choice_PR; |
| 21 | typedef enum ch_PR { |
| 22 | ch_PR_NOTHING, /* No components present */ |
| 23 | ch_PR_null, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 24 | ch_PR_int |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 25 | } ch_PR; |
| 26 | |
| 27 | /*** <<< TYPE-DECLS [Choice] >>> ***/ |
| 28 | |
| 29 | typedef struct Choice { |
| 30 | Choice_PR present; |
| 31 | union Choice_u { |
| 32 | RELATIVE_OID_t roid; |
| 33 | BIT_STRING_t bitstr; |
| 34 | struct ch { |
| 35 | ch_PR present; |
| 36 | union Choice__ch_u { |
| 37 | NULL_t null; |
| 38 | INTEGER_t Int; |
| 39 | } choice; |
| 40 | |
| 41 | /* Context for parsing across buffer boundaries */ |
| 42 | asn_struct_ctx_t _asn_ctx; |
| 43 | } ch; |
| 44 | /* |
| 45 | * This type is extensible, |
| 46 | * possible extensions are below. |
| 47 | */ |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 48 | BOOLEAN_t Bool; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 49 | } choice; |
| 50 | |
| 51 | /* Context for parsing across buffer boundaries */ |
| 52 | asn_struct_ctx_t _asn_ctx; |
| 53 | } Choice_t; |
| 54 | |
| 55 | /*** <<< FUNC-DECLS [Choice] >>> ***/ |
| 56 | |
| 57 | extern asn_TYPE_descriptor_t asn_DEF_Choice; |
| 58 | |
| 59 | /*** <<< STAT-DEFS [Choice] >>> ***/ |
| 60 | |
| 61 | static asn_TYPE_member_t asn_MBR_ch_4[] = { |
| 62 | { ATF_NOFLAGS, 0, offsetof(struct ch, choice.null), |
| 63 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), |
| 64 | .tag_mode = 0, |
| 65 | .type = &asn_DEF_NULL, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 66 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 67 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 68 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 69 | .name = "null" |
| 70 | }, |
| 71 | { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int), |
| 72 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 73 | .tag_mode = 0, |
| 74 | .type = &asn_DEF_INTEGER, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 75 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 76 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 77 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 78 | .name = "int" |
| 79 | }, |
| 80 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 81 | static const asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 82 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int */ |
| 83 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 84 | }; |
| 85 | static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = { |
| 86 | sizeof(struct ch), |
| 87 | offsetof(struct ch, _asn_ctx), |
| 88 | offsetof(struct ch, present), |
| 89 | sizeof(((struct ch *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 90 | .tag2el = asn_MAP_ch_tag2el_4, |
| 91 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 92 | 0, 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 93 | .ext_start = -1 /* Extensions start */ |
| 94 | }; |
| 95 | static /* Use -fall-defs-global to expose */ |
| 96 | asn_TYPE_descriptor_t asn_DEF_ch_4 = { |
| 97 | "ch", |
| 98 | "ch", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 99 | &asn_OP_CHOICE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 100 | 0, /* No effective tags (pointer) */ |
| 101 | 0, /* No effective tags (count) */ |
| 102 | 0, /* No tags (pointer) */ |
| 103 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 104 | { 0, 0, CHOICE_constraint }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 105 | asn_MBR_ch_4, |
| 106 | 2, /* Elements count */ |
| 107 | &asn_SPC_ch_specs_4 /* Additional specs */ |
| 108 | }; |
| 109 | |
| 110 | static asn_TYPE_member_t asn_MBR_Choice_1[] = { |
| 111 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid), |
| 112 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), |
| 113 | .tag_mode = 0, |
| 114 | .type = &asn_DEF_RELATIVE_OID, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 115 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 116 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 117 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 118 | .name = "roid" |
| 119 | }, |
| 120 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr), |
| 121 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), |
| 122 | .tag_mode = 0, |
| 123 | .type = &asn_DEF_BIT_STRING, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 124 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 125 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 126 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 127 | .name = "bitstr" |
| 128 | }, |
| 129 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch), |
| 130 | .tag = -1 /* Ambiguous tag (CHOICE?) */, |
| 131 | .tag_mode = 0, |
| 132 | .type = &asn_DEF_ch_4, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 133 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 134 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 135 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 136 | .name = "ch" |
| 137 | }, |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 138 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 139 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 140 | .tag_mode = 0, |
| 141 | .type = &asn_DEF_BOOLEAN, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 142 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 143 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 144 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 145 | .name = "bool" |
| 146 | }, |
| 147 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 148 | static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 149 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */ |
| 150 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int */ |
| 151 | { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr */ |
| 152 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null */ |
| 153 | { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 154 | }; |
| 155 | static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { |
| 156 | sizeof(struct Choice), |
| 157 | offsetof(struct Choice, _asn_ctx), |
| 158 | offsetof(struct Choice, present), |
| 159 | sizeof(((struct Choice *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 160 | .tag2el = asn_MAP_Choice_tag2el_1, |
| 161 | .tag2el_count = 5, /* Count of tags in the map */ |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 162 | 0, 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 163 | .ext_start = 3 /* Extensions start */ |
| 164 | }; |
| 165 | asn_TYPE_descriptor_t asn_DEF_Choice = { |
| 166 | "Choice", |
| 167 | "Choice", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 168 | &asn_OP_CHOICE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 169 | 0, /* No effective tags (pointer) */ |
| 170 | 0, /* No effective tags (count) */ |
| 171 | 0, /* No tags (pointer) */ |
| 172 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 173 | { 0, 0, CHOICE_constraint }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 174 | asn_MBR_Choice_1, |
| 175 | 4, /* Elements count */ |
| 176 | &asn_SPC_Choice_specs_1 /* Additional specs */ |
| 177 | }; |
| 178 | |
| 179 | |
| 180 | /*** <<< INCLUDES [Choice2] >>> ***/ |
| 181 | |
| 182 | #include <BIT_STRING.h> |
| 183 | #include <RELATIVE-OID.h> |
| 184 | #include <constr_CHOICE.h> |
| 185 | |
| 186 | /*** <<< DEPS [Choice2] >>> ***/ |
| 187 | |
| 188 | typedef enum Choice2_PR { |
| 189 | Choice2_PR_NOTHING, /* No components present */ |
| 190 | Choice2_PR_bitstr, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 191 | Choice2_PR_roid |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 192 | } Choice2_PR; |
| 193 | |
| 194 | /*** <<< TYPE-DECLS [Choice2] >>> ***/ |
| 195 | |
| 196 | typedef struct Choice2 { |
| 197 | Choice2_PR present; |
| 198 | union Choice2_u { |
| 199 | BIT_STRING_t bitstr; |
| 200 | RELATIVE_OID_t roid; |
| 201 | } choice; |
| 202 | |
| 203 | /* Context for parsing across buffer boundaries */ |
| 204 | asn_struct_ctx_t _asn_ctx; |
| 205 | } Choice2_t; |
| 206 | |
| 207 | /*** <<< FUNC-DECLS [Choice2] >>> ***/ |
| 208 | |
| 209 | extern asn_TYPE_descriptor_t asn_DEF_Choice2; |
| 210 | |
| 211 | /*** <<< STAT-DEFS [Choice2] >>> ***/ |
| 212 | |
| 213 | static asn_TYPE_member_t asn_MBR_Choice2_1[] = { |
| 214 | { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr), |
| 215 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 216 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 217 | .type = &asn_DEF_BIT_STRING, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 218 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 219 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 220 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 221 | .name = "bitstr" |
| 222 | }, |
| 223 | { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid), |
| 224 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 225 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 226 | .type = &asn_DEF_RELATIVE_OID, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 227 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 228 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 229 | 0, 0, /* No default value */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 230 | .name = "roid" |
| 231 | }, |
| 232 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 233 | static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 234 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr */ |
| 235 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 236 | }; |
| 237 | static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { |
| 238 | sizeof(struct Choice2), |
| 239 | offsetof(struct Choice2, _asn_ctx), |
| 240 | offsetof(struct Choice2, present), |
| 241 | sizeof(((struct Choice2 *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 242 | .tag2el = asn_MAP_Choice2_tag2el_1, |
| 243 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 20696a4 | 2017-10-17 21:27:33 -0700 | [diff] [blame] | 244 | 0, 0, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 245 | .ext_start = -1 /* Extensions start */ |
| 246 | }; |
| 247 | asn_TYPE_descriptor_t asn_DEF_Choice2 = { |
| 248 | "Choice2", |
| 249 | "Choice2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 250 | &asn_OP_CHOICE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 251 | 0, /* No effective tags (pointer) */ |
| 252 | 0, /* No effective tags (count) */ |
| 253 | 0, /* No tags (pointer) */ |
| 254 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 255 | { 0, 0, CHOICE_constraint }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 256 | asn_MBR_Choice2_1, |
| 257 | 2, /* Elements count */ |
| 258 | &asn_SPC_Choice2_specs_1 /* Additional specs */ |
| 259 | }; |
| 260 | |