+#include <arpa/inet.h>
+#include <netinet/in.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <sys/select.h>
#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netinet/in.h>
-
-#include <map>
-#include <string>
-#include <queue>
#include "greprotocol.h"
-#include "protocol.h"
#include "reorderer.h"
-#include "tunprotocol.h"
+#include "rsencoder.h"
using namespace std;
in6_addr myaddr = get_addr(argv[3]);
GREProtocol gre_a(myaddr, addr_a);
GREProtocol gre_b(myaddr, addr_b);
- Reorderer dst_a(&gre_a);
- Reorderer dst_b(&gre_b);
+ RSEncoder rs_a(&gre_a);
+ RSEncoder rs_b(&gre_b);
+ Reorderer reorder_a(&rs_a);
+ Reorderer reorder_b(&rs_b);
fd_set fds;
FD_ZERO(&fds);
}
if (FD_ISSET(gre_a.fd(), &fds)) {
- gre_a.read_packet(&dst_b);
+ gre_a.read_packet(&reorder_b);
}
if (FD_ISSET(gre_b.fd(), &fds)) {
- gre_b.read_packet(&dst_a);
+ gre_b.read_packet(&reorder_a);
}
}
}