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 "ansi", "stddef.h", "size_t" (!?) ;
|
|
|
31 |
+IMPLEMENT "unix95", "netinet/in.h", "in_t" ;
|
|
|
32 |
|
|
|
33 |
+FIELD struct hostent {
|
|
|
34 |
char *h_name ;
|
|
|
35 |
char **h_aliases ;
|
|
|
36 |
int h_addrtype ;
|
|
|
37 |
int h_length ;
|
|
|
38 |
char **h_addr_list ;
|
|
|
39 |
} ;
|
|
|
40 |
|
|
|
41 |
+FIELD struct netent {
|
|
|
42 |
char *n_name ;
|
|
|
43 |
char **n_aliases ;
|
|
|
44 |
int n_addrtype ;
|
|
|
45 |
in_addr_t n_net ;
|
|
|
46 |
} ;
|
|
|
47 |
|
|
|
48 |
+FIELD struct protoent {
|
|
|
49 |
char *p_name ;
|
|
|
50 |
char **p_aliases ;
|
|
|
51 |
int p_proto ;
|
|
|
52 |
} ;
|
|
|
53 |
|
|
|
54 |
+FIELD struct servent {
|
|
|
55 |
char *s_name ;
|
|
|
56 |
char **s_aliases ;
|
|
|
57 |
int s_port ;
|
|
|
58 |
char *s_proto ;
|
|
|
59 |
} ;
|
|
|
60 |
|
|
|
61 |
+CONST int IPPORT_RESERVED ;
|
|
|
62 |
|
|
|
63 |
+EXP (extern) int h_errno ;
|
|
|
64 |
|
|
|
65 |
+CONST int HOST_NOT_FOUND, NO_DATA, NO_RECOVERY, TRY_AGAIN ;
|
|
|
66 |
|
|
|
67 |
+FUNC void endhostent ( void ) ;
|
|
|
68 |
+FUNC void endnetent ( void ) ;
|
|
|
69 |
+FUNC void endprotoent ( void ) ;
|
|
|
70 |
+FUNC void endservent ( void ) ;
|
|
|
71 |
+FUNC struct hostent *gethostbyaddr ( const void *, size_t, int ) ;
|
|
|
72 |
+FUNC struct hostent *gethostbyname ( const char * ) ;
|
|
|
73 |
+FUNC struct hostent *gethostent ( void ) ;
|
|
|
74 |
+FUNC struct netent *getnetbyaddr ( in_addr_t, int ) ;
|
|
|
75 |
+FUNC struct netent *getnetbyname ( const char * ) ;
|
|
|
76 |
+FUNC struct netent *getnetent ( void ) ;
|
|
|
77 |
+FUNC struct protoent *getprotobyname ( const char * ) ;
|
|
|
78 |
+FUNC struct protoent *getprotobynumber ( int ) ;
|
|
|
79 |
+FUNC struct protoent *getprotoent ( void ) ;
|
|
|
80 |
+FUNC struct servent *getservbyname ( const char *, const char * ) ;
|
|
|
81 |
+FUNC struct servent *getservbyport ( int, const char * ) ;
|
|
|
82 |
+FUNC struct servent *getservent ( void ) ;
|
|
|
83 |
+FUNC void sethostent ( int ) ;
|
|
|
84 |
+FUNC void setnetent ( int ) ;
|
|
|
85 |
+FUNC void setprotoent ( int ) ;
|
|
|
86 |
+FUNC void setservent ( int ) ;
|