File Coverage

blib/lib/Socket/Netlink/Route_const.pm
Criterion Covered Total %
statement 330 381 86.6
branch 0 28 0.0
condition n/a
subroutine 110 124 88.7
pod 0 14 0.0
total 440 547 80.4


line stmt bran cond sub pod time code
1             package Socket::Netlink::Route;
2             # This module was generated automatically by ExtUtils::H2PM from lib/Socket/Netlink/Route_const.pm.PL
3              
4 1     1   6 use Carp;
  1         2  
  1         321  
5             push @EXPORT, 'NETLINK_ROUTE', 'RTM_NEWLINK', 'RTM_DELLINK', 'RTM_GETLINK', 'RTM_SETLINK', 'pack_ifinfomsg', 'unpack_ifinfomsg', 'IFLA_UNSPEC', 'IFLA_ADDRESS', 'IFLA_BROADCAST', 'IFLA_IFNAME', 'IFLA_MTU', 'IFLA_LINK', 'IFLA_QDISC', 'IFLA_STATS', 'IFLA_COST', 'IFLA_PRIORITY', 'IFLA_MASTER', 'IFLA_WIRELESS', 'IFLA_PROTINFO', 'IFLA_TXQLEN', 'IFLA_MAP', 'IFLA_WEIGHT', 'IFLA_OPERSTATE', 'IFLA_LINKMODE', 'IFLA_LINKINFO', 'IFLA_NET_NS_PID', 'pack_rtnl_link_stats', 'unpack_rtnl_link_stats', 'RTM_NEWADDR', 'RTM_DELADDR', 'RTM_GETADDR', 'pack_ifaddrmsg', 'unpack_ifaddrmsg', 'IFA_UNSPEC', 'IFA_ADDRESS', 'IFA_LOCAL', 'IFA_LABEL', 'IFA_BROADCAST', 'IFA_ANYCAST', 'IFA_CACHEINFO', 'pack_ifa_cacheinfo', 'unpack_ifa_cacheinfo', 'RTM_NEWROUTE', 'RTM_DELROUTE', 'RTM_GETROUTE', 'pack_rtmsg', 'unpack_rtmsg', 'RTN_UNSPEC', 'RTN_UNICAST', 'RTN_LOCAL', 'RTN_BROADCAST', 'RTN_ANYCAST', 'RTN_MULTICAST', 'RTN_BLACKHOLE', 'RTN_UNREACHABLE', 'RTN_PROHIBIT', 'RTN_THROW', 'RTN_NAT', 'RTN_XRESOLVE', 'RTPROT_UNSPEC', 'RTPROT_REDIRECT', 'RTPROT_KERNEL', 'RTPROT_BOOT', 'RTPROT_STATIC', 'RT_SCOPE_UNIVERSE', 'RT_SCOPE_SITE', 'RT_SCOPE_LINK', 'RT_SCOPE_HOST', 'RT_SCOPE_NOWHERE', 'RTM_F_NOTIFY', 'RTM_F_CLONED', 'RTM_F_EQUALIZE', 'RT_TABLE_UNSPEC', 'RT_TABLE_DEFAULT', 'RT_TABLE_MAIN', 'RT_TABLE_LOCAL', 'RTA_UNSPEC', 'RTA_DST', 'RTA_SRC', 'RTA_IIF', 'RTA_OIF', 'RTA_GATEWAY', 'RTA_PRIORITY', 'RTA_PREFSRC', 'RTA_METRICS', 'RTA_MULTIPATH', 'RTA_PROTOINFO', 'RTA_FLOW', 'RTA_CACHEINFO', 'RTM_NEWNEIGH', 'RTM_DELNEIGH', 'RTM_GETNEIGH', 'pack_ndmsg', 'unpack_ndmsg', 'NUD_INCOMPLETE', 'NUD_REACHABLE', 'NUD_STALE', 'NUD_DELAY', 'NUD_PROBE', 'NUD_FAILED', 'NUD_NOARP', 'NUD_PERMANENT', 'NTF_PROXY', 'NTF_ROUTER', 'NDA_UNSPEC', 'NDA_DST', 'NDA_LLADDR', 'NDA_CACHEINFO', 'pack_nda_cacheinfo', 'unpack_nda_cacheinfo', 'RTMGRP_LINK', 'RTMGRP_NOTIFY', 'RTMGRP_NEIGH', 'RTMGRP_TC', 'RTMGRP_IPV4_IFADDR', 'RTMGRP_IPV4_MROUTE', 'RTMGRP_IPV4_ROUTE', 'RTMGRP_IPV4_RULE', 'RTMGRP_IPV6_IFADDR', 'RTMGRP_IPV6_MROUTE', 'RTMGRP_IPV6_ROUTE', 'RTMGRP_IPV6_IFINFO';
6 1     1   8 use constant NETLINK_ROUTE => 0;
  1         2  
  1         84  
7 1     1   5 use constant RTM_NEWLINK => 16;
  1         2  
  1         59  
8 1     1   5 use constant RTM_DELLINK => 17;
  1         2  
  1         49  
9 1     1   4 use constant RTM_GETLINK => 18;
  1         2  
  1         48  
10 1     1   5 use constant RTM_SETLINK => 19;
  1         2  
  1         176  
11              
12             sub pack_ifinfomsg
13             {
14 0 0   0 0   @_ >= 5 or croak "usage: pack_ifinfomsg(ifi_family, ifi_type, ifi_index, ifi_flags, ifi_change, [tail])";
15 0           my @v = @_;
16 0           pack "C xS l L L a*", @v;
17             }
18              
19             sub unpack_ifinfomsg
20             {
21 0 0   0 0   length $_[0] >= 16 or croak "unpack_ifinfomsg: expected 16 bytes, got " . length $_[0];
22 0           my @v = unpack "C xS l L L a*", $_[0];
23 0           @v;
24             }
25 1     1   5 use constant IFLA_UNSPEC => 0;
  1         3  
  1         68  
26 1     1   6 use constant IFLA_ADDRESS => 1;
  1         2  
  1         55  
27 1     1   6 use constant IFLA_BROADCAST => 2;
  1         1  
  1         43  
28 1     1   13 use constant IFLA_IFNAME => 3;
  1         1  
  1         53  
29 1     1   5 use constant IFLA_MTU => 4;
  1         2  
  1         46  
30 1     1   5 use constant IFLA_LINK => 5;
  1         1  
  1         55  
31 1     1   6 use constant IFLA_QDISC => 6;
  1         1  
  1         52  
32 1     1   6 use constant IFLA_STATS => 7;
  1         2  
  1         172  
33 1     1   17 use constant IFLA_COST => 8;
  1         2  
  1         55  
34 1     1   5 use constant IFLA_PRIORITY => 9;
  1         1  
  1         34  
35 1     1   5 use constant IFLA_MASTER => 10;
  1         1  
  1         46  
36 1     1   4 use constant IFLA_WIRELESS => 11;
  1         2  
  1         51  
37 1     1   6 use constant IFLA_PROTINFO => 12;
  1         2  
  1         43  
38 1     1   5 use constant IFLA_TXQLEN => 13;
  1         2  
  1         51  
39 1     1   26 use constant IFLA_MAP => 14;
  1         3  
  1         46  
40 1     1   5 use constant IFLA_WEIGHT => 15;
  1         3  
  1         44  
41 1     1   5 use constant IFLA_OPERSTATE => 16;
  1         2  
  1         51  
42 1     1   7 use constant IFLA_LINKMODE => 17;
  1         2  
  1         60  
43 1     1   5 use constant IFLA_LINKINFO => 18;
  1         2  
  1         49  
44 1     1   5 use constant IFLA_NET_NS_PID => 19;
  1         1  
  1         902  
45              
46             sub pack_rtnl_link_stats
47             {
48 0 0   0 0   ref($_[0]) eq "HASH" or croak "usage: pack_rtnl_link_stats(\%args)";
49 0           my @v = @{$_[0]}{'rx_packets', 'tx_packets', 'rx_bytes', 'tx_bytes', 'rx_errors', 'tx_errors', 'rx_dropped', 'tx_dropped', 'multicast', 'collisions', 'rx_length_errors', 'rx_over_errors', 'rx_crc_errors', 'rx_frame_errors', 'rx_fifo_errors', 'rx_missed_errors', 'tx_aborted_errors', 'tx_carrier_errors', 'tx_fifo_errors', 'tx_heartbeat_errors', 'tx_window_errors', 'rx_compressed', 'tx_compressed'};
  0            
50 0           pack "L L L L L L L L L L L L L L L L L L L L L L L ", @v;
51             }
52              
53             sub unpack_rtnl_link_stats
54             {
55 0 0   0 0   length $_[0] == 92 or croak "unpack_rtnl_link_stats: expected 92 bytes, got " . length $_[0];
56 0           my @v = unpack "L L L L L L L L L L L L L L L L L L L L L L L ", $_[0];
57 0           my %ret; @ret{'rx_packets', 'tx_packets', 'rx_bytes', 'tx_bytes', 'rx_errors', 'tx_errors', 'rx_dropped', 'tx_dropped', 'multicast', 'collisions', 'rx_length_errors', 'rx_over_errors', 'rx_crc_errors', 'rx_frame_errors', 'rx_fifo_errors', 'rx_missed_errors', 'tx_aborted_errors', 'tx_carrier_errors', 'tx_fifo_errors', 'tx_heartbeat_errors', 'tx_window_errors', 'rx_compressed', 'tx_compressed'} = @v;
  0            
58 0           \%ret;
59             }
60 1     1   6 use constant RTM_NEWADDR => 20;
  1         1  
  1         45  
61 1     1   5 use constant RTM_DELADDR => 21;
  1         1  
  1         51  
62 1     1   5 use constant RTM_GETADDR => 22;
  1         2  
  1         177  
63              
64             sub pack_ifaddrmsg
65             {
66 0 0   0 0   @_ >= 5 or croak "usage: pack_ifaddrmsg(ifa_family, ifa_prefixlen, ifa_flags, ifa_scope, ifa_index, [tail])";
67 0           my @v = @_;
68 0           pack "C C C C L a*", @v;
69             }
70              
71             sub unpack_ifaddrmsg
72             {
73 0 0   0 0   length $_[0] >= 8 or croak "unpack_ifaddrmsg: expected 8 bytes, got " . length $_[0];
74 0           my @v = unpack "C C C C L a*", $_[0];
75 0           @v;
76             }
77 1     1   5 use constant IFA_UNSPEC => 0;
  1         1  
  1         48  
78 1     1   4 use constant IFA_ADDRESS => 1;
  1         2  
  1         42  
79 1     1   5 use constant IFA_LOCAL => 2;
  1         1  
  1         38  
80 1     1   5 use constant IFA_LABEL => 3;
  1         1  
  1         50  
81 1     1   5 use constant IFA_BROADCAST => 4;
  1         1  
  1         33  
82 1     1   4 use constant IFA_ANYCAST => 5;
  1         1  
  1         39  
83 1     1   3 use constant IFA_CACHEINFO => 6;
  1         2  
  1         174  
84              
85             sub pack_ifa_cacheinfo
86             {
87 0 0   0 0   ref($_[0]) eq "HASH" or croak "usage: pack_ifa_cacheinfo(\%args)";
88 0           my @v = @{$_[0]}{'ifa_prefered', 'ifa_valid', 'cstamp', 'tstamp'};
  0            
89 0           pack "L L L L ", @v;
90             }
91              
92             sub unpack_ifa_cacheinfo
93             {
94 0 0   0 0   length $_[0] == 16 or croak "unpack_ifa_cacheinfo: expected 16 bytes, got " . length $_[0];
95 0           my @v = unpack "L L L L ", $_[0];
96 0           my %ret; @ret{'ifa_prefered', 'ifa_valid', 'cstamp', 'tstamp'} = @v;
  0            
97 0           \%ret;
98             }
99 1     1   5 use constant RTM_NEWROUTE => 24;
  1         1  
  1         35  
100 1     1   3 use constant RTM_DELROUTE => 25;
  1         2  
  1         33  
101 1     1   4 use constant RTM_GETROUTE => 26;
  1         1  
  1         156  
102              
103             sub pack_rtmsg
104             {
105 0 0   0 0   @_ >= 9 or croak "usage: pack_rtmsg(rtm_family, rtm_dst_len, rtm_src_len, rtm_tos, rtm_table, rtm_protocol, rtm_scope, rtm_type, rtm_flags, [tail])";
106 0           my @v = @_;
107 0           pack "C C C C C C C C L a*", @v;
108             }
109              
110             sub unpack_rtmsg
111             {
112 0 0   0 0   length $_[0] >= 12 or croak "unpack_rtmsg: expected 12 bytes, got " . length $_[0];
113 0           my @v = unpack "C C C C C C C C L a*", $_[0];
114 0           @v;
115             }
116 1     1   5 use constant RTN_UNSPEC => 0;
  1         8  
  1         38  
117 1     1   4 use constant RTN_UNICAST => 1;
  1         1  
  1         41  
118 1     1   3 use constant RTN_LOCAL => 2;
  1         1  
  1         28  
119 1     1   4 use constant RTN_BROADCAST => 3;
  1         1  
  1         32  
120 1     1   3 use constant RTN_ANYCAST => 4;
  1         1  
  1         32  
121 1     1   4 use constant RTN_MULTICAST => 5;
  1         1  
  1         27  
122 1     1   4 use constant RTN_BLACKHOLE => 6;
  1         1  
  1         41  
123 1     1   5 use constant RTN_UNREACHABLE => 7;
  1         1  
  1         47  
124 1     1   4 use constant RTN_PROHIBIT => 8;
  1         2  
  1         47  
125 1     1   4 use constant RTN_THROW => 9;
  1         2  
  1         42  
126 1     1   4 use constant RTN_NAT => 10;
  1         2  
  1         42  
127 1     1   5 use constant RTN_XRESOLVE => 11;
  1         2  
  1         49  
128 1     1   4 use constant RTPROT_UNSPEC => 0;
  1         1  
  1         28  
129 1     1   4 use constant RTPROT_REDIRECT => 1;
  1         1  
  1         33  
130 1     1   4 use constant RTPROT_KERNEL => 2;
  1         1  
  1         32  
131 1     1   4 use constant RTPROT_BOOT => 3;
  1         1  
  1         46  
132 1     1   4 use constant RTPROT_STATIC => 4;
  1         2  
  1         49  
133 1     1   4 use constant RT_SCOPE_UNIVERSE => 0;
  1         1  
  1         29  
134 1     1   4 use constant RT_SCOPE_SITE => 200;
  1         1  
  1         32  
135 1     1   3 use constant RT_SCOPE_LINK => 253;
  1         2  
  1         31  
136 1     1   3 use constant RT_SCOPE_HOST => 254;
  1         1  
  1         27  
137 1     1   4 use constant RT_SCOPE_NOWHERE => 255;
  1         1  
  1         37  
138 1     1   3 use constant RTM_F_NOTIFY => 256;
  1         2  
  1         33  
139 1     1   5 use constant RTM_F_CLONED => 512;
  1         7  
  1         69  
140 1     1   4 use constant RTM_F_EQUALIZE => 1024;
  1         1  
  1         30  
141 1     1   3 use constant RT_TABLE_UNSPEC => 0;
  1         2  
  1         26  
142 1     1   4 use constant RT_TABLE_DEFAULT => 253;
  1         1  
  1         32  
143 1     1   4 use constant RT_TABLE_MAIN => 254;
  1         1  
  1         27  
144 1     1   8 use constant RT_TABLE_LOCAL => 255;
  1         1  
  1         26  
145 1     1   3 use constant RTA_UNSPEC => 0;
  1         1  
  1         32  
146 1     1   4 use constant RTA_DST => 1;
  1         1  
  1         56  
147 1     1   5 use constant RTA_SRC => 2;
  1         2  
  1         30  
148 1     1   5 use constant RTA_IIF => 3;
  1         1  
  1         43  
149 1     1   4 use constant RTA_OIF => 4;
  1         1  
  1         35  
150 1     1   5 use constant RTA_GATEWAY => 5;
  1         1  
  1         41  
151 1     1   5 use constant RTA_PRIORITY => 6;
  1         1  
  1         47  
152 1     1   4 use constant RTA_PREFSRC => 7;
  1         2  
  1         41  
153 1     1   4 use constant RTA_METRICS => 8;
  1         1  
  1         30  
154 1     1   4 use constant RTA_MULTIPATH => 9;
  1         7  
  1         44  
155 1     1   7 use constant RTA_PROTOINFO => 10;
  1         2  
  1         48  
156 1     1   6 use constant RTA_FLOW => 11;
  1         1  
  1         38  
157 1     1   4 use constant RTA_CACHEINFO => 12;
  1         1  
  1         42  
158 1     1   4 use constant RTM_NEWNEIGH => 28;
  1         2  
  1         29  
159 1     1   4 use constant RTM_DELNEIGH => 29;
  1         1  
  1         34  
160 1     1   4 use constant RTM_GETNEIGH => 30;
  1         2  
  1         157  
161              
162             sub pack_ndmsg
163             {
164 0 0   0 0   @_ >= 5 or croak "usage: pack_ndmsg(ndm_family, ndm_ifindex, ndm_state, ndm_flags, ndm_type, [tail])";
165 0           my @v = @_;
166 0           pack "C xxxl S C C a*", @v;
167             }
168              
169             sub unpack_ndmsg
170             {
171 0 0   0 0   length $_[0] >= 12 or croak "unpack_ndmsg: expected 12 bytes, got " . length $_[0];
172 0           my @v = unpack "C xxxl S C C a*", $_[0];
173 0           @v;
174             }
175 1     1   5 use constant NUD_INCOMPLETE => 1;
  1         1  
  1         37  
176 1     1   4 use constant NUD_REACHABLE => 2;
  1         1  
  1         43  
177 1     1   4 use constant NUD_STALE => 4;
  1         2  
  1         36  
178 1     1   5 use constant NUD_DELAY => 8;
  1         1  
  1         31  
179 1     1   4 use constant NUD_PROBE => 16;
  1         1  
  1         41  
180 1     1   5 use constant NUD_FAILED => 32;
  1         2  
  1         41  
181 1     1   20 use constant NUD_NOARP => 64;
  1         2  
  1         59  
182 1     1   5 use constant NUD_PERMANENT => 128;
  1         2  
  1         51  
183 1     1   5 use constant NTF_PROXY => 8;
  1         2  
  1         58  
184 1     1   5 use constant NTF_ROUTER => 128;
  1         2  
  1         59  
185 1     1   5 use constant NDA_UNSPEC => 0;
  1         1  
  1         33  
186 1     1   4 use constant NDA_DST => 1;
  1         7  
  1         33  
187 1     1   6 use constant NDA_LLADDR => 2;
  1         1  
  1         51  
188 1     1   5 use constant NDA_CACHEINFO => 3;
  1         2  
  1         196  
189              
190             sub pack_nda_cacheinfo
191             {
192 0 0   0 0   ref($_[0]) eq "HASH" or croak "usage: pack_nda_cacheinfo(\%args)";
193 0           my @v = @{$_[0]}{'ndm_confirmed', 'ndm_used', 'ndm_updated', 'ndm_refcnt'};
  0            
194 0           pack "L L L L ", @v;
195             }
196              
197             sub unpack_nda_cacheinfo
198             {
199 0 0   0 0   length $_[0] == 16 or croak "unpack_nda_cacheinfo: expected 16 bytes, got " . length $_[0];
200 0           my @v = unpack "L L L L ", $_[0];
201 0           my %ret; @ret{'ndm_confirmed', 'ndm_used', 'ndm_updated', 'ndm_refcnt'} = @v;
  0            
202 0           \%ret;
203             }
204 1     1   5 use constant RTMGRP_LINK => 1;
  1         1  
  1         39  
205 1     1   5 use constant RTMGRP_NOTIFY => 2;
  1         2  
  1         45  
206 1     1   6 use constant RTMGRP_NEIGH => 4;
  1         1  
  1         41  
207 1     1   4 use constant RTMGRP_TC => 8;
  1         2  
  1         38  
208 1     1   4 use constant RTMGRP_IPV4_IFADDR => 16;
  1         2  
  1         31  
209 1     1   4 use constant RTMGRP_IPV4_MROUTE => 32;
  1         1  
  1         36  
210 1     1   4 use constant RTMGRP_IPV4_ROUTE => 64;
  1         1  
  1         34  
211 1     1   11 use constant RTMGRP_IPV4_RULE => 128;
  1         2  
  1         31  
212 1     1   5 use constant RTMGRP_IPV6_IFADDR => 256;
  1         1  
  1         45  
213 1     1   13 use constant RTMGRP_IPV6_MROUTE => 512;
  1         2  
  1         57  
214 1     1   6 use constant RTMGRP_IPV6_ROUTE => 1024;
  1         1  
  1         41  
215 1     1   6 use constant RTMGRP_IPV6_IFINFO => 2048;
  1         2  
  1         64  
216              
217             1;