Vanetza
Loading...
Searching...
No Matches
AppExtension.c
1/*
2 * Generated by asn1c
3 * From ASN.1 module "Ieee1609Dot2"
4 * found in "Ieee1609Dot2.asn"
5 * `asn1c -fcompound-names -fincludes-quoted -no-gen-example -fprefix=Vanetza_Security_ -R`
6 */
7
8#include "AppExtension.h"
9
10static const long asn_VAL_2_Vanetza_Security_certExtId_OperatingOrganization = 1;
11static const asn_ioc_cell_t asn_IOS_Vanetza_Security_SetCertExtensions_1_rows[] = {
12 { "&id", aioc__value, &asn_DEF_Vanetza_Security_ExtId, &asn_VAL_2_Vanetza_Security_certExtId_OperatingOrganization },
13 { "&App", aioc__type, &asn_DEF_Vanetza_Security_OperatingOrganizationId },
14 { "&Issue", aioc__type, &asn_DEF_NULL },
15 { "&Req", aioc__type, &asn_DEF_NULL }
16};
17static const asn_ioc_set_t asn_IOS_Vanetza_Security_SetCertExtensions_1[] = {
18 { 1, 4, asn_IOS_Vanetza_Security_SetCertExtensions_1_rows }
19};
20static int
21memb_Vanetza_Security_id_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
22 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
23 long value;
24
25 if(!sptr) {
26 ASN__CTFAIL(app_key, td, sptr,
27 "%s: value not given (%s:%d)",
28 td->name, __FILE__, __LINE__);
29 return -1;
30 }
31
32 value = *(const long *)sptr;
33
34 if((value >= 0L && value <= 255L)) {
35 /* Constraint check succeeded */
36 return 0;
37 } else {
38 ASN__CTFAIL(app_key, td, sptr,
39 "%s: constraint failed (%s:%d)",
40 td->name, __FILE__, __LINE__);
41 return -1;
42 }
43}
44
45static asn_type_selector_result_t
46select_AppExtension_Vanetza_Security_content_type(const asn_TYPE_descriptor_t *parent_type, const void *parent_sptr) {
47 asn_type_selector_result_t result = {0, 0};
48 const asn_ioc_set_t *itable = asn_IOS_Vanetza_Security_SetCertExtensions_1;
49 size_t constraining_column = 0; /* &id */
50 size_t for_column = 1; /* &App */
51 size_t row, presence_index = 0;
52 const long *constraining_value = (const long *)((const char *)parent_sptr + offsetof(struct Vanetza_Security_AppExtension, id));
53
54 for(row=0; row < itable->rows_count; row++) {
55 const asn_ioc_cell_t *constraining_cell = &itable->rows[row * itable->columns_count + constraining_column];
56 const asn_ioc_cell_t *type_cell = &itable->rows[row * itable->columns_count + for_column];
57
58 if(type_cell->cell_kind == aioc__undefined)
59 continue;
60
61 presence_index++;
62 if(constraining_cell->type_descriptor->op->compare_struct(constraining_cell->type_descriptor, constraining_value, constraining_cell->value_sptr) == 0) {
63 result.type_descriptor = type_cell->type_descriptor;
64 result.presence_index = presence_index;
65 break;
66 }
67 }
68
69 return result;
70}
71
72static int
73memb_Vanetza_Security_content_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
74 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
75
76 if(!sptr) {
77 ASN__CTFAIL(app_key, td, sptr,
78 "%s: value not given (%s:%d)",
79 td->name, __FILE__, __LINE__);
80 return -1;
81 }
82
83
84 if(1 /* No applicable constraints whatsoever */) {
85 /* Nothing is here. See below */
86 }
87
88 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
89}
90
91#if !defined(ASN_DISABLE_OER_SUPPORT)
92static asn_oer_constraints_t asn_OER_memb_Vanetza_Security_id_constr_2 CC_NOTUSED = {
93 { 1, 1 } /* (0..255) */,
94 -1};
95#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
96#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
97static asn_per_constraints_t asn_PER_memb_Vanetza_Security_id_constr_2 CC_NOTUSED = {
98 { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */,
99 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
100 0, 0 /* No PER value map */
101};
102#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
103#if !defined(ASN_DISABLE_OER_SUPPORT)
104static asn_oer_constraints_t asn_OER_memb_Vanetza_Security_content_constr_3 CC_NOTUSED = {
105 { 0, 0 },
106 -1};
107#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
108#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
109static asn_per_constraints_t asn_PER_memb_Vanetza_Security_content_constr_3 CC_NOTUSED = {
110 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
111 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
112 0, 0 /* No PER value map */
113};
114#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
115static asn_TYPE_member_t asn_MBR_Vanetza_Security_content_3[] = {
116 { ATF_NOFLAGS, 0, offsetof(struct Vanetza_Security_AppExtension__content, choice.OperatingOrganizationId),
117 (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)),
118 0,
119 &asn_DEF_Vanetza_Security_OperatingOrganizationId,
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#if !defined(ASN_DISABLE_JER_SUPPORT)
129 0,
130#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
131 0
132 },
133 0, 0, /* No default value */
134 "OperatingOrganizationId"
135 },
136};
137static const asn_TYPE_tag2member_t asn_MAP_Vanetza_Security_content_tag2el_3[] = {
138 { (ASN_TAG_CLASS_UNIVERSAL | (6 << 2)), 0, 0, 0 } /* OperatingOrganizationId */
139};
140static asn_CHOICE_specifics_t asn_SPC_Vanetza_Security_content_specs_3 = {
141 sizeof(struct Vanetza_Security_AppExtension__content),
142 offsetof(struct Vanetza_Security_AppExtension__content, _asn_ctx),
143 offsetof(struct Vanetza_Security_AppExtension__content, present),
144 sizeof(((struct Vanetza_Security_AppExtension__content *)0)->present),
145 asn_MAP_Vanetza_Security_content_tag2el_3,
146 1, /* Count of tags in the map */
147 0, 0,
148 -1 /* Extensions start */
149};
150static /* Use -fall-defs-global to expose */
151asn_TYPE_descriptor_t asn_DEF_Vanetza_Security_content_3 = {
152 "content",
153 "content",
154 &asn_OP_OPEN_TYPE,
155 0, /* No effective tags (pointer) */
156 0, /* No effective tags (count) */
157 0, /* No tags (pointer) */
158 0, /* No tags (count) */
159 {
160#if !defined(ASN_DISABLE_OER_SUPPORT)
161 0,
162#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
163#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
164 0,
165#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
166#if !defined(ASN_DISABLE_JER_SUPPORT)
167 0,
168#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
169 OPEN_TYPE_constraint
170 },
171 asn_MBR_Vanetza_Security_content_3,
172 1, /* Elements count */
173 &asn_SPC_Vanetza_Security_content_specs_3 /* Additional specs */
174};
175
176asn_TYPE_member_t asn_MBR_Vanetza_Security_AppExtension_1[] = {
177 { ATF_NOFLAGS, 0, offsetof(struct Vanetza_Security_AppExtension, id),
178 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
179 -1, /* IMPLICIT tag at current level */
180 &asn_DEF_Vanetza_Security_ExtId,
181 0,
182 {
183#if !defined(ASN_DISABLE_OER_SUPPORT)
184 &asn_OER_memb_Vanetza_Security_id_constr_2,
185#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
186#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
187 &asn_PER_memb_Vanetza_Security_id_constr_2,
188#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
189#if !defined(ASN_DISABLE_JER_SUPPORT)
190 0,
191#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
192 memb_Vanetza_Security_id_constraint_1
193 },
194 0, 0, /* No default value */
195 "id"
196 },
197 { ATF_OPEN_TYPE | ATF_NOFLAGS, 0, offsetof(struct Vanetza_Security_AppExtension, content),
198 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
199 +1, /* EXPLICIT tag at current level */
200 &asn_DEF_Vanetza_Security_content_3,
201 select_AppExtension_Vanetza_Security_content_type,
202 {
203#if !defined(ASN_DISABLE_OER_SUPPORT)
204 &asn_OER_memb_Vanetza_Security_content_constr_3,
205#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
206#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
207 &asn_PER_memb_Vanetza_Security_content_constr_3,
208#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
209#if !defined(ASN_DISABLE_JER_SUPPORT)
210 0,
211#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
212 memb_Vanetza_Security_content_constraint_1
213 },
214 0, 0, /* No default value */
215 "content"
216 },
217};
218static const ber_tlv_tag_t asn_DEF_Vanetza_Security_AppExtension_tags_1[] = {
219 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
220};
221static const asn_TYPE_tag2member_t asn_MAP_Vanetza_Security_AppExtension_tag2el_1[] = {
222 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* id */
223 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* content */
224};
225asn_SEQUENCE_specifics_t asn_SPC_Vanetza_Security_AppExtension_specs_1 = {
226 sizeof(struct Vanetza_Security_AppExtension),
227 offsetof(struct Vanetza_Security_AppExtension, _asn_ctx),
228 asn_MAP_Vanetza_Security_AppExtension_tag2el_1,
229 2, /* Count of tags in the map */
230 0, 0, 0, /* Optional elements (not needed) */
231 -1, /* First extension addition */
232};
233asn_TYPE_descriptor_t asn_DEF_Vanetza_Security_AppExtension = {
234 "AppExtension",
235 "AppExtension",
236 &asn_OP_SEQUENCE,
237 asn_DEF_Vanetza_Security_AppExtension_tags_1,
238 sizeof(asn_DEF_Vanetza_Security_AppExtension_tags_1)
239 /sizeof(asn_DEF_Vanetza_Security_AppExtension_tags_1[0]), /* 1 */
240 asn_DEF_Vanetza_Security_AppExtension_tags_1, /* Same as above */
241 sizeof(asn_DEF_Vanetza_Security_AppExtension_tags_1)
242 /sizeof(asn_DEF_Vanetza_Security_AppExtension_tags_1[0]), /* 1 */
243 {
244#if !defined(ASN_DISABLE_OER_SUPPORT)
245 0,
246#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
247#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
248 0,
249#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
250#if !defined(ASN_DISABLE_JER_SUPPORT)
251 0,
252#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
253 SEQUENCE_constraint
254 },
255 asn_MBR_Vanetza_Security_AppExtension_1,
256 2, /* Elements count */
257 &asn_SPC_Vanetza_Security_AppExtension_specs_1 /* Additional specs */
258};