Class: PacketGen::Header::IP::Options

Inherits:
BinStruct::Array
  • Object
show all
Defined in:
lib/packetgen/header/ip/options.rb

Overview

Class to handle IP options

Author:

  • Sylvain Daubert

Constant Summary collapse

HUMAN_SEPARATOR =
';'

Instance Method Summary collapse

Instance Method Details

#to_sString

Get binary string

Returns:

  • (String)


21
22
23
24
25
# File 'lib/packetgen/header/ip/options.rb', line 21

def to_s
  str = super
  str += ([0] * (4 - (str.length % 4))).pack('C*') if str.length % 4 != 0
  str
end