summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/efl_net_control_access_point.eo
blob: 948325cab9f58f3f0c1c50780f23975c2e5ae019 (plain)
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
enum Efl.Net.Control.Access_Point.State {
    [[Provides the access point state.

      @since 1.19
    ]]
    idle, [[Nothing is happening with this access point]]
    association, [[The access point is trying to associate itself. This is the first state after a connection attempt.]]
    configuration, [[The access point is configuring itself, such as DHCP.]]
    local, [[The access point is connected but the internet connection hasn't been validated.]]
    online, [[The access point is connected and the internet connection has been validated.]]
    disconnect, [[The access point is disconnecting.]]
    failure, [[The connection attempt failed, @Efl.Net.Control.Access_Point.error will provide more details]]
}

enum Efl.Net.Control.Access_Point.Error {
    [[The reason for the connection error.

      @since 1.19
    ]]
    none, [[All OK, no errors]]
    out_of_range, [[Wireless device is out of range.]]
    pin_missing, [[PIN was required and is missing.]]
    dhcp_failed, [[DHCP failed to provide configuration.]]
    connect_failed, [[Could not connect to access point.]]
    login_failed, [[Login or authentication information was incorrect, agent_request_input event may be emitted.]]
}

enum Efl.Net.Control.Access_Point.Security {
    [[Bitwise-able securities supported by an access point.

      @since 1.19
    ]]
    unknow = 0, [[Unknown]]
    none = (1 << 0), [[Open access, no security]]
    wep = (1 << 1), [[WEP]]
    psk = (1 << 2), [[PSK (Pre Shared Key), such as WPA or RSN]]
    ieee802_1x = (1 << 3), [[IEEE 802.1X]]
}

enum Efl.Net.Control.Access_Point.Ipv4_Method {
    [[The method used to configure IPv4

      @since 1.19
    ]]
    off, [[IPv4 is disabled.]]
    dhcp, [[IPv4 is configured using DHCP.]]
    manual, [[IPv4 is manually set using address, netmask and gateway]]
    unset, [[Only to be used with @Efl.Net.Control.Access_Point.configuration_ipv4]]
}

enum Efl.Net.Control.Access_Point.Ipv6_Method {
    [[The method used to configure IPv6

      @since 1.19
    ]]
    off, [[IPv6 is disabled.]]
    fixed, [[IPv6 is fixed by operator and cannot be changed.]]
    manual, [[IPv6 is manually set using address, netmask and gateway.]]
    auto_privacy_none, [[IPv6 is set using dhcp or using a tunnel6to4. No privacy extensions should be used.]]
    auto_privacy_public, [[IPv6 is set using dhcp or using a tunnel6to4, privacy extensions are used and the system prefers a public IP address over temporary addresses.]]
    auto_privacy_temporary, [[IPv6 is set using dhcp or using a tunnel6to4, privacy extensions are used and the system prefers a temporary IP address over public addresses.]]
    tunnel6to4, [[IPv6 was configured using a 6-to-4 tunnel. This cannot be set by the user, which is set to "auto" instead]]
    unset, [[Only to be used with @Efl.Net.Control.Access_Point.configuration_ipv6]]
}

enum Efl.Net.Control.Access_Point.Proxy_Method {
    [[The method used to configure Proxies.

      @since 1.19
    ]]
    off, [[Direct connection to the internet, no proxy used.]]
    auto, [[Proxy is autoconfigured using Proxy-Auto-Configuration (PAC) using given URL.]]
    manual, [[Proxy is configured manually using servers and excludes.]]
    unset, [[Only to be used with @Efl.Net.Control.Access_Point.configuration_proxy.]]
}

class Efl.Net.Control.Access_Point (Efl.Loop.Consumer) {
    [[An access point for network connectivity.

      The @Efl.Net.Control is composed of multiple technologies, each
      create access points to allow configuration and connection.

      An application requiring only a network connection can just
      use a \@Efl.Net.Session instead.

      @since 1.19
    ]]

    events {
        changed; [[Called when some properties were changed.]]
    }

    methods {
        connect {
            [[Connects to this access point.

              This connection will happen asynchronously in the
              background, with results being delivered by events in
              the access point object, such as the "changed".

              Successful connections will remember the device and set
              it to auto-connect using the property @.auto_connect.

              See @.forget, @.remembered, @.auto_connect and
              @.disconnect

              The future may fail with non-fatal errors such as
              EINPROGRESS (the connection was already ongoing) and
              EALREADY (the connection was already established).
            ]]
            return: ptr(Eina.Future) @owned; [[Future for asynchronous connect]] /* NOTE: This should be future<void> */
        }

        disconnect {
            [[Disconnects from this access point.

              When disconnected previously connected access points
              won't be forgotten. The configuration and other details
              such as priority and passphrase will be available for
              future re-connection with a call to @.connect. If you
              need to disconnect and forget all access point
              information, use @.forget instead.
            ]]
        }

        forget {
            [[Disconnects and forgets about this access point.

              Successful @.connect will always remember the access
              point for future re-connections. This method overrides
              this by disconnecting and forgetting the access
              point and its configuration, which will set
              @.remembered to $false.
            ]]
        }

        @property state {
            [[The current state of the access point.

              Whenever the state changes, "changed" will be emitted.
            ]]
            get { }
            values {
                state: Efl.Net.Control.Access_Point.State; [[Access point state]]
            }
        }

        @property error {
            [[If the access point is in error state, this states the error.]]
            get { }
            values {
                error: Efl.Net.Control.Access_Point.Error; [[Access point error]]
            }
        }

        @property name {
            [[The user-friendly access point name.

              For hidden WiFi networks, this is empty.
            ]]
            get { }
            values {
                name: string; [[Access point name]]
            }
        }

        @property priority {
            [[The access point priority in the current access point listing.

              This property is dynamic and reflects the index of the
              access point in the current access points list. As
              access points may come and go, the value may change at
              any time and send notifications via the "changed" event.

              If set, then it will reorder priorities, moving all other
              services at equal or higher priority up. To move as the
              first (most priority), then use 0. To move as the last
              priority, use UINT32_MAX or the last known priority + 1.

              \@note Only stored access points may be reordered
              among themselves. Those that are not remembered will
              always come last in a random order defined by the backend.
            ]]
            get { }
            set { }
            values {
                priority: uint; [[Access point priority in listing]]
            }
        }

        @property technology {
            [[The technology that generated this access point]]
            get { }
            values {
                technology: Efl.Net.Control.Technology; [[Access point technology]]
            }
        }

        @property strength {
            [[Signal strength percentage in 0-100]]
            get { }
            values {
                strength: uint8; [[Access point signal strength]]
            }
        }

        @property roaming {
            [[If it's a cellular access point and it's on roaming.]]
            get { }
            values {
                roaming: bool; [[$true if the access point is cellular and uses roaming, $false otherwise]]
            }
        }

        @property auto_connect {
            [[Whenever to auto-connect to this access point if no other is connected.

              By default successfully connected access points are
              remembered and set to auto-connect. This behavior can be
              changed with this property.

              An access point is only connected automatically if there
              are no other connected and if it is not on roaming.
            ]]
            get { }
            set { }
            values {
                auto_connect: bool; [[$true when auto-connect is set for this access point, $false otherwise]]
            }
        }

        @property remembered {
            [[Successfully connected access points are remembered.

              To forget about this access point, call @.forget.
            ]]
            get { }
            values {
                remembered: bool; [[$true if this access point will be remembered, $false otherwise]]
            }
        }

        @property immutable {
            [[Immutable access points are those defined in configuration files and its properties can't be changed using API.]]
            get { }
            values {
                immutable: bool; [[$true is this access point is immutable, $false otherwise]]
            }
        }

        @property security {
            [[Security options such as WEP, WPS, PSK or none (open).]]
            get { }
            values {
                security: Efl.Net.Control.Access_Point.Security; [[Bitwise OR of security supported by this access point]]
            }
        }

        @property name_servers {
            [[DNS (Domain Name Servers) in use for this access point.

              These are the actual values used. Configure them using
              @.configuration_name_servers. This may generate changes
              to this property, triggering the "changed"
              event.
            ]]
            get { }
            values {
                name_servers: iterator<string> @owned; [[Iterator to DNS server]]
            }
        }

        @property time_servers {
            [[NTP (Time Server) in use for this access point.

           These are the actual values used. Configure them using
              @.configuration_name_servers. This may generate changes
              to this property, triggering the "changed"
              event.
            ]]
            get { }
            values {
                time_servers: iterator<string> @owned; [[Iterator to time server]]
            }
        }

        @property domains {
            [[Searches domains in use for this access point.

        These are the actual values used. Configure them using
              @.configuration_name_servers. This may generate changes
              to this property, triggering the "changed"
              event.
            ]]
            get { }
            values {
                domains: iterator<string> @owned; [[Iterator to search domains]]
            }
        }

        @property ipv4 {
            [[IPv4 in use for this access point.

             These are the actual values used. Configure them using
              @.configuration_name_servers. This may generate changes
              to this property, triggering the "changed"
              event.
            ]]
            get { }
            values {
                method: Efl.Net.Control.Access_Point.Ipv4_Method; [[IPv4 method]]
                address: string; [[IPv4 address]]
                netmask: string; [[IPv4 netmask]]
                gateway: string; [[IPv4 gateway]]
            }
        }

        @property ipv6 {
            [[IPv6 in use for this access point.

              These are the actual values used. Configure them using
              @.configuration_name_servers. This may generate changes
              to this property, triggering the "changed"
              event.
            ]]
            get { }
            values {
                method: Efl.Net.Control.Access_Point.Ipv6_Method; [[IPv6 method]]
                address: string; [[IPv6 address]]
                prefix_length: uint8; [[IPv6 prefix length]]
                netmask: string; [[IPv6 netmask]]
                gateway: string; [[IPv6 gateway]]
            }
        }

        @property proxy {
            [[Proxy in use for this access point.

             These are the actual values used. Configure them using
              @.configuration_name_servers. This may generate changes
              to this property, triggering the "changed"
              event.
            ]]
            get { }
            values {
                method: Efl.Net.Control.Access_Point.Proxy_Method; [[Proxy method]]
                url: string; [[If @Efl.Net.Control.Access_Point.Proxy_Method.auto, then states the URL to use for proxy auto-configuration]]
                servers: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]]
                excludes: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]]
            }
        }

        @property configuration_name_servers {
            [[DNS (Domain Name Servers) configured by user for this access point.

              These are user configured values, which will be
              applied by the backend system and in turn may result in
              "changed" event to notify of @.name_servers property
              with the actual value in use, which may differ from
              this.
            ]]
            set { }
            get { }
            values {
                name_servers: iterator<string> @owned; [[Iterator to user DNS server]]
            }
        }

        @property configuration_time_servers {
            [[NTP (Time Server) configured by user for this access point.

              These are user configured values, which will be
              applied by the backend system and in turn may result in
              "changed" event to notify of @.name_servers property
              with the actual value in use, which may differ from
              this.
            ]]
            set { }
            get { }
            values {
                time_servers: iterator<string> @owned; [[Iterator to user time server]]
            }
        }

        @property configuration_domains {
            [[Searches domains configured by user for this access point.

              These are user configured values, which will be
              applied by the backend system and in turn may result in
              "changed" event to notify of @.domains property
              with the actual value in use, which may differ from
              this.
            ]]
            set { }
            get { }
            values {
                domains: iterator<string> @owned; [[Iterator to user search domains]]
            }
        }

        @property configuration_ipv4 {
            [[IPv4 configured by user for this access point.

              These are user configured values, which will be
              applied by the backend system and in turn may result in
              "changed" event to notify of @.ipv4 property
              with the actual value in use, which may differ from
              this.
            ]]
            set { }
            get { }
            values {
                method: Efl.Net.Control.Access_Point.Ipv4_Method; [[IPv4 method]]
                address: string; [[IPv4 address]]
                netmask: string; [[IPv4 netmask]]
                gateway: string; [[IPv4 gateway]]
            }
        }

        @property configuration_ipv6 {
            [[IPv6 configured by user for this access point.

              These are user configured values, which will be
              applied by the backend system and in turn may result in
              "changed" event to notify of @.ipv6 property
              with the actual value in use, which may differ from
              this.
            ]]
            set { }
            get { }
            values {
                method: Efl.Net.Control.Access_Point.Ipv6_Method; [[IPv6 method]]
                address: string; [[IPv6 address]]
                prefix_length: uint8; [[IPv6 prefix length]]
                netmask: string; [[IPv6 netmask]]
                gateway: string; [[IPv6 gateway]]
            }
        }

        @property configuration_proxy {
            [[Proxy configured by user for this access point.

              These are user configured values, which will be
              applied by the backend system and in turn may result in
              "changed" event to notify of @.proxy property
              with the actual value in use, which may differ from
              this.
            ]]
            set { }
            get { }
            values {
                method: Efl.Net.Control.Access_Point.Proxy_Method; [[Proxy method]]
                url: string; [[If @Efl.Net.Control.Access_Point.Proxy_Method.auto, then states the URL to use for proxy auto-configuration]]
                servers: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the URI with proxy servers to use, like "http://proxy.domain.com:911"]]
                excludes: iterator<string> @owned; [[If @Efl.Net.Control.Access_Point.Proxy_Method.manual, then states the hosts or patterns to exclude from proxy access, such as "localhost", ".domain.com", or "10.0.0.0..."]]
            }
        }
    }

    implements {
        Efl.Object.destructor;
    }
}