Vanetza
 
Loading...
Searching...
No Matches
CertificateId.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 "CertificateId.h"
9
10static int
11memb_binaryId_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr;
14 size_t size;
15
16 if(!sptr) {
17 ASN__CTFAIL(app_key, td, sptr,
18 "%s: value not given (%s:%d)",
19 td->name, __FILE__, __LINE__);
20 return -1;
21 }
22
23 size = st->size;
24
25 if((size >= 1UL && size <= 64UL)) {
26 /* Constraint check succeeded */
27 return 0;
28 } else {
29 ASN__CTFAIL(app_key, td, sptr,
30 "%s: constraint failed (%s:%d)",
31 td->name, __FILE__, __LINE__);
32 return -1;
33 }
34}
35
36#if !defined(ASN_DISABLE_OER_SUPPORT)
37static asn_oer_constraints_t asn_OER_memb_binaryId_constr_4 CC_NOTUSED = {
38 { 0, 0 },
39 -1 /* (SIZE(1..64)) */};
40#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
41#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
42static asn_per_constraints_t asn_PER_memb_binaryId_constr_4 CC_NOTUSED = {
43 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
44 { APC_CONSTRAINED, 6, 6, 1, 64 } /* (SIZE(1..64)) */,
45 0, 0 /* No PER value map */
46};
47#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
48#if !defined(ASN_DISABLE_OER_SUPPORT)
49static asn_oer_constraints_t asn_OER_type_CertificateId_constr_1 CC_NOTUSED = {
50 { 0, 0 },
51 -1};
52#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
53#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
54asn_per_constraints_t asn_PER_type_CertificateId_constr_1 CC_NOTUSED = {
55 { APC_CONSTRAINED | APC_EXTENSIBLE, 2, 2, 0, 3 } /* (0..3,...) */,
56 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
57 0, 0 /* No PER value map */
58};
59#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
60asn_TYPE_member_t asn_MBR_CertificateId_1[] = {
61 { ATF_NOFLAGS, 0, offsetof(struct CertificateId, choice.linkageData),
62 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
63 -1, /* IMPLICIT tag at current level */
64 &asn_DEF_LinkageData,
65 0,
66 {
67#if !defined(ASN_DISABLE_OER_SUPPORT)
68 0,
69#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
70#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
71 0,
72#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
73 0
74 },
75 0, 0, /* No default value */
76 "linkageData"
77 },
78 { ATF_NOFLAGS, 0, offsetof(struct CertificateId, choice.name),
79 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
80 -1, /* IMPLICIT tag at current level */
81 &asn_DEF_Hostname,
82 0,
83 {
84#if !defined(ASN_DISABLE_OER_SUPPORT)
85 0,
86#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
87#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
88 0,
89#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
90 0
91 },
92 0, 0, /* No default value */
93 "name"
94 },
95 { ATF_NOFLAGS, 0, offsetof(struct CertificateId, choice.binaryId),
96 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
97 -1, /* IMPLICIT tag at current level */
98 &asn_DEF_OCTET_STRING,
99 0,
100 {
101#if !defined(ASN_DISABLE_OER_SUPPORT)
102 &asn_OER_memb_binaryId_constr_4,
103#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
104#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
105 &asn_PER_memb_binaryId_constr_4,
106#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
107 memb_binaryId_constraint_1
108 },
109 0, 0, /* No default value */
110 "binaryId"
111 },
112 { ATF_NOFLAGS, 0, offsetof(struct CertificateId, choice.none),
113 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
114 -1, /* IMPLICIT tag at current level */
115 &asn_DEF_NULL,
116 0,
117 {
118#if !defined(ASN_DISABLE_OER_SUPPORT)
119 0,
120#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
121#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
122 0,
123#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
124 0
125 },
126 0, 0, /* No default value */
127 "none"
128 },
129};
130static const asn_TYPE_tag2member_t asn_MAP_CertificateId_tag2el_1[] = {
131 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* linkageData */
132 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* name */
133 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* binaryId */
134 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* none */
135};
136asn_CHOICE_specifics_t asn_SPC_CertificateId_specs_1 = {
137 sizeof(struct CertificateId),
138 offsetof(struct CertificateId, _asn_ctx),
139 offsetof(struct CertificateId, present),
140 sizeof(((struct CertificateId *)0)->present),
141 asn_MAP_CertificateId_tag2el_1,
142 4, /* Count of tags in the map */
143 0, 0,
144 4 /* Extensions start */
145};
146asn_TYPE_descriptor_t asn_DEF_CertificateId = {
147 "CertificateId",
148 "CertificateId",
149 &asn_OP_CHOICE,
150 0, /* No effective tags (pointer) */
151 0, /* No effective tags (count) */
152 0, /* No tags (pointer) */
153 0, /* No tags (count) */
154 {
155#if !defined(ASN_DISABLE_OER_SUPPORT)
156 &asn_OER_type_CertificateId_constr_1,
157#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
158#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
159 &asn_PER_type_CertificateId_constr_1,
160#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
161 CHOICE_constraint
162 },
163 asn_MBR_CertificateId_1,
164 4, /* Elements count */
165 &asn_SPC_CertificateId_specs_1 /* Additional specs */
166};
167