+static bool
+check_include(struct fw3_state *state, struct fw3_include *include, struct uci_element *e)
+{
+ if (!include->enabled)
+ return false;
+
+ if (!include->path)
+ {
+ warn_section("include", include, e, "must specify a path");
+ return false;
+ }
+
+ if (include->type == FW3_INC_TYPE_RESTORE && !include->family)
+ warn_section("include", include, e, "does not specify a family, include will get"
+ "loaded with both iptables-restore and ip6tables-restore!");
+
+ return true;
+}
+
+static struct fw3_include *
+fw3_alloc_include(struct fw3_state *state)
+{
+ struct fw3_include *include;
+
+ include = calloc(1, sizeof(*include));
+ if (!include)
+ return NULL;
+
+ include->enabled = true;
+
+ list_add_tail(&include->list, &state->includes);
+
+ return include;
+}