1 --- net-tools-1.60/lib/interface.c.cycle 2003-02-11 14:29:29.000000000 +0100
2 +++ net-tools-1.60/lib/interface.c 2003-02-11 14:29:29.000000000 +0100
4 static struct interface *int_list, *int_last;
6 static int if_readlist_proc(char *);
7 +static int if_readlist_rep(char *, struct interface *);
9 static struct interface *add_interface(char *name)
12 int for_all_interfaces(int (*doit) (struct interface *, void *), void *cookie)
14 struct interface *ife;
17 if (!int_list && (if_readlist() < 0))
19 for (ife = int_list; ife; ife = ife->next) {
20 - int err = doit(ife, cookie);
21 + if_readlist_rep(ife->name, ife);
22 + err = doit(ife, cookie);
31 +static int if_readlist_rep(char *target, struct interface *ife)
37 + fh = fopen(_PATH_PROCNET_DEV, "r");
39 + fprintf(stderr, _("Warning: cannot open %s (%s). Limited output.\n"),
40 + _PATH_PROCNET_DEV, strerror(errno));
41 + return if_readconf();
43 + fgets(buf, sizeof buf, fh); /* eat line */
44 + fgets(buf, sizeof buf, fh);
46 + procnetdev_vsn = procnetdev_version(buf);
49 + while (fgets(buf, sizeof buf, fh)) {
50 + char *s, name[IFNAMSIZ];
51 + s = get_name(name, buf);
52 + get_dev_fields(s, ife);
53 + ife->statistics_valid = 1;
54 + if (target && !strcmp(target,name))
58 + perror(_PATH_PROCNET_DEV);
68 int err = if_readlist_proc(NULL);
69 --- net-tools-1.60/man/en_US/netstat.8.cycle 2001-01-07 13:43:57.000000000 +0100
70 +++ net-tools-1.60/man/en_US/netstat.8 2003-02-11 14:29:29.000000000 +0100
72 .RB [ \-\-program | \-p ]
73 .RB [ \-\-verbose | \-v ]
74 .RB [ \-\-continuous | \-c]
78 .RB { \-\-route | \-r }
80 .RB [ \-\-numeric | \-n ]
81 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
82 .RB [ \-\-continuous | \-c]
86 .RB { \-\-interfaces | \-i }
88 .RB [ \-\-numeric | \-n ]
89 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
90 .RB [ \-\-continuous | \-c]
94 .RB { \-\-groups | \-g }
95 .RB [ \-\-numeric | \-n ]
96 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
97 .RB [ \-\-continuous | \-c]
101 .RB { \-\-masquerade | \-M }
103 .RB [ \-\-numeric | \-n ]
104 .RB [ \-\-numeric-hosts ] [ \-\-numeric-ports ] [ \-\-numeric-ports ]
105 .RB [ \-\-continuous | \-c]
109 .RB { \-\-statistics | -s }
110 .RB [ \-\-tcp | \-t ]
111 .RB [ \-\-udp | \-u ]
112 .RB [ \-\-raw | \-w ]
116 .RB { \-\-version | \-V }
118 Print routing information from the FIB. (This is the default.)
120 Print routing information from the route cache.
122 +Netstat will cycle printing through statistics every
128 --- net-tools-1.60/netstat.c.cycle 2003-02-11 14:29:29.000000000 +0100
129 +++ net-tools-1.60/netstat.c 2003-02-11 15:07:26.000000000 +0100
133 /* prototypes for statistics.c */
134 -void parsesnmp(int, int, int);
135 +int parsesnmp(int, int, int);
139 @@ -1440,6 +1440,8 @@
141 static int iface_info(void)
143 + static int count=0;
146 if ((skfd = sockets_open(0)) < 0) {
148 @@ -1449,20 +1451,21 @@
152 - printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
154 + printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
157 if (for_all_interfaces(do_if_print, &flag_all) < 0) {
158 perror(_("missing interface information"));
163 free_interface_list();
173 @@ -1478,7 +1481,7 @@
175 fprintf(stderr, _("usage: netstat [-veenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
176 fprintf(stderr, _(" netstat [-vnNcaeol] [<Socket> ...]\n"));
177 - fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s }\n\n"));
178 + fprintf(stderr, _(" netstat { [-veenNac] -i | [-cnNe] -M | -s } [delay]\n\n"));
180 fprintf(stderr, _(" -r, --route display routing table\n"));
181 fprintf(stderr, _(" -i, --interfaces display interface table\n"));
182 @@ -1514,6 +1517,7 @@
183 (int argc, char *argv[]) {
187 struct option longopts[] =
190 @@ -1655,6 +1659,12 @@
194 + if(argc == optind + 1) {
195 + if((reptimer = atoi(argv[optind])) <= 0)
200 if (flag_int + flag_rou + flag_mas + flag_sta > 1)
203 @@ -1666,7 +1676,7 @@
205 flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
206 + flag_ax25 + flag_netrom + flag_igmp + flag_x25;
210 #if HAVE_FW_MASQUERADE && HAVE_AFINET
211 #if MORE_THAN_ONE_MASQ_AF
212 @@ -1678,7 +1688,7 @@
213 flag_not & FLAG_NUM_PORT, flag_exp);
220 ENOSUPP("netstat.c", "FW_MASQUERADE");
221 @@ -1688,9 +1698,15 @@
227 - parsesnmp(flag_raw, flag_tcp, flag_udp);
229 + i = parsesnmp(flag_raw, flag_tcp, flag_udp);
239 @@ -1712,7 +1728,7 @@
240 i = route_info(afname, options);
248 @@ -1721,7 +1737,7 @@
257 @@ -1847,7 +1863,7 @@
266 --- net-tools-1.60/statistics.c.cycle 2001-02-02 19:01:23.000000000 +0100
267 +++ net-tools-1.60/statistics.c 2003-02-11 14:29:29.000000000 +0100
272 -void parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
273 +int parsesnmp(int flag_raw, int flag_tcp, int flag_udp)
277 @@ -347,12 +347,14 @@
278 f = fopen("/proc/net/snmp", "r");
280 perror(_("cannot open /proc/net/snmp"));
288 perror("/proc/net/snmp");
294 @@ -361,12 +363,14 @@
299 - perror("/proc/net/netstat");
301 + perror("/proc/net/netstat");