| 1 |
|
| 2 |
/*** <<< INCLUDES [Type] >>> ***/ |
| 3 |
|
| 4 |
#include <asn_SET_OF.h> |
| 5 |
#include "Type1.h" |
| 6 |
#include "Type2.h" |
| 7 |
#include <constr_SEQUENCE.h> |
| 8 |
#include <constr_SET_OF.h> |
| 9 |
|
| 10 |
/*** <<< TYPE-DECLS [Type] >>> ***/ |
| 11 |
|
| 12 |
typedef struct Type { |
| 13 |
A_SET_OF(struct Member { |
| 14 |
Type1_t t1; |
| 15 |
Type2_t t2; |
| 16 |
|
| 17 |
/* Context for parsing across buffer boundaries */ |
| 18 |
asn_struct_ctx_t _asn_ctx; |
| 19 |
} ) list; |
| 20 |
|
| 21 |
/* Context for parsing across buffer boundaries */ |
| 22 |
asn_struct_ctx_t _asn_ctx; |
| 23 |
} Type_t; |
| 24 |
|
| 25 |
/*** <<< FUNC-DECLS [Type] >>> ***/ |
| 26 |
|
| 27 |
extern asn_TYPE_descriptor_t asn_DEF_Type; |
| 28 |
|
| 29 |
/*** <<< STAT-DEFS [Type] >>> ***/ |
| 30 |
|
| 31 |
static asn_TYPE_member_t asn_MBR_Member_2[] = { |
| 32 |
{ ATF_NOFLAGS, 0, offsetof(struct Member, t1), |
| 33 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 34 |
.tag_mode = 0, |
| 35 |
.type = &asn_DEF_Type1, |
| 36 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 37 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 38 |
.default_value = 0, |
| 39 |
.name = "t1" |
| 40 |
}, |
| 41 |
{ ATF_NOFLAGS, 0, offsetof(struct Member, t2), |
| 42 |
.tag = -1 /* Ambiguous tag (CHOICE?) */, |
| 43 |
.tag_mode = 0, |
| 44 |
.type = &asn_DEF_Type2, |
| 45 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 46 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 47 |
.default_value = 0, |
| 48 |
.name = "t2" |
| 49 |
}, |
| 50 |
}; |
| 51 |
static const ber_tlv_tag_t asn_DEF_Member_tags_2[] = { |
| 52 |
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 53 |
}; |
| 54 |
static const asn_TYPE_tag2member_t asn_MAP_Member_tag2el_2[] = { |
| 55 |
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* t1 */ |
| 56 |
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 }, /* one-name */ |
| 57 |
{ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name */ |
| 58 |
}; |
| 59 |
static asn_SEQUENCE_specifics_t asn_SPC_Member_specs_2 = { |
| 60 |
sizeof(struct Member), |
| 61 |
offsetof(struct Member, _asn_ctx), |
| 62 |
asn_MAP_Member_tag2el_2, |
| 63 |
3, /* Count of tags in the map */ |
| 64 |
0, 0, 0, /* Optional elements (not needed) */ |
| 65 |
-1, /* Start extensions */ |
| 66 |
-1 /* Stop extensions */ |
| 67 |
}; |
| 68 |
static /* Use -fall-defs-global to expose */ |
| 69 |
asn_TYPE_descriptor_t asn_DEF_Member_2 = { |
| 70 |
"SEQUENCE", |
| 71 |
"SEQUENCE", |
| 72 |
SEQUENCE_free, |
| 73 |
SEQUENCE_print, |
| 74 |
SEQUENCE_constraint, |
| 75 |
SEQUENCE_decode_ber, |
| 76 |
SEQUENCE_encode_der, |
| 77 |
SEQUENCE_decode_xer, |
| 78 |
SEQUENCE_encode_xer, |
| 79 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 80 |
0, /* Use generic outmost tag fetcher */ |
| 81 |
asn_DEF_Member_tags_2, |
| 82 |
sizeof(asn_DEF_Member_tags_2) |
| 83 |
/sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ |
| 84 |
asn_DEF_Member_tags_2, /* Same as above */ |
| 85 |
sizeof(asn_DEF_Member_tags_2) |
| 86 |
/sizeof(asn_DEF_Member_tags_2[0]), /* 1 */ |
| 87 |
0, /* No PER visible constraints */ |
| 88 |
asn_MBR_Member_2, |
| 89 |
2, /* Elements count */ |
| 90 |
&asn_SPC_Member_specs_2 /* Additional specs */ |
| 91 |
}; |
| 92 |
|
| 93 |
static asn_TYPE_member_t asn_MBR_Type_1[] = { |
| 94 |
{ ATF_POINTER, 0, 0, |
| 95 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 96 |
.tag_mode = 0, |
| 97 |
.type = &asn_DEF_Member_2, |
| 98 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 99 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 100 |
.default_value = 0, |
| 101 |
.name = "" |
| 102 |
}, |
| 103 |
}; |
| 104 |
static const ber_tlv_tag_t asn_DEF_Type_tags_1[] = { |
| 105 |
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 106 |
}; |
| 107 |
static asn_SET_OF_specifics_t asn_SPC_Type_specs_1 = { |
| 108 |
sizeof(struct Type), |
| 109 |
offsetof(struct Type, _asn_ctx), |
| 110 |
0, /* XER encoding is XMLDelimitedItemList */ |
| 111 |
}; |
| 112 |
asn_TYPE_descriptor_t asn_DEF_Type = { |
| 113 |
"Type", |
| 114 |
"Type", |
| 115 |
SET_OF_free, |
| 116 |
SET_OF_print, |
| 117 |
SET_OF_constraint, |
| 118 |
SET_OF_decode_ber, |
| 119 |
SET_OF_encode_der, |
| 120 |
SET_OF_decode_xer, |
| 121 |
SET_OF_encode_xer, |
| 122 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 123 |
0, /* Use generic outmost tag fetcher */ |
| 124 |
asn_DEF_Type_tags_1, |
| 125 |
sizeof(asn_DEF_Type_tags_1) |
| 126 |
/sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ |
| 127 |
asn_DEF_Type_tags_1, /* Same as above */ |
| 128 |
sizeof(asn_DEF_Type_tags_1) |
| 129 |
/sizeof(asn_DEF_Type_tags_1[0]), /* 1 */ |
| 130 |
0, /* No PER visible constraints */ |
| 131 |
asn_MBR_Type_1, |
| 132 |
1, /* Single element */ |
| 133 |
&asn_SPC_Type_specs_1 /* Additional specs */ |
| 134 |
}; |
| 135 |
|
| 136 |
|
| 137 |
/*** <<< INCLUDES [Type1] >>> ***/ |
| 138 |
|
| 139 |
#include <INTEGER.h> |
| 140 |
#include <constr_SEQUENCE.h> |
| 141 |
#include <constr_CHOICE.h> |
| 142 |
|
| 143 |
/*** <<< DEPS [Type1] >>> ***/ |
| 144 |
|
| 145 |
typedef enum one_name_PR { |
| 146 |
one_name_PR_NOTHING, /* No components present */ |
| 147 |
one_name_PR_another_name |
| 148 |
} one_name_PR; |
| 149 |
|
| 150 |
/*** <<< TYPE-DECLS [Type1] >>> ***/ |
| 151 |
|
| 152 |
typedef struct Type1 { |
| 153 |
struct one_name { |
| 154 |
one_name_PR present; |
| 155 |
union Type1__one_name_u { |
| 156 |
struct another_name { |
| 157 |
INTEGER_t a; |
| 158 |
INTEGER_t b; |
| 159 |
|
| 160 |
/* Context for parsing across buffer boundaries */ |
| 161 |
asn_struct_ctx_t _asn_ctx; |
| 162 |
} another_name; |
| 163 |
} choice; |
| 164 |
|
| 165 |
/* Context for parsing across buffer boundaries */ |
| 166 |
asn_struct_ctx_t _asn_ctx; |
| 167 |
} one_name; |
| 168 |
|
| 169 |
/* Context for parsing across buffer boundaries */ |
| 170 |
asn_struct_ctx_t _asn_ctx; |
| 171 |
} Type1_t; |
| 172 |
|
| 173 |
/*** <<< FUNC-DECLS [Type1] >>> ***/ |
| 174 |
|
| 175 |
extern asn_TYPE_descriptor_t asn_DEF_Type1; |
| 176 |
|
| 177 |
/*** <<< STAT-DEFS [Type1] >>> ***/ |
| 178 |
|
| 179 |
static asn_TYPE_member_t asn_MBR_another_name_3[] = { |
| 180 |
{ ATF_NOFLAGS, 0, offsetof(struct another_name, a), |
| 181 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 182 |
.tag_mode = 0, |
| 183 |
.type = &asn_DEF_INTEGER, |
| 184 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 185 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 186 |
.default_value = 0, |
| 187 |
.name = "a" |
| 188 |
}, |
| 189 |
{ ATF_NOFLAGS, 0, offsetof(struct another_name, b), |
| 190 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 191 |
.tag_mode = 0, |
| 192 |
.type = &asn_DEF_INTEGER, |
| 193 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 194 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 195 |
.default_value = 0, |
| 196 |
.name = "b" |
| 197 |
}, |
| 198 |
}; |
| 199 |
static const ber_tlv_tag_t asn_DEF_another_name_tags_3[] = { |
| 200 |
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 201 |
}; |
| 202 |
static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = { |
| 203 |
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 1 }, /* a */ |
| 204 |
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, -1, 0 } /* b */ |
| 205 |
}; |
| 206 |
static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = { |
| 207 |
sizeof(struct another_name), |
| 208 |
offsetof(struct another_name, _asn_ctx), |
| 209 |
asn_MAP_another_name_tag2el_3, |
| 210 |
2, /* Count of tags in the map */ |
| 211 |
0, 0, 0, /* Optional elements (not needed) */ |
| 212 |
-1, /* Start extensions */ |
| 213 |
-1 /* Stop extensions */ |
| 214 |
}; |
| 215 |
static /* Use -fall-defs-global to expose */ |
| 216 |
asn_TYPE_descriptor_t asn_DEF_another_name_3 = { |
| 217 |
"another-name", |
| 218 |
"another-name", |
| 219 |
SEQUENCE_free, |
| 220 |
SEQUENCE_print, |
| 221 |
SEQUENCE_constraint, |
| 222 |
SEQUENCE_decode_ber, |
| 223 |
SEQUENCE_encode_der, |
| 224 |
SEQUENCE_decode_xer, |
| 225 |
SEQUENCE_encode_xer, |
| 226 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 227 |
0, /* Use generic outmost tag fetcher */ |
| 228 |
asn_DEF_another_name_tags_3, |
| 229 |
sizeof(asn_DEF_another_name_tags_3) |
| 230 |
/sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ |
| 231 |
asn_DEF_another_name_tags_3, /* Same as above */ |
| 232 |
sizeof(asn_DEF_another_name_tags_3) |
| 233 |
/sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ |
| 234 |
0, /* No PER visible constraints */ |
| 235 |
asn_MBR_another_name_3, |
| 236 |
2, /* Elements count */ |
| 237 |
&asn_SPC_another_name_specs_3 /* Additional specs */ |
| 238 |
}; |
| 239 |
|
| 240 |
static asn_TYPE_member_t asn_MBR_one_name_2[] = { |
| 241 |
{ ATF_NOFLAGS, 0, offsetof(struct one_name, choice.another_name), |
| 242 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 243 |
.tag_mode = 0, |
| 244 |
.type = &asn_DEF_another_name_3, |
| 245 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 246 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 247 |
.default_value = 0, |
| 248 |
.name = "another-name" |
| 249 |
}, |
| 250 |
}; |
| 251 |
static const asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = { |
| 252 |
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */ |
| 253 |
}; |
| 254 |
static asn_CHOICE_specifics_t asn_SPC_one_name_specs_2 = { |
| 255 |
sizeof(struct one_name), |
| 256 |
offsetof(struct one_name, _asn_ctx), |
| 257 |
offsetof(struct one_name, present), |
| 258 |
sizeof(((struct one_name *)0)->present), |
| 259 |
asn_MAP_one_name_tag2el_2, |
| 260 |
1, /* Count of tags in the map */ |
| 261 |
.canonical_order = 0, |
| 262 |
.ext_start = -1 /* Extensions start */ |
| 263 |
}; |
| 264 |
static /* Use -fall-defs-global to expose */ |
| 265 |
asn_TYPE_descriptor_t asn_DEF_one_name_2 = { |
| 266 |
"one-name", |
| 267 |
"one-name", |
| 268 |
CHOICE_free, |
| 269 |
CHOICE_print, |
| 270 |
CHOICE_constraint, |
| 271 |
CHOICE_decode_ber, |
| 272 |
CHOICE_encode_der, |
| 273 |
CHOICE_decode_xer, |
| 274 |
CHOICE_encode_xer, |
| 275 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 276 |
CHOICE_outmost_tag, |
| 277 |
0, /* No effective tags (pointer) */ |
| 278 |
0, /* No effective tags (count) */ |
| 279 |
0, /* No tags (pointer) */ |
| 280 |
0, /* No tags (count) */ |
| 281 |
0, /* No PER visible constraints */ |
| 282 |
asn_MBR_one_name_2, |
| 283 |
1, /* Elements count */ |
| 284 |
&asn_SPC_one_name_specs_2 /* Additional specs */ |
| 285 |
}; |
| 286 |
|
| 287 |
static asn_TYPE_member_t asn_MBR_Type1_1[] = { |
| 288 |
{ ATF_NOFLAGS, 0, offsetof(struct Type1, one_name), |
| 289 |
.tag = -1 /* Ambiguous tag (CHOICE?) */, |
| 290 |
.tag_mode = 0, |
| 291 |
.type = &asn_DEF_one_name_2, |
| 292 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 293 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 294 |
.default_value = 0, |
| 295 |
.name = "one-name" |
| 296 |
}, |
| 297 |
}; |
| 298 |
static const ber_tlv_tag_t asn_DEF_Type1_tags_1[] = { |
| 299 |
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 300 |
}; |
| 301 |
static const asn_TYPE_tag2member_t asn_MAP_Type1_tag2el_1[] = { |
| 302 |
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */ |
| 303 |
}; |
| 304 |
static asn_SEQUENCE_specifics_t asn_SPC_Type1_specs_1 = { |
| 305 |
sizeof(struct Type1), |
| 306 |
offsetof(struct Type1, _asn_ctx), |
| 307 |
asn_MAP_Type1_tag2el_1, |
| 308 |
1, /* Count of tags in the map */ |
| 309 |
0, 0, 0, /* Optional elements (not needed) */ |
| 310 |
-1, /* Start extensions */ |
| 311 |
-1 /* Stop extensions */ |
| 312 |
}; |
| 313 |
asn_TYPE_descriptor_t asn_DEF_Type1 = { |
| 314 |
"Type1", |
| 315 |
"Type1", |
| 316 |
SEQUENCE_free, |
| 317 |
SEQUENCE_print, |
| 318 |
SEQUENCE_constraint, |
| 319 |
SEQUENCE_decode_ber, |
| 320 |
SEQUENCE_encode_der, |
| 321 |
SEQUENCE_decode_xer, |
| 322 |
SEQUENCE_encode_xer, |
| 323 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 324 |
0, /* Use generic outmost tag fetcher */ |
| 325 |
asn_DEF_Type1_tags_1, |
| 326 |
sizeof(asn_DEF_Type1_tags_1) |
| 327 |
/sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */ |
| 328 |
asn_DEF_Type1_tags_1, /* Same as above */ |
| 329 |
sizeof(asn_DEF_Type1_tags_1) |
| 330 |
/sizeof(asn_DEF_Type1_tags_1[0]), /* 1 */ |
| 331 |
0, /* No PER visible constraints */ |
| 332 |
asn_MBR_Type1_1, |
| 333 |
1, /* Elements count */ |
| 334 |
&asn_SPC_Type1_specs_1 /* Additional specs */ |
| 335 |
}; |
| 336 |
|
| 337 |
|
| 338 |
/*** <<< INCLUDES [Type2] >>> ***/ |
| 339 |
|
| 340 |
#include <BIT_STRING.h> |
| 341 |
#include <INTEGER.h> |
| 342 |
#include <constr_SEQUENCE.h> |
| 343 |
#include <constr_SET.h> |
| 344 |
#include <constr_CHOICE.h> |
| 345 |
|
| 346 |
/*** <<< DEPS [Type2] >>> ***/ |
| 347 |
|
| 348 |
typedef enum Type2_PR { |
| 349 |
Type2_PR_NOTHING, /* No components present */ |
| 350 |
Type2_PR_one_name, |
| 351 |
Type2_PR_two_name |
| 352 |
} Type2_PR; |
| 353 |
typedef enum a { |
| 354 |
a_one = 0 |
| 355 |
} e_a; |
| 356 |
|
| 357 |
/* |
| 358 |
* Method of determining the components presence |
| 359 |
*/ |
| 360 |
typedef enum two_name_PR { |
| 361 |
two_name_PR_another_name, /* Member another_name is present */ |
| 362 |
} two_name_PR; |
| 363 |
typedef enum a { |
| 364 |
a_one = 0 |
| 365 |
} e_a; |
| 366 |
|
| 367 |
/*** <<< TYPE-DECLS [Type2] >>> ***/ |
| 368 |
|
| 369 |
typedef struct Type2 { |
| 370 |
Type2_PR present; |
| 371 |
union Type2_u { |
| 372 |
struct one_name { |
| 373 |
struct another_name { |
| 374 |
BIT_STRING_t a; |
| 375 |
INTEGER_t b; |
| 376 |
|
| 377 |
/* Context for parsing across buffer boundaries */ |
| 378 |
asn_struct_ctx_t _asn_ctx; |
| 379 |
} another_name; |
| 380 |
|
| 381 |
/* Context for parsing across buffer boundaries */ |
| 382 |
asn_struct_ctx_t _asn_ctx; |
| 383 |
} one_name; |
| 384 |
struct two_name { |
| 385 |
struct another_name { |
| 386 |
BIT_STRING_t a; |
| 387 |
INTEGER_t b; |
| 388 |
|
| 389 |
/* Context for parsing across buffer boundaries */ |
| 390 |
asn_struct_ctx_t _asn_ctx; |
| 391 |
} another_name; |
| 392 |
|
| 393 |
/* Presence bitmask: ASN_SET_ISPRESENT(ptwo_name, two_name_PR_x) */ |
| 394 |
unsigned int _presence_map |
| 395 |
[((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))]; |
| 396 |
|
| 397 |
/* Context for parsing across buffer boundaries */ |
| 398 |
asn_struct_ctx_t _asn_ctx; |
| 399 |
} two_name; |
| 400 |
} choice; |
| 401 |
|
| 402 |
/* Context for parsing across buffer boundaries */ |
| 403 |
asn_struct_ctx_t _asn_ctx; |
| 404 |
} Type2_t; |
| 405 |
|
| 406 |
/*** <<< FUNC-DECLS [Type2] >>> ***/ |
| 407 |
|
| 408 |
extern asn_TYPE_descriptor_t asn_DEF_Type2; |
| 409 |
|
| 410 |
/*** <<< CODE [Type2] >>> ***/ |
| 411 |
|
| 412 |
static int |
| 413 |
memb_a_constraint_3(asn_TYPE_descriptor_t *td, const void *sptr, |
| 414 |
asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 415 |
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 416 |
size_t size; |
| 417 |
|
| 418 |
if(!sptr) { |
| 419 |
ASN__CTFAIL(app_key, td, sptr, |
| 420 |
"%s: value not given (%s:%d)", |
| 421 |
td->name, __FILE__, __LINE__); |
| 422 |
return -1; |
| 423 |
} |
| 424 |
|
| 425 |
if(st->size > 0) { |
| 426 |
/* Size in bits */ |
| 427 |
size = 8 * st->size - (st->bits_unused & 0x07); |
| 428 |
} else { |
| 429 |
size = 0; |
| 430 |
} |
| 431 |
|
| 432 |
if((size == 2)) { |
| 433 |
/* Constraint check succeeded */ |
| 434 |
return 0; |
| 435 |
} else { |
| 436 |
ASN__CTFAIL(app_key, td, sptr, |
| 437 |
"%s: constraint failed (%s:%d)", |
| 438 |
td->name, __FILE__, __LINE__); |
| 439 |
return -1; |
| 440 |
} |
| 441 |
} |
| 442 |
|
| 443 |
static int |
| 444 |
memb_a_constraint_8(asn_TYPE_descriptor_t *td, const void *sptr, |
| 445 |
asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 446 |
const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 447 |
size_t size; |
| 448 |
|
| 449 |
if(!sptr) { |
| 450 |
ASN__CTFAIL(app_key, td, sptr, |
| 451 |
"%s: value not given (%s:%d)", |
| 452 |
td->name, __FILE__, __LINE__); |
| 453 |
return -1; |
| 454 |
} |
| 455 |
|
| 456 |
if(st->size > 0) { |
| 457 |
/* Size in bits */ |
| 458 |
size = 8 * st->size - (st->bits_unused & 0x07); |
| 459 |
} else { |
| 460 |
size = 0; |
| 461 |
} |
| 462 |
|
| 463 |
if((size == 2)) { |
| 464 |
/* Constraint check succeeded */ |
| 465 |
return 0; |
| 466 |
} else { |
| 467 |
ASN__CTFAIL(app_key, td, sptr, |
| 468 |
"%s: constraint failed (%s:%d)", |
| 469 |
td->name, __FILE__, __LINE__); |
| 470 |
return -1; |
| 471 |
} |
| 472 |
} |
| 473 |
|
| 474 |
|
| 475 |
/*** <<< STAT-DEFS [Type2] >>> ***/ |
| 476 |
|
| 477 |
static asn_TYPE_member_t asn_MBR_another_name_3[] = { |
| 478 |
{ ATF_NOFLAGS, 0, offsetof(struct another_name, a), |
| 479 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), |
| 480 |
.tag_mode = 0, |
| 481 |
.type = &asn_DEF_BIT_STRING, |
| 482 |
.memb_constraints = memb_a_constraint_3, |
| 483 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 484 |
.default_value = 0, |
| 485 |
.name = "a" |
| 486 |
}, |
| 487 |
{ ATF_NOFLAGS, 0, offsetof(struct another_name, b), |
| 488 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 489 |
.tag_mode = 0, |
| 490 |
.type = &asn_DEF_INTEGER, |
| 491 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 492 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 493 |
.default_value = 0, |
| 494 |
.name = "b" |
| 495 |
}, |
| 496 |
}; |
| 497 |
static const ber_tlv_tag_t asn_DEF_another_name_tags_3[] = { |
| 498 |
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 499 |
}; |
| 500 |
static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_3[] = { |
| 501 |
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b */ |
| 502 |
{ (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a */ |
| 503 |
}; |
| 504 |
static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_3 = { |
| 505 |
sizeof(struct another_name), |
| 506 |
offsetof(struct another_name, _asn_ctx), |
| 507 |
asn_MAP_another_name_tag2el_3, |
| 508 |
2, /* Count of tags in the map */ |
| 509 |
0, 0, 0, /* Optional elements (not needed) */ |
| 510 |
-1, /* Start extensions */ |
| 511 |
-1 /* Stop extensions */ |
| 512 |
}; |
| 513 |
static /* Use -fall-defs-global to expose */ |
| 514 |
asn_TYPE_descriptor_t asn_DEF_another_name_3 = { |
| 515 |
"another-name", |
| 516 |
"another-name", |
| 517 |
SEQUENCE_free, |
| 518 |
SEQUENCE_print, |
| 519 |
SEQUENCE_constraint, |
| 520 |
SEQUENCE_decode_ber, |
| 521 |
SEQUENCE_encode_der, |
| 522 |
SEQUENCE_decode_xer, |
| 523 |
SEQUENCE_encode_xer, |
| 524 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 525 |
0, /* Use generic outmost tag fetcher */ |
| 526 |
asn_DEF_another_name_tags_3, |
| 527 |
sizeof(asn_DEF_another_name_tags_3) |
| 528 |
/sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ |
| 529 |
asn_DEF_another_name_tags_3, /* Same as above */ |
| 530 |
sizeof(asn_DEF_another_name_tags_3) |
| 531 |
/sizeof(asn_DEF_another_name_tags_3[0]), /* 1 */ |
| 532 |
0, /* No PER visible constraints */ |
| 533 |
asn_MBR_another_name_3, |
| 534 |
2, /* Elements count */ |
| 535 |
&asn_SPC_another_name_specs_3 /* Additional specs */ |
| 536 |
}; |
| 537 |
|
| 538 |
static asn_TYPE_member_t asn_MBR_one_name_2[] = { |
| 539 |
{ ATF_NOFLAGS, 0, offsetof(struct one_name, another_name), |
| 540 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 541 |
.tag_mode = 0, |
| 542 |
.type = &asn_DEF_another_name_3, |
| 543 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 544 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 545 |
.default_value = 0, |
| 546 |
.name = "another-name" |
| 547 |
}, |
| 548 |
}; |
| 549 |
static const ber_tlv_tag_t asn_DEF_one_name_tags_2[] = { |
| 550 |
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 551 |
}; |
| 552 |
static const asn_TYPE_tag2member_t asn_MAP_one_name_tag2el_2[] = { |
| 553 |
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */ |
| 554 |
}; |
| 555 |
static asn_SEQUENCE_specifics_t asn_SPC_one_name_specs_2 = { |
| 556 |
sizeof(struct one_name), |
| 557 |
offsetof(struct one_name, _asn_ctx), |
| 558 |
asn_MAP_one_name_tag2el_2, |
| 559 |
1, /* Count of tags in the map */ |
| 560 |
0, 0, 0, /* Optional elements (not needed) */ |
| 561 |
-1, /* Start extensions */ |
| 562 |
-1 /* Stop extensions */ |
| 563 |
}; |
| 564 |
static /* Use -fall-defs-global to expose */ |
| 565 |
asn_TYPE_descriptor_t asn_DEF_one_name_2 = { |
| 566 |
"one-name", |
| 567 |
"one-name", |
| 568 |
SEQUENCE_free, |
| 569 |
SEQUENCE_print, |
| 570 |
SEQUENCE_constraint, |
| 571 |
SEQUENCE_decode_ber, |
| 572 |
SEQUENCE_encode_der, |
| 573 |
SEQUENCE_decode_xer, |
| 574 |
SEQUENCE_encode_xer, |
| 575 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 576 |
0, /* Use generic outmost tag fetcher */ |
| 577 |
asn_DEF_one_name_tags_2, |
| 578 |
sizeof(asn_DEF_one_name_tags_2) |
| 579 |
/sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */ |
| 580 |
asn_DEF_one_name_tags_2, /* Same as above */ |
| 581 |
sizeof(asn_DEF_one_name_tags_2) |
| 582 |
/sizeof(asn_DEF_one_name_tags_2[0]), /* 1 */ |
| 583 |
0, /* No PER visible constraints */ |
| 584 |
asn_MBR_one_name_2, |
| 585 |
1, /* Elements count */ |
| 586 |
&asn_SPC_one_name_specs_2 /* Additional specs */ |
| 587 |
}; |
| 588 |
|
| 589 |
static asn_TYPE_member_t asn_MBR_another_name_8[] = { |
| 590 |
{ ATF_NOFLAGS, 0, offsetof(struct another_name, a), |
| 591 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), |
| 592 |
.tag_mode = 0, |
| 593 |
.type = &asn_DEF_BIT_STRING, |
| 594 |
.memb_constraints = memb_a_constraint_8, |
| 595 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 596 |
.default_value = 0, |
| 597 |
.name = "a" |
| 598 |
}, |
| 599 |
{ ATF_NOFLAGS, 0, offsetof(struct another_name, b), |
| 600 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), |
| 601 |
.tag_mode = 0, |
| 602 |
.type = &asn_DEF_INTEGER, |
| 603 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 604 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 605 |
.default_value = 0, |
| 606 |
.name = "b" |
| 607 |
}, |
| 608 |
}; |
| 609 |
static const ber_tlv_tag_t asn_DEF_another_name_tags_8[] = { |
| 610 |
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 611 |
}; |
| 612 |
static const asn_TYPE_tag2member_t asn_MAP_another_name_tag2el_8[] = { |
| 613 |
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* b */ |
| 614 |
{ (ASN_TAG_CLASS_UNIVERSAL | (3 << 2)), 0, 0, 0 } /* a */ |
| 615 |
}; |
| 616 |
static asn_SEQUENCE_specifics_t asn_SPC_another_name_specs_8 = { |
| 617 |
sizeof(struct another_name), |
| 618 |
offsetof(struct another_name, _asn_ctx), |
| 619 |
asn_MAP_another_name_tag2el_8, |
| 620 |
2, /* Count of tags in the map */ |
| 621 |
0, 0, 0, /* Optional elements (not needed) */ |
| 622 |
-1, /* Start extensions */ |
| 623 |
-1 /* Stop extensions */ |
| 624 |
}; |
| 625 |
static /* Use -fall-defs-global to expose */ |
| 626 |
asn_TYPE_descriptor_t asn_DEF_another_name_8 = { |
| 627 |
"another-name", |
| 628 |
"another-name", |
| 629 |
SEQUENCE_free, |
| 630 |
SEQUENCE_print, |
| 631 |
SEQUENCE_constraint, |
| 632 |
SEQUENCE_decode_ber, |
| 633 |
SEQUENCE_encode_der, |
| 634 |
SEQUENCE_decode_xer, |
| 635 |
SEQUENCE_encode_xer, |
| 636 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 637 |
0, /* Use generic outmost tag fetcher */ |
| 638 |
asn_DEF_another_name_tags_8, |
| 639 |
sizeof(asn_DEF_another_name_tags_8) |
| 640 |
/sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */ |
| 641 |
asn_DEF_another_name_tags_8, /* Same as above */ |
| 642 |
sizeof(asn_DEF_another_name_tags_8) |
| 643 |
/sizeof(asn_DEF_another_name_tags_8[0]), /* 1 */ |
| 644 |
0, /* No PER visible constraints */ |
| 645 |
asn_MBR_another_name_8, |
| 646 |
2, /* Elements count */ |
| 647 |
&asn_SPC_another_name_specs_8 /* Additional specs */ |
| 648 |
}; |
| 649 |
|
| 650 |
static asn_TYPE_member_t asn_MBR_two_name_7[] = { |
| 651 |
{ ATF_NOFLAGS, 0, offsetof(struct two_name, another_name), |
| 652 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 653 |
.tag_mode = 0, |
| 654 |
.type = &asn_DEF_another_name_8, |
| 655 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 656 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 657 |
.default_value = 0, |
| 658 |
.name = "another-name" |
| 659 |
}, |
| 660 |
}; |
| 661 |
static const ber_tlv_tag_t asn_DEF_two_name_tags_7[] = { |
| 662 |
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 663 |
}; |
| 664 |
static const asn_TYPE_tag2member_t asn_MAP_two_name_tag2el_7[] = { |
| 665 |
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 } /* another-name */ |
| 666 |
}; |
| 667 |
static const uint8_t asn_MAP_two_name_mmap_7[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = { |
| 668 |
(1 << 7) |
| 669 |
}; |
| 670 |
static asn_SET_specifics_t asn_SPC_two_name_specs_7 = { |
| 671 |
sizeof(struct two_name), |
| 672 |
offsetof(struct two_name, _asn_ctx), |
| 673 |
offsetof(struct two_name, _presence_map), |
| 674 |
asn_MAP_two_name_tag2el_7, |
| 675 |
1, /* Count of tags in the map */ |
| 676 |
asn_MAP_two_name_tag2el_7, /* Same as above */ |
| 677 |
1, /* Count of tags in the CXER map */ |
| 678 |
0, /* Whether extensible */ |
| 679 |
(unsigned int *)asn_MAP_two_name_mmap_7 /* Mandatory elements map */ |
| 680 |
}; |
| 681 |
static /* Use -fall-defs-global to expose */ |
| 682 |
asn_TYPE_descriptor_t asn_DEF_two_name_7 = { |
| 683 |
"two-name", |
| 684 |
"two-name", |
| 685 |
SET_free, |
| 686 |
SET_print, |
| 687 |
SET_constraint, |
| 688 |
SET_decode_ber, |
| 689 |
SET_encode_der, |
| 690 |
SET_decode_xer, |
| 691 |
SET_encode_xer, |
| 692 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 693 |
0, /* Use generic outmost tag fetcher */ |
| 694 |
asn_DEF_two_name_tags_7, |
| 695 |
sizeof(asn_DEF_two_name_tags_7) |
| 696 |
/sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */ |
| 697 |
asn_DEF_two_name_tags_7, /* Same as above */ |
| 698 |
sizeof(asn_DEF_two_name_tags_7) |
| 699 |
/sizeof(asn_DEF_two_name_tags_7[0]), /* 1 */ |
| 700 |
0, /* No PER visible constraints */ |
| 701 |
asn_MBR_two_name_7, |
| 702 |
1, /* Elements count */ |
| 703 |
&asn_SPC_two_name_specs_7 /* Additional specs */ |
| 704 |
}; |
| 705 |
|
| 706 |
static asn_TYPE_member_t asn_MBR_Type2_1[] = { |
| 707 |
{ ATF_NOFLAGS, 0, offsetof(struct Type2, choice.one_name), |
| 708 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 709 |
.tag_mode = 0, |
| 710 |
.type = &asn_DEF_one_name_2, |
| 711 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 712 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 713 |
.default_value = 0, |
| 714 |
.name = "one-name" |
| 715 |
}, |
| 716 |
{ ATF_NOFLAGS, 0, offsetof(struct Type2, choice.two_name), |
| 717 |
.tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 718 |
.tag_mode = 0, |
| 719 |
.type = &asn_DEF_two_name_7, |
| 720 |
.memb_constraints = 0, /* Defer constraints checking to the member type */ |
| 721 |
.per_constraints = 0, /* PER is not compiled, use -gen-PER */ |
| 722 |
.default_value = 0, |
| 723 |
.name = "two-name" |
| 724 |
}, |
| 725 |
}; |
| 726 |
static const asn_TYPE_tag2member_t asn_MAP_Type2_tag2el_1[] = { |
| 727 |
{ (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* one-name */ |
| 728 |
{ (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 } /* two-name */ |
| 729 |
}; |
| 730 |
static asn_CHOICE_specifics_t asn_SPC_Type2_specs_1 = { |
| 731 |
sizeof(struct Type2), |
| 732 |
offsetof(struct Type2, _asn_ctx), |
| 733 |
offsetof(struct Type2, present), |
| 734 |
sizeof(((struct Type2 *)0)->present), |
| 735 |
asn_MAP_Type2_tag2el_1, |
| 736 |
2, /* Count of tags in the map */ |
| 737 |
.canonical_order = 0, |
| 738 |
.ext_start = -1 /* Extensions start */ |
| 739 |
}; |
| 740 |
asn_TYPE_descriptor_t asn_DEF_Type2 = { |
| 741 |
"Type2", |
| 742 |
"Type2", |
| 743 |
CHOICE_free, |
| 744 |
CHOICE_print, |
| 745 |
CHOICE_constraint, |
| 746 |
CHOICE_decode_ber, |
| 747 |
CHOICE_encode_der, |
| 748 |
CHOICE_decode_xer, |
| 749 |
CHOICE_encode_xer, |
| 750 |
0, 0, /* No PER support, use "-gen-PER" to enable */ |
| 751 |
CHOICE_outmost_tag, |
| 752 |
0, /* No effective tags (pointer) */ |
| 753 |
0, /* No effective tags (count) */ |
| 754 |
0, /* No tags (pointer) */ |
| 755 |
0, /* No tags (count) */ |
| 756 |
0, /* No PER visible constraints */ |
| 757 |
asn_MBR_Type2_1, |
| 758 |
2, /* Elements count */ |
| 759 |
&asn_SPC_Type2_specs_1 /* Additional specs */ |
| 760 |
}; |
| 761 |
|