Class: Scriptroute::ICMPmaskreq

Inherits:
ICMP
  • Object
show all
Defined in:
lib/scriptroute/packets.rb

Overview

mask request doesn’t appear to be useful.

Constant Summary

Constants inherited from ICMP

Scriptroute::ICMP::ICMP_ECHO, Scriptroute::ICMP::ICMP_ECHOREPLY, Scriptroute::ICMP::ICMP_MASKREPLY, Scriptroute::ICMP::ICMP_MASKREQ, Scriptroute::ICMP::ICMP_PARAMETERPROB, Scriptroute::ICMP::ICMP_TIMESTAMP, Scriptroute::ICMP::ICMP_TIMESTAMPREPLY, Scriptroute::ICMP::ICMP_TIMXCEED, Scriptroute::ICMP::ICMP_UNREACH, Scriptroute::ICMP::ICMP_UNREACH_FILTER_PROHIB, Scriptroute::ICMP::ICMP_UNREACH_HOST, Scriptroute::ICMP::ICMP_UNREACH_HOST_PRECEDENCE, Scriptroute::ICMP::ICMP_UNREACH_HOST_PROHIB, Scriptroute::ICMP::ICMP_UNREACH_HOST_UNKNOWN, Scriptroute::ICMP::ICMP_UNREACH_ISOLATED, Scriptroute::ICMP::ICMP_UNREACH_NEEDFRAG, Scriptroute::ICMP::ICMP_UNREACH_NET, Scriptroute::ICMP::ICMP_UNREACH_NET_PROHIB, Scriptroute::ICMP::ICMP_UNREACH_NET_UNKNOWN, Scriptroute::ICMP::ICMP_UNREACH_PORT, Scriptroute::ICMP::ICMP_UNREACH_PRECEDENCE_CUTOFF, Scriptroute::ICMP::ICMP_UNREACH_PROTOCOL, Scriptroute::ICMP::ICMP_UNREACH_SRCFAIL, Scriptroute::ICMP::ICMP_UNREACH_TOSHOST, Scriptroute::ICMP::ICMP_UNREACH_TOSNET

Constants inherited from IPv4

Scriptroute::IPv4::IPPROTO_ICMP, Scriptroute::IPv4::IPPROTO_TCP, Scriptroute::IPv4::IPPROTO_UDP

Instance Attribute Summary collapse

Attributes inherited from ICMP

#icmp_cksum, #icmp_code, #icmp_type, #ip_p, #ip_payload_len

Attributes inherited from IPv4

#ip_dst, #ip_hl, #ip_id, #ip_len, #ip_off, #ip_options, #ip_p, #ip_src, #ip_sum, #ip_tos, #ip_ttl, #ip_v

Instance Method Summary collapse

Methods inherited from ICMP

#to_s

Methods inherited from IPv4

#add_option, #calculate_header_len, #calculate_packet_len, creator, #ip_payload_len, #ipv4_unmarshal, #to_s

Constructor Details

#initialize(payload_len = 0) ⇒ ICMPmaskreq

Returns a new instance of ICMPmaskreq.



627
628
629
630
631
632
633
634
# File 'lib/scriptroute/packets.rb', line 627

def initialize(payload_len = 0)
  if( payload_len < 0) then raise "payload length must be 0" end
  if( payload_len > 0) then raise "payload length must be 0" end
  @ip_payload_len = payload_len + 12
  @icmp_id = 678
  @icmp_seq = 1
  super(ICMP_MASKREQ)
end

Instance Attribute Details

#icmp_idFixnum (readonly)

Returns:

  • (Fixnum)


625
626
627
# File 'lib/scriptroute/packets.rb', line 625

def icmp_id
  @icmp_id
end

#icmp_seqFixnum

Returns:

  • (Fixnum)


625
626
627
# File 'lib/scriptroute/packets.rb', line 625

def icmp_seq
  @icmp_seq
end

Instance Method Details

#marshalString

Returns The packet in string form.

Returns:

  • (String)

    The packet in string form



636
637
638
# File 'lib/scriptroute/packets.rb', line 636

def marshal
  super + [ @icmp_id, @icmp_seq, @icmp_otime, @icmp_rtime, @icmp_ttime ].pack("nnNNN")
end