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