*: coccinelle-replace vty->index

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2016-12-07 17:15:32 +01:00 committed by David Lamparter
parent 3c5070bec0
commit cdc2d76507
19 changed files with 602 additions and 775 deletions

View file

@ -182,12 +182,14 @@ const char *bgp_origin_long_str[] = {"IGP","EGP","incomplete"};
static struct peer * static struct peer *
bgp_find_peer (struct vty *vty, const char *peer_str) bgp_find_peer (struct vty *vty, const char *peer_str)
{ {
struct bgp *bgp = VTY_GET_CONTEXT(bgp);
int ret; int ret;
union sockunion su; union sockunion su;
struct bgp *bgp;
struct peer *peer; struct peer *peer;
bgp = vty->index; if (!bgp) {
return NULL;
}
ret = str2sockunion (peer_str, &su); ret = str2sockunion (peer_str, &su);
/* 'swpX' string */ /* 'swpX' string */
@ -1380,11 +1382,12 @@ DEFUN (no_debug_bgp_update,
BGP_STR BGP_STR
"BGP updates\n") "BGP updates\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_debug_list_free(bgp_debug_update_in_peers); 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_out_peers);
bgp_debug_list_free(bgp_debug_update_prefixes); 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) if (vty->node == CONFIG_NODE)
{ {
@ -1615,6 +1618,7 @@ DEFUN (no_debug_bgp,
DEBUG_STR DEBUG_STR
BGP_STR) BGP_STR)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp_debug_list_free(bgp_debug_neighbor_events_peers); bgp_debug_list_free(bgp_debug_neighbor_events_peers);
bgp_debug_list_free(bgp_debug_keepalive_peers); bgp_debug_list_free(bgp_debug_keepalive_peers);
bgp_debug_list_free(bgp_debug_update_in_peers); bgp_debug_list_free(bgp_debug_update_in_peers);
@ -1623,7 +1627,7 @@ DEFUN (no_debug_bgp,
bgp_debug_list_free(bgp_debug_bestpath_prefixes); bgp_debug_list_free(bgp_debug_bestpath_prefixes);
bgp_debug_list_free(bgp_debug_zebra_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 (keepalive, KEEPALIVE);
TERM_DEBUG_OFF (update, UPDATE_IN); TERM_DEBUG_OFF (update, UPDATE_IN);

View file

@ -3991,9 +3991,10 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
/* Configure static BGP network. When user don't run zebra, static /* Configure static BGP network. When user don't run zebra, static
route should be installed as valid. */ route should be installed as valid. */
static int 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) afi_t afi, safi_t safi, const char *rmap, int backdoor)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct prefix p; struct prefix p;
struct bgp_static *bgp_static; struct bgp_static *bgp_static;
@ -4080,9 +4081,10 @@ bgp_static_set (struct vty *vty, struct bgp *bgp, const char *ip_str,
/* Configure static BGP network. */ /* Configure static BGP network. */
static int 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) afi_t afi, safi_t safi)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct prefix p; struct prefix p;
struct bgp_static *bgp_static; struct bgp_static *bgp_static;
@ -4278,18 +4280,16 @@ bgp_static_set_safi (safi_t safi, struct vty *vty, const char *ip_str,
const char *rd_str, const char *tag_str, const char *rd_str, const char *tag_str,
const char *rmap_str) const char *rmap_str)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct prefix p; struct prefix p;
struct prefix_rd prd; struct prefix_rd prd;
struct bgp *bgp;
struct bgp_node *prn; struct bgp_node *prn;
struct bgp_node *rn; struct bgp_node *rn;
struct bgp_table *table; struct bgp_table *table;
struct bgp_static *bgp_static; struct bgp_static *bgp_static;
u_char tag[3]; u_char tag[3];
bgp = vty->index;
ret = str2prefix (ip_str, &p); ret = str2prefix (ip_str, &p);
if (! ret) if (! ret)
{ {
@ -4359,8 +4359,8 @@ int
bgp_static_unset_safi(safi_t safi, struct vty *vty, const char *ip_str, bgp_static_unset_safi(safi_t safi, struct vty *vty, const char *ip_str,
const char *rd_str, const char *tag_str) const char *rd_str, const char *tag_str)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct bgp *bgp;
struct prefix p; struct prefix p;
struct prefix_rd prd; struct prefix_rd prd;
struct bgp_node *prn; struct bgp_node *prn;
@ -4369,8 +4369,6 @@ bgp_static_unset_safi(safi_t safi, struct vty *vty, const char *ip_str,
struct bgp_static *bgp_static; struct bgp_static *bgp_static;
u_char tag[3]; u_char tag[3];
bgp = vty->index;
/* Convert IP prefix string to struct prefix. */ /* Convert IP prefix string to struct prefix. */
ret = str2prefix (ip_str, &p); ret = str2prefix (ip_str, &p);
if (! ret) if (! ret)
@ -4421,9 +4419,10 @@ bgp_static_unset_safi(safi_t safi, struct vty *vty, const char *ip_str,
} }
static int 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) const char *rmap_name)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
struct bgp_rmap *rmap; struct bgp_rmap *rmap;
rmap = &bgp->table_map[afi][safi]; rmap = &bgp->table_map[afi][safi];
@ -4448,9 +4447,10 @@ bgp_table_map_set (struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
} }
static int 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) const char *rmap_name)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
struct bgp_rmap *rmap; struct bgp_rmap *rmap;
rmap = &bgp->table_map[afi][safi]; rmap = &bgp->table_map[afi][safi];
@ -4486,7 +4486,7 @@ DEFUN (bgp_table_map,
"Name of the route map\n") "Name of the route map\n")
{ {
int idx_word = 1; 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); bgp_node_afi (vty), bgp_node_safi (vty), argv[idx_word]->arg);
} }
DEFUN (no_bgp_table_map, DEFUN (no_bgp_table_map,
@ -4497,7 +4497,7 @@ DEFUN (no_bgp_table_map,
"Name of the route map\n") "Name of the route map\n")
{ {
int idx_word = 2; 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); bgp_node_afi (vty), bgp_node_safi (vty), argv[idx_word]->arg);
} }
@ -4508,7 +4508,7 @@ DEFUN (bgp_network,
"IPv4 prefix\n") "IPv4 prefix\n")
{ {
int idx_ipv4_prefixlen = 1; 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); AFI_IP, bgp_node_safi (vty), NULL, 0);
} }
@ -4522,7 +4522,7 @@ DEFUN (bgp_network_route_map,
{ {
int idx_ipv4_prefixlen = 1; int idx_ipv4_prefixlen = 1;
int idx_word = 3; 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); AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
} }
@ -4534,7 +4534,7 @@ DEFUN (bgp_network_backdoor,
"Specify a BGP backdoor route\n") "Specify a BGP backdoor route\n")
{ {
int idx_ipv4_prefixlen = 1; 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); NULL, 1);
} }
@ -4558,7 +4558,7 @@ DEFUN (bgp_network_mask,
return CMD_WARNING; 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); AFI_IP, bgp_node_safi (vty), NULL, 0);
} }
@ -4585,7 +4585,7 @@ DEFUN (bgp_network_mask_route_map,
return CMD_WARNING; 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); AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
} }
@ -4610,7 +4610,7 @@ DEFUN (bgp_network_mask_backdoor,
return CMD_WARNING; 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); NULL, 1);
} }
@ -4631,7 +4631,7 @@ DEFUN (bgp_network_mask_natural,
return CMD_WARNING; 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); AFI_IP, bgp_node_safi (vty), NULL, 0);
} }
@ -4655,7 +4655,7 @@ DEFUN (bgp_network_mask_natural_route_map,
return CMD_WARNING; 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); AFI_IP, bgp_node_safi (vty), argv[idx_word]->arg, 0);
} }
@ -4677,7 +4677,7 @@ DEFUN (bgp_network_mask_natural_backdoor,
return CMD_WARNING; 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); NULL, 1);
} }
@ -4692,7 +4692,7 @@ DEFUN (no_bgp_network,
"Name of the route map\n") "Name of the route map\n")
{ {
int idx_ipv4_prefixlen = 2; 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)); bgp_node_safi (vty));
} }
@ -4720,7 +4720,7 @@ DEFUN (no_bgp_network_mask,
return CMD_WARNING; 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)); bgp_node_safi (vty));
} }
@ -4745,7 +4745,7 @@ DEFUN (no_bgp_network_mask_natural,
return CMD_WARNING; 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)); bgp_node_safi (vty));
} }
@ -4756,7 +4756,7 @@ DEFUN (ipv6_bgp_network,
"IPv6 prefix\n") "IPv6 prefix\n")
{ {
int idx_ipv6_prefixlen = 1; 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); NULL, 0);
} }
@ -4770,7 +4770,7 @@ DEFUN (ipv6_bgp_network_route_map,
{ {
int idx_ipv6_prefixlen = 1; int idx_ipv6_prefixlen = 1;
int idx_word = 3; 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); bgp_node_safi (vty), argv[idx_word]->arg, 0);
} }
@ -4784,7 +4784,7 @@ DEFUN (no_ipv6_bgp_network,
"Name of the route map\n") "Name of the route map\n")
{ {
int idx_ipv6_prefixlen = 2; 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: /* Aggreagete address:
@ -5291,10 +5291,10 @@ static int
bgp_aggregate_unset (struct vty *vty, const char *prefix_str, bgp_aggregate_unset (struct vty *vty, const char *prefix_str,
afi_t afi, safi_t safi) afi_t afi, safi_t safi)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct prefix p; struct prefix p;
struct bgp_node *rn; struct bgp_node *rn;
struct bgp *bgp;
struct bgp_aggregate *aggregate; struct bgp_aggregate *aggregate;
/* Convert string to prefix structure. */ /* Convert string to prefix structure. */
@ -5306,9 +5306,6 @@ bgp_aggregate_unset (struct vty *vty, const char *prefix_str,
} }
apply_mask (&p); apply_mask (&p);
/* Get BGP structure. */
bgp = vty->index;
/* Old configuration check. */ /* Old configuration check. */
rn = bgp_node_lookup (bgp->aggregate[afi][safi], &p); rn = bgp_node_lookup (bgp->aggregate[afi][safi], &p);
if (! rn) if (! rn)
@ -5338,10 +5335,10 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str,
afi_t afi, safi_t safi, afi_t afi, safi_t safi,
u_char summary_only, u_char as_set) u_char summary_only, u_char as_set)
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct prefix p; struct prefix p;
struct bgp_node *rn; struct bgp_node *rn;
struct bgp *bgp;
struct bgp_aggregate *aggregate; struct bgp_aggregate *aggregate;
/* Convert string to prefix structure. */ /* Convert string to prefix structure. */
@ -5353,9 +5350,6 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str,
} }
apply_mask (&p); apply_mask (&p);
/* Get BGP structure. */
bgp = vty->index;
/* Old configuration check. */ /* Old configuration check. */
rn = bgp_node_get (bgp->aggregate[afi][safi], &p); rn = bgp_node_get (bgp->aggregate[afi][safi], &p);
@ -9940,14 +9934,13 @@ DEFUN (bgp_distance,
"Distance for routes internal to the AS\n" "Distance for routes internal to the AS\n"
"Distance for local routes\n") "Distance for local routes\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_number = 2; int idx_number = 2;
int idx_number_2 = 3; int idx_number_2 = 3;
int idx_number_3 = 4; int idx_number_3 = 4;
struct bgp *bgp;
afi_t afi; afi_t afi;
safi_t safi; safi_t safi;
bgp = vty->index;
afi = bgp_node_afi (vty); afi = bgp_node_afi (vty);
safi = bgp_node_safi (vty); safi = bgp_node_safi (vty);
@ -9967,11 +9960,10 @@ DEFUN (no_bgp_distance,
"Distance for routes internal to the AS\n" "Distance for routes internal to the AS\n"
"Distance for local routes\n") "Distance for local routes\n")
{ {
struct bgp *bgp; VTY_DECLVAR_CONTEXT(bgp, bgp);
afi_t afi; afi_t afi;
safi_t safi; safi_t safi;
bgp = vty->index;
afi = bgp_node_afi (vty); afi = bgp_node_afi (vty);
safi = bgp_node_safi (vty); safi = bgp_node_safi (vty);
@ -10098,11 +10090,11 @@ DEFUN (bgp_damp_set,
"Value to start suppressing a route\n" "Value to start suppressing a route\n"
"Maximum duration to suppress a stable route\n") "Maximum duration to suppress a stable route\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int idx_half_life = 2; int idx_half_life = 2;
int idx_reuse = 3; int idx_reuse = 3;
int idx_suppress = 4; int idx_suppress = 4;
int idx_max_suppress = 5; int idx_max_suppress = 5;
struct bgp *bgp;
int half = DEFAULT_HALF_LIFE * 60; int half = DEFAULT_HALF_LIFE * 60;
int reuse = DEFAULT_REUSE; int reuse = DEFAULT_REUSE;
int suppress = DEFAULT_SUPPRESS; int suppress = DEFAULT_SUPPRESS;
@ -10121,8 +10113,6 @@ DEFUN (bgp_damp_set,
max = 4 * half; max = 4 * half;
} }
bgp = vty->index;
if (suppress < reuse) if (suppress < reuse)
{ {
vty_out (vty, "Suppress value cannot be less than reuse value %s", vty_out (vty, "Suppress value cannot be less than reuse value %s",
@ -10145,9 +10135,7 @@ DEFUN (bgp_damp_unset,
"Value to start suppressing a route\n" "Value to start suppressing a route\n"
"Maximum duration to suppress a stable route\n") "Maximum duration to suppress a stable route\n")
{ {
struct bgp *bgp; VTY_DECLVAR_CONTEXT(bgp, bgp);
bgp = vty->index;
return bgp_damp_disable (bgp, bgp_node_afi (vty), bgp_node_safi (vty)); return bgp_damp_disable (bgp, bgp_node_afi (vty), bgp_node_safi (vty));
} }

View file

@ -2459,10 +2459,11 @@ struct route_map_rule_cmd route_set_originator_id_cmd =
/* Add bgp route map rule. */ /* Add bgp route map rule. */
static int 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, const char *command, const char *arg,
route_map_event_t type) route_map_event_t type)
{ {
VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret; int ret;
ret = route_map_add_match (index, command, arg); ret = route_map_add_match (index, command, arg);
@ -2489,10 +2490,11 @@ bgp_route_match_add (struct vty *vty, struct route_map_index *index,
/* Delete bgp route map rule. */ /* Delete bgp route map rule. */
static int 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, const char *command, const char *arg,
route_map_event_t type) route_map_event_t type)
{ {
VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret; int ret;
char *dep_name = NULL; char *dep_name = NULL;
const char *tmpstr; const char *tmpstr;
@ -2892,7 +2894,7 @@ DEFUN (match_peer,
"IPv6 address of peer\n") "IPv6 address of peer\n")
{ {
int idx_ip = 2; 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); RMAP_EVENT_MATCH_ADDED);
} }
@ -2903,7 +2905,7 @@ DEFUN (match_peer_local,
"Match peer address\n" "Match peer address\n"
"Static or Redistributed routes\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); RMAP_EVENT_MATCH_DELETED);
} }
@ -2920,9 +2922,9 @@ DEFUN (no_match_peer,
int idx_peer = 3; int idx_peer = 3;
if (argc <= idx_peer) 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); 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); RMAP_EVENT_MATCH_DELETED);
} }
@ -2936,7 +2938,7 @@ DEFUN (match_probability,
"Percentage of routes\n") "Percentage of routes\n")
{ {
int idx_number = 2; 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); RMAP_EVENT_MATCH_ADDED);
} }
@ -2951,9 +2953,9 @@ DEFUN (no_match_probability,
{ {
int idx_number = 3; int idx_number = 3;
if (argc <= idx_number) 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); 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); RMAP_EVENT_MATCH_DELETED);
} }
@ -2969,7 +2971,7 @@ DEFUN (match_ip_route_source,
"IP standard access-list name\n") "IP standard access-list name\n")
{ {
int idx_acl = 3; 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); RMAP_EVENT_FILTER_ADDED);
} }
@ -2987,9 +2989,9 @@ DEFUN (no_match_ip_route_source,
{ {
int idx_number = 4; int idx_number = 4;
if (argc <= idx_number) 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); 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); argv[idx_number]->arg, RMAP_EVENT_FILTER_DELETED);
} }
@ -3004,7 +3006,7 @@ DEFUN (match_ip_route_source_prefix_list,
"IP prefix-list name\n") "IP prefix-list name\n")
{ {
int idx_word = 4; 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); argv[idx_word]->arg, RMAP_EVENT_PLIST_ADDED);
} }
@ -3021,9 +3023,9 @@ DEFUN (no_match_ip_route_source_prefix_list,
{ {
int idx_word = 5; int idx_word = 5;
if (argc <= idx_word) 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); 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); argv[idx_word]->arg, RMAP_EVENT_PLIST_DELETED);
} }
@ -3036,7 +3038,7 @@ DEFUN (match_local_pref,
"Metric value\n") "Metric value\n")
{ {
int idx_number = 2; 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); RMAP_EVENT_MATCH_ADDED);
} }
@ -3051,9 +3053,9 @@ DEFUN (no_match_local_pref,
{ {
int idx_localpref = 3; int idx_localpref = 3;
if (argc <= idx_localpref) 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); 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, argv[idx_localpref]->arg,
RMAP_EVENT_MATCH_DELETED); RMAP_EVENT_MATCH_DELETED);
} }
@ -3069,7 +3071,7 @@ DEFUN (match_community,
"Community-list name\n") "Community-list name\n")
{ {
int idx_comm_list = 2; 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); RMAP_EVENT_CLIST_ADDED);
} }
@ -3092,7 +3094,7 @@ DEFUN (match_community_exact,
sprintf (argstr, "%s exact-match", argv[idx_comm_list]->arg); 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); RMAP_EVENT_CLIST_ADDED);
XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr); XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr);
@ -3111,7 +3113,7 @@ DEFUN (no_match_community,
"Community-list name\n" "Community-list name\n"
"Do exact matching of communities\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); RMAP_EVENT_CLIST_DELETED);
} }
@ -3127,7 +3129,7 @@ DEFUN (match_ecommunity,
"Extended community-list name\n") "Extended community-list name\n")
{ {
int idx_comm_list = 2; 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); RMAP_EVENT_ECLIST_ADDED);
} }
@ -3142,7 +3144,7 @@ DEFUN (no_match_ecommunity,
"Extended community-list number (expanded)\n" "Extended community-list number (expanded)\n"
"Extended community-list name\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); RMAP_EVENT_ECLIST_DELETED);
} }
@ -3155,7 +3157,7 @@ DEFUN (match_aspath,
"AS path access-list name\n") "AS path access-list name\n")
{ {
int idx_word = 2; 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); RMAP_EVENT_ASLIST_ADDED);
} }
@ -3168,7 +3170,7 @@ DEFUN (no_match_aspath,
"Match BGP AS path list\n" "Match BGP AS path list\n"
"AS path access-list name\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); RMAP_EVENT_ASLIST_DELETED);
} }
@ -3184,13 +3186,13 @@ DEFUN (match_origin,
{ {
int idx_origin = 2; int idx_origin = 2;
if (strncmp (argv[idx_origin]->arg, "igp", 2) == 0) 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); RMAP_EVENT_MATCH_ADDED);
if (strncmp (argv[idx_origin]->arg, "egp", 1) == 0) 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); RMAP_EVENT_MATCH_ADDED);
if (strncmp (argv[idx_origin]->arg, "incomplete", 2) == 0) 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); RMAP_EVENT_MATCH_ADDED);
return CMD_WARNING; return CMD_WARNING;
@ -3207,7 +3209,7 @@ DEFUN (no_match_origin,
"local IGP\n" "local IGP\n"
"unknown heritage\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); RMAP_EVENT_MATCH_DELETED);
} }
@ -3219,7 +3221,8 @@ DEFUN (set_ip_nexthop_peer,
"Next hop address\n" "Next hop address\n"
"Use peer address (for BGP only)\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, DEFUN (set_ip_nexthop_unchanged,
@ -3230,7 +3233,8 @@ DEFUN (set_ip_nexthop_unchanged,
"Next hop address\n" "Next hop address\n"
"Don't modify existing 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");
} }
@ -3242,7 +3246,8 @@ DEFUN (set_local_pref,
"Preference value\n") "Preference value\n")
{ {
int idx_number = 2; 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);
} }
@ -3256,8 +3261,10 @@ DEFUN (no_set_local_pref,
{ {
int idx_localpref = 3; int idx_localpref = 3;
if (argc <= idx_localpref) if (argc <= idx_localpref)
return generic_set_delete (vty, vty->index, "local-preference", NULL); return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
return generic_set_delete (vty, vty->index, "local-preference", argv[idx_localpref]->arg); "local-preference", NULL);
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
"local-preference", argv[idx_localpref]->arg);
} }
@ -3269,7 +3276,8 @@ DEFUN (set_weight,
"Weight value\n") "Weight value\n")
{ {
int idx_number = 2; 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);
} }
@ -3283,8 +3291,10 @@ DEFUN (no_set_weight,
{ {
int idx_weight = 3; int idx_weight = 3;
if (argc <= idx_weight) if (argc <= idx_weight)
return generic_set_delete (vty, vty->index, "weight", NULL); return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
return generic_set_delete (vty, vty->index, "weight", argv[idx_weight]->arg); "weight", NULL);
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index), "weight",
argv[idx_weight]->arg);
} }
@ -3301,7 +3311,8 @@ DEFUN (set_aspath_prepend_asn,
char *str; char *str;
str = argv_concat (argv, argc, idx_asn); 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); XFREE (MTYPE_TMP, str);
return ret; return ret;
@ -3333,7 +3344,8 @@ DEFUN (no_set_aspath_prepend,
char *str; char *str;
str = argv_concat (argv, argc, idx_asn); 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); XFREE (MTYPE_TMP, str);
return ret; return ret;
} }
@ -3352,7 +3364,8 @@ DEFUN (set_aspath_exclude,
char *str; char *str;
str = argv_concat (argv, argc, idx_asn); 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); XFREE (MTYPE_TMP, str);
return ret; return ret;
} }
@ -3371,7 +3384,8 @@ DEFUN (no_set_aspath_exclude,
char *str; char *str;
str = argv_concat (argv, argc, idx_asn); 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); XFREE (MTYPE_TMP, str);
return ret; return ret;
} }
@ -3460,11 +3474,13 @@ DEFUN (set_community,
argstr = XCALLOC (MTYPE_TMP, strlen (str) + strlen (" additive") + 1); argstr = XCALLOC (MTYPE_TMP, strlen (str) + strlen (" additive") + 1);
strcpy (argstr, str); strcpy (argstr, str);
strcpy (argstr + strlen (str), " additive"); 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); XFREE (MTYPE_TMP, argstr);
} }
else 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); community_free (com);
@ -3478,7 +3494,8 @@ DEFUN (set_community_none,
"BGP community attribute\n" "BGP community attribute\n"
"No 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, DEFUN (no_set_community,
@ -3489,7 +3506,8 @@ DEFUN (no_set_community,
"BGP community attribute\n" "BGP community attribute\n"
COMMUNITY_VAL_STR) 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);
} }
@ -3511,7 +3529,7 @@ DEFUN (set_community_delete,
strcpy (str, argv[idx_comm_list]->arg); strcpy (str, argv[idx_comm_list]->arg);
strcpy (str + strlen (argv[idx_comm_list]->arg), " delete"); 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); XFREE (MTYPE_TMP, str);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -3528,7 +3546,8 @@ DEFUN (no_set_community_delete,
"Community-list name\n" "Community-list name\n"
"Delete matching communities\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);
} }
@ -3545,7 +3564,8 @@ DEFUN (set_ecommunity_rt,
char *str; char *str;
str = argv_concat (argv, argc, idx_asn_nn); 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); XFREE (MTYPE_TMP, str);
return ret; return ret;
@ -3560,7 +3580,8 @@ DEFUN (no_set_ecommunity_rt,
"Route Target extended community\n" "Route Target extended community\n"
"VPN 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);
} }
@ -3577,7 +3598,8 @@ DEFUN (set_ecommunity_soo,
char *str; char *str;
str = argv_concat (argv, argc, idx_asn_nn); 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); XFREE (MTYPE_TMP, str);
return ret; return ret;
} }
@ -3592,7 +3614,8 @@ DEFUN (no_set_ecommunity_soo,
"Site-of-Origin extended community\n" "Site-of-Origin extended community\n"
"VPN 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);
} }
@ -3607,11 +3630,14 @@ DEFUN (set_origin,
{ {
int idx_origin = 2; int idx_origin = 2;
if (strncmp (argv[idx_origin]->arg, "igp", 2) == 0) 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) 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) 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; return CMD_WARNING;
} }
@ -3627,7 +3653,8 @@ DEFUN (no_set_origin,
"local IGP\n" "local IGP\n"
"unknown heritage\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);
} }
@ -3637,7 +3664,8 @@ DEFUN (set_atomic_aggregate,
SET_STR SET_STR
"BGP atomic aggregate attribute\n" ) "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, DEFUN (no_set_atomic_aggregate,
@ -3647,7 +3675,8 @@ DEFUN (no_set_atomic_aggregate,
SET_STR SET_STR
"BGP atomic aggregate attribute\n" ) "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, DEFUN (set_aggregator_as,
@ -3677,7 +3706,8 @@ DEFUN (set_aggregator_as,
sprintf (argstr, "%s %s", argv[idx_number]->arg, argv[idx_ipv4]->arg); 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); XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr);
@ -3702,7 +3732,8 @@ DEFUN (no_set_aggregator_as,
char *argstr; char *argstr;
if (argc <= idx_asn) 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); ret = inet_aton (argv[idx_ip]->arg, &address);
if (ret == 0) if (ret == 0)
@ -3716,7 +3747,8 @@ DEFUN (no_set_aggregator_as,
sprintf (argstr, "%s %s", argv[idx_asn]->arg, argv[idx_ip]->arg); 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); XFREE (MTYPE_ROUTE_MAP_COMPILED, argstr);
@ -3733,7 +3765,7 @@ DEFUN (match_ipv6_next_hop,
"IPv6 address of next hop\n") "IPv6 address of next hop\n")
{ {
int idx_ipv6 = 3; 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); RMAP_EVENT_MATCH_ADDED);
} }
@ -3747,7 +3779,7 @@ DEFUN (no_match_ipv6_next_hop,
"IPv6 address of next hop\n") "IPv6 address of next hop\n")
{ {
int idx_ipv6 = 4; 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); RMAP_EVENT_MATCH_DELETED);
} }
@ -3760,7 +3792,8 @@ DEFUN (set_ipv6_nexthop_peer,
"Next hop address\n" "Next hop address\n"
"Use peer address (for BGP only)\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, DEFUN (no_set_ipv6_nexthop_peer,
@ -3772,7 +3805,8 @@ DEFUN (no_set_ipv6_nexthop_peer,
"IPv6 next-hop address\n" "IPv6 next-hop address\n"
"Use peer address (for BGP only)\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, DEFUN (set_ipv6_nexthop_prefer_global,
@ -3783,7 +3817,8 @@ DEFUN (set_ipv6_nexthop_prefer_global,
"IPv6 next-hop address\n" "IPv6 next-hop address\n"
"Prefer global over link-local if both exist\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, DEFUN (no_set_ipv6_nexthop_prefer_global,
@ -3795,7 +3830,8 @@ DEFUN (no_set_ipv6_nexthop_prefer_global,
"IPv6 next-hop address\n" "IPv6 next-hop address\n"
"Prefer global over link-local if both exist\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, DEFUN (set_ipv6_nexthop_global,
@ -3826,7 +3862,8 @@ DEFUN (set_ipv6_nexthop_global,
return CMD_WARNING; 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);
} }
@ -3842,8 +3879,10 @@ DEFUN (no_set_ipv6_nexthop_global,
{ {
int idx_ipv6 = 5; int idx_ipv6 = 5;
if (argc <= idx_ipv6) if (argc <= idx_ipv6)
return generic_set_delete (vty, vty->index, "ipv6 next-hop global", NULL); return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
return generic_set_delete (vty, vty->index, "ipv6 next-hop global", argv[idx_ipv6]->arg); "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 */ #endif /* HAVE_IPV6 */
@ -3856,7 +3895,8 @@ DEFUN (set_vpnv4_nexthop,
"IP address of next hop\n") "IP address of next hop\n")
{ {
int idx_ipv4 = 3; 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);
} }
@ -3871,8 +3911,10 @@ DEFUN (no_set_vpnv4_nexthop,
{ {
int idx_ipv4 = 4; int idx_ipv4 = 4;
if (argc <= idx_ipv4) if (argc <= idx_ipv4)
return generic_set_delete (vty, vty->index, "vpnv4 next-hop", NULL); return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
return generic_set_delete (vty, vty->index, "vpnv4 next-hop", argv[idx_ipv4]->arg); "vpnv4 next-hop", NULL);
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
"vpnv4 next-hop", argv[idx_ipv4]->arg);
} }
@ -3884,7 +3926,8 @@ DEFUN (set_originator_id,
"IP address of originator\n") "IP address of originator\n")
{ {
int idx_ipv4 = 2; 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);
} }
@ -3898,8 +3941,10 @@ DEFUN (no_set_originator_id,
{ {
int idx_id = 3; int idx_id = 3;
if (argc < idx_id) if (argc < idx_id)
return generic_set_delete (vty, vty->index, "originator-id", NULL); return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
return generic_set_delete (vty, vty->index, "originator-id", argv[idx_id]->arg); "originator-id", NULL);
return generic_set_delete (vty, VTY_GET_CONTEXT(route_map_index),
"originator-id", argv[idx_id]->arg);
} }

File diff suppressed because it is too large Load diff

View file

@ -297,7 +297,7 @@ DEFUN (vnc_advertise_un_method,
"Via Encapsulation SAFI\n" "Via Encapsulation SAFI\n"
"Via Tunnel Encap attribute (in VPN SAFI)\n") "Via Tunnel Encap attribute (in VPN SAFI)\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp) if (!bgp)
{ {
@ -386,7 +386,7 @@ DEFUN (vnc_defaults_rt_import,
"Import filter\n" "Import filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\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) if (!bgp)
{ {
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
@ -403,7 +403,7 @@ DEFUN (vnc_defaults_rt_export,
"Export filter\n" "Export filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\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) if (!bgp)
{ {
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
@ -420,8 +420,8 @@ DEFUN (vnc_defaults_rt_both,
"Export+import filters\n" "Export+import filters\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n") "Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int rc; int rc;
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
@ -442,9 +442,9 @@ DEFUN (vnc_defaults_rd,
"Specify default route distinguisher\n" "Specify default route distinguisher\n"
"Route Distinguisher (<as-number>:<number> | <ip-address>:<number> | auto:vn:<number> )\n") "Route Distinguisher (<as-number>:<number> | <ip-address>:<number> | auto:vn:<number> )\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct prefix_rd prd; struct prefix_rd prd;
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
@ -505,7 +505,7 @@ DEFUN (vnc_defaults_l2rd,
"Fixed value 1-255\n" "Fixed value 1-255\n"
"use the low-order octet of the NVE's VN address\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; uint8_t value = 0;
if (!bgp) if (!bgp)
@ -550,7 +550,7 @@ DEFUN (vnc_defaults_no_l2rd,
NO_STR NO_STR
"Specify default Local Nve ID value to use in RD for L2 routes\n") "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) if (!bgp)
{ {
@ -570,8 +570,8 @@ DEFUN (vnc_defaults_responselifetime,
"Specify default response lifetime\n" "Specify default response lifetime\n"
"Response lifetime in seconds\n" "Infinite response lifetime\n") "Response lifetime in seconds\n" "Infinite response lifetime\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
uint32_t rspint; uint32_t rspint;
struct bgp *bgp = vty->index;
struct rfapi *h = NULL; struct rfapi *h = NULL;
struct listnode *hdnode; struct listnode *hdnode;
struct rfapi_descriptor *rfd; struct rfapi_descriptor *rfd;
@ -830,7 +830,7 @@ DEFUN (vnc_redistribute_rh_roo_localadmin,
"Resolve-NVE mode\n" "Resolve-NVE mode\n"
"Route Origin Extended Community Local Admin Field\n" "Field value\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; uint32_t localadmin;
char *endptr; char *endptr;
@ -892,7 +892,7 @@ DEFUN (vnc_redistribute_mode,
"Based on redistribute nve-group\n" "Based on redistribute nve-group\n"
"Unmodified\n" "Resolve each nexthop to connected NVEs\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; vnc_redist_mode_t newmode;
if (!bgp) if (!bgp)
@ -951,8 +951,8 @@ DEFUN (vnc_redistribute_protocol,
"From Open Shortest Path First (OSPF)\n" "From Open Shortest Path First (OSPF)\n"
"From Routing Information Protocol (RIP)\n" "From Static routes\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 */ int type = ZEBRA_ROUTE_MAX; /* init to bogus value */
struct bgp *bgp = vty->index;
afi_t afi; afi_t afi;
if (!bgp) if (!bgp)
@ -1004,8 +1004,8 @@ DEFUN (vnc_no_redistribute_protocol,
"From Open Shortest Path First (OSPF)\n" "From Open Shortest Path First (OSPF)\n"
"From Routing Information Protocol (RIP)\n" "From Static routes\n") "From Routing Information Protocol (RIP)\n" "From Static routes\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int type; int type;
struct bgp *bgp = vty->index;
afi_t afi; afi_t afi;
if (!bgp) if (!bgp)
@ -1050,8 +1050,8 @@ DEFUN (vnc_redistribute_bgp_exterior,
"From BGP without Zebra, only to configured NVE groups\n" "From BGP without Zebra, only to configured NVE groups\n"
"From BGP view\n" "BGP view name\n") "From BGP view\n" "BGP view name\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int type; int type;
struct bgp *bgp = vty->index;
afi_t afi; afi_t afi;
if (!bgp) if (!bgp)
@ -1089,7 +1089,7 @@ DEFUN (vnc_redistribute_nvegroup,
"Assign a NVE group to routes redistributed from another routing protocol\n" "Assign a NVE group to routes redistributed from another routing protocol\n"
"NVE group\n" "Group name\n") "NVE group\n" "Group name\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp) if (!bgp)
{ {
@ -1127,7 +1127,7 @@ DEFUN (vnc_redistribute_no_nvegroup,
"Redistribute from other protocol\n" "Redistribute from other protocol\n"
"Assign a NVE group to routes redistributed from another routing 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) if (!bgp)
{ {
@ -1161,7 +1161,7 @@ DEFUN (vnc_redistribute_lifetime,
"Assign a lifetime to routes redistributed from another routing protocol\n" "Assign a lifetime to routes redistributed from another routing protocol\n"
"lifetime value (32 bit)\n") "lifetime value (32 bit)\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp) if (!bgp)
{ {
@ -1205,7 +1205,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist,
"IPv4 routes\n" "IPv4 routes\n"
"IPv6 routes\n" "Prefix-list for filtering redistributed 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; afi_t afi;
struct rfapi_cfg *hc; struct rfapi_cfg *hc;
uint8_t route_type = 0; uint8_t route_type = 0;
@ -1264,7 +1264,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist,
"Prefix-list for filtering redistributed routes\n" "Prefix-list for filtering redistributed routes\n"
"prefix list name\n") "prefix list name\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc; struct rfapi_cfg *hc;
afi_t afi; afi_t afi;
uint8_t route_type = 0; uint8_t route_type = 0;
@ -1321,7 +1321,7 @@ DEFUN (vnc_redist_bgpdirect_no_routemap,
"Redistribute from BGP without Zebra, only to configured NVE groups\n" "Redistribute from BGP without Zebra, only to configured NVE groups\n"
"Route-map for filtering redistributed routes\n") "Route-map for filtering redistributed routes\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_cfg *hc; struct rfapi_cfg *hc;
uint8_t route_type = 0; uint8_t route_type = 0;
@ -1367,7 +1367,7 @@ DEFUN (vnc_redist_bgpdirect_routemap,
"Redistribute from BGP without Zebra, only to configured NVE groups\n" "Redistribute from BGP without Zebra, only to configured NVE groups\n"
"Route-map for filtering exported routes\n" "route map name\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; struct rfapi_cfg *hc;
uint8_t route_type = 0; uint8_t route_type = 0;
@ -1418,7 +1418,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist,
"IPv4 routes\n" "IPv4 routes\n"
"IPv6 routes\n" "Prefix-list for filtering redistributed 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) VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg)
afi_t afi; afi_t afi;
@ -1473,7 +1473,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist,
"Prefix-list for filtering redistributed routes\n" "Prefix-list for filtering redistributed routes\n"
"prefix list name\n") "prefix list name\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
afi_t afi; afi_t afi;
@ -1528,7 +1528,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap,
"Disable redistribute filter\n" "Disable redistribute filter\n"
"Route-map for filtering redistributed routes\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp) if (!bgp)
@ -1570,7 +1570,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap,
"Redistribute from BGP directly\n" "Redistribute from BGP directly\n"
"Route-map for filtering exported routes\n" "route map name\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp) if (!bgp)
@ -1624,7 +1624,7 @@ DEFUN (vnc_export_mode,
"Export routes with NVE connected router next-hops\n" "Export routes with NVE connected router next-hops\n"
"Disable export\n" "Export routes with registering NVE as next-hop\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 oldmode = 0;
uint32_t newmode = 0; uint32_t newmode = 0;
@ -1753,7 +1753,7 @@ DEFUN (vnc_export_nvegroup,
"NVE group, used in 'group-nve' export mode\n" "NVE group, used in 'group-nve' export mode\n"
"NVE group\n" "Group name\n") "NVE group\n" "Group name\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_nve_group_cfg *rfg_new; struct rfapi_nve_group_cfg *rfg_new;
if (!bgp) if (!bgp)
@ -1860,7 +1860,7 @@ DEFUN (vnc_no_export_nvegroup,
"NVE group, used in 'group-nve' export mode\n" "NVE group, used in 'group-nve' export mode\n"
"Disable export of VNC routes\n" "NVE group\n" "Group name\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 listnode *node, *nnode;
struct rfapi_rfg_name *rfgn; struct rfapi_rfg_name *rfgn;
@ -1927,7 +1927,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist,
"IPv6 routes\n" "IPv6 routes\n"
"Prefix-list for filtering exported routes\n" "prefix list name\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
afi_t afi; afi_t afi;
@ -2002,7 +2002,7 @@ DEFUN (vnc_nve_group_export_prefixlist,
"IPv6 routes\n" "IPv6 routes\n"
"Prefix-list for filtering exported routes\n" "prefix list name\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
afi_t afi; afi_t afi;
@ -2066,7 +2066,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
"Export to Zebra (experimental)\n" "Export to Zebra (experimental)\n"
"Route-map for filtering exported routes\n" "route map name\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp) if (!bgp)
@ -2131,7 +2131,7 @@ DEFUN (vnc_nve_group_export_routemap,
"Export to Zebra (experimental)\n" "Export to Zebra (experimental)\n"
"Route-map for filtering exported routes\n" "route map name\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
if (!bgp) if (!bgp)
@ -2187,7 +2187,7 @@ DEFUN (vnc_nve_export_no_prefixlist,
"IPv6 prefixes\n" "IPv6 prefixes\n"
"Prefix-list for filtering exported routes\n" "Prefix list name\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; struct rfapi_cfg *hc;
afi_t afi; afi_t afi;
@ -2255,7 +2255,7 @@ DEFUN (vnc_nve_export_prefixlist,
"IPv6 prefixes\n" "IPv6 prefixes\n"
"Prefix-list for filtering exported routes\n" "Prefix list name\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; struct rfapi_cfg *hc;
afi_t afi; afi_t afi;
@ -2309,7 +2309,7 @@ DEFUN (vnc_nve_export_no_routemap,
"Export to Zebra (experimental)\n" "Export to Zebra (experimental)\n"
"Route-map for filtering exported routes\n" "Route map name\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; struct rfapi_cfg *hc;
if (!bgp) if (!bgp)
@ -2367,7 +2367,7 @@ DEFUN (vnc_nve_export_routemap,
"Filters, used in 'registering-nve' export mode\n" "Filters, used in 'registering-nve' export mode\n"
"Route-map for filtering exported routes\n" "Route map name\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; struct rfapi_cfg *hc;
if (!bgp) if (!bgp)
@ -2611,8 +2611,8 @@ DEFUN (vnc_nve_group,
"vnc nve-group NAME", "vnc nve-group NAME",
VNC_CONFIG_STR "Configure a NVE group\n" "Group name\n") VNC_CONFIG_STR "Configure a NVE group\n" "Group name\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_nve_group_cfg *rfg; struct rfapi_nve_group_cfg *rfg;
struct bgp *bgp = vty->index;
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct rfapi_rfg_name *rfgn; struct rfapi_rfg_name *rfgn;
@ -2911,7 +2911,7 @@ DEFUN (vnc_no_nve_group,
"Configure a NVE group\n" "Configure a NVE group\n"
"Group name\n") "Group name\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp) if (!bgp)
{ {
@ -2930,6 +2930,7 @@ DEFUN (vnc_nve_group_prefix,
"IPv4 prefix\n" "IPv4 prefix\n"
"IPv6 prefix\n") "IPv6 prefix\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct prefix p; struct prefix p;
int afi; int afi;
@ -2937,8 +2938,6 @@ DEFUN (vnc_nve_group_prefix,
struct route_node *rn; struct route_node *rn;
int is_un_prefix = 0; int is_un_prefix = 0;
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE); vty_out (vty, "No BGP process is configured%s", VTY_NEWLINE);
@ -3056,8 +3055,8 @@ DEFUN (vnc_nve_group_rt_import,
"Import filter\n" "Import filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct bgp *bgp = vty->index;
int rc; int rc;
struct listnode *node; struct listnode *node;
struct rfapi_rfg_name *rfgn; struct rfapi_rfg_name *rfgn;
@ -3132,8 +3131,8 @@ DEFUN (vnc_nve_group_rt_export,
"Export filter\n" "Export filter\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct bgp *bgp = vty->index;
int rc; int rc;
if (!bgp) if (!bgp)
@ -3172,8 +3171,8 @@ DEFUN (vnc_nve_group_rt_both,
"Export+import filters\n" "Export+import filters\n"
"Space separated route target list (A.B.C.D:MN|EF:OPQR|GHJK:MN)\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct bgp *bgp = vty->index;
int rc; int rc;
int is_export_bgp = 0; int is_export_bgp = 0;
int is_export_zebra = 0; int is_export_zebra = 0;
@ -3264,8 +3263,8 @@ DEFUN (vnc_nve_group_l2rd,
"Fixed value 1-255\n" "Fixed value 1-255\n"
"use the low-order octet of the NVE's VN address\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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
@ -3318,8 +3317,8 @@ DEFUN (vnc_nve_group_no_l2rd,
NO_STR NO_STR
"Specify default Local Nve ID value to use in RD for L2 routes\n") "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); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
@ -3347,10 +3346,10 @@ DEFUN (vnc_nve_group_rd,
"Specify route distinguisher\n" "Specify route distinguisher\n"
"Route Distinguisher (<as-number>:<number> | <ip-address>:<number> | auto:vn:<number> )\n") "Route Distinguisher (<as-number>:<number> | <ip-address>:<number> | auto:vn:<number> )\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
int ret; int ret;
struct prefix_rd prd; struct prefix_rd prd;
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
@ -3428,9 +3427,9 @@ DEFUN (vnc_nve_group_responselifetime,
"Specify response lifetime\n" "Specify response lifetime\n"
"Response lifetime in seconds\n" "Infinite response lifetime\n") "Response lifetime in seconds\n" "Infinite response lifetime\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
unsigned int rspint; unsigned int rspint;
VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_nve_group_cfg, rfg);
struct bgp *bgp = vty->index;
struct rfapi_descriptor *rfd; struct rfapi_descriptor *rfd;
struct listnode *hdnode; struct listnode *hdnode;
@ -3507,8 +3506,8 @@ DEFUN (vnc_l2_group,
"vnc l2-group NAME", "vnc l2-group NAME",
VNC_CONFIG_STR "Configure a L2 group\n" "Group name\n") VNC_CONFIG_STR "Configure a L2 group\n" "Group name\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
struct rfapi_l2_group_cfg *rfg; struct rfapi_l2_group_cfg *rfg;
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
@ -3600,7 +3599,7 @@ DEFUN (vnc_no_l2_group,
"Configure a L2 group\n" "Configure a L2 group\n"
"Group name\n") "Group name\n")
{ {
struct bgp *bgp = vty->index; VTY_DECLVAR_CONTEXT(bgp, bgp);
if (!bgp) if (!bgp)
{ {
@ -3617,8 +3616,8 @@ DEFUN (vnc_l2_group_lni,
"Specify Logical Network ID associated with group\n" "Specify Logical Network ID associated with group\n"
"value\n") "value\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
struct bgp *bgp = vty->index;
if (!bgp) if (!bgp)
{ {
@ -3645,8 +3644,8 @@ DEFUN (vnc_l2_group_labels,
"Specify label values associated with group\n" "Specify label values associated with group\n"
"Space separated list of label values <0-1048575>\n") "Space separated list of label values <0-1048575>\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
struct bgp *bgp = vty->index;
struct list *ll; struct list *ll;
if (!bgp) if (!bgp)
@ -3691,8 +3690,8 @@ DEFUN (vnc_l2_group_no_labels,
"Specify label values associated with L2 group\n" "Specify label values associated with L2 group\n"
"Space separated list of label values <0-1048575>\n") "Space separated list of label values <0-1048575>\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
struct bgp *bgp = vty->index;
struct list *ll; struct list *ll;
if (!bgp) if (!bgp)
@ -3737,8 +3736,8 @@ DEFUN (vnc_l2_group_rt,
"Import filters\n" "Import filters\n"
"A route target\n") "A route target\n")
{ {
VTY_DECLVAR_CONTEXT(bgp, bgp);
VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg); VTY_DECLVAR_CONTEXT_SUB(rfapi_l2_group_cfg, rfg);
struct bgp *bgp = vty->index;
int rc = CMD_SUCCESS; int rc = CMD_SUCCESS;
int do_import = 0; int do_import = 0;
int do_export = 0; int do_export = 0;

View file

@ -1103,8 +1103,9 @@ DEFUN (ospf6_routemap_match_address_prefixlist,
"Match entries of prefix-lists\n" "Match entries of prefix-lists\n"
"IPv6 prefix-list name\n") "IPv6 prefix-list name\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 4; 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); "ipv6 address prefix-list", argv[idx_word]->arg);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }
@ -1120,8 +1121,9 @@ DEFUN (ospf6_routemap_no_match_address_prefixlist,
"Match entries of prefix-lists\n" "Match entries of prefix-lists\n"
"IPv6 prefix-list name\n") "IPv6 prefix-list name\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 5; 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); "ipv6 address prefix-list", argv[idx_word]->arg);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }
@ -1134,8 +1136,9 @@ DEFUN (ospf6_routemap_match_interface,
"Match first hop interface of route\n" "Match first hop interface of route\n"
"Interface name\n") "Interface name\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 2; 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); "interface", argv[idx_word]->arg);
} }
@ -1148,14 +1151,15 @@ DEFUN (ospf6_routemap_no_match_interface,
"Match first hop interface of route\n" "Match first hop interface of route\n"
"Interface name\n") "Interface name\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_word = 3; int idx_word = 3;
int ret; int ret;
if (argc == 4) 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); "interface", argv[idx_word]->arg);
else else
ret = route_map_delete_match ((struct route_map_index *) vty->index, ret = route_map_delete_match (route_map_index,
"interface", NULL); "interface", NULL);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }
@ -1169,8 +1173,9 @@ DEFUN (ospf6_routemap_set_metric_type,
"OSPF6 external type 1 metric\n" "OSPF6 external type 1 metric\n"
"OSPF6 external type 2 metric\n") "OSPF6 external type 2 metric\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_external = 2; 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); "metric-type", argv[idx_external]->arg);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }
@ -1185,8 +1190,9 @@ DEFUN (ospf6_routemap_no_set_metric_type,
"OSPF6 external type 1 metric\n" "OSPF6 external type 1 metric\n"
"OSPF6 external type 2 metric\n") "OSPF6 external type 2 metric\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_external = 3; 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); "metric-type", argv[idx_external]->arg);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }
@ -1199,8 +1205,9 @@ DEFUN (ospf6_routemap_set_forwarding,
"Forwarding Address\n" "Forwarding Address\n"
"IPv6 Address\n") "IPv6 Address\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_ipv6 = 2; 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); "forwarding-address", argv[idx_ipv6]->arg);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }
@ -1214,8 +1221,9 @@ DEFUN (ospf6_routemap_no_set_forwarding,
"Forwarding Address\n" "Forwarding Address\n"
"IPv6 Address\n") "IPv6 Address\n")
{ {
VTY_DECLVAR_CONTEXT(route_map_index, route_map_index);
int idx_ipv6 = 3; 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); "forwarding-address", argv[idx_ipv6]->arg);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }
@ -1228,7 +1236,8 @@ DEFUN (ospf6_routemap_set_tag,
"Tag value for routing protocol\n" "Tag value for routing protocol\n"
"Tag value\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); "tag", argv[2]->arg);
return route_map_command_status (vty, ret); return route_map_command_status (vty, ret);
} }

View file

@ -328,10 +328,8 @@ DEFUN (ipv6_ospf6_bfd,
"Enables BFD support\n" "Enables BFD support\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -354,17 +352,16 @@ DEFUN (ipv6_ospf6_bfd_param,
"Required min receive interval\n" "Required min receive interval\n"
"Desired min transmit interval\n") "Desired min transmit interval\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
int idx_number_2 = 4; int idx_number_2 = 4;
int idx_number_3 = 5; int idx_number_3 = 5;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
u_int32_t rx_val; u_int32_t rx_val;
u_int32_t tx_val; u_int32_t tx_val;
u_int8_t dm_val; u_int8_t dm_val;
int ret; int ret;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -390,10 +387,8 @@ DEFUN (no_ipv6_ospf6_bfd,
"Disables BFD support\n" "Disables BFD support\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;

View file

@ -1102,14 +1102,13 @@ DEFUN (ipv6_ospf6_ifmtu,
"OSPFv3 Interface MTU\n" "OSPFv3 Interface MTU\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
unsigned int ifmtu, iobuflen; unsigned int ifmtu, iobuflen;
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct ospf6_neighbor *on; struct ospf6_neighbor *on;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1163,13 +1162,12 @@ DEFUN (no_ipv6_ospf6_ifmtu,
"Interface MTU\n" "Interface MTU\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
unsigned int iobuflen; unsigned int iobuflen;
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct ospf6_neighbor *on; struct ospf6_neighbor *on;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1211,12 +1209,11 @@ DEFUN (ipv6_ospf6_cost,
"Outgoing metric of this interface\n" "Outgoing metric of this interface\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
unsigned long int lcost; unsigned long int lcost;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1252,10 +1249,8 @@ DEFUN (no_ipv6_ospf6_cost,
"Calculate interface cost from bandwidth\n" "Calculate interface cost from bandwidth\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1277,8 +1272,8 @@ DEFUN (auto_cost_reference_bandwidth,
"Use reference bandwidth method to assign OSPF cost\n" "Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\n") "The reference bandwidth in terms of Mbits per second\n")
{ {
VTY_DECLVAR_CONTEXT(ospf6, o);
int idx_number = 2; int idx_number = 2;
struct ospf6 *o = vty->index;
struct ospf6_area *oa; struct ospf6_area *oa;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct listnode *i, *j; struct listnode *i, *j;
@ -1311,7 +1306,7 @@ DEFUN (no_auto_cost_reference_bandwidth,
"Use reference bandwidth method to assign OSPF cost\n" "Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\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_area *oa;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct listnode *i, *j; struct listnode *i, *j;
@ -1337,11 +1332,9 @@ DEFUN (ipv6_ospf6_hellointerval,
SECONDS_STR SECONDS_STR
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1363,11 +1356,9 @@ DEFUN (ipv6_ospf6_deadinterval,
SECONDS_STR SECONDS_STR
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1388,11 +1379,9 @@ DEFUN (ipv6_ospf6_transmitdelay,
"Link state transmit delay\n" "Link state transmit delay\n"
SECONDS_STR) SECONDS_STR)
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1414,11 +1403,9 @@ DEFUN (ipv6_ospf6_retransmitinterval,
SECONDS_STR SECONDS_STR
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1440,11 +1427,9 @@ DEFUN (ipv6_ospf6_priority,
"Priority value\n" "Priority value\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1472,11 +1457,9 @@ DEFUN (ipv6_ospf6_instance,
"Instance ID value\n" "Instance ID value\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *)vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *)ifp->info; oi = (struct ospf6_interface *)ifp->info;
@ -1496,12 +1479,11 @@ DEFUN (ipv6_ospf6_passive,
"Passive interface; no adjacency will be formed on this interface\n" "Passive interface; no adjacency will be formed on this interface\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
struct listnode *node, *nnode; struct listnode *node, *nnode;
struct ospf6_neighbor *on; struct ospf6_neighbor *on;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1530,10 +1512,8 @@ DEFUN (no_ipv6_ospf6_passive,
"passive interface: No Adjacency will be formed on this I/F\n" "passive interface: No Adjacency will be formed on this I/F\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1557,10 +1537,8 @@ DEFUN (ipv6_ospf6_mtu_ignore,
"Disable MTU mismatch detection on this interface\n" "Disable MTU mismatch detection on this interface\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1582,10 +1560,8 @@ DEFUN (no_ipv6_ospf6_mtu_ignore,
"Disable MTU mismatch detection on this interface\n" "Disable MTU mismatch detection on this interface\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1608,11 +1584,9 @@ DEFUN (ipv6_ospf6_advertise_prefix_list,
"Prefix list name\n" "Prefix list name\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_word = 4; int idx_word = 4;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1650,10 +1624,8 @@ DEFUN (no_ipv6_ospf6_advertise_prefix_list,
"Filter prefix using prefix-list\n" "Filter prefix using prefix-list\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1693,11 +1665,9 @@ DEFUN (ipv6_ospf6_network,
"Specify OSPF6 point-to-point network\n" "Specify OSPF6 point-to-point network\n"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_network = 3; int idx_network = 3;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;
@ -1738,11 +1708,10 @@ DEFUN (no_ipv6_ospf6_network,
"Default to whatever interface type system specifies" "Default to whatever interface type system specifies"
) )
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp;
int type; int type;
ifp = (struct interface *) vty->index;
assert (ifp); assert (ifp);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;

View file

@ -866,7 +866,7 @@ ospf6_timers_spf_set (struct vty *vty, unsigned int delay,
unsigned int hold, unsigned int hold,
unsigned int max) unsigned int max)
{ {
struct ospf6 *ospf = vty->index; VTY_DECLVAR_CONTEXT(ospf6, ospf);
ospf->spf_delay = delay; ospf->spf_delay = delay;
ospf->spf_holdtime = hold; ospf->spf_holdtime = hold;

View file

@ -298,8 +298,7 @@ DEFUN (router_ospf6,
ospf6 = ospf6_create (); ospf6 = ospf6_create ();
/* set current ospf point. */ /* set current ospf point. */
vty->node = OSPF6_NODE; VTY_PUSH_CONTEXT(OSPF6_NODE, ospf6);
vty->index = ospf6;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -313,8 +312,7 @@ DEFUN (no_router_ospf6,
OSPF6_STR) OSPF6_STR)
{ {
/* return to config node . */ /* return to config node . */
vty->node = CONFIG_NODE; VTY_PUSH_CONTEXT_NULL(CONFIG_NODE);
vty->index = NULL;
return CMD_SUCCESS; return CMD_SUCCESS;
} }
@ -326,12 +324,10 @@ DEFUN (ospf6_router_id,
"Configure OSPF Router-ID\n" "Configure OSPF Router-ID\n"
V4NOTATION_STR) V4NOTATION_STR)
{ {
VTY_DECLVAR_CONTEXT(ospf6, o);
int idx_ipv4 = 1; int idx_ipv4 = 1;
int ret; int ret;
u_int32_t router_id; u_int32_t router_id;
struct ospf6 *o;
o = (struct ospf6 *) vty->index;
ret = inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id); ret = inet_pton (AF_INET, argv[idx_ipv4]->arg, &router_id);
if (ret == 0) if (ret == 0)
@ -352,7 +348,7 @@ DEFUN (ospf6_log_adjacency_changes,
"log-adjacency-changes", "log-adjacency-changes",
"Log changes in adjacency state\n") "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); SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL); UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
@ -365,7 +361,7 @@ DEFUN (ospf6_log_adjacency_changes_detail,
"Log changes in adjacency state\n" "Log changes in adjacency state\n"
"Log all state changes\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_CHANGES);
SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL); SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
@ -378,7 +374,7 @@ DEFUN (no_ospf6_log_adjacency_changes,
NO_STR NO_STR
"Log changes in adjacency state\n") "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_DETAIL);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES); UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
@ -392,7 +388,7 @@ DEFUN (no_ospf6_log_adjacency_changes_detail,
"Log changes in adjacency state\n" "Log changes in adjacency state\n"
"Log all state changes\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_DETAIL);
UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES); UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
@ -407,9 +403,9 @@ DEFUN (ospf6_timers_lsa,
"Minimum delay in receiving new version of a LSA\n" "Minimum delay in receiving new version of a LSA\n"
"Delay in milliseconds\n") "Delay in milliseconds\n")
{ {
VTY_DECLVAR_CONTEXT(ospf6, ospf);
int idx_number = 3; int idx_number = 3;
unsigned int minarrival; unsigned int minarrival;
struct ospf6 *ospf = vty->index;
if (!ospf) if (!ospf)
return CMD_SUCCESS; return CMD_SUCCESS;
@ -429,9 +425,9 @@ DEFUN (no_ospf6_timers_lsa,
"Minimum delay in receiving new version of a LSA\n" "Minimum delay in receiving new version of a LSA\n"
"Delay in milliseconds\n") "Delay in milliseconds\n")
{ {
VTY_DECLVAR_CONTEXT(ospf6, ospf);
int idx_number = 4; int idx_number = 4;
unsigned int minarrival; unsigned int minarrival;
struct ospf6 *ospf = vty->index;
if (!ospf) if (!ospf)
return CMD_SUCCESS; return CMD_SUCCESS;
@ -457,7 +453,7 @@ DEFUN (ospf6_distance,
"Administrative distance\n" "Administrative distance\n"
"OSPF6 Administrative distance\n") "OSPF6 Administrative distance\n")
{ {
struct ospf6 *o = vty->index; VTY_DECLVAR_CONTEXT(ospf6, o);
o->distance_all = atoi (argv[1]->arg); o->distance_all = atoi (argv[1]->arg);
@ -471,7 +467,7 @@ DEFUN (no_ospf6_distance,
"Administrative distance\n" "Administrative distance\n"
"OSPF6 Administrative distance\n") "OSPF6 Administrative distance\n")
{ {
struct ospf6 *o = vty->index; VTY_DECLVAR_CONTEXT(ospf6, o);
o->distance_all = 0; o->distance_all = 0;
@ -502,7 +498,7 @@ DEFUN (ospf6_distance_ospf6,
"External routes\n" "External routes\n"
"Distance for external routes\n") "Distance for external routes\n")
{ {
struct ospf6 *o = vty->index; VTY_DECLVAR_CONTEXT(ospf6, o);
char *intra, *inter, *external; char *intra, *inter, *external;
intra = inter = external = NULL; intra = inter = external = NULL;
@ -572,7 +568,7 @@ DEFUN (no_ospf6_distance_ospf6,
"External routes\n" "External routes\n"
"Distance for external routes\n") "Distance for external routes\n")
{ {
struct ospf6 *o = vty->index; VTY_DECLVAR_CONTEXT(ospf6, o);
char *intra, *inter, *external; char *intra, *inter, *external;
intra = inter = external = NULL; intra = inter = external = NULL;
@ -636,7 +632,7 @@ DEFUN (ospf6_distance_source,
"IP source prefix\n" "IP source prefix\n"
"Access list name\n") "Access list name\n")
{ {
struct ospf6 *o = vty->index; VTY_DECLVAR_CONTEXT(ospf6, o);
char *alname = (argc == 4) ? argv[3]->arg : NULL; char *alname = (argc == 4) ? argv[3]->arg : NULL;
ospf6_distance_set (vty, o, argv[1]->arg, argv[2]->arg, alname); ospf6_distance_set (vty, o, argv[1]->arg, argv[2]->arg, alname);
@ -652,7 +648,7 @@ DEFUN (no_ospf6_distance_source,
"IP source prefix\n" "IP source prefix\n"
"Access list name\n") "Access list name\n")
{ {
struct ospf6 *o = vty->index; VTY_DECLVAR_CONTEXT(ospf6, o);
char *alname = (argc == 5) ? argv[4]->arg : NULL; char *alname = (argc == 5) ? argv[4]->arg : NULL;
ospf6_distance_unset (vty, o, argv[2]->arg, argv[3]->arg, alname); ospf6_distance_unset (vty, o, argv[2]->arg, argv[3]->arg, alname);
@ -669,16 +665,14 @@ DEFUN (ospf6_interface_area,
"OSPF6 area ID in IPv4 address notation\n" "OSPF6 area ID in IPv4 address notation\n"
) )
{ {
VTY_DECLVAR_CONTEXT(ospf6, o);
int idx_ifname = 1; int idx_ifname = 1;
int idx_ipv4 = 3; int idx_ipv4 = 3;
struct ospf6 *o;
struct ospf6_area *oa; struct ospf6_area *oa;
struct ospf6_interface *oi; struct ospf6_interface *oi;
struct interface *ifp; struct interface *ifp;
u_int32_t area_id; u_int32_t area_id;
o = (struct ospf6 *) vty->index;
/* find/create ospf6 interface */ /* find/create ospf6 interface */
ifp = if_get_by_name (argv[idx_ifname]->arg); ifp = if_get_by_name (argv[idx_ifname]->arg);
oi = (struct ospf6_interface *) ifp->info; oi = (struct ospf6_interface *) ifp->info;

View file

@ -368,7 +368,7 @@ DEFUN (ip_ospf_bfd,
"OSPF interface commands\n" "OSPF interface commands\n"
"Enables BFD support\n") "Enables BFD support\n")
{ {
struct interface *ifp = (struct interface *) vty->index; VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf_if_params *params; struct ospf_if_params *params;
struct bfd_info *bfd_info; struct bfd_info *bfd_info;
@ -393,10 +393,10 @@ DEFUN (ip_ospf_bfd_param,
"Required min receive interval\n" "Required min receive interval\n"
"Desired min transmit interval\n") "Desired min transmit interval\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
int idx_number_2 = 4; int idx_number_2 = 4;
int idx_number_3 = 5; int idx_number_3 = 5;
struct interface *ifp = (struct interface *) vty->index;
u_int32_t rx_val; u_int32_t rx_val;
u_int32_t tx_val; u_int32_t tx_val;
u_int8_t dm_val; u_int8_t dm_val;
@ -424,7 +424,7 @@ DEFUN (no_ip_ospf_bfd,
"Required min receive interval\n" "Required min receive interval\n"
"Desired min transmit interval\n") "Desired min transmit interval\n")
{ {
struct interface *ifp = (struct interface *)vty->index; VTY_DECLVAR_CONTEXT(interface, ifp);
struct ospf_if_params *params; struct ospf_if_params *params;
assert (ifp); assert (ifp);

View file

@ -769,7 +769,7 @@ DEFUN (capability_opaque,
"Enable specific OSPF feature\n" "Enable specific OSPF feature\n"
"Opaque LSA\n") "Opaque LSA\n")
{ {
struct ospf *ospf = (struct ospf *) vty->index; VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf) if (!ospf)
return CMD_SUCCESS; return CMD_SUCCESS;
@ -802,7 +802,7 @@ DEFUN (no_capability_opaque,
"Enable specific OSPF feature\n" "Enable specific OSPF feature\n"
"Opaque LSA\n") "Opaque LSA\n")
{ {
struct ospf *ospf = (struct ospf *) vty->index; VTY_DECLVAR_CONTEXT(ospf, ospf);
if (!ospf) if (!ospf)
return CMD_SUCCESS; return CMD_SUCCESS;

View file

@ -119,9 +119,10 @@ ospf_route_map_event (route_map_event_t event, const char *name)
/* Delete rip route map rule. */ /* Delete rip route map rule. */
static int 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) const char *command, const char *arg)
{ {
VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret; int ret;
ret = route_map_delete_match (index, command, arg); ret = route_map_delete_match (index, command, arg);
@ -142,9 +143,10 @@ ospf_route_match_delete (struct vty *vty, struct route_map_index *index,
} }
static int 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) const char *command, const char *arg)
{ {
VTY_DECLVAR_CONTEXT(route_map_index, index);
int ret; int ret;
ret = route_map_add_match (index, command, arg); ret = route_map_add_match (index, command, arg);
@ -590,7 +592,7 @@ DEFUN (match_ip_nexthop,
"IP access-list name\n") "IP access-list name\n")
{ {
int idx_acl = 3; 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, DEFUN (no_match_ip_nexthop,
@ -605,7 +607,7 @@ DEFUN (no_match_ip_nexthop,
"IP access-list name\n") "IP access-list name\n")
{ {
char *al = (argc == 5) ? argv[4]->arg : NULL; 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, DEFUN (set_metric_type,
@ -617,7 +619,8 @@ DEFUN (set_metric_type,
"OSPF[6] external type 2 metric\n") "OSPF[6] external type 2 metric\n")
{ {
char *ext = argv[2]->text; 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, DEFUN (no_set_metric_type,
@ -630,7 +633,8 @@ DEFUN (no_set_metric_type,
"OSPF[6] external type 2 metric\n") "OSPF[6] external type 2 metric\n")
{ {
char *ext = (argc == 4) ? argv[3]->text : NULL; 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 */ /* Route-map init */

View file

@ -2264,9 +2264,9 @@ DEFUN (ospf_mpls_te_on,
MPLS_TE_STR MPLS_TE_STR
"Enable the MPLS-TE functionality\n") "Enable the MPLS-TE functionality\n")
{ {
VTY_DECLVAR_CONTEXT(ospf, ospf);
struct listnode *node; struct listnode *node;
struct mpls_te_link *lp; struct mpls_te_link *lp;
struct ospf *ospf = vty->index;
if (!ospf) if (!ospf)
return CMD_SUCCESS; return CMD_SUCCESS;
@ -2334,10 +2334,10 @@ DEFUN (ospf_mpls_te_router_addr,
"Stable IP address of the advertising router\n" "Stable IP address of the advertising router\n"
"MPLS-TE router address in IPv4 address format\n") "MPLS-TE router address in IPv4 address format\n")
{ {
VTY_DECLVAR_CONTEXT(ospf, ospf);
int idx_ipv4 = 2; int idx_ipv4 = 2;
struct te_tlv_router_addr *ra = &OspfMplsTE.router_addr; struct te_tlv_router_addr *ra = &OspfMplsTE.router_addr;
struct in_addr value; struct in_addr value;
struct ospf *ospf = vty->index;
if (!ospf) if (!ospf)
return CMD_SUCCESS; return CMD_SUCCESS;

File diff suppressed because it is too large Load diff

View file

@ -2551,10 +2551,9 @@ DEFUN (interface_ip_igmp,
IP_STR IP_STR
IFACE_IGMP_STR) IFACE_IGMP_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
@ -2582,10 +2581,9 @@ DEFUN (interface_no_ip_igmp,
IP_STR IP_STR
IFACE_IGMP_STR) IFACE_IGMP_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) if (!pim_ifp)
return CMD_SUCCESS; return CMD_SUCCESS;
@ -2612,17 +2610,15 @@ DEFUN (interface_ip_igmp_join,
"Multicast group address\n" "Multicast group address\n"
"Source address\n") "Source address\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 3; int idx_ipv4 = 3;
int idx_ipv4_2 = 4; int idx_ipv4_2 = 4;
struct interface *ifp;
const char *group_str; const char *group_str;
const char *source_str; const char *source_str;
struct in_addr group_addr; struct in_addr group_addr;
struct in_addr source_addr; struct in_addr source_addr;
int result; int result;
ifp = vty->index;
/* Group address */ /* Group address */
group_str = argv[idx_ipv4]->arg; group_str = argv[idx_ipv4]->arg;
result = inet_pton(AF_INET, group_str, &group_addr); result = inet_pton(AF_INET, group_str, &group_addr);
@ -2661,17 +2657,15 @@ DEFUN (interface_no_ip_igmp_join,
"Multicast group address\n" "Multicast group address\n"
"Source address\n") "Source address\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_ipv4 = 4; int idx_ipv4 = 4;
int idx_ipv4_2 = 5; int idx_ipv4_2 = 5;
struct interface *ifp;
const char *group_str; const char *group_str;
const char *source_str; const char *source_str;
struct in_addr group_addr; struct in_addr group_addr;
struct in_addr source_addr; struct in_addr source_addr;
int result; int result;
ifp = vty->index;
/* Group address */ /* Group address */
group_str = argv[idx_ipv4]->arg; group_str = argv[idx_ipv4]->arg;
result = inet_pton(AF_INET, group_str, &group_addr); result = inet_pton(AF_INET, group_str, &group_addr);
@ -2839,12 +2833,11 @@ DEFUN (interface_ip_igmp_query_interval,
IFACE_IGMP_QUERY_INTERVAL_STR IFACE_IGMP_QUERY_INTERVAL_STR
"Query interval in seconds\n") "Query interval in seconds\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
int query_interval; int query_interval;
int query_interval_dsec; int query_interval_dsec;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
@ -2898,11 +2891,10 @@ DEFUN (interface_no_ip_igmp_query_interval,
IFACE_IGMP_STR IFACE_IGMP_STR
IFACE_IGMP_QUERY_INTERVAL_STR) IFACE_IGMP_QUERY_INTERVAL_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
int default_query_interval_dsec; int default_query_interval_dsec;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) if (!pim_ifp)
@ -2934,11 +2926,10 @@ DEFUN (interface_ip_igmp_query_max_response_time,
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR
"Query response value in seconds\n") "Query response value in seconds\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
int query_max_response_time; int query_max_response_time;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
@ -2991,11 +2982,10 @@ DEFUN (interface_no_ip_igmp_query_max_response_time,
IFACE_IGMP_STR IFACE_IGMP_STR
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR) IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
int default_query_interval_dsec; int default_query_interval_dsec;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) if (!pim_ifp)
@ -3027,12 +3017,11 @@ DEFUN (interface_ip_igmp_query_max_response_time_dsec,
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR
"Query response value in deciseconds\n") "Query response value in deciseconds\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
int query_max_response_time_dsec; int query_max_response_time_dsec;
int default_query_interval_dsec; int default_query_interval_dsec;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
@ -3087,11 +3076,10 @@ DEFUN (interface_no_ip_igmp_query_max_response_time_dsec,
IFACE_IGMP_STR IFACE_IGMP_STR
IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR) IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
int default_query_interval_dsec; int default_query_interval_dsec;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) if (!pim_ifp)
@ -3120,12 +3108,11 @@ DEFUN (interface_ip_pim_drprio,
"Set the Designated Router Election Priority\n" "Set the Designated Router Election Priority\n"
"Value of the new DR Priority\n") "Value of the new DR Priority\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_number = 3; int idx_number = 3;
struct interface *ifp;
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
uint32_t old_dr_prio; uint32_t old_dr_prio;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
@ -3154,10 +3141,9 @@ DEFUN (interface_no_ip_pim_drprio,
"Revert the Designated Router Priority to default\n" "Revert the Designated Router Priority to default\n"
"Old Value of the Priority\n") "Old Value of the Priority\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
@ -3206,9 +3192,7 @@ DEFUN (interface_ip_pim_ssm,
PIM_STR PIM_STR
IFACE_PIM_STR) IFACE_PIM_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
ifp = vty->index;
if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SSM)) { if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SSM)) {
vty_out(vty, "Could not enable PIM SSM on interface%s", VTY_NEWLINE); vty_out(vty, "Could not enable PIM SSM on interface%s", VTY_NEWLINE);
@ -3225,9 +3209,7 @@ DEFUN (interface_ip_pim_sm,
PIM_STR PIM_STR
IFACE_PIM_SM_STR) IFACE_PIM_SM_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
ifp = vty->index;
if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SM)) { if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SM)) {
vty_out(vty, "Could not enable PIM SM on interface%s", VTY_NEWLINE); vty_out(vty, "Could not enable PIM SM on interface%s", VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
@ -3277,9 +3259,7 @@ DEFUN (interface_no_ip_pim_ssm,
PIM_STR PIM_STR
IFACE_PIM_STR) IFACE_PIM_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
ifp = vty->index;
if (!pim_cmd_interface_delete(ifp)) { if (!pim_cmd_interface_delete(ifp)) {
vty_out(vty, "Unable to delete interface information%s", VTY_NEWLINE); vty_out(vty, "Unable to delete interface information%s", VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
@ -3296,9 +3276,7 @@ DEFUN (interface_no_ip_pim_sm,
PIM_STR PIM_STR
IFACE_PIM_SM_STR) IFACE_PIM_SM_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
ifp = vty->index;
if (!pim_cmd_interface_delete(ifp)) { if (!pim_cmd_interface_delete(ifp)) {
vty_out(vty, "Unable to delete interface information%s", VTY_NEWLINE); vty_out(vty, "Unable to delete interface information%s", VTY_NEWLINE);
return CMD_WARNING; return CMD_WARNING;
@ -3315,9 +3293,9 @@ DEFUN (interface_ip_mroute,
"Outgoing interface name\n" "Outgoing interface name\n"
"Group address\n") "Group address\n")
{ {
VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 2; int idx_interface = 2;
int idx_ipv4 = 3; int idx_ipv4 = 3;
struct interface *iif;
struct interface *oif; struct interface *oif;
const char *oifname; const char *oifname;
const char *grp_str; const char *grp_str;
@ -3325,8 +3303,6 @@ DEFUN (interface_ip_mroute,
struct in_addr src_addr; struct in_addr src_addr;
int result; int result;
iif = vty->index;
oifname = argv[idx_interface]->arg; oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname); oif = if_lookup_by_name(oifname);
if (!oif) { if (!oif) {
@ -3362,10 +3338,10 @@ DEFUN (interface_ip_mroute_source,
"Group address\n" "Group address\n"
"Source address\n") "Source address\n")
{ {
VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 2; int idx_interface = 2;
int idx_ipv4 = 3; int idx_ipv4 = 3;
int idx_ipv4_2 = 4; int idx_ipv4_2 = 4;
struct interface *iif;
struct interface *oif; struct interface *oif;
const char *oifname; const char *oifname;
const char *grp_str; const char *grp_str;
@ -3374,8 +3350,6 @@ DEFUN (interface_ip_mroute_source,
struct in_addr src_addr; struct in_addr src_addr;
int result; int result;
iif = vty->index;
oifname = argv[idx_interface]->arg; oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname); oif = if_lookup_by_name(oifname);
if (!oif) { if (!oif) {
@ -3417,9 +3391,9 @@ DEFUN (interface_no_ip_mroute,
"Outgoing interface name\n" "Outgoing interface name\n"
"Group Address\n") "Group Address\n")
{ {
VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 3; int idx_interface = 3;
int idx_ipv4 = 4; int idx_ipv4 = 4;
struct interface *iif;
struct interface *oif; struct interface *oif;
const char *oifname; const char *oifname;
const char *grp_str; const char *grp_str;
@ -3427,8 +3401,6 @@ DEFUN (interface_no_ip_mroute,
struct in_addr src_addr; struct in_addr src_addr;
int result; int result;
iif = vty->index;
oifname = argv[idx_interface]->arg; oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname); oif = if_lookup_by_name(oifname);
if (!oif) { if (!oif) {
@ -3465,10 +3437,10 @@ DEFUN (interface_no_ip_mroute_source,
"Group Address\n" "Group Address\n"
"Source Address\n") "Source Address\n")
{ {
VTY_DECLVAR_CONTEXT(interface, iif);
int idx_interface = 3; int idx_interface = 3;
int idx_ipv4 = 4; int idx_ipv4 = 4;
int idx_ipv4_2 = 5; int idx_ipv4_2 = 5;
struct interface *iif;
struct interface *oif; struct interface *oif;
const char *oifname; const char *oifname;
const char *grp_str; const char *grp_str;
@ -3477,8 +3449,6 @@ DEFUN (interface_no_ip_mroute_source,
struct in_addr src_addr; struct in_addr src_addr;
int result; int result;
iif = vty->index;
oifname = argv[idx_interface]->arg; oifname = argv[idx_interface]->arg;
oif = if_lookup_by_name(oifname); oif = if_lookup_by_name(oifname);
if (!oif) { if (!oif) {
@ -3520,12 +3490,11 @@ DEFUN (interface_ip_pim_hello,
IFACE_PIM_HELLO_TIME_STR IFACE_PIM_HELLO_TIME_STR
IFACE_PIM_HELLO_HOLD_STR) IFACE_PIM_HELLO_HOLD_STR)
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_time = 3; int idx_time = 3;
int idx_hold = 4; int idx_hold = 4;
struct interface *ifp;
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {
@ -3553,10 +3522,9 @@ DEFUN (interface_no_ip_pim_hello,
IFACE_PIM_HELLO_TIME_STR IFACE_PIM_HELLO_TIME_STR
IFACE_PIM_HELLO_HOLD_STR) IFACE_PIM_HELLO_HOLD_STR)
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct pim_interface *pim_ifp; struct pim_interface *pim_ifp;
ifp = vty->index;
pim_ifp = ifp->info; pim_ifp = ifp->info;
if (!pim_ifp) { if (!pim_ifp) {

View file

@ -1332,11 +1332,10 @@ DEFUN (ip_rip_receive_version,
"RIP version 2\n" "RIP version 2\n"
"None\n") "None\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_type = 4; int idx_type = 4;
struct interface *ifp;
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
switch (argv[idx_type]->arg[0]) switch (argv[idx_type]->arg[0])
@ -1367,10 +1366,9 @@ DEFUN (ip_rip_receive_version_1,
"RIP version 1\n" "RIP version 1\n"
"RIP version 2\n") "RIP version 2\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
/* Version 1 and 2. */ /* Version 1 and 2. */
@ -1388,10 +1386,9 @@ DEFUN (ip_rip_receive_version_2,
"RIP version 2\n" "RIP version 2\n"
"RIP version 1\n") "RIP version 1\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
/* Version 1 and 2. */ /* Version 1 and 2. */
@ -1410,10 +1407,9 @@ DEFUN (no_ip_rip_receive_version,
"Version 1\n" "Version 1\n"
"Version 2\n") "Version 2\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
ri->ri_receive = RI_RIP_UNSPEC; ri->ri_receive = RI_RIP_UNSPEC;
@ -1431,11 +1427,10 @@ DEFUN (ip_rip_send_version,
"RIP version 1\n" "RIP version 1\n"
"RIP version 2\n") "RIP version 2\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_type = 4; int idx_type = 4;
struct interface *ifp;
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
/* Version 1. */ /* Version 1. */
@ -1462,10 +1457,9 @@ DEFUN (ip_rip_send_version_1,
"RIP version 1\n" "RIP version 1\n"
"RIP version 2\n") "RIP version 2\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
/* Version 1 and 2. */ /* Version 1 and 2. */
@ -1483,10 +1477,9 @@ DEFUN (ip_rip_send_version_2,
"RIP version 2\n" "RIP version 2\n"
"RIP version 1\n") "RIP version 1\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
/* Version 1 and 2. */ /* Version 1 and 2. */
@ -1505,10 +1498,9 @@ DEFUN (no_ip_rip_send_version,
"Version 1\n" "Version 1\n"
"Version 2\n") "Version 2\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
ri->ri_send = RI_RIP_UNSPEC; ri->ri_send = RI_RIP_UNSPEC;
@ -1523,10 +1515,9 @@ DEFUN (ip_rip_v2_broadcast,
"Routing Information Protocol\n" "Routing Information Protocol\n"
"Send ip broadcast v2 update\n") "Send ip broadcast v2 update\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
ri->v2_broadcast = 1; ri->v2_broadcast = 1;
@ -1541,10 +1532,9 @@ DEFUN (no_ip_rip_v2_broadcast,
"Routing Information Protocol\n" "Routing Information Protocol\n"
"Send ip broadcast v2 update\n") "Send ip broadcast v2 update\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
ri->v2_broadcast = 0; ri->v2_broadcast = 0;
@ -1564,13 +1554,12 @@ DEFUN (ip_rip_authentication_mode,
"RFC compatible\n" "RFC compatible\n"
"Old ripd compatible\n") "Old ripd compatible\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
char *cryptmode = argv[4]->text; char *cryptmode = argv[4]->text;
char *authlen = (argc > 5) ? argv[6]->text : NULL; char *authlen = (argc > 5) ? argv[6]->text : NULL;
struct interface *ifp;
struct rip_interface *ri; struct rip_interface *ri;
int auth_type; int auth_type;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
if (strmatch ("md5", cryptmode)) if (strmatch ("md5", cryptmode))
@ -1615,10 +1604,9 @@ DEFUN (no_ip_rip_authentication_mode,
"RFC compatible\n" "RFC compatible\n"
"Old ripd compatible\n") "Old ripd compatible\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
ri->auth_type = RIP_NO_AUTH; ri->auth_type = RIP_NO_AUTH;
@ -1636,11 +1624,10 @@ DEFUN (ip_rip_authentication_string,
"Authentication string\n" "Authentication string\n"
"Authentication string\n") "Authentication string\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_line = 4; int idx_line = 4;
struct interface *ifp;
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
if (strlen (argv[idx_line]->arg) > 16) if (strlen (argv[idx_line]->arg) > 16)
@ -1674,10 +1661,9 @@ DEFUN (no_ip_rip_authentication_string,
"Authentication string\n" "Authentication string\n"
"Authentication string\n") "Authentication string\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *)vty->index;
ri = ifp->info; ri = ifp->info;
if (ri->auth_str) if (ri->auth_str)
@ -1698,11 +1684,10 @@ DEFUN (ip_rip_authentication_key_chain,
"Authentication key-chain\n" "Authentication key-chain\n"
"name of key-chain\n") "name of key-chain\n")
{ {
VTY_DECLVAR_CONTEXT(interface, ifp);
int idx_line = 4; int idx_line = 4;
struct interface *ifp;
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *) vty->index;
ri = ifp->info; ri = ifp->info;
if (ri->auth_str) if (ri->auth_str)
@ -1730,10 +1715,9 @@ DEFUN (no_ip_rip_authentication_key_chain,
"Authentication key-chain\n" "Authentication key-chain\n"
"name of key-chain\n") "name of key-chain\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = (struct interface *) vty->index;
ri = ifp->info; ri = ifp->info;
if (ri->key_chain) if (ri->key_chain)
@ -1756,10 +1740,9 @@ DEFUN (ip_rip_split_horizon,
"Routing Information Protocol\n" "Routing Information Protocol\n"
"Perform split horizon\n") "Perform split horizon\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = vty->index;
ri = ifp->info; ri = ifp->info;
ri->split_horizon = RIP_SPLIT_HORIZON; ri->split_horizon = RIP_SPLIT_HORIZON;
@ -1774,10 +1757,9 @@ DEFUN (ip_rip_split_horizon_poisoned_reverse,
"Perform split horizon\n" "Perform split horizon\n"
"With poisoned-reverse\n") "With poisoned-reverse\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = vty->index;
ri = ifp->info; ri = ifp->info;
ri->split_horizon = RIP_SPLIT_HORIZON_POISONED_REVERSE; ri->split_horizon = RIP_SPLIT_HORIZON_POISONED_REVERSE;
@ -1796,10 +1778,9 @@ DEFUN (no_ip_rip_split_horizon,
"Routing Information Protocol\n" "Routing Information Protocol\n"
"Perform split horizon\n") "Perform split horizon\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = vty->index;
ri = ifp->info; ri = ifp->info;
ri->split_horizon = RIP_NO_SPLIT_HORIZON; ri->split_horizon = RIP_NO_SPLIT_HORIZON;
@ -1815,10 +1796,9 @@ DEFUN (no_ip_rip_split_horizon_poisoned_reverse,
"Perform split horizon\n" "Perform split horizon\n"
"With poisoned-reverse\n") "With poisoned-reverse\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct rip_interface *ri; struct rip_interface *ri;
ifp = vty->index;
ri = ifp->info; ri = ifp->info;
switch( ri->split_horizon ) switch( ri->split_horizon )

View file

@ -2820,8 +2820,7 @@ DEFUN (router_rip,
return CMD_WARNING; return CMD_WARNING;
} }
} }
vty->node = RIP_NODE; VTY_PUSH_CONTEXT(RIP_NODE, rip);
vty->index = rip;
return CMD_SUCCESS; return CMD_SUCCESS;
} }

View file

@ -1012,10 +1012,9 @@ DEFUN (ipv6_ripng_split_horizon,
"Routing Information Protocol\n" "Routing Information Protocol\n"
"Perform split horizon\n") "Perform split horizon\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct ripng_interface *ri; struct ripng_interface *ri;
ifp = vty->index;
ri = ifp->info; ri = ifp->info;
ri->split_horizon = RIPNG_SPLIT_HORIZON; ri->split_horizon = RIPNG_SPLIT_HORIZON;
@ -1030,10 +1029,9 @@ DEFUN (ipv6_ripng_split_horizon_poisoned_reverse,
"Perform split horizon\n" "Perform split horizon\n"
"With poisoned-reverse\n") "With poisoned-reverse\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct ripng_interface *ri; struct ripng_interface *ri;
ifp = vty->index;
ri = ifp->info; ri = ifp->info;
ri->split_horizon = RIPNG_SPLIT_HORIZON_POISONED_REVERSE; ri->split_horizon = RIPNG_SPLIT_HORIZON_POISONED_REVERSE;
@ -1049,10 +1047,9 @@ DEFUN (no_ipv6_ripng_split_horizon,
"Perform split horizon\n" "Perform split horizon\n"
"With poisoned-reverse\n") "With poisoned-reverse\n")
{ {
struct interface *ifp; VTY_DECLVAR_CONTEXT(interface, ifp);
struct ripng_interface *ri; struct ripng_interface *ri;
ifp = vty->index;
ri = ifp->info; ri = ifp->info;
ri->split_horizon = RIPNG_NO_SPLIT_HORIZON; ri->split_horizon = RIPNG_NO_SPLIT_HORIZON;