formatting and a few wording fixes

This commit is contained in:
Michael Kerrisk 2004-11-25 08:11:36 +00:00
parent 3b85198195
commit bab7e1c781
1 changed files with 34 additions and 37 deletions

View File

@ -6,6 +6,9 @@
.\" and in case of nontrivial modification author and date
.\" of the modification is added to the header.
.\" $Id: netdevice.7,v 1.10 2000/08/17 10:09:54 ak Exp $
.\"
.\" Modified, 2004-11-25, mtk, formatting and a few wording fixes
.\"
.TH NETDEVICE 7 1999-05-02 "Linux Man Page" "Linux Programmer's Manual"
.SH NAME
netdevice \- Low level access to Linux network devices
@ -24,34 +27,32 @@ They pass an
structure:
.nf
.ta 4 12 20
struct ifreq {
char ifr_name[IFNAMSIZ]; /* Interface name */
union {
struct sockaddr ifr_addr;
struct sockaddr ifr_dstaddr;
struct sockaddr ifr_broadaddr;
struct sockaddr ifr_netmask;
struct sockaddr ifr_hwaddr;
short ifr_flags;
int ifr_ifindex;
int ifr_metric;
int ifr_mtu;
struct ifmap ifr_map;
char ifr_slave[IFNAMSIZ];
char ifr_newname[IFNAMSIZ];
char * ifr_data;
};
char ifr_name[IFNAMSIZ]; /* Interface name */
union {
struct sockaddr ifr_addr;
struct sockaddr ifr_dstaddr;
struct sockaddr ifr_broadaddr;
struct sockaddr ifr_netmask;
struct sockaddr ifr_hwaddr;
short ifr_flags;
int ifr_ifindex;
int ifr_metric;
int ifr_mtu;
struct ifmap ifr_map;
char ifr_slave[IFNAMSIZ];
char ifr_newname[IFNAMSIZ];
char * ifr_data;
};
};
struct ifconf {
int ifc_len; /* size of buffer */
union {
char * ifc_buf; /* buffer address */
struct ifreq *ifc_req; /* array of structures */
};
};
.ta
int ifc_len; /* size of buffer */
union {
char * ifc_buf; /* buffer address */
struct ifreq * ifc_req; /* array of structures */
};
};
.fi
Normally, the user specifies which device to affect by setting
@ -152,17 +153,15 @@ Get or set the interface's hardware parameters using
Setting the parameters is a privileged operation.
.nf
.ta 4 20 42
struct ifmap
{
unsigned long mem_start;
unsigned long mem_end;
unsigned short base_addr;
unsigned char irq;
unsigned char dma;
unsigned char port;
unsigned long mem_start;
unsigned long mem_end;
unsigned short base_addr;
unsigned char irq;
unsigned char dma;
unsigned char port;
};
.ta
.fi
The interpretation of the ifmap structure depends on the device driver
@ -214,7 +213,7 @@ If
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 no error.
otherwise \-1. Overflow is not an error.
\" XXX Slaving isn't supported in 2.2
.\" .TP
.\" .BR SIOCGIFSLAVE ", " SIOCSIFSLAVE
@ -231,7 +230,7 @@ For configuring IP addresses see
.PP
In addition some devices support private ioctls. These are not described here.
.SH NOTES
Strictly seen,
Strictly speaking,
.B SIOCGIFCONF
is IP specific and belongs in
.BR ip (7).
@ -246,15 +245,13 @@ Local IPv6 IP addresses can be found via /proc/net or via
.SH BUGS
glibc 2.1 is missing the
.I ifr_newname
macro in net/if.h. Add the following to your program as workaround:
macro in net/if.h. Add the following to your program as a workaround:
.sp
.RS
.nf
.ta 4 20 42
#ifndef ifr_newname
#define ifr_newname ifr_ifru.ifru_slave
#endif
.ta
.fi
.RE
.SH "SEE ALSO"