Arp
Retrieve the content of the ARP cache
Installation
Add this line to your application's Gemfile:
gem 'arp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install arp
Usage
cache = Arp::Cache.new
cache.each do |entry|
puts entry.ip # => "192.168.124.2"
puts entry.hw_type # => "0x1"
puts entry.flags # => "0x2"
puts entry.hw_address # => "00:50:56:e9:27:c7"
puts entry.mask # => "*"
puts entry.device # => "eth0"
end
Limitation
Currently works only on Linux. Tested on Ubuntu 12.04.
Contributing
- Fork it ( http://github.com/
/arp/fork ) - Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request