Vanetza
 
Loading...
Searching...
No Matches
PsidGroupPermissions.c
1/*
2 * Generated by asn1c-0.9.29 (http://lionet.info/asn1c)
3 * From ASN.1 module "IEEE1609dot2"
4 * found in "asn1/IEEE1609dot2.asn"
5 * `asn1c -fcompound-names -fincludes-quoted -no-gen-example -R`
6 */
7
8#include "PsidGroupPermissions.h"
9
10static int asn_DFL_3_cmp_1(const void *sptr) {
11 const long *st = sptr;
12
13 if(!st) {
14 return -1; /* No value is not a default value */
15 }
16
17 /* Test default value 1 */
18 return (*st != 1);
19}
20static int asn_DFL_3_set_1(void **sptr) {
21 long *st = *sptr;
22
23 if(!st) {
24 st = (*sptr = CALLOC(1, sizeof(*st)));
25 if(!st) return -1;
26 }
27
28 /* Install default value 1 */
29 *st = 1;
30 return 0;
31}
32static int asn_DFL_4_cmp_0(const void *sptr) {
33 const long *st = sptr;
34
35 if(!st) {
36 return -1; /* No value is not a default value */
37 }
38
39 /* Test default value 0 */
40 return (*st != 0);
41}
42static int asn_DFL_4_set_0(void **sptr) {
43 long *st = *sptr;
44
45 if(!st) {
46 st = (*sptr = CALLOC(1, sizeof(*st)));
47 if(!st) return -1;
48 }
49
50 /* Install default value 0 */
51 *st = 0;
52 return 0;
53}
54static int asn_DFL_5_cmp(const void *sptr) {
55 static const uint8_t defv[] = { 0x00 };
56 const EndEntityType_t *st = sptr;
57
58 if(!st) {
59 return -1; /* No value is not a default value */
60 }
61
62 if(st->size == (sizeof(defv))
63 && memcmp(st->buf, &defv, sizeof(defv)) == 0)
64 return 0;
65 return 1;
66}
67static int asn_DFL_5_set(void **sptr) {
68 static const uint8_t defv[] = { 0x00 };
69 EndEntityType_t *st = *sptr;
70 uint8_t *nstr = MALLOC(sizeof(defv));
71
72 if(!nstr) return -1;
73 memcpy(nstr, defv, sizeof(defv));
74
75 if(st) {
76 FREEMEM(st->buf);
77 } else {
78 st = (*sptr = CALLOC(1, sizeof(*st)));
79 if(!st) { FREEMEM(nstr); return -1; }
80 }
81 st->buf = nstr;
82 st->size = sizeof(defv);
83 st->bits_unused = 0;
84
85 return 0;
86}
87asn_TYPE_member_t asn_MBR_PsidGroupPermissions_1[] = {
88 { ATF_NOFLAGS, 0, offsetof(struct PsidGroupPermissions, subjectPermissions),
89 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
90 +1, /* EXPLICIT tag at current level */
91 &asn_DEF_SubjectPermissions,
92 0,
93 {
94#if !defined(ASN_DISABLE_OER_SUPPORT)
95 0,
96#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
97#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
98 0,
99#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
100 0
101 },
102 0, 0, /* No default value */
103 "subjectPermissions"
104 },
105 { ATF_POINTER, 3, offsetof(struct PsidGroupPermissions, minChainLength),
106 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
107 -1, /* IMPLICIT tag at current level */
108 &asn_DEF_NativeInteger,
109 0,
110 {
111#if !defined(ASN_DISABLE_OER_SUPPORT)
112 0,
113#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
114#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
115 0,
116#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
117 0
118 },
119 &asn_DFL_3_cmp_1, /* Compare DEFAULT 1 */
120 &asn_DFL_3_set_1, /* Set DEFAULT 1 */
121 "minChainLength"
122 },
123 { ATF_NOFLAGS, 2, offsetof(struct PsidGroupPermissions, chainLengthRange),
124 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
125 -1, /* IMPLICIT tag at current level */
126 &asn_DEF_NativeInteger,
127 0,
128 {
129#if !defined(ASN_DISABLE_OER_SUPPORT)
130 0,
131#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
132#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
133 0,
134#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
135 0
136 },
137 &asn_DFL_4_cmp_0, /* Compare DEFAULT 0 */
138 &asn_DFL_4_set_0, /* Set DEFAULT 0 */
139 "chainLengthRange"
140 },
141 { ATF_POINTER, 1, offsetof(struct PsidGroupPermissions, eeType),
142 (ASN_TAG_CLASS_CONTEXT | (3 << 2)),
143 -1, /* IMPLICIT tag at current level */
144 &asn_DEF_EndEntityType,
145 0,
146 {
147#if !defined(ASN_DISABLE_OER_SUPPORT)
148 0,
149#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
150#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
151 0,
152#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
153 0
154 },
155 &asn_DFL_5_cmp, /* Compare DEFAULT "" */
156 &asn_DFL_5_set, /* Set DEFAULT "" */
157 "eeType"
158 },
159};
160static const int asn_MAP_PsidGroupPermissions_oms_1[] = { 1, 2, 3 };
161static const ber_tlv_tag_t asn_DEF_PsidGroupPermissions_tags_1[] = {
162 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
163};
164static const asn_TYPE_tag2member_t asn_MAP_PsidGroupPermissions_tag2el_1[] = {
165 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* subjectPermissions */
166 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* minChainLength */
167 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* chainLengthRange */
168 { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 } /* eeType */
169};
170asn_SEQUENCE_specifics_t asn_SPC_PsidGroupPermissions_specs_1 = {
171 sizeof(struct PsidGroupPermissions),
172 offsetof(struct PsidGroupPermissions, _asn_ctx),
173 asn_MAP_PsidGroupPermissions_tag2el_1,
174 4, /* Count of tags in the map */
175 asn_MAP_PsidGroupPermissions_oms_1, /* Optional members */
176 3, 0, /* Root/Additions */
177 -1, /* First extension addition */
178};
179asn_TYPE_descriptor_t asn_DEF_PsidGroupPermissions = {
180 "PsidGroupPermissions",
181 "PsidGroupPermissions",
182 &asn_OP_SEQUENCE,
183 asn_DEF_PsidGroupPermissions_tags_1,
184 sizeof(asn_DEF_PsidGroupPermissions_tags_1)
185 /sizeof(asn_DEF_PsidGroupPermissions_tags_1[0]), /* 1 */
186 asn_DEF_PsidGroupPermissions_tags_1, /* Same as above */
187 sizeof(asn_DEF_PsidGroupPermissions_tags_1)
188 /sizeof(asn_DEF_PsidGroupPermissions_tags_1[0]), /* 1 */
189 {
190#if !defined(ASN_DISABLE_OER_SUPPORT)
191 0,
192#endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
193#if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
194 0,
195#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
196 SEQUENCE_constraint
197 },
198 asn_MBR_PsidGroupPermissions_1,
199 4, /* Elements count */
200 &asn_SPC_PsidGroupPermissions_specs_1 /* Additional specs */
201};
202