|
|
1.1 root 1: /* dsap.h - include file for directory service users (DS-USER) */
2:
3: /*
4: * $Header: /f/osi/h/quipu/RCS/dsap.h,v 7.0 90/07/27 05:02:55 mrose Exp $
5: *
6: *
7: * $Log: dsap.h,v $
8: * Revision 7.0 90/07/27 05:02:55 mrose
9: * *** empty log message ***
10: *
11: */
12:
13: /*
14: * NOTICE
15: *
16: * Acquisition, use, and distribution of this module and related
17: * materials are subject to the restrictions of a license agreement.
18: * Consult the Preface in the User's Manual for the full terms of
19: * this agreement.
20: *
21: */
22:
23:
24: #ifndef _DSAP_
25: #define _DSAP_
26:
27: #ifndef _MANIFEST_
28: #include "manifest.h"
29: #endif
30: #ifndef _GENERAL_
31: #include "general.h"
32: #endif
33:
34: #ifndef _RoSAP_
35: #include "rosap.h" /* definitions for ROSE-USERs */
36: #endif
37:
38: #ifndef _RoNot_
39: #include "ronot.h" /* definitions for RoBIND-USERs */
40: #endif
41:
42: #include "quipu/common.h"
43: #include "quipu/dsargument.h"
44:
45: /* */
46:
47: /* An additional value for "asyn" parameters for interruptibility */
48: #define ROS_INTR -1
49:
50: /* */
51:
52: /* Values used to convey response type throughout DSAP library */
53: #define DS_RESULT 1
54: #define DS_ERROR 2
55: #define DS_REJECT 3
56:
57: /* */
58:
59: struct DSAPstart { /* D-BIND.INDICATION */
60: int ds_sd; /* association descriptor */
61:
62: int ds_ctx; /* Directory protocol type */
63: #define DS_CTX_X500_DAP 1
64: #define DS_CTX_X500_DSP 2
65: #define DS_CTX_QUIPU_DSP 3 /* Quipu has its own DSP context */
66:
67: int ds_pctx_id; /* Context identifier of directory AS */
68:
69: struct AcSAPstart ds_start; /* info from A-CONNECT.INDICATION */
70:
71: struct ds_bind_arg ds_bind_arg; /* Decoded bind argument */
72: };
73: #define DSFREE(ds) { \
74: ACSFREE (&(ds) -> ds_start); \
75: bind_arg_free (&(ds) -> ds_bind_arg); \
76: }
77:
78:
79: struct DSAPconnect {
80: int dc_sd; /* association descriptor */
81:
82: int dc_ctx; /* Directory protocol type */
83:
84: int ds_pctx_id; /* Context identifier of directory AS */
85:
86: struct AcSAPconnect dc_connect;/* info from A-CONNECT.CONFIRMATION */
87:
88: int dc_result; /* result */
89: /* Uses general DS response type definitiions */
90:
91: union {
92: struct ds_bind_arg dc_bind_res;
93: struct ds_bind_error dc_bind_err;
94: } dc_un;
95: };
96: #define DCFREE(dc) { \
97: ACCFREE (&(dc) -> dc_connect); \
98: switch ((dc) -> dc_result) { \
99: case DS_RESULT: \
100: bind_arg_free (&(dc) -> dc_un.dc_bind_res); \
101: break; \
102: case DS_ERROR: \
103: break; \
104: default: \
105: break; \
106: } \
107: }
108:
109: struct DSAPrelease { /* D-UNBIND.CONFIRMATION */
110: int dr_affirmative; /* T = connection released
111: NIL = request refused */
112:
113: int dr_reason; /* reason for result */
114: /* Takes values from acr_reason */
115: };
116:
117: struct DSAPabort { /* D-ABORT.INDICATION */
118: int da_source; /* abort source */
119: #define DA_USER 0 /* directory-user */
120: #define DA_PROVIDER 1 /* directory-provider */
121: #define DA_LOCAL 2 /* local DPM */
122:
123: int da_reason; /* reason for failure */
124: #define DA_NO_REASON 0 /* Ain't no reason to some things */
125: #define DA_RO_BIND 1 /* Error from RO BIND routine called */
126: #define DA_ROS 2 /* Error from ROS routine called */
127: #define DA_ARG_ENC 3 /* Error encoding argument */
128: #define DA_RES_ENC 4 /* Error encoding result */
129: #define DA_ERR_ENC 5 /* Error encoding error */
130: #define DA_ARG_DEC 6 /* Error decoding argument */
131: #define DA_RES_DEC 7 /* Error decoding result */
132: #define DA_ERR_DEC 8 /* Error decoding error */
133: #define DA_APP_CONTEXT 9 /* Unexpected application context */
134: #define DA_PCDL 10 /* Unacceptable presentation context list */
135:
136: /* diagnostics from provider */
137: #define DA_SIZE 512
138: int da_cc; /* length */
139: char da_data[DA_SIZE]; /* data */
140: };
141:
142: struct DSAPinvoke {
143: int dx_id; /* Operation identifier */
144: struct ds_op_arg dx_arg; /* Decoded argument */
145: };
146: #define DXFREE(dx) \
147: op_ch_arg_free (dx->dx_arg)
148:
149: struct DSAPresult {
150: int dr_id;
151: struct ds_op_res dr_res; /* Decoded argument */
152: };
153: #define DRFREE(dr) \
154: op_res_free (dr->dr_res)
155:
156: struct DSAPerror {
157: int de_id;
158: struct DSError de_err; /* Decoded error */
159: };
160: #define DEFREE(de) \
161: op_res_free (de->de_err)
162:
163: struct DSAPpreject {
164: int dp_id; /* Operation id or -1 */
165:
166: int dp_source; /* same values as DSAPabort.da_source */
167:
168: int dp_reason; /* reason for failure */
169: #define DP_NO_REASON 0 /* Ain't no reason to some things */
170: #define DP_ROS 1 /* ROSE error */
171: #define DP_INVOKE 2 /* Failure during invocation */
172: #define DP_RESULT 3 /* Failure during result */
173: #define DP_ERROR 4 /* Failure during error */
174:
175: /* diagnostics from provider */
176: #define DP_SIZE 512
177: int dp_cc; /* length */
178: char dp_data[DP_SIZE]; /* data */
179: };
180:
181: struct DSAPfinish {
182: int df_reason; /* Reason for unbinding */
183: };
184: #define DFFREE(df)
185:
186: struct DSAPindication {
187: int di_type;
188: #define DI_INVOKE 1 /* DAP operation invocation received */
189: #define DI_RESULT 2 /* DAP operation result received */
190: #define DI_ERROR 3 /* DAP operation error received */
191: #define DI_PREJECT 4 /* DAP operation rejected */
192: #define DI_FINISH 5 /* DAP UnBind received */
193: #define DI_ABORT 6 /* DAP association lost */
194: union {
195: struct DSAPinvoke di_un_invoke;
196: struct DSAPresult di_un_result;
197: struct DSAPerror di_un_error;
198: struct DSAPpreject di_un_preject;
199: struct DSAPfinish di_un_finish;
200: struct DSAPabort di_un_abort;
201: } di_un;
202: #define di_invoke di_un.di_un_invoke
203: #define di_result di_un.di_un_result
204: #define di_error di_un.di_un_error
205: #define di_preject di_un.di_un_preject
206: #define di_finish di_un.di_un_finish
207: #define di_abort di_un.di_un_abort
208: };
209:
210:
211: #ifndef lint
212: #ifndef __STDC__
213: #define copyDSAPdata(base,len,d) \
214: { \
215: register int i = len; \
216: if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \
217: bcopy (base, d -> d/* */_data, d -> d/* */_cc); \
218: }
219: #else
220: #define copyDSAPdata(base,len,d) \
221: { \
222: register int i = len; \
223: if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \
224: bcopy (base, d -> d##_data, d -> d##_cc); \
225: }
226: #endif
227: #else
228: #define copyDSAPdata(base,len,d) bcopy (base, (char *) d, len)
229: #endif
230:
231: /* */
232:
233: extern char *dsapversion;
234:
235:
236: int DBindInit (); /* D-BIND.INDICATION */
237:
238: int DAsynBindRequest (); /* D-BIND.REQUEST (ARGUMENT) */
239: int DAsynBindRetry(); /* D-BIND-RETRY.REQUEST */
240:
241: int DBindResult (); /* D-BIND.RESPONSE (RESULT) */
242: int DBindError (); /* D-BIND.RESPONSE (ERROR) */
243: int DBindReject (); /* D-BIND.RESPONSE (REJECT) */
244:
245: int DUnBindRequest (); /* D-UNBIND.REQUEST */
246: int DUnBindRetry (); /* D-BIND-RETRY.REQUEST (pseudo) */
247: int DUnBindResponse (); /* D-BIND.RESPONSE (RESULT) */
248: int DUnBindReject (); /* D-BIND.RESPONSE (REJECT) */
249:
250: char *DErrString (); /* return DSAP error code in string form */
251:
252: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.