static struct peer *
bgp_find_peer (struct vty *vty, const char *peer_str)
{
+ struct bgp *bgp = VTY_GET_CONTEXT(bgp);
int ret;
union sockunion su;
- struct bgp *bgp;
struct peer *peer;
- bgp = vty->index;
+ if (!bgp) {
+ return NULL;
+ }
ret = str2sockunion (peer_str, &su);
/* 'swpX' string */
BGP_STR
"BGP updates\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_debug_list_free(bgp_debug_update_in_peers);
bgp_debug_list_free(bgp_debug_update_out_peers);
bgp_debug_list_free(bgp_debug_update_prefixes);
- bgp_debug_clear_updgrp_update_dbg(vty->index);
+ bgp_debug_clear_updgrp_update_dbg(bgp);
if (vty->node == CONFIG_NODE)
{
DEBUG_STR
BGP_STR)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_debug_list_free(bgp_debug_neighbor_events_peers);
bgp_debug_list_free(bgp_debug_keepalive_peers);
bgp_debug_list_free(bgp_debug_update_in_peers);
bgp_debug_list_free(bgp_debug_bestpath_prefixes);
bgp_debug_list_free(bgp_debug_zebra_prefixes);
- bgp_debug_clear_updgrp_update_dbg(vty->index);
+ bgp_debug_clear_updgrp_update_dbg(bgp);
TERM_DEBUG_OFF (keepalive, KEEPALIVE);
TERM_DEBUG_OFF (update, UPDATE_IN);
/* Configure static BGP network. When user don't run zebra, static
route should be installed as valid. */
static int
-bgp_static_set (struct vty *vty, struct bgp *bgp, const char *ip_str,
+bgp_static_set (struct vty *vty, const char *ip_str,
afi_t afi, safi_t safi, const char *rmap, int backdoor)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
struct prefix p;
struct bgp_static *bgp_static;
/* Configure static BGP network. */
static int
-bgp_static_unset (struct vty *vty, struct bgp *bgp, const char *ip_str,
+bgp_static_unset (struct vty *vty, const char *ip_str,
afi_t afi, safi_t safi)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
struct prefix p;
struct bgp_static *bgp_static;
const char *rd_str, const char *tag_str,
const char *rmap_str)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
struct prefix p;
struct prefix_rd prd;
- struct bgp *bgp;
struct bgp_node *prn;
struct bgp_node *rn;
struct bgp_table *table;
struct bgp_static *bgp_static;
u_char tag[3];
- bgp = vty->index;
-
ret = str2prefix (ip_str, &p);
if (! ret)
{
bgp_static_unset_safi(safi_t safi, struct vty *vty, const char *ip_str,
const char *rd_str, const char *tag_str)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
- struct bgp *bgp;
struct prefix p;
struct prefix_rd prd;
struct bgp_node *prn;
struct bgp_static *bgp_static;
u_char tag[3];
- bgp = vty->index;
-
/* Convert IP prefix string to struct prefix. */
ret = str2prefix (ip_str, &p);
if (! ret)
}
static int
-bgp_table_map_set (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
+bgp_table_map_set (struct vty *vty, afi_t afi, safi_t safi,
const char *rmap_name)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct bgp_rmap *rmap;
rmap = &bgp->table_map[afi][safi];
}
static int
-bgp_table_map_unset (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
+bgp_table_map_unset (struct vty *vty, afi_t afi, safi_t safi,
const char *rmap_name)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct bgp_rmap *rmap;
rmap = &bgp->table_map[afi][safi];
"Name of the route map\n")
{
int idx_word = 1;
- return bgp_table_map_set (vty, vty->index,
+ return bgp_table_map_set (vty,
bgp_node_afi (vty), bgp_node_safi (vty), argv[idx_word]->arg);
}
DEFUN (no_bgp_table_map,
"Name of the route map\n")
{
int idx_word = 2;
- return bgp_table_map_unset (vty, vty->index,
+ return bgp_table_map_unset (vty,
bgp_node_afi (vty), bgp_node_safi (vty), argv[idx_word]->arg);
}
"IPv4 prefix\n")
{
int idx_ipv4_prefixlen = 1;
- return bgp_static_set (vty, vty->index, argv[idx_ipv4_prefixlen]->arg,
+ return bgp_static_set (vty, argv[idx_ipv4_prefixlen]->arg,
AFI_IP, bgp_node_safi (vty), NULL, 0);
}
{
int idx_ipv4_prefixlen = 1;
int idx_word = 3;
- return bgp_static_set (vty, vty->index, argv[idx_ipv4_prefixlen]->arg,
+ return bgp_static_set (vty, argv[idx_ipv4_prefixlen]->arg,
AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
}
"Specify a BGP backdoor route\n")
{
int idx_ipv4_prefixlen = 1;
- return bgp_static_set (vty, vty->index, argv[idx_ipv4_prefixlen]->arg, AFI_IP, SAFI_UNICAST,
+ return bgp_static_set (vty, argv[idx_ipv4_prefixlen]->arg, AFI_IP, SAFI_UNICAST,
NULL, 1);
}
return CMD_WARNING;
}
- return bgp_static_set (vty, vty->index, prefix_str,
+ return bgp_static_set (vty, prefix_str,
AFI_IP, bgp_node_safi (vty), NULL, 0);
}
return CMD_WARNING;
}
- return bgp_static_set (vty, vty->index, prefix_str,
+ return bgp_static_set (vty, prefix_str,
AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
}
return CMD_WARNING;
}
- return bgp_static_set (vty, vty->index, prefix_str, AFI_IP, SAFI_UNICAST,
+ return bgp_static_set (vty, prefix_str, AFI_IP, SAFI_UNICAST,
NULL, 1);
}
return CMD_WARNING;
}
- return bgp_static_set (vty, vty->index, prefix_str,
+ return bgp_static_set (vty, prefix_str,
AFI_IP, bgp_node_safi (vty), NULL, 0);
}
return CMD_WARNING;
}
- return bgp_static_set (vty, vty->index, prefix_str,
+ return bgp_static_set (vty, prefix_str,
AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
}
return CMD_WARNING;
}
- return bgp_static_set (vty, vty->index, prefix_str, AFI_IP, SAFI_UNICAST,
+ return bgp_static_set (vty, prefix_str, AFI_IP, SAFI_UNICAST,
NULL, 1);
}
"Name of the route map\n")
{
int idx_ipv4_prefixlen = 2;
- return bgp_static_unset (vty, vty->index, argv[idx_ipv4_prefixlen]->arg, AFI_IP,
+ return bgp_static_unset (vty, argv[idx_ipv4_prefixlen]->arg, AFI_IP,
bgp_node_safi (vty));
}
return CMD_WARNING;
}
- return bgp_static_unset (vty, vty->index, prefix_str, AFI_IP,
+ return bgp_static_unset (vty, prefix_str, AFI_IP,
bgp_node_safi (vty));
}
return CMD_WARNING;
}
- return bgp_static_unset (vty, vty->index, prefix_str, AFI_IP,
+ return bgp_static_unset (vty, prefix_str, AFI_IP,
bgp_node_safi (vty));
}
"IPv6 prefix\n")
{
int idx_ipv6_prefixlen = 1;
- return bgp_static_set (vty, vty->index, argv[idx_ipv6_prefixlen]->arg, AFI_IP6, bgp_node_safi(vty),
+ return bgp_static_set (vty, argv[idx_ipv6_prefixlen]->arg, AFI_IP6, bgp_node_safi(vty),
NULL, 0);
}
{
int idx_ipv6_prefixlen = 1;
int idx_word = 3;
- return bgp_static_set (vty, vty->index, argv[idx_ipv6_prefixlen]->arg, AFI_IP6,
+ return bgp_static_set (vty, argv[idx_ipv6_prefixlen]->arg, AFI_IP6,
bgp_node_safi (vty), argv[idx_word]->arg, 0);
}
"Name of the route map\n")
{
int idx_ipv6_prefixlen = 2;
- return bgp_static_unset (vty, vty->index, argv[idx_ipv6_prefixlen]->arg, AFI_IP6, bgp_node_safi(vty));
+ return bgp_static_unset (vty, argv[idx_ipv6_prefixlen]->arg, AFI_IP6, bgp_node_safi(vty));
}
/* Aggreagete address:
bgp_aggregate_unset (struct vty *vty, const char *prefix_str,
afi_t afi, safi_t safi)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
struct prefix p;
struct bgp_node *rn;
- struct bgp *bgp;
struct bgp_aggregate *aggregate;
/* Convert string to prefix structure. */
}
apply_mask (&p);
- /* Get BGP structure. */
- bgp = vty->index;
-
/* Old configuration check. */
rn = bgp_node_lookup (bgp->aggregate[afi][safi], &p);
if (! rn)
afi_t afi, safi_t safi,
u_char summary_only, u_char as_set)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
struct prefix p;
struct bgp_node *rn;
- struct bgp *bgp;
struct bgp_aggregate *aggregate;
/* Convert string to prefix structure. */
}
apply_mask (&p);
- /* Get BGP structure. */
- bgp = vty->index;
-
/* Old configuration check. */
rn = bgp_node_get (bgp->aggregate[afi][safi], &p);
"Distance for routes internal to the AS\n"
"Distance for local routes\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 2;
int idx_number_2 = 3;
int idx_number_3 = 4;
- struct bgp *bgp;
afi_t afi;
safi_t safi;
- bgp = vty->index;
afi = bgp_node_afi (vty);
safi = bgp_node_safi (vty);
"Distance for routes internal to the AS\n"
"Distance for local routes\n")
{
- struct bgp *bgp;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
afi_t afi;
safi_t safi;
- bgp = vty->index;
afi = bgp_node_afi (vty);
safi = bgp_node_safi (vty);
"Value to start suppressing a route\n"
"Maximum duration to suppress a stable route\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_half_life = 2;
int idx_reuse = 3;
int idx_suppress = 4;
int idx_max_suppress = 5;
- struct bgp *bgp;
int half = DEFAULT_HALF_LIFE * 60;
int reuse = DEFAULT_REUSE;
int suppress = DEFAULT_SUPPRESS;
max = 4 * half;
}
- bgp = vty->index;
-
if (suppress < reuse)
{
vty_out (vty, "Suppress value cannot be less than reuse value %s",
"Value to start suppressing a route\n"
"Maximum duration to suppress a stable route\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
return bgp_damp_disable (bgp, bgp_node_afi (vty), bgp_node_safi (vty));
}
/* Add bgp route map rule. */
static int
-bgp_route_match_add (struct vty *vty, struct route_map_index *index,
+bgp_route_match_add (struct vty *vty,
const char *command, const char *arg,
route_map_event_t type)
{
+ VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret;
ret = route_map_add_match (index, command, arg);
/* Delete bgp route map rule. */
static int
-bgp_route_match_delete (struct vty *vty, struct route_map_index *index,
+bgp_route_match_delete (struct vty *vty,
const char *command, const char *arg,
route_map_event_t type)
{
+ VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret;
char *dep_name = NULL;
const char *tmpstr;
"IPv6 address of peer\n")
{
int idx_ip = 2;
- return bgp_route_match_add (vty, vty->index, "peer", argv[idx_ip]->arg,
+ return bgp_route_match_add (vty, "peer", argv[idx_ip]->arg,
RMAP_EVENT_MATCH_ADDED);
}
"Match peer address\n"
"Static or Redistributed routes\n")
{
- return bgp_route_match_add (vty, vty->index, "peer", "local",
+ return bgp_route_match_add (vty, "peer", "local",
RMAP_EVENT_MATCH_DELETED);
}
int idx_peer = 3;
if (argc <= idx_peer)
- return bgp_route_match_delete (vty, vty->index, "peer", NULL,
+ return bgp_route_match_delete (vty, "peer", NULL,
RMAP_EVENT_MATCH_DELETED);
- return bgp_route_match_delete (vty, vty->index, "peer", argv[idx_peer]->arg,
+ return bgp_route_match_delete (vty, "peer", argv[idx_peer]->arg,
RMAP_EVENT_MATCH_DELETED);
}
"Percentage of routes\n")
{
int idx_number = 2;
- return bgp_route_match_add (vty, vty->index, "probability", argv[idx_number]->arg,
+ return bgp_route_match_add (vty, "probability", argv[idx_number]->arg,
RMAP_EVENT_MATCH_ADDED);
}
{
int idx_number = 3;
if (argc <= idx_number)
- return bgp_route_match_delete (vty, vty->index, "probability", NULL,
+ return bgp_route_match_delete (vty, "probability", NULL,
RMAP_EVENT_MATCH_DELETED);
- return bgp_route_match_delete (vty, vty->index, "probability", argv[idx_number]->arg,
+ return bgp_route_match_delete (vty, "probability", argv[idx_number]->arg,
RMAP_EVENT_MATCH_DELETED);
}
"IP standard access-list name\n")
{
int idx_acl = 3;
- return bgp_route_match_add (vty, vty->index, "ip route-source", argv[idx_acl]->arg,
+ return bgp_route_match_add (vty, "ip route-source", argv[idx_acl]->arg,
RMAP_EVENT_FILTER_ADDED);
}
{
int idx_number = 4;
if (argc <= idx_number)
- return bgp_route_match_delete (vty, vty->index, "ip route-source",
+ return bgp_route_match_delete (vty, "ip route-source",
NULL, RMAP_EVENT_FILTER_DELETED);
- return bgp_route_match_delete (vty, vty->index, "ip route-source",
+ return bgp_route_match_delete (vty, "ip route-source",
argv[idx_number]->arg, RMAP_EVENT_FILTER_DELETED);
}
"IP prefix-list name\n")
{
int idx_word = 4;
- return bgp_route_match_add (vty, vty->index, "ip route-source prefix-list",
+ return bgp_route_match_add (vty, "ip route-source prefix-list",
argv[idx_word]->arg, RMAP_EVENT_PLIST_ADDED);
}
{
int idx_word = 5;
if (argc <= idx_word)
- return bgp_route_match_delete (vty, vty->index, "ip route-source prefix-list",
+ return bgp_route_match_delete (vty, "ip route-source prefix-list",
NULL, RMAP_EVENT_PLIST_DELETED);
- return bgp_route_match_delete (vty, vty->index, "ip route-source prefix-list",
+ return bgp_route_match_delete (vty, "ip route-source prefix-list",
argv[idx_word]->arg, RMAP_EVENT_PLIST_DELETED);
}
"Metric value\n")
{
int idx_number = 2;
- return bgp_route_match_add (vty, vty->index, "local-preference", argv[idx_number]->arg,
+ return bgp_route_match_add (vty, "local-preference", argv[idx_number]->arg,
RMAP_EVENT_MATCH_ADDED);
}
{
int idx_localpref = 3;
if (argc <= idx_localpref)
- return bgp_route_match_delete (vty, vty->index, "local-preference",
+ return bgp_route_match_delete (vty, "local-preference",
NULL, RMAP_EVENT_MATCH_DELETED);
- return bgp_route_match_delete (vty, vty->index, "local-preference",
+ return bgp_route_match_delete (vty, "local-preference",
argv[idx_localpref]->arg,
RMAP_EVENT_MATCH_DELETED);
}
"Community-list name\n")
{
int idx_comm_list = 2;
- return bgp_route_match_add (vty, vty->index, "community", argv[idx_comm_list]->arg,
+ return bgp_route_match_add (vty, "community", argv[idx_comm_list]->arg,
RMAP_EVENT_CLIST_ADDED);
}
sprintf (argstr, "%s exact-match", argv[idx_comm_list]->arg);
- ret = bgp_route_match_add (vty, vty->index, "community", argstr,
+ ret = bgp_route_match_add (vty, "community", argstr,
RMAP_EVENT_CLIST_ADDED);
XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr);
"Community-list name\n"
"Do exact matching of communities\n")
{
- return bgp_route_match_delete (vty, vty->index, "community", NULL,
+ return bgp_route_match_delete (vty, "community", NULL,
RMAP_EVENT_CLIST_DELETED);
}
"Extended community-list name\n")
{
int idx_comm_list = 2;
- return bgp_route_match_add (vty, vty->index, "extcommunity", argv[idx_comm_list]->arg,
+ return bgp_route_match_add (vty, "extcommunity", argv[idx_comm_list]->arg,
RMAP_EVENT_ECLIST_ADDED);
}
"Extended community-list number (expanded)\n"
"Extended community-list name\n")
{
- return bgp_route_match_delete (vty, vty->index, "extcommunity", NULL,
+ return bgp_route_match_delete (vty, "extcommunity", NULL,
RMAP_EVENT_ECLIST_DELETED);
}
"AS path access-list name\n")
{
int idx_word = 2;
- return bgp_route_match_add (vty, vty->index, "as-path", argv[idx_word]->arg,
+ return bgp_route_match_add (vty, "as-path", argv[idx_word]->arg,
RMAP_EVENT_ASLIST_ADDED);
}
"Match BGP AS path list\n"
"AS path access-list name\n")
{
- return bgp_route_match_delete (vty, vty->index, "as-path", NULL,
+ return bgp_route_match_delete (vty, "as-path", NULL,
RMAP_EVENT_ASLIST_DELETED);
}
{
int idx_origin = 2;
if (strncmp (argv[idx_origin]->arg, "igp", 2) == 0)
- return bgp_route_match_add (vty, vty->index, "origin", "igp",
+ return bgp_route_match_add (vty, "origin", "igp",
RMAP_EVENT_MATCH_ADDED);
if (strncmp (argv[idx_origin]->arg, "egp", 1) == 0)
- return bgp_route_match_add (vty, vty->index, "origin", "egp",
+ return bgp_route_match_add (vty, "origin", "egp",
RMAP_EVENT_MATCH_ADDED);
if (strncmp (argv[idx_origin]->arg, "incomplete", 2) == 0)
- return bgp_route_match_add (vty, vty->index, "origin", "incomplete",
+ return bgp_route_match_add (vty, "origin", "incomplete",
RMAP_EVENT_MATCH_ADDED);
return CMD_WARNING;
"local IGP\n"
"unknown heritage\n")
{
- return bgp_route_match_delete (vty, vty->index, "origin", NULL,
+ return bgp_route_match_delete (vty, "origin", NULL,
RMAP_EVENT_MATCH_DELETED);
}
"Next hop address\n"
"Use peer address (for BGP only)\n")
{
- return generic_set_add (vty, vty->index, "ip next-hop", "peer-address");
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "ip next-hop", "peer-address");
}
DEFUN (set_ip_nexthop_unchanged,
"Next hop address\n"
"Don't modify existing Next hop address\n")
{
- return generic_set_add (vty, vty->index, "ip next-hop", "unchanged");
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "ip next-hop", "unchanged");
}
"Preference value\n")
{
int idx_number = 2;
- return generic_set_add (vty, vty->index, "local-preference", argv[idx_number]->arg);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "local-preference", argv[idx_number]->arg);
}
{
int idx_localpref = 3;
if (argc <= idx_localpref)
- return generic_set_delete (vty, vty->index, "local-preference", NULL);
- return generic_set_delete (vty, vty->index, "local-preference", argv[idx_localpref]->arg);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "local-preference", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "local-preference", argv[idx_localpref]->arg);
}
"Weight value\n")
{
int idx_number = 2;
- return generic_set_add (vty, vty->index, "weight", argv[idx_number]->arg);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "weight",
+ argv[idx_number]->arg);
}
{
int idx_weight = 3;
if (argc <= idx_weight)
- return generic_set_delete (vty, vty->index, "weight", NULL);
- return generic_set_delete (vty, vty->index, "weight", argv[idx_weight]->arg);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "weight", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index), "weight",
+ argv[idx_weight]->arg);
}
char *str;
str = argv_concat (argv, argc, idx_asn);
- ret = generic_set_add (vty, vty->index, "as-path prepend", str);
+ ret = generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "as-path prepend", str);
XFREE (MTYPE_TMP, str);
return ret;
char *str;
str = argv_concat (argv, argc, idx_asn);
- ret = generic_set_delete (vty, vty->index, "as-path prepend", str);
+ ret = generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "as-path prepend", str);
XFREE (MTYPE_TMP, str);
return ret;
}
char *str;
str = argv_concat (argv, argc, idx_asn);
- ret = generic_set_add (vty, vty->index, "as-path exclude", str);
+ ret = generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "as-path exclude", str);
XFREE (MTYPE_TMP, str);
return ret;
}
char *str;
str = argv_concat (argv, argc, idx_asn);
- ret = generic_set_delete (vty, vty->index, "as-path exclude", str);
+ ret = generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "as-path exclude", str);
XFREE (MTYPE_TMP, str);
return ret;
}
argstr = XCALLOC (MTYPE_TMP, strlen (str) + strlen (" additive") + 1);
strcpy (argstr, str);
strcpy (argstr + strlen (str), " additive");
- ret = generic_set_add (vty, vty->index, "community", argstr);
+ ret = generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "community", argstr);
XFREE (MTYPE_TMP, argstr);
}
else
- ret = generic_set_add (vty, vty->index, "community", str);
+ ret = generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "community", str);
community_free (com);
"BGP community attribute\n"
"No community attribute\n")
{
- return generic_set_add (vty, vty->index, "community", "none");
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "community",
+ "none");
}
DEFUN (no_set_community,
"BGP community attribute\n"
COMMUNITY_VAL_STR)
{
- return generic_set_delete (vty, vty->index, "community", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "community", NULL);
}
strcpy (str, argv[idx_comm_list]->arg);
strcpy (str + strlen (argv[idx_comm_list]->arg), " delete");
- generic_set_add (vty, vty->index, "comm-list", str);
+ generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "comm-list", str);
XFREE (MTYPE_TMP, str);
return CMD_SUCCESS;
"Community-list name\n"
"Delete matching communities\n")
{
- return generic_set_delete (vty, vty->index, "comm-list", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "comm-list", NULL);
}
char *str;
str = argv_concat (argv, argc, idx_asn_nn);
- ret = generic_set_add (vty, vty->index, "extcommunity rt", str);
+ ret = generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "extcommunity rt", str);
XFREE (MTYPE_TMP, str);
return ret;
"Route Target extended community\n"
"VPN extended community\n")
{
- return generic_set_delete (vty, vty->index, "extcommunity rt", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "extcommunity rt", NULL);
}
char *str;
str = argv_concat (argv, argc, idx_asn_nn);
- ret = generic_set_add (vty, vty->index, "extcommunity soo", str);
+ ret = generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "extcommunity soo", str);
XFREE (MTYPE_TMP, str);
return ret;
}
"Site-of-Origin extended community\n"
"VPN extended community\n")
{
- return generic_set_delete (vty, vty->index, "extcommunity soo", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "extcommunity soo", NULL);
}
{
int idx_origin = 2;
if (strncmp (argv[idx_origin]->arg, "igp", 2) == 0)
- return generic_set_add (vty, vty->index, "origin", "igp");
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin",
+ "igp");
if (strncmp (argv[idx_origin]->arg, "egp", 1) == 0)
- return generic_set_add (vty, vty->index, "origin", "egp");
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin",
+ "egp");
if (strncmp (argv[idx_origin]->arg, "incomplete", 2) == 0)
- return generic_set_add (vty, vty->index, "origin", "incomplete");
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin",
+ "incomplete");
return CMD_WARNING;
}
"local IGP\n"
"unknown heritage\n")
{
- return generic_set_delete (vty, vty->index, "origin", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index), "origin",
+ NULL);
}
SET_STR
"BGP atomic aggregate attribute\n" )
{
- return generic_set_add (vty, vty->index, "atomic-aggregate", NULL);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "atomic-aggregate", NULL);
}
DEFUN (no_set_atomic_aggregate,
SET_STR
"BGP atomic aggregate attribute\n" )
{
- return generic_set_delete (vty, vty->index, "atomic-aggregate", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "atomic-aggregate", NULL);
}
DEFUN (set_aggregator_as,
sprintf (argstr, "%s %s", argv[idx_number]->arg, argv[idx_ipv4]->arg);
- ret = generic_set_add (vty, vty->index, "aggregator as", argstr);
+ ret = generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "aggregator as", argstr);
XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr);
char *argstr;
if (argc <= idx_asn)
- return generic_set_delete (vty, vty->index, "aggregator as", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "aggregator as", NULL);
ret = inet_aton (argv[idx_ip]->arg, &address);
if (ret == 0)
sprintf (argstr, "%s %s", argv[idx_asn]->arg, argv[idx_ip]->arg);
- ret = generic_set_delete (vty, vty->index, "aggregator as", argstr);
+ ret = generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "aggregator as", argstr);
XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr);
"IPv6 address of next hop\n")
{
int idx_ipv6 = 3;
- return bgp_route_match_add (vty, vty->index, "ipv6 next-hop", argv[idx_ipv6]->arg,
+ return bgp_route_match_add (vty, "ipv6 next-hop", argv[idx_ipv6]->arg,
RMAP_EVENT_MATCH_ADDED);
}
"IPv6 address of next hop\n")
{
int idx_ipv6 = 4;
- return bgp_route_match_delete (vty, vty->index, "ipv6 next-hop", argv[idx_ipv6]->arg,
+ return bgp_route_match_delete (vty, "ipv6 next-hop", argv[idx_ipv6]->arg,
RMAP_EVENT_MATCH_DELETED);
}
"Next hop address\n"
"Use peer address (for BGP only)\n")
{
- return generic_set_add (vty, vty->index, "ipv6 next-hop peer-address", NULL);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "ipv6 next-hop peer-address", NULL);
}
DEFUN (no_set_ipv6_nexthop_peer,
"IPv6 next-hop address\n"
"Use peer address (for BGP only)\n")
{
- return generic_set_delete (vty, vty->index, "ipv6 next-hop peer-address", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "ipv6 next-hop peer-address", NULL);
}
DEFUN (set_ipv6_nexthop_prefer_global,
"IPv6 next-hop address\n"
"Prefer global over link-local if both exist\n")
{
- return generic_set_add (vty, vty->index, "ipv6 next-hop prefer-global", NULL);;
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "ipv6 next-hop prefer-global", NULL);;
}
DEFUN (no_set_ipv6_nexthop_prefer_global,
"IPv6 next-hop address\n"
"Prefer global over link-local if both exist\n")
{
- return generic_set_delete (vty, vty->index, "ipv6 next-hop prefer-global", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "ipv6 next-hop prefer-global", NULL);
}
DEFUN (set_ipv6_nexthop_global,
return CMD_WARNING;
}
- return generic_set_add (vty, vty->index, "ipv6 next-hop global", argv[idx_ipv6]->arg);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "ipv6 next-hop global", argv[idx_ipv6]->arg);
}
{
int idx_ipv6 = 5;
if (argc <= idx_ipv6)
- return generic_set_delete (vty, vty->index, "ipv6 next-hop global", NULL);
- return generic_set_delete (vty, vty->index, "ipv6 next-hop global", argv[idx_ipv6]->arg);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "ipv6 next-hop global", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "ipv6 next-hop global", argv[idx_ipv6]->arg);
}
#endif /* HAVE_IPV6 */
"IP address of next hop\n")
{
int idx_ipv4 = 3;
- return generic_set_add (vty, vty->index, "vpnv4 next-hop", argv[idx_ipv4]->arg);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "vpnv4 next-hop", argv[idx_ipv4]->arg);
}
{
int idx_ipv4 = 4;
if (argc <= idx_ipv4)
- return generic_set_delete (vty, vty->index, "vpnv4 next-hop", NULL);
- return generic_set_delete (vty, vty->index, "vpnv4 next-hop", argv[idx_ipv4]->arg);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "vpnv4 next-hop", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "vpnv4 next-hop", argv[idx_ipv4]->arg);
}
"IP address of originator\n")
{
int idx_ipv4 = 2;
- return generic_set_add (vty, vty->index, "originator-id", argv[idx_ipv4]->arg);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "originator-id", argv[idx_ipv4]->arg);
}
{
int idx_id = 3;
if (argc < idx_id)
- return generic_set_delete (vty, vty->index, "originator-id", NULL);
- return generic_set_delete (vty, vty->index, "originator-id", argv[idx_id]->arg);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "originator-id", NULL);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "originator-id", argv[idx_id]->arg);
}
static struct peer *
peer_lookup_vty (struct vty *vty, const char *ip_str)
{
+ struct bgp *bgp = VTY_GET_CONTEXT(bgp);
int ret;
- struct bgp *bgp;
union sockunion su;
struct peer *peer;
- bgp = vty->index;
+ if (!bgp) {
+ return NULL;
+ }
ret = str2sockunion (ip_str, &su);
if (ret < 0)
struct peer *
peer_and_group_lookup_vty (struct vty *vty, const char *peer_str)
{
+ struct bgp *bgp = VTY_GET_CONTEXT(bgp);
int ret;
- struct bgp *bgp;
union sockunion su;
struct peer *peer = NULL;
struct peer_group *group = NULL;
- bgp = vty->index;
+ if (!bgp) {
+ return NULL;
+ }
ret = str2sockunion (peer_str, &su);
if (ret == 0)
/* Pending: handle when user tries to change a view to vrf n vv. */
}
- vty->node = BGP_NODE;
- vty->index = bgp;
+ VTY_PUSH_CONTEXT(BGP_NODE, bgp);
return CMD_SUCCESS;
}
"Override configured router identifier\n"
"Manually configured router identifier\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ipv4 = 2;
int ret;
struct in_addr id;
- struct bgp *bgp;
-
- bgp = vty->index;
ret = inet_aton (argv[idx_ipv4]->arg, &id);
if (! ret)
"Override configured router identifier\n"
"Manually configured router identifier\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_router_id = 3;
int ret;
struct in_addr id;
- struct bgp *bgp;
-
- bgp = vty->index;
if (argc > idx_router_id)
{
"Route-Reflector Cluster-id in IP address format\n"
"Route-Reflector Cluster-id as 32 bit quantity\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ipv4 = 2;
int ret;
- struct bgp *bgp;
struct in_addr cluster;
- bgp = vty->index;
-
ret = inet_aton (argv[idx_ipv4]->arg, &cluster);
if (! ret)
{
"Route-Reflector Cluster-id in IP address format\n"
"Route-Reflector Cluster-id as 32 bit quantity\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_cluster_id_unset (bgp);
bgp_clear_star_soft_out (vty, bgp->name);
"AS number\n"
"Set routing domain confederation AS\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
as_t as;
- bgp = vty->index;
-
VTY_GET_INTEGER_RANGE ("AS", as, argv[idx_number]->arg, 1, BGP_AS4_MAX);
bgp_confederation_id_set (bgp, as);
"AS number\n"
"Set routing domain confederation AS\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_confederation_id_unset (bgp);
return CMD_SUCCESS;
"Peer ASs in BGP confederation\n"
AS_STR)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_asn = 3;
- struct bgp *bgp;
as_t as;
int i;
- bgp = vty->index;
-
for (i = idx_asn; i < argc; i++)
{
VTY_GET_INTEGER_RANGE ("AS", as, argv[i]->arg, 1, BGP_AS4_MAX);
"Peer ASs in BGP confederation\n"
AS_STR)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_asn = 4;
- struct bgp *bgp;
as_t as;
int i;
- bgp = vty->index;
-
for (i = idx_asn; i < argc; i++)
{
VTY_GET_INTEGER_RANGE ("AS", as, argv[i]->arg, 1, BGP_AS4_MAX);
bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths,
u_int16_t options, int set)
{
- struct bgp *bgp;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
u_int16_t maxpaths = 0;
int ret;
afi_t afi;
safi_t safi;
- bgp = vty->index;
afi = bgp_node_afi (vty);
safi = bgp_node_safi (vty);
"Advertise routes with max-med\n"
"Administratively applied, for an indefinite period\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp->v_maxmed_admin = 1;
bgp->maxmed_admin_value = BGP_MAXMED_VALUE_DEFAULT;
"Administratively applied, for an indefinite period\n"
"Max MED value to be used\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
-
- bgp = vty->index;
bgp->v_maxmed_admin = 1;
VTY_GET_INTEGER ("max-med admin med-value", bgp->maxmed_admin_value, argv[idx_number]->arg);
"Administratively applied, for an indefinite period\n"
"Max MED value to be used\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp->v_maxmed_admin = BGP_MAXMED_ADMIN_UNCONFIGURED;
bgp->maxmed_admin_value = BGP_MAXMED_VALUE_DEFAULT;
bgp_maxmed_update(bgp);
"Effective on a startup\n"
"Time (seconds) period for max-med\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
-
- bgp = vty->index;
VTY_GET_INTEGER ("max-med on-startup period", bgp->v_maxmed_onstartup, argv[idx_number]->arg);
bgp->maxmed_onstartup_value = BGP_MAXMED_VALUE_DEFAULT;
bgp_maxmed_update(bgp);
"Time (seconds) period for max-med\n"
"Max MED value to be used\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
int idx_number_2 = 4;
- struct bgp *bgp;
-
- bgp = vty->index;
VTY_GET_INTEGER ("max-med on-startup period", bgp->v_maxmed_onstartup, argv[idx_number]->arg);
VTY_GET_INTEGER ("max-med on-startup med-value", bgp->maxmed_onstartup_value, argv[idx_number_2]->arg);
bgp_maxmed_update(bgp);
"Time (seconds) period for max-med\n"
"Max MED value to be used\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
/* Cancel max-med onstartup if its on */
if (bgp->t_maxmed_onstartup)
bgp_update_delay_config_vty (struct vty *vty, const char *delay,
const char *wait)
{
- struct bgp *bgp;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
u_int16_t update_delay;
u_int16_t establish_wait;
-
- bgp = vty->index;
-
VTY_GET_INTEGER_RANGE ("update-delay", update_delay, delay,
BGP_UPDATE_DELAY_MIN, BGP_UPDATE_DELAY_MAX);
static int
bgp_update_delay_deconfig_vty (struct vty *vty)
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp->v_update_delay = BGP_UPDATE_DELAY_DEF;
bgp->v_establish_wait = bgp->v_update_delay;
static int
bgp_wpkt_quanta_config_vty (struct vty *vty, const char *num, char set)
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (set)
VTY_GET_INTEGER_RANGE ("write-quanta", bgp->wpkt_quanta, num,
static int
bgp_coalesce_config_vty (struct vty *vty, const char *num, char set)
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (set)
VTY_GET_INTEGER_RANGE ("coalesce-time", bgp->coalesce_time, num,
"Keepalive interval\n"
"Holdtime\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 2;
int idx_number_2 = 3;
- struct bgp *bgp;
unsigned long keepalive = 0;
unsigned long holdtime = 0;
- bgp = vty->index;
-
VTY_GET_INTEGER ("keepalive", keepalive, argv[idx_number]->arg);
VTY_GET_INTEGER ("holdtime", holdtime, argv[idx_number_2]->arg);
"Keepalive interval\n"
"Holdtime\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_timers_unset (bgp);
return CMD_SUCCESS;
"Configure client to client route reflection\n"
"reflection of routes allowed\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT);
bgp_clear_star_soft_out (vty, bgp->name);
"Configure client to client route reflection\n"
"reflection of routes allowed\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_NO_CLIENT_TO_CLIENT);
bgp_clear_star_soft_out (vty, bgp->name);
"BGP specific commands\n"
"Allow comparing MED from different neighbors\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_ALWAYS_COMPARE_MED);
bgp_recalculate_all_bestpaths (bgp);
"BGP specific commands\n"
"Allow comparing MED from different neighbors\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_ALWAYS_COMPARE_MED);
bgp_recalculate_all_bestpaths (bgp);
"BGP specific commands\n"
"Pick the best-MED path among paths advertised from the neighboring AS\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED))
{
"BGP specific commands\n"
"Pick the best-MED path among paths advertised from the neighboring AS\n")
{
- struct bgp *bgp;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int bestpath_per_as_used;
afi_t afi;
safi_t safi;
struct peer *peer;
struct listnode *node, *nnode;
- bgp = vty->index;
-
if (bgp_flag_check(bgp, BGP_FLAG_DETERMINISTIC_MED))
{
bestpath_per_as_used = 0;
"BGP specific commands\n"
"Graceful restart capability parameters\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_GRACEFUL_RESTART);
return CMD_SUCCESS;
}
"BGP specific commands\n"
"Graceful restart capability parameters\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_GRACEFUL_RESTART);
return CMD_SUCCESS;
}
"Set the max time to hold onto restarting peer's stale paths\n"
"Delay value (seconds)\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
u_int32_t stalepath;
- bgp = vty->index;
if (! bgp)
return CMD_WARNING;
"Set the time to wait to delete stale routes before a BGP open message is received\n"
"Delay value (seconds)\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
u_int32_t restart;
- bgp = vty->index;
if (! bgp)
return CMD_WARNING;
"Set the max time to hold onto restarting peer's stale paths\n"
"Delay value (seconds)\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (! bgp)
return CMD_WARNING;
"Set the time to wait to delete stale routes before a BGP open message is received\n"
"Delay value (seconds)\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (! bgp)
return CMD_WARNING;
BGP_STR
"Immediately reset session if a link to a directly connected external peer goes down\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER);
return CMD_SUCCESS;
}
BGP_STR
"Immediately reset session if a link to a directly connected external peer goes down\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_NO_FAST_EXT_FAILOVER);
return CMD_SUCCESS;
}
BGP_STR
"Enforce the first AS for EBGP routes\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_ENFORCE_FIRST_AS);
bgp_clear_star_soft_in (vty, bgp->name);
BGP_STR
"Enforce the first AS for EBGP routes\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_ENFORCE_FIRST_AS);
bgp_clear_star_soft_in (vty, bgp->name);
"Change the default bestpath selection\n"
"Compare router-id for identical EBGP paths\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_COMPARE_ROUTER_ID);
bgp_recalculate_all_bestpaths (bgp);
"Change the default bestpath selection\n"
"Compare router-id for identical EBGP paths\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_COMPARE_ROUTER_ID);
bgp_recalculate_all_bestpaths (bgp);
"AS-path attribute\n"
"Ignore as-path length in selecting a route\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_ASPATH_IGNORE);
bgp_recalculate_all_bestpaths (bgp);
"AS-path attribute\n"
"Ignore as-path length in selecting a route\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_ASPATH_IGNORE);
bgp_recalculate_all_bestpaths (bgp);
"AS-path attribute\n"
"Compare path lengths including confederation sets & sequences in selecting a route\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_ASPATH_CONFED);
bgp_recalculate_all_bestpaths (bgp);
"AS-path attribute\n"
"Compare path lengths including confederation sets & sequences in selecting a route\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_ASPATH_CONFED);
bgp_recalculate_all_bestpaths (bgp);
"Generate an AS_SET\n"
"Do not generate an AS_SET\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx = 0;
- struct bgp *bgp;
-
- bgp = vty->index;
bgp_flag_set (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
/* no-as-set is now the default behavior so we can silently
"Generate an AS_SET\n"
"Do not generate an AS_SET\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_ASPATH_MULTIPATH_RELAX);
bgp_flag_unset (bgp, BGP_FLAG_MULTIPATH_RELAX_AS_SET);
bgp_recalculate_all_bestpaths (bgp);
"BGP specific commands\n"
"Log neighbor up/down and reset reason\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES);
return CMD_SUCCESS;
}
"BGP specific commands\n"
"Log neighbor up/down and reset reason\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_LOG_NEIGHBOR_CHANGES);
return CMD_SUCCESS;
}
"Treat missing MED as the least preferred one\n"
"Compare MED among confederation paths\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx = 0;
if (argv_find (argv, argc, "confed", &idx))
"Treat missing MED as the least preferred one\n"
"Compare MED among confederation paths\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx = 0;
if (argv_find (argv, argc, "confed", &idx))
"Configure BGP defaults\n"
"Activate ipv4-unicast for a peer by default\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_NO_DEFAULT_IPV4);
return CMD_SUCCESS;
}
"Configure BGP defaults\n"
"Activate ipv4-unicast for a peer by default\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_NO_DEFAULT_IPV4);
return CMD_SUCCESS;
}
"Configure BGP defaults\n"
"Show hostname in certain command ouputs\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_SHOW_HOSTNAME);
return CMD_SUCCESS;
}
"Configure BGP defaults\n"
"Show hostname in certain command ouputs\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_SHOW_HOSTNAME);
return CMD_SUCCESS;
}
"BGP network command\n"
"Check BGP network route exists in IGP\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK))
{
bgp_flag_set (bgp, BGP_FLAG_IMPORT_CHECK);
"BGP network command\n"
"Check BGP network route exists in IGP\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (bgp_flag_check(bgp, BGP_FLAG_IMPORT_CHECK))
{
bgp_flag_unset (bgp, BGP_FLAG_IMPORT_CHECK);
"local preference (higher=more preferred)\n"
"Configure default local preference value\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
u_int32_t local_pref;
- bgp = vty->index;
-
VTY_GET_INTEGER ("local preference", local_pref, argv[idx_number]->arg);
bgp_default_local_preference_set (bgp, local_pref);
"local preference (higher=more preferred)\n"
"Configure default local preference value\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_default_local_preference_unset (bgp);
bgp_clear_star_soft_in (vty, bgp->name);
"subgroup-pkt-queue-max\n"
"Configure subgroup packet queue max\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
u_int32_t max_size;
- bgp = vty->index;
-
VTY_GET_INTEGER ("subgroup packet queue max", max_size, argv[idx_number]->arg);
bgp_default_subgroup_pkt_queue_max_set (bgp, max_size);
"subgroup-pkt-queue-max\n"
"Configure subgroup packet queue max\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_default_subgroup_pkt_queue_max_unset (bgp);
return CMD_SUCCESS;
}
"Allow modifications made by out route-map\n"
"on ibgp neighbors\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp_flag_check(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY))
{
"Allow modifications made by out route-map\n"
"on ibgp neighbors\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (bgp_flag_check(bgp, BGP_FLAG_RR_ALLOW_OUTBOUND_POLICY))
{
"maximum number of BGP Dynamic Neighbors that can be created\n"
"Configure Dynamic Neighbors listen limit value\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 3;
- struct bgp *bgp;
int listen_limit;
- bgp = vty->index;
-
VTY_GET_INTEGER_RANGE ("listen limit", listen_limit, argv[idx_number]->arg,
BGP_DYNAMIC_NEIGHBORS_LIMIT_MIN,
BGP_DYNAMIC_NEIGHBORS_LIMIT_MAX);
"Configure Dynamic Neighbors listen limit value to default\n"
"Configure Dynamic Neighbors listen limit value\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_listen_limit_unset (bgp);
return CMD_SUCCESS;
}
"Member of the peer-group\n"
"Peer-group name\n")
{
- struct bgp *bgp;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct prefix range;
struct peer_group *group, *existing_group;
afi_t afi;
argv_find (argv, argc, "WORD", &idx);
char *peergroup = argv[idx]->arg;
- bgp = vty->index;
-
/* Convert IP prefix string to struct prefix. */
ret = str2prefix (prefix, &range);
if (! ret)
"Member of the peer-group\n"
"Peer-group name\n")
{
- struct bgp *bgp;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct prefix range;
struct peer_group *group;
afi_t afi;
argv_find (argv, argc, "WORD", &idx);
char *peergroup = argv[idx]->arg;
- bgp = vty->index;
-
// VTY_GET_IPV4_PREFIX ("listen range", range, argv[idx_ipv4_prefixlen]->arg);
/* Convert IP prefix string to struct prefix. */
"BGP specific commands\n"
"Disable checking if nexthop is connected on ebgp sessions\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_set (bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK);
bgp_clear_star_soft_in (vty, bgp->name);
"BGP specific commands\n"
"Disable checking if nexthop is connected on ebgp sessions\n")
{
- struct bgp *bgp;
-
- bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_flag_unset (bgp, BGP_FLAG_DISABLE_NH_CONNECTED_CHK);
bgp_clear_star_soft_in (vty, bgp->name);
peer_remote_as_vty (struct vty *vty, const char *peer_str,
const char *as_str, afi_t afi, safi_t safi)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
- struct bgp *bgp;
as_t as;
int as_type = AS_SPECIFIED;
union sockunion su;
- bgp = vty->index;
-
if (as_str[0] == 'i')
{
as = 0;
safi_t safi, int v6only, const char *peer_group_name,
const char *as_str)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
as_t as = 0;
int as_type = AS_UNSPECIFIED;
- struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
int ret = 0;
union sockunion su;
- bgp = vty->index;
group = peer_group_lookup (bgp, conf_if);
if (group)
"Interface name or neighbor tag\n"
"Configure peer-group\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_word = 1;
- struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
- bgp = vty->index;
peer = peer_lookup_by_conf_if (bgp, argv[idx_word]->arg);
if (peer)
{
"Internal BGP peer\n"
"External BGP peer\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_peer = 2;
int ret;
union sockunion su;
if (ret < 0)
{
/* look up for neighbor by interface name config. */
- peer = peer_lookup_by_conf_if (vty->index, argv[idx_peer]->arg);
+ peer = peer_lookup_by_conf_if (bgp, argv[idx_peer]->arg);
if (peer)
{
/* Request zebra to terminate IPv6 RAs on this interface. */
return CMD_SUCCESS;
}
- group = peer_group_lookup (vty->index, argv[idx_peer]->arg);
+ group = peer_group_lookup (bgp, argv[idx_peer]->arg);
if (group)
peer_group_delete (group);
else
}
else
{
- peer = peer_lookup (vty->index, &su);
+ peer = peer_lookup (bgp, &su);
if (peer)
{
if (peer_dynamic_neighbor (peer))
"Internal BGP peer\n"
"External BGP peer\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_word = 2;
struct peer *peer;
/* look up for neighbor by interface name config. */
- peer = peer_lookup_by_conf_if (vty->index, argv[idx_word]->arg);
+ peer = peer_lookup_by_conf_if (bgp, argv[idx_word]->arg);
if (peer)
{
/* Request zebra to terminate IPv6 RAs on this interface. */
"Neighbor tag\n"
"Configure peer-group\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_word = 2;
struct peer_group *group;
- group = peer_group_lookup (vty->index, argv[idx_word]->arg);
+ group = peer_group_lookup (bgp, argv[idx_word]->arg);
if (group)
peer_group_delete (group);
else
"Internal BGP peer\n"
"External BGP peer\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_word = 2;
struct peer_group *group;
struct peer *peer;
/* look up for neighbor by interface name config. */
- peer = peer_lookup_by_conf_if (vty->index, argv[idx_word]->arg);
+ peer = peer_lookup_by_conf_if (bgp, argv[idx_word]->arg);
if (peer)
{
peer_as_change (peer, 0, AS_SPECIFIED);
return CMD_SUCCESS;
}
- group = peer_group_lookup (vty->index, argv[idx_word]->arg);
+ group = peer_group_lookup (bgp, argv[idx_word]->arg);
if (group)
peer_group_remote_as_delete (group);
else
"Member of the peer-group\n"
"Peer-group name\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_peer = 1;
int idx_word = 3;
int ret;
as_t as;
union sockunion su;
- struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
- bgp = vty->index;
peer = NULL;
ret = str2sockunion (argv[idx_peer]->arg, &su);
"Member of the peer-group\n"
"Peer-group name\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_peer = 2;
int idx_word = 4;
int ret;
- struct bgp *bgp;
struct peer *peer;
struct peer_group *group;
- bgp = vty->index;
-
peer = peer_lookup_vty (vty, argv[idx_peer]->arg);
if (! peer)
return CMD_WARNING;
"Push out prefix-list ORF and do inbound soft reconfig\n"
BGP_SOFT_OUT_STR)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
char *vrf = NULL;
afi_t afi = AFI_IP6;
idx++;
clr_arg = argv[idx]->arg;
- if (! peer_group_lookup (vty->index, clr_arg))
+ if (! peer_group_lookup (bgp, clr_arg))
{
vty_out (vty, "%% No such peer-group%s", VTY_NEWLINE);
return CMD_WARNING;
}
else if (argv_find (argv, argc, "WORD", &idx))
{
- if (peer_lookup_by_conf_if (vty->index, argv[idx]->arg))
+ if (peer_lookup_by_conf_if (bgp, argv[idx]->arg))
{
clr_sort = clear_peer;
clr_arg = argv[idx]->arg;
"Redistribute information from another routing protocol\n"
QUAGGA_IP_REDIST_HELP_STR_BGPD)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int type;
vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
return CMD_WARNING;
}
- bgp_redist_add(vty->index, AFI_IP, type, 0);
- return bgp_redistribute_set (vty->index, AFI_IP, type, 0);
+ bgp_redist_add(bgp, AFI_IP, type, 0);
+ return bgp_redistribute_set (bgp, AFI_IP, type, 0);
}
DEFUN (bgp_redistribute_ipv4_rmap,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_word = 3;
int type;
return CMD_WARNING;
}
- red = bgp_redist_add(vty->index, AFI_IP, type, 0);
+ red = bgp_redist_add(bgp, AFI_IP, type, 0);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- return bgp_redistribute_set (vty->index, AFI_IP, type, 0);
+ return bgp_redistribute_set (bgp, AFI_IP, type, 0);
}
DEFUN (bgp_redistribute_ipv4_metric,
"Metric for redistributed routes\n"
"Default metric\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_number = 3;
int type;
}
VTY_GET_INTEGER ("metric", metric, argv[idx_number]->arg);
- red = bgp_redist_add(vty->index, AFI_IP, type, 0);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP, type, 0);
+ red = bgp_redist_add(bgp, AFI_IP, type, 0);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
+ return bgp_redistribute_set (bgp, AFI_IP, type, 0);
}
DEFUN (bgp_redistribute_ipv4_rmap_metric,
"Metric for redistributed routes\n"
"Default metric\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_word = 3;
int idx_number = 5;
}
VTY_GET_INTEGER ("metric", metric, argv[idx_number]->arg);
- red = bgp_redist_add(vty->index, AFI_IP, type, 0);
+ red = bgp_redist_add(bgp, AFI_IP, type, 0);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP, type, 0);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
+ return bgp_redistribute_set (bgp, AFI_IP, type, 0);
}
DEFUN (bgp_redistribute_ipv4_metric_rmap,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_number = 3;
int idx_word = 5;
}
VTY_GET_INTEGER ("metric", metric, argv[idx_number]->arg);
- red = bgp_redist_add(vty->index, AFI_IP, type, 0);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP, type, metric);
+ red = bgp_redist_add(bgp, AFI_IP, type, 0);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP, type, metric);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- return bgp_redistribute_set (vty->index, AFI_IP, type, 0);
+ return bgp_redistribute_set (bgp, AFI_IP, type, 0);
}
DEFUN (bgp_redistribute_ipv4_ospf,
"Non-main Kernel Routing Table\n"
"Instance ID/Table ID\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ospf_table = 1;
int idx_number = 2;
u_short instance;
else
protocol = ZEBRA_ROUTE_TABLE;
- bgp_redist_add(vty->index, AFI_IP, protocol, instance);
- return bgp_redistribute_set (vty->index, AFI_IP, protocol, instance);
+ bgp_redist_add(bgp, AFI_IP, protocol, instance);
+ return bgp_redistribute_set (bgp, AFI_IP, protocol, instance);
}
DEFUN (bgp_redistribute_ipv4_ospf_rmap,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ospf_table = 1;
int idx_number = 2;
int idx_word = 4;
protocol = ZEBRA_ROUTE_TABLE;
VTY_GET_INTEGER ("Instance ID", instance, argv[idx_number]->arg);
- red = bgp_redist_add(vty->index, AFI_IP, protocol, instance);
+ red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- return bgp_redistribute_set (vty->index, AFI_IP, protocol, instance);
+ return bgp_redistribute_set (bgp, AFI_IP, protocol, instance);
}
DEFUN (bgp_redistribute_ipv4_ospf_metric,
"Metric for redistributed routes\n"
"Default metric\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ospf_table = 1;
int idx_number = 2;
int idx_number_2 = 4;
VTY_GET_INTEGER ("Instance ID", instance, argv[idx_number]->arg);
VTY_GET_INTEGER ("metric", metric, argv[idx_number_2]->arg);
- red = bgp_redist_add(vty->index, AFI_IP, protocol, instance);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP, protocol, metric);
- return bgp_redistribute_set (vty->index, AFI_IP, protocol, instance);
+ red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol, metric);
+ return bgp_redistribute_set (bgp, AFI_IP, protocol, instance);
}
DEFUN (bgp_redistribute_ipv4_ospf_rmap_metric,
"Metric for redistributed routes\n"
"Default metric\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ospf_table = 1;
int idx_number = 2;
int idx_word = 4;
VTY_GET_INTEGER ("Instance ID", instance, argv[idx_number]->arg);
VTY_GET_INTEGER ("metric", metric, argv[idx_number_2]->arg);
- red = bgp_redist_add(vty->index, AFI_IP, protocol, instance);
+ red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP, protocol, metric);
- return bgp_redistribute_set (vty->index, AFI_IP, protocol, instance);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol, metric);
+ return bgp_redistribute_set (bgp, AFI_IP, protocol, instance);
}
DEFUN (bgp_redistribute_ipv4_ospf_metric_rmap,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ospf_table = 1;
int idx_number = 2;
int idx_number_2 = 4;
VTY_GET_INTEGER ("Instance ID", instance, argv[idx_number]->arg);
VTY_GET_INTEGER ("metric", metric, argv[idx_number_2]->arg);
- red = bgp_redist_add(vty->index, AFI_IP, protocol, instance);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP, protocol, metric);
+ red = bgp_redist_add(bgp, AFI_IP, protocol, instance);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP, protocol, metric);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- return bgp_redistribute_set (vty->index, AFI_IP, protocol, instance);
+ return bgp_redistribute_set (bgp, AFI_IP, protocol, instance);
}
DEFUN (no_bgp_redistribute_ipv4_ospf,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_ospf_table = 2;
int idx_number = 3;
u_short instance;
protocol = ZEBRA_ROUTE_TABLE;
VTY_GET_INTEGER ("Instance ID", instance, argv[idx_number]->arg);
- return bgp_redistribute_unset (vty->index, AFI_IP, protocol, instance);
+ return bgp_redistribute_unset (bgp, AFI_IP, protocol, instance);
}
DEFUN (no_bgp_redistribute_ipv4,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 2;
int type;
vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
return CMD_WARNING;
}
- return bgp_redistribute_unset (vty->index, AFI_IP, type, 0);
+ return bgp_redistribute_unset (bgp, AFI_IP, type, 0);
}
#ifdef HAVE_IPV6
"Redistribute information from another routing protocol\n"
QUAGGA_IP6_REDIST_HELP_STR_BGPD)
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int type;
return CMD_WARNING;
}
- bgp_redist_add(vty->index, AFI_IP6, type, 0);
- return bgp_redistribute_set (vty->index, AFI_IP6, type, 0);
+ bgp_redist_add(bgp, AFI_IP6, type, 0);
+ return bgp_redistribute_set (bgp, AFI_IP6, type, 0);
}
DEFUN (bgp_redistribute_ipv6_rmap,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_word = 3;
int type;
return CMD_WARNING;
}
- red = bgp_redist_add(vty->index, AFI_IP6, type, 0);
+ red = bgp_redist_add(bgp, AFI_IP6, type, 0);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- return bgp_redistribute_set (vty->index, AFI_IP6, type, 0);
+ return bgp_redistribute_set (bgp, AFI_IP6, type, 0);
}
DEFUN (bgp_redistribute_ipv6_metric,
"Metric for redistributed routes\n"
"Default metric\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_number = 3;
int type;
}
VTY_GET_INTEGER ("metric", metric, argv[idx_number]->arg);
- red = bgp_redist_add(vty->index, AFI_IP6, type, 0);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP6, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP6, type, 0);
+ red = bgp_redist_add(bgp, AFI_IP6, type, 0);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP6, type, metric);
+ return bgp_redistribute_set (bgp, AFI_IP6, type, 0);
}
DEFUN (bgp_redistribute_ipv6_rmap_metric,
"Metric for redistributed routes\n"
"Default metric\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_word = 3;
int idx_number = 5;
}
VTY_GET_INTEGER ("metric", metric, argv[idx_number]->arg);
- red = bgp_redist_add(vty->index, AFI_IP6, type, 0);
+ red = bgp_redist_add(bgp, AFI_IP6, type, 0);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP6, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP6, type, 0);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP6, type, metric);
+ return bgp_redistribute_set (bgp, AFI_IP6, type, 0);
}
DEFUN (bgp_redistribute_ipv6_metric_rmap,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 1;
int idx_number = 3;
int idx_word = 5;
}
VTY_GET_INTEGER ("metric", metric, argv[idx_number]->arg);
- red = bgp_redist_add(vty->index, AFI_IP6, type, 0);
- bgp_redistribute_metric_set(vty->index, red, AFI_IP6, SAFI_UNICAST, metric);
+ red = bgp_redist_add(bgp, AFI_IP6, type, 0);
+ bgp_redistribute_metric_set(bgp, red, AFI_IP6, SAFI_UNICAST, metric);
bgp_redistribute_rmap_set (red, argv[idx_word]->arg);
- return bgp_redistribute_set (vty->index, AFI_IP6, type, 0);
+ return bgp_redistribute_set (bgp, AFI_IP6, type, 0);
}
DEFUN (no_bgp_redistribute_ipv6,
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_protocol = 2;
int type;
return CMD_WARNING;
}
- return bgp_redistribute_unset (vty->index, AFI_IP6, type, 0);
+ return bgp_redistribute_unset (bgp, AFI_IP6, type, 0);
}
"Via Encapsulation SAFI\n"
"Via Tunnel Encap attribute (in VPN SAFI)\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
"Import filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
"Export filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
"Export+import filters\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int rc;
- struct bgp *bgp = vty->index;
if (!bgp)
{
"Specify default route distinguisher\n"
"Route Distinguisher (<as-number>:<number> | <ip-address>:<number> | auto:vn:<number> )\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
struct prefix_rd prd;
- struct bgp *bgp = vty->index;
if (!bgp)
{
"Fixed value 1-255\n"
"use the low-order octet of the NVE's VN address\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
uint8_t value = 0;
if (!bgp)
NO_STR
"Specify default Local Nve ID value to use in RD for L2 routes\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
"Specify default response lifetime\n"
"Response lifetime in seconds\n" "Infinite response lifetime\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
uint32_t rspint;
- struct bgp *bgp = vty->index;
struct rfapi *h = NULL;
struct listnode *hdnode;
struct rfapi_descriptor *rfd;
"Resolve-NVE mode\n"
"Route Origin Extended Community Local Admin Field\n" "Field value\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
uint32_t localadmin;
char *endptr;
"Based on redistribute nve-group\n"
"Unmodified\n" "Resolve each nexthop to connected NVEs\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
vnc_redist_mode_t newmode;
if (!bgp)
"From Open Shortest Path First (OSPF)\n"
"From Routing Information Protocol (RIP)\n" "From Static routes\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int type = ZEBRA_ROUTE_MAX; /* init to bogus value */
- struct bgp *bgp = vty->index;
afi_t afi;
if (!bgp)
"From Open Shortest Path First (OSPF)\n"
"From Routing Information Protocol (RIP)\n" "From Static routes\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int type;
- struct bgp *bgp = vty->index;
afi_t afi;
if (!bgp)
"From BGP without Zebra, only to configured NVE groups\n"
"From BGP view\n" "BGP view name\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int type;
- struct bgp *bgp = vty->index;
afi_t afi;
if (!bgp)
"Assign a NVE group to routes redistributed from another routing protocol\n"
"NVE group\n" "Group name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
"Redistribute from other protocol\n"
"Assign a NVE group to routes redistributed from another routing protocol\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
"Assign a lifetime to routes redistributed from another routing protocol\n"
"lifetime value (32 bit)\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
"IPv4 routes\n"
"IPv6 routes\n" "Prefix-list for filtering redistributed routes\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
afi_t afi;
struct rfapi_cfg *hc;
uint8_t route_type = 0;
"Prefix-list for filtering redistributed routes\n"
"prefix list name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc;
afi_t afi;
uint8_t route_type = 0;
"Redistribute from BGP without Zebra, only to configured NVE groups\n"
"Route-map for filtering redistributed routes\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc;
uint8_t route_type = 0;
"Redistribute from BGP without Zebra, only to configured NVE groups\n"
"Route-map for filtering exported routes\n" "route map name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc;
uint8_t route_type = 0;
"IPv4 routes\n"
"IPv6 routes\n" "Prefix-list for filtering redistributed routes\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg)
afi_t afi;
"Prefix-list for filtering redistributed routes\n"
"prefix list name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
afi_t afi;
"Disable redistribute filter\n"
"Route-map for filtering redistributed routes\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp)
"Redistribute from BGP directly\n"
"Route-map for filtering exported routes\n" "route map name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp)
"Export routes with NVE connected router next-hops\n"
"Disable export\n" "Export routes with registering NVE as next-hop\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
uint32_t oldmode = 0;
uint32_t newmode = 0;
"NVE group, used in 'group-nve' export mode\n"
"NVE group\n" "Group name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_nve_group_cfg *rfg_new;
if (!bgp)
"NVE group, used in 'group-nve' export mode\n"
"Disable export of VNC routes\n" "NVE group\n" "Group name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct listnode *node, *nnode;
struct rfapi_rfg_name *rfgn;
"IPv6 routes\n"
"Prefix-list for filtering exported routes\n" "prefix list name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
afi_t afi;
"IPv6 routes\n"
"Prefix-list for filtering exported routes\n" "prefix list name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
afi_t afi;
"Export to Zebra (experimental)\n"
"Route-map for filtering exported routes\n" "route map name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp)
"Export to Zebra (experimental)\n"
"Route-map for filtering exported routes\n" "route map name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp)
"IPv6 prefixes\n"
"Prefix-list for filtering exported routes\n" "Prefix list name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc;
afi_t afi;
"IPv6 prefixes\n"
"Prefix-list for filtering exported routes\n" "Prefix list name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc;
afi_t afi;
"Export to Zebra (experimental)\n"
"Route-map for filtering exported routes\n" "Route map name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc;
if (!bgp)
"Filters, used in 'registering-nve' export mode\n"
"Route-map for filtering exported routes\n" "Route map name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc;
if (!bgp)
"vnc nve-group NAME",
VNC_CONFIG_STR "Configure a NVE group\n" "Group name\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_nve_group_cfg *rfg;
- struct bgp *bgp = vty->index;
struct listnode *node, *nnode;
struct rfapi_rfg_name *rfgn;
"Configure a NVE group\n"
"Group name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
"IPv4 prefix\n"
"IPv6 prefix\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct prefix p;
int afi;
struct route_node *rn;
int is_un_prefix = 0;
- struct bgp *bgp = vty->index;
-
if (!bgp)
{
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
"Import filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
- struct bgp *bgp = vty->index;
int rc;
struct listnode *node;
struct rfapi_rfg_name *rfgn;
"Export filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
- struct bgp *bgp = vty->index;
int rc;
if (!bgp)
"Export+import filters\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
- struct bgp *bgp = vty->index;
int rc;
int is_export_bgp = 0;
int is_export_zebra = 0;
"Fixed value 1-255\n"
"use the low-order octet of the NVE's VN address\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
- struct bgp *bgp = vty->index;
if (!bgp)
{
NO_STR
"Specify default Local Nve ID value to use in RD for L2 routes\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
- struct bgp *bgp = vty->index;
if (!bgp)
{
"Specify route distinguisher\n"
"Route Distinguisher (<as-number>:<number> | <ip-address>:<number> | auto:vn:<number> )\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret;
struct prefix_rd prd;
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
- struct bgp *bgp = vty->index;
if (!bgp)
{
"Specify response lifetime\n"
"Response lifetime in seconds\n" "Infinite response lifetime\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
unsigned int rspint;
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
- struct bgp *bgp = vty->index;
struct rfapi_descriptor *rfd;
struct listnode *hdnode;
"vnc l2-group NAME",
VNC_CONFIG_STR "Configure a L2 group\n" "Group name\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_l2_group_cfg *rfg;
- struct bgp *bgp = vty->index;
if (!bgp)
{
"Configure a L2 group\n"
"Group name\n")
{
- struct bgp *bgp = vty->index;
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp)
{
"Specify Logical Network ID associated with group\n"
"value\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
- struct bgp *bgp = vty->index;
if (!bgp)
{
"Specify label values associated with group\n"
"Space separated list of label values <0-1048575>\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
- struct bgp *bgp = vty->index;
struct list *ll;
if (!bgp)
"Specify label values associated with L2 group\n"
"Space separated list of label values <0-1048575>\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
- struct bgp *bgp = vty->index;
struct list *ll;
if (!bgp)
"Import filters\n"
"A route target\n")
{
+ VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
- struct bgp *bgp = vty->index;
int rc = CMD_SUCCESS;
int do_import = 0;
int do_export = 0;
"Match entries of prefix-lists\n"
"IPv6 prefix-list name\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 4;
- int ret = route_map_add_match ((struct route_map_index *) vty->index,
+ int ret = route_map_add_match (route_map_index,
"ipv6 address prefix-list", argv[idx_word]->arg);
return route_map_command_status (vty, ret);
}
"Match entries of prefix-lists\n"
"IPv6 prefix-list name\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 5;
- int ret = route_map_delete_match ((struct route_map_index *) vty->index,
+ int ret = route_map_delete_match (route_map_index,
"ipv6 address prefix-list", argv[idx_word]->arg);
return route_map_command_status (vty, ret);
}
"Match first hop interface of route\n"
"Interface name\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 2;
- return route_map_add_match ((struct route_map_index *) vty->index,
+ return route_map_add_match (route_map_index,
"interface", argv[idx_word]->arg);
}
"Match first hop interface of route\n"
"Interface name\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 3;
int ret;
if (argc == 4)
- ret = route_map_delete_match ((struct route_map_index *) vty->index,
+ ret = route_map_delete_match (route_map_index,
"interface", argv[idx_word]->arg);
else
- ret = route_map_delete_match ((struct route_map_index *) vty->index,
+ ret = route_map_delete_match (route_map_index,
"interface", NULL);
return route_map_command_status (vty, ret);
}
"OSPF6 external type 1 metric\n"
"OSPF6 external type 2 metric\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_external = 2;
- int ret = route_map_add_set ((struct route_map_index *) vty->index,
+ int ret = route_map_add_set (route_map_index,
"metric-type", argv[idx_external]->arg);
return route_map_command_status (vty, ret);
}
"OSPF6 external type 1 metric\n"
"OSPF6 external type 2 metric\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_external = 3;
- int ret = route_map_delete_set ((struct route_map_index *) vty->index,
+ int ret = route_map_delete_set (route_map_index,
"metric-type", argv[idx_external]->arg);
return route_map_command_status (vty, ret);
}
"Forwarding Address\n"
"IPv6 Address\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_ipv6 = 2;
- int ret = route_map_add_set ((struct route_map_index *) vty->index,
+ int ret = route_map_add_set (route_map_index,
"forwarding-address", argv[idx_ipv6]->arg);
return route_map_command_status (vty, ret);
}
"Forwarding Address\n"
"IPv6 Address\n")
{
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_ipv6 = 3;
- int ret = route_map_delete_set ((struct route_map_index *) vty->index,
+ int ret = route_map_delete_set (route_map_index,
"forwarding-address", argv[idx_ipv6]->arg);
return route_map_command_status (vty, ret);
}
"Tag value for routing protocol\n"
"Tag value\n")
{
- int ret = route_map_add_set ((struct route_map_index *) vty->index,
+ VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
+ int ret = route_map_add_set (route_map_index,
"tag", argv[2]->arg);
return route_map_command_status (vty, ret);
}
"Enables BFD support\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Required min receive interval\n"
"Desired min transmit interval\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
int idx_number_2 = 4;
int idx_number_3 = 5;
struct ospf6_interface *oi;
- struct interface *ifp;
u_int32_t rx_val;
u_int32_t tx_val;
u_int8_t dm_val;
int ret;
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Disables BFD support\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"OSPFv3 Interface MTU\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
unsigned int ifmtu, iobuflen;
struct listnode *node, *nnode;
struct ospf6_neighbor *on;
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Interface MTU\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
unsigned int iobuflen;
struct listnode *node, *nnode;
struct ospf6_neighbor *on;
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Outgoing metric of this interface\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
unsigned long int lcost;
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Calculate interface cost from bandwidth\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\n")
{
+ VTY_DECLVAR_CONTEXT(ospf6, o);
int idx_number = 2;
- struct ospf6 *o = vty->index;
struct ospf6_area *oa;
struct ospf6_interface *oi;
struct listnode *i, *j;
"Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\n")
{
- struct ospf6 *o = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, o);
struct ospf6_area *oa;
struct ospf6_interface *oi;
struct listnode *i, *j;
SECONDS_STR
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
SECONDS_STR
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Link state transmit delay\n"
SECONDS_STR)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
SECONDS_STR
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Priority value\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Instance ID value\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *)vty->index;
assert (ifp);
oi = (struct ospf6_interface *)ifp->info;
"Passive interface; no adjacency will be formed on this interface\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
struct listnode *node, *nnode;
struct ospf6_neighbor *on;
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"passive interface: No Adjacency will be formed on this I/F\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Disable MTU mismatch detection on this interface\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Disable MTU mismatch detection on this interface\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Prefix list name\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_word = 4;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Filter prefix using prefix-list\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Specify OSPF6 point-to-point network\n"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_network = 3;
struct ospf6_interface *oi;
- struct interface *ifp;
-
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
"Default to whatever interface type system specifies"
)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi;
- struct interface *ifp;
int type;
- ifp = (struct interface *) vty->index;
assert (ifp);
oi = (struct ospf6_interface *) ifp->info;
unsigned int hold,
unsigned int max)
{
- struct ospf6 *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, ospf);
ospf->spf_delay = delay;
ospf->spf_holdtime = hold;
ospf6 = ospf6_create ();
/* set current ospf point. */
- vty->node = OSPF6_NODE;
- vty->index = ospf6;
+ VTY_PUSH_CONTEXT(OSPF6_NODE, ospf6);
return CMD_SUCCESS;
}
OSPF6_STR)
{
/* return to config node . */
- vty->node = CONFIG_NODE;
- vty->index = NULL;
+ VTY_PUSH_CONTEXT_NULL(CONFIG_NODE);
return CMD_SUCCESS;
}
"Configure OSPF Router-ID\n"
V4NOTATION_STR)
{
+ VTY_DECLVAR_CONTEXT(ospf6, o);
int idx_ipv4 = 1;
int ret;
u_int32_t router_id;
- struct ospf6 *o;
-
- o = (struct ospf6 *) vty->index;
ret = inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id);
if (ret == 0)
"log-adjacency-changes",
"Log changes in adjacency state\n")
{
- struct ospf6 *ospf6 = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, ospf6);
SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
"Log changes in adjacency state\n"
"Log all state changes\n")
{
- struct ospf6 *ospf6 = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, ospf6);
SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
NO_STR
"Log changes in adjacency state\n")
{
- struct ospf6 *ospf6 = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, ospf6);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
"Log changes in adjacency state\n"
"Log all state changes\n")
{
- struct ospf6 *ospf6 = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, ospf6);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
"Minimum delay in receiving new version of a LSA\n"
"Delay in milliseconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf6, ospf);
int idx_number = 3;
unsigned int minarrival;
- struct ospf6 *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Minimum delay in receiving new version of a LSA\n"
"Delay in milliseconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf6, ospf);
int idx_number = 4;
unsigned int minarrival;
- struct ospf6 *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Administrative distance\n"
"OSPF6 Administrative distance\n")
{
- struct ospf6 *o = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, o);
o->distance_all = atoi (argv[1]->arg);
"Administrative distance\n"
"OSPF6 Administrative distance\n")
{
- struct ospf6 *o = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, o);
o->distance_all = 0;
"External routes\n"
"Distance for external routes\n")
{
- struct ospf6 *o = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, o);
char *intra, *inter, *external;
intra = inter = external = NULL;
"External routes\n"
"Distance for external routes\n")
{
- struct ospf6 *o = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, o);
char *intra, *inter, *external;
intra = inter = external = NULL;
"IP source prefix\n"
"Access list name\n")
{
- struct ospf6 *o = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, o);
char *alname = (argc == 4) ? argv[3]->arg : NULL;
ospf6_distance_set (vty, o, argv[1]->arg, argv[2]->arg, alname);
"IP source prefix\n"
"Access list name\n")
{
- struct ospf6 *o = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf6, o);
char *alname = (argc == 5) ? argv[4]->arg : NULL;
ospf6_distance_unset (vty, o, argv[2]->arg, argv[3]->arg, alname);
"OSPF6 area ID in IPv4 address notation\n"
)
{
+ VTY_DECLVAR_CONTEXT(ospf6, o);
int idx_ifname = 1;
int idx_ipv4 = 3;
- struct ospf6 *o;
struct ospf6_area *oa;
struct ospf6_interface *oi;
struct interface *ifp;
u_int32_t area_id;
- o = (struct ospf6 *) vty->index;
-
/* find/create ospf6 interface */
ifp = if_get_by_name (argv[idx_ifname]->arg);
oi = (struct ospf6_interface *) ifp->info;
"OSPF interface commands\n"
"Enables BFD support\n")
{
- struct interface *ifp = (struct interface *) vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf_if_params *params;
struct bfd_info *bfd_info;
"Required min receive interval\n"
"Desired min transmit interval\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
int idx_number_2 = 4;
int idx_number_3 = 5;
- struct interface *ifp = (struct interface *) vty->index;
u_int32_t rx_val;
u_int32_t tx_val;
u_int8_t dm_val;
"Required min receive interval\n"
"Desired min transmit interval\n")
{
- struct interface *ifp = (struct interface *)vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf_if_params *params;
assert (ifp);
"Enable specific OSPF feature\n"
"Opaque LSA\n")
{
- struct ospf *ospf = (struct ospf *) vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"Enable specific OSPF feature\n"
"Opaque LSA\n")
{
- struct ospf *ospf = (struct ospf *) vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
/* Delete rip route map rule. */
static int
-ospf_route_match_delete (struct vty *vty, struct route_map_index *index,
+ospf_route_match_delete (struct vty *vty,
const char *command, const char *arg)
{
+ VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret;
ret = route_map_delete_match (index, command, arg);
}
static int
-ospf_route_match_add (struct vty *vty, struct route_map_index *index,
+ospf_route_match_add (struct vty *vty,
const char *command, const char *arg)
-{
+{
+ VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret;
ret = route_map_add_match (index, command, arg);
"IP access-list name\n")
{
int idx_acl = 3;
- return ospf_route_match_add (vty, vty->index, "ip next-hop", argv[idx_acl]->arg);
+ return ospf_route_match_add (vty, "ip next-hop", argv[idx_acl]->arg);
}
DEFUN (no_match_ip_nexthop,
"IP access-list name\n")
{
char *al = (argc == 5) ? argv[4]->arg : NULL;
- return ospf_route_match_delete (vty, vty->index, "ip next-hop", al);
+ return ospf_route_match_delete (vty, "ip next-hop", al);
}
DEFUN (set_metric_type,
"OSPF[6] external type 2 metric\n")
{
char *ext = argv[2]->text;
- return generic_set_add (vty, vty->index, "metric-type", ext);
+ return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index),
+ "metric-type", ext);
}
DEFUN (no_set_metric_type,
"OSPF[6] external type 2 metric\n")
{
char *ext = (argc == 4) ? argv[3]->text : NULL;
- return generic_set_delete (vty, vty->index, "metric-type", ext);
+ return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
+ "metric-type", ext);
}
/* Route-map init */
MPLS_TE_STR
"Enable the MPLS-TE functionality\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct listnode *node;
struct mpls_te_link *lp;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Stable IP address of the advertising router\n"
"MPLS-TE router address in IPv4 address format\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 2;
struct te_tlv_router_addr *ra = &OspfMplsTE.router_addr;
struct in_addr value;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
return CMD_WARNING;
}
- vty->node = OSPF_NODE;
-
if (argc > 2)
VTY_GET_INTEGER ("Instance", instance, argv[2]->arg);
/* The following logic to set the vty->index is in place to be able
to ignore the commands which dont belong to this instance. */
if (ospf->instance != instance)
- vty->index = NULL;
+ VTY_PUSH_CONTEXT_NULL(OSPF_NODE);
else
{
if (IS_DEBUG_OSPF_EVENT)
"router-id for the OSPF process\n"
"OSPF router-id in IP address format\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 2;
- struct ospf *ospf = vty->index;
struct listnode *node;
struct ospf_area *area;
struct in_addr router_id;
"router-id for the OSPF process\n"
"OSPF router-id in IP address format\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 1;
- struct ospf *ospf = vty->index;
struct listnode *node;
struct ospf_area *area;
struct in_addr router_id;
"router-id for the OSPF process\n"
"OSPF router-id in IP address format\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct listnode *node;
struct ospf_area *area;
"IPv4 address\n"
"Suppress routing updates on interfaces by default\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 2;
struct interface *ifp;
struct in_addr addr = { .s_addr = INADDR_ANY };
int ret;
struct ospf_if_params *params;
struct route_node *rn;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"IPv4 address\n"
"Allow routing updates on interfaces by default\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 3;
struct interface *ifp;
struct in_addr addr = { .s_addr = INADDR_ANY };
struct ospf_if_params *params;
int ret;
struct route_node *rn;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"OSPF area ID in IP address format\n"
"OSPF area ID as a decimal value\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_prefixlen = 1;
int idx_ipv4_number = 3;
- struct ospf *ospf= vty->index;
struct prefix_ipv4 p;
struct in_addr area_id;
int ret, format;
"OSPF area ID in IP address format\n"
"OSPF area ID as a decimal value\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_prefixlen = 2;
int idx_ipv4_number = 4;
- struct ospf *ospf = (struct ospf *) vty->index;
struct prefix_ipv4 p;
struct in_addr area_id;
int ret, format;
"User specified metric for this range\n"
"Advertised metric for this range\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_ipv4_prefixlen = 3;
int idx_cost = 6;
- struct ospf *ospf = vty->index;
struct prefix_ipv4 p;
struct in_addr area_id;
int format;
"User specified metric for this range\n"
"Advertised metric for this range\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_ipv4_prefixlen = 3;
int idx_cost = 5;
- struct ospf *ospf = vty->index;
struct prefix_ipv4 p;
struct in_addr area_id;
int format;
"Area range prefix\n"
"DoNotAdvertise this range\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_ipv4_prefixlen = 3;
- struct ospf *ospf = vty->index;
struct prefix_ipv4 p;
struct in_addr area_id;
int format;
"Advertised metric for this range\n"
"DoNotAdvertise this range\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
int idx_ipv4_prefixlen = 4;
- struct ospf *ospf = vty->index;
struct prefix_ipv4 p;
struct in_addr area_id;
int format;
"Announce area range as another prefix\n"
"Network prefix to be announced instead of range\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_ipv4_prefixlen = 3;
int idx_ipv4_prefixlen_2 = 5;
- struct ospf *ospf = vty->index;
struct prefix_ipv4 p, s;
struct in_addr area_id;
int format;
"Announce area range as another prefix\n"
"Network prefix to be announced instead of range\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
int idx_ipv4_prefixlen = 4;
int idx_ipv4_prefixlen_2 = 6;
- struct ospf *ospf = vty->index;
struct prefix_ipv4 p, s;
struct in_addr area_id;
int format;
"Use MD5 algorithm\n" \
"The OSPF password (key)")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_ipv4 = 3;
- struct ospf *ospf = vty->index;
struct ospf_vl_config_data vl_config;
char auth_key[OSPF_AUTH_SIMPLE_SIZE+1];
char md5_key[OSPF_AUTH_MD5_SIZE+1];
VLINK_HELPSTR_TIME_PARAM
VLINK_HELPSTR_TIME_PARAM)
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct ospf_vl_config_data vl_config;
int ret = 0;
"Use MD5 algorithm\n" \
"The OSPF password (key)")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
int idx_ipv4 = 4;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct ospf_vl_config_data vl_config;
struct ospf_vl_data *vl_data = NULL;
VLINK_HELPSTR_TIME_PARAM
VLINK_HELPSTR_TIME_PARAM)
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct ospf_vl_config_data vl_config;
int ret = 0;
"Enable shortcutting through the area\n"
"Disable shortcutting through the area\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_enable_disable = 3;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int mode;
"Deconfigure enabled shortcutting through the area\n"
"Deconfigure disabled shortcutting through the area\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"OSPF area ID as a decimal value\n"
"Configure OSPF area as stub\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
- struct ospf *ospf = vty->index;
struct in_addr area_id;
int ret, format;
"Configure OSPF area as stub\n"
"Do not inject inter-area routes into stub\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
- struct ospf *ospf = vty->index;
struct in_addr area_id;
int ret, format;
"OSPF area ID as a decimal value\n"
"Configure OSPF area as stub\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
- struct ospf *ospf = vty->index;
struct in_addr area_id;
int format;
"Configure OSPF area as stub\n"
"Do not inject inter-area routes into area\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
- struct ospf *ospf = vty->index;
struct in_addr area_id;
int format;
ospf_area_nssa_cmd_handler (struct vty *vty, int argc, struct cmd_token **argv,
int nosum)
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct in_addr area_id;
int ret, format;
"Configure NSSA-ABR to always translate\n"
"Do not inject inter-area routes into nssa\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
- struct ospf *ospf = vty->index;
struct in_addr area_id;
int format;
"Set the summary-default cost of a NSSA or stub area\n"
"Stub's advertised default summary cost\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_number = 3;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
u_int32_t cost;
"Set the summary-default cost of a NSSA or stub area\n"
"Stub's advertised default summary cost\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
int idx_number = 4;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"Set the filter for networks announced to other areas\n"
"Name of the access-list\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"Unset the filter for networks announced to other areas\n"
"Name of the access-list\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"Set the filter for networks from other areas announced to the specified one\n"
"Name of the access-list\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"Unset the filter for networks announced to other areas\n"
"Name of the access-list\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"Filter networks sent to this area\n"
"Filter networks sent from this area\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
int idx_word = 4;
int idx_in_out = 5;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
struct prefix_list *plist;
"Filter networks sent to this area\n"
"Filter networks sent from this area\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
int idx_word = 5;
int idx_in_out = 6;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"Enable authentication\n"
"Use message-digest authentication\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"OSPF area ID as a decimal value\n"
"Enable authentication\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 1;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"OSPF area ID as a decimal value\n"
"Enable authentication\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4_number = 2;
- struct ospf *ospf = vty->index;
struct ospf_area *area;
struct in_addr area_id;
int format;
"Shortcut ABR\n"
"Standard behavior (RFC2328)\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_vendor = 2;
- struct ospf *ospf = vty->index;
u_char abr_type = OSPF_ABR_UNKNOWN;
if (!ospf)
"Shortcut ABR\n"
"Standard ABR\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_vendor = 3;
- struct ospf *ospf = vty->index;
u_char abr_type = OSPF_ABR_UNKNOWN;
if (!ospf)
"log-adjacency-changes",
"Log changes in adjacency state\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"Log changes in adjacency state\n"
"Log all state changes\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
NO_STR
"Log changes in adjacency state\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"Log changes in adjacency state\n"
"Log all state changes\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"OSPF compatibility list\n"
"compatible with RFC 1583\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"OSPF compatibility list\n"
"compatible with RFC 1583\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
unsigned int hold,
unsigned int max)
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"All LSA types\n"
"Delay (msec) between sending LSAs\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 4;
- struct ospf *ospf = vty->index;
unsigned int interval;
if (!ospf)
"All LSA types\n"
"Delay (msec) between sending LSAs\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
ospf->min_ls_interval = OSPF_MIN_LS_INTERVAL;
return CMD_SUCCESS;
"OSPF minimum arrival interval delay\n"
"Delay (msec) between accepted LSAs\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 3;
- struct ospf *ospf = vty->index;
unsigned int arrival;
if (!ospf)
"OSPF minimum arrival interval delay\n"
"Delay (msec) between accepted LSAs\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"Minimum delay in receiving new version of a LSA\n"
"Delay in milliseconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 3;
unsigned int minarrival;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Minimum delay in receiving new version of a LSA\n"
"Delay in milliseconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
unsigned int minarrival;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Dead Neighbor Polling interval\n"
"Seconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 1;
int idx_pri = 3;
int idx_poll = 5;
- struct ospf *ospf = vty->index;
struct in_addr nbr_addr;
unsigned int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT;
unsigned int interval = OSPF_POLL_INTERVAL_DEFAULT;
"OSPF priority of non-broadcast neighbor\n"
"Priority\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 1;
int idx_poll = 3;
int idx_pri = 5;
- struct ospf *ospf = vty->index;
struct in_addr nbr_addr;
unsigned int priority = OSPF_NEIGHBOR_PRIORITY_DEFAULT;
unsigned int interval = OSPF_POLL_INTERVAL_DEFAULT;
"Dead Neighbor Polling interval\n"
"Seconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 2;
- struct ospf *ospf = vty->index;
struct in_addr nbr_addr;
if (!ospf)
"Neighbor Priority\n"
"Priority\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 2;
- struct ospf *ospf = vty->index;
struct in_addr nbr_addr;
if (!ospf)
"Set refresh timer\n"
"Timer value in seconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 2;
- struct ospf *ospf = vty->index;
unsigned int interval;
if (!ospf)
"Unset refresh timer\n"
"Timer value in seconds\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 3;
- struct ospf *ospf = vty->index;
unsigned int interval;
if (!ospf)
"Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 2;
- struct ospf *ospf = vty->index;
u_int32_t refbw;
struct listnode *node;
struct interface *ifp;
"Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct listnode *node, *nnode;
struct interface *ifp;
"Write multiplier\n"
"Maximum number of interface serviced per write\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number;
- struct ospf *ospf = vty->index;
u_int32_t write_oi_count;
if (!ospf)
"Write multiplier\n"
"Maximum number of interface serviced per write\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"Use message-digest authentication\n"
"Address of interface\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_encryption = 3;
int idx_ipv4 = 4;
- struct interface *ifp;
struct in_addr addr;
int ret;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 5)
"Enable authentication on this interface\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 3;
- struct interface *ifp;
struct in_addr addr;
int ret;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 4)
"Use message-digest authentication\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_encryption = 4;
int idx_ipv4 = 5;
- struct interface *ifp;
struct in_addr addr;
int ret;
struct ospf_if_params *params;
struct route_node *rn;
int auth_type;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 6)
"Enable authentication on this interface\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 4;
- struct interface *ifp;
struct in_addr addr;
int ret;
struct ospf_if_params *params;
struct route_node *rn;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 5)
"The OSPF password (key)\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argv_find (argv, argc, "A.B.C.D", &idx))
"Authentication password (key)\n"
"The OSPF password (key)")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argv_find (argv, argc, "A.B.C.D", &idx))
"The OSPF password (key)\n"
"Address of interface\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct crypt_key *ck;
u_char key_id;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
int idx = 0;
"The OSPF password (key)\n"
"Address of interface\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp;
struct crypt_key *ck;
int key_id;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
argv_find (argv, argc, "(1-255)", &idx);
"Cost\n"
"Address of interface\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
u_int32_t cost;
struct in_addr addr;
struct ospf_if_params *params;
"Interface cost\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
// get arguments
const char *nbr_str,
const char *fast_hello_str)
{
- struct interface *ifp = vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
u_int32_t seconds;
u_char hellomult;
struct in_addr addr;
"Seconds\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = argc - 1;
- struct interface *ifp = vty->index;
struct in_addr addr;
int ret;
struct ospf_if_params *params;
struct ospf_interface *oi;
struct route_node *rn;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argv[idx_ipv4]->type == IPV4_TKN)
"Seconds\n"
"Address of interface\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
struct in_addr addr;
struct ospf_if_params *params;
params = IF_DEF_PARAMS (ifp);
"Seconds\n"
"Address of interface\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
struct in_addr addr;
struct ospf_if_params *params;
params = IF_DEF_PARAMS (ifp);
"Specify OSPF point-to-multipoint network\n"
"Specify OSPF point-to-point network\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
int old_type = IF_DEF_PARAMS (ifp)->type;
struct route_node *rn;
"Specify OSPF point-to-multipoint network\n"
"Specify OSPF point-to-point network\n")
{
- struct interface *ifp = vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int old_type = IF_DEF_PARAMS (ifp)->type;
struct route_node *rn;
"Priority\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
long priority;
struct route_node *rn;
struct in_addr addr;
"Priority\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
struct route_node *rn;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argv_find (argv, argc, "A.B.C.D", &idx))
"Seconds\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
u_int32_t seconds;
struct in_addr addr;
struct ospf_if_params *params;
"Seconds\n"
"Address of interface\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argv_find (argv, argc, "A.B.C.D", &idx))
"Seconds\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
u_int32_t seconds;
struct in_addr addr;
struct ospf_if_params *params;
"Link state transmit delay\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
struct in_addr addr;
struct ospf_if_params *params;
- ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argv_find (argv, argc, "A.B.C.D", &idx))
"OSPF area ID in IP address format\n"
"OSPF area ID as a decimal value\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
int format, ret;
struct in_addr area_id;
struct ospf *ospf;
"OSPF area ID in IP address format\n"
"OSPF area ID as a decimal value\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx = 0;
- struct interface *ifp = vty->index;
struct ospf *ospf;
struct ospf_if_params *params;
u_short instance = 0;
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_protocol = 1;
int idx_redist_param = 2;
- struct ospf *ospf = vty->index;
int source;
int type = -1;
int metric = -1;
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_protocol = 2;
- struct ospf *ospf = vty->index;
int source;
struct ospf_redist *red;
if (!ospf)
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ospf_table = 1;
int idx_number = 2;
int idx_redist_param = 3;
- struct ospf *ospf = vty->index;
int source;
int type = -1;
int metric = -1;
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ospf_table = 2;
int idx_number = 3;
- struct ospf *ospf = vty->index;
u_int instance;
struct ospf_redist *red;
int source;
OUT_STR
QUAGGA_REDIST_HELP_STR_OSPFD)
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_word = 1;
- struct ospf *ospf = vty->index;
int source;
if (!ospf)
OUT_STR
QUAGGA_REDIST_HELP_STR_OSPFD)
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_word = 2;
- struct ospf *ospf = vty->index;
int source;
if (!ospf)
"Route map reference\n"
"Pointer to route-map entries\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_redist_param = 2;
- struct ospf *ospf = vty->index;
int default_originate = DEFAULT_ORIGINATE_ZEBRA;
int type = -1;
int metric = -1;
"Route map reference\n"
"Pointer to route-map entries\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct prefix_ipv4 p;
struct ospf_external *ext;
struct ospf_redist *red;
"Set metric of redistributed routes\n"
"Default metric\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 1;
- struct ospf *ospf = vty->index;
int metric = -1;
if (!ospf)
"Set metric of redistributed routes\n"
"Default metric\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"Define an administrative distance\n"
"OSPF Administrative distance\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 1;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Define an administrative distance\n"
"OSPF Administrative distance\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
"External routes\n"
"Distance for external routes\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_area_distance = 3;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"External routes\n"
"Distance for external routes\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_area_distance = 2;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Distance value\n"
"IP source prefix\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 1;
int idx_ipv4_prefixlen = 2;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Distance value\n"
"IP source prefix\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 2;
int idx_ipv4_prefixlen = 3;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"IP source prefix\n"
"Access list name\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 1;
int idx_ipv4_prefixlen = 2;
int idx_word = 3;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"IP source prefix\n"
"Access list name\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 2;
int idx_ipv4_prefixlen = 3;
int idx_word = 4;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Disable MTU mismatch detection on this interface\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 3;
- struct interface *ifp = vty->index;
struct in_addr addr;
int ret;
"Disable MTU mismatch detection on this interface\n"
"Address of interface")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 4;
- struct interface *ifp = vty->index;
struct in_addr addr;
int ret;
"Advertise own Router-LSA with infinite distance (stub router)\n"
"Administratively applied, for an indefinite period\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct listnode *ln;
struct ospf_area *area;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Advertise own Router-LSA with infinite distance (stub router)\n"
"Administratively applied, for an indefinite period\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct listnode *ln;
struct ospf_area *area;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Automatically advertise stub Router-LSA on startup of OSPF\n"
"Time (seconds) to advertise self as stub-router\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 3;
unsigned int seconds;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Automatically advertise stub Router-LSA on startup of OSPF\n"
"Time (seconds) to advertise self as stub-router\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
struct listnode *ln;
struct ospf_area *area;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Advertise stub-router prior to full shutdown of OSPF\n"
"Time (seconds) to wait till full shutdown\n")
{
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_number = 3;
unsigned int seconds;
- struct ospf *ospf = vty->index;
if (!ospf)
return CMD_SUCCESS;
"Advertise stub-router prior to full shutdown of OSPF\n"
"Time (seconds) to wait till full shutdown\n")
{
- struct ospf *ospf = vty->index;
+ VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf)
return CMD_SUCCESS;
IP_STR
IFACE_IGMP_STR)
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
IP_STR
IFACE_IGMP_STR)
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp)
return CMD_SUCCESS;
"Multicast group address\n"
"Source address\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 3;
int idx_ipv4_2 = 4;
- struct interface *ifp;
const char *group_str;
const char *source_str;
struct in_addr group_addr;
struct in_addr source_addr;
int result;
- ifp = vty->index;
-
/* Group address */
group_str = argv[idx_ipv4]->arg;
result = inet_pton(AF_INET, group_str, &group_addr);
"Multicast group address\n"
"Source address\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 4;
int idx_ipv4_2 = 5;
- struct interface *ifp;
const char *group_str;
const char *source_str;
struct in_addr group_addr;
struct in_addr source_addr;
int result;
- ifp = vty->index;
-
/* Group address */
group_str = argv[idx_ipv4]->arg;
result = inet_pton(AF_INET, group_str, &group_addr);
IFACE_IGMP_QUERY_INTERVAL_STR
"Query interval in seconds\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
int query_interval;
int query_interval_dsec;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
IFACE_IGMP_STR
IFACE_IGMP_QUERY_INTERVAL_STR)
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
int default_query_interval_dsec;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp)
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR
"Query response value in seconds\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
int query_max_response_time;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
IFACE_IGMP_STR
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR)
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
int default_query_interval_dsec;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp)
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR
"Query response value in deciseconds\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
int query_max_response_time_dsec;
int default_query_interval_dsec;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
IFACE_IGMP_STR
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR)
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
int default_query_interval_dsec;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp)
"Set the Designated Router Election Priority\n"
"Value of the new DR Priority\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3;
- struct interface *ifp;
struct pim_interface *pim_ifp;
uint32_t old_dr_prio;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
"Revert the Designated Router Priority to default\n"
"Old Value of the Priority\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
PIM_STR
IFACE_PIM_STR)
{
- struct interface *ifp;
-
- ifp = vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SSM)) {
vty_out(vty, "Could not enable PIM SSM on interface%s", VTY_NEWLINE);
PIM_STR
IFACE_PIM_SM_STR)
{
- struct interface *ifp;
-
- ifp = vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SM)) {
vty_out(vty, "Could not enable PIM SM on interface%s", VTY_NEWLINE);
return CMD_WARNING;
PIM_STR
IFACE_PIM_STR)
{
- struct interface *ifp;
-
- ifp = vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
if (!pim_cmd_interface_delete(ifp)) {
vty_out(vty, "Unable to delete interface information%s", VTY_NEWLINE);
return CMD_WARNING;
PIM_STR
IFACE_PIM_SM_STR)
{
- struct interface *ifp;
-
- ifp = vty->index;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
if (!pim_cmd_interface_delete(ifp)) {
vty_out(vty, "Unable to delete interface information%s", VTY_NEWLINE);
return CMD_WARNING;
"Outgoing interface name\n"
"Group address\n")
{
+ VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 2;
int idx_ipv4 = 3;
- struct interface *iif;
struct interface *oif;
const char *oifname;
const char *grp_str;
struct in_addr src_addr;
int result;
- iif = vty->index;
-
oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname);
if (!oif) {
"Group address\n"
"Source address\n")
{
+ VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 2;
int idx_ipv4 = 3;
int idx_ipv4_2 = 4;
- struct interface *iif;
struct interface *oif;
const char *oifname;
const char *grp_str;
struct in_addr src_addr;
int result;
- iif = vty->index;
-
oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname);
if (!oif) {
"Outgoing interface name\n"
"Group Address\n")
{
+ VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 3;
int idx_ipv4 = 4;
- struct interface *iif;
struct interface *oif;
const char *oifname;
const char *grp_str;
struct in_addr src_addr;
int result;
- iif = vty->index;
-
oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname);
if (!oif) {
"Group Address\n"
"Source Address\n")
{
+ VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 3;
int idx_ipv4 = 4;
int idx_ipv4_2 = 5;
- struct interface *iif;
struct interface *oif;
const char *oifname;
const char *grp_str;
struct in_addr src_addr;
int result;
- iif = vty->index;
-
oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname);
if (!oif) {
IFACE_PIM_HELLO_TIME_STR
IFACE_PIM_HELLO_HOLD_STR)
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_time = 3;
int idx_hold = 4;
- struct interface *ifp;
struct pim_interface *pim_ifp;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
IFACE_PIM_HELLO_TIME_STR
IFACE_PIM_HELLO_HOLD_STR)
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp;
- ifp = vty->index;
pim_ifp = ifp->info;
if (!pim_ifp) {
"RIP version 2\n"
"None\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_type = 4;
- struct interface *ifp;
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
switch (argv[idx_type]->arg[0])
"RIP version 1\n"
"RIP version 2\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
/* Version 1 and 2. */
"RIP version 2\n"
"RIP version 1\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
/* Version 1 and 2. */
"Version 1\n"
"Version 2\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
ri->ri_receive = RI_RIP_UNSPEC;
"RIP version 1\n"
"RIP version 2\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_type = 4;
- struct interface *ifp;
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
/* Version 1. */
"RIP version 1\n"
"RIP version 2\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
/* Version 1 and 2. */
"RIP version 2\n"
"RIP version 1\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
/* Version 1 and 2. */
"Version 1\n"
"Version 2\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
ri->ri_send = RI_RIP_UNSPEC;
"Routing Information Protocol\n"
"Send ip broadcast v2 update\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
ri->v2_broadcast = 1;
"Routing Information Protocol\n"
"Send ip broadcast v2 update\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
ri->v2_broadcast = 0;
"RFC compatible\n"
"Old ripd compatible\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
char *cryptmode = argv[4]->text;
char *authlen = (argc > 5) ? argv[6]->text : NULL;
- struct interface *ifp;
struct rip_interface *ri;
int auth_type;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
if (strmatch ("md5", cryptmode))
"RFC compatible\n"
"Old ripd compatible\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
ri->auth_type = RIP_NO_AUTH;
"Authentication string\n"
"Authentication string\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_line = 4;
- struct interface *ifp;
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
if (strlen (argv[idx_line]->arg) > 16)
"Authentication string\n"
"Authentication string\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *)vty->index;
ri = ifp->info;
if (ri->auth_str)
"Authentication key-chain\n"
"name of key-chain\n")
{
+ VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_line = 4;
- struct interface *ifp;
struct rip_interface *ri;
- ifp = (struct interface *) vty->index;
ri = ifp->info;
if (ri->auth_str)
"Authentication key-chain\n"
"name of key-chain\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = (struct interface *) vty->index;
ri = ifp->info;
if (ri->key_chain)
"Routing Information Protocol\n"
"Perform split horizon\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = vty->index;
ri = ifp->info;
ri->split_horizon = RIP_SPLIT_HORIZON;
"Perform split horizon\n"
"With poisoned-reverse\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = vty->index;
ri = ifp->info;
ri->split_horizon = RIP_SPLIT_HORIZON_POISONED_REVERSE;
"Routing Information Protocol\n"
"Perform split horizon\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = vty->index;
ri = ifp->info;
ri->split_horizon = RIP_NO_SPLIT_HORIZON;
"Perform split horizon\n"
"With poisoned-reverse\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri;
- ifp = vty->index;
ri = ifp->info;
switch( ri->split_horizon )
return CMD_WARNING;
}
}
- vty->node = RIP_NODE;
- vty->index = rip;
+ VTY_PUSH_CONTEXT(RIP_NODE, rip);
return CMD_SUCCESS;
}
"Routing Information Protocol\n"
"Perform split horizon\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ripng_interface *ri;
- ifp = vty->index;
ri = ifp->info;
ri->split_horizon = RIPNG_SPLIT_HORIZON;
"Perform split horizon\n"
"With poisoned-reverse\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ripng_interface *ri;
- ifp = vty->index;
ri = ifp->info;
ri->split_horizon = RIPNG_SPLIT_HORIZON_POISONED_REVERSE;
"Perform split horizon\n"
"With poisoned-reverse\n")
{
- struct interface *ifp;
+ VTY_DECLVAR_CONTEXT(interface, ifp);
struct ripng_interface *ri;
- ifp = vty->index;
ri = ifp->info;
ri->split_horizon = RIPNG_NO_SPLIT_HORIZON;