]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_evpn_vty.c
*: make consistent & update GPLv2 file headers
[mirror_frr.git] / bgpd / bgp_evpn_vty.c
index 97ce7ee969cc4ecce7cf120b6e7f953afee07875..4850a8f13a8986b12c35d3d0cb43e039474ace26 100644 (file)
@@ -1,22 +1,22 @@
 /* Ethernet-VPN Packet and vty Processing File
  Copyright (C) 2017 6WIND
-
-This file is part of FRRouting
-
-FRRouting is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-FRRouting is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with FRRouting; see the file COPYING.  If not, write to the Free
-Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
* Copyright (C) 2017 6WIND
+ *
+ * This file is part of FRRouting
+ *
+ * FRRouting is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * FRRouting is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
 
 #include <zebra.h>
 #include "command.h"
@@ -300,10 +300,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd,
       "Display information for a route distinguisher\n"
       "VPN Route Distinguisher\n" JSON_STR)
 {
-       int idx_ext_community = 6;
+       int idx_ext_community = 0;
        int ret;
        struct prefix_rd prd;
 
+       argv_find (argv, argc, "ASN:nn_or_IP-address:nn", &idx_ext_community);
+
        ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
        if (!ret) {
                vty_out(vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
@@ -339,10 +341,12 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_tags,
       "Display information for a route distinguisher\n"
       "VPN Route Distinguisher\n" "Display BGP tags for prefixes\n")
 {
-       int idx_ext_community = 6;
+       int idx_ext_community = 0;
        int ret;
        struct prefix_rd prd;
 
+       argv_find (argv, argc, "ASN:nn_or_IP-address:nn", &idx_ext_community);
+
        ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
        if (!ret) {
                vty_out(vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);
@@ -365,12 +369,14 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_routes,
       "Neighbor to display information about\n"
       "Display routes learned from neighbor\n" JSON_STR)
 {
-       int idx_ipv4 = 6;
+       int idx_ipv4 = 0;
        union sockunion su;
        struct peer *peer;
        int ret;
        u_char uj = use_json(argc, argv);
 
+       argv_find (argv, argc, "A.B.C.D", &idx_ipv4);
+
        ret = str2sockunion(argv[idx_ipv4]->arg, &su);
        if (ret < 0) {
                if (uj) {
@@ -423,14 +429,17 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_routes,
       "Neighbor to display information about\n"
       "Display routes learned from neighbor\n" JSON_STR)
 {
-       int idx_ext_community = 6;
-       int idx_ipv4 = 8;
+       int idx_ext_community = 0;
+       int idx_ipv4 = 0;
        int ret;
        union sockunion su;
        struct peer *peer;
        struct prefix_rd prd;
        u_char uj = use_json(argc, argv);
 
+       argv_find (argv, argc, "ASN:nn_or_IP-address:nn", &idx_ext_community);
+       argv_find (argv, argc, "A.B.C.D", &idx_ipv4);
+
        ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
        if (!ret) {
                if (uj) {
@@ -499,12 +508,14 @@ DEFUN(show_ip_bgp_l2vpn_evpn_all_neighbor_advertised_routes,
       "Neighbor to display information about\n"
       "Display the routes advertised to a BGP neighbor\n" JSON_STR)
 {
-       int idx_ipv4 = 7;
+       int idx_ipv4 = 0;
        int ret;
        struct peer *peer;
        union sockunion su;
        u_char uj = use_json(argc, argv);
 
+       argv_find (argv, argc, "A.B.C.D", &idx_ipv4);
+
        ret = str2sockunion(argv[idx_ipv4]->arg, &su);
        if (ret < 0) {
                if (uj) {
@@ -555,14 +566,17 @@ DEFUN(show_ip_bgp_l2vpn_evpn_rd_neighbor_advertised_routes,
       "Neighbor to display information about\n"
       "Display the routes advertised to a BGP neighbor\n" JSON_STR)
 {
-       int idx_ext_community = 6;
-       int idx_ipv4 = 8;
+       int idx_ext_community = 0;
+       int idx_ipv4 = 0;
        int ret;
        struct peer *peer;
        struct prefix_rd prd;
        union sockunion su;
        u_char uj = use_json(argc, argv);
 
+       argv_find (argv, argc, "ASN:nn_or_IP-address:nn", &idx_ext_community);
+       argv_find (argv, argc, "A.B.C.D", &idx_ipv4);
+
        ret = str2sockunion(argv[idx_ipv4]->arg, &su);
        if (ret < 0) {
                if (uj) {
@@ -644,10 +658,12 @@ DEFUN(show_ip_bgp_evpn_rd_overlay,
       "VPN Route Distinguisher\n"
       "Display BGP Overlay Information for prefixes\n")
 {
-       int idx_ext_community = 6;
+       int idx_ext_community = 0;
        int ret;
        struct prefix_rd prd;
 
+       argv_find (argv, argc, "ASN:nn_or_IP-address:nn", &idx_ext_community);
+
        ret = str2prefix_rd(argv[idx_ext_community]->arg, &prd);
        if (!ret) {
                vty_out(vty, "%% Malformed Route Distinguisher%s", VTY_NEWLINE);