public class UPnP extends ControlPoint implements DeviceChangeListener, EventListener
Modifier and Type | Class and Description |
---|---|
(package private) static class |
UPnP.IPv6ForwardPort
Extended to store the requested IP to be forwarded.
|
Modifier and Type | Field and Description |
---|---|
static int |
LEASE_TIME_SECONDS |
Constructor and Description |
---|
UPnP(I2PAppContext context,
int ssdpPort,
int httpPort,
InetAddress[] binds) |
Modifier and Type | Method and Description |
---|---|
void |
deviceAdded(Device dev)
DeviceChangeListener
|
void |
deviceRemoved(Device dev)
DeviceChangeListener
|
void |
eventNotifyReceived(String uuid,
long seq,
String varName,
String value)
EventListener callback -
unused for now - supported in miniupnpd as of 1.1
|
DetectedIP[] |
getAddress()
As we only support a single active IGD, and we don't currently have any way
to get any IPv6 addresses, this will return at most one IPv4 address.
|
static Set<String> |
getLocalAddresses()
Get the addresses we want to bind to
|
static void |
main(String[] args)
Dumps out device info in semi-HTML format
|
void |
onChangePublicPorts(Set<ForwardPort> ports,
ForwardPortCallback cb)
Registers a callback when the given ports change.
|
String |
renderStatusHTML()
warning - slow
|
boolean |
runPlugin() |
void |
search()
We override search() to update the SSDPSearchResponseSocketList,
SSDPNotifySocketList, and HTTPServerList every time.
|
void |
terminate()
WARNING - Blocking up to 2 seconds
|
void |
unregisterPortMappings() |
addDeviceChangeListener, addEventListener, addNotifyListener, addSearchResponseListener, finalize, getDevice, getDeviceDisposer, getDeviceList, getEventSubURI, getExpiredDeviceMonitoringInterval, getHTTPPort, getHTTPServerList, getRenewSubscriber, getSearchMx, getSSDPNotifySocketList, getSSDPPort, getSSDPSearchResponseSocketList, getSubscriberService, getUserData, hasDevice, httpRequestRecieved, isNMPRMode, isSubscribed, lock, notifyReceived, performAddDeviceListener, performEventListener, performNotifyListener, performRemoveDeviceListener, performSearchResponseListener, print, removeDevice, removeDevice, removeDeviceChangeListener, removeEventListener, removeExpiredDevices, removeNotifyListener, removeSearchResponseListener, renewSubscriberService, renewSubscriberService, renewSubscriberService, search, search, searchResponseReceived, setDeviceDisposer, setEventSubURI, setExpiredDeviceMonitoringInterval, setHTTPPort, setNMPRMode, setRenewSubscriber, setSearchMx, setSSDPPort, setUserData, start, start, start, stop, subscribe, subscribe, subscribe, subscribe, unlock, unsubscribe, unsubscribe, unsubscribe
public static final int LEASE_TIME_SECONDS
public UPnP(I2PAppContext context, int ssdpPort, int httpPort, InetAddress[] binds)
public boolean runPlugin()
public void terminate()
public DetectedIP[] getAddress()
public void deviceAdded(Device dev)
deviceAdded
in interface DeviceChangeListener
public void unregisterPortMappings()
public void deviceRemoved(Device dev)
deviceRemoved
in interface DeviceChangeListener
public void eventNotifyReceived(String uuid, long seq, String varName, String value)
eventNotifyReceived
in interface EventListener
public static Set<String> getLocalAddresses()
public void search()
search
in class ControlPoint
public String renderStatusHTML()
public void onChangePublicPorts(Set<ForwardPort> ports, ForwardPortCallback cb)
ports
- non-nullcb
- in UPnPManager