X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=tunprotocol.h;h=81fd900f0f02238819a6cb4a261977d2a3a16cbf;hb=HEAD;hp=cfe3b46ef47bfcd1333cd2ec4eddec905314d318;hpb=5b611332f020c9fc94b5992188dd0701fdf4f327;p=greproxy diff --git a/tunprotocol.h b/tunprotocol.h index cfe3b46..81fd900 100644 --- a/tunprotocol.h +++ b/tunprotocol.h @@ -6,15 +6,21 @@ #include #include -class TUNProtocol : public Protocol { +class TUNProtocol : public Sender, public Reader { public: TUNProtocol(const char *devname); - virtual void send_packet(uint16_t proto, const std::string &data); + virtual void send_packet(uint16_t proto, const std::string &data, uint32_t incoming_seq); virtual int fd() const; - void read_packet(Protocol* 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 tunfd; + uint32_t seq; + + int received_packets = 0, sent_packets = 0; }; #endif // !defined(_TUNPROTOCOL_H)