Module architecture

Sockets

The idea behind the pyroute2 framework is pretty simple. The library provides socket objects, that have:

  • shortcuts to establish netlink connections

  • extra methods to run netlink queries

  • some magic to handle packet bursts

  • another magic to transparently mangle netlink messages

In other sense any netlink socket is just an ordinary socket with fileno(), recv(), sendto() etc. Of course, one can use it in poll().

There is an inheritance diagram of Linux netlink sockets, provided by the library:

digraph inheritance2ee30167cf { bgcolor=transparent; rankdir=LR; ratio=auto; size="8.0, 12.0"; "AcpiEventSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "EventSocket" -> "AcpiEventSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BatchSocket" [URL="nlsocket.html#pyroute2.netlink.nlsocket.BatchSocket",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "NetlinkMixin" -> "BatchSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DQuotSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "EventSocket" -> "DQuotSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DevlinkSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "GenericNetlinkSocket" -> "DevlinkSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "DiagSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Usage::"]; "NetlinkSocket" -> "DiagSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "EventSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "GenericNetlinkSocket" -> "EventSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "GenericNetlinkSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Low-level socket interface. Provides all the"]; "NetlinkSocket" -> "GenericNetlinkSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPBatch" [URL="iproute.html#pyroute2.iproute.linux.IPBatch",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Netlink requests compiler. Does not send any requests, but"]; "RTNL_API" -> "IPBatch" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPBatchSocket" -> "IPBatch" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPBatchSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "IPRSocketMixin" -> "IPBatchSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "BatchSocket" -> "IPBatchSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPQSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Low-level socket interface. Provides all the"]; "NetlinkSocket" -> "IPQSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPRSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="The simplest class, that connects together the netlink parser and"]; "IPRSocketMixin" -> "IPRSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NetlinkSocket" -> "IPRSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPRSocketMixin" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "IPRoute" [URL="iproute.html#pyroute2.iproute.linux.IPRoute",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Regular ordinary utility class, see RTNL API for the list of methods."]; "RTNL_API" -> "IPRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPRSocket" -> "IPRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPSet" [URL="ipset.html#pyroute2.ipset.IPSet",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="NFNetlink socket (family=NETLINK_NETFILTER)."]; "NetlinkSocket" -> "IPSet" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IW" [URL="devmodules.html#pyroute2.iwutil.IW",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "NL80211" -> "IW" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NFCTSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "NetlinkSocket" -> "NFCTSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NFTSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="NFNetlink socket (family=NETLINK_NETFILTER)."]; "NetlinkSocket" -> "NFTSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NL80211" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "GenericNetlinkSocket" -> "NL80211" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NetNS" [URL="netns.html#pyroute2.netns.nslink.NetNS",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="NetNS is the IPRoute API with network namespace support."]; "RTNL_API" -> "NetNS" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RemoteSocket" -> "NetNS" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NetlinkMixin" [URL="nlsocket.html#pyroute2.netlink.nlsocket.NetlinkMixin",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Generic netlink socket"]; "NetlinkSocket" [URL="nlsocket.html#pyroute2.netlink.nlsocket.NetlinkSocket",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "NetlinkMixin" -> "NetlinkSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NlEthtool" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "GenericNetlinkSocket" -> "NlEthtool" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RTNL_API" [URL="iproute.html#pyroute2.iproute.linux.RTNL_API",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="`RTNL_API` should not be instantiated by itself. It is intended"]; "RawIPRSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "RawIPRSocketMixin" -> "RawIPRSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NetlinkSocket" -> "RawIPRSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RawIPRSocketMixin" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "RawIPRoute" [URL="iproute.html#pyroute2.iproute.linux.RawIPRoute",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The same as `IPRoute`, but does not use the netlink proxy."]; "RTNL_API" -> "RawIPRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RawIPRSocket" -> "RawIPRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RemoteIPRoute" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "RTNL_API" -> "RemoteIPRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RemoteSocket" -> "RemoteIPRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RemoteSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "NetlinkMixin" -> "RemoteSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ShellIPR" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "RTNL_API" -> "ShellIPR" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RemoteSocket" -> "ShellIPR" [arrowsize=0.5,style="setlinewidth(0.5)"]; "TaskStats" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "GenericNetlinkSocket" -> "TaskStats" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ThermalEventSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "EventSocket" -> "ThermalEventSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "UeventSocket" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "NetlinkSocket" -> "UeventSocket" [arrowsize=0.5,style="setlinewidth(0.5)"]; "WireGuard" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "GenericNetlinkSocket" -> "WireGuard" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

under the hood

Let’s assume we use an IPRoute object to get the interface list of the system:

from pyroute2 import IPRoute
ipr = IPRoute()
ipr.get_links()
ipr.close()

The get_links() method is provided by the IPRouteMixin class. It chooses the message to send (ifinfmsg), prepares required fields and passes it to the next layer:

result.extend(self.nlm_request(msg, RTM_GETLINK, msg_flags))

The nlm_request() is a method of the NetlinkMixin class. It wraps the pair request/response in one method. The request is done via put(), response comes with get(). These methods hide under the hood the asynchronous nature of the netlink protocol, where the response can come whenever – the time and packet order are not guaranteed. But one can use the sequence_number field of a netlink message to match responses, and the pair put()/get() does it.

cache thread

Sometimes it is preferrable to get incoming messages asap and parse them only when there is time for that. For that case the NetlinkMixin provides a possibility to start a dedicated cache thread, that will collect and queue incoming messages as they arrive. The thread doesn’t affect the socket behaviour: it will behave exactly in the same way, the only difference is that recv() will return already cached in the userspace message. To start the thread, one should call bind() with async_cache=True:

ipr = IPRoute()
ipr.bind(async_cache=True)
...  # do some stuff
ipr.close()

message mangling

An interesting feature of the IPRSocketMixin is a netlink proxy code, that allows to register callbacks for different message types. The callback API is simple. The callback must accept the message as a binary data, and must return a dictionary with two keys, verdict and data. The verdict can be:

  • for sendto(): forward, return or error

  • for recv(): forward or error

E.g.:

msg = ifinfmsg(data)
msg.decode()
...  # mangle msg
msg.reset()
msg.encode()
return {'verdict': 'forward',
        'data': msg.buf.getvalue()}

The error verdict raises an exception from data. The forward verdict causes the data to be passed. The return verdict is valid only in sendto() callbacks and means that the data should not be passed to the kernel, but instead it must be returned to the user.

This magic allows the library to transparently support ovs, teamd, tuntap calls via netlink. The corresponding callbacks transparently route the call to an external utility or to ioctl() API.

How to register callbacks, see IPRSocketMixin init. The _sproxy serves sendto() mangling, the _rproxy serves the recv() mangling. Later this API can become public.

PF_ROUTE messages

PF_ROUTE socket is used to receive notifications from the BSD kernel. The PF_ROUTE messages:

digraph inheritanced553a8d5f3 { bgcolor=transparent; rankdir=LR; ratio=auto; size="8.0, 12.0"; "bsdmsg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "nlmsg_base" -> "bsdmsg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "if_announcemsg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "bsdmsg" -> "if_announcemsg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "if_msg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "bsdmsg" -> "if_msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ifa_msg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "ifa_msg_base" -> "ifa_msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "rt_msg" -> "ifa_msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ifa_msg_base" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "bsdmsg" -> "ifa_msg_base" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ifma_msg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "ifma_msg_base" -> "ifma_msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "rt_msg" -> "ifma_msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ifma_msg_base" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "bsdmsg" -> "ifma_msg_base" [arrowsize=0.5,style="setlinewidth(0.5)"]; "nlmsg_base" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Netlink base class. You do not need to inherit it directly, unless"]; "rt_msg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "rt_msg_base" -> "rt_msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "rt_msg_base" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "bsdmsg" -> "rt_msg_base" [arrowsize=0.5,style="setlinewidth(0.5)"]; "rt_slot" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "nlmsg_base" -> "rt_slot" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

IPDB

The IPDB module implements high-level logic to manage some of the system network settings. It is completely agnostic to the netlink object’s nature, the only requirement is that the netlink transport must provide RTNL API.

So, using proper mixin classes one can create a custom RTNL-compatible transport. E.g., this way IPDB can work over NetNS objects, providing the network management within some network namespace — while itself it runs in the main namespace.

The IPDB architecture is not too complicated, but it implements some useful transaction magic, see commit() methods of the Transactional objects.

digraph inheritancebd2219997f { bgcolor=transparent; rankdir=LR; ratio=auto; size="8.0, 12.0"; "BaseRoute" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Persistent transactional route object"]; "Transactional" -> "BaseRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Dotkeys" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="This is a sick-minded hack of dict, intended to be an eye-candy."]; "Encap" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Transactional" -> "Encap" [arrowsize=0.5,style="setlinewidth(0.5)"]; "IPDB" [URL="ipdb.html#pyroute2.ipdb.main.IPDB",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="The class that maintains information about network setup"]; "IPaddrSet" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="LinkedSet child class with different target filter. The"]; "LinkedSet" -> "IPaddrSet" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Interface" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Objects of this class represent network interface and"]; "Transactional" -> "Interface" [arrowsize=0.5,style="setlinewidth(0.5)"]; "LinkedSet" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Utility class, used by `Interface` to track ip addresses"]; "MPLSRoute" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "BaseRoute" -> "MPLSRoute" [arrowsize=0.5,style="setlinewidth(0.5)"]; "MPLSTable" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "RoutingTable" -> "MPLSTable" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Metrics" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Transactional" -> "Metrics" [arrowsize=0.5,style="setlinewidth(0.5)"]; "NextHopSet" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "LinkedSet" -> "NextHopSet" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Route" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "BaseRoute" -> "Route" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RoutingTable" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "RoutingTableSet" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Rule" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Persistent transactional rule object"]; "Transactional" -> "Rule" [arrowsize=0.5,style="setlinewidth(0.5)"]; "RulesDict" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Transactional" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Utility class that implements common transactional logic."]; "Dotkeys" -> "Transactional" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Via" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "Transactional" -> "Via" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Internet protocols

Beside of the netlink protocols, the library implements a limited set of supplementary internet protocol to play with.

digraph inheritance15756ada77 { bgcolor=transparent; rankdir=LR; ratio=auto; size="8.0, 12.0"; "dhcp4msg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "dhcpmsg" -> "dhcp4msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "dhcpmsg" [URL="dhcp.html#pyroute2.dhcp.dhcpmsg",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "msg" -> "dhcpmsg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ethmsg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "msg" -> "ethmsg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ip4msg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "msg" -> "ip4msg" [arrowsize=0.5,style="setlinewidth(0.5)"]; "msg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "udp4_pseudo_header" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "msg" -> "udp4_pseudo_header" [arrowsize=0.5,style="setlinewidth(0.5)"]; "udpmsg" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled"]; "msg" -> "udpmsg" [arrowsize=0.5,style="setlinewidth(0.5)"]; }