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 =
';'
Constants included from Types::LengthFrom
Types::LengthFrom::MAX_SZ_TO_READ
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, #sz_to_read
Methods included from Types::Fieldable
#format_inspect, #read, #sz, #to_human, #type_name
Constructor Details
This class inherits a constructor from PacketGen::Types::Array
Instance Method Details
#to_s ⇒ String
Get binary 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 |