summaryrefslogtreecommitdiffstats
path: root/isisd/isis_te.c
diff options
context:
space:
mode:
authorKaushik <kaushik@niralnetworks.com>2020-07-13 14:37:59 +0200
committerKaushik <kaushik@niralnetworks.com>2020-08-14 22:46:22 +0200
commiteab88f3655ba7549211f6bcc6fbc8edc3d51ede1 (patch)
treeb8b2601b48d5f19a3d6648174567c8c364a2e8f3 /isisd/isis_te.c
parentMerge pull request #6889 from opensourcerouting/isisd-assorted-fixes (diff)
downloadfrr-eab88f3655ba7549211f6bcc6fbc8edc3d51ede1.tar.xz
frr-eab88f3655ba7549211f6bcc6fbc8edc3d51ede1.zip
isisd : Transformational changes to support different VRFs.
1. Created a structure "isis master". 2. All the changes are related to handle ISIS with different vrf. 3. A new variable added in structure "isis" to store the vrf name. 4. The display commands for isis is changed to support different VRFs. Signed-off-by: Kaushik <kaushik@niralnetworks.com>
Diffstat (limited to 'isisd/isis_te.c')
-rw-r--r--isisd/isis_te.c101
1 files changed, 70 insertions, 31 deletions
diff --git a/isisd/isis_te.c b/isisd/isis_te.c
index a599909eb..016f811a7 100644
--- a/isisd/isis_te.c
+++ b/isisd/isis_te.c
@@ -302,34 +302,68 @@ int isis_mpls_te_update(struct interface *ifp)
/* Followings are vty command functions */
#ifndef FABRICD
-DEFUN (show_isis_mpls_te_router,
- show_isis_mpls_te_router_cmd,
- "show " PROTO_NAME " mpls-te router",
- SHOW_STR
- PROTO_HELP
- MPLS_TE_STR
- "Router information\n")
+DEFUN(show_isis_mpls_te_router,
+ show_isis_mpls_te_router_cmd,
+ "show " PROTO_NAME " [vrf <NAME|all>] mpls-te router",
+ SHOW_STR
+ PROTO_HELP
+ VRF_CMD_HELP_STR "All VRFs\n"
+ MPLS_TE_STR "Router information\n")
{
- struct listnode *anode;
+ struct listnode *anode, *nnode, *inode;
struct isis_area *area;
+ struct isis *isis = NULL;
+ const char *vrf_name = VRF_DEFAULT_NAME;
+ bool all_vrf = false;
+ int idx_vrf = 0;
- if (!isis) {
+ if (!im) {
vty_out(vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS;
}
-
- for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
-
- if (!IS_MPLS_TE(area->mta))
- continue;
-
- vty_out(vty, "Area %s:\n", area->area_tag);
- if (ntohs(area->mta->router_id.s_addr) != 0)
- vty_out(vty, " MPLS-TE Router-Address: %s\n",
- inet_ntoa(area->mta->router_id));
- else
- vty_out(vty, " N/A\n");
+ ISIS_FIND_VRF_ARGS(argv, argc, idx_vrf, vrf_name, all_vrf);
+ if (vrf_name) {
+ if (all_vrf) {
+ for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(isis->area_list,
+ anode, area)) {
+ if (!IS_MPLS_TE(area->mta))
+ continue;
+
+ vty_out(vty, "Area %s:\n",
+ area->area_tag);
+ if (ntohs(area->mta->router_id.s_addr)
+ != 0)
+ vty_out(vty,
+ " MPLS-TE Router-Address: %s\n",
+ inet_ntoa(
+ area->mta
+ ->router_id));
+ else
+ vty_out(vty, " N/A\n");
+ }
+ }
+ return 0;
+ }
+ isis = isis_lookup_by_vrfname(vrf_name);
+ if (isis != NULL) {
+ for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode,
+ area)) {
+
+ if (!IS_MPLS_TE(area->mta))
+ continue;
+
+ vty_out(vty, "Area %s:\n", area->area_tag);
+ if (ntohs(area->mta->router_id.s_addr) != 0)
+ vty_out(vty,
+ " MPLS-TE Router-Address: %s\n",
+ inet_ntoa(
+ area->mta->router_id));
+ else
+ vty_out(vty, " N/A\n");
+ }
+ }
}
return CMD_SUCCESS;
@@ -449,30 +483,35 @@ DEFUN (show_isis_mpls_te_interface,
"Interface information\n"
"Interface name\n")
{
- struct listnode *anode, *cnode;
+ struct listnode *anode, *cnode, *nnode, *inode;
struct isis_area *area;
struct isis_circuit *circuit;
struct interface *ifp;
int idx_interface = 4;
+ struct isis *isis = NULL;
- if (!isis) {
+ if (!im) {
vty_out(vty, "IS-IS Routing Process not enabled\n");
return CMD_SUCCESS;
}
if (argc == idx_interface) {
/* Show All Interfaces. */
- for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode, area)) {
+ for (ALL_LIST_ELEMENTS(im->isis, nnode, inode, isis)) {
+ for (ALL_LIST_ELEMENTS_RO(isis->area_list, anode,
+ area)) {
- if (!IS_MPLS_TE(area->mta))
- continue;
+ if (!IS_MPLS_TE(area->mta))
+ continue;
- vty_out(vty, "Area %s:\n", area->area_tag);
+ vty_out(vty, "Area %s:\n", area->area_tag);
- for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode,
- circuit))
- show_ext_sub(vty, circuit->interface->name,
- circuit->ext);
+ for (ALL_LIST_ELEMENTS_RO(area->circuit_list,
+ cnode, circuit))
+ show_ext_sub(vty,
+ circuit->interface->name,
+ circuit->ext);
+ }
}
} else {
/* Interface name is specified. */