Vanetza
Loading...
Searching...
No Matches
ContributedExtensionBlock.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
9
10static const long asn_VAL_1_Vanetza_Security_ieee1609HeaderInfoContributorId = 1;
11static const long asn_VAL_2_Vanetza_Security_etsiHeaderInfoContributorId = 2;
12static const asn_ioc_cell_t asn_IOS_Vanetza_Security_Ieee1609Dot2HeaderInfoContributedExtensions_1_rows[] = {
13 { "&id", aioc__value, &asn_DEF_Vanetza_Security_HeaderInfoContributorId, &asn_VAL_1_Vanetza_Security_ieee1609HeaderInfoContributorId },
14 { "&Extn", aioc__type, &asn_DEF_Vanetza_Security_Ieee1609ContributedHeaderInfoExtension },
15 { "&id", aioc__value, &asn_DEF_Vanetza_Security_HeaderInfoContributorId, &asn_VAL_2_Vanetza_Security_etsiHeaderInfoContributorId },
16 { "&Extn", aioc__type, &asn_DEF_Vanetza_Security_EtsiOriginatingHeaderInfoExtension }
17};
18static const asn_ioc_set_t asn_IOS_Vanetza_Security_Ieee1609Dot2HeaderInfoContributedExtensions_1[] = {
19 { 2, 2, asn_IOS_Vanetza_Security_Ieee1609Dot2HeaderInfoContributedExtensions_1_rows }
20};
21static int
22memb_ANY_constraint_3(const asn_TYPE_descriptor_t *td, const void *sptr,
23 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
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
33 if(1 /* No applicable constraints whatsoever */) {
34 /* Nothing is here. See below */
35 }
36
37 return td->encoding_constraints.general_constraints(td, sptr, ctfailcb, app_key);
38}
39
40static int
41memb_Vanetza_Security_contributorId_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
42 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
43 long value;
44
45 if(!sptr) {
46 ASN__CTFAIL(app_key, td, sptr,
47 "%s: value not given (%s:%d)",
48 td->name, __FILE__, __LINE__);
49 return -1;
50 }
51
52 value = *(const long *)sptr;
53
54 if((value >= 0L && value <= 255L)) {
55 /* Constraint check succeeded */
56 return 0;
57 } else {
58 ASN__CTFAIL(app_key, td, sptr,
59 "%s: constraint failed (%s:%d)",
60 td->name, __FILE__, __LINE__);
61 return -1;
62 }
63}
64
65static int
66memb_Vanetza_Security_extns_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr,
67 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
68 size_t size;
69
70 if(!sptr) {
71 ASN__CTFAIL(app_key, td, sptr,
72 "%s: value not given (%s:%d)",
73 td->name, __FILE__, __LINE__);
74 return -1;
75 }
76
77 /* Determine the number of elements */
78 size = _A_CSEQUENCE_FROM_VOID(sptr)->count;
79
80 if((size >= 1UL)) {
81 /* Perform validation of the inner elements */
82 return SEQUENCE_OF_constraint(td, sptr, ctfailcb, app_key);
83 } else {
84 ASN__CTFAIL(app_key, td, sptr,
85 "%s: constraint failed (%s:%d)",
86 td->name, __FILE__, __LINE__);
87 return -1;
88 }
89}
90
91#if !defined(ASN_DISABLE_OER_SUPPORT)
92static asn_oer_constraints_t asn_OER_memb_Vanetza_Security_Member_constr_4 CC_NOTUSED = {
93 { 0, 0 },
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_Member_constr_4 CC_NOTUSED = {
98 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
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_type_Vanetza_Security_extns_constr_3 CC_NOTUSED = {
105 { 0, 0 },
106 -1 /* (SIZE(1..MAX)) */};
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_type_Vanetza_Security_extns_constr_3 CC_NOTUSED = {
110 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
111 { APC_SEMI_CONSTRAINED, -1, -1, 1, 0 } /* (SIZE(1..MAX)) */,
112 0, 0 /* No PER value map */
113};
114#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
115#if !defined(ASN_DISABLE_OER_SUPPORT)
116static asn_oer_constraints_t asn_OER_memb_Vanetza_Security_contributorId_constr_2 CC_NOTUSED = {
117 { 1, 1 } /* (0..255) */,
118 -1};
119#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
120#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
121static asn_per_constraints_t asn_PER_memb_Vanetza_Security_contributorId_constr_2 CC_NOTUSED = {
122 { APC_CONSTRAINED, 8, 8, 0, 255 } /* (0..255) */,
123 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
124 0, 0 /* No PER value map */
125};
126#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
127#if !defined(ASN_DISABLE_OER_SUPPORT)
128static asn_oer_constraints_t asn_OER_memb_Vanetza_Security_extns_constr_3 CC_NOTUSED = {
129 { 0, 0 },
130 -1 /* (SIZE(1..MAX)) */};
131#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
132#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
133static asn_per_constraints_t asn_PER_memb_Vanetza_Security_extns_constr_3 CC_NOTUSED = {
134 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
135 { APC_SEMI_CONSTRAINED, -1, -1, 1, 0 } /* (SIZE(1..MAX)) */,
136 0, 0 /* No PER value map */
137};
138#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
139static asn_TYPE_member_t asn_MBR_Vanetza_Security_extns_3[] = {
140 { ATF_ANY_TYPE | ATF_POINTER, 0, 0,
141 -1 /* Ambiguous tag (ANY?) */,
142 0,
143 &asn_DEF_ANY,
144 0,
145 {
146#if !defined(ASN_DISABLE_OER_SUPPORT)
147 &asn_OER_memb_Vanetza_Security_Member_constr_4,
148#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
149#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
150 &asn_PER_memb_Vanetza_Security_Member_constr_4,
151#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
152#if !defined(ASN_DISABLE_JER_SUPPORT)
153 0,
154#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
155 memb_ANY_constraint_3
156 },
157 0, 0, /* No default value */
158 ""
159 },
160};
161static const ber_tlv_tag_t asn_DEF_Vanetza_Security_extns_tags_3[] = {
162 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
163 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
164};
165static asn_SET_OF_specifics_t asn_SPC_Vanetza_Security_extns_specs_3 = {
166 sizeof(struct Vanetza_Security_ContributedExtensionBlock__extns),
167 offsetof(struct Vanetza_Security_ContributedExtensionBlock__extns, _asn_ctx),
168 0, /* XER encoding is XMLDelimitedItemList */
169};
170static /* Use -fall-defs-global to expose */
171asn_TYPE_descriptor_t asn_DEF_Vanetza_Security_extns_3 = {
172 "extns",
173 "extns",
174 &asn_OP_SEQUENCE_OF,
175 asn_DEF_Vanetza_Security_extns_tags_3,
176 sizeof(asn_DEF_Vanetza_Security_extns_tags_3)
177 /sizeof(asn_DEF_Vanetza_Security_extns_tags_3[0]) - 1, /* 1 */
178 asn_DEF_Vanetza_Security_extns_tags_3, /* Same as above */
179 sizeof(asn_DEF_Vanetza_Security_extns_tags_3)
180 /sizeof(asn_DEF_Vanetza_Security_extns_tags_3[0]), /* 2 */
181 {
182#if !defined(ASN_DISABLE_OER_SUPPORT)
183 &asn_OER_type_Vanetza_Security_extns_constr_3,
184#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
185#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
186 &asn_PER_type_Vanetza_Security_extns_constr_3,
187#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
188#if !defined(ASN_DISABLE_JER_SUPPORT)
189 0,
190#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
191 SEQUENCE_OF_constraint
192 },
193 asn_MBR_Vanetza_Security_extns_3,
194 1, /* Single element */
195 &asn_SPC_Vanetza_Security_extns_specs_3 /* Additional specs */
196};
197
198asn_TYPE_member_t asn_MBR_Vanetza_Security_ContributedExtensionBlock_1[] = {
199 { ATF_NOFLAGS, 0, offsetof(struct Vanetza_Security_ContributedExtensionBlock, contributorId),
200 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
201 -1, /* IMPLICIT tag at current level */
202 &asn_DEF_Vanetza_Security_HeaderInfoContributorId,
203 0,
204 {
205#if !defined(ASN_DISABLE_OER_SUPPORT)
206 &asn_OER_memb_Vanetza_Security_contributorId_constr_2,
207#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
208#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
209 &asn_PER_memb_Vanetza_Security_contributorId_constr_2,
210#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
211#if !defined(ASN_DISABLE_JER_SUPPORT)
212 0,
213#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
214 memb_Vanetza_Security_contributorId_constraint_1
215 },
216 0, 0, /* No default value */
217 "contributorId"
218 },
219 { ATF_NOFLAGS, 0, offsetof(struct Vanetza_Security_ContributedExtensionBlock, extns),
220 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
221 0,
222 &asn_DEF_Vanetza_Security_extns_3,
223 0,
224 {
225#if !defined(ASN_DISABLE_OER_SUPPORT)
226 &asn_OER_memb_Vanetza_Security_extns_constr_3,
227#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
228#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
229 &asn_PER_memb_Vanetza_Security_extns_constr_3,
230#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
231#if !defined(ASN_DISABLE_JER_SUPPORT)
232 0,
233#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
234 memb_Vanetza_Security_extns_constraint_1
235 },
236 0, 0, /* No default value */
237 "extns"
238 },
239};
240static const ber_tlv_tag_t asn_DEF_Vanetza_Security_ContributedExtensionBlock_tags_1[] = {
241 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
242};
243static const asn_TYPE_tag2member_t asn_MAP_Vanetza_Security_ContributedExtensionBlock_tag2el_1[] = {
244 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* contributorId */
245 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* extns */
246};
247asn_SEQUENCE_specifics_t asn_SPC_Vanetza_Security_ContributedExtensionBlock_specs_1 = {
248 sizeof(struct Vanetza_Security_ContributedExtensionBlock),
249 offsetof(struct Vanetza_Security_ContributedExtensionBlock, _asn_ctx),
250 asn_MAP_Vanetza_Security_ContributedExtensionBlock_tag2el_1,
251 2, /* Count of tags in the map */
252 0, 0, 0, /* Optional elements (not needed) */
253 -1, /* First extension addition */
254};
255asn_TYPE_descriptor_t asn_DEF_Vanetza_Security_ContributedExtensionBlock = {
256 "ContributedExtensionBlock",
257 "ContributedExtensionBlock",
258 &asn_OP_SEQUENCE,
259 asn_DEF_Vanetza_Security_ContributedExtensionBlock_tags_1,
260 sizeof(asn_DEF_Vanetza_Security_ContributedExtensionBlock_tags_1)
261 /sizeof(asn_DEF_Vanetza_Security_ContributedExtensionBlock_tags_1[0]), /* 1 */
262 asn_DEF_Vanetza_Security_ContributedExtensionBlock_tags_1, /* Same as above */
263 sizeof(asn_DEF_Vanetza_Security_ContributedExtensionBlock_tags_1)
264 /sizeof(asn_DEF_Vanetza_Security_ContributedExtensionBlock_tags_1[0]), /* 1 */
265 {
266#if !defined(ASN_DISABLE_OER_SUPPORT)
267 0,
268#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
269#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
270 0,
271#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
272#if !defined(ASN_DISABLE_JER_SUPPORT)
273 0,
274#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
275 SEQUENCE_constraint
276 },
277 asn_MBR_Vanetza_Security_ContributedExtensionBlock_1,
278 2, /* Elements count */
279 &asn_SPC_Vanetza_Security_ContributedExtensionBlock_specs_1 /* Additional specs */
280};