class 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
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
Calls superclass method
Public Instance Methods
Source
# 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
Reads a string to populate the object.
Source
# File lib/packetfu/protos/eth/header.rb, line 112 def to_s "#{self[:oui]}#{self[:nic]}" end
Returns the object in string form.