58 lines
996 B
C++
Raw Normal View History

2017-08-08 23:34:35 +08:00
#include "common.h"
#include "log.h"
2017-10-26 08:38:52 -05:00
2017-09-14 07:01:39 -05:00
#include "lib/rs.h"
2017-09-15 03:34:29 -05:00
#include "packet.h"
2017-09-25 10:38:39 -05:00
#include "connection.h"
#include "fd_manager.h"
2017-09-23 02:00:44 -05:00
#include "delay_manager.h"
2017-10-05 12:21:06 -05:00
#include "fec_manager.h"
2017-10-26 08:38:52 -05:00
#include "misc.h"
#include "tunnel.h"
2017-10-21 11:27:39 +08:00
using namespace std;
2017-08-08 17:10:38 +08:00
2017-09-14 12:22:47 -05:00
2017-08-08 23:34:35 +08:00
int main(int argc, char *argv[])
{
2017-10-13 07:56:53 -05:00
2017-09-25 10:38:39 -05:00
/*
if(argc==1||argc==0)
{
printf("this_program classic\n");
printf("this_program fec\n");
return 0;
2017-09-25 10:38:39 -05:00
}*/
2017-09-23 02:00:44 -05:00
/*
if(argc>=2&&strcmp(argv[1],"fec")!=0)
{
2017-09-23 02:00:44 -05:00
printf("running into classic mode!\n");
return classic::main(argc,argv);
2017-09-23 02:00:44 -05:00
}*/
2017-08-13 10:19:17 +08:00
assert(sizeof(u64_t)==8);
assert(sizeof(i64_t)==8);
assert(sizeof(u32_t)==4);
assert(sizeof(i32_t)==4);
2017-10-13 10:26:05 -05:00
assert(sizeof(u16_t)==2);
assert(sizeof(i16_t)==2);
2017-08-08 23:34:35 +08:00
dup2(1, 2); //redirect stderr to stdout
int i, j, k;
process_arg(argc,argv);
2017-10-15 14:12:21 -05:00
2017-10-17 12:35:03 -05:00
delay_manager.set_capacity(delay_capacity);
2017-09-25 10:38:39 -05:00
local_ip_uint32=inet_addr(local_ip);
remote_ip_uint32=inet_addr(remote_ip);
2017-08-08 23:34:35 +08:00
2017-09-25 10:38:39 -05:00
if(program_mode==client_mode)
{
client_event_loop();
}
else
{
server_event_loop();
}
2017-08-08 23:34:35 +08:00
2017-08-08 17:10:38 +08:00
return 0;
}
2017-08-08 23:34:35 +08:00