1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
/*
*
* Connection Manager
*
* Copyright (C) 2007-2010 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef __CONNMAN_NETWORK_H
#define __CONNMAN_NETWORK_H
#include <connman/types.h>
#include <connman/device.h>
#include <connman/ipconfig.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* SECTION:network
* @title: Network premitives
* @short_description: Functions for handling networks
*/
enum connman_network_type {
CONNMAN_NETWORK_TYPE_UNKNOWN = 0,
CONNMAN_NETWORK_TYPE_ETHERNET = 1,
CONNMAN_NETWORK_TYPE_WIFI = 2,
CONNMAN_NETWORK_TYPE_WIMAX = 3,
CONNMAN_NETWORK_TYPE_BLUETOOTH_PAN = 8,
CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN = 9,
CONNMAN_NETWORK_TYPE_CELLULAR = 10,
CONNMAN_NETWORK_TYPE_VENDOR = 10000,
};
enum connman_network_protocol {
CONNMAN_NETWORK_PROTOCOL_UNKNOWN = 0,
CONNMAN_NETWORK_PROTOCOL_IP = 1,
};
enum connman_network_error {
CONNMAN_NETWORK_ERROR_UNKNOWN = 0,
CONNMAN_NETWORK_ERROR_ASSOCIATE_FAIL = 1,
CONNMAN_NETWORK_ERROR_CONFIGURE_FAIL = 2,
};
struct connman_network;
struct connman_network *connman_network_create(const char *identifier,
enum connman_network_type type);
struct connman_network *connman_network_ref(struct connman_network *network);
void connman_network_unref(struct connman_network *network);
enum connman_network_type connman_network_get_type(struct connman_network *network);
const char *connman_network_get_identifier(struct connman_network *network);
const char *connman_network_get_path(struct connman_network *network);
struct connman_element *connman_network_get_element(
struct connman_network *network);
void connman_network_set_index(struct connman_network *network, int index);
int connman_network_get_index(struct connman_network *network);
void connman_network_set_protocol(struct connman_network *network,
enum connman_network_protocol protocol);
void connman_network_set_group(struct connman_network *network,
const char *group);
const char *connman_network_get_group(struct connman_network *network);
int connman_network_set_available(struct connman_network *network,
connman_bool_t available);
connman_bool_t connman_network_get_available(struct connman_network *network);
int connman_network_set_associating(struct connman_network *network,
connman_bool_t associating);
void connman_network_set_error(struct connman_network *network,
enum connman_network_error error);
int connman_network_set_connected(struct connman_network *network,
connman_bool_t connected);
connman_bool_t connman_network_get_connected(struct connman_network *network);
connman_bool_t connman_network_get_associating(struct connman_network *network);
void connman_network_set_method(struct connman_network *network,
enum connman_ipconfig_method method);
int connman_network_set_address(struct connman_network *network,
const void *address, unsigned int size);
int connman_network_set_name(struct connman_network *network,
const char *name);
int connman_network_set_strength(struct connman_network *network,
connman_uint8_t strength);
int connman_network_set_roaming(struct connman_network *network,
connman_bool_t roaming);
int connman_network_set_string(struct connman_network *network,
const char *key, const char *value);
const char *connman_network_get_string(struct connman_network *network,
const char *key);
int connman_network_set_bool(struct connman_network *network,
const char *key, connman_bool_t value);
connman_bool_t connman_network_get_bool(struct connman_network *network,
const char *key);
int connman_network_set_uint8(struct connman_network *network,
const char *key, connman_uint8_t value);
connman_uint8_t connman_network_get_uint8(struct connman_network *network,
const char *key);
int connman_network_set_uint16(struct connman_network *network,
const char *key, connman_uint16_t value);
connman_uint16_t connman_network_get_uint16(struct connman_network *network,
const char *key);
int connman_network_set_blob(struct connman_network *network,
const char *key, const void *data, unsigned int size);
const void *connman_network_get_blob(struct connman_network *network,
const char *key, unsigned int *size);
struct connman_device *connman_network_get_device(struct connman_network *network);
void *connman_network_get_data(struct connman_network *network);
void connman_network_set_data(struct connman_network *network, void *data);
struct connman_network_driver {
const char *name;
enum connman_network_type type;
int priority;
int (*probe) (struct connman_network *network);
void (*remove) (struct connman_network *network);
int (*connect) (struct connman_network *network);
int (*disconnect) (struct connman_network *network);
int (*setup) (struct connman_network *network, const char *key);
};
int connman_network_driver_register(struct connman_network_driver *driver);
void connman_network_driver_unregister(struct connman_network_driver *driver);
#ifdef __cplusplus
}
#endif
#endif /* __CONNMAN_NETWORK_H */
|