summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-08-27 19:01:04 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2009-08-27 19:01:04 +0200
commit05198c12f48c9d4a65ee6d1d4117bd8067a71131 (patch)
tree1e2ad34f41df5cec921ea7f4757a4ce3012aa34f
parent949bd34e81ee99370decdabefa51c9c11ffe915b (diff)
downloadbird-05198c12f48c9d4a65ee6d1d4117bd8067a71131.tar
bird-05198c12f48c9d4a65ee6d1d4117bd8067a71131.zip
Some cleanups.
-rw-r--r--filter/filter.h3
-rw-r--r--filter/trie.c4
-rw-r--r--nest/a-path.c3
-rw-r--r--proto/bgp/attrs.c3
-rw-r--r--proto/bgp/packets.c2
-rw-r--r--proto/ospf/ospf.h2
6 files changed, 11 insertions, 6 deletions
diff --git a/filter/filter.h b/filter/filter.h
index 2277f51..62bad84 100644
--- a/filter/filter.h
+++ b/filter/filter.h
@@ -81,10 +81,13 @@ struct rte;
int f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struct linpool *tmp_pool, int flags);
int f_eval_int(struct f_inst *expr);
+u32 f_eval_asn(struct f_inst *expr);
+
char *filter_name(struct filter *filter);
int filter_same(struct filter *new, struct filter *old);
int i_same(struct f_inst *f1, struct f_inst *f2);
+void f_prefix_get_bounds(struct f_prefix *px, int *l, int *h);
int val_compare(struct f_val v1, struct f_val v2);
void val_print(struct f_val v);
diff --git a/filter/trie.c b/filter/trie.c
index ffb9b99..fb405de 100644
--- a/filter/trie.c
+++ b/filter/trie.c
@@ -70,6 +70,7 @@
*/
#include "nest/bird.h"
+#include "lib/string.h"
#include "conf/conf.h"
#include "filter/filter.h"
@@ -177,7 +178,6 @@ trie_add_prefix(struct f_trie *t, struct f_prefix *px)
{
int l, h;
int plen = px->len & LEN_MASK;
- ip_addr pmask = ipa_mkmask(plen);
/* 'l' and 'h' are lower and upper bounds on accepted
prefix lengths, both inclusive. 0 <= l, h <= 32 */
@@ -272,7 +272,7 @@ static int
trie_node_print(struct f_trie_node *t, char *buf, int blen)
{
if (t == NULL)
- return;
+ return 0;
int old_blen = blen;
int wb = 0; // bsnprintf(buf, blen, "%I/%d accept %I\n", t->addr, t->plen, t->accept);
diff --git a/nest/a-path.c b/nest/a-path.c
index 0a4bf82..19d61f0 100644
--- a/nest/a-path.c
+++ b/nest/a-path.c
@@ -13,6 +13,7 @@
#include "lib/resource.h"
#include "lib/unaligned.h"
#include "lib/string.h"
+#include "filter/filter.h"
/* Global AS4 support, shared by all BGP instances.
@@ -304,7 +305,7 @@ parse_path(struct adata *path, struct pm_pos *pos)
u8 *p = path->data;
u8 *q = p + path->length;
struct pm_pos *opos = pos;
- int i, j, len;
+ int i, len;
while (p < q)
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index bf976a6..831ada5 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -1131,6 +1131,8 @@ as4_aggregator_valid(struct adata *aggr)
if ((a[0] == 0) || (a[1] == 0))
return 0;
+
+ return 1;
}
@@ -1245,7 +1247,6 @@ bgp_decode_attrs(struct bgp_conn *conn, byte *attr, unsigned int len, struct lin
int errcode;
byte *z, *attr_start;
byte seen[256/8];
- eattr *e;
ea_list *ea;
struct adata *ad;
diff --git a/proto/bgp/packets.c b/proto/bgp/packets.c
index ae4906e..49c2add 100644
--- a/proto/bgp/packets.c
+++ b/proto/bgp/packets.c
@@ -488,7 +488,6 @@ bgp_parse_capabilities(struct bgp_conn *conn, byte *opt, int len)
{
struct bgp_proto *p = conn->bgp;
int cl;
- u32 as;
while (len > 0)
{
@@ -570,7 +569,6 @@ bgp_rx_open(struct bgp_conn *conn, byte *pkt, int len)
{
struct bgp_conn *other;
struct bgp_proto *p = conn->bgp;
- struct bgp_config *cf = p->cf;
unsigned hold;
u16 base_as;
u32 id;
diff --git a/proto/ospf/ospf.h b/proto/ospf/ospf.h
index 2279089..7f0ee54 100644
--- a/proto/ospf/ospf.h
+++ b/proto/ospf/ospf.h
@@ -603,6 +603,8 @@ void schedule_net_lsa(struct ospf_iface *ifa);
void ospf_sh_neigh(struct proto *p, char *iff);
void ospf_sh(struct proto *p);
void ospf_sh_iface(struct proto *p, char *iff);
+void ospf_sh_state(struct proto *p, int verbose);
+
#define EA_OSPF_METRIC1 EA_CODE(EAP_OSPF, 0)
#define EA_OSPF_METRIC2 EA_CODE(EAP_OSPF, 1)