0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-22 09:41:54 +00:00

Protocol: Linpool is not needed in preexport hook, removing.

This commit is contained in:
Jan Maria Matejka 2018-09-26 16:41:18 +02:00
parent 5911740c76
commit 9fb076dc77
11 changed files with 16 additions and 18 deletions

View 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; }
/**

View 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 *);

View 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;

View 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);

View 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;

View 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;

View 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);

View File

@ -101,7 +101,7 @@
#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);

View 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;

View 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);

View 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;