#ifndef _GREPROTOCOL_H
#define _GREPROTOCOL_H
-#include "protocol.h"
-
#include <arpa/inet.h>
+#include <netinet/in.h>
#include <stdint.h>
#include <string>
-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, 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 seq;
int sock;
sockaddr_in6 dstaddr;
+
+ int received_packets = 0, sent_packets = 0;
};
#endif // !defined(_GREPROTOCOL_H)