|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface PushEndpoint
a class that represents an endpoint behind one or more PushProxies.
almost everything is immutable including the contents of the set.
the network format this is serialized to is:
byte 0 (from right-to-left):
- bits 0-2 how many push proxies we have (so max is 7)
- bits 3-4 the version of the f2f transfer protocol this altloc supports
- bits 5-6 other possible features.
- bit 7 set if the TLS-capable push proxy indexes byte is included
bytes 1-16 : the guid
bytes 17-22: ip:port of the address (if FWT version > 0)
followed by a byte of TLS-capable PushProxy indexes (if bit 7 of features is set)
followed by 6 bytes per PushProxy
the http format this is serialized to is an ascii string consisting of
';'-delimited tokens. The first token is the client GUID represented in hex
and is the only required token. The other tokens can be addresses of push proxies
or various feature headers. At most one of the tokens should be the external ip and port
of the firewalled node in a port:ip format. Currently the only feature header we
parse is the fwawt header that contains the version number of the firewall to
firewall transfer protocol supported by the altloc. In addition, the 'pptls=' field
can indicate which, if any, push proxies support TLS. If the field is present, it
must be immediately before the listing of the push proxies. The hexadecimal string
after the '=' is a bit-representation of which push proxies are valid for TLS.
A PE does not need to know the actual external address of the firewalled host,
however without that knowledge we cannot do firewall-to-firewall transfer with
the given host. Also, the RemoteFileDesc objects requires a valid IP for construction,
so in the case we do not know the external address we return a BOGUS_IP.
Examples:
//altloc with 2 proxies and supports firewall transfer 1 :
Nested Class Summary
Nested classes/interfaces inherited from interface org.limewire.io.IpPort
IpPort.IpComparator, IpPort.IpPortComparator
Nested classes/interfaces inherited from interface org.limewire.io.Address
Address.EventType
Field Summary
static byteFEATURES_MASK
static byteFWT_VERSION_MASK
static intHEADER_SIZE
static intMAX_PROXIES
The maximum number of proxies to use.
static bytePLAIN
static bytePPTLS_BINARY
static StringPPTLS_HTTP
The pptls portion constant.
static intPROXY_SIZE
static byteSIZE_MASK
Fields inherited from interface org.limewire.io.IpPort
COMPARATOR, EMPTY_LIST, EMPTY_SET, IP_COMPARATOR
Method Summary
PushEndpointcreateClone()
Can return null if no valid push endpoint can be cloned.
booleanequals(Object other)
Equality should be based on the equality of the value of getClientGUID().
StringgetAddress()
Assessor for the address string.
byte[]getClientGUID()
Returns the GUID of the client that can be reached through the pushproxies.
bytegetFeatures()
intgetFWTVersion()
Set<? extends IpPort>getProxies()
IpPortgetValidExternalAddress()
Returns an IpPort representing the valid external address of
this push endpoint if it is known, otherwise null.
inthashCode()
Should return the GUID.hashCode() of getClientGUID().
booleanisLocal()
byte[]toBytes(boolean includeTLS)
voidtoBytes(byte[] where,
int offset,
boolean includeTLS)
creates a byte packet representation of this
voidupdateProxies(boolean good)
Updates either the PushEndpoint or the GUID_PROXY_MAP to ensure
that GUID_PROXY_MAP has a reference to all live PE GUIDs and
all live PE's reference the same GUID object as in GUID_PROXY_MAP.
Methods inherited from interface com.limegroup.gnutella.http.HTTPHeaderValue
httpStringValue
Methods inherited from interface org.limewire.io.IpPort
getInetAddress, getInetSocketAddress, getPort
Methods inherited from interface org.limewire.io.Address
getAddressDescription
Field Detail
HEADER_SIZE
static final int HEADER_SIZE
PROXY_SIZE
static final int PROXY_SIZE
PLAIN
static final byte PLAIN
PPTLS_BINARY
static final byte PPTLS_BINARY
SIZE_MASK
static final byte SIZE_MASK
FWT_VERSION_MASK
static final byte FWT_VERSION_MASK
FEATURES_MASK
static final byte FEATURES_MASK
PPTLS_HTTP
static final String PPTLS_HTTP
MAX_PROXIES
static final int MAX_PROXIES
Method Detail
toBytes
byte[] toBytes(boolean includeTLS)
toBytes
void toBytes(byte[] where,
int offset,
boolean includeTLS)
where - the byte [] to serialize tooffset - the offset within that byte [] to serialize
getClientGUID
byte[] getClientGUID()
getProxies
Set<? extends IpPort> getProxies()
getFWTVersion
int getFWTVersion()
hashCode
int hashCode()
GUID.hashCode() of getClientGUID().
equals
boolean equals(Object other)
getClientGUID().
getFeatures
byte getFeatures()
isLocal
boolean isLocal()
updateProxies
void updateProxies(boolean good)
createClone
PushEndpoint createClone()
getValidExternalAddress
IpPort getValidExternalAddress()
IpPort representing the valid external address of
this push endpoint if it is known, otherwise null.
getAddress
String getAddress()
IpPort
getAddress in interface IpPort
RemoteFileDesc.BOGUS_IP
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
LimeWire Consolidated API
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 2009. All Rights Reserved.