add option keep-reconnect

This commit is contained in:
wangyu- 2017-10-28 08:56:24 -05:00
parent f6dba6da1f
commit bcdb08691b
2 changed files with 12 additions and 0 deletions

View File

@ -46,6 +46,10 @@ u32_t sub_net_uint32=0;
char tun_dev[100]=""; char tun_dev[100]="";
int keep_reconnect=0;
int from_normal_to_fec(conn_info_t & conn_info,char *data,int len,int & out_n,char **&out_arr,int *&out_len,my_time_t *&out_delay) int from_normal_to_fec(conn_info_t & conn_info,char *data,int len,int & out_n,char **&out_arr,int *&out_len,my_time_t *&out_delay)
{ {
@ -567,6 +571,7 @@ void process_arg(int argc, char *argv[])
{"fifo", required_argument, 0, 1}, {"fifo", required_argument, 0, 1},
{"sub-net", required_argument, 0, 1}, {"sub-net", required_argument, 0, 1},
{"tun-dev", required_argument, 0, 1}, {"tun-dev", required_argument, 0, 1},
{"keep-reconnect", no_argument, 0, 1},
{NULL, 0, 0, 0} {NULL, 0, 0, 0}
}; };
int option_index = 0; int option_index = 0;
@ -868,6 +873,11 @@ void process_arg(int argc, char *argv[])
mylog(log_info,"fifo_file =%s \n",fifo_file); mylog(log_info,"fifo_file =%s \n",fifo_file);
} }
else if(strcmp(long_options[option_index].name,"keep-reconnect")==0)
{
keep_reconnect=1;
mylog(log_info,"keep_reconnect enabled\n");
}
else if(strcmp(long_options[option_index].name,"sub-net")==0) else if(strcmp(long_options[option_index].name,"sub-net")==0)
{ {
sscanf(optarg,"%s",sub_net); sscanf(optarg,"%s",sub_net);

2
misc.h
View File

@ -46,6 +46,8 @@ extern int time_mono_test;
extern int delay_capacity; extern int delay_capacity;
extern int keep_reconnect;
int from_normal_to_fec(conn_info_t & conn_info,char *data,int len,int & out_n,char **&out_arr,int *&out_len,my_time_t *&out_delay); int from_normal_to_fec(conn_info_t & conn_info,char *data,int len,int & out_n,char **&out_arr,int *&out_len,my_time_t *&out_delay);
int from_fec_to_normal(conn_info_t & conn_info,char *data,int len,int & out_n,char **&out_arr,int *&out_len,my_time_t *&out_delay); int from_fec_to_normal(conn_info_t & conn_info,char *data,int len,int & out_n,char **&out_arr,int *&out_len,my_time_t *&out_delay);