f817e0a173e89782dc123241741e2640eabebe89
[connman] / include / dhcp.h
1 /*
2  *
3  *  Connection Manager
4  *
5  *  Copyright (C) 2007  Intel Corporation. All rights reserved.
6  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef __CONNMAN_DHCP_H
23 #define __CONNMAN_DHCP_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <connman/iface.h>
30
31 enum connman_dhcp_state {
32         CONNMAN_DHCP_STATE_UNKNOWN = 0,
33         CONNMAN_DHCP_STATE_INIT    = 1,
34         CONNMAN_DHCP_STATE_BOUND   = 2,
35         CONNMAN_DHCP_STATE_RENEW   = 3,
36         CONNMAN_DHCP_STATE_FAILED  = 4,
37 };
38
39 struct connman_dhcp_driver {
40         const char *name;
41         int (*request) (struct connman_iface *iface);
42         int (*release) (struct connman_iface *iface);
43 };
44
45 extern int connman_dhcp_register(struct connman_dhcp_driver *driver);
46 extern void connman_dhcp_unregister(struct connman_dhcp_driver *driver);
47
48 extern int connman_dhcp_update(struct connman_iface *iface,
49                                 enum connman_dhcp_state state,
50                                         struct connman_ipv4 *ipv4);
51
52 #ifdef __cplusplus
53 }
54 #endif
55
56 #endif /* __CONNMAN_DHCP_H */