5 * Copyright (C) 2007-2009 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_NETWORK_H
23 #define __CONNMAN_NETWORK_H
25 #include <connman/types.h>
26 #include <connman/device.h>
34 * @title: Network premitives
35 * @short_description: Functions for handling networks
38 enum connman_network_type {
39 CONNMAN_NETWORK_TYPE_UNKNOWN = 0,
40 CONNMAN_NETWORK_TYPE_WIFI = 1,
41 CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN = 8,
42 CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN = 9,
43 CONNMAN_NETWORK_TYPE_HSO = 23,
44 CONNMAN_NETWORK_TYPE_VENDOR = 10000,
47 enum connman_network_protocol {
48 CONNMAN_NETWORK_PROTOCOL_UNKNOWN = 0,
49 CONNMAN_NETWORK_PROTOCOL_IP = 1,
50 CONNMAN_NETWORK_PROTOCOL_PPP = 2,
53 struct connman_network;
55 extern struct connman_network *connman_network_create(const char *identifier,
56 enum connman_network_type type);
57 extern struct connman_network *connman_network_ref(struct connman_network *network);
58 extern void connman_network_unref(struct connman_network *network);
60 extern const char *connman_network_get_identifier(struct connman_network *network);
62 extern const char *connman_network_get_path(struct connman_network *network);
63 extern void connman_network_set_index(struct connman_network *network,
65 extern int connman_network_get_index(struct connman_network *network);
67 extern void connman_network_set_protocol(struct connman_network *network,
68 enum connman_network_protocol protocol);
70 extern int connman_network_set_available(struct connman_network *network,
71 connman_bool_t available);
72 extern int connman_network_set_connected(struct connman_network *network,
73 connman_bool_t connected);
74 extern connman_bool_t connman_network_get_remember(struct connman_network *network);
76 extern int connman_network_connect(struct connman_network *network);
78 extern int connman_network_set_string(struct connman_network *network,
79 const char *key, const char *value);
80 extern const char *connman_network_get_string(struct connman_network *network,
82 extern int connman_network_set_uint8(struct connman_network *network,
83 const char *key, connman_uint8_t value);
84 extern int connman_network_set_blob(struct connman_network *network,
85 const char *key, const void *data, unsigned int size);
86 extern const void *connman_network_get_blob(struct connman_network *network,
87 const char *key, unsigned int *size);
89 extern struct connman_device *connman_network_get_device(struct connman_network *network);
91 extern void *connman_network_get_data(struct connman_network *network);
92 extern void connman_network_set_data(struct connman_network *network, void *data);
94 struct connman_network_driver {
96 enum connman_network_type type;
98 int (*probe) (struct connman_network *network);
99 void (*remove) (struct connman_network *network);
100 int (*connect) (struct connman_network *network);
101 int (*disconnect) (struct connman_network *network);
104 extern int connman_network_driver_register(struct connman_network_driver *driver);
105 extern void connman_network_driver_unregister(struct connman_network_driver *driver);
111 #endif /* __CONNMAN_NETWORK_H */