2017-10-26 08:38:52 -05:00

58 lines
996 B
C++

#include "common.h"
#include "log.h"
#include "lib/rs.h"
#include "packet.h"
#include "connection.h"
#include "fd_manager.h"
#include "delay_manager.h"
#include "fec_manager.h"
#include "misc.h"
#include "tunnel.h"
using namespace std;
int main(int argc, char *argv[])
{
/*
if(argc==1||argc==0)
{
printf("this_program classic\n");
printf("this_program fec\n");
return 0;
}*/
/*
if(argc>=2&&strcmp(argv[1],"fec")!=0)
{
printf("running into classic mode!\n");
return classic::main(argc,argv);
}*/
assert(sizeof(u64_t)==8);
assert(sizeof(i64_t)==8);
assert(sizeof(u32_t)==4);
assert(sizeof(i32_t)==4);
assert(sizeof(u16_t)==2);
assert(sizeof(i16_t)==2);
dup2(1, 2); //redirect stderr to stdout
int i, j, k;
process_arg(argc,argv);
delay_manager.set_capacity(delay_capacity);
local_ip_uint32=inet_addr(local_ip);
remote_ip_uint32=inet_addr(remote_ip);
if(program_mode==client_mode)
{
client_event_loop();
}
else
{
server_event_loop();
}
return 0;
}