Class: IPAddr
- Inherits:
-
Object
- Object
- IPAddr
- Defined in:
- lib/honeypot/ipaddr_ext.rb
Overview
Constant Summary collapse
- UNROUTEABLE_RANGES =
[ IPAddr.new('127.0.0.1/32'), IPAddr.new('10.0.0.0/8'), IPAddr.new('172.16.0.0/12'), IPAddr.new('192.168.0.0/16') ]
Instance Method Summary collapse
Instance Method Details
#routeable? ⇒ Boolean
15 16 17 |
# File 'lib/honeypot/ipaddr_ext.rb', line 15 def routeable? !unrouteable? end |
#unrouteable? ⇒ Boolean
10 11 12 13 |
# File 'lib/honeypot/ipaddr_ext.rb', line 10 def unrouteable? return false unless self.ipv4? UNROUTEABLE_RANGES.any? { |ipr| ipr.include? self } end |