]> git.sesse.net Git - greproxy/blobdiff - reorderer.h
Make Reorderer into a Protocol.
[greproxy] / reorderer.h
index 476093fc5e8e136d9fc4d3008d5f6eb81e82e489..393e327f7dbe86053fb374fd9601720c3a9e8195 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _REORDERER_H
 #define _REORDERER_H 1
 
+#include <assert.h>
 #include <stdint.h>
 
 #include <algorithm>
@@ -9,7 +10,7 @@
 #include <string>
 #include <vector>
 
-class Protocol;
+#include "protocol.h"
 
 struct GREPacket {
        int seq;
@@ -21,13 +22,14 @@ struct GREPacket {
        }
 };
 
-class Reorderer {
+class Reorderer : public Protocol {
 public:
        Reorderer(Protocol* sender);
-       void handle_packet(uint16_t proto, const std::string& data, int seq);
+       void send_packet(uint16_t proto, const std::string& data, int seq);
+       virtual int fd() const { assert(false); }
 
 private:
-       void send_packet(uint16_t proto, const std::string &data, bool silence);
+       void check_ts_discontinuity(uint16_t proto, const std::string &data, bool silence);
 
        Protocol* sender;
        int last_seq;