vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 1 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 2 | /*** <<< INCLUDES [T1] >>> ***/ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 3 | |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 4 | #include <INTEGER.h> |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 5 | #include <constr_SET.h> |
| 6 | |
| 7 | /*** <<< DEPS [T1] >>> ***/ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 8 | |
| 9 | |
| 10 | /* |
| 11 | * Method of determining the components presence |
| 12 | */ |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 13 | typedef enum T1_PR { |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 14 | T1_PR_i, /* Member i is present */ |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 15 | } T1_PR; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 16 | extern asn1_TYPE_descriptor_t asn1_DEF_T1; |
| 17 | |
| 18 | /*** <<< TYPE-DECLS [T1] >>> ***/ |
| 19 | |
| 20 | |
| 21 | typedef struct T1 { |
| 22 | INTEGER_t i; |
| 23 | /* |
| 24 | * This type is extensible, |
| 25 | * possible extensions are below. |
| 26 | */ |
| 27 | |
| 28 | /* Presence bitmask: ASN_SET_ISPRESENT(pT1, T1_PR_x) */ |
| 29 | unsigned int _presence_map |
| 30 | [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 31 | |
| 32 | /* Context for parsing across buffer boundaries */ |
| 33 | ber_dec_ctx_t _ber_dec_ctx; |
| 34 | } T1_t; |
| 35 | |
| 36 | /*** <<< STAT-DEFS [T1] >>> ***/ |
| 37 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 38 | static asn1_TYPE_member_t asn1_MBR_T1[] = { |
| 39 | { 0, offsetof(struct T1, i), |
| 40 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 41 | .tag_mode = 0, |
| 42 | .type = (void *)&asn1_DEF_INTEGER, |
| 43 | .memb_constraints = 0, /* Defer to actual type */ |
| 44 | .name = "i" |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 45 | }, |
| 46 | }; |
| 47 | static ber_tlv_tag_t asn1_DEF_T1_tags[] = { |
| 48 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 49 | }; |
| 50 | static asn1_TYPE_tag2member_t asn1_DEF_T1_tag2el[] = { |
| 51 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 14 */ |
| 52 | }; |
| 53 | static uint8_t asn1_DEF_T1_mmap[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
| 54 | (1 << 7) |
| 55 | }; |
| 56 | static asn1_SET_specifics_t asn1_DEF_T1_specs = { |
| 57 | sizeof(struct T1), |
| 58 | offsetof(struct T1, _ber_dec_ctx), |
| 59 | offsetof(struct T1, _presence_map), |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 60 | asn1_DEF_T1_tag2el, |
| 61 | 1, /* Count of tags in the map */ |
| 62 | 1, /* Whether extensible */ |
| 63 | (unsigned int *)asn1_DEF_T1_mmap /* Mandatory elements map */ |
| 64 | }; |
| 65 | asn1_TYPE_descriptor_t asn1_DEF_T1 = { |
| 66 | "T1", |
| 67 | SET_constraint, |
| 68 | SET_decode_ber, |
| 69 | SET_encode_der, |
| 70 | SET_print, |
| 71 | SET_free, |
| 72 | 0, /* Use generic outmost tag fetcher */ |
| 73 | asn1_DEF_T1_tags, |
| 74 | sizeof(asn1_DEF_T1_tags) |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 75 | /sizeof(asn1_DEF_T1_tags[0]), /* 1 */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 76 | 1, /* Tags to skip */ |
| 77 | 1, /* Whether CONSTRUCTED */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 78 | asn1_MBR_T1, |
| 79 | 1, /* Elements count */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 80 | &asn1_DEF_T1_specs /* Additional specs */ |
| 81 | }; |
| 82 | |
| 83 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 84 | /*** <<< INCLUDES [T2] >>> ***/ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 85 | |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 86 | #include <INTEGER.h> |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 87 | #include <constr_SET.h> |
| 88 | |
| 89 | /*** <<< DEPS [T2] >>> ***/ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 90 | |
| 91 | |
| 92 | /* |
| 93 | * Method of determining the components presence |
| 94 | */ |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 95 | typedef enum T2_PR { |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 96 | T2_PR_i, /* Member i is present */ |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 97 | } T2_PR; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 98 | extern asn1_TYPE_descriptor_t asn1_DEF_T2; |
| 99 | |
| 100 | /*** <<< TYPE-DECLS [T2] >>> ***/ |
| 101 | |
| 102 | |
| 103 | typedef struct T2 { |
| 104 | INTEGER_t i; |
| 105 | /* |
| 106 | * This type is extensible, |
| 107 | * possible extensions are below. |
| 108 | */ |
| 109 | |
| 110 | /* Presence bitmask: ASN_SET_ISPRESENT(pT2, T2_PR_x) */ |
| 111 | unsigned int _presence_map |
| 112 | [((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 113 | |
| 114 | /* Context for parsing across buffer boundaries */ |
| 115 | ber_dec_ctx_t _ber_dec_ctx; |
| 116 | } T2_t; |
| 117 | |
| 118 | /*** <<< STAT-DEFS [T2] >>> ***/ |
| 119 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 120 | static asn1_TYPE_member_t asn1_MBR_T2[] = { |
| 121 | { 0, offsetof(struct T2, i), |
| 122 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 123 | .tag_mode = 0, |
| 124 | .type = (void *)&asn1_DEF_INTEGER, |
| 125 | .memb_constraints = 0, /* Defer to actual type */ |
| 126 | .name = "i" |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 127 | }, |
| 128 | }; |
| 129 | static ber_tlv_tag_t asn1_DEF_T2_tags[] = { |
| 130 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 131 | }; |
| 132 | static asn1_TYPE_tag2member_t asn1_DEF_T2_tag2el[] = { |
| 133 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 15 */ |
| 134 | }; |
| 135 | static uint8_t asn1_DEF_T2_mmap[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
| 136 | (1 << 7) |
| 137 | }; |
| 138 | static asn1_SET_specifics_t asn1_DEF_T2_specs = { |
| 139 | sizeof(struct T2), |
| 140 | offsetof(struct T2, _ber_dec_ctx), |
| 141 | offsetof(struct T2, _presence_map), |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 142 | asn1_DEF_T2_tag2el, |
| 143 | 1, /* Count of tags in the map */ |
| 144 | 1, /* Whether extensible */ |
| 145 | (unsigned int *)asn1_DEF_T2_mmap /* Mandatory elements map */ |
| 146 | }; |
| 147 | asn1_TYPE_descriptor_t asn1_DEF_T2 = { |
| 148 | "T2", |
| 149 | SET_constraint, |
| 150 | SET_decode_ber, |
| 151 | SET_encode_der, |
| 152 | SET_print, |
| 153 | SET_free, |
| 154 | 0, /* Use generic outmost tag fetcher */ |
| 155 | asn1_DEF_T2_tags, |
| 156 | sizeof(asn1_DEF_T2_tags) |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 157 | /sizeof(asn1_DEF_T2_tags[0]), /* 1 */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 158 | 1, /* Tags to skip */ |
| 159 | 1, /* Whether CONSTRUCTED */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 160 | asn1_MBR_T2, |
| 161 | 1, /* Elements count */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 162 | &asn1_DEF_T2_specs /* Additional specs */ |
| 163 | }; |
| 164 | |
| 165 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 166 | /*** <<< INCLUDES [T3] >>> ***/ |
| 167 | |
| 168 | #include <INTEGER.h> |
| 169 | #include <constr_CHOICE.h> |
| 170 | |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 171 | /*** <<< DEPS [T3] >>> ***/ |
| 172 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 173 | typedef enum T3_PR { |
| 174 | T3_PR_NOTHING, /* No components present */ |
| 175 | T3_PR_i, |
| 176 | /* Extensions may appear below */ |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 177 | } T3_PR; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 178 | extern asn1_TYPE_descriptor_t asn1_DEF_T3; |
| 179 | |
| 180 | /*** <<< TYPE-DECLS [T3] >>> ***/ |
| 181 | |
| 182 | |
| 183 | typedef struct T3 { |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 184 | T3_PR present; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 185 | union { |
| 186 | INTEGER_t i; |
| 187 | /* |
| 188 | * This type is extensible, |
| 189 | * possible extensions are below. |
| 190 | */ |
| 191 | } choice; |
| 192 | |
| 193 | /* Context for parsing across buffer boundaries */ |
| 194 | ber_dec_ctx_t _ber_dec_ctx; |
| 195 | } T3_t; |
| 196 | |
| 197 | /*** <<< STAT-DEFS [T3] >>> ***/ |
| 198 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 199 | static asn1_TYPE_member_t asn1_MBR_T3[] = { |
| 200 | { 0, offsetof(struct T3, choice.i), |
| 201 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 202 | .tag_mode = 0, |
| 203 | .type = (void *)&asn1_DEF_INTEGER, |
| 204 | .memb_constraints = 0, /* Defer to actual type */ |
| 205 | .name = "i" |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 206 | }, |
| 207 | }; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 208 | static asn1_TYPE_tag2member_t asn1_DEF_T3_tag2el[] = { |
| 209 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 16 */ |
| 210 | }; |
| 211 | static asn1_CHOICE_specifics_t asn1_DEF_T3_specs = { |
| 212 | sizeof(struct T3), |
| 213 | offsetof(struct T3, _ber_dec_ctx), |
| 214 | offsetof(struct T3, present), |
| 215 | sizeof(((struct T3 *)0)->present), |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 216 | asn1_DEF_T3_tag2el, |
| 217 | 1, /* Count of tags in the map */ |
| 218 | 1 /* Whether extensible */ |
| 219 | }; |
| 220 | asn1_TYPE_descriptor_t asn1_DEF_T3 = { |
| 221 | "T3", |
| 222 | CHOICE_constraint, |
| 223 | CHOICE_decode_ber, |
| 224 | CHOICE_encode_der, |
| 225 | CHOICE_print, |
| 226 | CHOICE_free, |
| 227 | CHOICE_outmost_tag, |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 228 | 0, /* No explicit tags (pointer) */ |
| 229 | 0, /* No explicit tags (count) */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 230 | 0, /* Tags to skip */ |
| 231 | 1, /* Whether CONSTRUCTED */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 232 | asn1_MBR_T3, |
| 233 | 1, /* Elements count */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 234 | &asn1_DEF_T3_specs /* Additional specs */ |
| 235 | }; |
| 236 | |
| 237 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 238 | /*** <<< INCLUDES [T4] >>> ***/ |
| 239 | |
| 240 | #include <INTEGER.h> |
| 241 | #include <constr_CHOICE.h> |
| 242 | |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 243 | /*** <<< DEPS [T4] >>> ***/ |
| 244 | |
vlm | 6e1b13e | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 245 | typedef enum T4_PR { |
| 246 | T4_PR_NOTHING, /* No components present */ |
| 247 | T4_PR_i, |
| 248 | /* Extensions may appear below */ |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 249 | } T4_PR; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 250 | extern asn1_TYPE_descriptor_t asn1_DEF_T4; |
| 251 | |
| 252 | /*** <<< TYPE-DECLS [T4] >>> ***/ |
| 253 | |
| 254 | |
| 255 | typedef struct T4 { |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 256 | T4_PR present; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 257 | union { |
| 258 | INTEGER_t i; |
| 259 | /* |
| 260 | * This type is extensible, |
| 261 | * possible extensions are below. |
| 262 | */ |
| 263 | } choice; |
| 264 | |
| 265 | /* Context for parsing across buffer boundaries */ |
| 266 | ber_dec_ctx_t _ber_dec_ctx; |
| 267 | } T4_t; |
| 268 | |
| 269 | /*** <<< STAT-DEFS [T4] >>> ***/ |
| 270 | |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 271 | static asn1_TYPE_member_t asn1_MBR_T4[] = { |
| 272 | { 0, offsetof(struct T4, choice.i), |
| 273 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 274 | .tag_mode = 0, |
| 275 | .type = (void *)&asn1_DEF_INTEGER, |
| 276 | .memb_constraints = 0, /* Defer to actual type */ |
| 277 | .name = "i" |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 278 | }, |
| 279 | }; |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 280 | static asn1_TYPE_tag2member_t asn1_DEF_T4_tag2el[] = { |
| 281 | { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 17 */ |
| 282 | }; |
| 283 | static asn1_CHOICE_specifics_t asn1_DEF_T4_specs = { |
| 284 | sizeof(struct T4), |
| 285 | offsetof(struct T4, _ber_dec_ctx), |
| 286 | offsetof(struct T4, present), |
| 287 | sizeof(((struct T4 *)0)->present), |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 288 | asn1_DEF_T4_tag2el, |
| 289 | 1, /* Count of tags in the map */ |
| 290 | 1 /* Whether extensible */ |
| 291 | }; |
| 292 | asn1_TYPE_descriptor_t asn1_DEF_T4 = { |
| 293 | "T4", |
| 294 | CHOICE_constraint, |
| 295 | CHOICE_decode_ber, |
| 296 | CHOICE_encode_der, |
| 297 | CHOICE_print, |
| 298 | CHOICE_free, |
| 299 | CHOICE_outmost_tag, |
vlm | 6e73a04 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 300 | 0, /* No explicit tags (pointer) */ |
| 301 | 0, /* No explicit tags (count) */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 302 | 0, /* Tags to skip */ |
| 303 | 1, /* Whether CONSTRUCTED */ |
vlm | 21e4600 | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 304 | asn1_MBR_T4, |
| 305 | 1, /* Elements count */ |
vlm | 79b08d5 | 2004-07-01 00:52:50 +0000 | [diff] [blame] | 306 | &asn1_DEF_T4_specs /* Additional specs */ |
| 307 | }; |
| 308 | |