2 * Copyright (c) 1995-1999, Index Data
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.59 1999-04-21 11:46:00 adam
8 * Fixed bug in {en,de}coder for OtherInformation.
10 * Revision 1.58 1999/04/20 09:56:47 adam
11 * Added 'name' paramter to encoder/decoder routines (typedef Odr_fun).
12 * Modified all encoders/decoders to reflect this change.
14 * Revision 1.57 1998/10/20 13:55:37 quinn
15 * Fixed Scan bug in asn and client
17 * Revision 1.56 1998/08/19 16:10:04 adam
18 * Changed som member names of DeleteResultSetRequest/Response.
20 * Revision 1.55 1998/02/11 11:53:32 adam
21 * Changed code so that it compiles as C++.
23 * Revision 1.54 1996/11/11 13:14:46 adam
24 * Fixed tagging bug in z_ProximityOperator.
26 * Revision 1.53 1996/10/09 15:54:55 quinn
27 * Added SearchInfoReport
29 * Revision 1.52 1996/10/08 12:56:57 adam
30 * Bug fix: tagging of type 101 query.
32 * Revision 1.51 1996/07/26 14:07:21 quinn
35 * Revision 1.50 1996/07/26 13:36:15 quinn
38 * Revision 1.49 1996/07/06 19:58:28 quinn
39 * System headerfiles gathered in yconfig
41 * Revision 1.48 1996/06/10 08:53:33 quinn
42 * Added Summary,OPAC,ResourceReport
44 * Revision 1.47 1996/05/29 15:47:50 quinn
45 * Fixed in bug DiagRecs decoder. Thanks to Linda Harris.
47 * Revision 1.46 1996/04/10 11:39:42 quinn
48 * Fixed bug in UserInfo
50 * Revision 1.45 1996/02/23 10:00:25 quinn
53 * Revision 1.44 1996/02/20 12:51:41 quinn
54 * Completed SCAN. Fixed problems with EXTERNAL.
56 * Revision 1.43 1996/02/10 12:22:49 quinn
59 * Revision 1.42 1996/01/22 09:46:31 quinn
60 * Added Sort PDU. Moved StringList to main protocol file.
62 * Revision 1.41 1996/01/10 15:21:24 quinn
63 * Added links to access control PDUs
65 * Revision 1.40 1996/01/02 11:46:40 quinn
66 * Changed 'operator' to 'roperator' to avoid C++ conflict.
68 * Revision 1.39 1995/09/29 17:11:53 quinn
71 * Revision 1.38 1995/09/27 15:02:40 quinn
72 * Modified function heads & prototypes.
74 * Revision 1.37 1995/08/21 09:10:15 quinn
75 * Smallish fixes to suppport new formats.
77 * Revision 1.36 1995/08/15 11:59:39 quinn
80 * Revision 1.35 1995/08/10 08:53:59 quinn
83 * Revision 1.34 1995/06/19 17:01:48 quinn
84 * This should bring us in sync with the version distributed as 1.0b
86 * Revision 1.33 1995/06/19 13:39:56 quinn
87 * *** empty log message ***
89 * Revision 1.32 1995/06/19 12:37:28 quinn
90 * Fixed a bug in the compspec.
92 * Revision 1.31 1995/06/16 13:15:56 quinn
93 * Fixed Defaultdiagformat.
95 * Revision 1.30 1995/06/15 15:42:01 quinn
98 * Revision 1.29 1995/06/15 07:44:49 quinn
101 * Revision 1.28 1995/06/14 15:26:35 quinn
102 * *** empty log message ***
104 * Revision 1.27 1995/06/07 14:36:22 quinn
107 * Revision 1.26 1995/06/02 09:49:13 quinn
108 * Adding access control
110 * Revision 1.25 1995/05/25 11:00:08 quinn
111 * *** empty log message ***
113 * Revision 1.24 1995/05/22 13:58:18 quinn
114 * Fixed an ODR_NULLVAL.
116 * Revision 1.23 1995/05/22 11:30:18 quinn
117 * Adding Z39.50-1992 stuff to proto.c. Adding zget.c
119 * Revision 1.22 1995/05/17 08:40:56 quinn
120 * Added delete. Fixed some sequence_begins. Smallish.
122 * Revision 1.21 1995/05/16 08:50:24 quinn
123 * License, documentation, and memory fixes
125 * Revision 1.20 1995/05/15 11:55:25 quinn
128 * Revision 1.19 1995/04/11 11:58:35 quinn
131 * Revision 1.18 1995/04/11 11:52:02 quinn
132 * Fixed possible buf in proto.c
134 * Revision 1.17 1995/04/10 10:22:22 quinn
137 * Revision 1.16 1995/03/30 10:26:43 quinn
138 * Added Term structure
140 * Revision 1.15 1995/03/30 09:08:39 quinn
141 * Added Resource control protocol
143 * Revision 1.14 1995/03/29 08:06:13 quinn
144 * Added a few v3 elements
146 * Revision 1.13 1995/03/20 11:26:52 quinn
147 * *** empty log message ***
149 * Revision 1.12 1995/03/20 09:45:09 quinn
152 * Revision 1.11 1995/03/17 10:17:25 quinn
153 * Added memory management.
155 * Revision 1.10 1995/03/15 11:17:40 quinn
156 * Fixed some return-checks from choice.. need better ay to handle those..
158 * Revision 1.9 1995/03/15 08:37:06 quinn
159 * Fixed protocol bugs.
161 * Revision 1.8 1995/03/14 16:59:24 quinn
162 * Fixed OPTIONAL flag in attributeelement
164 * Revision 1.7 1995/03/07 16:29:33 quinn
165 * Added authentication stuff.
167 * Revision 1.6 1995/03/01 14:46:03 quinn
168 * Fixed protocol bug in 8777query.
170 * Revision 1.5 1995/02/14 11:54:22 quinn
173 * Revision 1.4 1995/02/10 15:54:30 quinn
176 * Revision 1.3 1995/02/09 15:51:39 quinn
179 * Revision 1.2 1995/02/06 21:26:07 quinn
180 * Repaired this evening's damages..
182 * Revision 1.1 1995/02/06 16:44:47 quinn
183 * First hack at Z/SR protocol
191 /* ---------------------- GLOBAL DEFS ------------------- */
194 * We'll use a general octetstring here, since string operations are
195 * clumsy on long strings.
197 int z_SUTRS(ODR o, Odr_oct **p, int opt, const char *name)
199 return odr_implicit(o, odr_octetstring, p, ODR_UNIVERSAL,
200 ODR_GENERALSTRING, opt);
203 int z_ReferenceId(ODR o, Z_ReferenceId **p, int opt, const char *name)
205 return odr_implicit(o, odr_octetstring, (Odr_oct**) p, ODR_CONTEXT, 2,
209 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt, const char *name)
211 return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 105,
215 int z_ResultSetId(ODR o, char **p, int opt, const char *name)
217 return odr_implicit(o, odr_visiblestring, (char **) p, ODR_CONTEXT, 31,
221 int z_ElementSetName(ODR o, char **p, int opt, const char *name)
223 return odr_implicit(o, odr_visiblestring, p, ODR_CONTEXT, 103, opt);
226 int z_UserInformationField(ODR o, Z_External **p, int opt, const char *name)
228 return odr_explicit(o, z_External, (Z_External **)p, ODR_CONTEXT,
232 int z_InternationalString(ODR o, char **p, int opt, const char *name)
234 return odr_generalstring(o, p, opt, 0);
237 int z_InfoCategory(ODR o, Z_InfoCategory **p, int opt, const char *name)
239 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
240 return opt && odr_ok(o);
242 odr_implicit(o, odr_oid, &(*p)->categoryTypeId, ODR_CONTEXT, 1, 1) &&
243 odr_implicit(o, odr_integer, &(*p)->categoryValue, ODR_CONTEXT, 2,
248 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt,
251 static Odr_arm arm[] =
253 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_OtherInfo_characterInfo,
254 odr_visiblestring, 0},
255 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_OtherInfo_binaryInfo,
256 (Odr_fun)odr_octetstring, 0},
257 {ODR_IMPLICIT, ODR_CONTEXT, 4, Z_OtherInfo_externallyDefinedInfo,
258 (Odr_fun)z_External, 0},
259 {ODR_IMPLICIT, ODR_CONTEXT, 5, Z_OtherInfo_oid,
260 (Odr_fun)odr_oid, 0},
261 {-1, -1, -1, -1, 0, 0}
264 if (!odr_sequence_begin(o, p, sizeof(**p), name))
265 return opt && odr_ok(o);
267 odr_implicit(o, z_InfoCategory, &(*p)->category, ODR_CONTEXT, 1, 1) &&
268 odr_choice(o, arm, &(*p)->information, &(*p)->which, name) &&
272 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt,
275 if (!odr_initmember (o, p, sizeof(**p)))
276 return opt && odr_ok(o);
277 odr_implicit_settag(o, ODR_CONTEXT, 201);
278 if (odr_sequence_of(o, (Odr_fun)z_OtherInformationUnit, &(*p)->list,
279 &(*p)->num_elements, name))
282 return opt && odr_ok(o);
285 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt, const char *name)
287 static Odr_arm arm[] =
289 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_StringOrNumeric_string,
290 odr_visiblestring, 0},
291 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_StringOrNumeric_numeric,
292 (Odr_fun)odr_integer, 0},
293 {-1, -1, -1, -1, 0, 0}
296 if (o->direction == ODR_DECODE)
297 *p = (Z_StringOrNumeric *)odr_malloc(o, sizeof(**p));
300 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
303 return opt && odr_ok(o);
309 int z_Unit(ODR o, Z_Unit **p, int opt, const char *name)
311 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
312 return opt && odr_ok(o);
314 odr_explicit(o, z_InternationalString, &(*p)->unitSystem, ODR_CONTEXT,
316 odr_explicit(o, z_StringOrNumeric, &(*p)->unitType, ODR_CONTEXT,
318 odr_explicit(o, z_StringOrNumeric, &(*p)->unit, ODR_CONTEXT, 3, 1) &&
319 odr_implicit(o, odr_integer, &(*p)->scaleFactor, ODR_CONTEXT, 4, 1) &&
323 int z_IntUnit(ODR o, Z_IntUnit **p, int opt, const char *name)
325 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
326 return opt && odr_ok(o);
328 odr_implicit(o, odr_integer, &(*p)->value, ODR_CONTEXT, 1, 0) &&
329 odr_implicit(o, z_Unit, &(*p)->unitUsed, ODR_CONTEXT, 2, 0) &&
333 int z_StringList(ODR o, Z_StringList **p, int opt, const char *name)
335 if (o->direction == ODR_DECODE)
336 *p = (Z_StringList *)odr_malloc(o, sizeof(**p));
339 if (odr_sequence_of(o, (Odr_fun)z_InternationalString, &(*p)->strings,
340 &(*p)->num_strings, 0))
343 return opt && odr_ok(o);
346 /* ---------------------- INITIALIZE SERVICE ------------------- */
349 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt,
352 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
353 return opt && odr_ok(o);
355 odr_visiblestring(o, &(*p)->user, 0, 0) &&
356 odr_visiblestring(o, &(*p)->password, 0, 0) &&
357 odr_visiblestring(o, &(*p)->account, 0, 0) &&
362 int z_IdPass(ODR o, Z_IdPass **p, int opt, const char *name)
364 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
365 return opt && odr_ok(o);
367 odr_implicit(o, odr_visiblestring, &(*p)->groupId, ODR_CONTEXT, 0,
369 odr_implicit(o, odr_visiblestring, &(*p)->userId, ODR_CONTEXT, 1, 1) &&
370 odr_implicit(o, odr_visiblestring, &(*p)->password, ODR_CONTEXT, 2,
375 int z_StrAuthentication(ODR o, char **p, int opt, const char *name)
377 return odr_visiblestring(o, p, opt, 0);
380 int z_IdAuthentication(ODR o, Z_IdAuthentication **p, int opt,
383 static Odr_arm arm[] =
385 {-1, -1, -1, Z_IdAuthentication_open, z_StrAuthentication, 0},
386 {-1, -1, -1, Z_IdAuthentication_idPass, (Odr_fun)z_IdPass, 0},
387 {-1, -1, -1, Z_IdAuthentication_anonymous, (Odr_fun)odr_null, 0},
388 {-1, -1, -1, Z_IdAuthentication_other, (Odr_fun)z_External, 0},
389 {-1, -1, -1, -1, 0, 0}
392 if (o->direction == ODR_DECODE)
393 *p = (Z_IdAuthentication *)odr_malloc(o, sizeof(**p));
397 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
400 return opt && odr_ok(o);
403 int z_InitRequest(ODR o, Z_InitRequest **p, int opt, const char *name)
407 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
408 return opt && odr_ok(o);
411 z_ReferenceId(o, &pp->referenceId, 1, 0) &&
412 odr_implicit(o, odr_bitstring, &pp->protocolVersion,
413 ODR_CONTEXT, 3, 0) &&
414 odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) &&
415 odr_implicit(o, odr_integer, &pp->preferredMessageSize, ODR_CONTEXT,
417 odr_implicit(o, odr_integer, &pp->maximumRecordSize,
418 ODR_CONTEXT, 6, 0) &&
419 odr_explicit(o, z_IdAuthentication, &pp->idAuthentication,
420 ODR_CONTEXT, 7, 1) &&
421 odr_implicit(o, odr_visiblestring, &pp->implementationId,
422 ODR_CONTEXT, 110, 1) &&
423 odr_implicit(o, odr_visiblestring, &pp->implementationName,
424 ODR_CONTEXT, 111, 1) &&
425 odr_implicit(o, odr_visiblestring, &pp->implementationVersion,
426 ODR_CONTEXT, 112, 1) &&
427 z_UserInformationField(o, &pp->userInformationField, 1, 0) &&
428 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
432 int z_InitResponse(ODR o, Z_InitResponse **p, int opt, const char *name)
436 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
437 return opt && odr_ok(o);
440 z_ReferenceId(o, &pp->referenceId, 1, 0) &&
441 odr_implicit(o, odr_bitstring, &pp->protocolVersion,
442 ODR_CONTEXT, 3, 0) &&
443 odr_implicit(o, odr_bitstring, &pp->options, ODR_CONTEXT, 4, 0) &&
444 odr_implicit(o, odr_integer, &pp->preferredMessageSize,
445 ODR_CONTEXT, 5, 0) &&
446 odr_implicit(o, odr_integer, &pp->maximumRecordSize,
447 ODR_CONTEXT, 6, 0) &&
448 odr_implicit(o, odr_bool, &pp->result, ODR_CONTEXT, 12, 0) &&
449 odr_implicit(o, odr_visiblestring, &pp->implementationId,
450 ODR_CONTEXT, 110, 1) &&
451 odr_implicit(o, odr_visiblestring, &pp->implementationName,
452 ODR_CONTEXT, 111, 1) &&
453 odr_implicit(o, odr_visiblestring, &pp->implementationVersion,
454 ODR_CONTEXT, 112, 1) &&
455 z_UserInformationField(o, &pp->userInformationField, 1, 0) &&
456 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
460 /* ------------------ RESOURCE CONTROL ----------------*/
462 int z_TriggerResourceControlRequest(ODR o, Z_TriggerResourceControlRequest **p,
463 int opt, const char *name)
465 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
466 return opt && odr_ok(o);
468 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
469 odr_implicit(o, odr_integer, &(*p)->requestedAction, ODR_CONTEXT,
471 odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat,
472 ODR_CONTEXT, 47, 1) &&
473 odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT,
475 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
479 int z_ResourceControlRequest(ODR o, Z_ResourceControlRequest **p, int opt,
482 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
483 return opt && odr_ok(o);
485 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
486 odr_implicit(o, odr_bool, &(*p)->suspendedFlag, ODR_CONTEXT, 39, 1)&&
487 odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT,
489 odr_implicit(o, odr_integer, &(*p)->partialResultsAvailable,
490 ODR_CONTEXT, 41, 1) &&
491 odr_implicit(o, odr_bool, &(*p)->responseRequired, ODR_CONTEXT,
493 odr_implicit(o, odr_bool, &(*p)->triggeredRequestFlag,
494 ODR_CONTEXT, 43, 1) &&
495 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
499 int z_ResourceControlResponse(ODR o, Z_ResourceControlResponse **p, int opt,
502 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
503 return opt && odr_ok(o);
505 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
506 odr_implicit(o, odr_bool, &(*p)->continueFlag, ODR_CONTEXT, 44, 0) &&
507 odr_implicit(o, odr_bool, &(*p)->resultSetWanted, ODR_CONTEXT,
509 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
513 /* ------------------------ SEARCH SERVICE ----------------------- */
515 int z_DatabaseSpecificUnit(ODR o, Z_DatabaseSpecificUnit **p, int opt,
518 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
519 return opt && odr_ok(o);
521 z_DatabaseName(o, &(*p)->databaseName, 0, 0) &&
522 z_ElementSetName(o, &(*p)->elementSetName, 0, 0) &&
526 int z_DatabaseSpecific(ODR o, Z_DatabaseSpecific **p, int opt,
529 if (o->direction == ODR_DECODE)
530 *p = (Z_DatabaseSpecific *)odr_malloc(o, sizeof(**p));
534 odr_implicit_settag(o, ODR_CONTEXT, 1);
535 if (odr_sequence_of(o, (Odr_fun)z_DatabaseSpecificUnit, &(*p)->elements,
536 &(*p)->num_elements, 0))
542 int z_ElementSetNames(ODR o, Z_ElementSetNames **p, int opt, const char *name)
544 static Odr_arm arm[] =
546 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_ElementSetNames_generic,
547 z_ElementSetName, 0},
548 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSetNames_databaseSpecific,
549 (Odr_fun)z_DatabaseSpecific, 0},
553 if (o->direction == ODR_DECODE)
554 *p = (Z_ElementSetNames *)odr_malloc(o, sizeof(**p));
556 return opt && odr_ok(o);
558 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
564 /* ----------------------- RPN QUERY -----------------------*/
566 int z_ComplexAttribute(ODR o, Z_ComplexAttribute **p, int opt,
569 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
570 return opt && odr_ok(o);
572 odr_implicit_settag(o, ODR_CONTEXT, 1) &&
573 odr_sequence_of(o, (Odr_fun)z_StringOrNumeric, &(*p)->list,
574 &(*p)->num_list, 0) &&
575 odr_implicit_settag(o, ODR_CONTEXT, 2) &&
576 (odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->semanticAction,
577 &(*p)->num_semanticAction, 0) || odr_ok(o)) &&
581 int z_AttributeElement(ODR o, Z_AttributeElement **p, int opt,
584 static Odr_arm arm[] =
586 {ODR_IMPLICIT, ODR_CONTEXT, 121, Z_AttributeValue_numeric,
587 (Odr_fun)odr_integer, 0},
588 {ODR_IMPLICIT, ODR_CONTEXT, 224, Z_AttributeValue_complex,
589 (Odr_fun)z_ComplexAttribute, 0},
590 {-1, -1, -1, -1, 0, 0}
592 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
593 return opt && odr_ok(o);
595 odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 1, 1) &&
596 odr_implicit(o, odr_integer, &(*p)->attributeType, ODR_CONTEXT,
598 odr_choice(o, arm, &(*p)->value, &(*p)->which, 0) &&
602 int z_Term(ODR o, Z_Term **p, int opt, const char *name)
604 static Odr_arm arm[] =
606 {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_Term_general,
607 (Odr_fun)odr_octetstring, 0},
608 {ODR_IMPLICIT, ODR_CONTEXT, 215, Z_Term_numeric,
609 (Odr_fun)odr_integer, 0},
610 {ODR_IMPLICIT, ODR_CONTEXT, 216, Z_Term_characterString,
611 odr_visiblestring, 0},
612 {ODR_IMPLICIT, ODR_CONTEXT, 217, Z_Term_oid, (Odr_fun)odr_oid, 0},
613 {ODR_IMPLICIT, ODR_CONTEXT, 218, Z_Term_dateTime, odr_cstring, 0},
614 {ODR_IMPLICIT, ODR_CONTEXT, 219, Z_Term_external,
615 (Odr_fun) z_External, 0},
616 /* add intUnit here */
617 {ODR_IMPLICIT, ODR_CONTEXT, 221, Z_Term_null, (Odr_fun)odr_null, 0},
618 {-1, -1, -1, -1, 0, 0}
621 if (o->direction ==ODR_DECODE)
622 *p = (Z_Term *)odr_malloc(o, sizeof(**p));
625 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
628 return opt && odr_ok(o);
631 int z_AttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt,
634 if (!(odr_implicit_settag(o, ODR_CONTEXT, 102) &&
635 odr_sequence_begin(o, p, sizeof(**p), 0)))
636 return opt && odr_ok(o);
638 odr_implicit_settag(o, ODR_CONTEXT, 44) &&
639 odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList,
640 &(*p)->num_attributes, 0) &&
641 z_Term(o, &(*p)->term, 0, 0) &&
645 int z_ResultSetPlusAttributes(ODR o, Z_ResultSetPlusAttributes **p, int opt,
648 if (!(odr_implicit_settag(o, ODR_CONTEXT, 214) &&
649 odr_sequence_begin(o, p, sizeof(**p), 0)))
650 return opt && odr_ok(o);
652 z_ResultSetId(o, &(*p)->resultSet, 0, 0) &&
653 odr_implicit_settag(o, ODR_CONTEXT, 44) &&
654 odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList,
655 &(*p)->num_attributes, 0) &&
659 int z_ProximityOperator(ODR o, Z_ProximityOperator **p, int opt,
662 static Odr_arm arm[] =
664 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ProxCode_known,
665 (Odr_fun)odr_integer, 0},
666 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ProxCode_private,
667 (Odr_fun)odr_integer, 0},
668 {-1, -1, -1, -1, 0, 0}
671 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
672 return opt && odr_ok(o);
674 odr_implicit(o, odr_bool, &(*p)->exclusion, ODR_CONTEXT, 1, 1) &&
675 odr_implicit(o, odr_integer, &(*p)->distance, ODR_CONTEXT, 2, 0) &&
676 odr_implicit(o, odr_bool, &(*p)->ordered, ODR_CONTEXT, 3, 0) &&
677 odr_implicit(o, odr_integer, &(*p)->relationType, ODR_CONTEXT, 4, 0) &&
678 odr_constructed_begin(o, &(*p)->proximityUnitCode,
679 ODR_CONTEXT, 5, 0) &&
680 odr_choice(o, arm, &(*p)->proximityUnitCode, &(*p)->which, 0) &&
681 odr_constructed_end(o) &&
685 int z_Operator(ODR o, Z_Operator **p, int opt, const char *name)
687 static Odr_arm arm[] =
689 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_Operator_and, (Odr_fun)odr_null, 0},
690 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Operator_or, (Odr_fun)odr_null, 0},
691 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_Operator_and_not,
692 (Odr_fun)odr_null, 0},
693 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_Operator_prox,
694 (Odr_fun)z_ProximityOperator, 0},
695 {-1, -1, -1, -1, 0, 0}
698 if (!*p && o->direction != ODR_DECODE)
700 if (!odr_constructed_begin(o, p, ODR_CONTEXT, 46, 0))
701 return opt && odr_ok(o);
702 if (o->direction == ODR_DECODE)
703 *p = (Z_Operator *)odr_malloc(o, sizeof(**p));
705 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
706 odr_constructed_end(o))
709 return opt && odr_ok(o);
712 int z_Operand(ODR o, Z_Operand **p, int opt, const char *name)
714 static Odr_arm arm[] =
716 {-1, -1, -1, Z_Operand_APT, (Odr_fun)z_AttributesPlusTerm, 0},
717 {-1, -1, -1, Z_Operand_resultSetId, (Odr_fun)z_ResultSetId, 0},
718 {-1, -1, -1, Z_Operand_resultAttr,
719 (Odr_fun)z_ResultSetPlusAttributes, 0},
720 {-1, -1, -1, -1, 0, 0}
723 if (o->direction == ODR_DECODE)
724 *p = (Z_Operand *)odr_malloc(o, sizeof(**p));
727 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
730 return opt && odr_ok(o);
733 int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt, const char *name);
735 int z_Complex(ODR o, Z_Complex **p, int opt, const char *name)
737 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
738 return opt && odr_ok(o);
740 z_RPNStructure(o, &(*p)->s1, 0, 0) &&
741 z_RPNStructure(o, &(*p)->s2, 0, 0) &&
742 z_Operator(o, &(*p)->roperator, 0, 0) &&
746 int z_RPNStructure(ODR o, Z_RPNStructure **p, int opt, const char *name)
748 static Odr_arm arm[] =
750 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_RPNStructure_simple,
751 (Odr_fun)z_Operand, 0},
752 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_RPNStructure_complex,
753 (Odr_fun)z_Complex, 0},
754 {-1 -1, -1, -1, 0, 0}
757 if (o->direction == ODR_DECODE)
758 *p = (Z_RPNStructure *)odr_malloc(o, sizeof(**p));
761 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
764 return opt && odr_ok(o);
767 int z_RPNQuery(ODR o, Z_RPNQuery **p, int opt, const char *name)
769 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
770 return opt && odr_ok(o);
772 odr_oid(o, &(*p)->attributeSetId, 0, 0) &&
773 z_RPNStructure(o, &(*p)->RPNStructure, 0, 0) &&
777 /* -----------------------END RPN QUERY ----------------------- */
779 int z_Query(ODR o, Z_Query **p, int opt, const char *name)
781 static Odr_arm arm[] =
783 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Query_type_1,
784 (Odr_fun)z_RPNQuery, 0},
785 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Query_type_2,
786 (Odr_fun)odr_octetstring, 0},
787 {ODR_IMPLICIT, ODR_CONTEXT, 101, Z_Query_type_101,
788 (Odr_fun)z_RPNQuery, 0},
789 {-1, -1, -1, -1, 0, 0}
792 if (o->direction == ODR_DECODE)
793 *p = (Z_Query *)odr_malloc(o, sizeof(**p));
796 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
799 return opt && odr_ok(o);
802 int z_SearchRequest(ODR o, Z_SearchRequest **p, int opt, const char *name)
806 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
807 return opt && odr_ok(o);
810 z_ReferenceId(o, &pp->referenceId, 1, 0) &&
811 odr_implicit(o, odr_integer, &pp->smallSetUpperBound, ODR_CONTEXT,
813 odr_implicit(o, odr_integer, &pp->largeSetLowerBound, ODR_CONTEXT,
815 odr_implicit(o, odr_integer, &pp->mediumSetPresentNumber, ODR_CONTEXT,
817 odr_implicit(o, odr_bool, &pp->replaceIndicator, ODR_CONTEXT, 16, 1) &&
818 odr_implicit(o, odr_visiblestring, &pp->resultSetName, ODR_CONTEXT,
820 odr_implicit_settag(o, ODR_CONTEXT, 18) &&
821 odr_sequence_of(o, z_DatabaseName, &pp->databaseNames,
822 &pp->num_databaseNames, 0) &&
823 odr_explicit(o, z_ElementSetNames, &pp->smallSetElementSetNames,
824 ODR_CONTEXT, 100, 1) &&
825 odr_explicit(o, z_ElementSetNames, &pp->mediumSetElementSetNames,
826 ODR_CONTEXT, 101, 1) &&
827 odr_implicit(o, odr_oid, &pp->preferredRecordSyntax,
828 ODR_CONTEXT, 104, 1) &&
829 odr_explicit(o, z_Query, &pp->query, ODR_CONTEXT, 21, 0) &&
830 odr_implicit_tag(o, z_OtherInformation, &(*p)->additionalSearchInfo,
831 ODR_CONTEXT, 203, 1, 0) &&
832 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
836 /* ------------------------ RECORD ------------------------- */
838 int z_DatabaseRecord(ODR o, Z_DatabaseRecord **p, int opt, const char *name)
840 return z_External(o, (Z_External **) p, opt, 0);
843 int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt,
846 static Odr_arm arm[] =
848 {-1, -1, -1, Z_DiagForm_v2AddInfo, odr_visiblestring, 0},
849 {-1, -1, -1, Z_DiagForm_v3AddInfo, z_InternationalString, 0},
850 {ODR_IMPLICIT, ODR_CONTEXT, ODR_VISIBLESTRING, Z_DiagForm_v2AddInfo,
851 odr_visiblestring, 0}, /* To cater to a bug in the CNIDR servers */
852 {-1, -1, -1, -1, 0, 0}
854 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
855 return opt && odr_ok(o);
857 odr_oid(o, &(*p)->diagnosticSetId, 1, 0) && /* SHOULD NOT BE OPT! */
858 odr_integer(o, &(*p)->condition, 0, 0) &&
860 * I no longer recall what server tagged the addinfo.. but it isn't
861 * hurting anyone, so...
862 * We need to turn it into a choice, or something, because of
863 * that damn generalstring in v3.
865 odr_choice(o, arm, &(*p)->addinfo, &(*p)->which, 0) &&
869 int z_DiagRec(ODR o, Z_DiagRec **p, int opt, const char *name)
871 static Odr_arm arm[] =
873 {-1, -1, -1, Z_DiagRec_defaultFormat, (Odr_fun)z_DefaultDiagFormat, 0},
874 {-1, -1, -1, Z_DiagRec_externallyDefined, (Odr_fun)z_External, 0},
875 {-1, -1, -1, -1, 0, 0}
878 if (o->direction == ODR_DECODE)
879 *p = (Z_DiagRec *)odr_malloc(o, sizeof(**p));
882 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
885 return opt && odr_ok(o);
888 int z_DiagRecs(ODR o, Z_DiagRecs **p, int opt, const char *name)
890 if (o->direction == ODR_DECODE)
891 *p = (Z_DiagRecs *)odr_malloc(o, sizeof(**p));
895 if (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->diagRecs,
896 &(*p)->num_diagRecs, 0))
899 return opt && odr_ok(o);
902 int z_NamePlusRecord(ODR o, Z_NamePlusRecord **p, int opt, const char *name)
904 static Odr_arm arm[] =
906 {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_NamePlusRecord_databaseRecord,
907 (Odr_fun)z_DatabaseRecord, 0},
908 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_NamePlusRecord_surrogateDiagnostic,
909 (Odr_fun)z_DiagRec, 0},
910 {-1, -1, -1, -1, 0, 0}
913 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
914 return opt && odr_ok(o);
916 odr_implicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT,
918 odr_constructed_begin(o, &(*p)->u, ODR_CONTEXT, 1, 0) &&
919 odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
920 odr_constructed_end(o) &&
924 int z_NamePlusRecordList(ODR o, Z_NamePlusRecordList **p, int opt,
927 if (o->direction == ODR_DECODE)
928 *p = (Z_NamePlusRecordList *)odr_malloc(o, sizeof(**p));
931 if (odr_sequence_of(o, (Odr_fun)z_NamePlusRecord, &(*p)->records,
932 &(*p)->num_records, 0))
938 int z_Records(ODR o, Z_Records **p, int opt, const char *name)
940 static Odr_arm arm[] =
942 {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_Records_DBOSD,
943 (Odr_fun)z_NamePlusRecordList, 0},
944 {ODR_IMPLICIT, ODR_CONTEXT, 130, Z_Records_NSD,
945 (Odr_fun)z_DiagRec, 0},
946 {ODR_IMPLICIT, ODR_CONTEXT, 205, Z_Records_multipleNSD,
947 (Odr_fun)z_DiagRecs, 0},
948 {-1, -1, -1, -1, 0, 0}
951 if (o->direction == ODR_DECODE)
952 *p = (Z_Records *)odr_malloc(o, sizeof(**p));
955 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
958 return opt && odr_ok(o);
961 /* ------------------------ ACCESS CTRL SERVICE ----------------------- */
963 int z_AccessControlRequest(ODR o, Z_AccessControlRequest **p, int opt,
966 static Odr_arm arm[] =
968 {ODR_IMPLICIT, ODR_CONTEXT, 37, Z_AccessRequest_simpleForm,
969 (Odr_fun)odr_octetstring, 0},
970 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessRequest_externallyDefined,
971 (Odr_fun)z_External, 0},
972 {-1, -1, -1, -1, 0, 0}
974 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
975 return opt && odr_ok(o);
977 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
978 odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
979 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
983 int z_AccessControlResponse(ODR o, Z_AccessControlResponse **p, int opt,
986 static Odr_arm arm[] =
988 {ODR_IMPLICIT, ODR_CONTEXT, 38, Z_AccessResponse_simpleForm,
989 (Odr_fun)odr_octetstring, 0},
990 {ODR_EXPLICIT, ODR_CONTEXT, 0, Z_AccessResponse_externallyDefined,
991 (Odr_fun)z_External, 0},
992 {-1, -1, -1, -1, 0, 0}
994 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
995 return opt && odr_ok(o);
997 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
998 odr_choice(o, arm, &(*p)->u, &(*p)->which, 0) &&
999 odr_explicit(o, z_DiagRec, &(*p)->diagnostic, ODR_CONTEXT, 223, 1) &&
1000 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1001 odr_sequence_end(o);
1004 /* ------------------------ SCAN SERVICE -------------------- */
1006 int z_AttributeList(ODR o, Z_AttributeList **p, int opt, const char *name)
1008 if (o->direction == ODR_DECODE)
1009 *p = (Z_AttributeList *)odr_malloc(o, sizeof(**p));
1013 odr_implicit_settag(o, ODR_CONTEXT, 44);
1014 if (odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributes,
1015 &(*p)->num_attributes, 0))
1018 return opt && odr_ok(o);
1022 * This is a temporary hack. We don't know just *what* old version of the
1023 * protocol willow uses, so we'll just patiently wait for them to update
1025 static int willow_scan = 0;
1027 int z_WillowAttributesPlusTerm(ODR o, Z_AttributesPlusTerm **p, int opt,
1030 if (!*p && o->direction != ODR_DECODE)
1032 if (!odr_constructed_begin(o, p, ODR_CONTEXT, 4, 0))
1035 return opt && odr_ok(o);
1037 if (!odr_constructed_begin(o, p, ODR_CONTEXT, 1, 0))
1039 if (!odr_constructed_begin(o, p, ODR_UNIVERSAL, ODR_SEQUENCE, 0))
1041 if (!odr_implicit_settag(o, ODR_CONTEXT, 44))
1043 if (o->direction == ODR_DECODE)
1044 *p = (Z_AttributesPlusTerm*)odr_malloc(o, sizeof(**p));
1045 if (!odr_sequence_of(o, (Odr_fun)z_AttributeElement, &(*p)->attributeList,
1046 &(*p)->num_attributes, 0))
1048 if (!odr_sequence_end(o) || !odr_sequence_end(o))
1050 if (!z_Term(o, &(*p)->term, 0, 0))
1052 if (!odr_constructed_end(o))
1058 int z_AlternativeTerm(ODR o, Z_AlternativeTerm **p, int opt, const char *name)
1060 if (o->direction == ODR_DECODE)
1061 *p = (Z_AlternativeTerm *)odr_malloc(o, sizeof(**p));
1065 return opt && odr_ok(o);
1068 if (odr_sequence_of(o, (Odr_fun)z_AttributesPlusTerm, &(*p)->terms,
1069 &(*p)->num_terms, 0))
1072 return opt && !o->error;
1075 int z_ByDatabase(ODR o, Z_ByDatabase **p, int opt, const char *name)
1077 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1078 return opt && odr_ok(o);
1080 z_DatabaseName(o, &(*p)->db, 1, 0) &&
1081 odr_implicit(o, odr_integer, &(*p)->num, ODR_CONTEXT, 1, 1) &&
1082 z_OtherInformation(o, &(*p)->otherDbInfo, 1, 0) &&
1083 odr_sequence_end(o);
1086 int z_ByDatabaseList(ODR o, Z_ByDatabaseList **p, int opt, const char *name)
1088 if (!odr_initmember(o, p, sizeof(**p)))
1089 return opt && odr_ok(o);
1090 if (odr_sequence_of(o, (Odr_fun)z_ByDatabase, &(*p)->elements,
1091 &(*p)->num_elements, 0))
1094 return opt && odr_ok(o);
1097 int z_ScanOccurrences(ODR o, Z_ScanOccurrences **p, int opt, const char *name)
1101 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_ScanOccurrences_global,
1102 (Odr_fun)odr_integer, 0},
1103 {ODR_EXPLICIT, ODR_CONTEXT, 3, Z_ScanOccurrences_byDatabase,
1104 (Odr_fun)z_ByDatabaseList, 0},
1105 {-1, -1, -1, -1, 0, 0}
1108 if (!odr_initmember(o, p, sizeof(**p)))
1109 return opt && odr_ok(o);
1110 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
1113 return opt && odr_ok(o);
1116 int z_OccurrenceByAttributesElem(ODR o, Z_OccurrenceByAttributesElem **p,
1117 int opt, const char *name)
1119 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1120 return opt && odr_ok(o);
1122 odr_explicit(o, z_AttributeList, &(*p)->attributes, ODR_CONTEXT,
1124 z_ScanOccurrences(o, &(*p)->occurrences, 1, 0) &&
1125 z_OtherInformation(o, &(*p)->otherOccurInfo, 1, 0) &&
1126 odr_sequence_end(o);
1129 int z_OccurrenceByAttributes(ODR o, Z_OccurrenceByAttributes **p, int opt, const char *name)
1131 if (!odr_initmember(o, p, sizeof(**p)))
1132 return opt && odr_ok(o);
1133 if (!odr_sequence_of(o, (Odr_fun)z_OccurrenceByAttributesElem,
1134 &(*p)->elements, &(*p)->num_elements, 0))
1137 return opt && odr_ok(o);
1140 int z_TermInfo(ODR o, Z_TermInfo **p, int opt, const char *name)
1142 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1143 return opt && odr_ok(o);
1146 odr_implicit(o, z_Term, &(*p)->term, ODR_CONTEXT, 1, 0) :
1147 z_Term(o, &(*p)->term, 0, 0)) &&
1148 odr_implicit(o, z_InternationalString, &(*p)->displayTerm, ODR_CONTEXT,
1150 z_AttributeList(o, &(*p)->suggestedAttributes, 1, 0) &&
1151 odr_implicit(o, z_AlternativeTerm, &(*p)->alternativeTerm,
1152 ODR_CONTEXT, 4, 1) &&
1153 odr_implicit(o, odr_integer, &(*p)->globalOccurrences, ODR_CONTEXT,
1155 odr_implicit(o, z_OccurrenceByAttributes, &(*p)->byAttributes,
1156 ODR_CONTEXT, 3, 1) &&
1157 z_OtherInformation(o, &(*p)->otherTermInfo, 1, 0) &&
1158 odr_sequence_end(o);
1161 int z_Entry(ODR o, Z_Entry **p, int opt, const char *name)
1163 static Odr_arm arm[] =
1165 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_Entry_termInfo,
1166 (Odr_fun)z_TermInfo, 0},
1167 {ODR_EXPLICIT, ODR_CONTEXT, 2, Z_Entry_surrogateDiagnostic,
1168 (Odr_fun)z_DiagRec, 0},
1169 {-1, -1, -1, -1, 0, 0}
1172 if (o->direction == ODR_DECODE)
1173 *p = (Z_Entry *)odr_malloc(o, sizeof(**p));
1177 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
1180 return opt && odr_ok(o);
1183 int z_ListEntries (ODR o, Z_ListEntries **p, int opt, const char *name)
1185 if (!odr_sequence_begin (o, p, sizeof(**p), 0))
1186 return opt && odr_ok (o);
1188 odr_implicit_settag (o, ODR_CONTEXT, 1) &&
1189 (odr_sequence_of(o, (Odr_fun) z_Entry, &(*p)->entries,
1190 &(*p)->num_entries, 0) || odr_ok(o)) &&
1191 odr_implicit_settag (o, ODR_CONTEXT, 2) &&
1192 (odr_sequence_of(o, (Odr_fun) z_DiagRec,
1193 &(*p)->nonsurrogateDiagnostics,
1194 &(*p)->num_nonsurrogateDiagnostics, 0)
1196 odr_sequence_end (o);
1199 int z_ScanRequest(ODR o, Z_ScanRequest **p, int opt, const char *name)
1201 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1202 return opt && odr_ok(o);
1205 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1206 odr_implicit_settag(o, ODR_CONTEXT, 3) &&
1207 odr_sequence_of(o, z_DatabaseName, &(*p)->databaseNames,
1208 &(*p)->num_databaseNames, 0) &&
1209 odr_oid(o, &(*p)->attributeSet, 1, 0) &&
1210 (z_AttributesPlusTerm(o, &(*p)->termListAndStartPoint, 1, 0) ?
1211 ((*p)->termListAndStartPoint ? 1 :
1212 z_WillowAttributesPlusTerm(o, &(*p)->termListAndStartPoint, 0, 0))
1214 odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 5, 1) &&
1215 odr_implicit(o, odr_integer, &(*p)->numberOfTermsRequested,
1216 ODR_CONTEXT, 6, 0) &&
1217 odr_implicit(o, odr_integer, &(*p)->preferredPositionInResponse,
1218 ODR_CONTEXT, 7, 1) &&
1219 odr_sequence_end(o);
1222 int z_ScanResponse(ODR o, Z_ScanResponse **p, int opt, const char *name)
1224 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1225 return opt && odr_ok(o);
1227 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1228 odr_implicit(o, odr_integer, &(*p)->stepSize, ODR_CONTEXT, 3, 1) &&
1229 odr_implicit(o, odr_integer, &(*p)->scanStatus, ODR_CONTEXT, 4, 0) &&
1230 odr_implicit(o, odr_integer, &(*p)->numberOfEntriesReturned,
1231 ODR_CONTEXT, 5, 0) &&
1232 odr_implicit(o, odr_integer, &(*p)->positionOfTerm,
1233 ODR_CONTEXT, 6, 1) &&
1234 odr_implicit(o, z_ListEntries, &(*p)->entries, ODR_CONTEXT, 7, 1) &&
1235 odr_implicit(o, odr_oid, &(*p)->attributeSet, ODR_CONTEXT, 8, 1) &&
1236 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1237 odr_sequence_end(o);
1240 /* ------------------------ SEARCHRESPONSE ----------------*/
1242 int z_NumberOfRecordsReturned(ODR o, int **p, int opt, const char *name)
1244 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 24, opt);
1247 int z_NextResultSetPosition(ODR o, int **p, int opt, const char *name)
1249 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 25, opt);
1252 int z_PresentStatus(ODR o, int **p, int opt, const char *name)
1254 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 27, opt);
1257 int z_SearchResponse(ODR o, Z_SearchResponse **p, int opt, const char *name)
1259 Z_SearchResponse *pp;
1261 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1262 return opt && odr_ok(o);
1265 z_ReferenceId(o, &pp->referenceId, 1, 0) &&
1266 odr_implicit(o, odr_integer, &pp->resultCount, ODR_CONTEXT, 23, 0) &&
1267 z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0, 0) &&
1268 z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0, 0) &&
1269 odr_implicit(o, odr_bool, &pp->searchStatus, ODR_CONTEXT, 22, 0) &&
1270 odr_implicit(o, odr_integer, &pp->resultSetStatus,
1271 ODR_CONTEXT, 26, 1) &&
1272 z_PresentStatus(o, &pp->presentStatus, 1, 0) &&
1273 z_Records(o, &pp->records, 1, 0) &&
1274 odr_implicit(o, z_OtherInformation, &(*p)->additionalSearchInfo,
1275 ODR_CONTEXT, 203, 1) &&
1276 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1277 odr_sequence_end(o);
1280 /* --------------------- PRESENT SERVICE ---------------------- */
1282 int z_ElementSpec(ODR o, Z_ElementSpec **p, int opt, const char *name)
1284 static Odr_arm arm[] =
1286 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_ElementSpec_elementSetName,
1287 odr_visiblestring, 0},
1288 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_ElementSpec_externalSpec,
1289 (Odr_fun)z_External, 0},
1290 {-1, -1, -1, -1, 0, 0}
1293 if (o->direction == ODR_DECODE)
1294 *p = (Z_ElementSpec *)odr_malloc(o, sizeof(**p));
1298 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
1301 return opt && odr_ok(o);
1304 int z_Specification(ODR o, Z_Specification **p, int opt, const char *name)
1306 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1307 return opt && odr_ok(o);
1309 odr_implicit(o, odr_oid, &(*p)->schema, ODR_CONTEXT, 1, 1) &&
1310 z_ElementSpec(o, &(*p)->elementSpec, 1, 0) &&
1311 odr_sequence_end(o);
1314 int z_DbSpecific(ODR o, Z_DbSpecific **p, int opt, const char *name)
1316 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1317 return opt && odr_ok(o);
1319 odr_explicit(o, z_DatabaseName, &(*p)->databaseName, ODR_CONTEXT,
1321 odr_implicit(o, z_Specification, &(*p)->spec, ODR_CONTEXT, 2, 0) &&
1322 odr_sequence_end(o);
1325 int z_CompSpec(ODR o, Z_CompSpec **p, int opt, const char *name)
1327 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1328 return opt && odr_ok(o);
1330 odr_implicit(o, odr_bool, &(*p)->selectAlternativeSyntax, ODR_CONTEXT,
1332 odr_implicit(o, z_Specification, &(*p)->generic, ODR_CONTEXT, 2, 1) &&
1333 odr_implicit_settag(o, ODR_CONTEXT, 3) &&
1334 (odr_sequence_of(o, (Odr_fun)z_DbSpecific, &(*p)->dbSpecific,
1335 &(*p)->num_dbSpecific, 0) || odr_ok(o)) &&
1336 odr_implicit_settag(o, ODR_CONTEXT, 4) &&
1337 (odr_sequence_of(o, (Odr_fun)odr_oid, &(*p)->recordSyntax,
1338 &(*p)->num_recordSyntax, 0) || odr_ok(o)) &&
1339 odr_sequence_end(o);
1342 int z_RecordComposition(ODR o, Z_RecordComposition **p, int opt,
1345 static Odr_arm arm[] =
1347 {ODR_EXPLICIT, ODR_CONTEXT, 19, Z_RecordComp_simple,
1348 (Odr_fun)z_ElementSetNames, 0},
1349 {ODR_IMPLICIT, ODR_CONTEXT, 209, Z_RecordComp_complex,
1350 (Odr_fun)z_CompSpec, 0},
1351 {-1, -1, -1, -1, 0, 0}
1354 if (o->direction == ODR_DECODE)
1355 *p = (Z_RecordComposition *)odr_malloc(o, sizeof(**p));
1359 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
1362 return opt && odr_ok(o);
1365 int z_Range(ODR o, Z_Range **p, int opt, const char *name)
1367 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1368 return opt && odr_ok(o);
1370 odr_implicit(o, odr_integer, &(*p)->startingPosition,
1371 ODR_CONTEXT, 1, 0) &&
1372 odr_implicit(o, odr_integer, &(*p)->numberOfRecords,
1373 ODR_CONTEXT, 2, 0) &&
1374 odr_sequence_end(o);
1377 int z_PresentRequest(ODR o, Z_PresentRequest **p, int opt, const char *name)
1379 Z_PresentRequest *pp;
1381 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1382 return opt && odr_ok(o);
1385 z_ReferenceId(o, &pp->referenceId, 1, 0) &&
1386 z_ResultSetId(o, &pp->resultSetId, 0, 0) &&
1387 odr_implicit(o, odr_integer, &pp->resultSetStartPoint,
1388 ODR_CONTEXT, 30, 0) &&
1389 odr_implicit(o, odr_integer, &pp->numberOfRecordsRequested,
1390 ODR_CONTEXT, 29, 0) &&
1391 odr_implicit_settag(o, ODR_CONTEXT, 212) &&
1392 (odr_sequence_of(o, (Odr_fun)z_Range, &(*p)->additionalRanges,
1393 &(*p)->num_ranges, 0) || odr_ok(o)) &&
1394 z_RecordComposition(o, &(*p)->recordComposition, 1, 0) &&
1395 odr_implicit(o, odr_oid, &(*p)->preferredRecordSyntax, ODR_CONTEXT,
1397 odr_implicit(o, odr_integer, &(*p)->maxSegmentCount, ODR_CONTEXT,
1399 odr_implicit(o, odr_integer, &(*p)->maxRecordSize, ODR_CONTEXT,
1401 odr_implicit(o, odr_integer, &(*p)->maxSegmentSize, ODR_CONTEXT,
1403 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1404 odr_sequence_end(o);
1407 int z_PresentResponse(ODR o, Z_PresentResponse **p, int opt, const char *name)
1409 Z_PresentResponse *pp;
1411 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1412 return opt && odr_ok(o);
1415 z_ReferenceId(o, &pp->referenceId, 1, 0) &&
1416 z_NumberOfRecordsReturned(o, &pp->numberOfRecordsReturned, 0, 0) &&
1417 z_NextResultSetPosition(o, &pp->nextResultSetPosition, 0, 0) &&
1418 z_PresentStatus(o, &pp->presentStatus, 0, 0) &&
1419 z_Records(o, &pp->records, 1, 0) &&
1420 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1421 odr_sequence_end(o);
1424 /* ----------------------DELETE -------------------------- */
1426 int z_DeleteSetStatus(ODR o, int **p, int opt, const char *name)
1428 return odr_implicit(o, odr_integer, p, ODR_CONTEXT, 33, opt);
1431 int z_ListStatus(ODR o, Z_ListStatus **p, int opt, const char *name)
1433 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1434 return opt && odr_ok(o);
1436 z_ResultSetId(o, &(*p)->id, 0, 0) &&
1437 z_DeleteSetStatus(o, &(*p)->status, 0, 0) &&
1438 odr_sequence_end(o);
1441 int z_DeleteResultSetRequest(ODR o, Z_DeleteResultSetRequest **p, int opt,
1444 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1445 return opt && odr_ok(o);
1447 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1448 odr_implicit(o, odr_integer, &(*p)->deleteFunction, ODR_CONTEXT, 32,
1450 (odr_sequence_of(o, z_ResultSetId, &(*p)->resultSetList,
1451 &(*p)->num_resultSetList, 0) || odr_ok(o)) &&
1452 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1453 odr_sequence_end(o);
1456 int z_ListStatuses (ODR o, Z_ListStatuses **p, int opt, const char *name)
1458 if (!odr_initmember (o, p, sizeof(**p)))
1459 return opt && odr_ok(o);
1460 if (odr_sequence_of (o, (Odr_fun) z_ListStatus, &(*p)->elements,
1464 return opt && odr_ok(o);
1467 int z_DeleteResultSetResponse(ODR o, Z_DeleteResultSetResponse **p, int opt,
1470 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1471 return opt && odr_ok(o);
1473 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1474 odr_implicit(o, z_DeleteSetStatus, &(*p)->deleteOperationStatus,
1475 ODR_CONTEXT, 0, 0) &&
1476 odr_implicit (o, z_ListStatuses,
1477 &(*p)->deleteListStatuses, ODR_CONTEXT, 1, 1) &&
1478 odr_implicit(o, odr_integer, &(*p)->numberNotDeleted, ODR_CONTEXT,
1480 odr_implicit (o, z_ListStatuses,
1481 &(*p)->bulkStatuses, ODR_CONTEXT, 35, 1) &&
1482 odr_implicit(o, odr_visiblestring, &(*p)->deleteMessage, ODR_CONTEXT,
1484 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1485 odr_sequence_end(o);
1488 /* ------------------------ SEGMENT SERVICE -------------- */
1490 int z_Segment(ODR o, Z_Segment **p, int opt, const char *name)
1492 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1493 return opt && odr_ok(o);
1495 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1496 odr_implicit(o, odr_integer, &(*p)->numberOfRecordsReturned,
1497 ODR_CONTEXT, 24, 0) &&
1498 odr_implicit_settag(o, ODR_CONTEXT, 0) &&
1499 odr_sequence_of(o, (Odr_fun)z_NamePlusRecord, &(*p)->segmentRecords,
1500 &(*p)->num_segmentRecords, 0) &&
1501 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1502 odr_sequence_end(o);
1505 /* ------------------------ CLOSE SERVICE ---------------- */
1507 int z_Close(ODR o, Z_Close **p, int opt, const char *name)
1509 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1510 return opt && odr_ok(o);
1512 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1513 odr_implicit(o, odr_integer, &(*p)->closeReason, ODR_CONTEXT, 211, 0)
1515 odr_implicit(o, odr_visiblestring, &(*p)->diagnosticInformation,
1516 ODR_CONTEXT, 3, 1) &&
1517 odr_implicit(o, odr_oid, &(*p)->resourceReportFormat, ODR_CONTEXT,
1519 odr_implicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT,
1521 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1522 odr_sequence_end(o);
1525 /* ------------------------ APDU ------------------------- */
1527 int z_Permissions(ODR o, Z_Permissions **p, int opt, const char *name)
1529 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1530 return opt && odr_ok(o);
1532 odr_implicit(o, z_InternationalString, &(*p)->userId, ODR_CONTEXT,
1534 odr_implicit_settag(o, ODR_CONTEXT, 2) &&
1535 odr_sequence_of(o, (Odr_fun)odr_integer, &(*p)->allowableFunctions,
1536 &(*p)->num_allowableFunctions, 0) &&
1537 odr_sequence_end(o);
1540 int z_ExtendedServicesRequest(ODR o, Z_ExtendedServicesRequest **p, int opt,
1543 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1544 return opt && odr_ok(o);
1546 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1547 odr_implicit(o, odr_integer, &(*p)->function, ODR_CONTEXT, 3, 0) &&
1548 odr_implicit(o, odr_oid, &(*p)->packageType, ODR_CONTEXT, 4, 0) &&
1549 odr_implicit(o, z_InternationalString, &(*p)->packageName,
1550 ODR_CONTEXT, 5, 1) &&
1551 odr_implicit(o, z_InternationalString, &(*p)->userId,
1552 ODR_CONTEXT, 6, 1) &&
1553 odr_implicit(o, z_IntUnit, &(*p)->retentionTime,
1554 ODR_CONTEXT, 7, 1) &&
1555 odr_implicit(o, z_Permissions, &(*p)->permissions,
1556 ODR_CONTEXT, 8, 1) &&
1557 odr_implicit(o, z_InternationalString, &(*p)->description,
1558 ODR_CONTEXT, 9, 1) &&
1559 odr_implicit(o, z_External, &(*p)->taskSpecificParameters,
1560 ODR_CONTEXT, 10, 1) &&
1561 odr_implicit(o, odr_integer, &(*p)->waitAction,
1562 ODR_CONTEXT, 11, 0) &&
1563 z_ElementSetName(o, &(*p)->elements, 1, 0) &&
1564 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1565 odr_sequence_end(o);
1568 int z_ExtendedServicesResponse(ODR o, Z_ExtendedServicesResponse **p, int opt,
1571 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1572 return opt && odr_ok(o);
1574 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1575 odr_implicit(o, odr_integer, &(*p)->operationStatus, ODR_CONTEXT,
1577 odr_implicit_settag(o, ODR_CONTEXT, 4) &&
1578 (odr_sequence_of(o, (Odr_fun)z_DiagRec, &(*p)->diagnostics,
1579 &(*p)->num_diagnostics, 0) || odr_ok(o)) &&
1580 odr_implicit(o, z_External, &(*p)->taskPackage, ODR_CONTEXT, 5, 1) &&
1581 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1582 odr_sequence_end(o);
1585 /* ------------------------ SORT ------------------------- */
1587 int z_SortAttributes(ODR o, Z_SortAttributes **p, int opt, const char *name)
1589 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1590 return opt && odr_ok(o);
1592 odr_oid(o, &(*p)->id, 0, 0) &&
1593 z_AttributeList(o, &(*p)->list, 0, 0) &&
1594 odr_sequence_end(o);
1597 int z_SortKey(ODR o, Z_SortKey **p, int opt, const char *name)
1599 static Odr_arm arm[] =
1601 {ODR_IMPLICIT, ODR_CONTEXT, 0, Z_SortKey_sortField,
1602 z_InternationalString, 0},
1603 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortKey_elementSpec,
1604 (Odr_fun)z_Specification, 0},
1605 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortKey_sortAttributes,
1606 (Odr_fun)z_SortAttributes, 0},
1610 if (!odr_initmember(o, p, sizeof(**p)))
1611 return opt && odr_ok(o);
1612 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
1615 return opt && odr_ok(o);
1618 int z_SortDbSpecific(ODR o, Z_SortDbSpecific **p, int opt, const char *name)
1620 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1621 return opt && odr_ok(o);
1623 z_DatabaseName(o, &(*p)->databaseName, 0, 0) &&
1624 z_SortKey(o, &(*p)->dbSort, 0, 0) &&
1625 odr_sequence_end(o);
1628 int z_SortDbSpecificList(ODR o, Z_SortDbSpecificList **p, int opt,
1631 if (!odr_initmember(o, p, sizeof(**p)))
1632 return opt && odr_ok(o);
1633 if (odr_sequence_of(o, (Odr_fun)z_SortDbSpecific, &(*p)->dbSpecific,
1634 &(*p)->num_dbSpecific, 0))
1637 return opt && odr_ok(o);
1640 int z_SortElement(ODR o, Z_SortElement **p, int opt, const char *name)
1642 static Odr_arm arm[] =
1644 {ODR_EXPLICIT, ODR_CONTEXT, 1, Z_SortElement_generic,
1645 (Odr_fun)z_SortKey, 0},
1646 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortElement_databaseSpecific,
1647 (Odr_fun)z_SortDbSpecificList, 0},
1648 {-1, -1, -1, -1, 0, 0}
1651 if (!odr_initmember(o, p, sizeof(**p)))
1652 return opt && odr_ok(o);
1653 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
1656 return opt && odr_ok(o);
1659 int z_SortMissingValueAction(ODR o, Z_SortMissingValueAction **p, int opt,
1662 static Odr_arm arm[] =
1664 {ODR_IMPLICIT, ODR_CONTEXT, 1, Z_SortMissingValAct_abort,
1665 (Odr_fun)odr_null, 0},
1666 {ODR_IMPLICIT, ODR_CONTEXT, 2, Z_SortMissingValAct_null,
1667 (Odr_fun)odr_null, 0},
1668 {ODR_IMPLICIT, ODR_CONTEXT, 3, Z_SortMissingValAct_valData,
1669 (Odr_fun)odr_octetstring, 0},
1670 {-1, -1, -1, -1, 0, 0}
1673 if (!odr_initmember(o, p, sizeof(**p)))
1674 return opt && odr_ok(o);
1675 if (odr_choice(o, arm, &(*p)->u, &(*p)->which, 0))
1678 return opt && odr_ok(o);
1681 int z_SortKeySpec(ODR o, Z_SortKeySpec **p, int opt, const char *name)
1683 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1684 return opt && odr_ok(o);
1686 z_SortElement(o, &(*p)->sortElement, 0, 0) &&
1687 odr_implicit(o, odr_integer, &(*p)->sortRelation, ODR_CONTEXT, 1, 0) &&
1688 odr_implicit(o, odr_integer, &(*p)->caseSensitivity,
1689 ODR_CONTEXT, 2, 0) &&
1690 odr_explicit(o, z_SortMissingValueAction, &(*p)->missingValueAction,
1691 ODR_CONTEXT, 3, 1) &&
1692 odr_sequence_end(o);
1695 int z_SortResponse(ODR o, Z_SortResponse **p, int opt, const char *name)
1697 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1698 return opt && odr_ok(o);
1700 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1701 odr_implicit(o, odr_integer, &(*p)->sortStatus, ODR_CONTEXT,
1703 odr_implicit(o, odr_integer, &(*p)->resultSetStatus, ODR_CONTEXT,
1705 odr_implicit(o, z_DiagRecs, &(*p)->diagnostics, ODR_CONTEXT, 5, 1) &&
1706 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1707 odr_sequence_end(o);
1710 int z_SortKeySpecList(ODR o, Z_SortKeySpecList **p, int opt, const char *name)
1712 if (!odr_initmember(o, p, sizeof(**p)))
1713 return opt && odr_ok(o);
1714 if (odr_sequence_of(o, (Odr_fun)z_SortKeySpec, &(*p)->specs,
1715 &(*p)->num_specs, 0))
1718 return opt && odr_ok(o);
1721 int z_SortRequest(ODR o, Z_SortRequest **p, int opt, const char *name)
1723 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1724 return opt && odr_ok(o);
1726 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1727 odr_implicit(o, z_StringList, &(*p)->inputResultSetNames,
1728 ODR_CONTEXT, 3, 0) &&
1729 odr_implicit(o, z_InternationalString, &(*p)->sortedResultSetName,
1730 ODR_CONTEXT, 4, 0) &&
1731 odr_implicit(o, z_SortKeySpecList, &(*p)->sortSequence, ODR_CONTEXT,
1733 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1734 odr_sequence_end(o);
1737 /* ---------------------- Resource Report ---------------- */
1739 int z_ResourceReportRequest(ODR o, Z_ResourceReportRequest **p, int opt,
1742 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1743 return opt && odr_ok(o);
1745 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1746 odr_implicit(o, z_ReferenceId, &(*p)->opId, ODR_CONTEXT, 210, 1) &&
1747 odr_implicit(o, odr_oid, &(*p)->prefResourceReportFormat, ODR_CONTEXT,
1749 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1750 odr_sequence_end(o);
1753 int z_ResourceReportResponse(ODR o, Z_ResourceReportResponse **p, int opt,
1756 if (!odr_sequence_begin(o, p, sizeof(**p), 0))
1757 return opt && odr_ok(o);
1759 z_ReferenceId(o, &(*p)->referenceId, 1, 0) &&
1760 odr_implicit(o, odr_integer, &(*p)->resourceReportStatus,
1761 ODR_CONTEXT, 50, 0) &&
1762 odr_explicit(o, z_External, &(*p)->resourceReport, ODR_CONTEXT,
1764 z_OtherInformation(o, &(*p)->otherInfo, 1, 0) &&
1765 odr_sequence_end(o);
1768 /* ------------------------ APDU ------------------------- */
1770 int z_APDU(ODR o, Z_APDU **p, int opt, const char *name)
1772 static Odr_arm arm[] =
1774 {ODR_IMPLICIT, ODR_CONTEXT, 20, Z_APDU_initRequest,
1775 (Odr_fun)z_InitRequest, 0},
1776 {ODR_IMPLICIT, ODR_CONTEXT, 21, Z_APDU_initResponse,
1777 (Odr_fun)z_InitResponse, 0},
1778 {ODR_IMPLICIT, ODR_CONTEXT, 22, Z_APDU_searchRequest,
1779 (Odr_fun)z_SearchRequest, 0},
1780 {ODR_IMPLICIT, ODR_CONTEXT, 23, Z_APDU_searchResponse,
1781 (Odr_fun)z_SearchResponse, 0},
1782 {ODR_IMPLICIT, ODR_CONTEXT, 24, Z_APDU_presentRequest,
1783 (Odr_fun)z_PresentRequest, 0},
1784 {ODR_IMPLICIT, ODR_CONTEXT, 25, Z_APDU_presentResponse,
1785 (Odr_fun)z_PresentResponse, 0},
1786 {ODR_IMPLICIT, ODR_CONTEXT, 26, Z_APDU_deleteResultSetRequest,
1787 (Odr_fun)z_DeleteResultSetRequest, 0},
1788 {ODR_IMPLICIT, ODR_CONTEXT, 27, Z_APDU_deleteResultSetResponse,
1789 (Odr_fun)z_DeleteResultSetResponse, 0},
1790 {ODR_IMPLICIT, ODR_CONTEXT, 28, Z_APDU_accessControlRequest,
1791 (Odr_fun)z_AccessControlRequest, 0},
1792 {ODR_IMPLICIT, ODR_CONTEXT, 29, Z_APDU_accessControlResponse,
1793 (Odr_fun)z_AccessControlResponse, 0},
1794 {ODR_IMPLICIT, ODR_CONTEXT, 30, Z_APDU_resourceControlRequest,
1795 (Odr_fun)z_ResourceControlRequest, 0},
1796 {ODR_IMPLICIT, ODR_CONTEXT, 31, Z_APDU_resourceControlResponse,
1797 (Odr_fun)z_ResourceControlResponse, 0},
1798 {ODR_IMPLICIT, ODR_CONTEXT, 32, Z_APDU_triggerResourceControlRequest,
1799 (Odr_fun)z_TriggerResourceControlRequest, 0},
1800 {ODR_IMPLICIT, ODR_CONTEXT, 33, Z_APDU_resourceReportRequest,
1801 (Odr_fun)z_ResourceReportRequest, 0},
1802 {ODR_IMPLICIT, ODR_CONTEXT, 34, Z_APDU_resourceReportResponse,
1803 (Odr_fun)z_ResourceReportResponse, 0},
1804 {ODR_IMPLICIT, ODR_CONTEXT, 35, Z_APDU_scanRequest,
1805 (Odr_fun)z_ScanRequest, 0},
1806 {ODR_IMPLICIT, ODR_CONTEXT, 36, Z_APDU_scanResponse,
1807 (Odr_fun)z_ScanResponse, 0},
1808 {ODR_IMPLICIT, ODR_CONTEXT, 43, Z_APDU_sortRequest,
1809 (Odr_fun)z_SortRequest, 0},
1810 {ODR_IMPLICIT, ODR_CONTEXT, 44, Z_APDU_sortResponse,
1811 (Odr_fun)z_SortResponse, 0},
1812 {ODR_IMPLICIT, ODR_CONTEXT, 45, Z_APDU_segmentRequest,
1813 (Odr_fun)z_Segment, 0},
1814 {ODR_IMPLICIT, ODR_CONTEXT, 46, Z_APDU_extendedServicesRequest,
1815 (Odr_fun)z_ExtendedServicesRequest, 0},
1816 {ODR_IMPLICIT, ODR_CONTEXT, 47, Z_APDU_extendedServicesResponse,
1817 (Odr_fun)z_ExtendedServicesResponse},
1818 {ODR_IMPLICIT, ODR_CONTEXT, 48, Z_APDU_close,
1819 (Odr_fun)z_Close, 0},
1820 {-1, -1, -1, -1, 0, 0}
1823 if (o->direction == ODR_DECODE)
1824 *p = (Z_APDU *)odr_malloc(o, sizeof(**p));
1825 odr_setlenlen(o, 5);
1826 if (!odr_choice(o, arm, &(*p)->u, &(*p)->which, name))
1828 if (o->direction == ODR_DECODE)
1830 return opt && odr_ok(o);