e_dbus/connman: Add getter/setter for LoginRequired
[framework/uifw/edbus.git] / src / lib / connman / e_connman_service.c
1 #include "e_connman_private.h"
2
3 E_Connman_Element *
4 e_connman_service_get(const char *path)
5 {
6    E_Connman_Element *service;
7
8    EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
9
10    service = e_connman_element_get(path);
11    if (!service)
12       return NULL;
13
14    if (!e_connman_element_is_service(service))
15      {
16         WRN("path '%s' is not a service!", path);
17         return NULL;
18      }
19
20    return service;
21 }
22
23 /**
24  * Connect this service.
25  *
26  * Connect this service. It will attempt to connect
27  * WiFi, WiMAX or Bluetooth services.
28  *
29  * For Ethernet devices this method can only be used
30  * if it has previously been disconnected. Otherwise
31  * the plugging of a cable will trigger connecting
32  * automatically. If no cable is plugged in this method
33  * will fail.
34  *
35  * @param service path to call method on server.
36  * @param cb function to call when server replies or some error happens.
37  * @param data data to give to cb when it is called.
38  *
39  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
40  */
41 Eina_Bool
42 e_connman_service_connect(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
43 {
44    const char name[] = "Connect";
45
46    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
47    return e_connman_element_call_full
48              (service, name, NULL, &service->_pending.service_connect, cb, data);
49 }
50
51 /**
52  * Disconnect this service.
53  *
54  * Disconnect this service. If the service is not
55  * connected an error message will be generated.
56  *
57  * On Ethernet devices this will disconnect the IP
58  * details from the service. It will not magically
59  * unplug the cable. When no cable is plugged in this
60  * method will fail.
61  *
62  * This method can also be used to abort a previous
63  * connectiong attempt via the Connect method.
64  *
65  * @param service path to call method on server.
66  * @param cb function to call when server replies or some error happens.
67  * @param data data to give to cb when it is called.
68  *
69  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
70  */
71 Eina_Bool
72 e_connman_service_disconnect(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
73 {
74    const char name[] = "Disconnect";
75
76    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
77    return e_connman_element_call_full
78              (service, name, NULL, &service->_pending.service_disconnect, cb, data);
79 }
80
81 /**
82  * Remove this service.
83  *
84  * A successfully connected service with Favorite=true
85  * can be removed this way. If it is connected, it will
86  * be automatically disconnected first.
87  *
88  * If the service requires a passphrase it will be
89  * cleared and forgotten when removing.
90  *
91  * This is similar to setting the Favorite property
92  * to false, but that is currently not supported.
93  *
94  * In the case a connection attempt failed and the
95  * service is in the State=failure, this method can
96  * also be used to reset the service.
97  *
98  * Calling this method on Ethernet devices will cause
99  * an error message. It is not possible to remove these
100  * kind of devices.
101  *
102  * @param service path to call method on server.
103  * @param cb function to call when server replies or some error happens.
104  * @param data data to give to cb when it is called.
105  *
106  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
107  */
108 Eina_Bool
109 e_connman_service_remove(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
110 {
111    const char name[] = "Remove";
112
113    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
114    return e_connman_element_call_full
115              (service, name, NULL, &service->_pending.service_remove, cb, data);
116 }
117
118 /**
119  * Clears the value of the specified property.
120  *
121  *
122  * @param service path to call method on server.
123  * @param property to be cleared.
124  * @param cb function to call when server replies or some error happens.
125  * @param data data to give to cb when it is called.
126  *
127  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
128  */
129 Eina_Bool
130 e_connman_service_clear_property(E_Connman_Element *service, const char *property, E_DBus_Method_Return_Cb cb, const void *data)
131 {
132    const char name[] = "ClearProperty";
133
134    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
135    EINA_SAFETY_ON_NULL_RETURN_VAL(property, EINA_FALSE);
136    return e_connman_element_call_with_string
137              (service, name, property, NULL, &service->_pending.service_clear_property,
138              cb, data);
139 }
140
141 /**
142  * Move service before in favorites list.
143  *
144  * Call method MoveBefore(object service) at the given service on server.
145  *
146  * If a service has been used before, this allows a
147  * reorder of the favorite services.
148  *
149  * The target service object must be part of this
150  * profile. Moving between profiles is not supported.
151  *
152  * @param service path to call method on server.
153  * @param object_path object service.
154  * @param cb function to call when server replies or some error happens.
155  * @param data data to give to cb when it is called.
156  *
157  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
158  */
159 Eina_Bool
160 e_connman_service_move_before(E_Connman_Element *service, const char *object_path, E_DBus_Method_Return_Cb cb, const void *data)
161 {
162    const char name[] = "MoveBefore";
163
164    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
165    EINA_SAFETY_ON_NULL_RETURN_VAL(object_path, EINA_FALSE);
166    return e_connman_element_call_with_path
167              (service, name, object_path, NULL,
168              &service->_pending.service_move_before, cb, data);
169 }
170
171 /**
172  * Move service after in favorites list.
173  *
174  * Call method MoveAfter(object service) at the given service on server.
175  *
176  * If a service has been used before, this allows a
177  * reorder of the favorite services.
178  *
179  * The target service object must be part of this
180  * profile. Moving between profiles is not supported.
181  *
182  * @param service path to call method on server.
183  * @param cb function to call when server replies or some error happens.
184  * @param data data to give to cb when it is called.
185  *
186  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
187  */
188 Eina_Bool
189 e_connman_service_move_after(E_Connman_Element *service, const char *object_path, E_DBus_Method_Return_Cb cb, const void *data)
190 {
191    const char name[] = "MoveAfter";
192
193    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
194    EINA_SAFETY_ON_NULL_RETURN_VAL(object_path, EINA_FALSE);
195    return e_connman_element_call_with_path
196              (service, name, object_path, NULL,
197              &service->_pending.service_move_after, cb, data);
198 }
199
200 /**
201  * Get property "State" value.
202  *
203  * If this property isn't found then @c EINA_FALSE is returned.
204  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
205  * values shall be considered invalid.
206  *
207  * The service state information.
208  *
209  * Valid states are "idle", "failure", "association",
210  * "configuration", "ready", "login" and "online".
211  *
212  * @param service path to get property.
213  * @param state where to store the property value, must be a pointer
214  *        to string (const char **), it will not be allocated or
215  *        copied and references will be valid until element changes,
216  *        so copy it if you want to use it later.
217  *
218  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
219  */
220 Eina_Bool
221 e_connman_service_state_get(const E_Connman_Element *service, const char **state)
222 {
223    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
224    EINA_SAFETY_ON_NULL_RETURN_VAL(state, EINA_FALSE);
225    return e_connman_element_property_get_stringshared
226              (service, e_connman_prop_state, NULL, state);
227 }
228
229 /**
230  * Get property "Error" value.
231  *
232  * If this property isn't found then @c EINA_FALSE is returned.
233  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
234  * values shall be considered invalid.
235  *
236  * The service error status details.
237  *
238  * When error occur during connection or disconnection
239  * the detailed information are represented in this
240  * property to help the user interface to present the
241  * user with alternate options.
242  *
243  * This property is only valid when the service is in
244  * the "failure" state. Otherwise it might be empty or
245  * not present at all.
246  *
247  * Current defined error code is "dhcp-failed".
248  *
249  * @param service path to get property.
250  * @param error where to store the property value, must be a pointer
251  *        to string (const char **), it will not be allocated or
252  *        copied and references will be valid until element changes,
253  *        so copy it if you want to use it later.
254  *
255  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
256  */
257 Eina_Bool
258 e_connman_service_error_get(const E_Connman_Element *service, const char **error)
259 {
260    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
261    EINA_SAFETY_ON_NULL_RETURN_VAL(error, EINA_FALSE);
262    return e_connman_element_property_get_stringshared
263              (service, e_connman_prop_error, NULL, error);
264 }
265
266 /**
267  * Get property "Name" value.
268  *
269  * If this property isn't found then @c EINA_FALSE is returned.
270  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
271  * values shall be considered invalid.
272  *
273  * The service name (for example "Wireless" etc.)
274  *
275  * This name can be used for directly displaying it in
276  * the application. It has pure informational purpose.
277  *
278  * For Ethernet devices and hidden WiFi networks it is
279  * not guaranteed that this property is present.
280  *
281  * @param service path to get property.
282  * @param name where to store the property value, must be a pointer
283  *        to string (const char **), it will not be allocated or
284  *        copied and references will be valid until element changes,
285  *        so copy it if you want to use it later.
286  *
287  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
288  */
289 Eina_Bool
290 e_connman_service_name_get(const E_Connman_Element *service, const char **name)
291 {
292    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
293    EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE);
294    return e_connman_element_property_get_stringshared
295              (service, e_connman_prop_name, NULL, name);
296 }
297
298 /**
299  * Get property "Type" value.
300  *
301  * If this property isn't found then @c EINA_FALSE is returned.
302  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
303  * values shall be considered invalid.
304  *
305  * The service type (for example "ethernet", "wifi" etc.)
306  *
307  * This information should only be used to determine
308  * advanced properties or showing the correct icon
309  * to the user.
310  *
311  * @param service path to get property.
312  * @param type where to store the property value, must be a pointer
313  *        to string (const char **), it will not be allocated or
314  *        copied and references will be valid until element changes,
315  *        so copy it if you want to use it later.
316  *
317  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
318  */
319 Eina_Bool
320 e_connman_service_type_get(const E_Connman_Element *service, const char **type)
321 {
322    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
323    EINA_SAFETY_ON_NULL_RETURN_VAL(type, EINA_FALSE);
324    return e_connman_element_property_get_stringshared
325              (service, e_connman_prop_type, NULL, type);
326 }
327
328 /**
329  * Get property "Mode" value.
330  *
331  * If this property isn't found then @c EINA_FALSE is returned.
332  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
333  * values shall be considered invalid.
334  *
335  * If the service type is WiFi or Cellular, then this
336  * property is present and contains the mode of the
337  * network.
338  *
339  * For WiFi services the possible values are "managed"
340  * and "adhoc". For Cellular services it describes the
341  * network technology. Possible values are "gprs", "edge"
342  * and "umts".
343  *
344  * This property might be only present for WiFi and
345  * Cellular services.
346  *
347  * @param service path to get property.
348  * @param mode where to store the property value, must be a pointer
349  *        to string (const char **), it will not be allocated or
350  *        copied and references will be valid until element changes,
351  *        so copy it if you want to use it later.
352  *
353  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
354  */
355 Eina_Bool
356 e_connman_service_mode_get(const E_Connman_Element *service, const char **mode)
357 {
358    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
359    EINA_SAFETY_ON_NULL_RETURN_VAL(mode, EINA_FALSE);
360    return e_connman_element_property_get_stringshared
361              (service, e_connman_prop_mode, NULL, mode);
362 }
363
364 /**
365  * Get property "Security" value.
366  *
367  * If this property isn't found then @c EINA_FALSE is returned.
368  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
369  * values shall be considered invalid.
370  *
371  * If the service type is WiFi, then this property is
372  * present and contains the list of security method or key
373  * management setting.
374  *
375  * Possible values are "none", "wep", "wpa", "rsn", "psk", "ieee8021x" and "wps"
376  *
377  * This property might be only present for WiFi
378  * services.
379  *
380  * @param service path to get property.
381  * @param security where to store the property value, must be a pointer
382  *        to E_Connman_Array, it will not be allocated or
383  *        copied and references will be valid until element changes,
384  *        so copy it if you want to use it later.
385  *
386  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
387  */
388 Eina_Bool
389 e_connman_service_security_get(const E_Connman_Element *service, const E_Connman_Array **security)
390 {
391    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
392    EINA_SAFETY_ON_NULL_RETURN_VAL(security, EINA_FALSE);
393    return e_connman_element_property_get_stringshared
394              (service, e_connman_prop_security, NULL, security);
395 }
396
397 /**
398  * Get property "Passphrase" value.
399  *
400  * If this property isn't found then @c EINA_FALSE is returned.
401  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
402  * values shall be considered invalid.
403  *
404  * If the service type is WiFi, then this property
405  * can be used to store a passphrase.
406  *
407  * No PropertyChanged signals will be send for this
408  * property. The PassphraseRequired property should
409  * be monitored instead.
410  *
411  * This property might also not always be included
412  * since it is protected by a different security policy.
413  *
414  * @param service path to get property.
415  * @param passphrase where to store the property value, must be a pointer
416  *        to string (const char **), it will not be allocated or
417  *        copied and references will be valid until element changes,
418  *        so copy it if you want to use it later.
419  *
420  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
421  * @see e_connman_service_passphrase_set()
422  */
423 Eina_Bool
424 e_connman_service_passphrase_get(const E_Connman_Element *service, const char **passphrase)
425 {
426    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
427    EINA_SAFETY_ON_NULL_RETURN_VAL(passphrase, EINA_FALSE);
428    return e_connman_element_property_get_stringshared
429              (service, e_connman_prop_passphrase, NULL, passphrase);
430 }
431
432 /**
433  * Set property "Passphrase" value.
434  *
435  * If this property isn't found then @c EINA_FALSE is returned.
436  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
437  * values shall be considered invalid.
438  *
439  * If the service type is WiFi, then this property
440  * can be used to store a passphrase.
441  *
442  * No PropertyChanged signals will be send for this
443  * property. The PassphraseRequired property should
444  * be monitored instead.
445  *
446  * This property might also not always be included
447  * since it is protected by a different security policy.
448  *
449  * @param service path to get property.
450  * @param passphrase value to set.
451  * @param cb function to call when server replies or some error happens.
452  * @param data data to give to cb when it is called.
453  *
454  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
455  * @see e_connman_service_passphrase_get()
456  */
457 Eina_Bool
458 e_connman_service_passphrase_set(E_Connman_Element *service, const char *passphrase, E_DBus_Method_Return_Cb cb, const void *data)
459 {
460    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
461    return e_connman_element_property_set_full
462              (service, e_connman_prop_passphrase, DBUS_TYPE_STRING,
463              passphrase, cb, data);
464 }
465
466 /**
467  * Get property "PassphraseRequired" value.
468  *
469  * If this property isn't found then @c EINA_FALSE is returned.
470  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
471  * values shall be considered invalid.
472  *
473  * If the service type is WiFi, then this property
474  * indicates if a passphrase is required.
475  *
476  * If a passphrase has been set already or if no
477  * passphrase is needed, then this property will
478  * be set to false.
479  *
480  * @param service path to get property.
481  * @param passphrase_required where to store the property value, must be a
482  *        pointer to Eina_Bool (Eina_Bool *).
483  *
484  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
485  */
486 Eina_Bool
487 e_connman_service_passphrase_required_get(const E_Connman_Element *service, Eina_Bool *passphrase_required)
488 {
489    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
490    EINA_SAFETY_ON_NULL_RETURN_VAL(passphrase_required, EINA_FALSE);
491    return e_connman_element_property_get_stringshared
492              (service, e_connman_prop_passphrase_required, NULL, passphrase_required);
493 }
494
495 /**
496  * Get property "LoginRequired" value.
497  *
498  * If this property isn't found then @c EINA_FALSE is returned.
499  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
500  * values shall be considered invalid.
501  *
502  * Indicates that a manual configuration must be done to login the
503  * user, likely access an website using a browser.
504  *
505  * If a login has been set already or if no
506  * login is needed, then this property will
507  * be set to false.
508  *
509  * @param service path to get property.
510  * @param login_required where to store the property value, must be a
511  *        pointer to Eina_Bool (Eina_Bool *).
512  *
513  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
514  *
515  * @since 1.1.0
516  */
517 Eina_Bool
518 e_connman_service_login_required_get(const E_Connman_Element *service, Eina_Bool *login_required)
519 {
520    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
521    EINA_SAFETY_ON_NULL_RETURN_VAL(login_required, EINA_FALSE);
522    return e_connman_element_property_get_stringshared
523              (service, e_connman_prop_login_required, NULL, login_required);
524 }
525
526 /**
527  * Get property "Strength" value.
528  *
529  * If this property isn't found then @c EINA_FALSE is returned.
530  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
531  * values shall be considered invalid.
532  *
533  * Indicates the signal strength of the service. This
534  * is a normalized value between 0 and 100.
535  *
536  * This property will not be present for Ethernet
537  * devices.
538  *
539  * @param service path to get property.
540  * @param strength where to store the property value, must be a pointer
541  *        to byte (unsigned char*).
542  *
543  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
544  */
545 Eina_Bool
546 e_connman_service_strength_get(const E_Connman_Element *service, unsigned char *strength)
547 {
548    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
549    EINA_SAFETY_ON_NULL_RETURN_VAL(strength, EINA_FALSE);
550    return e_connman_element_property_get_stringshared
551              (service, e_connman_prop_strength, NULL, strength);
552 }
553
554 /**
555  * Get property "Favorite" value.
556  *
557  * If this property isn't found then @c EINA_FALSE is returned.
558  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
559  * values shall be considered invalid.
560  *
561  * Will be true if a cable is plugged in or the user
562  * selected and successfully connected to this service.
563  *
564  * This value is automatically changed and to revert
565  * it back to false the Remove() method needs to be
566  * used.
567  *
568  * @param service path to get property.
569  * @param favorite where to store the property value, must be a
570  *        pointer to Eina_Bool (Eina_Bool *).
571  *
572  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
573  */
574 Eina_Bool
575 e_connman_service_favorite_get(const E_Connman_Element *service, Eina_Bool *favorite)
576 {
577    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
578    EINA_SAFETY_ON_NULL_RETURN_VAL(favorite, EINA_FALSE);
579    return e_connman_element_property_get_stringshared
580              (service, e_connman_prop_favorite, NULL, favorite);
581 }
582
583 /**
584  * Get property "Immutable" value.
585  *
586  * This value will be set to true if the service is configured
587  * externally via a configuration file.
588  *
589  * The only valid operation are e_connman_service_connect() and
590  * e_connman_service_disconnect(). The e_connman_service_remove()
591  * method will result in an error.
592
593  * @param service path to get property.
594  * @param immutable where to store the property value, must be a
595  *        pointer to Eina_Bool (Eina_Bool *).
596  *
597  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
598  */
599 Eina_Bool
600 e_connman_service_immutable_get(const E_Connman_Element *service, Eina_Bool *immutable)
601 {
602    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
603    EINA_SAFETY_ON_NULL_RETURN_VAL(immutable, EINA_FALSE);
604    return e_connman_element_property_get_stringshared
605              (service, e_connman_prop_immutable, NULL, immutable);
606 }
607
608 /**
609  * Get property "AutoConnect" value.
610  *
611  * If this property isn't found then @c EINA_FALSE is returned.
612  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
613  * values shall be considered invalid.
614  *
615  * If set to true, this service will auto-connect
616  * when not other connection is available.
617  *
618  * For favorite services it is possible to change
619  * this value to prevent or permit automatic
620  * connection attempts.
621  *
622  * @param service path to get property.
623  * @param auto_connect where to store the property value, must be a
624  *        pointer to Eina_Bool (Eina_Bool *).
625  *
626  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
627  * @see e_connman_service_auto_connect_set()
628  */
629 Eina_Bool
630 e_connman_service_auto_connect_get(const E_Connman_Element *service, Eina_Bool *auto_connect)
631 {
632    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
633    EINA_SAFETY_ON_NULL_RETURN_VAL(auto_connect, EINA_FALSE);
634    return e_connman_element_property_get_stringshared
635              (service, e_connman_prop_auto_connect, NULL, auto_connect);
636 }
637
638 /**
639  * Set property "AutoConnect" value.
640  *
641  * If this property isn't found then @c EINA_FALSE is returned.
642  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
643  * values shall be considered invalid.
644  *
645  * If set to true, this service will auto-connect
646  * when not other connection is available.
647  *
648  * For favorite services it is possible to change
649  * this value to prevent or permit automatic
650  * connection attempts.
651  *
652  * @param service path to get property.
653  * @param service_favorite where to store the property value, must be a
654  *        pointer to Eina_Bool (Eina_Bool *).
655  *
656  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
657  * @see e_connman_service_auto_connect_get()
658  */
659 Eina_Bool
660 e_connman_service_auto_connect_set(E_Connman_Element *service, Eina_Bool auto_connect, E_DBus_Method_Return_Cb cb, const void *data)
661 {
662    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
663    return e_connman_element_property_set_full
664              (service, e_connman_prop_auto_connect, DBUS_TYPE_BOOLEAN, &auto_connect, cb, data);
665 }
666
667 /**
668  * Get property "SetupRequired" value.
669  *
670  * If this property isn't found then @c EINA_FALSE is returned.
671  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
672  * values shall be considered invalid.
673  *
674  * If the service is Cellular, then this property
675  * indicates that some extra setup steps are required.
676  *
677  * In most cases it is required to fill in the APN
678  * details.
679  *
680  * @param service path to get property.
681  * @param setup_required where to store the property value, must be a
682  *        pointer to Eina_Bool (Eina_Bool *).
683  *
684  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
685  */
686 Eina_Bool
687 e_connman_service_setup_required_get(const E_Connman_Element *service, Eina_Bool *setup_required)
688 {
689    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
690    EINA_SAFETY_ON_NULL_RETURN_VAL(setup_required, EINA_FALSE);
691    return e_connman_element_property_get_stringshared
692              (service, e_connman_prop_setup_required, NULL, setup_required);
693 }
694
695 /**
696  * Get property "APN" value.
697  *
698  * If this property isn't found then @c EINA_FALSE is returned.
699  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
700  * values shall be considered invalid.
701  *
702  * If the service is Cellular, then this property
703  * contains the APN details.
704  *
705  * The APN is network provider specific and even
706  * sometimes data plan specific. Possible examples
707  * are "isp.cingular" or "internet.t-mobile".
708  *
709  * This property might also not always be included
710  * since it is protected by a different security policy.
711  *
712  * @param service path to get property.
713  * @param apn where to store the property value, must be a pointer
714  *        to string (const char **), it will not be allocated or
715  *        copied and references will be valid until element changes,
716  *        so copy it if you want to use it later.
717  *
718  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
719  * @see e_connman_service_apn_set()
720  */
721 Eina_Bool
722 e_connman_service_apn_get(const E_Connman_Element *service, const char **apn)
723 {
724    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
725    EINA_SAFETY_ON_NULL_RETURN_VAL(apn, EINA_FALSE);
726    return e_connman_element_property_get_stringshared
727              (service, e_connman_prop_apn, NULL, apn);
728 }
729
730 /**
731  * Set property "APN" value.
732  *
733  * If this property isn't found then @c EINA_FALSE is returned.
734  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
735  * values shall be considered invalid.
736  *
737  * If the service is Cellular, then this property
738  * contains the APN details.
739  *
740  * The APN is network provider specific and even
741  * sometimes data plan specific. Possible examples
742  * are "isp.cingular" or "internet.t-mobile".
743  *
744  * This property might also not always be included
745  * since it is protected by a different security policy.
746  *
747  * @param service path to get property.
748  * @param passphrase value to set.
749  * @param cb function to call when server replies or some error happens.
750  * @param data data to give to cb when it is called.
751  *
752  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
753  * @see e_connman_service_apn_get()
754  */
755 Eina_Bool
756 e_connman_service_apn_set(E_Connman_Element *service, const char *apn, E_DBus_Method_Return_Cb cb, const void *data)
757 {
758    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
759    return e_connman_element_property_set_full
760              (service, e_connman_prop_apn, DBUS_TYPE_STRING,
761              apn, cb, data);
762 }
763
764 /**
765  * Get property "MCC" value.
766  *
767  * If this property isn't found then @c EINA_FALSE is returned.
768  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
769  * values shall be considered invalid.
770  *
771  * If the service is Cellular, then this property
772  * contains the Mobile Country Code.
773  *
774  * @param service path to get property.
775  * @param mcc where to store the property value, must be a pointer
776  *        to string (const char **), it will not be allocated or
777  *        copied and references will be valid until element changes,
778  *        so copy it if you want to use it later.
779  *
780  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
781  */
782 Eina_Bool
783 e_connman_service_mcc_get(const E_Connman_Element *service, const char **mcc)
784 {
785    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
786    EINA_SAFETY_ON_NULL_RETURN_VAL(mcc, EINA_FALSE);
787    return e_connman_element_property_get_stringshared
788              (service, e_connman_prop_mcc, NULL, mcc);
789 }
790
791 /**
792  * Get property "MNC" value.
793  *
794  * If this property isn't found then @c EINA_FALSE is returned.
795  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
796  * values shall be considered invalid.
797  *
798  * If the service is Cellular, then this property
799  * contains the Mobile Network Code.
800  *
801  * @param service path to get property.
802  * @param mnc where to store the property value, must be a pointer
803  *        to string (const char **), it will not be allocated or
804  *        copied and references will be valid until element changes,
805  *        so copy it if you want to use it later.
806  *
807  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
808  */
809 Eina_Bool
810 e_connman_service_mnc_get(const E_Connman_Element *service, const char **mnc)
811 {
812    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
813    EINA_SAFETY_ON_NULL_RETURN_VAL(mnc, EINA_FALSE);
814    return e_connman_element_property_get_stringshared
815              (service, e_connman_prop_mnc, NULL, mnc);
816 }
817
818 /**
819  * Get property "Roaming" value.
820  *
821  * If this property isn't found then @c EINA_FALSE is returned.
822  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
823  * values shall be considered invalid.
824  *
825  * This property indicates if this service is roaming.
826  *
827  * In the case of Cellular services this normally
828  * indicates connections to a foreign provider when
829  * traveling abroad.
830  *
831  * @param service path to get property.
832  * @param roaming where to store the property value, must be a
833  *        pointer to Eina_Bool (Eina_Bool *).
834  *
835  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
836  */
837 Eina_Bool
838 e_connman_service_roaming_get(const E_Connman_Element *service, Eina_Bool *roaming)
839 {
840    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
841    EINA_SAFETY_ON_NULL_RETURN_VAL(roaming, EINA_FALSE);
842    return e_connman_element_property_get_stringshared
843              (service, e_connman_prop_roaming, NULL, roaming);
844 }
845
846 /**
847  * Get property "IPv4.Method" value.
848  *
849  * If this property isn't found then @c EINA_FALSE is returned.
850  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
851  * values shall be considered invalid.
852  *
853  * The IPv4 method in use. Possible values here are "dhcp" and
854  * "static".
855  *
856  * @param service path to get property.
857  * @param method where to store the property value, must be a pointer
858  *        to string (const char **), it will not be allocated or
859  *        copied and references will be valid until element changes,
860  *        so copy it if you want to use it later.
861  *
862  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
863  */
864 Eina_Bool
865 e_connman_service_ipv4_method_get(const E_Connman_Element *service, const char **method)
866 {
867    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
868    EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
869    return e_connman_element_property_dict_get_stringshared
870              (service, e_connman_prop_ipv4, e_connman_prop_method, NULL, method);
871 }
872
873 /**
874  * Get property "IPv4.Address" value.
875  *
876  * If this property isn't found then @c EINA_FALSE is returned.
877  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
878  * values shall be considered invalid.
879  *
880  * The current IPv4 address.
881  *
882  * @param service path to get property.
883  * @param address where to store the property value, must be a pointer
884  *        to string (const char **), it will not be allocated or
885  *        copied and references will be valid until element changes,
886  *        so copy it if you want to use it later.
887  *
888  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
889  */
890 Eina_Bool
891 e_connman_service_ipv4_address_get(const E_Connman_Element *service, const char **address)
892 {
893    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
894    EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
895    return e_connman_element_property_dict_get_stringshared
896              (service, e_connman_prop_ipv4, e_connman_prop_address, NULL, address);
897 }
898
899 /**
900  * Get property "IPv4.Gateway" value.
901  *
902  * If this property isn't found then @c EINA_FALSE is returned.
903  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
904  * values shall be considered invalid.
905  *
906  * The current IPv4 gateway.
907  *
908  * @param service path to get property.
909  * @param gateway where to store the property value, must be a pointer
910  *        to string (const char **), it will not be allocated or
911  *        copied and references will be valid until element changes,
912  *        so copy it if you want to use it later.
913  *
914  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
915  */
916 Eina_Bool
917 e_connman_service_ipv4_gateway_get(const E_Connman_Element *service, const char **gateway)
918 {
919    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
920    EINA_SAFETY_ON_NULL_RETURN_VAL(gateway, EINA_FALSE);
921    return e_connman_element_property_dict_get_stringshared
922              (service, e_connman_prop_ipv4, e_connman_prop_gateway, NULL, gateway);
923 }
924
925 /**
926  * Get property "IPv4.Netmask" value.
927  *
928  * If this property isn't found then @c EINA_FALSE is returned.
929  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
930  * values shall be considered invalid.
931  *
932  * The current IPv4 netmask.
933  *
934  * @param service path to get property.
935  * @param netmask where to store the property value, must be a pointer
936  *        to string (const char **), it will not be allocated or
937  *        copied and references will be valid until element changes,
938  *        so copy it if you want to use it later.
939  *
940  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
941  */
942 Eina_Bool
943 e_connman_service_ipv4_netmask_get(const E_Connman_Element *service, const char **netmask)
944 {
945    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
946    EINA_SAFETY_ON_NULL_RETURN_VAL(netmask, EINA_FALSE);
947    return e_connman_element_property_dict_get_stringshared
948              (service, e_connman_prop_ipv4, e_connman_prop_netmask, NULL, netmask);
949 }
950
951 /**
952  * Get property "IPv4.Configuration.Method" value.
953  *
954  * Unlike IPv4.Method, this is the user-set value, rather than the
955  * actual value.
956  *
957  * If this property isn't found then @c EINA_FALSE is returned.
958  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
959  * values shall be considered invalid.
960  *
961  * The IPv4 configured method. Possible values here are "dhcp" and
962  * "static".
963  *
964  * @param service path to get property.
965  * @param method where to store the property value, must be a pointer
966  *        to string (const char **), it will not be allocated or
967  *        copied and references will be valid until element changes,
968  *        so copy it if you want to use it later.
969  *
970  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
971  */
972 Eina_Bool
973 e_connman_service_ipv4_configuration_method_get(const E_Connman_Element *service, const char **method)
974 {
975    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
976    EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
977    return e_connman_element_property_dict_get_stringshared
978              (service, e_connman_prop_ipv4_configuration, e_connman_prop_method,
979              NULL, method);
980 }
981
982 /**
983  * Get property "IPv4.Configuration.Address" value.
984  *
985  * Unlike IPv4.Address, this is the user-set value, rather than the
986  * actual value.
987  *
988  * If this property isn't found then @c EINA_FALSE is returned.
989  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
990  * values shall be considered invalid.
991  *
992  * The current configured IPv4 address.
993  *
994  * @param service path to get property.
995  * @param address where to store the property value, must be a pointer
996  *        to string (const char **), it will not be allocated or
997  *        copied and references will be valid until element changes,
998  *        so copy it if you want to use it later.
999  *
1000  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1001  */
1002 Eina_Bool
1003 e_connman_service_ipv4_configuration_address_get(const E_Connman_Element *service, const char **address)
1004 {
1005    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1006    EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
1007    return e_connman_element_property_dict_get_stringshared
1008              (service, e_connman_prop_ipv4_configuration, e_connman_prop_address,
1009              NULL, address);
1010 }
1011
1012 /**
1013  * Get property "IPv4.Configuration.Gateway" value.
1014  *
1015  * Unlike IPv4.Gateway, this is the user-set value, rather than the
1016  * actual value.
1017  *
1018  * If this property isn't found then @c EINA_FALSE is returned.
1019  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1020  * values shall be considered invalid.
1021  *
1022  * The current configured IPv4 gateway.
1023  *
1024  * @param service path to get property.
1025  * @param gateway where to store the property value, must be a pointer
1026  *        to string (const char **), it will not be allocated or
1027  *        copied and references will be valid until element changes,
1028  *        so copy it if you want to use it later.
1029  *
1030  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1031  */
1032 Eina_Bool
1033 e_connman_service_ipv4_configuration_gateway_get(const E_Connman_Element *service, const char **gateway)
1034 {
1035    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1036    EINA_SAFETY_ON_NULL_RETURN_VAL(gateway, EINA_FALSE);
1037    return e_connman_element_property_dict_get_stringshared
1038              (service, e_connman_prop_ipv4_configuration, e_connman_prop_gateway,
1039              NULL, gateway);
1040 }
1041
1042 /**
1043  * Get property "IPv4.Configuration.Netmask" value.
1044  *
1045  * Unlike IPv4.Netmask, this is the user-set value, rather than the
1046  * actual value.
1047  *
1048  * If this property isn't found then @c EINA_FALSE is returned.
1049  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1050  * values shall be considered invalid.
1051  *
1052  * The current configured IPv4 netmask.
1053  *
1054  * @param service path to get property.
1055  * @param netmask where to store the property value, must be a pointer
1056  *        to string (const char **), it will not be allocated or
1057  *        copied and references will be valid until element changes,
1058  *        so copy it if you want to use it later.
1059  *
1060  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1061  */
1062 Eina_Bool
1063 e_connman_service_ipv4_configuration_netmask_get(const E_Connman_Element *service, const char **netmask)
1064 {
1065    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1066    EINA_SAFETY_ON_NULL_RETURN_VAL(netmask, EINA_FALSE);
1067    return e_connman_element_property_dict_get_stringshared
1068              (service, e_connman_prop_ipv4_configuration, e_connman_prop_netmask,
1069              NULL, netmask);
1070 }
1071
1072 /**
1073  * Set IPv4 to connect automatically using DHCP.
1074  *
1075  * @param service path to set.
1076  * @param cb function to call when server replies or some error happens.
1077  * @param data data to give to cb when it is called.
1078  *
1079  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1080  */
1081 Eina_Bool
1082 e_connman_service_ipv4_configure_dhcp(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
1083 {
1084    const char method[] = "dhcp";
1085    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1086    return e_connman_element_property_dict_set_full
1087              (service, e_connman_prop_ipv4_configuration, e_connman_prop_method,
1088              DBUS_TYPE_STRING, method, cb, data);
1089 }
1090
1091 /**
1092  * Set IPv4 to connect using manually set parameters.
1093  *
1094  * @param service path to set.
1095  * @param address IPv4 address.
1096  * @param netmask IPv4 netmask, or @c NULL for "/32".
1097  * @param gateway IPv4 gateway address.
1098  * @param cb function to call when server replies or some error happens.
1099  * @param data data to give to cb when it is called.
1100  *
1101  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1102  */
1103 Eina_Bool
1104 e_connman_service_ipv4_configure_manual(E_Connman_Element *service, const char *address, const char *netmask, const char *gateway, E_DBus_Method_Return_Cb cb, const void *data)
1105 {
1106    const char name[] = "SetProperty";
1107    const char *method = "manual"; /* not method[] as gcc screws it with dbus */
1108    DBusMessage *msg;
1109    DBusMessageIter itr, variant, dict, entry;
1110
1111    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1112    EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
1113
1114    msg = dbus_message_new_method_call
1115          (e_connman_system_bus_name_get(), service->path, service->interface, name);
1116
1117    if (!msg)
1118       return 0;
1119
1120    dbus_message_iter_init_append(msg, &itr);
1121    dbus_message_iter_append_basic
1122       (&itr, DBUS_TYPE_STRING, &e_connman_prop_ipv4_configuration);
1123
1124    dbus_message_iter_open_container
1125       (&itr, DBUS_TYPE_VARIANT,
1126       (DBUS_TYPE_ARRAY_AS_STRING
1127        DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
1128        DBUS_TYPE_STRING_AS_STRING
1129        DBUS_TYPE_STRING_AS_STRING
1130        DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
1131       &variant);
1132    dbus_message_iter_open_container
1133       (&variant, DBUS_TYPE_ARRAY,
1134       (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
1135        DBUS_TYPE_STRING_AS_STRING
1136        DBUS_TYPE_STRING_AS_STRING
1137        DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
1138       &dict);
1139
1140    dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1141    dbus_message_iter_append_basic
1142       (&entry, DBUS_TYPE_STRING, &e_connman_prop_method);
1143    dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &method);
1144    dbus_message_iter_close_container(&dict, &entry);
1145
1146    dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1147    dbus_message_iter_append_basic
1148       (&entry, DBUS_TYPE_STRING, &e_connman_prop_address);
1149    dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &address);
1150    dbus_message_iter_close_container(&dict, &entry);
1151
1152    if (netmask)
1153      {
1154         dbus_message_iter_open_container
1155            (&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1156         dbus_message_iter_append_basic
1157            (&entry, DBUS_TYPE_STRING, &e_connman_prop_netmask);
1158         dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &netmask);
1159         dbus_message_iter_close_container(&dict, &entry);
1160      }
1161
1162    if (gateway)
1163      {
1164         dbus_message_iter_open_container
1165            (&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1166         dbus_message_iter_append_basic
1167            (&entry, DBUS_TYPE_STRING, &e_connman_prop_gateway);
1168         dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &gateway);
1169         dbus_message_iter_close_container(&dict, &entry);
1170      }
1171
1172    dbus_message_iter_close_container(&variant, &dict);
1173    dbus_message_iter_close_container(&itr, &variant);
1174
1175    return e_connman_element_message_send
1176              (service, name, NULL, msg, &service->_pending.property_set, cb, data);
1177 }
1178
1179 /**
1180  * Get property "Ethernet.Method" value.
1181  *
1182  * If this property isn't found then @c EINA_FALSE is returned.
1183  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1184  * values shall be considered invalid.
1185  *
1186  * The Ethernet configuration method. Possible values here "auto" and "manual".
1187  *
1188  * @param service path to get property.
1189  * @param method where to store the property value, must be a pointer
1190  *        to string (const char **), it will not be allocated or
1191  *        copied and references will be valid until element changes,
1192  *        so copy it if you want to use it later.
1193  *
1194  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1195  */
1196 Eina_Bool
1197 e_connman_service_ethernet_method_get(const E_Connman_Element *service, const char **method)
1198 {
1199    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1200    EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
1201    return e_connman_element_property_dict_get_stringshared
1202              (service, e_connman_prop_ethernet, e_connman_prop_method, NULL, method);
1203 }
1204
1205 /**
1206  * Get property "Ethernet.Address" value.
1207  *
1208  * If this property isn't found then @c EINA_FALSE is returned.
1209  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1210  * values shall be considered invalid.
1211  *
1212  * The current configured Ethernet address (mac-address).
1213  *
1214  * @param service path to get property.
1215  * @param address where to store the property value, must be a pointer
1216  *        to string (const char **), it will not be allocated or
1217  *        copied and references will be valid until element changes,
1218  *        so copy it if you want to use it later.
1219  *
1220  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1221  */
1222 Eina_Bool
1223 e_connman_service_ethernet_address_get(const E_Connman_Element *service, const char **address)
1224 {
1225    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1226    EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
1227    return e_connman_element_property_dict_get_stringshared
1228              (service, e_connman_prop_ethernet, e_connman_prop_address, NULL, address);
1229 }
1230
1231 /**
1232  * Get property "Ethernet.MTU" value.
1233  *
1234  * If this property isn't found then @c EINA_FALSE is returned.
1235  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1236  * values shall be considered invalid.
1237  *
1238  * The current configured Ethernet MTU.
1239  *
1240  * @param service path to get property.
1241  * @param gateway where to store the property value, must be a pointer
1242  *        to string (const char **), it will not be allocated or
1243  *        copied and references will be valid until element changes,
1244  *        so copy it if you want to use it later.
1245  *
1246  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1247  */
1248 Eina_Bool
1249 e_connman_service_ethernet_mtu_get(const E_Connman_Element *service, unsigned short *mtu)
1250 {
1251    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1252    EINA_SAFETY_ON_NULL_RETURN_VAL(mtu, EINA_FALSE);
1253    return e_connman_element_property_dict_get_stringshared
1254              (service, e_connman_prop_ethernet, e_connman_prop_mtu, NULL, mtu);
1255 }
1256
1257 /**
1258  * Get property "Ethernet.Netmask" value.
1259  *
1260  * If this property isn't found then @c EINA_FALSE is returned.
1261  * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1262  * values shall be considered invalid.
1263  *
1264  * The current configured Ethernet netmask.
1265  *
1266  * @param service path to get property.
1267  * @param netmask where to store the property value, must be a pointer
1268  *        to string (const char **), it will not be allocated or
1269  *        copied and references will be valid until element changes,
1270  *        so copy it if you want to use it later.
1271  *
1272  * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1273  */
1274 Eina_Bool
1275 e_connman_service_ethernet_netmask_get(const E_Connman_Element *service, const char **netmask)
1276 {
1277    EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1278    EINA_SAFETY_ON_NULL_RETURN_VAL(netmask, EINA_FALSE);
1279    return e_connman_element_property_dict_get_stringshared
1280              (service, e_connman_prop_ethernet, e_connman_prop_netmask, NULL, netmask);
1281 }
1282