isisd: Add support of Traffic Engineering
These patches is an implementation of RFC5305 that enable the
support of Traffic Engineering in IS-IS
* isisd/Makefile.am: Add new files isis_te.c and isis_te.h
* isisd/isis_circuit.[c,h]: Add new mpls_te_circuit structure to
isis_circuit structure to handle new Traffic Engineering TLVs
* isisd/isis_lsp.c: Update LSP handler to mux/demux Traffic Engineering TLVs
* isisd/isis_main.c: Add initialisation of ISIS TE
* isisd/isis_pdu.c: Update function process_p2p_hello() to retrieve remote
IP address to populate Traffic Engineering TLV.
* isisd/isis_te.[c,]: Implementation of RFC5305
* isisd/isis_tlv.[c,h]: Update TLV definition and function to handle
Traffic Engineering ones
* isisd/isis_zebra.c: Add new function isis_zebra_link_params() to retrieve
the link parameters of interfaces from ZBus to populate the Traffic
Engineering TLVs
* isisd/isisd.[c,h]: Add Traffic Engineering support with new debug command
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c
index 4acaf8e..40157b5 100644
--- a/isisd/isis_zebra.c
+++ b/isisd/isis_zebra.c
@@ -48,6 +48,7 @@
#include "isisd/isis_lsp.h"
#include "isisd/isis_route.h"
#include "isisd/isis_zebra.h"
+#include "isisd/isis_te.h"
struct zclient *zclient = NULL;
@@ -60,6 +61,13 @@
struct listnode *node;
struct prefix router_id;
+ /*
+ * If ISIS TE is enable, TE Router ID is set through specific command.
+ * See mpls_te_router_addr() command in isis_te.c
+ */
+ if (IS_MPLS_TE(isisMplsTE))
+ return 0;
+
zebra_router_id_update_read (zclient->ibuf, &router_id);
if (isis->router_id == router_id.u.prefix4.s_addr)
return 0;
@@ -227,6 +235,23 @@
return 0;
}
+static int
+isis_zebra_link_params (int command, struct zclient *zclient,
+ zebra_size_t length)
+{
+ struct interface *ifp;
+
+ ifp = zebra_interface_link_params_read (zclient->ibuf);
+
+ if (ifp == NULL)
+ return 0;
+
+ /* Update TE TLV */
+ isis_mpls_te_update(ifp);
+
+ return 0;
+}
+
static void
isis_zebra_route_add_ipv4 (struct prefix *prefix,
struct isis_route_info *route_info)
@@ -678,6 +703,7 @@
zclient->interface_down = isis_zebra_if_state_down;
zclient->interface_address_add = isis_zebra_if_address_add;
zclient->interface_address_delete = isis_zebra_if_address_del;
+ zclient->interface_link_params = isis_zebra_link_params;
zclient->ipv4_route_add = isis_zebra_read_ipv4;
zclient->ipv4_route_delete = isis_zebra_read_ipv4;
#ifdef HAVE_IPV6