Ethereal-dev: [Ethereal-dev] BGP Extended Community update

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Motonori Shindo <mshindo@xxxxxxxxxxx>
Date: Sun, 18 May 2003 12:15:57 +0900 (JST)
Hi,

draft-ramachandra-bgp-ext-communities has been replaced by
draft-ietf-idr-bgp-ext-communities (the latest as of today is -05.txt)
with some updates. I attach a patch to keep Ethereal in sync with this
updated draft. I also deleted MAX_SIZE_OF_EXT_COM_NAMES constant
because no one is using this constant.

Regards,


Index: packet-bgp.c
===================================================================
RCS file: /cvsroot/ethereal/packet-bgp.c,v
retrieving revision 1.78
diff -u -r1.78 packet-bgp.c
--- packet-bgp.c	15 May 2003 05:35:42 -0000	1.78
+++ packet-bgp.c	18 May 2003 03:05:49 -0000
@@ -2,7 +2,7 @@
  * Routines for BGP packet dissection.
  * Copyright 1999, Jun-ichiro itojun Hagino <itojun@xxxxxxxxxx>
  *
- * $Id: packet-bgp.c,v 1.78 2003/05/15 05:35:42 guy Exp $
+ * $Id: packet-bgp.c,v 1.78 2003/05/11 06:07:37 guy Exp $
  *
  * Supports:
  * RFC1771 A Border Gateway Protocol 4 (BGP-4)
@@ -14,9 +14,9 @@
  * RFC2858 Multiprotocol Extensions for BGP-4
  * RFC2918 Route Refresh Capability for BGP-4
  * RFC3107 Carrying Label Information in BGP-4
- * Draft Ramahandra on Extended Communities Extentions
  * draft-ietf-idr-as4bytes-06
  * draft-ietf-idr-dynamic-cap-03
+ * draft-ietf-idr-bgp-ext-communities-05
  *
  * TODO:
  * Destination Preference Attribute for BGP (work in progress)
@@ -165,12 +165,13 @@
     { 0, NULL },
 };
 
-/* Beware : See also MAX_SIZE_OF_EXT_COM_NAMES */
 static const value_string bgpext_com_type[] = {
     { BGP_EXT_COM_RT_0, "Route Target" },
     { BGP_EXT_COM_RT_1, "Route Target" },
+    { BGP_EXT_COM_RT_2, "Route Target" },
     { BGP_EXT_COM_RO_0, "Route Origin" },
     { BGP_EXT_COM_RO_1, "Route Origin" },
+    { BGP_EXT_COM_RO_2, "Route Origin" },
     { BGP_EXT_COM_LINKBAND, "Link Bandwidth" },
     { BGP_EXT_COM_VPN_ORIGIN, "OSPF Domain" },
     { BGP_EXT_COM_OSPF_RTYPE, "OSPF Route Type" },
@@ -207,10 +208,6 @@
   { 0, NULL },
 };
 
-
-/* MUST be resized if a longer named extended community is added */
-#define MAX_SIZE_OF_EXT_COM_NAMES       20
-
 /* Subsequent address family identifier, RFC2858 */
 static const value_string bgpattr_nlri_safi[] = {
     { 0, "Reserved" },
@@ -2085,7 +2082,9 @@
                                                   val_to_str(ext_com,bgpext_com_type,"Unknown"));
                             switch (ext_com) {
                             case BGP_EXT_COM_RT_0:
+                            case BGP_EXT_COM_RT_2:
                             case BGP_EXT_COM_RO_0:
+                            case BGP_EXT_COM_RO_2:
                                 junk_buf_len+=snprintf(junk_buf+junk_buf_len, sizeof(junk_buf)-junk_buf_len, ": %u%s%d",
                                                        tvb_get_ntohs(tvb,q+2),":",tvb_get_ntohl(tvb,q+4));
                                 junk_buf[junk_buf_len]='\0';
Index: packet-bgp.h
===================================================================
RCS file: /cvsroot/ethereal/packet-bgp.h,v
retrieving revision 1.24
diff -u -r1.24 packet-bgp.h
--- packet-bgp.h	5 Apr 2003 11:20:54 -0000	1.24
+++ packet-bgp.h	18 May 2003 03:05:49 -0000
@@ -157,9 +157,11 @@
                                         /* draft-ramachandra-bgp-ext-communities */
 #define BGP_EXT_COM_RT_0        0x0002  /* Route Target,Format AS(2bytes):AN(4bytes) */
 #define BGP_EXT_COM_RT_1        0x0102  /* Route Target,Format IP address:AN(2bytes) */
+#define BGP_EXT_COM_RT_2        0x0202  /* Route Target,Format AS(2bytes):AN(4bytes) */
 #define BGP_EXT_COM_RO_0        0x0003  /* Route Origin,Format AS(2bytes):AN(4bytes) */
 #define BGP_EXT_COM_RO_1        0x0103  /* Route Origin,Format IP address:AN(2bytes) */
-#define BGP_EXT_COM_LINKBAND    0x4004  /* Link Bandwidth,Format AS(2B):Bandwidth(4B) */
+#define BGP_EXT_COM_RO_2        0x0203  /* Route Origin,Format AS(2bytes):AN(4bytes) */
+#define BGP_EXT_COM_LINKBAND    0x0004  /* Link Bandwidth,Format AS(2B):Bandwidth(4B) */
                                         /* rfc2547 bgp-mpls-vpns */
 #define BGP_EXT_COM_VPN_ORIGIN  0x0005  /* OSPF Domin ID / VPN of Origin  */
                                         /* draft-rosen-vpns-ospf-bgp-mpls */