#define C(f, tbl, def, fmt) \
{ FW3_FAMILY_##f, FW3_TABLE_##tbl, FW3_FLAG_##def, fmt }
-static const struct fw3_rule_spec default_chains[] = {
+static const struct fw3_chain_spec default_chains[] = {
C(ANY, FILTER, UNSPEC, "delegate_input"),
C(ANY, FILTER, UNSPEC, "delegate_output"),
C(ANY, FILTER, UNSPEC, "delegate_forward"),
bool reload)
{
struct fw3_defaults *defs = &state->defaults;
- const struct fw3_rule_spec *c;
+ const struct fw3_chain_spec *c;
#define policy(t) \
((t == FW3_FLAG_REJECT) ? FW3_FLAG_DROP : t)
{
enum fw3_flag policy = reload ? FW3_FLAG_DROP : FW3_FLAG_ACCEPT;
struct fw3_defaults *defs = &state->defaults;
- const struct fw3_rule_spec *c;
+ const struct fw3_chain_spec *c;
if (!has(defs->flags, handle->family, handle->table))
return;
bool statefile;
};
+struct fw3_chain_spec {
+ int family;
+ int table;
+ int flag;
+ const char *format;
+};
+
struct fw3_option
{
void fw3_free_object(void *obj, const void *opts);
-
-struct fw3_rule_spec {
- int family;
- int table;
- int flag;
- const char *format;
-};
-
bool fw3_hotplug(bool add, void *zone, void *device);
#endif
#define C(f, tbl, tgt, fmt) \
{ FW3_FAMILY_##f, FW3_TABLE_##tbl, FW3_FLAG_##tgt, fmt }
-static const struct fw3_rule_spec zone_chains[] = {
+static const struct fw3_chain_spec zone_chains[] = {
C(ANY, FILTER, UNSPEC, "zone_%s_input"),
C(ANY, FILTER, UNSPEC, "zone_%s_output"),
C(ANY, FILTER, UNSPEC, "zone_%s_forward"),
{
int i;
struct fw3_ipt_rule *r;
- const struct fw3_rule_spec *c;
+ const struct fw3_chain_spec *c;
const char *flt_chains[] = {
"input", "input",
bool reload)
{
struct fw3_zone *z, *tmp;
- const struct fw3_rule_spec *c;
+ const struct fw3_chain_spec *c;
char chain[32];
list_for_each_entry_safe(z, tmp, &state->zones, list)