Vanetza
 
Loading...
Searching...
No Matches
Time64.c
1/*
2 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3 * From ASN.1 module "IEEE1609dot2BaseTypes"
4 * found in "asn1/IEEE1609dot2BaseTypes.asn"
5 * `asn1c -fcompound-names -fincludes-quoted -no-gen-example -R`
6 */
7
8#include "Time64.h"
9
10int
11Time64_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const Uint64_t *st = (const Uint64_t *)sptr;
14 uintmax_t value;
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 if(asn_INTEGER2umax(st, &value)) {
24 ASN__CTFAIL(app_key, td, sptr,
25 "%s: value too large (%s:%d)",
26 td->name, __FILE__, __LINE__);
27 return -1;
28 }
29
30 if((value >= 0UL && value <= 18446744073709551615UL)) {
31 /* Constraint check succeeded */
32 return 0;
33 } else {
34 ASN__CTFAIL(app_key, td, sptr,
35 "%s: constraint failed (%s:%d)",
36 td->name, __FILE__, __LINE__);
37 return -1;
38 }
39}
40
41/*
42 * This type is implemented using Uint64,
43 * so here we adjust the DEF accordingly.
44 */
45#if !defined(ASN_DISABLE_OER_SUPPORT)
46static asn_oer_constraints_t asn_OER_type_Time64_constr_1 CC_NOTUSED = {
47 { 8, 1 } /* (0..18446744073709551615) */,
48 -1};
49#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
50#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
51asn_per_constraints_t asn_PER_type_Time64_constr_1 CC_NOTUSED = {
52 { APC_CONSTRAINED, 64, -1, 0, 18446744073709551615ul } /* (0..18446744073709551615) */,
53 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
54 0, 0 /* No PER value map */
55};
56const asn_INTEGER_specifics_t asn_SPC_Time64_specs_1 = {
57 0, 0, 0, 0, 0,
58 0, /* Native long size */
59 1 /* Unsigned representation */
60};
61#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
62static const ber_tlv_tag_t asn_DEF_Time64_tags_1[] = {
63 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
64};
65asn_TYPE_descriptor_t asn_DEF_Time64 = {
66 "Time64",
67 "Time64",
68 &asn_OP_INTEGER,
69 asn_DEF_Time64_tags_1,
70 sizeof(asn_DEF_Time64_tags_1)
71 /sizeof(asn_DEF_Time64_tags_1[0]), /* 1 */
72 asn_DEF_Time64_tags_1, /* Same as above */
73 sizeof(asn_DEF_Time64_tags_1)
74 /sizeof(asn_DEF_Time64_tags_1[0]), /* 1 */
75 {
76#if !defined(ASN_DISABLE_OER_SUPPORT)
77 &asn_OER_type_Time64_constr_1,
78#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
79#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
80 &asn_PER_type_Time64_constr_1,
81#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
82 Time64_constraint
83 },
84 0, 0, /* No members */
85 &asn_SPC_Time64_specs_1 /* Manually added specifics */
86};
87