Lev Walkin | 2a8672e | 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; |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 20 | |
| 21 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 22 | |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 23 | typedef struct T { |
| 24 | INTEGER_t i; |
| 25 | IA5String_t s; |
| 26 | /* |
| 27 | * This type is extensible, |
| 28 | * possible extensions are below. |
| 29 | */ |
| 30 | BOOLEAN_t *b; |
| 31 | |
| 32 | /* Presence bitmask: ASN_SET_ISPRESENT(pT, T_PR_x) */ |
| 33 | unsigned int _presence_map |
| 34 | [((3+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 35 | |
| 36 | /* Context for parsing across buffer boundaries */ |
| 37 | asn_struct_ctx_t _asn_ctx; |
| 38 | } T_t; |
| 39 | |
Lev Walkin | c828571 | 2005-03-04 22:18:20 +0000 | [diff] [blame] | 40 | /*** <<< FUNC-DECLS [T] >>> ***/ |
| 41 | |
| 42 | extern asn_TYPE_descriptor_t asn_DEF_T; |
| 43 | |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 44 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 45 | |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 46 | static asn_TYPE_member_t asn_MBR_T_1[] = { |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 47 | { ATF_NOFLAGS, 0, offsetof(struct T, i), |
| 48 | .tag = (ASN_TAG_CLASS_APPLICATION | (3 << 2)), |
| 49 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 50 | .type = &asn_DEF_INTEGER, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 51 | .type_selector = 0, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 52 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 53 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 54 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 55 | .default_value = 0, |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 56 | .name = "i" |
| 57 | }, |
| 58 | { ATF_NOFLAGS, 0, offsetof(struct T, s), |
| 59 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), |
| 60 | .tag_mode = 0, |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 61 | .type = &asn_DEF_IA5String, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 62 | .type_selector = 0, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 63 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 64 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 65 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 66 | .default_value = 0, |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 67 | .name = "s" |
| 68 | }, |
Lev Walkin | b85a813 | 2005-08-18 13:38:19 +0000 | [diff] [blame] | 69 | { ATF_POINTER, 1, offsetof(struct T, b), |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 70 | .tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 71 | .tag_mode = -1, /* IMPLICIT tag at current level */ |
Lev Walkin | ae7bf3f | 2005-08-29 10:31:14 +0000 | [diff] [blame] | 72 | .type = &asn_DEF_BOOLEAN, |
Lev Walkin | 67a3012 | 2017-08-10 05:48:54 -0700 | [diff] [blame] | 73 | .type_selector = 0, |
Lev Walkin | ba58e1b | 2005-01-17 12:20:19 +0000 | [diff] [blame] | 74 | .memb_constraints = 0, /* Defer constraints checking to the member type */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 75 | .oer_constraints = 0, /* OER is not compiled, use -gen-OER */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 76 | .per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 77 | .default_value = 0, |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 78 | .name = "b" |
| 79 | }, |
| 80 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 81 | static const ber_tlv_tag_t asn_DEF_T_tags_1[] = { |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 82 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 83 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 84 | static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { |
Lev Walkin | 4062b01 | 2013-10-11 14:29:38 -0700 | [diff] [blame] | 85 | { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 }, /* s */ |
| 86 | { (ASN_TAG_CLASS_APPLICATION | (3 << 2)), 0, 0, 0 }, /* i */ |
| 87 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* b */ |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 88 | }; |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 89 | static const uint8_t asn_MAP_T_mmap_1[(3 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 90 | (1 << 7) | (1 << 6) | (0 << 5) |
| 91 | }; |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 92 | static |
| 93 | asn_SET_specifics_t asn_SPC_T_specs_1 = { |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 94 | sizeof(struct T), |
| 95 | offsetof(struct T, _asn_ctx), |
| 96 | offsetof(struct T, _presence_map), |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 97 | asn_MAP_T_tag2el_1, |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 98 | 3, /* Count of tags in the map */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 99 | asn_MAP_T_tag2el_1, /* Same as above */ |
Lev Walkin | f82138b | 2005-02-25 08:20:32 +0000 | [diff] [blame] | 100 | 3, /* Count of tags in the CXER map */ |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 101 | 1, /* Whether extensible */ |
Lev Walkin | 46ef3f3 | 2017-07-06 08:47:53 -0700 | [diff] [blame] | 102 | (const unsigned int *)asn_MAP_T_mmap_1 /* Mandatory elements map */ |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 103 | }; |
| 104 | asn_TYPE_descriptor_t asn_DEF_T = { |
| 105 | "T", |
Lev Walkin | dc06f6b | 2004-10-20 15:50:55 +0000 | [diff] [blame] | 106 | "T", |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 107 | SET_free, |
| 108 | SET_print, |
Lev Walkin | cd2f48e | 2017-08-10 02:14:59 -0700 | [diff] [blame] | 109 | SET_compare, |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 110 | SET_constraint, |
| 111 | SET_decode_ber, |
| 112 | SET_encode_der, |
Lev Walkin | b223080 | 2005-02-14 20:31:31 +0000 | [diff] [blame] | 113 | SET_decode_xer, |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 114 | SET_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 115 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 116 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 117 | 0, /* Use generic outmost tag fetcher */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 118 | asn_DEF_T_tags_1, |
| 119 | sizeof(asn_DEF_T_tags_1) |
| 120 | /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
| 121 | asn_DEF_T_tags_1, /* Same as above */ |
| 122 | sizeof(asn_DEF_T_tags_1) |
| 123 | /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 124 | 0, /* No OER visible constraints */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 125 | 0, /* No PER visible constraints */ |
Lev Walkin | e0272aa | 2005-03-04 11:26:08 +0000 | [diff] [blame] | 126 | asn_MBR_T_1, |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 127 | 3, /* Elements count */ |
Lev Walkin | 59b176e | 2005-11-26 11:25:14 +0000 | [diff] [blame] | 128 | &asn_SPC_T_specs_1 /* Additional specs */ |
Lev Walkin | 2a8672e | 2004-10-03 09:14:49 +0000 | [diff] [blame] | 129 | }; |
| 130 | |