*** empty log message ***
[yaz-moved-to-github.git] / include / prt-acc.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: prt-acc.h,v $
27  * Revision 1.1  1995-06-02 09:49:49  quinn
28  * Add access control
29  *
30  *
31  */
32
33 typedef struct Z_Encryption1
34 {
35     Odr_oct *cryptType;       /* OPTIONAL */
36     Odr_oct *credential;      /* OPTIONAL */
37     Odr_oct *data;
38 } Z_Encryption1;
39
40 typedef struct Z_EnumeratedPrompt1
41 {
42     int *type;
43 #define Z_Prompt1_groupId        0
44 #define Z_Prompt1_userId         1
45 #define Z_Prompt1_password       2
46 #define Z_Prompt1_newPassword    3
47 #define Z_Prompt1_copyright      4
48     char *suggestedString;       /* OPTIONAL */
49 } Z_EnumeratedPrompt1;
50
51 typedef struct Z_PromptId1
52 {
53     enum
54     {
55         Z_PromptId1_enumeratedPrompt,
56         Z_PromptId1_nonEnumeratedPrompt
57     } which;
58     union
59     {
60         Z_EnumeratedPrompt1 *enumeratedPrompt;
61         char *nonEnumeratedPrompt;
62     } u;
63 } Z_PromptId1;
64
65 typedef struct Z_PromptInfo1
66 {
67     enum
68     {
69         Z_Challenge1_character,
70         Z_Challenge1_encrypted
71     } which;
72     union
73     {
74         char *character;
75         Z_Encryption1 *encrypted;
76     } u;
77 } Z_PromptInfo1;
78
79 typedef struct Z_ChallengeUnit1
80 {
81     Z_PromptId1 *promptId;
82     char *defaultResponse;           /* OPTIONAL */
83     Z_PromptInfo1 *promptInfo;       /* OPTIONAL */
84     char *regExpr;                   /* OPTIONAL */
85     Odr_null *responseRequired;      /* OPTIONAL */
86     int num_values;
87     char **allowedValues;            /* OPTIONAL */
88     Odr_null *shouldSave;            /* OPTIONAL */
89     int *dataType;                   /* OPTIONAL */
90 #define Z_ChalDataType_integer       1
91 #define Z_ChalDataType_date          2
92 #define Z_ChalDataType_float         3
93 #define Z_ChalDataType_alphaNumeric  4
94 #define Z_ChalDataType_urlUrn        5
95 #define Z_ChalDataType_boolean       6
96     Odr_external *diagnostic;        /* OPTIONAL */
97 } Z_ChallengeUnit1;
98
99 typedef struct Z_Challenge1
100 {
101     int num_challenges;
102     Z_ChallengeUnit1 **list;
103 } Z_Challenge1;
104
105 typedef struct Z_ResponseUnit1
106 {
107     Z_PromptId1 *promptId;
108     enum
109     {
110         Z_Response1_string,
111         Z_Response1_accept,
112         Z_Response1_acknowledge,
113         Z_Response1_diagnostic,
114         Z_Response1_encrypted
115     } which;
116     union
117     {
118         char *string;
119         bool_t *accept;
120         Odr_null *acknowledge;
121         Z_DiagRec *diagnostic;
122         Z_Encryption1 *encrypted;
123     } u;
124 } Z_ResponseUnit1;
125
126 typedef struct Z_Response1
127 {
128     int num_responses;
129     Z_ResponseUnit1 **list;
130 } Z_Response1;
131
132 typedef struct Z_PromptObject1
133 {
134     enum
135     {
136         Z_PromptObject1_challenge,
137         Z_PromptObject1_response
138     } which;
139     union
140     {
141         Z_Challenge1 *challenge;
142         Z_Response1 *response;
143     } u;
144 } Z_PromptObject1;