Class: PacketGen::Header::NetBIOS::Session
- Inherits:
-
Base
- Object
- Types::Fields
- Base
- PacketGen::Header::NetBIOS::Session
- Defined in:
- lib/packetgen/header/netbios/session.rb
Overview
NetBIOS Session Service messages.
Constant Summary collapse
- TCP_PORT =
Port number for NetBIOS Session Service over TCP
139- TYPES =
Session packet types
{ 'message' => 0, 'request' => 0x81, 'positive_response' => 0x82, 'negative_response' => 0x83, 'retarget_response' => 0x84, 'keep_alive' => 0x85, }.freeze
Instance Attribute Summary collapse
- #body ⇒ String
-
#length ⇒ Integer
17-bit session packet length.
-
#type ⇒ Integer
8-bit session packet type.
Attributes inherited from Base
Instance Method Summary collapse
- #added_to_packet(packet) ⇒ Object private
-
#calc_length ⇒ Integer
Compute and set #length field.
Methods inherited from Base
bind, bind_header, calculate_and_set_length, #header_id, inherited, #initialize, #ip_header, known_headers, #ll_header, #method_name, #parse?, #protocol_name, protocol_name
Methods inherited from Types::Fields
#[], #[]=, #bits_on, define_bit_fields_on, define_field, define_field_after, define_field_before, delete_field, fields, #fields, #force_binary, inherited, #initialize, #inspect, #is_optional?, #is_present?, #offset_of, #optional?, #optional_fields, #present?, #read, remove_bit_fields_on, remove_field, #sz, #to_h, #to_s, update_field
Constructor Details
This class inherits a constructor from PacketGen::Header::Base
Instance Attribute Details
#body ⇒ String
40 |
# File 'lib/packetgen/header/netbios/session.rb', line 40 define_field :body, Types::String |
Instance Method Details
#added_to_packet(packet) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method is used internally by PacketGen and should not be directly called
53 54 55 56 57 |
# File 'lib/packetgen/header/netbios/session.rb', line 53 def added_to_packet(packet) return unless packet.is? 'TCP' return unless packet.tcp.sport.zero? packet.tcp.sport = TCP_PORT end |
#calc_length ⇒ Integer
Compute and set #length field
44 45 46 |
# File 'lib/packetgen/header/netbios/session.rb', line 44 def calc_length Base.calculate_and_set_length(self, header_in_size: false) end |