size_t len;
u8 i;
- lease->is_ipv6 = 0; // only support IPv6 clients
+ lease->is_ipv6 = 0; // only support IPv4 clients
lease->sw_if_index = ntohl (client->sw_if_index);
lease->state = ntohl (client->state);
len = clib_min (sizeof (lease->hostname) - 1, vec_len (client->hostname));
return -1;
}
+static void
+vl_api_dhcp_client_details_t_handler (vl_api_dhcp_client_details_t * mp)
+{
+ vat_main_t *vam = &vat_main;
+ vl_api_dhcp_client_t *cp;
+ vl_api_dhcp_lease_t *lp;
+
+ cp = &mp->client;
+ lp = &mp->lease;
+
+ print (vam->ofp, "sw_if_index %d, id '%s'", ntohl (cp->sw_if_index),
+ cp->id);
+
+ print (vam->ofp, "leased address %U, router address %U",
+ format_ip4_address, &lp->host_address.un,
+ format_ip4_address, &lp->router_address.un);
+}
+
static int
api_dhcp_client_dump (vat_main_t * vam)
{
- return -1;
+ vl_api_dhcp_plugin_control_ping_t *mp_ping;
+ vl_api_dhcp_client_dump_t *mp;
+ int ret;
+
+ M (DHCP_CLIENT_DUMP, mp);
+
+ S (mp);
+
+ /* Use a control ping for synchronization */
+ MPING (DHCP_PLUGIN_CONTROL_PING, mp_ping);
+ S (mp_ping);
+
+ W (ret);
+ return ret;
}
static int
return -1;
}
-#define vl_api_dhcp_client_details_t_handler vl_noop_handler
-
static void
vl_api_dhcp_plugin_get_version_reply_t_handler
(vl_api_dhcp_plugin_get_version_reply_t * mp)
memory_api.c
memory_shared.c
memory_client.c
+ socket_client.c
socket_api.c
vlib_api.c
vlib_api_cli.c
vec_free (serialized_message_table);
}
+clib_error_t *vat_builtin_main_init (vlib_main_t * vm) __attribute__ ((weak));
+clib_error_t *
+vat_builtin_main_init (vlib_main_t * vm)
+{
+ return 0;
+}
+
static uword
vl_api_clnt_process (vlib_main_t * vm, vlib_node_runtime_t * node,
vlib_frame_t * f)
if (e)
clib_error_report (e);
+ e = vat_builtin_main_init (vm);
+ if (e)
+ clib_error_report (e);
+
sleep_time = 10.0;
dead_client_scan_time = vlib_time_now (vm) + 10.0;
hash_set (vam->error_string_by_error_number, 99, "Misc");
}
-static clib_error_t *
-api_main_init (vlib_main_t * vm)
+#if VPP_API_TEST_BUILTIN > 0
+clib_error_t *
+vat_builtin_main_init (vlib_main_t * vm)
{
vat_main_t *vam = &vat_main;
int rv;
return 0;
}
-
-VLIB_MAIN_LOOP_ENTER_FUNCTION (api_main_init);
+#endif
void
vat_plugin_hash_create (void)
static void
vpe_main_init (vlib_main_t * vm)
{
+#if VPP_API_TEST_BUILTIN > 0
void vat_plugin_hash_create (void);
+#endif
if (CLIB_DEBUG > 0)
vlib_unix_cli_set_prompt ("DBGvpp# ");
/*
* Create the binary api plugin hashes before loading plugins
*/
+#if VPP_API_TEST_BUILTIN > 0
vat_plugin_hash_create ();
+#endif
if (!vlib_plugin_path)
vpp_find_plugin_path ();