cb0da7fa2ca6512a36bc3b0b1534cd5ffc98edd4
[strongswan.git] / src / frontends / android / jni / libandroidbridge / kernel / network_manager.h
1 /*
2 * Copyright (C) 2012 Tobias Brunner
3 * Hochschule fuer Technik Rapperswil
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup network_manager network_manager
18 * @{ @ingroup kernel_android
19 */
20
21 #ifndef NETWORK_MANAGER_H_
22 #define NETWORK_MANAGER_H_
23
24 #include <jni.h>
25
26 #include <library.h>
27 #include <utils/host.h>
28
29 typedef struct network_manager_t network_manager_t;
30
31 /**
32 * NetworkManager, used to retrieve local IP addresses.
33 *
34 * Communicates with NetworkManager via JNI
35 */
36 struct network_manager_t {
37
38 /**
39 * Get a local address
40 *
41 * @param ipv4 TRUE to get an IPv4 address
42 * @return the address or NULL if none available
43 */
44 host_t *(*get_local_address)(network_manager_t *this, bool ipv4);
45
46 /**
47 * Destroy a network_manager_t instance
48 */
49 void (*destroy)(network_manager_t *this);
50 };
51
52 /**
53 * Create a network_manager_t instance
54 *
55 * @return network_manager_t instance
56 */
57 network_manager_t *network_manager_create();
58
59 #endif /** NETWORK_MANAGER_H_ @}*/