Class: PacketGen::Plugin::NetBIOS::Name

Inherits:
Header::DNS::Name
  • Object
show all
Defined in:
lib/packetgen/plugin/netbios/name.rb

Overview

NetBIOS Name.

Author:

  • Sylvain Daubert

Constant Summary collapse

ENCODED_NAME_SIZE =

Size, in bytes, of an encoded NetBIOS name

32

Instance Method Summary collapse

Instance Method Details

#from_human(str) ⇒ Name

Read a NetBIOS name from a string

Parameters:

  • str (String)

Returns:



21
22
23
24
25
26
27
# File 'lib/packetgen/plugin/netbios/name.rb', line 21

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)


31
32
33
34
# File 'lib/packetgen/plugin/netbios/name.rb', line 31

def to_human
  encoded_name = super
  decode_name(encoded_name)
end