Parent

Methods

Class/Module Index [+]

Quicksearch

PacketFu::EthMac

EthMac is the combination of an EthOui and EthNic, used in EthHeader.

Header Definition

EthOui :oui  # See EthOui
EthNic :nic  # See EthNic

Public Class Methods

new(args={}) click to toggle source
# File lib/packetfu/protos/eth/header.rb, line 105
def initialize(args={})
  super(
  EthOui.new.read(args[:oui]),
  EthNic.new.read(args[:nic]))
end

Public Instance Methods

read(str) click to toggle source

Reads a string to populate the object.

# File lib/packetfu/protos/eth/header.rb, line 117
def read(str)
  force_binary(str)
  return self if str.nil?
  self.oui.read str[0,3]
  self.nic.read str[3,3]
  self
end
to_s() click to toggle source

Returns the object in string form.

# File lib/packetfu/protos/eth/header.rb, line 112
def to_s
  "#{self[:oui]}#{self[:nic]}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.