summaryrefslogtreecommitdiff
path: root/nest/protocol.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-04-21 21:05:36 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2012-04-21 21:05:36 +0200
commit7d0a31deed92971e274aa0314e12619f93c850c9 (patch)
treedbd019cd9ffb61c38c3d6e254bc77dae9f58db29 /nest/protocol.h
parent334a0ed24d015e106558cc9eeef301c6f0d21aec (diff)
Fixes in generalized import limits.
Diffstat (limited to 'nest/protocol.h')
-rw-r--r--nest/protocol.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/nest/protocol.h b/nest/protocol.h
index 3dd7cf2f..d8442acb 100644
--- a/nest/protocol.h
+++ b/nest/protocol.h
@@ -375,13 +375,24 @@ extern struct proto_config *cf_dev_proto;
#define PLA_RESTART 4 /* Force protocol restart */
#define PLA_DISABLE 5 /* Shutdown and disable protocol */
+#define PLS_INITIAL 0 /* Initial limit state after protocol start */
+#define PLS_ACTIVE 1 /* Limit was hit */
+#define PLS_BLOCKED 2 /* Limit is active and blocking new routes */
+
struct proto_limit {
u32 limit; /* Maximum number of prefixes */
byte action; /* Action to take (PLA_*) */
- byte active; /* Limit is active */
+ byte state; /* State of limit (PLS_*) */
};
-int proto_notify_limit(struct announce_hook *ah, struct proto_limit *l);
+void proto_notify_limit(struct announce_hook *ah, struct proto_limit *l, u32 rt_count);
+
+static inline void proto_reset_limit(struct proto_limit *l)
+{
+ if (l)
+ l->state = PLS_INITIAL;
+}
+
/*
* Route Announcement Hook