|
14 | 14 |
|
15 | 15 |
|
16 | 16 | int hb_mode=1;
|
| 17 | +int hb_len=1200; |
17 | 18 |
|
18 | 19 | fd_manager_t fd_manager;
|
19 | 20 |
|
@@ -151,6 +152,7 @@ void print_help()
|
151 | 152 | printf(" the parameter automatically,specify it manually if 'auto' failed\n");
|
152 | 153 | printf(" --gen-add generate iptables rule and add it permanently,then exit.overrides -g\n");
|
153 | 154 | printf(" --keep-rule monitor iptables and auto re-add if necessary.implys -a\n");
|
| 155 | + printf(" --hb-len <number> length of heart-beat packet\n"); |
154 | 156 | printf(" --clear clear any iptables rules added by this program.overrides everything\n");
|
155 | 157 | printf(" -h,--help print this help message\n");
|
156 | 158 |
|
@@ -250,6 +252,7 @@ void process_arg(int argc, char *argv[]) //process all options
|
250 | 252 | {"random-drop", required_argument, 0, 1},
|
251 | 253 | {"fifo", required_argument, 0, 1},
|
252 | 254 | {"hb-mode", required_argument, 0, 1},
|
| 255 | + {"hb-len", required_argument, 0, 1}, |
253 | 256 | {NULL, 0, 0, 0}
|
254 | 257 | };
|
255 | 258 |
|
@@ -598,6 +601,12 @@ void process_arg(int argc, char *argv[]) //process all options
|
598 | 601 | assert(hb_mode==0||hb_mode==1);
|
599 | 602 | mylog(log_info,"hb_mode =%d \n",hb_mode);
|
600 | 603 | }
|
| 604 | + else if(strcmp(long_options[option_index].name,"hb-len")==0) |
| 605 | + { |
| 606 | + sscanf(optarg,"%d",&hb_len); |
| 607 | + assert(hb_len>=0&&hb_len<=1500); |
| 608 | + mylog(log_info,"hb_len =%d \n",hb_len); |
| 609 | + } |
601 | 610 |
|
602 | 611 | else
|
603 | 612 | {
|
|
0 commit comments