]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man7/rtnetlink.7
epoll.7: wfix
[thirdparty/man-pages.git] / man7 / rtnetlink.7
index 7bfa3fa1c19cc157e69650e5cde31574049d6bdc..626054512cdacbe462f1208a6303da52bafbcc6d 100644 (file)
@@ -1,14 +1,18 @@
 '\" t
-.\" Don't remove the line above, it tells man that tbl is needed.
 .\" This man page is Copyright (C) 1999 Andi Kleen <ak@muc.de>.
+.\"
+.\" %%%LICENSE_START(VERBATIM_ONE_PARA)
 .\" Permission is granted to distribute possibly modified copies
 .\" of this page provided the header is included verbatim,
 .\" and in case of nontrivial modification author and date
 .\" of the modification is added to the header.
+.\" %%%LICENSE_END
+.\"
 .\" Based on the original comments from Alexey Kuznetsov, written with
 .\" help from Matthew Wilcox.
 .\" $Id: rtnetlink.7,v 1.8 2000/01/22 01:55:04 freitag Exp $
-.TH RTNETLINK  7 2012-11-11 "Linux" "Linux Programmer's Manual"
+.\"
+.TH RTNETLINK  7 2017-09-15 "Linux" "Linux Programmer's Manual"
 .SH NAME
 rtnetlink \- Linux IPv4 routing socket
 .SH SYNOPSIS
@@ -19,7 +23,7 @@ rtnetlink \- Linux IPv4 routing socket
 .B #include <linux/rtnetlink.h>
 .br
 .B #include <sys/socket.h>
-.sp
+.PP
 .BI "rtnetlink_socket = socket(AF_NETLINK, int " socket_type ", NETLINK_ROUTE);"
 .SH DESCRIPTION
 Rtnetlink allows the kernel's routing tables to be read and altered.
@@ -34,21 +38,21 @@ sockets.
 It is based on netlink messages; see
 .BR netlink (7)
 for more information.
-.\" FIXME ? all these macros could be moved to rtnetlink(3)
+.\" FIXME ? all these macros could be moved to rtnetlink(3)
 .SS Routing attributes
 Some rtnetlink messages have optional attributes after the initial header:
-
+.PP
 .in +4n
-.nf
+.EX
 struct rtattr {
     unsigned short rta_len;    /* Length of option */
     unsigned short rta_type;   /* Type of option */
     /* Data follows */
 };
-.fi
+.EE
 .in
-
-These attributes should be only manipulated using the RTA_* macros
+.PP
+These attributes should be manipulated using only the RTA_* macros
 or libnetlink, see
 .BR rtnetlink (3).
 .SS Messages
@@ -62,8 +66,8 @@ These messages contain an
 structure followed by a series of
 .I rtattr
 structures.
-
-.nf
+.IP
+.EX
 struct ifinfomsg {
     unsigned char  ifi_family; /* AF_UNSPEC */
     unsigned short ifi_type;   /* Device type */
@@ -71,9 +75,9 @@ struct ifinfomsg {
     unsigned int   ifi_flags;  /* Device flags  */
     unsigned int   ifi_change; /* change mask */
 };
-.fi
-
-.\" FIXME ifi_type
+.EE
+.IP
+.\" FIXME Document ifinfomsg.ifi_type
 .I ifi_flags
 contains the device flags, see
 .BR netdevice (7);
@@ -85,7 +89,6 @@ message, thus creating a link with the given
 .IR ifindex );
 .I ifi_change
 is reserved for future use and should be always set to 0xFFFFFFFF.
-.na
 .TS
 tab(:);
 c s s
@@ -104,8 +107,7 @@ IFLA_STATS:T{
 see below
 T}:Interface Statistics.
 .TE
-.ad
-.sp
+.PP
 The value type for
 .B IFLA_STATS
 is
@@ -125,17 +127,17 @@ They contain an
 structure, optionally followed by
 .I rtattr
 routing attributes.
-
-.nf
+.IP
+.EX
 struct ifaddrmsg {
     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 */
+    unsigned int  ifa_index;     /* Interface index */
 };
-.fi
-
+.EE
+.IP
 .I ifa_family
 is the address family type (currently
 .B AF_INET
@@ -169,7 +171,7 @@ IFA_BROADCAST:raw protocol address:broadcast address.
 IFA_ANYCAST:raw protocol address:anycast address
 IFA_CACHEINFO:struct ifa_cacheinfo:Address information.
 .TE
-.\" FIXME struct ifa_cacheinfo
+.\" FIXME Document struct ifa_cacheinfo
 .TP
 .BR RTM_NEWROUTE ", " RTM_DELROUTE ", " RTM_GETROUTE
 Create, remove or receive information about a network route.
@@ -190,8 +192,8 @@ For the other fields, except
 and
 .IR rtm_protocol ,
 0 is the wildcard.
-
-.nf
+.IP
+.EX
 struct rtmsg {
     unsigned char rtm_family;   /* Address family of route */
     unsigned char rtm_dst_len;  /* Length of destination */
@@ -205,8 +207,7 @@ struct rtmsg {
 
     unsigned int  rtm_flags;
 };
-.fi
-.na
+.EE
 .TS
 tab(:);
 l l.
@@ -231,8 +232,6 @@ RTN_XRESOLVE:T{
 refer to an external resolver (not implemented)
 T}
 .TE
-.ad
-.na
 .TS
 tab(:);
 l l.
@@ -246,8 +245,7 @@ RTPROT_KERNEL:by the kernel
 RTPROT_BOOT:during boot
 RTPROT_STATIC:by the administrator
 .TE
-.ad
-
+.sp 1
 Values larger than
 .B RTPROT_STATIC
 are not interpreted by the kernel, they are just for user information.
@@ -256,10 +254,9 @@ distinguish between multiple routing daemons.
 See
 .I <linux/rtnetlink.h>
 for the routing daemon identifiers which are already assigned.
-
+.IP
 .I rtm_scope
 is the distance to the destination:
-.na
 .TS
 tab(:);
 l l.
@@ -271,18 +268,16 @@ RT_SCOPE_LINK:route on this link
 RT_SCOPE_HOST:route on the local host
 RT_SCOPE_NOWHERE:destination doesn't exist
 .TE
-.ad
-
+.sp 1
 The values between
 .B RT_SCOPE_UNIVERSE
 and
 .B RT_SCOPE_SITE
 are available to the user.
-
+.IP
 The
 .I rtm_flags
 have the following meanings:
-.na
 .TS
 tab(:);
 l l.
@@ -292,8 +287,7 @@ T}
 RTM_F_CLONED:route is cloned from another route
 RTM_F_EQUALIZE:a multipath equalizer (not yet implemented)
 .TE
-.ad
-
+.sp 1
 .I rtm_table
 specifies the routing table
 .TS
@@ -304,7 +298,7 @@ RT_TABLE_DEFAULT:the default table
 RT_TABLE_MAIN:the main table
 RT_TABLE_LOCAL:the local table
 .TE
-
+.sp 1
 The user may assign arbitrary values between
 .B RT_TABLE_UNSPEC
 and
@@ -332,7 +326,7 @@ RTA_PROTOINFO::
 RTA_FLOW::
 RTA_CACHEINFO::
 .TE
-
+.sp 1
 .B Fill these values in!
 .TP
 .BR RTM_NEWNEIGH ", " RTM_DELNEIGH  ", " RTM_GETNEIGH
@@ -341,8 +335,8 @@ entry (e.g., an ARP entry).
 The message contains an
 .I ndmsg
 structure.
-
-.nf
+.IP
+.EX
 struct ndmsg {
     unsigned char ndm_family;
     int           ndm_ifindex;  /* Interface index */
@@ -357,8 +351,8 @@ struct nda_cacheinfo {
     __u32         ndm_updated;
     __u32         ndm_refcnt;
 };
-.fi
-
+.EE
+.IP
 .I ndm_state
 is a bit mask of the following states:
 .TS
@@ -373,7 +367,7 @@ NUD_FAILED:an invalid cache entry
 NUD_NOARP:a device with no destination cache
 NUD_PERMANENT:a static entry
 .TE
-
+.sp 1
 Valid
 .I ndm_flags
 are:
@@ -383,8 +377,8 @@ l l.
 NTF_PROXY:a proxy arp entry
 NTF_ROUTER:an IPv6 router
 .TE
-
-.\" FIXME
+.sp 1
+.\" FIXME .
 .\" document the members of the struct better
 The
 .I rtattr
@@ -399,11 +393,11 @@ NDA_DST:a neighbor cache n/w layer destination address
 NDA_LLADDR:a neighbor cache link layer address
 NDA_CACHEINFO:cache statistics.
 .TE
-
+.sp 1
 If the
 .I rta_type
 field is
-.B NDA_CACHEINFO
+.BR NDA_CACHEINFO ,
 then a
 .I struct nda_cacheinfo
 header follows
@@ -419,8 +413,8 @@ The message contains a
 .I struct tcmsg
 and may be followed by a series of
 attributes.
-
-.nf
+.IP
+.EX
 struct tcmsg {
     unsigned char    tcm_family;
     int              tcm_ifindex;   /* interface index */
@@ -428,7 +422,7 @@ struct tcmsg {
     __u32            tcm_parent;    /* Parent qdisc */
     __u32            tcm_info;
 };
-.fi
+.EE
 .TS
 tab(:);
 c s s
@@ -440,11 +434,11 @@ TCA_UNSPEC:-:unspecified
 TCA_KIND:asciiz string:Name of queueing discipline
 TCA_OPTIONS:byte sequence:Qdisc-specific options follow
 TCA_STATS:struct tc_stats:Qdisc statistics.
-TCA_XSTATS:qdisc specific:Module-specific statistics.
+TCA_XSTATS:qdisc-specific:Module-specific statistics.
 TCA_RATE:struct tc_estimator:Rate limit.
 .TE
-
-In addition various other qdisc module specific attributes are allowed.
+.sp 1
+In addition, various other qdisc-module-specific attributes are allowed.
 For more information see the appropriate include files.
 .TP
 .BR RTM_NEWTCLASS ", " RTM_DELTCLASS ", " RTM_GETTCLASS