@@ -55,6 +55,7 @@ unsigned long conf_bgp_debug_zebra;
55
55
unsigned long conf_bgp_debug_allow_martians ;
56
56
unsigned long conf_bgp_debug_nht ;
57
57
unsigned long conf_bgp_debug_update_groups ;
58
+ unsigned long conf_bgp_debug_vpn ;
58
59
59
60
unsigned long term_bgp_debug_as4 ;
60
61
unsigned long term_bgp_debug_neighbor_events ;
@@ -68,6 +69,7 @@ unsigned long term_bgp_debug_zebra;
68
69
unsigned long term_bgp_debug_allow_martians ;
69
70
unsigned long term_bgp_debug_nht ;
70
71
unsigned long term_bgp_debug_update_groups ;
72
+ unsigned long term_bgp_debug_vpn ;
71
73
72
74
struct list * bgp_debug_neighbor_events_peers = NULL ;
73
75
struct list * bgp_debug_keepalive_peers = NULL ;
@@ -1557,6 +1559,96 @@ DEFUN (no_debug_bgp_update_groups,
1557
1559
return CMD_SUCCESS ;
1558
1560
}
1559
1561
1562
+ DEFUN (debug_bgp_vpn ,
1563
+ debug_bgp_vpn_cmd ,
1564
+ "debug bgp vpn <leak-from-vrf|leak-to-vrf|rmap-event|label>" ,
1565
+ DEBUG_STR
1566
+ BGP_STR
1567
+ "VPN routes\n"
1568
+ "leaked from vrf to vpn\n"
1569
+ "leaked to vrf from vpn\n"
1570
+ "route-map updates\n"
1571
+ "labels\n" )
1572
+ {
1573
+ int idx = 3 ;
1574
+
1575
+ if (argv_find (argv , argc , "leak-from-vrf" , & idx )) {
1576
+ if (vty -> node == CONFIG_NODE )
1577
+ DEBUG_ON (vpn , VPN_LEAK_FROM_VRF );
1578
+ else
1579
+ TERM_DEBUG_ON (vpn , VPN_LEAK_FROM_VRF );
1580
+ } else if (argv_find (argv , argc , "leak-to-vrf" , & idx )) {
1581
+ if (vty -> node == CONFIG_NODE )
1582
+ DEBUG_ON (vpn , VPN_LEAK_TO_VRF );
1583
+ else
1584
+ TERM_DEBUG_ON (vpn , VPN_LEAK_TO_VRF );
1585
+ } else if (argv_find (argv , argc , "rmap-event" , & idx )) {
1586
+ if (vty -> node == CONFIG_NODE )
1587
+ DEBUG_ON (vpn , VPN_LEAK_RMAP_EVENT );
1588
+ else
1589
+ TERM_DEBUG_ON (vpn , VPN_LEAK_RMAP_EVENT );
1590
+ } else if (argv_find (argv , argc , "label" , & idx )) {
1591
+ if (vty -> node == CONFIG_NODE )
1592
+ DEBUG_ON (vpn , VPN_LEAK_LABEL );
1593
+ else
1594
+ TERM_DEBUG_ON (vpn , VPN_LEAK_LABEL );
1595
+ } else {
1596
+ vty_out (vty , "%% unknown debug bgp vpn keyword\n" );
1597
+ return CMD_WARNING_CONFIG_FAILED ;
1598
+ }
1599
+
1600
+ if (vty -> node != CONFIG_NODE )
1601
+ vty_out (vty , "enabled debug bgp vpn %s\n" , argv [idx ]-> text );
1602
+
1603
+ return CMD_SUCCESS ;
1604
+ }
1605
+
1606
+ DEFUN (no_debug_bgp_vpn ,
1607
+ no_debug_bgp_vpn_cmd ,
1608
+ "no debug bgp vpn <leak-from-vrf|leak-to-vrf|rmap-event|label>" ,
1609
+ NO_STR
1610
+ DEBUG_STR
1611
+ BGP_STR
1612
+ "VPN routes\n"
1613
+ "leaked from vrf to vpn\n"
1614
+ "leaked to vrf from vpn\n"
1615
+ "route-map updates\n"
1616
+ "labels\n" )
1617
+ {
1618
+ int idx = 4 ;
1619
+
1620
+ if (argv_find (argv , argc , "leak-from-vrf" , & idx )) {
1621
+ if (vty -> node == CONFIG_NODE )
1622
+ DEBUG_OFF (vpn , VPN_LEAK_FROM_VRF );
1623
+ else
1624
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_FROM_VRF );
1625
+
1626
+ } else if (argv_find (argv , argc , "leak-to-vrf" , & idx )) {
1627
+ if (vty -> node == CONFIG_NODE )
1628
+ DEBUG_OFF (vpn , VPN_LEAK_TO_VRF );
1629
+ else
1630
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_TO_VRF );
1631
+ } else if (argv_find (argv , argc , "rmap-event" , & idx )) {
1632
+ if (vty -> node == CONFIG_NODE )
1633
+ DEBUG_OFF (vpn , VPN_LEAK_RMAP_EVENT );
1634
+ else
1635
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_RMAP_EVENT );
1636
+ } else if (argv_find (argv , argc , "label" , & idx )) {
1637
+ if (vty -> node == CONFIG_NODE )
1638
+ DEBUG_OFF (vpn , VPN_LEAK_LABEL );
1639
+ else
1640
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_LABEL );
1641
+ } else {
1642
+ vty_out (vty , "%% unknown debug bgp vpn keyword\n" );
1643
+ return CMD_WARNING_CONFIG_FAILED ;
1644
+ }
1645
+
1646
+ if (vty -> node != CONFIG_NODE )
1647
+ vty_out (vty , "disabled debug bgp vpn %s\n" , argv [idx ]-> text );
1648
+
1649
+ return CMD_SUCCESS ;
1650
+ }
1651
+
1560
1652
DEFUN (no_debug_bgp ,
1561
1653
no_debug_bgp_cmd ,
1562
1654
"no debug bgp" ,
@@ -1589,6 +1681,10 @@ DEFUN (no_debug_bgp,
1589
1681
TERM_DEBUG_OFF (zebra , ZEBRA );
1590
1682
TERM_DEBUG_OFF (allow_martians , ALLOW_MARTIANS );
1591
1683
TERM_DEBUG_OFF (nht , NHT );
1684
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_FROM_VRF );
1685
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_TO_VRF );
1686
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_RMAP_EVENT );
1687
+ TERM_DEBUG_OFF (vpn , VPN_LEAK_LABEL );
1592
1688
vty_out (vty , "All possible debugging has been turned off\n" );
1593
1689
1594
1690
return CMD_SUCCESS ;
@@ -1648,6 +1744,18 @@ DEFUN_NOSH (show_debugging_bgp,
1648
1744
1649
1745
if (BGP_DEBUG (allow_martians , ALLOW_MARTIANS ))
1650
1746
vty_out (vty , " BGP allow martian next hop debugging is on\n" );
1747
+
1748
+ if (BGP_DEBUG (vpn , VPN_LEAK_FROM_VRF ))
1749
+ vty_out (vty ,
1750
+ " BGP route leak from vrf to vpn debugging is on\n" );
1751
+ if (BGP_DEBUG (vpn , VPN_LEAK_TO_VRF ))
1752
+ vty_out (vty ,
1753
+ " BGP route leak to vrf from vpn debugging is on\n" );
1754
+ if (BGP_DEBUG (vpn , VPN_LEAK_RMAP_EVENT ))
1755
+ vty_out (vty , " BGP vpn route-map event debugging is on\n" );
1756
+ if (BGP_DEBUG (vpn , VPN_LEAK_LABEL ))
1757
+ vty_out (vty , " BGP vpn label event debugging is on\n" );
1758
+
1651
1759
vty_out (vty , "\n" );
1652
1760
return CMD_SUCCESS ;
1653
1761
}
@@ -1692,6 +1800,15 @@ int bgp_debug_count(void)
1692
1800
if (BGP_DEBUG (allow_martians , ALLOW_MARTIANS ))
1693
1801
ret ++ ;
1694
1802
1803
+ if (BGP_DEBUG (vpn , VPN_LEAK_FROM_VRF ))
1804
+ ret ++ ;
1805
+ if (BGP_DEBUG (vpn , VPN_LEAK_TO_VRF ))
1806
+ ret ++ ;
1807
+ if (BGP_DEBUG (vpn , VPN_LEAK_RMAP_EVENT ))
1808
+ ret ++ ;
1809
+ if (BGP_DEBUG (vpn , VPN_LEAK_LABEL ))
1810
+ ret ++ ;
1811
+
1695
1812
return ret ;
1696
1813
}
1697
1814
@@ -1768,6 +1885,23 @@ static int bgp_config_write_debug(struct vty *vty)
1768
1885
write ++ ;
1769
1886
}
1770
1887
1888
+ if (CONF_BGP_DEBUG (vpn , VPN_LEAK_FROM_VRF )) {
1889
+ vty_out (vty , "debug bgp vpn leak-from-vrf\n" );
1890
+ write ++ ;
1891
+ }
1892
+ if (CONF_BGP_DEBUG (vpn , VPN_LEAK_TO_VRF )) {
1893
+ vty_out (vty , "debug bgp vpn leak-to-vrf\n" );
1894
+ write ++ ;
1895
+ }
1896
+ if (CONF_BGP_DEBUG (vpn , VPN_LEAK_RMAP_EVENT )) {
1897
+ vty_out (vty , "debug bgp vpn rmap-event\n" );
1898
+ write ++ ;
1899
+ }
1900
+ if (CONF_BGP_DEBUG (vpn , VPN_LEAK_LABEL )) {
1901
+ vty_out (vty , "debug bgp vpn label\n" );
1902
+ write ++ ;
1903
+ }
1904
+
1771
1905
return write ;
1772
1906
}
1773
1907
@@ -1861,6 +1995,11 @@ void bgp_debug_init(void)
1861
1995
install_element (CONFIG_NODE , & no_debug_bgp_bestpath_cmd );
1862
1996
install_element (ENABLE_NODE , & no_debug_bgp_bestpath_prefix_cmd );
1863
1997
install_element (CONFIG_NODE , & no_debug_bgp_bestpath_prefix_cmd );
1998
+
1999
+ install_element (ENABLE_NODE , & debug_bgp_vpn_cmd );
2000
+ install_element (CONFIG_NODE , & debug_bgp_vpn_cmd );
2001
+ install_element (ENABLE_NODE , & no_debug_bgp_vpn_cmd );
2002
+ install_element (CONFIG_NODE , & no_debug_bgp_vpn_cmd );
1864
2003
}
1865
2004
1866
2005
/* Return true if this prefix is on the per_prefix_list of prefixes to debug
0 commit comments