Class: PacketGen::Header::IP::ArrayOfAddr

Inherits:
Types::Array show all
Defined in:
lib/packetgen/header/ip/option.rb

Overview

Class to handle series of IP addresses

Author:

  • Sylvain Daubert

Constant Summary

Constants inherited from Types::Array

Types::Array::HUMAN_SEPARATOR

Constants included from Types::LengthFrom

Types::LengthFrom::MAX_SZ_TO_READ

Instance Method Summary collapse

Methods inherited from Types::Array

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

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, #to_s, #type_name

Constructor Details

This class inherits a constructor from PacketGen::Types::Array

Instance Method Details

#push(addr) ⇒ self

Push a IP address to the array

Parameters:

  • addr (String, Addr)

Returns:

  • (self)

    array << ‘192.168.1.12’



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

def push(addr)
  addr = Addr.new.from_human(addr) unless addr.is_a?(Addr)
  super(addr)
end