api: register endian handlers for reply messages
[vpp.git] / src / plugins / lb / api.c
index bef6969..253cf5b 100644 (file)
@@ -93,7 +93,7 @@ vl_api_lb_add_del_vip_t_handler
       mp->protocol = ~0;
     }
 
-  memcpy (&(args.prefix.ip6), &mp->pfx.address.un.ip6, sizeof(args.prefix.ip6));
+  ip_address_decode (&mp->pfx.address, &(args.prefix));
 
   if (mp->is_del) {
     u32 vip_index;
@@ -183,20 +183,15 @@ vl_api_lb_add_del_as_t_handler
   int rv = 0;
   u32 vip_index;
   ip46_address_t vip_ip_prefix;
+  ip46_address_t as_address;
 
   /* if port == 0, it means all-port VIP */
   if (mp->port == 0)
     {
       mp->protocol = ~0;
     }
-
-  memcpy(&vip_ip_prefix.ip6, &mp->pfx.address.un.ip6,
-              sizeof(vip_ip_prefix.ip6));
-
-  ip46_address_t as_address;
-
-  memcpy(&as_address.ip6, &mp->as_address.un.ip6,
-         sizeof(as_address.ip6));
+  ip_address_decode (&mp->pfx.address, &vip_ip_prefix);
+  ip_address_decode (&mp->as_address, &as_address);
 
   if ((rv = lb_vip_find_index(&vip_ip_prefix, mp->pfx.len,
                               mp->protocol, ntohs(mp->port), &vip_index)))
@@ -247,7 +242,7 @@ vl_api_lb_vip_dump_t_handler
 
   /* construct vip list */
   pool_foreach(vip, lbm->vips, {
-      /* Hide dummy VIP */
+      /* Hide placeholder VIP */
       if (vip != lbm->vips) {
         msg_size = sizeof (*rmp);
         rmp = vl_msg_api_alloc (msg_size);
@@ -286,7 +281,7 @@ static void send_lb_as_details
   lb_as_t *as;
 
   pool_foreach(as_index, vip->as_indexes, {
-      /* Hide dummy As for specific VIP */
+      /* Hide placeholder As for specific VIP */
       if (*as_index != 0) {
         as = &lbm->ass[*as_index];
         msg_size = sizeof (*rmp);