X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=utils.h;h=0d1b9d836a56b6f194d3cbd0ed8f72fb8ddb6e06;hp=c3dc974bfea513a15003d9e0b5d81be7c7166f40;hb=294f209f64dca84d1c4dd801a1f7e615e39f0726;hpb=a4b710143626b399783865a3ea31bdb25aa1bac9 diff --git a/utils.h b/utils.h index c3dc974..0d1b9d8 100644 --- a/utils.h +++ b/utils.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #define FW3_STATEFILE "/var/run/fw3.state" #define FW3_LOCKFILE "/var/run/fw3.lock" +#define FW3_HOTPLUG "/sbin/hotplug-call" extern bool fw3_pr_debug; @@ -46,6 +48,10 @@ void info(const char *format, ...); #define delbit(field, flag) field &= ~(1 << (flag)) #define hasbit(field, flag) (field & (1 << (flag))) +#define set(field, family, flag) setbit(field[family == FW3_FAMILY_V6], flag) +#define del(field, family, flag) delbit(field[family == FW3_FAMILY_V6], flag) +#define has(field, family, flag) hasbit(field[family == FW3_FAMILY_V6], flag) + #define fw3_foreach(p, h) \ for (p = list_empty(h) ? NULL : list_first_entry(h, typeof(*p), list); \ list_empty(h) ? (p == NULL) : (&p->list != (h)); \ @@ -58,6 +64,14 @@ void info(const char *format, ...); #define fw3_no_family(flags) \ (!(flags & ((1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6)))) +#define fw3_no_table(flags) \ + (!(flags & ((1<