summaryrefslogtreecommitdiff
path: root/bgpd
diff options
context:
space:
mode:
authorhasso <hasso>2005-02-01 21:30:04 +0000
committerhasso <hasso>2005-02-01 21:30:04 +0000
commit3d515fd9af9f126667a9c2da9c2f40c4c37c28df (patch)
treec107224556ed7678d7a5afc42c19742948cda477 /bgpd
parent0a486e5fcb1b8dac7d8b4cf6ed93e82b8b72fed6 (diff)
* bgp_attr.c, bgp_snmp.c, bgp_vty.c, bgpd.[ch]: Remove support for old
draft - ie. "neighbor version 4-" commands. Preserve dummy "neighbor version" command as deprecated. [merge from GNU Zebra]
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/ChangeLog6
-rw-r--r--bgpd/bgp_attr.c44
-rw-r--r--bgpd/bgp_snmp.c2
-rw-r--r--bgpd/bgp_vty.c84
-rw-r--r--bgpd/bgpd.c24
-rw-r--r--bgpd/bgpd.h5
6 files changed, 20 insertions, 145 deletions
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 00072cca..10ccdf4e 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,5 +1,11 @@
2005-02-01 Akihiro Mizutani <mizutani@net-chef.net>
+ * bgp_attr.c, bgp_snmp.c, bgp_vty.c, bgpd.[ch]: Remove support for old
+ draft - ie. "neighbor version 4-" commands. Preserve dummy "neighbor
+ version" command as deprecated.
+
+2005-02-01 Akihiro Mizutani <mizutani@net-chef.net>
+
* bgpd.[ch], bgp_vty.c, bgp_route.c: "Restart session after
maximum-prefix limit" feature support.
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index cad9168d..c702946b 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -994,14 +994,6 @@ bgp_mp_reach_parse (struct peer *peer, bgp_size_t length, struct attr *attr,
stream_forward (s, (snpa_len + 1) >> 1);
}
- /* If peer is based on old draft-00. I read NLRI length from the
- packet. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- {
- bgp_size_t nlri_total_len;
- nlri_total_len = stream_getw (s);
- }
-
nlri_len = lim - stream_pnt (s);
if (safi != BGP_SAFI_VPNV4)
@@ -1538,7 +1530,6 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
if (p->family == AF_INET6)
{
unsigned long sizep;
- unsigned long draftp = 0;
stream_putc (s, BGP_ATTR_FLAG_OPTIONAL);
stream_putc (s, BGP_ATTR_MP_REACH_NLRI);
@@ -1560,29 +1551,17 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
/* SNPA */
stream_putc (s, 0);
- /* In case of old draft BGP-4+. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- {
- draftp = stream_get_putp (s);
- stream_putw (s, 0);
- }
-
/* Prefix write. */
stream_put_prefix (s, p);
/* Set MP attribute length. */
stream_putc_at (s, sizep, (stream_get_putp (s) - sizep) - 1);
-
- /* In case of old draft BGP-4+. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- stream_putw_at (s, draftp, (stream_get_putp (s) - draftp) - 2);
}
#endif /* HAVE_IPV6 */
if (p->family == AF_INET && safi == SAFI_MULTICAST)
{
unsigned long sizep;
- unsigned long draftp = 0;
stream_putc (s, BGP_ATTR_FLAG_OPTIONAL);
stream_putc (s, BGP_ATTR_MP_REACH_NLRI);
@@ -1597,28 +1576,16 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
/* SNPA */
stream_putc (s, 0);
- /* In case of old draft BGP-4+. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- {
- draftp = stream_get_putp (s);
- stream_putw (s, 0);
- }
-
/* Prefix write. */
stream_put_prefix (s, p);
/* Set MP attribute length. */
stream_putc_at (s, sizep, (stream_get_putp (s) - sizep) - 1);
-
- /* In case of old draft BGP-4+. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- stream_putw_at (s, draftp, (stream_get_putp (s) - draftp) - 2);
}
if (p->family == AF_INET && safi == SAFI_MPLS_VPN)
{
unsigned long sizep;
- unsigned long draftp = 0;
stream_putc (s, BGP_ATTR_FLAG_OPTIONAL);
stream_putc (s, BGP_ATTR_MP_REACH_NLRI);
@@ -1635,13 +1602,6 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
/* SNPA */
stream_putc (s, 0);
- /* In case of old draft BGP-4+. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- {
- draftp = stream_get_putp (s);
- stream_putw (s, 0);
- }
-
/* Tag, RD, Prefix write. */
stream_putc (s, p->prefixlen + 88);
stream_put (s, tag, 3);
@@ -1650,10 +1610,6 @@ bgp_packet_attribute (struct bgp *bgp, struct peer *peer,
/* Set MP attribute length. */
stream_putc_at (s, sizep, (stream_get_putp (s) - sizep) - 1);
-
- /* In case of old draft BGP-4+. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- stream_putw_at (s, draftp, (stream_get_putp (s) - draftp) - 2);
}
/* Extended Communities attribute. */
diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c
index 228060a0..f2d554df 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
@@ -476,7 +476,7 @@ bgpPeerTable (struct variable *v, oid name[], size_t *length,
return SNMP_INTEGER (BGP_PeerAdmin_start);
break;
case BGPPEERNEGOTIATEDVERSION:
- return SNMP_INTEGER (peer->version);
+ return SNMP_INTEGER (BGP_VERSION_4);
break;
case BGPPEERLOCALADDR:
if (peer->su_local)
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 02f8e4cf..dcca1a39 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -286,6 +286,17 @@ DEFUN (no_auto_summary,
{
return CMD_SUCCESS;
}
+
+DEFUN_DEPRECATED (neighbor_version,
+ neighbor_version_cmd,
+ NEIGHBOR_CMD "version (4|4-)",
+ NEIGHBOR_STR
+ NEIGHBOR_ADDR_STR
+ "Set the BGP version to match a neighbor\n"
+ "Neighbor's BGP version\n")
+{
+ return CMD_SUCCESS;
+}
/* "router bgp" commands. */
DEFUN (router_bgp,
@@ -3091,56 +3102,6 @@ ALIAS (no_neighbor_advertise_interval,
"Minimum interval between sending BGP routing updates\n"
"time in seconds\n")
-int
-peer_version_vty (struct vty *vty, const char *ip_str, const char *str)
-{
- int ret;
- struct peer *peer;
- int version = BGP_VERSION_4;
-
- peer = peer_lookup_vty (vty, ip_str);
- if (! peer)
- return CMD_WARNING;
-
- /* BGP version string check. */
- if (str)
- {
- if (strcmp (str, "4") == 0)
- version = BGP_VERSION_4;
- else if (strcmp (str, "4-") == 0)
- version = BGP_VERSION_MP_4_DRAFT_00;
-
- ret = peer_version_set (peer, version);
- }
- else
- ret = peer_version_unset (peer);
-
- return CMD_SUCCESS;
-}
-
-DEFUN (neighbor_version,
- neighbor_version_cmd,
- NEIGHBOR_CMD "version (4|4-)",
- NEIGHBOR_STR
- NEIGHBOR_ADDR_STR
- "Neighbor's BGP version\n"
- "Border Gateway Protocol 4\n"
- "Multiprotocol Extensions for BGP-4(Old Draft)\n")
-{
- return peer_version_vty (vty, argv[0], argv[1]);
-}
-
-DEFUN (no_neighbor_version,
- no_neighbor_version_cmd,
- NO_NEIGHBOR_CMD "version",
- NO_STR
- NEIGHBOR_STR
- NEIGHBOR_ADDR_STR
- "Neighbor's BGP version\n")
-{
- return peer_version_vty (vty, argv[0], NULL);
-}
-
/* neighbor interface */
int
peer_interface_vty (struct vty *vty, const char *ip_str, const char *str)
@@ -6438,15 +6399,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi)
else
vty_out (vty, "%*s", len, " ");
- switch (peer->version)
- {
- case BGP_VERSION_4:
- vty_out (vty, "4 ");
- break;
- case BGP_VERSION_MP_4_DRAFT_00:
- vty_out (vty, "4-");
- break;
- }
+ vty_out (vty, "4 ");
vty_out (vty, "%5d %7d %7d %8d %4d %4ld ",
peer->as,
@@ -6982,8 +6935,6 @@ bgp_show_peer (struct vty *vty, struct peer *p)
/* BGP Version. */
vty_out (vty, " BGP version 4");
- if (p->version == BGP_VERSION_MP_4_DRAFT_00)
- vty_out (vty, "(with draft-00 verion of multiporotocol extension)");
vty_out (vty, ", remote router ID %s%s",
inet_ntop (AF_INET, &p->remote_id, buf1, BUFSIZ),
VTY_NEWLINE);
@@ -7615,15 +7566,7 @@ bgp_write_rsclient_summary (struct vty *vty, struct peer *rsclient,
else
vty_out (vty, "%*s", len, " ");
- switch (rsclient->version)
- {
- case BGP_VERSION_4:
- vty_out (vty, "4 ");
- break;
- case BGP_VERSION_MP_4_DRAFT_00:
- vty_out (vty, "4-");
- break;
- }
+ vty_out (vty, "4 ");
vty_out (vty, "%5d ", rsclient->as);
@@ -8933,7 +8876,6 @@ bgp_vty_init ()
/* "neighbor version" commands. */
install_element (BGP_NODE, &neighbor_version_cmd);
- install_element (BGP_NODE, &no_neighbor_version_cmd);
/* "neighbor interface" commands. */
install_element (BGP_NODE, &neighbor_interface_cmd);
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 097b235c..1cce8c5e 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -705,7 +705,6 @@ peer_new ()
peer->v_asorig = BGP_DEFAULT_ASORIGINATE;
peer->status = Idle;
peer->ostatus = Idle;
- peer->version = BGP_VERSION_4;
peer->weight = 0;
/* Set default flags. */
@@ -3061,24 +3060,6 @@ peer_advertise_interval_unset (struct peer *peer)
return 0;
}
-int
-peer_version_set (struct peer *peer, int version)
-{
- if (version != BGP_VERSION_4 && version != BGP_VERSION_MP_4_DRAFT_00)
- return BGP_ERR_INVALID_VALUE;
-
- peer->version = version;
-
- return 0;
-}
-
-int
-peer_version_unset (struct peer *peer)
-{
- peer->version = BGP_VERSION_4;
- return 0;
-}
-
/* neighbor interface */
int
peer_interface_set (struct peer *peer, const char *str)
@@ -4350,11 +4331,6 @@ bgp_config_write_peer (struct vty *vty, struct bgp *bgp,
sockunion2str (peer->update_source, buf, SU_ADDRSTRLEN),
VTY_NEWLINE);
- /* BGP version print. */
- if (peer->version == BGP_VERSION_MP_4_DRAFT_00)
- vty_out (vty, " neighbor %s version %s%s",
- addr,"4-", VTY_NEWLINE);
-
/* advertisement-interval */
if (CHECK_FLAG (peer->config, PEER_CONFIG_ROUTEADV))
vty_out (vty, " neighbor %s advertisement-interval %d%s",
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 7a0707c0..6fb66d3f 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -288,7 +288,6 @@ struct peer
char *update_if;
union sockunion *update_source;
struct zlog *log;
- u_char version; /* Peer BGP version. */
union sockunion *su_local; /* Sockunion of local address. */
union sockunion *su_remote; /* Sockunion of remote address. */
@@ -520,7 +519,6 @@ struct bgp_nlri
/* BGP versions. */
#define BGP_VERSION_4 4
-#define BGP_VERSION_MP_4_DRAFT_00 40
/* Default BGP port number. */
#define BGP_PORT_DEFAULT 179
@@ -867,9 +865,6 @@ int peer_timers_connect_unset (struct peer *);
int peer_advertise_interval_set (struct peer *, u_int32_t);
int peer_advertise_interval_unset (struct peer *);
-int peer_version_set (struct peer *, int);
-int peer_version_unset (struct peer *);
-
int peer_interface_set (struct peer *, const char *);
int peer_interface_unset (struct peer *);