From 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 Mon Sep 17 00:00:00 2001 From: Mauro Date: Wed, 30 Jun 2021 07:57:22 +0000 Subject: [HICN-713] Transport Library Major Refactoring 2 Co-authored-by: Luca Muscariello Co-authored-by: Michele Papalini Co-authored-by: Olivier Roques Co-authored-by: Giulio Grassi Signed-off-by: Mauro Sardara Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2 --- telemetry/vpp-collectd/vpp/CMakeLists.txt | 5 ++--- telemetry/vpp-collectd/vpp/vpp.c | 19 +------------------ 2 files changed, 3 insertions(+), 21 deletions(-) (limited to 'telemetry/vpp-collectd/vpp') diff --git a/telemetry/vpp-collectd/vpp/CMakeLists.txt b/telemetry/vpp-collectd/vpp/CMakeLists.txt index 464ab42d8..c36787355 100644 --- a/telemetry/vpp-collectd/vpp/CMakeLists.txt +++ b/telemetry/vpp-collectd/vpp/CMakeLists.txt @@ -11,8 +11,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) - # Dependencies find_package(Vpp REQUIRED) find_package(Collectd REQUIRED) @@ -23,7 +21,8 @@ list(APPEND SOURCE_FILES list(APPEND INCLUDE_DIRS ${COLLECTD_INCLUDE_DIRS} ${VPP_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}) + ${CMAKE_CURRENT_SOURCE_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/../common") list(APPEND LIBRARIES ${VPP_LIBRARY_VPPAPICLIENT} diff --git a/telemetry/vpp-collectd/vpp/vpp.c b/telemetry/vpp-collectd/vpp/vpp.c index 8bf5182a8..dcf956c93 100644 --- a/telemetry/vpp-collectd/vpp/vpp.c +++ b/telemetry/vpp-collectd/vpp/vpp.c @@ -15,23 +15,13 @@ /* Keep order as it is */ #include -#include -#include +#include "common.h" #define counter_t vpp_counter_t #include #include #undef counter_t -#define STATIC_ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a))) - -#define IS_TRUE(s) \ - ((strcasecmp("true", (s)) == 0) || (strcasecmp("yes", (s)) == 0) || \ - (strcasecmp("on", (s)) == 0)) -#define IS_FALSE(s) \ - ((strcasecmp("false", (s)) == 0) || (strcasecmp("no", (s)) == 0) || \ - (strcasecmp("off", (s)) == 0)) - /************** OPTIONS ***********************************/ static const char *config_keys[2] = { "Verbose", @@ -157,12 +147,6 @@ static data_set_t if_tx_broadcast_ds = { /**********************************************************/ /********** UTILITY FUNCTIONS *****************************/ /**********************************************************/ -char *sstrncpy(char *dest, const char *src, size_t n) { - strncpy(dest, src, n); - dest[n - 1] = '\0'; - return dest; -} - /* * Utility function used by the read callback to populate a * value_list_t and pass it to plugin_dispatch_values. @@ -245,7 +229,6 @@ static int get_data_set(const char *stat_name, data_set_t *data_set_ptr) { /**********************************************************/ /********** CALLBACK FUNCTIONS ****************************/ /**********************************************************/ - /* * This function is called for each configuration item. */ -- cgit 1.2.3-korg