#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
#ifndef KERNEL
#ifndef AFS_NT40_ENV
* By including this, we get any system dependencies. In particular,
* the pthreads for solaris requires the socket call to be mapped.
*/
-#include "rx_internal.h"
#include "rx.h"
#include "rx_globals.h"
#endif /* AFS_NT40_ENV */
#ifdef UKERNEL
#include "rx/rx_kcommon.h"
#else /* UKERNEL */
-#include "rx/rx_internal.h"
#include "rx/rx.h"
#endif /* UKERNEL */
#endif /* KERNEL */
** the buffer has to be passed in by the caller
*/
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_OBSD42_ENV)
+void
+ifm_fixversion(char *buffer, size_t *size) {
+ struct if_msghdr *ifm;
+ char *b = buffer;
+ char *s, *t;
+
+ if ((t = malloc(*size)) != NULL) {
+ memcpy(t, buffer, *size);
+
+ for (s = t; s < t + *size; s += ifm->ifm_msglen) {
+ ifm = (struct if_msghdr *)s;
+
+ if (ifm->ifm_version == RTM_VERSION) {
+ memcpy(b, ifm, ifm->ifm_msglen);
+ b += ifm->ifm_msglen;
+ }
+ }
+
+ free(t);
+
+ *size = b - buffer;
+ }
+}
+#endif
+
int
rx_getAllAddr_internal(afs_uint32 buffer[], int maxSize, int loopbacks)
{
free(buf);
return 0;
}
+#if defined(AFS_OBSD42_ENV)
+ ifm_fixversion(buf, &needed);
+#endif
lim = buf + needed;
next = buf;
while (next < lim) {
free(buf);
return 0;
}
+#if defined(AFS_OBSD42_ENV)
+ ifm_fixversion(buf, &needed);
+#endif
s = socket(PF_INET, SOCK_DGRAM, 0);
if (s < 0)
return 0;
rx_getAllAddrMaskMtu(afs_uint32 addrBuffer[], afs_uint32 maskBuffer[],
afs_uint32 mtuBuffer[], int maxSize)
{
- int s;
- int i, len, count = 0;
+ int i, count = 0;
+#if defined(AFS_USERSPACE_IP_ADDR)
+ int s, len;
struct ifconf ifc;
struct ifreq ifs[NIFS], *ifr;
struct sockaddr_in *a;
+#endif
+
#if defined(AFS_AIX41_ENV) || defined(AFS_USR_AIX_ENV)
char *cp, *cplim; /* used only for AIX 41 */
#endif