]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Remove #if 0 code
authorDonald Sharp <sharpd@nvidia.com>
Thu, 28 Jan 2021 19:04:02 +0000 (14:04 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 28 Jan 2021 19:04:02 +0000 (14:04 -0500)
Just some more dead code that has been sitting unused for
a very long time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib/buffer.c
lib/if.c
lib/vty.c
lib/workqueue.c

index 459d98e75d2e2c10bc0ec0e1d312c2e792535136..42796faae82b41a2b5512bfc6a715eaa0a9efa09 100644 (file)
@@ -468,16 +468,6 @@ buffer_status_t buffer_write(struct buffer *b, int fd, const void *p,
 {
        ssize_t nbytes;
 
-#if 0
-       /*
-        * Should we attempt to drain any previously buffered data?
-        * This could help reduce latency in pushing out the data if
-        * we are stuck in a long-running thread that is preventing
-        * the main select loop from calling the flush thread...
-        */
-       if (b->head && (buffer_flush_available(b, fd) == BUFFER_ERROR))
-               return BUFFER_ERROR;
-#endif
        if (b->head)
                /* Buffer is not empty, so do not attempt to write the new data.
                 */
index c707c4c6d9040cc6794fa4c0eda291639d443ae5..fa0b1d0195adfd06fd2b9c59fa2bc74b0b14dd86 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -802,70 +802,6 @@ void if_dump_all(void)
                        if_dump(ifp);
 }
 
-#if 0
-/* For debug purpose. */
-DEFUN (show_address,
-       show_address_cmd,
-       "show address [vrf NAME]",
-       SHOW_STR
-       "address\n"
-       VRF_CMD_HELP_STR)
-{
-       int idx_vrf = 3;
-       struct listnode *node;
-       struct interface *ifp;
-       struct connected *ifc;
-       struct prefix *p;
-       vrf_id_t vrf_id = VRF_DEFAULT;
-
-       if (argc > 2)
-               VRF_GET_ID (vrf_id, argv[idx_vrf]->arg);
-
-       FOR_ALL_INTERFACES (vrf, ifp) {
-               for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) {
-                       p = ifc->address;
-
-                       if (p->family == AF_INET)
-                               vty_out (vty, "%pFX\n", p);
-               }
-       }
-       return CMD_SUCCESS;
-}
-
-DEFUN (show_address_vrf_all,
-       show_address_vrf_all_cmd,
-       "show address vrf all",
-       SHOW_STR
-       "address\n"
-       VRF_ALL_CMD_HELP_STR)
-{
-       struct vrf *vrf;
-       struct listnode *node;
-       struct interface *ifp;
-       struct connected *ifc;
-       struct prefix *p;
-
-       RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
-       {
-               if (RB_EMPTY (if_name_head, &vrf->ifaces_by_name))
-                       continue;
-
-               vty_out (vty, "\nVRF %s(%u)\n\n",
-                        VRF_LOGNAME(vrf), vrf->vrf_id);
-
-               FOR_ALL_INTERFACES (vrf, ifp) {
-                       for (ALL_LIST_ELEMENTS_RO (ifp->connected, node, ifc)) {
-                               p = ifc->address;
-
-                               if (p->family == AF_INET)
-                                       vty_out (vty, "%pFX\n", p);
-                       }
-               }
-       }
-       return CMD_SUCCESS;
-}
-#endif
-
 /* Allocate connected structure. */
 struct connected *connected_new(void)
 {
@@ -1083,84 +1019,6 @@ struct connected *connected_get_linklocal(struct interface *ifp)
        return c;
 }
 
-#if 0  /* this route_table of struct connected's is unused                     \
-       * however, it would be good to use a route_table rather than           \
-       * a list..                                                             \
-       */
-/* Interface looking up by interface's address. */
-/* Interface's IPv4 address reverse lookup table. */
-struct route_table *ifaddr_ipv4_table;
-/* struct route_table *ifaddr_ipv6_table; */
-
-static void
-ifaddr_ipv4_add (struct in_addr *ifaddr, struct interface *ifp)
-{
-  struct route_node *rn;
-  struct prefix_ipv4 p;
-
-  p.family = AF_INET;
-  p.prefixlen = IPV4_MAX_PREFIXLEN;
-  p.prefix = *ifaddr;
-
-  rn = route_node_get (ifaddr_ipv4_table, (struct prefix *) &p);
-  if (rn)
-    {
-      route_unlock_node (rn);
-      zlog_info("ifaddr_ipv4_add(): address %pI4 is already added",
-                               ifaddr);
-      return;
-    }
-  rn->info = ifp;
-}
-
-static void
-ifaddr_ipv4_delete (struct in_addr *ifaddr, struct interface *ifp)
-{
-  struct route_node *rn;
-  struct prefix_ipv4 p;
-
-  p.family = AF_INET;
-  p.prefixlen = IPV4_MAX_PREFIXLEN;
-  p.prefix = *ifaddr;
-
-  rn = route_node_lookup (ifaddr_ipv4_table, (struct prefix *) &p);
-  if (! rn)
-    {
-      zlog_info("%s: can't find address %pI4", __func__, ifaddr);
-      return;
-    }
-  rn->info = NULL;
-  route_unlock_node (rn);
-  route_unlock_node (rn);
-}
-
-/* Lookup interface by interface's IP address or interface index. */
-static struct interface *
-ifaddr_ipv4_lookup (struct in_addr *addr, ifindex_t ifindex)
-{
-  struct prefix_ipv4 p;
-  struct route_node *rn;
-  struct interface *ifp;
-
-  if (addr)
-    {
-      p.family = AF_INET;
-      p.prefixlen = IPV4_MAX_PREFIXLEN;
-      p.prefix = *addr;
-
-      rn = route_node_lookup (ifaddr_ipv4_table, (struct prefix *) &p);
-      if (! rn)
-       return NULL;
-
-      ifp = rn->info;
-      route_unlock_node (rn);
-      return ifp;
-    }
-  else
-    return if_lookup_by_index(ifindex, VRF_DEFAULT);
-}
-#endif /* ifaddr_ipv4_table */
-
 void if_terminate(struct vrf *vrf)
 {
        struct interface *ifp;
index 21b3d47b097b441e982861d73423a4c346425251..4062b183e721178ad22649e2f04ff417aaf24899 100644 (file)
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -396,16 +396,6 @@ static void vty_do_window_size(struct vty *vty)
        vty_out(vty, "%s", cmd);
 }
 
-#if 0  /* Currently not used. */
-/* Make don't use lflow vty interface. */
-static void
-vty_dont_lflow_ahead (struct vty *vty)
-{
-  unsigned char cmd[] = { IAC, DONT, TELOPT_LFLOW, '\0' };
-  vty_out (vty, "%s", cmd);
-}
-#endif /* 0 */
-
 /* Authentication of vty */
 static void vty_auth(struct vty *vty, char *buf)
 {
@@ -1090,11 +1080,6 @@ static void vty_describe_command(struct vty *vty)
 
                                vector_free(varcomps);
                        }
-#if 0
-        vty_out (vty, "  %-*s %s\n", width
-                 desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd,
-                 desc->str ? desc->str : "");
-#endif /* 0 */
                }
 
        if ((token = token_cr)) {
@@ -1396,12 +1381,6 @@ static int vty_read(struct thread *thread)
                        case 'Q':
                                vty_buffer_reset(vty);
                                break;
-#if 0 /* More line does not work for "show ip bgp".  */
-            case '\n':
-            case '\r':
-              vty->status = VTY_MORELINE;
-              break;
-#endif
                        default:
                                break;
                        }
index f8e4677220f77a46b305054f51b7c189466ce6e3..8eabdf52e76362442e0e8abe3cd4a9f748bbbbc8 100644 (file)
@@ -377,11 +377,6 @@ stats:
        if (yielded)
                wq->yields++;
 
-#if 0
-  printf ("%s: cycles %d, new: best %d, worst %d\n",
-            __func__, cycles, wq->cycles.best, wq->cycles.granularity);
-#endif
-
        /* Is the queue done yet? If it is, call the completion callback. */
        if (!work_queue_empty(wq)) {
                if (ret == WQ_RETRY_LATER ||