X-Git-Url: https://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=options.c;h=3f8c977beabd490e201542a0e52d59a5e095c34e;hp=9870e91ac522f791bbc4006e01d4b079c6c3bcb8;hb=83ff4b94b044086d80b1e189e5601274bd5b4852;hpb=fe3ecee341da8542aa25b962dcb8bcc628fcdd1e diff --git a/options.c b/options.c index 9870e91..3f8c977 100644 --- a/options.c +++ b/options.c @@ -672,6 +672,19 @@ fw3_parse_monthdays(void *ptr, const char *val) return true; } +bool +fw3_parse_include_type(void *ptr, const char *val) +{ + if (!strcmp(val, "script")) + *((enum fw3_include_type *)ptr) = FW3_INC_TYPE_SCRIPT; + else if (!strcmp(val, "restore")) + *((enum fw3_include_type *)ptr) = FW3_INC_TYPE_RESTORE; + else + return false; + + return true; +} + void fw3_parse_options(void *s, const struct fw3_option *opts, @@ -1014,7 +1027,7 @@ fw3_format_time(struct fw3_time *time) if (time->monthdays & 0xFFFFFFFE) { - fw3_pr(" %s--monthdays", (time->monthdays & 1) ? "! " : ""); + fw3_pr(" %s--monthdays", hasbit(time->monthdays, 0) ? "! " : ""); for (i = 1, first = true; i < 32; i++) { @@ -1028,7 +1041,7 @@ fw3_format_time(struct fw3_time *time) if (time->weekdays & 0xFE) { - fw3_pr(" %s--weekdays", (time->weekdays & 1) ? "! " : ""); + fw3_pr(" %s--weekdays", hasbit(time->weekdays, 0) ? "! " : ""); for (i = 1, first = true; i < 8; i++) {