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 |
+USE "svid3", "fcntl.h" ;
|
|
|
29 |
|
|
|
30 |
+CONST int T_BIND, T_CALL, T_OPTMGMT, T_DIS, T_UNITDATA, T_UDERROR, T_INFO ;
|
|
|
31 |
+CONST int T_ADDR, T_OPT, T_UDATA, T_ALL ;
|
|
|
32 |
+CONST int T_UNBND, T_IDLE, T_OUTCON, T_INCON, T_DATAXFER, T_OUTREL ;
|
|
|
33 |
+CONST int T_INREL, T_UNINIT ;
|
|
|
34 |
+CONST int T_LISTEN, T_CONNECT, T_DATA, T_EXDATA, T_DISCONNECT, T_ERROR ;
|
|
|
35 |
+CONST int T_UDERR, T_ORDREL ;
|
|
|
36 |
+CONST int T_COTS, T_COTS_ORD, T_CLTS ;
|
|
|
37 |
+CONST int T_NEGOTIATE, T_CHECK, T_DEFAULT ;
|
|
|
38 |
+CONST int T_MORE, T_EXPEDITED ;
|
|
|
39 |
|
|
|
40 |
+FIELD struct netbuf {
|
|
|
41 |
unsigned int maxlen ;
|
|
|
42 |
unsigned int len ;
|
|
|
43 |
char *buf ;
|
|
|
44 |
} ;
|
|
|
45 |
|
|
|
46 |
+FIELD struct t_bind | t_bind_struct {
|
|
|
47 |
struct netbuf addr ;
|
|
|
48 |
unsigned qlen ;
|
|
|
49 |
} ;
|
|
|
50 |
|
|
|
51 |
+FIELD struct t_call {
|
|
|
52 |
struct netbuf addr ;
|
|
|
53 |
struct netbuf opt ;
|
|
|
54 |
struct netbuf udata ;
|
|
|
55 |
int sequence ;
|
|
|
56 |
} ;
|
|
|
57 |
|
|
|
58 |
+FIELD struct t_info {
|
|
|
59 |
long addr ;
|
|
|
60 |
long options ;
|
|
|
61 |
long tsdu ;
|
|
|
62 |
long etsdu ;
|
|
|
63 |
long connect ;
|
|
|
64 |
long discon ;
|
|
|
65 |
long servtype ;
|
|
|
66 |
} ;
|
|
|
67 |
|
|
|
68 |
+FIELD struct t_optmgmt | t_optmgmt_struct {
|
|
|
69 |
struct netbuf opt ;
|
|
|
70 |
long flags ;
|
|
|
71 |
} ;
|
|
|
72 |
|
|
|
73 |
+FIELD struct t_discon {
|
|
|
74 |
struct netbuf udata ;
|
|
|
75 |
int reason ;
|
|
|
76 |
int sequence ;
|
|
|
77 |
} ;
|
|
|
78 |
|
|
|
79 |
+FIELD struct t_unitdata {
|
|
|
80 |
struct netbuf addr ;
|
|
|
81 |
struct netbuf opt ;
|
|
|
82 |
struct netbuf udata ;
|
|
|
83 |
} ;
|
|
|
84 |
|
|
|
85 |
+FIELD struct t_uderr {
|
|
|
86 |
struct netbuf addr ;
|
|
|
87 |
struct netbuf opt ;
|
|
|
88 |
long error ;
|
|
|
89 |
} ;
|
|
|
90 |
|
|
|
91 |
+CONST int TACCES, TBADADDR, TBADDATA, TBADF, TBADFLAG, TBADOPT, TBADSEQ ;
|
|
|
92 |
+CONST int TBUFOVFLW, TFLOW, TLOOK, TNOADDR, TNODATA, TNODIS, TNOREL ;
|
|
|
93 |
+CONST int TNOTSUPPORT, TNOUDERR, TOUTSTATE, TSTATECHNG, TSYSERR ;
|
|
|
94 |
|
|
|
95 |
+EXP (extern) int t_errno ;
|
|
|
96 |
+EXP (extern) char *t_errlist [] ;
|
|
|
97 |
+EXP (extern) int t_nerr ;
|
|
|
98 |
|
|
|
99 |
+FUNC int t_accept ( int, int, struct t_call * ) ;
|
|
|
100 |
+FUNC char *t_alloc ( int, int, int ) ;
|
|
|
101 |
+FUNC int t_bind ( int, struct t_bind *, struct t_bind * ) ;
|
|
|
102 |
+FUNC int t_close ( int ) ;
|
|
|
103 |
+FUNC int t_connect ( int, struct t_call *, struct t_call * ) ;
|
|
|
104 |
+FUNC void t_error ( const char * ) ;
|
|
|
105 |
+FUNC int t_free ( char *, int ) ;
|
|
|
106 |
+FUNC int t_getinfo ( int, struct t_info * ) ;
|
|
|
107 |
+FUNC int t_getstate ( int ) ;
|
|
|
108 |
+FUNC int t_listen ( int, struct t_call * ) ;
|
|
|
109 |
+FUNC int t_look ( int ) ;
|
|
|
110 |
+FUNC int t_open ( const char *, int, struct t_info * ) ;
|
|
|
111 |
+FUNC int t_optmgmt ( int, struct t_optmgmt *, struct t_optmgmt * ) ;
|
|
|
112 |
+FUNC int t_rcv ( int, char *, unsigned, int * ) ;
|
|
|
113 |
+FUNC int t_rcvconnect ( int, struct t_call * ) ;
|
|
|
114 |
+FUNC int t_rcvdis ( int, struct t_discon * ) ;
|
|
|
115 |
+FUNC int t_rcvrel ( int ) ;
|
|
|
116 |
+FUNC int t_rcvudata ( int, struct t_unitdata *, int * ) ;
|
|
|
117 |
+FUNC int t_rcvuderr ( int, struct t_uderr * ) ;
|
|
|
118 |
+FUNC int t_snd ( int, const void *, unsigned, int ) ;
|
|
|
119 |
+FUNC int t_snddis ( int, struct t_call * ) ;
|
|
|
120 |
+FUNC int t_sndrel ( int ) ;
|
|
|
121 |
+FUNC int t_sndudata ( int, struct t_unitdata * ) ;
|
|
|
122 |
+FUNC int t_sync ( int ) ;
|
|
|
123 |
+FUNC int t_unbind ( int ) ;
|