5 * Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef __CONNMAN_DHCP_H
23 #define __CONNMAN_DHCP_H
31 * @title: DHCP premitives
32 * @short_description: Functions for handling DHCP
35 enum connman_dhcp_state {
36 CONNMAN_DHCP_STATE_UNKNOWN = 0,
37 CONNMAN_DHCP_STATE_IDLE = 1,
38 CONNMAN_DHCP_STATE_BOUND = 2,
39 CONNMAN_DHCP_STATE_RENEW = 3,
40 CONNMAN_DHCP_STATE_FAIL = 4,
43 #define CONNMAN_DHCP_PRIORITY_LOW -100
44 #define CONNMAN_DHCP_PRIORITY_DEFAULT 0
45 #define CONNMAN_DHCP_PRIORITY_HIGH 100
49 struct connman_dhcp *connman_dhcp_ref(struct connman_dhcp *dhcp);
50 void connman_dhcp_unref(struct connman_dhcp *dhcp);
52 int connman_dhcp_get_index(struct connman_dhcp *dhcp);
53 char *connman_dhcp_get_interface(struct connman_dhcp *dhcp);
55 void connman_dhcp_set_value(struct connman_dhcp *dhcp,
56 const char *key, const char *value);
58 void connman_dhcp_bound(struct connman_dhcp *dhcp);
59 void connman_dhcp_renew(struct connman_dhcp *dhcp);
60 void connman_dhcp_fail(struct connman_dhcp *dhcp);
62 void *connman_dhcp_get_data(struct connman_dhcp *dhcp);
63 void connman_dhcp_set_data(struct connman_dhcp *dhcp, void *data);
65 struct connman_dhcp_driver {
68 int (*request) (struct connman_dhcp *dhcp);
69 int (*release) (struct connman_dhcp *dhcp);
70 int (*renew) (struct connman_dhcp *dhcp);
73 int connman_dhcp_driver_register(struct connman_dhcp_driver *driver);
74 void connman_dhcp_driver_unregister(struct connman_dhcp_driver *driver);
80 #endif /* __CONNMAN_DHCP_H */