Vanetza
 
Loading...
Searching...
No Matches
CertificateBase.c
1/*
2 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3 * From ASN.1 module "IEEE1609dot2"
4 * found in "asn1/IEEE1609dot2.asn"
5 * `asn1c -fcompound-names -fincludes-quoted -no-gen-example -R`
6 */
7
8#include "CertificateBase.h"
9
10static int
11memb_version_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 long value;
14
15 if(!sptr) {
16 ASN__CTFAIL(app_key, td, sptr,
17 "%s: value not given (%s:%d)",
18 td->name, __FILE__, __LINE__);
19 return -1;
20 }
21
22 value = *(const long *)sptr;
23
24 if((value == 3L)) {
25 /* Constraint check succeeded */
26 return 0;
27 } else {
28 ASN__CTFAIL(app_key, td, sptr,
29 "%s: constraint failed (%s:%d)",
30 td->name, __FILE__, __LINE__);
31 return -1;
32 }
33}
34
35#if !defined(ASN_DISABLE_OER_SUPPORT)
36static asn_oer_constraints_t asn_OER_memb_version_constr_2 CC_NOTUSED = {
37 { 1, 1 } /* (3..3) */,
38 -1};
39#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
40#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
41static asn_per_constraints_t asn_PER_memb_version_constr_2 CC_NOTUSED = {
42 { APC_CONSTRAINED, 0, 0, 3, 3 } /* (3..3) */,
43 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
44 0, 0 /* No PER value map */
45};
46#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
47asn_TYPE_member_t asn_MBR_CertificateBase_1[] = {
48 { ATF_NOFLAGS, 0, offsetof(struct CertificateBase, version),
49 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
50 -1, /* IMPLICIT tag at current level */
51 &asn_DEF_Uint8,
52 0,
53 {
54#if !defined(ASN_DISABLE_OER_SUPPORT)
55 &asn_OER_memb_version_constr_2,
56#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
57#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
58 &asn_PER_memb_version_constr_2,
59#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
60 memb_version_constraint_1
61 },
62 0, 0, /* No default value */
63 "version"
64 },
65 { ATF_NOFLAGS, 0, offsetof(struct CertificateBase, type),
66 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
67 -1, /* IMPLICIT tag at current level */
68 &asn_DEF_CertificateType,
69 0,
70 {
71#if !defined(ASN_DISABLE_OER_SUPPORT)
72 0,
73#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
74#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
75 0,
76#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
77 0
78 },
79 0, 0, /* No default value */
80 "type"
81 },
82 { ATF_NOFLAGS, 0, offsetof(struct CertificateBase, issuer),
83 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
84 +1, /* EXPLICIT tag at current level */
85 &asn_DEF_IssuerIdentifier,
86 0,
87 {
88#if !defined(ASN_DISABLE_OER_SUPPORT)
89 0,
90#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
91#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
92 0,
93#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
94 0
95 },
96 0, 0, /* No default value */
97 "issuer"
98 },
99 { ATF_NOFLAGS, 0, offsetof(struct CertificateBase, toBeSigned),
100 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
101 -1, /* IMPLICIT tag at current level */
102 &asn_DEF_ToBeSignedCertificate,
103 0,
104 {
105#if !defined(ASN_DISABLE_OER_SUPPORT)
106 0,
107#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
108#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
109 0,
110#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
111 0
112 },
113 0, 0, /* No default value */
114 "toBeSigned"
115 },
116 { ATF_POINTER, 1, offsetof(struct CertificateBase, signature),
117 (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
118 +1, /* EXPLICIT tag at current level */
119 &asn_DEF_Signature,
120 0,
121 {
122#if !defined(ASN_DISABLE_OER_SUPPORT)
123 0,
124#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
125#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
126 0,
127#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
128 0
129 },
130 0, 0, /* No default value */
131 "signature"
132 },
133};
134static const int asn_MAP_CertificateBase_oms_1[] = { 4 };
135static const ber_tlv_tag_t asn_DEF_CertificateBase_tags_1[] = {
136 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
137};
138static const asn_TYPE_tag2member_t asn_MAP_CertificateBase_tag2el_1[] = {
139 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version */
140 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* type */
141 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* issuer */
142 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* toBeSigned */
143 { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* signature */
144};
145asn_SEQUENCE_specifics_t asn_SPC_CertificateBase_specs_1 = {
146 sizeof(struct CertificateBase),
147 offsetof(struct CertificateBase, _asn_ctx),
148 asn_MAP_CertificateBase_tag2el_1,
149 5, /* Count of tags in the map */
150 asn_MAP_CertificateBase_oms_1, /* Optional members */
151 1, 0, /* Root/Additions */
152 -1, /* First extension addition */
153};
154asn_TYPE_descriptor_t asn_DEF_CertificateBase = {
155 "CertificateBase",
156 "CertificateBase",
157 &asn_OP_SEQUENCE,
158 asn_DEF_CertificateBase_tags_1,
159 sizeof(asn_DEF_CertificateBase_tags_1)
160 /sizeof(asn_DEF_CertificateBase_tags_1[0]), /* 1 */
161 asn_DEF_CertificateBase_tags_1, /* Same as above */
162 sizeof(asn_DEF_CertificateBase_tags_1)
163 /sizeof(asn_DEF_CertificateBase_tags_1[0]), /* 1 */
164 {
165#if !defined(ASN_DISABLE_OER_SUPPORT)
166 0,
167#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
168#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
169 0,
170#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
171 SEQUENCE_constraint
172 },
173 asn_MBR_CertificateBase_1,
174 5, /* Elements count */
175 &asn_SPC_CertificateBase_specs_1 /* Additional specs */
176};
177