0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2025-03-23 23:07:04 +00:00

Code cleanup, fix compiler warnings

This commit is contained in:
Vojtech Vilimek 2022-07-19 12:15:24 +02:00
parent 58d0aeddb3
commit f3b9b30693

View File

@ -30,9 +30,9 @@
#endif #endif
static void static void
stats_rt_notify(struct proto *P, struct channel *src_ch, const net_addr *n, rte *new, const rte *old) stats_rt_notify(struct proto *P UNUSED, struct channel *src_ch, const net_addr *n UNUSED, rte *new, const rte *old)
{ {
struct stats_channel *ch = src_ch; struct stats_channel *ch = (void *) src_ch;
log(L_INFO "stats_rt_notify() %u", ch->max_generation); log(L_INFO "stats_rt_notify() %u", ch->max_generation);
if (old) if (old)
@ -66,20 +66,9 @@ stats_rt_notify(struct proto *P, struct channel *src_ch, const net_addr *n, rte
} }
} }
static int
stats_preexport(struct channel *c, rte *e)
{
struct stats_proto *p = (void *) c->proto;
log(L_INFO "stats_preexport()");
return 0;
}
static void static void
stats_reload_routes(struct channel *C) stats_reload_routes(struct channel *C UNUSED)
{ {
struct stats_proto *p = (void *) C->proto;
/* Route reload on one channel is just refeed on the other */ /* Route reload on one channel is just refeed on the other */
//channel_request_feeding(p->c); //channel_request_feeding(p->c);
} }
@ -87,8 +76,6 @@ stats_reload_routes(struct channel *C)
static void static void
stats_configure_channels(struct proto *P, struct proto_config *CF) stats_configure_channels(struct proto *P, struct proto_config *CF)
{ {
struct stats_proto *p = (void *) P;
struct stats_config *cf = (void *) CF;
log(L_INFO "stats_configure_channels()"); log(L_INFO "stats_configure_channels()");
struct channel_config *cc; struct channel_config *cc;
@ -109,11 +96,9 @@ stats_init(struct proto_config *CF)
{ {
struct proto *P = proto_new(CF); struct proto *P = proto_new(CF);
struct stats_proto *p = (void *) P; struct stats_proto *p = (void *) P;
struct stats_config *cf = (void *) CF;
log(L_INFO "stats_init()"); log(L_INFO "stats_init()");
P->rt_notify = stats_rt_notify; P->rt_notify = stats_rt_notify;
P->preexport = stats_preexport;
P->reload_routes = stats_reload_routes; P->reload_routes = stats_reload_routes;
p->rl_gen = (struct tbf) TBF_DEFAULT_LOG_LIMITS; p->rl_gen = (struct tbf) TBF_DEFAULT_LOG_LIMITS;
@ -135,9 +120,8 @@ stats_find_channel(struct stats_proto *p, const char *name)
} }
static int static int
stats_start(struct proto *P) stats_start(struct proto *P UNUSED)
{ {
struct stats_proto *p = (struct stats_proto *) P;
log(L_INFO "stats_start()"); log(L_INFO "stats_start()");
return PS_UP; return PS_UP;
@ -148,7 +132,6 @@ stats_reconfigure(struct proto *P, struct proto_config *CF)
{ {
struct stats_proto *p = (void *) P; struct stats_proto *p = (void *) P;
struct stats_config *new = (void *) CF; struct stats_config *new = (void *) CF;
struct stats_config *old = (void *) P->cf;
log(L_INFO "stats_reconfigure()"); log(L_INFO "stats_reconfigure()");
struct channel *c; struct channel *c;
@ -245,9 +228,8 @@ stats_show_proto_info(struct proto *P)
} }
void void
stats_update_debug(struct proto *P) stats_update_debug(struct proto *P UNUSED)
{ {
struct stats_proto *p = (void *) P;
//p->c->debug = p->p.debug; //p->c->debug = p->p.debug;
} }
@ -255,8 +237,8 @@ stats_update_debug(struct proto *P)
static int static int
stats_channel_start(struct channel *C) stats_channel_start(struct channel *C)
{ {
struct stats_proto *p = (void *) C->proto;
struct stats_channel *c = (void *) C; struct stats_channel *c = (void *) C;
struct stats_proto *p = (void *) C->proto;
log(L_INFO "stats_channel_start() %s", C->name); log(L_INFO "stats_channel_start() %s", C->name);
c->pool = p->p.pool; c->pool = p->p.pool;