Sha256: 3b24aa04cd0e28fee1247a0a9cefbdd84d183a5634621b381600cca2da20f386

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

module PacketGen::Plugin
  class SMB
    module Negotiate
      # A SMB_Dialect struct containing:
      # * a 8-bit {#format} field, which should be set to 0x02,
      # * a null-terminated string identifying a SMB dialect.
      # @author Sylvain Daubert
      class Dialect < PacketGen::Types::Fields
        # @!attribute format
        #  8-bit format. Should be +2+ to indicate a null-terminated string for
        #  {#dialect} field.
        #  @return [Integer]
        define_field :format, PacketGen::Types::Int8, default: 2
        # @!attribute dialect
        #  Null-terminated string identifying a SMB dialect.
        #  @return [String]
        define_field :dialect,PacketGen::Types::CString

        # @return [String]
        def to_human
          self[:dialect].to_human
        end
      end

      # Specialized {PacketGen::Types::Array} to embed {Dialect Dialects}.
      # @author Sylvain Daubert
      class ArrayOfDialect < PacketGen::Types::Array
        set_of Dialect
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
packetgen-plugin-smb-0.6.1 lib/packetgen/plugin/smb/negotiate/dialect.rb
packetgen-plugin-smb-0.6.0 lib/packetgen/plugin/smb/negotiate/dialect.rb
packetgen-plugin-smb-0.5.0 lib/packetgen/plugin/smb/negotiate/dialect.rb