if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
rx_SetRxDeadTime @241
rx_GetMinUdpBufSize @242
rx_SetUdpBufSize @243
+ rx_getAllAddrMaskMtu @244
; for performance testing
rx_TSFPQGlobSize @2001 DATA
if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
}
int
-rxi_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[],
- afs_uint32 mtuBuffer[], int maxSize)
+rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[],
+ afs_uint32 mtuBuffer[], int maxSize)
{
int s;
* by afsi_SetServerIPRank().
*/
int
-rxi_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[],
- afs_uint32 mtuBuffer[], int maxSize)
+rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[],
+ afs_uint32 mtuBuffer[], int maxSize)
{
int s;
int i, len, count = 0;
extern void rxi_setaddr(afs_uint32 x);
extern afs_uint32 rxi_getaddr(void);
extern int rx_getAllAddr(afs_uint32 * buffer, int maxSize);
-extern int rxi_getAllAddrMaskMtu(afs_uint32 addrBuffer[],
+extern int rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[],
afs_uint32 maskBuffer[],
afs_uint32 mtuBuffer[],
int maxSize);
/* The IP address list can change so we must query for it */
rx_GetIFInfo();
-#ifndef AFS_NT40_ENV
+#ifdef AFS_DJGPP_ENV
/* we don't want to use the loopback adapter which is first */
/* this is a bad bad hack.
* and doesn't hold true on Windows.
*/
if ( rxi_numNetAddrs > 1 )
offset = 1;
-#endif /* AFS_NT40_ENV */
+#endif /* AFS_DJGPP_ENV */
for (count = 0; offset < rxi_numNetAddrs && maxSize > 0;
count++, offset++, maxSize--)
return count;
}
+
+/* this function returns the total number of interface addresses
+ * the buffer has to be passed in by the caller. It also returns
+ * the matching interface mask and mtu. All values are returned
+ * in network byte order.
+ */
+int
+rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[],
+ afs_uint32 mtuBuffer[], int maxSize)
+{
+ int count = 0, offset = 0;
+
+ /* The IP address list can change so we must query for it */
+ rx_GetIFInfo();
+
+#ifdef AFS_DJGPP_ENV
+ /* we don't want to use the loopback adapter which is first */
+ /* this is a bad bad hack.
+ * and doesn't hold true on Windows.
+ */
+ if ( rxi_numNetAddrs > 1 )
+ offset = 1;
+#endif /* AFS_DJGPP_ENV */
+
+ for (count = 0;
+ offset < rxi_numNetAddrs && maxSize > 0;
+ count++, offset++, maxSize--) {
+ addrBuffer[count] = htonl(rxi_NetAddrs[offset]);
+ maskBuffer[count] = htonl(myNetMasks[offset]);
+ mtuBuffer[count] = htonl(myNetMTUs[offset]);
+ }
+ return count;
+}
#endif
#ifdef AFS_NT40_ENV
totalServers++;
}
-#ifdef AFS_NT40_ENV
- /* get all my interface addresses in net byte order */
- count = rx_getAllAddr(myAddr, UBIK_MAX_INTERFACE_ADDR);
-#else
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || AFSDIR_SERVER_NETINFO_FILEPATH) {
/*
* Find addresses we are supposed to register as per the netrestrict file
/* get all my interface addresses in net byte order */
count = rx_getAllAddr(myAddr, UBIK_MAX_INTERFACE_ADDR);
}
-#endif
if (count <= 0) { /* no address found */
ubik_print("ubik: No network addresses found, aborting..");
if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
$(INCFILEDIR)\errors.h \
$(INCFILEDIR)\itc.h \
$(INCFILEDIR)\vice.h \
+ $(INCFILEDIR)\netutils.h \
$(INCFILEDIR)\pthread_glock.h \
$(INCFILEDIR)\pthread_nosigs.h \
$(INCFILEDIR)\errmap_nt.h \
$(OUT)\isathing.obj \
$(OUT)\kreltime.obj \
$(OUT)\ktime.obj \
+ $(OUT)\netutils.obj \
$(OUT)\regex.obj \
$(OUT)\readdir_nt.obj \
$(OUT)\serverLog.obj \
#include "afs/sysincludes.h"
#include "afsincludes.h"
#else
+#ifdef AFS_NT40_ENV
+#include <winsock2.h>
+#else
#ifdef __FreeBSD__
#include <sys/types.h>
#endif
#include <netinet/in.h>
-#include <errno.h>
#include <sys/errno.h>
#endif
+#include <errno.h>
+#endif
#include "assert.h"
#include "afsutil.h"
* caller can choose to ignore the entire file but should write
* something to a log file).
*
- * All addresses should be in NBO (as returned by rx_getAllAddr() and
+ * All addresses should be in NBO (as returned by rx_getAllAddrMaskMtu() and
* parsed by extract_Addr().
*/
/*
strcpy(reason, "");
/* get all network interfaces from the kernel */
- neaddrs = rxi_getAllAddrMaskMtu(eAddrs, eMask, eMtu, MAXIPADDRS);
+ neaddrs = rx_getAllAddrMaskMtu(eAddrs, eMask, eMtu, MAXIPADDRS);
if (neaddrs <= 0) {
sprintf(reason, "No existing IP interfaces found");
return -1;
/* get all network interfaces from the kernel */
existNu =
- rxi_getAllAddrMaskMtu(existingAddr, existingMask, existingMtu,
+ rx_getAllAddrMaskMtu(existingAddr, existingMask, existingMtu,
MAXIPADDRS);
if (existNu < 0)
return existNu;
extern int rxi_numNetAddrs;
extern afs_uint32 rxi_NetAddrs[];
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH || AFSDIR_SERVER_NETINFO_FILEPATH) {
/*
* Find addresses we are supposed to register as per the netrestrict
}
FS_HostAddr_cnt = (afs_uint32) code;
} else
-#endif
{
FS_HostAddr_cnt = rx_getAllAddr(FS_HostAddrs, ADDRSPERSITE);
}
rx_SetUdpBufSize(udpBufSize); /* set the UDP buffer size for receive */
if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}