Add access control
[yaz-moved-to-github.git] / include / proto.h
1 /*
2  * Copyright (c) 1995, Index Data.
3  *
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,
6  * provided that:
7  *
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.
11  *
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.
15  *
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
24  * OF THIS SOFTWARE.
25  *
26  * $Log: proto.h,v $
27  * Revision 1.11  1995-06-02 09:49:47  quinn
28  * Add access control
29  *
30  * Revision 1.10  1995/05/29  08:11:34  quinn
31  * Moved oid from odr/asn to util.
32  *
33  * Revision 1.9  1995/05/22  11:31:25  quinn
34  * Added PDUs
35  *
36  * Revision 1.8  1995/05/17  08:41:35  quinn
37  * Added delete to proto & other little things.
38  * Relaying auth info to backend.
39  *
40  * Revision 1.7  1995/05/16  08:50:37  quinn
41  * License, documentation, and memory fixes
42  *
43  * Revision 1.6  1995/05/15  11:55:55  quinn
44  * Work on asynchronous activity.
45  *
46  * Revision 1.5  1995/04/17  11:28:18  quinn
47  * Smallish
48  *
49  * Revision 1.4  1995/04/10  10:22:47  quinn
50  * Added SCAN
51  *
52  * Revision 1.3  1995/03/30  12:18:09  quinn
53  * Added info.
54  *
55  * Revision 1.2  1995/03/30  10:26:48  quinn
56  * Added Term structure
57  *
58  * Revision 1.1  1995/03/30  09:39:42  quinn
59  * Moved .h files to include directory
60  *
61  * Revision 1.11  1995/03/30  09:08:44  quinn
62  * Added Resource control protocol
63  *
64  * Revision 1.10  1995/03/29  15:39:39  quinn
65  * Adding some resource control elements, and a null-check to getentbyoid
66  *
67  * Revision 1.9  1995/03/29  08:06:18  quinn
68  * Added a few v3 elements
69  *
70  * Revision 1.8  1995/03/22  10:12:49  quinn
71  * Added Z_PRES constants.
72  *
73  * Revision 1.7  1995/03/20  09:45:12  quinn
74  * Working towards v3
75  *
76  * Revision 1.5  1995/03/07  16:29:34  quinn
77  * Added authentication stuff.
78  *
79  * Revision 1.4  1995/03/07  10:13:00  quinn
80  * Added prototype for z_APDU()
81  *
82  * Revision 1.3  1995/02/14  11:54:23  quinn
83  * Fixing include.
84  *
85  * Revision 1.2  1995/02/09  15:51:40  quinn
86  * Works better now.
87  *
88  * Revision 1.1  1995/02/06  16:44:48  quinn
89  * First hack at Z/SR protocol
90  *
91  */
92
93 #ifndef PROTO_H
94 #define PROTO_H
95
96 #include <odr.h>
97 #include <oid.h>
98 #include <odr_use.h>
99
100 /* ----------------- GLOBAL AUXILIARY DEFS ----------------*/
101
102 typedef Odr_oct Z_ReferenceId;
103 typedef char Z_DatabaseName;
104 typedef char Z_ResultSetId;
105 typedef Odr_oct Z_ResultsetId;
106 typedef Odr_external Z_UserInformationField;
107
108 typedef struct Z_InfoCategory
109 {
110     Odr_oid *categoryTypeId;         /* OPTIONAL */
111     int *categoryValue;
112 } Z_InfoCategory;
113
114 typedef struct Z_OtherInformationUnit
115 {
116     Z_InfoCategory *category;        /* OPTIONAL */
117     enum
118     {
119         Z_OtherInfo_characterInfo,
120         Z_OtherInfo_binaryInfo,
121         Z_OtherInfo_externallyDefinedInfo,
122         Z_OtherInfo_oid
123     } which;
124     union
125     {
126         char *characterInfo; 
127         Odr_oct *binaryInfo;
128         Odr_external *externallyDefinedInfo;
129         Odr_oid *oid;
130     } information;
131 } Z_OtherInformationUnit;
132
133 typedef struct Z_OtherInformation
134 {
135     int num_elements;
136     Z_OtherInformationUnit **list;
137 } Z_OtherInformation;
138
139 typedef struct Z_StringOrNumeric
140 {
141     enum
142     {
143         Z_StringOrNumeric_string,
144         Z_StringOrNumeric_numeric
145     } which;
146     union
147     {
148         char *string;
149         int *numeric;
150     } u;
151 } Z_StringOrNumeric;
152
153 typedef struct Z_Unit
154 {
155     char *unitSystem;               /* OPTIONAL */
156     Z_StringOrNumeric *unitType;    /* OPTIONAL */
157     Z_StringOrNumeric *unit;        /* OPTIONAL */
158     int *scaleFactor;               /* OPTIONAL */
159 } Z_Unit;
160
161 typedef struct Z_IntUnit
162 {
163     int *value;
164     Z_Unit *unitUsed;
165 } Z_IntUnit;
166
167 /* ----------------- INIT SERVICE  ----------------*/
168
169 typedef struct
170 {
171     char *groupId;       /* OPTIONAL */
172     char *userId;         /* OPTIONAL */
173     char *password;      /* OPTIONAL */
174 } Z_IdPass;
175
176 typedef struct Z_IdAuthentication
177 {
178     enum
179     {
180         Z_IdAuthentication_open,
181         Z_IdAuthentication_idPass,
182         Z_IdAuthentication_anonymous,
183         Z_IdAuthentication_other
184     } which;
185     union
186     {
187         char *open;
188         Z_IdPass *idPass;
189         Odr_null *anonymous;
190         Odr_external *other;
191     } u;
192 } Z_IdAuthentication;
193
194 #define Z_ProtocolVersion_1            0
195 #define Z_ProtocolVersion_2            1
196 #define Z_ProtocolVersion_3            2
197
198 #define Z_Options_search               0
199 #define Z_Options_present              1
200 #define Z_Options_delSet               2
201 #define Z_Options_resourceReport       3
202 #define Z_Options_triggerResourceCtrl  4
203 #define Z_Options_resourceCtrl         5
204 #define Z_Options_accessCtrl           6
205 #define Z_Options_scan                 7
206 #define Z_Options_sort                 8
207 #define Z_Options_reserved             9
208 #define Z_Options_extendedServices    10
209 #define Z_Options_level_1Segmentation 11
210 #define Z_Options_level_2Segmentation 12
211 #define Z_Options_concurrentOperations 13
212 #define Z_Options_namedResultSets     14
213
214 typedef struct Z_InitRequest
215 {
216     Z_ReferenceId *referenceId;                   /* OPTIONAL */
217     Odr_bitmask *options;
218     Odr_bitmask *protocolVersion;
219     int *preferredMessageSize;
220     int *maximumRecordSize;
221     Z_IdAuthentication* idAuthentication;        /* OPTIONAL */
222     char *implementationId;                      /* OPTIONAL */
223     char *implementationName;                    /* OPTIONAL */
224     char *implementationVersion;                 /* OPTIONAL */
225     Z_UserInformationField *userInformationField; /* OPTIONAL */
226 } Z_InitRequest;
227
228 typedef struct Z_InitResponse
229 {
230     Z_ReferenceId *referenceId;    /* OPTIONAL */
231     Odr_bitmask *options;
232     Odr_bitmask *protocolVersion;
233     int *preferredMessageSize;
234     int *maximumRecordSize;
235     bool_t *result;
236     char *implementationId;      /* OPTIONAL */
237     char *implementationName;    /* OPTIONAL */
238     char *implementationVersion; /* OPTIONAL */
239     Z_UserInformationField *userInformationField; /* OPTIONAL */
240 } Z_InitResponse;
241
242 typedef struct Z_NSRAuthentication
243 {
244     char *user;
245     char *password;
246     char *account;
247 } Z_NSRAuthentication;
248
249 int z_NSRAuthentication(ODR o, Z_NSRAuthentication **p, int opt);
250
251 int z_StrAuthentication(ODR o, char **p, int opt);
252
253
254 /* ------------------ RESOURCE CONTROL ----------------*/
255
256 typedef struct Z_TriggerResourceControlRequest
257 {
258     Z_ReferenceId *referenceId;    /* OPTIONAL */
259     int *requestedAction;
260 #define Z_TriggerResourceCtrl_resourceReport  1
261 #define Z_TriggerResourceCtrl_resourceControl 2
262 #define Z_TriggerResourceCtrl_cancel          3
263     Odr_oid *prefResourceReportFormat;  /* OPTIONAL */
264     bool_t *resultSetWanted;            /* OPTIONAL */
265 } Z_TriggerResourceControlRequest;
266
267 typedef struct Z_ResourceControlRequest
268 {
269     Z_ReferenceId *referenceId;    /* OPTIONAL */
270     bool_t *suspendedFlag;         /* OPTIONAL */
271     Odr_external *resourceReport; /* OPTIONAL */
272     int *partialResultsAvailable;  /* OPTIONAL */
273 #define Z_ResourceControlRequest_subset    1
274 #define Z_ResourceControlRequest_interim   2
275 #define Z_ResourceControlRequest_none      3
276     bool_t *responseRequired;
277     bool_t *triggeredRequestFlag;  /* OPTIONAL */
278 } Z_ResourceControlRequest;
279
280 typedef struct Z_ResourceControlResponse
281 {
282     Z_ReferenceId *referenceId;    /* OPTIONAL */
283     bool_t *continueFlag;
284     bool_t *resultSetWanted;       /* OPTIONAL */
285 } Z_ResourceControlResponse;
286
287 /* ------------------ SEARCH SERVICE ----------------*/
288
289 typedef Odr_oid Z_PreferredRecordSyntax;
290
291 typedef struct Z_DatabaseSpecificUnit
292 {
293     char *databaseName;
294     char *elementSetName;
295 } Z_DatabaseSpecificUnit;
296
297 typedef struct Z_DatabaseSpecific
298 {
299     int num_elements;
300     Z_DatabaseSpecificUnit **elements;
301 } Z_DatabaseSpecific;
302
303 typedef struct Z_ElementSetNames
304 {
305     int which;
306 #define Z_ElementSetNames_generic 0
307 #define Z_ElementSetNames_databaseSpecific 1
308     union
309     {
310         char *generic;
311         Z_DatabaseSpecific *databaseSpecific;
312     } u;
313 } Z_ElementSetNames;
314
315 /* ---------------------- RPN QUERY --------------------------- */
316
317 typedef struct Z_AttributeElement
318 {
319     int *attributeType;
320     int *attributeValue;
321 } Z_AttributeElement;
322
323 #define Z_V3
324 #ifdef Z_V3
325
326 typedef struct Z_Term 
327 {
328     enum
329     {
330         Z_Term_general,
331         Z_Term_numeric,
332         Z_Term_characterString,
333         Z_Term_oid,
334         Z_Term_dateTime,
335         Z_Term_external,
336         Z_Term_integerAndUnit,
337         Z_Term_null
338     } which;
339     union
340     {
341         Odr_oct *general; /* this is required for v2 */
342         int *numeric;
343         char *characterString;
344         Odr_oid *oid;
345         char *dateTime;
346         Odr_external *external;
347         /* Z_IntUnit *integerAndUnit; */
348         Odr_null *null;
349     } u;
350 } Z_Term;
351
352 #endif
353
354 typedef struct Z_AttributesPlusTerm
355 {
356     int num_attributes;
357     Z_AttributeElement **attributeList;
358 #ifdef Z_V3
359     Z_Term *term;
360 #else
361     Odr_oct *term;
362 #endif
363 } Z_AttributesPlusTerm;
364
365 typedef struct Z_ProximityOperator
366 {
367     bool_t *exclusion;          /* OPTIONAL */
368     int *distance;
369     bool_t *ordered;
370     int *relationType;
371 #define Z_Prox_lessThan           1
372 #define Z_Prox_lessThanOrEqual    2
373 #define Z_Prox_equal              3
374 #define Z_Prox_greaterThanOrEqual 4
375 #define Z_Prox_greaterThan        5
376 #define Z_Prox_notEqual           6
377     enum
378     {
379         Z_ProxCode_known,
380         Z_ProxCode_private
381     } which;
382     int *proximityUnitCode;
383 #define Z_ProxUnit_character       1
384 #define Z_ProxUnit_word            2
385 #define Z_ProxUnit_sentence        3
386 #define Z_ProxUnit_paragraph       4
387 #define Z_ProxUnit_section         5
388 #define Z_ProxUnit_chapter         6
389 #define Z_ProxUnit_document        7
390 #define Z_ProxUnit_element         8
391 #define Z_ProxUnit_subelement      9
392 #define Z_ProxUnit_elementType    10
393 #define Z_ProxUnit_byte           11   /* v3 only */
394 } Z_ProximityOperator;
395
396 typedef struct Z_Operator
397 {
398     enum
399     {
400         Z_Operator_and,
401         Z_Operator_or,
402         Z_Operator_and_not,
403         Z_Operator_prox
404     } which;
405     union
406     {
407         Odr_null *and;          /* these guys are nulls. */
408         Odr_null *or;
409         Odr_null *and_not;
410         Z_ProximityOperator *prox;
411     } u;
412 } Z_Operator;
413
414 typedef struct Z_Operand
415 {
416     int which;
417 #define Z_Operand_APT 0
418 #define Z_Operand_resultSetId 1
419     union
420     {
421         Z_AttributesPlusTerm *attributesPlusTerm;
422         Z_ResultSetId *resultSetId;
423     } u;
424 } Z_Operand;
425
426 typedef struct Z_Complex
427 {
428     struct Z_RPNStructure *s1;
429     struct Z_RPNStructure *s2;
430     Z_Operator *operator;
431 } Z_Complex;
432
433 typedef struct Z_RPNStructure
434 {
435     int which;
436 #define Z_RPNStructure_simple 0
437 #define Z_RPNStructure_complex 1
438     union
439     {
440         Z_Operand *simple;
441         Z_Complex *complex;
442     } u;
443 } Z_RPNStructure;
444
445 typedef struct Z_RPNQuery
446 {
447     Odr_oid *attributeSetId;
448     Z_RPNStructure *RPNStructure;
449 } Z_RPNQuery;
450
451 /* -------------------------- SEARCHREQUEST -------------------------- */
452
453 typedef struct Z_Query
454 {
455     int which;
456 #define Z_Query_type_1 1
457 #define Z_Query_type_2 2
458     union
459     {
460         Z_RPNQuery *type_1;
461         Odr_oct *type_2;
462     } u;
463 } Z_Query;
464
465 typedef struct Z_SearchRequest
466 {
467     Z_ReferenceId *referenceId;   /* OPTIONAL */
468     int *smallSetUpperBound;
469     int *largeSetLowerBound;
470     int *mediumSetPresentNumber;
471     bool_t *replaceIndicator;
472     char *resultSetName;
473     int num_databaseNames;
474     char **databaseNames;
475     Z_ElementSetNames *smallSetElementSetNames;    /* OPTIONAL */
476     Z_ElementSetNames *mediumSetElementSetNames;    /* OPTIONAL */
477     Z_PreferredRecordSyntax *preferredRecordSyntax;  /* OPTIONAL */
478     Z_Query *query;
479 } Z_SearchRequest;
480
481 /* ------------------------ RECORD -------------------------- */
482
483 typedef Odr_external Z_DatabaseRecord;
484
485 typedef struct Z_DiagRec
486 {
487     Odr_oid *diagnosticSetId;
488     int *condition;
489     char *addinfo;
490 } Z_DiagRec;
491
492 typedef struct Z_NamePlusRecord
493 {
494     char *databaseName;      /* OPTIONAL */
495     int which;
496 #define Z_NamePlusRecord_databaseRecord 0
497 #define Z_NamePlusRecord_surrogateDiagnostic 1
498     union
499     {
500         Z_DatabaseRecord *databaseRecord;
501         Z_DiagRec *surrogateDiagnostic;
502     } u;
503 } Z_NamePlusRecord;
504
505 typedef struct Z_NamePlusRecordList
506 {
507     int num_records;
508     Z_NamePlusRecord **records;
509 } Z_NamePlusRecordList;
510
511 typedef struct Z_Records
512 {
513     int which;
514 #define Z_Records_DBOSD 0
515 #define Z_Records_NSD 1
516     union
517     {
518         Z_NamePlusRecordList *databaseOrSurDiagnostics;
519         Z_DiagRec *nonSurrogateDiagnostic;
520     } u;
521 } Z_Records;
522
523 /* ------------------ ACCESS CTRL SERVICE ----------------*/
524
525 typedef struct Z_AccessControlRequest
526 {
527     Z_ReferenceId *referenceId;           /* OPTIONAL */
528     enum
529     {
530         Z_AccessRequest_simpleForm,
531         Z_AccessRequest_externallyDefined
532     } which;
533     union
534     {
535         Odr_oct *simpleForm;
536         Odr_external *externallyDefined;
537     } u;
538 #ifdef Z_OTHERINFO
539     Z_OtherInformation *otherInfo;           /* OPTIONAL */
540 #endif
541 } Z_AccessControlRequest;
542
543 typedef struct Z_AccessControlResponse
544 {
545     Z_ReferenceId *referenceId;              /* OPTIONAL */
546     enum
547     {
548         Z_AccessResponse_simpleForm,
549         Z_AccessResponse_externallyDefined
550     } which;
551     union
552     {
553         Odr_oct *simpleForm;
554         Odr_external *externallyDefined;
555     } u;
556     Z_DiagRec *diagnostic;                   /* OPTIONAL */
557 #ifdef Z_OTHERINFO
558     Z_OtherInformation *otherInfo;           /* OPTIONAL */
559 #endif
560 } Z_AccessControlResponse;
561
562 /* ------------------------ SCAN SERVICE -------------------- */
563
564 typedef struct Z_AttributeList
565 {
566     int num_attributes;
567     Z_AttributeElement **attributes;
568 } Z_AttributeList;
569
570 typedef struct Z_AlternativeTerm
571 {
572     int num_terms;
573     Z_AttributesPlusTerm **terms;
574 } Z_AlternativeTerm;
575
576 typedef struct Z_OccurrenceByAttributes
577 {
578     Z_AttributeList *attributes;
579 #if 0
580     enum
581     {
582         Z_OByAtt_global,
583         Z_ObyAtt_byDatabase
584     } which;
585     union
586     {
587 #endif
588         int *global;
589 #if 0
590         /* Z_ByDatabase *byDatabase; */
591     } u;
592 #endif
593 } Z_OccurrenceByAttributes;
594
595 typedef struct Z_TermInfo
596 {
597     Z_Term *term;
598     Z_AttributeList *suggestedAttributes;  /* OPTIONAL */
599     Z_AlternativeTerm *alternativeTerm;    /* OPTIONAL */
600     int *globalOccurrences;                /* OPTIONAL */
601     Z_OccurrenceByAttributes *byAttributes; /* OPTIONAL */
602 } Z_TermInfo;
603
604 typedef struct Z_Entry
605 {
606     enum
607     {
608         Z_Entry_termInfo,
609         Z_Entry_surrogateDiagnostic
610     } which;
611     union
612     {
613         Z_TermInfo *termInfo;
614         Z_DiagRec *surrogateDiagnostic;
615     } u;
616 } Z_Entry;
617
618 typedef struct Z_Entries
619 {
620     int num_entries;
621     Z_Entry **entries;
622 } Z_Entries;
623
624 typedef struct Z_DiagRecs
625 {
626     int num_diagRecs;
627     Z_DiagRec **diagRecs;
628 } Z_DiagRecs;
629
630 typedef struct Z_ListEntries
631 {
632     enum
633     {
634         Z_ListEntries_entries,
635         Z_ListEntries_nonSurrogateDiagnostics
636     } which;
637     union
638     {
639         Z_Entries *entries;
640         Z_DiagRecs *nonSurrogateDiagnostics;
641     } u;
642 } Z_ListEntries;
643
644 typedef struct Z_ScanRequest
645 {
646     Z_ReferenceId *referenceId;       /* OPTIONAL */
647     int num_databaseNames;
648     char **databaseNames;
649     Odr_oid *attributeSet;          /* OPTIONAL */
650     Odr_any *eatme1;
651     Z_AttributesPlusTerm *termListAndStartPoint;
652     int *stepSize;                    /* OPTIONAL */
653     int *numberOfTermsRequested;
654     int *preferredPositionInResponse;   /* OPTIONAL */
655 } Z_ScanRequest;
656
657 typedef struct Z_ScanResponse
658 {
659     Z_ReferenceId *referenceId;       /* OPTIONAL */
660     int *stepSize;                    /* OPTIONAL */
661     int *scanStatus;
662 #define Z_Scan_success      0
663 #define Z_Scan_partial_1    1
664 #define Z_Scan_partial_2    2
665 #define Z_Scan_partial_3    3
666 #define Z_Scan_partial_4    4
667 #define Z_Scan_partial_5    5
668 #define Z_Scan_failure      6
669     int *numberOfEntriesReturned;
670     int *positionOfTerm;              /* OPTIONAL */
671     Z_ListEntries *entries;           /* OPTIONAL */
672     Odr_oid *attributeSet;            /* OPTIONAL */
673 } Z_ScanResponse; 
674
675 /* ------------------------ SEARCHRESPONSE ------------------ */
676
677 typedef struct Z_SearchResponse
678 {
679     Z_ReferenceId *referenceId;       /* OPTIONAL */
680     int *resultCount;
681     int *numberOfRecordsReturned;
682     int *nextResultSetPosition;
683     bool_t *searchStatus;
684     int *resultSetStatus;              /* OPTIONAL */
685 #define Z_RES_SUBSET        1
686 #define Z_RES_INTERIM       2
687 #define Z_RES_NONE          3
688     int *presentStatus;                /* OPTIONAL */
689 #define Z_PRES_SUCCESS      0
690 #define Z_PRES_PARTIAL_1    1
691 #define Z_PRES_PARTIAL_2    2
692 #define Z_PRES_PARTIAL_3    3
693 #define Z_PRES_PARTIAL_4    4
694 #define Z_PRES_FAILURE      5
695     Z_Records *records;                  /* OPTIONAL */
696 } Z_SearchResponse;
697
698 /* ------------------------- PRESENT SERVICE -----------------*/
699
700 typedef struct Z_PresentRequest
701 {
702     Z_ReferenceId *referenceId;          /* OPTIONAL */
703     Z_ResultSetId *resultSetId;
704     int *resultSetStartPoint;
705     int *numberOfRecordsRequested;
706     Z_ElementSetNames *elementSetNames;  /* OPTIONAL */
707     Z_PreferredRecordSyntax *preferredRecordSyntax;  /* OPTIONAL */
708 } Z_PresentRequest;
709
710 typedef struct Z_PresentResponse
711 {
712     Z_ReferenceId *referenceId;        /* OPTIONAL */
713     int *numberOfRecordsReturned;
714     int *nextResultSetPosition;
715     int *presentStatus;
716     Z_Records *records;
717 } Z_PresentResponse;
718
719 /* ------------------------ DELETE -------------------------- */
720
721 #define Z_DeleteStatus_success                          0
722 #define Z_DeleteStatus_resultSetDidNotExist             1
723 #define Z_DeleteStatus_previouslyDeletedByTarget        2
724 #define Z_DeleteStatus_systemProblemAtTarget            3
725 #define Z_DeleteStatus_accessNotAllowed                 4
726 #define Z_DeleteStatus_resourceControlAtOrigin          5
727 #define Z_DeleteStatus_resourceControlAtTarget          6
728 #define Z_DeleteStatus_bulkDeleteNotSupported           7
729 #define Z_DeleteStatus_notAllRsltSetsDeletedOnBulkDlte  8
730 #define Z_DeleteStatus_notAllRequestedResultSetsDeleted 9
731 #define Z_DeleteStatus_resultSetInUse                  10
732
733 typedef struct Z_ListStatus
734 {
735     Z_ResultSetId *id;
736     int *status;
737 } Z_ListStatus;
738
739 typedef struct Z_DeleteResultSetRequest
740 {
741     Z_ReferenceId *referenceId;        /* OPTIONAL */
742     int *deleteFunction;
743 #define Z_DeleteRequest_list    0
744 #define Z_DeleteRequest_all     1
745     int num_ids;
746     Z_ResultSetId **resultSetList;      /* OPTIONAL */
747 #ifdef Z_OTHERINFO
748     Z_OtherInformation *otherInfo;
749 #endif
750 } Z_DeleteResultSetRequest;
751
752 typedef struct Z_DeleteResultSetResponse
753 {
754     Z_ReferenceId *referenceId;        /* OPTIONAL */
755     int *deleteOperationStatus;
756     int num_statuses;
757     Z_ListStatus *deleteListStatuses;  /* OPTIONAL */
758     int *numberNotDeleted;             /* OPTIONAL */
759     int num_bulkStatuses;
760     Z_ListStatus *bulkStatuses;        /* OPTIONAL */
761     char *deleteMessage;               /* OPTIONAL */
762 #ifdef Z_OTHERINFO
763     Z_OtherInformation *otherInfo;
764 #endif
765 } Z_DeleteResultSetResponse;
766
767 /* ------------------------ APDU ---------------------------- */
768
769 typedef struct Z_APDU
770 {    
771     enum Z_APDU_which
772     {
773         Z_APDU_initRequest,
774         Z_APDU_initResponse,
775         Z_APDU_searchRequest,
776         Z_APDU_searchResponse,
777         Z_APDU_presentRequest,
778         Z_APDU_presentResponse,
779         Z_APDU_deleteResultSetRequest,
780         Z_APDU_deleteResultSetResponse,
781         Z_APDU_resourceControlRequest,
782         Z_APDU_resourceControlResponse,
783         Z_APDU_triggerResourceControlRequest,
784         Z_APDU_scanRequest,
785         Z_APDU_scanResponse
786     } which;
787     union
788     {
789         Z_InitRequest  *initRequest;
790         Z_InitResponse *initResponse;
791         Z_SearchRequest *searchRequest;
792         Z_SearchResponse *searchResponse;
793         Z_PresentRequest *presentRequest;
794         Z_PresentResponse *presentResponse;
795         Z_DeleteResultSetRequest *deleteResultSetRequest;
796         Z_DeleteResultSetResponse *deleteResultSetResponse;
797         Z_ResourceControlRequest *resourceControlRequest;
798         Z_ResourceControlResponse *resourceControlResponse;
799         Z_TriggerResourceControlRequest *triggerResourceControlRequest;
800         Z_ScanRequest *scanRequest;
801         Z_ScanResponse *scanResponse;
802     } u;
803 } Z_APDU;
804
805 int z_APDU(ODR o, Z_APDU **p, int opt);
806
807 Z_InitRequest *zget_InitRequest(ODR o);
808 Z_InitResponse *zget_InitResponse(ODR o);
809 Z_SearchRequest *zget_SearchRequest(ODR o);
810 Z_SearchResponse *zget_SearchResponse(ODR o);
811 Z_PresentRequest *zget_PresentRequest(ODR o);
812 Z_PresentResponse *zget_PresentResponse(ODR o);
813 Z_DeleteResultSetRequest *zget_DeleteResultSetRequest(ODR o);
814 Z_DeleteResultSetResponse *zget_DeleteResultSetResponse(ODR o);
815 Z_ScanRequest *zget_ScanRequest(ODR o);
816 Z_ScanResponse *zget_ScanResponse(ODR o);
817 Z_TriggerResourceControlRequest *zget_TriggerResourceControlRequest(ODR o);
818 Z_ResourceControlRequest *zget_ResourceControlRequest(ODR o);
819 Z_ResourceControlResponse *zget_ResourceControlResponse(ODR o);
820 Z_APDU *zget_APDU(ODR o, enum Z_APDU_which which);
821
822 #include <prt-rsc.h>
823 #include <prt-acc.h>
824
825 #endif