]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Trivial whitespace cleanup
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 6 Feb 2018 16:43:55 +0000 (17:43 +0100)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 7 Feb 2018 16:12:33 +0000 (17:12 +0100)
16 files changed:
lib/net.c
nest/a-path.c
nest/a-path_test.c
nest/cli.c
nest/config.Y
nest/iface.c
nest/mrtdump.h
nest/neighbor.c
nest/proto-hooks.c
nest/protocol.h
nest/route.h
nest/rt-attr.c
nest/rt-dev.c
nest/rt-fib.c
nest/rt-show.c
nest/rt-table.c

index 9335b78f5ece5172d0261ee3ed3a803ab15ea60f..3e5d62e28ed95be7f0b472006ebb9d10d176d322 100644 (file)
--- a/lib/net.c
+++ b/lib/net.c
@@ -6,50 +6,50 @@
 
 
 const char * const net_label[] = {
-  [NET_IP4]    = "ipv4",
-  [NET_IP6]    = "ipv6",
-  [NET_VPN4]   = "vpn4",
-  [NET_VPN6]   = "vpn6",
-  [NET_ROA4]   = "roa4",
-  [NET_ROA6]   = "roa6",
-  [NET_FLOW4]  = "flow4",
-  [NET_FLOW6]  = "flow6",
+  [NET_IP4]    = "ipv4",
+  [NET_IP6]    = "ipv6",
+  [NET_VPN4]   = "vpn4",
+  [NET_VPN6]   = "vpn6",
+  [NET_ROA4]   = "roa4",
+  [NET_ROA6]   = "roa6",
+  [NET_FLOW4]  = "flow4",
+  [NET_FLOW6]  = "flow6",
   [NET_MPLS]   = "mpls",
 };
 
 const u16 net_addr_length[] = {
-  [NET_IP4]    = sizeof(net_addr_ip4),
-  [NET_IP6]    = sizeof(net_addr_ip6),
-  [NET_VPN4]   = sizeof(net_addr_vpn4),
-  [NET_VPN6]   = sizeof(net_addr_vpn6),
-  [NET_ROA4]   = sizeof(net_addr_roa4),
-  [NET_ROA6]   = sizeof(net_addr_roa6),
-  [NET_FLOW4]  = 0,
-  [NET_FLOW6]  = 0,
+  [NET_IP4]    = sizeof(net_addr_ip4),
+  [NET_IP6]    = sizeof(net_addr_ip6),
+  [NET_VPN4]   = sizeof(net_addr_vpn4),
+  [NET_VPN6]   = sizeof(net_addr_vpn6),
+  [NET_ROA4]   = sizeof(net_addr_roa4),
+  [NET_ROA6]   = sizeof(net_addr_roa6),
+  [NET_FLOW4]  = 0,
+  [NET_FLOW6]  = 0,
   [NET_MPLS]   = sizeof(net_addr_mpls),
 };
 
 const u8 net_max_prefix_length[] = {
-  [NET_IP4]    = IP4_MAX_PREFIX_LENGTH,
-  [NET_IP6]    = IP6_MAX_PREFIX_LENGTH,
-  [NET_VPN4]   = IP4_MAX_PREFIX_LENGTH,
-  [NET_VPN6]   = IP6_MAX_PREFIX_LENGTH,
-  [NET_ROA4]   = IP4_MAX_PREFIX_LENGTH,
-  [NET_ROA6]   = IP6_MAX_PREFIX_LENGTH,
-  [NET_FLOW4]  = IP4_MAX_PREFIX_LENGTH,
-  [NET_FLOW6]  = IP6_MAX_PREFIX_LENGTH,
+  [NET_IP4]    = IP4_MAX_PREFIX_LENGTH,
+  [NET_IP6]    = IP6_MAX_PREFIX_LENGTH,
+  [NET_VPN4]   = IP4_MAX_PREFIX_LENGTH,
+  [NET_VPN6]   = IP6_MAX_PREFIX_LENGTH,
+  [NET_ROA4]   = IP4_MAX_PREFIX_LENGTH,
+  [NET_ROA6]   = IP6_MAX_PREFIX_LENGTH,
+  [NET_FLOW4]  = IP4_MAX_PREFIX_LENGTH,
+  [NET_FLOW6]  = IP6_MAX_PREFIX_LENGTH,
   [NET_MPLS]   = 0,
 };
 
 const u16 net_max_text_length[] = {
-  [NET_IP4]    = 18,   /* "255.255.255.255/32" */
-  [NET_IP6]    = 43,   /* "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" */
-  [NET_VPN4]   = 40,   /* "4294967296:4294967296 255.255.255.255/32" */
-  [NET_VPN6]   = 65,   /* "4294967296:4294967296 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" */
-  [NET_ROA4]   = 34,   /* "255.255.255.255/32-32 AS4294967295" */
-  [NET_ROA6]   = 60,   /* "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128-128 AS4294967295" */
-  [NET_FLOW4]  = 0,    /* "flow4 { ... }" */
-  [NET_FLOW6]  = 0,    /* "flow6 { ... }" */
+  [NET_IP4]    = 18,   /* "255.255.255.255/32" */
+  [NET_IP6]    = 43,   /* "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" */
+  [NET_VPN4]   = 40,   /* "4294967296:4294967296 255.255.255.255/32" */
+  [NET_VPN6]   = 65,   /* "4294967296:4294967296 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" */
+  [NET_ROA4]   = 34,   /* "255.255.255.255/32-32 AS4294967295" */
+  [NET_ROA6]   = 60,   /* "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128-128 AS4294967295" */
+  [NET_FLOW4]  = 0,    /* "flow4 { ... }" */
+  [NET_FLOW6]  = 0,    /* "flow6 { ... }" */
   [NET_MPLS]   = 7,    /* "1048575" */
 };
 
index 32ffc72c1b2c89d5e062bbb86c2232b315d65fa0..c0d16c30497b41545135efa5975049702ea61780 100644 (file)
@@ -810,7 +810,7 @@ as_path_match(const struct adata *path, struct f_path_mask *mask)
        case PM_ASN_RANGE:
          val = mask->val;
          val2 = mask->val2;
-          goto step;
+         goto step;
        case PM_QUESTION:
        step:
          nh = nl = -1;
index 5e1223968a166856f34cdcb71e9ccfaaf46504d1..a71b48ba11e0a37a40d5b2011640c6b5379d1dde 100644 (file)
@@ -43,14 +43,14 @@ t_as_path_match(void)
       bt_debug("Prepending ASN: %10u \n", val);
 
       if (i == 0)
-        first_prepended = val;
+       first_prepended = val;
       if (i == AS_PATH_LENGTH-1)
-        last_prepended = val;
+       last_prepended = val;
 
       mask[i].kind = PM_ASN;
       mask[i].val  = val;
       if (i)
-        mask[i].next = &mask[i-1];
+       mask[i].next = &mask[i-1];
     }
 
     bt_assert_msg(as_path_match(as_path, &mask[AS_PATH_LENGTH-1]), "Mask should match with AS path");
index ad81d384f763527fbcedea0ed64ad487064a69c6..c421cc7e7c7e14b090a64927387b018b6a0067e7 100644 (file)
@@ -60,7 +60,7 @@
  * the new one. When the consumer processes everything in the buffer
  * queue, it calls cli_written(), tha frees all buffers (except the
  * first one) and schedules cli.event .
- * 
+ *
  */
 
 #include "nest/bird.h"
@@ -136,7 +136,7 @@ cli_printf(cli *c, int code, char *msg, ...)
     }
   else if (cd == CLI_ASYNC_CODE)
     {
-      size = 1; buf[0] = '+'; 
+      size = 1; buf[0] = '+';
       errcode = cd;
     }
   else
index 044aba2b3095bef90832d6094fa71185b68d6385..af5114f5a93ff3cb5eb737a5dd9dbee022008ac0 100644 (file)
@@ -151,7 +151,7 @@ CF_ENUM(T_ENUM_NETTYPE, NET_, IP4, IP6, VPN4, VPN6, ROA4, ROA6, FLOW4, FLOW6)
 CF_ADDTO(conf, table)
 
 table_sorted:
-          { $$ = 0; }
+         { $$ = 0; }
  | SORTED { $$ = 1; }
  ;
 
@@ -454,9 +454,9 @@ password_item:
 password_item_begin:
    PASSWORD text {
      if (!this_p_list) {
-       this_p_list = cfg_alloc(sizeof(list));
-       init_list(this_p_list);
-        password_id = 1;
+       this_p_list = cfg_alloc(sizeof(list));
+       init_list(this_p_list);
+       password_id = 1;
      }
      this_p_item = cfg_alloc(sizeof (struct password_item));
      this_p_item->password = $2;
index 54c16c583d3ef8fbc284b4bad2ee916801d1f6ba..a633f748aa03b62c70019ad4ee038154c905dc51 100644 (file)
@@ -317,7 +317,7 @@ if_update(struct iface *new)
            new->sysdep = i->sysdep;
            memcpy(&new->addrs, &i->addrs, sizeof(i->addrs));
            memcpy(i, new, sizeof(*i));
-           i->flags &= ~IF_UP;         /* IF_TMP_DOWN will be added later */
+           i->flags &= ~IF_UP;         /* IF_TMP_DOWN will be added later */
            goto newif;
          }
 
index 7393255379984b29171faa409fe44716b6698b47..28b3bdfd867ee09d9001fac60e0471b13db40d92 100644 (file)
@@ -28,4 +28,3 @@
 void mrt_dump_message(struct proto *p, u16 type, u16 subtype, byte *buf, u32 len);
 
 #endif
-
index fb05d96ce98b79b1ac4e16022fda92eb27767051..4f93e29e74306e21bf7ec5ac2f0fa2f65f761859 100644 (file)
@@ -156,7 +156,7 @@ neigh_find2(struct proto *p, ip_addr *a, struct iface *ifa, unsigned flags)
     WALK_LIST(i, iface_list)
       if ((!p->vrf || p->vrf == i->master) &&
          ((scope = if_connected(a, i, &addr)) >= 0))
-        {
+       {
          ifa = i;
          break;
        }
index 92863f8e407ea824c0d2cfd905d7f6875d7750f5..71cddd64c64c47e735db2d7c75a0c380d03134d9 100644 (file)
@@ -281,7 +281,7 @@ int import_control(struct proto *p, rte **e, ea_list **attrs, struct linpool *po
 
 /**
  * rte_recalculate - prepare routes for comparison
- * @table: a routing table 
+ * @table: a routing table
  * @net: a network entry
  * @new: new route for the network
  * @old: old route for the network
index 9afd3a0a2f6fc7a63cc6bddfe1258975f5491aa0..8a22d76b860ca5a3dc241881c1deae6601baebeb 100644 (file)
@@ -337,7 +337,7 @@ void proto_notify_state(struct proto *p, unsigned state);
  *
  *             HUNGRY    ---->   FEEDING
  *              ^                   |
- *              |                   V
+ *              |                   V
  *             FLUSHING  <----   HAPPY
  *
  *     States: HUNGRY  Protocol either administratively down (i.e.,
index 1c86110b7e117df26b63773c702be34192c14eb5..791275195d9e2efb7d973ed1175658836b334da0 100644 (file)
@@ -74,7 +74,7 @@ static inline struct fib_node * fib_user_to_node(struct fib *f, void *e)
 void fib_init(struct fib *f, pool *p, uint addr_type, uint node_size, uint node_offset, uint hash_order, fib_init_fn init);
 void *fib_find(struct fib *, const net_addr *);        /* Find or return NULL if doesn't exist */
 void *fib_get_chain(struct fib *f, const net_addr *a); /* Find first node in linked list from hash table */
-void *fib_get(struct fib *, const net_addr *);         /* Find or create new if nonexistent */
+void *fib_get(struct fib *, const net_addr *); /* Find or create new if nonexistent */
 void *fib_route(struct fib *, const net_addr *); /* Longest-match routing lookup */
 void fib_delete(struct fib *, void *); /* Remove fib entry */
 void fib_free(struct fib *);           /* Destroy the fib */
@@ -104,7 +104,7 @@ void fit_put_next(struct fib *f, struct fib_iterator *i, struct fib_node *n, uin
        type *z;                                                \
        for(;;) {                                               \
          if (!fn_)                                             \
-            {                                                  \
+                                                             \
               if (++hpos_ >= count_)                           \
                 break;                                         \
               fn_ = (fib)->hash_table[hpos_];                  \
@@ -663,7 +663,7 @@ extern struct protocol *attr_class_to_protocol[EAP_MAX];
  *     Default protocol preferences
  */
 
-#define DEF_PREF_DIRECT                240     /* Directly connected */
+#define DEF_PREF_DIRECT                240     /* Directly connected */
 #define DEF_PREF_STATIC                200     /* Static route */
 #define DEF_PREF_OSPF          150     /* OSPF intra-area, inter-area and type 1 external routes */
 #define DEF_PREF_BABEL         130     /* Babel */
index 761ba9fe8faaa6656323cb50a990c2a9564e72cb..881687de5c9d7dfc4cedd02dec878166316f2d9c 100644 (file)
@@ -1204,7 +1204,7 @@ rta_dump(rta *a)
   static char *rts[] = { "RTS_DUMMY", "RTS_STATIC", "RTS_INHERIT", "RTS_DEVICE",
                         "RTS_STAT_DEV", "RTS_REDIR", "RTS_RIP",
                         "RTS_OSPF", "RTS_OSPF_IA", "RTS_OSPF_EXT1",
-                         "RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
+                        "RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
   static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" };
 
   debug("p=%s uc=%d %s %s%s h=%04x",
index b3d5bf9776f073688b21937b0626e14fe428bde2..718c4578c9a8faf98b87fe3978889ff268c6078b 100644 (file)
@@ -159,13 +159,13 @@ dev_copy_config(struct proto_config *dest, struct proto_config *src)
 }
 
 struct protocol proto_device = {
-  .name =              "Direct",
-  .template =          "direct%d",
+  .name =              "Direct",
+  .template =          "direct%d",
   .preference =                DEF_PREF_DIRECT,
   .channel_mask =      NB_IP,
   .proto_size =                sizeof(struct rt_dev_proto),
   .config_size =       sizeof(struct rt_dev_config),
-  .init =              dev_init,
-  .reconfigure =       dev_reconfigure,
-  .copy_config =       dev_copy_config
+  .init =              dev_init,
+  .reconfigure =       dev_reconfigure,
+  .copy_config =       dev_copy_config
 };
index c09f275915c0d5b18227c7a3f29a5dc9a1c81f34..169d6a4f8126b6d4a7baf6bc08d05e1c23bcdd4b 100644 (file)
@@ -603,7 +603,7 @@ fib_histogram(struct fib *f)
       for (e = f->hash_table[i]; e != NULL; e = e->next)
        j++;
       if (j > 0)
-        log(L_WARN "Histogram line %d: %d", i, j);
+       log(L_WARN "Histogram line %d: %d", i, j);
     }
 
   log(L_WARN "Histogram dump end");
index 70dabc1f11883dc5dc3cd396697b1f3c46835af8..1f1b73d20d5280a0e64e42135b6e04e835efa913 100644 (file)
@@ -74,7 +74,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
       char weight[16] = "";
 
       if (nh->labels)
-        {
+       {
          lsp += bsprintf(lsp, " mpls %d", nh->label[0]);
          for (int i=1;i<nh->labels; i++)
            lsp += bsprintf(lsp, "/%d", nh->label[i]);
@@ -129,7 +129,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
 
       /* Special case for merged export */
       if ((d->export_mode == RSEM_EXPORT) && (ec->ra_mode == RA_MERGED))
-        {
+       {
          rte *rt_free;
          e = rt_export_merged(ec, n, &rt_free, &tmpa, c->show_pool, 1);
          pass = 1;
@@ -419,4 +419,3 @@ rt_show(struct rt_show_data *d)
       cli_msg(8001, "Network not found");
   }
 }
-
index 784f6cfb04ed072054e8e880ea1b096af4c4de68..0f53c93f3efcab1c3ec4eb83d2f534b9eed2366b 100644 (file)
@@ -614,9 +614,9 @@ rt_notify_accepted(struct channel *c, net *net, rte *new_changed, rte *old_chang
        old_meet = 1;
     }
 
-  /* 
+  /*
    * Second, handle the feed case. That means we do not care for
-   * old_best. It is NULL for feed, and the new_best for refeed. 
+   * old_best. It is NULL for feed, and the new_best for refeed.
    * For refeed, there is a hack similar to one in rt_notify_basic()
    * to ensure withdraws in case of changed filters
    */
@@ -825,7 +825,7 @@ rt_notify_merged(struct channel *c, net *net, rte *new_changed, rte *old_changed
  * @new_best: the new best route for the same network
  * @old_best: the previous best route for the same network
  * @before_old: The previous route before @old for the same network.
- *             If @before_old is NULL @old was the first.
+ *             If @before_old is NULL @old was the first.
  *
  * This function gets a routing table update and announces it
  * to all protocols that acccepts given type of route announcement
@@ -1387,7 +1387,7 @@ rte_update2(struct channel *c, const net_addr *n, rte *new, struct rte_src *src)
 
 /* Independent call to rte_announce(), used from next hop
    recalculation, outside of rte_update(). new must be non-NULL */
-static inline void 
+static inline void
 rte_announce_i(rtable *tab, unsigned type, net *net, rte *new, rte *old,
               rte *new_best, rte *old_best)
 {
@@ -2357,7 +2357,7 @@ if_local_addr(ip_addr a, struct iface *i)
   return 0;
 }
 
-static u32 
+static u32
 rt_get_igp_metric(rte *rt)
 {
   eattr *ea = ea_find(rt->attrs->eattrs, EA_GEN_IGP_METRIC);