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