Class: PacketFu::TcpOption::ECHOREPLY
- Inherits:
-
PacketFu::TcpOption
- Object
- Struct
- PacketFu::TcpOption
- PacketFu::TcpOption::ECHOREPLY
- Defined in:
- lib/packetfu/protos/tcp/option.rb
Overview
Echo Reply option.
Instance Attribute Summary
Attributes inherited from PacketFu::TcpOption
Instance Method Summary collapse
-
#decode ⇒ Object
ECHOREPLY options with lengths other than 6 are malformed.
-
#initialize(args = {}) ⇒ ECHOREPLY
constructor
A new instance of ECHOREPLY.
Methods inherited from PacketFu::TcpOption
#encode, #has_optlen?, #has_value?, #read, #to_s
Methods included from StructFu
#body=, #clone, #set_endianness, #sz, #typecast
Methods inherited from Struct
Constructor Details
#initialize(args = {}) ⇒ ECHOREPLY
Returns a new instance of ECHOREPLY.
265 266 267 268 269 270 271 |
# File 'lib/packetfu/protos/tcp/option.rb', line 265 def initialize(args={}) super( args.merge(:kind => 7, :optlen => 6 ) ) end |
Instance Method Details
#decode ⇒ Object
ECHOREPLY options with lengths other than 6 are malformed.
274 275 276 277 278 279 280 |
# File 'lib/packetfu/protos/tcp/option.rb', line 274 def decode if self[:optlen].to_i == 6 "ECHOREPLY:#{self[:value]}" else "ECHOREPLY-bad:#{self[:value]}" end end |