Updated link documentation
- API documentation - developer guide - enabled doxygen navbar - fixed css
This commit is contained in:
parent
915a23fd16
commit
70c9371760
12 changed files with 1163 additions and 821 deletions
|
@ -181,6 +181,12 @@ TAB_SIZE = 8
|
|||
|
||||
ALIASES = arg=\param
|
||||
|
||||
ALIASES += ref_asciidoc{3}="<a href=\"../\1.html#\2\">\3</a>"
|
||||
ALIASES += ref_core{2}="\ref_asciidoc{core,\1,\2 (Netlink Library)}"
|
||||
ALIASES += ref_route{2}="\ref_asciidoc{route,\1,\2 (Routing Family Library)}"
|
||||
ALIASES += core_doc{2}="\par Related Documentation:\n\ref_core{\1,\2}"
|
||||
ALIASES += route_doc{2}="\par Related Documentation:\n\ref_route{\1,\2}"
|
||||
|
||||
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
|
||||
# sources only. Doxygen will then generate output that is more tailored for C.
|
||||
# For instance, some of the names that are used will be different. The list
|
||||
|
@ -487,13 +493,13 @@ SHOW_USED_FILES = NO
|
|||
# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
|
||||
# in the documentation. The default is NO.
|
||||
|
||||
SHOW_DIRECTORIES = YES
|
||||
SHOW_DIRECTORIES = NO
|
||||
|
||||
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
|
||||
# This will remove the Files entry from the Quick Index and from the
|
||||
# Folder Tree View (if specified). The default is YES.
|
||||
|
||||
SHOW_FILES = YES
|
||||
SHOW_FILES = NO
|
||||
|
||||
# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
|
||||
# Namespaces page.
|
||||
|
@ -1012,7 +1018,7 @@ GENERATE_ECLIPSEHELP = NO
|
|||
# the directory name containing the HTML and XML files should also have
|
||||
# this name.
|
||||
|
||||
ECLIPSE_DOC_ID = org.doxygen.Project
|
||||
ECLIPSE_DOC_ID = org.infradead.libnl
|
||||
|
||||
# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
|
||||
# top of each HTML page. The value NO (the default) enables the index and
|
||||
|
@ -1033,7 +1039,7 @@ ENUM_VALUES_PER_LINE = 1
|
|||
# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
|
||||
# Windows users are probably better off using the HTML help feature.
|
||||
|
||||
GENERATE_TREEVIEW = NO
|
||||
GENERATE_TREEVIEW = YES
|
||||
|
||||
# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
|
||||
# and Class Hierarchy pages using a tree view instead of an ordered list.
|
||||
|
@ -1044,7 +1050,7 @@ USE_INLINE_TREES = YES
|
|||
# used to set the initial width (in pixels) of the frame in which the tree
|
||||
# is shown.
|
||||
|
||||
TREEVIEW_WIDTH = 250
|
||||
TREEVIEW_WIDTH = 205
|
||||
|
||||
# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
|
||||
# links to external symbols imported via tag files in a separate window.
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
<tab type="hierarchy" visible="yes" title="" intro=""/>
|
||||
<tab type="classmembers" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="files" visible="yes" title="">
|
||||
<tab type="files" visible="no" title="">
|
||||
<tab type="files" visible="yes" title="" intro=""/>
|
||||
<tab type="globals" visible="yes" title="" intro=""/>
|
||||
</tab>
|
||||
<tab type="dirs" visible="yes" title="" intro=""/>
|
||||
<tab type="dirs" visible="no" title="" intro=""/>
|
||||
<tab type="examples" visible="yes" title="" intro=""/>
|
||||
</navindex>
|
||||
|
||||
|
@ -64,13 +64,13 @@
|
|||
<detaileddescription title=""/>
|
||||
<memberdef>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<constructors title=""/>
|
||||
<functions title=""/>
|
||||
<related title=""/>
|
||||
<variables title=""/>
|
||||
<properties title=""/>
|
||||
<events title=""/>
|
||||
<enums title=""/>
|
||||
</memberdef>
|
||||
<usedfiles visible="$SHOW_USED_FILES"/>
|
||||
<authorsection visible="yes"/>
|
||||
|
@ -132,14 +132,13 @@
|
|||
<groupgraph visible="$GROUP_GRAPHS"/>
|
||||
<detaileddescription title=""/>
|
||||
<memberdecl>
|
||||
<classes visible="yes" title=""/>
|
||||
<namespaces visible="yes" title=""/>
|
||||
<dirs visible="yes" title=""/>
|
||||
<nestedgroups visible="yes" title=""/>
|
||||
<classes visible="yes" title=""/>
|
||||
<files visible="yes" title=""/>
|
||||
<defines title=""/>
|
||||
<typedefs title=""/>
|
||||
<enums title=""/>
|
||||
<enumvalues title=""/>
|
||||
<functions title=""/>
|
||||
<variables title=""/>
|
||||
|
@ -151,6 +150,7 @@
|
|||
<properties title=""/>
|
||||
<friends title=""/>
|
||||
<membergroups visible="yes"/>
|
||||
<enums title=""/>
|
||||
</memberdecl>
|
||||
<memberdef>
|
||||
<pagedocs/>
|
||||
|
|
|
@ -376,7 +376,7 @@ table.memberdecls {
|
|||
}
|
||||
|
||||
.memItemLeft, .memItemRight, .memTemplParams {
|
||||
border-top: 1px solid #C4CFE5;
|
||||
border-top: 1px solid #a7a7a7;
|
||||
}
|
||||
|
||||
.memItemLeft, .memTemplItemLeft {
|
||||
|
@ -428,18 +428,17 @@ table.memberdecls {
|
|||
|
||||
.memname {
|
||||
white-space: nowrap;
|
||||
font-weight: bold;
|
||||
font-family: monospace, fixed;
|
||||
font-weight: bold;
|
||||
font-size: 110%;
|
||||
margin-left: 6px;
|
||||
}
|
||||
|
||||
.memproto {
|
||||
border-top: 1px solid #A8B8D9;
|
||||
border-left: 1px solid #A8B8D9;
|
||||
border-right: 1px solid #A8B8D9;
|
||||
border-bottom: 1px solid #A8B8D9;
|
||||
border: 1px solid #990000;
|
||||
padding: 6px 0px 6px 0px;
|
||||
color: #253555;
|
||||
font-weight: bold;
|
||||
/* color: #253555; */
|
||||
color: #990000;
|
||||
/* text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); */
|
||||
/* opera specific markup */
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
|
@ -453,17 +452,16 @@ table.memberdecls {
|
|||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
|
||||
-webkit-border-top-right-radius: 8px;
|
||||
-webkit-border-top-left-radius: 8px;
|
||||
background-image:url('nav_f.png');
|
||||
background-repeat:repeat-x;
|
||||
background-color: #E2E8F2;
|
||||
|
||||
/* background-image:url('nav_f.png');
|
||||
background-repeat:repeat-x; */
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.memdoc {
|
||||
border-bottom: 1px solid #A8B8D9;
|
||||
border-left: 1px solid #A8B8D9;
|
||||
border-right: 1px solid #A8B8D9;
|
||||
padding: 2px 5px;
|
||||
border-bottom: 1px solid #990000;
|
||||
border-left: 1px solid #990000;
|
||||
border-right: 1px solid #990000;
|
||||
padding: 10px 15px;
|
||||
background-color: #FBFCFD;
|
||||
border-top-width: 0;
|
||||
/* opera specific markup */
|
||||
|
@ -487,13 +485,15 @@ table.memberdecls {
|
|||
}
|
||||
|
||||
.paramtype {
|
||||
color: #c87424;
|
||||
white-space: nowrap;
|
||||
font-family: monospace, fixed;
|
||||
}
|
||||
|
||||
.paramname {
|
||||
/* color: #602020; */
|
||||
color: black;
|
||||
color: #990000;
|
||||
white-space: nowrap;
|
||||
font-family: monospace, fixed;
|
||||
}
|
||||
.paramname em {
|
||||
font-style: normal;
|
||||
|
@ -751,6 +751,11 @@ dl
|
|||
padding: 0 0 0 10px;
|
||||
}
|
||||
|
||||
.memdoc > dl
|
||||
{
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug
|
||||
{
|
||||
border-left:4px solid;
|
||||
|
|
289
doc/route.txt
289
doc/route.txt
|
@ -15,6 +15,7 @@ This library provides APIs to the kernel interfaces of the routing family.
|
|||
|
||||
== Addresses
|
||||
|
||||
[[route_link]]
|
||||
== Links (Network Devices)
|
||||
|
||||
The link configuration interface is part of the +NETLINK_ROUTE+ protocol
|
||||
|
@ -171,34 +172,6 @@ Notification sent by the kernel to the multicast group +RTNLGRP_LINK+ when
|
|||
a. a network device was unregistered (change == ~0)
|
||||
b. a bridging device was deleted (address family will be +PF_BRIDGE+)
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#define IFF_UP 0x1 /* interface is up */
|
||||
#define IFF_BROADCAST 0x2 /* broadcast address valid */
|
||||
#define IFF_DEBUG 0x4 /* turn on debugging */
|
||||
#define IFF_LOOPBACK 0x8 /* is a loopback net */
|
||||
#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
|
||||
#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
|
||||
#define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */
|
||||
#define IFF_NOARP 0x80 /* no ARP protocol */
|
||||
#define IFF_PROMISC 0x100 /* receive all packets */
|
||||
#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
|
||||
|
||||
#define IFF_MASTER 0x400 /* master of a load balancer */
|
||||
#define IFF_SLAVE 0x800 /* slave of a load balancer */
|
||||
|
||||
#define IFF_MULTICAST 0x1000 /* Supports multicast */
|
||||
|
||||
#define IFF_PORTSEL 0x2000 /* can set media type */
|
||||
#define IFF_AUTOMEDIA 0x4000 /* auto media select active */
|
||||
#define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/
|
||||
|
||||
#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
|
||||
#define IFF_DORMANT 0x20000 /* driver signals dormant */
|
||||
|
||||
#define IFF_ECHO 0x40000 /* echo sent packets */
|
||||
-----
|
||||
|
||||
=== Get / List
|
||||
|
||||
[[link_list]]
|
||||
|
@ -252,6 +225,7 @@ rtnl_link_put(link);
|
|||
nl_cache_put(cache);
|
||||
-----
|
||||
|
||||
[[link_direct_lookup]]
|
||||
==== Lookup Single Link (Direct Lookup)
|
||||
|
||||
If only a single link is of interest, the link can be looked up directly
|
||||
|
@ -287,6 +261,7 @@ NOTE: While using this function can save a substantial amount of bandwidth
|
|||
to rtnl_link_get_kernel() will always trigger sending a +RTM_GETLINK+
|
||||
request.
|
||||
|
||||
[[link_translate_ifindex]]
|
||||
==== Translating interface index to link name
|
||||
|
||||
Applications which require to translate interface index to a link name or
|
||||
|
@ -347,68 +322,267 @@ rtnl_link_put(link);
|
|||
[[link_object]]
|
||||
=== Link Object
|
||||
|
||||
Name::
|
||||
The name of a network device is the human readable representation of a
|
||||
network device and secondary identification parameter besides the interface
|
||||
index.
|
||||
+
|
||||
Kernels >= 2.6.11 support identification by link name.
|
||||
+
|
||||
A link is represented by the structure +struct rtnl_link+. Instances may be
|
||||
created with the function +rtnl_link_alloc()+ or via a link cache (see
|
||||
<<link_list>>) and are freed again using the function +rtnl_link_put()+.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
void rtnl_link_set_name(struct rtnl_link *link, const char *name);
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
struct rtnl_link *rtnl_link_alloc(void);
|
||||
void rtnl_link_put(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
[[link_attr_name]]
|
||||
==== Name
|
||||
The name serves as unique, human readable description of the link. By
|
||||
default, links are named based on their type and then enumerated, e.g.
|
||||
eth0, eth1, ethn but they may be renamed at any time.
|
||||
|
||||
Kernels >= 2.6.11 support identification by link name.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_name(struct rtnl_link *link, const char *name);
|
||||
char *rtnl_link_get_name(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
Interface Index::
|
||||
The interface index is an integer uniquely identifying a network device.
|
||||
If present, it will be used to identify an existing network device.
|
||||
+
|
||||
*Accepted link name format:* +[^ /]*+ (maximum length: 15 characters)
|
||||
|
||||
[[link_attr_ifindex]]
|
||||
==== Interface Index (Identifier)
|
||||
The interface index is an integer uniquely identifying a link. If present
|
||||
in any link message, it will be used to identify an existing link.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_ifindex(struct rtnl_link *link, int ifindex);
|
||||
int rtnl_link_get_ifindex(struct rtnl_link *link);
|
||||
int rtnl_link_get_ifindex(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
[[link_attr_address]]
|
||||
==== Link Layer Address
|
||||
The link layer address (e.g. MAC address).
|
||||
|
||||
Address::
|
||||
The link layer address (MAC address).
|
||||
+
|
||||
[source,c]
|
||||
-----
|
||||
void rtnl_link_set_addr(struct rtnl_link *link, struct nl_addr *addr);
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_addr(struct rtnl_link *link, struct nl_addr *addr);
|
||||
struct nl_addr *rtnl_link_get_addr(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
Broadcast Address::
|
||||
Foo
|
||||
+
|
||||
[[link_attr_broadcast]]
|
||||
==== Broadcast Address
|
||||
The link layer broadcast address
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
void rtnl_link_set_broadcast(struct rtnl_link *link, struct nl_addr *addr);
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_broadcast(struct rtnl_link *link, struct nl_addr *addr);
|
||||
struct nl_addr *rtnl_link_get_broadcast(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
MTU::
|
||||
[[link_attr_mtu]]
|
||||
==== MTU (Maximum Transmission Unit)
|
||||
The maximum transmission unit specifies the maximum packet size a network
|
||||
device can transmit or receive. This value may be lower than the capability
|
||||
of the physical network device.
|
||||
+
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
void rtnl_link_set_mtu(struct rtnl_link *link, unsigned int mtu);
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_mtu(struct rtnl_link *link, unsigned int mtu);
|
||||
unsigned int rtnl_link_get_mtu(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
Weight::
|
||||
Foo
|
||||
+
|
||||
[[link_attr_flags]]
|
||||
==== Flags
|
||||
The flags of a link enable or disable various link features or inform about
|
||||
the state of the link.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
void rtnl_link_set_weight(struct rtnl_link *link, unsigned int weight);
|
||||
unsigned int rtnl_link_get_weight(struct rtnl_link *link);
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_flags(struct rtnl_link *link, unsigned int flags);
|
||||
void rtnl_link_unset_flags(struct rtnl_link *link, unsigned int flags);
|
||||
unsigned int rtnl_link_get_flags(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
[options="compact"]
|
||||
[horizontal]
|
||||
IFF_UP:: Link is up (administratively)
|
||||
IFF_RUNNING:: Link is up and carrier is OK (RFC2863 OPER_UP)
|
||||
IFF_LOWER_UP:: Link layer is operational
|
||||
IFF_DORMANT:: Driver signals dormant
|
||||
IFF_BROADCAST:: Link supports broadcasting
|
||||
IFF_MULTICAST:: Link supports multicasting
|
||||
IFF_ALLMULTI:: Link supports multicast routing
|
||||
IFF_DEBUG:: Tell driver to do debugging (currently unused)
|
||||
IFF_LOOPBACK:: Link loopback network
|
||||
IFF_POINTOPOINT:: Point-to-point link
|
||||
IFF_NOARP:: ARP is not supported
|
||||
IFF_PROMISC:: Status of promiscious mode
|
||||
IFF_MASTER:: Master of a load balancer (bonding)
|
||||
IFF_SLAVE:: Slave to a master link
|
||||
IFF_PORTSEL:: Driver supports setting media type (only used by ARM ethernet)
|
||||
IFF_AUTOMEDIA:: Link selects port automatically (only used by ARM ethernet)
|
||||
IFF_ECHO:: Echo sent packets (testing feature, CAN only)
|
||||
IFF_DYNAMIC:: Unused (BSD compatibility)
|
||||
IFF_NOTRAILERS:: Unused (BSD compatibility)
|
||||
|
||||
To translate a link flag to a link flag name or vice versa:
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
char *rtnl_link_flags2str(int flags, char *buf, size_t size);
|
||||
int rtnl_link_str2flags(const char *flag_name);
|
||||
-----
|
||||
|
||||
[[link_attr_txqlen]]
|
||||
==== Transmission Queue Length
|
||||
|
||||
The transmission queue holds packets before packets are delivered to
|
||||
the driver for transmission. It is usually specified in number of
|
||||
packets but the unit may be specific to the link type.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_txqlen(struct rtnl_link *link, unsigned int txqlen);
|
||||
unsigned int rtnl_link_get_txqlen(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
[[link_attr_operstate]]
|
||||
==== Operational Status
|
||||
The operational status has been introduced to provide extended information
|
||||
on the link status. Traditionally the link state has been described using
|
||||
the link flags +IFF_UP, IFF_RUNNING, IFF_LOWER_UP+, and +IFF_DORMANT+ which
|
||||
was no longer sufficient for some link types.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_operstate(struct rtnl_link *link, uint8_t state);
|
||||
uint8_t rtnl_link_get_operstate(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
[options="compact"]
|
||||
[horizontal]
|
||||
IF_OPER_UNKNOWN:: Unknown state
|
||||
IF_OPER_NOTPRESENT:: Link not present
|
||||
IF_OPER_DOWN:: Link down
|
||||
IF_OPER_LOWERLAYERDOWN:: L1 down
|
||||
IF_OPER_TESTING:: Testing
|
||||
IF_OPER_DORMANT:: Dormant
|
||||
IF_OPER_UP:: Link up
|
||||
|
||||
Translation of operational status code to string and vice versa:
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
char *rtnl_link_operstate2str(uint8_t state, char *buf, size_t size);
|
||||
int rtnl_link_str2operstate(const char *name);
|
||||
-----
|
||||
|
||||
[[link_attr_mode]]
|
||||
==== Mode
|
||||
Currently known link modes are:
|
||||
|
||||
[options="compact"]
|
||||
[horizontal]
|
||||
IF_LINK_MODE_DEFAULT:: Default link mode
|
||||
IF_LINK_MODE_DORMANT:: Limit upward transition to dormant
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
void rtnl_link_set_linkmode(struct rtnl_link *link, uint8_t mode);
|
||||
uint8_t rtnl_link_get_linkmode(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
Translation of link mode to string and vice versa:
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
char *rtnl_link_mode2str(uint8_t mode, char *buf, size_t len);
|
||||
uint8_t rtnl_link_str2mode(const char *name);
|
||||
-----
|
||||
|
||||
[[link_attr_alias]]
|
||||
==== IfAlias
|
||||
Alternative name for the link, primarly used for SNMP IfAlias.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
const char *rtnl_link_get_ifalias(struct rtnl_link *link);
|
||||
void rtnl_link_set_ifalias(struct rtnl_link *link, const char *alias);
|
||||
-----
|
||||
|
||||
*Length limit:* 256
|
||||
|
||||
[[link_attr_arptype]]
|
||||
==== Hardware Type
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
#include <linux/if_arp.h>
|
||||
|
||||
void rtnl_link_set_arptype(struct rtnl_link *link, unsigned int arptype);
|
||||
unsigned int rtnl_link_get_arptype(struct rtnl_link *link);
|
||||
----
|
||||
|
||||
Translation of hardware type to character string and vice versa:
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/utils.h>
|
||||
|
||||
char *nl_llproto2str(int arptype, char *buf, size_t len);
|
||||
int nl_str2llproto(const char *name);
|
||||
-----
|
||||
|
||||
[[link_attr_qdisc]]
|
||||
==== Qdisc
|
||||
The name of the queueing discipline used by the link is of informational
|
||||
nature only. It is a read-only attribute provided by the kernel and cannot
|
||||
be modified. The set function is provided solely for the purpose of creating
|
||||
link objects to be used for comparison.
|
||||
|
||||
For more information on how to modify the qdisc of a link, see section
|
||||
<<route_tc>>.
|
||||
|
||||
[[link_attr_weight]]
|
||||
==== Weight
|
||||
This attribute is unused and obsoleted in all recent kernels.
|
||||
|
||||
[source,c]
|
||||
-----
|
||||
#include <netlink/route/link.h>
|
||||
|
||||
extern void rtnl_link_set_qdisc(struct rtnl_link *link, const char *name);
|
||||
extern char *rtnl_link_get_qdisc(struct rtnl_link *link);
|
||||
-----
|
||||
|
||||
[[link_modules]]
|
||||
=== Modules
|
||||
|
||||
[[link_bonding]]
|
||||
|
@ -490,6 +664,7 @@ rtnl_link_put(link);
|
|||
|
||||
== Routing
|
||||
|
||||
[[route_tc]]
|
||||
== Traffic Control
|
||||
|
||||
The traffic control architecture allows the queueing and
|
||||
|
|
35
doc/src/hidden.c
Normal file
35
doc/src/hidden.c
Normal file
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* \cond skip
|
||||
* vim:syntax=doxygen
|
||||
* \endcond
|
||||
|
||||
\page auto_ack_warning Disabling Auto-ACK
|
||||
|
||||
\attention Disabling Auto-ACK (nl_socket_disable_auto_ack()) will cause this
|
||||
function to return immediately after sending the netlink message.
|
||||
The function will not wait for an eventual error message. It is
|
||||
the responsibility of the caller to handle any error messages or
|
||||
ACKs returned.
|
||||
|
||||
\page pointer_lifetime_warning Pointer Lifetime
|
||||
|
||||
\attention The reference counter of the returned object is not incremented.
|
||||
Therefore, the returned pointer is only valid during the lifetime
|
||||
of the parent object. Increment the reference counter if the object
|
||||
is supposed to stay around after the parent object was freed.
|
||||
|
||||
\page private_struct Private Structure
|
||||
|
||||
\note The definition of this structure is private to allow modification
|
||||
without breaking API. Use the designated accessor functions to
|
||||
access individual object attributes.
|
||||
|
||||
\page read_only_attribute Read-Only Attribute
|
||||
|
||||
\note The attribute this accessor is modifying is a read-only attribute
|
||||
which can not be modified in the kernel. Any changes to the
|
||||
attribute only have an effect on the local copy of the object. The
|
||||
accessor function is provided solely for the purpose of creating
|
||||
objects for comparison and filtering.
|
||||
|
||||
*/
|
|
@ -285,7 +285,8 @@ td.hdlist1 {
|
|||
vertical-align: top;
|
||||
font-style: normal;
|
||||
padding-right: 0.8em;
|
||||
color: navy;
|
||||
/* color: navy; */
|
||||
color: #990000;
|
||||
}
|
||||
td.hdlist2 {
|
||||
vertical-align: top;
|
||||
|
|
|
@ -21,77 +21,86 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @struct rtnl_link link.h "netlink/route/link.h"
|
||||
* @brief Link object
|
||||
* @implements nl_object
|
||||
* @ingroup link
|
||||
*
|
||||
* @copydoc private_struct
|
||||
*/
|
||||
struct rtnl_link;
|
||||
|
||||
enum rtnl_link_st {
|
||||
RTNL_LINK_RX_PACKETS,
|
||||
RTNL_LINK_TX_PACKETS,
|
||||
RTNL_LINK_RX_BYTES,
|
||||
RTNL_LINK_TX_BYTES,
|
||||
RTNL_LINK_RX_ERRORS,
|
||||
RTNL_LINK_TX_ERRORS,
|
||||
RTNL_LINK_RX_DROPPED,
|
||||
RTNL_LINK_TX_DROPPED,
|
||||
RTNL_LINK_RX_COMPRESSED,
|
||||
RTNL_LINK_TX_COMPRESSED,
|
||||
RTNL_LINK_RX_FIFO_ERR,
|
||||
RTNL_LINK_TX_FIFO_ERR,
|
||||
RTNL_LINK_RX_LEN_ERR,
|
||||
RTNL_LINK_RX_OVER_ERR,
|
||||
RTNL_LINK_RX_CRC_ERR,
|
||||
RTNL_LINK_RX_FRAME_ERR,
|
||||
RTNL_LINK_RX_MISSED_ERR,
|
||||
RTNL_LINK_TX_ABORT_ERR,
|
||||
RTNL_LINK_TX_CARRIER_ERR,
|
||||
RTNL_LINK_TX_HBEAT_ERR,
|
||||
RTNL_LINK_TX_WIN_ERR,
|
||||
RTNL_LINK_COLLISIONS,
|
||||
RTNL_LINK_MULTICAST,
|
||||
RTNL_LINK_IP6_INPKTS, /* InReceives */
|
||||
RTNL_LINK_IP6_INHDRERRORS, /* InHdrErrors */
|
||||
RTNL_LINK_IP6_INTOOBIGERRORS, /* InTooBigErrors */
|
||||
RTNL_LINK_IP6_INNOROUTES, /* InNoRoutes */
|
||||
RTNL_LINK_IP6_INADDRERRORS, /* InAddrErrors */
|
||||
RTNL_LINK_IP6_INUNKNOWNPROTOS, /* InUnknownProtos */
|
||||
RTNL_LINK_IP6_INTRUNCATEDPKTS, /* InTruncatedPkts */
|
||||
RTNL_LINK_IP6_INDISCARDS, /* InDiscards */
|
||||
RTNL_LINK_IP6_INDELIVERS, /* InDelivers */
|
||||
RTNL_LINK_IP6_OUTFORWDATAGRAMS, /* OutForwDatagrams */
|
||||
RTNL_LINK_IP6_OUTPKTS, /* OutRequests */
|
||||
RTNL_LINK_IP6_OUTDISCARDS, /* OutDiscards */
|
||||
RTNL_LINK_IP6_OUTNOROUTES, /* OutNoRoutes */
|
||||
RTNL_LINK_IP6_REASMTIMEOUT, /* ReasmTimeout */
|
||||
RTNL_LINK_IP6_REASMREQDS, /* ReasmReqds */
|
||||
RTNL_LINK_IP6_REASMOKS, /* ReasmOKs */
|
||||
RTNL_LINK_IP6_REASMFAILS, /* ReasmFails */
|
||||
RTNL_LINK_IP6_FRAGOKS, /* FragOKs */
|
||||
RTNL_LINK_IP6_FRAGFAILS, /* FragFails */
|
||||
RTNL_LINK_IP6_FRAGCREATES, /* FragCreates */
|
||||
RTNL_LINK_IP6_INMCASTPKTS, /* InMcastPkts */
|
||||
RTNL_LINK_IP6_OUTMCASTPKTS, /* OutMcastPkts */
|
||||
RTNL_LINK_IP6_INBCASTPKTS, /* InBcastPkts */
|
||||
RTNL_LINK_IP6_OUTBCASTPKTS, /* OutBcastPkts */
|
||||
RTNL_LINK_IP6_INOCTETS, /* InOctets */
|
||||
RTNL_LINK_IP6_OUTOCTETS, /* OutOctets */
|
||||
RTNL_LINK_IP6_INMCASTOCTETS, /* InMcastOctets */
|
||||
RTNL_LINK_IP6_OUTMCASTOCTETS, /* OutMcastOctets */
|
||||
RTNL_LINK_IP6_INBCASTOCTETS, /* InBcastOctets */
|
||||
RTNL_LINK_IP6_OUTBCASTOCTETS, /* OutBcastOctets */
|
||||
RTNL_LINK_ICMP6_INMSGS, /* InMsgs */
|
||||
RTNL_LINK_ICMP6_INERRORS, /* InErrors */
|
||||
RTNL_LINK_ICMP6_OUTMSGS, /* OutMsgs */
|
||||
RTNL_LINK_ICMP6_OUTERRORS, /* OutErrors */
|
||||
/**
|
||||
* @ingroup link
|
||||
*/
|
||||
typedef enum {
|
||||
RTNL_LINK_RX_PACKETS, /*!< Packets received */
|
||||
RTNL_LINK_TX_PACKETS, /*!< Packets sent */
|
||||
RTNL_LINK_RX_BYTES, /*!< Bytes received */
|
||||
RTNL_LINK_TX_BYTES, /*!< Bytes sent */
|
||||
RTNL_LINK_RX_ERRORS, /*!< Receive errors */
|
||||
RTNL_LINK_TX_ERRORS, /*!< Send errors */
|
||||
RTNL_LINK_RX_DROPPED, /*!< Received packets dropped */
|
||||
RTNL_LINK_TX_DROPPED, /*!< Packets dropped during transmit */
|
||||
RTNL_LINK_RX_COMPRESSED, /*!< Compressed packets received */
|
||||
RTNL_LINK_TX_COMPRESSED, /*!< Compressed packets sent */
|
||||
RTNL_LINK_RX_FIFO_ERR, /*!< Receive FIFO errors */
|
||||
RTNL_LINK_TX_FIFO_ERR, /*!< Send FIFO errors */
|
||||
RTNL_LINK_RX_LEN_ERR, /*!< Length errors */
|
||||
RTNL_LINK_RX_OVER_ERR, /*!< Over errors */
|
||||
RTNL_LINK_RX_CRC_ERR, /*!< CRC errors */
|
||||
RTNL_LINK_RX_FRAME_ERR, /*!< Frame errors */
|
||||
RTNL_LINK_RX_MISSED_ERR, /*!< Missed errors */
|
||||
RTNL_LINK_TX_ABORT_ERR, /*!< Aborted errors */
|
||||
RTNL_LINK_TX_CARRIER_ERR, /*!< Carrier errors */
|
||||
RTNL_LINK_TX_HBEAT_ERR, /*!< Heartbeat errors */
|
||||
RTNL_LINK_TX_WIN_ERR, /*!< Window errors */
|
||||
RTNL_LINK_COLLISIONS, /*!< Send collisions */
|
||||
RTNL_LINK_MULTICAST, /*!< Multicast */
|
||||
RTNL_LINK_IP6_INPKTS, /*!< IPv6 SNMP InReceives */
|
||||
RTNL_LINK_IP6_INHDRERRORS, /*!< IPv6 SNMP InHdrErrors */
|
||||
RTNL_LINK_IP6_INTOOBIGERRORS, /*!< IPv6 SNMP InTooBigErrors */
|
||||
RTNL_LINK_IP6_INNOROUTES, /*!< IPv6 SNMP InNoRoutes */
|
||||
RTNL_LINK_IP6_INADDRERRORS, /*!< IPv6 SNMP InAddrErrors */
|
||||
RTNL_LINK_IP6_INUNKNOWNPROTOS, /*!< IPv6 SNMP InUnknownProtos */
|
||||
RTNL_LINK_IP6_INTRUNCATEDPKTS, /*!< IPv6 SNMP InTruncatedPkts */
|
||||
RTNL_LINK_IP6_INDISCARDS, /*!< IPv6 SNMP InDiscards */
|
||||
RTNL_LINK_IP6_INDELIVERS, /*!< IPv6 SNMP InDelivers */
|
||||
RTNL_LINK_IP6_OUTFORWDATAGRAMS, /*!< IPv6 SNMP OutForwDatagrams */
|
||||
RTNL_LINK_IP6_OUTPKTS, /*!< IPv6 SNMP OutRequests */
|
||||
RTNL_LINK_IP6_OUTDISCARDS, /*!< IPv6 SNMP OutDiscards */
|
||||
RTNL_LINK_IP6_OUTNOROUTES, /*!< IPv6 SNMP OutNoRoutes */
|
||||
RTNL_LINK_IP6_REASMTIMEOUT, /*!< IPv6 SNMP ReasmTimeout */
|
||||
RTNL_LINK_IP6_REASMREQDS, /*!< IPv6 SNMP ReasmReqds */
|
||||
RTNL_LINK_IP6_REASMOKS, /*!< IPv6 SNMP ReasmOKs */
|
||||
RTNL_LINK_IP6_REASMFAILS, /*!< IPv6 SNMP ReasmFails */
|
||||
RTNL_LINK_IP6_FRAGOKS, /*!< IPv6 SNMP FragOKs */
|
||||
RTNL_LINK_IP6_FRAGFAILS, /*!< IPv6 SNMP FragFails */
|
||||
RTNL_LINK_IP6_FRAGCREATES, /*!< IPv6 SNMP FragCreates */
|
||||
RTNL_LINK_IP6_INMCASTPKTS, /*!< IPv6 SNMP InMcastPkts */
|
||||
RTNL_LINK_IP6_OUTMCASTPKTS, /*!< IPv6 SNMP OutMcastPkts */
|
||||
RTNL_LINK_IP6_INBCASTPKTS, /*!< IPv6 SNMP InBcastPkts */
|
||||
RTNL_LINK_IP6_OUTBCASTPKTS, /*!< IPv6 SNMP OutBcastPkts */
|
||||
RTNL_LINK_IP6_INOCTETS, /*!< IPv6 SNMP InOctets */
|
||||
RTNL_LINK_IP6_OUTOCTETS, /*!< IPv6 SNMP OutOctets */
|
||||
RTNL_LINK_IP6_INMCASTOCTETS, /*!< IPv6 SNMP InMcastOctets */
|
||||
RTNL_LINK_IP6_OUTMCASTOCTETS, /*!< IPv6 SNMP OutMcastOctets */
|
||||
RTNL_LINK_IP6_INBCASTOCTETS, /*!< IPv6 SNMP InBcastOctets */
|
||||
RTNL_LINK_IP6_OUTBCASTOCTETS, /*!< IPv6 SNMP OutBcastOctets */
|
||||
RTNL_LINK_ICMP6_INMSGS, /*!< ICMPv6 SNMP InMsgs */
|
||||
RTNL_LINK_ICMP6_INERRORS, /*!< ICMPv6 SNMP InErrors */
|
||||
RTNL_LINK_ICMP6_OUTMSGS, /*!< ICMPv6 SNMP OutMsgs */
|
||||
RTNL_LINK_ICMP6_OUTERRORS, /*!< ICMPv6 SNMP OutErrors */
|
||||
__RTNL_LINK_STATS_MAX,
|
||||
};
|
||||
} rtnl_link_stat_id_t;
|
||||
|
||||
#define RTNL_LINK_STATS_MAX (__RTNL_LINK_STATS_MAX - 1)
|
||||
|
||||
/* link object allocation/freeage */
|
||||
extern struct rtnl_link *rtnl_link_alloc(void);
|
||||
extern void rtnl_link_put(struct rtnl_link *);
|
||||
extern void rtnl_link_free(struct rtnl_link *);
|
||||
|
||||
/* link cache management */
|
||||
extern int rtnl_link_alloc_cache(struct nl_sock *, int, struct nl_cache **);
|
||||
extern struct rtnl_link *rtnl_link_get(struct nl_cache *, int);
|
||||
extern struct rtnl_link *rtnl_link_get_by_name(struct nl_cache *, const char *);
|
||||
|
@ -149,9 +158,6 @@ extern unsigned int rtnl_link_get_mtu(struct rtnl_link *);
|
|||
extern void rtnl_link_set_txqlen(struct rtnl_link *, unsigned int);
|
||||
extern unsigned int rtnl_link_get_txqlen(struct rtnl_link *);
|
||||
|
||||
extern void rtnl_link_set_weight(struct rtnl_link *, unsigned int);
|
||||
extern unsigned int rtnl_link_get_weight(struct rtnl_link *);
|
||||
|
||||
extern void rtnl_link_set_ifindex(struct rtnl_link *, int);
|
||||
extern int rtnl_link_get_ifindex(struct rtnl_link *);
|
||||
|
||||
|
@ -184,15 +190,19 @@ extern void rtnl_link_set_ifalias(struct rtnl_link *, const char *);
|
|||
|
||||
extern int rtnl_link_get_num_vf(struct rtnl_link *, uint32_t *);
|
||||
|
||||
extern uint64_t rtnl_link_get_stat(struct rtnl_link *, int);
|
||||
extern int rtnl_link_set_stat(struct rtnl_link *, const unsigned int,
|
||||
extern uint64_t rtnl_link_get_stat(struct rtnl_link *, rtnl_link_stat_id_t);
|
||||
extern int rtnl_link_set_stat(struct rtnl_link *, rtnl_link_stat_id_t,
|
||||
const uint64_t);
|
||||
|
||||
extern int rtnl_link_set_type(struct rtnl_link *, const char *);
|
||||
extern char * rtnl_link_get_type(struct rtnl_link *);
|
||||
|
||||
/* deprecated */
|
||||
extern int rtnl_link_set_info_type(struct rtnl_link *, const char *) __attribute__((deprecated));
|
||||
extern char * rtnl_link_get_info_type(struct rtnl_link *) __attribute__((deprecated));
|
||||
extern void rtnl_link_set_weight(struct rtnl_link *, unsigned int) __attribute__((deprecated));
|
||||
extern unsigned int rtnl_link_get_weight(struct rtnl_link *) __attribute__((deprecated));
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -203,8 +203,6 @@ struct nl_cache *flnl_result_alloc_cache(void)
|
|||
* \c rtnl_link_set_* functions.
|
||||
*
|
||||
* @return 0 on success or a negative error code.
|
||||
* @note Not all attributes can be changed, see
|
||||
* \ref link_changeable "Changeable Attributes" for more details.
|
||||
*/
|
||||
int flnl_lookup_build_request(struct flnl_request *req, int flags,
|
||||
struct nl_msg **result)
|
||||
|
|
1433
lib/route/link.c
1433
lib/route/link.c
File diff suppressed because it is too large
Load diff
|
@ -13,8 +13,10 @@
|
|||
* @ingroup link
|
||||
* @defgroup bonding Bonding
|
||||
*
|
||||
* <a href="../route.html#_links_network_devices">Link Documentation</a>
|
||||
* @details
|
||||
* \b Link Type Name: "bond"
|
||||
*
|
||||
* @route_doc{link_bonding, Bonding Documentation}
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
/**
|
||||
* @ingroup link
|
||||
* @defgroup dummy Dummy
|
||||
* @brief
|
||||
*
|
||||
* @details
|
||||
* \b Link Type Name: "dummy"
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,10 @@
|
|||
* @defgroup vlan VLAN
|
||||
* Virtual LAN link module
|
||||
*
|
||||
* See <a href="../route.html#link_vlan">VLAN API documentation</a> for more information
|
||||
* @details
|
||||
* \b Link Type Name: "vlan"
|
||||
*
|
||||
* @route_doc{link_vlan, VLAN Documentation}
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue