[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip/ospf OSPFhello_packet.java,1.2,1.3 ospf_packet
Status: Beta
Brought to you by:
darkkey
From: Alouette <alo...@us...> - 2005-11-20 14:31:24
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7648/core/protocolsuite/tcp_ip/ospf Modified Files: OSPFhello_packet.java ospf_packetheader.java Log Message: Index: OSPFhello_packet.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPFhello_packet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OSPFhello_packet.java 20 Nov 2005 11:09:42 -0000 1.2 --- OSPFhello_packet.java 20 Nov 2005 14:31:16 -0000 1.3 *************** *** 10,13 **** --- 10,14 ---- package core.protocolsuite.tcp_ip.ospf; + import core.protocolsuite.tcp_ip.ospf.ospf_packetheader; /** *************** *** 15,23 **** * @author Alouette */ ! public class OSPFhello_packet { ! /** Creates a new instance of OSPFhello_packet */ ! public OSPFhello_packet() { } } --- 16,106 ---- * @author Alouette */ ! public class OSPFhello_packet extends ospf_packetheader { ! ! private int[] Options; ! ! private String Networkmask; //do not forget to correct field type ! /* TODO */ ! private static final int Interval=30; // period of sending packets ??! ! private int Priority; ! private int DeadInterval; ! private String DesignatedRouter; // 0 - not chosen yet ! ! private String BackupDesignatedRouter; //0 - not chosen yet ! /* todo */ /* need to be list*/ ! private String[] Neighbor; ! /** Creates a new instance of OSPFhello_packet */ ! public OSPFhello_packet(int NeighborCount) ! { ! super(1); ! int i; ! Options=new int[8]; ! for (i=0; i<8; i++) ! { ! Options[i]=0; ! } ! BackupDesignatedRouter=""; ! DesignatedRouter=""; ! if (NeighborCount>0) ! { ! Neighbor = new String[NeighborCount]; ! } ! } + + /* + *This method set desR + *@author Alouette + *returns nothing + *v1.0 + */ + public void SetDesignatedRouter(String inDesignatedRouter) + { + DesignatedRouter=inDesignatedRouter; + } + + /* + *This method set BackupdesR + *@author Alouette + *returns nothing + *v1.0 + */ + public void SetBackupDesignatedRouter(String inBackupDesignatedRouter) + { + BackupDesignatedRouter=inBackupDesignatedRouter; + } + + /* + *This method set priority + *@author Alouette + *returns nothing + *v1.0 + */ + public void Setpriority(int inpri) + { + Priority=inpri; + } + + /* + *This method get priority + *@author Alouette + *returns nothing + *v1.0 + */ + public int GetPriority() + { + return Priority; + } + + /*TODO + /* + *This method add neighbor to the neighbor table in hello message + *This message is for another router, in the start time this is empty table + *@author Alouette + *returns nothing + *v1.0 + */ } + Index: ospf_packetheader.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/ospf_packetheader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ospf_packetheader.java 20 Nov 2005 11:09:42 -0000 1.2 --- ospf_packetheader.java 20 Nov 2005 14:31:16 -0000 1.3 *************** *** 43,46 **** --- 43,60 ---- } + + /** + * this method parametred constructor + * @author alouette (sourceforge.net user) + * @returns Cheksum + * @version 1.0 + */ + + public ospf_packetheader(int inType) + { + Checksum=1; + Type=inType; + Authentication=""; + } /** * this method returns checksum |