Class Racket::L4::SCTP
In: lib/racket/l4/sctp.rb  (CVS)
Parent: RacketPart

Methods

add_chunk   checksum!   checksum?   fix!   new  

Attributes

checksum    Checksum
dst_port    Destination port
payload   
src_port    Source port
verification    Verification tag

Public Class methods

[Source]

# File lib/racket/l4/sctp.rb, line 66
  def initialize(*args)
    @chunks = []
    super
  end

Public Instance methods

Add a new SCTP chunk (see tools.ietf.org/html/rfc4960)

[Source]

# File lib/racket/l4/sctp.rb, line 45
  def add_chunk(type, flags, length, data)
    @chunks << [ type, flags, length, data ]
  end

[Source]

# File lib/racket/l4/sctp.rb, line 53
  def checksum!
    self.checksum = compute_checksum
  end

[Source]

# File lib/racket/l4/sctp.rb, line 49
  def checksum?
    self.checksum == compute_checksum
  end

(really, just set the checksum)

[Source]

# File lib/racket/l4/sctp.rb, line 58
  def fix!
    self.payload = ""
    @chunks.each do |c|
      self.payload += c.pack("CCna*")
    end
    self.checksum!
  end

[Validate]