}
+#ifndef VTYSH_EXTRACT_PL
+#include "bgp_vty_clippy.c"
+#endif
+
/* BGP global configuration. */
DEFUN (bgp_multiple_instance_func,
/* BGP router-id. */
-DEFUN (bgp_router_id,
+DEFPY (bgp_router_id,
bgp_router_id_cmd,
"bgp router-id A.B.C.D",
BGP_STR
"Manually configured router identifier\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
- int idx_ipv4 = 2;
- int ret;
- struct in_addr id;
-
- ret = inet_aton (argv[idx_ipv4]->arg, &id);
- if (! ret)
- {
- vty_out (vty, "%% Malformed bgp router identifier%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- bgp_router_id_static_set (bgp, id);
-
+ bgp_router_id_static_set (bgp, router_id);
return CMD_SUCCESS;
}
-DEFUN (no_bgp_router_id,
+DEFPY (no_bgp_router_id,
no_bgp_router_id_cmd,
"no bgp router-id [A.B.C.D]",
NO_STR
"Manually configured router identifier\n")
{
VTY_DECLVAR_CONTEXT(bgp, bgp);
- int idx_router_id = 3;
- int ret;
- struct in_addr id;
- if (argc > idx_router_id)
+ if (router_id_str)
{
- ret = inet_aton (argv[idx_router_id]->arg, &id);
- if (! ret)
- {
- vty_out (vty, "%% Malformed BGP router identifier%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
-
- if (! IPV4_ADDR_SAME (&bgp->router_id_static, &id))
+ if (! IPV4_ADDR_SAME (&bgp->router_id_static, &router_id))
{
vty_out (vty, "%% BGP router-id doesn't match%s", VTY_NEWLINE);
return CMD_WARNING;
}
}
- id.s_addr = 0;
- bgp_router_id_static_set (bgp, id);
+ router_id.s_addr = 0;
+ bgp_router_id_static_set (bgp, router_id);
return CMD_SUCCESS;
}