IO::Socket::Netlink::Route - Object interface to NETLINK_ROUTE netlink protocol sockets
IO::Socket::Netlink::Route
NETLINK_ROUTE
This subclass of IO::Socket::Netlink implements the NETLINK_ROUTE protocol. This protocol allows communication with the Linux kernel's networking stack, allowing querying or modification of interfaces, addresses, routes, and other networking properties.
This module is currently a work-in-progress, and this documentation is fairly minimal. The reader is expected to be familiar with NETLINK_ROUTE, as it currently only gives a fairly minimal description of the Perl-level wrapping of the kernel level concepts. For more information see the documentation in rtnetlink(7).
Each message type falls into one of the following subclasses, chosen by the value of the nlmsg_type field. Each subclass provides access to the field headers of its message body, and netlink attributes.
nlmsg_type
Relates to a network interface. Used by the following message types
RTM_NEWLINK
RTM_DELLINK
RTM_GETLINK
Provides the following header field accessors
ifi_family
ifi_type
ifi_index
ifi_flags
ifi_change
Provides the following netlink attributes
address => STRING
broadcast => STRING
ifname => STRING
mtu => INT
qdisc => STRING
stats => HASH
txqlen => INT
operstate => INT
linkmode => INT
Relates to an address present on an interface. Used by the following message types
RTM_NEWADDR
RTM_DELADDR
RTM_GETADDR
ifa_family
ifa_prefixlen
ifa_flags
ifa_scope
ifa_index
local => STRING
label => STRING
anycast => STRING
cacheinfo => HASH
Sets or returns both the address netlink attribute, and the ifa_prefixlen header value, in the form
address
address/ifa_prefixlen
Relates to a routing table entry. Used by the following message types
RTM_NEWROUTE
RTM_DELROUTE
RTM_GETROUTE
rtm_family
rtm_dst_len
rtm_src_len
rtm_tos
rtm_table
rtm_protocol
rtm_scope
rtm_type
rtm_flags
dst => STRING
src => STRING
iif => INT
oif => INT
gateway => STRING
priority => INT
metrics => INT
Sets or returns the src netlink attribute and the rtm_src_len header value, in the form
src
address/prefixlen
if the address is defined, or undef if not.
undef
Sets or returns the dst netlink attribute and the rtm_dst_len header value, in the form given above.
dst
Relates to a neighbour discovery table entry. Used by the following message types
RTM_NEWNEIGH
RTM_DELNEIGH
RTM_GETNEIGH
ndm_family
ndm_ifindex
ndm_state
ndm_flags
ndm_type
lladdr => STRING
Socket::Netlink::Route - interface to Linux's NETLINK_ROUTE netlink socket protocol
IO::Socket::Netlink - Object interface to AF_NETLINK domain sockets
AF_NETLINK
rtnetlink(7) - rtnetlink, NETLINK_ROUTE - Linux IPv4 routing socket
Paul Evans <leonerd@leonerd.org.uk>
To install Socket::Netlink::Route, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Socket::Netlink::Route
CPAN shell
perl -MCPAN -e shell install Socket::Netlink::Route
For more information on module installation, please visit the detailed CPAN module installation guide.