Class: PacketGen::Header::NetBIOS::Name

Inherits:
DNS::Name show all
Defined in:
lib/packetgen/header/netbios/name.rb

Overview

NetBIOS Name.

Author:

  • Sylvain Daubert

Since:

  • 2.5.1

Constant Summary collapse

ENCODED_NAME_SIZE =

Size, in bytes, of an encoded NetBIOS name

Since:

  • 2.5.1

32

Constants inherited from DNS::Name

DNS::Name::POINTER_MASK

Constants inherited from Types::Array

Types::Array::HUMAN_SEPARATOR

Instance Attribute Summary

Attributes inherited from DNS::Name

#dns

Instance Method Summary collapse

Methods inherited from DNS::Name

#<<, #initialize, #push, #read, #to_s

Methods inherited from Types::Array

#<<, #==, #[], #clear, #clear!, #delete, #delete_at, #each, #empty?, #first, #force_binary, #initialize, #initialize_copy, #last, #push, #read, set_of, #size, #sz, #to_a, #to_s

Constructor Details

This class inherits a constructor from PacketGen::Header::DNS::Name

Instance Method Details

#from_human(str) ⇒ Name

Read a NetBIOS name from a string

Parameters:

  • str (String)

Returns:

Since:

  • 2.5.1



23
24
25
26
27
28
29
# File 'lib/packetgen/header/netbios/name.rb', line 23

def from_human(str)
  clear
  return self if str.nil?
  encoded_name = encode_name(str)

  super(encoded_name)
end

#to_humanString

Get a human readable string

Returns:

  • (String)

Since:

  • 2.5.1



33
34
35
36
# File 'lib/packetgen/header/netbios/name.rb', line 33

def to_human
  encoded_name = super
  decode_name(encoded_name)
end