mirror of
https://github.com/hufrea/byedpi.git
synced 2025-08-23 03:38:46 +00:00
--copy
This commit is contained in:
parent
13abef7c01
commit
c2755ffb0c
26
main.c
26
main.c
@ -153,6 +153,7 @@ const struct option options[] = {
|
|||||||
#ifdef TIMEOUT_SUPPORT
|
#ifdef TIMEOUT_SUPPORT
|
||||||
{"timeout", 1, 0, 'T'},
|
{"timeout", 1, 0, 'T'},
|
||||||
#endif
|
#endif
|
||||||
|
{"copy", 1, 0, 'B'},
|
||||||
{"proto", 1, 0, 'K'},
|
{"proto", 1, 0, 'K'},
|
||||||
{"hosts", 1, 0, 'H'},
|
{"hosts", 1, 0, 'H'},
|
||||||
{"pf", 1, 0, 'V'},
|
{"pf", 1, 0, 'V'},
|
||||||
@ -659,6 +660,8 @@ int main(int argc, char **argv)
|
|||||||
char *end = 0;
|
char *end = 0;
|
||||||
bool all_limited = 1;
|
bool all_limited = 1;
|
||||||
|
|
||||||
|
int curr_optind = 1;
|
||||||
|
|
||||||
struct desync_params *dp = add((void *)¶ms.dp,
|
struct desync_params *dp = add((void *)¶ms.dp,
|
||||||
¶ms.dp_count, sizeof(struct desync_params));
|
¶ms.dp_count, sizeof(struct desync_params));
|
||||||
if (!dp) {
|
if (!dp) {
|
||||||
@ -668,7 +671,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
while (!invalid && (rez = getopt_long(
|
while (!invalid && (rez = getopt_long(
|
||||||
argc, argv, opt, options, 0)) != -1) {
|
argc, argv, opt, options, 0)) != -1) {
|
||||||
|
|
||||||
switch (rez) {
|
switch (rez) {
|
||||||
|
|
||||||
case 'N':
|
case 'N':
|
||||||
@ -762,6 +764,10 @@ int main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'A':
|
case 'A':
|
||||||
|
if (optind < curr_optind) {
|
||||||
|
optind = curr_optind;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!(dp->hosts || dp->proto || dp->pf[0] || dp->detect || dp->ipset)) {
|
if (!(dp->hosts || dp->proto || dp->pf[0] || dp->detect || dp->ipset)) {
|
||||||
all_limited = 0;
|
all_limited = 0;
|
||||||
}
|
}
|
||||||
@ -796,6 +802,24 @@ int main(int argc, char **argv)
|
|||||||
if (dp->detect && params.auto_level == AUTO_NOBUFF) {
|
if (dp->detect && params.auto_level == AUTO_NOBUFF) {
|
||||||
params.auto_level = AUTO_NOSAVE;
|
params.auto_level = AUTO_NOSAVE;
|
||||||
}
|
}
|
||||||
|
dp->_optind = optind;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'B':
|
||||||
|
if (optind < curr_optind) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (*optarg == 'i') {
|
||||||
|
dp->pf[0] = htons(1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
val = strtol(optarg, &end, 0);
|
||||||
|
if (val < 1 || val >= params.dp_count || *end)
|
||||||
|
invalid = 1;
|
||||||
|
else {
|
||||||
|
curr_optind = optind;
|
||||||
|
optind = params.dp[val - 1]._optind;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'u':
|
case 'u':
|
||||||
|
Loading…
Reference in New Issue
Block a user