Class: Arpoon::Table
Defined Under Namespace
Classes: Entry
Constant Summary collapse
- Types =
{ 0 => :netrom, 1 => :ether, 2 => :eether, 3 => :ax25, 4 => :pronet, 5 => :chaos, 6 => :ieee802, 7 => :arcnet, 8 => :appletlk, 15 => :dlci, 19 => :atm, 23 => :metricom, 24 => :ieee1394, 27 => :eui64, 32 => :infiniband }
- Flags =
Bitmap.new( completed: 0x02, permanent: 0x04, publish: 0x08, has_requested_trailers: 0x10, wants_netmask: 0x20, dont_publish: 0x40 )
Instance Method Summary collapse
- #[](what) ⇒ Object
- #each(device = nil) ⇒ Object
-
#initialize ⇒ Table
constructor
A new instance of Table.
Constructor Details
Instance Method Details
#[](what) ⇒ Object
93 94 95 96 97 |
# File 'lib/arpoon/table.rb', line 93 def [] (what) find {|entry| what == entry.ip || what == entry.mac } end |
#each(device = nil) ⇒ Object
83 84 85 86 87 88 89 90 91 |
# File 'lib/arpoon/table.rb', line 83 def each (device = nil) return enum_for :each, device unless block_given? @entries.each {|entry| yield entry if !device || device.to_s == entry.device } self end |