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