java.lang.Object
org.freenetproject.ForwardPort
net.i2p.router.transport.UPnP.IPv6ForwardPort
- Enclosing class:
UPnP
IPv6-specific port forwarding configuration. Extended to store the requested IP to be forwarded.
Field Summary
FieldsFields inherited from class ForwardPort
isIP6, name, portNumber, protocol, PROTOCOL_TCP_IPV4, PROTOCOL_UDP_IPV4Modifier and TypeFieldDescriptionfinal booleanIPv4 vs IPv6?final StringName of the interface e.g.final intPort number to forwardfinal intProtocol number.static final intPROTOCOL_TCP_IPV4.static final intPROTOCOL_UDP_IPV4.Constructor Summary
ConstructorsConstructorDescriptionIPv6ForwardPort(String name, int protocol, int port, String ip) Port forwarding entry for the given IPv6 address.Method Summary
All MethodsModifier and TypeMethodDescriptionbooleanIgnores UID.longExpiration time of the pinhole.getIP()The forwarded IPv6 address.intgetUID()Unique ID of the pinhole.inthashCode()The hash code for this forward port.voidsetExpiration(long expires) Expiration time of the pinhole.voidsetUID(int uid) Unique ID of the pinhole.toString()String representation of this forward port.
Field Details
_ip
The external IP address we mapped._uid
private int _uidDevice id of the mapping, -1 if unknown._expires
private long _expiresWhen the mapping lease expires.
Constructor Details
IPv6ForwardPort
Port forwarding entry for the given IPv6 address.- Parameters:
name- the tunnel description to show in the UPnP device's port mappingprotocol- the IP protocol number to forwardport- the port number to forwardip- the IPv6 address being forwarded, non-null
Method Details
getIP
getUID
public int getUID()Unique ID of the pinhole.- Returns:
- 0-65535 or -1 if unset
setUID
public void setUID(int uid) Unique ID of the pinhole.- Parameters:
uid- 0-65535
getExpiration
public long getExpiration()Expiration time of the pinhole.- Returns:
- absolute time or 0 if unset
setExpiration
public void setExpiration(long expires) Expiration time of the pinhole.- Parameters:
expires- the expiry as an absolute time, or 0 for no expiry
hashCode
public int hashCode()The hash code for this forward port.- Overrides:
hashCodein classForwardPort- Returns:
- the hash code
equals
toString