X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=tunprotocol.h;h=79e528f379904f9b642440fb5328285f79325b7a;hb=3f954bd32d89c220993d14782e73decc5f567abd;hp=9af2e78149787815e9d1994757b2f0c1c9639a3c;hpb=8e81c01b2de70c5e7e1a73d25ebbece0a95bd2c8;p=greproxy diff --git a/tunprotocol.h b/tunprotocol.h index 9af2e78..79e528f 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, int 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; + int seq; + + int received_packets = 0, sent_packets = 0; }; #endif // !defined(_TUNPROTOCOL_H)