summaryrefslogtreecommitdiff
path: root/nest/proto-hooks.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2012-03-15 11:58:08 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2012-03-15 12:13:04 +0100
commitc0adf7e9fc0bb920175a639c6f56ed7b4190f3e4 (patch)
tree8bc6ac9e4c9288d7e7009a80a04d7278325ff05c /nest/proto-hooks.c
parent46c1a583a5c1ea81e8d8f372bd7f614506a63938 (diff)
Better support for multitable protocols.
The nest-protocol interaction is changed to better handle multitable protocols. Multitable protocols now declare that by 'multitable' field, which tells nest that a protocol handles things related to proto-rtable interaction (table locking, announce hook adding, reconfiguration of filters) itself. Filters and stats are moved to announce hooks, a protocol could have different filters and stats to different tables. The patch is based on one from Alexander V. Chernikov, thanks.
Diffstat (limited to 'nest/proto-hooks.c')
-rw-r--r--nest/proto-hooks.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/nest/proto-hooks.c b/nest/proto-hooks.c
index 2582c48b..e80f87ea 100644
--- a/nest/proto-hooks.c
+++ b/nest/proto-hooks.c
@@ -90,7 +90,7 @@ void dump_attrs(rte *e)
* @p: protocol instance
*
* The start() hook is called by the core when it wishes to start
- * the instance.
+ * the instance. Multitable protocols should lock their tables here.
*
* Result: new protocol state
*/
@@ -110,6 +110,17 @@ int shutdown(struct proto *p)
{ DUMMY; }
/**
+ * cleanup - request instance cleanup
+ * @p: protocol instance
+ *
+ * The cleanup() hook is called by the core when the protocol became
+ * hungry/down, i.e. all protocol ahooks and routes are flushed.
+ * Multitable protocols should unlock their tables here.
+ */
+void cleanup(struct proto *p)
+{ DUMMY; }
+
+/**
* get_status - get instance status
* @p: protocol instance
* @buf: buffer to be filled with the status string