vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | |
vlm | eb2157b | 2004-08-11 05:22:22 +0000 | [diff] [blame] | 2 | /*** <<< INCLUDES [T] >>> ***/ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 4 | #include <INTEGER.h> |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 5 | #include <T2.h> |
| 6 | #include <asn_SEQUENCE_OF.h> |
vlm | eb2157b | 2004-08-11 05:22:22 +0000 | [diff] [blame] | 7 | #include <constr_SEQUENCE_OF.h> |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 8 | #include <constr_SEQUENCE.h> |
| 9 | |
vlm | eb2157b | 2004-08-11 05:22:22 +0000 | [diff] [blame] | 10 | /*** <<< DEPS [T] >>> ***/ |
| 11 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 12 | extern asn1_TYPE_descriptor_t asn1_DEF_T; |
| 13 | |
| 14 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 15 | |
| 16 | |
| 17 | typedef struct T { |
| 18 | INTEGER_t int; |
| 19 | struct collection { |
| 20 | A_SEQUENCE_OF(struct T2) list; |
| 21 | |
| 22 | /* Context for parsing across buffer boundaries */ |
| 23 | ber_dec_ctx_t _ber_dec_ctx; |
| 24 | } collection; |
| 25 | |
| 26 | /* Context for parsing across buffer boundaries */ |
| 27 | ber_dec_ctx_t _ber_dec_ctx; |
| 28 | } T_t; |
| 29 | |
| 30 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 31 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 32 | static asn1_TYPE_member_t asn1_MBR_collection[] = { |
| 33 | { 0, 0, |
| 34 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 35 | .tag_mode = 0, |
| 36 | .type = (void *)&asn1_DEF_T2, |
| 37 | .memb_constraints = 0, /* Defer to actual type */ |
| 38 | .name = "" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 39 | }, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 40 | }; |
| 41 | static ber_tlv_tag_t asn1_DEF_collection_tags[] = { |
| 42 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 43 | }; |
| 44 | static asn1_SET_OF_specifics_t asn1_DEF_collection_specs = { |
| 45 | sizeof(struct collection), |
| 46 | offsetof(struct collection, _ber_dec_ctx), |
| 47 | }; |
| 48 | asn1_TYPE_descriptor_t asn1_DEF_collection = { |
| 49 | "collection", |
| 50 | SEQUENCE_OF_constraint, |
| 51 | SEQUENCE_OF_decode_ber, |
| 52 | SEQUENCE_OF_encode_der, |
| 53 | SEQUENCE_OF_print, |
| 54 | SEQUENCE_OF_free, |
| 55 | 0, /* Use generic outmost tag fetcher */ |
| 56 | asn1_DEF_collection_tags, |
| 57 | sizeof(asn1_DEF_collection_tags) |
| 58 | /sizeof(asn1_DEF_collection_tags[0]), /* 1 */ |
| 59 | 1, /* Tags to skip */ |
| 60 | 1, /* Whether CONSTRUCTED */ |
| 61 | asn1_MBR_collection, |
| 62 | 1, /* Single element */ |
| 63 | &asn1_DEF_collection_specs /* Additional specs */ |
| 64 | }; |
| 65 | |
| 66 | static asn1_TYPE_member_t asn1_MBR_T[] = { |
| 67 | { 0, offsetof(struct T, int), |
| 68 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 69 | .tag_mode = 0, |
| 70 | .type = (void *)&asn1_DEF_INTEGER, |
| 71 | .memb_constraints = 0, /* Defer to actual type */ |
| 72 | .name = "int" |
| 73 | }, |
| 74 | { 0, offsetof(struct T, collection), |
| 75 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 76 | .tag_mode = 0, |
| 77 | .type = (void *)&asn1_DEF_collection, |
| 78 | .memb_constraints = 0, /* Defer to actual type */ |
| 79 | .name = "collection" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 80 | }, |
| 81 | }; |
| 82 | static ber_tlv_tag_t asn1_DEF_T_tags[] = { |
| 83 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 84 | }; |
vlm | 35efd1b | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 85 | static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = { |
vlm | c8aeab4 | 2004-06-14 13:09:45 +0000 | [diff] [blame] | 86 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int at 15 */ |
| 87 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* collection at 17 */ |
vlm | 35efd1b | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 88 | }; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 89 | static asn1_SEQUENCE_specifics_t asn1_DEF_T_specs = { |
| 90 | sizeof(struct T), |
| 91 | offsetof(struct T, _ber_dec_ctx), |
vlm | 35efd1b | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 92 | asn1_DEF_T_tag2el, |
| 93 | 2, /* Count of tags in the map */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 94 | -1, /* Start extensions */ |
| 95 | -1 /* Stop extensions */ |
| 96 | }; |
| 97 | asn1_TYPE_descriptor_t asn1_DEF_T = { |
| 98 | "T", |
| 99 | SEQUENCE_constraint, |
| 100 | SEQUENCE_decode_ber, |
| 101 | SEQUENCE_encode_der, |
| 102 | SEQUENCE_print, |
| 103 | SEQUENCE_free, |
| 104 | 0, /* Use generic outmost tag fetcher */ |
| 105 | asn1_DEF_T_tags, |
| 106 | sizeof(asn1_DEF_T_tags) |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 107 | /sizeof(asn1_DEF_T_tags[0]), /* 1 */ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 108 | 1, /* Tags to skip */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 109 | 1, /* Whether CONSTRUCTED */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 110 | asn1_MBR_T, |
| 111 | 2, /* Elements count */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 112 | &asn1_DEF_T_specs /* Additional specs */ |
| 113 | }; |
| 114 | |
| 115 | |
vlm | eb2157b | 2004-08-11 05:22:22 +0000 | [diff] [blame] | 116 | /*** <<< INCLUDES [T2] >>> ***/ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 117 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 118 | #include <BOOLEAN.h> |
| 119 | #include <UTF8String.h> |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 120 | #include <constr_SEQUENCE.h> |
| 121 | |
vlm | eb2157b | 2004-08-11 05:22:22 +0000 | [diff] [blame] | 122 | /*** <<< DEPS [T2] >>> ***/ |
| 123 | |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 124 | extern asn1_TYPE_descriptor_t asn1_DEF_T2; |
| 125 | |
| 126 | /*** <<< TYPE-DECLS [T2] >>> ***/ |
| 127 | |
| 128 | |
| 129 | typedef struct T2 { |
| 130 | BOOLEAN_t flag; |
| 131 | UTF8String_t str; |
| 132 | |
| 133 | /* Context for parsing across buffer boundaries */ |
| 134 | ber_dec_ctx_t _ber_dec_ctx; |
| 135 | } T2_t; |
| 136 | |
| 137 | /*** <<< STAT-DEFS [T2] >>> ***/ |
| 138 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 139 | static asn1_TYPE_member_t asn1_MBR_T2[] = { |
| 140 | { 0, offsetof(struct T2, flag), |
| 141 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 142 | .tag_mode = 0, |
| 143 | .type = (void *)&asn1_DEF_BOOLEAN, |
| 144 | .memb_constraints = 0, /* Defer to actual type */ |
| 145 | .name = "flag" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 146 | }, |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 147 | { 0, offsetof(struct T2, str), |
| 148 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), |
| 149 | .tag_mode = 0, |
| 150 | .type = (void *)&asn1_DEF_UTF8String, |
| 151 | .memb_constraints = 0, /* Defer to actual type */ |
| 152 | .name = "str" |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 153 | }, |
| 154 | }; |
| 155 | static ber_tlv_tag_t asn1_DEF_T2_tags[] = { |
| 156 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 157 | }; |
vlm | 35efd1b | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 158 | static asn1_TYPE_tag2member_t asn1_DEF_T2_tag2el[] = { |
vlm | c8aeab4 | 2004-06-14 13:09:45 +0000 | [diff] [blame] | 159 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* flag at 20 */ |
| 160 | { (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), 1, 0, 0 }, /* str at 21 */ |
vlm | 35efd1b | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 161 | }; |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 162 | static asn1_SEQUENCE_specifics_t asn1_DEF_T2_specs = { |
| 163 | sizeof(struct T2), |
| 164 | offsetof(struct T2, _ber_dec_ctx), |
vlm | 35efd1b | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 165 | asn1_DEF_T2_tag2el, |
| 166 | 2, /* Count of tags in the map */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 167 | -1, /* Start extensions */ |
| 168 | -1 /* Stop extensions */ |
| 169 | }; |
| 170 | asn1_TYPE_descriptor_t asn1_DEF_T2 = { |
| 171 | "T2", |
| 172 | SEQUENCE_constraint, |
| 173 | SEQUENCE_decode_ber, |
| 174 | SEQUENCE_encode_der, |
| 175 | SEQUENCE_print, |
| 176 | SEQUENCE_free, |
| 177 | 0, /* Use generic outmost tag fetcher */ |
| 178 | asn1_DEF_T2_tags, |
| 179 | sizeof(asn1_DEF_T2_tags) |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 180 | /sizeof(asn1_DEF_T2_tags[0]), /* 1 */ |
vlm | 3df7966 | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 181 | 1, /* Tags to skip */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 182 | 1, /* Whether CONSTRUCTED */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 183 | asn1_MBR_T2, |
| 184 | 2, /* Elements count */ |
vlm | fa67ddc | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 185 | &asn1_DEF_T2_specs /* Additional specs */ |
| 186 | }; |
| 187 | |