+ fprintf(sf, "%x - %x %x\n",
+ FW3_TYPE_DEFAULTS, defs->flags[0], defs->flags[1]);
+
+ list_for_each_entry(z, &s->running_zones, running_list)
+ {
+ if (fw3_no_table(z->flags[0]) && fw3_no_table(z->flags[1]))
+ continue;
+
+ fprintf(sf, "%x %s %x %x\n",
+ FW3_TYPE_ZONE, z->name, z->flags[0], z->flags[1]);
+
+ list_for_each_entry(d, &z->devices, list)
+ {
+ if (!d->network)
+ continue;
+
+ fprintf(sf, "%x %s 0 0 %s %s\n",
+ FW3_TYPE_NETWORK, z->name, d->network->name, d->name);
+ }
+ }
+
+ list_for_each_entry(i, &s->running_ipsets, running_list)
+ {
+ if (!fw3_no_family(i->flags[0]) || !fw3_no_family(i->flags[1]))
+ {
+ fprintf(sf, "%x %s %x %x\n",
+ FW3_TYPE_IPSET, i->name, i->flags[0], i->flags[1]);
+ }
+ }
+
+ fclose(sf);
+}
+
+
+struct object_list_heads
+{
+ struct list_head list;
+ struct list_head running_list;
+};
+
+void
+fw3_set_running(void *object, struct list_head *dest)
+{
+ struct object_list_heads *o = object;
+
+ if (dest && !o->running_list.next)
+ list_add_tail(&o->running_list, dest);
+ else if (!dest && o->running_list.next)
+ list_del(&o->running_list);
+}
+
+void
+fw3_free_object(void *obj, const void *opts)
+{
+ const struct fw3_option *ol;
+ struct list_head *list, *cur, *tmp;