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 |
# CAE, Networking Services, Issue 4
|
|
|
29 |
|
|
|
30 |
+USE "unix95", "sys/types.h" ;
|
|
|
31 |
+USE "unix95", "sys/uio.h" ;
|
|
|
32 |
|
|
|
33 |
+CONST int SCM_RIGHTS ;
|
|
|
34 |
|
|
|
35 |
+CONST int SOCK_DGRAM, SOCK_STREAM, SOCK_SEQPACKET ;
|
|
|
36 |
|
|
|
37 |
+CONST int SOL_SOCKET ;
|
|
|
38 |
|
|
|
39 |
+CONST int SO_DEBUG, SO_ACCEPTCONN, SO_BROADCAST, SO_REUSEADDR ;
|
|
|
40 |
+CONST int SO_KEEPALIVE, SO_LINGER, SO_OOBINLINE ;
|
|
|
41 |
+CONST int SO_SNDBUF, SO_RCVBUF, SO_ERROR, SO_TYPE ;
|
|
|
42 |
|
|
|
43 |
+CONST int MSG_CTRUNC, MSG_OOB, MSG_PEEK, MSG_TRUNC, MSG_WAITALL;
|
|
|
44 |
|
|
|
45 |
+CONST int AF_UNIX, AF_INET ;
|
|
|
46 |
|
|
|
47 |
+CONST int SHUT_RD, SHUT_WR, SHUT_RDWR ;
|
|
|
48 |
|
|
|
49 |
+SUBSET "sa_family_t" := { +TYPE (unsigned) sa_family_t ; } ;
|
|
|
50 |
|
|
|
51 |
+NAT ~sa_data_size ;
|
|
|
52 |
|
|
|
53 |
+FIELD struct sockaddr {
|
|
|
54 |
sa_family_t sa_family ;
|
|
|
55 |
char sa_data [ ~sa_data_size ] ;
|
|
|
56 |
} ;
|
|
|
57 |
|
|
|
58 |
+FIELD struct msghdr {
|
|
|
59 |
void *msg_name ;
|
|
|
60 |
size_t msg_namelen ;
|
|
|
61 |
struct iovec *msg_iov ;
|
|
|
62 |
int msg_iovlen ;
|
|
|
63 |
void *msg_control ;
|
|
|
64 |
size_t msg_controllen ;
|
|
|
65 |
int msg_flags ;
|
|
|
66 |
} ;
|
|
|
67 |
|
|
|
68 |
+FIELD struct cmsghdr {
|
|
|
69 |
size_t cmsg_len ;
|
|
|
70 |
int cmsg_level ;
|
|
|
71 |
int cmsg_type ;
|
|
|
72 |
} ;
|
|
|
73 |
|
|
|
74 |
+FIELD struct linger {
|
|
|
75 |
int l_onoff ;
|
|
|
76 |
int l_linger ;
|
|
|
77 |
} ;
|
|
|
78 |
|
|
|
79 |
+MACRO unsigned char * CMSG_DATA ( struct cmsghdr * ) ;
|
|
|
80 |
+MACRO struct cmsghdr * CMSG_NXTHDR ( struct msghdr *, struct cmsghdr * ) ;
|
|
|
81 |
+MACRO struct cmsghdr * CMSG_FIRSTHDR ( struct msghdr * ) ;
|
|
|
82 |
|
|
|
83 |
+FUNC int accept ( int, struct sockaddr *, size_t * ) ;
|
|
|
84 |
+FUNC int bind ( int, const struct sockaddr *, size_t ) ;
|
|
|
85 |
+FUNC int connect ( int, const struct sockaddr *, size_t ) ;
|
|
|
86 |
+FUNC int getpeername ( int, const struct sockaddr *, size_t * ) ;
|
|
|
87 |
+FUNC int getsockname ( int, const struct sockaddr *, size_t * ) ;
|
|
|
88 |
+FUNC int getsockopt ( int, int, int, void *, size_t * ) ;
|
|
|
89 |
+FUNC int listen ( int, int ) ;
|
|
|
90 |
+FUNC ssize_t recv ( int, void *, size_t, int ) ;
|
|
|
91 |
+FUNC ssize_t recvfrom ( int, void *, size_t,
|
|
|
92 |
int, struct sockaddr *, size_t * ) ;
|
|
|
93 |
+FUNC ssize_t recvmsg ( int, struct msghdr *, int ) ;
|
|
|
94 |
+FUNC ssize_t send ( int, const void *, size_t, int ) ;
|
|
|
95 |
+FUNC ssize_t sendmsg ( int, const struct msghdr *, int ) ;
|
|
|
96 |
+FUNC ssize_t sendto ( int, const void *, size_t, int,
|
|
|
97 |
const struct sockaddr *, size_t ) ;
|
|
|
98 |
+FUNC int setsockopt ( int, int, int, const void *, size_t ) ;
|
|
|
99 |
+FUNC int shutdown ( int, int ) ;
|
|
|
100 |
+FUNC int socket ( int, int, int ) ;
|
|
|
101 |
+FUNC int socketpair ( int, int, int, int [2] ) ;
|