blob: ad70a9afae1d7d7f39d70709b1feb3b841db3c26 [file] [log] [blame]
Lev Walkin6ec10322006-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,
Lev Walkin1eded352006-07-13 11:19:01 +000026 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
Lev Walkin6ec10322006-03-14 11:48:01 +000027
28 if(!sptr) {
Lev Walkin7c1dc052016-03-14 03:08:15 -070029 ASN__CTFAIL(app_key, td, sptr,
Lev Walkin6ec10322006-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
Lev Walkin1eded352006-07-13 11:19:01 +000040 return td->check_constraints(td, sptr, ctfailcb, app_key);
Lev Walkin6ec10322006-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,
Lev Walkinb33425f2017-07-14 14:59:52 +040052 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin6ec10322006-03-14 11:48:01 +000053 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
54 .default_value = 0,
55 .name = "identifier"
56 },
57 { ATF_NOFLAGS, 0, offsetof(struct Attribute, siAttributeValue),
58 .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)),
59 .tag_mode = 0,
60 .type = &asn_DEF_IA5String,
61 .memb_constraints = 0, /* Defer constraints checking to the member type */
Lev Walkinb33425f2017-07-14 14:59:52 +040062 .oer_constraints = 0, /* OER is not compiled, use -gen-OER */
Lev Walkin6ec10322006-03-14 11:48:01 +000063 .per_constraints = 0, /* PER is not compiled, use -gen-PER */
64 .default_value = 0,
65 .name = "siAttributeValue"
66 },
67};
Lev Walkina7591b52014-10-12 18:37:35 -070068static const ber_tlv_tag_t asn_DEF_Attribute_tags_1[] = {
Lev Walkin6ec10322006-03-14 11:48:01 +000069 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
70};
Lev Walkina7591b52014-10-12 18:37:35 -070071static const asn_TYPE_tag2member_t asn_MAP_Attribute_tag2el_1[] = {
Lev Walkin4062b012013-10-11 14:29:38 -070072 { (ASN_TAG_CLASS_UNIVERSAL | (13 << 2)), 0, 0, 0 }, /* identifier */
73 { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 1, 0, 0 } /* siAttributeValue */
Lev Walkin6ec10322006-03-14 11:48:01 +000074};
75static asn_SEQUENCE_specifics_t asn_SPC_Attribute_specs_1 = {
76 sizeof(struct Attribute),
77 offsetof(struct Attribute, _asn_ctx),
78 asn_MAP_Attribute_tag2el_1,
79 2, /* Count of tags in the map */
80 0, 0, 0, /* Optional elements (not needed) */
81 -1, /* Start extensions */
82 -1 /* Stop extensions */
83};
84asn_TYPE_descriptor_t asn_DEF_Attribute = {
85 "Attribute",
86 "Attribute",
87 SEQUENCE_free,
88 SEQUENCE_print,
89 SEQUENCE_constraint,
90 SEQUENCE_decode_ber,
91 SEQUENCE_encode_der,
92 SEQUENCE_decode_xer,
93 SEQUENCE_encode_xer,
Lev Walkinba68c912017-07-06 07:52:39 -070094 0, 0, /* No OER support, use "-gen-OER" to enable */
Lev Walkinb33425f2017-07-14 14:59:52 +040095 0, 0, /* No PER support, use "-gen-PER" to enable */
Lev Walkin6ec10322006-03-14 11:48:01 +000096 0, /* Use generic outmost tag fetcher */
97 asn_DEF_Attribute_tags_1,
98 sizeof(asn_DEF_Attribute_tags_1)
99 /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
100 asn_DEF_Attribute_tags_1, /* Same as above */
101 sizeof(asn_DEF_Attribute_tags_1)
102 /sizeof(asn_DEF_Attribute_tags_1[0]), /* 1 */
Lev Walkinb33425f2017-07-14 14:59:52 +0400103 0, /* No OER visible constraints */
Lev Walkin6ec10322006-03-14 11:48:01 +0000104 0, /* No PER visible constraints */
105 asn_MBR_Attribute_1,
106 2, /* Elements count */
107 &asn_SPC_Attribute_specs_1 /* Additional specs */
108};
109