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

Header Definition

  EthOui :oui  # See EthOui
  EthNic :nic  # See EthNic
Methods
N
R
T
Class Public methods
new(args={})
# File lib/packetfu/protos/eth.rb, line 106
                def initialize(args={})
                        super(
                        EthOui.new.read(args[:oui]),
                        EthNic.new.read(args[:nic]))
                end
Instance Public methods
read(str)

Reads a string to populate the object.

# File lib/packetfu/protos/eth.rb, line 118
                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()

Returns the object in string form.

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