svn commit: trunk/busybox/networking
landley at busybox.net
landley at busybox.net
Tue Jun 20 14:57:02 UTC 2006
Author: landley
Date: 2006-06-20 07:57:00 -0700 (Tue, 20 Jun 2006)
New Revision: 15437
Log:
Patch from Robert P. J. Day cleaning up some unnecessary preprocessor
directives.
Modified:
trunk/busybox/networking/interface.c
Changeset:
Modified: trunk/busybox/networking/interface.c
===================================================================
--- trunk/busybox/networking/interface.c 2006-06-20 14:09:20 UTC (rev 15436)
+++ trunk/busybox/networking/interface.c 2006-06-20 14:57:00 UTC (rev 15437)
@@ -31,22 +31,6 @@
* (default AF was wrong)
*/
-/*
- *
- * Protocol Families.
- *
- */
-#define HAVE_AFINET 1
-
-/*
- *
- * Device Hardware types.
- *
- */
-#define HAVE_HWETHER 1
-#define HAVE_HWPPP 1
-
-
#include "inet_common.h"
#include <stdio.h>
#include <errno.h>
@@ -126,37 +110,6 @@
char *flag_file;
};
-#if HAVE_AFUNIX
-
-/* Display a UNIX domain address. */
-static char *UNIX_print(unsigned char *ptr)
-{
- return (ptr);
-}
-
-
-/* Display a UNIX domain address. */
-static char *UNIX_sprint(struct sockaddr *sap, int numeric)
-{
- static char buf[64];
-
- if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
- return safe_strncpy(buf, "[NONE SET]", sizeof(buf));
- return (UNIX_print(sap->sa_data));
-}
-
-
-static struct aftype unix_aftype = {
- "unix", "UNIX Domain", AF_UNIX, 0,
- UNIX_print, UNIX_sprint, NULL, NULL,
- NULL, NULL, NULL,
- -1,
- "/proc/net/unix"
-};
-#endif /* HAVE_AFUNIX */
-
-#if HAVE_AFINET
-
/* Display an Internet socket address. */
static char *INET_sprint(struct sockaddr *sap, int numeric)
{
@@ -182,8 +135,6 @@
NULL
};
-#endif /* HAVE_AFINET */
-
#if HAVE_AFINET6
/* Display an Internet socket address. */
@@ -247,12 +198,7 @@
};
static struct aftype * const aftypes[] = {
-#if HAVE_AFUNIX
- &unix_aftype,
-#endif
-#if HAVE_AFINET
&inet_aftype,
-#endif
#if HAVE_AFINET6
&inet6_aftype,
#endif
@@ -721,7 +667,6 @@
ife->tx_queue_len = -1; /* unknown value */
#endif
-#if HAVE_AFINET
/* IPv4 address? */
fd = get_socket_for_af(AF_INET);
if (fd >= 0) {
@@ -750,7 +695,6 @@
} else
memset(&ife->addr, 0, sizeof(struct sockaddr));
}
-#endif
return 0;
}
@@ -796,7 +740,6 @@
NULL, NULL, NULL
};
-#if HAVE_HWETHER
#include <net/if_arp.h>
#if (__GLIBC__ >=2 && __GLIBC_MINOR >= 1) || defined(_NEWLIB_VERSION)
@@ -822,12 +765,6 @@
pr_ether, NULL /* UNUSED in_ether */ , NULL
};
-
-#endif /* HAVE_HWETHER */
-
-
-#if HAVE_HWPPP
-
#include <net/if_arp.h>
static const struct hwtype ppp_hwtype = {
@@ -835,25 +772,10 @@
NULL, NULL, NULL /* UNUSED do_ppp */ , 0
};
-
-#endif /* HAVE_PPP */
-
static const struct hwtype * const hwtypes[] = {
-
&loop_hwtype,
-
-#if HAVE_HWSTRIP
- &strip_hwtype,
-#endif
-#if HAVE_HWETHER
ðer_hwtype,
-#endif
-#if HAVE_HWTUNNEL
- &tunnel_hwtype,
-#endif
-#if HAVE_HWPPP
&ppp_hwtype,
-#endif
&unspec_hwtype,
NULL
};
@@ -1005,7 +927,6 @@
#endif
printf("\n");
-#if HAVE_AFINET
if (ptr->has_ip) {
printf(" %s addr:%s ", ap->name,
ap->sprint(&ptr->addr, 1));
@@ -1017,7 +938,6 @@
}
printf(" Mask:%s\n", ap->sprint(&ptr->netmask, 1));
}
-#endif
#if HAVE_AFINET6
More information about the busybox-cvs
mailing list