Class: Msf::RPC::RPC_Base

Inherits:
Object
  • Object
show all
Defined in:
lib/msf/core/rpc/v10/rpc_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(service) ⇒ RPC_Base

Initializes framework, service, tokens, and users

return [void]



11
12
13
14
15
16
17
# File 'lib/msf/core/rpc/v10/rpc_base.rb', line 11

def initialize(service)
  self.service            = service
  self.framework          = service.framework
  self.tokens             = service.tokens
  self.users              = service.users
  self.job_status_tracker = service.job_status_tracker
end

Instance Attribute Details

#frameworkObject

Returns the value of attribute framework.



6
7
8
# File 'lib/msf/core/rpc/v10/rpc_base.rb', line 6

def framework
  @framework
end

#job_status_trackerObject

Returns the value of attribute job_status_tracker.



6
7
8
# File 'lib/msf/core/rpc/v10/rpc_base.rb', line 6

def job_status_tracker
  @job_status_tracker
end

#serviceObject

Returns the value of attribute service.



6
7
8
# File 'lib/msf/core/rpc/v10/rpc_base.rb', line 6

def service
  @service
end

#tokensObject

Returns the value of attribute tokens.



6
7
8
# File 'lib/msf/core/rpc/v10/rpc_base.rb', line 6

def tokens
  @tokens
end

#usersObject

Returns the value of attribute users.



6
7
8
# File 'lib/msf/core/rpc/v10/rpc_base.rb', line 6

def users
  @users
end

Instance Method Details

#error(code, message) ⇒ void

This method returns an undefined value.

Raises an Msf::RPC Exception.

Parameters:

  • code (Integer)

    The error code to raise.

  • message (String)

    The error message.

Raises:



25
26
27
# File 'lib/msf/core/rpc/v10/rpc_base.rb', line 25

def error(code, message)
  raise Msf::RPC::Exception.new(code, message)
end