aboutsummaryrefslogtreecommitdiffstats
path: root/ctrl/sysrepo-plugins/hicn-plugin
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-11-17 12:50:48 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-11-18 11:16:44 +0100
commitfb81ea88640de69820f2b2d24e29e5743e4f301b (patch)
tree51b929825d7d68b4105ac63ea0cea32dd48ae269 /ctrl/sysrepo-plugins/hicn-plugin
parent547acf3eed92d3564139cccf205c852178bcc310 (diff)
[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>
Diffstat (limited to 'ctrl/sysrepo-plugins/hicn-plugin')
-rw-r--r--ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c16
1 files changed, 8 insertions, 8 deletions
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");