mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 09:30:30 +00:00
Merge pull request #7132 from volta-networks/fix_ldp_sync_cmds
Fix ldp sync cmds
This commit is contained in:
commit
e2dcd0c2c5
@ -698,7 +698,12 @@ static void isis_circuit_ldp_sync_print_vty(struct isis_circuit *circuit,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ldp_sync_info = circuit->ldp_sync_info;
|
ldp_sync_info = circuit->ldp_sync_info;
|
||||||
vty_out(vty, "%-10s\n", circuit->interface->name);
|
vty_out(vty, "%-16s\n", circuit->interface->name);
|
||||||
|
if (circuit->state == C_STATE_CONF) {
|
||||||
|
vty_out(vty, " Interface down\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
vty_out(vty, " LDP-IGP Synchronization enabled: %s\n",
|
vty_out(vty, " LDP-IGP Synchronization enabled: %s\n",
|
||||||
ldp_sync_info->enabled == LDP_IGP_SYNC_ENABLED
|
ldp_sync_info->enabled == LDP_IGP_SYNC_ENABLED
|
||||||
? "yes"
|
? "yes"
|
||||||
@ -751,6 +756,7 @@ DEFUN (show_isis_mpls_ldp_interface,
|
|||||||
struct isis_area *area;
|
struct isis_area *area;
|
||||||
struct isis_circuit *circuit;
|
struct isis_circuit *circuit;
|
||||||
struct isis *isis = isis_lookup_by_vrfid(VRF_DEFAULT);
|
struct isis *isis = isis_lookup_by_vrfid(VRF_DEFAULT);
|
||||||
|
bool found = false;
|
||||||
|
|
||||||
if (!isis) {
|
if (!isis) {
|
||||||
vty_out(vty, "IS-IS Routing Process not enabled\n");
|
vty_out(vty, "IS-IS Routing Process not enabled\n");
|
||||||
@ -769,10 +775,16 @@ DEFUN (show_isis_mpls_ldp_interface,
|
|||||||
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode, circuit))
|
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, cnode, circuit))
|
||||||
if (!ifname)
|
if (!ifname)
|
||||||
isis_circuit_ldp_sync_print_vty(circuit, vty);
|
isis_circuit_ldp_sync_print_vty(circuit, vty);
|
||||||
else if (strcmp(circuit->interface->name, ifname) == 0)
|
else if (strcmp(circuit->interface->name, ifname)
|
||||||
|
== 0) {
|
||||||
isis_circuit_ldp_sync_print_vty(circuit, vty);
|
isis_circuit_ldp_sync_print_vty(circuit, vty);
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (found == false && ifname)
|
||||||
|
vty_out(vty, "%-16s\n ISIS not enabled\n", ifname);
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -710,8 +710,12 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty,
|
|||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
struct ospf_interface *oi;
|
struct ospf_interface *oi;
|
||||||
|
|
||||||
if (ospf_oi_count(ifp) == 0)
|
if (ospf_oi_count(ifp) == 0 && !use_json) {
|
||||||
|
if (!if_is_up(ifp))
|
||||||
|
vty_out(vty, "%s\n Interface down\n",
|
||||||
|
ifp->name);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
for (rn = route_top(IF_OIFS(ifp)); rn;
|
for (rn = route_top(IF_OIFS(ifp)); rn;
|
||||||
rn = route_next(rn)) {
|
rn = route_next(rn)) {
|
||||||
oi = rn->info;
|
oi = rn->info;
|
||||||
@ -739,9 +743,12 @@ static int show_ip_ospf_mpls_ldp_interface_common(struct vty *vty,
|
|||||||
struct ospf_interface *oi;
|
struct ospf_interface *oi;
|
||||||
|
|
||||||
if (ospf_oi_count(ifp) == 0 && !use_json) {
|
if (ospf_oi_count(ifp) == 0 && !use_json) {
|
||||||
vty_out(vty,
|
if (if_is_up(ifp))
|
||||||
" OSPF not enabled on this interface %s\n",
|
vty_out(vty, "%s\n OSPF not enabled\n",
|
||||||
ifp->name);
|
ifp->name);
|
||||||
|
else
|
||||||
|
vty_out(vty, "%s\n Interface down\n",
|
||||||
|
ifp->name);
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
for (rn = route_top(IF_OIFS(ifp)); rn;
|
for (rn = route_top(IF_OIFS(ifp)); rn;
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
"r1-eth1":{
|
"r1-eth1":{
|
||||||
"ldpIgpSyncEnabled":true,
|
"Interface":true
|
||||||
"holdDownTimeInSec":0,
|
|
||||||
"ldpIgpSyncState":"Sync not achieved"
|
|
||||||
},
|
},
|
||||||
"r1-eth2":{
|
"r1-eth2":{
|
||||||
"ldpIgpSyncEnabled":true,
|
"ldpIgpSyncEnabled":true,
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
"r2-eth1":{
|
"r2-eth1":{
|
||||||
"ldpIgpSyncEnabled":true,
|
"Interface":true
|
||||||
"holdDownTimeInSec":0,
|
|
||||||
"ldpIgpSyncState":"Sync not achieved"
|
|
||||||
},
|
},
|
||||||
"r2-eth2":{
|
"r2-eth2":{
|
||||||
"ldpIgpSyncEnabled":false,
|
"ldpIgpSyncEnabled":false,
|
||||||
|
@ -470,16 +470,17 @@ def parse_show_isis_ldp_sync(lines, rname):
|
|||||||
|
|
||||||
if line.startswith(" LDP-IGP Synchronization enabled: "):
|
if line.startswith(" LDP-IGP Synchronization enabled: "):
|
||||||
interface["ldpIgpSyncEnabled"] = line.endswith("yes")
|
interface["ldpIgpSyncEnabled"] = line.endswith("yes")
|
||||||
|
line = it.next();
|
||||||
|
|
||||||
line = it.next();
|
if line.startswith(" holddown timer in seconds: "):
|
||||||
|
interface["holdDownTimeInSec"] = int(line.split(": ")[-1])
|
||||||
|
line = it.next();
|
||||||
|
|
||||||
if line.startswith(" holddown timer in seconds: "):
|
if line.startswith(" State: "):
|
||||||
interface["holdDownTimeInSec"] = int(line.split(": ")[-1])
|
interface["ldpIgpSyncState"] = line.split(": ")[-1]
|
||||||
|
|
||||||
line = it.next();
|
elif line.startswith(" Interface "):
|
||||||
|
interface["Interface"] = line.endswith("down")
|
||||||
if line.startswith(" State: "):
|
|
||||||
interface["ldpIgpSyncState"] = line.split(": ")[-1]
|
|
||||||
|
|
||||||
interfaces[interface_name] = interface
|
interfaces[interface_name] = interface
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user