[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip ProtocolStack.java, 1.46, 1.47 Tcp.java, 1.60
Status: Beta
Brought to you by:
darkkey
From: gift <gi...@us...> - 2006-09-03 10:38:25
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19048/core/protocolsuite/tcp_ip Modified Files: ProtocolStack.java Tcp.java Log Message: tcp Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** ProtocolStack.java 2 Sep 2006 16:38:34 -0000 1.46 --- ProtocolStack.java 3 Sep 2006 10:38:20 -0000 1.47 *************** *** 1842,1846 **** { int ack_num=-1; ! String msg=""; boolean flags[]={false,false,false,false,false,true}; /* URG, ACK, PSH, RST, SYN, !FIN! */ sendTCPSegment(application, msg, flags,ack_num); --- 1842,1846 ---- { int ack_num=-1; ! String msg="EMPTY STRING the problem is in FinalizeTCP"; boolean flags[]={false,false,false,false,false,true}; /* URG, ACK, PSH, RST, SYN, !FIN! */ sendTCPSegment(application, msg, flags,ack_num); Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Tcp.java 3 Sep 2006 09:53:38 -0000 1.60 --- Tcp.java 3 Sep 2006 10:38:20 -0000 1.61 *************** *** 1285,1289 **** * FIN,ACK -> receive * receive <- FIN,ACK ! * CLOSE * closed <- FIN,ACK * 0-port -> FIN,ACK --- 1285,1295 ---- * FIN,ACK -> receive * receive <- FIN,ACK ! * CLOSE ! * receive ! * CLOSE ! * ! *========================================================== ! *=================TEMP SCHEME============================= ! *========================================================== * closed <- FIN,ACK * 0-port -> FIN,ACK *************** *** 1304,1307 **** --- 1310,1314 ---- Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received + Integer our_ack = (Integer)inPacket.get_acknowledgment_number(); Elm.ReceivedACKs.addElement(our_ack); //adding ACK that we have received *************** *** 1322,1327 **** else { if (!Elm.isFIN_confirmed) ! s="TCP FIN-packet ACK received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + ". Now sending our FIN confirmation!"; ! else s="TCP FIN-packet ACK confirmation received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + ". Now closing connection!"; } --- 1329,1334 ---- else { if (!Elm.isFIN_confirmed) ! s="TCP FIN-packet ACK received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + ". Now disconnecting application!"; ! else s="TCP FIN-packet ACK confirmation received from "+ inPacket.getSourceIPAddress() + ":" + inPacket.get_srcPort() + ". Now disconnecting!"; } *************** *** 1336,1348 **** if (!Elm.isFIN_sent) { - if (Elm.isPassive) { - Application serv; - serv=(Application)Elm.application; - ClosePort(serv); //FIN sent and confirmed!!! Closing connection in case isPassive==true - serv.DisconnectEvent(); - serv.Listen(); - } - - Elm.isPassive=true; String msg=""; boolean flags[]={false,true,false,false,false,true}; /* URG, !ACK!, PSH, RST, SYN, !FIN! */ //maybe not like in RFC page 37 p3.5 --- 1343,1346 ---- *************** *** 1361,1364 **** --- 1359,1373 ---- Elm.SentACKs.remove(inPacket.get_sequence_number()); } + + Elm.isPassive=true; + + if (Elm.isPassive) { + Application serv; + serv=(Application)Elm.application; + ClosePort(serv); //FIN sent and confirmed!!! Closing connection in case isPassive==true + serv.DisconnectEvent(); + serv.Listen(); + } + } else { if (!Elm.isFIN_confirmed) { |