Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22380/core/protocolsuite/tcp_ip
Modified Files:
ARP.java IpV4.java ProtocolStack.java
Log Message:
Index: ProtocolStack.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** ProtocolStack.java 1 Dec 2005 18:37:16 -0000 1.27
--- ProtocolStack.java 1 Dec 2005 19:51:53 -0000 1.28
***************
*** 249,252 ****
--- 249,253 ----
if(outIface!=null) outInterface[0] = outIface;
+ if(GatewayAddress.contains("*")) GatewayAddress = inPacket.getDestIPAddress();
destMAC = mARPprotocol.getMACAddress(GatewayAddress,outInterface[0]);
***************
*** 359,362 ****
--- 360,366 ----
if(outIface!=null) outInterface[0] = outIface;
+
+ if(GatewayAddress.contains("*")) GatewayAddress = inPacket.getDestIPAddress();
+
}catch(Exception e){} //UGLY!!! FIXME!!!
Index: IpV4.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/IpV4.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** IpV4.java 1 Dec 2005 15:04:55 -0000 1.4
--- IpV4.java 1 Dec 2005 19:51:53 -0000 1.5
***************
*** 315,318 ****
--- 315,320 ----
curdestNetwork = (String)keys1.nextElement();
r = (Route_entry)routingTable.get(curdestNetwork);
+ if(r.gateway.contains("*") && curdestNetwork.contains(inIPAddress))
+ return "*";
binMask = IPV4Address.toBinaryString(r.genMask);
destNetwork = IPV4Address.toDecimalString(IPV4Address.IPandMask(binIP,binMask));
***************
*** 343,346 ****
--- 345,350 ----
curdestNetwork = (String)keys1.nextElement();
r = (Route_entry)routingTable.get(curdestNetwork);
+ if(r.gateway.contains("*") && curdestNetwork.contains(inIPAddress))
+ return r.iFace;
binMask = IPV4Address.toBinaryString(r.genMask);
destNetwork = IPV4Address.toDecimalString(IPV4Address.IPandMask(binIP,binMask));
Index: ARP.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ARP.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ARP.java 19 Nov 2005 21:53:51 -0000 1.4
--- ARP.java 1 Dec 2005 19:51:53 -0000 1.5
***************
*** 428,432 ****
// test if this packet is for a local Address.
!
if(mParentStack.isInternalIP(inARPpacket.getDestIPAddress())){
--- 428,433 ----
// test if this packet is for a local Address.
! //mParentStack.isInternalIP(inARPpacket.getDestIPAddress())
!
if(mParentStack.isInternalIP(inARPpacket.getDestIPAddress())){
|