doc: Add PrivateNetwork interface.
[platform/upstream/connman.git] / doc / manager-api.txt
1 Manager hierarchy
2 =================
3
4 Service         net.connman
5 Interface       net.connman.Manager
6 Object path     /
7
8 Methods         dict GetProperties()
9
10                         Returns all global system properties. See the
11                         properties section for available properties.
12
13                         Possible Errors: [service].Error.InvalidArguments
14
15                 void SetProperty(string name, variant value)
16
17                         Changes the value of the specified property. Only
18                         properties that are listed as read-write are
19                         changeable. On success a PropertyChanged signal
20                         will be emitted.
21
22                         Possible Errors: [service].Error.InvalidArguments
23                                          [service].Error.InvalidProperty
24
25                 string GetState()
26
27                         Return global connection state of a system. The
28                         same value is return via the State property.
29
30                         Possible Errors: [service].Error.InvalidArguments
31
32                 void RequestScan(string type)
33
34                         Request to trigger a scan for the specified
35                         technology. The empty string "" triggers scanning
36                         on all technologies.
37
38                         Possible Errors: [service].Error.InvalidArguments
39
40                 void EnableTechnology(string type)
41
42                         Enable specified type of technologies.
43
44                         Possible Errors: [service].Error.InvalidArguments
45
46                 void DisableTechnology(string type)
47
48                         Disable specified type of technologies.
49
50                         Possible Errors: [service].Error.InvalidArguments
51
52                 array{object,dict} GetServices()
53
54                         Returns a sorted list of tuples with service
55                         object path and dictionary of service properties.
56
57                         This list will not contain sensitive information
58                         like passphrases etc.
59
60                         Possible Errors: [service].Error.InvalidArguments
61
62                 object LookupService(string pattern)
63
64                         Lookup a service matching the specific pattern.
65
66                         Examples are interface names like "eth0", "wlan0"
67                         etc. or service names like "hotspot" etc.
68
69                         In case of multiple services match the the pattern
70                         an error is returned.
71
72                         Possible Errors: [service].Error.InvalidArguments
73                                          [service].Error.NotUnique
74                                          [service].Error.NotFound
75
76                 object ConnectService(dict network)
77
78                         Connect to a network specified by the given
79                         properties.
80
81                         For connecting to a hidden WiFi network for example
82                         it is required that Type = "wifi" and the SSID
83                         properties are provided.
84
85                         When successful this method will return object
86                         path of the service object.
87
88                         This method can also be used to connect to an
89                         already existing service. It works exactly the
90                         same as executing the Connect method from the
91                         service interface.
92
93                         This method call will only return in case of an
94                         error or when the service is fully connected. So
95                         setting a longer D-Bus timeout might be a really
96                         good idea.
97
98                         Possible Errors: [service].Error.InvalidArguments
99
100                 void ProvisionService(string configuration)
101
102                         Provide a configuration for services.
103
104                         Service configuration is provided as a single string
105                         that follows the same format as configuration files,
106                         see config-format.txt. An exception to this format
107                         is that only one service can be provisioned per call.
108
109                         Possible Errors: [service].Error.InvalidArguments
110
111                 object ConnectProvider(dict provider)
112
113                         Connect to a VPN specified by the given provider
114                         properties.
115
116                         When successful this method will return the object
117                         path of the VPN service object.
118
119                         This method can also be used to connect to an
120                         already existing VPN.
121
122                         This method call will only return in case of an
123                         error or when the service is fully connected. So
124                         setting a longer D-Bus timeout might be a really
125                         good idea.
126
127                         Possible Errors: [service].Error.InvalidArguments
128
129                 void RegisterAgent(object path)
130
131                         Register new agent for handling user requests.
132
133                         Possible Errors: [service].Error.InvalidArguments
134
135                 void UnregisterAgent(object path)
136
137                         Unregister an existing agent.
138
139                         Possible Errors: [service].Error.InvalidArguments
140
141                 void RegisterCounter(object path, uint32 accuracy, uint32 period)
142
143                         Register a new counter for user notifications.
144
145                         The accuracy is specified in kilo-bytes and defines
146                         a threshold for counter updates. Together with the
147                         period value it defines how often user space needs
148                         to be updated. The period value is in seconds.
149
150                         This interface is not meant for time tracking. If
151                         the time needs to be tracked down to the second, it
152                         is better to have a real timer running inside the
153                         application than using this interface.
154
155                         Also getting notified for every kilo-byte is a bad
156                         choice (even if the interface supports it). Something
157                         like 10 kilo-byte units or better 1 mega-byte seems
158                         to be a lot more reasonable and better for the user.
159
160                         Possible Errors: [service].Error.InvalidArguments
161
162                 void UnregisterCounter(object path)
163
164                         Unregister an existing counter.
165
166                         Possible Errors: [service].Error.InvalidArguments
167
168                 object CreateSession(dict settings, object notifier)
169
170                         Create a new session for the application. Every
171                         application can create multiple session with
172                         different settings. The settings are described
173                         as part of the session interface.
174
175                         The notifier allows asynchronous notification about
176                         session specific changes. These changes can be
177                         for online/offline state or IP address changes or
178                         similar things the application is required to
179                         handle.
180
181                         Every application should at least create one session
182                         to inform about its requirements and it purpose.
183
184                 void DestroySession(object session)
185
186                         Remove the previously created session. The notifier
187                         will be informed via its release method.
188
189                         If an application exits unexpectatly the session
190                         will be automatically destroyed.
191
192                 fd, dict {settings} RequestPrivateNetwork(dict options)
193                                                                 [experimental]
194
195                         Request a new Private Network, whick includes the
196                         creation of a tun/tap interface, and IP
197                         configuration, NAT and IP forwarding on that
198                         interface.
199                         A file descritor to the interface is returned together
200                         with the IP, gateway and DNS settings for the
201                         interface.
202
203                         Possible Errors: [service].Error.InvalidArguments
204                                          [service].Error.NotSupported
205
206                 void ReleasePrivateNetwork(fd) [experimental]
207
208                         Releases a private network.
209
210                         Possible Errors: [service].Error.InvalidArguments
211
212 Signals         PropertyChanged(string name, variant value)
213
214                         This signal indicates a changed value of the given
215                         property.
216
217                 StateChanged(string state)
218
219                         This signal is similar to the PropertyChanged signal
220                         for the State property.
221
222                         It exists for application state only care about the
223                         current state and so can avoid to be woken up when
224                         other details changes.
225
226 Properties      string State [readonly]
227
228                         The global connection state of a system. Possible
229                         values are "online" if at least one connection exists
230                         and "offline" if no device is connected.
231
232                         In certain situations the state might change to
233                         the value "connected". This can only be seen if
234                         previously no connection was present.
235
236                 array{string} AvailableTechnologies [readonly]
237
238                         The list of available technologies. The strings
239                         are the same as the ones from the service types.
240
241                 array{string} EnabledTechnologies [readonly]
242
243                         The list of enabled technologies. The strings
244                         are the same as the ones from the service types.
245
246                 array{string} ConnectedTechnologies [readonly]
247
248                         The list of connected technologies. The strings
249                         are the same as the ones from the service type.
250
251                 string DefaultTechnology [readonly]
252
253                         The current connected technology which holds the
254                         default route.
255
256                 boolean OfflineMode [readwrite]
257
258                         The offline mode indicates the global setting for
259                         switching all radios on or off. Changing offline mode
260                         to true results in powering down all devices. When
261                         leaving offline mode the individual policy of each
262                         device decides to switch the radio back on or not.
263
264                         During offline mode, it is still possible to switch
265                         certain technologies manually back on. For example
266                         the limited usage of WiFi or Bluetooth devices might
267                         be allowed in some situations.
268
269                 object ActiveProfile [readwrite]
270
271                         Object path of the current active profile.
272
273                 array{object} Technologies [readonly]
274
275                         List of technology object paths.
276
277                 array{object} Services [readonly]
278
279                         List of service object paths. The list is sorted
280                         internally to have the service with the default
281                         route always first and then the favorite services
282                         followed by scan results.
283
284                         This list represents the available services for the
285                         current selected profile. If the profile gets changed
286                         then this list will be updated.
287
288                         The same list is available via the profile object
289                         itself. It is just provided here for convenience of
290                         applications only dealing with the current active
291                         profile.
292
293                 boolean SessionMode [readwrite]
294
295                         This disables the auto connect feature. It should be
296                         enabled when the Session API is used.
297
298                         The default value is false.