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> |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 8 | #include <NativeInteger.h> |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 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; |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 38 | long Int; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 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 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 59 | /*** <<< CTDEFS [Choice] >>> ***/ |
| 60 | |
Lev Walkin | 0479e04 | 2017-09-26 18:39:58 -0700 | [diff] [blame] | 61 | static asn_per_constraints_t asn_PER_type_ch_constr_4 CC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 62 | { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, |
| 63 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 64 | 0, 0 /* No PER value map */ |
| 65 | }; |
Lev Walkin | 0479e04 | 2017-09-26 18:39:58 -0700 | [diff] [blame] | 66 | static asn_per_constraints_t asn_PER_type_Choice_constr_1 CC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 67 | { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 2 } /* (0..2,...) */, |
| 68 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 69 | 0, 0 /* No PER value map */ |
| 70 | }; |
| 71 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 72 | /*** <<< STAT-DEFS [Choice] >>> ***/ |
| 73 | |
| 74 | static asn_TYPE_member_t asn_MBR_ch_4[] = { |
| 75 | { ATF_NOFLAGS, 0, offsetof(struct ch, choice.null), |
| 76 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), |
| 77 | .tag_mode = 0, |
| 78 | .type = &asn_DEF_NULL, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 79 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 80 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 81 | .default_value = 0, |
| 82 | .name = "null" |
| 83 | }, |
| 84 | { ATF_NOFLAGS, 0, offsetof(struct ch, choice.Int), |
| 85 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 86 | .tag_mode = 0, |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 87 | .type = &asn_DEF_NativeInteger, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 88 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 89 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 90 | .default_value = 0, |
| 91 | .name = "int" |
| 92 | }, |
| 93 | }; |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 94 | static const unsigned asn_MAP_ch_cmap_4[] = { 1, 0 }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 95 | static const asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 96 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int */ |
| 97 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 98 | }; |
| 99 | static asn_CHOICE_specifics_t asn_SPC_ch_specs_4 = { |
| 100 | sizeof(struct ch), |
| 101 | offsetof(struct ch, _asn_ctx), |
| 102 | offsetof(struct ch, present), |
| 103 | sizeof(((struct ch *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 104 | .tag2el = asn_MAP_ch_tag2el_4, |
| 105 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 106 | .canonical_order = asn_MAP_ch_cmap_4, /* Canonically sorted */ |
| 107 | .ext_start = -1 /* Extensions start */ |
| 108 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 109 | static /* Use -fall-defs-global to expose */ |
| 110 | asn_TYPE_descriptor_t asn_DEF_ch_4 = { |
| 111 | "ch", |
| 112 | "ch", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 113 | &asn_OP_CHOICE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 114 | 0, /* No effective tags (pointer) */ |
| 115 | 0, /* No effective tags (count) */ |
| 116 | 0, /* No tags (pointer) */ |
| 117 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 118 | { 0, &asn_PER_type_ch_constr_4, CHOICE_constraint }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 119 | asn_MBR_ch_4, |
| 120 | 2, /* Elements count */ |
| 121 | &asn_SPC_ch_specs_4 /* Additional specs */ |
| 122 | }; |
| 123 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 124 | static asn_TYPE_member_t asn_MBR_Choice_1[] = { |
| 125 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid), |
| 126 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), |
| 127 | .tag_mode = 0, |
| 128 | .type = &asn_DEF_RELATIVE_OID, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 129 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 130 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 131 | .default_value = 0, |
| 132 | .name = "roid" |
| 133 | }, |
| 134 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr), |
| 135 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), |
| 136 | .tag_mode = 0, |
| 137 | .type = &asn_DEF_BIT_STRING, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 138 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 139 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 140 | .default_value = 0, |
| 141 | .name = "bitstr" |
| 142 | }, |
| 143 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch), |
| 144 | .tag = -1 /* Ambiguous tag (CHOICE?) */, |
| 145 | .tag_mode = 0, |
| 146 | .type = &asn_DEF_ch_4, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 147 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 148 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 149 | .default_value = 0, |
| 150 | .name = "ch" |
| 151 | }, |
Lev Walkin | 2a744a7 | 2013-03-27 01:56:23 -0700 | [diff] [blame] | 152 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.Bool), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 153 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 154 | .tag_mode = 0, |
| 155 | .type = &asn_DEF_BOOLEAN, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 156 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 157 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 158 | .default_value = 0, |
| 159 | .name = "bool" |
| 160 | }, |
| 161 | }; |
Lev Walkin | 18660d2 | 2017-08-12 20:45:23 -0700 | [diff] [blame] | 162 | static const unsigned asn_MAP_Choice_cmap_1[] = { 2, 1, 0, 3 }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 163 | static const asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 164 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool */ |
| 165 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int */ |
| 166 | { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr */ |
| 167 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null */ |
| 168 | { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 169 | }; |
| 170 | static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { |
| 171 | sizeof(struct Choice), |
| 172 | offsetof(struct Choice, _asn_ctx), |
| 173 | offsetof(struct Choice, present), |
| 174 | sizeof(((struct Choice *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 175 | .tag2el = asn_MAP_Choice_tag2el_1, |
| 176 | .tag2el_count = 5, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 177 | .canonical_order = asn_MAP_Choice_cmap_1, /* Canonically sorted */ |
| 178 | .ext_start = 3 /* Extensions start */ |
| 179 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 180 | asn_TYPE_descriptor_t asn_DEF_Choice = { |
| 181 | "Choice", |
| 182 | "Choice", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 183 | &asn_OP_CHOICE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 184 | 0, /* No effective tags (pointer) */ |
| 185 | 0, /* No effective tags (count) */ |
| 186 | 0, /* No tags (pointer) */ |
| 187 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 188 | { 0, &asn_PER_type_Choice_constr_1, CHOICE_constraint }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 189 | asn_MBR_Choice_1, |
| 190 | 4, /* Elements count */ |
| 191 | &asn_SPC_Choice_specs_1 /* Additional specs */ |
| 192 | }; |
| 193 | |
| 194 | |
| 195 | /*** <<< INCLUDES [Choice2] >>> ***/ |
| 196 | |
| 197 | #include <BIT_STRING.h> |
| 198 | #include <RELATIVE-OID.h> |
| 199 | #include <constr_CHOICE.h> |
| 200 | |
| 201 | /*** <<< DEPS [Choice2] >>> ***/ |
| 202 | |
| 203 | typedef enum Choice2_PR { |
| 204 | Choice2_PR_NOTHING, /* No components present */ |
| 205 | Choice2_PR_bitstr, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 206 | Choice2_PR_roid |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 207 | } Choice2_PR; |
| 208 | |
| 209 | /*** <<< TYPE-DECLS [Choice2] >>> ***/ |
| 210 | |
| 211 | typedef struct Choice2 { |
| 212 | Choice2_PR present; |
| 213 | union Choice2_u { |
| 214 | BIT_STRING_t bitstr; |
| 215 | RELATIVE_OID_t roid; |
| 216 | } choice; |
| 217 | |
| 218 | /* Context for parsing across buffer boundaries */ |
| 219 | asn_struct_ctx_t _asn_ctx; |
| 220 | } Choice2_t; |
| 221 | |
| 222 | /*** <<< FUNC-DECLS [Choice2] >>> ***/ |
| 223 | |
| 224 | extern asn_TYPE_descriptor_t asn_DEF_Choice2; |
| 225 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 226 | /*** <<< CTDEFS [Choice2] >>> ***/ |
| 227 | |
Lev Walkin | 0479e04 | 2017-09-26 18:39:58 -0700 | [diff] [blame] | 228 | static asn_per_constraints_t asn_PER_type_Choice2_constr_1 CC_NOTUSED = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 229 | { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, |
| 230 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 231 | 0, 0 /* No PER value map */ |
| 232 | }; |
| 233 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 234 | /*** <<< STAT-DEFS [Choice2] >>> ***/ |
| 235 | |
| 236 | static asn_TYPE_member_t asn_MBR_Choice2_1[] = { |
| 237 | { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr), |
| 238 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 239 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 240 | .type = &asn_DEF_BIT_STRING, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 241 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 242 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 243 | .default_value = 0, |
| 244 | .name = "bitstr" |
| 245 | }, |
| 246 | { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid), |
| 247 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 248 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 249 | .type = &asn_DEF_RELATIVE_OID, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 250 | .type_selector = 0, |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 251 | { .oer_constraints = 0, .per_constraints = 0, .general_constraints = 0 }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 252 | .default_value = 0, |
| 253 | .name = "roid" |
| 254 | }, |
| 255 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 256 | static const asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 257 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr */ |
| 258 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 259 | }; |
| 260 | static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { |
| 261 | sizeof(struct Choice2), |
| 262 | offsetof(struct Choice2, _asn_ctx), |
| 263 | offsetof(struct Choice2, present), |
| 264 | sizeof(((struct Choice2 *)0)->present), |
Lev Walkin | e391708 | 2017-08-23 10:29:38 -0700 | [diff] [blame] | 265 | .tag2el = asn_MAP_Choice2_tag2el_1, |
| 266 | .tag2el_count = 2, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 267 | .canonical_order = 0, |
| 268 | .ext_start = -1 /* Extensions start */ |
| 269 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 270 | asn_TYPE_descriptor_t asn_DEF_Choice2 = { |
| 271 | "Choice2", |
| 272 | "Choice2", |
Bi-Ruei, Chiu | 1f87ac0 | 2017-08-20 01:25:45 +0800 | [diff] [blame] | 273 | &asn_OP_CHOICE, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 274 | 0, /* No effective tags (pointer) */ |
| 275 | 0, /* No effective tags (count) */ |
| 276 | 0, /* No tags (pointer) */ |
| 277 | 0, /* No tags (count) */ |
Lev Walkin | 0bfea56 | 2017-09-29 23:16:48 -0700 | [diff] [blame] | 278 | { 0, &asn_PER_type_Choice2_constr_1, CHOICE_constraint }, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 279 | asn_MBR_Choice2_1, |
| 280 | 2, /* Elements count */ |
| 281 | &asn_SPC_Choice2_specs_1 /* Additional specs */ |
| 282 | }; |
| 283 | |