summaryrefslogtreecommitdiffstats
path: root/bgpd
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@diac24.net>2009-03-13 09:49:36 +0100
committerDavid Lamparter <equinox@diac24.net>2010-02-03 05:23:25 +0100
commit553dc585041231151be4eeeb7184a61fc62817ef (patch)
treebbf6ef61d1582754fe44a4dfe93e0ad3a6f54218 /bgpd
parenta0fa577ff5a95df8f7b49f0736ac96b34c5b3c86 (diff)
downloadquagga-553dc585041231151be4eeeb7184a61fc62817ef.tar.bz2
quagga-553dc585041231151be4eeeb7184a61fc62817ef.tar.xz
bgpd: Add flags to MRT dump
Add an additional, quagga-specific flag to the MRT dump. It contains the route's flags value which has bits for "dampened", "selected", "valid", etc.
Diffstat (limited to 'bgpd')
-rw-r--r--bgpd/bgp_attr.c10
-rw-r--r--bgpd/bgp_attr.h2
-rw-r--r--bgpd/bgp_dump.c2
-rw-r--r--bgpd/bgpd.h3
4 files changed, 14 insertions, 3 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index 5e7536ae..2de60031 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -2353,7 +2353,7 @@ bgp_attr_finish (void)
/* Make attribute packet. */
void
bgp_dump_routes_attr (struct stream *s, struct attr *attr,
- struct prefix *prefix)
+ struct prefix *prefix, uint16_t flags)
{
unsigned long cp;
unsigned long len;
@@ -2494,6 +2494,14 @@ bgp_dump_routes_attr (struct stream *s, struct attr *attr,
stream_putl (s, attr->pathlimit.as);
}
+ /* Quagga extended dump attribute. */
+ stream_putc (s, BGP_ATTR_FLAG_OPTIONAL);
+ stream_putc (s, BGP_ATTR_QUAGGA_DUMPEXT);
+ stream_putc (s, 3);
+ /* put a version byte to allow clean extensions */
+ stream_putc (s, 0);
+ stream_putw (s, flags);
+
/* Return total size of attribute. */
len = stream_get_endp (s) - cp - 2;
stream_putw_at (s, cp, len);
diff --git a/bgpd/bgp_attr.h b/bgpd/bgp_attr.h
index ed8753bd..a09ed61c 100644
--- a/bgpd/bgp_attr.h
+++ b/bgpd/bgp_attr.h
@@ -163,7 +163,7 @@ extern bgp_size_t bgp_packet_withdraw (struct peer *peer, struct stream *s,
struct prefix *p, afi_t, safi_t,
struct prefix_rd *, u_char *);
extern void bgp_dump_routes_attr (struct stream *, struct attr *,
- struct prefix *);
+ struct prefix *, uint16_t);
extern int attrhash_cmp (const void *, const void *);
extern unsigned int attrhash_key_make (void *);
extern void attr_show_all (struct vty *);
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index dd32164f..2f5c83af 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -368,7 +368,7 @@ bgp_dump_routes_func (int afi, int first_run, unsigned int seq)
/* Dump attribute. */
/* Skip prefix & AFI/SAFI for MP_NLRI */
- bgp_dump_routes_attr (obuf, info->attr, &rn->p);
+ bgp_dump_routes_attr (obuf, info->attr, &rn->p, info->flags);
}
/* Overwrite the entry count, now that we know the right number */
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index a5afaedc..49664030 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -616,6 +616,9 @@ struct bgp_nlri
#define BGP_ATTR_AS4_AGGREGATOR 18
#define BGP_ATTR_AS_PATHLIMIT 21
+/* BGP attribute 255, "development". Used in dumps for extended information. */
+#define BGP_ATTR_QUAGGA_DUMPEXT 255
+
/* BGP update origin. */
#define BGP_ORIGIN_IGP 0
#define BGP_ORIGIN_EGP 1