2 * Copyright (c) 2008 Nicira Networks.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #define DHCP_CLIENT_H 1
26 int dhclient_create(const char *netdev,
27 void (*modify_request)(struct dhcp_msg *, void *aux),
28 bool (*validate_offer)(const struct dhcp_msg *, void *aux),
29 void *aux, struct dhclient **);
30 void dhclient_set_max_timeout(struct dhclient *, unsigned int max_timeout);
31 void dhclient_destroy(struct dhclient *);
33 struct netdev *dhclient_get_netdev(struct dhclient *);
35 void dhclient_init(struct dhclient *, uint32_t requested_ip);
36 void dhclient_release(struct dhclient *);
37 void dhclient_force_renew(struct dhclient *, int deadline);
38 bool dhclient_is_bound(const struct dhclient *);
39 bool dhclient_changed(struct dhclient *);
41 const char *dhclient_get_state(const struct dhclient *);
42 unsigned int dhclient_get_state_elapsed(const struct dhclient *);
43 unsigned int dhclient_get_lease_remaining(const struct dhclient *);
45 uint32_t dhclient_get_ip(const struct dhclient *);
46 uint32_t dhclient_get_netmask(const struct dhclient *);
47 uint32_t dhclient_get_router(const struct dhclient *);
48 const struct dhcp_msg *dhclient_get_config(const struct dhclient *);
50 int dhclient_configure_netdev(struct dhclient *);
51 int dhclient_update_resolv_conf(struct dhclient *);
53 void dhclient_run(struct dhclient *);
54 void dhclient_wait(struct dhclient *);
56 #endif /* dhcp-client.h */