]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #4797 from opensourcerouting/eigrpd-vrf
authorRuss White <russ@riw.us>
Tue, 3 Sep 2019 13:17:35 +0000 (09:17 -0400)
committerGitHub <noreply@github.com>
Tue, 3 Sep 2019 13:17:35 +0000 (09:17 -0400)
eigrpd: vrf support

1  2 
vtysh/vtysh.c

diff --combined vtysh/vtysh.c
index eee864940cb54c621b1778ffad84ee7c929f4c61,1fa1f4eaa268d87194f1282907e1fb0fe1a11b29..f23232af75a30fc93ed79fbcb63b0db79a287703
@@@ -164,10 -164,9 +164,10 @@@ static int vtysh_reconnect(struct vtysh
  static void vclient_close(struct vtysh_client *vclient)
  {
        if (vclient->fd >= 0) {
 -              vty_out(vty,
 -                      "Warning: closing connection to %s because of an I/O error!\n",
 -                      vclient->name);
 +              if (vty->of)
 +                      vty_out(vty,
 +                              "Warning: closing connection to %s because of an I/O error!\n",
 +                              vclient->name);
                close(vclient->fd);
                /* indicate as candidate for reconnect */
                vclient->fd = VTYSH_WAS_ACTIVE;
@@@ -238,11 -237,8 +238,11 @@@ static int vtysh_client_run(struct vtys
                        continue;
  
                if (nread <= 0) {
 -                      vty_out(vty, "vtysh: error reading from %s: %s (%d)",
 -                              vclient->name, safe_strerror(errno), errno);
 +                      if (vty->of)
 +                              vty_out(vty,
 +                                      "vtysh: error reading from %s: %s (%d)",
 +                                      vclient->name, safe_strerror(errno),
 +                                      errno);
                        goto out_err;
                }
  
@@@ -387,7 -383,7 +387,7 @@@ static int vtysh_client_run_all(struct 
                        rc_all = rc;
                }
        }
 -      if (wrong_instance && !correct_instance) {
 +      if (wrong_instance && !correct_instance && vty->of) {
                vty_out(vty,
                        "%% [%s]: command ignored as it targets an instance that is not running\n",
                        head_client->name);
@@@ -856,15 -852,11 +856,15 @@@ int vtysh_mark_file(const char *filenam
                        return CMD_ERR_INCOMPLETE;
                case CMD_SUCCESS:
                        vty_out(vty, "%s", vty->buf);
 +                      if (strmatch(vty_buf_trimmed, "exit-vrf"))
 +                              vty_out(vty, "end\n");
                        break;
                case CMD_SUCCESS_DAEMON: {
                        int cmd_stat;
  
                        vty_out(vty, "%s", vty->buf);
 +                      if (strmatch(vty_buf_trimmed, "exit-vrf"))
 +                              vty_out(vty, "end\n");
                        cmd_stat = vtysh_client_execute(&vtysh_client[0],
                                                        vty->buf);
                        if (cmd_stat != CMD_SUCCESS)
@@@ -1260,8 -1252,6 +1260,8 @@@ static struct cmd_node bgp_vrf_policy_n
  static struct cmd_node bgp_vnc_l2_group_node = {
        BGP_VNC_L2_GROUP_NODE, "%s(config-router-vnc-l2-group)# "};
  
 +static struct cmd_node bmp_node = {BMP_NODE, "%s(config-bgp-bmp)# "};
 +
  static struct cmd_node ospf_node = {OSPF_NODE, "%s(config-router)# "};
  
  static struct cmd_node eigrp_node = {EIGRP_NODE, "%s(config-router)# "};
@@@ -1337,7 -1327,7 +1337,7 @@@ DEFUNSH(VTYSH_REALLYALL, vtysh_end_all
  }
  
  DEFUNSH(VTYSH_BGPD, router_bgp, router_bgp_cmd,
 -      "router bgp [(1-4294967295) [<view|vrf> WORD]]",
 +      "router bgp [(1-4294967295)$instasn [<view|vrf> WORD]]",
        ROUTER_STR BGP_STR AS_STR
        "BGP view\nBGP VRF\n"
        "View/VRF name\n")
@@@ -1480,18 -1470,6 +1480,18 @@@ DEFUNSH(VTYSH_BGPD
        return CMD_SUCCESS;
  }
  
 +DEFUNSH(VTYSH_BGPD,
 +      bmp_targets,
 +      bmp_targets_cmd,
 +      "bmp targets BMPTARGETS",
 +      "BGP Monitoring Protocol\n"
 +      "Create BMP target group\n"
 +      "Name of the BMP target group\n")
 +{
 +      vty->node = BMP_NODE;
 +      return CMD_SUCCESS;
 +}
 +
  DEFUNSH(VTYSH_BGPD, address_family_evpn, address_family_evpn_cmd,
        "address-family <l2vpn evpn>",
        "Enter Address Family command mode\n"
@@@ -1599,10 -1577,11 +1599,11 @@@ DEFUNSH(VTYSH_OSPFD, router_ospf, route
        return CMD_SUCCESS;
  }
  
- DEFUNSH(VTYSH_EIGRPD, router_eigrp, router_eigrp_cmd, "router eigrp (1-65535)",
+ DEFUNSH(VTYSH_EIGRPD, router_eigrp, router_eigrp_cmd, "router eigrp (1-65535) [vrf NAME]",
        "Enable a routing process\n"
        "Start EIGRP configuration\n"
-       "AS number to use\n")
+       "AS number to use\n"
+       VRF_CMD_HELP_STR)
  {
        vty->node = EIGRP_NODE;
        return CMD_SUCCESS;
@@@ -1856,7 -1835,6 +1857,7 @@@ static int vtysh_exit(struct vty *vty
        case BGP_VNC_DEFAULTS_NODE:
        case BGP_VNC_NVE_GROUP_NODE:
        case BGP_VNC_L2_GROUP_NODE:
 +      case BMP_NODE:
                vty->node = BGP_NODE;
                break;
        case BGP_EVPN_VNI_NODE:
@@@ -1947,19 -1925,6 +1948,19 @@@ DEFUNSH(VTYSH_BGPD, rpki_quit, rpki_qui
        return rpki_exit(self, vty, argc, argv);
  }
  
 +DEFUNSH(VTYSH_BGPD, bmp_exit, bmp_exit_cmd, "exit",
 +      "Exit current mode and down to previous mode\n")
 +{
 +      vtysh_exit(vty);
 +      return CMD_SUCCESS;
 +}
 +
 +DEFUNSH(VTYSH_BGPD, bmp_quit, bmp_quit_cmd, "quit",
 +      "Exit current mode and down to previous mode\n")
 +{
 +      return bmp_exit(self, vty, argc, argv);
 +}
 +
  DEFUNSH(VTYSH_VRF, exit_vrf_config, exit_vrf_config_cmd, "exit-vrf",
        "Exit from VRF configuration mode\n")
  {
@@@ -3648,7 -3613,6 +3649,7 @@@ void vtysh_init_vty(void
        install_node(&openfabric_node, NULL);
        install_node(&vty_node, NULL);
        install_node(&rpki_node, NULL);
 +      install_node(&bmp_node, NULL);
  #if HAVE_BFDD > 0
        install_node(&bfd_node, NULL);
        install_node(&bfd_peer_node, NULL);
        install_element(BGP_FLOWSPECV4_NODE, &exit_address_family_cmd);
        install_element(BGP_FLOWSPECV6_NODE, &exit_address_family_cmd);
  
 +      install_element(BGP_NODE, &bmp_targets_cmd);
 +      install_element(BMP_NODE, &bmp_exit_cmd);
 +      install_element(BMP_NODE, &bmp_quit_cmd);
 +      install_element(BMP_NODE, &vtysh_end_all_cmd);
 +
        install_element(CONFIG_NODE, &rpki_cmd);
        install_element(RPKI_NODE, &rpki_exit_cmd);
        install_element(RPKI_NODE, &rpki_quit_cmd);