diff options
author | Mauro <you@example.com> | 2021-06-30 07:57:22 +0000 |
---|---|---|
committer | Mauro Sardara <msardara@cisco.com> | 2021-07-06 16:16:04 +0000 |
commit | 08233d44a6cfde878d7e10bca38ae935ed1c8fd5 (patch) | |
tree | 7ecc534d55bdc7e8dd15ecab084720910bcdf4d9 /telemetry/vpp-collectd/vpp-hicn | |
parent | 147ba39bed26887f5eba84757e2463ab8e370a9a (diff) |
[HICN-713] Transport Library Major Refactoring 2
Co-authored-by: Luca Muscariello <muscariello@ieee.org>
Co-authored-by: Michele Papalini <micpapal@cisco.com>
Co-authored-by: Olivier Roques <oroques+fdio@cisco.com>
Co-authored-by: Giulio Grassi <gigrassi@cisco.com>
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I5b2c667bad66feb45abdb5effe22ed0f6c85d1c2
Diffstat (limited to 'telemetry/vpp-collectd/vpp-hicn')
-rw-r--r-- | telemetry/vpp-collectd/vpp-hicn/CMakeLists.txt | 5 | ||||
-rw-r--r-- | telemetry/vpp-collectd/vpp-hicn/vpp_hicn.c | 19 |
2 files changed, 4 insertions, 20 deletions
diff --git a/telemetry/vpp-collectd/vpp-hicn/CMakeLists.txt b/telemetry/vpp-collectd/vpp-hicn/CMakeLists.txt index 3703515dc..9db20be38 100644 --- a/telemetry/vpp-collectd/vpp-hicn/CMakeLists.txt +++ b/telemetry/vpp-collectd/vpp-hicn/CMakeLists.txt @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # Dependencies find_package(Collectd REQUIRED) @@ -36,7 +36,8 @@ list(APPEND INCLUDE_DIRS ${HICNPLUGIN_INCLUDE_DIRS} ${SAFE_VAPI_INCLUDE_DIRS} ${VPP_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}) + ${CMAKE_CURRENT_SOURCE_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/../common") list(APPEND LIBRARIES ${VPP_LIBRARY_VAPICLIENT} diff --git a/telemetry/vpp-collectd/vpp-hicn/vpp_hicn.c b/telemetry/vpp-collectd/vpp-hicn/vpp_hicn.c index 4228ac6e6..b6bc3af49 100644 --- a/telemetry/vpp-collectd/vpp-hicn/vpp_hicn.c +++ b/telemetry/vpp-collectd/vpp-hicn/vpp_hicn.c @@ -15,8 +15,7 @@ /* Keep order as it is */ #include <config.h> -#include <collectd.h> -#include <plugin.h> +#include "common.h" #define counter_t vpp_counter_t #include <vapi/hicn.api.vapi.h> @@ -26,15 +25,6 @@ DEFINE_VAPI_MSG_IDS_HICN_API_JSON vapi_ctx_t vapi_ctx; -#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", @@ -181,12 +171,6 @@ static data_set_t dtx_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. @@ -214,7 +198,6 @@ static int submit(const char *plugin_instance, const char *type, /**********************************************************/ /********** CALLBACK FUNCTIONS ****************************/ /**********************************************************/ - /* * This function is called for each configuration item. */ |