denm_DangerousGoodsExtended.c
Go to the documentation of this file.
1 /*
2  * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3  * From ASN.1 module "ITS-Container"
4  * found in "/input/ITS-Container.asn"
5  * `asn1c -fcompound-names -fprefix=denm_ -no-gen-BER -no-gen-XER -no-gen-OER -no-gen-example -gen-UPER -gen-JER`
6  */
7 
9 
10 static int check_permitted_alphabet_7(const void *sptr) {
11  /* The underlying type is IA5String */
12  const IA5String_t *st = (const IA5String_t *)sptr;
13  const uint8_t *ch = st->buf;
14  const uint8_t *end = ch + st->size;
15 
16  for(; ch < end; ch++) {
17  uint8_t cv = *ch;
18  if(!(cv <= 127UL)) return -1;
19  }
20  return 0;
21 }
22 
23 static int
25  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
26  long value;
27 
28  if(!sptr) {
29  ASN__CTFAIL(app_key, td, sptr,
30  "%s: value not given (%s:%d)",
31  td->name, __FILE__, __LINE__);
32  return -1;
33  }
34 
35  value = *(const long *)sptr;
36 
37  if((value >= 0L && value <= 9999L)) {
38  /* Constraint check succeeded */
39  return 0;
40  } else {
41  ASN__CTFAIL(app_key, td, sptr,
42  "%s: constraint failed (%s:%d)",
43  td->name, __FILE__, __LINE__);
44  return -1;
45  }
46 }
47 
48 static int
50  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
51  const IA5String_t *st = (const IA5String_t *)sptr;
52  size_t size;
53 
54  if(!sptr) {
55  ASN__CTFAIL(app_key, td, sptr,
56  "%s: value not given (%s:%d)",
57  td->name, __FILE__, __LINE__);
58  return -1;
59  }
60 
61  size = st->size;
62 
63  if((size >= 1UL && size <= 24UL)
65  /* Constraint check succeeded */
66  return 0;
67  } else {
68  ASN__CTFAIL(app_key, td, sptr,
69  "%s: constraint failed (%s:%d)",
70  td->name, __FILE__, __LINE__);
71  return -1;
72  }
73 }
74 
75 static int
77  asn_app_constraint_failed_f *ctfailcb, void *app_key) {
78  const UTF8String_t *st = (const UTF8String_t *)sptr;
79  size_t size;
80 
81  if(!sptr) {
82  ASN__CTFAIL(app_key, td, sptr,
83  "%s: value not given (%s:%d)",
84  td->name, __FILE__, __LINE__);
85  return -1;
86  }
87 
88  size = UTF8String_length(st);
89  if((ssize_t)size < 0) {
90  ASN__CTFAIL(app_key, td, sptr,
91  "%s: UTF-8: broken encoding (%s:%d)",
92  td->name, __FILE__, __LINE__);
93  return -1;
94  }
95 
96  if((size >= 1UL && size <= 24UL)) {
97  /* Constraint check succeeded */
98  return 0;
99  } else {
100  ASN__CTFAIL(app_key, td, sptr,
101  "%s: constraint failed (%s:%d)",
102  td->name, __FILE__, __LINE__);
103  return -1;
104  }
105 }
106 
107 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
108 static asn_per_constraints_t asn_PER_memb_denm_unNumber_constr_3 CC_NOTUSED = {
109  { APC_CONSTRAINED, 14, 14, 0, 9999 } /* (0..9999) */,
110  { APC_UNCONSTRAINED, -1, -1, 0, 0 },
111  0, 0 /* No PER value map */
112 };
113 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
114 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
115 static asn_per_constraints_t asn_PER_memb_denm_emergencyActionCode_constr_7 CC_NOTUSED = {
116  { APC_CONSTRAINED, 7, 7, 0, 127 } /* (0..127) */,
117  { APC_CONSTRAINED, 5, 5, 1, 24 } /* (SIZE(1..24)) */,
118  0, 0 /* No PER character map necessary */
119 };
120 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
121 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
122 static asn_per_constraints_t asn_PER_memb_denm_companyName_constr_9 CC_NOTUSED = {
123  { APC_UNCONSTRAINED, -1, -1, 0, 0 },
124  { APC_UNCONSTRAINED, -1, -1, 0, 0 },
125  0, 0 /* No PER value map */
126 };
127 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
129  { ATF_NOFLAGS, 0, offsetof(struct denm_DangerousGoodsExtended, dangerousGoodsType),
130  (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
131  -1, /* IMPLICIT tag at current level */
133  0,
134  {
135 #if !defined(ASN_DISABLE_OER_SUPPORT)
136  0,
137 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
138 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
139  0,
140 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
141 #if !defined(ASN_DISABLE_JER_SUPPORT)
142  0,
143 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
144  0
145  },
146  0, 0, /* No default value */
147  "dangerousGoodsType"
148  },
149  { ATF_NOFLAGS, 0, offsetof(struct denm_DangerousGoodsExtended, unNumber),
150  (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
151  -1, /* IMPLICIT tag at current level */
153  0,
154  {
155 #if !defined(ASN_DISABLE_OER_SUPPORT)
156  0,
157 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
158 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
159  &asn_PER_memb_denm_unNumber_constr_3,
160 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
161 #if !defined(ASN_DISABLE_JER_SUPPORT)
162  0,
163 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
165  },
166  0, 0, /* No default value */
167  "unNumber"
168  },
169  { ATF_NOFLAGS, 0, offsetof(struct denm_DangerousGoodsExtended, elevatedTemperature),
170  (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
171  -1, /* IMPLICIT tag at current level */
173  0,
174  {
175 #if !defined(ASN_DISABLE_OER_SUPPORT)
176  0,
177 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
178 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
179  0,
180 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
181 #if !defined(ASN_DISABLE_JER_SUPPORT)
182  0,
183 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
184  0
185  },
186  0, 0, /* No default value */
187  "elevatedTemperature"
188  },
189  { ATF_NOFLAGS, 0, offsetof(struct denm_DangerousGoodsExtended, tunnelsRestricted),
190  (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
191  -1, /* IMPLICIT tag at current level */
193  0,
194  {
195 #if !defined(ASN_DISABLE_OER_SUPPORT)
196  0,
197 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
198 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
199  0,
200 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
201 #if !defined(ASN_DISABLE_JER_SUPPORT)
202  0,
203 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
204  0
205  },
206  0, 0, /* No default value */
207  "tunnelsRestricted"
208  },
209  { ATF_NOFLAGS, 0, offsetof(struct denm_DangerousGoodsExtended, limitedQuantity),
210  (ASN_TAG_CLASS_CONTEXT | (4 << 2)),
211  -1, /* IMPLICIT tag at current level */
213  0,
214  {
215 #if !defined(ASN_DISABLE_OER_SUPPORT)
216  0,
217 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
218 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
219  0,
220 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
221 #if !defined(ASN_DISABLE_JER_SUPPORT)
222  0,
223 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
224  0
225  },
226  0, 0, /* No default value */
227  "limitedQuantity"
228  },
229  { ATF_POINTER, 3, offsetof(struct denm_DangerousGoodsExtended, emergencyActionCode),
230  (ASN_TAG_CLASS_CONTEXT | (5 << 2)),
231  -1, /* IMPLICIT tag at current level */
233  0,
234  {
235 #if !defined(ASN_DISABLE_OER_SUPPORT)
236  0,
237 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
238 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
239  &asn_PER_memb_denm_emergencyActionCode_constr_7,
240 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
241 #if !defined(ASN_DISABLE_JER_SUPPORT)
242  0,
243 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
245  },
246  0, 0, /* No default value */
247  "emergencyActionCode"
248  },
249  { ATF_POINTER, 2, offsetof(struct denm_DangerousGoodsExtended, phoneNumber),
250  (ASN_TAG_CLASS_CONTEXT | (6 << 2)),
251  -1, /* IMPLICIT tag at current level */
253  0,
254  {
255 #if !defined(ASN_DISABLE_OER_SUPPORT)
256  0,
257 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
258 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
259  0,
260 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
261 #if !defined(ASN_DISABLE_JER_SUPPORT)
262  0,
263 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
264  0
265  },
266  0, 0, /* No default value */
267  "phoneNumber"
268  },
269  { ATF_POINTER, 1, offsetof(struct denm_DangerousGoodsExtended, companyName),
270  (ASN_TAG_CLASS_CONTEXT | (7 << 2)),
271  -1, /* IMPLICIT tag at current level */
273  0,
274  {
275 #if !defined(ASN_DISABLE_OER_SUPPORT)
276  0,
277 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
278 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
279  &asn_PER_memb_denm_companyName_constr_9,
280 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
281 #if !defined(ASN_DISABLE_JER_SUPPORT)
282  0,
283 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
285  },
286  0, 0, /* No default value */
287  "companyName"
288  },
289 };
290 static const int asn_MAP_denm_DangerousGoodsExtended_oms_1[] = { 5, 6, 7 };
292  (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
293 };
295  { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* dangerousGoodsType */
296  { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* unNumber */
297  { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* elevatedTemperature */
298  { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* tunnelsRestricted */
299  { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* limitedQuantity */
300  { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 }, /* emergencyActionCode */
301  { (ASN_TAG_CLASS_CONTEXT | (6 << 2)), 6, 0, 0 }, /* phoneNumber */
302  { (ASN_TAG_CLASS_CONTEXT | (7 << 2)), 7, 0, 0 } /* companyName */
303 };
305  sizeof(struct denm_DangerousGoodsExtended),
308  8, /* Count of tags in the map */
309  asn_MAP_denm_DangerousGoodsExtended_oms_1, /* Optional members */
310  3, 0, /* Root/Additions */
311  8, /* First extension addition */
312 };
314  "DangerousGoodsExtended",
315  "DangerousGoodsExtended",
319  /sizeof(asn_DEF_denm_DangerousGoodsExtended_tags_1[0]), /* 1 */
320  asn_DEF_denm_DangerousGoodsExtended_tags_1, /* Same as above */
322  /sizeof(asn_DEF_denm_DangerousGoodsExtended_tags_1[0]), /* 1 */
323  {
324 #if !defined(ASN_DISABLE_OER_SUPPORT)
325  0,
326 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
327 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
328  0,
329 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
330 #if !defined(ASN_DISABLE_JER_SUPPORT)
331  0,
332 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
334  },
336  8, /* Elements count */
337  &asn_SPC_denm_DangerousGoodsExtended_specs_1 /* Additional specs */
338 };
339 
asn_OP_SEQUENCE
asn_TYPE_operation_t asn_OP_SEQUENCE
Definition: constr_SEQUENCE.c:9
asn_MAP_denm_DangerousGoodsExtended_tag2el_1
static const asn_TYPE_tag2member_t asn_MAP_denm_DangerousGoodsExtended_tag2el_1[]
Definition: denm_DangerousGoodsExtended.c:294
asn_SPC_denm_DangerousGoodsExtended_specs_1
asn_SEQUENCE_specifics_t asn_SPC_denm_DangerousGoodsExtended_specs_1
Definition: denm_DangerousGoodsExtended.c:304
asn_app_constraint_failed_f
void() asn_app_constraint_failed_f(void *application_specific_key, const struct asn_TYPE_descriptor_s *type_descriptor_which_failed, const void *structure_which_failed_ptr, const char *error_message_format,...) CC_PRINTFLIKE(4
Definition: asn_application.h:167
ASN_TAG_CLASS_CONTEXT
@ ASN_TAG_CLASS_CONTEXT
Definition: ber_tlv_tag.h:15
ber_tlv_tag_t
unsigned ber_tlv_tag_t
Definition: ber_tlv_tag.h:18
CC_NOTUSED
static asn_per_constraints_t asn_PER_memb_denm_unNumber_constr_3 CC_NOTUSED
Definition: denm_DangerousGoodsExtended.c:108
ASN_TAG_CLASS_UNIVERSAL
@ ASN_TAG_CLASS_UNIVERSAL
Definition: ber_tlv_tag.h:13
asn_TYPE_descriptor_s::name
const char * name
Definition: constr_TYPE.h:225
memb_denm_companyName_constraint_1
static int memb_denm_companyName_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
Definition: denm_DangerousGoodsExtended.c:76
asn_DEF_denm_DangerousGoodsExtended_tags_1
static const ber_tlv_tag_t asn_DEF_denm_DangerousGoodsExtended_tags_1[]
Definition: denm_DangerousGoodsExtended.c:291
asn_DEF_UTF8String
asn_TYPE_descriptor_t asn_DEF_UTF8String
Definition: UTF8String.c:74
asn_MBR_denm_DangerousGoodsExtended_1
asn_TYPE_member_t asn_MBR_denm_DangerousGoodsExtended_1[]
Definition: denm_DangerousGoodsExtended.c:128
OCTET_STRING::buf
uint8_t * buf
Definition: OCTET_STRING.h:15
memb_denm_emergencyActionCode_constraint_1
static int memb_denm_emergencyActionCode_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
Definition: denm_DangerousGoodsExtended.c:49
asn_TYPE_tag2member_s
Definition: constr_TYPE.h:289
check_permitted_alphabet_7
static int check_permitted_alphabet_7(const void *sptr)
Definition: denm_DangerousGoodsExtended.c:10
ATF_POINTER
@ ATF_POINTER
Definition: constr_TYPE.h:268
SEQUENCE_constraint
asn_constr_check_f SEQUENCE_constraint
Definition: constr_SEQUENCE.h:56
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
offsetof
#define offsetof(s, m)
Definition: asn_system.h:132
denm_DangerousGoodsExtended
Definition: denm_DangerousGoodsExtended.h:28
asn_DEF_denm_PhoneNumber
asn_TYPE_descriptor_t asn_DEF_denm_PhoneNumber
Definition: denm_PhoneNumber.c:86
asn_MAP_denm_DangerousGoodsExtended_oms_1
static const int asn_MAP_denm_DangerousGoodsExtended_oms_1[]
Definition: denm_DangerousGoodsExtended.c:290
asn_DEF_denm_DangerousGoodsBasic
asn_TYPE_descriptor_t asn_DEF_denm_DangerousGoodsBasic
Definition: denm_DangerousGoodsBasic.c:77
asn_DEF_IA5String
asn_TYPE_descriptor_t asn_DEF_IA5String
Definition: IA5String.c:80
UTF8String_length
ssize_t UTF8String_length(const UTF8String_t *st)
Definition: UTF8String.c:213
asn_DEF_NativeInteger
asn_TYPE_descriptor_t asn_DEF_NativeInteger
Definition: NativeInteger.c:80
memb_denm_unNumber_constraint_1
static int memb_denm_unNumber_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
Definition: denm_DangerousGoodsExtended.c:24
ATF_NOFLAGS
@ ATF_NOFLAGS
Definition: constr_TYPE.h:267
OCTET_STRING
Definition: OCTET_STRING.h:14
asn_SEQUENCE_specifics_s
Definition: constr_SEQUENCE.h:14
ASN__CTFAIL
#define ASN__CTFAIL
Definition: constraints.h:57
denm_DangerousGoodsExtended::_asn_ctx
asn_struct_ctx_t _asn_ctx
Definition: denm_DangerousGoodsExtended.h:43
asn_DEF_denm_DangerousGoodsExtended
asn_TYPE_descriptor_t asn_DEF_denm_DangerousGoodsExtended
Definition: denm_DangerousGoodsExtended.c:313
denm_DangerousGoodsExtended.h
asn_per_constraints_s
Definition: per_support.h:30
asn_TYPE_member_s
Definition: constr_TYPE.h:272
asn_DEF_BOOLEAN
asn_TYPE_descriptor_t asn_DEF_BOOLEAN
Definition: BOOLEAN.c:72
OCTET_STRING::size
size_t size
Definition: OCTET_STRING.h:16


etsi_its_denm_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:23:47