]>
git.proxmox.com Git - mirror_ovs.git/blob - lib/dhcp-client.h
2 * Copyright (c) 2008 Nicira Networks.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
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 */