2 |
7u83 |
1 |
# Crown Copyright (c) 1997
|
|
|
2 |
#
|
|
|
3 |
# This TenDRA(r) Computer Program is subject to Copyright
|
|
|
4 |
# owned by the United Kingdom Secretary of State for Defence
|
|
|
5 |
# acting through the Defence Evaluation and Research Agency
|
|
|
6 |
# (DERA). It is made available to Recipients with a
|
|
|
7 |
# royalty-free licence for its use, reproduction, transfer
|
|
|
8 |
# to other parties and amendment for any purpose not excluding
|
|
|
9 |
# product development provided that any such use et cetera
|
|
|
10 |
# shall be deemed to be acceptance of the following conditions:-
|
|
|
11 |
#
|
|
|
12 |
# (1) Its Recipients shall ensure that this Notice is
|
|
|
13 |
# reproduced upon any copies or amended versions of it;
|
|
|
14 |
#
|
|
|
15 |
# (2) Any amended version of it shall be clearly marked to
|
|
|
16 |
# show both the nature of and the organisation responsible
|
|
|
17 |
# for the relevant amendment or amendments;
|
|
|
18 |
#
|
|
|
19 |
# (3) Its onward transfer from a recipient to another
|
|
|
20 |
# party shall be deemed to be that party's acceptance of
|
|
|
21 |
# these conditions;
|
|
|
22 |
#
|
|
|
23 |
# (4) DERA gives no warranty or assurance as to its
|
|
|
24 |
# quality or suitability for any purpose and DERA accepts
|
|
|
25 |
# no liability whatsoever in relation to any use to which
|
|
|
26 |
# it may be put.
|
|
|
27 |
#
|
|
|
28 |
+IF 0 # FOR THE MOMENT
|
|
|
29 |
|
|
|
30 |
# NETWORKING SERVICES
|
|
|
31 |
|
|
|
32 |
# Events
|
|
|
33 |
+CONST int T_LISTEN, T_CONNECT, T_DATA, T_EXDATA, T_DISCONNECT, T_ORDREL ;
|
|
|
34 |
+CONST int T_UDERR, T_GODATA, T_GOEXDATA ;
|
|
|
35 |
|
|
|
36 |
# States
|
|
|
37 |
+CONST int T_UNINIT, T_UNBND, T_IDLE, T_OUTCON, T_INCON, T_DATAXFER ;
|
|
|
38 |
+CONST int T_INREL, T_OUTREL ;
|
|
|
39 |
|
|
|
40 |
# Service types
|
|
|
41 |
+CONST int T_COTS, T_COTS_ORD, T_CLTS ;
|
|
|
42 |
|
|
|
43 |
# Errors
|
|
|
44 |
+CONST int TBADADDR, TBADOPT, TACCES, TBADF, TNOADDR, TOUTSTATE, TBADSEQ ;
|
|
|
45 |
+CONST int TSYSERR, TLOOK, TBADDATA, TBUFOVFLW, TFLOW, TNODATA, TNODIS ;
|
|
|
46 |
+CONST int TNOUDERR, TBADFLAG, TNOREL, TNOTSUPPORT, TSTATECHNG, TNOSTRUCTYPE;
|
|
|
47 |
+CONST int TBADNAME, TBADQLEN, TADDRBUSY ;
|
|
|
48 |
|
|
|
49 |
# Structure types for t_alloc
|
|
|
50 |
+CONST int T_BIND_STR, T_CALL_STR, T_OPTMGMT_STR, T_DIS_STR, T_UNITDATA_STR ;
|
|
|
51 |
+CONST int T_UDERROR_STR, T_INFO_STR ;
|
|
|
52 |
|
|
|
53 |
# Fields for t_alloc
|
|
|
54 |
+CONST int T_ADDR, T_OPT, T_UDATA, T_ALL ;
|
|
|
55 |
|
|
|
56 |
# Flags for t_optmgmt
|
|
|
57 |
+CONST int T_NEGOTIATE, T_CHECK, T_DEFAULT ;
|
|
|
58 |
|
|
|
59 |
# Flags for t_send
|
|
|
60 |
+CONST int T_EXPEDITED, T_MORE ;
|
|
|
61 |
|
|
|
62 |
# Structures
|
|
|
63 |
|
|
|
64 |
+FIELD struct netbuf {
|
|
|
65 |
unsigned int maxlen ;
|
|
|
66 |
unsigned int len ;
|
|
|
67 |
char *buf ;
|
|
|
68 |
} ;
|
|
|
69 |
|
|
|
70 |
+FIELD struct t_call {
|
|
|
71 |
struct netbuf addr ;
|
|
|
72 |
struct netbuf opt ;
|
|
|
73 |
struct netbuf udata ;
|
|
|
74 |
int sequence ;
|
|
|
75 |
} ;
|
|
|
76 |
|
|
|
77 |
+FIELD struct t_bind | t_bind_struct {
|
|
|
78 |
struct netbuf addr ;
|
|
|
79 |
unsigned int qlen ;
|
|
|
80 |
} ;
|
|
|
81 |
|
|
|
82 |
+FIELD struct t_info {
|
|
|
83 |
long addr ;
|
|
|
84 |
long options ;
|
|
|
85 |
long tsdu ;
|
|
|
86 |
long etsdu ;
|
|
|
87 |
long connect ;
|
|
|
88 |
long discon ;
|
|
|
89 |
long servtype ;
|
|
|
90 |
} ;
|
|
|
91 |
|
|
|
92 |
+FIELD struct t_optmgmt | t_optmgmt_struct {
|
|
|
93 |
struct netbuf opt ;
|
|
|
94 |
long flags ;
|
|
|
95 |
} ;
|
|
|
96 |
|
|
|
97 |
+FIELD struct t_discon {
|
|
|
98 |
struct netbuf udata ;
|
|
|
99 |
int reason ;
|
|
|
100 |
int sequence ;
|
|
|
101 |
} ;
|
|
|
102 |
|
|
|
103 |
+FIELD struct t_unitdata {
|
|
|
104 |
struct netbuf addr ;
|
|
|
105 |
struct netbuf opt ;
|
|
|
106 |
struct netbuf udata ;
|
|
|
107 |
} ;
|
|
|
108 |
|
|
|
109 |
+FIELD struct t_uderr {
|
|
|
110 |
struct netbuf addr ;
|
|
|
111 |
struct netbuf opt ;
|
|
|
112 |
long error ;
|
|
|
113 |
} ;
|
|
|
114 |
|
|
|
115 |
# Error handling
|
|
|
116 |
%%
|
|
|
117 |
extern int t_errno ;
|
|
|
118 |
extern char *t_errlist [] ;
|
|
|
119 |
extern int t_nerr ;
|
|
|
120 |
%%
|
|
|
121 |
|
|
|
122 |
# Functions
|
|
|
123 |
|
|
|
124 |
+FUNC int t_bind ( int, struct t_bind *, struct t_bind * ) ;
|
|
|
125 |
+FUNC int t_close ( int ) ;
|
|
|
126 |
+FUNC int t_look ( int ) ;
|
|
|
127 |
+FUNC int t_open ( char *, int, struct t_info * ) ;
|
|
|
128 |
+FUNC int t_sync ( int ) ;
|
|
|
129 |
+FUNC int t_unbind ( int ) ;
|
|
|
130 |
|
|
|
131 |
+FUNC int t_accept ( int, int, struct t_call * ) ;
|
|
|
132 |
+FUNC int t_connect ( int, struct t_call *, struct t_call * ) ;
|
|
|
133 |
+FUNC int t_listen ( int, struct t_call * ) ;
|
|
|
134 |
+FUNC int t_rcv ( int, char *, unsigned, int * ) ;
|
|
|
135 |
+FUNC int t_rcvconnect ( int, struct t_call * ) ;
|
|
|
136 |
+FUNC int t_rcvdis ( int, struct t_discon * ) ;
|
|
|
137 |
+FUNC int t_snd ( int, char *, unsigned, int ) ;
|
|
|
138 |
+FUNC int t_snddis ( int, struct t_call * ) ;
|
|
|
139 |
|
|
|
140 |
+FUNC int t_rcvrel ( int ) ;
|
|
|
141 |
+FUNC int t_sndrel ( int ) ;
|
|
|
142 |
|
|
|
143 |
+FUNC int t_rcvudata ( int, struct t_unitdata *, int * ) ;
|
|
|
144 |
+FUNC int t_rcvuderr ( int, struct t_uderr * ) ;
|
|
|
145 |
+FUNC int t_sndudata ( int, struct t_unitdata * ) ;
|
|
|
146 |
|
|
|
147 |
+FUNC int t_error ( char * ) ;
|
|
|
148 |
+FUNC int t_getinfo ( int, struct t_info * ) ;
|
|
|
149 |
+FUNC int t_getstate ( int ) ;
|
|
|
150 |
+FUNC int t_optmgmt ( int, struct t_optmgmt *, struct t_optmgmt * ) ;
|
|
|
151 |
+FUNC char *t_alloc ( int, int, int ) ;
|
|
|
152 |
+FUNC int t_free ( char *, int ) ;
|
|
|
153 |
|
|
|
154 |
# Appendix A
|
|
|
155 |
|
|
|
156 |
+FIELD struct rate {
|
|
|
157 |
long targetvalue ;
|
|
|
158 |
long minacceptvalue ;
|
|
|
159 |
} ;
|
|
|
160 |
|
|
|
161 |
+FIELD struct reqvalue {
|
|
|
162 |
struct rate called ;
|
|
|
163 |
struct rate calling ;
|
|
|
164 |
} ;
|
|
|
165 |
|
|
|
166 |
+FIELD struct thrpt {
|
|
|
167 |
struct reqvalue maxthrpt ;
|
|
|
168 |
struct reqvalue avgthrpt ;
|
|
|
169 |
} ;
|
|
|
170 |
|
|
|
171 |
+FIELD struct management {
|
|
|
172 |
short dflt ;
|
|
|
173 |
int ltpdu ;
|
|
|
174 |
short reastime ;
|
|
|
175 |
char class ;
|
|
|
176 |
char altclass ;
|
|
|
177 |
char extform ;
|
|
|
178 |
char flowctrl ;
|
|
|
179 |
char checksum ;
|
|
|
180 |
char netexp ;
|
|
|
181 |
char netrecptcf ;
|
|
|
182 |
} ;
|
|
|
183 |
|
|
|
184 |
+FIELD struct isoco_options {
|
|
|
185 |
struct thrpt throughput ;
|
|
|
186 |
struct reqvalue transdel ;
|
|
|
187 |
struct rate reserrorrate ;
|
|
|
188 |
struct rate transffailprob ;
|
|
|
189 |
struct rate estfailprob ;
|
|
|
190 |
struct rate relfailprob ;
|
|
|
191 |
struct rate estdelay ;
|
|
|
192 |
struct rate reldelay ;
|
|
|
193 |
struct netbuf connresil ;
|
|
|
194 |
unsigned short protection ;
|
|
|
195 |
short priority ;
|
|
|
196 |
struct management mngmt ;
|
|
|
197 |
char expd ;
|
|
|
198 |
} ;
|
|
|
199 |
|
|
|
200 |
+CONST int T_UNUSED ;
|
|
|
201 |
+CONST int T_YES, T_NO ;
|
|
|
202 |
+CONST int T_CLASS0, T_CLASS1, T_CLASS2, T_CLASS3, T_CLASS4 ;
|
|
|
203 |
+CONST int T_PRIDFLT, T_PRILOW, T_PRIMID, T_PRIHIGH, T_PRITOP ;
|
|
|
204 |
+CONST int T_NOPROTECT, T_PASSIVEPROTECT, T_ACTIVEPROTECT ;
|
|
|
205 |
+CONST int T_ABSREQ ;
|
|
|
206 |
+CONST int T_LTPDUDFLT ;
|
|
|
207 |
|
|
|
208 |
+FIELD struct isocl_options {
|
|
|
209 |
struct rate transdel ;
|
|
|
210 |
struct rate reserrorrate ;
|
|
|
211 |
unsigned short protection ;
|
|
|
212 |
short priority ;
|
|
|
213 |
} ;
|
|
|
214 |
|
|
|
215 |
|
|
|
216 |
# Appendix B
|
|
|
217 |
|
|
|
218 |
+FIELD struct secoptions {
|
|
|
219 |
short security ;
|
|
|
220 |
short compartment ;
|
|
|
221 |
short handling ;
|
|
|
222 |
long tcc ;
|
|
|
223 |
} ;
|
|
|
224 |
|
|
|
225 |
+FIELD struct tcp_options {
|
|
|
226 |
short precedence ;
|
|
|
227 |
long timeout ;
|
|
|
228 |
long max_seg_size ;
|
|
|
229 |
struct secoptions secopt ;
|
|
|
230 |
} ;
|
|
|
231 |
|
|
|
232 |
+CONST int T_ROUTINE, T_PRIORITY, T_IMMEDIATE, T_FLASH, T_OVERRIDEFLASH ;
|
|
|
233 |
+CONST int T_CRITIC_ECP, T_INETCONTROL, T_NETCONTROL ;
|
|
|
234 |
|
|
|
235 |
+ENDIF
|