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 | */ |
| 48 | BOOLEAN_t bool; |
| 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 | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 61 | static asn_per_constraints_t asn_PER_type_ch_constr_4 = { |
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 | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 66 | static asn_per_constraints_t asn_PER_type_Choice_constr_1 = { |
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, |
| 79 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 80 | .per_constraints = 0, /* No PER visible constraints */ |
| 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, |
| 87 | .type = &asn_DEF_INTEGER, |
| 88 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 89 | .per_constraints = 0, /* No PER visible constraints */ |
| 90 | .default_value = 0, |
| 91 | .name = "int" |
| 92 | }, |
| 93 | }; |
| 94 | static int asn_MAP_ch_cmap_4[] = { 1, 0 }; |
| 95 | static asn_TYPE_tag2member_t asn_MAP_ch_tag2el_4[] = { |
| 96 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* int at 20 */ |
| 97 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 0, 0, 0 } /* null at 18 */ |
| 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), |
| 104 | asn_MAP_ch_tag2el_4, |
| 105 | 2, /* Count of tags in the map */ |
| 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", |
| 113 | CHOICE_free, |
| 114 | CHOICE_print, |
| 115 | CHOICE_constraint, |
| 116 | CHOICE_decode_ber, |
| 117 | CHOICE_encode_der, |
| 118 | CHOICE_decode_xer, |
| 119 | CHOICE_encode_xer, |
| 120 | CHOICE_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 121 | CHOICE_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 122 | CHOICE_outmost_tag, |
| 123 | 0, /* No effective tags (pointer) */ |
| 124 | 0, /* No effective tags (count) */ |
| 125 | 0, /* No tags (pointer) */ |
| 126 | 0, /* No tags (count) */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 127 | &asn_PER_type_ch_constr_4, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 128 | asn_MBR_ch_4, |
| 129 | 2, /* Elements count */ |
| 130 | &asn_SPC_ch_specs_4 /* Additional specs */ |
| 131 | }; |
| 132 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 133 | static asn_TYPE_member_t asn_MBR_Choice_1[] = { |
| 134 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.roid), |
| 135 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), |
| 136 | .tag_mode = 0, |
| 137 | .type = &asn_DEF_RELATIVE_OID, |
| 138 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 139 | .per_constraints = 0, /* No PER visible constraints */ |
| 140 | .default_value = 0, |
| 141 | .name = "roid" |
| 142 | }, |
| 143 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bitstr), |
| 144 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), |
| 145 | .tag_mode = 0, |
| 146 | .type = &asn_DEF_BIT_STRING, |
| 147 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 148 | .per_constraints = 0, /* No PER visible constraints */ |
| 149 | .default_value = 0, |
| 150 | .name = "bitstr" |
| 151 | }, |
| 152 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.ch), |
| 153 | .tag = -1 /* Ambiguous tag (CHOICE?) */, |
| 154 | .tag_mode = 0, |
| 155 | .type = &asn_DEF_ch_4, |
| 156 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | 07aaa34 | 2006-10-09 12:52:15 +0000 | [diff] [blame] | 157 | .per_constraints = 0, /* No PER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 158 | .default_value = 0, |
| 159 | .name = "ch" |
| 160 | }, |
| 161 | { ATF_NOFLAGS, 0, offsetof(struct Choice, choice.bool), |
| 162 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 163 | .tag_mode = 0, |
| 164 | .type = &asn_DEF_BOOLEAN, |
| 165 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 166 | .per_constraints = 0, /* No PER visible constraints */ |
| 167 | .default_value = 0, |
| 168 | .name = "bool" |
| 169 | }, |
| 170 | }; |
| 171 | static int asn_MAP_Choice_cmap_1[] = { 2, 1, 0, 3 }; |
| 172 | static asn_TYPE_tag2member_t asn_MAP_Choice_tag2el_1[] = { |
| 173 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 3, 0, 0 }, /* bool at 22 */ |
| 174 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 2, 0, 0 }, /* int at 20 */ |
| 175 | { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 1, 0, 0 }, /* bitstr at 16 */ |
| 176 | { (ASN_TAG_CLASS_UNIVERSAL | (5 << 2)), 2, 0, 0 }, /* null at 18 */ |
| 177 | { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 } /* roid at 15 */ |
| 178 | }; |
| 179 | static asn_CHOICE_specifics_t asn_SPC_Choice_specs_1 = { |
| 180 | sizeof(struct Choice), |
| 181 | offsetof(struct Choice, _asn_ctx), |
| 182 | offsetof(struct Choice, present), |
| 183 | sizeof(((struct Choice *)0)->present), |
| 184 | asn_MAP_Choice_tag2el_1, |
| 185 | 5, /* Count of tags in the map */ |
| 186 | .canonical_order = asn_MAP_Choice_cmap_1, /* Canonically sorted */ |
| 187 | .ext_start = 3 /* Extensions start */ |
| 188 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 189 | asn_TYPE_descriptor_t asn_DEF_Choice = { |
| 190 | "Choice", |
| 191 | "Choice", |
| 192 | CHOICE_free, |
| 193 | CHOICE_print, |
| 194 | CHOICE_constraint, |
| 195 | CHOICE_decode_ber, |
| 196 | CHOICE_encode_der, |
| 197 | CHOICE_decode_xer, |
| 198 | CHOICE_encode_xer, |
| 199 | CHOICE_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 200 | CHOICE_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 201 | CHOICE_outmost_tag, |
| 202 | 0, /* No effective tags (pointer) */ |
| 203 | 0, /* No effective tags (count) */ |
| 204 | 0, /* No tags (pointer) */ |
| 205 | 0, /* No tags (count) */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 206 | &asn_PER_type_Choice_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 207 | asn_MBR_Choice_1, |
| 208 | 4, /* Elements count */ |
| 209 | &asn_SPC_Choice_specs_1 /* Additional specs */ |
| 210 | }; |
| 211 | |
| 212 | |
| 213 | /*** <<< INCLUDES [Choice2] >>> ***/ |
| 214 | |
| 215 | #include <BIT_STRING.h> |
| 216 | #include <RELATIVE-OID.h> |
| 217 | #include <constr_CHOICE.h> |
| 218 | |
| 219 | /*** <<< DEPS [Choice2] >>> ***/ |
| 220 | |
| 221 | typedef enum Choice2_PR { |
| 222 | Choice2_PR_NOTHING, /* No components present */ |
| 223 | Choice2_PR_bitstr, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 224 | Choice2_PR_roid |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 225 | } Choice2_PR; |
| 226 | |
| 227 | /*** <<< TYPE-DECLS [Choice2] >>> ***/ |
| 228 | |
| 229 | typedef struct Choice2 { |
| 230 | Choice2_PR present; |
| 231 | union Choice2_u { |
| 232 | BIT_STRING_t bitstr; |
| 233 | RELATIVE_OID_t roid; |
| 234 | } choice; |
| 235 | |
| 236 | /* Context for parsing across buffer boundaries */ |
| 237 | asn_struct_ctx_t _asn_ctx; |
| 238 | } Choice2_t; |
| 239 | |
| 240 | /*** <<< FUNC-DECLS [Choice2] >>> ***/ |
| 241 | |
| 242 | extern asn_TYPE_descriptor_t asn_DEF_Choice2; |
| 243 | |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 244 | /*** <<< CTDEFS [Choice2] >>> ***/ |
| 245 | |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 246 | static asn_per_constraints_t asn_PER_type_Choice2_constr_1 = { |
Lev Walkin | 725883b | 2006-10-09 12:07:58 +0000 | [diff] [blame] | 247 | { APC_CONSTRAINED, 1, 1, 0, 1 } /* (0..1) */, |
| 248 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 249 | 0, 0 /* No PER value map */ |
| 250 | }; |
| 251 | |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 252 | /*** <<< STAT-DEFS [Choice2] >>> ***/ |
| 253 | |
| 254 | static asn_TYPE_member_t asn_MBR_Choice2_1[] = { |
| 255 | { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.bitstr), |
| 256 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 257 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 258 | .type = &asn_DEF_BIT_STRING, |
| 259 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 260 | .per_constraints = 0, /* No PER visible constraints */ |
| 261 | .default_value = 0, |
| 262 | .name = "bitstr" |
| 263 | }, |
| 264 | { ATF_NOFLAGS, 0, offsetof(struct Choice2, choice.roid), |
| 265 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 266 | .tag_mode = +1, /* EXPLICIT tag at current level */ |
| 267 | .type = &asn_DEF_RELATIVE_OID, |
| 268 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 269 | .per_constraints = 0, /* No PER visible constraints */ |
| 270 | .default_value = 0, |
| 271 | .name = "roid" |
| 272 | }, |
| 273 | }; |
| 274 | static asn_TYPE_tag2member_t asn_MAP_Choice2_tag2el_1[] = { |
| 275 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* bitstr at 26 */ |
| 276 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* roid at 27 */ |
| 277 | }; |
| 278 | static asn_CHOICE_specifics_t asn_SPC_Choice2_specs_1 = { |
| 279 | sizeof(struct Choice2), |
| 280 | offsetof(struct Choice2, _asn_ctx), |
| 281 | offsetof(struct Choice2, present), |
| 282 | sizeof(((struct Choice2 *)0)->present), |
| 283 | asn_MAP_Choice2_tag2el_1, |
| 284 | 2, /* Count of tags in the map */ |
| 285 | .canonical_order = 0, |
| 286 | .ext_start = -1 /* Extensions start */ |
| 287 | }; |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 288 | asn_TYPE_descriptor_t asn_DEF_Choice2 = { |
| 289 | "Choice2", |
| 290 | "Choice2", |
| 291 | CHOICE_free, |
| 292 | CHOICE_print, |
| 293 | CHOICE_constraint, |
| 294 | CHOICE_decode_ber, |
| 295 | CHOICE_encode_der, |
| 296 | CHOICE_decode_xer, |
| 297 | CHOICE_encode_xer, |
| 298 | CHOICE_decode_uper, |
Lev Walkin | 9f5bb3a | 2006-08-18 01:46:46 +0000 | [diff] [blame] | 299 | CHOICE_encode_uper, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 300 | CHOICE_outmost_tag, |
| 301 | 0, /* No effective tags (pointer) */ |
| 302 | 0, /* No effective tags (count) */ |
| 303 | 0, /* No tags (pointer) */ |
| 304 | 0, /* No tags (count) */ |
Lev Walkin | 4b5dae3 | 2006-10-09 12:27:44 +0000 | [diff] [blame] | 305 | &asn_PER_type_Choice2_constr_1, |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 306 | asn_MBR_Choice2_1, |
| 307 | 2, /* Elements count */ |
| 308 | &asn_SPC_Choice2_specs_1 /* Additional specs */ |
| 309 | }; |
| 310 | |