1 #include "e_connman_private.h"
4 e_connman_service_get(const char *path)
6 E_Connman_Element *service;
8 EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL);
10 service = e_connman_element_get(path);
14 if (!e_connman_element_is_service(service))
16 WRN("path '%s' is not a service!", path);
24 * Connect this service.
26 * Connect this service. It will attempt to connect
27 * WiFi, WiMAX or Bluetooth services.
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
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.
39 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
42 e_connman_service_connect(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
44 const char name[] = "Connect";
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);
52 * Disconnect this service.
54 * Disconnect this service. If the service is not
55 * connected an error message will be generated.
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
62 * This method can also be used to abort a previous
63 * connectiong attempt via the Connect method.
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.
69 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
72 e_connman_service_disconnect(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
74 const char name[] = "Disconnect";
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);
82 * Remove this service.
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.
88 * If the service requires a passphrase it will be
89 * cleared and forgotten when removing.
91 * This is similar to setting the Favorite property
92 * to false, but that is currently not supported.
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.
98 * Calling this method on Ethernet devices will cause
99 * an error message. It is not possible to remove these
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.
106 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
109 e_connman_service_remove(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
111 const char name[] = "Remove";
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);
119 * Clears the value of the specified property.
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.
127 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
130 e_connman_service_clear_property(E_Connman_Element *service, const char *property, E_DBus_Method_Return_Cb cb, const void *data)
132 const char name[] = "ClearProperty";
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,
142 * Move service before in favorites list.
144 * Call method MoveBefore(object service) at the given service on server.
146 * If a service has been used before, this allows a
147 * reorder of the favorite services.
149 * The target service object must be part of this
150 * profile. Moving between profiles is not supported.
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.
157 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
160 e_connman_service_move_before(E_Connman_Element *service, const char *object_path, E_DBus_Method_Return_Cb cb, const void *data)
162 const char name[] = "MoveBefore";
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);
172 * Move service after in favorites list.
174 * Call method MoveAfter(object service) at the given service on server.
176 * If a service has been used before, this allows a
177 * reorder of the favorite services.
179 * The target service object must be part of this
180 * profile. Moving between profiles is not supported.
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.
186 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
189 e_connman_service_move_after(E_Connman_Element *service, const char *object_path, E_DBus_Method_Return_Cb cb, const void *data)
191 const char name[] = "MoveAfter";
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);
201 * Get property "State" value.
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.
207 * The service state information.
209 * Valid states are "idle", "failure", "association",
210 * "configuration", "ready", "login" and "online".
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.
218 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
221 e_connman_service_state_get(const E_Connman_Element *service, const char **state)
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);
230 * Get property "Error" value.
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.
236 * The service error status details.
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.
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.
247 * Current defined error code is "dhcp-failed".
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.
255 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
258 e_connman_service_error_get(const E_Connman_Element *service, const char **error)
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);
267 * Get property "Name" value.
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.
273 * The service name (for example "Wireless" etc.)
275 * This name can be used for directly displaying it in
276 * the application. It has pure informational purpose.
278 * For Ethernet devices and hidden WiFi networks it is
279 * not guaranteed that this property is present.
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.
287 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
290 e_connman_service_name_get(const E_Connman_Element *service, const char **name)
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);
299 * Get property "Type" value.
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.
305 * The service type (for example "ethernet", "wifi" etc.)
307 * This information should only be used to determine
308 * advanced properties or showing the correct icon
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.
317 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
320 e_connman_service_type_get(const E_Connman_Element *service, const char **type)
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);
329 * Get property "Security" value.
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.
335 * If the service type is WiFi, then this property is
336 * present and contains the list of security method or key
337 * management setting.
339 * Possible values are "none", "wep", "wpa", "rsn", "psk", "ieee8021x" and "wps"
341 * This property might be only present for WiFi
344 * @param service path to get property.
345 * @param count where to return the number of elements in @a security
346 * @param security where to store the property value, must be a pointer
347 * to array of strings, it will not be allocated or
348 * copied and references will be valid until element changes,
349 * so copy it if you want to use it later.
351 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
354 e_connman_service_security2_get(const E_Connman_Element *service, unsigned int *count, const char ***security)
356 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
357 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
358 EINA_SAFETY_ON_NULL_RETURN_VAL(security, EINA_FALSE);
360 return e_connman_element_strings_array_get_stringshared
361 (service, e_connman_prop_security, count, security);
365 * Get property "Passphrase" value.
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.
371 * If the service type is WiFi, then this property
372 * can be used to store a passphrase.
374 * No PropertyChanged signals will be send for this
375 * property. The PassphraseRequired property should
376 * be monitored instead.
378 * This property might also not always be included
379 * since it is protected by a different security policy.
381 * @param service path to get property.
382 * @param passphrase where to store the property value, must be a pointer
383 * to string (const char **), it will not be allocated or
384 * copied and references will be valid until element changes,
385 * so copy it if you want to use it later.
387 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
388 * @see e_connman_service_passphrase_set()
391 e_connman_service_passphrase_get(const E_Connman_Element *service, const char **passphrase)
393 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
394 EINA_SAFETY_ON_NULL_RETURN_VAL(passphrase, EINA_FALSE);
395 return e_connman_element_property_get_stringshared
396 (service, e_connman_prop_passphrase, NULL, passphrase);
400 * Set property "Passphrase" value.
402 * If this property isn't found then @c EINA_FALSE is returned.
403 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
404 * values shall be considered invalid.
406 * If the service type is WiFi, then this property
407 * can be used to store a passphrase.
409 * No PropertyChanged signals will be send for this
410 * property. The PassphraseRequired property should
411 * be monitored instead.
413 * This property might also not always be included
414 * since it is protected by a different security policy.
416 * @param service path to get property.
417 * @param passphrase value to set.
418 * @param cb function to call when server replies or some error happens.
419 * @param data data to give to cb when it is called.
421 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
422 * @see e_connman_service_passphrase_get()
425 e_connman_service_passphrase_set(E_Connman_Element *service, const char *passphrase, E_DBus_Method_Return_Cb cb, const void *data)
427 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
428 return e_connman_element_property_set_full
429 (service, e_connman_prop_passphrase, DBUS_TYPE_STRING,
430 passphrase, cb, data);
434 * Get property "PassphraseRequired" value.
436 * If this property isn't found then @c EINA_FALSE is returned.
437 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
438 * values shall be considered invalid.
440 * If the service type is WiFi, then this property
441 * indicates if a passphrase is required.
443 * If a passphrase has been set already or if no
444 * passphrase is needed, then this property will
447 * @param service path to get property.
448 * @param passphrase_required where to store the property value, must be a
449 * pointer to Eina_Bool (Eina_Bool *).
451 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
454 e_connman_service_passphrase_required_get(const E_Connman_Element *service, Eina_Bool *passphrase_required)
456 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
457 EINA_SAFETY_ON_NULL_RETURN_VAL(passphrase_required, EINA_FALSE);
458 return e_connman_element_property_get_stringshared
459 (service, e_connman_prop_passphrase_required, NULL, passphrase_required);
463 * Get property "LoginRequired" value.
465 * If this property isn't found then @c EINA_FALSE is returned.
466 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
467 * values shall be considered invalid.
469 * Indicates that a manual configuration must be done to login the
470 * user, likely access an website using a browser.
472 * If a login has been set already or if no
473 * login is needed, then this property will
476 * @param service path to get property.
477 * @param login_required where to store the property value, must be a
478 * pointer to Eina_Bool (Eina_Bool *).
480 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
485 e_connman_service_login_required_get(const E_Connman_Element *service, Eina_Bool *login_required)
487 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
488 EINA_SAFETY_ON_NULL_RETURN_VAL(login_required, EINA_FALSE);
489 return e_connman_element_property_get_stringshared
490 (service, e_connman_prop_login_required, NULL, login_required);
494 * Get property "Strength" value.
496 * If this property isn't found then @c EINA_FALSE is returned.
497 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
498 * values shall be considered invalid.
500 * Indicates the signal strength of the service. This
501 * is a normalized value between 0 and 100.
503 * This property will not be present for Ethernet
506 * @param service path to get property.
507 * @param strength where to store the property value, must be a pointer
508 * to byte (unsigned char*).
510 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
513 e_connman_service_strength_get(const E_Connman_Element *service, unsigned char *strength)
515 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
516 EINA_SAFETY_ON_NULL_RETURN_VAL(strength, EINA_FALSE);
517 return e_connman_element_property_get_stringshared
518 (service, e_connman_prop_strength, NULL, strength);
522 * Get property "Favorite" value.
524 * If this property isn't found then @c EINA_FALSE is returned.
525 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
526 * values shall be considered invalid.
528 * Will be true if a cable is plugged in or the user
529 * selected and successfully connected to this service.
531 * This value is automatically changed and to revert
532 * it back to false the Remove() method needs to be
535 * @param service path to get property.
536 * @param favorite where to store the property value, must be a
537 * pointer to Eina_Bool (Eina_Bool *).
539 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
542 e_connman_service_favorite_get(const E_Connman_Element *service, Eina_Bool *favorite)
544 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
545 EINA_SAFETY_ON_NULL_RETURN_VAL(favorite, EINA_FALSE);
546 return e_connman_element_property_get_stringshared
547 (service, e_connman_prop_favorite, NULL, favorite);
551 * Get property "Immutable" value.
553 * This value will be set to true if the service is configured
554 * externally via a configuration file.
556 * The only valid operation are e_connman_service_connect() and
557 * e_connman_service_disconnect(). The e_connman_service_remove()
558 * method will result in an error.
560 * @param service path to get property.
561 * @param immutable where to store the property value, must be a
562 * pointer to Eina_Bool (Eina_Bool *).
564 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
567 e_connman_service_immutable_get(const E_Connman_Element *service, Eina_Bool *immutable)
569 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
570 EINA_SAFETY_ON_NULL_RETURN_VAL(immutable, EINA_FALSE);
571 return e_connman_element_property_get_stringshared
572 (service, e_connman_prop_immutable, NULL, immutable);
576 * Get property "AutoConnect" value.
578 * If this property isn't found then @c EINA_FALSE is returned.
579 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
580 * values shall be considered invalid.
582 * If set to true, this service will auto-connect
583 * when not other connection is available.
585 * For favorite services it is possible to change
586 * this value to prevent or permit automatic
587 * connection attempts.
589 * @param service path to get property.
590 * @param auto_connect where to store the property value, must be a
591 * pointer to Eina_Bool (Eina_Bool *).
593 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
594 * @see e_connman_service_auto_connect_set()
597 e_connman_service_auto_connect_get(const E_Connman_Element *service, Eina_Bool *auto_connect)
599 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
600 EINA_SAFETY_ON_NULL_RETURN_VAL(auto_connect, EINA_FALSE);
601 return e_connman_element_property_get_stringshared
602 (service, e_connman_prop_auto_connect, NULL, auto_connect);
606 * Set property "AutoConnect" value.
608 * If this property isn't found then @c EINA_FALSE is returned.
609 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
610 * values shall be considered invalid.
612 * If set to true, this service will auto-connect
613 * when not other connection is available.
615 * For favorite services it is possible to change
616 * this value to prevent or permit automatic
617 * connection attempts.
619 * @param service path to get property.
620 * @param service_favorite where to store the property value, must be a
621 * pointer to Eina_Bool (Eina_Bool *).
623 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
624 * @see e_connman_service_auto_connect_get()
627 e_connman_service_auto_connect_set(E_Connman_Element *service, Eina_Bool auto_connect, E_DBus_Method_Return_Cb cb, const void *data)
629 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
630 return e_connman_element_property_set_full
631 (service, e_connman_prop_auto_connect, DBUS_TYPE_BOOLEAN, &auto_connect, cb, data);
635 * Get property "Roaming" value.
637 * If this property isn't found then @c EINA_FALSE is returned.
638 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
639 * values shall be considered invalid.
641 * This property indicates if this service is roaming.
643 * In the case of Cellular services this normally
644 * indicates connections to a foreign provider when
647 * @param service path to get property.
648 * @param roaming where to store the property value, must be a
649 * pointer to Eina_Bool (Eina_Bool *).
651 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
654 e_connman_service_roaming_get(const E_Connman_Element *service, Eina_Bool *roaming)
656 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
657 EINA_SAFETY_ON_NULL_RETURN_VAL(roaming, EINA_FALSE);
658 return e_connman_element_property_get_stringshared
659 (service, e_connman_prop_roaming, NULL, roaming);
663 * Get property "Nameservers" value.
665 * If this property isn't found then @c EINA_FALSE is returned.
666 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
667 * values shall be considered invalid.
668 * The list of currently active nameservers for this service. If the server is
669 * not in READY or ONLINE state than this list will be empty.
671 * Global nameservers are automatically added to this list.
673 * The array represents a sorted list of the current nameservers. The first one
674 * has the highest priority and is used by default.
676 * When using DHCP this array represents the nameservers provided by the
677 * network. In case of manual settings, the ones from Nameservers.Configuration
680 * @param service path to get property.
681 * @param count return the number of elements in array.
682 * @param nameservers array with pointers to internal strings. These
683 * strings are not copied in any way, and they are granted to
684 * be eina_stringshare instances, so one can use
685 * eina_stringshare_ref() if he wants to save memory and cpu to
686 * get an extra reference. The array itself is also NOT
687 * allocated or copied, do not modify it. This pointer is just
688 * set if return is @c EINA_TRUE.
690 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
693 e_connman_service_nameservers_get(const E_Connman_Element *service, unsigned int *count, const char ***nameservers)
695 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
696 EINA_SAFETY_ON_NULL_RETURN_VAL(nameservers, EINA_FALSE);
697 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
698 return e_connman_element_strings_array_get_stringshared
699 (service, e_connman_prop_nameservers, count, nameservers);
703 * Get property "Nameservers.Configuration" value.
705 * If this property isn't found then @c EINA_FALSE is returned.
706 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
707 * values shall be considered invalid.
708 * The list of currently active nameservers for this service. If the server is
709 * not in READY or ONLINE state than this list will be empty.
711 * Unlike Nameservers, this is the user-set value, rather than the
714 * @param service path to get property.
715 * @param count return the number of elements in array.
716 * @param nameservers array with pointers to internal strings. These
717 * strings are not copied in any way, and they are granted to
718 * be eina_stringshare instances, so one can use
719 * eina_stringshare_ref() if he wants to save memory and cpu to
720 * get an extra reference. The array itself is also NOT
721 * allocated or copied, do not modify it. This pointer is just
722 * set if return is @c EINA_TRUE.
724 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
727 e_connman_service_nameservers_configuration_get(const E_Connman_Element *service, unsigned int *count, const char ***nameservers)
729 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
730 EINA_SAFETY_ON_NULL_RETURN_VAL(nameservers, EINA_FALSE);
731 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
732 return e_connman_element_strings_array_get_stringshared
733 (service, e_connman_prop_nameservers_configuration,
738 * Set property "Nameservers.Configuration" value.
740 * If this property isn't found then @c EINA_FALSE is returned.
741 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
742 * values shall be considered invalid.
744 * Unlike Nameservers, this is the user-set value, rather than the actual value.
745 * It allows user to override the default setting. When using manual
746 * configuration and no global nameservers are configured, then it is useful to
747 * configure this setting as well.
749 * This list is sorted by priority and the first entry represents the nameserver
750 * with the highest priority.
752 * Changes to the domain name servers can be done at any time. It will not cause
753 * a disconnect of the service. However there might be small window where name
754 * resolution might fail.
756 * @param service path to set property.
757 * @param nameservers sorted list of the current nameservers. The first one has
758 * the highest priority and is used by default.
759 * @param cb function to call when server replies or some error happens.
760 * @param data data to give to cb when it is called.
762 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
763 * @see e_connman_service_nameservers_configuration_get()
766 e_connman_service_nameservers_configuration_set(E_Connman_Element *service, unsigned int count, const char **nameservers, E_DBus_Method_Return_Cb cb, const void *data)
768 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
769 EINA_SAFETY_ON_NULL_RETURN_VAL(nameservers, EINA_FALSE);
770 return e_connman_element_property_array_set_full
771 (service, e_connman_prop_nameservers_configuration,
772 DBUS_TYPE_STRING, count,
773 (const void * const *)nameservers, cb, data);
777 * Get property "Domains" value.
779 * If this property isn't found then @c EINA_FALSE is returned.
780 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
781 * values shall be considered invalid.
782 * The list of currently active domains for this service. If the server is
783 * not in READY or ONLINE state than this list will be empty.
785 * The list of currently used search domains.
787 * @param service path to get property.
788 * @param count return the number of elements in array.
789 * @param domains array with pointers to internal strings. These
790 * strings are not copied in any way, and they are granted to
791 * be eina_stringshare instances, so one can use
792 * eina_stringshare_ref() if he wants to save memory and cpu to
793 * get an extra reference. The array itself is also NOT
794 * allocated or copied, do not modify it. This pointer is just
795 * set if return is @c EINA_TRUE.
797 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
800 e_connman_service_domains_get(const E_Connman_Element *service, unsigned int *count, const char ***domains)
802 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
803 EINA_SAFETY_ON_NULL_RETURN_VAL(domains, EINA_FALSE);
804 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
805 return e_connman_element_strings_array_get_stringshared
806 (service, e_connman_prop_domains, count, domains);
810 * Get property "Domains.Configuration" value.
812 * If this property isn't found then @c EINA_FALSE is returned.
813 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
814 * values shall be considered invalid.
815 * The list of currently active domains for this service. If the server is
816 * not in READY or ONLINE state than this list will be empty.
818 * Unlike Domains, this is the user-set value, rather than the
821 * @param service path to get property.
822 * @param count return the number of elements in array.
823 * @param domains array with pointers to internal strings. These
824 * strings are not copied in any way, and they are granted to
825 * be eina_stringshare instances, so one can use
826 * eina_stringshare_ref() if he wants to save memory and cpu to
827 * get an extra reference. The array itself is also NOT
828 * allocated or copied, do not modify it. This pointer is just
829 * set if return is @c EINA_TRUE.
831 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
834 e_connman_service_domains_configuration_get(const E_Connman_Element *service, unsigned int *count, const char ***domains)
836 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
837 EINA_SAFETY_ON_NULL_RETURN_VAL(domains, EINA_FALSE);
838 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
839 return e_connman_element_strings_array_get_stringshared
840 (service, e_connman_prop_domains_configuration, count, domains);
844 * Set property "Domains.Configuration" value.
846 * If this property isn't found then @c EINA_FALSE is returned.
847 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
848 * values shall be considered invalid.
850 * Unlike Domains, this is the user-set value, rather than the actual value.
851 * It allows user to override the default setting. When using manual
852 * configuration and no global domains are configured, then it is useful to
853 * configure this setting as well.
855 * This list is sorted by priority and the first entry represents the nameserver
856 * with the highest priority.
858 * Changes to the domain name servers can be done at any time. It will not cause
859 * a disconnect of the service. However there might be small window where name
860 * resolution might fail.
862 * @param service path to set property.
863 * @param count number of elements in @a domain.
864 * @param domains sorted list of the current domains. The first one has
865 * the highest priority and is used by default.
866 * @param cb function to call when server replies or some error happens.
867 * @param data data to give to cb when it is called.
869 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
870 * @see e_connman_service_domains_configuration_get()
873 e_connman_service_domains_configuration_set(E_Connman_Element *service, unsigned int count, const char **domains, E_DBus_Method_Return_Cb cb, const void *data)
875 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
876 EINA_SAFETY_ON_NULL_RETURN_VAL(domains, EINA_FALSE);
877 return e_connman_element_property_array_set_full
878 (service, e_connman_prop_domains_configuration,
879 DBUS_TYPE_STRING, count,
880 (const void * const *)domains, cb, data);
884 * Get property "IPv4.Method" value.
886 * If this property isn't found then @c EINA_FALSE is returned.
887 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
888 * values shall be considered invalid.
890 * The IPv4 method in use. Possible values here are "dhcp" and
893 * @param service path to get property.
894 * @param method where to store the property value, must be a pointer
895 * to string (const char **), it will not be allocated or
896 * copied and references will be valid until element changes,
897 * so copy it if you want to use it later.
899 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
902 e_connman_service_ipv4_method_get(const E_Connman_Element *service, const char **method)
904 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
905 EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
906 return e_connman_element_property_dict_get_stringshared
907 (service, e_connman_prop_ipv4, e_connman_prop_method, NULL, method);
911 * Get property "IPv4.Address" value.
913 * If this property isn't found then @c EINA_FALSE is returned.
914 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
915 * values shall be considered invalid.
917 * The current IPv4 address.
919 * @param service path to get property.
920 * @param address where to store the property value, must be a pointer
921 * to string (const char **), it will not be allocated or
922 * copied and references will be valid until element changes,
923 * so copy it if you want to use it later.
925 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
928 e_connman_service_ipv4_address_get(const E_Connman_Element *service, const char **address)
930 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
931 EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
932 return e_connman_element_property_dict_get_stringshared
933 (service, e_connman_prop_ipv4, e_connman_prop_address, NULL, address);
937 * Get property "IPv4.Gateway" value.
939 * If this property isn't found then @c EINA_FALSE is returned.
940 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
941 * values shall be considered invalid.
943 * The current IPv4 gateway.
945 * @param service path to get property.
946 * @param gateway where to store the property value, must be a pointer
947 * to string (const char **), it will not be allocated or
948 * copied and references will be valid until element changes,
949 * so copy it if you want to use it later.
951 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
954 e_connman_service_ipv4_gateway_get(const E_Connman_Element *service, const char **gateway)
956 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
957 EINA_SAFETY_ON_NULL_RETURN_VAL(gateway, EINA_FALSE);
958 return e_connman_element_property_dict_get_stringshared
959 (service, e_connman_prop_ipv4, e_connman_prop_gateway, NULL, gateway);
963 * Get property "IPv4.Netmask" value.
965 * If this property isn't found then @c EINA_FALSE is returned.
966 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
967 * values shall be considered invalid.
969 * The current IPv4 netmask.
971 * @param service path to get property.
972 * @param netmask where to store the property value, must be a pointer
973 * to string (const char **), it will not be allocated or
974 * copied and references will be valid until element changes,
975 * so copy it if you want to use it later.
977 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
980 e_connman_service_ipv4_netmask_get(const E_Connman_Element *service, const char **netmask)
982 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
983 EINA_SAFETY_ON_NULL_RETURN_VAL(netmask, EINA_FALSE);
984 return e_connman_element_property_dict_get_stringshared
985 (service, e_connman_prop_ipv4, e_connman_prop_netmask, NULL, netmask);
989 * Get property "IPv4.Configuration.Method" value.
991 * Unlike IPv4.Method, this is the user-set value, rather than the
994 * If this property isn't found then @c EINA_FALSE is returned.
995 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
996 * values shall be considered invalid.
998 * The IPv4 configured method. Possible values here are "dhcp" and
1001 * @param service path to get property.
1002 * @param method where to store the property value, must be a pointer
1003 * to string (const char **), it will not be allocated or
1004 * copied and references will be valid until element changes,
1005 * so copy it if you want to use it later.
1007 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1010 e_connman_service_ipv4_configuration_method_get(const E_Connman_Element *service, const char **method)
1012 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1013 EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
1014 return e_connman_element_property_dict_get_stringshared
1015 (service, e_connman_prop_ipv4_configuration, e_connman_prop_method,
1020 * Get property "IPv4.Configuration.Address" value.
1022 * Unlike IPv4.Address, this is the user-set value, rather than the
1025 * If this property isn't found then @c EINA_FALSE is returned.
1026 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1027 * values shall be considered invalid.
1029 * The current configured IPv4 address.
1031 * @param service path to get property.
1032 * @param address where to store the property value, must be a pointer
1033 * to string (const char **), it will not be allocated or
1034 * copied and references will be valid until element changes,
1035 * so copy it if you want to use it later.
1037 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1040 e_connman_service_ipv4_configuration_address_get(const E_Connman_Element *service, const char **address)
1042 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1043 EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
1044 return e_connman_element_property_dict_get_stringshared
1045 (service, e_connman_prop_ipv4_configuration, e_connman_prop_address,
1050 * Get property "IPv4.Configuration.Gateway" value.
1052 * Unlike IPv4.Gateway, this is the user-set value, rather than the
1055 * If this property isn't found then @c EINA_FALSE is returned.
1056 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1057 * values shall be considered invalid.
1059 * The current configured IPv4 gateway.
1061 * @param service path to get property.
1062 * @param gateway where to store the property value, must be a pointer
1063 * to string (const char **), it will not be allocated or
1064 * copied and references will be valid until element changes,
1065 * so copy it if you want to use it later.
1067 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1070 e_connman_service_ipv4_configuration_gateway_get(const E_Connman_Element *service, const char **gateway)
1072 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1073 EINA_SAFETY_ON_NULL_RETURN_VAL(gateway, EINA_FALSE);
1074 return e_connman_element_property_dict_get_stringshared
1075 (service, e_connman_prop_ipv4_configuration, e_connman_prop_gateway,
1080 * Get property "IPv4.Configuration.Netmask" value.
1082 * Unlike IPv4.Netmask, this is the user-set value, rather than the
1085 * If this property isn't found then @c EINA_FALSE is returned.
1086 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1087 * values shall be considered invalid.
1089 * The current configured IPv4 netmask.
1091 * @param service path to get property.
1092 * @param netmask where to store the property value, must be a pointer
1093 * to string (const char **), it will not be allocated or
1094 * copied and references will be valid until element changes,
1095 * so copy it if you want to use it later.
1097 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1100 e_connman_service_ipv4_configuration_netmask_get(const E_Connman_Element *service, const char **netmask)
1102 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1103 EINA_SAFETY_ON_NULL_RETURN_VAL(netmask, EINA_FALSE);
1104 return e_connman_element_property_dict_get_stringshared
1105 (service, e_connman_prop_ipv4_configuration, e_connman_prop_netmask,
1110 * Set IPv4 to connect automatically using DHCP.
1112 * @param service path to set.
1113 * @param cb function to call when server replies or some error happens.
1114 * @param data data to give to cb when it is called.
1116 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1119 e_connman_service_ipv4_configure_dhcp(E_Connman_Element *service, E_DBus_Method_Return_Cb cb, const void *data)
1121 const char method[] = "dhcp";
1122 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1123 return e_connman_element_property_dict_set_full
1124 (service, e_connman_prop_ipv4_configuration, e_connman_prop_method,
1125 DBUS_TYPE_STRING, method, cb, data);
1129 * Set IPv4 to connect using manually set parameters.
1131 * @param service path to set.
1132 * @param address IPv4 address.
1133 * @param netmask IPv4 netmask, or @c NULL for "/32".
1134 * @param gateway IPv4 gateway address.
1135 * @param cb function to call when server replies or some error happens.
1136 * @param data data to give to cb when it is called.
1138 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1141 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)
1143 const char name[] = "SetProperty";
1144 const char *method = "manual"; /* not method[] as gcc screws it with dbus */
1146 DBusMessageIter itr, variant, dict, entry;
1148 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1149 EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
1151 msg = dbus_message_new_method_call
1152 (e_connman_system_bus_name_get(), service->path, service->interface, name);
1157 dbus_message_iter_init_append(msg, &itr);
1158 dbus_message_iter_append_basic
1159 (&itr, DBUS_TYPE_STRING, &e_connman_prop_ipv4_configuration);
1161 dbus_message_iter_open_container
1162 (&itr, DBUS_TYPE_VARIANT,
1163 (DBUS_TYPE_ARRAY_AS_STRING
1164 DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
1165 DBUS_TYPE_STRING_AS_STRING
1166 DBUS_TYPE_STRING_AS_STRING
1167 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
1169 dbus_message_iter_open_container
1170 (&variant, DBUS_TYPE_ARRAY,
1171 (DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
1172 DBUS_TYPE_STRING_AS_STRING
1173 DBUS_TYPE_STRING_AS_STRING
1174 DBUS_DICT_ENTRY_END_CHAR_AS_STRING),
1177 dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1178 dbus_message_iter_append_basic
1179 (&entry, DBUS_TYPE_STRING, &e_connman_prop_method);
1180 dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &method);
1181 dbus_message_iter_close_container(&dict, &entry);
1183 dbus_message_iter_open_container(&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1184 dbus_message_iter_append_basic
1185 (&entry, DBUS_TYPE_STRING, &e_connman_prop_address);
1186 dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &address);
1187 dbus_message_iter_close_container(&dict, &entry);
1191 dbus_message_iter_open_container
1192 (&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1193 dbus_message_iter_append_basic
1194 (&entry, DBUS_TYPE_STRING, &e_connman_prop_netmask);
1195 dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &netmask);
1196 dbus_message_iter_close_container(&dict, &entry);
1201 dbus_message_iter_open_container
1202 (&dict, DBUS_TYPE_DICT_ENTRY, NULL, &entry);
1203 dbus_message_iter_append_basic
1204 (&entry, DBUS_TYPE_STRING, &e_connman_prop_gateway);
1205 dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &gateway);
1206 dbus_message_iter_close_container(&dict, &entry);
1209 dbus_message_iter_close_container(&variant, &dict);
1210 dbus_message_iter_close_container(&itr, &variant);
1212 return e_connman_element_message_send
1213 (service, name, NULL, msg, &service->_pending.property_set, cb, data);
1217 * Get property "Proxy.Method" value.
1219 * If this property isn't found then @c EINA_FALSE is returned.
1220 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1221 * values shall be considered invalid.
1223 * Possible values are "direct", "auto" and "manual".
1225 * @param service path to get property.
1226 * @param method where to store the property value, must be a pointer
1227 * to string (const char **), it will not be allocated or
1228 * copied and references will be valid until element changes,
1229 * so copy it if you want to use it later.
1231 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1234 e_connman_service_proxy_method_get(const E_Connman_Element *service, const char **method)
1236 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1237 EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
1238 return e_connman_element_property_dict_get_stringshared
1239 (service, e_connman_prop_proxy, e_connman_prop_method, NULL, method);
1243 * Get property "Proxy.URL" value.
1245 * If this property isn't found then @c EINA_FALSE is returned.
1246 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1247 * values shall be considered invalid.
1249 * Automatic proxy configuration URL. Used by "auto" method.
1251 * @param service path to get property.
1252 * @param url where to store the property value, must be a pointer
1253 * to string (const char **), it will not be allocated or
1254 * copied and references will be valid until element changes,
1255 * so copy it if you want to use it later.
1257 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1260 e_connman_service_proxy_url_get(const E_Connman_Element *service, const char **url)
1262 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1263 EINA_SAFETY_ON_NULL_RETURN_VAL(url, EINA_FALSE);
1264 return e_connman_element_property_dict_get_stringshared
1265 (service, e_connman_prop_proxy, e_connman_prop_url, NULL, url);
1269 * Get property "Proxy.Servers" value.
1271 * If this property isn't found then @c EINA_FALSE is returned.
1272 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1273 * values shall be considered invalid.
1275 * List of proxy URIs. The URI without a protocol will be interpreted as the
1276 * generic proxy URI. All others will target a specific protocol and only once.
1277 * Example of generic proxy server entry would be like this:
1278 * "server.example.com:911".
1280 * Used when "manual" method is set.
1282 * @param service path to get property.
1283 * @param count return the number of elements in array.
1284 * @param servers array with pointers to internal strings. These
1285 * strings are not copied in any way, and they are granted to
1286 * be eina_stringshare instances, so one can use
1287 * eina_stringshare_ref() if he wants to save memory and cpu to
1288 * get an extra reference. The array itself is also NOT
1289 * allocated or copied, do not modify it. This pointer is just
1290 * set if return is @c EINA_TRUE.
1292 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1295 e_connman_service_proxy_servers_get(const E_Connman_Element *service, unsigned int *count, const char ***servers)
1297 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1298 EINA_SAFETY_ON_NULL_RETURN_VAL(servers, EINA_FALSE);
1299 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
1300 return e_connman_element_property_dict_strings_array_get_stringshared
1301 (service, e_connman_prop_proxy, e_connman_prop_servers, count, servers);
1305 * Get property "Proxy.Excludes" value.
1307 * If this property isn't found then @c EINA_FALSE is returned.
1308 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1309 * values shall be considered invalid.
1311 * List of hosts which can be accessed directly.
1313 * Used when "manual" method is set.
1315 * @param service path to get property.
1316 * @param count return the number of elements in array.
1317 * @param excludes array with pointers to internal strings. These
1318 * strings are not copied in any way, and they are granted to
1319 * be eina_stringshare instances, so one can use
1320 * eina_stringshare_ref() if he wants to save memory and cpu to
1321 * get an extra reference. The array itself is also NOT
1322 * allocated or copied, do not modify it. This pointer is just
1323 * set if return is @c EINA_TRUE.
1325 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1328 e_connman_service_proxy_excludes_get(const E_Connman_Element *service, unsigned int *count, const char ***excludes)
1330 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1331 EINA_SAFETY_ON_NULL_RETURN_VAL(excludes, EINA_FALSE);
1332 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
1333 return e_connman_element_property_dict_strings_array_get_stringshared
1334 (service, e_connman_prop_proxy, e_connman_prop_excludes, count, excludes);
1338 * Get property "Proxy.Configuration.Method" value.
1340 * Unlike Proxy.Configuration.Method, this is the user-set value, rather than
1343 * If this property isn't found then @c EINA_FALSE is returned.
1344 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1345 * values shall be considered invalid.
1347 * Possible values are "direct", "auto" and "manual".
1349 * @param service path to get property.
1350 * @param method where to store the property value, must be a pointer
1351 * to string (const char **), it will not be allocated or
1352 * copied and references will be valid until element changes,
1353 * so copy it if you want to use it later.
1355 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1358 e_connman_service_proxy_configuration_method_get(const E_Connman_Element *service, const char **method)
1360 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1361 EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
1362 return e_connman_element_property_dict_get_stringshared
1363 (service, e_connman_prop_proxy_configuration, e_connman_prop_method, NULL, method);
1367 * Get property "Proxy.Configuration.URL" value.
1369 * Unlike Proxy.URL, this is the user-set value, rather than the
1372 * If this property isn't found then @c EINA_FALSE is returned.
1373 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1374 * values shall be considered invalid.
1376 * Automatic proxy configuration URL. Used by "auto" method.
1378 * @param service path to get property.
1379 * @param url where to store the property value, must be a pointer
1380 * to string (const char **), it will not be allocated or
1381 * copied and references will be valid until element changes,
1382 * so copy it if you want to use it later.
1384 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1387 e_connman_service_proxy_configuration_url_get(const E_Connman_Element *service, const char **url)
1389 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1390 EINA_SAFETY_ON_NULL_RETURN_VAL(url, EINA_FALSE);
1391 return e_connman_element_property_dict_get_stringshared
1392 (service, e_connman_prop_proxy_configuration, e_connman_prop_url, NULL, url);
1396 * Get property "Proxy.Configuration.Servers" value.
1398 * Unlike Proxy.Servers, this is the user-set value, rather than the
1401 * If this property isn't found then @c EINA_FALSE is returned.
1402 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1403 * values shall be considered invalid.
1405 * List of proxy URIs. The URI without a protocol will be interpreted as the
1406 * generic proxy URI. All others will target a specific protocol and only once.
1407 * Example of generic proxy server entry would be like this:
1408 * "server.example.com:911".
1410 * Used when "manual" method is set.
1412 * @param service path to get property.
1413 * @param count return the number of elements in array.
1414 * @param servers array with pointers to internal strings. These
1415 * strings are not copied in any way, and they are granted to
1416 * be eina_stringshare instances, so one can use
1417 * eina_stringshare_ref() if he wants to save memory and cpu to
1418 * get an extra reference. The array itself is also NOT
1419 * allocated or copied, do not modify it. This pointer is just
1420 * set if return is @c EINA_TRUE.
1422 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1425 e_connman_service_proxy_configuration_servers_get(const E_Connman_Element *service, unsigned int *count, const char ***servers)
1427 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1428 EINA_SAFETY_ON_NULL_RETURN_VAL(servers, EINA_FALSE);
1429 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
1430 return e_connman_element_property_dict_strings_array_get_stringshared
1431 (service, e_connman_prop_proxy_configuration, e_connman_prop_servers, count, servers);
1435 * Get property "Proxy.Configuration.Excludes" value.
1437 * Unlike Proxy.Excludes, this is the user-set value, rather than the
1440 * If this property isn't found then @c EINA_FALSE is returned.
1441 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1442 * values shall be considered invalid.
1444 * List of hosts which can be accessed directly.
1446 * Used when "manual" method is set.
1448 * @param service path to get property.
1449 * @param count return the number of elements in array.
1450 * @param excludes array with pointers to internal strings. These
1451 * strings are not copied in any way, and they are granted to
1452 * be eina_stringshare instances, so one can use
1453 * eina_stringshare_ref() if he wants to save memory and cpu to
1454 * get an extra reference. The array itself is also NOT
1455 * allocated or copied, do not modify it. This pointer is just
1456 * set if return is @c EINA_TRUE.
1458 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1461 e_connman_service_proxy_configuration_excludes_get(const E_Connman_Element *service, unsigned int *count, const char ***excludes)
1463 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1464 EINA_SAFETY_ON_NULL_RETURN_VAL(excludes, EINA_FALSE);
1465 EINA_SAFETY_ON_NULL_RETURN_VAL(count, EINA_FALSE);
1466 return e_connman_element_property_dict_strings_array_get_stringshared
1467 (service, e_connman_prop_proxy_configuration, e_connman_prop_excludes, count, excludes);
1471 * Get property "Ethernet.Interface" value.
1473 * If this property isn't found then @c EINA_FALSE is returned.
1474 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1475 * values shall be considered invalid.
1477 * Interface name (for example eth0).
1479 * @param service path to get property.
1480 * @param iface where to store the property value, must be a pointer
1481 * to string (const char **), it will not be allocated or
1482 * copied and references will be valid until element changes,
1483 * so copy it if you want to use it later.
1485 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1488 e_connman_service_ethernet_interface_get(const E_Connman_Element *service, const char **iface)
1490 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1491 EINA_SAFETY_ON_NULL_RETURN_VAL(iface, EINA_FALSE);
1492 return e_connman_element_property_dict_get_stringshared
1493 (service, e_connman_prop_ethernet, e_connman_prop_interface, NULL, iface);
1497 * Get property "Ethernet.Method" value.
1499 * If this property isn't found then @c EINA_FALSE is returned.
1500 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1501 * values shall be considered invalid.
1503 * The Ethernet configuration method. Possible values here "auto" and "manual".
1505 * @param service path to get property.
1506 * @param method where to store the property value, must be a pointer
1507 * to string (const char **), it will not be allocated or
1508 * copied and references will be valid until element changes,
1509 * so copy it if you want to use it later.
1511 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1514 e_connman_service_ethernet_method_get(const E_Connman_Element *service, const char **method)
1516 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1517 EINA_SAFETY_ON_NULL_RETURN_VAL(method, EINA_FALSE);
1518 return e_connman_element_property_dict_get_stringshared
1519 (service, e_connman_prop_ethernet, e_connman_prop_method, NULL, method);
1523 * Get property "Ethernet.Speed" value.
1525 * If this property isn't found then @c EINA_FALSE is returned.
1526 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1527 * values shall be considered invalid.
1529 * Selected speed of the line. This information might not always be available.
1531 * @param service path to get property.
1532 * @param speed where to store the property value.
1534 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1537 e_connman_service_ethernet_speed_get(const E_Connman_Element *service, unsigned short *speed)
1539 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1540 EINA_SAFETY_ON_NULL_RETURN_VAL(speed, EINA_FALSE);
1541 return e_connman_element_property_dict_get_stringshared
1542 (service, e_connman_prop_ethernet, e_connman_prop_speed, NULL, speed);
1546 * Get property "Ethernet.Address" value.
1548 * If this property isn't found then @c EINA_FALSE is returned.
1549 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1550 * values shall be considered invalid.
1552 * The current configured Ethernet address (mac-address).
1554 * @param service path to get property.
1555 * @param address where to store the property value, must be a pointer
1556 * to string (const char **), it will not be allocated or
1557 * copied and references will be valid until element changes,
1558 * so copy it if you want to use it later.
1560 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1563 e_connman_service_ethernet_address_get(const E_Connman_Element *service, const char **address)
1565 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1566 EINA_SAFETY_ON_NULL_RETURN_VAL(address, EINA_FALSE);
1567 return e_connman_element_property_dict_get_stringshared
1568 (service, e_connman_prop_ethernet, e_connman_prop_address, NULL, address);
1572 * Get property "Ethernet.Duplex" value.
1574 * If this property isn't found then @c EINA_FALSE is returned.
1575 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1576 * values shall be considered invalid.
1578 * Selected duplex settings of the line. Possible values are "half" and "full".
1579 * This information might not always be available.
1581 * @param service path to get property.
1582 * @param duplex where to store the property value, must be a pointer
1583 * to string (const char **), it will not be allocated or
1584 * copied and references will be valid until element changes,
1585 * so copy it if you want to use it later.
1587 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1590 e_connman_service_ethernet_duplex_get(const E_Connman_Element *service, const char **duplex)
1592 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1593 EINA_SAFETY_ON_NULL_RETURN_VAL(duplex, EINA_FALSE);
1594 return e_connman_element_property_dict_get_stringshared
1595 (service, e_connman_prop_ethernet, e_connman_prop_duplex, NULL, duplex);
1599 * Get property "Ethernet.MTU" value.
1601 * If this property isn't found then @c EINA_FALSE is returned.
1602 * If @c EINA_FALSE is returned, then this call failed and parameter-returned
1603 * values shall be considered invalid.
1605 * The current configured Ethernet MTU.
1607 * @param service path to get property.
1608 * @param gateway where to store the property value, must be a pointer
1609 * to string (const char **), it will not be allocated or
1610 * copied and references will be valid until element changes,
1611 * so copy it if you want to use it later.
1613 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
1616 e_connman_service_ethernet_mtu_get(const E_Connman_Element *service, unsigned short *mtu)
1618 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1619 EINA_SAFETY_ON_NULL_RETURN_VAL(mtu, EINA_FALSE);
1620 return e_connman_element_property_dict_get_stringshared
1621 (service, e_connman_prop_ethernet, e_connman_prop_mtu, NULL, mtu);
1639 /* compat api's - quickly pulled in old implementations */
1641 e_connman_service_apn_get(const E_Connman_Element *service, const char **apn)
1643 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1644 EINA_SAFETY_ON_NULL_RETURN_VAL(apn, EINA_FALSE);
1645 return e_connman_element_property_get_stringshared
1646 (service, e_connman_prop_apn, NULL, apn);
1650 e_connman_service_apn_set(E_Connman_Element *service, const char *apn, E_DBus_Method_Return_Cb cb, const void *data)
1652 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1653 return e_connman_element_property_set_full
1654 (service, e_connman_prop_apn, DBUS_TYPE_STRING,
1659 e_connman_service_ethernet_netmask_get(const E_Connman_Element *service, const char **netmask)
1661 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1662 EINA_SAFETY_ON_NULL_RETURN_VAL(netmask, EINA_FALSE);
1663 return e_connman_element_property_dict_get_stringshared
1664 (service, e_connman_prop_ethernet, e_connman_prop_netmask, NULL, netmask);
1668 e_connman_service_mcc_get(const E_Connman_Element *service, const char **mcc)
1670 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1671 EINA_SAFETY_ON_NULL_RETURN_VAL(mcc, EINA_FALSE);
1672 return e_connman_element_property_get_stringshared
1673 (service, e_connman_prop_mcc, NULL, mcc);
1677 e_connman_service_mode_get(const E_Connman_Element *service, const char **mode)
1679 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1680 EINA_SAFETY_ON_NULL_RETURN_VAL(mode, EINA_FALSE);
1681 return e_connman_element_property_get_stringshared
1682 (service, e_connman_prop_mode, NULL, mode);
1686 e_connman_service_security_get(const E_Connman_Element *service, const char **security)
1688 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1689 EINA_SAFETY_ON_NULL_RETURN_VAL(security, EINA_FALSE);
1690 return e_connman_element_property_get_stringshared
1691 (service, e_connman_prop_security, NULL, security);
1695 e_connman_service_setup_required_get(const E_Connman_Element *service, Eina_Bool *setup_required)
1697 EINA_SAFETY_ON_NULL_RETURN_VAL(service, EINA_FALSE);
1698 EINA_SAFETY_ON_NULL_RETURN_VAL(setup_required, EINA_FALSE);
1699 return e_connman_element_property_get_stringshared
1700 (service, e_connman_prop_setup_required, NULL, setup_required);