SSF.OS.OSPFv2
Class Packet

java.lang.Object
  |
  +--SSF.OS.ProtocolMessage
        |
        +--SSF.OS.OSPFv2.Packet

public class Packet
extends ProtocolMessage

This class implements a generic OSPF packet. The following from RFC 2178 are not included: 1) OSPF Version number 2) Packet length 3) Checksum 4) Authentication Type 5) Authentication


Field Summary
 int areaNum
          The area to which this packet belongs.
 java.lang.String as_nh
          The NHI address prefix of the AS to which this packet belongs.
static int DATABASE
          Indicates a database description packet.
static int HEADER_LENGTH
          The standard length of an OSPF Packet header.
static int HELLO
          Indicates a hello packet.
static int LSACK
          Indicates a link state acknowledgement packet.
static int LSREQUEST
          Indicates a link state request packet.
static int LSUPDATE
          Indicates a link state update packet.
 java.lang.String nh
          The NHI prefix of the sender.
 int router_ID
          The identification of the router which sent this packet, chosen as the smallest of the IPaddress of all its interfaces.
 int type
          The type of this Packet.
 
Constructor Summary
Packet(int type, int router_ID, java.lang.String nh, java.lang.String as_nh, int areaNum)
          Constructs a packet given type, router ID, area ID.
 
Method Summary
 int bytecount()
          Return the total size (in bytes) of this OSPF Packet including the header.
static int headerByteCount()
          Return the size (in bytes) of this Packet only, don't include the payload, if any.
 java.lang.String toString()
           
 
Methods inherited from class SSF.OS.ProtocolMessage
carryPayload, copy, dropHeader, dropPayload, frombytes, fromVersion, header_bytecount, payload, previous, size, tobytes, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HELLO

public static final int HELLO
Indicates a hello packet.

See Also:
Constant Field Values

DATABASE

public static final int DATABASE
Indicates a database description packet.

See Also:
Constant Field Values

LSREQUEST

public static final int LSREQUEST
Indicates a link state request packet.

See Also:
Constant Field Values

LSUPDATE

public static final int LSUPDATE
Indicates a link state update packet.

See Also:
Constant Field Values

LSACK

public static final int LSACK
Indicates a link state acknowledgement packet.

See Also:
Constant Field Values

HEADER_LENGTH

public static final int HEADER_LENGTH
The standard length of an OSPF Packet header.

See Also:
Constant Field Values

type

public int type
The type of this Packet.


router_ID

public int router_ID
The identification of the router which sent this packet, chosen as the smallest of the IPaddress of all its interfaces.


nh

public java.lang.String nh
The NHI prefix of the sender.


as_nh

public java.lang.String as_nh
The NHI address prefix of the AS to which this packet belongs.


areaNum

public int areaNum
The area to which this packet belongs.

Constructor Detail

Packet

public Packet(int type,
              int router_ID,
              java.lang.String nh,
              java.lang.String as_nh,
              int areaNum)
Constructs a packet given type, router ID, area ID.

Method Detail

bytecount

public int bytecount()
Return the total size (in bytes) of this OSPF Packet including the header. All and only fields specified in RFC 2328 are included in calculation!!!

Overrides:
bytecount in class ProtocolMessage

headerByteCount

public static int headerByteCount()
Return the size (in bytes) of this Packet only, don't include the payload, if any.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object