Parent

Rubyipmi::Freeipmi::Lan

Attributes

channel[RW]
config[RW]
info[RW]

Public Class Methods

new(opts) click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 9
def initialize(opts)
  @config = Rubyipmi::Freeipmi::BmcConfig.new(opts)

  @info = {}
  @channel = 2
end

Public Instance Methods

dhcp?() click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 24
def dhcp?
  if @info.length < 1
    parse(@config.section("Lan_Conf"))
  end
  @info["ip_address_source"].match(/dhcp/) != nil
end
gateway() click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 59
def gateway
  if @info.length < 1
    parse(@config.section("Lan_Conf"))
  end
  @info["default_gateway_ip_address"]
end
gateway=(address) click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 86
def gateway=(address)
  @config.setsection("Lan_Conf", "Default_Gateway_IP_Address", address)
end
ip() click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 38
def ip
  if @info.length < 1
    parse(@config.section("Lan_Conf"))
  end
  @info["ip_address"]
end
ip=(address) click to toggle source

def snmp=(community)

end

# File lib/rubyipmi/freeipmi/commands/lan.rb, line 78
def ip=(address)
  @config.setsection("Lan_Conf", "IP_Address", address)
end
mac() click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 45
def mac
  if @info.length < 1
    parse(@config.section("Lan_Conf"))
  end
  @info["mac_address"]
end
netmask() click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 52
def netmask
  if @info.length < 1
    parse(@config.section("Lan_Conf"))
  end
  @info["subnet_mask"]
end
netmask=(netmask) click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 82
def netmask=(netmask)
  @config.setsection("Lan_Conf", "Subnet_Mask", netmask)
end
parse(landata) click to toggle source

def vlanid=(vlan)

end

# File lib/rubyipmi/freeipmi/commands/lan.rb, line 94
def parse(landata)
  landata.lines.each do |line|
    # clean up the data from spaces
    next if line.match(/#+/)
    next if line.match(/Section/)
    line.gsub!(/\t/, '')
    item = line.split(/\s+/)
    key = item.first.strip.downcase
    value = item.last.strip
    @info[key] = value

  end
  return @info
end
static?() click to toggle source
# File lib/rubyipmi/freeipmi/commands/lan.rb, line 31
def static?
  if @info.length < 1
    parse(@config.section("Lan_Conf"))
  end
  @info["ip_address_source"].match(/static/) != nil
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.