mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2025-12-31 03:38:07 +03:00
Add --exclude-domains flag. Fix #100
This commit is contained in:
12
args.c
12
args.c
@@ -49,12 +49,16 @@ struct config_t config = {
|
||||
.domains_str = defaul_snistr,
|
||||
.domains_strlen = sizeof(defaul_snistr),
|
||||
|
||||
.exclude_domains_str = "",
|
||||
.exclude_domains_strlen = 0,
|
||||
|
||||
.queue_start_num = DEFAULT_QUEUE_NUM,
|
||||
.fake_sni_pkt = fake_sni_old,
|
||||
.fake_sni_pkt_sz = sizeof(fake_sni_old) - 1, // - 1 for null-terminator
|
||||
};
|
||||
|
||||
#define OPT_SNI_DOMAINS 1
|
||||
#define OPT_EXCLUDE_DOMAINS 25
|
||||
#define OPT_FAKE_SNI 2
|
||||
#define OPT_FAKING_TTL 3
|
||||
#define OPT_FAKING_STRATEGY 10
|
||||
@@ -79,12 +83,13 @@ struct config_t config = {
|
||||
#define OPT_NO_GSO 8
|
||||
#define OPT_QUEUE_NUM 9
|
||||
|
||||
#define OPT_MAX OPT_SYNFAKE_LEN
|
||||
#define OPT_MAX OPT_SNI_DOMAINS
|
||||
|
||||
static struct option long_opt[] = {
|
||||
{"help", 0, 0, 'h'},
|
||||
{"version", 0, 0, 'v'},
|
||||
{"sni-domains", 1, 0, OPT_SNI_DOMAINS},
|
||||
{"exclude-domains", 1, 0, OPT_EXCLUDE_DOMAINS},
|
||||
{"fake-sni", 1, 0, OPT_FAKE_SNI},
|
||||
{"synfake", 1, 0, OPT_SYNFAKE},
|
||||
{"synfake-len", 1, 0, OPT_SYNFAKE_LEN},
|
||||
@@ -142,6 +147,7 @@ void print_usage(const char *argv0) {
|
||||
printf("Options:\n");
|
||||
printf("\t--queue-num=<number of netfilter queue>\n");
|
||||
printf("\t--sni-domains=<comma separated domain list>|all\n");
|
||||
printf("\t--exclude-domains=<comma separated domain list>\n");
|
||||
printf("\t--fake-sni={1|0}\n");
|
||||
printf("\t--fake-sni-seq-len=<length>\n");
|
||||
printf("\t--fake-seq-offset=<offset>\n");
|
||||
@@ -203,6 +209,10 @@ int parse_args(int argc, char *argv[]) {
|
||||
config.domains_str = optarg;
|
||||
config.domains_strlen = strlen(config.domains_str);
|
||||
break;
|
||||
case OPT_EXCLUDE_DOMAINS:
|
||||
config.exclude_domains_str = optarg;
|
||||
config.exclude_domains_strlen = strlen(config.exclude_domains_str);
|
||||
break;
|
||||
case OPT_SNI_DETECTION:
|
||||
if (strcmp(optarg, "parse") == 0) {
|
||||
config.sni_detection = SNI_DETECTION_PARSE;
|
||||
|
||||
Reference in New Issue
Block a user