2 * Copyright (c) 1995, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.28 1995-06-14 15:26:35 quinn
8 * *** empty log message ***
10 * Revision 1.27 1995/06/07 14:36:22 quinn
13 * Revision 1.26 1995/06/02 09:49:13 quinn
14 * Adding access control
16 * Revision 1.25 1995/05/25 11:00:08 quinn
17 * *** empty log message ***
19 * Revision 1.24 1995/05/22 13:58:18 quinn
20 * Fixed an ODR_NULLVAL.
22 * Revision 1.23 1995/05/22 11:30:18 quinn
23 * Adding Z39.50-1992 stuff to proto.c. Adding zget.c
25 * Revision 1.22 1995/05/17 08:40:56 quinn
26 * Added delete. Fixed some sequence_begins. Smallish.
28 * Revision 1.21 1995/05/16 08:50:24 quinn
29 * License, documentation, and memory fixes
31 * Revision 1.20 1995/05/15 11:55:25 quinn
34 * Revision 1.19 1995/04/11 11:58:35 quinn
37 * Revision 1.18 1995/04/11 11:52:02 quinn
38 * Fixed possible buf in proto.c
40 * Revision 1.17 1995/04/10 10:22:22 quinn
43 * Revision 1.16 1995/03/30 10:26:43 quinn
44 * Added Term structure
46 * Revision 1.15 1995/03/30 09:08:39 quinn
47 * Added Resource control protocol
49 * Revision 1.14 1995/03/29 08:06:13 quinn
50 * Added a few v3 elements
52 * Revision 1.13 1995/03/20 11:26:52 quinn
53 * *** empty log message ***
55 * Revision 1.12 1995/03/20 09:45:09 quinn
58 * Revision 1.11 1995/03/17 10:17:25 quinn
59 * Added memory management.
61 * Revision 1.10 1995/03/15 11:17:40 quinn
62 * Fixed some return-checks from choice.. need better ay to handle those..
64 * Revision 1.9 1995/03/15 08:37:06 quinn
65 * Fixed protocol bugs.
67 * Revision 1.8 1995/03/14 16:59:24 quinn
68 * Fixed OPTIONAL flag in attributeelement
70 * Revision 1.7 1995/03/07 16:29:33 quinn
71 * Added authentication stuff.
73 * Revision 1.6 1995/03/01 14:46:03 quinn
74 * Fixed protocol bug in 8777query.
76 * Revision 1.5 1995/02/14 11:54:22 quinn
79 * Revision 1.4 1995/02/10 15:54:30 quinn
82 * Revision 1.3 1995/02/09 15:51:39 quinn
85 * Revision 1.2 1995/02/06 21:26:07 quinn
86 * Repaired this evening's damages..
88 * Revision 1.1 1995/02/06 16:44:47 quinn
89 * First hack at Z/SR protocol
97 /* ---------------------- GLOBAL DEFS ------------------- */
99 int z_ReferenceId(ODR o, Z_ReferenceId **p, int opt)
101 return odr_implicit(o, odr_octetstring, (Odr_oct**) p, ODR_CONTEXT, 2, opt);
104 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt)
106 return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 105,
110 int z_ResultSetId(ODR o, char **p, int opt)
112 return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 31,
116 int z_UserInformationField(ODR o, Odr_external **p, int opt)
118 return odr_explicit(o, odr_external, (Odr_external **)p, ODR_CONTEXT,
122 int z_InfoCategory(ODR o, Z_InfoCategory **p, int opt)
124 if (!odr_sequence_begin(o, p, sizeof(**p)))
125 return opt && odr_ok(o);
127 odr_implicit(o, odr_oid, &(*p)->categoryTypeId, ODR_CONTEXT, 1, 1) &&
128 odr_implicit(o, odr_integer, &(*p)->categoryValue, ODR_CONTEXT, 2, 0) &&
132 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt)
134 static Odr_arm arm[] =
136 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_OtherInfo_characterInfo,
138 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OtherInfo_binaryInfo,
140 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_OtherInfo_externallyDefinedInfo,
142 {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid, odr_oid},
146 if (!odr_sequence_begin(o, p, sizeof(**p)))
147 return opt && odr_ok(o);
149 odr_implicit(o, z_InfoCategory, &(*p)->category, ODR_CONTEXT, 1, 1) &&
150 odr_choice(o, arm, &(*p)->which, &(*p)->information) &&
154 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt)
156 if (o->direction == ODR_ENCODE)
157 *p = odr_malloc(o, sizeof(**p));
159 odr_implicit_settag(o, ODR_CONTEXT, 201);
160 if (odr_sequence_of(o, z_OtherInformationUnit, &(*p)->list,
161 &(*p)->num_elements))
164 return opt && odr_ok(o);
167 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt)
169 static Odr_arm arm[] =
171 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_StringOrNumeric_string,
173 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_StringOrNumeric_numeric,
178 if (o->direction == ODR_DECODE)
179 *p = odr_malloc(o, sizeof(**p));
180 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
183 return opt && odr_ok(o);
189 int z_Unit(ODR o, Z_Unit **p, int opt)
191 if (!odr_sequence_begin(o, p, sizeof(**p)))
192 return opt && odr_ok(o);
194 odr_implicit(o, odr_visiblestring, &(*p)->unitSystem, ODR_CONTEXT,
196 odr_explicit(o, z_StringOrNumeric, &(*p)->unitType, ODR_CONTEXT,
198 odr_explicit(o, z_StringOrNumeric, &(*p)->unit, ODR_CONTEXT, 3, 1) &&
199 odr_implicit(o, odr_integer, &(*p)->scaleFactor, ODR_CONTEXT, 4, 1) &&
203 int z_IntUnit(ODR o, Z_IntUnit **p, int opt)
205 if (!odr_sequence_begin(o, p, sizeof(**p)))
206 return opt && odr_ok(o);
208 odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 1, 0) &&
209 odr_implicit(o, z_Unit, &(*p)->unitUsed, ODR_CONTEXT, 2, 0) &&
213 /* ---------------------- INITIALIZE SERVICE ------------------- */
216 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt)
218 if (!odr_sequence_begin(o, p, sizeof(**p)))
219 return opt && odr_ok(o);
221 odr_visiblestring(o, &(*p)->user, 0) &&
222 odr_visiblestring(o, &(*p)->password, 0) &&
223 odr_visiblestring(o, &(*p)->account, 0) &&
228 int z_IdPass(ODR o, Z_IdPass **p, int opt)
230 if (!odr_sequence_begin(o, p, sizeof(**p)))
231 return opt && odr_ok(o);
233 odr_implicit(o, odr_visiblestring, &(*p)->groupId, ODR_CONTEXT, 0, 1) &&
234 odr_implicit(o, odr_visiblestring, &(*p)->userId, ODR_CONTEXT, 1, 1) &&
235 odr_implicit(o, odr_visiblestring, &(*p)->password, ODR_CONTEXT, 2,
240 int z_StrAuthentication(ODR o, char **p, int opt)
242 return odr_visiblestring(o, p, opt);
245 int z_IdAuthentication(ODR o, Z_IdAuthentication **p, int opt)
247 static Odr_arm arm[] =
249 {-1, -1, -1, Z_IdAuthentication_open, z_StrAuthentication},
250 {-1, -1, -1, Z_IdAuthentication_idPass, z_IdPass},
251 {-1, -1, -1, Z_IdAuthentication_anonymous, odr_null},
252 {-1, -1, -1, Z_IdAuthentication_other, odr_external},
256 if (o->direction == ODR_DECODE)
257 *p = odr_malloc(o, sizeof(**p));
259 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
262 return opt && odr_ok(o);
265 int z_InitRequest(ODR o, Z_InitRequest **p, int opt)
269 if (!odr_sequence_begin(o, p, sizeof(**p)))
270 return opt && odr_ok(o);
273 z_ReferenceId(o, &pp->referenceId, 1) &&
274 odr_implicit(o, odr_bitstring, &pp->protocolVersion, ODR_CONTEXT,
276 odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) &&
277 odr_implicit(o, odr_integer, &pp->preferredMessageSize, ODR_CONTEXT,
279 odr_implicit(o, odr_integer, &pp->maximumRecordSize, ODR_CONTEXT,
281 odr_explicit(o, z_IdAuthentication, &pp->idAuthentication, ODR_CONTEXT,
283 odr_implicit(o, odr_visiblestring, &pp->implementationId, ODR_CONTEXT,
285 odr_implicit(o, odr_visiblestring, &pp->implementationName, ODR_CONTEXT,
287 odr_implicit(o, odr_visiblestring, &pp->implementationVersion,
288 ODR_CONTEXT, 112, 1) &&
289 z_UserInformationField(o, &pp->userInformationField, 1) &&
291 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
296 int z_InitResponse(ODR o, Z_InitResponse **p, int opt)
300 if (!odr_sequence_begin(o, p, sizeof(**p)))
301 return opt && odr_ok(o);
304 z_ReferenceId(o, &pp->referenceId, 1) &&
305 odr_implicit(o, odr_bitstring, &pp->protocolVersion, ODR_CONTEXT,
307 odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) &&
308 odr_implicit(o, odr_integer, &pp->preferredMessageSize, ODR_CONTEXT,
310 odr_implicit(o, odr_integer, &pp->maximumRecordSize, ODR_CONTEXT,
312 odr_implicit(o, odr_bool, &pp->result, ODR_CONTEXT, 12, 0) &&
313 odr_implicit(o, odr_visiblestring, &pp->implementationId, ODR_CONTEXT,
315 odr_implicit(o, odr_visiblestring, &pp->implementationName, ODR_CONTEXT,
317 odr_implicit(o, odr_visiblestring, &pp->implementationVersion,
318 ODR_CONTEXT, 112, 1) &&
319 z_UserInformationField(o, &pp->userInformationField, 1) &&
321 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
326 /* ------------------ RESOURCE CONTROL ----------------*/
328 int z_TriggerResourceControlRequest(ODR o, Z_TriggerResourceControlRequest **p,
331 if (!odr_sequence_begin(o, p, sizeof(**p)))
332 return opt && odr_ok(o);
334 z_ReferenceId(o, &(*p)->referenceId, 1) &&
335 odr_implicit(o, odr_integer, &(*p)->requestedAction, ODR_CONTEXT,
337 odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat,
338 ODR_CONTEXT, 47, 1) &&
339 odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT,
342 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
347 int z_ResourceControlRequest(ODR o, Z_ResourceControlRequest **p, int opt)
349 if (!odr_sequence_begin(o, p, sizeof(**p)))
350 return opt && odr_ok(o);
352 z_ReferenceId(o, &(*p)->referenceId, 1) &&
353 odr_implicit(o, odr_bool, &(*p)->suspendedFlag, ODR_CONTEXT, 39, 1)&&
354 odr_explicit(o, odr_external, &(*p)->resourceReport, ODR_CONTEXT,
356 odr_implicit(o, odr_integer, &(*p)->partialResultsAvailable,
357 ODR_CONTEXT, 41, 1) &&
358 odr_implicit(o, odr_bool, &(*p)->responseRequired, ODR_CONTEXT,
360 odr_implicit(o, odr_bool, &(*p)->triggeredRequestFlag,
361 ODR_CONTEXT, 43, 1) &&
363 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
368 int z_ResourceControlResponse(ODR o, Z_ResourceControlResponse **p, int opt)
370 if (!odr_sequence_begin(o, p, sizeof(**p)))
371 return opt && odr_ok(o);
373 z_ReferenceId(o, &(*p)->referenceId, 1) &&
374 odr_implicit(o, odr_bool, &(*p)->continueFlag, ODR_CONTEXT, 44, 0) &&
375 odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT,
378 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
383 /* ------------------------ SEARCH SERVICE ----------------------- */
385 int z_ElementSetName(ODR o, char **p, int opt)
387 return odr_implicit(o, odr_visiblestring, (char**) p, ODR_CONTEXT, 103,
391 int z_DatabaseSpecificUnit(ODR o, Z_DatabaseSpecificUnit **p, int opt)
393 if (!odr_sequence_begin(o, p, sizeof(**p)))
394 return opt && odr_ok(o);
396 z_DatabaseName(o, &(*p)->databaseName, 0) &&
397 z_ElementSetName(o, &(*p)->elementSetName, 0) &&
401 int z_DatabaseSpecific(ODR o, Z_DatabaseSpecific **p, int opt)
403 if (o->direction == ODR_DECODE)
404 *p = odr_malloc(o, sizeof(**p));
408 odr_implicit_settag(o, ODR_CONTEXT, 1);
409 if (odr_sequence_of(o, z_DatabaseSpecificUnit, &(*p)->elements,
410 &(*p)->num_elements))
416 int z_ElementSetNames(ODR o, Z_ElementSetNames **p, int opt)
418 static Odr_arm arm[] =
420 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementSetNames_generic,
422 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSetNames_databaseSpecific,
427 if (!odr_constructed_begin(o, p, ODR_CONTEXT, 19))
428 return opt && odr_ok(o);
430 if (o->direction == ODR_DECODE)
431 *p = odr_malloc(o, sizeof(**p));
433 if (odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
434 odr_constructed_end(o))
440 /* ----------------------- RPN QUERY -----------------------*/
442 int z_ComplexAttribute(ODR o, Z_ComplexAttribute **p, int opt)
444 if (!odr_sequence_begin(o, p, sizeof(**p)))
445 return opt && odr_ok(o);
447 odr_implicit_settag(o, ODR_CONTEXT, 1) &&
448 odr_sequence_of(o, z_StringOrNumeric, &(*p)->list,
450 odr_implicit_settag(o, ODR_CONTEXT, 2) &&
451 (odr_sequence_of(o, odr_integer, &(*p)->semanticAction,
452 &(*p)->num_semanticAction) || odr_ok(o)) &&
456 int z_AttributeElement(ODR o, Z_AttributeElement **p, int opt)
459 static Odr_arm arm[] =
461 {ODR_IMPLICIT, ODR_CONTEXT, 121, Z_AttributeValue_numeric,
463 {ODR_IMPLICIT, ODR_CONTEXT, 224, Z_AttributeValue_complex,
469 if (!odr_sequence_begin(o, p, sizeof(**p)))
470 return opt && odr_ok(o);
473 odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 1, 1) &&
475 odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT,
478 odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
480 odr_implicit(o, odr_integer, &(*p)->attributeValue, ODR_CONTEXT,
486 int z_Term(ODR o, Z_Term **p, int opt)
488 static Odr_arm arm[] =
490 {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_Term_general, odr_octetstring},
491 {ODR_IMPLICIT, ODR_CONTEXT, 215, Z_Term_numeric, odr_integer},
492 {ODR_IMPLICIT, ODR_CONTEXT, 216, Z_Term_characterString,
494 {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid, odr_oid},
495 {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime, odr_cstring},
496 {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external, odr_external},
497 /* add intUnit here */
498 {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null, odr_null},
502 if (o->direction ==ODR_DECODE)
503 *p = odr_malloc(o, sizeof(**p));
506 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
509 return opt && odr_ok(o);
512 int z_AttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt)
514 if (!(odr_implicit_settag(o, ODR_CONTEXT, 102) &&
515 odr_sequence_begin(o, p, sizeof(**p))))
516 return opt && odr_ok(o);
518 odr_implicit_settag(o, ODR_CONTEXT, 44) &&
519 odr_sequence_of(o, z_AttributeElement, &(*p)->attributeList,
520 &(*p)->num_attributes) &&
521 z_Term(o, &(*p)->term, 0) &&
525 int z_ResultSetPlusAttributes(ODR o, Z_ResultSetPlusAttributes **p, int opt)
527 if (!(odr_implicit_settag(o, ODR_CONTEXT, 214) &&
528 odr_sequence_begin(o, p, sizeof(**p))))
529 return opt && odr_ok(o);
531 z_ResultSetId(o, &(*p)->resultSet, 0) &&
532 odr_implicit_settag(o, ODR_CONTEXT, 44) &&
533 odr_sequence_of(o, z_AttributeElement, &(*p)->attributeList,
534 &(*p)->num_attributes) &&
538 int z_ProximityOperator(ODR o, Z_ProximityOperator **p, int opt)
540 static Odr_arm arm[] =
542 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxCode_known, odr_integer},
543 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxCode_private, odr_integer},
547 if (!odr_sequence_begin(o, p, sizeof(**p)))
548 return opt && odr_ok(o);
550 odr_implicit(o, odr_bool, &(*p)->exclusion, ODR_CONTEXT, 1, 1) &&
551 odr_implicit(o, odr_integer, &(*p)->distance, ODR_CONTEXT, 2, 0) &&
552 odr_implicit(o, odr_bool, &(*p)->ordered, ODR_CONTEXT, 3, 0) &&
553 odr_implicit(o, odr_integer, &(*p)->relationType, ODR_CONTEXT, 4, 0) &&
554 odr_constructed_begin(o, &(*p)->proximityUnitCode, ODR_CONTEXT, 5) &&
555 odr_choice(o, arm, &(*p)->proximityUnitCode, &(*p)->which) &&
556 odr_constructed_end(o) &&
560 int z_Operator(ODR o, Z_Operator **p, int opt)
562 static Odr_arm arm[] =
564 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Operator_and, odr_null},
565 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Operator_or, odr_null},
566 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Operator_and_not, odr_null},
567 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Operator_prox, z_ProximityOperator},
571 if (!*p && o->direction != ODR_DECODE)
573 if (!odr_constructed_begin(o, p, ODR_CONTEXT, 46))
574 return opt && odr_ok(o);
575 if (o->direction == ODR_DECODE)
576 *p = odr_malloc(o, sizeof(**p));
578 (*p)->u.and = ODR_NULLVAL;
580 if (odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
581 odr_constructed_end(o))
584 return opt && odr_ok(o);
587 int z_Operand(ODR o, Z_Operand **p, int opt)
589 static Odr_arm arm[] =
591 {-1, -1, -1, Z_Operand_APT, z_AttributesPlusTerm},
592 {-1, -1, -1, Z_Operand_resultSetId, z_ResultSetId},
593 {-1, -1, -1, Z_Operand_resultAttr, z_ResultSetPlusAttributes},
597 if (o->direction ==ODR_DECODE)
598 *p = odr_malloc(o, sizeof(**p));
601 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
604 return opt && odr_ok(o);
607 int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt);
609 int z_Complex(ODR o, Z_Complex **p, int opt)
611 if (!odr_sequence_begin(o, p, sizeof(**p)))
612 return opt && odr_ok(o);
614 z_RPNStructure(o, &(*p)->s1, 0) &&
615 z_RPNStructure(o, &(*p)->s2, 0) &&
616 z_Operator(o, &(*p)->operator, 0) &&
620 int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt)
622 static Odr_arm arm[] =
624 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_RPNStructure_simple, z_Operand},
625 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RPNStructure_complex, z_Complex},
629 if (o->direction == ODR_DECODE)
630 *p = odr_malloc(o, sizeof(**p));
633 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
636 return opt && odr_ok(o);
639 int z_RPNQuery(ODR o, Z_RPNQuery **p, int opt)
641 if (!odr_sequence_begin(o, p, sizeof(**p)))
642 return opt && odr_ok(o);
644 odr_oid(o, &(*p)->attributeSetId, 0) &&
645 z_RPNStructure(o, &(*p)->RPNStructure, 0) &&
649 /* -----------------------END RPN QUERY ----------------------- */
651 int z_Query(ODR o, Z_Query **p, int opt)
653 static Odr_arm arm[] =
655 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1, z_RPNQuery},
656 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2, odr_octetstring},
657 {ODR_EXPLICIT, ODR_CONTEXT, 101, Z_Query_type_101, z_RPNQuery},
661 if (o->direction == ODR_DECODE)
662 *p = odr_malloc(o, sizeof(**p));
665 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
668 return opt && odr_ok(o);
671 int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt)
675 if (!odr_sequence_begin(o, p, sizeof(**p)))
676 return opt && odr_ok(o);
679 z_ReferenceId(o, &pp->referenceId, 1) &&
680 odr_implicit(o, odr_integer, &pp->smallSetUpperBound, ODR_CONTEXT,
682 odr_implicit(o, odr_integer, &pp->largeSetLowerBound, ODR_CONTEXT,
684 odr_implicit(o, odr_integer, &pp->mediumSetPresentNumber, ODR_CONTEXT,
686 odr_implicit(o, odr_bool, &pp->replaceIndicator, ODR_CONTEXT, 16, 1) &&
687 odr_implicit(o, odr_visiblestring, &pp->resultSetName, ODR_CONTEXT,
689 odr_implicit_settag(o, ODR_CONTEXT, 18) &&
690 odr_sequence_of(o, z_DatabaseName, &pp->databaseNames,
691 &pp->num_databaseNames) &&
692 odr_explicit(o, z_ElementSetNames, &pp->smallSetElementSetNames,
693 ODR_CONTEXT, 100, 1) &&
694 odr_explicit(o, z_ElementSetNames, &pp->mediumSetElementSetNames,
695 ODR_CONTEXT, 101, 1) &&
696 odr_implicit(o, odr_oid, &pp->preferredRecordSyntax,
697 ODR_CONTEXT, 104, 1) &&
698 odr_explicit(o, z_Query, &pp->query, ODR_CONTEXT, 21, 0) &&
700 odr_implicit(o, z_OtherInformation, &(*p)->additionalSearchInfo,
701 ODR_CONTEXT, 203, 1) &&
702 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
707 /* ------------------------ RECORD ------------------------- */
709 int z_DatabaseRecord(ODR o, Z_DatabaseRecord **p, int opt)
711 return odr_external(o, (Odr_external **) p, opt);
714 int z_DiagRec(ODR o, Z_DiagRec **p, int opt)
716 if (!odr_sequence_begin(o, p, sizeof(**p)))
717 return opt && odr_ok(o);
719 odr_oid(o, &(*p)->diagnosticSetId, 1) && /* SHOULD NOT BE OPT! */
720 odr_integer(o, &(*p)->condition, 0) &&
722 * I no longer recall what server tagged the addinfo.. but it isn't
723 * hurting anyone, so...
724 * We need to turn it into a choice, or something, because of
725 * that damn generalstring in v3.
727 (odr_visiblestring(o, &(*p)->addinfo, 0) ||
728 odr_implicit(o, odr_cstring, &(*p)->addinfo, ODR_CONTEXT,
729 ODR_VISIBLESTRING, 1)) &&
733 int z_NamePlusRecord(ODR o, Z_NamePlusRecord **p, int opt)
735 static Odr_arm arm[] =
737 {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_NamePlusRecord_databaseRecord,
739 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_NamePlusRecord_surrogateDiagnostic,
744 if (!odr_sequence_begin(o, p, sizeof(**p)))
745 return opt && odr_ok(o);
747 odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT,
749 odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1) &&
750 odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
751 odr_constructed_end(o) &&
755 int z_NamePlusRecordList(ODR o, Z_NamePlusRecordList **p, int opt)
757 if (o->direction == ODR_DECODE)
758 *p = odr_malloc(o, sizeof(**p));
759 if (odr_sequence_of(o, z_NamePlusRecord, &(*p)->records,
766 int z_Records(ODR o, Z_Records **p, int opt)
770 {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_Records_DBOSD, z_NamePlusRecordList},
771 {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD, z_DiagRec},
775 if (o->direction == ODR_DECODE)
776 *p = odr_malloc(o, sizeof(**p));
779 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
782 return opt && odr_ok(o);
785 /* ------------------------ ACCESS CTRL SERVICE ----------------------- */
787 int z_AccessControlRequest(ODR o, Z_AccessControlRequest **p, int opt)
789 static Odr_arm arm[] =
791 {ODR_IMPLICIT, ODR_CONTEXT, 37, Z_AccessRequest_simpleForm,
793 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessRequest_externallyDefined,
797 if (!odr_sequence_begin(o, p, sizeof(**p)))
798 return opt && odr_ok(o);
800 z_ReferenceId(o, &(*p)->referenceId, 1) &&
801 odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
803 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
808 int z_AccessControlResponse(ODR o, Z_AccessControlResponse **p, int opt)
810 static Odr_arm arm[] =
812 {ODR_IMPLICIT, ODR_CONTEXT, 38, Z_AccessResponse_simpleForm,
814 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessResponse_externallyDefined,
818 if (!odr_sequence_begin(o, p, sizeof(**p)))
819 return opt && odr_ok(o);
821 z_ReferenceId(o, &(*p)->referenceId, 1) &&
822 odr_choice(o, arm, &(*p)->u, &(*p)->which) &&
823 odr_explicit(o, z_DiagRec, &(*p)->diagnostic, ODR_CONTEXT, 223, 1) &&
825 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
830 /* ------------------------ SCAN SERVICE -------------------- */
832 int z_AttributeList(ODR o, Z_AttributeList **p, int opt)
834 if (o->direction == ODR_DECODE)
835 *p = odr_malloc(o, sizeof(**p));
839 odr_implicit_settag(o, ODR_CONTEXT, 44);
840 if (odr_sequence_of(o, z_AttributeElement, &(*p)->attributes,
841 &(*p)->num_attributes))
844 return opt && odr_ok(o);
848 * This is a temporary hack. We don't know just *what* old version of the
849 * protocol willow uses, so we'll just patiently wait for them to update
851 static int willow_scan = 0;
853 int z_WillowAttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt)
855 if (!*p && o->direction != ODR_DECODE)
857 if (!odr_constructed_begin(o, p, ODR_CONTEXT, 4))
860 return opt && odr_ok(o);
862 if (!odr_constructed_begin(o, p, ODR_CONTEXT, 1))
864 if (!odr_constructed_begin(o, p, ODR_UNIVERSAL, ODR_SEQUENCE))
866 if (!odr_implicit_settag(o, ODR_CONTEXT, 44))
868 if (o->direction == ODR_DECODE)
869 *p = odr_malloc(o, sizeof(**p));
870 if (!odr_sequence_of(o, z_AttributeElement, &(*p)->attributeList,
871 &(*p)->num_attributes))
873 if (!odr_sequence_end(o) || !odr_sequence_end(o))
875 if (!z_Term(o, &(*p)->term, 0))
877 if (!odr_constructed_end(o))
883 int z_AlternativeTerm(ODR o, Z_AlternativeTerm **p, int opt)
885 if (o->direction == ODR_DECODE)
886 *p = odr_malloc(o, sizeof(**p));
890 return opt && odr_ok(o);
893 if (odr_sequence_of(o, z_AttributesPlusTerm, &(*p)->terms,
897 return opt && !o->error;
900 int z_OccurrenceByAttributes(ODR o, Z_OccurrenceByAttributes **p, int opt)
902 if (!odr_sequence_begin(o, p, sizeof(**p)))
903 return opt && odr_ok(o);
905 odr_explicit(o, z_AttributeList, &(*p)->attributes, ODR_CONTEXT, 1, 1)&&
906 odr_explicit(o, odr_integer, &(*p)->global, ODR_CONTEXT, 2, 1) &&
910 int z_TermInfo(ODR o, Z_TermInfo **p, int opt)
912 if (!odr_sequence_begin(o, p, sizeof(**p)))
913 return opt && odr_ok(o);
916 odr_implicit(o, z_Term, &(*p)->term, ODR_CONTEXT, 1, 0) :
917 z_Term(o, &(*p)->term, 0)) &&
918 z_AttributeList(o, &(*p)->suggestedAttributes, 1) &&
919 odr_implicit(o, z_AlternativeTerm, &(*p)->alternativeTerm,
920 ODR_CONTEXT, 4, 1) &&
921 odr_implicit(o, odr_integer, &(*p)->globalOccurrences, ODR_CONTEXT,
923 odr_implicit(o, z_OccurrenceByAttributes, &(*p)->byAttributes,
924 ODR_CONTEXT, 3, 1) &&
928 int z_Entry(ODR o, Z_Entry **p, int opt)
930 static Odr_arm arm[] =
932 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Entry_termInfo, z_TermInfo},
933 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Entry_surrogateDiagnostic,
938 if (o->direction == ODR_DECODE)
939 *p = odr_malloc(o, sizeof(**p));
941 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
944 return opt && odr_ok(o);
947 int z_Entries(ODR o, Z_Entries **p, int opt)
949 if (o->direction == ODR_DECODE)
950 *p = odr_malloc(o, sizeof(**p));
954 if (odr_sequence_of(o, z_Entry, &(*p)->entries,
961 int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt)
963 if (o->direction == ODR_DECODE)
964 *p = odr_malloc(o, sizeof(**p));
968 if (odr_sequence_of(o, z_DiagRec, &(*p)->diagRecs,
969 &(*p)->num_diagRecs))
975 int z_ListEntries(ODR o, Z_ListEntries **p, int opt)
977 static Odr_arm arm[] =
979 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ListEntries_entries, z_Entries},
980 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ListEntries_nonSurrogateDiagnostics,
985 if (o->direction == ODR_DECODE)
986 *p = odr_malloc(o, sizeof(**p));
988 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
991 return opt && odr_ok(o);
994 int z_ScanRequest(ODR o, Z_ScanRequest **p, int opt)
996 if (!odr_sequence_begin(o, p, sizeof(**p)))
997 return opt && odr_ok(o);
1000 z_ReferenceId(o, &(*p)->referenceId, 1) &&
1001 odr_implicit_settag(o, ODR_CONTEXT, 3) &&
1002 odr_sequence_of(o, z_DatabaseName, &(*p)->databaseNames,
1003 &(*p)->num_databaseNames) &&
1004 odr_oid(o, &(*p)->attributeSet, 1) &&
1005 (z_AttributesPlusTerm(o, &(*p)->termListAndStartPoint, 1) ?
1006 ((*p)->termListAndStartPoint ? 1 :
1007 z_WillowAttributesPlusTerm(o, &(*p)->termListAndStartPoint, 0)) : 0) &&
1008 odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 5, 1) &&
1009 odr_implicit(o, odr_integer, &(*p)->numberOfTermsRequested,
1010 ODR_CONTEXT, 6, 0) &&
1011 odr_implicit(o, odr_integer, &(*p)->preferredPositionInResponse,
1012 ODR_CONTEXT, 7, 1) &&
1013 odr_sequence_end(o);
1016 int z_ScanResponse(ODR o, Z_ScanResponse **p, int opt)
1018 if (!odr_sequence_begin(o, p, sizeof(**p)))
1019 return opt && odr_ok(o);
1021 z_ReferenceId(o, &(*p)->referenceId, 1) &&
1022 odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 3, 1) &&
1023 odr_implicit(o, odr_integer, &(*p)->scanStatus, ODR_CONTEXT, 4, 0) &&
1024 odr_implicit(o, odr_integer, &(*p)->numberOfEntriesReturned,
1025 ODR_CONTEXT, 5, 0) &&
1026 odr_implicit(o, odr_integer, &(*p)->positionOfTerm, ODR_CONTEXT, 6, 1)&&
1027 odr_explicit(o, z_ListEntries, &(*p)->entries, ODR_CONTEXT, 7, 1) &&
1028 odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 8, 1) &&
1029 odr_sequence_end(o);
1032 /* ------------------------ SEARCHRESPONSE ----------------*/
1034 int z_NumberOfRecordsReturned(ODR o, int **p, int opt)
1036 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 24, opt);
1039 int z_NextResultSetPosition(ODR o, int **p, int opt)
1041 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 25, opt);
1044 int z_PresentStatus(ODR o, int **p, int opt)
1046 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 27, opt);
1049 int z_SearchResponse(ODR o, Z_SearchResponse **p, int opt)
1051 Z_SearchResponse *pp;
1053 if (!odr_sequence_begin(o, p, sizeof(**p)))
1054 return opt && odr_ok(o);
1057 z_ReferenceId(o, &pp->referenceId, 1) &&
1058 odr_implicit(o, odr_integer, &pp->resultCount, ODR_CONTEXT, 23, 0) &&
1059 z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0) &&
1060 z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0) &&
1061 odr_implicit(o, odr_bool, &pp->searchStatus, ODR_CONTEXT, 22, 0) &&
1062 odr_implicit(o, odr_integer, &pp->resultSetStatus, ODR_CONTEXT, 26,
1064 z_PresentStatus(o, &pp->presentStatus, 1) &&
1065 z_Records(o, &pp->records, 1) &&
1067 odr_implicit(o, z_OtherInformation, &(*p)->additionalSearchInfo,
1068 ODR_CONTEXT, 203, 1) &&
1069 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
1071 odr_sequence_end(o);
1074 /* --------------------- PRESENT SERVICE ---------------------- */
1076 int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt)
1078 static Odr_arm arm[] =
1080 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSpec_elementSetName,
1082 {ODR_IMPLICIT; ODR_CONTEXT, 2, Z_ElementSpec_externalSpec,
1087 if (o->direction == ODR_DECODE)
1088 *p = odr_malloc(o, sizeof(**p));
1090 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
1093 return opt && odr_ok(o);
1096 int z_Specification(ODR o, Z_Specification **p, int opt)
1098 if (!odr_sequence_begin(o, p, sizeof(**p)))
1099 return opt && odr_ok(o);
1101 odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 1, 1) &&
1102 z_ElementSpec(o, &(*p)->elementSpec, 1) &&
1103 odr_sequence_end(o);
1106 int z_DbSpecific(ODR o, Z_DbSpecific **p, int opt)
1108 if (!odr_sequence_begin(o, p, sizeof(**p)))
1109 return opt && odr_ok(o);
1111 odr_explicit(o, z_DatabaseName, &(*p)->db, ODR_CONTEXT, 1, 0) &&
1112 odr_implicit(o, z_Specification, &(*p)->spec, ODR_CONTEXT, 2, 0) &&
1113 odr_sequence_end(o);
1116 int z_CompSpec(ODR o, Z_CompSpec **p, int opt)
1118 if (!odr_sequence_begin(o, p, sizeof(**p)))
1119 return opt && odr_ok(o);
1121 odr_implicit(o, odr_bool, &(*p)->selectAlternativeSyntax, ODR_CONTEXT,
1123 odr_implicit(o, z_Specification, &(*p)->generic, ODR_CONTEXT, 2, 1) &&
1124 odr_implicit_settag(o, ODR_CONTEXT, 3) &&
1125 (odr_sequence_of(o, z_DbSpecific, &(*p)->num_dbSpecific,
1126 &(*p)->dbSpecific) || odr_ok(o)) &&
1127 odr_implicit_settag(o, ODR_CONTEXT, 4) &&
1128 (odr_sequence_of(o, odr_oid, &(*p)->num_recordSyntax,
1129 &(*p)->recordSyntax) || odr_ok(o)) &&
1130 odr_sequence_end(o);
1133 int z_RecordComposition(ODR o, Z_RecordComposition **p, int opt)
1135 static Odr_arm arm[] =
1137 {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_RecordComp_simple,
1139 {ODR_IMPLICIT, ODR_CONTEXT, 209, Z_RecordComp_complex,
1144 if (o->direction == ODR_DECODE)
1145 *p = odr_malloc(o, sizeof(**p));
1147 if (odr_choice(o, arm, &(*p)->u, &(*p)->which))
1150 return opt && odr_ok(o);
1153 int z_Range(ODR o, Z_Range **p, int opt)
1155 if (!odr_sequence_begin(o, p, sizeof(**p)))
1156 return opt && odr_ok(o);
1158 odr_implicit(o, odr_integer, &(*p)->startingPosition, ODR_CONTEXT,
1160 odr_implicit(o, odr_integer, &(*p)->numberOfRecords, ODR_CONTEXT,
1162 odr_sequence_end(o);
1165 int z_PresentRequest(ODR o, Z_PresentRequest **p, int opt)
1167 Z_PresentRequest *pp;
1169 if (!odr_sequence_begin(o, p, sizeof(**p)))
1170 return opt && odr_ok(o);
1173 z_ReferenceId(o, &pp->referenceId, 1) &&
1174 z_ResultSetId(o, &pp->resultSetId, 0) &&
1175 odr_implicit(o, odr_integer, &pp->resultSetStartPoint, ODR_CONTEXT,
1177 odr_implicit(o, odr_integer, &pp->numberOfRecordsRequested, ODR_CONTEXT,
1180 odr_implicit_settag(o, ODR_CONTEXT, 212) &&
1181 (odr_sequence_of(o, z_Range, &(*p)->num_ranges,
1182 &(*p)->additionalRanges) || odr_ok(o)) &&
1183 z_RecordComposition(o, &(*p)->recordComposition, 1) &&
1185 z_ElementSetNames(o, &pp->elementSetNames, 1) &&
1187 odr_implicit(o, odr_oid, &(*p)->preferredRecordSyntax, ODR_CONTEXT,
1190 odr_implicit(o, odr_integer, &(*p)->maxSegmentCount, ODR_CONTEXT,
1192 odr_implicit(o, odr_integer, &(*p)->maxRecordSize, ODR_CONTEXT,
1194 odr_impplicit(o, odr_integer, &(*p)->maxSegmentSize, ODR_CONTEXT,
1196 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
1198 odr_sequence_end(o);
1201 int z_PresentResponse(ODR o, Z_PresentResponse **p, int opt)
1203 Z_PresentResponse *pp;
1205 if (!odr_sequence_begin(o, p, sizeof(**p)))
1206 return opt && odr_ok(o);
1209 z_ReferenceId(o, &pp->referenceId, 1) &&
1210 z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0) &&
1211 z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0) &&
1212 z_PresentStatus(o, &pp->presentStatus, 0) &&
1213 z_Records(o, &pp->records, 1) &&
1215 Z_OtherInformation(o, &(*p)->otherInfo, 1) &&
1217 odr_sequence_end(o);
1220 /* ----------------------DELETE -------------------------- */
1222 int z_DeleteSetStatus(ODR o, int **p, int opt)
1224 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 33, opt);
1227 int z_ListStatus(ODR o, Z_ListStatus **p, int opt)
1229 if (!odr_sequence_begin(o, p, sizeof(**p)))
1230 return opt && odr_ok(o);
1232 z_ResultSetId(o, &(*p)->id, 0) &&
1233 z_DeleteSetStatus(o, &(*p)->status, 0) &&
1234 odr_sequence_end(o);
1237 int z_DeleteResultSetRequest(ODR o, Z_DeleteResultSetRequest **p, int opt)
1239 if (!odr_sequence_begin(o, p, sizeof(**p)))
1240 return opt && odr_ok(o);
1242 z_ReferenceId(o, &(*p)->referenceId, 1) &&
1243 odr_implicit(o, odr_integer, &(*p)->deleteFunction, ODR_CONTEXT, 32,
1245 (odr_sequence_of(o, z_ListStatus, &(*p)->resultSetList,
1246 &(*p)->num_ids) || odr_ok(o)) &&
1248 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
1250 odr_sequence_end(o);
1253 int z_DeleteResultSetResponse(ODR o, Z_DeleteResultSetResponse **p, int opt)
1255 if (!odr_sequence_begin(o, p, sizeof(**p)))
1256 return opt && odr_ok(o);
1258 z_ReferenceId(o, &(*p)->referenceId, 1) &&
1259 odr_implicit(o, z_DeleteSetStatus, &(*p)->deleteOperationStatus,
1260 ODR_CONTEXT, 0, 1) &&
1261 odr_implicit_settag(o, ODR_CONTEXT, 1) &&
1262 (odr_sequence_of(o, z_ListStatus, &(*p)->deleteListStatuses,
1263 &(*p)->num_statuses) || odr_ok(o)) &&
1264 odr_implicit(o, odr_integer, &(*p)->numberNotDeleted, ODR_CONTEXT,
1266 odr_implicit_settag(o, ODR_CONTEXT, 35) &&
1267 (odr_sequence_of(o, z_ListStatus, &(*p)->bulkStatuses,
1268 &(*p)->num_bulkStatuses) || odr_ok(o)) &&
1269 odr_implicit(o, odr_visiblestring, &(*p)->deleteMessage, ODR_CONTEXT,
1272 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
1274 odr_sequence_end(o);
1277 /* ------------------------ SEGMENT SERVICE -------------- */
1279 int z_Segment(ODR o, Z_Segment **p, int opt)
1281 if (!odr_sequence_begin(o, p, sizeof(**p)))
1282 return opt && odr_ok(o);
1284 z_ReferenceId(o, &(*p)->referenceId, 1) &&
1285 odr_implicit(o, odr_integer, &(*p)->numberOfRecordsReturned,
1286 ODR_CONTEXT, 24, 0) &&
1287 odr_implicit_settag(o, ODR_CONTEXT, 0) &&
1288 odr_sequence_of(o, z_NamePlusRecord, &(*p)->num_segmentRecords,
1289 &(*p)->segmentRecords) &&
1290 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
1291 odr_sequence_end(o);
1294 /* ------------------------ CLOSE SERVICE ---------------- */
1296 int z_Close(ODR o, Z_Close **p, int opt)
1298 if (!odr_sequence_begin(o, p, sizeof(**p)))
1299 return opt && odr_ok(o);
1301 z_ReferenceId(o, &(*p)->referenceId, 1) &&
1302 odr_implicit(o, odr_integer, &(*p)->closeReason, ODR_CONTEXT, 211, 0) &&
1303 odr_implicit(o, odr_visiblestring, &(*p)->diagnosticInformation,
1304 ODR_CONTEXT, 3, 1) &&
1305 odr_implicit(o, odr_oid, &(*p)->resourceReportFormat, ODR_CONTEXT,
1307 odr_implicit(o, odr_external, &(*p)->resourceReport, ODR_CONTEXT,
1310 z_OtherInformation(o, &(*p)->otherInfo, 1) &&
1312 odr_sequence_end(o);
1315 /* ------------------------ APDU ------------------------- */
1317 int z_APDU(ODR o, Z_APDU **p, int opt)
1319 static Odr_arm arm[] =
1321 {ODR_IMPLICIT, ODR_CONTEXT, 20, Z_APDU_initRequest, z_InitRequest},
1322 {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse, z_InitResponse},
1323 {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest, z_SearchRequest},
1324 {ODR_IMPLICIT, ODR_CONTEXT, 23, Z_APDU_searchResponse,
1326 {ODR_IMPLICIT, ODR_CONTEXT, 24, Z_APDU_presentRequest,
1328 {ODR_IMPLICIT, ODR_CONTEXT, 25, Z_APDU_presentResponse,
1330 {ODR_IMPLICIT, ODR_CONTEXT, 26, Z_APDU_deleteResultSetRequest,
1331 z_DeleteResultSetRequest},
1332 {ODR_IMPLICIT, ODR_CONTEXT, 27, Z_APDU_deleteResultSetResponse,
1333 z_DeleteResultSetResponse},
1334 {ODR_IMPLICIT, ODR_CONTEXT, 30, Z_APDU_resourceControlRequest,
1335 z_ResourceControlRequest},
1336 {ODR_IMPLICIT, ODR_CONTEXT, 31, Z_APDU_resourceControlResponse,
1337 z_ResourceControlResponse},
1338 {ODR_IMPLICIT, ODR_CONTEXT, 32, Z_APDU_triggerResourceControlRequest,
1339 z_TriggerResourceControlRequest},
1340 {ODR_IMPLICIT, ODR_CONTEXT, 35, Z_APDU_scanRequest, z_ScanRequest},
1341 {ODR_IMPLICIT, ODR_CONTEXT, 36, Z_APDU_scanResponse, z_ScanResponse},
1342 {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_APDU_segmentRequest, z_Segment},
1343 {ODR_IMPLICIT, ODR_CONTEXT, 48, Z_APDU_close, z_Close},
1348 if (o->direction == ODR_DECODE)
1349 *p = odr_malloc(o, sizeof(**p));
1350 if (!odr_choice(o, arm, &(*p)->u, &(*p)->which))
1352 if (o->direction == ODR_DECODE)
1354 return opt && odr_ok(o);