Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 1 | |
| 2 | /*** <<< INCLUDES [T] >>> ***/ |
| 3 | |
| 4 | #include <BIT_STRING.h> |
| 5 | |
| 6 | /*** <<< DEPS [T] >>> ***/ |
| 7 | |
| 8 | typedef enum T { |
| 9 | T_flag1 = 0, |
| 10 | T_flag2 = 1, |
| 11 | T_flag3 = 2 |
| 12 | } e_T; |
| 13 | |
| 14 | /*** <<< TYPE-DECLS [T] >>> ***/ |
| 15 | |
| 16 | typedef BIT_STRING_t T_t; |
| 17 | |
| 18 | /*** <<< FUNC-DECLS [T] >>> ***/ |
| 19 | |
| 20 | extern asn_TYPE_descriptor_t asn_DEF_T; |
| 21 | asn_struct_free_f T_free; |
| 22 | asn_struct_print_f T_print; |
| 23 | asn_constr_check_f T_constraint; |
| 24 | ber_type_decoder_f T_decode_ber; |
| 25 | der_type_encoder_f T_encode_der; |
| 26 | xer_type_decoder_f T_decode_xer; |
| 27 | xer_type_encoder_f T_encode_xer; |
| 28 | |
| 29 | /*** <<< CODE [T] >>> ***/ |
| 30 | |
| 31 | int |
| 32 | T_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
| 33 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 34 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 35 | |
| 36 | if(!sptr) { |
Lev Walkin | 7c1dc05 | 2016-03-14 03:08:15 -0700 | [diff] [blame] | 37 | ASN__CTFAIL(app_key, td, sptr, |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 38 | "%s: value not given (%s:%d)", |
| 39 | td->name, __FILE__, __LINE__); |
| 40 | return -1; |
| 41 | } |
| 42 | |
| 43 | |
| 44 | if(1 /* No applicable constraints whatsoever */) { |
johvik | bd3dea9 | 2017-05-09 10:20:51 +0200 | [diff] [blame] | 45 | (void)st; /* Unused variable */ |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 46 | /* Nothing is here. See below */ |
| 47 | } |
| 48 | |
| 49 | /* Replace with underlying type checker */ |
| 50 | td->check_constraints = asn_DEF_BIT_STRING.check_constraints; |
| 51 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
| 52 | } |
| 53 | |
| 54 | /* |
| 55 | * This type is implemented using BIT_STRING, |
| 56 | * so here we adjust the DEF accordingly. |
| 57 | */ |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 58 | |
| 59 | /*** <<< STAT-DEFS [T] >>> ***/ |
| 60 | |
Lev Walkin | a7591b5 | 2014-10-12 18:37:35 -0700 | [diff] [blame] | 61 | static const ber_tlv_tag_t asn_DEF_T_tags_1[] = { |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 62 | (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)) |
| 63 | }; |
| 64 | asn_TYPE_descriptor_t asn_DEF_T = { |
| 65 | "T", |
| 66 | "T", |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 67 | BIT_STRING_free, |
| 68 | BIT_STRING_print, |
Lev Walkin | cd2f48e | 2017-08-10 02:14:59 -0700 | [diff] [blame] | 69 | BIT_STRING_compare, |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 70 | T_constraint, |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 71 | BIT_STRING_decode_ber, |
| 72 | BIT_STRING_encode_der, |
| 73 | BIT_STRING_decode_xer, |
| 74 | BIT_STRING_encode_xer, |
Lev Walkin | ba68c91 | 2017-07-06 07:52:39 -0700 | [diff] [blame] | 75 | 0, 0, /* No OER support, use "-gen-OER" to enable */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 76 | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 77 | 0, /* Use generic outmost tag fetcher */ |
| 78 | asn_DEF_T_tags_1, |
| 79 | sizeof(asn_DEF_T_tags_1) |
| 80 | /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
| 81 | asn_DEF_T_tags_1, /* Same as above */ |
| 82 | sizeof(asn_DEF_T_tags_1) |
| 83 | /sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
Lev Walkin | b33425f | 2017-07-14 14:59:52 +0400 | [diff] [blame] | 84 | 0, /* No OER visible constraints */ |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 85 | 0, /* No PER visible constraints */ |
| 86 | 0, 0, /* Defined elsewhere */ |
Bi-Ruei, Chiu | 1fa31c9 | 2016-05-16 13:50:09 +0800 | [diff] [blame] | 87 | &asn_SPC_BIT_STRING_specs /* Additional specs */ |
Lev Walkin | 1b6d63d | 2006-10-27 05:38:20 +0000 | [diff] [blame] | 88 | }; |
| 89 | |