add --fifo option

This commit is contained in:
wangyu-
2017-10-24 09:04:47 -05:00
parent 740e10bd04
commit 6c0642c37e
5 changed files with 106 additions and 29 deletions

View File

@@ -39,6 +39,8 @@ int debug_resend=0; // debug only
char key_string[1000]= "secret key";// -k option
char fifo_file[1000]="";
string iptables_pattern="";
int iptables_rule_added=0;
int iptables_rule_keeped=0;
@@ -52,6 +54,8 @@ int about_to_exit=0;
int socket_buf_size=1024*1024;
int force_socket_buf=0;
@@ -237,6 +241,7 @@ void process_arg(int argc, char *argv[]) //process all options
{"conf-file", required_argument, 0, 1},
{"force-sock-buf", no_argument, 0, 1},
{"random-drop", required_argument, 0, 1},
{"fifo", required_argument, 0, 1},
{NULL, 0, 0, 0}
};
@@ -569,6 +574,12 @@ void process_arg(int argc, char *argv[]) //process all options
}
mylog(log_info,"random_drop =%d \n",random_drop);
}
else if(strcmp(long_options[option_index].name,"fifo")==0)
{
sscanf(optarg,"%s",fifo_file);
mylog(log_info,"fifo_file =%s \n",fifo_file);
}
else if(strcmp(long_options[option_index].name,"conf-file")==0)
{
mylog(log_info,"configuration loaded from %s\n",optarg);