vlm | 0789113 | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [T] >>> ***/ |
| 3 | |
| 4 | #include <INTEGER.h> |
| 5 | #include <IA5String.h> |
| 6 | #include <BOOLEAN.h> |
| 7 | #include <constr_SET.h> |
| 8 | |
| 9 | /*** <<< DEPS [T] >>> ***/ |
| 10 | |
| 11 | |
| 12 | /* |
| 13 | * Method of determining the components presence |
| 14 | */ |
| 15 | typedef enum T_PR { |
| 16 | T_PR_i, /* Member i is present */ |
| 17 | T_PR_s, /* Member s is present */ |
| 18 | T_PR_b, /* Member b is present */ |
| 19 | } T_PR; |
| 20 | extern asn_TYPE_descriptor_t asn_DEF_T; |
| 21 | |
| 22 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 23 | |
| 24 | |
| 25 | typedef struct T { |
| 26 | INTEGER_t i; |
| 27 | IA5String_t s; |
| 28 | /* |
| 29 | * This type is extensible, |
| 30 | * possible extensions are below. |
| 31 | */ |
| 32 | BOOLEAN_t *b; |
| 33 | |
| 34 | /* Presence bitmask: ASN_SET_ISPRESENT(pT, T_PR_x) */ |
| 35 | unsigned int _presence_map |
| 36 | [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 37 | |
| 38 | /* Context for parsing across buffer boundaries */ |
| 39 | asn_struct_ctx_t _asn_ctx; |
| 40 | } T_t; |
| 41 | |
| 42 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 43 | |
| 44 | static asn_TYPE_member_t asn_MBR_T[] = { |
| 45 | { ATF_NOFLAGS, 0, offsetof(struct T, i), |
| 46 | .tag = (ASN_TAG_CLASS_APPLICATION | (3 << 2)), |
| 47 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 48 | .type = (void *)&asn_DEF_INTEGER, |
vlm | 0a9af51 | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 49 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 0789113 | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 50 | .name = "i" |
| 51 | }, |
| 52 | { ATF_NOFLAGS, 0, offsetof(struct T, s), |
| 53 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), |
| 54 | .tag_mode = 0, |
| 55 | .type = (void *)&asn_DEF_IA5String, |
vlm | 0a9af51 | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 56 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 0789113 | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 57 | .name = "s" |
| 58 | }, |
| 59 | { ATF_POINTER, 0, offsetof(struct T, b), |
| 60 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 61 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
| 62 | .type = (void *)&asn_DEF_BOOLEAN, |
vlm | 0a9af51 | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 63 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
vlm | 0789113 | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 64 | .name = "b" |
| 65 | }, |
| 66 | }; |
| 67 | static ber_tlv_tag_t asn_DEF_T_tags[] = { |
| 68 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 69 | }; |
| 70 | static asn_TYPE_tag2member_t asn_DEF_T_tag2el[] = { |
| 71 | { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 }, /* s at 16 */ |
| 72 | { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, 0, 0 }, /* i at 15 */ |
| 73 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* b at 18 */ |
| 74 | }; |
| 75 | static uint8_t asn_DEF_T_mmap[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
| 76 | (1 << 7) | (1 << 6) | (0 << 5) |
| 77 | }; |
| 78 | static asn_SET_specifics_t asn_DEF_T_specs = { |
| 79 | sizeof(struct T), |
| 80 | offsetof(struct T, _asn_ctx), |
| 81 | offsetof(struct T, _presence_map), |
| 82 | asn_DEF_T_tag2el, |
| 83 | 3, /* Count of tags in the map */ |
| 84 | asn_DEF_T_tag2el, /* Same as above */ |
| 85 | 3, /* Count of tags in the CANONICAL-XER map */ |
| 86 | 1, /* Whether extensible */ |
| 87 | (unsigned int *)asn_DEF_T_mmap /* Mandatory elements map */ |
| 88 | }; |
| 89 | asn_TYPE_descriptor_t asn_DEF_T = { |
| 90 | "T", |
vlm | 9de248e | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 91 | "T", |
vlm | 0789113 | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 92 | SET_free, |
| 93 | SET_print, |
| 94 | SET_constraint, |
| 95 | SET_decode_ber, |
| 96 | SET_encode_der, |
| 97 | 0, /* Not implemented yet */ |
| 98 | SET_encode_xer, |
| 99 | 0, /* Use generic outmost tag fetcher */ |
| 100 | asn_DEF_T_tags, |
| 101 | sizeof(asn_DEF_T_tags) |
| 102 | /sizeof(asn_DEF_T_tags[0]), /* 1 */ |
| 103 | asn_DEF_T_tags, /* Same as above */ |
| 104 | sizeof(asn_DEF_T_tags) |
| 105 | /sizeof(asn_DEF_T_tags[0]), /* 1 */ |
| 106 | asn_MBR_T, |
| 107 | 3, /* Elements count */ |
| 108 | &asn_DEF_T_specs /* Additional specs */ |
| 109 | }; |
| 110 | |