public class UPnP
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static GatewayDevice |
gatewayDevice |
private static ConcurrentLog |
LOG |
private static java.util.Map<UPnPMappingType,UPnPMapping> |
MAPPINGS |
private static int |
MAX_CANDIDATE_PORT |
private static int |
MIN_CANDIDATE_PORT |
private static Switchboard |
SB |
Constructor and Description |
---|
UPnP() |
Modifier and Type | Method and Description |
---|---|
private static void |
addPortMapping(UPnPMappingType type,
UPnPMapping mapping,
int port)
Add port mapping to all gateway devices on the network.
Latest port mapping will be removed. |
static void |
addPortMappings()
Add port mappings for configured ports.
|
private static void |
deletePortMapping(UPnPMapping mapping)
Delete current port mapping.
|
static void |
deletePortMappings()
Remove all port mappings.
|
static int |
getMappedPort(UPnPMappingType type)
Gets currently mapped port.
|
private static int |
getNewPortCandidate(int oldCandidate) |
private static boolean |
init() |
private static boolean |
isInUse(int port) |
private static java.lang.String |
toString(java.net.InetAddress inetAddress) |
private static final ConcurrentLog LOG
private static final Switchboard SB
private static GatewayDevice gatewayDevice
private static final java.util.Map<UPnPMappingType,UPnPMapping> MAPPINGS
private static final int MIN_CANDIDATE_PORT
private static final int MAX_CANDIDATE_PORT
private static boolean init()
public static void addPortMappings()
public static void deletePortMappings()
private static void addPortMapping(UPnPMappingType type, UPnPMapping mapping, int port)
type
- mapping typemapping
- contains data about mappingport
- port number to mapprivate static void deletePortMapping(UPnPMapping mapping)
mapping
- to deletepublic static int getMappedPort(UPnPMappingType type)
type
- mapping typeprivate static int getNewPortCandidate(int oldCandidate)
private static boolean isInUse(int port)
private static java.lang.String toString(java.net.InetAddress inetAddress)