X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Frx%2Frx_user.c;h=7d9f603f56b7d3cfc16cf7e2bf2123eba9495dbb;hp=a01b7cce47ee5983bc741288d8641de3f3535e32;hb=e63a93f371729d565b37aaacb29734faafc938a2;hpb=87c10e8d7f05dbbdf12ee9e8651dcec07e08af3f diff --git a/src/rx/rx_user.c b/src/rx/rx_user.c index a01b7cc..7d9f603 100644 --- a/src/rx/rx_user.c +++ b/src/rx/rx_user.c @@ -1,28 +1,16 @@ - /* -**************************************************************************** -* Copyright IBM Corporation 1988, 1989 - All Rights Reserved * -* * -* Permission to use, copy, modify, and distribute this software and its * -* documentation for any purpose and without fee is hereby granted, * -* provided that the above copyright notice appear in all copies and * -* that both that copyright notice and this permission notice appear in * -* supporting documentation, and that the name of IBM not be used in * -* advertising or publicity pertaining to distribution of the software * -* without specific, written prior permission. * -* * -* IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL * -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL IBM * -* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY * -* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER * -* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * -* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * -**************************************************************************** -*/ + * Copyright 2000, International Business Machines Corporation and others. + * All Rights Reserved. + * + * This software has been released under the terms of the IBM Public + * License. For details, see the LICENSE file in the top-level source + * directory or online at http://www.openafs.org/dl/license10.html + */ /* rx_user.c contains routines specific to the user space UNIX implementation of rx */ # include +# include # include # include # include @@ -39,11 +27,17 @@ # include #endif # include -#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) # include #endif #include #include +#ifdef HAVE_STRINGS_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif #ifndef IPPORT_USERRESERVED /* If in.h doesn't define this, define it anyway. Unfortunately, defining @@ -58,8 +52,8 @@ # include "rx.h" # include "rx_globals.h" - extern void rxi_Delay(); +extern void rxi_MorePackets(); #ifdef AFS_PTHREAD_ENV #include @@ -99,14 +93,14 @@ pthread_mutex_t rx_if_mutex; */ osi_socket rxi_GetUDPSocket(u_short port) { - int binds, code; + int binds, code=0; osi_socket socketFd = OSI_NULLSOCKET; struct sockaddr_in taddr; char *name = "rxi_GetUDPSocket: "; extern int rxi_Listen(osi_socket sock); - int greedy; + int greedy=0; -#ifndef AFS_NT40_ENV +#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) if (ntohs(port) >= IPPORT_RESERVED && ntohs(port) < IPPORT_USERRESERVED) { /* (osi_Msg "%s*WARNING* port number %d is not a reserved port number. Use port numbers above %d\n", name, port, IPPORT_USERRESERVED); */ ; @@ -138,7 +132,7 @@ osi_socket rxi_GetUDPSocket(u_short port) goto error; } -#ifndef AFS_NT40_ENV +#if !defined(AFS_NT40_ENV) && !defined(AFS_DJGPP_ENV) /* * Set close-on-exec on rx socket */ @@ -153,6 +147,7 @@ osi_socket rxi_GetUDPSocket(u_short port) len1 = 32766; len2 = rx_UdpBufSize; +#ifndef AFS_DJGPP_ENV greedy = (setsockopt(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2, sizeof(len2)) >= 0); @@ -165,10 +160,13 @@ osi_socket rxi_GetUDPSocket(u_short port) sizeof(len1)) >= 0) && (setsockopt(socketFd, SOL_SOCKET, SO_RCVBUF, (char *)&len2, sizeof(len2)) >= 0); +#endif /* AFS_DJGPP_ENV */ } +#ifndef AFS_DJGPP_ENV if (!greedy) (osi_Msg "%s*WARNING* Unable to increase buffering on socket\n", name); +#endif /* AFS_DJGPP_ENV */ if (rxi_Listen(socketFd) < 0) { goto error; } @@ -241,7 +239,7 @@ static int myNetFlags[ADDRSPERSITE]; u_int rxi_numNetAddrs; static int Inited = 0; -#if defined(AFS_NT40_ENV) +#if defined(AFS_NT40_ENV) || defined(AFS_DJGPP_ENV) int rxi_getaddr(void) { if (rxi_numNetAddrs > 0) @@ -327,7 +325,7 @@ return msk; -#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) +#if !defined(AFS_AIX_ENV) && !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DJGPP_ENV) int rxi_syscall(a3, a4, a5) afs_uint32 a3, a4; void * a5; @@ -354,13 +352,15 @@ void rx_GetIFInfo() { int s; int i, j, len, res; +#ifndef AFS_DJGPP_ENV struct ifconf ifc; struct ifreq ifs[ADDRSPERSITE]; - struct ifreq ifreq, *ifr; + struct ifreq *ifr; #ifdef AFS_AIX41_ENV char buf[BUFSIZ], *cp, *cplim; #endif struct sockaddr_in *a; +#endif /* AFS_DJGPP_ENV */ LOCK_IF_INIT if (Inited) { @@ -381,6 +381,7 @@ void rx_GetIFInfo() s = socket(AF_INET, SOCK_DGRAM, 0); if (s < 0) return; +#ifndef AFS_DJGPP_ENV #ifdef AFS_AIX41_ENV ifc.ifc_len = sizeof (buf); ifc.ifc_buf = buf; @@ -547,6 +548,10 @@ void rx_GetIFInfo() rxi_MorePackets(npackets*(ncbufs+1)); } } +#else /* AFS_DJGPP_ENV */ + close(s); + return; +#endif /* AFS_DJGPP_ENV */ } #endif /* AFS_NT40_ENV */