Introduce fw3_no_family() helper macro and use it
[project/firewall3.git] / utils.h
diff --git a/utils.h b/utils.h
index baba9df..79bf394 100644 (file)
--- a/utils.h
+++ b/utils.h
@@ -35,6 +35,8 @@
 #define FW3_STATEFILE  "/var/run/fw3.state"
 #define FW3_LOCKFILE   "/var/run/fw3.lock"
 
+extern bool fw3_pr_debug;
+
 void warn_elem(struct uci_element *e, const char *format, ...);
 void warn(const char *format, ...);
 void error(const char *format, ...);
@@ -53,6 +55,9 @@ void info(const char *format, ...);
 #define fw3_is_family(p, f)                                                \
        (!p || (p)->family == FW3_FAMILY_ANY || (p)->family == f)
 
+#define fw3_no_family(p)                                                   \
+       (!p || !((p)->flags & ((1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6))))
+
 const char * fw3_find_command(const char *cmd);
 
 bool fw3_stdout_pipe(void);