summaryrefslogtreecommitdiffstats
path: root/zebra/rt.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-11-14 15:57:37 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-11-29 18:56:34 +0100
commit0c555cc6a588c9512dcbefe9275acafcb0b0da27 (patch)
tree378582e47ee8c29a0947381c160578a059f63c0a /zebra/rt.h
parentMerge pull request #1493 from donaldsharp/plist_stuff (diff)
downloadfrr-0c555cc6a588c9512dcbefe9275acafcb0b0da27.tar.xz
frr-0c555cc6a588c9512dcbefe9275acafcb0b0da27.zip
zebra: Implement call back for route install/delete success/fail
When a route is installed or deleted into the kernel allow a callback mechanism to handle the success/failure of the kernel call. This separation is to allow us to do these things: 1) In the future create a true pthread to handle route install/deletes. This way we can schedule these events in a smarter fashion 2) Allow us to use a common southbound api for route install and deletion. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/rt.h')
-rw-r--r--zebra/rt.h32
1 files changed, 30 insertions, 2 deletions
diff --git a/zebra/rt.h b/zebra/rt.h
index 3ce15e964..2581b9012 100644
--- a/zebra/rt.h
+++ b/zebra/rt.h
@@ -41,8 +41,36 @@
* success failure should be handled by the caller.
*/
-extern int kernel_route_rib(struct prefix *, struct prefix *,
- struct route_entry *, struct route_entry *);
+
+enum southbound_results {
+ SOUTHBOUND_INSTALL_SUCCESS,
+ SOUTHBOUND_INSTALL_FAILURE,
+ SOUTHBOUND_DELETE_SUCCESS,
+ SOUTHBOUND_DELETE_FAILURE,
+};
+
+/*
+ * Install/delete the specified prefix p from the kernel
+ *
+ * old = NULL, new = pointer - Install new
+ * old = pointer, new = pointer - Route replace Old w/ New
+ * old = pointer, new = NULL, - Route Delete
+ *
+ * Please note not all kernels support route replace
+ * semantics so we will end up with a delete than
+ * a re-add.
+ */
+extern void kernel_route_rib(struct prefix *p, struct prefix *src_p,
+ struct route_entry *old, struct route_entry *new);
+
+/*
+ * So route install/failure may not be immediately known
+ * so let's separate it out and allow the result to
+ * be passed back up.
+ */
+extern void kernel_route_rib_pass_fail(struct prefix *p,
+ struct route_entry *re,
+ enum southbound_results res);
extern int kernel_address_add_ipv4(struct interface *, struct connected *);
extern int kernel_address_delete_ipv4(struct interface *, struct connected *);