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