Class: Rex::Proto::DNS::Server::MockDnsClient
- Inherits:
-
Object
- Object
- Rex::Proto::DNS::Server::MockDnsClient
- Defined in:
- lib/rex/proto/dns/server.rb
Instance Attribute Summary collapse
-
#peerhost ⇒ Object
readonly
Returns the value of attribute peerhost.
-
#peerport ⇒ Object
readonly
Returns the value of attribute peerport.
-
#srvsock ⇒ Object
readonly
Returns the value of attribute srvsock.
Instance Method Summary collapse
-
#initialize(host, port, sock) ⇒ MockDnsClient
constructor
Create mock DNS client.
-
#mock_dns_client? ⇒ Boolean
Test method to prevent GC/ObjectSpace abuse via class lookups.
- #write(data) ⇒ Object
Constructor Details
#initialize(host, port, sock) ⇒ MockDnsClient
Create mock DNS client
19 20 21 22 23 |
# File 'lib/rex/proto/dns/server.rb', line 19 def initialize(host, port, sock) @peerhost = host @peerport = port @srvsock = sock end |
Instance Attribute Details
#peerhost ⇒ Object (readonly)
Returns the value of attribute peerhost.
12 13 14 |
# File 'lib/rex/proto/dns/server.rb', line 12 def peerhost @peerhost end |
#peerport ⇒ Object (readonly)
Returns the value of attribute peerport.
12 13 14 |
# File 'lib/rex/proto/dns/server.rb', line 12 def peerport @peerport end |
#srvsock ⇒ Object (readonly)
Returns the value of attribute srvsock.
12 13 14 |
# File 'lib/rex/proto/dns/server.rb', line 12 def srvsock @srvsock end |
Instance Method Details
#mock_dns_client? ⇒ Boolean
Test method to prevent GC/ObjectSpace abuse via class lookups
28 29 30 |
# File 'lib/rex/proto/dns/server.rb', line 28 def mock_dns_client? true end |
#write(data) ⇒ Object
32 33 34 |
# File 'lib/rex/proto/dns/server.rb', line 32 def write(data) srvsock.sendto(data, peerhost, peerport) end |