* 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]
diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 00072cc..10ccdf4 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 cad9168..c702946 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -994,14 +994,6 @@
       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 @@
   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 @@
       /* 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 @@
       /* 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 @@
       /* 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 @@
 
       /* 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 228060a..f2d554d 100644
--- a/bgpd/bgp_snmp.c
+++ b/bgpd/bgp_snmp.c
@@ -476,7 +476,7 @@
 	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 02f8e4c..dcca1a3 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -286,6 +286,17 @@
 {
   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 @@
        "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 @@
 	  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 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 @@
   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 @@
 
   /* "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 097b235..1cce8c5 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -705,7 +705,6 @@
   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 @@
   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 @@
 		   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 7a0707c..6fb66d3 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -288,7 +288,6 @@
   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 @@
 
 /* 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_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 *);