Method: Rex::Socket.addr_ctoa
- Defined in:
- lib/rex/socket.rb
.addr_ctoa(cidr) ⇒ Object
Resolves a CIDR bitmask into a dotted-quad. Returns nil if it’s not convertable.
300 301 302 303 |
# File 'lib/rex/socket.rb', line 300 def self.addr_ctoa(cidr) return nil unless (0..32) === cidr.to_i addr_itoa(((1 << cidr)-1) << 32-cidr) end |