|
|
1.1 root 1: /* rosap.h - include file for remote operation users (RoS-USER) */
2:
3: /*
4: * $Header: /f/osi/h/RCS/rosap.h,v 7.0 89/11/23 21:55:56 mrose Rel $
5: *
6: * Based on an TCP-based implementation by George Michaelson of University
7: * College London.
8: *
9: *
10: * $Log: rosap.h,v $
11: * Revision 7.0 89/11/23 21:55:56 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 _RoSAP_
28: #define _RoSAP_
29:
30: #ifndef _MANIFEST_
31: #include "manifest.h"
32: #endif
33: #ifndef _GENERAL_
34: #include "general.h"
35: #endif
36:
37: #ifndef _AcSAP_
38: #include "acsap.h" /* definitions for AcS-USERs */
39: #endif
40:
41: /* */
42:
43: struct RoSAPaddr { /* RoSAP address (old-style)*/
44: struct SSAPaddr roa_addr;
45:
46: u_short roa_port;
47: };
48: #define NULLRoA ((struct RoSAPaddr *) 0)
49:
50: /* */
51:
52: #define ROS_MYREQUIRE SR_DUPLEX/* for direct users of ACSE */
53:
54:
55: struct RoSAPstart { /* RO-BEGIN.INDICATION */
56: int ros_sd; /* ROS descriptor */
57:
58: struct RoSAPaddr ros_initiator;/* unique identifier */
59:
60: u_short ros_port; /* application number */
61:
62: PE ros_data; /* initial DATA from peer */
63: };
64: #define ROSFREE(ros) \
65: { \
66: if ((ros) -> ros_data) \
67: pe_free ((ros) -> ros_data), (ros) -> ros_data = NULLPE; \
68: }
69:
70: struct RoSAPconnect { /* RO-BEGIN.CONFIRMATION */
71: int roc_sd; /* ROS descriptor */
72:
73: int roc_result; /* result */
74: #define ROS_ACCEPT (-1)
75:
76: /* RO-BEGIN.REQUEST */
77: #define ROS_VALIDATE 0 /* Authentication failure */
78: #define ROS_BUSY 1 /* Busy */
79:
80: /* General Problem */
81: #define ROS_GP_UNRECOG 2 /* Unrecognized APDU */
82: #define ROS_GP_MISTYPED 3 /* Mistyped APDU */
83: #define ROS_GP_STRUCT 4 /* Badly structured APDU */
84:
85: /* Invoke Problem */
86: #define ROS_IP_DUP 5 /* Duplicate invocation */
87: #define ROS_IP_UNRECOG 6 /* Unrecognized operation */
88: #define ROS_IP_MISTYPED 7 /* Mistyped argument */
89: #define ROS_IP_LIMIT 8 /* Resource limitation */
90: #define ROS_IP_RELEASE 9 /* Initiator releasing */
91: #define ROS_IP_UNLINKED 10 /* Unrecognized linked ID */
92: #define ROS_IP_LINKED 11 /* Linked response unexpected */
93: #define ROS_IP_CHILD 12 /* Unexpected child operation */
94:
95: /* Return Result Problem */
96: #define ROS_RRP_UNRECOG 13 /* Unrecognized invocation */
97: #define ROS_RRP_UNEXP 14 /* Result response unexpected */
98: #define ROS_RRP_MISTYPED 15 /* Mistyped result */
99:
100: /* Return Error Problem */
101: #define ROS_REP_UNRECOG 16 /* Unrecognized invocation */
102: #define ROS_REP_UNEXP 17 /* Error response unexpected */
103: #define ROS_REP_RECERR 18 /* Unrecognized error */
104: #define ROS_REP_UNEXPERR 19 /* Unexpected error */
105: #define ROS_REP_MISTYPED 20 /* Mistyped parameter */
106:
107: /* begin UNOFFICIAL */
108: #define ROS_ADDRESS 21 /* Address unknown */
109: #define ROS_REFUSED 22 /* Connect request refused on this network
110: connection */
111: #define ROS_SESSION 23 /* Session disconnect */
112: #define ROS_PROTOCOL 24 /* Protocol error */
113: #define ROS_CONGEST 25 /* Congestion at RoSAP */
114: #define ROS_REMOTE 26 /* Remote system problem */
115: #define ROS_DONE 27 /* Association done via async handler */
116: #define ROS_ABORTED 28 /* Peer aborted association */
117: #define ROS_RTS 29 /* RTS disconnect */
118: #define ROS_PRESENTATION 30 /* Presentation disconnect */
119: #define ROS_ACS 31 /* ACS disconnect */
120: #define ROS_PARAMETER 32 /* Invalid parameter */
121: #define ROS_OPERATION 33 /* Invalid operation */
122: #define ROS_TIMER 34 /* Timer expired */
123: #define ROS_WAITING 35 /* Indications waiting */
124: #define ROS_APDU 36 /* APDU not transferred */
125: #define ROS_INTERRUPTED 37 /* stub interrupted */
126: /* end UNOFFICIAL */
127:
128: #define ROS_FATAL(r) (!(ROS_OFFICIAL (r)) && (r) < ROS_PARAMETER)
129: #define ROS_OFFICIAL(r) ((r) < ROS_ADDRESS)
130:
131: PE roc_data; /* initial DATA from peer */
132: };
133: #define ROCFREE(roc) \
134: { \
135: if ((roc) -> roc_data) \
136: pe_free ((roc) -> roc_data), (roc) -> roc_data = NULLPE; \
137: }
138:
139:
140: /* Operation Classes */
141: #define ROS_SYNC 0 /* synchronous mode with result or error */
142: #define ROS_ASYNC 1 /* asynchronous mode with result or error */
143:
144: /* APDU priorities */
145: #define ROS_NOPRIO 0 /* no priority */
146:
147:
148: struct RoSAPinvoke { /* RO-INVOKE.INDICATION */
149: int rox_id; /* invokeID */
150:
151: int rox_linkid; /* linkedID */
152: int rox_nolinked; /* non-zero if no linkedID present */
153:
154: int rox_op; /* operation */
155: PE rox_args; /* arguments */
156: };
157: #define ROXFREE(rox) \
158: { \
159: if ((rox) -> rox_args) \
160: pe_free ((rox) -> rox_args), (rox) -> rox_args = NULLPE; \
161: }
162:
163:
164: struct RoSAPresult { /* RO-RESULT.INDICATION */
165: int ror_id; /* invokeID */
166:
167: int ror_op; /* operation */
168: PE ror_result; /* result */
169: };
170: #define RORFREE(ror) \
171: { \
172: if ((ror) -> ror_result) \
173: pe_free ((ror) -> ror_result), (ror) -> ror_result = NULLPE; \
174: }
175:
176:
177: struct RoSAPerror { /* RO-ERROR.INDICATION */
178: int roe_id; /* invokeID */
179:
180: int roe_error; /* error */
181: PE roe_param; /* parameter */
182: };
183: #define ROEFREE(roe) \
184: { \
185: if ((roe) -> roe_param) \
186: pe_free ((roe) -> roe_param), (roe) -> roe_param = NULLPE; \
187: }
188:
189:
190: struct RoSAPureject { /* RO-U-REJECT.INDICATION */
191: int rou_id; /* invokeID */
192: int rou_noid; /* .. is not present */
193:
194: int rou_reason; /* reason (same as roc_result) */
195: };
196:
197:
198: struct RoSAPpreject { /* RO-P-REJECT.INDICATION */
199: int rop_reason; /* reason (same as roc_result) */
200:
201: /* APDU not transferred (reason is ROS_APDU) */
202: int rop_id; /* invokeID */
203: PE rop_apdu; /* APDU */
204:
205: /* additional failure data from provider */
206: #define ROP_SIZE 512
207: int rop_cc; /* length */
208: char rop_data[ROP_SIZE]; /* data */
209: };
210: #define ROPFREE(rop) \
211: { \
212: if ((rop) -> rop_apdu) \
213: pe_free ((rop) -> rop_apdu), (rop) -> rop_apdu = NULLPE; \
214: }
215:
216:
217: struct RoSAPend { /* RO-END.INDICATION */
218: int roe_dummy; /* not used */
219: };
220:
221:
222: struct RoSAPindication {
223: int roi_type; /* the union element present */
224: #define ROI_INVOKE 0x00
225: #define ROI_RESULT 0x01
226: #define ROI_ERROR 0x02
227: #define ROI_UREJECT 0x03
228: #define ROI_PREJECT 0x04
229: #define ROI_END 0x05
230: #define ROI_FINISH 0x06
231:
232: union {
233: struct RoSAPinvoke roi_un_invoke;
234: struct RoSAPresult roi_un_result;
235: struct RoSAPerror roi_un_error;
236: struct RoSAPureject roi_un_ureject;
237: struct RoSAPpreject roi_un_preject;
238: struct RoSAPend roi_un_end;
239: struct AcSAPfinish roi_un_finish;
240: } roi_un;
241: #define roi_invoke roi_un.roi_un_invoke
242: #define roi_result roi_un.roi_un_result
243: #define roi_error roi_un.roi_un_error
244: #define roi_ureject roi_un.roi_un_ureject
245: #define roi_preject roi_un.roi_un_preject
246: #define roi_end roi_un.roi_un_end
247: #define roi_finish roi_un.roi_un_finish
248: };
249:
250: /* */
251:
252: extern char *rosapversion;
253:
254: int RoExec (); /* SERVER only */
255: int RoInit (); /* RO-BEGIN.INDICATION */
256:
257: int RoBeginResponse (); /* RO-BEGIN.RESPONSE */
258: int RoBeginRequest (); /* RO-BEGIN.REQUEST */
259: int RoEndRequest (); /* RO-END.REQUEST */
260: int RoEndResponse (); /* RO-END.RESPONSE */
261:
262: int RoInvokeRequest (); /* RO-INVOKE.REQUEST */
263: int RoResultRequest (); /* RO-RESULT.REQUEST */
264: int RoErrorRequest (); /* RO-ERROR.REQUEST */
265: int RoURejectRequest (); /* RO-U-REJECT.REQUEST */
266: #define RoRejectURequest RoURejectRequest
267: int RoIntrRequest (); /* RO-INVOKE.REQUEST (interruptable) */
268: int RoWaitRequest (); /* RO-WAIT.REQUEST (pseudo) */
269:
270: int RoSetIndications (); /* define vectors for INDICATION events */
271: int RoSelectMask (); /* map remote operation descriptors for
272: select() */
273:
274: int RoSetService (); /* bind underlying service */
275: int RoRtService (), RoPService (), RoSService ();
276: int RoSetThorn ();
277:
278: char *RoErrString (); /* return RoSAP error code in string form */
279: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.