Commit a1de6479 authored by Jiri Popelka's avatar Jiri Popelka

Removed SET and GET of interface metrics

https://sourceforge.net/mailarchive/message.php?msg_id=28701120
parent 5fac0371
...@@ -104,7 +104,7 @@ static int if_print(char *ifname) ...@@ -104,7 +104,7 @@ static int if_print(char *ifname)
int res; int res;
if (ife_short) if (ife_short)
printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n")); printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
if (!ifname) { if (!ifname) {
res = for_all_interfaces(do_if_print, &opt_a); res = for_all_interfaces(do_if_print, &opt_a);
...@@ -212,7 +212,7 @@ static void usage(void) ...@@ -212,7 +212,7 @@ static void usage(void)
#ifdef SIOCSKEEPALIVE #ifdef SIOCSKEEPALIVE
fprintf(stderr, _(" [outfill <NN>] [keepalive <NN>]\n")); fprintf(stderr, _(" [outfill <NN>] [keepalive <NN>]\n"));
#endif #endif
fprintf(stderr, _(" [hw <HW> <address>] [metric <NN>] [mtu <NN>]\n")); fprintf(stderr, _(" [hw <HW> <address>] [mtu <NN>]\n"));
fprintf(stderr, _(" [[-]trailers] [[-]arp] [[-]allmulti]\n")); fprintf(stderr, _(" [[-]trailers] [[-]arp] [[-]allmulti]\n"));
fprintf(stderr, _(" [multicast] [[-]promisc]\n")); fprintf(stderr, _(" [multicast] [[-]promisc]\n"));
fprintf(stderr, _(" [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n")); fprintf(stderr, _(" [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]\n"));
...@@ -471,17 +471,6 @@ int main(int argc, char **argv) ...@@ -471,17 +471,6 @@ int main(int argc, char **argv)
} }
#endif #endif
if (!strcmp(*spp, "metric")) {
if (*++spp == NULL)
usage();
ifr.ifr_metric = atoi(*spp);
if (ioctl(skfd, SIOCSIFMETRIC, &ifr) < 0) {
fprintf(stderr, "SIOCSIFMETRIC: %s\n", strerror(errno));
goterr = 1;
}
spp++;
continue;
}
if (!strcmp(*spp, "mtu")) { if (!strcmp(*spp, "mtu")) {
if (*++spp == NULL) if (*++spp == NULL)
usage(); usage();
......
...@@ -32,7 +32,6 @@ struct interface { ...@@ -32,7 +32,6 @@ struct interface {
char name[IFNAMSIZ]; /* interface name */ char name[IFNAMSIZ]; /* interface name */
short type; /* if type */ short type; /* if type */
short flags; /* various flags */ short flags; /* various flags */
int metric; /* routing metric */
int mtu; /* MTU value */ int mtu; /* MTU value */
int tx_queue_len; /* transmit queue length */ int tx_queue_len; /* transmit queue length */
struct ifmap map; /* hardware setup */ struct ifmap map; /* hardware setup */
......
...@@ -427,12 +427,6 @@ int if_fetch(struct interface *ife) ...@@ -427,12 +427,6 @@ int if_fetch(struct interface *ife)
ife->type = ifr.ifr_hwaddr.sa_family; ife->type = ifr.ifr_hwaddr.sa_family;
strcpy(ifr.ifr_name, ifname);
if (ioctl(skfd, SIOCGIFMETRIC, &ifr) < 0)
ife->metric = 0;
else
ife->metric = ifr.ifr_metric;
strcpy(ifr.ifr_name, ifname); strcpy(ifr.ifr_name, ifname);
if (ioctl(skfd, SIOCGIFMTU, &ifr) < 0) if (ioctl(skfd, SIOCGIFMTU, &ifr) < 0)
ife->mtu = 0; ife->mtu = 0;
...@@ -599,8 +593,8 @@ int do_if_print(struct interface *ife, void *cookie) ...@@ -599,8 +593,8 @@ int do_if_print(struct interface *ife, void *cookie)
void ife_print_short(struct interface *ptr) void ife_print_short(struct interface *ptr)
{ {
printf("%-5.5s ", ptr->name); printf("%-8.8s ", ptr->name);
printf("%5d %-2d ", ptr->mtu, ptr->metric); printf("%5d ", ptr->mtu);
/* If needed, display the interface statistics. */ /* If needed, display the interface statistics. */
if (ptr->statistics_valid) { if (ptr->statistics_valid) {
printf("%8llu %6lu %6lu %-6lu ", printf("%8llu %6lu %6lu %-6lu ",
...@@ -734,8 +728,8 @@ void ife_print_long(struct interface *ptr) ...@@ -734,8 +728,8 @@ void ife_print_long(struct interface *ptr)
flags[strlen(flags)-1] = 0; flags[strlen(flags)-1] = 0;
printf(_("%s: %s mtu %d metric %d"), printf(_("%s: %s mtu %d"),
ptr->name, flags, ptr->mtu, ptr->metric ? ptr->metric : 1); ptr->name, flags, ptr->mtu);
#ifdef SIOCSKEEPALIVE #ifdef SIOCSKEEPALIVE
if (ptr->outfill || ptr->keepalive) if (ptr->outfill || ptr->keepalive)
printf(_(" outfill %d keepalive %d"), printf(_(" outfill %d keepalive %d"),
......
...@@ -73,9 +73,6 @@ Modus. Ist er eingeschaltet, so werden alle Multicastpakete vom Netzwerk ...@@ -73,9 +73,6 @@ Modus. Ist er eingeschaltet, so werden alle Multicastpakete vom Netzwerk
empfangen unabh\(:angig davon, ob sie an die Schnittstelle adressiert sind empfangen unabh\(:angig davon, ob sie an die Schnittstelle adressiert sind
oder nicht. oder nicht.
.TP .TP
.B "metric N"
Dieses Argument setzt den Metrik-Wert f\(:ur die Schnittstelle auf N.
.TP
.B "mtu N" .B "mtu N"
Dieses Argument setzt die Maximum Transfer Unit (MTU) der Schnittstelle, Dieses Argument setzt die Maximum Transfer Unit (MTU) der Schnittstelle,
das ist das gr\(:o\(sste Paket, dass gesendet werden kann. das ist das gr\(:o\(sste Paket, dass gesendet werden kann.
......
...@@ -90,9 +90,6 @@ Enable or disable ...@@ -90,9 +90,6 @@ Enable or disable
mode. If selected, all multicast packets on the network will be mode. If selected, all multicast packets on the network will be
received by the interface. received by the interface.
.TP .TP
.B "metric N"
This parameter sets the interface metric.
.TP
.B "mtu N" .B "mtu N"
This parameter sets the Maximum Transfer Unit (MTU) of an interface. This parameter sets the Maximum Transfer Unit (MTU) of an interface.
.TP .TP
......
...@@ -70,10 +70,6 @@ Valide ou invalide le fonctionnement de l'interface en mode ...@@ -70,10 +70,6 @@ Valide ou invalide le fonctionnement de l'interface en mode
S'il est validé, tous les paquets multicast circulant sur le réseau S'il est validé, tous les paquets multicast circulant sur le réseau
seront reçus sur cette interface. seront reçus sur cette interface.
.TP .TP
.B "metric N"
Ce paramètre définit la métrique de l'interface. Il n'est pour
l'instant pas implémenté, mais le sera prochainement.
.TP
.B "mtu N" .B "mtu N"
Ce paramètre définit le MTU (Maximum Transfer Unit) d'une Ce paramètre définit le MTU (Maximum Transfer Unit) d'une
interface. interface.
......
...@@ -69,10 +69,6 @@ Habilita ou desabilita o modo ...@@ -69,10 +69,6 @@ Habilita ou desabilita o modo
da interface. Isto significa que todos os frames passarão pela camada da interface. Isto significa que todos os frames passarão pela camada
de rede do kernel, permitindo monitoração da rede. de rede do kernel, permitindo monitoração da rede.
.TP .TP
.B "metric N"
Este parâmetro configura a métrica da interface. Não é usado atualmente,
mas será implementado no futuro.
.TP
.B "mtu N" .B "mtu N"
Este parâmetro configura a Unidade Máxima de Transferência (MTU) de uma Este parâmetro configura a Unidade Máxima de Transferência (MTU) de uma
interface. Para Ethernet é um número entre 1000-2000 (o padrão é interface. Para Ethernet é um número entre 1000-2000 (o padrão é
......
...@@ -1794,7 +1794,7 @@ static int iface_info(void) ...@@ -1794,7 +1794,7 @@ static int iface_info(void)
} }
if (flag_exp < 2) { if (flag_exp < 2) {
ife_short = 1; ife_short = 1;
printf(_("Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n")); printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
} }
if (for_all_interfaces(do_if_print, &flag_all) < 0) { if (for_all_interfaces(do_if_print, &flag_all) < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment