aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac28
-rw-r--r--src/Makefile_Ecore_Con.am14
-rw-r--r--src/lib/ecore_con/efl_net_control-none.c80
-rw-r--r--src/lib/ecore_con/efl_net_control.eo12
-rw-r--r--src/lib/ecore_con/efl_net_control_access_point-none.c208
-rw-r--r--src/lib/ecore_con/efl_net_control_technology-none.c65
-rw-r--r--src/lib/ecore_con/efl_net_session-none.c88
-rw-r--r--src/lib/ecore_con/efl_net_session.eo17
8 files changed, 509 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 6ebb2c9183..307675a3ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3044,6 +3044,26 @@ AC_DEFINE_IF([HAVE_ABSTRACT_SOCKETS],
[test "x${want_ecore_con_abstract_sockets}" = "xyes"],
[1], [Have abstract sockets namespace])
+efl_net_control_backend=none
+if test "${have_linux}" = "yes"; then
+ EFL_NET_CONTROL_BACKEND=connman
+fi
+
+AC_MSG_CHECKING([net-control backend to use])
+AC_ARG_WITH([net-control],
+ [AS_HELP_STRING([--with-net-control=BACKEND],[Specify which network control backend to be used by Efl.Net.Session and Efl.Net.Control. One of: connman or none])],
+ [EFL_NET_CONTROL_BACKEND="${withval}"])
+
+case "${EFL_NET_CONTROL_BACKEND}" in
+ connman|none)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown net-control backend --with-net-control=${EFL_NET_CONTROL_BACKEND}])
+ ;;
+esac
+AC_MSG_RESULT([${EFL_NET_CONTROL_BACKEND}])
+AC_SUBST(EFL_NET_CONTROL_BACKEND)
+
### Checks for programs
### Checks for libraries
@@ -3057,7 +3077,12 @@ EFL_INTERNAL_DEPEND_PKG([ECORE_CON], [eet])
EFL_INTERNAL_DEPEND_PKG([ECORE_CON], [eina])
EFL_INTERNAL_DEPEND_PKG([ECORE_CON], [ecore])
EFL_INTERNAL_DEPEND_PKG([ECORE_CON], [emile])
-EFL_INTERNAL_DEPEND_PKG([ECORE_CON], [eldbus])
+
+if test "${EFL_NET_CONTROL_BACKEND}" = "connman"; then
+ EFL_INTERNAL_DEPEND_PKG([ECORE_CON], [eldbus])
+fi
+AM_CONDITIONAL([EFL_NET_CONTROL_BACKEND_CONNMAN], [test "${EFL_NET_CONTROL_BACKEND}" = "connman"])
+AM_CONDITIONAL([EFL_NET_CONTROL_BACKEND_NONE], [test "${EFL_NET_CONTROL_BACKEND}" = "none"])
EFL_ADD_LIBS([ECORE_CON], [-lm])
@@ -3066,6 +3091,7 @@ EFL_OPTIONAL_DEPEND_PKG([ECORE_CON], [${want_systemd}], [SYSTEMD], [libsystemd])
EFL_ADD_FEATURE([ECORE_CON], [local-sockets], [${want_ecore_con_local_sockets}])
EFL_ADD_FEATURE([ECORE_CON], [abstract-sockets], [${want_ecore_con_abstract_sockets}])
EFL_ADD_FEATURE([ECORE_CON], [systemd-daemon], [${want_systemd}])
+EFL_ADD_FEATURE([ECORE_CON], [net-control], [${EFL_NET_CONTROL_BACKEND}])
EFL_EVAL_PKGS([ECORE_CON])
diff --git a/src/Makefile_Ecore_Con.am b/src/Makefile_Ecore_Con.am
index 6fcbcba492..d66186138c 100644
--- a/src/Makefile_Ecore_Con.am
+++ b/src/Makefile_Ecore_Con.am
@@ -108,13 +108,25 @@ lib/ecore_con/efl_net_server_udp_client.c \
lib/ecore_con/efl_net_socket_ssl.c \
lib/ecore_con/efl_net_ssl_context.c \
lib/ecore_con/efl_net_dialer_ssl.c \
-lib/ecore_con/efl_net_server_ssl.c \
+lib/ecore_con/efl_net_server_ssl.c
+
+if EFL_NET_CONTROL_BACKEND_CONNMAN
+lib_ecore_con_libecore_con_la_SOURCES += \
lib/ecore_con/efl_net-connman.h \
lib/ecore_con/efl_net-connman.c \
lib/ecore_con/efl_net_control_access_point-connman.c \
lib/ecore_con/efl_net_control_technology-connman.c \
lib/ecore_con/efl_net_control-connman.c \
lib/ecore_con/efl_net_session-connman.c
+endif
+
+if EFL_NET_CONTROL_BACKEND_NONE
+lib_ecore_con_libecore_con_la_SOURCES += \
+lib/ecore_con/efl_net_control_access_point-none.c \
+lib/ecore_con/efl_net_control_technology-none.c \
+lib/ecore_con/efl_net_control-none.c \
+lib/ecore_con/efl_net_session-none.c
+endif
EXTRA_DIST2 += lib/ecore_con/ecore_con_legacy.c
diff --git a/src/lib/ecore_con/efl_net_control-none.c b/src/lib/ecore_con/efl_net_control-none.c
new file mode 100644
index 0000000000..bb5f621642
--- /dev/null
+++ b/src/lib/ecore_con/efl_net_control-none.c
@@ -0,0 +1,80 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "Ecore_Con.h"
+#include "ecore_con_private.h"
+
+typedef struct
+{
+
+} Efl_Net_Control_Data;
+
+EOLIAN static void
+_efl_net_control_efl_object_destructor(Eo *obj, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, EFL_NET_CONTROL_CLASS));
+}
+
+EOLIAN static Efl_Object *
+_efl_net_control_efl_object_constructor(Eo *obj, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ INF("EFL compiled with --with-net-control=none");
+ return efl_constructor(efl_super(obj, EFL_NET_CONTROL_CLASS));
+}
+
+EOLIAN static Efl_Object *
+_efl_net_control_efl_object_finalize(Eo *obj, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ obj = efl_finalize(efl_super(obj, EFL_NET_CONTROL_CLASS));
+ efl_event_callback_call(obj, EFL_NET_CONTROL_EVENT_STATE_CHANGED, NULL);
+ return obj;
+}
+
+EOLIAN static void
+_efl_net_control_radios_offline_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED, Eina_Bool radios_offline EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_radios_offline_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Efl_Net_Control_State
+_efl_net_control_state_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ return EFL_NET_CONTROL_STATE_ONLINE; /* best default for unsupported, hope we're online */
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_access_points_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ return eina_list_iterator_new(NULL);
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_technologies_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ return eina_list_iterator_new(NULL);
+}
+
+EOLIAN static void
+_efl_net_control_agent_enabled_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED, Eina_Bool agent_enabled EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_agent_enabled_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_net_control_agent_reply(Eo *obj EINA_UNUSED, Efl_Net_Control_Data *pd EINA_UNUSED, const char *name EINA_UNUSED, const Eina_Slice *ssid EINA_UNUSED, const char *username EINA_UNUSED, const char *passphrase EINA_UNUSED, const char *wps EINA_UNUSED)
+{
+}
+
+#include "efl_net_control.eo.c"
diff --git a/src/lib/ecore_con/efl_net_control.eo b/src/lib/ecore_con/efl_net_control.eo
index 756564a36c..87b4fc0f84 100644
--- a/src/lib/ecore_con/efl_net_control.eo
+++ b/src/lib/ecore_con/efl_net_control.eo
@@ -98,6 +98,13 @@ class Efl.Net.Control (Efl.Loop_User) {
@.radios_offline property. This is usually called "airplane
mode" in some platforms.
+ Some platforms may not implement the backend for this class, in
+ such cases the system will report always @.state "online"
+ (@Efl.Net.Control.State.online) and iterators for
+ @.access_points and @.technologies will be empty (they will be
+ returned but won't contain any item).
+
+
@since 1.19
]]
events {
@@ -134,6 +141,11 @@ class Efl.Net.Control (Efl.Loop_User) {
point is connected but couldn't reach the internet;
- online means verified connectivity.
+
+ \@note if there is no backend for this class, then state
+ will be always online, however @.access_points and
+ @.technologies will be empty iterators (valid pointers
+ but no items in them).
]]
get { }
values {
diff --git a/src/lib/ecore_con/efl_net_control_access_point-none.c b/src/lib/ecore_con/efl_net_control_access_point-none.c
new file mode 100644
index 0000000000..8eba6dcb18
--- /dev/null
+++ b/src/lib/ecore_con/efl_net_control_access_point-none.c
@@ -0,0 +1,208 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "Ecore_Con.h"
+#include "ecore_con_private.h"
+
+typedef struct
+{
+
+} Efl_Net_Control_Access_Point_Data;
+
+EOLIAN static void
+_efl_net_control_access_point_efl_object_destructor(Eo *obj, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, EFL_NET_CONTROL_ACCESS_POINT_CLASS));
+}
+
+EOLIAN static Efl_Net_Control_Access_Point_State
+_efl_net_control_access_point_state_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static Efl_Net_Control_Access_Point_Error
+_efl_net_control_access_point_error_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static const char *
+_efl_net_control_access_point_name_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_efl_net_control_access_point_priority_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, unsigned int priority EINA_UNUSED)
+{
+}
+
+EOLIAN static unsigned int
+_efl_net_control_access_point_priority_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static Efl_Net_Control_Technology *
+_efl_net_control_access_point_technology_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static uint8_t
+_efl_net_control_access_point_strength_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_access_point_roaming_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_net_control_access_point_auto_connect_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Eina_Bool auto_connect EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_access_point_auto_connect_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_access_point_remembered_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_access_point_immutable_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static Efl_Net_Control_Access_Point_Security
+_efl_net_control_access_point_security_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_access_point_name_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_access_point_time_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_access_point_domains_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_efl_net_control_access_point_ipv4_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv4_Method *method EINA_UNUSED, const char **address EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_ipv6_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv6_Method *method EINA_UNUSED, const char **address EINA_UNUSED, uint8_t *prefix_length EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_proxy_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Proxy_Method *method EINA_UNUSED, const char **url EINA_UNUSED, Eina_Iterator **servers EINA_UNUSED, Eina_Iterator **excludes EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_name_servers_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Eina_Iterator *name_servers EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_access_point_configuration_name_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_time_servers_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Eina_Iterator *time_servers EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_access_point_configuration_time_servers_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_domains_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Eina_Iterator *domains EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Iterator *
+_efl_net_control_access_point_configuration_domains_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_ipv4_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv4_Method method EINA_UNUSED, const char *address EINA_UNUSED, const char *netmask EINA_UNUSED, const char *gateway EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_ipv4_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv4_Method *method EINA_UNUSED, const char **address EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_ipv6_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv6_Method method EINA_UNUSED, const char *address EINA_UNUSED, uint8_t prefix_length EINA_UNUSED, const char *netmask EINA_UNUSED, const char *gateway EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_ipv6_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Ipv6_Method *method EINA_UNUSED, const char **address EINA_UNUSED, uint8_t *prefix_length EINA_UNUSED, const char **netmask EINA_UNUSED, const char **gateway EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_proxy_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Proxy_Method method EINA_UNUSED, const char *url EINA_UNUSED, Eina_Iterator *servers EINA_UNUSED, Eina_Iterator *excludes EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_configuration_proxy_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED, Efl_Net_Control_Access_Point_Proxy_Method *method EINA_UNUSED, const char **url EINA_UNUSED, Eina_Iterator **servers EINA_UNUSED, Eina_Iterator **excludes EINA_UNUSED)
+{
+}
+
+EOLIAN static Efl_Future *
+_efl_net_control_access_point_connect(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_efl_net_control_access_point_disconnect(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_access_point_forget(Eo *obj EINA_UNUSED, Efl_Net_Control_Access_Point_Data *pd EINA_UNUSED)
+{
+}
+
+#include "efl_net_control_access_point.eo.c"
diff --git a/src/lib/ecore_con/efl_net_control_technology-none.c b/src/lib/ecore_con/efl_net_control_technology-none.c
new file mode 100644
index 0000000000..3f1412fc12
--- /dev/null
+++ b/src/lib/ecore_con/efl_net_control_technology-none.c
@@ -0,0 +1,65 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "Ecore_Con.h"
+#include "ecore_con_private.h"
+
+typedef struct
+{
+
+} Efl_Net_Control_Technology_Data;
+
+EOLIAN static void
+_efl_net_control_technology_efl_object_destructor(Eo *obj, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, EFL_NET_CONTROL_TECHNOLOGY_CLASS));
+}
+
+EOLIAN static void
+_efl_net_control_technology_powered_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED, Eina_Bool powered EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_technology_powered_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static void
+_efl_net_control_technology_tethering_set(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED, Eina_Bool enabled EINA_UNUSED, const char *identifier EINA_UNUSED, const char *passphrase EINA_UNUSED)
+{
+}
+
+EOLIAN static void
+_efl_net_control_technology_tethering_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED, Eina_Bool *enabled EINA_UNUSED, const char **identifier EINA_UNUSED, const char **passphrase EINA_UNUSED)
+{
+}
+
+EOLIAN static Eina_Bool
+_efl_net_control_technology_connected_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+{
+ return EINA_FALSE;
+}
+
+EOLIAN static const char *
+_efl_net_control_technology_name_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static Efl_Net_Control_Technology_Type
+_efl_net_control_technology_type_get(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+{
+ return 0;
+}
+
+EOLIAN static Efl_Future *
+_efl_net_control_technology_scan(Eo *obj EINA_UNUSED, Efl_Net_Control_Technology_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+#include "efl_net_control_technology.eo.c"
diff --git a/src/lib/ecore_con/efl_net_session-none.c b/src/lib/ecore_con/efl_net_session-none.c
new file mode 100644
index 0000000000..6545520dda
--- /dev/null
+++ b/src/lib/ecore_con/efl_net_session-none.c
@@ -0,0 +1,88 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "Ecore_Con.h"
+#include "ecore_con_private.h"
+
+typedef struct
+{
+
+} Efl_Net_Session_Data;
+
+EOLIAN static void
+_efl_net_session_efl_object_destructor(Eo *obj, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ efl_destructor(efl_super(obj, EFL_NET_SESSION_CLASS));
+}
+
+EOLIAN static Efl_Object *
+_efl_net_session_efl_object_constructor(Eo *obj, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ INF("EFL compiled with --with-net-control=none");
+ return efl_constructor(efl_super(obj, EFL_NET_SESSION_CLASS));
+}
+
+EOLIAN static Efl_Object *
+_efl_net_session_efl_object_finalize(Eo *obj, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ obj = efl_finalize(efl_super(obj, EFL_NET_SESSION_CLASS));
+ efl_event_callback_call(obj, EFL_NET_SESSION_EVENT_CHANGED, NULL);
+ return obj;
+}
+
+EOLIAN static const char *
+_efl_net_session_name_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static Efl_Net_Session_State
+_efl_net_session_state_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ return EFL_NET_SESSION_STATE_ONLINE; /* best default for unsupported, hope we're online */
+}
+
+EOLIAN static Efl_Net_Session_Technology
+_efl_net_session_technology_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ return EFL_NET_SESSION_TECHNOLOGY_UNKNOWN;
+}
+
+EOLIAN static const char *
+_efl_net_session_interface_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ return NULL;
+}
+
+EOLIAN static void
+_efl_net_session_ipv4_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED, const char **address, const char **netmask, const char **gateway)
+{
+ if (address) *address = NULL;
+ if (netmask) *netmask = NULL;
+ if (gateway) *gateway = NULL;
+}
+
+EOLIAN static void
+_efl_net_session_ipv6_get(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED, const char **address, uint8_t *prefix_length, const char **netmask, const char **gateway)
+{
+ if (address) *address = NULL;
+ if (prefix_length) *prefix_length = 0;
+ if (netmask) *netmask = NULL;
+ if (gateway) *gateway = NULL;
+}
+
+EOLIAN static void
+_efl_net_session_connect(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED, Eina_Bool online_required EINA_UNUSED, Efl_Net_Session_Technology technologies_allowed EINA_UNUSED)
+{
+ INF("EFL compiled with --with-net-control=none, cannot connect.");
+}
+
+EOLIAN static void
+_efl_net_session_disconnect(Eo *obj EINA_UNUSED, Efl_Net_Session_Data *pd EINA_UNUSED)
+{
+ INF("EFL compiled with --with-net-control=none, cannot disconnect.");
+}
+
+#include "efl_net_session.eo.c"
diff --git a/src/lib/ecore_con/efl_net_session.eo b/src/lib/ecore_con/efl_net_session.eo
index af792a256a..9a449ec2de 100644
--- a/src/lib/ecore_con/efl_net_session.eo
+++ b/src/lib/ecore_con/efl_net_session.eo
@@ -35,6 +35,15 @@ class Efl.Net.Session (Efl.Loop_User) {
to the internet, as well as if just local networking is enough
or validated internet access is required.
+ Some platforms may not implement the backend for this class, in
+ such cases the system will report always @.state "online"
+ (@Efl.Net.Session.State.online) and other properties will be
+ NULL, such as @.name, @.interface, @.ipv4 and @.ipv6; as well as
+ @.technology is set to @Efl.Net.Session.Technology.unknown. Thus
+ if there is need to detect for an actual backend, check if the
+ state is online but those properties are NULL or technology is
+ unknown.
+
\@note the @.connect method is subject to backend policy. For
instance, ConnMan uses
https://github.com/aldebaran/connman/blob/master/doc/session-policy-format.txt
@@ -84,7 +93,13 @@ class Efl.Net.Session (Efl.Loop_User) {
}
@property state {
- [[If the session connectivity is offline, local or online.]]
+ [[If the session connectivity is offline, local or online.
+
+ \@note if there is no backend for this class, then state
+ will be always online, however @.technology will be
+ unknown, @.interface, @.name, @.ipv4 and @.ipv6 will be
+ NULL.
+ ]]
get { }
values {
state: Efl.Net.Session.State; [[Network session state]]