Methods Summary |
---|
public void | addPortMapping(boolean tcp, int port, java.lang.String description)Azureus framework methods
try{
/* use public port for internal port */
natDevice.addPortMapping( tcp, port, port );
} catch( Exception e) {
throw( new UPnPException( "addPortMapping failed", e ));
}
synchronized( this ){
/* Find and remove old mapping, if any */
Iterator it = mappings.iterator();
while( it.hasNext() ) {
portMapping m = (portMapping)it.next();
if (m.getExternalPort() == port && m.isTCP() == tcp)
it.remove() ;
}
/* add new port to list */
mappings.add( new portMapping( port, tcp,
natDevice.getLocalAddress().getHostAddress(),
description) );
}
|
public void | deletePortMapping(boolean tcp, int port)
try {
natDevice.deletePortMapping( tcp, port, port );
} catch ( Exception e) {
throw( new UPnPException("deletePortMapping failed", e) );
}
synchronized( this ){
/* Delete from the mappings */
Iterator it = mappings.iterator();
while( it.hasNext() ) {
portMapping m = (portMapping)it.next();
if (m.getExternalPort() == port && m.isTCP() == tcp)
it.remove() ;
}
}
|
public java.lang.String | getExternalIPAddress()
return(natDevice.getExternalIPAddress());
|
public com.aelitis.net.upnp.services.UPnPWANConnectionPortMapping[] | getPortMappings()
synchronized( this ){
/* Check UPnPSSWANConnectionImpl.java for hints */
UPnPWANConnectionPortMapping[] res2 = new UPnPWANConnectionPortMapping[mappings.size()];
mappings.toArray(res2);
return res2;
}
|
public java.lang.String[] | getStatusInfo()
String connection_status = null;
String connection_error = null;
String uptime = null;
/* can we ping the NAT for this info? */
uptime = "" + natDevice.getEpoch();
return( new String[] { connection_status, connection_error, uptime } );
|