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());
}
|