Vanetza
Loading...
Searching...
No Matches
EndEntityType.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
10int
11Vanetza_Security_EndEntityType_constraint(const asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 const BIT_STRING_t *st = (const BIT_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 if(st->size > 0) {
24 /* Size in bits */
25 size = 8 * st->size - (st->bits_unused & 0x07);
26 } else {
27 size = 0;
28 }
29
30 if((size == 8UL)) {
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 BIT_STRING,
43 * so here we adjust the DEF accordingly.
44 */
45#if !defined(ASN_DISABLE_OER_SUPPORT)
46asn_oer_constraints_t asn_OER_type_Vanetza_Security_EndEntityType_constr_1 CC_NOTUSED = {
47 { 0, 0 },
48 8 /* (SIZE(8..8)) */};
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_Vanetza_Security_EndEntityType_constr_1 CC_NOTUSED = {
52 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
53 { APC_CONSTRAINED, 0, 0, 8, 8 } /* (SIZE(8..8)) */,
54 0, 0 /* No PER value map */
55};
56#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
57#if !defined(ASN_DISABLE_JER_SUPPORT)
58asn_jer_constraints_t asn_JER_type_Vanetza_Security_EndEntityType_constr_1 CC_NOTUSED = {
59 8};
60#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
61static const ber_tlv_tag_t asn_DEF_Vanetza_Security_EndEntityType_tags_1[] = {
62 (ASN_TAG_CLASS_UNIVERSAL | (3 << 2))
63};
64asn_TYPE_descriptor_t asn_DEF_Vanetza_Security_EndEntityType = {
65 "EndEntityType",
66 "EndEntityType",
67 &asn_OP_BIT_STRING,
68 asn_DEF_Vanetza_Security_EndEntityType_tags_1,
69 sizeof(asn_DEF_Vanetza_Security_EndEntityType_tags_1)
70 /sizeof(asn_DEF_Vanetza_Security_EndEntityType_tags_1[0]), /* 1 */
71 asn_DEF_Vanetza_Security_EndEntityType_tags_1, /* Same as above */
72 sizeof(asn_DEF_Vanetza_Security_EndEntityType_tags_1)
73 /sizeof(asn_DEF_Vanetza_Security_EndEntityType_tags_1[0]), /* 1 */
74 {
75#if !defined(ASN_DISABLE_OER_SUPPORT)
76 &asn_OER_type_Vanetza_Security_EndEntityType_constr_1,
77#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
78#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
79 &asn_PER_type_Vanetza_Security_EndEntityType_constr_1,
80#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
81#if !defined(ASN_DISABLE_JER_SUPPORT)
82 &asn_JER_type_Vanetza_Security_EndEntityType_constr_1,
83#endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
84 Vanetza_Security_EndEntityType_constraint
85 },
86 0, 0, /* Defined elsewhere */
87 &asn_SPC_BIT_STRING_specs /* Additional specs */
88};