aboutsummaryrefslogtreecommitdiffstats
path: root/packet-bgp.h
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@itojun.org>1999-11-11 21:08:52 +0000
committerJun-ichiro itojun Hagino <itojun@itojun.org>1999-11-11 21:08:52 +0000
commit1d554ab6c9ab6d5383f02f7b10bd775bda8fcefc (patch)
treeeb893f633e76fe6433b78f3aef99071762156fc2 /packet-bgp.h
parent4020918fa4ce950de6dffaee301772f1a2c1d501 (diff)
bgp improvements.
- a few more tree types - RFC1771 NLRI printed on advertisements - AS_PATH parsing - lots of small cleanup on printing "byte" vs "bytes" From: Greg Hankins <gregh@cc.gatech.edu> svn path=/trunk/; revision=1015
Diffstat (limited to 'packet-bgp.h')
-rw-r--r--packet-bgp.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/packet-bgp.h b/packet-bgp.h
index 620003557d..2239aecbbe 100644
--- a/packet-bgp.h
+++ b/packet-bgp.h
@@ -1,7 +1,7 @@
/* packet-bgp.c
* Definitions for BGP packet disassembly structures and routine
*
- * $Id: packet-bgp.h,v 1.3 1999/11/06 01:28:50 itojun Exp $
+ * $Id: packet-bgp.h,v 1.4 1999/11/11 21:08:52 itojun Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -25,9 +25,6 @@
#ifndef __PACKET_BGP_H__
#define __PACKET_BGP_H__
-#include "packet.h"
-#include "packet-ipv6.h"
-
/* some handy things to know */
#define BGP_MAX_PACKET_SIZE 4096
#define BGP_MARKER_SIZE 16
@@ -75,6 +72,16 @@ struct bgp_attr {
guint8 bgpa_type;
};
+/* attribute flags, from RFC 1771 */
+#define BGP_ATTR_FLAG_OPTIONAL 0x80
+#define BGP_ATTR_FLAG_TRANSITIVE 0x40
+#define BGP_ATTR_FLAG_PARTIAL 0x20
+#define BGP_ATTR_FLAG_EXTENDED_LENGTH 0x10
+
+/* AS_PATH segment types, from RFC 1771 */
+#define AS_SET 1
+#define AS_SEQUENCE 2
+
#define BGPTYPE_ORIGIN 1 /* RFC1771 */
#define BGPTYPE_AS_PATH 2 /* RFC1771 */
#define BGPTYPE_NEXT_HOP 3 /* RFC1771 */
@@ -118,4 +125,9 @@ do { \
#define offsetof(type, member) ((size_t)(&((type *)0)->member))
#endif
+/*
+ * Convert prefix length into number of guint8s needed for prefix.
+ */
+#define convert_prefix(p) (((p) + 7) / (8))
+
#endif