3 * Authors: Charles Bailey bailey@genetics.upenn.edu
4 * David Denholm denholm@conmat.phys.soton.ac.uk
5 * Last Revised: 17-Mar-1995
7 * This file should include any other header files and procide any
8 * declarations, typedefs, and prototypes needed by perl for TCP/IP
11 * This version is set up for perl5 with socketshr 0.9D TCP/IP support.
14 /* SocketShr doesn't support these routines, but the DECC RTL contains
15 * stubs with these names, designed to be used with the UCX socket
16 * library. We avoid linker collisions by substituting new names.
18 #define getnetbyaddr no_getnetbyaddr
19 #define getnetbyname no_getnetbyname
20 #define getnetent no_getnetent
21 #define setnetent no_setnetent
22 #define endnetent no_endnetent
27 /* we may not have netdb.h etc, so lets just do this here - div */
28 /* no harm doing this for all .c files - needed only by pp_sys.c */
31 char *h_name; /* official name of host */
32 char **h_aliases; /* alias list */
33 int h_addrtype; /* host address type */
34 int h_length; /* length of address */
35 char **h_addr_list; /* address */
40 #define h_addr h_addr_list[0]
43 char *p_name; /* official protocol name */
44 char **p_aliases; /* alias list */
45 int p_proto; /* protocol # */
49 char *s_name; /* official service name */
50 char **s_aliases; /* alias list */
51 int s_port; /* port # */
52 char *s_proto; /* protocol to use */
60 unsigned short sa_family; /* address family */
61 char sa_data[14]; /* up to 14 bytes of direct address */
65 * Socket address, internet style.
69 unsigned short sin_port;
70 struct in_addr sin_addr;
86 /* Since socketshr.h won't declare function prototypes unless it thinks
87 * the system headers have already been included, we convince it that
95 # define IPPROTO_TCP 6
98 # define __INET_LOADED
100 #ifndef __NETDB_LOADED
101 # define __NETDB_LOADED
104 /* Finally, we provide prototypes for routines not supported by SocketShr,
105 * so that the stubs in sockadapt.c won't cause complaints about
106 * undeclared routines.
109 struct netent *getnetbyaddr( long net, int type);
110 struct netent *getnetbyname( char *name);
111 struct netent *getnetent();
115 #else /* !__GNU_CC__ */
117 /* DECC and VAXC have socket headers in the system set; they're for UCX, but
118 * we'll assume that the actual calling sequence is identical across the
119 * various TCP/IP stacks; these routines are pretty standard.
125 /* However, we don't have these two in the system headers. */
131 #include <socketshr.h>
132 /* socketshr.h from SocketShr 0.9D doesn't alias fileno; it's comments say
133 * that the CRTL version works OK. This isn't the case, at least with
134 * VAXC, so we use the SocketShr version.
135 * N.B. This means that sockadapt.h must be included *after* stdio.h.
136 * This is presently the case for Perl.
141 #define fileno si_fileno
142 int si_fileno(FILE *);