diff -u --recursive clean/net-tools/arp.c net-tools/arp.c --- clean/net-tools/arp.c Mon Dec 16 17:21:28 1996 +++ net-tools/arp.c Fri Feb 14 14:29:53 1997 @@ -43,8 +43,7 @@ #include #include #include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/config.in net-tools/config.in --- clean/net-tools/config.in Mon Dec 16 17:21:28 1996 +++ net-tools/config.in Sat Feb 15 17:58:37 1997 @@ -60,41 +60,44 @@ * * Protocol Families. * -* (Protocol Families supported by 1.2.x Kernels) +* (Protocol families supported by 1.2 kernels) * -bool 'UNIX protocol family?' HAVE_AFUNIX y -bool 'INET (TCP/IP) protocol family?' HAVE_AFINET y -bool 'Novell IPX/SPX protocol family?' HAVE_AFIPX y +bool 'UNIX protocol family' HAVE_AFUNIX y +bool 'INET (TCP/IP) protocol family' HAVE_AFINET y +bool 'Novell IPX/SPX protocol family' HAVE_AFIPX y * -* (Protocol Families supported by 1.3.x Kernels) +* (Protocol families supported by 2.0 kernels) * -bool 'Appletalk DDP protocol family?' HAVE_AFATALK n -bool 'AX25 (Packet Radio) protocol family?' HAVE_AFAX25 n -bool 'NET/ROM (Packet Radio) protocol family ?' HAVE_AFNETROM n +bool 'Appletalk DDP protocol family' HAVE_AFATALK y +bool 'AX25 (Packet Radio) protocol family' HAVE_AFAX25 n +bool 'NET/ROM (Packet Radio) protocol family' HAVE_AFNETROM n * -* (Protocol Families supported by additional patches) +* (Protocol families supported by 2.1 kernels) * -bool 'INET6 (IPv6) protocol family?' HAVE_AFINET6 n +bool 'INET6 (IPv6) protocol family' HAVE_AFINET6 y * * * Device Hardware types. * -* (Hardware types supported by 1.2.x Kernels) +* (Hardware types supported by 1.2 kernels) * bool 'Ethernet (generic) support' HAVE_HWETHER y -bool 'ARCnet support' HAVE_HWARC y +bool 'ARCnet support' HAVE_HWARC n bool 'SLIP (serial line) support' HAVE_HWSLIP y bool 'PPP (serial line) support' HAVE_HWPPP y bool 'IPIP Tunnel support' HAVE_HWTUNNEL y * -* (Hardware types supported by 1.3.x Kernels) +* (Hardware types supported by 2.0 kernels) * bool 'Token ring (generic) support' HAVE_HWTR n bool 'AX25 (Packet Radio) support' HAVE_HWAX25 n bool 'NET/ROM (Packet Radio) support' HAVE_HWNETROM n bool 'DLCI/FRAD (Frame Relay) support' HAVE_HWFR n * -* (Hardware types supported by additional patches) +* (Hardware types supported by 2.1 kernels) * -bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n -# bool 'ATM (Asynchronous Transfer Mode) support' HAVE_HWATM n +bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT y +#* +#* (Hardware types supported by additional patches) +#* +#bool 'ATM (Asynchronous Transfer Mode) support' HAVE_HWATM n diff -u --recursive clean/net-tools/ifconfig.c net-tools/ifconfig.c --- clean/net-tools/ifconfig.c Tue Dec 17 15:34:40 1996 +++ net-tools/ifconfig.c Sat Feb 15 18:02:14 1997 @@ -27,12 +27,12 @@ * Foundation; either version 2 of the License, or (at * your option) any later version. */ +#include #include #include #include -#include -#include -#include +#include +#include #include #include #include @@ -47,7 +47,7 @@ #include "version.h" #include "config.h" #include "net-locale.h" -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 #include #include @@ -74,6 +74,38 @@ #endif +/* This is from . */ + +struct user_net_device_stats +{ + unsigned long rx_packets; /* total packets received */ + unsigned long tx_packets; /* total packets transmitted */ + unsigned long rx_bytes; /* total bytes received */ + unsigned long tx_bytes; /* total bytes transmitted */ + unsigned long rx_errors; /* bad packets received */ + unsigned long tx_errors; /* packet transmit problems */ + unsigned long rx_dropped; /* no space in linux buffers */ + unsigned long tx_dropped; /* no space available in linux */ + unsigned long multicast; /* multicast packets received */ + unsigned long collisions; + + /* detailed rx_errors: */ + unsigned long rx_length_errors; + unsigned long rx_over_errors; /* receiver ring buff overflow */ + unsigned long rx_crc_errors; /* recved pkt with crc error */ + unsigned long rx_frame_errors; /* recv'd frame alignment error */ + unsigned long rx_fifo_errors; /* recv'r fifo overrun */ + unsigned long rx_missed_errors; /* receiver missed packet */ + /* detailed tx_errors */ + unsigned long tx_aborted_errors; + unsigned long tx_carrier_errors; + unsigned long tx_fifo_errors; + unsigned long tx_heartbeat_errors; + unsigned long tx_window_errors; + +}; + + struct interface { char name[IFNAMSIZ]; /* interface name */ short type; /* if type */ @@ -98,7 +130,7 @@ int has_ax25; int has_ddp; char hwaddr[32]; /* HW address */ - struct enet_statistics stats; /* statistics */ + struct user_net_device_stats stats; /* statistics */ }; @@ -113,7 +145,7 @@ int ipx_sock = -1; /* IPX socket */ int ax25_sock = -1; /* AX.25 socket */ int inet_sock = -1; /* INET socket */ -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 int inet6_sock = -1; /* INET6 socket */ #endif int ddp_sock = -1; /* Appletalk DDP socket */ @@ -128,7 +160,7 @@ int hf; char *dispname=NLS_CATSAVE (catfd, ifconfigSet, ifconfig_over, "overruns"); static struct aftype *ipxtype=NULL, *ddptype=NULL; -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 FILE *f; char addr6[40], devname[10]; struct sockaddr_in6 sap; @@ -165,7 +197,7 @@ , hw->print(ptr->hwaddr)); } printf("\n"); -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 if (ap->af != AF_INET6) { #endif printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_adr, @@ -180,7 +212,7 @@ } printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_mask, "Mask:%s\n"), ap->sprint(&ptr->netmask, 1)); -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 } if ((f = fopen("/proc/net/if_inet6", "r")) != NULL) { while(fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %s\n", @@ -264,15 +296,23 @@ /* If needed, display the interface statistics. */ printf(" "); + printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_rx, - "RX packets:%u errors:%u dropped:%u %s:%u\n"), + "RX packets:%lu errors:%lu dropped:%lu %s:%lu frame:%lu\n"), ptr->stats.rx_packets, ptr->stats.rx_errors, - ptr->stats.rx_dropped, dispname, ptr->stats.rx_fifo_errors); + ptr->stats.rx_dropped, dispname, ptr->stats.rx_fifo_errors,ptr->stats.rx_frame_errors); + printf(" "); + printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_tx, - "TX packets:%u errors:%u dropped:%u %s:%u\n"), + "TX packets:%lu errors:%lu dropped:%lu %s:%lu carrier:%lu\n"), ptr->stats.tx_packets, ptr->stats.tx_errors, - ptr->stats.tx_dropped, dispname, ptr->stats.tx_fifo_errors); + ptr->stats.tx_dropped, dispname, ptr->stats.tx_fifo_errors,ptr->stats.tx_carrier_errors); + + printf(" "); + + printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_tx, + "Collisions:%lu\n"),ptr->stats.collisions); if(hf<255 && (ptr->map.irq || ptr->map.mem_start || ptr->map.dma || ptr->map.base_addr)) { @@ -293,6 +333,7 @@ ptr->map.dma); printf("\n"); } + printf("\n"); #if NLS @@ -318,19 +359,21 @@ { bp=strchr(bp,':'); bp++; - sscanf(bp,"%d %d %d %d %d %d %d %d %d %d %d", + sscanf(bp,"%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld", + &ife->stats.rx_bytes, &ife->stats.rx_packets, &ife->stats.rx_errors, &ife->stats.rx_dropped, &ife->stats.rx_fifo_errors, &ife->stats.rx_frame_errors, + &ife->stats.tx_bytes, &ife->stats.tx_packets, &ife->stats.tx_errors, &ife->stats.tx_dropped, &ife->stats.tx_fifo_errors, &ife->stats.collisions, - + &ife->stats.tx_carrier_errors ); fclose(f); @@ -527,7 +570,7 @@ { fprintf(stderr, NLS_CATGETS(catfd, ifconfigSet, ifconfig_usage1, "Usage: ifconfig [-a] [-i] [-v] interface\n")); -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 fprintf(stderr, " [add inet6address/prefixlen]\n"); fprintf(stderr, " [del inet6address/prefixlen]\n"); #endif @@ -559,7 +602,7 @@ static int sockets_open() { inet_sock=socket(AF_INET, SOCK_DGRAM, 0); -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 inet6_sock=socket(AF_INET6, SOCK_DGRAM, 0); #endif ipx_sock=socket(AF_IPX, SOCK_DGRAM, 0); @@ -570,7 +613,7 @@ */ if(inet_sock!=-1) return inet_sock; -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 if(inet6_sock!=-1) return inet6_sock; #endif @@ -595,7 +638,7 @@ struct ifreq ifr; int goterr = 0; char **spp; -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 extern struct aftype inet6_aftype; struct sockaddr_in6 sa6; struct in6_ifreq ifr6; @@ -914,7 +957,7 @@ continue; } -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 if (!strcmp(*spp, "add")) { if (*++spp == NULL) usage(); if ((cp = strchr(*spp, '/'))) { diff -u --recursive clean/net-tools/lib/arcnet.c net-tools/lib/arcnet.c --- clean/net-tools/lib/arcnet.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/arcnet.c Fri Feb 14 14:30:49 1997 @@ -18,9 +18,8 @@ #if HAVE_HWARC #include #include -#include +#include #include -#include #include #include #include diff -u --recursive clean/net-tools/lib/ax25.c net-tools/lib/ax25.c --- clean/net-tools/lib/ax25.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/ax25.c Fri Feb 14 14:30:58 1997 @@ -24,9 +24,8 @@ #include #include #include -#include #include -#include /* ARPHRD_AX25 */ +#include #include #include #include @@ -39,7 +38,6 @@ #include "pathnames.h" #define EXTERN #include "net-locale.h" - static char AX25_errmsg[128]; diff -u --recursive clean/net-tools/lib/ddp.c net-tools/lib/ddp.c --- clean/net-tools/lib/ddp.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/ddp.c Sat Jan 25 11:24:28 1997 @@ -13,6 +13,7 @@ #include "config.h" #if HAVE_AFATALK +#include #include #include #include diff -u --recursive clean/net-tools/lib/ddp_gr.c net-tools/lib/ddp_gr.c --- clean/net-tools/lib/ddp_gr.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/ddp_gr.c Sat Jan 25 11:25:25 1997 @@ -1,6 +1,7 @@ #include "config.h" #if HAVE_AFATALK +#include #include #include #include diff -u --recursive clean/net-tools/lib/ether.c net-tools/lib/ether.c --- clean/net-tools/lib/ether.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/ether.c Fri Feb 14 14:31:06 1997 @@ -18,9 +18,8 @@ #if HAVE_HWETHER #include #include -#include +#include #include -#include #include #include #include diff -u --recursive clean/net-tools/lib/frame.c net-tools/lib/frame.c --- clean/net-tools/lib/frame.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/frame.c Fri Feb 14 14:31:13 1997 @@ -25,9 +25,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/inet.c net-tools/lib/inet.c --- clean/net-tools/lib/inet.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/inet.c Fri Feb 14 14:25:16 1997 @@ -30,7 +30,9 @@ #include #include #include +#if 0 #include +#endif #include #include #include @@ -272,7 +274,7 @@ #endif /* HAVE_AFINET || HAVE_AFINET6 */ -#if defined(HAVE_AFINET) || defined(HAVE_AFINET6) +#if HAVE_AFINET || HAVE_AFINET6 static void add2list(struct service **namebase, struct service *item) diff -u --recursive clean/net-tools/lib/inet6.c net-tools/lib/inet6.c --- clean/net-tools/lib/inet6.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/inet6.c Fri Feb 7 20:49:05 1997 @@ -20,13 +20,16 @@ #include "config.h" #if HAVE_AFINET6 +#include #include #include #include #include #include #include +#if 0 #include +#endif #include #include #include diff -u --recursive clean/net-tools/lib/inet6_gr.c net-tools/lib/inet6_gr.c --- clean/net-tools/lib/inet6_gr.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/inet6_gr.c Fri Feb 14 14:31:19 1997 @@ -1,12 +1,13 @@ #include "config.h" #if HAVE_AFINET6 +#include #include #include #include #include #include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/inet6_sr.c net-tools/lib/inet6_sr.c --- clean/net-tools/lib/inet6_sr.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/inet6_sr.c Fri Feb 14 14:31:25 1997 @@ -1,13 +1,15 @@ #include "config.h" #if HAVE_AFINET6 +#include #include #include #include #include #include #include -#include +#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/inet_gr.c net-tools/lib/inet_gr.c --- clean/net-tools/lib/inet_gr.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/inet_gr.c Fri Feb 14 14:31:32 1997 @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/inet_sr.c net-tools/lib/inet_sr.c --- clean/net-tools/lib/inet_sr.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/inet_sr.c Sat Feb 15 18:03:36 1997 @@ -1,13 +1,14 @@ #include "config.h" #if HAVE_AFINET +#include #include #include #include #include #include #include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/ipx.c net-tools/lib/ipx.c --- clean/net-tools/lib/ipx.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/ipx.c Sat Jan 25 11:24:18 1997 @@ -13,6 +13,7 @@ #include "config.h" #if HAVE_AFIPX +#include #include #include #include diff -u --recursive clean/net-tools/lib/ipx_gr.c net-tools/lib/ipx_gr.c --- clean/net-tools/lib/ipx_gr.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/ipx_gr.c Sat Jan 25 11:25:11 1997 @@ -3,6 +3,7 @@ #include "config.h" #if HAVE_AFIPX +#include #include #include #include diff -u --recursive clean/net-tools/lib/ipx_sr.c net-tools/lib/ipx_sr.c --- clean/net-tools/lib/ipx_sr.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/ipx_sr.c Sat Feb 15 18:03:48 1997 @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff -u --recursive clean/net-tools/lib/loopback.c net-tools/lib/loopback.c --- clean/net-tools/lib/loopback.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/loopback.c Sat Feb 15 18:04:01 1997 @@ -16,16 +16,13 @@ #include #include -#include -#include -#include +#include #include #include #include #include #include #include -#include #include "net-support.h" #include "pathnames.h" #define EXTERN diff -u --recursive clean/net-tools/lib/masq_info.c net-tools/lib/masq_info.c --- clean/net-tools/lib/masq_info.c Mon Dec 16 17:21:28 1996 +++ net-tools/lib/masq_info.c Fri Jan 24 12:42:07 1997 @@ -32,12 +32,14 @@ #include #include #include +#if 0 #include #include #include #include #include #include +#endif #include "net-support.h" #include "pathnames.h" #include "version.h" diff -u --recursive clean/net-tools/lib/netrom.c net-tools/lib/netrom.c --- clean/net-tools/lib/netrom.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/netrom.c Fri Feb 14 14:31:52 1997 @@ -24,10 +24,8 @@ #include #include #include -#include +#include #include -#include -#include /* ARPHRD_NETROM */ #include #include #include diff -u --recursive clean/net-tools/lib/ppp.c net-tools/lib/ppp.c --- clean/net-tools/lib/ppp.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/ppp.c Fri Feb 14 14:32:02 1997 @@ -22,9 +22,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/ppp_ac.c net-tools/lib/ppp_ac.c --- clean/net-tools/lib/ppp_ac.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/ppp_ac.c Fri Feb 14 14:32:23 1997 @@ -19,9 +19,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/sit.c net-tools/lib/sit.c --- clean/net-tools/lib/sit.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/sit.c Fri Feb 14 14:32:32 1997 @@ -21,9 +21,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/slip.c net-tools/lib/slip.c --- clean/net-tools/lib/slip.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/slip.c Fri Feb 14 14:32:40 1997 @@ -21,9 +21,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/slip_ac.c net-tools/lib/slip_ac.c --- clean/net-tools/lib/slip_ac.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/slip_ac.c Sat Feb 15 18:04:21 1997 @@ -23,9 +23,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/lib/tr.c net-tools/lib/tr.c --- clean/net-tools/lib/tr.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/tr.c Fri Feb 14 14:32:49 1997 @@ -16,11 +16,11 @@ #include "config.h" #if HAVE_HWTR +#include #include #include -#include +#include #include -#include #include #include #include diff -u --recursive clean/net-tools/lib/tunnel.c net-tools/lib/tunnel.c --- clean/net-tools/lib/tunnel.c Mon Dec 16 17:21:29 1996 +++ net-tools/lib/tunnel.c Fri Feb 14 14:32:53 1997 @@ -8,9 +8,8 @@ #if HAVE_HWTUNNEL #include #include -#include +#include #include -#include #include #include #include diff -u --recursive clean/net-tools/netstat.c net-tools/netstat.c --- clean/net-tools/netstat.c Tue Dec 17 15:34:40 1996 +++ net-tools/netstat.c Sat Feb 15 18:05:04 1997 @@ -44,6 +44,7 @@ * your option) any later version. * */ +#include #include #include #include @@ -56,29 +57,38 @@ #include #include #include -#include #include #include -#include #include #include #include #include #include #include -#include -#include +#include #include "net-support.h" #include "pathnames.h" #include "version.h" #include "config.h" #include "net-locale.h" -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 #include #include #endif +typedef enum { + SS_FREE = 0, /* not allocated */ + SS_UNCONNECTED, /* unconnected to any socket */ + SS_CONNECTING, /* in process of connecting */ + SS_CONNECTED, /* connected to socket */ + SS_DISCONNECTING /* in process of disconnecting */ +} socket_state; + +#define SO_ACCEPTCON (1<<16) /* performed a listen */ +#define SO_WAITDATA (1<<17) /* wait data to read */ +#define SO_NOSPACE (1<<18) /* no space to write */ + #define DFLT_AF "inet" #define FEATURE_NETSTAT @@ -93,6 +103,38 @@ #define E_IOCTL -3 +/* This is from . */ + +struct net_device_stats +{ + unsigned long rx_packets; /* total packets received */ + unsigned long tx_packets; /* total packets transmitted */ + unsigned long rx_bytes; /* total bytes received */ + unsigned long tx_bytes; /* total bytes transmitted */ + unsigned long rx_errors; /* bad packets received */ + unsigned long tx_errors; /* packet transmit problems */ + unsigned long rx_dropped; /* no space in linux buffers */ + unsigned long tx_dropped; /* no space available in linux */ + unsigned long multicast; /* multicast packets received */ + unsigned long collisions; + + /* detailed rx_errors: */ + unsigned long rx_length_errors; + unsigned long rx_over_errors; /* receiver ring buff overflow */ + unsigned long rx_crc_errors; /* recved pkt with crc error */ + unsigned long rx_frame_errors; /* recv'd frame alignment error */ + unsigned long rx_fifo_errors; /* recv'r fifo overrun */ + unsigned long rx_missed_errors; /* receiver missed packet */ + /* detailed tx_errors */ + unsigned long tx_aborted_errors; + unsigned long tx_carrier_errors; + unsigned long tx_fifo_errors; + unsigned long tx_heartbeat_errors; + unsigned long tx_window_errors; + +}; + + struct interface { char name[IFNAMSIZ]; /* interface name */ short flags; /* various flags */ @@ -103,7 +145,7 @@ struct sockaddr broadaddr; /* IP broadcast address */ struct sockaddr netmask; /* IP network mask */ struct sockaddr hwaddr; /* HW address */ - struct enet_statistics stats; /* statistics */ + struct net_device_stats stats; /* statistics */ }; int flag_nlp = 0; @@ -283,7 +325,7 @@ { char buffer[8192], local_addr[128]; char rem_addr[128], *tcp_state, timers[64]; -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 struct sockaddr_in6 localaddr, remaddr; char addr6p[8][5]; char addr6[128]; @@ -322,7 +364,7 @@ (void) fclose(procinfo); lnr--; lnr--; while (lnr >= 0) { -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 num = sscanf(line[lnr--], "%d: %[0-9A-Fa-f]:%X %[0-9A-Fa-f]:%X %X %lX:%lX %X:%lX %lX %d\n", &d, local_addr, &local_port, @@ -485,7 +527,7 @@ char buffer[8192], local_addr[64], rem_addr[64]; char *udp_state, timer_queued, timers[64], more[512]; int num, local_port, rem_port, d, state, timer_run, lnr = 0; -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 struct sockaddr_in6 localaddr, remaddr; char addr6p[8][5]; char addr6[128]; @@ -522,7 +564,7 @@ while (lnr >= 0) { -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 more[0] = '\0'; timer_queued = '\0'; num = sscanf(line[lnr--], @@ -599,7 +641,7 @@ strcpy(local_addr, ap->sprint((struct sockaddr *)&localaddr, flag_not)); strcpy(rem_addr, ap->sprint((struct sockaddr *)&remaddr, flag_not)); -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 if (flag_all || ((localaddr.sin6_family == AF_INET6) && ((localaddr.sin6_addr.s6_addr32[0])|| @@ -1073,10 +1115,10 @@ printf("%-5.5s ", ptr->name); printf("%5d %3d ", ptr->mtu, ptr->metric); /* If needed, display the interface statistics. */ - printf("%6u %6u %6u %6u ", + printf("%6lu %6lu %6lu %6lu ", ptr->stats.rx_packets, ptr->stats.rx_errors, ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors); - printf("%6u %6u %6u %6u ", + printf("%6lu %6lu %6lu %6lu ", ptr->stats.tx_packets, ptr->stats.tx_errors, ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors); if (ptr->flags == 0) printf(NLS_CATGETS(catfd, netstatSet, netstat_noflags, "[NO FLAGS]")); @@ -1109,13 +1151,15 @@ { bp=strchr(bp,':'); bp++; - sscanf(bp,"%d %d %d %d %d %d %d %d %d %d %d", + sscanf(bp,"%ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld", + &ife->stats.rx_bytes, &ife->stats.rx_packets, &ife->stats.rx_errors, &ife->stats.rx_dropped, &ife->stats.rx_fifo_errors, &ife->stats.rx_frame_errors, + &ife->stats.tx_bytes, &ife->stats.tx_packets, &ife->stats.tx_errors, &ife->stats.tx_dropped, @@ -1263,7 +1307,7 @@ fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage12, " -a, --all, --listening display all\n")); fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage13, " -o, --timers display timers\n\n")); fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage14, "={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n")); -#ifdef HAVE_AFINET6 +#if HAVE_AFINET6 fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage15, "= -A {inet|inet6|ipx|netrom|ddp|ax25},... --inet --inet6 --ipx --netrom --ddp --ax25\n")); #else fprintf(stderr, NLS_CATGETS(catfd, netstatSet, netstat_usage15, "= -A {inet|ipx|netrom|ddp|ax25},... --inet --ipx --netrom --ddp --ax25\n")); @@ -1421,7 +1465,7 @@ return(i); } if (flag_mas) { -#if HAVE_FW_MASQUERADE +#if HAVE_FW_MASQUERADE && HAVE_AFINET #if MORE_THAN_ONE_MASQ_AF if (!afname[0]) strcpy(afname,DFLT_AF); diff -u --recursive clean/net-tools/rarp.c net-tools/rarp.c --- clean/net-tools/rarp.c Mon Dec 16 17:21:28 1996 +++ net-tools/rarp.c Fri Feb 14 14:30:19 1997 @@ -18,8 +18,7 @@ #include #include #include -#include -#include +#include #include #include #include diff -u --recursive clean/net-tools/route.c net-tools/route.c --- clean/net-tools/route.c Mon Dec 16 17:21:28 1996 +++ net-tools/route.c Fri Feb 14 14:30:26 1997 @@ -51,7 +51,6 @@ #include #include #include -#include #include "net-support.h" #include "config.h" #include "net-locale.h"