Class: SimpleCapture::ICMPHeader
- Inherits:
-
Object
- Object
- SimpleCapture::ICMPHeader
- Defined in:
- lib/simple_capture/header/icmp_header.rb
Instance Attribute Summary collapse
-
#checksum ⇒ Object
readonly
Returns the value of attribute checksum.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#seq_number ⇒ Object
readonly
Returns the value of attribute seq_number.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #dump ⇒ Object
-
#initialize(bytes: nil) ⇒ ICMPHeader
constructor
A new instance of ICMPHeader.
Constructor Details
#initialize(bytes: nil) ⇒ ICMPHeader
Returns a new instance of ICMPHeader.
6 7 8 |
# File 'lib/simple_capture/header/icmp_header.rb', line 6 def initialize(bytes: nil) convert_bytes_to_header(bytes) unless bytes.nil? end |
Instance Attribute Details
#checksum ⇒ Object (readonly)
Returns the value of attribute checksum.
3 4 5 |
# File 'lib/simple_capture/header/icmp_header.rb', line 3 def checksum @checksum end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/simple_capture/header/icmp_header.rb', line 3 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/simple_capture/header/icmp_header.rb', line 3 def data @data end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/simple_capture/header/icmp_header.rb', line 3 def id @id end |
#seq_number ⇒ Object (readonly)
Returns the value of attribute seq_number.
3 4 5 |
# File 'lib/simple_capture/header/icmp_header.rb', line 3 def seq_number @seq_number end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/simple_capture/header/icmp_header.rb', line 3 def type @type end |
Instance Method Details
#dump ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/simple_capture/header/icmp_header.rb', line 10 def dump puts "■icmp--------------------------------------".blue print_checksum print_code print_type print_id print_seqnumber print_data end |