Restructure so messages and code specific to NETLINK_ROUTE are in one file
This commit is contained in:
16
examples/route_lo.rb
Normal file
16
examples/route_lo.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
LIBDIR = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
||||
$LOAD_PATH.unshift LIBDIR
|
||||
|
||||
require 'pp'
|
||||
require 'netlink/route'
|
||||
|
||||
# Example of use of low-level API for NETLINK_ROUTE socket.
|
||||
# Each of these method calls performs a netlink protocol exchange.
|
||||
|
||||
nl = Netlink::RTSocket.new
|
||||
puts "*** links ***"
|
||||
pp nl.read_links
|
||||
puts "*** addrs ***"
|
||||
pp nl.read_addrs(:family => Socket::AF_INET)
|
||||
puts "*** routes ***"
|
||||
pp nl.read_routes(:family => Socket::AF_INET)
|
Reference in New Issue
Block a user