@TypeCode('A') public class PeerListRequest extends CommunicationPacket { private Log log = new Log(PeerListRequest.class); public PeerListRequest() { } public PeerListRequest(byte[] data) { super(data); int remaining = data.length - CommunicationPacket.HEADER_LENGTH; if (remaining > 0) log.debug("Peer List Request packet has " + remaining + " extra bytes."); } @Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); try { writeHeader(outputStream); } catch (IOException e) { log.error("Can't write to ByteArrayOutputStream.", e); } return outputStream.toByteArray(); } }
@TypeCode('L') public class PeerList extends DataPacket { private Log log = new Log(PeerList.class);
@TypeCode('Y') public class DeletionQuery extends CommunicationPacket { private Log log = new Log(DeletionQuery.class);
@TypeCode('Q') public class RetrieveRequest extends CommunicationPacket { private Log log = new Log(RetrieveRequest.class);
@TypeCode('F') public class FindClosePeersPacket extends CommunicationPacket { private Log log = new Log(FindClosePeersPacket.class);
@TypeCode('S') public class StoreRequest extends CommunicationPacket { private Log log = new Log(StoreRequest.class);
@TypeCode('N') public class ResponsePacket extends CommunicationPacket { private Log log = new Log(ResponsePacket.class);
@TypeCode('D') public class EmailPacketDeleteRequest extends DeleteRequest { private Log log = new Log(EmailPacketDeleteRequest.class);
@TypeCode('X') public class IndexPacketDeleteRequest extends DeleteRequest { private Log log = new Log(IndexPacketDeleteRequest.class);
@TypeCode('U') public class UnencryptedEmailPacket extends DataPacket { private final static int OVERHEAD = 72; // total packet size minus content size
@TypeCode('T') public class DeletionInfoPacket extends DataPacket implements Iterable<DeletionRecord> { private Collection<DeletionRecord> entries;
@TypeCode('E') public class EncryptedEmailPacket extends DhtStorablePacket { public static int MAX_OVERHEAD = 641; // The maximum number of bytes by which EncryptedEmailPacket can be bigger than the UnencryptedEmailPacket
@TypeCode('R') public class RelayRequest extends CommunicationPacket { private static Random random = new Random();
@TypeCode('C') public class Contact extends DhtStorablePacket { private final static Charset UTF8 = Charset.forName("UTF-8");
@TypeCode('I') public class IndexPacket extends DhtStorablePacket implements Iterable<IndexPacketEntry>, Splittable { private Log log = new Log(IndexPacket.class);