blob: 67ab3fdf934a5b5690b3e7e2646cc31b1967fcbd [file] [log] [blame]
Lev Walkin1b6d63d2006-10-27 05:38:20 +00001
2/*** <<< INCLUDES [T] >>> ***/
3
4#include <BIT_STRING.h>
5
6/*** <<< DEPS [T] >>> ***/
7
8typedef enum T {
9 T_flag1 = 0,
10 T_flag2 = 1,
11 T_flag3 = 2
12} e_T;
13
14/*** <<< TYPE-DECLS [T] >>> ***/
15
16typedef BIT_STRING_t T_t;
17
18/*** <<< FUNC-DECLS [T] >>> ***/
19
20extern asn_TYPE_descriptor_t asn_DEF_T;
21asn_struct_free_f T_free;
22asn_struct_print_f T_print;
23asn_constr_check_f T_constraint;
24ber_type_decoder_f T_decode_ber;
25der_type_encoder_f T_encode_der;
26xer_type_decoder_f T_decode_xer;
27xer_type_encoder_f T_encode_xer;
28
29/*** <<< CODE [T] >>> ***/
30
31int
32T_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 Walkin7c1dc052016-03-14 03:08:15 -070037 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin1b6d63d2006-10-27 05:38:20 +000038 "%s: value not given (%s:%d)",
39 td->name, __FILE__, __LINE__);
40 return -1;
41 }
42
43
44 if(1 /* No applicable constraints whatsoever */) {
johvikbd3dea92017-05-09 10:20:51 +020045 (void)st; /* Unused variable */
Lev Walkin1b6d63d2006-10-27 05:38:20 +000046 /* Nothing is here. See below */
47 }
48
49 /* Replace with underlying type checker */
Lev Walkin154519a2017-09-06 23:34:40 -070050 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin1b6d63d2006-10-27 05:38:20 +000051}
52
53/*
54 * This type is implemented using BIT_STRING,
55 * so here we adjust the DEF accordingly.
56 */
Lev Walkin1b6d63d2006-10-27 05:38:20 +000057
58/*** <<< STAT-DEFS [T] >>> ***/
59
Lev Walkina7591b52014-10-12 18:37:35 -070060static const ber_tlv_tag_t asn_DEF_T_tags_1[] = {
Lev Walkin1b6d63d2006-10-27 05:38:20 +000061 (ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
62};
63asn_TYPE_descriptor_t asn_DEF_T = {
64 "T",
65 "T",
Bi-Ruei, Chiu1f87ac02017-08-20 01:25:45 +080066 &asn_OP_BIT_STRING,
Lev Walkin1b6d63d2006-10-27 05:38:20 +000067 T_constraint,
Lev Walkin1b6d63d2006-10-27 05:38:20 +000068 asn_DEF_T_tags_1,
69 sizeof(asn_DEF_T_tags_1)
70 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
71 asn_DEF_T_tags_1, /* Same as above */
72 sizeof(asn_DEF_T_tags_1)
73 /sizeof(asn_DEF_T_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +040074 0, /* No OER visible constraints */
Lev Walkin1b6d63d2006-10-27 05:38:20 +000075 0, /* No PER visible constraints */
76 0, 0, /* Defined elsewhere */
Bi-Ruei, Chiu1fa31c92016-05-16 13:50:09 +080077 &asn_SPC_BIT_STRING_specs /* Additional specs */
Lev Walkin1b6d63d2006-10-27 05:38:20 +000078};
79