]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Protocol: Linpool is not needed in preexport hook, removing. mq-pool
authorJan Maria Matejka <mq@ucw.cz>
Wed, 26 Sep 2018 14:41:18 +0000 (16:41 +0200)
committerJan Maria Matejka <mq@ucw.cz>
Wed, 26 Sep 2018 14:41:18 +0000 (16:41 +0200)
nest/proto-hooks.c
nest/protocol.h
nest/rt-show.c
nest/rt-table.c
proto/babel/babel.c
proto/bgp/attrs.c
proto/bgp/bgp.h
proto/ospf/ospf.c
proto/pipe/pipe.c
proto/radv/radv.c
sysdep/unix/krt.c

index bc88b4b4d3a201946995aa7cf22f768252e99905..234115d944d29985da1428e0eede754e67f5036c 100644 (file)
@@ -261,22 +261,20 @@ void store_tmp_attrs(rte *e, ea_list *attrs)
  * preexport - pre-filtering decisions before route export
  * @p: protocol instance the route is going to be exported to
  * @e: the route in question
- * @attrs: extended attributes of the route
- * @pool: linear pool for allocation of all temporary data
  *
  * The preexport() hook is called as the first step of a exporting
- * a route from a routing table to the protocol instance. It can modify
- * route attributes and force acceptance or rejection of the route before
+ * a route from a routing table to the protocol instance. It can
+ * force acceptance or rejection of the route before
  * the user-specified filters are run. See rte_announce() for a complete description
  * of the route distribution process.
  *
  * The standard use of this hook is to reject routes having originated
- * from the same instance and to set default values of the protocol's metrics.
+ * from the same instance.
  *
  * Result: 1 if the route has to be accepted, -1 if rejected and 0 if it
  * should be passed to the filters.
  */
-int preexport(struct proto *p, rte **e, ea_list **attrs, struct linpool *pool)
+int preexport(struct proto *p, rte **e)
 { DUMMY; }
 
 /**
index b62c150843ddafea1d3b22c3974524e8d3a1a677..8f63ec4d78daa68416ae3d34c2db16aef51ef90e 100644 (file)
@@ -209,7 +209,7 @@ struct proto {
   void (*neigh_notify)(struct neighbor *neigh);
   struct ea_list *(*make_tmp_attrs)(struct rte *rt, struct linpool *pool);
   void (*store_tmp_attrs)(struct rte *rt);
-  int (*preexport)(struct proto *, struct rte **rt, struct linpool *pool);
+  int (*preexport)(struct proto *, struct rte **rt);
   void (*reload_routes)(struct channel *);
   void (*feed_begin)(struct channel *, int initial);
   void (*feed_end)(struct channel *);
index c7bcdf2f6c98546cfd8705817389920513ff81ac..533d2afeac902ed5a2304d7441bf7ffa12581844 100644 (file)
@@ -133,7 +133,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
       else if (d->export_mode)
        {
          struct proto *ep = ec->proto;
-         int ic = ep->preexport ? ep->preexport(ep, &e, c->show_pool) : 0;
+         int ic = ep->preexport ? ep->preexport(ep, &e) : 0;
 
          if (ec->ra_mode == RA_OPTIMAL || ec->ra_mode == RA_MERGED)
            pass = 1;
index a343638ba05710aed586179de3021c8fb977b408..709dad2c62d4e817db093af431972e818160a70e 100644 (file)
@@ -405,7 +405,7 @@ export_filter(struct channel *c, rte *rt0, rte **rt_free, linpool *pool, int sil
 
   rte_make_tmp_attrs(&rt, pool);
 
-  v = p->preexport ? p->preexport(p, &rt, pool) : 0;
+  v = p->preexport ? p->preexport(p, &rt) : 0;
   if (v < 0)
     {
       if (silent)
@@ -1420,7 +1420,7 @@ rt_examine(rtable *t, net_addr *a, struct proto *p, struct filter *filter, struc
 
   /* Rest is stripped down export_filter() */
   rte_make_tmp_attrs(&rt, lp);
-  int v = p->preexport ? p->preexport(p, &rt, lp) : 0;
+  int v = p->preexport ? p->preexport(p, &rt) : 0;
   if (v == RIC_PROCESS)
     v = (f_run(filter, &rt, lp, FF_SILENT) <= F_ACCEPT);
 
index 1f52658e76656f9f230ba4252f98824aef266fac..61bf3f60f6a86ba7bac210689a2d26ef4f97cd3c 100644 (file)
@@ -2095,7 +2095,7 @@ babel_prepare_attrs(struct linpool *pool, ea_list *next, uint metric, u64 router
 
 
 static int
-babel_preexport(struct proto *P, struct rte **new, struct linpool *pool UNUSED)
+babel_preexport(struct proto *P, struct rte **new)
 {
   struct rta *a = (*new)->attrs;
 
index 14061ae421b5f78ab9b0a54c41180850dd8359cb..9f55c8dded325eb5195cb43cfa2fa2a2da74983e 100644 (file)
@@ -1365,7 +1365,7 @@ bgp_free_prefix(struct bgp_channel *c, struct bgp_prefix *px)
  */
 
 int
-bgp_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED)
+bgp_preexport(struct proto *P, rte **new)
 {
   rte *e = *new;
   struct proto *SRC = e->attrs->src->proto;
index ced09a817e98f6dfbf5076b071d36295acfa97a3..bbbceb9fe18d5453e2cf68b5f09dfde54236d0ce 100644 (file)
@@ -531,7 +531,7 @@ int bgp_rte_mergable(rte *pri, rte *sec);
 int bgp_rte_recalculate(rtable *table, net *net, rte *new, rte *old, rte *old_best);
 struct rte *bgp_rte_modify_stale(struct rte *r, struct linpool *pool);
 void bgp_rt_notify(struct proto *P, struct channel *C, net *n, rte *new, rte *old);
-int bgp_preexport(struct proto *, struct rte **, struct linpool *);
+int bgp_preexport(struct proto *, struct rte **);
 int bgp_get_attr(struct eattr *e, byte *buf, int buflen);
 void bgp_get_route_info(struct rte *, byte *buf);
 
index 6336fad63df9aabf0279e57911028f180098551f..0a784ed8d7064501695bf66d9264ea2257ed8144 100644 (file)
 #include <stdlib.h>
 #include "ospf.h"
 
-static int ospf_preexport(struct proto *P, rte **new, struct linpool *pool);
+static int ospf_preexport(struct proto *P, rte **new);
 static struct ea_list *ospf_make_tmp_attrs(struct rte *rt, struct linpool *pool);
 static void ospf_store_tmp_attrs(struct rte *rt);
 static void ospf_reload_routes(struct channel *C);
@@ -446,7 +446,7 @@ ospf_disp(timer * timer)
  * import to the filters.
  */
 static int
-ospf_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED)
+ospf_preexport(struct proto *P, rte **new)
 {
   struct ospf_proto *p = (struct ospf_proto *) P;
   struct ospf_area *oa = ospf_main_area(p);
index 7dcad637d46bed295ca6383928e16612745d34ff..7e1d03c1e19c366c39b06eaa51a4d9df6237920f 100644 (file)
@@ -101,7 +101,7 @@ pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *o
 }
 
 static int
-pipe_preexport(struct proto *P, rte **ee, struct linpool *p UNUSED)
+pipe_preexport(struct proto *P, rte **ee)
 {
   struct proto *pp = (*ee)->sender->proto;
 
index 38f491314871eb19bae725f2abf4fd6841beeaf7..465bd969428413b27ce22d94ae50e9ddc843f5d0 100644 (file)
@@ -396,7 +396,7 @@ radv_net_match_trigger(struct radv_config *cf, net *n)
 }
 
 int
-radv_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED)
+radv_preexport(struct proto *P, rte **new)
 {
   // struct radv_proto *p = (struct radv_proto *) P;
   struct radv_config *cf = (struct radv_config *) (P->cf);
index bfc82990ffc86b8d24b6e136980064cb74cc2a5e..334654ec5404700f97436008afb6697d22e89bcb 100644 (file)
@@ -934,7 +934,7 @@ krt_store_tmp_attrs(rte *rt)
 }
 
 static int
-krt_preexport(struct proto *P, rte **new, struct linpool *pool UNUSED)
+krt_preexport(struct proto *P, rte **new)
 {
   // struct krt_proto *p = (struct krt_proto *) P;
   rte *e = *new;