summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-04-03 22:18:08 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-04-03 22:18:08 +0200
commitfe7f26ce7660fe054f207bd0e5cd92ed138698ab (patch)
tree438a6ed915901169df9cfe2a52162c28f909be9f
parentMerge pull request #4070 from donaldsharp/static_fixup (diff)
downloadfrr-fe7f26ce7660fe054f207bd0e5cd92ed138698ab.tar.xz
frr-fe7f26ce7660fe054f207bd0e5cd92ed138698ab.zip
lib: remove event_counter.[ch]
goodbye spooky code Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--lib/event_counter.c71
-rw-r--r--lib/event_counter.h62
-rw-r--r--lib/subdir.am2
-rw-r--r--tests/lib/cxxcompat.c1
4 files changed, 0 insertions, 136 deletions
diff --git a/lib/event_counter.c b/lib/event_counter.c
deleted file mode 100644
index 57dbfb5fd..000000000
--- a/lib/event_counter.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2016 Christian Franke
- *
- * This file is part of Quagga.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Alternatively, you can use, redistribute and/or modify it under the
- * following terms:
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <zebra.h>
-
-#include "event_counter.h"
-
-void event_counter_inc(struct event_counter *counter)
-{
- counter->count++;
- counter->last = time(NULL);
-}
-
-const char *event_counter_format(const struct event_counter *counter)
-{
- struct tm last_change_store;
- struct tm *last_change;
- char timebuf[sizeof("Thu, 01 Jan 1970 00:00:00 +0000")];
- static char rv[20 + sizeof(" last: ") + sizeof(timebuf)];
-
- last_change = localtime_r(&counter->last, &last_change_store);
- if (!last_change
- || strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %T %z",
- last_change)
- == 0) {
- strlcpy(timebuf, "???", sizeof(timebuf));
- }
-
- snprintf(rv, sizeof(rv), "%5llu last: %s", counter->count,
- counter->last ? timebuf : "(never)");
- return rv;
-}
diff --git a/lib/event_counter.h b/lib/event_counter.h
deleted file mode 100644
index 8ae276ffe..000000000
--- a/lib/event_counter.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2016 Christian Franke
- *
- * This file is part of Quagga.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Alternatively, you can use, redistribute and/or modify it under the
- * following terms:
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _ZEBRA_EVENT_COUNTER_H
-#define _ZEBRA_EVENT_COUNTER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct event_counter {
- unsigned long long count;
- time_t last;
-};
-
-void event_counter_inc(struct event_counter *counter);
-const char *event_counter_format(const struct event_counter *counter);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/lib/subdir.am b/lib/subdir.am
index f245560c4..3b14be467 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -18,7 +18,6 @@ lib_libfrr_la_SOURCES = \
lib/csv.c \
lib/debug.c \
lib/distribute.c \
- lib/event_counter.c \
lib/ferr.c \
lib/filter.c \
lib/frr_pthread.c \
@@ -144,7 +143,6 @@ pkginclude_HEADERS += \
lib/db.h \
lib/debug.h \
lib/distribute.h \
- lib/event_counter.h \
lib/ferr.h \
lib/fifo.h \
lib/filter.h \
diff --git a/tests/lib/cxxcompat.c b/tests/lib/cxxcompat.c
index 530468642..d10962993 100644
--- a/tests/lib/cxxcompat.c
+++ b/tests/lib/cxxcompat.c
@@ -31,7 +31,6 @@
#include "lib/csv.h"
#include "lib/debug.h"
#include "lib/distribute.h"
-#include "lib/event_counter.h"
#include "lib/ferr.h"
#include "lib/fifo.h"
#include "lib/filter.h"