Basic NETLINK_FIREWALL support. Highlights need for struct alignment

This commit is contained in:
Brian Candler
2011-05-01 12:32:22 +01:00
parent aefd94093c
commit b78327c3b6
7 changed files with 297 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ module Netlink
code RTM_NEWLINK, RTM_DELLINK, RTM_GETLINK
field :family, :uchar # Socket::AF_*
field :pad, :uchar
field_pad
field :type, :ushort # ARPHRD_*
field :index, :int
field :flags, :uint # IFF_*
@@ -149,7 +149,7 @@ module Netlink
#
# res = nl.read_links
# p res
# [#<Netlink::IFInfo {:family=>0, :pad=>0, :type=>772, :index=>1,
# [#<Netlink::IFInfo {:family=>0, :type=>772, :index=>1,
# :flags=>65609, :change=>0, :ifname=>"lo", :txqlen=>0, :operstate=>0,
# :linkmode=>0, :mtu=>16436, :qdisc=>"noqueue", :map=>"...",
# :address=>"\x00\x00\x00\x00\x00\x00", :broadcast=>"\x00\x00\x00\x00\x00\x00",