blob: 72c338032b6c947f216dc86cd4b75b16e0cc7620 [file] [log] [blame]
vlma6888042006-03-14 11:48:01 +00001
2/*** <<< INCLUDES [Attribute] >>> ***/
3
4#include <RELATIVE-OID.h>
5#include <IA5String.h>
6#include <constr_SEQUENCE.h>
7
8/*** <<< TYPE-DECLS [Attribute] >>> ***/
9
10typedef struct Attribute {
11 RELATIVE_OID_t identifier;
12 IA5String_t siAttributeValue;
13
14 /* Context for parsing across buffer boundaries */
15 asn_struct_ctx_t _asn_ctx;
16} Attribute_t;
17
18/*** <<< FUNC-DECLS [Attribute] >>> ***/
19
20extern asn_TYPE_descriptor_t asn_DEF_Attribute;
21
22/*** <<< CODE [Attribute] >>> ***/
23
24static int
25memb_identifier_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
vlmaf68ef52006-07-13 11:19:01 +000026 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
vlma6888042006-03-14 11:48:01 +000027
28 if(!sptr) {
vlmd4ae41c2006-07-13 13:28:32 +000029 _ASN_CTFAIL(app_key, td, sptr,
vlma6888042006-03-14 11:48:01 +000030 "%s: value not given (%s:%d)",
31 td->name, __FILE__, __LINE__);
32 return -1;
33 }
34
35
36 if(1 /* No applicable constraints whatsoever */) {
37 /* Nothing is here. See below */
38 }
39
vlmaf68ef52006-07-13 11:19:01 +000040 return td->check_constraints(td, sptr, ctfailcb, app_key);
vlma6888042006-03-14 11:48:01 +000041}
42
43
44/*** <<< STAT-DEFS [Attribute] >>> ***/
45
46static asn_TYPE_member_t asn_MBR_Attribute_1[] = {
47 { ATF_NOFLAGS, 0, offsetof(struct Attribute, identifier),
48 .tag = (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)),
49 .tag_mode = 0,
50 .type = &asn_DEF_RELATIVE_OID,
51 .memb_constraints = memb_identifier_constraint_1,
52 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
53 .default_value = 0,
54 .name = "identifier"
55 },
56 { ATF_NOFLAGS, 0, offsetof(struct Attribute, siAttributeValue),
57 .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
58 .tag_mode = 0,
59 .type = &asn_DEF_IA5String,
60 .memb_constraints = 0, /* Defer constraints checking to the member type */
61 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
62 .default_value = 0,
63 .name = "siAttributeValue"
64 },
65};
66static ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = {
67 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
68};
69static asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = {
70 { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 }, /* identifier at 19 */
71 { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 } /* siAttributeValue at 20 */
72};
73static asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = {
74 sizeof(struct Attribute),
75 offsetof(struct Attribute, _asn_ctx),
76 asn_MAP_Attribute_tag2el_1,
77 2, /* Count of tags in the map */
78 0, 0, 0, /* Optional elements (not needed) */
79 -1, /* Start extensions */
80 -1 /* Stop extensions */
81};
82asn_TYPE_descriptor_t asn_DEF_Attribute = {
83 "Attribute",
84 "Attribute",
85 SEQUENCE_free,
86 SEQUENCE_print,
87 SEQUENCE_constraint,
88 SEQUENCE_decode_ber,
89 SEQUENCE_encode_der,
90 SEQUENCE_decode_xer,
91 SEQUENCE_encode_xer,
vlmb1b193e2006-08-18 01:46:46 +000092 0, 0, /* No PER support, use "-gen-PER" to enable */
vlma6888042006-03-14 11:48:01 +000093 0, /* Use generic outmost tag fetcher */
94 asn_DEF_Attribute_tags_1,
95 sizeof(asn_DEF_Attribute_tags_1)
96 /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
97 asn_DEF_Attribute_tags_1, /* Same as above */
98 sizeof(asn_DEF_Attribute_tags_1)
99 /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
100 0, /* No PER visible constraints */
101 asn_MBR_Attribute_1,
102 2, /* Elements count */
103 &asn_SPC_Attribute_specs_1 /* Additional specs */
104};
105