]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Renamed channel class pointers
authorVojtech Vilimek <vojtech.vilimek@nic.cz>
Thu, 14 Sep 2023 13:21:53 +0000 (15:21 +0200)
committerMaria Matejka <mq@ucw.cz>
Sun, 24 Sep 2023 18:43:04 +0000 (20:43 +0200)
The channel class pointers were strangely named , not .

nest/proto.c
nest/protocol.h
nest/rt-table.c
proto/bgp/attrs.c
proto/bgp/bgp.c
proto/bgp/bgp.h
proto/pipe/pipe.c

index b06f7b727b2d0a1402b3fd2afe82efffce8244f7..83fbce2c03cc375741ad4d4ee5eccaf24b93d9c9 100644 (file)
@@ -195,10 +195,10 @@ proto_find_channel_by_name(struct proto *p, const char *n)
 struct channel *
 proto_add_channel(struct proto *p, struct channel_config *cf)
 {
-  struct channel *c = mb_allocz(proto_pool, cf->channel->channel_size);
+  struct channel *c = mb_allocz(proto_pool, cf->class->channel_size);
 
   c->name = cf->name;
-  c->channel = cf->channel;
+  c->class = cf->class;
   c->proto = p;
   c->table = cf->table->table;
   rt_lock_table(c->table);
@@ -227,7 +227,7 @@ proto_add_channel(struct proto *p, struct channel_config *cf)
 
   init_list(&c->roa_subscriptions);
 
-  CALL(c->channel->init, c, cf);
+  CALL(c->class->init, c, cf);
 
   add_tail(&p->channels, &c->n);
 
@@ -415,7 +415,7 @@ channel_roa_subscribe_filter(struct channel *c, int dir)
 
 #ifdef CONFIG_BGP
   /* No automatic reload for BGP channels without in_table / out_table */
-  if (c->channel == &channel_bgp)
+  if (c->class == &channel_bgp)
     valid = dir ? ((c->in_keep & RIK_PREFILTER) == RIK_PREFILTER) : !!c->out_table;
 #endif
 
@@ -708,7 +708,7 @@ channel_do_start(struct channel *c)
   if ((c->in_keep & RIK_PREFILTER) == RIK_PREFILTER)
     channel_setup_in_table(c);
 
-  CALL(c->channel->start, c);
+  CALL(c->class->start, c);
 
   channel_start_import(c);
 }
@@ -752,7 +752,7 @@ channel_do_stop(struct channel *c)
   if (c->gr_lock)
     channel_graceful_restart_unlock(c);
 
-  CALL(c->channel->shutdown, c);
+  CALL(c->class->shutdown, c);
 
 }
 
@@ -770,7 +770,7 @@ channel_do_down(struct channel *c)
 
   /* The in_table and out_table are going to be freed by freeing their resource pools. */
 
-  CALL(c->channel->cleanup, c);
+  CALL(c->class->cleanup, c);
 
   /* Schedule protocol shutddown */
   if (proto_is_done(c->proto))
@@ -912,7 +912,7 @@ channel_config_new(const struct channel_class *cc, const char *name, uint net_ty
 
   cf = cfg_allocz(cc->config_size);
   cf->name = name;
-  cf->channel = cc;
+  cf->class = cc;
   cf->parent = proto;
   cf->table = tab;
   cf->out_filter = FILTER_REJECT;
@@ -959,12 +959,12 @@ channel_config_get(const struct channel_class *cc, const char *name, uint net_ty
 struct channel_config *
 channel_copy_config(struct channel_config *src, struct proto_config *proto)
 {
-  struct channel_config *dst = cfg_alloc(src->channel->config_size);
+  struct channel_config *dst = cfg_alloc(src->class->config_size);
 
-  memcpy(dst, src, src->channel->config_size);
+  memcpy(dst, src, src->class->config_size);
   memset(&dst->n, 0, sizeof(node));
   add_tail(&proto->channels, &dst->n);
-  CALL(src->channel->copy_config, dst, src);
+  CALL(src->class->copy_config, dst, src);
 
   return dst;
 }
@@ -1031,7 +1031,7 @@ channel_reconfigure(struct channel *c, struct channel_config *cf)
   }
 
   /* Execute channel-specific reconfigure hook */
-  if (c->channel->reconfigure && !c->channel->reconfigure(c, cf, &import_changed, &export_changed))
+  if (c->class->reconfigure && !c->class->reconfigure(c, cf, &import_changed, &export_changed))
     return 0;
 
   /* If the channel is not open, it has no routes and we cannot reload it anyways */
index 4916e75676389c7d3a1b0d3ade6cd9fb92fc2128..82bbf56c60049ee207a99973062f670fd4fc67af 100644 (file)
@@ -488,7 +488,7 @@ extern struct channel_class channel_bgp;
 struct channel_config {
   node n;
   const char *name;
-  const struct channel_class *channel;
+  const struct channel_class *class;
 
   struct proto_config *parent;         /* Where channel is defined (proto or template) */
   struct rtable_config *table;         /* Table we're attached to */
@@ -518,7 +518,7 @@ struct channel {
   node n;                              /* Node in proto->channels */
 
   const char *name;                    /* Channel name (may be NULL) */
-  const struct channel_class *channel;
+  const struct channel_class *class;
   struct proto *proto;
 
   rtable *table;
index 1c7c5da6dd1ebdd17db3317c32934635bf5d218d..609f3c6d46a426c2f0f27a13cec62a1485a466fe 100644 (file)
@@ -3738,7 +3738,7 @@ rt_flowspec_resolve_rte(rte *r, struct channel *c)
   struct bgp_channel *bc = (struct bgp_channel *) c;
 
   if ( (rt_get_source_attr(r) == RTS_BGP)
-     && (c->channel == &channel_bgp)
+     && (c->class == &channel_bgp)
      && (bc->base_table))
   {
     struct bgp_proto *p = SKIP_BACK(struct bgp_proto, p, bc->c.proto);
index 46145fc5124959d8bd5ae5c534ce9cc2d9bc0b00..f0d93d154f0d1ccfb51b7dd2760e90c2ccf4a83c 100644 (file)
@@ -2041,7 +2041,7 @@ bgp_preexport(struct channel *C, rte *e)
   struct bgp_channel *c = (struct bgp_channel *) C;
 
   /* Ignore non-BGP channels */
-  if (C->channel != &channel_bgp)
+  if (C->class != &channel_bgp)
     return -1;
 
   /* Reject our routes */
@@ -2252,7 +2252,7 @@ bgp_rt_notify(struct proto *P, struct channel *C, const net_addr *n, rte *new, c
   struct rte_src *path;
 
   /* Ignore non-BGP channels */
-  if (C->channel != &channel_bgp)
+  if (C->class != &channel_bgp)
     return;
 
   if (new)
index 3a7ed6b77e05ee76c081e075051ed76a61c83dfa..573fa1528a6e9fbc5b6e79769f24f07be8e46396 100644 (file)
@@ -1567,7 +1567,7 @@ bgp_reload_routes(struct channel *C)
   struct bgp_channel *c = (void *) C;
 
   /* Ignore non-BGP channels */
-  if (C->channel != &channel_bgp)
+  if (C->class != &channel_bgp)
     return;
 
   ASSERT(p->conn && p->route_refresh);
@@ -1581,7 +1581,7 @@ bgp_feed_begin(struct channel *C, int initial)
   struct bgp_channel *c = (void *) C;
 
   /* Ignore non-BGP channels */
-  if (C->channel != &channel_bgp)
+  if (C->class != &channel_bgp)
     return;
 
   /* This should not happen */
@@ -1616,7 +1616,7 @@ bgp_feed_end(struct channel *C)
   struct bgp_channel *c = (void *) C;
 
   /* Ignore non-BGP channels */
-  if (C->channel != &channel_bgp)
+  if (C->class != &channel_bgp)
     return;
 
   if (c->feed_out_table)
@@ -2781,7 +2781,7 @@ bgp_show_proto_info(struct proto *P)
     {
       channel_show_info(&c->c);
 
-      if (c->c.channel != &channel_bgp)
+      if (c->c.class != &channel_bgp)
        continue;
 
       if (p->gr_active_num)
index 6f75874fd655b3b21d6dfd321d7740bb85bfde46..69942b6bc5aaa066729421b58b82ae56b6cc4e3b 100644 (file)
@@ -516,8 +516,8 @@ struct bgp_parse_state {
 #define BGP_RX_BUFFER_EXT_SIZE 65535
 #define BGP_TX_BUFFER_EXT_SIZE 65535
 
-#define BGP_CF_WALK_CHANNELS(P,C) WALK_LIST(C, P->c.channels) if (C->c.channel == &channel_bgp)
-#define BGP_WALK_CHANNELS(P,C) WALK_LIST(C, P->p.channels) if (C->c.channel == &channel_bgp)
+#define BGP_CF_WALK_CHANNELS(P,C) WALK_LIST(C, P->c.channels) if (C->c.class == &channel_bgp)
+#define BGP_WALK_CHANNELS(P,C) WALK_LIST(C, P->p.channels) if (C->c.class == &channel_bgp)
 
 static inline int bgp_channel_is_ipv4(struct bgp_channel *c)
 { return BGP_AFI(c->afi) == BGP_AFI_IPV4; }
index b2083010dbebfd2ec74527ae49e8d9373930255a..1267a657b8482a75a3af47d4665d8cbcd9de2f0d 100644 (file)
@@ -172,7 +172,7 @@ pipe_configure_channels(struct pipe_proto *p, struct pipe_config *cf)
 
   struct channel_config pri_cf = {
     .name = "pri",
-    .channel = cc->channel,
+    .class = cc->class,
     .table = cc->table,
     .out_filter = cc->out_filter,
     .out_subprefix = cc->out_subprefix,
@@ -184,7 +184,7 @@ pipe_configure_channels(struct pipe_proto *p, struct pipe_config *cf)
 
   struct channel_config sec_cf = {
     .name = "sec",
-    .channel = cc->channel,
+    .class = cc->class,
     .table = cf->peer,
     .out_filter = cc->in_filter,
     .out_subprefix = cf->in_subprefix,