Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 1 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 2 | /*** <<< INCLUDES [LogLine] >>> ***/ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 3 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 4 | #include <IA5String.h> |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 5 | #include <VariablePartSet.h> |
| 6 | #include <asn_SEQUENCE_OF.h> |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 7 | #include <constr_SEQUENCE_OF.h> |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 8 | #include <constr_SEQUENCE.h> |
| 9 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 10 | /*** <<< DEPS [LogLine] >>> ***/ |
| 11 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 12 | extern asn1_TYPE_descriptor_t asn1_DEF_LogLine; |
| 13 | |
| 14 | /*** <<< TYPE-DECLS [LogLine] >>> ***/ |
| 15 | |
| 16 | |
| 17 | typedef struct LogLine { |
| 18 | IA5String_t line_digest; |
| 19 | struct varsets { |
| 20 | A_SEQUENCE_OF(struct VariablePartSet) list; |
| 21 | |
| 22 | /* Context for parsing across buffer boundaries */ |
| 23 | ber_dec_ctx_t _ber_dec_ctx; |
| 24 | } varsets; |
| 25 | /* |
| 26 | * This type is extensible, |
| 27 | * possible extensions are below. |
| 28 | */ |
| 29 | |
| 30 | /* Context for parsing across buffer boundaries */ |
| 31 | ber_dec_ctx_t _ber_dec_ctx; |
| 32 | } LogLine_t; |
| 33 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 34 | /*** <<< CODE [LogLine] >>> ***/ |
| 35 | |
| 36 | static int |
Lev Walkin | a09e5da | 2004-08-22 03:19:00 +0000 | [diff] [blame^] | 37 | memb_varsets_1_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 38 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
| 39 | size_t size; |
| 40 | |
| 41 | if(!sptr) { |
| 42 | _ASN_ERRLOG(app_errlog, app_key, |
| 43 | "%s: value not given", td->name); |
| 44 | return -1; |
| 45 | } |
| 46 | |
| 47 | { /* Determine the number of elements */ |
| 48 | const A_SEQUENCE_OF(void) *list; |
| 49 | (const void *)list = sptr; |
| 50 | size = list->count; |
| 51 | } |
| 52 | |
| 53 | if((size >= 1)) { |
| 54 | /* Constraint check succeeded */ |
| 55 | return 1; |
| 56 | } else { |
| 57 | _ASN_ERRLOG(app_errlog, app_key, |
| 58 | "%s: constraint failed", td->name); |
| 59 | return -1; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 64 | /*** <<< STAT-DEFS [LogLine] >>> ***/ |
| 65 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 66 | static asn1_TYPE_member_t asn1_MBR_varsets[] = { |
| 67 | { 0, 0, |
| 68 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 69 | .tag_mode = 0, |
| 70 | .type = (void *)&asn1_DEF_VariablePartSet, |
| 71 | .memb_constraints = 0, /* Defer to actual type */ |
| 72 | .name = "" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 73 | }, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 74 | }; |
| 75 | static ber_tlv_tag_t asn1_DEF_varsets_tags[] = { |
| 76 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 77 | }; |
| 78 | static asn1_SET_OF_specifics_t asn1_DEF_varsets_specs = { |
| 79 | sizeof(struct varsets), |
| 80 | offsetof(struct varsets, _ber_dec_ctx), |
| 81 | }; |
| 82 | asn1_TYPE_descriptor_t asn1_DEF_varsets = { |
| 83 | "varsets", |
| 84 | SEQUENCE_OF_constraint, |
| 85 | SEQUENCE_OF_decode_ber, |
| 86 | SEQUENCE_OF_encode_der, |
| 87 | SEQUENCE_OF_print, |
| 88 | SEQUENCE_OF_free, |
| 89 | 0, /* Use generic outmost tag fetcher */ |
| 90 | asn1_DEF_varsets_tags, |
| 91 | sizeof(asn1_DEF_varsets_tags) |
| 92 | /sizeof(asn1_DEF_varsets_tags[0]), /* 1 */ |
| 93 | 1, /* Tags to skip */ |
| 94 | 1, /* Whether CONSTRUCTED */ |
| 95 | asn1_MBR_varsets, |
| 96 | 1, /* Single element */ |
| 97 | &asn1_DEF_varsets_specs /* Additional specs */ |
| 98 | }; |
| 99 | |
| 100 | static asn1_TYPE_member_t asn1_MBR_LogLine[] = { |
| 101 | { 0, offsetof(struct LogLine, line_digest), |
| 102 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), |
| 103 | .tag_mode = 0, |
| 104 | .type = (void *)&asn1_DEF_IA5String, |
| 105 | .memb_constraints = 0, /* Defer to actual type */ |
| 106 | .name = "line-digest" |
| 107 | }, |
| 108 | { 0, offsetof(struct LogLine, varsets), |
| 109 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 110 | .tag_mode = 0, |
| 111 | .type = (void *)&asn1_DEF_varsets, |
Lev Walkin | a09e5da | 2004-08-22 03:19:00 +0000 | [diff] [blame^] | 112 | .memb_constraints = memb_varsets_1_constraint, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 113 | .name = "varsets" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 114 | }, |
| 115 | }; |
| 116 | static ber_tlv_tag_t asn1_DEF_LogLine_tags[] = { |
| 117 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 118 | }; |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 119 | static asn1_TYPE_tag2member_t asn1_DEF_LogLine_tag2el[] = { |
Lev Walkin | 38abe79 | 2004-06-14 13:09:45 +0000 | [diff] [blame] | 120 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* varsets at 25 */ |
| 121 | { (ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), 0, 0, 0 }, /* line-digest at 23 */ |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 122 | }; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 123 | static asn1_SEQUENCE_specifics_t asn1_DEF_LogLine_specs = { |
| 124 | sizeof(struct LogLine), |
| 125 | offsetof(struct LogLine, _ber_dec_ctx), |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 126 | asn1_DEF_LogLine_tag2el, |
| 127 | 2, /* Count of tags in the map */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 128 | 1, /* Start extensions */ |
| 129 | 3 /* Stop extensions */ |
| 130 | }; |
| 131 | asn1_TYPE_descriptor_t asn1_DEF_LogLine = { |
| 132 | "LogLine", |
| 133 | SEQUENCE_constraint, |
| 134 | SEQUENCE_decode_ber, |
| 135 | SEQUENCE_encode_der, |
| 136 | SEQUENCE_print, |
| 137 | SEQUENCE_free, |
| 138 | 0, /* Use generic outmost tag fetcher */ |
| 139 | asn1_DEF_LogLine_tags, |
| 140 | sizeof(asn1_DEF_LogLine_tags) |
Lev Walkin | 6439972 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 141 | /sizeof(asn1_DEF_LogLine_tags[0]), /* 1 */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 142 | 1, /* Tags to skip */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 143 | 1, /* Whether CONSTRUCTED */ |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 144 | asn1_MBR_LogLine, |
| 145 | 2, /* Elements count */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 146 | &asn1_DEF_LogLine_specs /* Additional specs */ |
| 147 | }; |
| 148 | |
| 149 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 150 | /*** <<< INCLUDES [VariablePartSet] >>> ***/ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 151 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 152 | #include <ActionItem.h> |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 153 | #include <VariablePart.h> |
| 154 | #include <asn_SEQUENCE_OF.h> |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 155 | #include <constr_SEQUENCE_OF.h> |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 156 | #include <constr_SEQUENCE.h> |
| 157 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 158 | /*** <<< DEPS [VariablePartSet] >>> ***/ |
| 159 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 160 | extern asn1_TYPE_descriptor_t asn1_DEF_VariablePartSet; |
| 161 | |
| 162 | /*** <<< TYPE-DECLS [VariablePartSet] >>> ***/ |
| 163 | |
| 164 | |
| 165 | typedef struct VariablePartSet { |
| 166 | struct vparts { |
| 167 | A_SEQUENCE_OF(struct VariablePart) list; |
| 168 | |
| 169 | /* Context for parsing across buffer boundaries */ |
| 170 | ber_dec_ctx_t _ber_dec_ctx; |
| 171 | } vparts; |
| 172 | ActionItem_t resolution; |
| 173 | /* |
| 174 | * This type is extensible, |
| 175 | * possible extensions are below. |
| 176 | */ |
| 177 | |
| 178 | /* Context for parsing across buffer boundaries */ |
| 179 | ber_dec_ctx_t _ber_dec_ctx; |
| 180 | } VariablePartSet_t; |
| 181 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 182 | /*** <<< CODE [VariablePartSet] >>> ***/ |
| 183 | |
| 184 | static int |
Lev Walkin | a09e5da | 2004-08-22 03:19:00 +0000 | [diff] [blame^] | 185 | memb_vparts_2_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 186 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
| 187 | |
| 188 | if(!sptr) { |
| 189 | _ASN_ERRLOG(app_errlog, app_key, |
| 190 | "%s: value not given", td->name); |
| 191 | return -1; |
| 192 | } |
| 193 | |
| 194 | |
| 195 | if(1 /* No applicable constraints whatsoever */) { |
| 196 | /* Nothing is here. See below */ |
| 197 | } |
| 198 | |
| 199 | return td->check_constraints |
| 200 | (td, sptr, app_errlog, app_key); |
| 201 | } |
| 202 | |
| 203 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 204 | /*** <<< STAT-DEFS [VariablePartSet] >>> ***/ |
| 205 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 206 | static asn1_TYPE_member_t asn1_MBR_vparts[] = { |
| 207 | { 0, 0, |
| 208 | .tag = -1 /* Ambiguous tag (CHOICE?) */, |
| 209 | .tag_mode = 0, |
| 210 | .type = (void *)&asn1_DEF_VariablePart, |
| 211 | .memb_constraints = 0, /* Defer to actual type */ |
| 212 | .name = "" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 213 | }, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 214 | }; |
| 215 | static ber_tlv_tag_t asn1_DEF_vparts_tags[] = { |
| 216 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 217 | }; |
| 218 | static asn1_SET_OF_specifics_t asn1_DEF_vparts_specs = { |
| 219 | sizeof(struct vparts), |
| 220 | offsetof(struct vparts, _ber_dec_ctx), |
| 221 | }; |
| 222 | asn1_TYPE_descriptor_t asn1_DEF_vparts = { |
| 223 | "vparts", |
| 224 | SEQUENCE_OF_constraint, |
| 225 | SEQUENCE_OF_decode_ber, |
| 226 | SEQUENCE_OF_encode_der, |
| 227 | SEQUENCE_OF_print, |
| 228 | SEQUENCE_OF_free, |
| 229 | 0, /* Use generic outmost tag fetcher */ |
| 230 | asn1_DEF_vparts_tags, |
| 231 | sizeof(asn1_DEF_vparts_tags) |
| 232 | /sizeof(asn1_DEF_vparts_tags[0]), /* 1 */ |
| 233 | 1, /* Tags to skip */ |
| 234 | 1, /* Whether CONSTRUCTED */ |
| 235 | asn1_MBR_vparts, |
| 236 | 1, /* Single element */ |
| 237 | &asn1_DEF_vparts_specs /* Additional specs */ |
| 238 | }; |
| 239 | |
| 240 | static asn1_TYPE_member_t asn1_MBR_VariablePartSet[] = { |
| 241 | { 0, offsetof(struct VariablePartSet, vparts), |
| 242 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 243 | .tag_mode = 0, |
| 244 | .type = (void *)&asn1_DEF_vparts, |
Lev Walkin | a09e5da | 2004-08-22 03:19:00 +0000 | [diff] [blame^] | 245 | .memb_constraints = memb_vparts_2_constraint, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 246 | .name = "vparts" |
| 247 | }, |
| 248 | { 0, offsetof(struct VariablePartSet, resolution), |
| 249 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 250 | .tag_mode = 0, |
| 251 | .type = (void *)&asn1_DEF_ActionItem, |
| 252 | .memb_constraints = 0, /* Defer to actual type */ |
| 253 | .name = "resolution" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 254 | }, |
| 255 | }; |
| 256 | static ber_tlv_tag_t asn1_DEF_VariablePartSet_tags[] = { |
| 257 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 258 | }; |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 259 | static asn1_TYPE_tag2member_t asn1_DEF_VariablePartSet_tag2el[] = { |
Lev Walkin | 38abe79 | 2004-06-14 13:09:45 +0000 | [diff] [blame] | 260 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 1 }, /* vparts at 33 */ |
| 261 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, -1, 0 }, /* resolution at 35 */ |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 262 | }; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 263 | static asn1_SEQUENCE_specifics_t asn1_DEF_VariablePartSet_specs = { |
| 264 | sizeof(struct VariablePartSet), |
| 265 | offsetof(struct VariablePartSet, _ber_dec_ctx), |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 266 | asn1_DEF_VariablePartSet_tag2el, |
| 267 | 2, /* Count of tags in the map */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 268 | 1, /* Start extensions */ |
| 269 | 3 /* Stop extensions */ |
| 270 | }; |
| 271 | asn1_TYPE_descriptor_t asn1_DEF_VariablePartSet = { |
| 272 | "VariablePartSet", |
| 273 | SEQUENCE_constraint, |
| 274 | SEQUENCE_decode_ber, |
| 275 | SEQUENCE_encode_der, |
| 276 | SEQUENCE_print, |
| 277 | SEQUENCE_free, |
| 278 | 0, /* Use generic outmost tag fetcher */ |
| 279 | asn1_DEF_VariablePartSet_tags, |
| 280 | sizeof(asn1_DEF_VariablePartSet_tags) |
Lev Walkin | 6439972 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 281 | /sizeof(asn1_DEF_VariablePartSet_tags[0]), /* 1 */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 282 | 1, /* Tags to skip */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 283 | 1, /* Whether CONSTRUCTED */ |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 284 | asn1_MBR_VariablePartSet, |
| 285 | 2, /* Elements count */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 286 | &asn1_DEF_VariablePartSet_specs /* Additional specs */ |
| 287 | }; |
| 288 | |
| 289 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 290 | /*** <<< INCLUDES [VariablePart] >>> ***/ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 291 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 292 | #include <VisibleString.h> |
| 293 | #include <asn_SET_OF.h> |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 294 | #include <constr_SET_OF.h> |
| 295 | #include <constr_SEQUENCE.h> |
| 296 | #include <constr_CHOICE.h> |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 297 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 298 | /*** <<< DEPS [VariablePart] >>> ***/ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 299 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 300 | typedef enum VariablePart_PR { |
| 301 | VariablePart_PR_NOTHING, /* No components present */ |
| 302 | VariablePart_PR_vset, |
| 303 | VariablePart_PR_vrange, |
| 304 | /* Extensions may appear below */ |
Lev Walkin | 6439972 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 305 | } VariablePart_PR; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 306 | extern asn1_TYPE_descriptor_t asn1_DEF_VariablePart; |
| 307 | |
| 308 | /*** <<< TYPE-DECLS [VariablePart] >>> ***/ |
| 309 | |
| 310 | |
| 311 | typedef struct VariablePart { |
Lev Walkin | 6439972 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 312 | VariablePart_PR present; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 313 | union { |
| 314 | struct vset { |
| 315 | A_SET_OF(VisibleString_t) list; |
| 316 | |
| 317 | /* Context for parsing across buffer boundaries */ |
| 318 | ber_dec_ctx_t _ber_dec_ctx; |
| 319 | } vset; |
| 320 | struct vrange { |
| 321 | VisibleString_t from; |
| 322 | VisibleString_t to; |
| 323 | /* |
| 324 | * This type is extensible, |
| 325 | * possible extensions are below. |
| 326 | */ |
| 327 | |
| 328 | /* Context for parsing across buffer boundaries */ |
| 329 | ber_dec_ctx_t _ber_dec_ctx; |
| 330 | } vrange; |
| 331 | /* |
| 332 | * This type is extensible, |
| 333 | * possible extensions are below. |
| 334 | */ |
| 335 | } choice; |
| 336 | |
| 337 | /* Context for parsing across buffer boundaries */ |
| 338 | ber_dec_ctx_t _ber_dec_ctx; |
| 339 | } VariablePart_t; |
| 340 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 341 | /*** <<< CODE [VariablePart] >>> ***/ |
| 342 | |
| 343 | static int |
Lev Walkin | a09e5da | 2004-08-22 03:19:00 +0000 | [diff] [blame^] | 344 | memb_vset_3_constraint(asn1_TYPE_descriptor_t *td, const void *sptr, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 345 | asn_app_consume_bytes_f *app_errlog, void *app_key) { |
| 346 | size_t size; |
| 347 | |
| 348 | if(!sptr) { |
| 349 | _ASN_ERRLOG(app_errlog, app_key, |
| 350 | "%s: value not given", td->name); |
| 351 | return -1; |
| 352 | } |
| 353 | |
| 354 | { /* Determine the number of elements */ |
| 355 | const A_SET_OF(void) *list; |
| 356 | (const void *)list = sptr; |
| 357 | size = list->count; |
| 358 | } |
| 359 | |
| 360 | if((size >= 1)) { |
| 361 | /* Constraint check succeeded */ |
| 362 | return 1; |
| 363 | } else { |
| 364 | _ASN_ERRLOG(app_errlog, app_key, |
| 365 | "%s: constraint failed", td->name); |
| 366 | return -1; |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 371 | /*** <<< STAT-DEFS [VariablePart] >>> ***/ |
| 372 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 373 | static asn1_TYPE_member_t asn1_MBR_vset[] = { |
| 374 | { 0, 0, |
| 375 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), |
| 376 | .tag_mode = 0, |
| 377 | .type = (void *)&asn1_DEF_VisibleString, |
| 378 | .memb_constraints = 0, /* Defer to actual type */ |
| 379 | .name = "" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 380 | }, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 381 | }; |
| 382 | static ber_tlv_tag_t asn1_DEF_vset_tags[] = { |
| 383 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 384 | }; |
| 385 | static asn1_SET_OF_specifics_t asn1_DEF_vset_specs = { |
| 386 | sizeof(struct vset), |
| 387 | offsetof(struct vset, _ber_dec_ctx), |
| 388 | }; |
| 389 | asn1_TYPE_descriptor_t asn1_DEF_vset = { |
| 390 | "vset", |
| 391 | SET_OF_constraint, |
| 392 | SET_OF_decode_ber, |
| 393 | SET_OF_encode_der, |
| 394 | SET_OF_print, |
| 395 | SET_OF_free, |
| 396 | 0, /* Use generic outmost tag fetcher */ |
| 397 | asn1_DEF_vset_tags, |
| 398 | sizeof(asn1_DEF_vset_tags) |
| 399 | /sizeof(asn1_DEF_vset_tags[0]), /* 1 */ |
| 400 | 1, /* Tags to skip */ |
| 401 | 1, /* Whether CONSTRUCTED */ |
| 402 | asn1_MBR_vset, |
| 403 | 1, /* Single element */ |
| 404 | &asn1_DEF_vset_specs /* Additional specs */ |
| 405 | }; |
| 406 | |
| 407 | static asn1_TYPE_member_t asn1_MBR_vrange[] = { |
| 408 | { 0, offsetof(struct vrange, from), |
| 409 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), |
| 410 | .tag_mode = 0, |
| 411 | .type = (void *)&asn1_DEF_VisibleString, |
| 412 | .memb_constraints = 0, /* Defer to actual type */ |
| 413 | .name = "from" |
| 414 | }, |
| 415 | { 0, offsetof(struct vrange, to), |
| 416 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), |
| 417 | .tag_mode = 0, |
| 418 | .type = (void *)&asn1_DEF_VisibleString, |
| 419 | .memb_constraints = 0, /* Defer to actual type */ |
| 420 | .name = "to" |
| 421 | }, |
| 422 | }; |
| 423 | static ber_tlv_tag_t asn1_DEF_vrange_tags[] = { |
| 424 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 425 | }; |
| 426 | static asn1_TYPE_tag2member_t asn1_DEF_vrange_tag2el[] = { |
| 427 | { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), 0, 0, 1 }, /* from at 45 */ |
| 428 | { (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), 1, -1, 0 }, /* to at 46 */ |
| 429 | }; |
| 430 | static asn1_SEQUENCE_specifics_t asn1_DEF_vrange_specs = { |
| 431 | sizeof(struct vrange), |
| 432 | offsetof(struct vrange, _ber_dec_ctx), |
| 433 | asn1_DEF_vrange_tag2el, |
| 434 | 2, /* Count of tags in the map */ |
| 435 | 1, /* Start extensions */ |
| 436 | 3 /* Stop extensions */ |
| 437 | }; |
| 438 | asn1_TYPE_descriptor_t asn1_DEF_vrange = { |
| 439 | "vrange", |
| 440 | SEQUENCE_constraint, |
| 441 | SEQUENCE_decode_ber, |
| 442 | SEQUENCE_encode_der, |
| 443 | SEQUENCE_print, |
| 444 | SEQUENCE_free, |
| 445 | 0, /* Use generic outmost tag fetcher */ |
| 446 | asn1_DEF_vrange_tags, |
| 447 | sizeof(asn1_DEF_vrange_tags) |
| 448 | /sizeof(asn1_DEF_vrange_tags[0]), /* 1 */ |
| 449 | 1, /* Tags to skip */ |
| 450 | 1, /* Whether CONSTRUCTED */ |
| 451 | asn1_MBR_vrange, |
| 452 | 2, /* Elements count */ |
| 453 | &asn1_DEF_vrange_specs /* Additional specs */ |
| 454 | }; |
| 455 | |
| 456 | static asn1_TYPE_member_t asn1_MBR_VariablePart[] = { |
| 457 | { 0, offsetof(struct VariablePart, choice.vset), |
| 458 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 459 | .tag_mode = 0, |
| 460 | .type = (void *)&asn1_DEF_vset, |
Lev Walkin | a09e5da | 2004-08-22 03:19:00 +0000 | [diff] [blame^] | 461 | .memb_constraints = memb_vset_3_constraint, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 462 | .name = "vset" |
| 463 | }, |
| 464 | { 0, offsetof(struct VariablePart, choice.vrange), |
| 465 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 466 | .tag_mode = 0, |
| 467 | .type = (void *)&asn1_DEF_vrange, |
| 468 | .memb_constraints = 0, /* Defer to actual type */ |
| 469 | .name = "vrange" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 470 | }, |
| 471 | }; |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 472 | static asn1_TYPE_tag2member_t asn1_DEF_VariablePart_tag2el[] = { |
Lev Walkin | 38abe79 | 2004-06-14 13:09:45 +0000 | [diff] [blame] | 473 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* vrange at 45 */ |
| 474 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 0, 0, 0 }, /* vset at 42 */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 475 | }; |
| 476 | static asn1_CHOICE_specifics_t asn1_DEF_VariablePart_specs = { |
| 477 | sizeof(struct VariablePart), |
| 478 | offsetof(struct VariablePart, _ber_dec_ctx), |
| 479 | offsetof(struct VariablePart, present), |
| 480 | sizeof(((struct VariablePart *)0)->present), |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 481 | asn1_DEF_VariablePart_tag2el, |
| 482 | 2, /* Count of tags in the map */ |
Lev Walkin | d64497c | 2004-07-01 00:49:55 +0000 | [diff] [blame] | 483 | 1 /* Whether extensible */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 484 | }; |
| 485 | asn1_TYPE_descriptor_t asn1_DEF_VariablePart = { |
| 486 | "VariablePart", |
| 487 | CHOICE_constraint, |
| 488 | CHOICE_decode_ber, |
| 489 | CHOICE_encode_der, |
| 490 | CHOICE_print, |
| 491 | CHOICE_free, |
| 492 | CHOICE_outmost_tag, |
Lev Walkin | 6439972 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 493 | 0, /* No explicit tags (pointer) */ |
| 494 | 0, /* No explicit tags (count) */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 495 | 0, /* Tags to skip */ |
| 496 | 1, /* Whether CONSTRUCTED */ |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 497 | asn1_MBR_VariablePart, |
| 498 | 2, /* Elements count */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 499 | &asn1_DEF_VariablePart_specs /* Additional specs */ |
| 500 | }; |
| 501 | |
| 502 | |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 503 | /*** <<< INCLUDES [ActionItem] >>> ***/ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 504 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 505 | #include <ENUMERATED.h> |
Lev Walkin | b47ddce | 2004-08-11 05:25:47 +0000 | [diff] [blame] | 506 | #include <BOOLEAN.h> |
| 507 | #include <VisibleString.h> |
| 508 | #include <asn_SET_OF.h> |
| 509 | #include <constr_SET_OF.h> |
| 510 | #include <constr_SEQUENCE.h> |
| 511 | |
| 512 | /*** <<< DEPS [ActionItem] >>> ***/ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 513 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 514 | typedef enum accept_as { |
| 515 | accept_as_unknown = 0, |
| 516 | accept_as_safe = 1, |
| 517 | accept_as_unsafe = 2, |
| 518 | /* |
| 519 | * Enumeration is extensible |
| 520 | */ |
| 521 | } accept_as_e; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 522 | extern asn1_TYPE_descriptor_t asn1_DEF_ActionItem; |
| 523 | |
| 524 | /*** <<< TYPE-DECLS [ActionItem] >>> ***/ |
| 525 | |
| 526 | |
| 527 | typedef struct ActionItem { |
| 528 | ENUMERATED_t accept_as; |
| 529 | struct notify { |
| 530 | BOOLEAN_t critical; |
| 531 | struct email { |
| 532 | A_SET_OF(VisibleString_t) list; |
| 533 | |
| 534 | /* Context for parsing across buffer boundaries */ |
| 535 | ber_dec_ctx_t _ber_dec_ctx; |
| 536 | } email; |
| 537 | /* |
| 538 | * This type is extensible, |
| 539 | * possible extensions are below. |
| 540 | */ |
| 541 | |
| 542 | /* Context for parsing across buffer boundaries */ |
| 543 | ber_dec_ctx_t _ber_dec_ctx; |
| 544 | } *notify; |
| 545 | /* |
| 546 | * This type is extensible, |
| 547 | * possible extensions are below. |
| 548 | */ |
| 549 | |
| 550 | /* Context for parsing across buffer boundaries */ |
| 551 | ber_dec_ctx_t _ber_dec_ctx; |
| 552 | } ActionItem_t; |
| 553 | |
| 554 | /*** <<< STAT-DEFS [ActionItem] >>> ***/ |
| 555 | |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 556 | static asn1_TYPE_member_t asn1_MBR_email[] = { |
| 557 | { 0, 0, |
| 558 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), |
| 559 | .tag_mode = 0, |
| 560 | .type = (void *)&asn1_DEF_VisibleString, |
| 561 | .memb_constraints = 0, /* Defer to actual type */ |
| 562 | .name = "" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 563 | }, |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 564 | }; |
| 565 | static ber_tlv_tag_t asn1_DEF_email_tags[] = { |
| 566 | (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)) |
| 567 | }; |
| 568 | static asn1_SET_OF_specifics_t asn1_DEF_email_specs = { |
| 569 | sizeof(struct email), |
| 570 | offsetof(struct email, _ber_dec_ctx), |
| 571 | }; |
| 572 | asn1_TYPE_descriptor_t asn1_DEF_email = { |
| 573 | "email", |
| 574 | SET_OF_constraint, |
| 575 | SET_OF_decode_ber, |
| 576 | SET_OF_encode_der, |
| 577 | SET_OF_print, |
| 578 | SET_OF_free, |
| 579 | 0, /* Use generic outmost tag fetcher */ |
| 580 | asn1_DEF_email_tags, |
| 581 | sizeof(asn1_DEF_email_tags) |
| 582 | /sizeof(asn1_DEF_email_tags[0]), /* 1 */ |
| 583 | 1, /* Tags to skip */ |
| 584 | 1, /* Whether CONSTRUCTED */ |
| 585 | asn1_MBR_email, |
| 586 | 1, /* Single element */ |
| 587 | &asn1_DEF_email_specs /* Additional specs */ |
| 588 | }; |
| 589 | |
| 590 | static asn1_TYPE_member_t asn1_MBR_notify[] = { |
| 591 | { 0, offsetof(struct notify, critical), |
| 592 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), |
| 593 | .tag_mode = 0, |
| 594 | .type = (void *)&asn1_DEF_BOOLEAN, |
| 595 | .memb_constraints = 0, /* Defer to actual type */ |
| 596 | .name = "critical" |
| 597 | }, |
| 598 | { 0, offsetof(struct notify, email), |
| 599 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), |
| 600 | .tag_mode = 0, |
| 601 | .type = (void *)&asn1_DEF_email, |
| 602 | .memb_constraints = 0, /* Defer to actual type */ |
| 603 | .name = "email" |
| 604 | }, |
| 605 | }; |
| 606 | static ber_tlv_tag_t asn1_DEF_notify_tags[] = { |
| 607 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 608 | }; |
| 609 | static asn1_TYPE_tag2member_t asn1_DEF_notify_tag2el[] = { |
| 610 | { (ASN_TAG_CLASS_UNIVERSAL | (1 << 2)), 0, 0, 0 }, /* critical at 61 */ |
| 611 | { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 1, 0, 0 }, /* email at 62 */ |
| 612 | }; |
| 613 | static asn1_SEQUENCE_specifics_t asn1_DEF_notify_specs = { |
| 614 | sizeof(struct notify), |
| 615 | offsetof(struct notify, _ber_dec_ctx), |
| 616 | asn1_DEF_notify_tag2el, |
| 617 | 2, /* Count of tags in the map */ |
| 618 | 1, /* Start extensions */ |
| 619 | 3 /* Stop extensions */ |
| 620 | }; |
| 621 | asn1_TYPE_descriptor_t asn1_DEF_notify = { |
| 622 | "notify", |
| 623 | SEQUENCE_constraint, |
| 624 | SEQUENCE_decode_ber, |
| 625 | SEQUENCE_encode_der, |
| 626 | SEQUENCE_print, |
| 627 | SEQUENCE_free, |
| 628 | 0, /* Use generic outmost tag fetcher */ |
| 629 | asn1_DEF_notify_tags, |
| 630 | sizeof(asn1_DEF_notify_tags) |
| 631 | /sizeof(asn1_DEF_notify_tags[0]), /* 1 */ |
| 632 | 1, /* Tags to skip */ |
| 633 | 1, /* Whether CONSTRUCTED */ |
| 634 | asn1_MBR_notify, |
| 635 | 2, /* Elements count */ |
| 636 | &asn1_DEF_notify_specs /* Additional specs */ |
| 637 | }; |
| 638 | |
| 639 | static asn1_TYPE_member_t asn1_MBR_ActionItem[] = { |
| 640 | { 0, offsetof(struct ActionItem, accept_as), |
| 641 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), |
| 642 | .tag_mode = 0, |
| 643 | .type = (void *)&asn1_DEF_ENUMERATED, |
| 644 | .memb_constraints = 0, /* Defer to actual type */ |
| 645 | .name = "accept-as" |
| 646 | }, |
| 647 | { 1, offsetof(struct ActionItem, notify), |
| 648 | .tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), |
| 649 | .tag_mode = 0, |
| 650 | .type = (void *)&asn1_DEF_notify, |
| 651 | .memb_constraints = 0, /* Defer to actual type */ |
| 652 | .name = "notify" |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 653 | }, |
| 654 | }; |
| 655 | static ber_tlv_tag_t asn1_DEF_ActionItem_tags[] = { |
| 656 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 657 | }; |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 658 | static asn1_TYPE_tag2member_t asn1_DEF_ActionItem_tag2el[] = { |
Lev Walkin | 38abe79 | 2004-06-14 13:09:45 +0000 | [diff] [blame] | 659 | { (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)), 0, 0, 0 }, /* accept-as at 55 */ |
| 660 | { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 1, 0, 0 }, /* notify at 61 */ |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 661 | }; |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 662 | static asn1_SEQUENCE_specifics_t asn1_DEF_ActionItem_specs = { |
| 663 | sizeof(struct ActionItem), |
| 664 | offsetof(struct ActionItem, _ber_dec_ctx), |
Lev Walkin | cda6b8a | 2004-06-06 07:20:52 +0000 | [diff] [blame] | 665 | asn1_DEF_ActionItem_tag2el, |
| 666 | 2, /* Count of tags in the map */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 667 | 1, /* Start extensions */ |
| 668 | 3 /* Stop extensions */ |
| 669 | }; |
| 670 | asn1_TYPE_descriptor_t asn1_DEF_ActionItem = { |
| 671 | "ActionItem", |
| 672 | SEQUENCE_constraint, |
| 673 | SEQUENCE_decode_ber, |
| 674 | SEQUENCE_encode_der, |
| 675 | SEQUENCE_print, |
| 676 | SEQUENCE_free, |
| 677 | 0, /* Use generic outmost tag fetcher */ |
| 678 | asn1_DEF_ActionItem_tags, |
| 679 | sizeof(asn1_DEF_ActionItem_tags) |
Lev Walkin | 6439972 | 2004-08-11 07:17:22 +0000 | [diff] [blame] | 680 | /sizeof(asn1_DEF_ActionItem_tags[0]), /* 1 */ |
Lev Walkin | 5bbff1e | 2004-06-28 21:13:22 +0000 | [diff] [blame] | 681 | 1, /* Tags to skip */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 682 | 1, /* Whether CONSTRUCTED */ |
Lev Walkin | 2e3055d | 2004-08-20 13:36:32 +0000 | [diff] [blame] | 683 | asn1_MBR_ActionItem, |
| 684 | 2, /* Elements count */ |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 685 | &asn1_DEF_ActionItem_specs /* Additional specs */ |
| 686 | }; |
| 687 | |