]>
git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_vty_fabricd.c
2 * IS-IS Rout(e)ing protocol - isis_vty_fabricd.c
4 * This file contains the CLI that is specific to OpenFabric
6 * Copyright (C) 2018 Christian Franke, for NetDEF, Inc.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "isisd/isisd.h"
27 #include "isisd/isis_vty_common.h"
28 #include "isisd/fabricd.h"
29 #include "isisd/isis_tlvs.h"
30 #include "isisd/isis_misc.h"
31 #include "isisd/isis_lsp.h"
36 "Statically configure the tier to advertise\n"
37 "Tier to advertise\n")
39 VTY_DECLVAR_CONTEXT(isis_area
, area
);
41 uint8_t tier
= atoi(argv
[1]->arg
);
43 fabricd_configure_tier(area
, tier
);
47 DEFUN (no_fabric_tier
,
49 "no fabric-tier [(0-14)]",
51 "Statically configure the tier to advertise\n"
52 "Tier to advertise\n")
54 VTY_DECLVAR_CONTEXT(isis_area
, area
);
56 fabricd_configure_tier(area
, ISIS_TIER_UNDEFINED
);
60 static void lsp_print_flooding(struct vty
*vty
, struct isis_lsp
*lsp
)
64 lspid_print(lsp
->hdr
.lsp_id
, lspid
, true, true);
65 vty_out(vty
, "Flooding information for %s\n", lspid
);
67 if (!lsp
->flooding_neighbors
[TX_LSP_NORMAL
]) {
68 vty_out(vty
, " Never flooded.\n");
72 vty_out(vty
, " Last received on: %s\n",
73 lsp
->flooding_interface
?
74 lsp
->flooding_interface
: "(null)");
76 for (enum isis_tx_type type
= TX_LSP_NORMAL
;
77 type
<= TX_LSP_CIRCUIT_SCOPED
; type
++) {
78 struct listnode
*node
;
81 vty_out(vty
, " %s:\n",
82 (type
== TX_LSP_NORMAL
) ? "RF" : "DNR");
83 for (ALL_LIST_ELEMENTS_RO(lsp
->flooding_neighbors
[type
],
86 print_sys_hostname(neighbor_id
));
91 DEFUN (show_lsp_flooding
,
92 show_lsp_flooding_cmd
,
93 "show openfabric flooding [WORD]",
96 "Flooding information\n"
99 const char *lspid
= NULL
;
102 lspid
= argv
[3]->arg
;
105 struct listnode
*node
;
106 struct isis_area
*area
;
108 for (ALL_LIST_ELEMENTS_RO(isis
->area_list
, node
, area
)) {
109 dict_t
*lspdb
= area
->lspdb
[ISIS_LEVEL2
- 1];
111 vty_out(vty
, "Area %s:\n", area
->area_tag
?
112 area
->area_tag
: "null");
115 struct isis_lsp
*lsp
= lsp_for_arg(lspid
, lspdb
);
118 lsp_print_flooding(vty
, lsp
);
123 for (dnode_t
*dnode
= dict_first(lspdb
); dnode
;
124 dnode
= dict_next(lspdb
, dnode
)) {
125 lsp_print_flooding(vty
, dnode_get(dnode
));
133 void isis_vty_daemon_init(void)
135 install_element(ROUTER_NODE
, &fabric_tier_cmd
);
136 install_element(ROUTER_NODE
, &no_fabric_tier_cmd
);
138 install_element(ENABLE_NODE
, &show_lsp_flooding_cmd
);