]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: remove event_counter.[ch]
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 3 Apr 2019 20:18:08 +0000 (20:18 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 3 Apr 2019 20:18:08 +0000 (20:18 +0000)
goodbye spooky code

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/event_counter.c [deleted file]
lib/event_counter.h [deleted file]
lib/subdir.am
tests/lib/cxxcompat.c

diff --git a/lib/event_counter.c b/lib/event_counter.c
deleted file mode 100644 (file)
index 57dbfb5..0000000
+++ /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 (file)
index 8ae276f..0000000
+++ /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
index f245560c45829cd5e41a11f0e8f527248bf59b13..3b14be46767b5fbbb26bfce5f7e10c3c5872571d 100644 (file)
@@ -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 \
index 530468642eb81ca45cf67b70f4a583c2fcb6dc7b..d10962993d219f1b8f0658b786f3d05a8f238ce1 100644 (file)
@@ -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"