+ if (!print_family && run_state)
+ fw3_hotplug_zones(run_state, false);
+
+ for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
+ {
+ if (!complete && !family_running(family))
+ continue;
+
+ for (table = FW3_TABLE_FILTER; table <= FW3_TABLE_RAW; table++)
+ {
+ if (!(handle = fw3_ipt_open(family, table)))
+ continue;
+
+ info(" * %sing %s %s table", complete ? "Flush" : "Clear",
+ fw3_flag_names[family], fw3_flag_names[table]);
+
+ if (complete)
+ {
+ fw3_flush_all(handle);
+ }
+ else if (run_state)
+ {
+ fw3_flush_rules(handle, run_state, false);
+ fw3_flush_zones(handle, run_state, false);
+ }
+
+ fw3_ipt_commit(handle);
+ fw3_ipt_close(handle);
+ }
+
+ family_set(run_state, family, false);
+ family_set(cfg_state, family, false);
+
+ rv = 0;
+ }
+
+ if (run_state) {
+ for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
+ fw3_destroy_ipsets(run_state, family, false);
+ }
+
+ if (complete)
+ fw3_flush_conntrack(NULL);
+
+ if (!rv && run_state)
+ fw3_write_statefile(run_state);
+
+ return rv;