summaryrefslogtreecommitdiffstats
path: root/ctrl/sysrepo-plugins
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-12-02 14:28:22 +0100
committerLuca Muscariello <muscariello@ieee.org>2019-12-04 09:45:43 +0000
commit2bfd3335ff11281d703cb7f422bb17da2d3a6bcd (patch)
tree278c097859d17c3f96c84d432ab1ef5c80e9a6d2 /ctrl/sysrepo-plugins
parent3e0ff4e7897bb8bc03538f1b2643fe73de158714 (diff)
to fix HICN-421 by adding cpack to libyang and sysrepo
Signed-off-by: Luca Muscariello <muscariello@ieee.org> Change-Id: Ia9e0752f877c7fc0be6df85664d18e1caad86741 Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'ctrl/sysrepo-plugins')
-rw-r--r--ctrl/sysrepo-plugins/CMakeLists.txt14
-rw-r--r--ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c8
2 files changed, 14 insertions, 8 deletions
diff --git a/ctrl/sysrepo-plugins/CMakeLists.txt b/ctrl/sysrepo-plugins/CMakeLists.txt
index d6f319fdb..4671794a0 100644
--- a/ctrl/sysrepo-plugins/CMakeLists.txt
+++ b/ctrl/sysrepo-plugins/CMakeLists.txt
@@ -23,9 +23,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Mo
include(GNUInstallDirs)
include(BuildMacros)
-find_package(PkgConfig)
-find_package(Sysrepo)
-find_package_wrapper(Vpp REQUIRED)
+find_package(PkgConfig REQUIRED)
+find_package(Sysrepo REQUIRED)
if (NOT SRPD_PLUGINS_PATH)
if (PKG_CONFIG_FOUND)
@@ -38,7 +37,9 @@ if (NOT SRPD_PLUGINS_PATH)
endif()
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
- find_package_wrapper(HicnPlugin REQUIRED)
+ find_package(VPP REQUIRED)
+ find_package(HicnPlugin REQUIRED)
+ find_package(Libhicn REQUIRED)
add_subdirectory(hicn-plugin)
else()
if (BUILD_HICNPLUGIN AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
@@ -49,4 +50,9 @@ else()
endif()
# add subdirectories
+
include(Packaging)
+if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
+ include(Packager)
+ make_packages()
+endif()
diff --git a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
index 305512af3..8db0a6238 100644
--- a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
+++ b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
@@ -296,7 +296,7 @@ vapi_error_e call_hicn_api_node_params_set(struct vapi_ctx_s *ctx,
}
static inline void state_update(sr_val_t * vals, struct lyd_node **parent, sr_session_ctx_t *session){
- char buf[20];
+ char buf[20];
//struct ly_ctx *ly_ctx = sr_get_context(sr_session_get_connection(session));
sr_val_set_xpath(&vals[0], "/hicn:hicn-state/states/pkts_processed");
vals[0].type = SR_UINT64_T;
@@ -420,12 +420,12 @@ static inline int routes_update(sr_val_t * vals, uint32_t nleaves, struct lyd_n
memset(buf, 0x00, 20);
if (temp->route.prefix.address.af==ADDRESS_IP4){
struct sockaddr_in sa;
- memcpy(&sa.sin_addr.s_addr,temp->route.prefix.address.un.ip4,INET_ADDRSTRLEN);
+ memcpy(&sa.sin_addr.s_addr, temp->route.prefix.address.un.ip4, IPV4_ADDR_LEN);
inet_ntop(AF_INET, &(sa.sin_addr), buf, INET_ADDRSTRLEN);
vals[route].data.string_val = buf;
}else{
struct sockaddr_in6 sa;
- memcpy(&sa.sin6_addr,temp->route.prefix.address.un.ip6,INET6_ADDRSTRLEN);
+ memcpy(&sa.sin6_addr,temp->route.prefix.address.un.ip6, IPV6_ADDR_LEN);
inet_ntop(AF_INET6, &(sa.sin6_addr), buf, INET6_ADDRSTRLEN);
vals[route].data.string_val = buf;
}
@@ -443,7 +443,7 @@ static inline int routes_update(sr_val_t * vals, uint32_t nleaves, struct lyd_n
memset(buf, 0x00, 20);
sprintf( buf, "%d", temp->route.strategy_id);
lyd_new_path(*parent, NULL, vals[route].xpath, buf, 0, 0);
-
+
route++;
temp=temp->next;