Class: Rex::Proto::LDAP::Server::MockLdapClient
- Inherits:
-
Object
- Object
- Rex::Proto::LDAP::Server::MockLdapClient
- Defined in:
- lib/rex/proto/ldap/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) ⇒ MockLdapClient
constructor
Create mock LDAP client.
-
#mock_ldap_client? ⇒ Boolean
Test method to prevent GC/ObjectSpace abuse via class lookups.
- #write(data) ⇒ Object
Constructor Details
#initialize(host, port, sock) ⇒ MockLdapClient
Create mock LDAP client
32 33 34 35 36 |
# File 'lib/rex/proto/ldap/server.rb', line 32 def initialize(host, port, sock) @peerhost = host @peerport = port @srvsock = sock end |
Instance Attribute Details
#peerhost ⇒ Object (readonly)
Returns the value of attribute peerhost.
24 25 26 |
# File 'lib/rex/proto/ldap/server.rb', line 24 def peerhost @peerhost end |
#peerport ⇒ Object (readonly)
Returns the value of attribute peerport.
24 25 26 |
# File 'lib/rex/proto/ldap/server.rb', line 24 def peerport @peerport end |
#srvsock ⇒ Object (readonly)
Returns the value of attribute srvsock.
24 25 26 |
# File 'lib/rex/proto/ldap/server.rb', line 24 def srvsock @srvsock end |
Instance Method Details
#mock_ldap_client? ⇒ Boolean
Test method to prevent GC/ObjectSpace abuse via class lookups
41 42 43 |
# File 'lib/rex/proto/ldap/server.rb', line 41 def mock_ldap_client? true end |
#write(data) ⇒ Object
45 46 47 |
# File 'lib/rex/proto/ldap/server.rb', line 45 def write(data) srvsock.sendto(data, peerhost, peerport) end |