Sha256: b310e4690af5bbd79fe9db9e01cff080395f8b818b8e805e82d2806c4b9e3ae4

Contents?: true

Size: 727 Bytes

Versions: 39

Compression:

Stored size: 727 Bytes

Contents

module RubySMB
  module Dispatcher
    # Provides the base class for the packet dispatcher.
    class Base
      # Creates a NetBIOS Session Service (NBSS) header
      #
      # @param packet [#do_num_bytes] the packet to be sent
      # @return [String] NBSS header to go in front of `packet`
      def nbss(packet)
        nbss = RubySMB::Nbss::SessionHeader.new
        nbss.session_packet_type = RubySMB::Nbss::SESSION_MESSAGE
        nbss.stream_protocol_length = packet.do_num_bytes.to_i
        nbss.to_binary_s
      end

      # @abstract
      def send_packet(_packet)
        raise NotImplementedError
      end

      # @abstract
      def recv_packet
        raise NotImplementedError
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
ruby_smb-3.3.12 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.11 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.10 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.9 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.7 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.6 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.5 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.4 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.3 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.2 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.1 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.3.0 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.8 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.7 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.6 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.5 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.4 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.3 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.2 lib/ruby_smb/dispatcher/base.rb
ruby_smb-3.2.1 lib/ruby_smb/dispatcher/base.rb