/* 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"
"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);
"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);
"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) {
"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) {
"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) {
"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) {
"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);