summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
Diffstat (limited to 'proto')
-rw-r--r--proto/babel/babel.c4
-rw-r--r--proto/bgp/attrs.c16
-rw-r--r--proto/bgp/bgp.h10
-rw-r--r--proto/ospf/ospf.c6
-rw-r--r--proto/rip/rip.c6
-rw-r--r--proto/static/static.c6
6 files changed, 24 insertions, 24 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 86306180..4f3603e4 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -2068,7 +2068,7 @@ babel_dump(struct proto *P)
}
static void
-babel_get_route_info(rte *rte, byte *buf)
+babel_get_route_info(const rte *rte, byte *buf)
{
u64 rid = 0;
eattr *e = ea_find(rte->attrs, &ea_babel_router_id);
@@ -2388,7 +2388,7 @@ babel_rt_notify(struct proto *P, struct channel *c UNUSED, const net_addr *net,
}
static int
-babel_rte_better(struct rte *new, struct rte *old)
+babel_rte_better(const rte *new, const rte *old)
{
uint new_metric = ea_get_int(new->attrs, &ea_babel_metric, BABEL_INFINITY);
uint old_metric = ea_get_int(old->attrs, &ea_babel_metric, BABEL_INFINITY);
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 1c934301..f6097078 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -1958,7 +1958,7 @@ bgp_out_table_feed(void *data)
if (hook->h.req->export_bulk)
{
- rte *feed = &es.rte;
+ const rte *feed = &es.rte;
hook->h.req->export_bulk(hook->h.req, n->net, &rpe, &feed, 1);
}
else if (hook->h.req->export_one)
@@ -2273,7 +2273,7 @@ bgp_rt_notify(struct proto *P, struct channel *C, const net_addr *n, rte *new, c
static inline u32
-bgp_get_neighbor(rte *r)
+bgp_get_neighbor(const rte *r)
{
eattr *e = ea_find(r->attrs, BGP_EA_ID(BA_AS_PATH));
u32 as;
@@ -2287,14 +2287,14 @@ bgp_get_neighbor(rte *r)
}
static inline int
-rte_stale(rte *r)
+rte_stale(const rte *r)
{
eattr *a = ea_find(r->attrs, BGP_EA_ID(BA_COMMUNITY));
return a && int_set_contains(a->u.ptr, BGP_COMM_LLGR_STALE);
}
int
-bgp_rte_better(rte *new, rte *old)
+bgp_rte_better(const rte *new, const rte *old)
{
struct bgp_proto *new_bgp = bgp_rte_proto(new);
struct bgp_proto *old_bgp = bgp_rte_proto(old);
@@ -2439,7 +2439,7 @@ bgp_rte_better(rte *new, rte *old)
int
-bgp_rte_mergable(rte *pri, rte *sec)
+bgp_rte_mergable(const rte *pri, const rte *sec)
{
struct bgp_proto *pri_bgp = bgp_rte_proto(pri);
struct bgp_proto *sec_bgp = bgp_rte_proto(sec);
@@ -2657,7 +2657,7 @@ bgp_rte_recalculate(struct rtable_private *table, net *net, rte *new, rte *old,
}
void
-bgp_rte_modify_stale(struct rt_export_request *req, const net_addr *n, struct rt_pending_export *rpe UNUSED, rte **feed, uint count)
+bgp_rte_modify_stale(struct rt_export_request *req, const net_addr *n, struct rt_pending_export *rpe UNUSED, const rte **feed, uint count)
{
struct bgp_channel *c = SKIP_BACK(struct bgp_channel, stale_feed, req);
struct rt_import_hook *irh = c->c.in_req.hook;
@@ -2665,7 +2665,7 @@ bgp_rte_modify_stale(struct rt_export_request *req, const net_addr *n, struct rt
/* Find our routes among others */
for (uint i=0; i<count; i++)
{
- rte *r = feed[i];
+ const rte *r = feed[i];
if (
!rte_is_valid(r) || /* Not a valid route */
@@ -2755,7 +2755,7 @@ bgp_process_as4_attrs(ea_list **attrs, struct linpool *pool)
}
void
-bgp_get_route_info(rte *e, byte *buf)
+bgp_get_route_info(const rte *e, byte *buf)
{
eattr *p = ea_find(e->attrs, BGP_EA_ID(BA_AS_PATH));
eattr *o = ea_find(e->attrs, BGP_EA_ID(BA_ORIGIN));
diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h
index b1167820..1a55fef6 100644
--- a/proto/bgp/bgp.h
+++ b/proto/bgp/bgp.h
@@ -615,17 +615,17 @@ int bgp_done_bucket(struct bgp_channel *c, struct bgp_bucket *b);
void bgp_done_prefix(struct bgp_channel *c, struct bgp_prefix *px, struct bgp_bucket *buck);
-int bgp_rte_better(struct rte *, struct rte *);
-int bgp_rte_mergable(rte *pri, rte *sec);
+int bgp_rte_better(const rte *, const rte *);
+int bgp_rte_mergable(const rte *pri, const rte *sec);
int bgp_rte_recalculate(struct rtable_private *table, net *net, rte *new, rte *old, rte *old_best);
-void bgp_rte_modify_stale(struct rt_export_request *req, const net_addr *n, struct rt_pending_export *rpe UNUSED, rte **feed, uint count);
+void bgp_rte_modify_stale(struct rt_export_request *req, const net_addr *n, struct rt_pending_export *rpe UNUSED, const rte **feed, uint count);
u32 bgp_rte_igp_metric(const rte *);
void bgp_rt_notify(struct proto *P, struct channel *C, const net_addr *n, rte *new, const rte *old);
int bgp_preexport(struct channel *, struct rte *);
-void bgp_get_route_info(struct rte *, byte *);
+void bgp_get_route_info(const rte *, byte *);
int bgp_total_aigp_metric_(const rte *e, u64 *metric, const struct adata **ad);
-static inline struct bgp_proto *bgp_rte_proto(struct rte *rte)
+static inline struct bgp_proto *bgp_rte_proto(const rte *rte)
{
return (rte->src->owner->class == &bgp_rte_owner_class) ?
SKIP_BACK(struct bgp_proto, p.sources, rte->src->owner) : NULL;
diff --git a/proto/ospf/ospf.c b/proto/ospf/ospf.c
index 54d67fd6..896bf5a3 100644
--- a/proto/ospf/ospf.c
+++ b/proto/ospf/ospf.c
@@ -110,7 +110,7 @@
static int ospf_preexport(struct channel *C, rte *new);
static void ospf_reload_routes(struct channel *C);
-static int ospf_rte_better(struct rte *new, struct rte *old);
+static int ospf_rte_better(const rte *new, const rte *old);
static u32 ospf_rte_igp_metric(const rte *rt);
static void ospf_disp(timer *timer);
@@ -385,7 +385,7 @@ ospf_init(struct proto_config *CF)
/* If new is better return 1 */
static int
-ospf_rte_better(struct rte *new, struct rte *old)
+ospf_rte_better(const rte *new, const rte *old)
{
u32 new_metric1 = ea_get_int(new->attrs, &ea_ospf_metric1, LSINFINITY);
@@ -570,7 +570,7 @@ ospf_get_status(struct proto *P, byte * buf)
}
static void
-ospf_get_route_info(rte * rte, byte * buf)
+ospf_get_route_info(const rte * rte, byte * buf)
{
char *type = "<bug>";
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 2c504112..d15177da 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -1119,7 +1119,7 @@ rip_reload_routes(struct channel *C)
static struct rte_owner_class rip_rte_owner_class;
static inline struct rip_proto *
-rip_rte_proto(struct rte *rte)
+rip_rte_proto(const rte *rte)
{
return (rte->src->owner->class == &rip_rte_owner_class) ?
SKIP_BACK(struct rip_proto, p.sources, rte->src->owner) : NULL;
@@ -1132,7 +1132,7 @@ rip_rte_igp_metric(const rte *rt)
}
static int
-rip_rte_better(struct rte *new, struct rte *old)
+rip_rte_better(const rte *new, const rte *old)
{
return rip_rte_igp_metric(new) < rip_rte_igp_metric(old);
}
@@ -1231,7 +1231,7 @@ rip_reconfigure(struct proto *P, struct proto_config *CF)
}
static void
-rip_get_route_info(rte *rte, byte *buf)
+rip_get_route_info(const rte *rte, byte *buf)
{
struct rip_proto *p = rip_rte_proto(rte);
u32 rt_metric = ea_get_int(rte->attrs, &ea_rip_metric, p->infinity);
diff --git a/proto/static/static.c b/proto/static/static.c
index 86142790..6bae827b 100644
--- a/proto/static/static.c
+++ b/proto/static/static.c
@@ -406,7 +406,7 @@ static_reload_routes(struct channel *C)
}
static int
-static_rte_better(rte *new, rte *old)
+static_rte_better(const rte *new, const rte *old)
{
u32 n = ea_get_int(new->attrs, &ea_gen_igp_metric, IGP_METRIC_UNKNOWN);
u32 o = ea_get_int(old->attrs, &ea_gen_igp_metric, IGP_METRIC_UNKNOWN);
@@ -414,7 +414,7 @@ static_rte_better(rte *new, rte *old)
}
static int
-static_rte_mergable(rte *pri, rte *sec)
+static_rte_mergable(const rte *pri, const rte *sec)
{
u32 a = ea_get_int(pri->attrs, &ea_gen_igp_metric, IGP_METRIC_UNKNOWN);
u32 b = ea_get_int(sec->attrs, &ea_gen_igp_metric, IGP_METRIC_UNKNOWN);
@@ -709,7 +709,7 @@ static_copy_config(struct proto_config *dest, struct proto_config *src)
}
static void
-static_get_route_info(rte *rte, byte *buf)
+static_get_route_info(const rte *rte, byte *buf)
{
eattr *a = ea_find(rte->attrs, &ea_gen_igp_metric);
u32 pref = rt_get_preference(rte);