summaryrefslogtreecommitdiffstats
path: root/man7/netdevice.7
diff options
context:
space:
mode:
Diffstat (limited to 'man7/netdevice.7')
-rw-r--r--man7/netdevice.782
1 files changed, 55 insertions, 27 deletions
diff --git a/man7/netdevice.7 b/man7/netdevice.7
index a0f0049..9f9f002 100644
--- a/man7/netdevice.7
+++ b/man7/netdevice.7
@@ -10,7 +10,7 @@
.\" Modified, 2011-11-02, <bidulock@openss7.org>, added many basic
.\" but missing ioctls, such as SIOCGIFADDR.
.\"
-.TH netdevice 7 2023-07-15 "Linux man-pages 6.05.01"
+.TH netdevice 7 2023-10-31 "Linux man-pages 6.7"
.SH NAME
netdevice \- low-level access to Linux network devices
.SH SYNOPSIS
@@ -21,14 +21,14 @@ netdevice \- low-level access to Linux network devices
.SH DESCRIPTION
This man page describes the sockets interface which is used to configure
network devices.
-.PP
+.P
Linux supports some standard ioctls to configure network devices.
They can be used on any socket's file descriptor regardless of the
family or type.
Most of them pass an
.I ifreq
structure:
-.PP
+.P
.in +4n
.EX
struct ifreq {
@@ -51,13 +51,13 @@ struct ifreq {
};
.EE
.in
-.PP
+.P
.B AF_INET6
is an exception.
It passes an
.I in6_ifreq
structure:
-.PP
+.P
.in +4n
.EX
struct in6_ifreq {
@@ -67,7 +67,7 @@ struct in6_ifreq {
};
.EE
.in
-.PP
+.P
Normally, the user specifies which device to affect by setting
.I ifr_name
to the name of the interface or
@@ -96,7 +96,9 @@ This is the only ioctl which returns its result in
Retrieve the interface index of the interface into
.IR ifr_ifindex .
.TP
-.BR SIOCGIFFLAGS ", " SIOCSIFFLAGS
+.B SIOCGIFFLAGS
+.TQ
+.B SIOCSIFFLAGS
Get or set the active flag word of the device.
.I ifr_flags
contains a bit mask of the following values:
@@ -132,11 +134,13 @@ IFF_DORMANT:Driver signals dormant (since Linux 2.6.17)
IFF_ECHO:Echo sent packets (since Linux 2.6.25)
.TE
.ad
-.PP
+.P
Setting the active flag word is a privileged operation, but any
process may read it.
.TP
-.BR SIOCGIFPFLAGS ", " SIOCSIFPFLAGS
+.B SIOCGIFPFLAGS
+.TQ
+.B SIOCSIFPFLAGS
Get or set extended (private) flags for the device.
.I ifr_flags
contains a bit mask of the following values:
@@ -154,10 +158,14 @@ IFF_BONDING:Interface is a bonding master or slave.
IFF_SLAVE_NEEDARP:Interface needs ARPs for validation.
IFF_ISATAP:Interface is RFC4214 ISATAP interface.
.TE
-.PP
+.P
Setting the extended (private) interface flags is a privileged operation.
.TP
-.BR SIOCGIFADDR ", " SIOCSIFADDR ", " SIOCDIFADDR
+.B SIOCGIFADDR
+.TQ
+.B SIOCSIFADDR
+.TQ
+.B SIOCDIFADDR
Get, set, or delete the address of the device using
.IR ifr_addr ,
or
@@ -185,7 +193,9 @@ A
address can be deleted by setting it to zero via
.BR SIOCSIFADDR .
.TP
-.BR SIOCGIFDSTADDR ", " SIOCSIFDSTADDR
+.B SIOCGIFDSTADDR
+.TQ
+.B SIOCSIFDSTADDR
Get or set the destination address of a point-to-point device using
.IR ifr_dstaddr .
For compatibility, only
@@ -193,7 +203,9 @@ For compatibility, only
addresses are accepted or returned.
Setting the destination address is a privileged operation.
.TP
-.BR SIOCGIFBRDADDR ", " SIOCSIFBRDADDR
+.B SIOCGIFBRDADDR
+.TQ
+.B SIOCSIFBRDADDR
Get or set the broadcast address for a device using
.IR ifr_brdaddr .
For compatibility, only
@@ -201,7 +213,9 @@ For compatibility, only
addresses are accepted or returned.
Setting the broadcast address is a privileged operation.
.TP
-.BR SIOCGIFNETMASK ", " SIOCSIFNETMASK
+.B SIOCGIFNETMASK
+.TQ
+.B SIOCSIFNETMASK
Get or set the network mask for a device using
.IR ifr_netmask .
For compatibility, only
@@ -209,7 +223,9 @@ For compatibility, only
addresses are accepted or returned.
Setting the network mask is a privileged operation.
.TP
-.BR SIOCGIFMETRIC ", " SIOCSIFMETRIC
+.B SIOCGIFMETRIC
+.TQ
+.B SIOCSIFMETRIC
Get or set the metric of the device using
.IR ifr_metric .
This is currently not implemented; it sets
@@ -218,14 +234,18 @@ to 0 if you attempt to read it and returns
.B EOPNOTSUPP
if you attempt to set it.
.TP
-.BR SIOCGIFMTU ", " SIOCSIFMTU
+.B SIOCGIFMTU
+.TQ
+.B SIOCSIFMTU
Get or set the MTU (Maximum Transfer Unit) of a device using
.IR ifr_mtu .
Setting the MTU is a privileged operation.
Setting the MTU to
too small values may cause kernel crashes.
.TP
-.BR SIOCGIFHWADDR ", " SIOCSIFHWADDR
+.B SIOCGIFHWADDR
+.TQ
+.B SIOCSIFHWADDR
Get or set the hardware address of a device using
.IR ifr_hwaddr .
The hardware address is specified in a struct
@@ -241,7 +261,9 @@ Set the hardware broadcast address of a device from
.IR ifr_hwaddr .
This is a privileged operation.
.TP
-.BR SIOCGIFMAP ", " SIOCSIFMAP
+.B SIOCGIFMAP
+.TQ
+.B SIOCSIFMAP
Get or set the interface's hardware parameters using
.IR ifr_map .
Setting the parameters is a privileged operation.
@@ -262,7 +284,9 @@ struct ifmap {
The interpretation of the ifmap structure depends on the device driver
and the architecture.
.TP
-.BR SIOCADDMULTI ", " SIOCDELMULTI
+.B SIOCADDMULTI
+.TQ
+.B SIOCDELMULTI
Add an address to or delete an address from the device's link layer
multicast filters using
.IR ifr_hwaddr .
@@ -271,7 +295,9 @@ See also
.BR packet (7)
for an alternative.
.TP
-.BR SIOCGIFTXQLEN ", " SIOCSIFTXQLEN
+.B SIOCGIFTXQLEN
+.TQ
+.B SIOCSIFTXQLEN
Get or set the transmit queue length of a device using
.IR ifr_qlen .
Setting the transmit queue length is a privileged operation.
@@ -357,19 +383,21 @@ will be returned.
.\" Slaving isn't supported in Linux 2.2
.\" .
.\" .TP
-.\" .BR SIOCGIFSLAVE ", " SIOCSIFSLAVE
+.\" .B SIOCGIFSLAVE
+.\" .TQ
+.\" .B SIOCSIFSLAVE
.\" Get or set the slave device using
.\" .IR ifr_slave .
.\" Setting the slave device is a privileged operation.
-.\" .PP
+.\" .P
.\" FIXME . add amateur radio stuff.
-.PP
+.P
Most protocols support their own ioctls to configure protocol-specific
interface options.
See the protocol man pages for a description.
For configuring IP addresses, see
.BR ip (7).
-.PP
+.P
In addition, some devices support private ioctls.
These are not described here.
.SH NOTES
@@ -379,12 +407,12 @@ and the other ioctls that accept or return only
socket addresses
are IP-specific and perhaps should rather be documented in
.BR ip (7).
-.PP
+.P
The names of interfaces with no addresses or that don't have the
.B IFF_RUNNING
flag set can be found via
.IR /proc/net/dev .
-.PP
+.P
.B AF_INET6
IPv6 addresses can be read from
.I /proc/net/if_inet6
@@ -406,7 +434,7 @@ glibc 2.1 is missing the
macro in
.IR <net/if.h> .
Add the following to your program as a workaround:
-.PP
+.P
.in +4n
.EX
#ifndef ifr_newname