]> git.sesse.net Git - greproxy/commitdiff
Split Protocol out into a header.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 7 Feb 2015 00:04:34 +0000 (01:04 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 7 Feb 2015 00:04:34 +0000 (01:04 +0100)
protocol.h [new file with mode: 0644]
tungre.cpp

diff --git a/protocol.h b/protocol.h
new file mode 100644 (file)
index 0000000..a6d3309
--- /dev/null
@@ -0,0 +1,13 @@
+#ifndef _PROTOCOL_H
+#define _PROTOCOL_H 1
+
+#include <stdint.h>
+#include <string>
+
+class Protocol {
+public:
+       virtual void send_packet(uint16_t proto, const std::string &data) = 0;
+       virtual int fd() const = 0;
+};
+
+#endif  // !defined(_PROTOCOL_H)
index 9b93e8531bab246f761605de5a7d08a567a66558..5735817e76dec5b466f128dcc9ee35fe9b26f488 100644 (file)
@@ -13,6 +13,8 @@
 #include <string>
 #include <queue>
 
+#include "protocol.h"
+
 using namespace std;
 
 struct gre_header {
@@ -69,14 +71,7 @@ struct GREPacket {
        }
 };
 
-class Protocol {
-public:
-       virtual void send_packet(uint16_t proto, const string &data) = 0;
-       virtual int fd() const = 0;
-};
-
 class Reorderer;
-class Protocol;
 
 class GREProtocol : public Protocol {
 public: