X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=greprotocol.h;h=738ec7b195ef620ddbf99db72a8a7dfa609c52f0;hb=89aae635b2877b787b4b377802ec18fc92d68401;hp=6930f20b601a9c932ea9d27384a970e4ecc2435d;hpb=7c67b21504e7758f4148386befc8cd80455a1a85;p=greproxy diff --git a/greprotocol.h b/greprotocol.h index 6930f20..738ec7b 100644 --- a/greprotocol.h +++ b/greprotocol.h @@ -1,25 +1,28 @@ #ifndef _GREPROTOCOL_H #define _GREPROTOCOL_H -#include "protocol.h" - #include +#include #include #include -class Reorderer; +#include "protocol.h" -class GREProtocol : public Protocol { +class GREProtocol : public Sender, public Reader { public: GREProtocol(const in6_addr &myaddr, const in6_addr &dst); - virtual void send_packet(uint16_t proto, const std::string &data); + virtual void send_packet(uint16_t proto, const std::string &data, int incoming_seq); virtual int fd() const; - void read_packet(Reorderer* sender); + virtual void read_packet(Sender* sender); + + int get_received_packets() const { return received_packets; } + int get_sent_packets() const { return sent_packets; } private: - int seq; int sock; sockaddr_in6 dstaddr; + + int received_packets = 0, sent_packets = 0; }; #endif // !defined(_GREPROTOCOL_H)