class PacketFu::EthNic
EthNic
is the Network Interface Controler portion of a MAC address, used in EthHeader
.
Header Definition¶ ↑
Integer:n1 Integer:n2 Integer:n3
Public Class Methods
Source
Public Instance Methods
Source
# File lib/packetfu/protos/eth/header.rb, line 88 def read(str) force_binary(str) return self if str.nil? self[:n0], self[:n1], self[:n2] = str[0,3].unpack("C3") self end
Reads a string to populate the object.
Source
# File lib/packetfu/protos/eth/header.rb, line 83 def to_s [n0,n1,n2].map {|x| x.to_i}.pack("C3") end
Returns the object in string form.