asn1c/tests/47-set-ext-OK.asn1.-P

309 lines
6.9 KiB
Plaintext

/*** <<< INCLUDES [T1] >>> ***/
#include <INTEGER.h>
#include <constr_SET.h>
/*** <<< DEPS [T1] >>> ***/
/*
* Method of determining the components presence
*/
typedef enum T1_PR {
T1_PR_i, /* Member i is present */
} T1_PR;
extern asn1_TYPE_descriptor_t asn1_DEF_T1;
/*** <<< TYPE-DECLS [T1] >>> ***/
typedef struct T1 {
INTEGER_t i;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Presence bitmask: ASN_SET_ISPRESENT(pT1, T1_PR_x) */
unsigned int _presence_map
[((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
/* Context for parsing across buffer boundaries */
ber_dec_ctx_t _ber_dec_ctx;
} T1_t;
/*** <<< STAT-DEFS [T1] >>> ***/
static asn1_TYPE_member_t asn1_MBR_T1[] = {
{ 0, offsetof(struct T1, i),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = (void *)&asn1_DEF_INTEGER,
.memb_constraints = 0, /* Defer to actual type */
.name = "i"
},
};
static ber_tlv_tag_t asn1_DEF_T1_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
};
static asn1_TYPE_tag2member_t asn1_DEF_T1_tag2el[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 14 */
};
static uint8_t asn1_DEF_T1_mmap[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
(1 << 7)
};
static asn1_SET_specifics_t asn1_DEF_T1_specs = {
sizeof(struct T1),
offsetof(struct T1, _ber_dec_ctx),
offsetof(struct T1, _presence_map),
asn1_DEF_T1_tag2el,
1, /* Count of tags in the map */
1, /* Whether extensible */
(unsigned int *)asn1_DEF_T1_mmap /* Mandatory elements map */
};
asn1_TYPE_descriptor_t asn1_DEF_T1 = {
"T1",
SET_constraint,
SET_decode_ber,
SET_encode_der,
SET_print,
SET_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T1_tags,
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
asn1_MBR_T1,
1, /* Elements count */
&asn1_DEF_T1_specs /* Additional specs */
};
/*** <<< INCLUDES [T2] >>> ***/
#include <INTEGER.h>
#include <constr_SET.h>
/*** <<< DEPS [T2] >>> ***/
/*
* Method of determining the components presence
*/
typedef enum T2_PR {
T2_PR_i, /* Member i is present */
} T2_PR;
extern asn1_TYPE_descriptor_t asn1_DEF_T2;
/*** <<< TYPE-DECLS [T2] >>> ***/
typedef struct T2 {
INTEGER_t i;
/*
* This type is extensible,
* possible extensions are below.
*/
/* Presence bitmask: ASN_SET_ISPRESENT(pT2, T2_PR_x) */
unsigned int _presence_map
[((1+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];
/* Context for parsing across buffer boundaries */
ber_dec_ctx_t _ber_dec_ctx;
} T2_t;
/*** <<< STAT-DEFS [T2] >>> ***/
static asn1_TYPE_member_t asn1_MBR_T2[] = {
{ 0, offsetof(struct T2, i),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = (void *)&asn1_DEF_INTEGER,
.memb_constraints = 0, /* Defer to actual type */
.name = "i"
},
};
static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
};
static asn1_TYPE_tag2member_t asn1_DEF_T2_tag2el[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 15 */
};
static uint8_t asn1_DEF_T2_mmap[(1 + (8 * sizeof(unsigned int)) - 1) / 8] = {
(1 << 7)
};
static asn1_SET_specifics_t asn1_DEF_T2_specs = {
sizeof(struct T2),
offsetof(struct T2, _ber_dec_ctx),
offsetof(struct T2, _presence_map),
asn1_DEF_T2_tag2el,
1, /* Count of tags in the map */
1, /* Whether extensible */
(unsigned int *)asn1_DEF_T2_mmap /* Mandatory elements map */
};
asn1_TYPE_descriptor_t asn1_DEF_T2 = {
"T2",
SET_constraint,
SET_decode_ber,
SET_encode_der,
SET_print,
SET_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
1, /* Tags to skip */
1, /* Whether CONSTRUCTED */
asn1_MBR_T2,
1, /* Elements count */
&asn1_DEF_T2_specs /* Additional specs */
};
/*** <<< INCLUDES [T3] >>> ***/
#include <INTEGER.h>
#include <constr_CHOICE.h>
/*** <<< DEPS [T3] >>> ***/
typedef enum T3_PR {
T3_PR_NOTHING, /* No components present */
T3_PR_i,
/* Extensions may appear below */
} T3_PR;
extern asn1_TYPE_descriptor_t asn1_DEF_T3;
/*** <<< TYPE-DECLS [T3] >>> ***/
typedef struct T3 {
T3_PR present;
union {
INTEGER_t i;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
ber_dec_ctx_t _ber_dec_ctx;
} T3_t;
/*** <<< STAT-DEFS [T3] >>> ***/
static asn1_TYPE_member_t asn1_MBR_T3[] = {
{ 0, offsetof(struct T3, choice.i),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = (void *)&asn1_DEF_INTEGER,
.memb_constraints = 0, /* Defer to actual type */
.name = "i"
},
};
static asn1_TYPE_tag2member_t asn1_DEF_T3_tag2el[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 16 */
};
static asn1_CHOICE_specifics_t asn1_DEF_T3_specs = {
sizeof(struct T3),
offsetof(struct T3, _ber_dec_ctx),
offsetof(struct T3, present),
sizeof(((struct T3 *)0)->present),
asn1_DEF_T3_tag2el,
1, /* Count of tags in the map */
1 /* Whether extensible */
};
asn1_TYPE_descriptor_t asn1_DEF_T3 = {
"T3",
CHOICE_constraint,
CHOICE_decode_ber,
CHOICE_encode_der,
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
asn1_MBR_T3,
1, /* Elements count */
&asn1_DEF_T3_specs /* Additional specs */
};
/*** <<< INCLUDES [T4] >>> ***/
#include <INTEGER.h>
#include <constr_CHOICE.h>
/*** <<< DEPS [T4] >>> ***/
typedef enum T4_PR {
T4_PR_NOTHING, /* No components present */
T4_PR_i,
/* Extensions may appear below */
} T4_PR;
extern asn1_TYPE_descriptor_t asn1_DEF_T4;
/*** <<< TYPE-DECLS [T4] >>> ***/
typedef struct T4 {
T4_PR present;
union {
INTEGER_t i;
/*
* This type is extensible,
* possible extensions are below.
*/
} choice;
/* Context for parsing across buffer boundaries */
ber_dec_ctx_t _ber_dec_ctx;
} T4_t;
/*** <<< STAT-DEFS [T4] >>> ***/
static asn1_TYPE_member_t asn1_MBR_T4[] = {
{ 0, offsetof(struct T4, choice.i),
.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),
.tag_mode = 0,
.type = (void *)&asn1_DEF_INTEGER,
.memb_constraints = 0, /* Defer to actual type */
.name = "i"
},
};
static asn1_TYPE_tag2member_t asn1_DEF_T4_tag2el[] = {
{ (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 0, 0, 0 }, /* i at 17 */
};
static asn1_CHOICE_specifics_t asn1_DEF_T4_specs = {
sizeof(struct T4),
offsetof(struct T4, _ber_dec_ctx),
offsetof(struct T4, present),
sizeof(((struct T4 *)0)->present),
asn1_DEF_T4_tag2el,
1, /* Count of tags in the map */
1 /* Whether extensible */
};
asn1_TYPE_descriptor_t asn1_DEF_T4 = {
"T4",
CHOICE_constraint,
CHOICE_decode_ber,
CHOICE_encode_der,
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* Tags to skip */
1, /* Whether CONSTRUCTED */
asn1_MBR_T4,
1, /* Elements count */
&asn1_DEF_T4_specs /* Additional specs */
};