Class: RubySMB::Dispatcher::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_smb/dispatcher/base.rb

Overview

Provides the base class for the packet dispatcher.

Direct Known Subclasses

Socket

Instance Method Summary collapse

Instance Method Details

#nbss(packet) ⇒ String

Creates a NetBIOS Session Service (NBSS) header

Parameters:

  • packet (#do_num_bytes)

    the packet to be sent

Returns:

  • (String)

    NBSS header to go in front of packet



9
10
11
12
13
14
# File 'lib/ruby_smb/dispatcher/base.rb', line 9

def nbss(packet)
  nbss = RubySMB::Nbss::SessionHeader.new
  nbss.session_packet_type = RubySMB::Nbss::SESSION_MESSAGE
  nbss.packet_length       = packet.do_num_bytes
  nbss.to_binary_s
end

#recv_packetObject

This method is abstract.

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/ruby_smb/dispatcher/base.rb', line 22

def recv_packet
  raise NotImplementedError
end

#send_packet(_packet) ⇒ Object

This method is abstract.

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/ruby_smb/dispatcher/base.rb', line 17

def send_packet(_packet)
  raise NotImplementedError
end