+/* Sets the maximum amount of timeout that 'cli' will wait for a reply from
+ * the DHCP server before retransmitting, in seconds, to 'max_timeout'. The
+ * default is 64 seconds. */
+void
+dhclient_set_max_timeout(struct dhclient *cli, unsigned int max_timeout)
+{
+ cli->max_timeout = MAX(2, max_timeout);
+}
+
+/* Destroys 'cli' and frees all related resources. */
+void
+dhclient_destroy(struct dhclient *cli)
+{
+ if (cli) {
+ dhcp_msg_uninit(cli->binding);
+ free(cli->binding);
+ netdev_close(cli->netdev);
+ ds_destroy(&cli->s);
+ free(cli);
+ }
+}
+
+/* Returns the network device in use by 'cli'. The caller must not destroy
+ * the returned device. */
+struct netdev *
+dhclient_get_netdev(struct dhclient *cli)
+{
+ return cli->netdev;
+}
+