DRCL JavaSim API

drcl.inet.protocol.ospf
Class OSPF_LSA_Header

java.lang.Object
  |
  +--drcl.inet.protocol.ospf.OSPF_LSA_Header

public class OSPF_LSA_Header
extends java.lang.Object

OSPF LSA Header (fixed length = 20 byte) ref: sec. 12.1 & A.4.1 contains fields: ls_age(2), options(1), type(1), LS_ID(4), Adv_router(4), LS_seqno(4), checksum(2), length(2) Ref: RFC 2328 sec. 12 Remark: ls_age, options, type, checksum, length in RFC is defined unsigned type Here we use signed type for simplicity. Besides, we replace struct in_addr with long

Author:
Wei-peng Chen
See Also:
OSPF_LSA

Field Summary
protected  int birth
          birth: the time when genarating the LSA although 'birth' is not defined in the header, it is necessary to record in the lsa.
protected static int INITIAL_SEQUENCE_NUMBER
           
protected  int installed
           
protected  int lsh_advtr
          specify router ID of the LSA's originator
protected  int lsh_age
          Age of the LSA: An instance of age MaxAge is always accepted as most recent; Otherwise, if the ages differ by more than MaxAgeDiff, the instance having the smaller age is accepted as most recent.(sec.
protected  int lsh_id
          In type 1, link state type always represents router ID ref: sec 12.1.4 table 16
protected  int lsh_seqnum
          increase one when the router send one new LSA
protected  int lsh_type
           
protected static int MAX_SEQUENCE_NUMBER
           
protected static int OSPF_LSA_HEADER_SIZE
           
 
Method Summary
protected  int check_lsh_type()
          Check the correctness of the header type
 java.lang.Object clone()
           
protected  void duplicate(java.lang.Object source_)
          duplicate the OSPF_LSA_Header
protected  int ospf_age_current(int now_)
          get current age of the LSA
protected  void ospf_age_update_to_send(int transdelay, int now_)
          update age field of lsa_hdr, add InfTransDelay, when sending out the packet over the interface
protected static int ospf_lsa_issame(OSPF_LSA_Header lsh1, OSPF_LSA_Header lsh2)
          test LSAs identity
protected  int size()
          return the header size
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OSPF_LSA_HEADER_SIZE

protected static final int OSPF_LSA_HEADER_SIZE

lsh_age

protected int lsh_age
Age of the LSA: An instance of age MaxAge is always accepted as most recent; Otherwise, if the ages differ by more than MaxAgeDiff, the instance having the smaller age is accepted as most recent.(sec. 12.1.1)

lsh_type

protected int lsh_type

lsh_id

protected int lsh_id
In type 1, link state type always represents router ID ref: sec 12.1.4 table 16

lsh_advtr

protected int lsh_advtr
specify router ID of the LSA's originator

INITIAL_SEQUENCE_NUMBER

protected static final int INITIAL_SEQUENCE_NUMBER

MAX_SEQUENCE_NUMBER

protected static final int MAX_SEQUENCE_NUMBER

lsh_seqnum

protected int lsh_seqnum
increase one when the router send one new LSA

birth

protected int birth
birth: the time when genarating the LSA although 'birth' is not defined in the header, it is necessary to record in the lsa. Record the birth time of this lsa. => also can record the time that this lsa has stayed

installed

protected int installed
Method Detail

toString

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

duplicate

protected void duplicate(java.lang.Object source_)
duplicate the OSPF_LSA_Header

size

protected int size()
return the header size

check_lsh_type

protected int check_lsh_type()
Check the correctness of the header type

ospf_age_update_to_send

protected void ospf_age_update_to_send(int transdelay,
                                       int now_)
update age field of lsa_hdr, add InfTransDelay, when sending out the packet over the interface

ospf_age_current

protected int ospf_age_current(int now_)
get current age of the LSA

ospf_lsa_issame

protected static int ospf_lsa_issame(OSPF_LSA_Header lsh1,
                                     OSPF_LSA_Header lsh2)
test LSAs identity

DRCL JavaSim API

Copyright © 2001 - DRCL, OSU     ~ Back to JavaSim Home ~