Class: PacketFu::TcpOption::ECHO
- Inherits:
-
PacketFu::TcpOption
- Object
- Struct
- PacketFu::TcpOption
- PacketFu::TcpOption::ECHO
- Defined in:
- lib/packetfu/protos/tcp/option.rb
Overview
Instance Attribute Summary
Attributes inherited from PacketFu::TcpOption
Instance Method Summary collapse
-
#decode ⇒ Object
ECHO options with lengths other than 6 are malformed.
-
#initialize(args = {}) ⇒ ECHO
constructor
A new instance of ECHO.
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 = {}) ⇒ ECHO
Returns a new instance of ECHO.
242 243 244 245 246 247 248 |
# File 'lib/packetfu/protos/tcp/option.rb', line 242 def initialize(args={}) super( args.merge(:kind => 6, :optlen => 6 ) ) end |
Instance Method Details
#decode ⇒ Object
ECHO options with lengths other than 6 are malformed.
251 252 253 254 255 256 257 |
# File 'lib/packetfu/protos/tcp/option.rb', line 251 def decode if self[:optlen].to_i == 6 "ECHO:#{self[:value]}" else "ECHO-bad:#{self[:value]}" end end |