]> git.sesse.net Git - greproxy/blobdiff - tungre.cpp
Add FEC.
[greproxy] / tungre.cpp
index 6b4ffb876c4b455314721edee14c10869c22057f..b9ad8f143b743b9e021422fbadf3efdf00001003 100644 (file)
@@ -1,19 +1,14 @@
+#include <arpa/inet.h>
+#include <netinet/in.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include <map>
-#include <string>
-#include <queue>
+#include <sys/select.h>
+#include <sys/socket.h>
 
 #include "greprotocol.h"
-#include "protocol.h"
 #include "reorderer.h"
 #include "tunprotocol.h"
+#include "rsdecoder.h"
 
 using namespace std;
 
@@ -34,6 +29,7 @@ int main(int argc, char **argv)
        TUNProtocol tun("tungre");
 
        Reorderer tun_reorderer(&tun);
+       RSDecoder tun_decoder(&tun_reorderer);
 
        fd_set fds;
        FD_ZERO(&fds);
@@ -47,7 +43,7 @@ int main(int argc, char **argv)
                }
 
                if (FD_ISSET(gre.fd(), &fds)) {
-                       gre.read_packet(&tun_reorderer);
+                       gre.read_packet(&tun_decoder);
                }
                if (FD_ISSET(tun.fd(), &fds)) {
                        tun.read_packet(&gre);