mirror of
https://github.com/hufrea/byedpi.git
synced 2025-06-29 18:21:14 +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
|
||||
{"timeout", 1, 0, 'T'},
|
||||
#endif
|
||||
{"copy", 1, 0, 'B'},
|
||||
{"proto", 1, 0, 'K'},
|
||||
{"hosts", 1, 0, 'H'},
|
||||
{"pf", 1, 0, 'V'},
|
||||
@ -659,6 +660,8 @@ int main(int argc, char **argv)
|
||||
char *end = 0;
|
||||
bool all_limited = 1;
|
||||
|
||||
int curr_optind = 1;
|
||||
|
||||
struct desync_params *dp = add((void *)¶ms.dp,
|
||||
¶ms.dp_count, sizeof(struct desync_params));
|
||||
if (!dp) {
|
||||
@ -668,7 +671,6 @@ int main(int argc, char **argv)
|
||||
|
||||
while (!invalid && (rez = getopt_long(
|
||||
argc, argv, opt, options, 0)) != -1) {
|
||||
|
||||
switch (rez) {
|
||||
|
||||
case 'N':
|
||||
@ -762,6 +764,10 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
if (optind < curr_optind) {
|
||||
optind = curr_optind;
|
||||
continue;
|
||||
}
|
||||
if (!(dp->hosts || dp->proto || dp->pf[0] || dp->detect || dp->ipset)) {
|
||||
all_limited = 0;
|
||||
}
|
||||
@ -796,6 +802,24 @@ int main(int argc, char **argv)
|
||||
if (dp->detect && params.auto_level == AUTO_NOBUFF) {
|
||||
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;
|
||||
|
||||
case 'u':
|
||||
|
Loading…
Reference in New Issue
Block a user