|
|
1.1 root 1: /* dap.h - */
2:
3: /*
4: * $Header: /f/osi/h/quipu/RCS/dap2.h,v 7.0 90/07/27 05:02:57 mrose Exp $
5: *
6: *
7: * $Log: dap2.h,v $
8: * Revision 7.0 90/07/27 05:02:57 mrose
9: * *** empty log message ***
10: *
11: * Revision 7.0 89/11/23 21:56:29 mrose
12: * Release 6.0
13: *
14: */
15:
16: /*
17: * NOTICE
18: *
19: * Acquisition, use, and distribution of this module and related
20: * materials are subject to the restrictions of a license agreement.
21: * Consult the Preface in the User's Manual for the full terms of
22: * this agreement.
23: *
24: */
25:
26:
27: #ifndef QUIPUDAP2
28: #define QUIPUDAP2
29:
30: #ifndef _MANIFEST_
31: #include "manifest.h"
32: #endif
33: #ifndef _GENERAL_
34: #include "general.h"
35: #endif
36:
37: #ifndef _RoSAP_
38: #include "rosap.h" /* definitions for ROSE-USERs */
39: #endif
40:
41: #ifndef _RoNot_
42: #include "ronot.h" /* definitions for RoBIND-USERs */
43: #endif
44:
45: #include "quipu/common.h"
46: #include "quipu/dsargument.h"
47:
48: /* */
49:
50: /* An additional value for "asyn" parameters for interruptibility */
51: #define ROS_INTR -1
52:
53: /* */
54:
55: struct DAPconnect {
56: int dc_sd; /* association descriptor */
57:
58: int ds_pctx_id; /* Context identifier of directory access AS */
59:
60: struct AcSAPconnect dc_connect;/* info from A-CONNECT.CONFIRMATION */
61:
62: int dc_result; /* result */
63: #define DC_RESULT 1
64: #define DC_ERROR 2
65: #define DC_REJECT 3
66:
67: union {
68: struct ds_bind_arg dc_bind_res; /* DC_RESULT */
69: struct ds_bind_error dc_bind_err; /* DC_ERROR */
70: } dc_un;
71: };
72: #define DCFREE(dc) { \
73: ACCFREE (&((dc) -> dc_connect)); \
74: switch ((dc) -> dc_result) { \
75: case DC_RESULT: \
76: bind_arg_free (&(dc) -> dc_un.dc_bind_res); \
77: break; \
78: case DC_ERROR: \
79: break; \
80: default: \
81: break; \
82: } \
83: }
84:
85: struct DAPrelease { /* DAP-UNBIND.CONFIRMATION */
86: int dr_affirmative; /* T = connection released
87: NIL = request refused */
88:
89: int dr_reason; /* reason for result */
90: /* Takes values from acr_reason */
91: };
92:
93: struct DAPabort { /* DAP-ABORT.INDICATION */
94: int da_source; /* abort source */
95: #define DA_USER 0 /* DAP-user */
96: #define DA_PROVIDER 1 /* DAP-provider */
97: #define DA_LOCAL 2 /* DAP interface internal error */
98:
99: int da_reason; /* reason for failure */
100: #define DA_NO_REASON 0 /* Ain't no reason to some things */
101: #define DA_RONOT 1 /* Error from RONOT provider */
102: #define DA_ROS 2 /* Error from ROS provider called */
103: #define DA_ARG_ENC 3 /* Error encoding argument */
104: #define DA_RES_ENC 4 /* Error encoding result */
105: #define DA_ERR_ENC 5 /* Error encoding error */
106: #define DA_ARG_DEC 6 /* Error decoding argument */
107: #define DA_RES_DEC 7 /* Error decoding result */
108: #define DA_ERR_DEC 8 /* Error decoding error */
109:
110: /* diagnostics from provider */
111: #define DA_SIZE 512
112: int da_cc; /* length */
113: char da_data[DA_SIZE]; /* data */
114: };
115:
116: struct DAPresult {
117: int dr_id;
118: struct DSResult dr_res; /* Decoded result and op type */
119: };
120: #define DRFREE(dr) \
121: ds_res_free (&((dr)->dr_res))
122:
123: struct DAPerror {
124: int de_id;
125: struct DSError de_err; /* Decoded error and error type */
126: };
127: #define DEFREE(de) \
128: ds_error_free (&((de)->de_err))
129:
130: struct DAPpreject {
131: int dp_id; /* Operation id or -1 */
132:
133: int dp_source; /* same values as DAPabort.da_source */
134:
135: int dp_reason; /* reason for failure */
136: #define DP_NO_REASON 0 /* Ain't no reason to some things */
137: #define DP_ROS 1 /* ROSE error */
138: #define DP_INVOKE 2 /* Failure during invocation */
139: #define DP_RESULT 3 /* Failure during result */
140: #define DP_ERROR 4 /* Failure during error */
141:
142: /* diagnostics from provider */
143: #define DP_SIZE 512
144: int dp_cc; /* length */
145: char dp_data[DP_SIZE]; /* data */
146: };
147:
148: struct DAPindication {
149: int di_type;
150: #define DI_RESULT 2 /* DAP operation result received */
151: #define DI_ERROR 3 /* DAP operation error received */
152: #define DI_PREJECT 4 /* DAP operation rejected */
153: #define DI_ABORT 6 /* DAP association lost */
154: union {
155: struct DAPresult di_un_result;
156: struct DAPerror di_un_error;
157: struct DAPpreject di_un_preject;
158: struct DAPabort di_un_abort;
159: } di_un;
160: #define di_result di_un.di_un_result
161: #define di_error di_un.di_un_error
162: #define di_preject di_un.di_un_preject
163: #define di_abort di_un.di_un_abort
164: };
165:
166:
167: #ifndef lint
168: #ifndef __STDC__
169: #define copyDAPdata(base,len,d) \
170: { \
171: register int i = len; \
172: if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \
173: bcopy (base, d -> d/* */_data, d -> d/* */_cc); \
174: }
175: #else
176: #define copyDAPdata(base,len,d) \
177: { \
178: register int i = len; \
179: if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \
180: bcopy (base, d -> d##_data, d -> d##_cc); \
181: }
182: #endif
183: #else
184: #define copyDAPdata(base,len,d) bcopy (base, (char *) d, len)
185: #endif
186:
187: /* */
188:
189: int DapAsynBindReqAux (); /* DAP-BIND.REQUEST (ARGUMENT) */
190: int DapAsynBindRequest (); /* DAP-BIND.REQUEST (ARGUMENT) */
191: int DapAsynBindRetry(); /* DAP-BIND-RETRY.REQUEST */
192:
193: int DapUnBindRequest (); /* DAP-UNBIND.REQUEST */
194: int DapUnBindRetry (); /* DAP-BIND-RETRY.REQUEST (pseudo) */
195:
196: char *DapErrString (); /* return DAP error code in string form */
197:
198: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.