* (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>
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)
{
NULL
};
-#endif /* HAVE_AFINET */
-
#if HAVE_AFINET6
/* Display an Internet socket address. */
};
static struct aftype * const aftypes[] = {
-#if HAVE_AFUNIX
- &unix_aftype,
-#endif
-#if HAVE_AFINET
&inet_aftype,
-#endif
#if HAVE_AFINET6
&inet6_aftype,
#endif
ife->tx_queue_len = -1; /* unknown value */
#endif
-#if HAVE_AFINET
/* IPv4 address? */
fd = get_socket_for_af(AF_INET);
if (fd >= 0) {
} else
memset(&ife->addr, 0, sizeof(struct sockaddr));
}
-#endif
return 0;
}
NULL, NULL, NULL
};
-#if HAVE_HWETHER
#include <net/if_arp.h>
#if (__GLIBC__ >=2 && __GLIBC_MINOR >= 1) || defined(_NEWLIB_VERSION)
pr_ether, NULL /* UNUSED in_ether */ , NULL
};
-
-#endif /* HAVE_HWETHER */
-
-
-#if HAVE_HWPPP
-
#include <net/if_arp.h>
static const struct hwtype ppp_hwtype = {
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
};
#endif
printf("\n");
-#if HAVE_AFINET
if (ptr->has_ip) {
printf(" %s addr:%s ", ap->name,
ap->sprint(&ptr->addr, 1));
}
printf(" Mask:%s\n", ap->sprint(&ptr->netmask, 1));
}
-#endif
#if HAVE_AFINET6