javanetsim-cvs Mailing List for javaNetSim
Status: Beta
Brought to you by:
darkkey
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(120) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(1) |
Feb
(69) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(76) |
Oct
(28) |
Nov
(77) |
Dec
(186) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(36) |
Oct
(61) |
Nov
(23) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(17) |
Oct
(105) |
Nov
(5) |
Dec
(1) |
2009 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(9) |
Nov
|
Dec
|
From: QweR <qw...@us...> - 2009-10-25 18:20:47
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4966 Modified Files: Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Tcp.java 25 Oct 2009 17:44:54 -0000 1.109 --- Tcp.java 25 Oct 2009 18:20:33 -0000 1.110 *************** *** 991,995 **** if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); ! printLayerInfo("Closing port in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } boolean flags[] = genFlags(Tcp.ACK); --- 991,995 ---- if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); ! printLayerInfo("Closing port "+mSL.get_socket(Elm.getSocket()).src_port+" in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } boolean flags[] = genFlags(Tcp.ACK); *************** *** 1004,1013 **** Elm.setState(TCP_session.FIN_WAIT_2); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_EXIT); ! printLayerInfo("Closing if FIN will not have received in "+(Tcp.resendtimes_EXIT[0]/1000.0)+"s."); } else if(inPacket.get_FIN_flag()){ Elm.setState(TCP_session.CLOSING); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_SYNC_CLOSE); ! printLayerInfo("Closing if ACK will not have received in "+(Tcp.resendtimes_SYNC_CLOSE[0]/1000.0)+"s."); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); --- 1004,1013 ---- Elm.setState(TCP_session.FIN_WAIT_2); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_EXIT); ! printLayerInfo("Closing port "+mSL.get_socket(Elm.getSocket()).src_port+" if FIN will not have received in "+(Tcp.resendtimes_EXIT[0]/1000.0)+"s."); } else if(inPacket.get_FIN_flag()){ Elm.setState(TCP_session.CLOSING); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_SYNC_CLOSE); ! printLayerInfo("Closing port "+mSL.get_socket(Elm.getSocket()).src_port+" if ACK will not have received in "+(Tcp.resendtimes_SYNC_CLOSE[0]/1000.0)+"s."); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); *************** *** 1027,1031 **** if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); ! printLayerInfo("Closing port in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } boolean flags[] = genFlags(Tcp.ACK); --- 1027,1031 ---- if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); ! printLayerInfo("Closing port "+mSL.get_socket(Elm.getSocket()).src_port+" in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } boolean flags[] = genFlags(Tcp.ACK); *************** *** 1052,1056 **** if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); ! printLayerInfo("Closing port in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } else{ --- 1052,1056 ---- if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); ! printLayerInfo("Closing port "+mSL.get_socket(Elm.getSocket()).src_port+" in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } else{ |
From: QweR <qw...@us...> - 2009-10-25 17:45:03
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv823 Modified Files: Tcp.java Log Message: change text of messages Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** Tcp.java 24 Oct 2009 23:24:33 -0000 1.108 --- Tcp.java 25 Oct 2009 17:44:54 -0000 1.109 *************** *** 665,669 **** int nextrt = tmr.getResendDelay(); if(nextrt>0){ ! resend_mes = " Next resend on packet loss in "+(nextrt/1000.0)+"s."; } } --- 665,669 ---- int nextrt = tmr.getResendDelay(); if(nextrt>0){ ! resend_mes = " Next retransmission on packet loss in "+(nextrt/1000.0)+"s."; } } *************** *** 1004,1013 **** Elm.setState(TCP_session.FIN_WAIT_2); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_EXIT); ! printLayerInfo("Closing on error in "+(Tcp.resendtimes_EXIT[0]/1000.0)+"s."); } else if(inPacket.get_FIN_flag()){ Elm.setState(TCP_session.CLOSING); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_SYNC_CLOSE); ! printLayerInfo("Closing on error in "+(Tcp.resendtimes_SYNC_CLOSE[0]/1000.0)+"s."); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); --- 1004,1013 ---- Elm.setState(TCP_session.FIN_WAIT_2); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_EXIT); ! printLayerInfo("Closing if FIN will not have received in "+(Tcp.resendtimes_EXIT[0]/1000.0)+"s."); } else if(inPacket.get_FIN_flag()){ Elm.setState(TCP_session.CLOSING); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_SYNC_CLOSE); ! printLayerInfo("Closing if ACK will not have received in "+(Tcp.resendtimes_SYNC_CLOSE[0]/1000.0)+"s."); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); |
From: QweR <qw...@us...> - 2009-10-24 23:24:55
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2641 Modified Files: MainScreen.java Log Message: some TCP bugs fixed Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** MainScreen.java 23 Oct 2009 20:06:33 -0000 1.107 --- MainScreen.java 24 Oct 2009 23:24:45 -0000 1.108 *************** *** 4288,4292 **** String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE)); if (ip == null) --- 4288,4292 ---- String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Send message over Echo TCP. Host.", JOptionPane.QUESTION_MESSAGE)); if (ip == null) *************** *** 4294,4303 **** String port = JOptionPane.showInputDialog(this, "Server Port:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE); if (port == null) return; ! String msg = JOptionPane.showInputDialog(this, "Message:", "Message.", JOptionPane.QUESTION_MESSAGE); --- 4294,4303 ---- String port = JOptionPane.showInputDialog(this, "Server Port:", ! "Send message over Echo TCP. Port.", JOptionPane.QUESTION_MESSAGE); if (port == null) return; ! String msg = JOptionPane.showInputDialog(this, "Message:", "Send message over Echo TCP. Message.", JOptionPane.QUESTION_MESSAGE); *************** *** 4306,4310 **** String cnt = JOptionPane.showInputDialog(this, "Quantity:", ! "How many times send.", JOptionPane.QUESTION_MESSAGE); if (port != null && ip != null && msg != null && cnt != null) { --- 4306,4310 ---- String cnt = JOptionPane.showInputDialog(this, "Quantity:", ! "Send message over Echo TCP. How many times send?", JOptionPane.QUESTION_MESSAGE); if (port != null && ip != null && msg != null && cnt != null) { |
From: QweR <qw...@us...> - 2009-10-24 23:24:46
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2606 Modified Files: Echo_tcp.java TCP_session.java Tcp.java Telnet_server.java Log Message: some TCP bugs fixed Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** Tcp.java 24 Oct 2008 16:18:48 -0000 1.107 --- Tcp.java 24 Oct 2009 23:24:33 -0000 1.108 *************** *** 39,42 **** --- 39,44 ---- import java.util.concurrent.ConcurrentLinkedQueue; + import sun.swing.PrintingStatus; + import core.CommunicationException; import core.LayerInfo; *************** *** 84,89 **** public void run() { try{ ! LinkedList q_rs = new LinkedList(); ! LinkedList q_nt = new LinkedList(); synchronized(tcp_timers_lock){ while(!tcp_timers.isEmpty() && current_time > ((Resender)tcp_timers.peek()).getResendTime()){ --- 86,91 ---- public void run() { try{ ! LinkedList<Resender> q_rs = new LinkedList<Resender>(); ! LinkedList<Integer> q_nt = new LinkedList<Integer>(); synchronized(tcp_timers_lock){ while(!tcp_timers.isEmpty() && current_time > ((Resender)tcp_timers.peek()).getResendTime()){ *************** *** 95,99 **** q_rs.add(rs); q_nt.add(new Integer(nt)); ! //printLayerInfo(">>> Timer "+mParentStack.getHostName()+":"+rs.timerID+" was reistalled"); } //System.out.println("Host: "+mParentStack.getHostName()+", time: " + current_time); --- 97,101 ---- q_rs.add(rs); q_nt.add(new Integer(nt)); ! //printLayerInfo(">>> Timer "+mParentStack.getHostName()+":"+rs.timerID+" was reinstalled"); } //System.out.println("Host: "+mParentStack.getHostName()+", time: " + current_time); *************** *** 117,124 **** --- 119,129 ---- private int sock; public int nearest_resend; + public int resend_delay; public long timerID; public Resender(int sock, TCP_packet pack, int times[]){ this.sock = sock; + nearest_resend = 0; + resend_delay = 0; packet = pack; for(int i=0; i<times.length; i++){ *************** *** 157,169 **** //TCP_session tcps = getSession(mParentStack.SL().get_socket(sock).genKey()); if(tcps!=null){ ! tcps.inc_sent_duplicates(); ! tcps.removeSegmentToResend(packet.get_sequence_number()); switch(nt){ ! case 0:{ //normal quit, do nothing break; } case -1:{ try{ - removeTimer(tcps.last_timer); Application app = mSL.get_socket(sock).app; mSL.close(sock); --- 162,175 ---- //TCP_session tcps = getSession(mParentStack.SL().get_socket(sock).genKey()); if(tcps!=null){ ! if(packet!=null){ ! tcps.inc_sent_duplicates(); ! tcps.removeSegmentToResend(packet.get_sequence_number()); ! } switch(nt){ ! case 0:{ //normal end, do nothing break; } case -1:{ try{ Application app = mSL.get_socket(sock).app; mSL.close(sock); *************** *** 208,211 **** --- 214,225 ---- break; } + case -4:{ //TIME_WAIT end, Application already closed + try{ + mSL.close(sock); + }catch(TransportLayerException e){ + System.out.println(e.toString()); + } + break; + } default: System.out.println("TCP error: unsupported resend time"); } *************** *** 218,221 **** --- 232,238 ---- return nearest_resend; } + public int getResendDelay(){ + return resend_delay; + } public int compareTo(Object o){ *************** *** 225,231 **** public int nextTime(int cur_time){ ! if(resend_time.isEmpty()) nearest_resend = 0; else{ ! nearest_resend = resend_time.poll().intValue(); if(nearest_resend>0){ nearest_resend += cur_time; --- 242,252 ---- public int nextTime(int cur_time){ ! if(resend_time.isEmpty()){ ! nearest_resend = 0; ! resend_delay = 0; ! } else{ ! resend_delay = resend_time.poll().intValue(); ! nearest_resend = resend_delay; if(nearest_resend>0){ nearest_resend += cur_time; *************** *** 246,255 **** private static final int MAXTIME = 2000000000; ! private Hashtable sessionTable = new Hashtable(); private Object sessionTable_lock = new Object(); //for locking Hashtable sessionTable private ProtocolStack mParentStack; private socketLayer mSL; private Timer timer; ! private PriorityQueue tcp_timers = new PriorityQueue(); private int window_size = Tcp.DEFAULT_WINDOW_SIZE; //tcp window-size for new sessions public final static int DEFAULT_WINDOW_SIZE = 10; --- 267,276 ---- private static final int MAXTIME = 2000000000; ! private Hashtable<String,TCP_session> sessionTable = new Hashtable<String,TCP_session>(); private Object sessionTable_lock = new Object(); //for locking Hashtable sessionTable private ProtocolStack mParentStack; private socketLayer mSL; private Timer timer; ! private PriorityQueue<Resender> tcp_timers = new PriorityQueue<Resender>(); private int window_size = Tcp.DEFAULT_WINDOW_SIZE; //tcp window-size for new sessions public final static int DEFAULT_WINDOW_SIZE = 10; *************** *** 257,276 **** private int current_time = 0; private long nextTimerID = 0; ! private static final boolean USE_2MSL = false; ! private static final int MSL_TIME = 2500; ! // private static final int resendtimes_SYN_ACK[] = {1500,3000,6000,12000,24000,28000,-2}; ! // private static final int resendtimes_SYN[] = {6000,24000,45000,-2}; ! // private static final int resendtimes_DEFAULT[] = {1500,3000,6000,12000,24000,48000,64000,64000,64000,64000,64000,64000,-3}; ! // private static final int resendtimes_NULL[] = {}; ! // private static final int resendtimes_2MSL[] = {2*MSL_TIME,-1}; // 2MSL ! // private static final int resendtimes_EXIT[] = {75000,-1}; // non-RFC exit ! // private static final int resendtimes_SYNC_CLOSE[] = {75000, -1}; // synchronous closing ! private static final int resendtimes_SYN_ACK[] = {1000,1000,1000,1000,1000,1000,-2}; ! private static final int resendtimes_SYN[] = {1000,1000,1000,1000,1000,1000,1000,-2}; ! private static final int resendtimes_DEFAULT[] = {1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,-3}; private static final int resendtimes_NULL[] = {}; ! private static final int resendtimes_2MSL[] = {2*Tcp.MSL_TIME,-1}; // 2MSL ! private static final int resendtimes_EXIT[] = {15000,-1}; // non-RFC exit ! private static final int resendtimes_SYNC_CLOSE[] = {15000, -1}; // synchronous closing --- 278,298 ---- private int current_time = 0; private long nextTimerID = 0; ! private static final boolean USE_2MSL = true; ! private static final int MSL_TIME = 60000; ! private static final int resendtimes_SYN_ACK[] = {1500,3000,6000,12000,24000,28000,-2}; ! private static final int resendtimes_SYN[] = {6000,24000,45000,-2}; ! private static final int resendtimes_DEFAULT[] = {1500,3000,6000,12000,24000,48000,64000,64000,64000,64000,64000,64000,-3}; private static final int resendtimes_NULL[] = {}; ! private static final int resendtimes_2MSL[] = {2*MSL_TIME,-4}; // 2MSL ! private static final int resendtimes_EXIT[] = {75000,-1}; // non-RFC exit ! private static final int resendtimes_SYNC_CLOSE[] = {75000, -1}; // synchronous closing ! // private static final int MSL_TIME = 7500; ! // private static final int resendtimes_SYN_ACK[] = {1000,1000,1000,1000,1000,1000,-2}; ! // private static final int resendtimes_SYN[] = {1000,1000,1000,1000,1000,1000,1000,-2}; ! // private static final int resendtimes_DEFAULT[] = {1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,1000,-3}; ! // private static final int resendtimes_NULL[] = {}; ! // private static final int resendtimes_2MSL[] = {2*Tcp.MSL_TIME,-4}; // 2MSL ! // private static final int resendtimes_EXIT[] = {15000,-1}; // non-RFC exit ! // private static final int resendtimes_SYNC_CLOSE[] = {15000, -1}; // synchronous closing *************** *** 365,381 **** { //lets try to reserve any free port - int number=Tcp.PORT_START_NUMBER; boolean Reserved=false; ! while ( (number<Tcp.PORT_START_NUMBER+Tcp.PORT_QUANT) && !(Reserved) ) ! { ! Elm = getSession(jnSocket.genTCPkey(number,"0.0.0.0",0)); ! if (Elm == null) //free port ! { ! Reserved=true; ! mSL.get_socket(sock).src_port = number; ! addSession(jnSocket.genTCPkey(number,"0.0.0.0",0), sock); ! printLayerInfo("Local port " + number + " reserved for client app."); ! } ! number++; } --- 387,412 ---- { //lets try to reserve any free port boolean Reserved=false; ! ! for(int attempt=0; attempt<2 && !Reserved; attempt++){ ! int start=0; ! int end=Tcp.PORT_QUANT/2; ! if(attempt==1){ ! start=Tcp.PORT_START_NUMBER; ! end=Tcp.PORT_START_NUMBER+Tcp.PORT_QUANT; ! } ! for(int i=start; i<end && !Reserved; i++) ! { ! int number=i; ! if(attempt==0) number=(int)Math.floor(Math.random()*Tcp.PORT_QUANT+Tcp.PORT_START_NUMBER); ! Elm = getSession(jnSocket.genTCPkey(number,"0.0.0.0",0)); ! if (Elm == null) //free port ! { ! Reserved=true; ! mSL.get_socket(sock).src_port = number; ! addSession(jnSocket.genTCPkey(number,"0.0.0.0",0), sock); ! printLayerInfo("Local port " + number + " reserved for client app."); ! } ! } } *************** *** 426,430 **** if(!mSL.get_socket(sock_num).open_state){ TCP_session tcps = addSession(jnSocket.genTCPkey(in_Port,"0.0.0.0",0), sock_num); ! tcps.setState(tcps.LISTEN); printLayerInfo("Local port " + in_Port + " is listening."); } --- 457,461 ---- if(!mSL.get_socket(sock_num).open_state){ TCP_session tcps = addSession(jnSocket.genTCPkey(in_Port,"0.0.0.0",0), sock_num); ! tcps.setState(TCP_session.LISTEN); printLayerInfo("Local port " + in_Port + " is listening."); } *************** *** 474,478 **** reserveFreePort(sock); TCP_session Elm = addSession(mSL.get_socket(sock).genKey(), sock); ! Elm.setState(Elm.SYN_SENT); if (sendTCPSegment(sock, "", flags, -1, Tcp.resendtimes_SYN)) --- 505,509 ---- reserveFreePort(sock); TCP_session Elm = addSession(mSL.get_socket(sock).genKey(), sock); ! Elm.setState(TCP_session.SYN_SENT); if (sendTCPSegment(sock, "", flags, -1, Tcp.resendtimes_SYN)) *************** *** 481,485 **** } else{ ! Elm.setState(Elm.CLOSED); } } --- 512,516 ---- } else{ ! Elm.setState(TCP_session.CLOSED); } } *************** *** 511,515 **** if(Elm != null){ ! Elm.setState(Elm.FIN_WAIT_1); boolean flags[] = genFlags(Tcp.FIN); sendTCPSegment(Elm.getSocket(), "", flags, -1, Tcp.resendtimes_DEFAULT); --- 542,546 ---- if(Elm != null){ ! Elm.setState(TCP_session.FIN_WAIT_1); boolean flags[] = genFlags(Tcp.FIN); sendTCPSegment(Elm.getSocket(), "", flags, -1, Tcp.resendtimes_DEFAULT); *************** *** 584,598 **** jnSocket jnsock = mSL.get_socket(sock); - int srcPort = jnsock.src_port; - String dstIP = jnsock.dst_IP; - int dstPort = jnsock.dst_port; TCP_session Elm = getSession(jnsock.genKey()); ! if(!(flags[Tcp.ACK_flag] || flags[Tcp.RST_flag])){ ! Elm.addSendingSegment(tosend, resendtimes); ! trySendSegments(Elm); } else{ ! sendPacket(tosend, Elm); } --- 615,626 ---- jnSocket jnsock = mSL.get_socket(sock); TCP_session Elm = getSession(jnsock.genKey()); ! if((flags[Tcp.ACK_flag] && !flags[Tcp.SYN_flag] && !flags[Tcp.FIN_flag])|| flags[Tcp.RST_flag]){ ! sendPacket(tosend, Elm); } else{ ! Elm.addSendingSegment(tosend, resendtimes); ! trySendSegments(Elm); } *************** *** 630,634 **** System.out.println(e.getMessage()); } ! printLayerInfo("TCP packet send to "+pack_dst+" flags="+pack_flags+" seq="+packet.get_sequence_number()+" ack="+packet.get_acknowledgment_number()+" data='"+packet.getTCP_message()+"'"); // if(packet.get_acknowledgment_number()!=Elm.getNextSequenceNumber()){ --- 658,672 ---- System.out.println(e.getMessage()); } ! ! String resend_mes = ""; ! long tid = Elm.getTimerSegmentToResend(packet.get_sequence_number()); ! Resender tmr = getTimer(tid); ! if(tmr!=null){ ! int nextrt = tmr.getResendDelay(); ! if(nextrt>0){ ! resend_mes = " Next resend on packet loss in "+(nextrt/1000.0)+"s."; ! } ! } ! printLayerInfo("TCP packet send to "+pack_dst+" flags="+pack_flags+" seq="+packet.get_sequence_number()+" ack="+packet.get_acknowledgment_number()+" data='"+packet.getTCP_message()+"'." + resend_mes); // if(packet.get_acknowledgment_number()!=Elm.getNextSequenceNumber()){ *************** *** 672,677 **** int dstPort = jnsock.dst_port; TCP_session Elm = getSession(jnsock.genKey()); - - int reps=50; TCP_packet tosend = new TCP_packet(dstIP,srcIP,dstPort,srcPort); --- 710,713 ---- *************** *** 749,753 **** System.out.println("|| >>> TCP recv pack: src="+pack_src+" dst="+pack_dst+" flags="+pack_flags+" seq="+inPacket.get_sequence_number()+" ack="+inPacket.get_acknowledgment_number()+" data='"+inPacket.getTCP_message()+"'"); ! // test if TCP sesssion exists on this NeworkLayerDevice TCP_session Elm; Elm = getSession(jnSocket.genTCPkey(inPacket.get_destPort(), inPacket.getSourceIPAddress(), inPacket.get_srcPort())); --- 785,789 ---- System.out.println("|| >>> TCP recv pack: src="+pack_src+" dst="+pack_dst+" flags="+pack_flags+" seq="+inPacket.get_sequence_number()+" ack="+inPacket.get_acknowledgment_number()+" data='"+inPacket.getTCP_message()+"'"); ! // test if TCP session exists on this NeworkLayerDevice TCP_session Elm; Elm = getSession(jnSocket.genTCPkey(inPacket.get_destPort(), inPacket.getSourceIPAddress(), inPacket.get_srcPort())); *************** *** 755,763 **** Elm = getSession(jnSocket.genTCPkey(inPacket.get_destPort(), "0.0.0.0", 0)); if(Elm != null){ - int listensock = Elm.getSocket(); int sock = mSL.accept(Elm.getSocket(), inPacket.getSourceIPAddress(), inPacket.get_srcPort()); - jnSocket jnsock = mSL.get_socket(sock); Elm = addSession(jnSocket.genTCPkey(inPacket.get_destPort(), inPacket.getSourceIPAddress(), inPacket.get_srcPort()), sock); ! Elm.setState(Elm.LISTEN); } else{ --- 791,797 ---- Elm = getSession(jnSocket.genTCPkey(inPacket.get_destPort(), "0.0.0.0", 0)); if(Elm != null){ int sock = mSL.accept(Elm.getSocket(), inPacket.getSourceIPAddress(), inPacket.get_srcPort()); Elm = addSession(jnSocket.genTCPkey(inPacket.get_destPort(), inPacket.getSourceIPAddress(), inPacket.get_srcPort()), sock); ! Elm.setState(TCP_session.LISTEN); } else{ *************** *** 857,861 **** { if(inPacket.get_SYN_flag()){ ! Elm.setState(Elm.SYN_RCVD); boolean flags[] = genFlags(Tcp.ACK | Tcp.SYN); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_SYN_ACK); --- 891,895 ---- { if(inPacket.get_SYN_flag()){ ! Elm.setState(TCP_session.SYN_RCVD); boolean flags[] = genFlags(Tcp.ACK | Tcp.SYN); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_SYN_ACK); *************** *** 868,872 **** { if(inPacket.get_SYN_flag() && inPacket.get_ACK_flag()){ ! Elm.setState(Elm.ESTABLISHED); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); --- 902,906 ---- { if(inPacket.get_SYN_flag() && inPacket.get_ACK_flag()){ ! Elm.setState(TCP_session.ESTABLISHED); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); *************** *** 882,888 **** { if(inPacket.get_ACK_flag() && !(inPacket.get_FIN_flag() || inPacket.get_SYN_flag())){ ! Elm.setState(Elm.ESTABLISHED); mSL.get_socket(Elm.getSocket()).app.OnConnect(Elm.getSocket()); ! processSegment(Elm, null); // pass already reveived segments to application } else if(inPacket.get_SYN_flag() && !(inPacket.get_ACK_flag() || inPacket.get_FIN_flag())){ --- 916,922 ---- { if(inPacket.get_ACK_flag() && !(inPacket.get_FIN_flag() || inPacket.get_SYN_flag())){ ! Elm.setState(TCP_session.ESTABLISHED); mSL.get_socket(Elm.getSocket()).app.OnConnect(Elm.getSocket()); ! processSegment(Elm, null); // pass already received segments to application } else if(inPacket.get_SYN_flag() && !(inPacket.get_ACK_flag() || inPacket.get_FIN_flag())){ *************** *** 905,913 **** { if(inPacket.get_FIN_flag() && !inPacket.get_ACK_flag()){ ! Elm.setState(Elm.CLOSE_WAIT); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); ! Elm.setState(Elm.LAST_ACK); flags = genFlags(Tcp.FIN); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_DEFAULT); --- 939,947 ---- { if(inPacket.get_FIN_flag() && !inPacket.get_ACK_flag()){ ! Elm.setState(TCP_session.CLOSE_WAIT); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); ! Elm.setState(TCP_session.LAST_ACK); flags = genFlags(Tcp.FIN); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_DEFAULT); *************** *** 931,938 **** private void recv_CLOSE_WAIT(TCP_session Elm, TCP_packet inPacket) throws TransportLayerPortException, TransportLayerException, LowLinkException, CommunicationException { ! if(false){ ! } ! else ! throw new TransportLayerException("TCP: recv_CLOSE_WAIT: unexpected packet"); } --- 965,969 ---- private void recv_CLOSE_WAIT(TCP_session Elm, TCP_packet inPacket) throws TransportLayerPortException, TransportLayerException, LowLinkException, CommunicationException { ! throw new TransportLayerException("TCP: recv_CLOSE_WAIT: unexpected packet"); } *************** *** 957,979 **** { if(inPacket.get_ACK_flag() && inPacket.get_FIN_flag()){ ! Elm.setState(Elm.TIME_WAIT); if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); } boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); if(!Tcp.USE_2MSL){ - Application app = mSL.get_socket(Elm.getSocket()).app; mSL.close(Elm.getSocket()); - app.OnDisconnect(Elm.getSocket()); } } else if(inPacket.get_ACK_flag()){ ! Elm.setState(Elm.FIN_WAIT_2); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_EXIT); } else if(inPacket.get_FIN_flag()){ ! Elm.setState(Elm.CLOSING); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_SYNC_CLOSE); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); --- 988,1013 ---- { if(inPacket.get_ACK_flag() && inPacket.get_FIN_flag()){ ! Elm.setState(TCP_session.TIME_WAIT); if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); + printLayerInfo("Closing port in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); + Application app = mSL.get_socket(Elm.getSocket()).app; if(!Tcp.USE_2MSL){ mSL.close(Elm.getSocket()); } + app.OnDisconnect(Elm.getSocket()); } else if(inPacket.get_ACK_flag()){ ! Elm.setState(TCP_session.FIN_WAIT_2); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_EXIT); + printLayerInfo("Closing on error in "+(Tcp.resendtimes_EXIT[0]/1000.0)+"s."); } else if(inPacket.get_FIN_flag()){ ! Elm.setState(TCP_session.CLOSING); Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_SYNC_CLOSE); + printLayerInfo("Closing on error in "+(Tcp.resendtimes_SYNC_CLOSE[0]/1000.0)+"s."); boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); *************** *** 989,1004 **** { if(inPacket.get_FIN_flag()){ ! Elm.setState(Elm.TIME_WAIT); removeTimer(Elm.last_timer); if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); } boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); if(!Tcp.USE_2MSL){ - Application app = mSL.get_socket(Elm.getSocket()).app; mSL.close(Elm.getSocket()); - app.OnDisconnect(Elm.getSocket()); } } else if(!(inPacket.get_ACK_flag() || inPacket.get_SYN_flag() || inPacket.get_FIN_flag())){ --- 1023,1039 ---- { if(inPacket.get_FIN_flag()){ ! Elm.setState(TCP_session.TIME_WAIT); removeTimer(Elm.last_timer); if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); + printLayerInfo("Closing port in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } boolean flags[] = genFlags(Tcp.ACK); sendTCPSegment(Elm.getSocket(), "", flags, inPacket.get_sequence_number()+1, Tcp.resendtimes_NULL); + Application app = mSL.get_socket(Elm.getSocket()).app; if(!Tcp.USE_2MSL){ mSL.close(Elm.getSocket()); } + app.OnDisconnect(Elm.getSocket()); } else if(!(inPacket.get_ACK_flag() || inPacket.get_SYN_flag() || inPacket.get_FIN_flag())){ *************** *** 1012,1025 **** { if(inPacket.get_ACK_flag()){ ! Elm.setState(Elm.TIME_WAIT); removeTimer(Elm.last_timer); if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); } else{ - Application app = mSL.get_socket(Elm.getSocket()).app; mSL.close(Elm.getSocket()); - app.OnDisconnect(Elm.getSocket()); } } else --- 1047,1061 ---- { if(inPacket.get_ACK_flag()){ ! Elm.setState(TCP_session.TIME_WAIT); removeTimer(Elm.last_timer); + Application app = mSL.get_socket(Elm.getSocket()).app; if(Tcp.USE_2MSL){ Elm.last_timer = createTimer(Elm.getSocket(), null, Tcp.resendtimes_2MSL); + printLayerInfo("Closing port in "+(Tcp.resendtimes_2MSL[0]/1000.0)+"s."); } else{ mSL.close(Elm.getSocket()); } + app.OnDisconnect(Elm.getSocket()); } else *************** *** 1092,1095 **** --- 1128,1145 ---- } + private Resender getTimer(long timerid){ + Resender tmr = null; + synchronized(tcp_timers_lock){ + Iterator<Resender> it = tcp_timers.iterator(); + while(tmr==null && it.hasNext()){ + Resender curtmr = it.next(); + if(curtmr.timerID == timerid){ + tmr = curtmr; + } + } + } + return tmr; + } + private TCP_session addSession(String key, int sock){ TCP_session tcps = new TCP_session(sock); Index: TCP_session.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/TCP_session.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TCP_session.java 24 Oct 2008 16:18:48 -0000 1.12 --- TCP_session.java 24 Oct 2009 23:24:33 -0000 1.13 *************** *** 71,79 **** * <p>Aim of this hashtable: necessarily to have</p> */ ! private Hashtable segmentsToResend = new Hashtable(); ! private PriorityQueue receivedSegments = new PriorityQueue(); ! private PriorityQueue sendingSegments = new PriorityQueue(); --- 71,79 ---- * <p>Aim of this hashtable: necessarily to have</p> */ ! private Hashtable<Integer,Long> segmentsToResend = new Hashtable<Integer,Long>(); ! private PriorityQueue<TCP_packet> receivedSegments = new PriorityQueue<TCP_packet>(); ! private PriorityQueue<TCPPacketTimesPair> sendingSegments = new PriorityQueue<TCPPacketTimesPair>(); *************** *** 161,165 **** } ! public long getSegmentToResend(int segnum){ long timerID = -1; Integer sn = new Integer(segnum); --- 161,165 ---- } ! public long getTimerSegmentToResend(int segnum){ long timerID = -1; Integer sn = new Integer(segnum); *************** *** 167,172 **** timerID = ((Long)segmentsToResend.get(sn)).longValue(); } - else - System.out.println("TCP session error on get: segment is not exists"); return timerID; } --- 167,170 ---- Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Echo_tcp.java 24 Oct 2008 16:18:48 -0000 1.43 --- Echo_tcp.java 24 Oct 2009 23:24:33 -0000 1.44 *************** *** 50,55 **** */ @Override ! public void Listen() throws TransportLayerException{ ! //throw new TransportLayerException("Cannot bind port " + listenPort + "."); recieved = 0; try{ --- 50,54 ---- */ @Override ! public void Listen() throws TransportLayerException{ recieved = 0; try{ *************** *** 57,63 **** mParentStack.SL().bind(appSock, mParentStack.getSrcIP(), listenPort); mParentStack.SL().listen(appSock); } }catch (TransportLayerException e){ ! System.out.println(e.toString());; } } --- 56,64 ---- mParentStack.SL().bind(appSock, mParentStack.getSrcIP(), listenPort); mParentStack.SL().listen(appSock); + printLayerInfo("Echo TCP server starts listening in port " + listenPort + "."); } }catch (TransportLayerException e){ ! printLayerInfo("Error: cannot bind port " + listenPort + "."); ! throw new TransportLayerException("Cannot bind port " + listenPort + "."); } } Index: Telnet_server.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_server.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Telnet_server.java 24 Oct 2008 17:46:42 -0000 1.26 --- Telnet_server.java 24 Oct 2009 23:24:33 -0000 1.27 *************** *** 70,76 **** --- 70,79 ---- mParentStack.SL().bind(appSock, mParentStack.getSrcIP(), listenPort); mParentStack.SL().listen(appSock); + printLayerInfo("Telnet server starts listening in port " + listenPort + "."); running = true; }catch (TransportLayerException e){ + printLayerInfo("Error: cannot bind port " + listenPort + "."); System.out.println(e.toString());; + throw new TransportLayerException("Cannot bind port " + listenPort + "."); } islogin=false; |
From: QweR <qw...@us...> - 2009-10-23 20:06:50
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31328 Modified Files: MainScreen.java SNMPSendDataDialog.java Log Message: fixed problems with spaces in IP addresses Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** MainScreen.java 2 Oct 2009 16:37:24 -0000 1.106 --- MainScreen.java 23 Oct 2009 20:06:33 -0000 1.107 *************** *** 122,125 **** --- 122,126 ---- import core.protocolsuite.tcp_ip.Echo; import core.protocolsuite.tcp_ip.Echo_tcp; + import core.protocolsuite.tcp_ip.IPV4Address; import core.protocolsuite.tcp_ip.Route_entry; import core.protocolsuite.tcp_ip.SNMP; *************** *** 4172,4177 **** public void EchoSend(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE); if (ip == null) --- 4173,4178 ---- public void EchoSend(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE)); if (ip == null) *************** *** 4286,4291 **** public void EchotcpSend(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE); if (ip == null) --- 4287,4292 ---- public void EchotcpSend(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE)); if (ip == null) *************** *** 4338,4343 **** public void TelnetConnect(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", --- 4339,4344 ---- public void TelnetConnect(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE)); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", *************** *** 4363,4368 **** public void PosixTelnet(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", --- 4364,4369 ---- public void PosixTelnet(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE)); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", Index: SNMPSendDataDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SNMPSendDataDialog.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SNMPSendDataDialog.java 17 Sep 2009 12:02:49 -0000 1.5 --- SNMPSendDataDialog.java 23 Oct 2009 20:06:33 -0000 1.6 *************** *** 47,50 **** --- 47,51 ---- import core.Simulation; + import core.protocolsuite.tcp_ip.IPV4Address; import core.protocolsuite.tcp_ip.SNMP; *************** *** 240,263 **** Vector<String> vars = new Vector<String>(0); Vector<String> vals = new Vector<String>(0); if(parseVariablesList(txtVariables.getText(),vars,vals)) { String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); --- 241,265 ---- Vector<String> vars = new Vector<String>(0); Vector<String> vals = new Vector<String>(0); + String ip = IPV4Address.sanitizeDecIPorName(txtIPAddress.getText()); if(parseVariablesList(txtVariables.getText(),vars,vals)) { String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + ip + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(ip, Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + ip + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + ip + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(ip, Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + ip + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + ip + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(ip, Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + ip + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); |
From: QweR <qw...@us...> - 2009-10-23 20:06:30
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31290 Modified Files: IPV4Address.java IP_packet.java ProtocolStack.java Log Message: fixed problems with spaces in IP addresses Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** ProtocolStack.java 4 Jan 2009 15:43:16 -0000 1.78 --- ProtocolStack.java 23 Oct 2009 20:06:21 -0000 1.79 *************** *** 637,641 **** } ! if (dest != "") { pingPacket = mICMPprotocol.sendPing(dest); sendPacket(pingPacket); --- 637,641 ---- } ! if (dest!=null && dest != "") { pingPacket = mICMPprotocol.sendPing(dest); sendPacket(pingPacket); Index: IP_packet.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/IP_packet.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IP_packet.java 24 Oct 2008 16:18:48 -0000 1.8 --- IP_packet.java 23 Oct 2009 20:06:21 -0000 1.9 *************** *** 109,119 **** public IP_packet(String inDestIPAddress) - { ! ! mDestIPAddress = inDestIPAddress; NatInsideMark = false; NatOutsideMark = false; - } --- 109,116 ---- public IP_packet(String inDestIPAddress) { ! setDestIPAddress(inDestIPAddress); NatInsideMark = false; NatOutsideMark = false; } *************** *** 133,141 **** public void setDestIPAddress(String inDestIPAddress) - { ! ! mDestIPAddress = inDestIPAddress; ! } --- 130,135 ---- public void setDestIPAddress(String inDestIPAddress) { ! mDestIPAddress = IPV4Address.sanitizeDecIP(inDestIPAddress); } *************** *** 157,163 **** { ! ! mSourceIPAddress = inSourceIPAddress; ! } --- 151,155 ---- { ! mSourceIPAddress = IPV4Address.sanitizeDecIP(inSourceIPAddress); } Index: IPV4Address.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/IPV4Address.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** IPV4Address.java 4 Jan 2009 15:43:16 -0000 1.12 --- IPV4Address.java 23 Oct 2009 20:06:20 -0000 1.13 *************** *** 82,86 **** public static boolean isValidIp(final String ip) { ! return ip.matches("^[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}$"); } --- 82,86 ---- public static boolean isValidIp(final String ip) { ! return ip.matches("^[\\s]*[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}[\\s]*$"); } *************** *** 520,523 **** --- 520,524 ---- */ public static boolean validateDecIP(String inDecIPAddress) { + inDecIPAddress = inDecIPAddress.trim(); String[] ip = inDecIPAddress.split("\\."); // split string into an array if (ip.length != 4) { // ip address must have 4 octets *************** *** 568,571 **** --- 569,643 ---- /** + * This is a static method that will sanitize the IP Address valid IPV4 address or null + * + * @author QweR + * @param inIPAddress + * - The IP address to be tested eg: 192.168.0.2 + * @return String + * @version v0.20 + */ + public static String sanitizeDecIP(String inDecIPAddress) { + if(inDecIPAddress==null) return null; + inDecIPAddress = inDecIPAddress.trim(); + String ipaddr = ""; + String[] ip = inDecIPAddress.split("\\."); // split string into an array + if (ip.length != 4) { // ip address must have 4 octets + return null; + } + + if (inDecIPAddress.contains("255.255.255.255")) { + return inDecIPAddress; + } + + for (int i = 0; i < ip.length; i++) { + try { + Integer octet = new Integer(ip[i].trim()); + // if this is the first octect test to see if it is a valid + // a,b or address in the range of 1 to 223 + if (i == 0) { + if (octet.intValue() < 1 || octet.intValue() > 223) { + return null; + } + ipaddr = octet.toString(); + } else { + if (octet.intValue() < 0 || octet.intValue() > 255) { + return null; + } + ipaddr += "."+octet.toString(); + } + } catch (NumberFormatException e) { + return null; + } + try { + // This code check to make sure the host id of an ipaddress is + // also valid. + boolean x = IPV4Address.checkHostId(IPV4Address.toBinaryString(IPV4Address + .getDefaultSubnetMask(inDecIPAddress)), IPV4Address.toBinaryString(inDecIPAddress)); + if (!x) { + return null; + } + } catch (Exception e) { + return null; + } // This should never happen! (fingers crossed) + } + return ipaddr; // if it has passed all of these tests return true + } + + /** + * This is a static method that will sanitize the IP Address valid IPV4 address or null + * + * @author QweR + * @param inIPAddress + * - The IP address to be tested eg: 192.168.0.2 + * @return String + * @version v0.20 + */ + public static String sanitizeDecIPorName(String inDecIPAddress) { + String ip = sanitizeDecIP(inDecIPAddress); + if(ip==null) return inDecIPAddress; + else return ip; + } + + /** * This static method will validate a subnet mask against the passed in IP * Addres. If found as a Class A, B, C and passes substring test return *************** *** 583,587 **** if (ipn.length == 4) { for (int i = 0; i < 4; i++) { ! int num = Integer.parseInt(ipn[i]); if (num < 0 || num > 255) throw new NumberFormatException(); --- 655,659 ---- if (ipn.length == 4) { for (int i = 0; i < 4; i++) { ! int num = Integer.parseInt(ipn[i].trim()); if (num < 0 || num > 255) throw new NumberFormatException(); *************** *** 685,689 **** for (int i = 0; i < 4; i++) { try { ! int val = Integer.parseInt(asip[i]); if (val >= 0 && val <= 255) { nip = (nip << 8) + val; --- 757,761 ---- for (int i = 0; i < 4; i++) { try { ! int val = Integer.parseInt(asip[i].trim()); if (val >= 0 && val <= 255) { nip = (nip << 8) + val; |
From: QweR <qw...@us...> - 2009-10-02 17:03:19
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11513/core Modified Files: Node.java Log Message: routing table import was fixed Index: Node.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Node.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Node.java 3 Jan 2009 00:53:11 -0000 1.32 --- Node.java 2 Oct 2009 16:37:24 -0000 1.33 *************** *** 596,600 **** public void execCmd(String cmd){ ! System.out.println("WRANING: Cannot execute " + cmd + " for " + getName() + "."); } --- 596,600 ---- public void execCmd(String cmd){ ! System.out.println("WARNING: Cannot execute " + cmd + " for " + getName() + ". This device not support configuration management."); } |
From: QweR <qw...@us...> - 2009-10-02 16:37:38
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11513/guiUI Modified Files: MainScreen.java Log Message: routing table import was fixed Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** MainScreen.java 27 Oct 2008 21:22:11 -0000 1.105 --- MainScreen.java 2 Oct 2009 16:37:24 -0000 1.106 *************** *** 2902,2905 **** --- 2902,2908 ---- rts[2] = "0.0.0.0"; + if(rts[2].equals("null")) + rts[2] = "255.255.0.0"; + /*r = new Route_entry(rts[0], rts[1], rts[2], rts[4], Integer.valueOf(rts[3]) |
From: QweR <qw...@us...> - 2009-10-01 21:54:17
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28331 Modified Files: GuiNode.java Log Message: correct "Disconnect link" code Index: GuiNode.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiNode.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** GuiNode.java 17 Sep 2009 12:02:49 -0000 1.16 --- GuiNode.java 1 Oct 2009 21:54:04 -0000 1.17 *************** *** 386,399 **** JMenuItem mnuDI = new JMenuItem((String)ints[i]+" ("+ni.getConnectedLink().getLinkedNodeName(getName(), (String)ints[i])+")"); ! mnuDI.addActionListener(new ActionListener() { ! ! public void actionPerformed(ActionEvent e) { ! ! controller.breakLink(lblNodeName.getText(), ! ((JMenuItem) e.getSource()).getText()); ! ! } ! ! }); mnuBreakLink.add(mnuDI); } --- 386,390 ---- JMenuItem mnuDI = new JMenuItem((String)ints[i]+" ("+ni.getConnectedLink().getLinkedNodeName(getName(), (String)ints[i])+")"); ! mnuDI.addActionListener(new LinkMenuActionListener((String)ints[i])); mnuBreakLink.add(mnuDI); } *************** *** 1001,1004 **** --- 992,1006 ---- } + + class LinkMenuActionListener implements ActionListener { + String ifName; + public LinkMenuActionListener(String in){ + super(); + ifName=in; + } + public void actionPerformed(ActionEvent e) { + controller.breakLink(lblNodeName.getText(),ifName); + } + } } |
From: QweR <qw...@us...> - 2009-09-28 17:19:29
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13989/core Modified Files: Version.java Log Message: some little bugs Index: Version.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Version.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Version.java 13 Feb 2009 09:18:27 -0000 1.18 --- Version.java 28 Sep 2009 17:19:16 -0000 1.19 *************** *** 40,48 **** */ public class Version { ! public final static String CORE_VERSION = "v0.41"; //version of the simulation core public final static String YEARS = "2005 - 2009"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 12 Feb 2009", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", --- 40,48 ---- */ public class Version { ! public final static String CORE_VERSION = "v0.42"; //version of the simulation core public final static String YEARS = "2005 - 2009"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 26 Sep 2009", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", |
From: QweR <qw...@us...> - 2009-09-28 17:19:27
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13989/guiUI Modified Files: GuiPC.java MenuBar.java WiFiPortProperties.java Log Message: some little bugs Index: GuiPC.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiPC.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GuiPC.java 27 Oct 2008 16:09:02 -0000 1.13 --- GuiPC.java 28 Sep 2009 17:19:16 -0000 1.14 *************** *** 214,220 **** + "0", core.NetworkInterface.Console, false, 0); ! /*node.addNetworkInterface(core.NetworkInterface .getIntName(core.NetworkInterface.Wireless) ! + "0", core.NetworkInterface.Wireless, true, 0);*/ } --- 214,220 ---- + "0", core.NetworkInterface.Console, false, 0); ! node.addNetworkInterface(core.NetworkInterface .getIntName(core.NetworkInterface.Wireless) ! + "0", core.NetworkInterface.Wireless, true, 0); } Index: WiFiPortProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/WiFiPortProperties.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WiFiPortProperties.java 17 Sep 2009 12:02:49 -0000 1.2 --- WiFiPortProperties.java 28 Sep 2009 17:19:16 -0000 1.3 *************** *** 51,54 **** --- 51,55 ---- import javax.swing.WindowConstants; + import core.DeviceConfig; import core.NetworkLayerDevice; import core.Simulation; *************** *** 319,328 **** backpanel.add(cmbMode, gridBagConstraints_12); ! cmbMode.addItem("Station"); if(Sim.getNode(NodeName) instanceof core.Router || Sim.getNode(NodeName) instanceof core.WirelessAP) cmbMode.addItem("AP"); ! if(((core.WiFiPort)Sim.getNode(NodeName).getNetworkInterface(NodeInt)).getMode() == core.WiFiPort.MODE_AP) ! cmbMode.setSelectedIndex(1); txtSSID = new JTextField(); --- 320,334 ---- backpanel.add(cmbMode, gridBagConstraints_12); ! if(!(Sim.getNode(NodeName) instanceof core.WirelessAP)) cmbMode.addItem("Station"); if(Sim.getNode(NodeName) instanceof core.Router || Sim.getNode(NodeName) instanceof core.WirelessAP) cmbMode.addItem("AP"); ! if(((core.WiFiPort)Sim.getNode(NodeName).getNetworkInterface(NodeInt)).getMode() == core.WiFiPort.MODE_AP){ ! int newModeIndex=-1; ! for(int i=0; i<cmbMode.getComponentCount() && newModeIndex==-1; i++){ ! if(cmbMode.getItemAt(i).equals("AP")) newModeIndex=i; ! } ! if(newModeIndex>=0) cmbMode.setSelectedIndex(newModeIndex); ! } txtSSID = new JTextField(); *************** *** 357,361 **** if(((core.WiFiPort)Sim.getNode(NodeName).getNetworkInterface(NodeInt)).isSharedAuth()) ! cmbChannel.setSelectedIndex(1); txtWEPKey = new JTextField(); --- 363,367 ---- if(((core.WiFiPort)Sim.getNode(NodeName).getNetworkInterface(NodeInt)).isSharedAuth()) ! cmbAuthMode.setSelectedIndex(1); txtWEPKey = new JTextField(); *************** *** 441,447 **** tmpNode.getConfig().executeCommand( ! "int " + NodeInt + " int wrl0 encryption key 1 size 40bit " + txtWEPKey.getText()); ! if(cmbAuthMode.getSelectedIndex() == 1) tmpNode.getConfig().executeCommand( "int " + NodeInt + " authentication open"); --- 447,456 ---- tmpNode.getConfig().executeCommand( ! "int " + NodeInt + " channel " + cmbChannel.getSelectedIndex()); ! tmpNode.getConfig().executeCommand( ! "int " + NodeInt + " encryption key 1 size 40bit " + txtWEPKey.getText()); ! ! if(cmbAuthMode.getSelectedIndex() == 0) tmpNode.getConfig().executeCommand( "int " + NodeInt + " authentication open"); *************** *** 450,462 **** "int " + NodeInt + " authentication shared"); ! if(cmbMode.getItemAt(cmbMode.getSelectedIndex()).equals("Station")) tmpNode.getConfig().executeCommand( ! "int " + NodeInt + "station-role client"); ! else tmpNode.getConfig().executeCommand( "int " + NodeInt + " station-role root access-point"); - - if (chkUP.isSelected()) { tmpNode.getConfig().executeCommand( --- 459,471 ---- "int " + NodeInt + " authentication shared"); ! if(cmbMode.getSelectedItem().equals("Station")){ tmpNode.getConfig().executeCommand( ! "int " + NodeInt + " station-role client"); ! } ! else{ tmpNode.getConfig().executeCommand( "int " + NodeInt + " station-role root access-point"); + } if (chkUP.isSelected()) { tmpNode.getConfig().executeCommand( Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** MenuBar.java 27 Oct 2008 21:22:11 -0000 1.23 --- MenuBar.java 28 Sep 2009 17:19:16 -0000 1.24 *************** *** 62,67 **** private JMenuItem mnuClearConsole = new JMenuItem("Clear Console"); ! private JMenuItem mnuClearNodeInformation = new JMenuItem( ! "Clear Node Information"); private JMenu mnuFilters = new JMenu("Show simulation messages for:"); --- 62,67 ---- private JMenuItem mnuClearConsole = new JMenuItem("Clear Console"); ! private JMenuItem mnuRefreshNodeInformation = new JMenuItem( ! "Refresh Node Information"); private JMenu mnuFilters = new JMenu("Show simulation messages for:"); *************** *** 128,132 **** mnuClearConsole.setAccelerator(KeyStroke.getKeyStroke("F3")); ! mnuClearNodeInformation.setAccelerator(KeyStroke.getKeyStroke("F4")); mnuMsgLinkLayer.setAccelerator(KeyStroke.getKeyStroke("F9")); --- 128,132 ---- mnuClearConsole.setAccelerator(KeyStroke.getKeyStroke("F3")); ! mnuRefreshNodeInformation.setAccelerator(KeyStroke.getKeyStroke("F4")); mnuMsgLinkLayer.setAccelerator(KeyStroke.getKeyStroke("F9")); *************** *** 158,162 **** mnuEnvironment.add(mnuClearConsole); ! mnuEnvironment.add(mnuClearNodeInformation); mnuEnvironment.add(mnuFilters); mnuEnvironment.add(mnuFilters2); --- 158,162 ---- mnuEnvironment.add(mnuClearConsole); ! mnuEnvironment.add(mnuRefreshNodeInformation); mnuEnvironment.add(mnuFilters); mnuEnvironment.add(mnuFilters2); *************** *** 191,195 **** mnuEnvironment.setMnemonic('E'); mnuClearConsole.setMnemonic('C'); ! mnuClearNodeInformation.setMnemonic('N'); mnuHelp.setMnemonic('H'); mnuAbout.setMnemonic('A'); --- 191,195 ---- mnuEnvironment.setMnemonic('E'); mnuClearConsole.setMnemonic('C'); ! mnuRefreshNodeInformation.setMnemonic('N'); mnuHelp.setMnemonic('H'); mnuAbout.setMnemonic('A'); *************** *** 326,332 **** }); ! mnuClearNodeInformation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ! controller.clearNodeInformation(); } }); --- 326,332 ---- }); ! mnuRefreshNodeInformation.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ! controller.refreshNodeInformationTab(); } }); |
From: QweR <qw...@us...> - 2009-09-28 17:19:27
|
Update of /cvsroot/javanetsim/javaNetSim/core/OSPF In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13989/core/OSPF Modified Files: OSPFConfigurateCommands.java Log Message: some little bugs Index: OSPFConfigurateCommands.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/OSPF/OSPFConfigurateCommands.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OSPFConfigurateCommands.java 13 Feb 2009 09:18:27 -0000 1.2 --- OSPFConfigurateCommands.java 28 Sep 2009 17:19:16 -0000 1.3 *************** *** 33,37 **** myCommands.add(OSPF_AREA_COMMAND, new RouterOSPFAreaCommand(), "Area of router OSPF"); myCommands.add(OSPF_REDISTRIBUTE_COMMAND, new RouterOSPFRedistributeCommand(), "Router use redistribute"); ! myCommands.add(OSPF_NETWORK_COMMAND, new RouterOSPFNetworkCommand(), "Add network/interface for RIP"); } --- 33,37 ---- myCommands.add(OSPF_AREA_COMMAND, new RouterOSPFAreaCommand(), "Area of router OSPF"); myCommands.add(OSPF_REDISTRIBUTE_COMMAND, new RouterOSPFRedistributeCommand(), "Router use redistribute"); ! myCommands.add(OSPF_NETWORK_COMMAND, new RouterOSPFNetworkCommand(), "Add network/interface for OSPF"); } |
From: Alexander B. <da...@us...> - 2009-09-17 12:03:03
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12004/guiUI Modified Files: ConsolePortProperties.java EthPortProperties.java GuiNode.java LinkProperties.java PingDialog.java SNMPSendDataDialog.java SerPortProperties.java SetTCPIPPropertiesDialog.java WANPortProperties.java WiFiPortProperties.java Log Message: Fixed imports and project settings... Index: LinkProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/LinkProperties.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LinkProperties.java 24 Oct 2008 16:18:48 -0000 1.10 --- LinkProperties.java 17 Sep 2009 12:02:49 -0000 1.11 *************** *** 44,48 **** import javax.swing.JButton; import javax.swing.JComboBox; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; --- 44,47 ---- Index: ConsolePortProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/ConsolePortProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConsolePortProperties.java 27 Oct 2008 18:44:41 -0000 1.1 --- ConsolePortProperties.java 17 Sep 2009 12:02:49 -0000 1.2 *************** *** 39,52 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; - import java.awt.event.FocusAdapter; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; - import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.WindowConstants; --- 39,49 ---- Index: SetTCPIPPropertiesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SetTCPIPPropertiesDialog.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SetTCPIPPropertiesDialog.java 24 Oct 2008 16:18:48 -0000 1.12 --- SetTCPIPPropertiesDialog.java 17 Sep 2009 12:02:49 -0000 1.13 *************** *** 50,54 **** import javax.swing.JButton; import javax.swing.JComboBox; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; --- 50,53 ---- Index: SNMPSendDataDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SNMPSendDataDialog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SNMPSendDataDialog.java 24 Oct 2008 16:18:48 -0000 1.4 --- SNMPSendDataDialog.java 17 Sep 2009 12:02:49 -0000 1.5 *************** *** 40,44 **** import javax.swing.JButton; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; --- 40,43 ---- Index: WANPortProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/WANPortProperties.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WANPortProperties.java 24 Oct 2008 16:18:48 -0000 1.6 --- WANPortProperties.java 17 Sep 2009 12:02:49 -0000 1.7 *************** *** 48,52 **** import javax.swing.JCheckBox; import javax.swing.JComboBox; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; --- 48,51 ---- Index: EthPortProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/EthPortProperties.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EthPortProperties.java 24 Oct 2008 16:18:48 -0000 1.7 --- EthPortProperties.java 17 Sep 2009 12:02:49 -0000 1.8 *************** *** 44,48 **** import javax.swing.JButton; import javax.swing.JCheckBox; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; --- 44,47 ---- Index: WiFiPortProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/WiFiPortProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WiFiPortProperties.java 25 Oct 2008 16:35:11 -0000 1.1 --- WiFiPortProperties.java 17 Sep 2009 12:02:49 -0000 1.2 *************** *** 44,48 **** import javax.swing.JCheckBox; import javax.swing.JComboBox; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; --- 44,47 ---- Index: SerPortProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SerPortProperties.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SerPortProperties.java 24 Oct 2008 16:18:48 -0000 1.5 --- SerPortProperties.java 17 Sep 2009 12:02:49 -0000 1.6 *************** *** 44,48 **** import javax.swing.JButton; import javax.swing.JCheckBox; - import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; --- 44,47 ---- Index: GuiNode.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiNode.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** GuiNode.java 27 Oct 2008 16:09:02 -0000 1.15 --- GuiNode.java 17 Sep 2009 12:02:49 -0000 1.16 *************** *** 95,99 **** import javax.swing.SwingConstants; - import core.Link; import core.NetworkInterface; import core.Node; --- 95,98 ---- Index: PingDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/PingDialog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PingDialog.java 24 Oct 2008 16:18:48 -0000 1.4 --- PingDialog.java 17 Sep 2009 12:02:49 -0000 1.5 *************** *** 35,39 **** import javax.swing.BoxLayout; import javax.swing.JButton; - import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JLabel; --- 35,38 ---- |
From: Alexander B. <da...@us...> - 2009-09-17 12:03:00
|
Update of /cvsroot/javanetsim/javaNetSim In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12004 Added Files: .classpath .project Removed Files: build.xml Log Message: Fixed imports and project settings... --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>javaNetSim</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> --- build.xml DELETED --- --- NEW FILE: .classpath --- <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path=""/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="output" path=""/> </classpath> |
From: Alexander B. <da...@us...> - 2009-09-17 12:02:59
|
Update of /cvsroot/javanetsim/javaNetSim/HtmlHelp/images In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12004/HtmlHelp/images Removed Files: Sim1_NodeInfo_sm.gif Sim1_PingInfo_sm.gif Sim4_sm.gif back.gif firewall.gif screeninformation.JPG Log Message: Fixed imports and project settings... --- firewall.gif DELETED --- --- Sim1_NodeInfo_sm.gif DELETED --- --- Sim4_sm.gif DELETED --- --- screeninformation.JPG DELETED --- --- back.gif DELETED --- --- Sim1_PingInfo_sm.gif DELETED --- |
From: Alexander B. <da...@us...> - 2009-09-17 12:02:59
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12004/core Modified Files: WANDatagram.java WANSocket.java Log Message: Fixed imports and project settings... Index: WANDatagram.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/WANDatagram.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WANDatagram.java 24 Oct 2008 16:18:48 -0000 1.5 --- WANDatagram.java 17 Sep 2009 12:02:49 -0000 1.6 *************** *** 9,14 **** package core; - import java.io.BufferedReader; - import java.io.InputStream; import java.net.DatagramPacket; import java.net.DatagramSocket; --- 9,12 ---- Index: WANSocket.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/WANSocket.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** WANSocket.java 24 Oct 2008 16:18:48 -0000 1.8 --- WANSocket.java 17 Sep 2009 12:02:49 -0000 1.9 *************** *** 10,14 **** package core; import java.io.BufferedReader; - import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; --- 10,13 ---- |
From: Alexander B. <da...@us...> - 2009-09-17 12:02:58
|
Update of /cvsroot/javanetsim/javaNetSim/HtmlHelp In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12004/HtmlHelp Removed Files: GUI-tutorial.htm about.htm credits.htm introduction.htm toc.html Log Message: Fixed imports and project settings... --- about.htm DELETED --- --- GUI-tutorial.htm DELETED --- --- introduction.htm DELETED --- --- credits.htm DELETED --- --- toc.html DELETED --- |
From: Alexander B. <da...@us...> - 2009-02-13 09:18:41
|
Update of /cvsroot/javanetsim/javaNetSim In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21599 Modified Files: README.txt Log Message: Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/README.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** README.txt 24 Oct 2008 18:13:48 -0000 1.19 --- README.txt 13 Feb 2009 09:18:25 -0000 1.20 *************** *** 3,7 **** ################################### ! Version: Public Release Version 0.40 Website: http://sf.net/projects/javanetsim Authors: See 'About' menu. --- 3,7 ---- ################################### ! Version: Public Release Version 0.41 Website: http://sf.net/projects/javanetsim Authors: See 'About' menu. *************** *** 32,35 **** --- 32,54 ---- ********************* + ***** Release Version 0.41 12 February 2009 ***** + + Fixed + ----- + + GUI Issues - + + 1. Fixed some console bugs. + + Simulation Issues - + + 1. Fixed bugs with console interfaces. + + New Features + ------------ + + 1. OSPF. + + ***** Release Version 0.40 1st November 2008 ***** |
From: Alexander B. <da...@us...> - 2009-02-13 09:18:39
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21599/core Modified Files: AccessListEngine.java Laptop.java Version.java Log Message: Index: Laptop.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Laptop.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Laptop.java 24 Oct 2008 16:18:48 -0000 1.2 --- Laptop.java 13 Feb 2009 09:18:27 -0000 1.3 *************** *** 67,86 **** - /** - - * A PC is considered to be a client PC in a network which only has one NetworkInterface. The addInterface - - * method of the inherited Node class is overridden to only allow one NetworkInterface to be added. - - * @author tristan_veness - - * @since 13 June 2004 - - * @version v0.10 - - */ - - - class Laptop extends ApplicationLayerDevice { --- 67,70 ---- *************** *** 90,99 **** private static final long serialVersionUID = -8692117217516199205L; - /** - * Constructs a PC with the specified name. - * @author tristan_veness - * @param inName - A name to give the new PC Node. eg: PC1 - * @version v0.10 - */ public Laptop(String inName, boolean inOn) { super(inName,7, inOn); --- 74,77 ---- Index: Version.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Version.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Version.java 26 Oct 2008 15:37:40 -0000 1.17 --- Version.java 13 Feb 2009 09:18:27 -0000 1.18 *************** *** 40,55 **** */ public class Version { ! public final static String CORE_VERSION = "v0.40"; //version of the simulation core ! public final static String YEARS = "2005 - 2008"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 1 Nov 2008", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", ! "Alexander Bolshev [Key]", "Project Leader / Developer / Maintainer", ! "Konstantin Karpov [QweR]", "Developer / Tester", ! "","Contributors & Old Developers:", "Ilgar Alekperov [Gift]", "\t First version of TCP, Echo TCP, Export to HTML, Testing & Bugfixing", ! "Igor Goroshkov", "\t RIP protocol core & GUI", "", "If you found a bug, please post it to: http://sf.net/tracker/?atid=784685&group_id=152576", --- 40,58 ---- */ public class Version { ! public final static String CORE_VERSION = "v0.41"; //version of the simulation core ! public final static String YEARS = "2005 - 2009"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 12 Feb 2009", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", ! "Maintainer", ! "Alexander Bolshev [Key]", ! "","Contributors & Other Developers:", ! "Konstantin Karpov [QweR]", "\t Developer / Tester", ! "Anatoly Chekh [achekh]", "\t OSPF, Testing & Bugfixing", "Ilgar Alekperov [Gift]", "\t First version of TCP, Echo TCP, Export to HTML, Testing & Bugfixing", ! "Igor Goroshkov", "\t RIP protocol core & GUI", ! "Oleg Listov [listov]", "\t DNS", "", "If you found a bug, please post it to: http://sf.net/tracker/?atid=784685&group_id=152576", Index: AccessListEngine.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/AccessListEngine.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AccessListEngine.java 16 Dec 2008 15:14:23 -0000 1.8 --- AccessListEngine.java 13 Feb 2009 09:18:27 -0000 1.9 *************** *** 9,13 **** import core.protocolsuite.tcp_ip.TCP_packet; import core.protocolsuite.tcp_ip.UDP_packet; ! /** * --- 9,13 ---- import core.protocolsuite.tcp_ip.TCP_packet; import core.protocolsuite.tcp_ip.UDP_packet; ! /** * *************** *** 229,233 **** || temp_acl.protocol==protocol) && IPV4Address.IPandMask(binNetwork1, binMask1).equals(IPV4Address.IPandMask(binIP1,binMask1)) && ! (binNetwork2==null || (binIP2!=null && IPV4Address.IPandMask(binNetwork2, binMask2).equals(IPV4Address.IPandMask(binIP2,binMask2)))) && (temp_acl.Port2 == 0 || temp_acl.Port2 == port2) --- 229,233 ---- || temp_acl.protocol==protocol) && IPV4Address.IPandMask(binNetwork1, binMask1).equals(IPV4Address.IPandMask(binIP1,binMask1)) && ! (binNetwork2==null || (binIP2!=null && IPV4Address.IPandMask(binNetwork2, binMask2).equals(IPV4Address.IPandMask(binIP2,binMask2)))) && (temp_acl.Port2 == 0 || temp_acl.Port2 == port2) |
From: Alexander B. <da...@us...> - 2009-02-13 09:18:34
|
Update of /cvsroot/javanetsim/javaNetSim/core/OSPF In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv21599/core/OSPF Modified Files: OSPFConfigurateCommands.java SPFCreator.java Log Message: Index: OSPFConfigurateCommands.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/OSPF/OSPFConfigurateCommands.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OSPFConfigurateCommands.java 3 Jan 2009 00:53:11 -0000 1.1 --- OSPFConfigurateCommands.java 13 Feb 2009 09:18:27 -0000 1.2 *************** *** 30,33 **** --- 30,34 ---- public void init() { + myCommands.addDescription("router ospf","Open Shortest Path First (OSPF)"); myCommands.add(OSPF_AREA_COMMAND, new RouterOSPFAreaCommand(), "Area of router OSPF"); myCommands.add(OSPF_REDISTRIBUTE_COMMAND, new RouterOSPFRedistributeCommand(), "Router use redistribute"); Index: SPFCreator.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/OSPF/SPFCreator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SPFCreator.java 3 Jan 2009 00:53:12 -0000 1.1 --- SPFCreator.java 13 Feb 2009 09:18:27 -0000 1.2 *************** *** 155,159 **** } ! @Override public int compareTo(VertexCandidate vertexCandidate) { return myMetric - vertexCandidate.myMetric; --- 155,159 ---- } ! //@Override public int compareTo(VertexCandidate vertexCandidate) { return myMetric - vertexCandidate.myMetric; |
From: QweR <qw...@us...> - 2009-02-12 23:16:42
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17281 Modified Files: DeviceConfig.java Log Message: sh run on Laptop fixed Index: DeviceConfig.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/DeviceConfig.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** DeviceConfig.java 3 Jan 2009 00:53:11 -0000 1.31 --- DeviceConfig.java 12 Feb 2009 21:58:15 -0000 1.32 *************** *** 667,673 **** if (snmpa != null && snmpa.running) { conf.add("snmp-server port " + snmpa.getPort()); ! } ! if (!snmpa.getPassword().equals(SNMP.DEFAULT_COMMUNITY)) { ! conf.add("snmp-server community " + snmpa.getPassword()); } --- 667,673 ---- if (snmpa != null && snmpa.running) { conf.add("snmp-server port " + snmpa.getPort()); ! if (!snmpa.getPassword().equals(SNMP.DEFAULT_COMMUNITY)) { ! conf.add("snmp-server community " + snmpa.getPassword()); ! } } |
From: Alexander B. <da...@us...> - 2008-12-16 15:14:29
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2484/core Modified Files: AccessListEngine.java CommandProcessor.java MultilayerSwitch.java Log Message: Index: CommandProcessor.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/CommandProcessor.java,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** CommandProcessor.java 3 Nov 2008 23:33:11 -0000 1.42 --- CommandProcessor.java 16 Dec 2008 15:14:23 -0000 1.43 *************** *** 3356,3360 **** } else{ ! IPV4Address ip = new IPV4Address(params.get(2)); ArrayList<?> ifaces = device.getAllInterfacesNames(); boolean found = false; --- 3356,3360 ---- } else{ ! IPV4Address ip = new IPV4Address(params.get(0)); ArrayList<?> ifaces = device.getAllInterfacesNames(); boolean found = false; Index: MultilayerSwitch.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/MultilayerSwitch.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MultilayerSwitch.java 27 Oct 2008 18:27:52 -0000 1.10 --- MultilayerSwitch.java 16 Dec 2008 15:14:23 -0000 1.11 *************** *** 113,118 **** it = NetworkInterfacetable.elements(); while (it.hasMoreElements()) { ! NetworkInterfacePort tempInterface = (NetworkInterfacePort) it ! .nextElement(); nic = tempInterface.getName(); Hashtable<String, Long> outInt = IntCaches.get(nic); --- 113,122 ---- it = NetworkInterfacetable.elements(); while (it.hasMoreElements()) { ! NetworkInterface tempInt = (NetworkInterface) it.nextElement(); ! ! if(!(tempInt instanceof NetworkInterfacePort)) continue; ! ! NetworkInterfacePort tempInterface = (NetworkInterfacePort) tempInt; ! nic = tempInterface.getName(); Hashtable<String, Long> outInt = IntCaches.get(nic); *************** *** 144,149 **** // that sent in the packet // if it is skip that interface ! NetworkInterfacePort tempInterface = (NetworkInterfacePort) it ! .nextElement(); if (!tempInterface.getName().equals(inInterfaceName)) { --- 148,156 ---- // that sent in the packet // if it is skip that interface ! NetworkInterface tempInt = (NetworkInterface) it.nextElement(); ! ! if(!(tempInt instanceof NetworkInterfacePort)) continue; ! ! NetworkInterfacePort tempInterface = (NetworkInterfacePort) tempInt; if (!tempInterface.getName().equals(inInterfaceName)) { Index: AccessListEngine.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/AccessListEngine.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AccessListEngine.java 24 Oct 2008 17:46:42 -0000 1.7 --- AccessListEngine.java 16 Dec 2008 15:14:23 -0000 1.8 *************** *** 219,222 **** --- 219,224 ---- binNetwork1 = IPV4Address.toBinaryString(temp_acl.IP1); binMask1 = IPV4Address.toBinaryString(temp_acl.SubnetMask1); + binNetwork2 = null; + binMask2 = null; if(temp_acl.IP2!=null && temp_acl.SubnetMask2!=null){ binNetwork2 = IPV4Address.toBinaryString(temp_acl.IP2); *************** *** 224,230 **** } ! if((temp_acl.protocol==-1 || temp_acl.protocol==access_list.IP || temp_acl.protocol==protocol) && IPV4Address.IPandMask(binNetwork1, binMask1).equals(IPV4Address.IPandMask(binIP1,binMask1)) && ! (binNetwork2==null || (binIP2!=null || IPV4Address.IPandMask(binNetwork2, binMask2).equals(IPV4Address.IPandMask(binIP2,binMask2)))) && (temp_acl.Port2 == 0 || temp_acl.Port2 == port2) ){ --- 226,234 ---- } ! if((temp_acl.protocol==-1 || temp_acl.protocol==access_list.IP ! || temp_acl.protocol==protocol) && IPV4Address.IPandMask(binNetwork1, binMask1).equals(IPV4Address.IPandMask(binIP1,binMask1)) && ! (binNetwork2==null ! || (binIP2!=null && IPV4Address.IPandMask(binNetwork2, binMask2).equals(IPV4Address.IPandMask(binIP2,binMask2)))) && (temp_acl.Port2 == 0 || temp_acl.Port2 == port2) ){ |
From: QweR <qw...@us...> - 2008-11-03 23:33:16
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23439/core Modified Files: CommandProcessor.java Log Message: wrong parameters description fixed Index: CommandProcessor.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/CommandProcessor.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** CommandProcessor.java 2 Nov 2008 22:25:23 -0000 1.41 --- CommandProcessor.java 3 Nov 2008 23:33:11 -0000 1.42 *************** *** 837,841 **** modes = new Modes(CommandInterface.CONF_MODE, CommandInterface.NETWORK_LAYER, CommandInterface.NO_CALL); call_params = "(1|2|3|4) size <40bit|128bit> <HEX key>"; ! no_call_params = "<cr>"; } public String call(Vector<String> params){ --- 837,841 ---- modes = new Modes(CommandInterface.CONF_MODE, CommandInterface.NETWORK_LAYER, CommandInterface.NO_CALL); call_params = "(1|2|3|4) size <40bit|128bit> <HEX key>"; ! no_call_params = "(1|2|3|4)"; } public String call(Vector<String> params){ *************** *** 1655,1659 **** modes = new Modes(CommandInterface.CONF_MODE, CommandInterface.NETWORK_LAYER, CommandInterface.CALL_ONLY); call_params = "(client|repeater|root access-point)"; - no_call_params = "<cr>"; } public String call(Vector<String> params){ --- 1655,1658 ---- |
From: QweR <qw...@us...> - 2008-11-02 22:25:32
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5741/core/protocolsuite/tcp_ip Modified Files: SNMP.java Log Message: more fixes Index: SNMP.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/SNMP.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** SNMP.java 24 Oct 2008 16:18:48 -0000 1.29 --- SNMP.java 2 Nov 2008 22:25:23 -0000 1.30 *************** *** 71,78 **** public final static int SNMP_RESPONSE = 5; public final static int DEFAULT_PORT = 161; private static int SNMPID = 0; public boolean running = false; public Vector<SNMPInstance> SNMPgroups = new Vector<SNMPInstance>(0); ! private String current_password = ""; private ApplicationLayerDevice current_device; //following variables be actual temporality --- 71,79 ---- public final static int SNMP_RESPONSE = 5; public final static int DEFAULT_PORT = 161; + public final static String DEFAULT_COMMUNITY = "public"; private static int SNMPID = 0; public boolean running = false; public Vector<SNMPInstance> SNMPgroups = new Vector<SNMPInstance>(0); ! private String current_password = DEFAULT_COMMUNITY; private ApplicationLayerDevice current_device; //following variables be actual temporality |
From: QweR <qw...@us...> - 2008-11-02 22:25:28
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5741/core Modified Files: CommandProcessor.java DeviceConfig.java Log Message: more fixes Index: CommandProcessor.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/CommandProcessor.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** CommandProcessor.java 2 Nov 2008 00:10:29 -0000 1.40 --- CommandProcessor.java 2 Nov 2008 22:25:23 -0000 1.41 *************** *** 4301,4314 **** if(snmpa != null){ if(params.size()==1){ - try{ - snmpa.Close(); - }catch(TransportLayerException e) { } snmpa.setPassword(params.get(0)); - try{ - snmpa.Listen(); - } - catch(TransportLayerException e) { - out+="SNMP agent: unable to listen\n"; - } } else{ --- 4301,4305 ---- *************** *** 4331,4337 **** if(snmpa != null){ if(params.size() == 0){ ! try{ ! snmpa.Close(); ! }catch(TransportLayerException e) { } } else{ --- 4322,4326 ---- if(snmpa != null){ if(params.size() == 0){ ! snmpa.setPassword(SNMP.DEFAULT_COMMUNITY); } else{ *************** *** 4361,4377 **** if(snmpa != null){ if(params.size()==1){ ! try{ ! snmpa.Close(); ! }catch(TransportLayerException e) { } try{ int port = Integer.parseInt(params.get(0)); snmpa.setPort(port); ! if(snmpa.running){ ! try{ ! snmpa.Listen(); ! } ! catch(TransportLayerException e) { ! out+="SNMP agent: unable to listen\n"; ! } } }catch(NumberFormatException e){ --- 4350,4366 ---- if(snmpa != null){ if(params.size()==1){ ! if(snmpa.running){ ! try{ ! snmpa.Close(); ! }catch(TransportLayerException e) { } ! } try{ int port = Integer.parseInt(params.get(0)); snmpa.setPort(port); ! try{ ! snmpa.Listen(); ! } ! catch(TransportLayerException e) { ! out+="SNMP agent: unable to listen\n"; } }catch(NumberFormatException e){ Index: DeviceConfig.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/DeviceConfig.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** DeviceConfig.java 27 Oct 2008 21:22:11 -0000 1.29 --- DeviceConfig.java 2 Nov 2008 22:25:23 -0000 1.30 *************** *** 612,618 **** SNMP snmpa = (SNMP) appdevice.getApp(core.ApplicationLayerDevice.SNMP_AGENT_ID); if(snmpa != null && snmpa.running){ ! if(snmpa.getPort()!=SNMP.DEFAULT_PORT){ ! conf.add("snmp-server port "+snmpa.getPort()); ! } conf.add("snmp-server community "+snmpa.getPassword()); } --- 612,618 ---- SNMP snmpa = (SNMP) appdevice.getApp(core.ApplicationLayerDevice.SNMP_AGENT_ID); if(snmpa != null && snmpa.running){ ! conf.add("snmp-server port "+snmpa.getPort()); ! } ! if(!snmpa.getPassword().equals(SNMP.DEFAULT_COMMUNITY)){ conf.add("snmp-server community "+snmpa.getPassword()); } |