aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/sysrepo-plugins/hicn-light
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/sysrepo-plugins/hicn-light
parented27687177b38da2b0bc43b2e01fcb2034751935 (diff)
[HICN-357] sysrepo plugin update
Signed-off-by: masoud <mhemmatp@cisco.com> Change-Id: Idabe9d3a3b03139ad3cdb20c8c822e6dd7d4c553
Diffstat (limited to 'ctrl/sysrepo-plugins/hicn-light')
-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
2 files changed, 11 insertions, 14 deletions
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
+}