Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [Forest] >>> ***/ |
| 3 | |
| 4 | #include <Tree.h> |
| 5 | #include <asn_SET_OF.h> |
| 6 | #include <constr_SET_OF.h> |
| 7 | |
| 8 | /*** <<< DEPS [Forest] >>> ***/ |
| 9 | |
| 10 | extern asn1_TYPE_descriptor_t asn1_DEF_Forest; |
| 11 | |
| 12 | /*** <<< TYPE-DECLS [Forest] >>> ***/ |
| 13 | |
| 14 | |
| 15 | typedef struct Forest { |
| 16 | A_SET_OF(struct Tree) list; |
| 17 | |
| 18 | /* Context for parsing across buffer boundaries */ |
| 19 | ber_dec_ctx_t _ber_dec_ctx; |
| 20 | } Forest_t; |
| 21 | |
| 22 | /*** <<< STAT-DEFS [Forest] >>> ***/ |
| 23 | |
| 24 | static asn1_TYPE_member_t asn1_MBR_Forest[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 25 | { ATF_NOFLAGS, 0, 0, |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 26 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 27 | .tag_mode = 0, |
| 28 | .type = (void *)&asn1_DEF_Tree, |
| 29 | .memb_constraints = 0, /* Defer to actual type */ |
| 30 | .name = "" |
| 31 | }, |
| 32 | }; |
| 33 | static ber_tlv_tag_t asn1_DEF_Forest_tags[] = { |
| 34 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 35 | }; |
| 36 | static asn1_SET_OF_specifics_t asn1_DEF_Forest_specs = { |
| 37 | sizeof(struct Forest), |
| 38 | offsetof(struct Forest, _ber_dec_ctx), |
| 39 | }; |
| 40 | asn1_TYPE_descriptor_t asn1_DEF_Forest = { |
| 41 | "Forest", |
| 42 | SET_OF_constraint, |
| 43 | SET_OF_decode_ber, |
| 44 | SET_OF_encode_der, |
| 45 | SET_OF_print, |
| 46 | SET_OF_free, |
| 47 | 0, /* Use generic outmost tag fetcher */ |
| 48 | asn1_DEF_Forest_tags, |
| 49 | sizeof(asn1_DEF_Forest_tags) |
| 50 | /sizeof(asn1_DEF_Forest_tags[0]), /* 1 */ |
| 51 | 1, /* Tags to skip */ |
| 52 | 1, /* Whether CONSTRUCTED */ |
| 53 | asn1_MBR_Forest, |
| 54 | 1, /* Single element */ |
| 55 | &asn1_DEF_Forest_specs /* Additional specs */ |
| 56 | }; |
| 57 | |
| 58 | |
| 59 | /*** <<< INCLUDES [Tree] >>> ***/ |
| 60 | |
| 61 | #include <INTEGER.h> |
| 62 | #include <constr_SEQUENCE.h> |
| 63 | |
| 64 | /*** <<< DEPS [Tree] >>> ***/ |
| 65 | |
| 66 | extern asn1_TYPE_descriptor_t asn1_DEF_Tree; |
| 67 | |
| 68 | /*** <<< TYPE-DECLS [Tree] >>> ***/ |
| 69 | |
| 70 | |
| 71 | typedef struct Tree { |
| 72 | INTEGER_t height; |
| 73 | INTEGER_t width; |
| 74 | |
| 75 | /* Context for parsing across buffer boundaries */ |
| 76 | ber_dec_ctx_t _ber_dec_ctx; |
| 77 | } Tree_t; |
| 78 | |
| 79 | /*** <<< STAT-DEFS [Tree] >>> ***/ |
| 80 | |
| 81 | static asn1_TYPE_member_t asn1_MBR_Tree[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 82 | { ATF_NOFLAGS, 0, offsetof(struct Tree, height), |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 83 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 84 | .tag_mode = 0, |
| 85 | .type = (void *)&asn1_DEF_INTEGER, |
| 86 | .memb_constraints = 0, /* Defer to actual type */ |
| 87 | .name = "height" |
| 88 | }, |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 89 | { ATF_NOFLAGS, 0, offsetof(struct Tree, width), |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 90 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 91 | .tag_mode = 0, |
| 92 | .type = (void *)&asn1_DEF_INTEGER, |
| 93 | .memb_constraints = 0, /* Defer to actual type */ |
| 94 | .name = "width" |
| 95 | }, |
| 96 | }; |
| 97 | static ber_tlv_tag_t asn1_DEF_Tree_tags[] = { |
| 98 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 99 | }; |
| 100 | static asn1_TYPE_tag2member_t asn1_DEF_Tree_tag2el[] = { |
| 101 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* height at 17 */ |
| 102 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 }, /* width at 19 */ |
| 103 | }; |
| 104 | static asn1_SEQUENCE_specifics_t asn1_DEF_Tree_specs = { |
| 105 | sizeof(struct Tree), |
| 106 | offsetof(struct Tree, _ber_dec_ctx), |
| 107 | asn1_DEF_Tree_tag2el, |
| 108 | 2, /* Count of tags in the map */ |
| 109 | -1, /* Start extensions */ |
| 110 | -1 /* Stop extensions */ |
| 111 | }; |
| 112 | asn1_TYPE_descriptor_t asn1_DEF_Tree = { |
| 113 | "Tree", |
| 114 | SEQUENCE_constraint, |
| 115 | SEQUENCE_decode_ber, |
| 116 | SEQUENCE_encode_der, |
| 117 | SEQUENCE_print, |
| 118 | SEQUENCE_free, |
| 119 | 0, /* Use generic outmost tag fetcher */ |
| 120 | asn1_DEF_Tree_tags, |
| 121 | sizeof(asn1_DEF_Tree_tags) |
| 122 | /sizeof(asn1_DEF_Tree_tags[0]), /* 1 */ |
| 123 | 1, /* Tags to skip */ |
| 124 | 1, /* Whether CONSTRUCTED */ |
| 125 | asn1_MBR_Tree, |
| 126 | 2, /* Elements count */ |
| 127 | &asn1_DEF_Tree_specs /* Additional specs */ |
| 128 | }; |
| 129 | |
| 130 | |
| 131 | /*** <<< INCLUDES [Stuff] >>> ***/ |
| 132 | |
| 133 | #include <Forest.h> |
| 134 | #include <asn_SET_OF.h> |
| 135 | #include <constr_SET_OF.h> |
| 136 | #include <BIT_STRING.h> |
| 137 | #include <constr_SEQUENCE.h> |
| 138 | #include <constr_SET.h> |
| 139 | |
| 140 | /*** <<< DEPS [Stuff] >>> ***/ |
| 141 | |
| 142 | |
| 143 | /* |
| 144 | * Method of determining the components presence |
| 145 | */ |
| 146 | typedef enum Stuff_PR { |
| 147 | Stuff_PR_trees, /* Member trees is present */ |
| 148 | Stuff_PR_anything, /* Member anything is present */ |
| 149 | } Stuff_PR; |
| 150 | extern asn1_TYPE_descriptor_t asn1_DEF_Stuff; |
| 151 | |
| 152 | /*** <<< TYPE-DECLS [Stuff] >>> ***/ |
| 153 | |
| 154 | |
| 155 | typedef struct Stuff { |
| 156 | struct trees { |
| 157 | A_SET_OF(struct Forest) list; |
| 158 | |
| 159 | /* Context for parsing across buffer boundaries */ |
| 160 | ber_dec_ctx_t _ber_dec_ctx; |
| 161 | } *trees; |
| 162 | struct anything { |
| 163 | A_SET_OF(struct anything_member { |
| 164 | BIT_STRING_t cup_of_coffee; |
| 165 | /* |
| 166 | * This type is extensible, |
| 167 | * possible extensions are below. |
| 168 | */ |
| 169 | |
| 170 | /* Context for parsing across buffer boundaries */ |
| 171 | ber_dec_ctx_t _ber_dec_ctx; |
| 172 | } ) list; |
| 173 | |
| 174 | /* Context for parsing across buffer boundaries */ |
| 175 | ber_dec_ctx_t _ber_dec_ctx; |
| 176 | } *anything; |
| 177 | |
| 178 | /* Presence bitmask: ASN_SET_ISPRESENT(pStuff, Stuff_PR_x) */ |
| 179 | unsigned int _presence_map |
| 180 | [((2+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 181 | |
| 182 | /* Context for parsing across buffer boundaries */ |
| 183 | ber_dec_ctx_t _ber_dec_ctx; |
| 184 | } Stuff_t; |
| 185 | |
| 186 | /*** <<< STAT-DEFS [Stuff] >>> ***/ |
| 187 | |
| 188 | static asn1_TYPE_member_t asn1_MBR_trees[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 189 | { ATF_NOFLAGS, 0, 0, |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 190 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 191 | .tag_mode = 0, |
| 192 | .type = (void *)&asn1_DEF_Forest, |
| 193 | .memb_constraints = 0, /* Defer to actual type */ |
| 194 | .name = "" |
| 195 | }, |
| 196 | }; |
| 197 | static ber_tlv_tag_t asn1_DEF_trees_tags[] = { |
| 198 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)) |
| 199 | }; |
| 200 | static asn1_SET_OF_specifics_t asn1_DEF_trees_specs = { |
| 201 | sizeof(struct trees), |
| 202 | offsetof(struct trees, _ber_dec_ctx), |
| 203 | }; |
Lev Walkin | d04430c | 2004-09-07 06:44:29 +0000 | [diff] [blame] | 204 | static /* Use -fall-defs-global to expose */ |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 205 | asn1_TYPE_descriptor_t asn1_DEF_trees = { |
| 206 | "trees", |
| 207 | SET_OF_constraint, |
| 208 | SET_OF_decode_ber, |
| 209 | SET_OF_encode_der, |
| 210 | SET_OF_print, |
| 211 | SET_OF_free, |
| 212 | 0, /* Use generic outmost tag fetcher */ |
| 213 | asn1_DEF_trees_tags, |
| 214 | sizeof(asn1_DEF_trees_tags) |
| 215 | /sizeof(asn1_DEF_trees_tags[0]), /* 1 */ |
| 216 | 1, /* Tags to skip */ |
| 217 | 1, /* Whether CONSTRUCTED */ |
| 218 | asn1_MBR_trees, |
| 219 | 1, /* Single element */ |
| 220 | &asn1_DEF_trees_specs /* Additional specs */ |
| 221 | }; |
| 222 | |
| 223 | static asn1_TYPE_member_t asn1_MBR_anything_member[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 224 | { ATF_NOFLAGS, 0, offsetof(struct anything_member, cup_of_coffee), |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 225 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), |
| 226 | .tag_mode = 0, |
| 227 | .type = (void *)&asn1_DEF_BIT_STRING, |
| 228 | .memb_constraints = 0, /* Defer to actual type */ |
| 229 | .name = "cup-of-coffee" |
| 230 | }, |
| 231 | }; |
| 232 | static ber_tlv_tag_t asn1_DEF_anything_member_tags[] = { |
| 233 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 234 | }; |
| 235 | static asn1_TYPE_tag2member_t asn1_DEF_anything_member_tag2el[] = { |
| 236 | { (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 }, /* cup-of-coffee at 26 */ |
| 237 | }; |
| 238 | static asn1_SEQUENCE_specifics_t asn1_DEF_anything_member_specs = { |
| 239 | sizeof(struct anything_member), |
| 240 | offsetof(struct anything_member, _ber_dec_ctx), |
| 241 | asn1_DEF_anything_member_tag2el, |
| 242 | 1, /* Count of tags in the map */ |
| 243 | 0, /* Start extensions */ |
| 244 | 2 /* Stop extensions */ |
| 245 | }; |
Lev Walkin | d04430c | 2004-09-07 06:44:29 +0000 | [diff] [blame] | 246 | static /* Use -fall-defs-global to expose */ |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 247 | asn1_TYPE_descriptor_t asn1_DEF_anything_member = { |
| 248 | "", |
| 249 | SEQUENCE_constraint, |
| 250 | SEQUENCE_decode_ber, |
| 251 | SEQUENCE_encode_der, |
| 252 | SEQUENCE_print, |
| 253 | SEQUENCE_free, |
| 254 | 0, /* Use generic outmost tag fetcher */ |
| 255 | asn1_DEF_anything_member_tags, |
| 256 | sizeof(asn1_DEF_anything_member_tags) |
| 257 | /sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */ |
| 258 | 1, /* Tags to skip */ |
| 259 | 1, /* Whether CONSTRUCTED */ |
| 260 | asn1_MBR_anything_member, |
| 261 | 1, /* Elements count */ |
| 262 | &asn1_DEF_anything_member_specs /* Additional specs */ |
| 263 | }; |
| 264 | |
| 265 | static asn1_TYPE_member_t asn1_MBR_anything[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 266 | { ATF_NOFLAGS, 0, 0, |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 267 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 268 | .tag_mode = 0, |
| 269 | .type = (void *)&asn1_DEF_anything_member, |
| 270 | .memb_constraints = 0, /* Defer to actual type */ |
| 271 | .name = "" |
| 272 | }, |
| 273 | }; |
| 274 | static ber_tlv_tag_t asn1_DEF_anything_tags[] = { |
| 275 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)) |
| 276 | }; |
| 277 | static asn1_SET_OF_specifics_t asn1_DEF_anything_specs = { |
| 278 | sizeof(struct anything), |
| 279 | offsetof(struct anything, _ber_dec_ctx), |
| 280 | }; |
Lev Walkin | d04430c | 2004-09-07 06:44:29 +0000 | [diff] [blame] | 281 | static /* Use -fall-defs-global to expose */ |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 282 | asn1_TYPE_descriptor_t asn1_DEF_anything = { |
| 283 | "anything", |
| 284 | SET_OF_constraint, |
| 285 | SET_OF_decode_ber, |
| 286 | SET_OF_encode_der, |
| 287 | SET_OF_print, |
| 288 | SET_OF_free, |
| 289 | 0, /* Use generic outmost tag fetcher */ |
| 290 | asn1_DEF_anything_tags, |
| 291 | sizeof(asn1_DEF_anything_tags) |
| 292 | /sizeof(asn1_DEF_anything_tags[0]), /* 1 */ |
| 293 | 1, /* Tags to skip */ |
| 294 | 1, /* Whether CONSTRUCTED */ |
| 295 | asn1_MBR_anything, |
| 296 | 1, /* Single element */ |
| 297 | &asn1_DEF_anything_specs /* Additional specs */ |
| 298 | }; |
| 299 | |
| 300 | static asn1_TYPE_member_t asn1_MBR_Stuff[] = { |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 301 | { ATF_POINTER, 2, offsetof(struct Stuff, trees), |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 302 | .tag = (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 303 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 304 | .type = (void *)&asn1_DEF_trees, |
| 305 | .memb_constraints = 0, /* Defer to actual type */ |
| 306 | .name = "trees" |
| 307 | }, |
Lev Walkin | cc93b0f | 2004-09-10 09:18:20 +0000 | [diff] [blame] | 308 | { ATF_POINTER, 1, offsetof(struct Stuff, anything), |
Lev Walkin | 03ba3e9 | 2004-08-22 03:18:17 +0000 | [diff] [blame] | 309 | .tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 310 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 311 | .type = (void *)&asn1_DEF_anything, |
| 312 | .memb_constraints = 0, /* Defer to actual type */ |
| 313 | .name = "anything" |
| 314 | }, |
| 315 | }; |
| 316 | static ber_tlv_tag_t asn1_DEF_Stuff_tags[] = { |
| 317 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 318 | }; |
| 319 | static asn1_TYPE_tag2member_t asn1_DEF_Stuff_tag2el[] = { |
| 320 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* trees at 23 */ |
| 321 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* anything at 28 */ |
| 322 | }; |
| 323 | static uint8_t asn1_DEF_Stuff_mmap[(2 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
| 324 | (0 << 7) | (0 << 6) |
| 325 | }; |
| 326 | static asn1_SET_specifics_t asn1_DEF_Stuff_specs = { |
| 327 | sizeof(struct Stuff), |
| 328 | offsetof(struct Stuff, _ber_dec_ctx), |
| 329 | offsetof(struct Stuff, _presence_map), |
| 330 | asn1_DEF_Stuff_tag2el, |
| 331 | 2, /* Count of tags in the map */ |
| 332 | 0, /* Whether extensible */ |
| 333 | (unsigned int *)asn1_DEF_Stuff_mmap /* Mandatory elements map */ |
| 334 | }; |
| 335 | asn1_TYPE_descriptor_t asn1_DEF_Stuff = { |
| 336 | "Stuff", |
| 337 | SET_constraint, |
| 338 | SET_decode_ber, |
| 339 | SET_encode_der, |
| 340 | SET_print, |
| 341 | SET_free, |
| 342 | 0, /* Use generic outmost tag fetcher */ |
| 343 | asn1_DEF_Stuff_tags, |
| 344 | sizeof(asn1_DEF_Stuff_tags) |
| 345 | /sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */ |
| 346 | 1, /* Tags to skip */ |
| 347 | 1, /* Whether CONSTRUCTED */ |
| 348 | asn1_MBR_Stuff, |
| 349 | 2, /* Elements count */ |
| 350 | &asn1_DEF_Stuff_specs /* Additional specs */ |
| 351 | }; |
| 352 | |