Start development on 386BSD 0.0
[unix-history] / .ref-BSD-4_3_Net_2 / usr / src / contrib / isode / h / rtpkt.h
CommitLineData
0cdd0310
C
1/* rtpkt.h - include file for reliable transfer providers (RtS-PROVIDER) */
2
3/*
4 * $Header: /f/osi/h/RCS/rtpkt.h,v 7.1 91/02/22 09:25:03 mrose Interim $
5 *
6 *
7 * $Log: rtpkt.h,v $
8 * Revision 7.1 91/02/22 09:25:03 mrose
9 * Interim 6.8
10 *
11 * Revision 7.0 89/11/23 21:55:58 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 _RtSAP_
28#include "rtsap.h" /* definitions for RtS-USERs */
29#endif
30
31#include "acpkt.h" /* definitions for AcS-PROVIDERs */
32
33#ifndef _SSAP_
34#include "ssap.h" /* definitions for SS-USERs */
35#endif
36
37/* \f */
38
39#define rtsapPsig(acb, sd) \
40{ \
41 if ((acb = findacblk (sd)) == NULL) { \
42 (void) sigiomask (smask); \
43 return rtsaplose (rti, RTS_PARAMETER, NULLCP, \
44 "invalid association descriptor"); \
45 } \
46 if (!(acb -> acb_flags & ACB_RTS)) { \
47 (void) sigiomask (smask); \
48 return rtsaplose (rti, RTS_OPERATION, NULLCP, \
49 "not an association descriptor for RTS"); \
50 } \
51 if (!(acb -> acb_flags & ACB_CONN)) { \
52 (void) sigiomask (smask); \
53 return rtsaplose (rti, RTS_OPERATION, NULLCP, \
54 "association descriptor not connected"); \
55 } \
56 if (acb -> acb_flags & ACB_FINN) { \
57 (void) sigiomask (smask); \
58 return rtsaplose (rti, RTS_OPERATION, NULLCP, \
59 "association descriptor finishing"); \
60 } \
61}
62
63#define rtsapFsig(acb, sd) \
64{ \
65 if ((acb = findacblk (sd)) == NULL) { \
66 (void) sigiomask (smask); \
67 return rtsaplose (rti, RTS_PARAMETER, NULLCP, \
68 "invalid association descriptor"); \
69 } \
70 if (!(acb -> acb_flags & ACB_RTS)) { \
71 (void) sigiomask (smask); \
72 return rtsaplose (rti, RTS_OPERATION, NULLCP, \
73 "not an association descriptor for RTS"); \
74 } \
75 if (!(acb -> acb_flags & ACB_CONN)) { \
76 (void) sigiomask (smask); \
77 return rtsaplose (rti, RTS_OPERATION, NULLCP, \
78 "association descriptor not connected"); \
79 } \
80 if (!(acb -> acb_flags & ACB_FINN)) { \
81 (void) sigiomask (smask); \
82 return rtsaplose (rti, RTS_OPERATION, NULLCP, \
83 "association descriptor not finishing"); \
84 } \
85}
86
87#define missingP(p) \
88{ \
89 if (p == NULL) \
90 return rtsaplose (rti, RTS_PARAMETER, NULLCP, \
91 "mandatory parameter \"%s\" missing", "p"); \
92}
93
94
95#ifndef lint
96#ifndef __STDC__
97#define copyRtSAPdata(base,len,d) \
98{ \
99 register int i = len; \
100 if ((d -> d/* */_cc = min (i, sizeof d -> d/* */_data)) > 0) \
101 bcopy (base, d -> d/* */_data, d -> d/* */_cc); \
102}
103#else
104#define copyRtSAPdata(base,len,d) \
105{ \
106 register int i = len; \
107 if ((d -> d##_cc = min (i, sizeof d -> d##_data)) > 0) \
108 bcopy (base, d -> d##_data, d -> d##_cc); \
109}
110#endif
111#else
112#define copyRtSAPdata(base,len,d) bcopy (base, (char *) d, len)
113#endif
114
115
116#define pylose() \
117 rtpktlose (acb, rti, RTS_PROTOCOL, NULLCP, "%s", PY_pepy)
118
119
120/* would really prefer to determine DEFAULT_CKPOINT dynamically, but can't
121 since need to know it *before* doing the A-ASSOCIATE.REQUEST or
122 S-CONNECT.REQUEST... */
123
124#define DEFAULT_CKPOINT (65518 >> 10)
125#define DEFAULT_WINDOW PCONN_WD_DFLT
126
127
128#define RTS_MYREQUIRE (SR_EXCEPTIONS | SR_ACTIVITY | SR_HALFDUPLEX \
129 | SR_MINORSYNC)
130
131
132#define RT_ASN "rtse pci version 1"
133
134
135int rtpktlose (), rtsaplose ();
136
137/* \f */
138
139#define SetPS2RtService(acb) \
140{ \
141 (acb) -> acb_pturnrequest = rt2pspturn; \
142 (acb) -> acb_gturnrequest = rt2psgturn; \
143 (acb) -> acb_transferequest = rt2pstrans; \
144 (acb) -> acb_rtwaitrequest = rt2pswait; \
145 (acb) -> acb_rtsetindications = rt2psasync; \
146 (acb) -> acb_rtselectmask = rt2psmask; \
147 (acb) -> acb_rtpktlose = rt2pslose; \
148}
149
150int acs2rtslose (), acs2rtsabort (), ps2rtslose ();
151int rt2pspturn (), rt2psgturn (), rt2pstrans (), rt2pswait (),
152 rt2psasync (), rt2psmask (), rt2pslose ();
153
154
155#define SetSS2RtService(acb) \
156{ \
157 (acb) -> acb_pturnrequest = rt2sspturn; \
158 (acb) -> acb_gturnrequest = rt2ssgturn; \
159 (acb) -> acb_transferequest = rt2sstrans; \
160 (acb) -> acb_rtwaitrequest = rt2sswait; \
161 (acb) -> acb_rtsetindications = rt2ssasync; \
162 (acb) -> acb_rtselectmask = rt2ssmask; \
163 (acb) -> acb_rtpktlose = rt2sslose; \
164}
165
166int ss2rtslose (), ss2rtsabort ();
167int rt2sspturn (), rt2ssgturn (), rt2sstrans (), rt2sswait (),
168 rt2ssasync (), rt2ssmask (), rt2sslose ();
169
170/* \f */
171 /* RTORQ apdu */
172#define RTORQ_CKPOINT 0 /* checkpointSize tag */
173#define RTORQ_CK_DFLT 0 /* default */
174#define RTORQ_WINDOW 1 /* windowSize tag */
175#define RTORQ_WD_DFLT 3 /* default */
176#define RTORQ_DIALOGUE 2 /* dialogueMode tag */
177#define RTORQ_DM_MONO 0 /* monologue */
178#define RTORQ_DM_TWA 1 /* two-way alternate */
179#define RTORQ_DM_DFLT RTORQ_DM_MONO
180#define RTORQ_CONNDATA 3 /* connectionDataRQ tag */
181#define RTORQ_CD_OPEN 0 /* open tag */
182#define RTORQ_CD_RCVR 1 /* recover tag */
183
184 /* RTOAC apdu */
185#define RTOAC_CKPOINT 0 /* checkpointSize tag */
186#define RTOAC_CK_DFLT 0 /* default */
187#define RTOAC_WINDOW 1 /* windowSize tag */
188#define RTOAC_WD_DFLT 3 /* default */
189#define RTOAC_CONNDATA 2 /* connectionDataAC */
190#define RTOAC_CD_OPEN 0 /* open tag */
191#define RTOAC_CD_RCVR 1 /* recover tag */
192
193 /* RTORJ apdu */
194#define RTORJ_REFUSE 0 /* refuseReason tag */
195#define RTORJ_USERDATA 1 /* userDataRJ */
196
197 /* RTAB apdu */
198#define RTAB_REASON 0 /* abortReason tag */
199#define RTAB_REFLECT 1 /* relectedParameter tag */
200#define RTAB_USERDATA 2 /* userDataAB */
201
202extern int rtsap_priority;