Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
a1de6479
Commit
a1de6479
authored
Jan 20, 2012
by
Jiri Popelka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed SET and GET of interface metrics
https://sourceforge.net/mailarchive/message.php?msg_id=28701120
parent
5fac0371
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
7 additions
and
39 deletions
+7
-39
ifconfig.c
ifconfig.c
+2
-13
include/interface.h
include/interface.h
+0
-1
lib/interface.c
lib/interface.c
+4
-10
man/de_DE/ifconfig.8
man/de_DE/ifconfig.8
+0
-3
man/en_US/ifconfig.8
man/en_US/ifconfig.8
+0
-3
man/fr_FR/ifconfig.8
man/fr_FR/ifconfig.8
+0
-4
man/pt_BR/ifconfig.8
man/pt_BR/ifconfig.8
+0
-4
netstat.c
netstat.c
+1
-1
No files found.
ifconfig.c
View file @
a1de6479
...
...
@@ -104,7 +104,7 @@ static int if_print(char *ifname)
int
res
;
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
)
{
res
=
for_all_interfaces
(
do_if_print
,
&
opt_a
);
...
...
@@ -212,7 +212,7 @@ static void usage(void)
#ifdef SIOCSKEEPALIVE
fprintf
(
stderr
,
_
(
" [outfill <NN>] [keepalive <NN>]
\n
"
));
#endif
fprintf
(
stderr
,
_
(
" [hw <HW> <address>] [m
etric <NN>] [m
tu <NN>]
\n
"
));
fprintf
(
stderr
,
_
(
" [hw <HW> <address>] [mtu <NN>]
\n
"
));
fprintf
(
stderr
,
_
(
" [[-]trailers] [[-]arp] [[-]allmulti]
\n
"
));
fprintf
(
stderr
,
_
(
" [multicast] [[-]promisc]
\n
"
));
fprintf
(
stderr
,
_
(
" [mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]
\n
"
));
...
...
@@ -471,17 +471,6 @@ int main(int argc, char **argv)
}
#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
(
*++
spp
==
NULL
)
usage
();
...
...
include/interface.h
View file @
a1de6479
...
...
@@ -32,7 +32,6 @@ struct interface {
char
name
[
IFNAMSIZ
];
/* interface name */
short
type
;
/* if type */
short
flags
;
/* various flags */
int
metric
;
/* routing metric */
int
mtu
;
/* MTU value */
int
tx_queue_len
;
/* transmit queue length */
struct
ifmap
map
;
/* hardware setup */
...
...
lib/interface.c
View file @
a1de6479
...
...
@@ -427,12 +427,6 @@ int if_fetch(struct interface *ife)
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
);
if
(
ioctl
(
skfd
,
SIOCGIFMTU
,
&
ifr
)
<
0
)
ife
->
mtu
=
0
;
...
...
@@ -599,8 +593,8 @@ int do_if_print(struct interface *ife, void *cookie)
void
ife_print_short
(
struct
interface
*
ptr
)
{
printf
(
"%-
5.5
s "
,
ptr
->
name
);
printf
(
"%5d
%-2d "
,
ptr
->
mtu
,
ptr
->
metric
);
printf
(
"%-
8.8
s "
,
ptr
->
name
);
printf
(
"%5d
"
,
ptr
->
mtu
);
/* If needed, display the interface statistics. */
if
(
ptr
->
statistics_valid
)
{
printf
(
"%8llu %6lu %6lu %-6lu "
,
...
...
@@ -734,8 +728,8 @@ void ife_print_long(struct interface *ptr)
flags
[
strlen
(
flags
)
-
1
]
=
0
;
printf
(
_
(
"%s: %s mtu %d
metric %d
"
),
ptr
->
name
,
flags
,
ptr
->
mtu
,
ptr
->
metric
?
ptr
->
metric
:
1
);
printf
(
_
(
"%s: %s mtu %d"
),
ptr
->
name
,
flags
,
ptr
->
mtu
);
#ifdef SIOCSKEEPALIVE
if
(
ptr
->
outfill
||
ptr
->
keepalive
)
printf
(
_
(
" outfill %d keepalive %d"
),
...
...
man/de_DE/ifconfig.8
View file @
a1de6479
...
...
@@ -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
oder nicht.
.TP
.B "metric N"
Dieses Argument setzt den Metrik-Wert f\(:ur die Schnittstelle auf N.
.TP
.B "mtu N"
Dieses Argument setzt die Maximum Transfer Unit (MTU) der Schnittstelle,
das ist das gr\(:o\(sste Paket, dass gesendet werden kann.
...
...
man/en_US/ifconfig.8
View file @
a1de6479
...
...
@@ -90,9 +90,6 @@ Enable or disable
mode
.
If
selected
,
all
multicast
packets
on
the
network
will
be
received
by
the
interface
.
.
TP
.
B
"metric N"
This
parameter
sets
the
interface
metric
.
.
TP
.
B
"mtu N"
This
parameter
sets
the
Maximum
Transfer
Unit
(
MTU
)
of
an
interface
.
.
TP
...
...
man/fr_FR/ifconfig.8
View file @
a1de6479
...
...
@@ -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
seront reçus sur cette interface.
.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"
Ce paramètre définit le MTU (Maximum Transfer Unit) d'une
interface.
...
...
man/pt_BR/ifconfig.8
View file @
a1de6479
...
...
@@ -69,10 +69,6 @@ Habilita ou desabilita o modo
da interface. Isto significa que todos os frames passarão pela camada
de rede do kernel, permitindo monitoração da rede.
.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"
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 é
...
...
netstat.c
View file @
a1de6479
...
...
@@ -1794,7 +1794,7 @@ static int iface_info(void)
}
if
(
flag_exp
<
2
)
{
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment