Update of /cvsroot/javanetsim/javaNetSim/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29458/javaNetSim/core
Modified Files:
NetworkLayerDevice.java Simulation.java
Log Message:
Index: NetworkLayerDevice.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkLayerDevice.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NetworkLayerDevice.java 8 Nov 2005 15:35:29 -0000 1.1
--- NetworkLayerDevice.java 8 Nov 2005 20:58:14 -0000 1.2
***************
*** 32,35 ****
--- 32,36 ----
import core.InvalidNetworkInterfaceNameException;
import core.protocolsuite.tcp_ip.InvalidSubnetMaskException;
+ import core.protocolsuite.tcp_ip.Route_entry;
import java.util.*;
***************
*** 231,235 ****
NodeProtocolStack.addToARP(inIPAddress, inMACAddress);
}
!
public void addToARPStatic(String inIPAddress, String inMACAddress){
NodeProtocolStack.addToARPStatic(inIPAddress, inMACAddress);
--- 232,242 ----
NodeProtocolStack.addToARP(inIPAddress, inMACAddress);
}
!
! /**
! * ARP functions...
! * Shall be documented as well.
! * @author Key
! * @version v0.21
! */
public void addToARPStatic(String inIPAddress, String inMACAddress){
NodeProtocolStack.addToARPStatic(inIPAddress, inMACAddress);
***************
*** 256,258 ****
--- 263,289 ----
return interfaceArray.toArray();
}
+
+ /**
+ * Routing tables functions... Use carefully!
+ * Shall be documented as well.
+ * @author Key
+ * @version v0.21
+ */
+
+ public void addRoute(Route_entry r){
+ NodeProtocolStack.addRoute(r);
+ }
+
+ public void removeRoute(String destIP){
+ NodeProtocolStack.removeRoute(destIP);
+ }
+
+ public String[] getRouteTableEntries(){
+ return NodeProtocolStack.getRouteTableEntries();
+ }
+
+ public Route_entry getRouteTableEntry(String destIP){
+ return NodeProtocolStack.getRouteTableEntry(destIP);
+ }
+
}//EOF
Index: Simulation.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Simulation.java 8 Nov 2005 15:35:29 -0000 1.1
--- Simulation.java 8 Nov 2005 20:58:14 -0000 1.2
***************
*** 32,35 ****
--- 32,36 ----
import core.protocolsuite.tcp_ip.IPV4Address;
+ import core.protocolsuite.tcp_ip.Route_entry;
import core.protocolsuite.tcp_ip.InvalidIPAddressException;
import core.protocolsuite.tcp_ip.InvalidSubnetMaskException;
***************
*** 588,591 ****
--- 589,598 ----
}
+ /**
+ * Functions for control hubs.
+ * Shall be documented as well.
+ * @author Key
+ * @version v0.21
+ */
public int getState(String inNodeName) {
***************
*** 602,605 ****
--- 609,645 ----
}
+
+ /**
+ * Routing tables functions... Use carefully!
+ * Shall be documented as well.
+ * @author Key
+ * @version v0.21
+ */
+
+ public void addRoute(String inNodeName,Route_entry r){
+ if (nodeTable.containsKey(inNodeName)) {
+ ((NetworkLayerDevice)nodeTable.get(inNodeName)).addRoute(r);
+ }
+ }
+
+ public void removeRoute(String inNodeName,String destIP){
+ if (nodeTable.containsKey(inNodeName)) {
+ ((NetworkLayerDevice)nodeTable.get(inNodeName)).removeRoute(destIP);
+ }
+ }
+
+ public String[] getRouteTableEntries(String inNodeName){
+ if (nodeTable.containsKey(inNodeName)) {
+ return ((NetworkLayerDevice)nodeTable.get(inNodeName)).getRouteTableEntries();
+ }
+ return null;
+ }
+
+ public Route_entry getRouteEntry(String inNodeName,String destIP){
+ if (nodeTable.containsKey(inNodeName)) {
+ return ((NetworkLayerDevice)nodeTable.get(inNodeName)).getRouteTableEntry(destIP);
+ }
+ return null;
+ }
/**
|