diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-11-18 10:51:08 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-11-18 10:51:08 +0000 |
commit | f1590834352d863d238d38c5a58d5a31ab042e3f (patch) | |
tree | 23dd849a19f44300004f5d4a6f68d728faadaf19 /ctrl | |
parent | 7a8ed38fac8f0c42e214e3f648be855609afcc43 (diff) | |
parent | fb81ea88640de69820f2b2d24e29e5743e4f301b (diff) |
Merge "[HICN-225] Added generic binary api for handling faces"
Diffstat (limited to 'ctrl')
-rw-r--r-- | ctrl/sysrepo-plugins/hicn-plugin/plugin/model/hicn_model.c | 16 |
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"); |