/* packet-bgp.c
* Definitions for BGP packet disassembly structures and routine
*
- * $Id: packet-bgp.h,v 1.20 2002/08/28 21:00:08 jmayer Exp $
+ * $Id: packet-bgp.h,v 1.25 2003/05/19 20:36:49 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
/* some handy things to know */
#define BGP_MAX_PACKET_SIZE 4096
-#define BGP_MARKER_SIZE 16
-#define BGP_HEADER_SIZE 19
+#define BGP_MARKER_SIZE 16 /* size of BGP marker */
+#define BGP_HEADER_SIZE 19 /* size of BGP header, including marker */
#define BGP_MIN_OPEN_MSG_SIZE 29
#define BGP_MIN_UPDATE_MSG_SIZE 23
#define BGP_MIN_NOTIFICATION_MSG_SIZE 21
#define BGP_NOTIFICATION 3
#define BGP_KEEPALIVE 4
#define BGP_ROUTE_REFRESH 5
+#define BGP_CAPABILITY 6
#define BGP_ROUTE_REFRESH_CISCO 0x80
-/* BGP header */
-struct bgp {
- guint8 bgp_marker[BGP_MARKER_SIZE];
- guint16 bgp_len;
- guint8 bgp_type;
-};
-
/* BGP OPEN message */
struct bgp_open {
guint8 bgpo_marker[BGP_MARKER_SIZE];
#define BGP_OPTION_CAPABILITY 2 /* RFC2842 */
/* BGP capability code */
-#define BGP_CAPABILITY_RESERVED 0 /* RFC2434 */
-#define BGP_CAPABILITY_MULTIPROTOCOL 1 /* RFC2858 */
-#define BGP_CAPABILITY_ROUTE_REFRESH 2 /* RFC2918 */
-#define BGP_CAPABILITY_COOPERATIVE_ROUTE_FILTERING 3 /* draft-ietf-idr-route-filter-04.txt */
-#define BGP_CAPABILITY_ORF_CISCO 0x82 /* Cisco */
+#define BGP_CAPABILITY_RESERVED 0 /* RFC2434 */
+#define BGP_CAPABILITY_MULTIPROTOCOL 1 /* RFC2858 */
+#define BGP_CAPABILITY_ROUTE_REFRESH 2 /* RFC2918 */
+#define BGP_CAPABILITY_COOPERATIVE_ROUTE_FILTERING 3 /* draft-ietf-idr-route-filter-04.txt */
+#define BGP_CAPABILITY_GRACEFUL_RESTART 0x40 /* draft-ietf-idr-restart-05 */
+#define BGP_CAPABILITY_4_OCTET_AS_NUMBER 0x41 /* draft-ietf-idr-as4bytes-06 */
+#define BGP_CAPABILITY_DYNAMIC_CAPABILITY 0x42 /* draft-ietf-idr-dynamic-cap-03 */
+#define BGP_CAPABILITY_ORF_CISCO 0x82 /* Cisco */
#define BGP_CAPABILITY_ROUTE_REFRESH_CISCO 0x80 /* Cisco */
#define BGP_ORF_PREFIX_CISCO 0x80 /* Cisco */
#define FOURHEXF 0xFFFF0000
/* attribute types */
-#define BGPTYPE_ORIGIN 1 /* RFC1771 */
-#define BGPTYPE_AS_PATH 2 /* RFC1771 */
-#define BGPTYPE_NEXT_HOP 3 /* RFC1771 */
-#define BGPTYPE_MULTI_EXIT_DISC 4 /* RFC1771 */
-#define BGPTYPE_LOCAL_PREF 5 /* RFC1771 */
-#define BGPTYPE_ATOMIC_AGGREGATE 6 /* RFC1771 */
-#define BGPTYPE_AGGREGATOR 7 /* RFC1771 */
-#define BGPTYPE_COMMUNITIES 8 /* RFC1997 */
-#define BGPTYPE_ORIGINATOR_ID 9 /* RFC2796 */
-#define BGPTYPE_CLUSTER_LIST 10 /* RFC2796 */
-#define BGPTYPE_DPA 11 /* work in progress */
-#define BGPTYPE_ADVERTISER 12 /* RFC1863 */
-#define BGPTYPE_RCID_PATH 13 /* RFC1863 */
-#define BGPTYPE_MP_REACH_NLRI 14 /* RFC2858 */
-#define BGPTYPE_MP_UNREACH_NLRI 15 /* RFC2858 */
+#define BGPTYPE_ORIGIN 1 /* RFC1771 */
+#define BGPTYPE_AS_PATH 2 /* RFC1771 */
+#define BGPTYPE_NEXT_HOP 3 /* RFC1771 */
+#define BGPTYPE_MULTI_EXIT_DISC 4 /* RFC1771 */
+#define BGPTYPE_LOCAL_PREF 5 /* RFC1771 */
+#define BGPTYPE_ATOMIC_AGGREGATE 6 /* RFC1771 */
+#define BGPTYPE_AGGREGATOR 7 /* RFC1771 */
+#define BGPTYPE_COMMUNITIES 8 /* RFC1997 */
+#define BGPTYPE_ORIGINATOR_ID 9 /* RFC2796 */
+#define BGPTYPE_CLUSTER_LIST 10 /* RFC2796 */
+#define BGPTYPE_DPA 11 /* work in progress */
+#define BGPTYPE_ADVERTISER 12 /* RFC1863 */
+#define BGPTYPE_RCID_PATH 13 /* RFC1863 */
+#define BGPTYPE_MP_REACH_NLRI 14 /* RFC2858 */
+#define BGPTYPE_MP_UNREACH_NLRI 15 /* RFC2858 */
#define BGPTYPE_EXTENDED_COMMUNITY 16 /* Draft Ramachandra */
+#define BGPTYPE_NEW_AS_PATH 17 /* draft-ietf-idr-as4bytes */
+#define BGPTYPE_NEW_AGGREGATOR 18 /* draft-ietf-idr-as4bytes */
/* Extended community type */
/* 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 */
/* Extended community & Route dinstinguisher formats */
#define FORMAT_AS2_LOC 0x00 /* Format AS(2bytes):AN(4bytes) */
#define FORMAT_IP_LOC 0x01 /* Format IP address:AN(2bytes) */
-#define FORMAT_AS4_LOC 0x02 /* FOrmat AS(4bytes):AN(2bytes) */
+#define FORMAT_AS4_LOC 0x02 /* Format AS(4bytes):AN(2bytes) */
/* RFC 2858 subsequent address family numbers */
#define SAFNUM_UNICAST 1