zebra: Add link parameters support to Zebra
* zebra/interface.c:
- Add new link-params CLI commands
- Add new functions to set/get link parameters for interface
* zebra/redistribute.[c,h]: Add new function to propagate link parameters
to routing daemon (essentially OSPFD and ISISD) for Traffic Engineering.
* zebra/redistribute_null.c: Add new function
zebra_interface_parameters_update()
* zebra/zserv.[c,h]: Add new functions to send link parameters
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 57b515e..6c54917 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -281,7 +281,11 @@
zlog_debug ("MESSAGE: ZEBRA_INTERFACE_UP %s", ifp->name);
for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client))
- zsend_interface_update (ZEBRA_INTERFACE_UP, client, ifp);
+ if (client->ifinfo)
+ {
+ zsend_interface_update (ZEBRA_INTERFACE_UP, client, ifp);
+ zsend_interface_link_params (client, ifp);
+ }
}
/* Interface down information. */
@@ -310,7 +314,10 @@
for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client))
if (client->ifinfo)
- zsend_interface_add (client, ifp);
+ {
+ zsend_interface_add (client, ifp);
+ zsend_interface_link_params (client, ifp);
+ }
}
void
@@ -381,3 +388,18 @@
if (client->ifinfo && CHECK_FLAG (ifc->conf, ZEBRA_IFC_REAL))
zsend_interface_address (ZEBRA_INTERFACE_ADDRESS_DELETE, client, ifp, ifc);
}
+
+/* Interface parameters update */
+void
+zebra_interface_parameters_update (struct interface *ifp)
+{
+ struct listnode *node, *nnode;
+ struct zserv *client;
+
+ if (IS_ZEBRA_DEBUG_EVENT)
+ zlog_debug ("MESSAGE: ZEBRA_INTERFACE_LINK_PARAMS %s", ifp->name);
+
+ for (ALL_LIST_ELEMENTS (zebrad.client_list, node, nnode, client))
+ if (client->ifinfo)
+ zsend_interface_link_params (client, ifp);
+}