Class DHTUDPUtils
java.lang.Object
com.biglybt.core.dht.transport.udp.impl.DHTUDPUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final List<DHTTransportAlternativeNetwork>
private static final int
protected static final int
static final int
static final int
private static GlobalManagerStats
private static final SHA1Simple
static final int
static final int
static final IOException
private static long
private static GlobalManagerStats.CountryDetails[]
private static long
private static GlobalManagerStats.CountryDetails[]
private static long
private static long
private static final int
private static final List<DHTTransportUDPImpl>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static InetSocketAddress
protected static DHTTransportAlternativeContactImpl
protected static void
protected static DHTTransportAlternativeContact[]
protected static byte[]
deserialiseByteArray
(DataInputStream is, int max_length) protected static byte[][]
deserialiseByteArrayArray
(DataInputStream is, int max_length) protected static DHTTransportUDPContactImpl
deserialiseContact
(DHTTransportUDPImpl transport, DataInputStream is) protected static DHTTransportContact[]
deserialiseContacts
(DHTTransportUDPImpl transport, DataInputStream is) protected static int
deserialiseLength
(DataInputStream is, int max_length) protected static DHTTransportFullStats
deserialiseStats
(int version, DataInputStream is) protected static DHTTransportValue
deserialiseTransportValue
(DHTUDPPacket packet, DataInputStream is, long skew) protected static DHTTransportValue[]
deserialiseTransportValues
(DHTUDPPacket packet, DataInputStream is, long skew) protected static DHTTransportValue[][]
deserialiseTransportValuesArray
(DHTUDPPacket packet, DataInputStream is, long skew, int max_length) protected static Object
protected static void
deserialiseVivaldi
(DHTUDPPacketReply reply, DataInputStream is) static List<DHTTransportAlternativeContact>
getAlternativeContacts
(int network, int max) getAlternativeNetwork
(int type) protected static byte[]
protected static byte[]
getNodeID
(InetSocketAddress address, byte protocol_version) protected static void
receiveUploadStats
(DHTTransportUDPContactImpl contact, Object _stats) static void
protected static void
registerTransport
(DHTTransportUDPImpl transport) protected static void
serialiseAddress
(DataOutputStream os, InetSocketAddress address) protected static void
protected static void
protected static void
serialiseAltContacts
(DataOutputStream os, DHTTransportAlternativeContact[] contacts) protected static void
serialiseByteArray
(DataOutputStream os, byte[] data, int max_length) protected static void
serialiseByteArray
(DataOutputStream os, byte[] data, int start, int length, int max_length) protected static void
serialiseByteArrayArray
(DataOutputStream os, byte[][] data, int max_length) protected static void
serialiseContact
(DataOutputStream os, DHTTransportContact contact) protected static void
serialiseContacts
(DataOutputStream os, DHTTransportContact[] contacts) protected static void
serialiseLength
(DataOutputStream os, int len, int max_length) protected static void
serialiseStats
(int version, DataOutputStream os, DHTTransportFullStats stats) protected static void
serialiseTransportValue
(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue value, long skew) protected static void
serialiseTransportValues
(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue[] values, long skew) protected static void
serialiseTransportValuesArray
(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue[][] values, long skew, int max_length) protected static void
serialiseUploadStats
(int protocol_version, int packet_type, DataOutputStream os) protected static void
serialiseVivaldi
(DHTUDPPacketReply reply, DataOutputStream os) static void
-
Field Details
-
INVALID_PROTOCOL_VERSION_EXCEPTION
-
CT_UDP
protected static final int CT_UDP- See Also:
-
node_id_history
-
hasher
-
INETSOCKETADDRESS_IPV4_SIZE
public static final int INETSOCKETADDRESS_IPV4_SIZE- See Also:
-
INETSOCKETADDRESS_IPV6_SIZE
public static final int INETSOCKETADDRESS_IPV6_SIZE- See Also:
-
DHTTRANSPORTCONTACT_SIZE
public static final int DHTTRANSPORTCONTACT_SIZE- See Also:
-
DHTTRANSPORTVALUE_SIZE_WITHOUT_VALUE
public static final int DHTTRANSPORTVALUE_SIZE_WITHOUT_VALUE- See Also:
-
transports
-
alt_networks
-
MAX_CC_STATS
private static final int MAX_CC_STATS- See Also:
-
CALC_PERIOD
private static final int CALC_PERIOD- See Also:
-
last_calc
private static volatile long last_calc -
last_details_recv
-
last_details_sent
-
last_details_recv_total
private static volatile long last_details_recv_total -
last_details_sent_total
private static volatile long last_details_sent_total -
gm_stats
-
last_upload_stats
private static volatile long last_upload_stats
-
-
Constructor Details
-
DHTUDPUtils
public DHTUDPUtils()
-
-
Method Details
-
getNodeID
protected static byte[] getNodeID(InetSocketAddress address, byte protocol_version) throws DHTTransportException - Throws:
DHTTransportException
-
getBogusNodeID
protected static byte[] getBogusNodeID() -
serialiseLength
protected static void serialiseLength(DataOutputStream os, int len, int max_length) throws IOException - Throws:
IOException
-
deserialiseLength
- Throws:
IOException
-
deserialiseByteArray
- Throws:
IOException
-
serialiseByteArray
protected static void serialiseByteArray(DataOutputStream os, byte[] data, int max_length) throws IOException - Throws:
IOException
-
serialiseByteArray
protected static void serialiseByteArray(DataOutputStream os, byte[] data, int start, int length, int max_length) throws IOException - Throws:
IOException
-
serialiseByteArrayArray
protected static void serialiseByteArrayArray(DataOutputStream os, byte[][] data, int max_length) throws IOException - Throws:
IOException
-
deserialiseByteArrayArray
protected static byte[][] deserialiseByteArrayArray(DataInputStream is, int max_length) throws IOException - Throws:
IOException
-
serialiseAddress
protected static void serialiseAddress(DataOutputStream os, InetSocketAddress address) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
deserialiseAddress
- Throws:
IOException
-
deserialiseTransportValuesArray
protected static DHTTransportValue[][] deserialiseTransportValuesArray(DHTUDPPacket packet, DataInputStream is, long skew, int max_length) throws IOException - Throws:
IOException
-
serialiseTransportValuesArray
protected static void serialiseTransportValuesArray(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue[][] values, long skew, int max_length) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
serialiseContact
protected static void serialiseContact(DataOutputStream os, DHTTransportContact contact) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
deserialiseContact
protected static DHTTransportUDPContactImpl deserialiseContact(DHTTransportUDPImpl transport, DataInputStream is) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
serialiseAltContact
protected static void serialiseAltContact(DataOutputStream os, DHTTransportAlternativeContact contact) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
deserialiseAltContact
protected static DHTTransportAlternativeContactImpl deserialiseAltContact(DataInputStream is) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
deserialiseTransportValues
protected static DHTTransportValue[] deserialiseTransportValues(DHTUDPPacket packet, DataInputStream is, long skew) throws IOException - Throws:
IOException
-
serialiseTransportValues
protected static void serialiseTransportValues(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue[] values, long skew) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
deserialiseTransportValue
protected static DHTTransportValue deserialiseTransportValue(DHTUDPPacket packet, DataInputStream is, long skew) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
serialiseTransportValue
protected static void serialiseTransportValue(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue value, long skew) throws IOException, DHTTransportException - Throws:
IOException
DHTTransportException
-
serialiseContacts
protected static void serialiseContacts(DataOutputStream os, DHTTransportContact[] contacts) throws IOException - Throws:
IOException
-
deserialiseContacts
protected static DHTTransportContact[] deserialiseContacts(DHTTransportUDPImpl transport, DataInputStream is) throws IOException - Throws:
IOException
-
serialiseAltContacts
protected static void serialiseAltContacts(DataOutputStream os, DHTTransportAlternativeContact[] contacts) throws IOException - Throws:
IOException
-
deserialiseAltContacts
protected static DHTTransportAlternativeContact[] deserialiseAltContacts(DataInputStream is) throws IOException - Throws:
IOException
-
serialiseAltContactRequest
protected static void serialiseAltContactRequest(DHTUDPPacketRequestPing ping, DataOutputStream os) throws IOException - Throws:
IOException
-
deserialiseAltContactRequest
protected static void deserialiseAltContactRequest(DHTUDPPacketRequestPing ping, DataInputStream is) throws IOException - Throws:
IOException
-
serialiseVivaldi
protected static void serialiseVivaldi(DHTUDPPacketReply reply, DataOutputStream os) throws IOException - Throws:
IOException
-
deserialiseVivaldi
protected static void deserialiseVivaldi(DHTUDPPacketReply reply, DataInputStream is) throws IOException - Throws:
IOException
-
serialiseStats
protected static void serialiseStats(int version, DataOutputStream os, DHTTransportFullStats stats) throws IOException - Throws:
IOException
-
deserialiseStats
protected static DHTTransportFullStats deserialiseStats(int version, DataInputStream is) throws IOException - Throws:
IOException
-
registerTransport
-
registerAlternativeNetwork
-
getAlternativeNetwork
-
unregisterAlternativeNetwork
-
getAlternativeContacts
-
serialiseUploadStats
protected static void serialiseUploadStats(int protocol_version, int packet_type, DataOutputStream os) throws IOException - Throws:
IOException
-
deserialiseUploadStats
- Throws:
IOException
-
receiveUploadStats
-