{
char *port_name;
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
if (addr->sa_family == AF_INET6) {
INET6_rresolve(ip_port, size, (struct sockaddr_in6 *)addr,
(numeric&NETSTAT_NUMERIC) ? 0x0fff : 0);
const char *state_str;
char more[512];
int num, local_port, rem_port, d, state, timer_run, uid, timeout;
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
struct sockaddr_in6 localaddr, remaddr;
char addr6[INET6_ADDRSTRLEN];
struct in6_addr in6;
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
if (strlen(local_addr) > 8) {
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
sscanf(local_addr, "%08X%08X%08X%08X",
&in6.s6_addr32[0], &in6.s6_addr32[1],
&in6.s6_addr32[2], &in6.s6_addr32[3]);
char local_addr[64], rem_addr[64];
char *state_str, more[512];
int num, local_port, rem_port, d, state, timer_run, uid, timeout;
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
struct sockaddr_in6 localaddr, remaddr;
char addr6[INET6_ADDRSTRLEN];
struct in6_addr in6;
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
if (strlen(local_addr) > 8) {
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
/* Demangle what the kernel gives us */
sscanf(local_addr, "%08X%08X%08X%08X",
&in6.s6_addr32[0], &in6.s6_addr32[1],
break;
}
-#if CONFIG_FEATURE_IPV6
-#define notnull(A) (((A.sin6_family == AF_INET6) && \
+#ifdef CONFIG_FEATURE_IPV6
+# define notnull(A) (((A.sin6_family == AF_INET6) && \
((A.sin6_addr.s6_addr32[0]) || \
(A.sin6_addr.s6_addr32[1]) || \
(A.sin6_addr.s6_addr32[2]) || \
((A.sin6_family == AF_INET) && \
((struct sockaddr_in *) &A)->sin_addr.s_addr))
#else
-#define notnull(A) (A.sin_addr.s_addr)
+# define notnull(A) (A.sin_addr.s_addr)
#endif
if ((notnull(remaddr) && (flags&NETSTAT_CONNECTED)) ||
(!notnull(remaddr) && (flags&NETSTAT_LISTENING)))
char local_addr[64], rem_addr[64];
char *state_str, more[512];
int num, local_port, rem_port, d, state, timer_run, uid, timeout;
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
struct sockaddr_in6 localaddr, remaddr;
char addr6[INET6_ADDRSTRLEN];
struct in6_addr in6;
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
if (strlen(local_addr) > 8) {
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
sscanf(local_addr, "%08X%08X%08X%08X",
&in6.s6_addr32[0], &in6.s6_addr32[1],
&in6.s6_addr32[2], &in6.s6_addr32[3]);
}
state_str=itoa(state);
-#if CONFIG_FEATURE_IPV6
-#define notnull(A) (((A.sin6_family == AF_INET6) && \
+#ifdef CONFIG_FEATURE_IPV6
+# define notnull(A) (((A.sin6_family == AF_INET6) && \
((A.sin6_addr.s6_addr32[0]) || \
(A.sin6_addr.s6_addr32[1]) || \
(A.sin6_addr.s6_addr32[2]) || \
((A.sin6_family == AF_INET) && \
((struct sockaddr_in *) &A)->sin_addr.s_addr))
#else
-#define notnull(A) (A.sin_addr.s_addr)
+# define notnull(A) (A.sin_addr.s_addr)
#endif
if ((notnull(remaddr) && (flags&NETSTAT_CONNECTED)) ||
(!notnull(remaddr) && (flags&NETSTAT_LISTENING)))
int opt;
int new_flags=0;
int showroute = 0, extended = 0;
-#if CONFIG_FEATURE_IPV6
+#ifdef CONFIG_FEATURE_IPV6
int inet=1;
int inet6=1;
#else
-#define inet 1
-#define inet6 0
+# define inet 1
+# define inet6 0
#endif
while ((opt = getopt(argc, argv, "laenrtuwx")) != -1)
switch (opt) {