Wrap long lines; .ta + TABs with spaces in code examples

This commit is contained in:
Michael Kerrisk 2006-03-07 02:02:26 +00:00
parent a7dd5ac617
commit 8786649296
6 changed files with 131 additions and 145 deletions

View File

@ -109,7 +109,8 @@ local broadcast address.
.SH "SOCKET OPTIONS"
No protocol-specific socket options are supported.
.SH SYSCTLS
IP supports a sysctl interface to configure some global AppleTalk parameters.
IP supports a sysctl interface to configure some global AppleTalk
parameters.
The sysctls can be accessed by reading or writing the
.I /proc/sys/net/atalk/*
files or with the
@ -164,8 +165,9 @@ Invalid argument passed.
Datagram is bigger than the DDP MTU.
.TP
.B EACCES
The user tried to execute an operation without the necessary permissions. These
include sending to a broadcast address without having the broadcast flag set,
The user tried to execute an operation without the necessary permissions.
These include sending to a broadcast address without
having the broadcast flag set,
and trying to bind to a reserved port without effective user ID 0 or
.BR CAP_NET_BIND_SERVICE .
.TP
@ -179,7 +181,8 @@ Not enough memory available.
Invalid socket option passed.
.TP
.B EPERM
User doesn't have permission to set high priority, make a configuration change,
User doesn't have permission to set high priority,
make a configuration change,
or send signals to the requested process or group,
.TP
.B EADDRNOTAVAIL
@ -232,8 +235,8 @@ package and AppleTalk monitoring tools more easily.
.SH BUGS
There are too many inconsistent error values.
.PP
The ioctls used to configure routing tables, devices, AARP tables and other
devices are not yet described.
The ioctls used to configure routing tables, devices,
AARP tables and other devices are not yet described.
.SH "SEE ALSO"
.BR recvmsg (2),
.BR sendmsg (2),

View File

@ -110,22 +110,20 @@ On raw sockets
is set to the IP protocol.
.PP
.RS
.in +0.25i
.nf
.ta 4n 19n 31n
struct sockaddr_in {
sa_family_t sin_family; /* address family: AF_INET */
u_int16_t sin_port; /* port in network byte order */
struct in_addr sin_addr; /* internet address */
sa_family_t sin_family; /* address family: AF_INET */
u_int16_t sin_port; /* port in network byte order */
struct in_addr sin_addr; /* internet address */
};
/* Internet address. */
struct in_addr {
u_int32_t s_addr; /* address in network byte order */
u_int32_t s_addr; /* address in network byte order */
};
.ta
.fi
.RE
.in -0.25i
.PP
.I sin_family
is always set to
@ -248,16 +246,16 @@ or
.BR sendmsg (2).
.IP
.RS
.ta 4n 19n 33n
.in +0.25i
.nf
struct in_pktinfo {
unsigned int ipi_ifindex; /* Interface index */
struct in_addr ipi_spec_dst; /* Local address */
struct in_addr ipi_addr; /* Header Destination address */
unsigned int ipi_ifindex; /* Interface index */
struct in_addr ipi_spec_dst; /* Local address */
struct in_addr ipi_addr; /* Header Destination
address */
};
.fi
.RE
.in -0.25i
.IP
.\" FIXME elaborate on that.
.I ipi_ifindex
@ -394,30 +392,28 @@ control message contains a
.I sock_extended_err
structure:
.IP
.RS
.in +0.25i
.ne 18
.nf
.ta 4n 20n 32n
#define SO_EE_ORIGIN_NONE 0
#define SO_EE_ORIGIN_LOCAL 1
#define SO_EE_ORIGIN_ICMP 2
#define SO_EE_ORIGIN_ICMP6 3
#define SO_EE_ORIGIN_NONE 0
#define SO_EE_ORIGIN_LOCAL 1
#define SO_EE_ORIGIN_ICMP 2
#define SO_EE_ORIGIN_ICMP6 3
struct sock_extended_err {
u_int32_t ee_errno; /* error number */
u_int8_t ee_origin; /* where the error originated */
u_int8_t ee_type; /* type */
u_int8_t ee_code; /* code */
u_int8_t ee_pad;
u_int32_t ee_info; /* additional information */
u_int32_t ee_data; /* other data */
/* More data may follow */
u_int32_t ee_errno; /* error number */
u_int8_t ee_origin; /* where the error originated */
u_int8_t ee_type; /* type */
u_int8_t ee_code; /* code */
u_int8_t ee_pad;
u_int32_t ee_info; /* additional information */
u_int32_t ee_data; /* other data */
/* More data may follow */
};
struct sockaddr *SO_EE_OFFENDER(struct sock_extended_err *);
.ta
.fi
.RE
.in -0.25i
.IP
.I ee_errno
contains the errno number of the queued error.
@ -550,7 +546,8 @@ take it into account for their packet retransmit strategy.
To bootstrap the path MTU discovery process on unconnected sockets it
is possible to start with a big datagram size
(up to 64K-headers bytes long) and let it shrink by updates of the path MTU.
(up to 64K-headers bytes long) and let it shrink by updates of the
path MTU.
.\" FIXME this is an ugly hack
To get an initial estimate of the
@ -602,18 +599,19 @@ packets should be looped back to the local sockets.
Join a multicast group. Argument is an
.I ip_mreqn
structure.
.PP
.RS
.sp
.in +0.25i
.nf
.ta 4n 19n 34n
struct ip_mreqn {
struct in_addr imr_multiaddr; /* IP multicast group address */
struct in_addr imr_address; /* IP address of local interface */
int imr_ifindex; /* interface index */
struct in_addr imr_multiaddr; /* IP multicast group
address */
struct in_addr imr_address; /* IP address of local
interface */
int imr_ifindex; /* interface index */
};
.fi
.RE
.IP
.in -0.25i
.sp
.I imr_multiaddr
contains the address of the multicast group the application
wants to join or leave.

View File

@ -13,7 +13,7 @@ packet, PF_PACKET \- packet interface on device level.
.br
.B #include <netpacket/packet.h>
.br
.B #include <net/ethernet.h> /* the L2 protocols */
.B #include <net/ethernet.h> /* the L2 protocols */
.sp
.BI "packet_socket = socket(PF_PACKET, int " socket_type ", int "protocol );
.fi
@ -48,7 +48,8 @@ capability may open packet sockets.
.B SOCK_RAW
packets are passed to and from the device driver without any changes in
the packet data. When receiving a packet, the address is still parsed and
the packet data.
When receiving a packet, the address is still parsed and
passed in a standard
.B sockaddr_ll
address structure. When transmitting a packet, the user supplied buffer
@ -98,21 +99,19 @@ even when it is longer than the buffer.
.SH "ADDRESS TYPES"
The sockaddr_ll is a device independent physical layer address.
.RS
.in +0.25i
.nf
.ta 4n 20n 35n
struct sockaddr_ll {
unsigned short sll_family; /* Always AF_PACKET */
unsigned short sll_protocol; /* Physical layer protocol */
int sll_ifindex; /* Interface number */
unsigned short sll_hatype; /* Header type */
unsigned char sll_pkttype; /* Packet type */
unsigned char sll_halen; /* Length of address */
unsigned char sll_addr[8]; /* Physical layer address */
unsigned short sll_family; /* Always AF_PACKET */
unsigned short sll_protocol; /* Physical layer protocol */
int sll_ifindex; /* Interface number */
unsigned short sll_hatype; /* Header type */
unsigned char sll_pkttype; /* Packet type */
unsigned char sll_halen; /* Length of address */
unsigned char sll_addr[8]; /* Physical layer address */
};
.ta
.fi
.RE
.in -0.25i
.B sll_protocol
is the standard ethernet protocol type in network order as defined
@ -177,18 +176,16 @@ They both expect a
.B packet_mreq
structure as argument:
.RS
.in +0.25i
.nf
.ta 4n 20n 35n
struct packet_mreq {
int mr_ifindex; /* interface index */
unsigned short mr_type; /* action */
unsigned short mr_alen; /* address length */
unsigned char mr_address[8]; /* physical layer address */
int mr_ifindex; /* interface index */
unsigned short mr_type; /* action */
unsigned short mr_alen; /* address length */
unsigned char mr_address[8]; /* physical layer address */
};
.ta
.fi
.RE
.in -0.25i
.B mr_ifindex
contains the interface index for the interface whose status
@ -244,17 +241,15 @@ uses the old
to specify an interface, which doesn't provide physical layer
independence.
.RS
.in +0.25i
.nf
.ta 4n 20n 35n
struct sockaddr_pkt {
unsigned short spkt_family;
unsigned char spkt_device[14];
unsigned short spkt_protocol;
unsigned short spkt_family;
unsigned char spkt_device[14];
unsigned short spkt_protocol;
};
.ta
.fi
.RE
.in -0.25i
.B spkt_family
contains
@ -279,8 +274,8 @@ features.
The
.B SOCK_DGRAM
packet sockets make no attempt to create or parse the IEEE 802.2 LLC header
for a IEEE 802.3 frame.
packet sockets make no attempt to create or parse the IEEE 802.2 LLC
header for a IEEE 802.3 frame.
When
.B ETH_P_802_3
is specified as protocol for sending the kernel creates the
@ -354,13 +349,13 @@ is a new feature in Linux 2.2. Earlier Linux versions supported only
glibc 2.1 does not have a define for
.BR SOL_PACKET .
The suggested workaround is to use
.RS
.in +0.25i
.nf
#ifndef SOL_PACKET
#define SOL_PACKET 263
#endif
.fi
.RE
.in -0.25i
This is fixed in later glibc versions and also does not occur on
libc5 systems.

View File

@ -40,11 +40,10 @@ for more information.
Some rtnetlink messages have optional attributes after the initial header:
.nf
.ta 4 19 32
struct rtattr {
unsigned short rta_len; /* Length of option */
unsigned short rta_type; /* Type of option */
/* Data follows */
unsigned short rta_len; /* Length of option */
unsigned short rta_type; /* Type of option */
/* Data follows */
};
.fi
@ -65,13 +64,12 @@ structure followed by a series of
structures.
.nf
.ta 4 19 32
struct ifinfomsg {
unsigned char ifi_family; /* AF_UNSPEC */
unsigned short ifi_type; /* Device type */
int ifi_index; /* Interface index */
unsigned int ifi_flags; /* Device flags */
unsigned int ifi_change; /* change mask */
unsigned char ifi_family; /* AF_UNSPEC */
unsigned short ifi_type; /* Device type */
int ifi_index; /* Interface index */
unsigned int ifi_flags; /* Device flags */
unsigned int ifi_change; /* change mask */
};
.fi
@ -103,8 +101,8 @@ IFLA_STATS:T{
struct net_device_stats
T}:Interface Statistics.
.TE
.TP
.BR RTM_NEWADDR ", " RTM_DELADDR ", " RTM_GETADDR
.TP
.BR RTM_NEWADDR ", " RTM_DELADDR ", " RTM_GETADDR
Add, remove or receive information about an IP address associated with
an interface. In Linux 2.2 an interface can carry multiple IP addresses,
this replaces the alias device concept in 2.0. In Linux 2.2 these messages
@ -115,13 +113,12 @@ structure, optionally followed by
routing attributes.
.nf
.ta 4 19 32
struct ifaddrmsg {
unsigned char ifa_family; /* Address type */
unsigned char ifa_prefixlen; /* Prefixlength of the address */
unsigned char ifa_flags; /* Address flags */
unsigned char ifa_scope; /* Address scope */
int ifa_index; /* Interface index */
unsigned char ifa_family; /* Address type */
unsigned char ifa_prefixlen; /* Prefixlength of address */
unsigned char ifa_flags; /* Address flags */
unsigned char ifa_scope; /* Address scope */
int ifa_index; /* Interface index */
};
.fi
@ -161,8 +158,8 @@ IFA_CACHEINFO:struct ifa_cacheinfo:Address information.
.TE
.\" FIXME struct ifa_cacheinfo
.TP
.BR RTM_NEWROUTE ", " RTM_DELROUTE ", " RTM_GETROUTE
.TP
.BR RTM_NEWROUTE ", " RTM_DELROUTE ", " RTM_GETROUTE
Create, remove or receive information about a network route.
These messages contain an
.B rtmsg
@ -182,19 +179,18 @@ and
0 is the wildcard.
.nf
.ta 4 19 32
struct rtmsg {
unsigned char rtm_family; /* Address family of route */
unsigned char rtm_dst_len; /* Length of source */
unsigned char rtm_src_len; /* Length of destination */
unsigned char rtm_tos; /* TOS filter */
unsigned char rtm_family; /* Address family of route */
unsigned char rtm_dst_len; /* Length of source */
unsigned char rtm_src_len; /* Length of destination */
unsigned char rtm_tos; /* TOS filter */
unsigned char rtm_table; /* Routing table ID */
unsigned char rtm_protocol; /* Routing protocol; see below */
unsigned char rtm_scope; /* See below */
unsigned char rtm_type; /* See below */
unsigned char rtm_table; /* Routing table ID */
unsigned char rtm_protocol; /* Routing protocol; see below */
unsigned char rtm_scope; /* See below */
unsigned char rtm_type; /* See below */
unsigned int rtm_flags;
unsigned int rtm_flags;
};
.fi
@ -321,28 +317,27 @@ RTA_CACHEINFO::
.TE
.B Fill these values in!
.TP
.BR RTM_NEWNEIGH ", " RTM_DELNEIGH ", " RTM_GETNEIGH
.TP
.BR RTM_NEWNEIGH ", " RTM_DELNEIGH ", " RTM_GETNEIGH
Add, remove or receive information about a neighbour table
entry (e.g. an ARP entry). The message contains an
.B ndmsg
structure.
.nf
.ta 4 19 32
struct ndmsg {
unsigned char ndm_family;
int ndm_ifindex; /* Interface index */
__u16 ndm_state; /* State */
__u8 ndm_flags; /* Flags */
__u8 ndm_type;
unsigned char ndm_family;
int ndm_ifindex; /* Interface index */
__u16 ndm_state; /* State */
__u8 ndm_flags; /* Flags */
__u8 ndm_type;
};
struct nda_cacheinfo {
__u32 ndm_confirmed;
__u32 ndm_used;
__u32 ndm_updated;
__u32 ndm_refcnt;
__u32 ndm_confirmed;
__u32 ndm_used;
__u32 ndm_updated;
__u32 ndm_refcnt;
};
.fi
@ -409,13 +404,12 @@ and may be followed by a series of
attributes.
.nf
.ta 4 19 32
struct tcmsg {
unsigned char tcm_family;
int tcm_ifindex; /* interface index */
__u32 tcm_handle; /* Qdisc handle */
__u32 tcm_parent; /* Parent qdisc */
__u32 tcm_info;
unsigned char tcm_family;
int tcm_ifindex; /* interface index */
__u32 tcm_handle; /* Qdisc handle */
__u32 tcm_parent; /* Parent qdisc */
__u32 tcm_info;
};
.fi

View File

@ -405,16 +405,14 @@ option. The argument is a
.I linger
structure.
.PP
.RS
.in +0.25i
.nf
.ta 4n 10n 22n
struct linger {
int l_onoff; /* linger active */
int l_linger; /* how many seconds to linger for */
int l_onoff; /* linger active */
int l_linger; /* how many seconds to linger for */
};
.ta
.fi
.RE
.in -0.25i
.IP
When enabled, a
.BR close (2)
@ -542,11 +540,11 @@ per socket.
These operations can be accessed using
.BR ioctl (2):
.RS
.in +0.25i
.nf
.IB error " = ioctl(" ip_socket ", " ioctl_type ", " &value_result ");"
.fi
.RE
.in -0.25i
.TP
.B SIOCGSTAMP

View File

@ -60,17 +60,16 @@ The local address can be set using
When a socket is connected and it doesn't already have a local address a
unique address in the abstract namespace will be generated automatically.
.RS
.in +0.25i
.nf
#define UNIX_PATH_MAX 108
#define UNIX_PATH_MAX 108
.ta 4n 17n 42n
struct sockaddr_un {
sa_family_t sun_family; /* AF_UNIX */
char sun_path[UNIX_PATH_MAX]; /* pathname */
sa_family_t sun_family; /* AF_UNIX */
char sun_path[UNIX_PATH_MAX]; /* pathname */
};
.fi
.RE
.in -0.25i
.B sun_family
always contains
@ -163,16 +162,15 @@ The credentials are passed as a
.I struct ucred
ancillary message.
.RS
.in +0.25i
.nf
.ta 4n 11n 17n
struct ucred {
pid_t pid; /* process ID of the sending process */
uid_t uid; /* user ID of the sending process */
gid_t gid; /* group ID of the sending process */
pid_t pid; /* process ID of the sending process */
uid_t uid; /* user ID of the sending process */
gid_t gid; /* group ID of the sending process */
};
.fi
.RE
.in -0.25i
The credentials which the sender specifies are checked by the kernel.
A process with effective user ID 0 is allowed to specify values that do