summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaesub kim <taesub.kim@samsung.com>2016-01-19 22:42:42 -0800
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2016-01-19 22:42:42 -0800
commit91f6a0259bd1c2319d7dd5fb1b28924c398a69bd (patch)
treeb392ec0ce30c781ba92b477fc6c502b3c5145ff1
parent2686979357ca9fca8b65641f52aeef515a21bd3c (diff)
parent2de1944cb9184bd2ff37103d71d24db06314728f (diff)
downloadconnman-91f6a0259bd1c2319d7dd5fb1b28924c398a69bd.tar.gz
connman-91f6a0259bd1c2319d7dd5fb1b28924c398a69bd.tar.bz2
connman-91f6a0259bd1c2319d7dd5fb1b28924c398a69bd.zip
Merge "Added Connman VPN package" into tizen
-rwxr-xr-xMakefile.am30
-rwxr-xr-xpackaging/connman.spec102
-rwxr-xr-xvpn/main.c23
3 files changed, 145 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am
index 7fda2139..6e69fc4c 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -136,18 +136,32 @@ builtin_vpn_cflags =
sbin_PROGRAMS += vpn/connman-vpnd
-vpn_connman_vpnd_SOURCES = $(builtin_vpn_sources) \
+vpn_connman_vpnd_SOURCES = $(gdhcp_sources) $(builtin_vpn_sources) \
$(gweb_sources) vpn/vpn.ver vpn/main.c vpn/vpn.h \
- src/log.c src/error.c src/plugin.c src/task.c \
vpn/vpn-manager.c vpn/vpn-provider.c \
vpn/vpn-provider.h vpn/vpn-rtnl.h \
vpn/vpn-ipconfig.c src/inet.c vpn/vpn-rtnl.c \
- src/dbus.c src/storage.c src/ipaddress.c src/agent.c \
- vpn/vpn-agent.c vpn/vpn-agent.h src/inotify.c \
+ src/log.c src/error.c src/plugin.c src/task.c \
+ src/device.c src/network.c src/connection.c \
+ src/manager.c src/service.c \
+ src/clock.c src/timezone.c src/agent-connman.c \
+ src/agent.c src/notifier.c src/provider.c \
+ src/resolver.c src/ipconfig.c src/detect.c \
+ src/dhcp.c src/dhcpv6.c src/rtnl.c src/proxy.c \
+ src/utsname.c src/timeserver.c src/rfkill.c \
+ src/storage.c src/dbus.c src/config.c \
+ src/technology.c src/counter.c src/ntp.c \
+ src/session.c src/tethering.c src/wpad.c src/wispr.c \
+ src/stats.c src/iptables.c src/dnsproxy.c src/6to4.c \
+ src/ippool.c src/bridge.c src/nat.c src/ipaddress.c \
+ src/inotify.c src/firewall.c src/ipv6pd.c src/peer.c \
+ src/peer_service.c src/machine.c src/util.c \
+ vpn/vpn-agent.c vpn/vpn-agent.h \
vpn/vpn-config.c
vpn_connman_vpnd_LDADD = gdbus/libgdbus-internal.la $(builtin_vpn_libadd) \
- @GLIB_LIBS@ @DBUS_LIBS@ @GNUTLS_LIBS@ @TPKP_GNUTLS_LIBS@ \
+ @GLIB_LIBS@ @DBUS_LIBS@ @XTABLES_LIBS@ @GNUTLS_LIBS@ \
+ @TPKP_GNUTLS_LIBS@ \
-lresolv -ldl
vpn_connman_vpnd_LDFLAGS = -Wl,--export-dynamic \
@@ -204,9 +218,9 @@ AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
-DCONFIGDIR=\""$(configdir)\""
if VPN
-AM_CPPFLAGS = -I$(builddir)/include -I$(srcdir)/gdbus
+AM_CPPFLAGS = @TPKP_GNUTLS_CFLAGS@ -I$(builddir)/include -I$(srcdir)/gdbus
else
-AM_CPPFLAGS = -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
+AM_CPPFLAGS = @TPKP_GNUTLS_CFLAGS@ -I$(builddir)/include -I$(builddir)/src -I$(srcdir)/gdbus
endif
src_connmand_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
@@ -225,7 +239,7 @@ EXTRA_DIST = src/genbuiltin src/connman-dbus.conf src/connman-polkit.conf \
$(service_files_sources) scripts/connman.in
if VPN
-vpn_connman_vpnd_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
+vpn_connman_vpnd_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ @XTABLES_CFLAGS@ \
$(builtin_vpn_cflags) \
-DCONNMAN_PLUGIN_BUILTIN \
-DVPN_STATEDIR=\""$(vpn_statedir)"\" \
diff --git a/packaging/connman.spec b/packaging/connman.spec
index 2581a1b0..464a0c2e 100755
--- a/packaging/connman.spec
+++ b/packaging/connman.spec
@@ -1,11 +1,16 @@
+%bcond_with connman_openconnect
+%bcond_without connman_openvpn
+%bcond_without connman_vpnd
+
Name: connman
Version: 1.26
-Release: 6
+Release: 7
License: GPL-2.0+
Summary: Connection Manager
Url: http://connman.net
Group: Network & Connectivity/Connection Management
Source0: %{name}-%{version}.tar.gz
+BuildRequires: systemd-devel
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(libiptc)
@@ -13,6 +18,12 @@ BuildRequires: pkgconfig(xtables)
BuildRequires: pkgconfig(gnutls)
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(tpkp-gnutls)
+%if %{with connman_openconnect}
+BuildRequires: openconnect
+%endif
+%if %{with connman_openvpn}
+BuildRequires: openvpn
+%endif
BuildRequires: ca-certificates-devel
BuildRequires: readline-devel
#%systemd_requires
@@ -27,6 +38,35 @@ Requires: net-config
Connection Manager provides a daemon for managing Internet connections
within embedded devices running the Linux operating system.
+%if %{with connman_openconnect}
+%package plugin-openconnect
+Summary: Openconnect Support for Connman
+Requires: %{name} = %{version}
+Requires: openconnect
+
+%description plugin-openconnect
+Openconnect Support for Connman.
+%endif
+
+%if %{with connman_openvpn}
+%package plugin-openvpn
+Summary: Openvpn Support for Connman
+Requires: %{name} = %{version}
+Requires: openvpn
+
+%description plugin-openvpn
+OpenVPN support for Connman.
+%endif
+
+%if %{with connman_vpnd}
+%package connman-vpnd
+Summary: VPN Support for Connman
+BuildRequires: %{name} = %{version}
+Requires: %{name} = %{version}
+
+%description connman-vpnd
+Provides VPN support for Connman
+%endif
%package test
Summary: Test Scripts for Connection Manager
@@ -58,6 +98,10 @@ CFLAGS+=" -DTIZEN_SYS_CA_BUNDLE=\"%TZ_SYS_CA_BUNDLE\""
CFLAGS+=" -DTIZEN_TV_EXT"
%endif
+%if %{with connman_vpnd}
+VPN_CFLAGS+=" -DTIZEN_EXT -lsmack -Werror"
+%endif
+
chmod +x bootstrap
./bootstrap
%configure \
@@ -65,6 +109,12 @@ chmod +x bootstrap
--enable-client \
--enable-pacrunner \
--enable-wifi=builtin \
+%if %{with connman_openconnect}
+ --enable-openconnect \
+%endif
+%if %{with connman_openvpn}
+ --enable-openvpn \
+%endif
%if 0%{?enable_connman_features}
%connman_features \
%endif
@@ -118,15 +168,26 @@ cp src/connman.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/
mkdir -p %{buildroot}%{_datadir}/license
cp COPYING %{buildroot}%{_datadir}/license/connman
+%if %{with connman_vpnd}
+#%install_service multi-user.target.wants connman-vpn.service
+cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
+%endif
+
%post
#systemctl daemon-reload
#systemctl restart connman.service
+%if %{with connman_vpnd}
+systemctl restart connman-vpn.service
+%endif
%preun
#systemctl stop connman.service
+%if %{with connman_vpnd}
+systemctl stop connman-vpn.service
+%endif
%postun
-#systemctl daemon-reload
+systemctl daemon-reload
%docs_package
@@ -143,17 +204,54 @@ cp COPYING %{buildroot}%{_datadir}/license/connman
%{_sysconfdir}/dbus-1/system.d/*.conf
%attr(644,root,root) %{_libdir}/systemd/system/connman.service
%attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/connman.service
+%attr(644,root,root) %{_libdir}/systemd/system/connman-vpn.service
+%attr(644,root,root) %{_libdir}/systemd/system/multi-user.target.wants/connman-vpn.service
%if "%{?_lib}" == "lib64"
%attr(644,root,root) %{_unitdir}/connman.service
%attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman.service
+%attr(644,root,root) %{_unitdir}/connman-vpn.service
+%attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman-vpn.service
%endif
%{_datadir}/license/connman
%files test
+%manifest connman.manifest
%{_libdir}/%{name}/test/*
%files devel
+%manifest connman.manifest
%{_includedir}/*
%{_libdir}/pkgconfig/*.pc
+%if %{with connman_openconnect}
+%files plugin-openconnect
+%manifest %{name}.manifest
+%{_unitdir}/connman-vpn.service
+%{_libdir}/connman/plugins-vpn/openconnect.so
+%{_libdir}/connman/scripts/openconnect-script
+%{_datadir}/dbus-1/system-services/net.connman.vpn.service
+%endif
+
+%if %{with connman_openvpn}
+%files plugin-openvpn
+%manifest %{name}.manifest
+%{_unitdir}/connman-vpn.service
+%{_libdir}/%{name}/plugins-vpn/openvpn.so
+%{_libdir}/%{name}/scripts/openvpn-script
+%{_datadir}/dbus-1/system-services/net.connman.vpn.service
+%endif
+
+%if %{with connman_vpnd}
+%files connman-vpnd
+%manifest %{name}.manifest
+%{_sbindir}/connman-vpnd
+%{_unitdir}/connman-vpn.service
+#%{_unitdir}/multi-user.target.wants/connman-vpn.service
+%dir %{_libdir}/%{name}
+%dir %{_libdir}/%{name}/scripts
+%dir %{_libdir}/%{name}/plugins-vpn
+%config %{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
+%{_datadir}/dbus-1/system-services/net.connman.vpn.service
+%endif
+
diff --git a/vpn/main.c b/vpn/main.c
index ee88aacd..debb0ca4 100755
--- a/vpn/main.c
+++ b/vpn/main.c
@@ -45,6 +45,7 @@
#define CONFIGMAINFILE CONFIGDIR "/connman-vpn.conf"
#define DEFAULT_INPUT_REQUEST_TIMEOUT 300 * 1000
+#define DEFAULT_BROWSER_LAUNCH_TIMEOUT 300 * 1000
static GMainLoop *main_loop = NULL;
@@ -52,8 +53,10 @@ static unsigned int __terminated = 0;
static struct {
unsigned int timeout_inputreq;
+ unsigned int timeout_browserlaunch;
} connman_vpn_settings = {
.timeout_inputreq = DEFAULT_INPUT_REQUEST_TIMEOUT,
+ .timeout_browserlaunch = DEFAULT_BROWSER_LAUNCH_TIMEOUT,
};
static GKeyFile *load_config(const char *file)
@@ -224,6 +227,21 @@ static GOptionEntry options[] = {
{ NULL },
};
+bool connman_setting_get_bool(const char *key)
+{
+ return false;
+}
+
+char **connman_setting_get_string_list(const char *key)
+{
+ return NULL;
+}
+
+unsigned int *connman_setting_get_uint_list(const char *key)
+{
+ return NULL;
+}
+
/*
* This function will be called from generic src/agent.c code so we have
* to use connman_ prefix instead of vpn_ one.
@@ -233,6 +251,11 @@ unsigned int connman_timeout_input_request(void)
return connman_vpn_settings.timeout_inputreq;
}
+unsigned int connman_timeout_browser_launch(void)
+{
+ return connman_vpn_settings.timeout_browserlaunch;
+}
+
int main(int argc, char *argv[])
{
GOptionContext *context;