mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-10-14 09:55:33 +08:00
add --fifo option
This commit is contained in:
11
misc.cpp
11
misc.cpp
@@ -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);
|
||||
|
Reference in New Issue
Block a user