lib/rethtool/interface_settings.rb in rethtool-0.0.1 vs lib/rethtool/interface_settings.rb in rethtool-0.0.2

- old
+ new

@@ -1,13 +1,18 @@ +require 'rethtool' require 'rethtool/ethtool_cmd' # All of the settings of a network interface. Ridiculous amounts of # info is available; we only support a subset of them at present. # # Create an instance of this class with the interface name as the only # parameter, then use the available instance methods to get the info you -# seek. +# seek: +# +# if = Rethtool::InterfaceSettings.new("eth0") +# puts "Current link mode is #{if.current_mode}" +# class Rethtool::InterfaceSettings Mode = Struct.new(:speed, :duplex, :media) # A struct to represent interface modes (supported, advertised, current) # @@ -29,13 +34,13 @@ end # Create a new InterfaceSettings object. Simply pass it the name of the # interface you want to get the settings for. def initialize(interface) - cmd = EthtoolCmd.new - cmd.cmd = REthtool::ETHTOOL_CMD_GSET + cmd = Rethtool::EthtoolCmd.new + cmd.cmd = Rethtool::ETHTOOL_CMD_GSET - @data = REthtool.ioctl(interface, cmd) + @data = Rethtool.ioctl(interface, cmd) end # Return an array of the modes supported by the interface. Returns an # array of Mode objects. def supported_modes