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 intprotected static final intstatic final intstatic final intprivate static GlobalManagerStatsprivate static final SHA1Simplestatic final intstatic final intstatic final IOExceptionprivate static longprivate static GlobalManagerStats.CountryDetails[]private static longprivate static GlobalManagerStats.CountryDetails[]private static longprivate static longprivate static final intprivate static final List<DHTTransportUDPImpl> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static InetSocketAddressprotected static DHTTransportAlternativeContactImplprotected static voidprotected static DHTTransportAlternativeContact[]protected static byte[]deserialiseByteArray(DataInputStream is, int max_length) protected static byte[][]deserialiseByteArrayArray(DataInputStream is, int max_length) protected static DHTTransportUDPContactImpldeserialiseContact(DHTTransportUDPImpl transport, DataInputStream is) protected static DHTTransportContact[]deserialiseContacts(DHTTransportUDPImpl transport, DataInputStream is) protected static intdeserialiseLength(DataInputStream is, int max_length) protected static DHTTransportFullStatsdeserialiseStats(int version, DataInputStream is) protected static DHTTransportValuedeserialiseTransportValue(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 Objectprotected static voiddeserialiseVivaldi(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 voidreceiveUploadStats(DHTTransportUDPContactImpl contact, Object _stats) static voidprotected static voidregisterTransport(DHTTransportUDPImpl transport) protected static voidserialiseAddress(DataOutputStream os, InetSocketAddress address) protected static voidprotected static voidprotected static voidserialiseAltContacts(DataOutputStream os, DHTTransportAlternativeContact[] contacts) protected static voidserialiseByteArray(DataOutputStream os, byte[] data, int max_length) protected static voidserialiseByteArray(DataOutputStream os, byte[] data, int start, int length, int max_length) protected static voidserialiseByteArrayArray(DataOutputStream os, byte[][] data, int max_length) protected static voidserialiseContact(DataOutputStream os, DHTTransportContact contact) protected static voidserialiseContacts(DataOutputStream os, DHTTransportContact[] contacts) protected static voidserialiseLength(DataOutputStream os, int len, int max_length) protected static voidserialiseStats(int version, DataOutputStream os, DHTTransportFullStats stats) protected static voidserialiseTransportValue(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue value, long skew) protected static voidserialiseTransportValues(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue[] values, long skew) protected static voidserialiseTransportValuesArray(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue[][] values, long skew, int max_length) protected static voidserialiseUploadStats(int protocol_version, int packet_type, DataOutputStream os) protected static voidserialiseVivaldi(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:
IOExceptionDHTTransportException
-
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:
IOExceptionDHTTransportException
-
serialiseContact
protected static void serialiseContact(DataOutputStream os, DHTTransportContact contact) throws IOException, DHTTransportException - Throws:
IOExceptionDHTTransportException
-
deserialiseContact
protected static DHTTransportUDPContactImpl deserialiseContact(DHTTransportUDPImpl transport, DataInputStream is) throws IOException, DHTTransportException - Throws:
IOExceptionDHTTransportException
-
serialiseAltContact
protected static void serialiseAltContact(DataOutputStream os, DHTTransportAlternativeContact contact) throws IOException, DHTTransportException - Throws:
IOExceptionDHTTransportException
-
deserialiseAltContact
protected static DHTTransportAlternativeContactImpl deserialiseAltContact(DataInputStream is) throws IOException, DHTTransportException - Throws:
IOExceptionDHTTransportException
-
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:
IOExceptionDHTTransportException
-
deserialiseTransportValue
protected static DHTTransportValue deserialiseTransportValue(DHTUDPPacket packet, DataInputStream is, long skew) throws IOException, DHTTransportException - Throws:
IOExceptionDHTTransportException
-
serialiseTransportValue
protected static void serialiseTransportValue(DHTUDPPacket packet, DataOutputStream os, DHTTransportValue value, long skew) throws IOException, DHTTransportException - Throws:
IOExceptionDHTTransportException
-
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
-