+#define family_flag(f) \
+ (f == FW3_FAMILY_V4 ? FW3_DEFAULT_IPV4_LOADED : FW3_DEFAULT_IPV6_LOADED)
+
+static bool
+family_running(struct list_head *statefile, enum fw3_family family)
+{
+ struct fw3_statefile_entry *e;
+
+ if (statefile)
+ {
+ list_for_each_entry(e, statefile, list)
+ {
+ if (e->type != FW3_TYPE_DEFAULTS)
+ continue;
+
+ return hasbit(e->flags[0], family_flag(family));
+ }
+ }
+
+ return false;
+}
+
+static bool
+family_used(enum fw3_family family)
+{
+ return (use_family == FW3_FAMILY_ANY) || (use_family == family);
+}
+
+static bool
+family_loaded(struct fw3_state *state, enum fw3_family family)
+{
+ return hasbit(state->defaults.has_flag, family_flag(family));
+}
+
+static void
+family_set(struct fw3_state *state, enum fw3_family family, bool set)
+{
+ if (set)
+ setbit(state->defaults.has_flag, family_flag(family));
+ else
+ delbit(state->defaults.has_flag, family_flag(family));
+}
+