Class: PacketGen::Header::IP::Options
- Inherits:
-
Types::Array
- Object
- Types::Array
- PacketGen::Header::IP::Options
- Defined in:
- lib/packetgen/header/ip/options.rb
Overview
Class to handle IP options
Constant Summary collapse
- HUMAN_SEPARATOR =
';'
Instance Method Summary collapse
-
#to_s ⇒ String
Get binary string.
Methods inherited from Types::Array
#<<, #==, #[], #clear, #clear!, #delete, #delete_at, #each, #empty?, #first, #initialize, #initialize_copy, #last, #push, #read, set_of, set_of_klass, #size, #sz, #to_a, #to_human
Methods included from Types::LengthFrom
#initialize_length_from, #read_with_length_from
Constructor Details
This class inherits a constructor from PacketGen::Types::Array
Instance Method Details
#to_s ⇒ String
Get binary string
20 21 22 23 24 25 26 |
# File 'lib/packetgen/header/ip/options.rb', line 20 def to_s str = super if str.length % 4 != 0 str += ([0] * (4 - (str.length % 4))).pack('C*') end str end |