| 1 |
|
| 2 |
/*** <<< INCLUDES [T] >>> ***/ |
| 3 |
|
| 4 |
#include <INTEGER.h> |
| 5 |
#include <OCTET_STRING.h> |
| 6 |
#include <REAL.h> |
| 7 |
#include <constr_SET.h> |
| 8 |
#include <constr_SEQUENCE.h> |
| 9 |
|
| 10 |
/*** <<< DEPS [T] >>> ***/ |
| 11 |
|
| 12 |
|
| 13 |
/* |
| 14 |
* Method of determining the components presence |
| 15 |
*/ |
| 16 |
typedef enum class_PR { |
| 17 |
} class_PR; |
| 18 |
|
| 19 |
/*** <<< TYPE-DECLS [T] >>> ***/ |
| 20 |
|
| 21 |
typedef struct T { |
| 22 |
INTEGER_t Int; |
| 23 |
OCTET_STRING_t Char; |
| 24 |
struct Class { |
| 25 |
/* |
| 26 |
* This type is extensible, |
| 27 |
* possible extensions are below. |
| 28 |
*/ |
| 29 |
|
| 30 |
/* Presence bitmask: ASN_SET_ISPRESENT(pclass, class_PR_x) */ |
| 31 |
unsigned int _presence_map |
| 32 |
[((0+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 33 |
|
| 34 |
/* Context for parsing across buffer boundaries */ |
| 35 |
asn_struct_ctx_t _asn_ctx; |
| 36 |
} Class; |
| 37 |
REAL_t Double; |
| 38 |
|
| 39 |
/* Context for parsing across buffer boundaries */ |
| 40 |
asn_struct_ctx_t _asn_ctx; |
| 41 |
} T_t; |
| 42 |
|
| 43 |
/*** <<< FUNC-DECLS [T] >>> ***/ |
| 44 |
|
| 45 |
extern asn_TYPE_descriptor_t asn_DEF_T; |
| 46 |
|
| 47 |
/*** <<< CODE [T] >>> ***/ |
| 48 |
|
| 49 |
static int |
| 50 |
memb_char_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 51 |
asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 52 |
const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; |
| 53 |
size_t size; |
| 54 |
|
| 55 |
if(!sptr) { |
| 56 |
ASN__CTFAIL(app_key, td, sptr, |
| 57 |
"%s: value not given (%s:%d)", |
| 58 |
td->name, __FILE__, __LINE__); |
| 59 |
return -1; |
| 60 |
} |
| 61 |
|
| 62 |
size = st->size; |
| 63 |
|
| 64 |
if((size == 1)) { |
| 65 |
/* Constraint check succeeded */ |
| 66 |
return 0; |
| 67 |
} else { |
| 68 |
ASN__CTFAIL(app_key, td, sptr, |
| 69 |
"%s: constraint failed (%s:%d)", |
| 70 |
td->name, __FILE__, __LINE__); |
| 71 |
return -1; |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
/*** <<< STAT-DEFS [T] >>> ***/ |
| 77 |
|
| 78 |
static const ber_tlv_tag_t asn_DEF_class_tags_4[] = { |
| 79 |
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 80 |
}; |
| 81 |
static const uint8_t asn_MAP_class_mmap_4[(0 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
| 82 |
0 |
| 83 |
}; |
| 84 |
static asn_SET_specifics_t asn_SPC_class_specs_4 = { |
| 85 |
sizeof(struct Class), |
| 86 |
offsetof(struct Class, _asn_ctx), |
| 87 |
offsetof(struct Class, _presence_map), |
| 88 |
asn_MAP_class_tag2el_4, |
| 89 |
0, /* Count of tags in the map */ |
| 90 |
asn_MAP_class_tag2el_4, /* Same as above */ |
| 91 |
0, /* Count of tags in the CXER map */ |
| 92 |
1, /* Whether extensible */ |
| 93 |
(unsigned int *)asn_MAP_class_mmap_4 /* Mandatory elements map */ |
| 94 |
}; |
| 95 |
static /* Use -fall-defs-global to expose */ |
| 96 |
asn_TYPE_descriptor_t asn_DEF_class_4 = { |
| 97 |
"class", |
| 98 |
"class", |
| 99 |
SET_free, |
| 100 |
SET_print, |
| 101 |
SET_constraint, |
| 102 |
SET_decode_ber, |
| 103 |
SET_encode_der, |
| 104 |
SET_decode_xer, |
| 105 |
SET_encode_xer, |
| 106 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 107 |
0, /* Use generic outmost tag fetcher */ |
| 108 |
asn_DEF_class_tags_4, |
| 109 |
sizeof(asn_DEF_class_tags_4) |
| 110 |
/sizeof(asn_DEF_class_tags_4[0]), /* 1 */ |
| 111 |
asn_DEF_class_tags_4, /* Same as above */ |
| 112 |
sizeof(asn_DEF_class_tags_4) |
| 113 |
/sizeof(asn_DEF_class_tags_4[0]), /* 1 */ |
| 114 |
0, /* No PER visible constraints */ |
| 115 |
0, 0, /* No members */ |
| 116 |
&asn_SPC_class_specs_4 /* Additional specs */ |
| 117 |
}; |
| 118 |
|
| 119 |
static asn_TYPE_member_t asn_MBR_T_1[] = { |
| 120 |
{ ATF_NOFLAGS, 0, offsetof(struct T, Int), |
| 121 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 122 |
.tag_mode = 0, |
| 123 |
.type = &asn_DEF_INTEGER, |
| 124 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 125 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 126 |
.default_value = 0, |
| 127 |
.name = "int" |
| 128 |
}, |
| 129 |
{ ATF_NOFLAGS, 0, offsetof(struct T, Char), |
| 130 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), |
| 131 |
.tag_mode = 0, |
| 132 |
.type = &asn_DEF_OCTET_STRING, |
| 133 |
.memb_constraints = memb_char_constraint_1, |
| 134 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 135 |
.default_value = 0, |
| 136 |
.name = "char" |
| 137 |
}, |
| 138 |
{ ATF_NOFLAGS, 0, offsetof(struct T, Class), |
| 139 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 140 |
.tag_mode = 0, |
| 141 |
.type = &asn_DEF_class_4, |
| 142 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 143 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 144 |
.default_value = 0, |
| 145 |
.name = "class" |
| 146 |
}, |
| 147 |
{ ATF_NOFLAGS, 0, offsetof(struct T, Double), |
| 148 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), |
| 149 |
.tag_mode = 0, |
| 150 |
.type = &asn_DEF_REAL, |
| 151 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 152 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 153 |
.default_value = 0, |
| 154 |
.name = "double" |
| 155 |
}, |
| 156 |
}; |
| 157 |
static const ber_tlv_tag_t asn_DEF_T_tags_1[] = { |
| 158 |
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 159 |
}; |
| 160 |
static const asn_TYPE_tag2member_t asn_MAP_T_tag2el_1[] = { |
| 161 |
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* int */ |
| 162 |
{ (ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), 1, 0, 0 }, /* char */ |
| 163 |
{ (ASN_TAG_CLASS_UNIVERSAL | (9 << 2)), 3, 0, 0 }, /* double */ |
| 164 |
{ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 } /* class */ |
| 165 |
}; |
| 166 |
static asn_SEQUENCE_specifics_t asn_SPC_T_specs_1 = { |
| 167 |
sizeof(struct T), |
| 168 |
offsetof(struct T, _asn_ctx), |
| 169 |
asn_MAP_T_tag2el_1, |
| 170 |
4, /* Count of tags in the map */ |
| 171 |
0, 0, 0, /* Optional elements (not needed) */ |
| 172 |
-1, /* Start extensions */ |
| 173 |
-1 /* Stop extensions */ |
| 174 |
}; |
| 175 |
asn_TYPE_descriptor_t asn_DEF_T = { |
| 176 |
"T", |
| 177 |
"T", |
| 178 |
SEQUENCE_free, |
| 179 |
SEQUENCE_print, |
| 180 |
SEQUENCE_constraint, |
| 181 |
SEQUENCE_decode_ber, |
| 182 |
SEQUENCE_encode_der, |
| 183 |
SEQUENCE_decode_xer, |
| 184 |
SEQUENCE_encode_xer, |
| 185 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 186 |
0, /* Use generic outmost tag fetcher */ |
| 187 |
asn_DEF_T_tags_1, |
| 188 |
sizeof(asn_DEF_T_tags_1) |
| 189 |
/sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
| 190 |
asn_DEF_T_tags_1, /* Same as above */ |
| 191 |
sizeof(asn_DEF_T_tags_1) |
| 192 |
/sizeof(asn_DEF_T_tags_1[0]), /* 1 */ |
| 193 |
0, /* No PER visible constraints */ |
| 194 |
asn_MBR_T_1, |
| 195 |
4, /* Elements count */ |
| 196 |
&asn_SPC_T_specs_1 /* Additional specs */ |
| 197 |
}; |
| 198 |
|