Class: Racket::L5::BOOTP
- Inherits:
-
RacketPart
- Object
- BitStruct
- RacketPart
- Racket::L5::BOOTP
- Defined in:
- lib/racket/l5/bootp.rb
Overview
RFC951 (www.faqs.org/rfcs/rfc951.html)
Constant Summary collapse
- BOOTP_REQUEST =
1
- BOOTP_REPLY =
2
Instance Attribute Summary
Attributes inherited from RacketPart
Instance Method Summary collapse
- #add_option(number, value) ⇒ Object
- #fix! ⇒ Object
-
#initialize(*args) ⇒ BOOTP
constructor
A new instance of BOOTP.
- #to_s ⇒ Object
- #to_str ⇒ Object
Methods inherited from RacketPart
Constructor Details
#initialize(*args) ⇒ BOOTP
Returns a new instance of BOOTP.
96 97 98 99 100 101 |
# File 'lib/racket/l5/bootp.rb', line 96 def initialize(*args) @options = [] @options << "\x63\x82\x53\x63" # magic super @autofix = false end |
Instance Method Details
#add_option(number, value) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/racket/l5/bootp.rb', line 68 def add_option(number, value) o = Racket::Misc::TLV.new(1,1) o.type = number o.value = value o.length = value.length @options << o.encode end |
#fix! ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/racket/l5/bootp.rb', line 76 def fix! # tack on an EOL to the options newpayload = @options.join + "\xff" # pad out to 64 bytes while (newpayload.length != 64) newpayload += "\x00" end self.payload = newpayload + self.payload end |
#to_s ⇒ Object
88 89 90 |
# File 'lib/racket/l5/bootp.rb', line 88 def to_s puts "to_s" end |
#to_str ⇒ Object
92 93 94 |
# File 'lib/racket/l5/bootp.rb', line 92 def to_str puts to_str end |