Class: Racket::L4::ICMPGeneric

Inherits:
RacketPart
  • Object
show all
Defined in:
lib/racket/l4/icmp.rb

Overview

Generic ICMP class from which all ICMP variants spawn. This should never be used directly.

Constant Summary collapse

ICMP_TYPE_ECHO_REPLY =
0
ICMP_TYPE_DESTINATION_UNREACHABLE =
3
ICMP_TYPE_SOURCE_QUENCH =
4
ICMP_TYPE_REDIRECT =
5
ICMP_TYPE_ECHO_REQUEST =
8
ICMP_TYPE_MOBILE_IP_ADVERTISEMENT =
9
ICMP_TYPE_ROUTER_SOLICITATION =
10
ICMP_TYPE_TIME_EXCEEDED =
11
ICMP_TYPE_PARAMETER_PROBLEM =
12
ICMP_TYPE_TIMESTAMP_REQUEST =
13
ICMP_TYPE_TIMESTAMP_REPLY =
14
ICMP_TYPE_INFO_REQUEST =
15
ICMP_TYPE_INFO_REPLY =
16
ICMP_TYPE_ADDRESS_MASK_REQUEST =
17
ICMP_TYPE_ADDRESS_MASK_REPLY =
18

Instance Attribute Summary

Attributes inherited from RacketPart

#autofix

Instance Method Summary collapse

Methods inherited from RacketPart

#autofix?, #pretty

Constructor Details

#initialize(*args) ⇒ ICMPGeneric

Returns a new instance of ICMPGeneric.



65
66
67
68
# File 'lib/racket/l4/icmp.rb', line 65

def initialize(*args)
  super(*args)
  @autofix = false
end

Instance Method Details

#checksum!Object

compute and set the checksum for this ICMP packet



72
73
74
# File 'lib/racket/l4/icmp.rb', line 72

def checksum!
  self.checksum = compute_checksum
end

#checksum?Boolean

check the checksum for this ICMP packet

Returns:

  • (Boolean)


61
62
63
# File 'lib/racket/l4/icmp.rb', line 61

def checksum?
  self.checksum == compute_checksum
end

#fix!Object

‘fix’ this ICMP packet up for sending. (really, just set the checksum)



78
79
80
# File 'lib/racket/l4/icmp.rb', line 78

def fix!
  self.checksum!
end