bgp_vty.c
上传用户:xiaozhuqw
上传日期:2009-11-15
资源大小:1338k
文件大小:293k
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
- vty_out (vty, " AF-dependant capabilities:%s", VTY_NEWLINE);
- if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_RCV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_RCV))
- {
- vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
- ORF_TYPE_PREFIX, VTY_NEWLINE);
- bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
- PEER_CAP_ORF_PREFIX_SM_ADV,
- PEER_CAP_ORF_PREFIX_RM_ADV,
- PEER_CAP_ORF_PREFIX_SM_RCV,
- PEER_CAP_ORF_PREFIX_RM_RCV);
- }
- if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_ADV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_SM_OLD_RCV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_ADV)
- || CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_ORF_PREFIX_RM_OLD_RCV))
- {
- vty_out (vty, " Outbound Route Filter (ORF) type (%d) Prefix-list:%s",
- ORF_TYPE_PREFIX_OLD, VTY_NEWLINE);
- bgp_show_peer_afi_orf_cap (vty, p, afi, safi,
- PEER_CAP_ORF_PREFIX_SM_ADV,
- PEER_CAP_ORF_PREFIX_RM_ADV,
- PEER_CAP_ORF_PREFIX_SM_OLD_RCV,
- PEER_CAP_ORF_PREFIX_RM_OLD_RCV);
- }
- sprintf (orf_pfx_name, "%s.%d.%d", p->host, afi, safi);
- orf_pfx_count = prefix_bgp_show_prefix_list (NULL, afi, orf_pfx_name);
- if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND)
- || orf_pfx_count)
- {
- vty_out (vty, " Outbound Route Filter (ORF):");
- if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_PREFIX_SEND))
- vty_out (vty, " sent;");
- if (orf_pfx_count)
- vty_out (vty, " received (%d entries)", orf_pfx_count);
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_ORF_WAIT_REFRESH))
- vty_out (vty, " First update is deferred until ORF or ROUTE-REFRESH is received%s", VTY_NEWLINE);
- if (filter->plist[FILTER_IN].name
- || filter->dlist[FILTER_IN].name
- || filter->aslist[FILTER_IN].name
- || filter->map[FILTER_IN].name)
- vty_out (vty, " Inbound path policy configured%s", VTY_NEWLINE);
- if (filter->plist[FILTER_OUT].name
- || filter->dlist[FILTER_OUT].name
- || filter->aslist[FILTER_OUT].name
- || filter->map[FILTER_OUT].name
- || filter->usmap.name)
- vty_out (vty, " Outbound path policy configured%s", VTY_NEWLINE);
- /* prefix-list */
- if (filter->plist[FILTER_IN].name)
- vty_out (vty, " Incoming update prefix filter list is %s%s%s",
- filter->plist[FILTER_IN].plist ? "*" : "",
- filter->plist[FILTER_IN].name,
- VTY_NEWLINE);
- if (filter->plist[FILTER_OUT].name)
- vty_out (vty, " Outgoing update prefix filter list is %s%s%s",
- filter->plist[FILTER_OUT].plist ? "*" : "",
- filter->plist[FILTER_OUT].name,
- VTY_NEWLINE);
- /* distribute-list */
- if (filter->dlist[FILTER_IN].name)
- vty_out (vty, " Incoming update network filter list is %s%s%s",
- filter->dlist[FILTER_IN].alist ? "*" : "",
- filter->dlist[FILTER_IN].name,
- VTY_NEWLINE);
- if (filter->dlist[FILTER_OUT].name)
- vty_out (vty, " Outgoing update network filter list is %s%s%s",
- filter->dlist[FILTER_OUT].alist ? "*" : "",
- filter->dlist[FILTER_OUT].name,
- VTY_NEWLINE);
- /* filter-list. */
- if (filter->aslist[FILTER_IN].name)
- vty_out (vty, " Incoming update AS path filter list is %s%s%s",
- filter->aslist[FILTER_IN].aslist ? "*" : "",
- filter->aslist[FILTER_IN].name,
- VTY_NEWLINE);
- if (filter->aslist[FILTER_OUT].name)
- vty_out (vty, " Outgoing update AS path filter list is %s%s%s",
- filter->aslist[FILTER_OUT].aslist ? "*" : "",
- filter->aslist[FILTER_OUT].name,
- VTY_NEWLINE);
- /* route-map. */
- if (filter->map[FILTER_IN].name)
- vty_out (vty, " Route map for incoming advertisements is %s%s%s",
- filter->map[FILTER_IN].map ? "*" : "",
- filter->map[FILTER_IN].name,
- VTY_NEWLINE);
- if (filter->map[FILTER_OUT].name)
- vty_out (vty, " Route map for outgoing advertisements is %s%s%s",
- filter->map[FILTER_OUT].map ? "*" : "",
- filter->map[FILTER_OUT].name,
- VTY_NEWLINE);
- /* unsuppress-map */
- if (filter->usmap.name)
- vty_out (vty, " Route map for selective unsuppress is %s%s%s",
- filter->usmap.map ? "*" : "",
- filter->usmap.name, VTY_NEWLINE);
- /* Default weight */
- if (CHECK_FLAG (p->af_config[afi][safi], PEER_AF_CONFIG_WEIGHT))
- vty_out (vty, " Default weight %d%s", p->weight[afi][safi],
- VTY_NEWLINE);
- /* Receive prefix count */
- vty_out (vty, " %ld accepted prefixes%s", p->pcount[afi][safi], VTY_NEWLINE);
- /* Maximum prefix */
- if (CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX))
- {
- vty_out (vty, " Maximum prefixes allowed %ld%s%s", p->pmax[afi][safi],
- CHECK_FLAG (p->af_flags[afi][safi], PEER_FLAG_MAX_PREFIX_WARNING)
- ? " (warning-only)" : "", VTY_NEWLINE);
- vty_out (vty, " Threshold for warning message %d%%", p->pmax_threshold[afi][safi]);
- if (p->pmax_restart[afi][safi])
- vty_out (vty, ", restart interval %d min", p->pmax_restart[afi][safi]);
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- void
- bgp_show_peer (struct vty *vty, struct peer *p)
- {
- struct bgp *bgp;
- char buf1[BUFSIZ];
- char timebuf[BGP_UPTIME_LEN];
- afi_t afi;
- safi_t safi;
- bgp = p->bgp;
- /* Configured IP address. */
- vty_out (vty, "BGP neighbor is %s, ", p->host);
- vty_out (vty, "remote AS %d, ", p->as);
- vty_out (vty, "local AS %d%s, ",
- p->change_local_as ? p->change_local_as : p->local_as,
- CHECK_FLAG (p->flags, PEER_FLAG_LOCAL_AS_NO_PREPEND) ?
- " no-prepend" : "");
- vty_out (vty, "%s link%s",
- p->as == p->local_as ? "internal" : "external",
- VTY_NEWLINE);
- /* Description. */
- if (p->desc)
- vty_out (vty, " Description: %s%s", p->desc, VTY_NEWLINE);
-
- /* Peer-group */
- if (p->group)
- vty_out (vty, " Member of peer-group %s for session parameters%s",
- p->group->name, VTY_NEWLINE);
- /* Administrative shutdown. */
- if (CHECK_FLAG (p->flags, PEER_FLAG_SHUTDOWN))
- vty_out (vty, " Administratively shut down%s", VTY_NEWLINE);
- /* BGP Version. */
- vty_out (vty, " BGP version 4");
- vty_out (vty, ", remote router ID %s%s",
- inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ),
- VTY_NEWLINE);
- /* Confederation */
- if (CHECK_FLAG (bgp->config, BGP_CONFIG_CONFEDERATION)
- && bgp_confederation_peers_check (bgp, p->as))
- vty_out (vty, " Neighbor under common administration%s", VTY_NEWLINE);
-
- /* Status. */
- vty_out (vty, " BGP state = %s",
- LOOKUP (bgp_status_msg, p->status));
- if (p->status == Established)
- vty_out (vty, ", up for %8s",
- peer_uptime (p->uptime, timebuf, BGP_UPTIME_LEN));
- vty_out (vty, "%s", VTY_NEWLINE);
-
- /* read timer */
- vty_out (vty, " Last read %s", peer_uptime (p->readtime, timebuf, BGP_UPTIME_LEN));
- /* Configured timer values. */
- vty_out (vty, ", hold time is %d, keepalive interval is %d seconds%s",
- p->v_holdtime, p->v_keepalive, VTY_NEWLINE);
- if (CHECK_FLAG (p->config, PEER_CONFIG_TIMER))
- {
- vty_out (vty, " Configured hold time is %d", p->holdtime);
- vty_out (vty, ", keepalive interval is %d seconds%s",
- p->keepalive, VTY_NEWLINE);
- }
- /* Capability. */
- if (p->status == Established)
- {
- if (p->cap
- || p->afc_adv[AFI_IP][SAFI_UNICAST]
- || p->afc_recv[AFI_IP][SAFI_UNICAST]
- || p->afc_adv[AFI_IP][SAFI_MULTICAST]
- || p->afc_recv[AFI_IP][SAFI_MULTICAST]
- #ifdef HAVE_IPV6
- || p->afc_adv[AFI_IP6][SAFI_UNICAST]
- || p->afc_recv[AFI_IP6][SAFI_UNICAST]
- || p->afc_adv[AFI_IP6][SAFI_MULTICAST]
- || p->afc_recv[AFI_IP6][SAFI_MULTICAST]
- #endif /* HAVE_IPV6 */
- || p->afc_adv[AFI_IP][SAFI_MPLS_VPN]
- || p->afc_recv[AFI_IP][SAFI_MPLS_VPN])
- {
- vty_out (vty, " Neighbor capabilities:%s", VTY_NEWLINE);
- /* Dynamic */
- if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV)
- || CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV))
- {
- vty_out (vty, " Dynamic:");
- if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV))
- vty_out (vty, " advertised");
- if (CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_RCV))
- vty_out (vty, " %sreceived",
- CHECK_FLAG (p->cap, PEER_CAP_DYNAMIC_ADV) ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- /* Route Refresh */
- if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV)
- || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)
- || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV))
- {
- vty_out (vty, " Route refresh:");
- if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV))
- vty_out (vty, " advertised");
- if (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)
- || CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV))
- vty_out (vty, " %sreceived(%s)",
- CHECK_FLAG (p->cap, PEER_CAP_REFRESH_ADV) ? "and " : "",
- (CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV)
- && CHECK_FLAG (p->cap, PEER_CAP_REFRESH_NEW_RCV)) ?
- "old & new" : CHECK_FLAG (p->cap, PEER_CAP_REFRESH_OLD_RCV) ? "old" : "new");
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- /* Multiprotocol Extensions */
- for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
- for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
- if (p->afc_adv[afi][safi] || p->afc_recv[afi][safi])
- {
- vty_out (vty, " Address family %s:", afi_safi_print (afi, safi));
- if (p->afc_adv[afi][safi])
- vty_out (vty, " advertised");
- if (p->afc_recv[afi][safi])
- vty_out (vty, " %sreceived", p->afc_adv[afi][safi] ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- /* Gracefull Restart */
- if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)
- || CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV))
- {
- vty_out (vty, " Graceful Restart Capabilty:");
- if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV))
- vty_out (vty, " advertised");
- if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
- vty_out (vty, " %sreceived",
- CHECK_FLAG (p->cap, PEER_CAP_RESTART_ADV) ? "and " : "");
- vty_out (vty, "%s", VTY_NEWLINE);
- if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV))
- {
- int restart_af_count = 0;
- vty_out (vty, " Remote Restart timer is %d seconds%s",
- p->v_gr_restart, VTY_NEWLINE);
- vty_out (vty, " Address families preserved by peer:%s", VTY_NEWLINE);
- vty_out (vty, " ");
- for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
- for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
- if (CHECK_FLAG (p->af_cap[afi][safi], PEER_CAP_RESTART_AF_RCV))
- {
- vty_out (vty, "%s%s", restart_af_count ? ", " : "",
- afi_safi_print (afi, safi));
- restart_af_count++;
- }
- if (! restart_af_count)
- vty_out (vty, "none");
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- }
- }
- }
- /* graceful restart information */
- if (CHECK_FLAG (p->cap, PEER_CAP_RESTART_RCV)
- || p->t_gr_restart
- || p->t_gr_stale)
- {
- int eor_send_af_count = 0;
- int eor_receive_af_count = 0;
- vty_out (vty, " Graceful restart informations:%s", VTY_NEWLINE);
- if (p->status == Established)
- {
- vty_out (vty, " End-of-RIB send: ");
- for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
- for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
- if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_SEND))
- {
- vty_out (vty, "%s%s", eor_send_af_count ? ", " : "",
- afi_safi_print (afi, safi));
- eor_send_af_count++;
- }
- vty_out (vty, "%s", VTY_NEWLINE);
- vty_out (vty, " End-of-RIB received: ");
- for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
- for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
- if (CHECK_FLAG (p->af_sflags[afi][safi], PEER_STATUS_EOR_RECEIVED))
- {
- vty_out (vty, "%s%s", eor_receive_af_count ? ", " : "",
- afi_safi_print (afi, safi));
- eor_receive_af_count++;
- }
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- if (p->t_gr_restart)
- {
- vty_out (vty, " The remaining time of restart timer is %s%s",
- thread_timer_remain_second (p->t_gr_restart), VTY_NEWLINE);
- }
- if (p->t_gr_stale)
- {
- vty_out (vty, " The remaining time of stalepath timer is %s%s",
- thread_timer_remain_second (p->t_gr_stale), VTY_NEWLINE);
- }
- }
- /* Packet counts. */
- vty_out (vty, " Message statistics:%s", VTY_NEWLINE);
- vty_out (vty, " Inq depth is 0%s", VTY_NEWLINE);
- vty_out (vty, " Outq depth is %ld%s", p->obuf->count, VTY_NEWLINE);
- vty_out (vty, " Sent Rcvd%s", VTY_NEWLINE);
- vty_out (vty, " Opens: %10d %10d%s", p->open_out, p->open_in, VTY_NEWLINE);
- vty_out (vty, " Notifications: %10d %10d%s", p->notify_out, p->notify_in, VTY_NEWLINE);
- vty_out (vty, " Updates: %10d %10d%s", p->update_out, p->update_in, VTY_NEWLINE);
- vty_out (vty, " Keepalives: %10d %10d%s", p->keepalive_out, p->keepalive_in, VTY_NEWLINE);
- vty_out (vty, " Route Refresh: %10d %10d%s", p->refresh_out, p->refresh_in, VTY_NEWLINE);
- vty_out (vty, " Capability: %10d %10d%s", p->dynamic_cap_out, p->dynamic_cap_in, VTY_NEWLINE);
- vty_out (vty, " Total: %10d %10d%s", p->open_out + p->notify_out +
- p->update_out + p->keepalive_out + p->refresh_out + p->dynamic_cap_out,
- p->open_in + p->notify_in + p->update_in + p->keepalive_in + p->refresh_in +
- p->dynamic_cap_in, VTY_NEWLINE);
- /* advertisement-interval */
- vty_out (vty, " Minimum time between advertisement runs is %d seconds%s",
- p->v_routeadv, VTY_NEWLINE);
- /* Update-source. */
- if (p->update_if || p->update_source)
- {
- vty_out (vty, " Update source is ");
- if (p->update_if)
- vty_out (vty, "%s", p->update_if);
- else if (p->update_source)
- vty_out (vty, "%s",
- sockunion2str (p->update_source, buf1, SU_ADDRSTRLEN));
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- vty_out (vty, "%s", VTY_NEWLINE);
- /* Address Family Information */
- for (afi = AFI_IP ; afi < AFI_MAX ; afi++)
- for (safi = SAFI_UNICAST ; safi < SAFI_MAX ; safi++)
- if (p->afc[afi][safi])
- bgp_show_peer_afi (vty, p, afi, safi);
- vty_out (vty, " Connections established %d; dropped %d%s",
- p->established, p->dropped,
- VTY_NEWLINE);
- if (! p->dropped)
- vty_out (vty, " Last reset never%s", VTY_NEWLINE);
- else
- vty_out (vty, " Last reset %s, due to %s%s",
- peer_uptime (p->resettime, timebuf, BGP_UPTIME_LEN),
- peer_down_str[(int) p->last_reset], VTY_NEWLINE);
- if (CHECK_FLAG (p->sflags, PEER_STATUS_PREFIX_OVERFLOW))
- {
- vty_out (vty, " Peer had exceeded the max. no. of prefixes configured.%s", VTY_NEWLINE);
- if (p->t_pmax_restart)
- vty_out (vty, " Reduce the no. of prefix from %s, will restart in %s%s",
- p->host, thread_timer_remain_second (p->t_pmax_restart), VTY_NEWLINE);
- else
- vty_out (vty, " Reduce the no. of prefix and clear ip bgp %s to restore peering%s",
- p->host, VTY_NEWLINE);
- }
- /* EBGP Multihop */
- if (peer_sort (p) != BGP_PEER_IBGP && p->ttl > 1)
- vty_out (vty, " External BGP neighbor may be up to %d hops away.%s",
- p->ttl, VTY_NEWLINE);
- /* connection-mode */
- if (CHECK_FLAG (p->flags, PEER_FLAG_CONNECT_MODE_PASSIVE))
- vty_out (vty, " TCP session must be opened passively%s", VTY_NEWLINE);
- if (CHECK_FLAG (p->flags, PEER_FLAG_CONNECT_MODE_ACTIVE))
- vty_out (vty, " TCP session must be opened actively%s", VTY_NEWLINE);
- /* Local address. */
- if (p->su_local)
- {
- vty_out (vty, "Local host: %s, Local port: %d%s",
- sockunion2str (p->su_local, buf1, SU_ADDRSTRLEN),
- ntohs (p->su_local->sin.sin_port),
- VTY_NEWLINE);
- }
-
- /* Remote address. */
- if (p->su_remote)
- {
- vty_out (vty, "Foreign host: %s, Foreign port: %d%s",
- sockunion2str (p->su_remote, buf1, SU_ADDRSTRLEN),
- ntohs (p->su_remote->sin.sin_port),
- VTY_NEWLINE);
- }
- /* Nexthop display. */
- if (p->su_local)
- {
- vty_out (vty, "Nexthop: %s%s",
- inet_ntop (AF_INET, &p->nexthop.v4, buf1, BUFSIZ),
- VTY_NEWLINE);
- #ifdef HAVE_IPV6
- vty_out (vty, "Nexthop global: %s%s",
- inet_ntop (AF_INET6, &p->nexthop.v6_global, buf1, BUFSIZ),
- VTY_NEWLINE);
- vty_out (vty, "Nexthop local: %s%s",
- inet_ntop (AF_INET6, &p->nexthop.v6_local, buf1, BUFSIZ),
- VTY_NEWLINE);
- vty_out (vty, "BGP connection: %s%s",
- p->shared_network ? "shared network" : "non shared network",
- VTY_NEWLINE);
- #endif /* HAVE_IPV6 */
- }
- /* Timer information. */
- if (p->t_start)
- vty_out (vty, "Next start timer due in %s%s",
- thread_timer_remain_second (p->t_start), VTY_NEWLINE);
- if (p->t_connect)
- vty_out (vty, "Next connect timer due in %s%s",
- thread_timer_remain_second (p->t_connect), VTY_NEWLINE);
-
- vty_out (vty, "Read thread: %s Write thread: %s%s",
- p->t_read ? "on" : "off",
- p->t_write ? "on" : "off",
- VTY_NEWLINE);
- if (p->notify.code == BGP_NOTIFY_OPEN_ERR
- && p->notify.subcode == BGP_NOTIFY_OPEN_UNSUP_CAPBL)
- bgp_capability_vty_out (vty, p);
-
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- int
- bgp_show_neighbor (struct vty *vty, struct bgp *bgp,
- enum show_type type, union sockunion *su)
- {
- struct listnode *nn;
- struct peer *peer;
- int find = 0;
- LIST_LOOP (bgp->peer, peer, nn)
- {
- switch (type)
- {
- case show_all:
- bgp_show_peer (vty, peer);
- break;
- case show_peer:
- if (sockunion_same (&peer->su, su))
- {
- find = 1;
- bgp_show_peer (vty, peer);
- }
- break;
- }
- }
- if (type == show_peer && ! find)
- vty_out (vty, "%% No such neighbor%s", VTY_NEWLINE);
-
- return CMD_SUCCESS;
- }
- int
- bgp_show_neighbor_vty (struct vty *vty, char *name, enum show_type type,
- char *ip_str)
- {
- int ret;
- struct bgp *bgp;
- union sockunion su;
- if (ip_str)
- {
- ret = str2sockunion (ip_str, &su);
- if (ret < 0)
- {
- vty_out (vty, "%% Malformed address: %s%s", ip_str, VTY_NEWLINE);
- return CMD_WARNING;
- }
- }
- if (name)
- {
- bgp = bgp_lookup_by_name (name);
-
- if (! bgp)
- {
- vty_out (vty, "%% No such BGP instance exist%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_show_neighbor (vty, bgp, type, &su);
- return CMD_SUCCESS;
- }
- bgp = bgp_get_default ();
- if (bgp)
- bgp_show_neighbor (vty, bgp, type, &su);
- return CMD_SUCCESS;
- }
- /* "show ip bgp neighbors" commands. */
- DEFUN (show_ip_bgp_neighbors,
- show_ip_bgp_neighbors_cmd,
- "show ip bgp neighbors",
- SHOW_STR
- IP_STR
- BGP_STR
- "Detailed information on TCP and BGP neighbor connectionsn")
- {
- return bgp_show_neighbor_vty (vty, NULL, show_all, NULL);
- }
- ALIAS (show_ip_bgp_neighbors,
- show_ip_bgp_ipv4_neighbors_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors",
- SHOW_STR
- IP_STR
- BGP_STR
- "Address familyn"
- "Address Family modifiern"
- "Address Family modifiern"
- "Detailed information on TCP and BGP neighbor connectionsn");
- ALIAS (show_ip_bgp_neighbors,
- show_ip_bgp_vpnv4_all_neighbors_cmd,
- "show ip bgp vpnv4 all neighbors",
- SHOW_STR
- IP_STR
- BGP_STR
- "Display VPNv4 NLRI specific informationn"
- "Display information about all VPNv4 NLRIsn"
- "Detailed information on TCP and BGP neighbor connectionsn");
- ALIAS (show_ip_bgp_neighbors,
- show_ip_bgp_vpnv4_rd_neighbors_cmd,
- "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors",
- SHOW_STR
- IP_STR
- BGP_STR
- "Display VPNv4 NLRI specific informationn"
- "Display information for a route distinguishern"
- "VPN Route Distinguishern"
- "Detailed information on TCP and BGP neighbor connectionsn");
- ALIAS (show_ip_bgp_neighbors,
- show_bgp_neighbors_cmd,
- "show bgp neighbors",
- SHOW_STR
- BGP_STR
- "Detailed information on TCP and BGP neighbor connectionsn");
- ALIAS (show_ip_bgp_neighbors,
- show_bgp_ipv6_neighbors_cmd,
- "show bgp ipv6 neighbors",
- SHOW_STR
- BGP_STR
- "Address familyn"
- "Detailed information on TCP and BGP neighbor connectionsn");
- DEFUN (show_ip_bgp_neighbors_peer,
- show_ip_bgp_neighbors_peer_cmd,
- "show ip bgp neighbors (A.B.C.D|X:X::X:X)",
- SHOW_STR
- IP_STR
- BGP_STR
- "Detailed information on TCP and BGP neighbor connectionsn"
- "Neighbor to display information aboutn"
- "Neighbor to display information aboutn")
- {
- return bgp_show_neighbor_vty (vty, NULL, show_peer, argv[argc - 1]);
- }
- ALIAS (show_ip_bgp_neighbors_peer,
- show_ip_bgp_ipv4_neighbors_peer_cmd,
- "show ip bgp ipv4 (unicast|multicast) neighbors (A.B.C.D|X:X::X:X)",
- SHOW_STR
- IP_STR
- BGP_STR
- "Address familyn"
- "Address Family modifiern"
- "Address Family modifiern"
- "Detailed information on TCP and BGP neighbor connectionsn"
- "Neighbor to display information aboutn"
- "Neighbor to display information aboutn");
- ALIAS (show_ip_bgp_neighbors_peer,
- show_ip_bgp_vpnv4_all_neighbors_peer_cmd,
- "show ip bgp vpnv4 all neighbors A.B.C.D",
- SHOW_STR
- IP_STR
- BGP_STR
- "Display VPNv4 NLRI specific informationn"
- "Display information about all VPNv4 NLRIsn"
- "Detailed information on TCP and BGP neighbor connectionsn"
- "Neighbor to display information aboutn");
- ALIAS (show_ip_bgp_neighbors_peer,
- show_ip_bgp_vpnv4_rd_neighbors_peer_cmd,
- "show ip bgp vpnv4 rd ASN:nn_or_IP-address:nn neighbors A.B.C.D",
- SHOW_STR
- IP_STR
- BGP_STR
- "Display VPNv4 NLRI specific informationn"
- "Display information about all VPNv4 NLRIsn"
- "Detailed information on TCP and BGP neighbor connectionsn"
- "Neighbor to display information aboutn");
- ALIAS (show_ip_bgp_neighbors_peer,
- show_bgp_neighbors_peer_cmd,
- "show bgp neighbors (A.B.C.D|X:X::X:X)",
- SHOW_STR
- BGP_STR
- "Detailed information on TCP and BGP neighbor connectionsn"
- "Neighbor to display information aboutn"
- "Neighbor to display information aboutn");
- ALIAS (show_ip_bgp_neighbors_peer,
- show_bgp_ipv6_neighbors_peer_cmd,
- "show bgp ipv6 neighbors (A.B.C.D|X:X::X:X)",
- SHOW_STR
- BGP_STR
- "Address familyn"
- "Detailed information on TCP and BGP neighbor connectionsn"
- "Neighbor to display information aboutn"
- "Neighbor to display information aboutn");
- DEFUN (show_ip_bgp_instance_neighbors,
- show_ip_bgp_instance_neighbors_cmd,
- "show ip bgp view WORD neighbors",
- SHOW_STR
- IP_STR
- BGP_STR
- "BGP viewn"
- "View namen"
- "Detailed information on TCP and BGP neighbor connectionsn")
- {
- return bgp_show_neighbor_vty (vty, argv[0], show_all, NULL);
- }
- DEFUN (show_ip_bgp_instance_neighbors_peer,
- show_ip_bgp_instance_neighbors_peer_cmd,
- "show ip bgp view WORD neighbors (A.B.C.D|X:X::X:X)",
- SHOW_STR
- IP_STR
- BGP_STR
- "BGP viewn"
- "View namen"
- "Detailed information on TCP and BGP neighbor connectionsn"
- "Neighbor to display information aboutn"
- "Neighbor to display information aboutn")
- {
- return bgp_show_neighbor_vty (vty, argv[0], show_peer, argv[1]);
- }
- /* Show BGP's AS paths internal data. There are both `show ip bgp
- paths' and `show ip mbgp paths'. Those functions results are the
- same.*/
- DEFUN (show_ip_bgp_paths,
- show_ip_bgp_paths_cmd,
- "show ip bgp paths",
- SHOW_STR
- IP_STR
- BGP_STR
- "Path informationn")
- {
- vty_out (vty, "Address Refcnt Path%s", VTY_NEWLINE);
- aspath_print_all_vty (vty);
- return CMD_SUCCESS;
- }
- DEFUN (show_ip_bgp_ipv4_paths,
- show_ip_bgp_ipv4_paths_cmd,
- "show ip bgp ipv4 (unicast|multicast) paths",
- SHOW_STR
- IP_STR
- BGP_STR
- "Address familyn"
- "Address Family modifiern"
- "Address Family modifiern"
- "Path informationn")
- {
- vty_out (vty, "Address Refcnt Pathrn");
- aspath_print_all_vty (vty);
- return CMD_SUCCESS;
- }
- #include "hash.h"
- void
- community_show_all_iterator (struct hash_backet *backet, struct vty *vty)
- {
- struct community *com;
- com = (struct community *) backet->data;
- vty_out (vty, "[%p] (%ld) %s%s", backet, com->refcnt,
- community_str (com), VTY_NEWLINE);
- }
- /* Show BGP's community internal data. */
- DEFUN (show_ip_bgp_community_info,
- show_ip_bgp_community_info_cmd,
- "show ip bgp community-info",
- SHOW_STR
- IP_STR
- BGP_STR
- "List all bgp community informationn")
- {
- vty_out (vty, "Address Refcnt Community%s", VTY_NEWLINE);
- hash_iterate (community_hash (),
- (void (*) (struct hash_backet *, void *))
- community_show_all_iterator,
- vty);
- return CMD_SUCCESS;
- }
- DEFUN (show_ip_bgp_attr_info,
- show_ip_bgp_attr_info_cmd,
- "show ip bgp attribute-info",
- SHOW_STR
- IP_STR
- BGP_STR
- "List all bgp attribute informationn")
- {
- attr_show_all (vty);
- return CMD_SUCCESS;
- }
- /* Redistribute VTY commands. */
- /* Utility function to convert user input route type string to route
- type. */
- static int
- bgp_str2route_type (int afi, char *str)
- {
- if (! str)
- return 0;
- if (afi == AFI_IP)
- {
- if (strncmp (str, "k", 1) == 0)
- return ZEBRA_ROUTE_KERNEL;
- else if (strncmp (str, "c", 1) == 0)
- return ZEBRA_ROUTE_CONNECT;
- else if (strncmp (str, "s", 1) == 0)
- return ZEBRA_ROUTE_STATIC;
- else if (strncmp (str, "r", 1) == 0)
- return ZEBRA_ROUTE_RIP;
- else if (strncmp (str, "o", 1) == 0)
- return ZEBRA_ROUTE_OSPF;
- }
- if (afi == AFI_IP6)
- {
- if (strncmp (str, "k", 1) == 0)
- return ZEBRA_ROUTE_KERNEL;
- else if (strncmp (str, "c", 1) == 0)
- return ZEBRA_ROUTE_CONNECT;
- else if (strncmp (str, "s", 1) == 0)
- return ZEBRA_ROUTE_STATIC;
- else if (strncmp (str, "r", 1) == 0)
- return ZEBRA_ROUTE_RIPNG;
- else if (strncmp (str, "o", 1) == 0)
- return ZEBRA_ROUTE_OSPF6;
- }
- return 0;
- }
- DEFUN (bgp_redistribute_ipv4,
- bgp_redistribute_ipv4_cmd,
- "redistribute (connected|kernel|ospf|rip|static)",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return bgp_redistribute_set (vty->index, AFI_IP, type);
- }
- DEFUN (bgp_redistribute_ipv4_rmap,
- bgp_redistribute_ipv4_rmap_cmd,
- "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]);
- return bgp_redistribute_set (vty->index, AFI_IP, type);
- }
- DEFUN (bgp_redistribute_ipv4_metric,
- bgp_redistribute_ipv4_metric_cmd,
- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- u_int32_t metric;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- VTY_GET_INTEGER ("metric", metric, argv[1]);
- bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP, type);
- }
- DEFUN (bgp_redistribute_ipv4_rmap_metric,
- bgp_redistribute_ipv4_rmap_metric_cmd,
- "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- u_int32_t metric;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- VTY_GET_INTEGER ("metric", metric, argv[2]);
- bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[1]);
- bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP, type);
- }
- DEFUN (bgp_redistribute_ipv4_metric_rmap,
- bgp_redistribute_ipv4_metric_rmap_cmd,
- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn"
- "Route map referencen"
- "Pointer to route-map entriesn")
- {
- int type;
- u_int32_t metric;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- VTY_GET_INTEGER ("metric", metric, argv[1]);
- bgp_redistribute_metric_set (vty->index, AFI_IP, type, metric);
- bgp_redistribute_rmap_set (vty->index, AFI_IP, type, argv[2]);
- return bgp_redistribute_set (vty->index, AFI_IP, type);
- }
- DEFUN (no_bgp_redistribute_ipv4,
- no_bgp_redistribute_ipv4_cmd,
- "no redistribute (connected|kernel|ospf|rip|static)",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return bgp_redistribute_unset (vty->index, AFI_IP, type);
- }
- DEFUN (no_bgp_redistribute_ipv4_rmap,
- no_bgp_redistribute_ipv4_rmap_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_routemap_unset (vty->index, AFI_IP, type);
- return CMD_SUCCESS;
- }
- DEFUN (no_bgp_redistribute_ipv4_metric,
- no_bgp_redistribute_ipv4_metric_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_metric_unset (vty->index, AFI_IP, type);
- return CMD_SUCCESS;
- }
- DEFUN (no_bgp_redistribute_ipv4_rmap_metric,
- no_bgp_redistribute_ipv4_rmap_metric_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_metric_unset (vty->index, AFI_IP, type);
- bgp_redistribute_routemap_unset (vty->index, AFI_IP, type);
- return CMD_SUCCESS;
- }
- ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
- no_bgp_redistribute_ipv4_metric_rmap_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPF)n"
- "Routing Information Protocol (RIP)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn"
- "Route map referencen"
- "Pointer to route-map entriesn");
- #ifdef HAVE_IPV6
- DEFUN (bgp_redistribute_ipv6,
- bgp_redistribute_ipv6_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static)",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return bgp_redistribute_set (vty->index, AFI_IP6, type);
- }
- DEFUN (bgp_redistribute_ipv6_rmap,
- bgp_redistribute_ipv6_rmap_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]);
- return bgp_redistribute_set (vty->index, AFI_IP6, type);
- }
- DEFUN (bgp_redistribute_ipv6_metric,
- bgp_redistribute_ipv6_metric_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- u_int32_t metric;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- VTY_GET_INTEGER ("metric", metric, argv[1]);
- bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP6, type);
- }
- DEFUN (bgp_redistribute_ipv6_rmap_metric,
- bgp_redistribute_ipv6_rmap_metric_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- u_int32_t metric;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- VTY_GET_INTEGER ("metric", metric, argv[2]);
- bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[1]);
- bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric);
- return bgp_redistribute_set (vty->index, AFI_IP6, type);
- }
- DEFUN (bgp_redistribute_ipv6_metric_rmap,
- bgp_redistribute_ipv6_metric_rmap_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn"
- "Route map referencen"
- "Pointer to route-map entriesn")
- {
- int type;
- u_int32_t metric;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- VTY_GET_INTEGER ("metric", metric, argv[1]);
- bgp_redistribute_metric_set (vty->index, AFI_IP6, type, metric);
- bgp_redistribute_rmap_set (vty->index, AFI_IP6, type, argv[2]);
- return bgp_redistribute_set (vty->index, AFI_IP6, type);
- }
- DEFUN (no_bgp_redistribute_ipv6,
- no_bgp_redistribute_ipv6_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static)",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- return bgp_redistribute_unset (vty->index, AFI_IP6, type);
- }
- DEFUN (no_bgp_redistribute_ipv6_rmap,
- no_bgp_redistribute_ipv6_rmap_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_routemap_unset (vty->index, AFI_IP6, type);
- return CMD_SUCCESS;
- }
- DEFUN (no_bgp_redistribute_ipv6_metric,
- no_bgp_redistribute_ipv6_metric_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_metric_unset (vty->index, AFI_IP6, type);
- return CMD_SUCCESS;
- }
- DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
- no_bgp_redistribute_ipv6_rmap_metric_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Route map referencen"
- "Pointer to route-map entriesn"
- "Metric for redistributed routesn"
- "Default metricn")
- {
- int type;
- type = bgp_str2route_type (AFI_IP6, argv[0]);
- if (! type)
- {
- vty_out (vty, "%% Invalid route type%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- bgp_redistribute_metric_unset (vty->index, AFI_IP6, type);
- bgp_redistribute_routemap_unset (vty->index, AFI_IP6, type);
- return CMD_SUCCESS;
- }
- ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
- no_bgp_redistribute_ipv6_metric_rmap_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
- NO_STR
- "Redistribute information from another routing protocoln"
- "Connectedn"
- "Kernel routesn"
- "Open Shurtest Path First (OSPFv3)n"
- "Routing Information Protocol (RIPng)n"
- "Static routesn"
- "Metric for redistributed routesn"
- "Default metricn"
- "Route map referencen"
- "Pointer to route-map entriesn");
- #endif /* HAVE_IPV6 */
- /* Show version. */
- DEFUN (show_version_bgpd,
- show_version_bgpd_cmd,
- "show version bgpd",
- SHOW_STR
- "Displays zebra versionn"
- "Displays bgpd versionn")
- {
- vty_out (vty, "Zebra BGPd version %s%s", ZEBRA_BGPD_VERSION, VTY_NEWLINE);
- vty_out (vty, "Copyright 1996-2004, Kunihiro Ishiguro.%s", VTY_NEWLINE);
- vty_out (vty, "%s", VTY_NEWLINE);
- return CMD_SUCCESS;
- }
- int
- bgp_config_write_redistribute (struct vty *vty, struct bgp *bgp, afi_t afi,
- safi_t safi, int *write)
- {
- int i;
- char *str[] = { "system", "kernel", "connected", "static", "rip",
- "ripng", "ospf", "ospf6", "bgp"};
- /* Unicast redistribution only. */
- if (safi != SAFI_UNICAST)
- return 0;
- for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
- {
- /* Redistribute BGP does not make sense. */
- if (bgp->redist[afi][i] && i != ZEBRA_ROUTE_BGP)
- {
- /* Display "address-family" when it is not yet diplayed. */
- bgp_config_write_family_header (vty, afi, safi, write);
- /* "redistribute" configuration. */
- vty_out (vty, " redistribute %s", str[i]);
- if (bgp->redist_metric_flag[afi][i])
- vty_out (vty, " metric %d", bgp->redist_metric[afi][i]);
- if (bgp->rmap[afi][i].name)
- vty_out (vty, " route-map %s", bgp->rmap[afi][i].name);
- vty_out (vty, "%s", VTY_NEWLINE);
- }
- }
- return *write;
- }
- /* BGP node structure. */
- struct cmd_node bgp_node =
- {
- BGP_NODE,
- "%s(config-router)# ",
- 1,
- };
- struct cmd_node bgp_ipv4_unicast_node =
- {
- BGP_IPV4_NODE,
- "%s(config-router-af)# ",
- 1,
- };
- struct cmd_node bgp_ipv4_multicast_node =
- {
- BGP_IPV4M_NODE,
- "%s(config-router-af)# ",
- 1,
- };
- struct cmd_node bgp_ipv6_unicast_node =
- {
- BGP_IPV6_NODE,
- "%s(config-router-af)# ",
- 1,
- };
- struct cmd_node bgp_vpnv4_node =
- {
- BGP_VPNV4_NODE,
- "%s(config-router-af)# ",
- 1
- };
- void
- bgp_vty_init ()
- {
- int bgp_config_write (struct vty *);
- void community_list_vty ();
- /* Install bgp top node. */
- install_node (&bgp_node, bgp_config_write);
- install_node (&bgp_ipv4_unicast_node, NULL);
- install_node (&bgp_ipv4_multicast_node, NULL);
- install_node (&bgp_ipv6_unicast_node, NULL);
- install_node (&bgp_vpnv4_node, NULL);
- /* Install default VTY commands to new nodes. */
- install_default (BGP_NODE);
- install_default (BGP_IPV4_NODE);
- install_default (BGP_IPV4M_NODE);
- install_default (BGP_IPV6_NODE);
- install_default (BGP_VPNV4_NODE);
-
- /* "bgp multiple-instance" commands. */
- install_element (CONFIG_NODE, &bgp_multiple_instance_cmd);
- install_element (CONFIG_NODE, &no_bgp_multiple_instance_cmd);
- /* "bgp config-type" commands. */
- install_element (CONFIG_NODE, &bgp_config_type_cmd);
- install_element (CONFIG_NODE, &no_bgp_config_type_cmd);
- /* Dummy commands (Currently not supported) */
- install_element (BGP_NODE, &no_synchronization_cmd);
- install_element (BGP_IPV4_NODE, &no_synchronization_cmd);
- install_element (BGP_IPV6_NODE, &no_synchronization_cmd);
- install_element (BGP_NODE, &no_auto_summary_cmd);
- install_element (BGP_IPV4_NODE, &no_auto_summary_cmd);
- install_element (BGP_IPV4M_NODE, &no_auto_summary_cmd);
- /* "router bgp" commands. */
- install_element (CONFIG_NODE, &router_bgp_cmd);
- install_element (CONFIG_NODE, &router_bgp_view_cmd);
- /* "no router bgp" commands. */
- install_element (CONFIG_NODE, &no_router_bgp_cmd);
- install_element (CONFIG_NODE, &no_router_bgp_view_cmd);
- /* "bgp router-id" commands. */
- install_element (BGP_NODE, &bgp_router_id_cmd);
- install_element (BGP_NODE, &no_bgp_router_id_cmd);
- install_element (BGP_NODE, &no_bgp_router_id_val_cmd);
- /* "bgp cluster-id" commands. */
- install_element (BGP_NODE, &bgp_cluster_id_cmd);
- install_element (BGP_NODE, &bgp_cluster_id32_cmd);
- install_element (BGP_NODE, &no_bgp_cluster_id_cmd);
- install_element (BGP_NODE, &no_bgp_cluster_id_arg_cmd);
- /* "bgp confederation" commands. */
- install_element (BGP_NODE, &bgp_confederation_identifier_cmd);
- install_element (BGP_NODE, &no_bgp_confederation_identifier_cmd);
- install_element (BGP_NODE, &no_bgp_confederation_identifier_arg_cmd);
- /* "bgp confederation peers" commands. */
- install_element (BGP_NODE, &bgp_confederation_peers_cmd);
- install_element (BGP_NODE, &no_bgp_confederation_peers_cmd);
- /* "timers bgp" commands. */
- install_element (BGP_NODE, &bgp_timers_cmd);
- install_element (BGP_NODE, &no_bgp_timers_cmd);
- install_element (BGP_NODE, &no_bgp_timers_arg_cmd);
- /* "bgp client-to-client reflection" commands */
- install_element (BGP_NODE, &no_bgp_client_to_client_reflection_cmd);
- install_element (BGP_NODE, &bgp_client_to_client_reflection_cmd);
- /* "bgp always-compare-med" commands */
- install_element (BGP_NODE, &bgp_always_compare_med_cmd);
- install_element (BGP_NODE, &no_bgp_always_compare_med_cmd);
-
- /* "bgp deterministic-med" commands */
- install_element (BGP_NODE, &bgp_deterministic_med_cmd);
- install_element (BGP_NODE, &no_bgp_deterministic_med_cmd);
-
- /* "bgp graceful-restart" commands */
- install_element (BGP_NODE, &bgp_graceful_restart_cmd);
- install_element (BGP_NODE, &no_bgp_graceful_restart_cmd);
- install_element (BGP_NODE, &bgp_graceful_restart_stalepath_time_cmd);
- install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_cmd);
- install_element (BGP_NODE, &no_bgp_graceful_restart_stalepath_time_val_cmd);
- /* "bgp fast-external-failover" commands */
- install_element (BGP_NODE, &bgp_fast_external_failover_cmd);
- install_element (BGP_NODE, &no_bgp_fast_external_failover_cmd);
- /* "bgp enforce-first-as" commands */
- install_element (BGP_NODE, &bgp_enforce_first_as_cmd);
- install_element (BGP_NODE, &no_bgp_enforce_first_as_cmd);
- /* "bgp bestpath compare-routerid" commands */
- install_element (BGP_NODE, &bgp_bestpath_compare_router_id_cmd);
- install_element (BGP_NODE, &no_bgp_bestpath_compare_router_id_cmd);
- /* "bgp bestpath cost-community ignore" commands */
- install_element (BGP_NODE, &bgp_bestpath_cost_community_ignore_cmd);
- install_element (BGP_NODE, &no_bgp_bestpath_cost_community_ignore_cmd);
- /* "bgp bestpath as-path ignore" commands */
- install_element (BGP_NODE, &bgp_bestpath_aspath_ignore_cmd);
- install_element (BGP_NODE, &no_bgp_bestpath_aspath_ignore_cmd);
- /* "bgp log-neighbor-changes" commands */
- install_element (BGP_NODE, &bgp_log_neighbor_changes_cmd);
- install_element (BGP_NODE, &no_bgp_log_neighbor_changes_cmd);
- /* "bgp bestpath med" commands */
- install_element (BGP_NODE, &bgp_bestpath_med_cmd);
- install_element (BGP_NODE, &bgp_bestpath_med2_cmd);
- install_element (BGP_NODE, &bgp_bestpath_med3_cmd);
- install_element (BGP_NODE, &no_bgp_bestpath_med_cmd);
- install_element (BGP_NODE, &no_bgp_bestpath_med2_cmd);
- install_element (BGP_NODE, &no_bgp_bestpath_med3_cmd);
- /* "no bgp default ipv4-unicast" commands. */
- install_element (BGP_NODE, &no_bgp_default_ipv4_unicast_cmd);
- install_element (BGP_NODE, &bgp_default_ipv4_unicast_cmd);
-
- /* "bgp network import-check" commands. */
- install_element (BGP_NODE, &bgp_network_import_check_cmd);
- install_element (BGP_NODE, &no_bgp_network_import_check_cmd);
- /* "bgp default local-preference" commands. */
- install_element (BGP_NODE, &bgp_default_local_preference_cmd);
- install_element (BGP_NODE, &no_bgp_default_local_preference_cmd);
- install_element (BGP_NODE, &no_bgp_default_local_preference_val_cmd);
- /* "neighbor remote-as" commands. */
- install_element (BGP_NODE, &neighbor_remote_as_cmd);
- install_element (BGP_NODE, &no_neighbor_cmd);
- install_element (BGP_NODE, &no_neighbor_remote_as_cmd);
- /* "neighbor peer-group" commands. */
- install_element (BGP_NODE, &neighbor_peer_group_cmd);
- install_element (BGP_NODE, &no_neighbor_peer_group_cmd);
- install_element (BGP_NODE, &no_neighbor_peer_group_remote_as_cmd);
- /* "neighbor local-as" commands. */
- install_element (BGP_NODE, &neighbor_local_as_cmd);
- install_element (BGP_NODE, &neighbor_local_as_no_prepend_cmd);
- install_element (BGP_NODE, &no_neighbor_local_as_cmd);
- install_element (BGP_NODE, &no_neighbor_local_as_val_cmd);
- install_element (BGP_NODE, &no_neighbor_local_as_val2_cmd);
- #ifdef HAVE_TCP_SIGNATURE
- /* "neighbor password" commands. */
- install_element (BGP_NODE, &neighbor_password_cmd);
- install_element (BGP_NODE, &no_neighbor_password_cmd);
- #endif /* HAVE_TCP_SIGNATURE */
- /* "neighbor activate" commands. */
- install_element (BGP_NODE, &neighbor_activate_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_activate_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_activate_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_activate_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_activate_cmd);
- /* "no neighbor activate" commands. */
- install_element (BGP_NODE, &no_neighbor_activate_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_activate_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_activate_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_activate_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_activate_cmd);
- /* "neighbor peer-group set" commands. */
- install_element (BGP_NODE, &neighbor_set_peer_group_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_set_peer_group_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_set_peer_group_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_set_peer_group_cmd);
- /* "no neighbor peer-group unset" commands. */
- install_element (BGP_NODE, &no_neighbor_set_peer_group_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_set_peer_group_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_set_peer_group_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_set_peer_group_cmd);
- /* "neighbor softreconfiguration inbound" commands.*/
- install_element (BGP_NODE, &neighbor_soft_reconfiguration_cmd);
- install_element (BGP_NODE, &no_neighbor_soft_reconfiguration_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_soft_reconfiguration_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_soft_reconfiguration_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_soft_reconfiguration_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_soft_reconfiguration_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_soft_reconfiguration_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_soft_reconfiguration_cmd);
- /* "neighbor attribute-unchanged" commands. */
- install_element (BGP_NODE, &neighbor_attr_unchanged_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged1_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged2_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged3_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged4_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged5_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged6_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged7_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged8_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged9_cmd);
- install_element (BGP_NODE, &neighbor_attr_unchanged10_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged1_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged2_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged3_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged4_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged5_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged6_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged7_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged8_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged9_cmd);
- install_element (BGP_NODE, &no_neighbor_attr_unchanged10_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged1_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged2_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged3_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged4_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged5_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged6_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged7_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged8_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged9_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_attr_unchanged10_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged1_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged2_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged3_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged4_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged5_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged6_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged7_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged8_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged9_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_attr_unchanged10_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged1_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged2_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged3_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged4_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged5_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged6_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged7_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged8_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged9_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_attr_unchanged10_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged1_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged2_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged3_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged4_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged5_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged6_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged7_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged8_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged9_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_attr_unchanged10_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged1_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged2_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged3_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged4_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged5_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged6_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged7_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged8_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged9_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_attr_unchanged10_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged1_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged2_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged3_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged4_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged5_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged6_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged7_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged8_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged9_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_attr_unchanged10_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged1_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged2_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged3_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged4_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged5_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged6_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged7_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged8_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged9_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_attr_unchanged10_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged1_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged2_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged3_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged4_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged5_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged6_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged7_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged8_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged9_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_attr_unchanged10_cmd);
- /* "neighbor next-hop-self" commands. */
- install_element (BGP_NODE, &neighbor_nexthop_self_cmd);
- install_element (BGP_NODE, &no_neighbor_nexthop_self_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_nexthop_self_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_nexthop_self_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_nexthop_self_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_nexthop_self_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_nexthop_self_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_nexthop_self_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_nexthop_self_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_nexthop_self_cmd);
- /* "neighbor remove-private-AS" commands. */
- install_element (BGP_NODE, &neighbor_remove_private_as_cmd);
- install_element (BGP_NODE, &no_neighbor_remove_private_as_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_remove_private_as_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_remove_private_as_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_remove_private_as_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_remove_private_as_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_remove_private_as_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_remove_private_as_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_remove_private_as_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_remove_private_as_cmd);
- /* "neighbor send-community" commands.*/
- install_element (BGP_NODE, &neighbor_send_community_cmd);
- install_element (BGP_NODE, &neighbor_send_community_type_cmd);
- install_element (BGP_NODE, &no_neighbor_send_community_cmd);
- install_element (BGP_NODE, &no_neighbor_send_community_type_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_send_community_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_send_community_type_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_send_community_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_send_community_type_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_send_community_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_send_community_type_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_send_community_type_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_send_community_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_send_community_type_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_send_community_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_send_community_type_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_send_community_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_send_community_type_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_send_community_type_cmd);
- /* "neighbor route-reflector" commands.*/
- install_element (BGP_NODE, &neighbor_route_reflector_client_cmd);
- install_element (BGP_NODE, &no_neighbor_route_reflector_client_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_route_reflector_client_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_route_reflector_client_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_route_reflector_client_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_route_reflector_client_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_route_reflector_client_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_route_reflector_client_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_route_reflector_client_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_route_reflector_client_cmd);
- /* "neighbor route-server" commands.*/
- install_element (BGP_NODE, &neighbor_route_server_client_cmd);
- install_element (BGP_NODE, &no_neighbor_route_server_client_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_route_server_client_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_route_server_client_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_route_server_client_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_route_server_client_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_route_server_client_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_route_server_client_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_route_server_client_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_route_server_client_cmd);
- /* "neighbor transport connection-mode" commands. */
- install_element (BGP_NODE, &neighbor_transport_connection_mode_cmd);
- install_element (BGP_NODE, &no_neighbor_transport_connection_mode_cmd);
- install_element (BGP_NODE, &no_neighbor_transport_connection_mode_val_cmd);
- install_element (BGP_NODE, &neighbor_passive_cmd);
- /* "neighbor shutdown" commands. */
- install_element (BGP_NODE, &neighbor_shutdown_cmd);
- install_element (BGP_NODE, &no_neighbor_shutdown_cmd);
- /* "neighbor capability orf prefix-list" commands.*/
- install_element (BGP_NODE, &neighbor_capability_orf_prefix_cmd);
- install_element (BGP_NODE, &no_neighbor_capability_orf_prefix_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_capability_orf_prefix_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_capability_orf_prefix_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_capability_orf_prefix_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_capability_orf_prefix_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_capability_orf_prefix_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_capability_orf_prefix_cmd);
- /* "neighbor capability dynamic" commands.*/
- install_element (BGP_NODE, &neighbor_capability_dynamic_cmd);
- install_element (BGP_NODE, &no_neighbor_capability_dynamic_cmd);
- /* "neighbor dont-capability-negotiate" commands. */
- install_element (BGP_NODE, &neighbor_dont_capability_negotiate_cmd);
- install_element (BGP_NODE, &no_neighbor_dont_capability_negotiate_cmd);
- /* "neighbor ebgp-multihop" commands. */
- install_element (BGP_NODE, &neighbor_ebgp_multihop_cmd);
- install_element (BGP_NODE, &neighbor_ebgp_multihop_ttl_cmd);
- install_element (BGP_NODE, &no_neighbor_ebgp_multihop_cmd);
- install_element (BGP_NODE, &no_neighbor_ebgp_multihop_ttl_cmd);
- /* "neighbor disable-connected-check" commands. */
- install_element (BGP_NODE, &neighbor_disable_connected_check_cmd);
- install_element (BGP_NODE, &no_neighbor_disable_connected_check_cmd);
- install_element (BGP_NODE, &neighbor_enforce_multihop_cmd);
- /* "neighbor description" commands. */
- install_element (BGP_NODE, &neighbor_description_cmd);
- install_element (BGP_NODE, &no_neighbor_description_cmd);
- install_element (BGP_NODE, &no_neighbor_description_val_cmd);
- /* "neighbor update-source" commands. "*/
- install_element (BGP_NODE, &neighbor_update_source_cmd);
- install_element (BGP_NODE, &no_neighbor_update_source_cmd);
- /* "neighbor default-originate" commands. */
- install_element (BGP_NODE, &neighbor_default_originate_cmd);
- install_element (BGP_NODE, &neighbor_default_originate_rmap_cmd);
- install_element (BGP_NODE, &no_neighbor_default_originate_cmd);
- install_element (BGP_NODE, &no_neighbor_default_originate_rmap_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_default_originate_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_default_originate_rmap_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_default_originate_rmap_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_default_originate_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_default_originate_rmap_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_default_originate_rmap_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_default_originate_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_default_originate_rmap_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_default_originate_rmap_cmd);
- /* "neighbor port" commands. */
- install_element (BGP_NODE, &neighbor_port_cmd);
- install_element (BGP_NODE, &no_neighbor_port_cmd);
- install_element (BGP_NODE, &no_neighbor_port_val_cmd);
- /* "neighbor weight" commands. */
- install_element (BGP_NODE, &neighbor_weight_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_weight_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_weight_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_weight_cmd);
- install_element (BGP_NODE, &no_neighbor_weight_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_weight_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_weight_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_weight_cmd);
- install_element (BGP_NODE, &no_neighbor_weight_val_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_weight_val_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_weight_val_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_weight_val_cmd);
- /* "neighbor override-capability" commands. */
- install_element (BGP_NODE, &neighbor_override_capability_cmd);
- install_element (BGP_NODE, &no_neighbor_override_capability_cmd);
- /* "neighbor strict-capability-match" commands. */
- install_element (BGP_NODE, &neighbor_strict_capability_cmd);
- install_element (BGP_NODE, &no_neighbor_strict_capability_cmd);
- /* "neighbor timers" commands. */
- install_element (BGP_NODE, &neighbor_timers_cmd);
- install_element (BGP_NODE, &no_neighbor_timers_cmd);
- /* "neighbor advertisement-interval" commands. */
- install_element (BGP_NODE, &neighbor_advertise_interval_cmd);
- install_element (BGP_NODE, &no_neighbor_advertise_interval_cmd);
- install_element (BGP_NODE, &no_neighbor_advertise_interval_val_cmd);
- /* "neighbor version" commands. */
- install_element (BGP_NODE, &neighbor_version_cmd);
- /* "neighbor interface" commands. */
- install_element (BGP_NODE, &neighbor_interface_cmd);
- install_element (BGP_NODE, &no_neighbor_interface_cmd);
- /* "neighbor distribute" commands. */
- install_element (BGP_NODE, &neighbor_distribute_list_cmd);
- install_element (BGP_NODE, &no_neighbor_distribute_list_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_distribute_list_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_distribute_list_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_distribute_list_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_distribute_list_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_distribute_list_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_distribute_list_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_distribute_list_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_distribute_list_cmd);
- /* "neighbor prefix-list" commands. */
- install_element (BGP_NODE, &neighbor_prefix_list_cmd);
- install_element (BGP_NODE, &no_neighbor_prefix_list_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_prefix_list_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_prefix_list_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_prefix_list_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_prefix_list_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_prefix_list_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_prefix_list_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_prefix_list_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_prefix_list_cmd);
- /* "neighbor filter-list" commands. */
- install_element (BGP_NODE, &neighbor_filter_list_cmd);
- install_element (BGP_NODE, &no_neighbor_filter_list_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_filter_list_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_filter_list_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_filter_list_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_filter_list_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_filter_list_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_filter_list_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_filter_list_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_filter_list_cmd);
- /* "neighbor route-map" commands. */
- install_element (BGP_NODE, &neighbor_route_map_cmd);
- install_element (BGP_NODE, &no_neighbor_route_map_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_route_map_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_route_map_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_route_map_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_route_map_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_route_map_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_route_map_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_route_map_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_route_map_cmd);
- /* "neighbor unsuppress-map" commands. */
- install_element (BGP_NODE, &neighbor_unsuppress_map_cmd);
- install_element (BGP_NODE, &no_neighbor_unsuppress_map_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_unsuppress_map_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_unsuppress_map_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_unsuppress_map_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_unsuppress_map_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_unsuppress_map_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_unsuppress_map_cmd);
- /* "neighbor maximum-prefix" commands. */
- install_element (BGP_NODE, &neighbor_maximum_prefix_cmd);
- install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_NODE, &neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_NODE, &neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_NODE, &no_neighbor_maximum_prefix_cmd);
- install_element (BGP_NODE, &no_neighbor_maximum_prefix_val_cmd);
- install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_NODE, &no_neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_NODE, &no_neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_val_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_val_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_val_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_maximum_prefix_threshold_restart_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_val_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_warning_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_warning_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_restart_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_maximum_prefix_threshold_restart_cmd);
- /* "neighbor allowas-in" */
- install_element (BGP_NODE, &neighbor_allowas_in_cmd);
- install_element (BGP_NODE, &neighbor_allowas_in_arg_cmd);
- install_element (BGP_NODE, &no_neighbor_allowas_in_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_allowas_in_cmd);
- install_element (BGP_IPV4_NODE, &neighbor_allowas_in_arg_cmd);
- install_element (BGP_IPV4_NODE, &no_neighbor_allowas_in_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_cmd);
- install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_arg_cmd);
- install_element (BGP_IPV4M_NODE, &no_neighbor_allowas_in_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_allowas_in_cmd);
- install_element (BGP_IPV6_NODE, &neighbor_allowas_in_arg_cmd);
- install_element (BGP_IPV6_NODE, &no_neighbor_allowas_in_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_cmd);
- install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_arg_cmd);
- install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd);
- /* address-family commands. */
- install_element (BGP_NODE, &address_family_ipv4_cmd);
- install_element (BGP_NODE, &address_family_ipv4_safi_cmd);
- #ifdef HAVE_IPV6
- install_element (BGP_NODE, &address_family_ipv6_cmd);
- install_element (BGP_NODE, &address_family_ipv6_unicast_cmd);
- #endif /* HAVE_IPV6 */
- install_element (BGP_NODE, &address_family_vpnv4_cmd);
- install_element (BGP_NODE, &address_family_vpnv4_unicast_cmd);
- /* "exit-address-family" command. */
- install_element (BGP_IPV4_NODE, &exit_address_family_cmd);
- install_element (BGP_IPV4M_NODE, &exit_address_family_cmd);
- install_element (BGP_IPV6_NODE, &exit_address_family_cmd);
- install_element (BGP_VPNV4_NODE, &exit_address_family_cmd);
- /* "clear ip bgp commands" */
- install_element (ENABLE_NODE, &clear_ip_bgp_all_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_cmd);
- #ifdef HAVE_IPV6
- install_element (ENABLE_NODE, &clear_bgp_all_cmd);
- install_element (ENABLE_NODE, &clear_bgp_instance_all_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_all_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_group_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_cmd);
- install_element (ENABLE_NODE, &clear_bgp_external_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_external_cmd);
- install_element (ENABLE_NODE, &clear_bgp_as_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_as_cmd);
- #endif /* HAVE_IPV6 */
- /* "clear ip bgp neighbor soft in" */
- install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_in_cmd);
- #ifdef HAVE_IPV6
- install_element (ENABLE_NODE, &clear_bgp_all_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_all_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_all_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_group_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_group_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_external_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_external_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_external_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_as_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_as_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_as_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_all_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_external_in_prefix_filter_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_as_in_prefix_filter_cmd);
- #endif /* HAVE_IPV6 */
- /* "clear ip bgp neighbor soft out" */
- install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_out_cmd);
- #ifdef HAVE_IPV6
- install_element (ENABLE_NODE, &clear_bgp_all_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_all_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_group_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_external_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_external_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_as_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_as_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_all_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_external_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_out_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_as_out_cmd);
- #endif /* HAVE_IPV6 */
- /* "clear ip bgp neighbor soft" */
- install_element (ENABLE_NODE, &clear_ip_bgp_all_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_ipv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_instance_all_ipv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_ipv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_group_ipv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_external_ipv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_ipv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_all_vpnv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_peer_vpnv4_soft_cmd);
- install_element (ENABLE_NODE, &clear_ip_bgp_as_vpnv4_soft_cmd);
- #ifdef HAVE_IPV6
- install_element (ENABLE_NODE, &clear_bgp_all_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_instance_all_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_peer_group_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_external_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_as_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_all_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_peer_group_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_external_soft_cmd);
- install_element (ENABLE_NODE, &clear_bgp_ipv6_as_soft_cmd);
- #endif /* HAVE_IPV6 */
- /* "show ip bgp summary" commands. */
- install_element (VIEW_NODE, &show_ip_bgp_summary_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_instance_summary_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_ipv4_summary_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
- #ifdef HAVE_IPV6
- install_element (VIEW_NODE, &show_bgp_summary_cmd);
- install_element (VIEW_NODE, &show_bgp_instance_summary_cmd);
- install_element (VIEW_NODE, &show_bgp_ipv6_summary_cmd);
- install_element (VIEW_NODE, &show_bgp_instance_ipv6_summary_cmd);
- #endif /* HAVE_IPV6 */
- install_element (ENABLE_NODE, &show_ip_bgp_summary_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_instance_summary_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_ipv4_summary_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_instance_ipv4_summary_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_summary_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_summary_cmd);
- #ifdef HAVE_IPV6
- install_element (ENABLE_NODE, &show_bgp_summary_cmd);
- install_element (ENABLE_NODE, &show_bgp_instance_summary_cmd);
- install_element (ENABLE_NODE, &show_bgp_ipv6_summary_cmd);
- install_element (ENABLE_NODE, &show_bgp_instance_ipv6_summary_cmd);
- #endif /* HAVE_IPV6 */
- /* "show ip bgp neighbors" commands. */
- install_element (VIEW_NODE, &show_ip_bgp_neighbors_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_neighbors_peer_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_neighbors_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_neighbors_peer_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_ipv4_neighbors_peer_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_all_neighbors_peer_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_vpnv4_rd_neighbors_peer_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_instance_neighbors_peer_cmd);
- #ifdef HAVE_IPV6
- install_element (VIEW_NODE, &show_bgp_neighbors_cmd);
- install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_cmd);
- install_element (VIEW_NODE, &show_bgp_neighbors_peer_cmd);
- install_element (VIEW_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
- install_element (ENABLE_NODE, &show_bgp_neighbors_cmd);
- install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_cmd);
- install_element (ENABLE_NODE, &show_bgp_neighbors_peer_cmd);
- install_element (ENABLE_NODE, &show_bgp_ipv6_neighbors_peer_cmd);
- #endif /* HAVE_IPV6 */
- /* "show ip bgp paths" commands. */
- install_element (VIEW_NODE, &show_ip_bgp_paths_cmd);
- install_element (VIEW_NODE, &show_ip_bgp_ipv4_paths_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_paths_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_ipv4_paths_cmd);
- /* "show ip bgp community" commands. */
- install_element (VIEW_NODE, &show_ip_bgp_community_info_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_community_info_cmd);
- /* "show ip bgp attribute-info" commands. */
- install_element (VIEW_NODE, &show_ip_bgp_attr_info_cmd);
- install_element (ENABLE_NODE, &show_ip_bgp_attr_info_cmd);
- /* "redistribute" commands. */
- install_element (BGP_NODE, &bgp_redistribute_ipv4_cmd);
- install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_cmd);
- install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_cmd);
- install_element (BGP_NODE, &bgp_redistribute_ipv4_rmap_metric_cmd);
- install_element (BGP_NODE, &bgp_redistribute_ipv4_metric_rmap_cmd);
- install_element (BGP_IPV4_NODE, &bgp_redistribute_ipv4_cmd);
- install_element (BGP_IPV4_NODE, &bgp_redistribute_ipv4_rmap_cmd);
- install_element (BGP_IPV4_NODE, &bgp_redistribute_ipv4_metric_cmd);
- install_element (BGP_IPV4_NODE, &bgp_redistribute_ipv4_rmap_metric_cmd);
- install_element (BGP_IPV4_NODE, &bgp_redistribute_ipv4_metric_rmap_cmd);
- install_element (BGP_NODE, &no_bgp_redistribute_ipv4_cmd);
- install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_cmd);
- install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_cmd);
- install_element (BGP_NODE, &no_bgp_redistribute_ipv4_rmap_metric_cmd);
- install_element (BGP_NODE, &no_bgp_redistribute_ipv4_metric_rmap_cmd);
- install_element (BGP_IPV4_NODE, &no_bgp_redistribute_ipv4_cmd);
- install_element (BGP_IPV4_NODE, &no_bgp_redistribute_ipv4_rmap_cmd);
- install_element (BGP_IPV4_NODE, &no_bgp_redistribute_ipv4_metric_cmd);
- install_element (BGP_IPV4_NODE, &no_bgp_redistribute_ipv4_rmap_metric_cmd);
- install_element (BGP_IPV4_NODE, &no_bgp_redistribute_ipv4_metric_rmap_cmd);
- #ifdef HAVE_IPV6
- install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_cmd);
- install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_cmd);
- install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_cmd);
- install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_cmd);
- install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_cmd);
- install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_cmd);
- install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_rmap_metric_cmd);
- install_element (BGP_IPV6_NODE, &bgp_redistribute_ipv6_metric_rmap_cmd);
- install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_rmap_metric_cmd);
- install_element (BGP_IPV6_NODE, &no_bgp_redistribute_ipv6_metric_rmap_cmd);
- #endif /* HAVE_IPV6 */
- /* Community-list. */
- community_list_vty ();
- }
- #include "memory.h"
- #include "bgp_regex.h"
- #include "bgp_clist.h"
- #include "bgp_ecommunity.h"
- /* VTY functions. */
- /* Direction value to string conversion. */
- char *
- community_direct_str (int direct)
- {
- switch (direct)
- {
- case COMMUNITY_DENY:
- return "deny";
- break;
- case COMMUNITY_PERMIT:
- return "permit";
- break;
- default:
- return "unknown";
- break;
- }
- }
- /* Display error string. */
- void
- community_list_perror (struct vty *vty, int ret)
- {
- switch (ret)
- {
- case COMMUNITY_LIST_ERR_CANT_FIND_LIST:
- vty_out (vty, "%% Can't find communit-list%s", VTY_NEWLINE);
- break;
- case COMMUNITY_LIST_ERR_MALFORMED_VAL:
- vty_out (vty, "%% Malformed community-list value%s", VTY_NEWLINE);
- break;
- case COMMUNITY_LIST_ERR_STANDARD_CONFLICT:
- vty_out (vty, "%% Community name conflict, previously defined as standard community%s", VTY_NEWLINE);
- break;
- case COMMUNITY_LIST_ERR_EXPANDED_CONFLICT:
- vty_out (vty, "%% Community name conflict, previously defined as expanded community%s", VTY_NEWLINE);
- break;
- }
- }
- /* VTY interface for community_set() function. */
- int
- community_list_set_vty (struct vty *vty, int argc, char **argv, int style,
- int reject_all_digit_name)
- {
- int ret;
- int direct;
- char *str;
- /* Check the list type. */
- if (strncmp (argv[1], "p", 1) == 0)
- direct = COMMUNITY_PERMIT;
- else if (strncmp (argv[1], "d", 1) == 0)
- direct = COMMUNITY_DENY;
- else
- {
- vty_out (vty, "%% Matching condition must be permit or deny%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- /* All digit name check. */
- if (reject_all_digit_name && all_digit (argv[0]))
- {
- vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- /* Concat community string argument. */
- if (argc > 1)
- str = argv_concat (argv, argc, 2);
- else
- str = NULL;
- /* When community_list_set() return nevetive value, it means
- malformed community string. */
- ret = community_list_set (bgp_clist, argv[0], str, direct, style);
- /* Free temporary community list string allocated by
- argv_concat(). */
- if (str)
- XFREE (MTYPE_TMP, str);
- if (ret < 0)
- {
- /* Display error string. */
- community_list_perror (vty, ret);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
- }
- /* Communiyt-list entry delete. */
- int
- community_list_unset_vty (struct vty *vty, int argc, char **argv, int style)
- {
- int ret;
- int direct = 0;
- char *str = NULL;
- if (argc > 1)
- {
- /* Check the list direct. */
- if (strncmp (argv[1], "p", 1) == 0)
- direct = COMMUNITY_PERMIT;
- else if (strncmp (argv[1], "d", 1) == 0)
- direct = COMMUNITY_DENY;
- else
- {
- vty_out (vty, "%% Matching condition must be permit or deny%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- /* Concat community string argument. */
- str = argv_concat (argv, argc, 2);
- }
- /* Unset community list. */
- ret = community_list_unset (bgp_clist, argv[0], str, direct, style);
- /* Free temporary community list string allocated by
- argv_concat(). */
- if (str)
- XFREE (MTYPE_TMP, str);
- if (ret < 0)
- {
- community_list_perror (vty, ret);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
- }
- /* "community-list" keyword help string. */
- #define COMMUNITY_LIST_STR "Add a community list entryn"
- #define COMMUNITY_VAL_STR "Community number in aa:nn format or internet|local-AS|no-advertise|no-exportn"
- DEFUN (ip_community_list_standard,
- ip_community_list_standard_cmd,
- "ip community-list <1-99> (deny|permit) .AA:NN",
- IP_STR
- COMMUNITY_LIST_STR
- "Community list number (standard)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- COMMUNITY_VAL_STR)
- {
- return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0);
- }
- ALIAS (ip_community_list_standard,
- ip_community_list_standard2_cmd,
- "ip community-list <1-99> (deny|permit)",
- IP_STR
- COMMUNITY_LIST_STR
- "Community list number (standard)n"
- "Specify community to rejectn"
- "Specify community to acceptn");
- DEFUN (ip_community_list_expanded,
- ip_community_list_expanded_cmd,
- "ip community-list <100-500> (deny|permit) .LINE",
- IP_STR
- COMMUNITY_LIST_STR
- "Community list number (expanded)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 0);
- }
- DEFUN (ip_community_list_name_standard,
- ip_community_list_name_standard_cmd,
- "ip community-list standard WORD (deny|permit) .AA:NN",
- IP_STR
- COMMUNITY_LIST_STR
- "Add a standard community-list entryn"
- "Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- COMMUNITY_VAL_STR)
- {
- return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 1);
- }
- ALIAS (ip_community_list_name_standard,
- ip_community_list_name_standard2_cmd,
- "ip community-list standard WORD (deny|permit)",
- IP_STR
- COMMUNITY_LIST_STR
- "Add a standard community-list entryn"
- "Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn");
- DEFUN (ip_community_list_name_expanded,
- ip_community_list_name_expanded_cmd,
- "ip community-list expanded WORD (deny|permit) .LINE",
- IP_STR
- COMMUNITY_LIST_STR
- "Add an expanded community-list entryn"
- "Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return community_list_set_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 1);
- }
- DEFUN (no_ip_community_list_standard_all,
- no_ip_community_list_standard_all_cmd,
- "no ip community-list <1-99>",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Community list number (standard)n")
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_community_list_expanded_all,
- no_ip_community_list_expanded_all_cmd,
- "no ip community-list <100-500>",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Community list number (expanded)n")
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
- }
- DEFUN (no_ip_community_list_name_standard_all,
- no_ip_community_list_name_standard_all_cmd,
- "no ip community-list standard WORD",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Add a standard community-list entryn"
- "Community list namen")
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_community_list_name_expanded_all,
- no_ip_community_list_name_expanded_all_cmd,
- "no ip community-list expanded WORD",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Add an expanded community-list entryn"
- "Community list namen")
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
- }
- DEFUN (no_ip_community_list_standard,
- no_ip_community_list_standard_cmd,
- "no ip community-list <1-99> (deny|permit) .AA:NN",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Community list number (standard)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- COMMUNITY_VAL_STR)
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_community_list_expanded,
- no_ip_community_list_expanded_cmd,
- "no ip community-list <100-500> (deny|permit) .LINE",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Community list number (expanded)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
- }
- DEFUN (no_ip_community_list_name_standard,
- no_ip_community_list_name_standard_cmd,
- "no ip community-list standard WORD (deny|permit) .AA:NN",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Specify a standard community-listn"
- "Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- COMMUNITY_VAL_STR)
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_community_list_name_expanded,
- no_ip_community_list_name_expanded_cmd,
- "no ip community-list expanded WORD (deny|permit) .LINE",
- NO_STR
- IP_STR
- COMMUNITY_LIST_STR
- "Specify an expanded community-listn"
- "Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
- }
- void
- community_list_show (struct vty *vty, struct community_list *list)
- {
- struct community_entry *entry;
- for (entry = list->head; entry; entry = entry->next)
- {
- if (entry == list->head)
- {
- if (all_digit (list->name))
- vty_out (vty, "Community %s list %s%s",
- entry->style == COMMUNITY_LIST_STANDARD ?
- "standard" : "(expanded) access",
- list->name, VTY_NEWLINE);
- else
- vty_out (vty, "Named Community %s list %s%s",
- entry->style == COMMUNITY_LIST_STANDARD ?
- "standard" : "expanded",
- list->name, VTY_NEWLINE);
- }
- if (entry->any)
- vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTY_NEWLINE);
- else
- vty_out (vty, " %s %s%s",
- community_direct_str (entry->direct),
- entry->style == COMMUNITY_LIST_STANDARD
- ? community_str (entry->u.com) : entry->config,
- VTY_NEWLINE);
- }
- }
- DEFUN (show_ip_community_list,
- show_ip_community_list_cmd,
- "show ip community-list",
- SHOW_STR
- IP_STR
- "List community-listn")
- {
- struct community_list *list;
- struct community_list_master *cm;
- cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER);
- if (! cm)
- return CMD_SUCCESS;
- for (list = cm->num.head; list; list = list->next)
- community_list_show (vty, list);
- for (list = cm->str.head; list; list = list->next)
- community_list_show (vty, list);
- return CMD_SUCCESS;
- }
- DEFUN (show_ip_community_list_arg,
- show_ip_community_list_arg_cmd,
- "show ip community-list (<1-500>|WORD)",
- SHOW_STR
- IP_STR
- "List community-listn"
- "Community-list numbern"
- "Community-list namen")
- {
- struct community_list *list;
- list = community_list_lookup (bgp_clist, argv[0], COMMUNITY_LIST_MASTER);
- if (! list)
- {
- vty_out (vty, "%% Can't find communit-list%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- community_list_show (vty, list);
- return CMD_SUCCESS;
- }
- int
- extcommunity_list_set_vty (struct vty *vty, int argc, char **argv, int style,
- int reject_all_digit_name)
- {
- int ret;
- int direct;
- char *str;
- /* Check the list type. */
- if (strncmp (argv[1], "p", 1) == 0)
- direct = COMMUNITY_PERMIT;
- else if (strncmp (argv[1], "d", 1) == 0)
- direct = COMMUNITY_DENY;
- else
- {
- vty_out (vty, "%% Matching condition must be permit or deny%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- /* All digit name check. */
- if (reject_all_digit_name && all_digit (argv[0]))
- {
- vty_out (vty, "%% Community name cannot have all digits%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- /* Concat community string argument. */
- if (argc > 1)
- str = argv_concat (argv, argc, 2);
- else
- str = NULL;
- ret = extcommunity_list_set (bgp_clist, argv[0], str, direct, style);
- /* Free temporary community list string allocated by
- argv_concat(). */
- if (str)
- XFREE (MTYPE_TMP, str);
- if (ret < 0)
- {
- community_list_perror (vty, ret);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
- }
- int
- extcommunity_list_unset_vty (struct vty *vty, int argc, char **argv, int style)
- {
- int ret;
- int direct = 0;
- char *str = NULL;
- if (argc > 1)
- {
- /* Check the list direct. */
- if (strncmp (argv[1], "p", 1) == 0)
- direct = COMMUNITY_PERMIT;
- else if (strncmp (argv[1], "d", 1) == 0)
- direct = COMMUNITY_DENY;
- else
- {
- vty_out (vty, "%% Matching condition must be permit or deny%s",
- VTY_NEWLINE);
- return CMD_WARNING;
- }
- /* Concat community string argument. */
- str = argv_concat (argv, argc, 2);
- }
- /* Unset community list. */
- ret = extcommunity_list_unset (bgp_clist, argv[0], str, direct, style);
- /* Free temporary community list string allocated by
- argv_concat(). */
- if (str)
- XFREE (MTYPE_TMP, str);
- if (ret < 0)
- {
- community_list_perror (vty, ret);
- return CMD_WARNING;
- }
- return CMD_SUCCESS;
- }
- /* "extcommunity-list" keyword help string. */
- #define EXTCOMMUNITY_LIST_STR "Add a extended community list entryn"
- #define EXTCOMMUNITY_VAL_STR "Extended community attribute in 'rt aa:nn_or_IPaddr:nn' OR 'soo aa:nn_or_IPaddr:nn' formatn"
- DEFUN (ip_extcommunity_list_standard,
- ip_extcommunity_list_standard_cmd,
- "ip extcommunity-list <1-99> (deny|permit) .AA:NN",
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Extended Community list number (standard)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- EXTCOMMUNITY_VAL_STR)
- {
- return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0);
- }
- ALIAS (ip_extcommunity_list_standard,
- ip_extcommunity_list_standard2_cmd,
- "ip extcommunity-list <1-99> (deny|permit)",
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Extended Community list number (standard)n"
- "Specify community to rejectn"
- "Specify community to acceptn");
- DEFUN (ip_extcommunity_list_expanded,
- ip_extcommunity_list_expanded_cmd,
- "ip extcommunity-list <100-500> (deny|permit) .LINE",
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Extended Community list number (expanded)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 0);
- }
- DEFUN (ip_extcommunity_list_name_standard,
- ip_extcommunity_list_name_standard_cmd,
- "ip extcommunity-list standard WORD (deny|permit) .AA:NN",
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Specify standard extcommunity-listn"
- "Extended Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- EXTCOMMUNITY_VAL_STR)
- {
- return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 1);
- }
- ALIAS (ip_extcommunity_list_name_standard,
- ip_extcommunity_list_name_standard2_cmd,
- "ip extcommunity-list standard WORD (deny|permit)",
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Specify standard extcommunity-listn"
- "Extended Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn");
- DEFUN (ip_extcommunity_list_name_expanded,
- ip_extcommunity_list_name_expanded_cmd,
- "ip extcommunity-list expanded WORD (deny|permit) .LINE",
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Specify expanded extcommunity-listn"
- "Extended Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return extcommunity_list_set_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 1);
- }
- DEFUN (no_ip_extcommunity_list_standard_all,
- no_ip_extcommunity_list_standard_all_cmd,
- "no ip extcommunity-list <1-99>",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Extended Community list number (standard)n")
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_extcommunity_list_expanded_all,
- no_ip_extcommunity_list_expanded_all_cmd,
- "no ip extcommunity-list <100-500>",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Extended Community list number (expanded)n")
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
- }
- DEFUN (no_ip_extcommunity_list_name_standard_all,
- no_ip_extcommunity_list_name_standard_all_cmd,
- "no ip extcommunity-list standard WORD",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Specify standard extcommunity-listn"
- "Extended Community list namen")
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_extcommunity_list_name_expanded_all,
- no_ip_extcommunity_list_name_expanded_all_cmd,
- "no ip extcommunity-list expanded WORD",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Specify expanded extcommunity-listn"
- "Extended Community list namen")
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
- }
- DEFUN (no_ip_extcommunity_list_standard,
- no_ip_extcommunity_list_standard_cmd,
- "no ip extcommunity-list <1-99> (deny|permit) .AA:NN",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Extended Community list number (standard)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- EXTCOMMUNITY_VAL_STR)
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_extcommunity_list_expanded,
- no_ip_extcommunity_list_expanded_cmd,
- "no ip extcommunity-list <100-500> (deny|permit) .LINE",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Extended Community list number (expanded)n"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
- }
- DEFUN (no_ip_extcommunity_list_name_standard,
- no_ip_extcommunity_list_name_standard_cmd,
- "no ip extcommunity-list standard WORD (deny|permit) .AA:NN",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Specify standard extcommunity-listn"
- "Extended Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- EXTCOMMUNITY_VAL_STR)
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
- }
- DEFUN (no_ip_extcommunity_list_name_expanded,
- no_ip_extcommunity_list_name_expanded_cmd,
- "no ip extcommunity-list expanded WORD (deny|permit) .LINE",
- NO_STR
- IP_STR
- EXTCOMMUNITY_LIST_STR
- "Specify expanded extcommunity-listn"
- "Community list namen"
- "Specify community to rejectn"
- "Specify community to acceptn"
- "An ordered list as a regular-expressionn")
- {
- return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
- }
- void
- extcommunity_list_show (struct vty *vty, struct community_list *list)
- {
- struct community_entry *entry;
- for (entry = list->head; entry; entry = entry->next)
- {
- if (entry == list->head)
- {
- if (all_digit (list->name))
- vty_out (vty, "Extended community %s list %s%s",
- entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- "standard" : "(expanded) access",
- list->name, VTY_NEWLINE);
- else
- vty_out (vty, "Named extended community %s list %s%s",
- entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- "standard" : "expanded",
- list->name, VTY_NEWLINE);
- }
- if (entry->any)
- vty_out (vty, " %s%s",
- community_direct_str (entry->direct), VTY_NEWLINE);
- else
- vty_out (vty, " %s %s%s",
- community_direct_str (entry->direct),
- entry->style == EXTCOMMUNITY_LIST_STANDARD ?
- entry->u.ecom->str : entry->config,
- VTY_NEWLINE);
- }
- }
- DEFUN (show_ip_extcommunity_list,
- show_ip_extcommunity_list_cmd,
- "show ip extcommunity-list",
- SHOW_STR
- IP_STR
- "List extended-community listn")
- {
- struct community_list *list;
- struct community_list_master *cm;
- cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER);
- if (! cm)
- return CMD_SUCCESS;
- for (list = cm->num.head; list; list = list->next)
- extcommunity_list_show (vty, list);
- for (list = cm->str.head; list; list = list->next)
- extcommunity_list_show (vty, list);
- return CMD_SUCCESS;
- }
- DEFUN (show_ip_extcommunity_list_arg,
- show_ip_extcommunity_list_arg_cmd,
- "show ip extcommunity-list (<1-500>|WORD)",
- SHOW_STR
- IP_STR
- "List extended-community listn"
- "Extcommunity-list numbern"
- "Extcommunity-list namen")
- {
- struct community_list *list;
- list = community_list_lookup (bgp_clist, argv[0], EXTCOMMUNITY_LIST_MASTER);
- if (! list)
- {
- vty_out (vty, "%% Can't find extcommunit-list%s", VTY_NEWLINE);
- return CMD_WARNING;
- }
- extcommunity_list_show (vty, list);
- return CMD_SUCCESS;
- }
- /* Return configuration string of community-list entry. */
- static char *
- community_list_config_str (struct community_entry *entry)
- {
- char *str;
- if (entry->any)
- str = "";
- else
- {
- if (entry->style == COMMUNITY_LIST_STANDARD)
- str = community_str (entry->u.com);
- else
- str = entry->config;
- }
- return str;
- }
- /* Display community-list and extcommunity-list configuration. */
- int
- community_list_config_write (struct vty *vty)
- {
- struct community_list *list;
- struct community_entry *entry;
- struct community_list_master *cm;
- int write = 0;
- /* Community-list. */
- cm = community_list_master_lookup (bgp_clist, COMMUNITY_LIST_MASTER);
- for (list = cm->num.head; list; list = list->next)
- for (entry = list->head; entry; entry = entry->next)
- {
- vty_out (vty, "ip community-list %s %s %s%s",
- list->name, community_direct_str (entry->direct),
- community_list_config_str (entry),
- VTY_NEWLINE);
- write++;
- }
- for (list = cm->str.head; list; list = list->next)
- for (entry = list->head; entry; entry = entry->next)
- {
- vty_out (vty, "ip community-list %s %s %s %s%s",
- entry->style == COMMUNITY_LIST_STANDARD
- ? "standard" : "expanded",
- list->name, community_direct_str (entry->direct),
- community_list_config_str (entry),
- VTY_NEWLINE);
- write++;
- }
- /* Extcommunity-list. */
- cm = community_list_master_lookup (bgp_clist, EXTCOMMUNITY_LIST_MASTER);
- for (list = cm->num.head; list; list = list->next)
- for (entry = list->head; entry; entry = entry->next)
- {
- vty_out (vty, "ip extcommunity-list %s %s %s%s",
- list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
- write++;
- }
- for (list = cm->str.head; list; list = list->next)
- for (entry = list->head; entry; entry = entry->next)
- {
- vty_out (vty, "ip extcommunity-list %s %s %s %s%s",
- entry->style == EXTCOMMUNITY_LIST_STANDARD
- ? "standard" : "expanded",
- list->name, community_direct_str (entry->direct),
- community_list_config_str (entry), VTY_NEWLINE);
- write++;
- }
- return write;
- }
- struct cmd_node community_list_node =
- {
- COMMUNITY_LIST_NODE,
- "",
- 1 /* Export to vtysh. */
- };
- void
- community_list_vty ()
- {
- install_node (&community_list_node, community_list_config_write);
- /* Community-list. */
- install_element (CONFIG_NODE, &ip_community_list_standard_cmd);
- install_element (CONFIG_NODE, &ip_community_list_standard2_cmd);
- install_element (CONFIG_NODE, &ip_community_list_expanded_cmd);
- install_element (CONFIG_NODE, &ip_community_list_name_standard_cmd);
- install_element (CONFIG_NODE, &ip_community_list_name_standard2_cmd);
- install_element (CONFIG_NODE, &ip_community_list_name_expanded_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_standard_all_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_expanded_all_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_name_standard_all_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_all_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_standard_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_expanded_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_name_standard_cmd);
- install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_cmd);
- install_element (VIEW_NODE, &show_ip_community_list_cmd);
- install_element (VIEW_NODE, &show_ip_community_list_arg_cmd);
- install_element (ENABLE_NODE, &show_ip_community_list_cmd);
- install_element (ENABLE_NODE, &show_ip_community_list_arg_cmd);
- /* Extcommunity-list. */
- install_element (CONFIG_NODE, &ip_extcommunity_list_standard_cmd);
- install_element (CONFIG_NODE, &ip_extcommunity_list_standard2_cmd);
- install_element (CONFIG_NODE, &ip_extcommunity_list_expanded_cmd);
- install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard_cmd);
- install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard2_cmd);
- install_element (CONFIG_NODE, &ip_extcommunity_list_name_expanded_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_all_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_all_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_all_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_cmd);
- install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_cmd);
- install_element (VIEW_NODE, &show_ip_extcommunity_list_cmd);
- install_element (VIEW_NODE, &show_ip_extcommunity_list_arg_cmd);
- install_element (ENABLE_NODE, &show_ip_extcommunity_list_cmd);
- install_element (ENABLE_NODE, &show_ip_extcommunity_list_arg_cmd);
- /* bgpd version */
- install_element (VIEW_NODE, &show_version_bgpd_cmd);
- install_element (ENABLE_NODE, &show_version_bgpd_cmd);
- }