From 2b1c67c9a219ea85de7db4ada9364da3905e7b62 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 7 Feb 2015 01:04:34 +0100 Subject: [PATCH] Split Protocol out into a header. --- protocol.h | 13 +++++++++++++ tungre.cpp | 9 ++------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 protocol.h diff --git a/protocol.h b/protocol.h new file mode 100644 index 0000000..a6d3309 --- /dev/null +++ b/protocol.h @@ -0,0 +1,13 @@ +#ifndef _PROTOCOL_H +#define _PROTOCOL_H 1 + +#include +#include + +class Protocol { +public: + virtual void send_packet(uint16_t proto, const std::string &data) = 0; + virtual int fd() const = 0; +}; + +#endif // !defined(_PROTOCOL_H) diff --git a/tungre.cpp b/tungre.cpp index 9b93e85..5735817 100644 --- a/tungre.cpp +++ b/tungre.cpp @@ -13,6 +13,8 @@ #include #include +#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: -- 2.39.2