Class: Racket::RacketPart
- Inherits:
-
BitStruct
- Object
- BitStruct
- Racket::RacketPart
- Defined in:
- lib/racket/racketpart.rb
Overview
Every Racket object is made up of numerous sub-parts, namely layers of the OSI stack.
Direct Known Subclasses
L2::EightOTwoDotThree, L2::Ethernet, L2::LLC, L2::SNAP, L2::VLAN, L2::VTPGeneric, L3::ARP, L3::CDP, L3::EGP, L3::IPv4, L3::IPv6, L3::STP, L4::GRE, L4::ICMPGeneric, L4::ICMPv6Generic, L4::IGMPv1, L4::IGMPv2, L4::IGRP, L4::SCTP, L4::TCP, L4::UDP, L4::VRRP, L5::BOOTP, L5::DNS, L5::HSRP, L5::NTP, Raw
Instance Attribute Summary collapse
-
#autofix ⇒ Object
Boolean indicating whether or not this instance should be automatically “fixed” prior to be packed and sent.
Instance Method Summary collapse
-
#autofix? ⇒ Boolean
Should this instance be automatically fixed prior to being packed and sent?.
- #fix! ⇒ Object
-
#initialize(*args) ⇒ RacketPart
constructor
A new instance of RacketPart.
-
#pretty ⇒ Object
Print out all of the fields and all of their values.
Constructor Details
#initialize(*args) ⇒ RacketPart
Returns a new instance of RacketPart.
45 46 47 48 |
# File 'lib/racket/racketpart.rb', line 45 def initialize(*args) @autofix = true super(*args) end |
Instance Attribute Details
#autofix ⇒ Object
Boolean indicating whether or not this instance should be automatically “fixed” prior to be packed and sent.
37 38 39 |
# File 'lib/racket/racketpart.rb', line 37 def autofix @autofix end |
Instance Method Details
#autofix? ⇒ Boolean
Should this instance be automatically fixed prior to being packed and sent?
41 42 43 |
# File 'lib/racket/racketpart.rb', line 41 def autofix? @autofix end |
#fix! ⇒ Object
62 63 |
# File 'lib/racket/racketpart.rb', line 62 def fix! end |
#pretty ⇒ Object
Print out all of the fields and all of their values
52 53 54 55 56 57 58 59 60 |
# File 'lib/racket/racketpart.rb', line 52 def pretty s = "" self.fields.each do |f| unless (f.name == "payload") s += "#{f.name}=#{self.send(f.name)} " end end s.gsub(/ $/, '') end |