From fb81ea88640de69820f2b2d24e29e5743e4f301b Mon Sep 17 00:00:00 2001
From: Alberto Compagno <acompagn+fdio@cisco.com>
Date: Sun, 17 Nov 2019 12:50:48 +0100
Subject: [HICN-225] Added generic binary api for handling faces

Supported messages are add, del, get, dump, get.
Each message contains a face id and the expected message has different
fields based on the face type.
The binary api specific for ip faces is still available for compatibility
but deprecated.

Change-Id: I899c6cf31a56abd39ad287ea3128993857997fcb
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
---
 .../hicn-plugin/plugin/model/hicn_model.c                | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

(limited to 'ctrl/sysrepo-plugins/hicn-plugin/plugin')

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 4bf266ff5..bb8c5e828 100644
--- a/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
+++ b/ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c
@@ -1053,16 +1053,16 @@ static int hicn_face_ip_add_cb(const char *xpath, const sr_val_t *input,
      struct sockaddr_in sa;
      inet_pton(AF_INET,  input[0].data.string_val, &(sa.sin_addr));
      unsigned char * tmp = (unsigned char *) &sa.sin_addr.s_addr;
-     memcpy(&msg->payload.local_addr.un.ip4[0],tmp,B32);
-     msg->payload.local_addr.af = ADDRESS_IP4;
+     memcpy(&msg->payload.face.local_addr.un.ip4[0],tmp,B32);
+     msg->payload.face.local_addr.af = ADDRESS_IP4;
 
  }else if(strcmp(input[1].data.string_val,"-1")){
 
      void *dst = malloc(sizeof(struct in6_addr));
      inet_pton(AF_INET6, input[1].data.string_val, dst);
      unsigned char * tmp = (unsigned char *) ((struct in6_addr *)dst)->s6_addr;
-     memcpy(&msg->payload.local_addr.un.ip6[0],tmp,B128);
-     msg->payload.local_addr.af = ADDRESS_IP6;
+     memcpy(&msg->payload.face.local_addr.un.ip6[0],tmp,B128);
+     msg->payload.face.local_addr.af = ADDRESS_IP6;
 
  }else{
      SRP_LOG_DBG_MSG("Invalid local IP address");
@@ -1074,8 +1074,8 @@ static int hicn_face_ip_add_cb(const char *xpath, const sr_val_t *input,
      struct sockaddr_in sa;
      inet_pton(AF_INET,  input[2].data.string_val, &(sa.sin_addr));
      unsigned char * tmp = (unsigned char *)&sa.sin_addr.s_addr;
-     memcpy(&msg->payload.remote_addr.un.ip4[0],tmp,B32);
-     msg->payload.remote_addr.af = ADDRESS_IP4;
+     memcpy(&msg->payload.face.remote_addr.un.ip4[0],tmp,B32);
+     msg->payload.face.remote_addr.af = ADDRESS_IP4;
 
 
  }else if(strcmp(input[3].data.string_val,"-1")){
@@ -1083,8 +1083,8 @@ static int hicn_face_ip_add_cb(const char *xpath, const sr_val_t *input,
      void *dst = malloc(sizeof(struct in6_addr));
      inet_pton(AF_INET6, input[3].data.string_val, dst);
      unsigned char * tmp =(unsigned char *) ((struct in6_addr *)dst)->s6_addr;
-     memcpy(&msg->payload.remote_addr.un.ip6[0],tmp,B128);
-     msg->payload.remote_addr.af = ADDRESS_IP6;
+     memcpy(&msg->payload.face.remote_addr.un.ip6[0],tmp,B128);
+     msg->payload.face.remote_addr.af = ADDRESS_IP6;
 
  }else{
      SRP_LOG_DBG_MSG("Invalid local IP address");
-- 
cgit