class Arachni::State::Framework::RPC
State
information for {Arachni::RPC::Server::Framework}.
@author Tasos “Zapotek” Laskos <tasos.laskos@arachni-scanner.com>
Attributes
distributed_elements[R]
@return [Set]
distributed_pages[R]
@return [Support::LookUp::HashSet]
Public Class Methods
load( directory )
click to toggle source
# File lib/arachni/state/framework/rpc.rb, line 44 def self.load( directory ) rpc = new rpc.distributed_elements.merge Marshal.load( IO.binread( "#{directory}/distributed_elements" ) ) rpc.distributed_pages.merge Marshal.load( IO.binread( "#{directory}/distributed_pages" ) ) rpc end
new()
click to toggle source
# File lib/arachni/state/framework/rpc.rb, line 24 def initialize @distributed_pages = Support::LookUp::HashSet.new( hasher: :persistent_hash ) @distributed_elements = Set.new end
Public Instance Methods
clear()
click to toggle source
# File lib/arachni/state/framework/rpc.rb, line 53 def clear @distributed_pages.clear @distributed_elements.clear end
dump( directory )
click to toggle source
# File lib/arachni/state/framework/rpc.rb, line 36 def dump( directory ) FileUtils.mkdir_p( directory ) %w(distributed_pages distributed_elements).each do |attribute| IO.binwrite( "#{directory}/#{attribute}", Marshal.dump( send(attribute) ) ) end end
statistics()
click to toggle source
# File lib/arachni/state/framework/rpc.rb, line 29 def statistics { distributed_pages: @distributed_pages.size, distributed_elements: @distributed_elements.size } end