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