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

Internet Gateway Routing Protocol: IGRP

www.cisco.com/warp/public/103/5.html

Every routing entry has the following fields:

  uchar number[3];       /* 3 significant octets of IP address */
  uchar delay[3];        /* delay, in tens of microseconds */
  uchar bandwidth[3];    /* bandwidth, in units of 1 Kbit/sec */
  uchar mtu[2];          /* MTU, in octets */
  uchar reliability;     /* percent packets successfully tx/rx */
  uchar load;            /* percent of channel occupied */
  uchar hopcount;        /* hop count */

Methods

Constants

IGRP_UPDATE = 1
IGRP_REQUEST = 2

Attributes

asystem    Autonomous system number
checksum    Checksum (IP)
edition    Serial number which is incremented whenever the routing table is updated.
nexterior    Number of exterior routes contained in this update message
ninterior    Number of interior routes contained in this update message
nsystem    Number of system routes contained in this update message
opcode    Type of the IGRP message contained in this packet.
payload    Payload. Generally unused.
version    Version of the IGRP message contained in this packet. Defaults to 1. Anything else is currently invalid

Public Class methods

[Source]

# File lib/racket/l4/igrp.rb, line 67
  def initialize(*args)
    @interior_routes = []
    @system_routes = []
    @exterior_routes = []
    super
  end

Public Instance methods

Add an exterior route to this IGRP packet

[Source]

# File lib/racket/l4/igrp.rb, line 87
  def add_exterior(ip, delay, bw, mtu, rel, load, hop)
    @exterior_routes << add_entry(ip, delay, bw, mtu, rel, load, hop)
    self.nexterior += 1
  end

Add an interior route to this IGRP packet

[Source]

# File lib/racket/l4/igrp.rb, line 81
  def add_interior(ip, delay, bw, mtu, rel, load, hop)
    @interior_routes << add_entry(ip, delay, bw, mtu, rel, load, hop)
    self.ninterior += 1
  end

Add a system route to this IGRP packet

[Source]

# File lib/racket/l4/igrp.rb, line 75
  def add_system(ip, delay, bw, mtu, rel, load, hop)
    @system_routes << add_entry(ip, delay, bw, mtu, rel, load, hop)
    self.nsystem += 1
  end

Compute and set the checksum of this IGRP packet

[Source]

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

Is the checksum correct?

[Source]

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

Fix everything up in preparation for sending.

[Source]

# File lib/racket/l4/igrp.rb, line 103
  def fix!
    [@interior_routes, @system_routes, @exterior_routes].flatten.each do |r|
      self.payload += r
    end
    checksum!
  end

[Validate]