Class: Rex::Proto::MsDnsp::MsDnspAddr4

Inherits:
BinData::Primitive
  • Object
show all
Defined in:
lib/rex/proto/ms_dnsp.rb

Instance Method Summary collapse

Instance Method Details

#getObject



57
58
59
# File 'lib/rex/proto/ms_dnsp.rb', line 57

def get
  Rex::Socket.addr_ntoa(self.data)
end

#set(v) ⇒ Object

Raises:

  • (TypeError)


61
62
63
64
65
# File 'lib/rex/proto/ms_dnsp.rb', line 61

def set(v)
  raise TypeError, 'must be an IPv4 address' unless Rex::Socket.is_ipv4?(v)

  self.data = Rex::Socket.addr_aton(v)
end