Package org.drasyl.util.protocol
Class UpnpIgdUtil
- java.lang.Object
-
- org.drasyl.util.protocol.UpnpIgdUtil
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UpnpIgdUtil.DiscoveryResponseMessage
static class
UpnpIgdUtil.ExternalIpAddress
static class
UpnpIgdUtil.MappingEntry
static interface
UpnpIgdUtil.Message
static class
UpnpIgdUtil.PortMapping
static class
UpnpIgdUtil.Service
static class
UpnpIgdUtil.StatusInfo
-
Field Summary
Fields Modifier and Type Field Description static Pattern
HTTP_HEADER_FIELD_SEPARATOR_PATTERN
static Pattern
HTTP_HEADER_SEPARATOR_PATTERN
static Pattern
SSDP_DISCOVERY_RESPONSE_PATTERN
static Pattern
SSDP_HEADER_PATTERN
static Duration
SSDP_MAX_WAIT_TIME
static InetSocketAddressWrapper
SSDP_MULTICAST_ADDRESS
static Pattern
UPNP_ERROR_PATTERN
static Pattern
UPNP_EXTERNAL_IP_ADDRESS_PATTERN
static Pattern
UPNP_NEW_CONNECTION_STATUS_PATTERN
static Pattern
UPNP_NEW_INTERNAL_CLIENT_PATTERN
static Pattern
UPNP_NEW_INTERNAL_PORT_PATTERN
static Pattern
UPNP_NEW_LEASE_DURATION_PATTERN
static Pattern
UPNP_NEW_PORT_MAPPING_DESCRIPTION_PATTERN
static Pattern
UPNP_SERVICE_PATTERN
-
Constructor Summary
Constructors Constructor Description UpnpIgdUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UpnpIgdUtil.PortMapping
addPortMapping(URI url, String serviceType, Integer externalPort, InetAddress localAddress, String description)
static byte[]
buildDiscoveryMessage()
boolean
deletePortMapping(URI url, String serviceType, int port)
UpnpIgdUtil.ExternalIpAddress
getExternalIpAddress(URI url, String serviceType)
UpnpIgdUtil.MappingEntry
getSpecificPortMappingEntry(URI url, String serviceType, Integer externalPort)
UpnpIgdUtil.StatusInfo
getStatusInfo(URI url, String serviceType)
UpnpIgdUtil.Service
getUpnpService(URI url)
static UpnpIgdUtil.Message
readMessage(byte[] content)
-
-
-
Field Detail
-
SSDP_MULTICAST_ADDRESS
public static final InetSocketAddressWrapper SSDP_MULTICAST_ADDRESS
-
SSDP_MAX_WAIT_TIME
public static final Duration SSDP_MAX_WAIT_TIME
-
SSDP_DISCOVERY_RESPONSE_PATTERN
public static final Pattern SSDP_DISCOVERY_RESPONSE_PATTERN
-
SSDP_HEADER_PATTERN
public static final Pattern SSDP_HEADER_PATTERN
-
UPNP_SERVICE_PATTERN
public static final Pattern UPNP_SERVICE_PATTERN
-
UPNP_EXTERNAL_IP_ADDRESS_PATTERN
public static final Pattern UPNP_EXTERNAL_IP_ADDRESS_PATTERN
-
UPNP_ERROR_PATTERN
public static final Pattern UPNP_ERROR_PATTERN
-
UPNP_NEW_CONNECTION_STATUS_PATTERN
public static final Pattern UPNP_NEW_CONNECTION_STATUS_PATTERN
-
UPNP_NEW_PORT_MAPPING_DESCRIPTION_PATTERN
public static final Pattern UPNP_NEW_PORT_MAPPING_DESCRIPTION_PATTERN
-
UPNP_NEW_INTERNAL_PORT_PATTERN
public static final Pattern UPNP_NEW_INTERNAL_PORT_PATTERN
-
UPNP_NEW_INTERNAL_CLIENT_PATTERN
public static final Pattern UPNP_NEW_INTERNAL_CLIENT_PATTERN
-
UPNP_NEW_LEASE_DURATION_PATTERN
public static final Pattern UPNP_NEW_LEASE_DURATION_PATTERN
-
HTTP_HEADER_SEPARATOR_PATTERN
public static final Pattern HTTP_HEADER_SEPARATOR_PATTERN
-
HTTP_HEADER_FIELD_SEPARATOR_PATTERN
public static final Pattern HTTP_HEADER_FIELD_SEPARATOR_PATTERN
-
-
Method Detail
-
getUpnpService
public UpnpIgdUtil.Service getUpnpService(URI url) throws InterruptedException
- Throws:
InterruptedException
-
getSpecificPortMappingEntry
public UpnpIgdUtil.MappingEntry getSpecificPortMappingEntry(URI url, String serviceType, Integer externalPort) throws InterruptedException
- Throws:
InterruptedException
-
addPortMapping
public UpnpIgdUtil.PortMapping addPortMapping(URI url, String serviceType, Integer externalPort, InetAddress localAddress, String description) throws InterruptedException
- Throws:
InterruptedException
-
deletePortMapping
public boolean deletePortMapping(URI url, String serviceType, int port) throws InterruptedException
- Throws:
InterruptedException
-
getStatusInfo
public UpnpIgdUtil.StatusInfo getStatusInfo(URI url, String serviceType) throws InterruptedException
- Throws:
InterruptedException
-
getExternalIpAddress
public UpnpIgdUtil.ExternalIpAddress getExternalIpAddress(URI url, String serviceType) throws InterruptedException
- Throws:
InterruptedException
-
buildDiscoveryMessage
public static byte[] buildDiscoveryMessage()
-
readMessage
public static UpnpIgdUtil.Message readMessage(byte[] content)
-
-