RULE_LOOKUP,
RULE_ACTION,
RULE_GOTO,
+ RULE_SUP_PREFIXLEN,
__RULE_MAX
};
[RULE_TOS] = { .name = "tos", .type = BLOBMSG_TYPE_INT32 },
[RULE_FWMARK] = { .name = "mark", .type = BLOBMSG_TYPE_STRING },
[RULE_LOOKUP] = { .name = "lookup", .type = BLOBMSG_TYPE_STRING },
+ [RULE_SUP_PREFIXLEN] = { .name = "suppress_prefixlength", .type = BLOBMSG_TYPE_INT32 },
[RULE_ACTION] = { .name = "action", .type = BLOBMSG_TYPE_STRING },
[RULE_GOTO] = { .name = "goto", .type = BLOBMSG_TYPE_INT32 },
};
rule->flags |= IPRULE_LOOKUP;
}
+ if ((cur = tb[RULE_SUP_PREFIXLEN]) != NULL) {
+ rule->sup_prefixlen = blobmsg_get_u32(cur);
+ rule->flags |= IPRULE_SUP_PREFIXLEN;
+ }
+
if ((cur = tb[RULE_ACTION]) != NULL) {
if (!system_resolve_iprule_action(blobmsg_data(cur), &rule->action)) {
DPRINTF("Failed to parse rule action: %s\n", (char *) blobmsg_data(cur));
/* rule is a goto */
IPRULE_GOTO = (1 << 12),
+
+ /* rule suppresses results by prefix length */
+ IPRULE_SUP_PREFIXLEN = (1 << 13),
};
struct iprule {
unsigned int fwmask;
unsigned int lookup;
+ unsigned int sup_prefixlen;
unsigned int action;
unsigned int gotoid;
};
nla_put_u32(msg, FRA_TABLE, rule->lookup);
}
+ if (rule->flags & IPRULE_SUP_PREFIXLEN)
+ nla_put_u32(msg, FRA_SUPPRESS_PREFIXLEN, rule->sup_prefixlen);
+
if (rule->flags & IPRULE_GOTO)
nla_put_u32(msg, FRA_GOTO, rule->gotoid);