summaryrefslogtreecommitdiffstats
path: root/ctrl
diff options
context:
space:
mode:
authormasoud <mhemmatp@cisco.com>2019-10-31 18:07:18 +0100
committerMasoud Hemmatpour <mhemmatp@cisco.com>2019-11-04 13:02:29 +0000
commit6b7f4c3f9d9d26a5aa71be8f5976956aff387e8f (patch)
treeb4b8c63ab76ab3f39543196b7c4d59a8b7353736 /ctrl
parented27687177b38da2b0bc43b2e01fcb2034751935 (diff)
[HICN-357] sysrepo plugin update
Signed-off-by: masoud <mhemmatp@cisco.com> Change-Id: Idabe9d3a3b03139ad3cdb20c8c822e6dd7d4c553
Diffstat (limited to 'ctrl')
-rw-r--r--ctrl/sysrepo-plugins/cmake/FindHicnLight.cmake6
-rw-r--r--ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light_comm.h2
-rw-r--r--ctrl/sysrepo-plugins/hicn-light/plugin/model/hicn_model.c23
-rw-r--r--ctrl/sysrepo-plugins/hicn-plugin/plugin/ietf/ietf_interface.c2
-rw-r--r--ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c16
5 files changed, 17 insertions, 32 deletions
diff --git a/ctrl/sysrepo-plugins/cmake/FindHicnLight.cmake b/ctrl/sysrepo-plugins/cmake/FindHicnLight.cmake
index bce3265fa..7883b09dd 100644
--- a/ctrl/sysrepo-plugins/cmake/FindHicnLight.cmake
+++ b/ctrl/sysrepo-plugins/cmake/FindHicnLight.cmake
@@ -18,15 +18,15 @@ set(HICNLIGHT_SEARCH_PATH_LIST
/usr
)
-find_path(HICNLIGHT_INCLUDE_DIR hicn/api/api.h
+find_path(HICNLIGHT_INCLUDE_DIR hicn/ctrl/api.h
HINTS ${HICNLIGHT_SEARCH_PATH_LIST}
PATH_SUFFIXES include
DOC "Find the hicn plugin includes"
)
-find_library(HICNLIGHT_LIBRARY NAMES libhicn-light-ctrl.so
+find_library(HICNLIGHT_LIBRARY NAMES libhicnctrl.so
HINTS ${HICNLIGHT_SEARCH_PATH_LIST}
- PATH_SUFFIXES lib
+ PATH_SUFFIXES lib/x86_64-linux-gnu/
DOC "Find the hicn light lib"
)
diff --git a/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light_comm.h b/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light_comm.h
index adb7737aa..100023564 100644
--- a/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light_comm.h
+++ b/ctrl/sysrepo-plugins/hicn-light/plugin/hicn_light_comm.h
@@ -20,7 +20,7 @@
#include <sysrepo/values.h>
-#include <hicn/api/api.h>
+#include <hicn/ctrl/api.h>
#ifndef HICN_THIS_FUNC
#ifdef __FUNCTION__
diff --git a/ctrl/sysrepo-plugins/hicn-light/plugin/model/hicn_model.c b/ctrl/sysrepo-plugins/hicn-light/plugin/model/hicn_model.c
index 7cfb8363a..6f8ece08c 100644
--- a/ctrl/sysrepo-plugins/hicn-light/plugin/model/hicn_model.c
+++ b/ctrl/sysrepo-plugins/hicn-light/plugin/model/hicn_model.c
@@ -33,24 +33,22 @@ static int hicn_face_ip_add_cb(const char *xpath, const sr_val_t *input,
size_t *output_cnt, void *private_ctx) {
SRP_LOG_DBG_MSG("hicn face ip add received successfully");
-
hc_face_t face;
-
if(strcmp(input[0].data.string_val,"-1")){
struct sockaddr_in sa;
// store this IP address in sa:
inet_pton(AF_INET, input[0].data.string_val, &(sa.sin_addr));
- face.face.hicn.family=AF_INET;
- face.face.hicn.local_addr.v4.as_inaddr=sa.sin_addr;
+ face.face.family=AF_INET;
+ face.face.local_addr.v4.as_inaddr=sa.sin_addr;
}else if(strcmp(input[1].data.string_val,"-1")){
struct in6_addr *dst = malloc(sizeof(struct in6_addr));
inet_pton(AF_INET6, input[1].data.string_val, dst);
- face.face.hicn.family=AF_INET6;
- face.face.hicn.local_addr.v6.as_in6addr = *dst;
+ face.face.family=AF_INET6;
+ face.face.local_addr.v6.as_in6addr = *dst;
}else{
SRP_LOG_DBG_MSG("Invalid local IP address");
@@ -62,16 +60,16 @@ static int hicn_face_ip_add_cb(const char *xpath, const sr_val_t *input,
struct sockaddr_in sa;
// store this IP address in sa:
inet_pton(AF_INET, input[2].data.string_val, &(sa.sin_addr));
- face.face.hicn.family=AF_INET;
- face.face.hicn.remote_addr.v4.as_inaddr=sa.sin_addr;
+ face.face.family=AF_INET;
+ face.face.remote_addr.v4.as_inaddr=sa.sin_addr;
}else if(strcmp(input[3].data.string_val,"-1")){
struct in6_addr *dst = malloc(sizeof(struct in6_addr));
inet_pton(AF_INET6, input[3].data.string_val, dst);
- face.face.hicn.family=AF_INET6;
- face.face.hicn.remote_addr.v6.as_in6addr = *dst;
+ face.face.family=AF_INET6;
+ face.face.remote_addr.v6.as_in6addr = *dst;
}else{
SRP_LOG_DBG_MSG("Invalid local IP address");
@@ -80,11 +78,10 @@ static int hicn_face_ip_add_cb(const char *xpath, const sr_val_t *input,
// strncpy(face.face.hicn.netdevice.name,"ens39"); // Can we work only with Idx number ?
- face.face.hicn.netdevice.index = input[4].data.uint32_val; // This is the idx number of interface
+ face.face.netdevice.index = input[4].data.uint32_val; // This is the idx number of interface
face.id=0;//can be empty
- face.face.tags=0;//can be empty
strcpy(face.name,"hicn_face");
face.face.type=1;
@@ -203,4 +200,4 @@ error:
sr_plugin_cleanup_cb(session, hsocket);
return rc;
-} \ No newline at end of file
+}
diff --git a/ctrl/sysrepo-plugins/hicn-plugin/plugin/ietf/ietf_interface.c b/ctrl/sysrepo-plugins/hicn-plugin/plugin/ietf/ietf_interface.c
index f02605895..0498527cb 100644
--- a/ctrl/sysrepo-plugins/hicn-plugin/plugin/ietf/ietf_interface.c
+++ b/ctrl/sysrepo-plugins/hicn-plugin/plugin/ietf/ietf_interface.c
@@ -302,7 +302,7 @@ static i32 ietf_interface_name2index(const char *name, u32* if_index)
dump = vapi_alloc_sw_interface_dump(g_vapi_ctx_instance);
dump->payload.name_filter_valid = true;
- memcpy(dump->payload.name_filter, name, sizeof(dump->payload.name_filter));
+ memcpy(&dump->payload.name_filter, name, sizeof(dump->payload.name_filter));
while (VAPI_EAGAIN == (rv = vapi_sw_interface_dump(g_vapi_ctx_instance, dump, ietf_sw_interface_dump_cb, &dctx)))
;
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 b49839c53..b40293705 100644
--- a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
+++ b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
@@ -28,7 +28,7 @@
/* Hicn headers */
#include <vapi/hicn.api.vapi.h>
-#include <hicn/api/ip_address.h>
+#include <hicn/util/ip_address.h>
#include "../hicn_plugin.h"
#include "../hicn_vpp_comm.h"
#include "hicn_model.h"
@@ -485,18 +485,6 @@ static int hicn_node_params_set_cb(sr_session_ctx_t *session, const char *xpath,
new_val->data.int32_val);
msg->payload.cs_reserved_app = new_val->data.int32_val;
} else if (!strcmp(new_val->xpath,
- "/hicn:hicn-conf/params/pit_dflt_lifetime_sec")) {
- SRP_LOG_DBG("A change detected in '%s', op=%d",
- new_val ? new_val->xpath : old_val->xpath,
- new_val->data.decimal64_val);
- msg->payload.pit_dflt_lifetime_sec = new_val->data.decimal64_val;
- } else if (!strcmp(new_val->xpath,
- "/hicn:hicn-conf/params/pit_min_lifetime_sec")) {
- SRP_LOG_DBG("A change detected in '%s', op=%d",
- new_val ? new_val->xpath : old_val->xpath,
- new_val->data.decimal64_val);
- msg->payload.pit_min_lifetime_sec = new_val->data.decimal64_val;
- } else if (!strcmp(new_val->xpath,
"/hicn:hicn-conf/params/pit_max_lifetime_sec")) {
SRP_LOG_DBG("A change detected in '%s', op=%d",
new_val ? new_val->xpath : old_val->xpath,
@@ -1452,4 +1440,4 @@ error:
SRP_LOG_ERR_MSG("Error by initialization of the hicn plugin.");
sr_plugin_cleanup_cb(session, &g_vapi_ctx_instance);
return rc;
-} \ No newline at end of file
+}