1
Changes extracted from diff.gz, not present in upstream's CVS.
3
Index: net-tools/lib/ec_hw.c
4
===================================================================
5
--- net-tools.orig/lib/ec_hw.c
6
+++ net-tools/lib/ec_hw.c
13
#include <net/if_arp.h>
14
#include "net-support.h"
16
Index: net-tools/lib/fddi.c
17
===================================================================
18
--- net-tools.orig/lib/fddi.c
19
+++ net-tools/lib/fddi.c
21
#error "No FDDI Support in your current Kernelsource Tree."
22
#error "Disable HW Type FDDI"
24
+#include <linux/types.h>
26
#include <netinet/if_fddi.h>
28
Index: net-tools/lib/interface.c
29
===================================================================
30
--- net-tools.orig/lib/interface.c
31
+++ net-tools/lib/interface.c
32
@@ -594,7 +594,7 @@ int do_if_print(struct interface *ife, v
34
void ife_print_short(struct interface *ptr)
36
- printf("%-5.5s ", ptr->name);
37
+ printf("%-9s ", ptr->name);
38
printf("%5d %-2d ", ptr->mtu, ptr->metric);
39
/* If needed, display the interface statistics. */
40
if (ptr->statistics_valid) {
41
@@ -653,8 +653,7 @@ void ife_print_long(struct interface *pt
42
unsigned long long rx, tx, short_rx, short_tx;
43
const char *Rext = "B";
44
const char *Text = "B";
45
- static char flags[200];
49
static struct aftype *ipxtype = NULL;
51
@@ -686,70 +685,32 @@ void ife_print_long(struct interface *pt
55
- sprintf(flags, "flags=%d<", ptr->flags);
56
- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
57
- if (ptr->flags == 0)
59
- if (ptr->flags & IFF_UP)
60
- strcat(flags,_("UP,"));
61
- if (ptr->flags & IFF_BROADCAST)
62
- strcat(flags,_("BROADCAST,"));
63
- if (ptr->flags & IFF_DEBUG)
64
- strcat(flags,_("DEBUG,"));
65
- if (ptr->flags & IFF_LOOPBACK)
66
- strcat(flags,_("LOOPBACK,"));
67
- if (ptr->flags & IFF_POINTOPOINT)
68
- strcat(flags,_("POINTOPOINT,"));
69
- if (ptr->flags & IFF_NOTRAILERS)
70
- strcat(flags,_("NOTRAILERS,"));
71
- if (ptr->flags & IFF_RUNNING)
72
- strcat(flags,_("RUNNING,"));
73
- if (ptr->flags & IFF_NOARP)
74
- strcat(flags,_("NOARP,"));
75
- if (ptr->flags & IFF_PROMISC)
76
- strcat(flags,_("PROMISC,"));
77
- if (ptr->flags & IFF_ALLMULTI)
78
- strcat(flags,_("ALLMULTI,"));
79
- if (ptr->flags & IFF_SLAVE)
80
- strcat(flags,_("SLAVE,"));
81
- if (ptr->flags & IFF_MASTER)
82
- strcat(flags,_("MASTER,"));
83
- if (ptr->flags & IFF_MULTICAST)
84
- strcat(flags,_("MULTICAST,"));
86
- if (ptr->flags & IFF_DYNAMIC)
87
- strcat(flags,_("DYNAMIC,"));
89
- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
90
- if (flags[strlen(flags)-1] == ',')
91
- flags[strlen(flags)-1] = '>';
93
- flags[strlen(flags)-1] = 0;
96
- printf(_("%s: %s mtu %d metric %d"),
97
- ptr->name, flags, ptr->mtu, ptr->metric ? ptr->metric : 1);
98
-#ifdef SIOCSKEEPALIVE
99
- if (ptr->outfill || ptr->keepalive)
100
- printf(_(" outfill %d keepalive %d"),
101
- ptr->outfill, ptr->keepalive);
102
+ printf(_("%-9s Link encap:%s "), ptr->name, hw->title);
103
+ /* For some hardware types (eg Ash, ATM) we don't print the
104
+ hardware address if it's null. */
105
+ if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
106
+ hw->suppress_null_addr)))
107
+ printf(_("HWaddr %s "), hw->print(ptr->hwaddr));
109
+ if (ptr->flags & IFF_PORTSEL) {
110
+ printf(_("Media:%s"), if_port_text[ptr->map.port][0]);
111
+ if (ptr->flags & IFF_AUTOMEDIA)
112
+ printf(_("(auto)"));
121
- printf(_(" %s %s"), ap->name,
122
+ printf(_(" %s addr:%s "), ap->name,
123
ap->sprint(&ptr->addr, 1));
124
- printf(_(" netmask %s"), ap->sprint(&ptr->netmask, 1));
125
- if (ptr->flags & IFF_BROADCAST) {
126
- printf(_(" broadcast %s"), ap->sprint(&ptr->broadaddr, 1));
128
if (ptr->flags & IFF_POINTOPOINT) {
129
- printf(_(" destination %s"), ap->sprint(&ptr->dstaddr, 1));
130
+ printf(_(" P-t-P:%s "), ap->sprint(&ptr->dstaddr, 1));
133
+ if (ptr->flags & IFF_BROADCAST) {
134
+ printf(_(" Bcast:%s "), ap->sprint(&ptr->broadaddr, 1));
136
+ printf(_(" Mask:%s\n"), ap->sprint(&ptr->netmask, 1));
140
@@ -757,7 +718,7 @@ void ife_print_long(struct interface *pt
141
/* FIXME: should be integrated into interface.c. */
143
if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
144
- while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
145
+ while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
146
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
147
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
148
&if_idx, &plen, &scope, &dad_status, devname) != EOF) {
149
@@ -766,30 +727,29 @@ void ife_print_long(struct interface *pt
150
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
151
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
152
inet6_aftype.input(1, addr6, (struct sockaddr *) &sap);
153
- printf(_(" %s %s prefixlen %d"),
155
- inet6_aftype.sprint((struct sockaddr *) &sap, 1),
157
- printf(_(" scopeid 0x%x"), scope);
159
- flags[0] = '<'; flags[1] = 0;
160
- if (scope & IPV6_ADDR_COMPATv4) {
161
- strcat(flags, _("compat,"));
162
- scope -= IPV6_ADDR_COMPATv4;
163
+ printf(_(" inet6 addr: %s/%d"),
164
+ inet6_aftype.sprint((struct sockaddr *) &sap, 1), plen);
165
+ printf(_(" Scope:"));
168
+ printf(_("Global"));
170
+ case IPV6_ADDR_LINKLOCAL:
173
+ case IPV6_ADDR_SITELOCAL:
176
+ case IPV6_ADDR_COMPATv4:
177
+ printf(_("Compat"));
179
+ case IPV6_ADDR_LOOPBACK:
183
+ printf(_("Unknown"));
186
- strcat(flags, _("global,"));
187
- if (scope & IPV6_ADDR_LINKLOCAL)
188
- strcat(flags, _("link,"));
189
- if (scope & IPV6_ADDR_SITELOCAL)
190
- strcat(flags, _("site,"));
191
- if (scope & IPV6_ADDR_LOOPBACK)
192
- strcat(flags, _("host,"));
193
- if (flags[strlen(flags)-1] == ',')
194
- flags[strlen(flags)-1] = '>';
196
- flags[strlen(flags)-1] = 0;
197
- printf("%s\n", flags);
202
@@ -802,17 +762,17 @@ void ife_print_long(struct interface *pt
204
if (ipxtype != NULL) {
206
- printf(_(" %s Ethernet-II %s\n"),
207
- ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_bb, 1));
208
+ printf(_(" IPX/Ethernet II addr:%s\n"),
209
+ ipxtype->sprint(&ptr->ipxaddr_bb, 1));
211
- printf(_(" %s Ethernet-SNAP %s\n"),
212
- ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_sn, 1));
213
+ printf(_(" IPX/Ethernet SNAP addr:%s\n"),
214
+ ipxtype->sprint(&ptr->ipxaddr_sn, 1));
216
- printf(_(" %s Ethernet802.2 %s\n"),
217
- ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e2, 1));
218
+ printf(_(" IPX/Ethernet 802.2 addr:%s\n"),
219
+ ipxtype->sprint(&ptr->ipxaddr_e2, 1));
221
- printf(_(" %s Ethernet802.3 %s\n"),
222
- ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e3, 1));
223
+ printf(_(" IPX/Ethernet 802.3 addr:%s\n"),
224
+ ipxtype->sprint(&ptr->ipxaddr_e3, 1));
228
@@ -821,7 +781,7 @@ void ife_print_long(struct interface *pt
229
ddptype = get_afntype(AF_APPLETALK);
230
if (ddptype != NULL) {
232
- printf(_(" %s %s\n"), ddptype->name, ddptype->sprint(&ptr->ddpaddr, 1));
233
+ printf(_(" EtherTalk Phase 2 addr:%s\n"), ddptype->sprint(&ptr->ddpaddr, 1));
237
@@ -830,30 +790,53 @@ void ife_print_long(struct interface *pt
238
ectype = get_afntype(AF_ECONET);
239
if (ectype != NULL) {
241
- printf(_(" %s %s\n"), ectype->name, ectype->sprint(&ptr->ecaddr, 1));
242
+ printf(_(" econet addr:%s\n"), ectype->sprint(&ptr->ecaddr, 1));
246
- /* For some hardware types (eg Ash, ATM) we don't print the
247
- hardware address if it's null. */
248
- if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
249
- hw->suppress_null_addr)))
250
- printf(_(" %s %s"), hw->name, hw->print(ptr->hwaddr));
252
- printf(_(" %s"), hw->name);
253
- if (ptr->tx_queue_len != -1)
254
- printf(_(" txqueuelen %d"), ptr->tx_queue_len);
255
- printf(" (%s)\n", hw->title);
258
- if (ptr->flags & IFF_PORTSEL) {
259
- printf(_(" media %s"), if_port_text[ptr->map.port][0]);
260
- if (ptr->flags & IFF_AUTOMEDIA)
261
- printf(_("autoselect"));
265
+ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
266
+ if (ptr->flags == 0)
267
+ printf(_("[NO FLAGS] "));
268
+ if (ptr->flags & IFF_UP)
270
+ if (ptr->flags & IFF_BROADCAST)
271
+ printf(_("BROADCAST "));
272
+ if (ptr->flags & IFF_DEBUG)
273
+ printf(_("DEBUG "));
274
+ if (ptr->flags & IFF_LOOPBACK)
275
+ printf(_("LOOPBACK "));
276
+ if (ptr->flags & IFF_POINTOPOINT)
277
+ printf(_("POINTOPOINT "));
278
+ if (ptr->flags & IFF_NOTRAILERS)
279
+ printf(_("NOTRAILERS "));
280
+ if (ptr->flags & IFF_RUNNING)
281
+ printf(_("RUNNING "));
282
+ if (ptr->flags & IFF_NOARP)
283
+ printf(_("NOARP "));
284
+ if (ptr->flags & IFF_PROMISC)
285
+ printf(_("PROMISC "));
286
+ if (ptr->flags & IFF_ALLMULTI)
287
+ printf(_("ALLMULTI "));
288
+ if (ptr->flags & IFF_SLAVE)
289
+ printf(_("SLAVE "));
290
+ if (ptr->flags & IFF_MASTER)
291
+ printf(_("MASTER "));
292
+ if (ptr->flags & IFF_MULTICAST)
293
+ printf(_("MULTICAST "));
295
+ if (ptr->flags & IFF_DYNAMIC)
296
+ printf(_("DYNAMIC "));
299
+ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
300
+ printf(_(" MTU:%d Metric:%d"),
301
+ ptr->mtu, ptr->metric ? ptr->metric : 1);
302
+#ifdef SIOCSKEEPALIVE
303
+ if (ptr->outfill || ptr->keepalive)
304
+ printf(_(" Outfill:%d Keepalive:%d"),
305
+ ptr->outfill, ptr->keepalive);
309
/* If needed, display the interface statistics. */
311
@@ -862,8 +845,19 @@ void ife_print_long(struct interface *pt
312
* not for the aliases, although strictly speaking they're shared
317
+ printf(_("RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"),
318
+ ptr->stats.rx_packets, ptr->stats.rx_errors,
319
+ ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors,
320
+ ptr->stats.rx_frame_errors);
322
+ printf(_(" compressed:%lu\n"), ptr->stats.rx_compressed);
324
rx = ptr->stats.rx_bytes;
325
+ tx = ptr->stats.tx_bytes;
327
+ short_tx = tx * 10;
328
if (rx > 1125899906842624ull) {
329
short_rx /= 1125899906842624ull;
331
@@ -880,8 +874,6 @@ void ife_print_long(struct interface *pt
335
- tx = ptr->stats.tx_bytes;
336
- short_tx = tx * 10;
337
if (tx > 1125899906842624ull) {
338
short_tx /= 1125899906842624ull;
340
@@ -899,50 +891,37 @@ void ife_print_long(struct interface *pt
345
- printf(_("RX packets %llu bytes %llu (%lu.%lu %s)\n"),
346
- ptr->stats.rx_packets,
347
- rx, (unsigned long)(short_rx / 10),
348
- (unsigned long)(short_rx % 10), Rext);
349
- if (can_compress) {
351
- printf(_("RX compressed:%lu\n"), ptr->stats.rx_compressed);
354
- printf(_("RX errors %lu dropped %lu overruns %lu frame %lu\n"),
355
- ptr->stats.rx_errors, ptr->stats.rx_dropped,
356
- ptr->stats.rx_fifo_errors, ptr->stats.rx_frame_errors);
360
- printf(_("TX packets %llu bytes %llu (%lu.%lu %s)\n"),
361
- ptr->stats.tx_packets,
362
- tx, (unsigned long)(short_tx / 10),
363
- (unsigned long)(short_tx % 10), Text);
364
- if (can_compress) {
366
- printf(_("TX compressed %lu\n"), ptr->stats.tx_compressed);
369
- printf(_("TX errors %lu dropped %lu overruns %lu carrier %lu collisions %lu\n"),
370
- ptr->stats.tx_errors,
372
+ printf(_("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"),
373
+ ptr->stats.tx_packets, ptr->stats.tx_errors,
374
ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors,
375
- ptr->stats.tx_carrier_errors, ptr->stats.collisions);
376
+ ptr->stats.tx_carrier_errors);
377
+ printf(_(" collisions:%lu "), ptr->stats.collisions);
379
+ printf(_("compressed:%lu "), ptr->stats.tx_compressed);
380
+ if (ptr->tx_queue_len != -1)
381
+ printf(_("txqueuelen:%d "), ptr->tx_queue_len);
383
+ printf(_("RX bytes:%llu (%lu.%lu %s) TX bytes:%llu (%lu.%lu %s)\n"),
384
+ rx, (unsigned long)(short_rx / 10),
385
+ (unsigned long)(short_rx % 10), Rext,
386
+ tx, (unsigned long)(short_tx / 10),
387
+ (unsigned long)(short_tx % 10), Text);
390
if ((ptr->map.irq || ptr->map.mem_start || ptr->map.dma ||
391
ptr->map.base_addr >= 0x100)) {
392
- printf(" device ");
395
- printf(_("interrupt %d "), ptr->map.irq);
396
+ printf(_("Interrupt:%d "), ptr->map.irq);
397
if (ptr->map.base_addr >= 0x100) /* Only print devices using it for
399
- printf(_("base 0x%x "), ptr->map.base_addr);
400
+ printf(_("Base address:0x%x "), ptr->map.base_addr);
401
if (ptr->map.mem_start) {
402
- printf(_("memory 0x%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end);
403
+ printf(_("Memory:%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end);
406
- printf(_(" dma 0x%x"), ptr->map.dma);
407
+ printf(_("DMA chan:%x "), ptr->map.dma);