aboutsummaryrefslogtreecommitdiffstats
path: root/man7/netdevice.7
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2007-04-12 22:42:49 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2007-04-12 22:42:49 +0000
commitc13182efa3b3d77f2563034c8212c0ca798243ca (patch)
treee7652b26018b7c22cd6a4e4b41404dfaab911303 /man7/netdevice.7
parent4174ff5658082832c2ed511720f18881b3a80a34 (diff)
downloadman-pages-c13182efa3b3d77f2563034c8212c0ca798243ca.tar.gz
Wrapped long lines, wrapped at sentence boundaries; stripped trailing
white space.
Diffstat (limited to 'man7/netdevice.7')
-rw-r--r--man7/netdevice.7105
1 files changed, 57 insertions, 48 deletions
diff --git a/man7/netdevice.7 b/man7/netdevice.7
index b3ab1d9dc0..2b6885174b 100644
--- a/man7/netdevice.7
+++ b/man7/netdevice.7
@@ -9,7 +9,7 @@
.\"
.\" Modified, 2004-11-25, mtk, formatting and a few wording fixes
.\"
-.TH NETDEVICE 7 1999-05-02 "Linux Man Page" "Linux Programmer's Manual"
+.TH NETDEVICE 7 1999-05-02 "Linux Man Page" "Linux Programmer's Manual"
.SH NAME
netdevice \- Low level access to Linux network devices
.SH SYNOPSIS
@@ -20,11 +20,11 @@ netdevice \- Low level access to Linux network devices
This man page describes the sockets interface which is used to configure
network devices.
-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.
-They pass an
-.B ifreq
+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.
+They pass an
+.B ifreq
structure:
.nf
@@ -47,24 +47,26 @@ struct ifreq {
};
};
-struct ifconf {
+struct ifconf {
int ifc_len; /* size of buffer */
- union {
- char * ifc_buf; /* buffer address */
+ union {
+ char * ifc_buf; /* buffer address */
struct ifreq * ifc_req; /* array of structures */
- };
-};
+ };
+};
.fi
Normally, the user specifies which device to affect by setting
.B ifr_name
-to the name of the interface. All other members of the structure may
-share memory.
+to the name of the interface.
+All other members of the structure may
+share memory.
.SH IOCTLS
If an ioctl is marked as privileged then using it requires an effective
user ID of 0 or the
.B CAP_NET_ADMIN
-capability. If this is not the case
+capability.
+If this is not the case
.B EPERM
will be returned.
.TP
@@ -107,7 +109,7 @@ IFF_AUTOMEDIA:Auto media selection active.
IFF_DYNAMIC:T{
The addresses are lost when the interface goes down.
T}
-.TE
+.TE
Setting the active flag word is a privileged operation, but any
process may read it.
.TP
@@ -123,7 +125,8 @@ if you attempt to set it.
.BR SIOCGIFMTU ", " SIOCSIFMTU
Get or set the MTU (Maximum Transfer Unit) of a device using
.BR ifr_mtu .
-Setting the MTU is a privileged operation. Setting the MTU to
+Setting the MTU is a privileged operation.
+Setting the MTU to
too small values may cause kernel crashes.
.TP
.BR SIOCGIFHWADDR ", " SIOCSIFHWADDR
@@ -131,10 +134,10 @@ Get or set the hardware address of a device using
.BR ifr_hwaddr .
The hardware address is specified in a struct
.IR sockaddr .
-.I sa_family
-contains the ARPHRD_* device type,
+.I sa_family
+contains the ARPHRD_* device type,
.I sa_data
-the L2 hardware address starting from byte 0.
+the L2 hardware address starting from byte 0.
Setting the hardware address is a privileged operation.
.TP
.B SIOCSIFHWBROADCAST
@@ -151,10 +154,10 @@ Setting the parameters is a privileged operation.
struct ifmap {
unsigned long mem_start;
unsigned long mem_end;
- unsigned short base_addr;
- unsigned char irq;
- unsigned char dma;
- unsigned char port;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
};
.fi
@@ -176,38 +179,42 @@ Get or set the transmit queue length of a device using
Setting the transmit queue length is a privileged operation.
.TP
.B SIOCSIFNAME
-Changes the name of the interface specified in
+Changes the name of the interface specified in
.BR ifr_name
to
.BR ifr_newname .
-This is a privileged operation. It is only allowed when the interface
+This is a privileged operation.
+It is only allowed when the interface
is not up.
.TP
.B SIOCGIFCONF
-Return a list of interface (transport layer) addresses. This currently
-means only addresses of the AF_INET (IPv4) family for compatibility.
-The user passes a
+Return a list of interface (transport layer) addresses.
+This currently
+means only addresses of the AF_INET (IPv4) family for compatibility.
+The user passes a
.B ifconf
-structure as argument to the ioctl. It contains a pointer to an array of
+structure as argument to the ioctl.
+It contains a pointer to an array of
.I ifreq
-structures in
+structures in
.B ifc_req
-and its length in bytes in
+and its length in bytes in
.BR ifc_len .
The kernel fills the ifreqs with all current L3 interface addresses that
-are running:
-.I ifr_name
-contains the interface name (eth0:1 etc.),
+are running:
+.I ifr_name
+contains the interface name (eth0:1 etc.),
.I ifr_addr
the address.
-The kernel returns with the actual length in
+The kernel returns with the actual length in
.IR ifc_len .
-If
+If
.I ifc_len
is equal to the original length the buffer probably has overflowed
and you should retry with a bigger buffer to get all addresses.
When no error occurs the ioctl returns 0;
-otherwise \-1. Overflow is not an error.
+otherwise \-1.
+Overflow is not an error.
.\" FIXME Slaving isn't supported in 2.2
.\" .
.\" .TP
@@ -218,30 +225,32 @@ otherwise \-1. Overflow is not an error.
.\" .PP
.\" FIXME add amateur radio stuff.
.PP
-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
+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
-In addition some devices support private ioctls.
+In addition some devices support private ioctls.
These are not described here.
.SH NOTES
Strictly speaking,
-.B SIOCGIFCONF
-is IP specific and belongs in
+.B SIOCGIFCONF
+is IP specific and belongs in
.BR ip (7).
.LP
The names of interfaces with no addresses or that don't have the
-.B IFF_RUNNING
+.B IFF_RUNNING
flag set can be found via
.IR /proc/net/dev .
.LP
-Local IPv6 IP addresses can be found via /proc/net or via
+Local IPv6 IP addresses can be found via /proc/net or via
.BR rtnetlink (7).
.SH BUGS
-glibc 2.1 is missing the
-.I ifr_newname
-macro in net/if.h. Add the following to your program as a workaround:
+glibc 2.1 is missing the
+.I ifr_newname
+macro in net/if.h.
+Add the following to your program as a workaround:
.sp
.RS
.nf