summaryrefslogtreecommitdiffstats
path: root/src/plugins/dhcp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dhcp')
-rw-r--r--src/plugins/dhcp/dhcp_api.c2
-rw-r--r--src/plugins/dhcp/dhcp_test.c35
2 files changed, 33 insertions, 4 deletions
diff --git a/src/plugins/dhcp/dhcp_api.c b/src/plugins/dhcp/dhcp_api.c
index d2e423572fb..c5c7a82f3c3 100644
--- a/src/plugins/dhcp/dhcp_api.c
+++ b/src/plugins/dhcp/dhcp_api.c
@@ -262,7 +262,7 @@ dhcp_client_lease_encode (vl_api_dhcp_lease_t * lease,
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));
diff --git a/src/plugins/dhcp/dhcp_test.c b/src/plugins/dhcp/dhcp_test.c
index a0d6f416e6b..0eb87ab3257 100644
--- a/src/plugins/dhcp/dhcp_test.c
+++ b/src/plugins/dhcp/dhcp_test.c
@@ -366,10 +366,41 @@ api_dhcp6_pd_send_client_message (vat_main_t * vam)
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
@@ -396,8 +427,6 @@ api_dhcp_plugin_get_version (vat_main_t * vam)
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)