Class Racket::L3::CDP
In: lib/racket/l3/cdp.rb  (CVS)
Parent: RacketPart

Methods

add_field   checksum!   checksum?   fix!   new  

Attributes

checksum    Checksum
payload    Payload of this CDP message. Generally untouched.
ttl    Time-to-live of the data in this message
version    CDP Version (generally 1)

Public Class methods

[Source]

# File lib/racket/l3/cdp.rb, line 43
  def initialize(*args)
    super(*args)
  end

Public Instance methods

Add a new field to this CDP message.

[Source]

# File lib/racket/l3/cdp.rb, line 48
  def add_field(type, value) 
    t = Racket::Misc::TLV.new(2,2)
    t.type = type
    t.value = value
    t.length = 4 + value.length
    self.payload += t.encode   
  end

Compute and set the checksum for this IP datagram

[Source]

# File lib/racket/l3/cdp.rb, line 62
  def checksum! 
    self.checksum = compute_checksum
  end

Check the checksum for this IP datagram

[Source]

# File lib/racket/l3/cdp.rb, line 57
  def checksum? 
    self.checksum == compute_checksum
  end

Fix this CDP message up for sending.

[Source]

# File lib/racket/l3/cdp.rb, line 67
  def fix! 
    self.checksum!
  end

[Validate]