DHCP Client Dump
[vpp.git] / src / vat / api_format.c
index df62e81..f17802d 100644 (file)
@@ -2669,10 +2669,11 @@ vl_api_dhcp_compl_event_t_handler (vl_api_dhcp_compl_event_t * mp)
 {
   errmsg ("DHCP compl event: pid %d %s hostname %s host_addr %U "
          "router_addr %U host_mac %U",
-         ntohl (mp->pid), mp->is_ipv6 ? "ipv6" : "ipv4", mp->hostname,
-         format_ip4_address, &mp->host_address,
-         format_ip4_address, &mp->router_address,
-         format_ethernet_address, mp->host_mac);
+         ntohl (mp->pid), mp->lease.is_ipv6 ? "ipv6" : "ipv4",
+         mp->lease.hostname,
+         format_ip4_address, &mp->lease.host_address,
+         format_ip4_address, &mp->lease.router_address,
+         format_ethernet_address, mp->lease.host_mac);
 }
 
 static void vl_api_dhcp_compl_event_t_handler_json
@@ -7354,7 +7355,7 @@ api_l2fib_add_del (vat_main_t * vam)
   u8 mac_set = 0;
   u32 bd_id;
   u8 bd_id_set = 0;
-  u32 sw_if_index = ~0;
+  u32 sw_if_index = 0;
   u8 sw_if_index_set = 0;
   u8 is_add = 1;
   u8 static_mac = 0;
@@ -7437,10 +7438,10 @@ api_l2fib_add_del (vat_main_t * vam)
       clib_memcpy (mp->mac, mac, 6);
       mp->bd_id = ntohl (bd_id);
       mp->is_add = is_add;
+      mp->sw_if_index = ntohl (sw_if_index);
 
       if (is_add)
        {
-         mp->sw_if_index = ntohl (sw_if_index);
          mp->static_mac = static_mac;
          mp->filter_mac = filter_mac;
          mp->bvi_mac = bvi_mac;
@@ -10125,12 +10126,12 @@ api_dhcp_client_config (vat_main_t * vam)
   /* Construct the API message */
   M (DHCP_CLIENT_CONFIG, mp);
 
-  mp->sw_if_index = htonl (sw_if_index);
-  clib_memcpy (mp->hostname, hostname, vec_len (hostname));
-  vec_free (hostname);
   mp->is_add = is_add;
-  mp->want_dhcp_event = disable_event ? 0 : 1;
-  mp->pid = htonl (getpid ());
+  mp->client.sw_if_index = htonl (sw_if_index);
+  clib_memcpy (mp->client.hostname, hostname, vec_len (hostname));
+  vec_free (hostname);
+  mp->client.want_dhcp_event = disable_event ? 0 : 1;
+  mp->client.pid = htonl (getpid ());
 
   /* send it... */
   S (mp);
@@ -23298,7 +23299,7 @@ script (vat_main_t * vam)
   vam->current_file = s;
   do_one_file (vam);
 
-  clib_memcpy (&vam->input, &save_input, sizeof (vam->input));
+  clib_memcpy (&vam->input, &save_input, sizeof (save_input));
   clib_memcpy (&vam->jump_buf, &save_jump_buf, sizeof (save_jump_buf));
   vam->ifp = save_ifp;
   vam->input_line_number = save_line_number;