iprule: Add option to suppress unspecific routing lookups
[project/netifd.git] / iprule.h
index e4ceee0..7617c76 100644 (file)
--- a/iprule.h
+++ b/iprule.h
 
 #include "interface-ip.h"
 
-#define IPRULE_PRIORITY_ADDR 80000
+#define IPRULE_PRIORITY_ADDR 10000
+#define IPRULE_PRIORITY_ADDR_MASK 20000
 #define IPRULE_PRIORITY_NW 90000
-#define IPRULE_PRIORITY_REJECT 2000000000
+#define IPRULE_PRIORITY_REJECT 4200000000
 
 enum iprule_flags {
        /* address family for rule */
@@ -59,6 +60,9 @@ enum iprule_flags {
 
        /* rule is a goto */
        IPRULE_GOTO                     = (1 << 12),
+
+       /* rule suppresses results by prefix length */
+       IPRULE_SUP_PREFIXLEN    = (1 << 13),
 };
 
 struct iprule {
@@ -86,12 +90,13 @@ struct iprule {
        unsigned int fwmask;
 
        unsigned int lookup;
+       unsigned int sup_prefixlen;
        unsigned int action;
        unsigned int gotoid;
 };
 
 extern struct vlist_tree iprules;
-extern const struct config_param_list rule_attr_list;
+extern const struct uci_blob_param_list rule_attr_list;
 
 void iprule_add(struct blob_attr *attr, bool v6);
 void iprule_update_start(void);