Class Racket::L5::BOOTP
In: lib/racket/l5/bootp.rb  (CVS)
Parent: RacketPart

Bootstrap Protocol — BOOTP

RFC951 (www.faqs.org/rfcs/rfc951.html)

Methods

add_option   fix!   new   to_s   to_str  

Constants

BOOTP_REQUEST = 1
BOOTP_REPLY = 2

Attributes

chaddr    Client hardware address
cip    Client IP address
file    Boot file name
flags    Flags. Generally unused
gip    Gateway IP address
hops    Hops between client and server
hwlen    Hardware adddress length
hwtype    Hardware address type
id    Transaction ID
payload    Payload
secs    Seceonds elapsed since client started trying to boot
server    Optional server host name
sip    Server IP address
type    Message type
yip    "Your" (client) IP address.

Public Class methods

[Source]

# File lib/racket/l5/bootp.rb, line 96
  def initialize(*args)
    @options = []
    @options << "\x63\x82\x53\x63" # magic
    super
    @autofix = false
  end

Public Instance methods

[Source]

# 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

[Source]

# 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

[Source]

# File lib/racket/l5/bootp.rb, line 88
  def to_s
    puts "to_s"
  end

[Source]

# File lib/racket/l5/bootp.rb, line 92
  def to_str
    puts to_str
  end

[Validate]