rice.pastry.socket.nat.sbbi
Class SBBINatHandler

java.lang.Object
  extended by rice.pastry.socket.nat.sbbi.SBBINatHandler
All Implemented Interfaces:
NATHandler

public class SBBINatHandler
extends Object
implements NATHandler


Field Summary
static int MAX_PORT
           
 
Constructor Summary
SBBINatHandler(Environment env, InetAddress localAddress)
           
 
Method Summary
 int findAvailableFireWallPort(int internal, int external, int tries, String appName)
          Search for an available port forwarding, starting with the external address specified.
 InetAddress findFireWall(InetAddress bindAddress)
          Search for the firewall on the NIC specified by the bindAddress
 InetAddress getFireWallExternalAddress()
          The neame of the firewall's external address.
 void openFireWallPort(int local, int external, String appName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_PORT

public static final int MAX_PORT
See Also:
Constant Field Values
Constructor Detail

SBBINatHandler

public SBBINatHandler(Environment env,
                      InetAddress localAddress)
Method Detail

findFireWall

public InetAddress findFireWall(InetAddress bindAddress)
                         throws IOException
Description copied from interface: NATHandler
Search for the firewall on the NIC specified by the bindAddress

Specified by:
findFireWall in interface NATHandler
Parameters:
bindAddress - the network to find the firewall on
Returns:
Throws:
IOException

findAvailableFireWallPort

public int findAvailableFireWallPort(int internal,
                                     int external,
                                     int tries,
                                     String appName)
                              throws IOException
Description copied from interface: NATHandler
Search for an available port forwarding, starting with the external address specified. The internal one is given so you can detect that the rule was already in place.

Specified by:
findAvailableFireWallPort in interface NATHandler
Returns:
Throws:
IOException

openFireWallPort

public void openFireWallPort(int local,
                             int external,
                             String appName)
                      throws IOException
Specified by:
openFireWallPort in interface NATHandler
Throws:
IOException

getFireWallExternalAddress

public InetAddress getFireWallExternalAddress()
Description copied from interface: NATHandler
The neame of the firewall's external address. null if there is no firewall.

Specified by:
getFireWallExternalAddress in interface NATHandler
Returns:


Copyright © 2010. All Rights Reserved.