3 * Author: Charles Bailey bailey@genetics.upenn.edu
4 * Last Revised: 29-Jan-1996
6 * This file should contain stubs for any of the TCP/IP functions perl5
7 * requires which are not supported by your TCP/IP stack. These stubs
8 * can attempt to emulate the routine in question, or can just return
9 * an error status or cause perl to die.
11 * This version is set up for perl5 with socketshr 0.9D TCP/IP support.
16 #if defined(__DECC) && defined(__DECC_VER) && (__DECC_VER >= 50200000)
17 # define __sockadapt_my_netent_t __struct_netent_ptr32
18 # define __sockadapt_my_addr_t __in_addr_t
19 # define __sockadapt_my_name_t const char *
21 # define __sockadapt_my_netent_t struct netent *
22 # define __sockadapt_my_addr_t long
23 # define __sockadapt_my_name_t char *
26 __sockadapt_my_netent_t getnetbyaddr( __sockadapt_my_addr_t net, int type) {
27 croak("Function \"getnetbyaddr\" not implemented in this version of perl");
28 return (struct netent *)NULL; /* Avoid MISSINGRETURN warning, not reached */
30 __sockadapt_my_netent_t getnetbyname( __sockadapt_my_name_t name) {
31 croak("Function \"getnetbyname\" not implemented in this version of perl");
32 return (struct netent *)NULL; /* Avoid MISSINGRETURN warning, not reached */
34 __sockadapt_my_netent_t getnetent() {
35 croak("Function \"getnetent\" not implemented in this version of perl");
36 return (struct netent *)NULL; /* Avoid MISSINGRETURN warning, not reached */
39 croak("Function \"setnetent\" not implemented in this version of perl");
42 croak("Function \"endnetent\" not implemented in this version of perl");
45 /* Some TCP/IP implementations seem to return success, when getpeername()
46 * is called on a UDP socket, but the port and in_addr are all zeroes.
49 int my_getpeername(int sock, struct sockaddr *addr, int *addrlen) {
50 static char nowhere[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
53 rslt = si_getpeername(sock, addr, addrlen);
55 /* Just pass an error back up the line */
56 if (rslt) return rslt;
58 /* If the call succeeded, make sure we don't have a zeroed port/addr */
59 if (addr->sa_family == AF_INET &&
60 !memcmp((char *)addr + sizeof(u_short), nowhere,
61 sizeof(u_short) + sizeof(struct in_addr))) {
63 SETERRNO(ENOTCONN,SS$_CLEARED);