public class UPnP extends ControlPoint implements DeviceChangeListener, EventListener
| Modifier and Type | Class and Description |
|---|---|
(package private) static class | UPnP.IPv6ForwardPortIPv6-specific port forwarding configuration. |
| Modifier and Type | Field and Description |
|---|---|
static int | LEASE_TIME_SECONDSLEASE_TIME_SECONDS. |
| Constructor and Description |
|---|
UPnP(I2PAppContext context,
int ssdpPort,
int httpPort,
InetAddress[] binds)UPnP. |
| 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()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()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, unsubscribepublic static final int LEASE_TIME_SECONDS
public UPnP(I2PAppContext context, int ssdpPort, int httpPort, InetAddress[] binds)
public void deviceAdded(Device dev)
deviceAdded in interface DeviceChangeListenerdev - the device that was addedpublic void deviceRemoved(Device dev)
deviceRemoved in interface DeviceChangeListenerdev - the device that was removedpublic void eventNotifyReceived(String uuid, long seq, String varName, String value)
eventNotifyReceived in interface EventListeneruuid - the subscription UUID identifying the subscriptionseq - the sequence number of this event notificationvarName - the name of the state variable that changedvalue - the new value of the state variablepublic DetectedIP[] getAddress()
public static Set<String> getLocalAddresses()
public static void main(String[] args) throws Exception
Exceptionpublic void onChangePublicPorts(Set<ForwardPort> ports, ForwardPortCallback cb)
ports - non-nullcb - in UPnPManagerpublic String renderStatusHTML()
public boolean runPlugin()
public void search()
search in class ControlPointpublic void terminate()
public void unregisterPortMappings()