2 * Copyright (c) 1995, Index Data.
4 * Permission to use, copy, modify, distribute, and sell this software and
5 * its documentation, in whole or in part, for any purpose, is hereby granted,
8 * 1. This copyright and permission notice appear in all copies of the
9 * software and its documentation. Notices of copyright or attribution
10 * which appear at the beginning of any file must remain unchanged.
12 * 2. The name of Index Data or the individual authors may not be used to
13 * endorse or promote products derived from this software without specific
14 * prior written permission.
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS, IMPLIED, OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
18 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
19 * IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
20 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR
22 * NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
23 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
27 * Revision 1.35 1996-06-10 08:57:38 quinn
28 * Added OPAC, ResourceReport
30 * Revision 1.34 1996/06/10 08:55:36 quinn
33 * Revision 1.33 1996/02/23 10:00:51 quinn
36 * Revision 1.32 1996/02/20 12:52:39 quinn
39 * Revision 1.31 1996/01/22 09:46:45 quinn
40 * Added Sort PDU. Moved StringList to main protocol file.
42 * Revision 1.30 1996/01/10 15:21:32 quinn
43 * Added links to access control PDUs
45 * Revision 1.29 1996/01/02 11:46:49 quinn
46 * Changed 'operator' to 'roperator' to avoid C++ conflict.
49 * Revision 1.28 1996/01/02 08:57:32 quinn
50 * Changed enums in the ASN.1 .h files to #defines. Changed oident.class to oclass
52 * Revision 1.27 1995/10/12 10:34:46 quinn
55 * Revision 1.26 1995/09/29 17:12:08 quinn
58 * Revision 1.25 1995/09/27 15:02:49 quinn
59 * Modified function heads & prototypes.
61 * Revision 1.24 1995/08/29 11:17:43 quinn
62 * *** empty log message ***
64 * Revision 1.23 1995/08/21 09:10:36 quinn
65 * Smallish fixes to suppport new formats.
67 * Revision 1.22 1995/08/17 12:45:14 quinn
68 * Fixed minor problems with GRS-1. Added support in c&s.
70 * Revision 1.21 1995/08/15 12:00:11 quinn
73 * Revision 1.20 1995/08/10 08:54:35 quinn
76 * Revision 1.19 1995/06/19 12:38:28 quinn
77 * Reorganized include-files. Added small features.
79 * Revision 1.18 1995/06/16 13:16:05 quinn
80 * Fixed Defaultdiagformat.
82 * Revision 1.17 1995/06/15 15:42:05 quinn
85 * Revision 1.16 1995/06/15 07:45:06 quinn
88 * Revision 1.15 1995/06/14 15:26:43 quinn
89 * *** empty log message ***
91 * Revision 1.14 1995/06/07 14:42:34 quinn
94 * Revision 1.13 1995/06/07 14:36:47 quinn
97 * Revision 1.12 1995/06/05 10:53:13 quinn
100 * Revision 1.11 1995/06/02 09:49:47 quinn
103 * Revision 1.10 1995/05/29 08:11:34 quinn
104 * Moved oid from odr/asn to util.
106 * Revision 1.9 1995/05/22 11:31:25 quinn
109 * Revision 1.8 1995/05/17 08:41:35 quinn
110 * Added delete to proto & other little things.
111 * Relaying auth info to backend.
113 * Revision 1.7 1995/05/16 08:50:37 quinn
114 * License, documentation, and memory fixes
116 * Revision 1.6 1995/05/15 11:55:55 quinn
117 * Work on asynchronous activity.
119 * Revision 1.5 1995/04/17 11:28:18 quinn
122 * Revision 1.4 1995/04/10 10:22:47 quinn
125 * Revision 1.3 1995/03/30 12:18:09 quinn
128 * Revision 1.2 1995/03/30 10:26:48 quinn
129 * Added Term structure
131 * Revision 1.1 1995/03/30 09:39:42 quinn
132 * Moved .h files to include directory
134 * Revision 1.11 1995/03/30 09:08:44 quinn
135 * Added Resource control protocol
137 * Revision 1.10 1995/03/29 15:39:39 quinn
138 * Adding some resource control elements, and a null-check to getentbyoid
140 * Revision 1.9 1995/03/29 08:06:18 quinn
141 * Added a few v3 elements
143 * Revision 1.8 1995/03/22 10:12:49 quinn
144 * Added Z_PRES constants.
146 * Revision 1.7 1995/03/20 09:45:12 quinn
149 * Revision 1.5 1995/03/07 16:29:34 quinn
150 * Added authentication stuff.
152 * Revision 1.4 1995/03/07 10:13:00 quinn
153 * Added prototype for z_APDU()
155 * Revision 1.3 1995/02/14 11:54:23 quinn
158 * Revision 1.2 1995/02/09 15:51:40 quinn
161 * Revision 1.1 1995/02/06 16:44:48 quinn
162 * First hack at Z/SR protocol
173 #include <yaz-version.h>
176 * Because we didn't have time to put all of the extra v3 elements in here
177 * before the first applications were written, we have to place them
178 * in #ifdefs in places where they would break existing code. If you are
179 * developing new stuff, we urge you to leave them in, even if you don't
180 * intend to use any v3 features. When we are comfortable that the old
181 * apps have been updated, we'll remove the #ifdefs.
186 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
189 typedef struct Z_External Z_External;
191 typedef Odr_oct Z_ReferenceId;
192 typedef char Z_DatabaseName;
193 typedef char Z_ResultSetId;
194 typedef Odr_oct Z_ResultsetId;
196 typedef struct Z_InfoCategory
198 Odr_oid *categoryTypeId; /* OPTIONAL */
202 typedef struct Z_OtherInformationUnit
204 Z_InfoCategory *category; /* OPTIONAL */
206 #define Z_OtherInfo_characterInfo 0
207 #define Z_OtherInfo_binaryInfo 1
208 #define Z_OtherInfo_externallyDefinedInfo 2
209 #define Z_OtherInfo_oid 3
214 Z_External *externallyDefinedInfo;
217 } Z_OtherInformationUnit;
219 typedef struct Z_OtherInformation
222 Z_OtherInformationUnit **list;
223 } Z_OtherInformation;
225 typedef struct Z_StringOrNumeric
228 #define Z_StringOrNumeric_string 0
229 #define Z_StringOrNumeric_numeric 1
237 typedef struct Z_Unit
239 char *unitSystem; /* OPTIONAL */
240 Z_StringOrNumeric *unitType; /* OPTIONAL */
241 Z_StringOrNumeric *unit; /* OPTIONAL */
242 int *scaleFactor; /* OPTIONAL */
245 typedef struct Z_IntUnit
251 typedef Odr_oct Z_SUTRS;
253 typedef struct Z_StringList
259 /* ----------------- INIT SERVICE ----------------*/
263 char *groupId; /* OPTIONAL */
264 char *userId; /* OPTIONAL */
265 char *password; /* OPTIONAL */
268 typedef struct Z_IdAuthentication
271 #define Z_IdAuthentication_open 0
272 #define Z_IdAuthentication_idPass 1
273 #define Z_IdAuthentication_anonymous 2
274 #define Z_IdAuthentication_other 3
282 } Z_IdAuthentication;
284 #define Z_ProtocolVersion_1 0
285 #define Z_ProtocolVersion_2 1
286 #define Z_ProtocolVersion_3 2
288 #define Z_Options_search 0
289 #define Z_Options_present 1
290 #define Z_Options_delSet 2
291 #define Z_Options_resourceReport 3
292 #define Z_Options_triggerResourceCtrl 4
293 #define Z_Options_resourceCtrl 5
294 #define Z_Options_accessCtrl 6
295 #define Z_Options_scan 7
296 #define Z_Options_sort 8
297 #define Z_Options_reserved 9
298 #define Z_Options_extendedServices 10
299 #define Z_Options_level_1Segmentation 11
300 #define Z_Options_level_2Segmentation 12
301 #define Z_Options_concurrentOperations 13
302 #define Z_Options_namedResultSets 14
304 typedef struct Z_InitRequest
306 Z_ReferenceId *referenceId; /* OPTIONAL */
307 Odr_bitmask *protocolVersion;
308 Odr_bitmask *options;
309 int *preferredMessageSize;
310 int *maximumRecordSize;
311 Z_IdAuthentication* idAuthentication; /* OPTIONAL */
312 char *implementationId; /* OPTIONAL */
313 char *implementationName; /* OPTIONAL */
314 char *implementationVersion; /* OPTIONAL */
315 Z_External *userInformationField; /* OPTIONAL */
317 Z_OtherInformation *otherInfo; /* OPTIONAL */
321 typedef struct Z_InitResponse
323 Z_ReferenceId *referenceId; /* OPTIONAL */
324 Odr_bitmask *protocolVersion;
325 Odr_bitmask *options;
326 int *preferredMessageSize;
327 int *maximumRecordSize;
329 char *implementationId; /* OPTIONAL */
330 char *implementationName; /* OPTIONAL */
331 char *implementationVersion; /* OPTIONAL */
332 Z_External *userInformationField; /* OPTIONAL */
334 Z_OtherInformation *otherInfo; /* OPTIONAL */
338 typedef struct Z_NSRAuthentication
343 } Z_NSRAuthentication;
345 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
347 int z_StrAuthentication(ODR o, char **p, int opt);
349 /* ------------------ SEARCH SERVICE ----------------*/
351 typedef struct Z_DatabaseSpecificUnit
354 char *elementSetName;
355 } Z_DatabaseSpecificUnit;
357 typedef struct Z_DatabaseSpecific
360 Z_DatabaseSpecificUnit **elements;
361 } Z_DatabaseSpecific;
363 typedef struct Z_ElementSetNames
366 #define Z_ElementSetNames_generic 0
367 #define Z_ElementSetNames_databaseSpecific 1
371 Z_DatabaseSpecific *databaseSpecific;
375 /* ---------------------- RPN QUERY --------------------------- */
377 typedef struct Z_ComplexAttribute
380 Z_StringOrNumeric **list;
381 int num_semanticAction;
382 int **semanticAction; /* OPTIONAL */
383 } Z_ComplexAttribute;
385 typedef struct Z_AttributeElement
388 Odr_oid *attributeSet; /* OPTIONAL - v3 only */
393 #define Z_AttributeValue_numeric 0
394 #define Z_AttributeValue_complex 1
398 Z_ComplexAttribute *complex;
403 } Z_AttributeElement;
405 typedef struct Z_Term
408 #define Z_Term_general 0
409 #define Z_Term_numeric 1
410 #define Z_Term_characterString 2
412 #define Z_Term_dateTime 4
413 #define Z_Term_external 5
414 #define Z_Term_integerAndUnit 6
415 #define Z_Term_null 7
418 Odr_oct *general; /* this is required for v2 */
420 char *characterString;
423 Z_External *external;
424 /* Z_IntUnit *integerAndUnit; */
429 typedef struct Z_AttributesPlusTerm
432 Z_AttributeElement **attributeList;
434 } Z_AttributesPlusTerm;
436 typedef struct Z_ResultSetPlusAttributes
440 Z_AttributeElement **attributeList;
441 } Z_ResultSetPlusAttributes;
443 typedef struct Z_ProximityOperator
445 bool_t *exclusion; /* OPTIONAL */
449 #define Z_Prox_lessThan 1
450 #define Z_Prox_lessThanOrEqual 2
451 #define Z_Prox_equal 3
452 #define Z_Prox_greaterThanOrEqual 4
453 #define Z_Prox_greaterThan 5
454 #define Z_Prox_notEqual 6
456 #define Z_ProxCode_known 0
457 #define Z_ProxCode_private 1
458 int *proximityUnitCode;
459 #define Z_ProxUnit_character 1
460 #define Z_ProxUnit_word 2
461 #define Z_ProxUnit_sentence 3
462 #define Z_ProxUnit_paragraph 4
463 #define Z_ProxUnit_section 5
464 #define Z_ProxUnit_chapter 6
465 #define Z_ProxUnit_document 7
466 #define Z_ProxUnit_element 8
467 #define Z_ProxUnit_subelement 9
468 #define Z_ProxUnit_elementType 10
469 #define Z_ProxUnit_byte 11 /* v3 only */
470 } Z_ProximityOperator;
472 typedef struct Z_Operator
475 #define Z_Operator_and 0
476 #define Z_Operator_or 1
477 #define Z_Operator_and_not 2
478 #define Z_Operator_prox 3
481 Odr_null *and; /* these guys are nulls. */
484 Z_ProximityOperator *prox;
488 typedef struct Z_Operand
491 #define Z_Operand_APT 0
492 #define Z_Operand_resultSetId 1
493 #define Z_Operand_resultAttr /* v3 only */ 2
496 Z_AttributesPlusTerm *attributesPlusTerm;
497 Z_ResultSetId *resultSetId;
498 Z_ResultSetPlusAttributes *resultAttr;
502 typedef struct Z_Complex
504 struct Z_RPNStructure *s1;
505 struct Z_RPNStructure *s2;
506 Z_Operator *roperator;
509 typedef struct Z_RPNStructure
512 #define Z_RPNStructure_simple 0
513 #define Z_RPNStructure_complex 1
521 typedef struct Z_RPNQuery
523 Odr_oid *attributeSetId;
524 Z_RPNStructure *RPNStructure;
527 /* -------------------------- SEARCHREQUEST -------------------------- */
529 typedef struct Z_Query
532 #define Z_Query_type_1 1
533 #define Z_Query_type_2 2
534 #define Z_Query_type_101 3
539 Z_RPNQuery *type_101;
543 typedef struct Z_SearchRequest
545 Z_ReferenceId *referenceId; /* OPTIONAL */
546 int *smallSetUpperBound;
547 int *largeSetLowerBound;
548 int *mediumSetPresentNumber;
549 bool_t *replaceIndicator;
551 int num_databaseNames;
552 char **databaseNames;
553 Z_ElementSetNames *smallSetElementSetNames; /* OPTIONAL */
554 Z_ElementSetNames *mediumSetElementSetNames; /* OPTIONAL */
555 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
558 Z_OtherInformation *additionalSearchInfo; /* OPTIONAL */
559 Z_OtherInformation *otherInfo; /* OPTIONAL */
563 /* ------------------------ RECORD -------------------------- */
565 typedef Z_External Z_DatabaseRecord;
569 typedef struct Z_DefaultDiagFormat
571 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
573 /* until the whole character set issue becomes more definite,
574 * you can probably ignore this on input. */
576 #define Z_DiagForm_v2AddInfo 0
577 #define Z_DiagForm_v3AddInfo 1
579 } Z_DefaultDiagFormat;
581 typedef struct Z_DiagRec
584 #define Z_DiagRec_defaultFormat 0
585 #define Z_DiagRec_externallyDefined 1
588 Z_DefaultDiagFormat *defaultFormat;
589 Z_External *externallyDefined;
595 typedef struct Z_DiagRec
597 Odr_oid *diagnosticSetId; /* This is opt'l to interwork with bad targets */
604 typedef struct Z_DiagRecs
607 Z_DiagRec **diagRecs;
610 typedef struct Z_NamePlusRecord
612 char *databaseName; /* OPTIONAL */
614 #define Z_NamePlusRecord_databaseRecord 0
615 #define Z_NamePlusRecord_surrogateDiagnostic 1
618 Z_DatabaseRecord *databaseRecord;
619 Z_DiagRec *surrogateDiagnostic;
623 typedef struct Z_NamePlusRecordList
626 Z_NamePlusRecord **records;
627 } Z_NamePlusRecordList;
629 typedef struct Z_Records
632 #define Z_Records_DBOSD 0
633 #define Z_Records_NSD 1
634 #define Z_Records_multipleNSD 2
637 Z_NamePlusRecordList *databaseOrSurDiagnostics;
638 Z_DiagRec *nonSurrogateDiagnostic;
639 Z_DiagRecs *multipleNonSurDiagnostics;
643 /* ------------------------ SEARCHRESPONSE ------------------ */
645 typedef struct Z_SearchResponse
647 Z_ReferenceId *referenceId; /* OPTIONAL */
649 int *numberOfRecordsReturned;
650 int *nextResultSetPosition;
651 bool_t *searchStatus;
652 int *resultSetStatus; /* OPTIONAL */
653 #define Z_RES_SUBSET 1
654 #define Z_RES_INTERIM 2
656 int *presentStatus; /* OPTIONAL */
657 #define Z_PRES_SUCCESS 0
658 #define Z_PRES_PARTIAL_1 1
659 #define Z_PRES_PARTIAL_2 2
660 #define Z_PRES_PARTIAL_3 3
661 #define Z_PRES_PARTIAL_4 4
662 #define Z_PRES_FAILURE 5
663 Z_Records *records; /* OPTIONAL */
665 Z_OtherInformation *additionalSearchInfo;
666 Z_OtherInformation *otherInfo;
670 /* ------------------------- PRESENT SERVICE -----------------*/
672 typedef struct Z_ElementSpec
675 #define Z_ElementSpec_elementSetName 0
676 #define Z_ElementSpec_externalSpec 1
679 char *elementSetName;
680 Z_External *externalSpec;
684 typedef struct Z_Specification
686 Odr_oid *schema; /* OPTIONAL */
687 Z_ElementSpec *elementSpec; /* OPTIONAL */
690 typedef struct Z_DbSpecific
693 Z_Specification *spec;
696 typedef struct Z_CompSpec
698 bool_t *selectAlternativeSyntax;
699 Z_Specification *generic; /* OPTIONAL */
701 Z_DbSpecific **dbSpecific; /* OPTIONAL */
702 int num_recordSyntax;
703 Odr_oid **recordSyntax; /* OPTIONAL */
706 typedef struct Z_RecordComposition
709 #define Z_RecordComp_simple 0
710 #define Z_RecordComp_complex 1
713 Z_ElementSetNames *simple;
716 } Z_RecordComposition;
718 typedef struct Z_Range
720 int *startingPosition;
721 int *numberOfRecords;
724 typedef struct Z_PresentRequest
726 Z_ReferenceId *referenceId; /* OPTIONAL */
727 Z_ResultSetId *resultSetId;
728 int *resultSetStartPoint;
729 int *numberOfRecordsRequested;
732 Z_Range **additionalRanges; /* OPTIONAL */
733 Z_RecordComposition *recordComposition; /* OPTIONAL */
735 Z_ElementSetNames *elementSetNames; /* OPTIONAL */
737 Odr_oid *preferredRecordSyntax; /* OPTIONAL */
739 int *maxSegmentCount; /* OPTIONAL */
740 int *maxRecordSize; /* OPTIONAL */
741 int *maxSegmentSize; /* OPTIONAL */
742 Z_OtherInformation *otherInfo; /* OPTIONAL */
746 typedef struct Z_PresentResponse
748 Z_ReferenceId *referenceId; /* OPTIONAL */
749 int *numberOfRecordsReturned;
750 int *nextResultSetPosition;
754 Z_OtherInformation *otherInfo; /* OPTIONAL */
758 /* ------------------ RESOURCE CONTROL ----------------*/
760 typedef struct Z_TriggerResourceControlRequest
762 Z_ReferenceId *referenceId; /* OPTIONAL */
763 int *requestedAction;
764 #define Z_TriggerResourceCtrl_resourceReport 1
765 #define Z_TriggerResourceCtrl_resourceControl 2
766 #define Z_TriggerResourceCtrl_cancel 3
767 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
768 bool_t *resultSetWanted; /* OPTIONAL */
770 Z_OtherInformation *otherInfo;
772 } Z_TriggerResourceControlRequest;
774 typedef struct Z_ResourceControlRequest
776 Z_ReferenceId *referenceId; /* OPTIONAL */
777 bool_t *suspendedFlag; /* OPTIONAL */
778 Z_External *resourceReport; /* OPTIONAL */
779 int *partialResultsAvailable; /* OPTIONAL */
780 #define Z_ResourceControlRequest_subset 1
781 #define Z_ResourceControlRequest_interim 2
782 #define Z_ResourceControlRequest_none 3
783 bool_t *responseRequired;
784 bool_t *triggeredRequestFlag; /* OPTIONAL */
786 Z_OtherInformation *otherInfo;
788 } Z_ResourceControlRequest;
790 typedef struct Z_ResourceControlResponse
792 Z_ReferenceId *referenceId; /* OPTIONAL */
793 bool_t *continueFlag;
794 bool_t *resultSetWanted; /* OPTIONAL */
796 Z_OtherInformation *otherInfo;
798 } Z_ResourceControlResponse;
801 /* ------------------ ACCESS CTRL SERVICE ----------------*/
803 typedef struct Z_AccessControlRequest
805 Z_ReferenceId *referenceId; /* OPTIONAL */
807 #define Z_AccessRequest_simpleForm 0
808 #define Z_AccessRequest_externallyDefined 1
812 Z_External *externallyDefined;
815 Z_OtherInformation *otherInfo; /* OPTIONAL */
817 } Z_AccessControlRequest;
819 typedef struct Z_AccessControlResponse
821 Z_ReferenceId *referenceId; /* OPTIONAL */
823 #define Z_AccessResponse_simpleForm 0
824 #define Z_AccessResponse_externallyDefined 1
828 Z_External *externallyDefined;
830 Z_DiagRec *diagnostic; /* OPTIONAL */
832 Z_OtherInformation *otherInfo; /* OPTIONAL */
834 } Z_AccessControlResponse;
836 /* ------------------------ SCAN SERVICE -------------------- */
838 typedef struct Z_AttributeList
841 Z_AttributeElement **attributes;
844 typedef struct Z_AlternativeTerm
847 Z_AttributesPlusTerm **terms;
852 typedef struct Z_ByDatabase
855 int *num; /* OPTIONAL */
856 Z_OtherInformation *otherDbInfo; /* OPTIONAL */
859 typedef struct Z_ByDatabaseList
862 Z_ByDatabase **elements;
865 typedef struct Z_ScanOccurrences
868 #define Z_ScanOccurrences_global 0
869 #define Z_ScanOccurrences_byDatabase 1
873 Z_ByDatabaseList *byDatabase;
878 typedef struct Z_OccurrenceByAttributesElem
880 Z_AttributeList *attributes;
881 Z_ScanOccurrences *occurrences; /* OPTIONAL */
882 Z_OtherInformation *otherOccurInfo; /* OPTIONAL */
883 } Z_OccurrenceByAttributesElem;
885 typedef struct Z_OccurrenceByAttributes
888 Z_OccurrenceByAttributesElem **elements;
889 } Z_OccurrenceByAttributes;
894 * Old, incomplete definition of OccurrenceByAttributes.
897 typedef struct Z_OccurrenceByAttributes
899 Z_AttributeList *attributes;
902 #define Z_OByAtt_global 0
903 #define Z_ObyAtt_byDatabase 1
909 /* Z_ByDatabase *byDatabase; */
912 } Z_OccurrenceByAttributes;
916 typedef struct Z_TermInfo
919 char *displayTerm; /* OPTIONAL */
920 Z_AttributeList *suggestedAttributes; /* OPTIONAL */
921 Z_AlternativeTerm *alternativeTerm; /* OPTIONAL */
922 int *globalOccurrences; /* OPTIONAL */
923 Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
924 Z_OtherInformation *otherTermInfo; /* OPTIONAL */
927 typedef struct Z_Entry
930 #define Z_Entry_termInfo 0
931 #define Z_Entry_surrogateDiagnostic 1
934 Z_TermInfo *termInfo;
935 Z_DiagRec *surrogateDiagnostic;
939 typedef struct Z_Entries
945 typedef struct Z_ListEntries
948 #define Z_ListEntries_entries 0
949 #define Z_ListEntries_nonSurrogateDiagnostics 1
953 Z_DiagRecs *nonSurrogateDiagnostics;
957 typedef struct Z_ScanRequest
959 Z_ReferenceId *referenceId; /* OPTIONAL */
960 int num_databaseNames;
961 char **databaseNames;
962 Odr_oid *attributeSet; /* OPTIONAL */
963 Z_AttributesPlusTerm *termListAndStartPoint;
964 int *stepSize; /* OPTIONAL */
965 int *numberOfTermsRequested;
966 int *preferredPositionInResponse; /* OPTIONAL */
968 Z_OtherInformation *otherInfo;
972 typedef struct Z_ScanResponse
974 Z_ReferenceId *referenceId; /* OPTIONAL */
975 int *stepSize; /* OPTIONAL */
977 #define Z_Scan_success 0
978 #define Z_Scan_partial_1 1
979 #define Z_Scan_partial_2 2
980 #define Z_Scan_partial_3 3
981 #define Z_Scan_partial_4 4
982 #define Z_Scan_partial_5 5
983 #define Z_Scan_failure 6
984 int *numberOfEntriesReturned;
985 int *positionOfTerm; /* OPTIONAL */
986 Z_ListEntries *entries; /* OPTIONAL */
987 Odr_oid *attributeSet; /* OPTIONAL */
989 Z_OtherInformation *otherInfo;
994 /* ------------------------ DELETE -------------------------- */
996 #define Z_DeleteStatus_success 0
997 #define Z_DeleteStatus_resultSetDidNotExist 1
998 #define Z_DeleteStatus_previouslyDeletedByTarget 2
999 #define Z_DeleteStatus_systemProblemAtTarget 3
1000 #define Z_DeleteStatus_accessNotAllowed 4
1001 #define Z_DeleteStatus_resourceControlAtOrigin 5
1002 #define Z_DeleteStatus_resourceControlAtTarget 6
1003 #define Z_DeleteStatus_bulkDeleteNotSupported 7
1004 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte 8
1005 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
1006 #define Z_DeleteStatus_resultSetInUse 10
1008 typedef struct Z_ListStatus
1014 typedef struct Z_DeleteResultSetRequest
1016 Z_ReferenceId *referenceId; /* OPTIONAL */
1017 int *deleteFunction;
1018 #define Z_DeleteRequest_list 0
1019 #define Z_DeleteRequest_all 1
1021 Z_ResultSetId **resultSetList; /* OPTIONAL */
1023 Z_OtherInformation *otherInfo;
1025 } Z_DeleteResultSetRequest;
1027 typedef struct Z_DeleteResultSetResponse
1029 Z_ReferenceId *referenceId; /* OPTIONAL */
1030 int *deleteOperationStatus;
1032 Z_ListStatus *deleteListStatuses; /* OPTIONAL */
1033 int *numberNotDeleted; /* OPTIONAL */
1034 int num_bulkStatuses;
1035 Z_ListStatus *bulkStatuses; /* OPTIONAL */
1036 char *deleteMessage; /* OPTIONAL */
1038 Z_OtherInformation *otherInfo;
1040 } Z_DeleteResultSetResponse;
1042 /* ------------------------ CLOSE SERVICE ------------------- */
1044 typedef struct Z_Close
1046 Z_ReferenceId *referenceId; /* OPTIONAL */
1048 #define Z_Close_finished 0
1049 #define Z_Close_shutdown 1
1050 #define Z_Close_systemProblem 2
1051 #define Z_Close_costLimit 3
1052 #define Z_Close_resources 4
1053 #define Z_Close_securityViolation 5
1054 #define Z_Close_protocolError 6
1055 #define Z_Close_lackOfActivity 7
1056 #define Z_Close_peerAbort 8
1057 #define Z_Close_unspecified 9
1058 char *diagnosticInformation; /* OPTIONAL */
1059 Odr_oid *resourceReportFormat; /* OPTIONAL */
1060 Z_External *resourceReport; /* OPTIONAL */
1062 Z_OtherInformation *otherInfo; /* OPTIONAL */
1066 /* ------------------------ SEGMENTATION -------------------- */
1068 typedef struct Z_Segment
1070 Z_ReferenceId *referenceId; /* OPTIONAL */
1071 int *numberOfRecordsReturned;
1072 int num_segmentRecords;
1073 Z_NamePlusRecord **segmentRecords;
1074 Z_OtherInformation *otherInfo; /* OPTIONAL */
1077 /* ----------------------- Extended Services ---------------- */
1079 typedef struct Z_Permissions
1082 int num_allowableFunctions;
1083 int **allowableFunctions;
1084 #define Z_Permissions_delete 1
1085 #define Z_Permissions_modifyContents 2
1086 #define Z_Permissions_modifyPermissions 3
1087 #define Z_Permissions_present 4
1088 #define Z_Permissions_invoke 5
1091 typedef struct Z_ExtendedServicesRequest
1093 Z_ReferenceId *referenceId; /* OPTIONAL */
1095 #define Z_ExtendedServicesRequest_create 1
1096 #define Z_ExtendedServicesRequest_delete 2
1097 #define Z_ExtendedServicesRequest_modify 3
1098 Odr_oid *packageType;
1099 char *packageName; /* OPTIONAL */
1100 char *userId; /* OPTIONAL */
1101 Z_IntUnit *retentionTime; /* OPTIONAL */
1102 Z_Permissions *permissions; /* OPTIONAL */
1103 char *description; /* OPTIONAL */
1104 Z_External *taskSpecificParameters; /* OPTIONAL */
1106 #define Z_ExtendedServicesRequest_wait 1
1107 #define Z_ExtendedServicesRequest_waitIfPossible 2
1108 #define Z_ExtendedServicesRequest_dontWait 3
1109 #define Z_ExtendedServicesRequest_dontReturnPackage 4
1110 char *elements; /* OPTIONAL */
1111 Z_OtherInformation *otherInfo; /* OPTIONAL */
1112 } Z_ExtendedServicesRequest;
1114 typedef struct Z_ExtendedServicesResponse
1116 Z_ReferenceId *referenceId; /* OPTIONAL */
1117 int *operationStatus;
1118 #define Z_ExtendedServicesResponse_done 1
1119 #define Z_ExtendedServicesResponse_accepted 2
1120 #define Z_ExtendedServicesResponse_failure 3
1121 int num_diagnostics;
1122 Z_DiagRec **diagnostics; /* OPTIONAL */
1123 Z_External *taskPackage; /* OPTIONAL */
1124 Z_OtherInformation *otherInfo; /* OPTIONAL */
1125 } Z_ExtendedServicesResponse;
1127 /* ------------------------ Sort --------------------------- */
1129 typedef struct Z_SortAttributes
1132 Z_AttributeList *list;
1135 typedef struct Z_SortKey
1138 #define Z_SortKey_sortField 0
1139 #define Z_SortKey_elementSpec 1
1140 #define Z_SortKey_sortAttributes 2
1144 Z_Specification *elementSpec;
1145 Z_SortAttributes *sortAttributes;
1149 typedef struct Z_SortDbSpecific
1155 typedef struct Z_SortDbSpecificList
1158 Z_SortDbSpecific **dbSpecific;
1159 } Z_SortDbSpecificList;
1161 typedef struct Z_SortElement
1164 #define Z_SortElement_generic 0
1165 #define Z_SortElement_databaseSpecific 1
1169 Z_SortDbSpecificList *databaseSpecific;
1173 typedef struct Z_SortMissingValueAction
1176 #define Z_SortMissingValAct_abort 0
1177 #define Z_SortMissingValAct_null 1
1178 #define Z_SortMissingValAct_valData 2
1185 } Z_SortMissingValueAction;
1187 typedef struct Z_SortKeySpec
1189 Z_SortElement *sortElement;
1191 #define Z_SortRelation_ascending 0
1192 #define Z_SortRelation_descending 1
1193 #define Z_SortRelation_ascendingByFreq 3
1194 #define Z_SortRelation_descendingByFreq 4
1195 int *caseSensitivity;
1196 #define Z_SortCase_caseSensitive 0
1197 #define Z_SortCase_caseInsensitive 1
1198 Z_SortMissingValueAction *missingValueAction; /* OPTIONAL */
1201 typedef struct Z_SortResponse
1203 Z_ReferenceId *referenceId; /* OPTIONAL */
1205 #define Z_SortStatus_success 0
1206 #define Z_SortStatus_partial_1 1
1207 #define Z_SortStatus_failure 2
1208 int *resultSetStatus; /* OPTIONAL */
1209 #define Z_SortResultSetStatus_empty 1
1210 #define Z_SortResultSetStatus_interim 2
1211 #define Z_SortResultSetStatus_unchanged 3
1212 #define Z_SortResultSetStatus_none 4
1213 Z_DiagRecs *diagnostics; /* OPTIONAL */
1214 Z_OtherInformation *otherInfo; /* OPTIONAL */
1217 typedef struct Z_SortKeySpecList
1220 Z_SortKeySpec **specs;
1221 } Z_SortKeySpecList;
1223 typedef struct Z_SortRequest
1225 Z_ReferenceId *referenceId; /* OPTIONAL */
1226 Z_StringList *inputResultSetNames;
1227 char *sortedResultSetName;
1228 Z_SortKeySpecList *sortSequence;
1229 Z_OtherInformation *otherInfo; /* OPTIONAL */
1232 /* ----------------------- Resource Report ------------------ */
1234 typedef struct Z_ResourceReportRequest
1236 Z_ReferenceId *referenceId; /* OPTIONAL */
1237 Z_ReferenceId *opId; /* OPTIONAL */
1238 Odr_oid *prefResourceReportFormat; /* OPTIONAL */
1239 Z_OtherInformation *otherInfo; /* OPTIONAL */
1240 } Z_ResourceReportRequest;
1242 typedef struct Z_ResourceReportResponse
1244 Z_ReferenceId *referenceId; /* OPTIONAL */
1245 int *resourceReportStatus;
1246 #define Z_ResourceReportStatus_success 0
1247 #define Z_ResourceReportStatus_partial 1
1248 #define Z_ResourceReportStatus_failure_1 2
1249 #define Z_ResourceReportStatus_failure_2 3
1250 #define Z_ResourceReportStatus_failure_3 4
1251 #define Z_ResourceReportStatus_failure_4 5
1252 #define Z_ResourceReportStatus_failure_5 6
1253 #define Z_ResourceReportStatus_failure_6 7
1254 Z_External *resourceReport; /* OPTIONAL */
1255 Z_OtherInformation *otherInfo; /* OPTIONAL */
1256 } Z_ResourceReportResponse;
1258 /* ------------------------ APDU ---------------------------- */
1260 typedef struct Z_APDU
1263 #define Z_APDU_initRequest 0
1264 #define Z_APDU_initResponse 1
1265 #define Z_APDU_searchRequest 2
1266 #define Z_APDU_searchResponse 3
1267 #define Z_APDU_presentRequest 4
1268 #define Z_APDU_presentResponse 5
1269 #define Z_APDU_deleteResultSetRequest 6
1270 #define Z_APDU_deleteResultSetResponse 7
1271 #define Z_APDU_resourceControlRequest 8
1272 #define Z_APDU_resourceControlResponse 9
1273 #define Z_APDU_triggerResourceControlRequest 10
1274 #define Z_APDU_scanRequest 11
1275 #define Z_APDU_scanResponse 12
1276 #define Z_APDU_segmentRequest 13
1277 #define Z_APDU_extendedServicesRequest 14
1278 #define Z_APDU_extendedServicesResponse 15
1279 #define Z_APDU_close 16
1280 #define Z_APDU_accessControlRequest 17
1281 #define Z_APDU_accessControlResponse 18
1282 #define Z_APDU_sortRequest 20
1283 #define Z_APDU_sortResponse 21
1284 #define Z_APDU_resourceReportRequest 22
1285 #define Z_APDU_resourceReportResponse 23
1288 Z_InitRequest *initRequest;
1289 Z_InitResponse *initResponse;
1290 Z_SearchRequest *searchRequest;
1291 Z_SearchResponse *searchResponse;
1292 Z_PresentRequest *presentRequest;
1293 Z_PresentResponse *presentResponse;
1294 Z_DeleteResultSetRequest *deleteResultSetRequest;
1295 Z_DeleteResultSetResponse *deleteResultSetResponse;
1296 Z_AccessControlRequest *accessControlRequest;
1297 Z_AccessControlResponse *accessControlResponse;
1298 Z_ResourceControlRequest *resourceControlRequest;
1299 Z_ResourceControlResponse *resourceControlResponse;
1300 Z_TriggerResourceControlRequest *triggerResourceControlRequest;
1301 Z_ResourceReportRequest *resourceReportRequest;
1302 Z_ResourceReportResponse *resourceReportResponse;
1303 Z_ScanRequest *scanRequest;
1304 Z_ScanResponse *scanResponse;
1305 Z_SortRequest *sortRequest;
1306 Z_SortResponse *sortResponse;
1307 Z_Segment *segmentRequest;
1308 Z_ExtendedServicesRequest *extendedServicesRequest;
1309 Z_ExtendedServicesResponse *extendedServicesResponse;
1314 int z_APDU(ODR o, Z_APDU **p, int opt);
1315 int z_SUTRS(ODR o, Odr_oct **p, int opt);
1317 Z_InitRequest *zget_InitRequest(ODR o);
1318 Z_InitResponse *zget_InitResponse(ODR o);
1319 Z_SearchRequest *zget_SearchRequest(ODR o);
1320 Z_SearchResponse *zget_SearchResponse(ODR o);
1321 Z_PresentRequest *zget_PresentRequest(ODR o);
1322 Z_PresentResponse *zget_PresentResponse(ODR o);
1323 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
1324 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
1325 Z_ScanRequest *zget_ScanRequest(ODR o);
1326 Z_ScanResponse *zget_ScanResponse(ODR o);
1327 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
1328 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
1329 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
1330 Z_Close *zget_Close(ODR o);
1331 int z_StringList(ODR o, Z_StringList **p, int opt);
1332 int z_InternationalString(ODR o, char **p, int opt);
1333 int z_OtherInformation(ODR o, Z_OtherInformation **p, int opt);
1334 int z_ElementSetName(ODR o, char **p, int opt);
1335 int z_IntUnit(ODR o, Z_IntUnit **p, int opt);
1336 int z_Unit(ODR o, Z_Unit **p, int opt);
1337 int z_DatabaseName(ODR o, Z_DatabaseName **p, int opt);
1338 int z_StringOrNumeric(ODR o, Z_StringOrNumeric **p, int opt);
1339 int z_OtherInformationUnit(ODR o, Z_OtherInformationUnit **p, int opt);
1340 int z_Term(ODR o, Z_Term **p, int opt);
1341 int z_Specification(ODR o, Z_Specification **p, int opt);
1342 int z_Permissions(ODR o, Z_Permissions **p, int opt);
1343 int z_DiagRec(ODR o, Z_DiagRec **p, int opt);
1344 int z_AttributeList(ODR o, Z_AttributeList **p, int opt);
1345 int z_DefaultDiagFormat(ODR o, Z_DefaultDiagFormat **p, int opt);
1346 Z_APDU *zget_APDU(ODR o, int which);
1348 #include <prt-rsc.h>
1349 #include <prt-acc.h>
1350 #include <prt-exp.h>
1351 #include <prt-grs.h>
1352 #include <prt-arc.h>
1353 #include <prt-exd.h>
1354 #include <prt-dia.h>
1355 #include <prt-esp.h>
1357 #include <prt-ext.h>