diff --git a/.gitignore b/.gitignore index 8cc07de4..46cd4c88 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ *.[oa] *.dll *.exe +*.exe.* *.mak *.obj *.pyc *.so *~ +*.idb .deps Makefile Makefile.in @@ -21,21 +23,11 @@ config.sub configure configure.h depcomp -dist/ -install-sh -install-win32/settings -install-win32/tmp -missing -openvpn -openvpn.8.html -openvpn.exe.manifest -openvpnserv.exe.manifest -openvpn.spec stamp-h1 -t_client.sh -tap-win32/SOURCES -tap-win32/amd64/ -tap-win32/i386/ -tapinstall/ -vc90.idb -win/version_m4_vars.tmp +install-sh +missing + +doc/openvpn.8.html +distro/rpm/openvpn.spec +tests/t_client.sh +src/openvpn/openvpn diff --git a/.svnignore b/.svnignore deleted file mode 100644 index c02d2b8d..00000000 --- a/.svnignore +++ /dev/null @@ -1,20 +0,0 @@ -*.o -*.obj -config.status -config.log -config.guess -aclocal.m4 -install-sh -Makefile.in -openvpn -depcomp -config.h -.deps -Makefile -config.h.in -configure -config.sub -openvpn.spec -stamp-h1 -autom4te.cache -missing diff --git a/Makefile.am b/Makefile.am index a8ff4572..850074b3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,7 @@ # # Copyright (C) 2002-2010 OpenVPN Technologies, Inc. # Copyright (C) 2010 David Sommerseth +# Copyright (C) 2006-2012 Alon Bar-Lev # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 @@ -34,30 +35,13 @@ MAINTAINERCLEANFILES = \ $(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ $(srcdir)/depcomp $(srcdir)/aclocal.m4 \ - $(srcdir)/config.guess $(srcdir)/config.sub \ - $(srcdir)/openvpn.spec -CLEANFILES = openvpn.8.html + $(srcdir)/config.guess $(srcdir)/config.sub EXTRA_DIST = \ - sample-config-files \ - sample-keys \ - sample-scripts \ - suse \ contrib \ - debug \ - plugins + debug -SUBDIRS = service-win32 - -TESTS = t_client.sh t_lpback.sh t_cltsrv.sh -sbin_PROGRAMS = openvpn - -dist_doc_DATA = \ - management/management-notes.txt - -dist_noinst_SCRIPTS = \ - $(TESTS) \ - t_cltsrv-down.sh +SUBDIRS = distro include src sample doc tests dist_doc_DATA = \ COPYRIGHT.GPL \ @@ -65,101 +49,12 @@ dist_doc_DATA = \ dist_noinst_DATA = \ .gitignore \ - openvpn.spec \ PORTS \ README.IPv6 TODO.IPv6 \ - README.polarssl \ + README.polarssl if WIN32 dist_doc_DATA += INSTALL-win32.txt else dist_noinst_DATA += INSTALL-win32.txt endif - -openvpn_SOURCES = \ - base64.c base64.h \ - basic.h \ - buffer.c buffer.h \ - circ_list.h \ - clinat.c clinat.h \ - common.h \ - compat.h compat.c \ - crypto.c crypto.h crypto_backend.h \ - crypto_openssl.c crypto_openssl.h \ - crypto_polarssl.c crypto_polarssl.h \ - dhcp.c dhcp.h \ - errlevel.h \ - error.c error.h \ - event.c event.h \ - fdmisc.c fdmisc.h \ - forward.c forward.h forward-inline.h \ - fragment.c fragment.h \ - gremlin.c gremlin.h \ - helper.c helper.h \ - httpdigest.c httpdigest.h \ - lladdr.c lladdr.h \ - init.c init.h \ - integer.h \ - interval.c interval.h \ - list.c list.h \ - lzo.c lzo.h \ - manage.c manage.h \ - mbuf.c mbuf.h \ - memdbg.h \ - misc.c misc.h \ - mroute.c mroute.h \ - mss.c mss.h \ - mstats.c mstats.h \ - mtcp.c mtcp.h \ - mtu.c mtu.h \ - mudp.c mudp.h \ - multi.c multi.h \ - ntlm.c ntlm.h \ - occ.c occ.h occ-inline.h \ - pkcs11.c pkcs11.h pkcs11_backend.h \ - pkcs11_openssl.c \ - pkcs11_polarssl.c \ - openvpn.c openvpn.h \ - openvpn-plugin.h \ - options.c options.h \ - otime.c otime.h \ - packet_id.c packet_id.h \ - perf.c perf.h \ - pf.c pf.h pf-inline.h \ - ping.c ping.h ping-inline.h \ - plugin.c plugin.h \ - pool.c pool.h \ - proto.c proto.h \ - proxy.c proxy.h \ - ps.c ps.h \ - push.c push.h \ - pushlist.h \ - reliable.c reliable.h \ - route.c route.h \ - schedule.c schedule.h \ - session_id.c session_id.h \ - shaper.c shaper.h \ - sig.c sig.h \ - socket.c socket.h \ - socks.c socks.h \ - ssl.c ssl.h ssl_backend.h \ - ssl_openssl.c ssl_openssl.h \ - ssl_polarssl.c ssl_polarssl.h \ - ssl_common.h \ - ssl_verify.c ssl_verify.h ssl_verify_backend.h \ - ssl_verify_openssl.c ssl_verify_openssl.h \ - ssl_verify_polarssl.c ssl_verify_polarssl.h \ - status.c status.h \ - syshead.h \ - tun.c tun.h tap-windows.h \ - win32.h win32.c \ - cryptoapi.h cryptoapi.c - -if WIN32 -dist_noinst_DATA += openvpn.8 -nodist_html_DATA = openvpn.8.html -openvpn.8.html: $(srcdir)/openvpn.8 - $(MAN2HTML) < $(srcdir)/openvpn.8 > openvpn.8.html -else -dist_man_MANS = openvpn.8 -endif diff --git a/configure.ac b/configure.ac index 0b703256..fe0fbab7 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ AC_INIT([PRODUCT_NAME], [PRODUCT_VERSION], [PRODUCT_BUGREPORT], [PRODUCT_TARNAME m4_include(compat.m4) AC_CONFIG_AUX_DIR([.]) AM_CONFIG_HEADER([config.h]) -AC_CONFIG_SRCDIR([syshead.h]) +AC_CONFIG_SRCDIR([src/openvpn/syshead.h]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE AC_CANONICAL_HOST @@ -928,10 +928,18 @@ AC_SUBST([TAP_WIN_MIN_MINOR]) AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) -AC_CONFIG_FILES([t_client.sh], [chmod +x t_client.sh]) AC_CONFIG_FILES([ Makefile - openvpn.spec - service-win32/Makefile + distro/Makefile + distro/rpm/Makefile + distro/rpm/openvpn.spec + include/Makefile + src/Makefile + src/openvpn/Makefile + src/openvpnserv/Makefile + tests/Makefile + sample/Makefile + doc/Makefile ]) +AC_CONFIG_FILES([tests/t_client.sh], [chmod +x tests/t_client.sh]) AC_OUTPUT diff --git a/doval b/debug/doval similarity index 100% rename from doval rename to debug/doval diff --git a/dovalns b/debug/dovalns similarity index 100% rename from dovalns rename to debug/dovalns diff --git a/distro/Makefile.am b/distro/Makefile.am new file mode 100644 index 00000000..2dd6a6ee --- /dev/null +++ b/distro/Makefile.am @@ -0,0 +1,15 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +SUBDIRS = rpm diff --git a/distro/rpm/Makefile.am b/distro/rpm/Makefile.am new file mode 100644 index 00000000..536061dd --- /dev/null +++ b/distro/rpm/Makefile.am @@ -0,0 +1,18 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +dist_noinst_DATA = \ + openvpn.spec \ + openvpn.init.d.rhel \ + openvpn.init.d.suse diff --git a/sample-scripts/openvpn.init b/distro/rpm/openvpn.init.d.rhel similarity index 100% rename from sample-scripts/openvpn.init rename to distro/rpm/openvpn.init.d.rhel diff --git a/suse/openvpn.init b/distro/rpm/openvpn.init.d.suse similarity index 99% rename from suse/openvpn.init rename to distro/rpm/openvpn.init.d.suse index 8f1060aa..2bac7f32 100644 --- a/suse/openvpn.init +++ b/distro/rpm/openvpn.init.d.suse @@ -82,7 +82,7 @@ # # Location of openvpn binary -openvpn="/usr/local/sbin/openvpn" +openvpn="/usr/sbin/openvpn" # Lockfile lock="/var/lock/subsys/openvpn" diff --git a/openvpn.spec.in b/distro/rpm/openvpn.spec.in similarity index 80% rename from openvpn.spec.in rename to distro/rpm/openvpn.spec.in index 6283d625..455f7395 100644 --- a/openvpn.spec.in +++ b/distro/rpm/openvpn.spec.in @@ -68,6 +68,13 @@ support for dynamic IP addresses and DHCP, scalability to hundreds or thousands of users, and portability to most major OS platforms. +%package devel +Summary: OpenVPN is a robust and highly flexible VPN daemon by James Yonan. +Group: Applications/Internet +Requires: %{name} +%description devel +Development support for OpenVPN. + # # Define vendor type # @@ -99,17 +106,22 @@ and portability to most major OS platforms. %setup -q %build -%configure --disable-dependency-tracking %{?with_password_save:--enable-password-save} %{?without_lzo:--disable-lzo} %{?with_kerberos:--with-ssl-headers=/usr/kerberos/include} +%configure \ + --disable-dependency-tracking \ + --docdir="%{_docdir}/%{name}-%{version}" \ + %{?with_password_save:--enable-password-save} \ + %{?without_lzo:--disable-lzo} \ + %{?with_kerberos:--with-ssl-headers=/usr/kerberos/include} %__make # Build down-root plugin -pushd plugins/down-root +pushd src/plugins/down-root %__make popd # Build auth-pam plugin %if %{build_auth_pam} -pushd plugins/auth-pam +pushd src/plugins/auth-pam %__make popd %endif @@ -124,17 +136,15 @@ popd # Install init script %if "%{VENDOR}" == "SuSE" -%__install -c -d -m 755 %{buildroot}/etc/init.d -%__sed -e 's#openvpn=\"/usr/local/sbin/openvpn\"#openvpn=\"/usr/sbin/openvpn\"#' < suse/%{name}.init > %{_tmppath}/%{name}.init -%__install -c -m 755 %{_tmppath}/%{name}.init %{buildroot}/etc/init.d/%{name} -%__rm %{_tmppath}/%{name}.init +%__install -c -d -m 755 "%{buildroot}/etc/init.d" +%__install -c -m 755 "distro/rpm/%{name}.init.d.suse" "%{buildroot}/etc/init.d/%{name}" %else -%__install -c -d -m 755 %{buildroot}/etc/rc.d/init.d -%__install -c -m 755 sample-scripts/%{name}.init %{buildroot}/etc/rc.d/init.d/%{name} +%__install -c -d -m 755 "%{buildroot}/etc/rc.d/init.d" +%__install -c -m 755 distro/rpm/%{name}.init.d.rhel "%{buildroot}/etc/rc.d/init.d/%{name}" %endif # Install /etc/openvpn -%__install -c -d -m 755 %{buildroot}/etc/%{name} +%__install -c -d -m 755 "%{buildroot}/etc/%{name}" # # Build /usr/share/openvpn @@ -146,23 +156,23 @@ popd # Install the plugins # -%__mkdir_p %{buildroot}%{_datadir}/%{name}/plugins/lib +%__mkdir_p "%{buildroot}%{_datadir}/%{name}/plugins/lib" for pi in auth-pam down-root; do - %__mv -f plugins/$pi/README plugins/README.$pi - if [ -e plugins/$pi/openvpn-$pi.so ]; then - %__install -c -m 755 plugins/$pi/openvpn-$pi.so %{buildroot}%{_datadir}/openvpn/plugins/lib/openvpn-$pi.so + %__mv -f src/plugins/$pi/README src/plugins/README.$pi + if [ -e src/plugins/$pi/openvpn-$pi.so ]; then + %__install -c -m 755 src/plugins/$pi/openvpn-$pi.so "%{buildroot}%{_datadir}/openvpn/plugins/lib/openvpn-$pi.so" fi done -%__mv -f plugins/README plugins/README.plugins +%__mv -f src/plugins/README src/plugins/README.plugins # # Clean section # %clean -[ %{buildroot} != "/" ] && rm -rf %{buildroot} +[ %{buildroot} != "/" ] && rm -rf "%{buildroot}" # # On Linux 2.4, make the device node @@ -215,7 +225,11 @@ fi %endif # Install extra %doc stuff -%doc contrib/ sample-*/ plugins/README.* +%doc contrib/ sample/ src/plugins/README.* + +%files devel +%defattr(-,root,root) +%{_includedir}/* %changelog * Thu Jul 30 2009 David Sommerseth diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 00000000..46687b29 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,28 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +CLEANFILES = openvpn.8.html + +dist_doc_DATA = \ + management-notes.txt + +if WIN32 +dist_noinst_DATA = openvpn.8 +nodist_html_DATA = openvpn.8.html +openvpn.8.html: $(srcdir)/openvpn.8 + $(MAN2HTML) < $(srcdir)/openvpn.8 > openvpn.8.html +else +dist_man_MANS = openvpn.8 +endif + diff --git a/doxygen/doc_compression.h b/doc/doxygen/doc_compression.h similarity index 100% rename from doxygen/doc_compression.h rename to doc/doxygen/doc_compression.h diff --git a/doxygen/doc_control_processor.h b/doc/doxygen/doc_control_processor.h similarity index 100% rename from doxygen/doc_control_processor.h rename to doc/doxygen/doc_control_processor.h diff --git a/doxygen/doc_control_tls.h b/doc/doxygen/doc_control_tls.h similarity index 100% rename from doxygen/doc_control_tls.h rename to doc/doxygen/doc_control_tls.h diff --git a/doxygen/doc_data_control.h b/doc/doxygen/doc_data_control.h similarity index 100% rename from doxygen/doc_data_control.h rename to doc/doxygen/doc_data_control.h diff --git a/doxygen/doc_data_crypto.h b/doc/doxygen/doc_data_crypto.h similarity index 100% rename from doxygen/doc_data_crypto.h rename to doc/doxygen/doc_data_crypto.h diff --git a/doxygen/doc_eventloop.h b/doc/doxygen/doc_eventloop.h similarity index 100% rename from doxygen/doc_eventloop.h rename to doc/doxygen/doc_eventloop.h diff --git a/doxygen/doc_external_multiplexer.h b/doc/doxygen/doc_external_multiplexer.h similarity index 100% rename from doxygen/doc_external_multiplexer.h rename to doc/doxygen/doc_external_multiplexer.h diff --git a/doxygen/doc_fragmentation.h b/doc/doxygen/doc_fragmentation.h similarity index 100% rename from doxygen/doc_fragmentation.h rename to doc/doxygen/doc_fragmentation.h diff --git a/doxygen/doc_internal_multiplexer.h b/doc/doxygen/doc_internal_multiplexer.h similarity index 100% rename from doxygen/doc_internal_multiplexer.h rename to doc/doxygen/doc_internal_multiplexer.h diff --git a/doxygen/doc_key_generation.h b/doc/doxygen/doc_key_generation.h similarity index 100% rename from doxygen/doc_key_generation.h rename to doc/doxygen/doc_key_generation.h diff --git a/doxygen/doc_mainpage.h b/doc/doxygen/doc_mainpage.h similarity index 100% rename from doxygen/doc_mainpage.h rename to doc/doxygen/doc_mainpage.h diff --git a/doxygen/doc_memory_management.h b/doc/doxygen/doc_memory_management.h similarity index 100% rename from doxygen/doc_memory_management.h rename to doc/doxygen/doc_memory_management.h diff --git a/doxygen/doc_protocol_overview.h b/doc/doxygen/doc_protocol_overview.h similarity index 100% rename from doxygen/doc_protocol_overview.h rename to doc/doxygen/doc_protocol_overview.h diff --git a/doxygen/doc_reliable.h b/doc/doxygen/doc_reliable.h similarity index 100% rename from doxygen/doc_reliable.h rename to doc/doxygen/doc_reliable.h diff --git a/doxygen/doc_tunnel_state.h b/doc/doxygen/doc_tunnel_state.h similarity index 100% rename from doxygen/doc_tunnel_state.h rename to doc/doxygen/doc_tunnel_state.h diff --git a/doxygen/openvpn.doxyfile b/doc/doxygen/openvpn.doxyfile similarity index 100% rename from doxygen/openvpn.doxyfile rename to doc/doxygen/openvpn.doxyfile diff --git a/management/management-notes.txt b/doc/management-notes.txt similarity index 100% rename from management/management-notes.txt rename to doc/management-notes.txt diff --git a/openvpn.8 b/doc/openvpn.8 similarity index 100% rename from openvpn.8 rename to doc/openvpn.8 diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 00000000..36eeb6c1 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,17 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +dist_noinst_HEADERS = tap-windows.h + +include_HEADERS = openvpn-plugin.h diff --git a/openvpn-plugin.h b/include/openvpn-plugin.h similarity index 100% rename from openvpn-plugin.h rename to include/openvpn-plugin.h diff --git a/tap-windows.h b/include/tap-windows.h similarity index 100% rename from tap-windows.h rename to include/tap-windows.h diff --git a/plugins/auth-pam/.svnignore b/plugins/auth-pam/.svnignore deleted file mode 100644 index 140f8cf8..00000000 --- a/plugins/auth-pam/.svnignore +++ /dev/null @@ -1 +0,0 @@ -*.so diff --git a/sample/Makefile.am b/sample/Makefile.am new file mode 100644 index 00000000..5df8d9ce --- /dev/null +++ b/sample/Makefile.am @@ -0,0 +1,19 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +EXTRA_DIST = \ + sample-config-files \ + sample-windows \ + sample-keys \ + sample-scripts diff --git a/sample-config-files/README b/sample/sample-config-files/README similarity index 100% rename from sample-config-files/README rename to sample/sample-config-files/README diff --git a/sample-config-files/client.conf b/sample/sample-config-files/client.conf similarity index 100% rename from sample-config-files/client.conf rename to sample/sample-config-files/client.conf diff --git a/sample-config-files/firewall.sh b/sample/sample-config-files/firewall.sh similarity index 100% rename from sample-config-files/firewall.sh rename to sample/sample-config-files/firewall.sh diff --git a/sample-config-files/home.up b/sample/sample-config-files/home.up similarity index 100% rename from sample-config-files/home.up rename to sample/sample-config-files/home.up diff --git a/sample-config-files/loopback-client b/sample/sample-config-files/loopback-client similarity index 100% rename from sample-config-files/loopback-client rename to sample/sample-config-files/loopback-client diff --git a/sample-config-files/loopback-server b/sample/sample-config-files/loopback-server similarity index 100% rename from sample-config-files/loopback-server rename to sample/sample-config-files/loopback-server diff --git a/sample-config-files/office.up b/sample/sample-config-files/office.up similarity index 100% rename from sample-config-files/office.up rename to sample/sample-config-files/office.up diff --git a/sample-config-files/openvpn-shutdown.sh b/sample/sample-config-files/openvpn-shutdown.sh similarity index 100% rename from sample-config-files/openvpn-shutdown.sh rename to sample/sample-config-files/openvpn-shutdown.sh diff --git a/sample-config-files/openvpn-startup.sh b/sample/sample-config-files/openvpn-startup.sh similarity index 100% rename from sample-config-files/openvpn-startup.sh rename to sample/sample-config-files/openvpn-startup.sh diff --git a/sample-config-files/server.conf b/sample/sample-config-files/server.conf similarity index 100% rename from sample-config-files/server.conf rename to sample/sample-config-files/server.conf diff --git a/sample-config-files/static-home.conf b/sample/sample-config-files/static-home.conf similarity index 100% rename from sample-config-files/static-home.conf rename to sample/sample-config-files/static-home.conf diff --git a/sample-config-files/static-office.conf b/sample/sample-config-files/static-office.conf similarity index 100% rename from sample-config-files/static-office.conf rename to sample/sample-config-files/static-office.conf diff --git a/sample-config-files/tls-home.conf b/sample/sample-config-files/tls-home.conf similarity index 100% rename from sample-config-files/tls-home.conf rename to sample/sample-config-files/tls-home.conf diff --git a/sample-config-files/tls-office.conf b/sample/sample-config-files/tls-office.conf similarity index 100% rename from sample-config-files/tls-office.conf rename to sample/sample-config-files/tls-office.conf diff --git a/sample-config-files/xinetd-client-config b/sample/sample-config-files/xinetd-client-config similarity index 100% rename from sample-config-files/xinetd-client-config rename to sample/sample-config-files/xinetd-client-config diff --git a/sample-config-files/xinetd-server-config b/sample/sample-config-files/xinetd-server-config similarity index 100% rename from sample-config-files/xinetd-server-config rename to sample/sample-config-files/xinetd-server-config diff --git a/sample-keys/README b/sample/sample-keys/README similarity index 100% rename from sample-keys/README rename to sample/sample-keys/README diff --git a/sample-keys/ca.crt b/sample/sample-keys/ca.crt similarity index 100% rename from sample-keys/ca.crt rename to sample/sample-keys/ca.crt diff --git a/sample-keys/ca.key b/sample/sample-keys/ca.key similarity index 100% rename from sample-keys/ca.key rename to sample/sample-keys/ca.key diff --git a/sample-keys/client.crt b/sample/sample-keys/client.crt similarity index 100% rename from sample-keys/client.crt rename to sample/sample-keys/client.crt diff --git a/sample-keys/client.key b/sample/sample-keys/client.key similarity index 100% rename from sample-keys/client.key rename to sample/sample-keys/client.key diff --git a/sample-keys/dh1024.pem b/sample/sample-keys/dh1024.pem similarity index 100% rename from sample-keys/dh1024.pem rename to sample/sample-keys/dh1024.pem diff --git a/sample-keys/pass.crt b/sample/sample-keys/pass.crt similarity index 100% rename from sample-keys/pass.crt rename to sample/sample-keys/pass.crt diff --git a/sample-keys/pass.key b/sample/sample-keys/pass.key similarity index 100% rename from sample-keys/pass.key rename to sample/sample-keys/pass.key diff --git a/sample-keys/pkcs12.p12 b/sample/sample-keys/pkcs12.p12 similarity index 100% rename from sample-keys/pkcs12.p12 rename to sample/sample-keys/pkcs12.p12 diff --git a/sample-keys/server.crt b/sample/sample-keys/server.crt similarity index 100% rename from sample-keys/server.crt rename to sample/sample-keys/server.crt diff --git a/sample-keys/server.key b/sample/sample-keys/server.key similarity index 100% rename from sample-keys/server.key rename to sample/sample-keys/server.key diff --git a/sample-scripts/auth-pam.pl b/sample/sample-scripts/auth-pam.pl similarity index 100% rename from sample-scripts/auth-pam.pl rename to sample/sample-scripts/auth-pam.pl diff --git a/sample-scripts/bridge-start b/sample/sample-scripts/bridge-start similarity index 100% rename from sample-scripts/bridge-start rename to sample/sample-scripts/bridge-start diff --git a/sample-scripts/bridge-stop b/sample/sample-scripts/bridge-stop similarity index 100% rename from sample-scripts/bridge-stop rename to sample/sample-scripts/bridge-stop diff --git a/sample-scripts/ucn.pl b/sample/sample-scripts/ucn.pl similarity index 100% rename from sample-scripts/ucn.pl rename to sample/sample-scripts/ucn.pl diff --git a/sample-scripts/verify-cn b/sample/sample-scripts/verify-cn similarity index 100% rename from sample-scripts/verify-cn rename to sample/sample-scripts/verify-cn diff --git a/sample-windows/sample.ovpn b/sample/sample-windows/sample.ovpn similarity index 100% rename from sample-windows/sample.ovpn rename to sample/sample-windows/sample.ovpn diff --git a/service-win32/.svnignore b/service-win32/.svnignore deleted file mode 100644 index d9987b37..00000000 --- a/service-win32/.svnignore +++ /dev/null @@ -1,4 +0,0 @@ -*.o -Makefile.in -.deps -Makefile diff --git a/service-win32/Makefile.am b/service-win32/Makefile.am deleted file mode 100644 index 4e4f55ed..00000000 --- a/service-win32/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -# -# OpenVPN -- An application to securely tunnel IP networks -# over a single UDP port, with support for SSL/TLS-based -# session authentication and key exchange, -# packet encryption, packet authentication, and -# packet compression. -# -# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 -# as published by the Free Software Foundation. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program (see the file COPYING included with this -# distribution); if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in - -if WIN32 - -sbin_PROGRAMS = openvpnserv - -openvpnserv_SOURCES = \ - openvpnserv.c \ - service.h service.c - -else - -dist_noinst_DATA = \ - openvpnserv.c \ - service.h service.c - -endif diff --git a/sources b/sources deleted file mode 100755 index dbfa0183..00000000 --- a/sources +++ /dev/null @@ -1,2 +0,0 @@ -ls -1 *.[ch] -ls -1 configure.ac Makefile.am diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 00000000..f2481c2f --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,18 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +EXTRA_DIST = \ + plugins + +SUBDIRS = openvpn openvpnserv diff --git a/src/openvpn/Makefile.am b/src/openvpn/Makefile.am new file mode 100644 index 00000000..4a6b4976 --- /dev/null +++ b/src/openvpn/Makefile.am @@ -0,0 +1,95 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +INCLUDES = -I$(top_srcdir)/include + +sbin_PROGRAMS = openvpn + +openvpn_SOURCES = \ + base64.c base64.h \ + basic.h \ + buffer.c buffer.h \ + circ_list.h \ + clinat.c clinat.h \ + common.h \ + compat.h compat.c \ + crypto.c crypto.h crypto_backend.h \ + crypto_openssl.c crypto_openssl.h \ + crypto_polarssl.c crypto_polarssl.h \ + dhcp.c dhcp.h \ + errlevel.h \ + error.c error.h \ + event.c event.h \ + fdmisc.c fdmisc.h \ + forward.c forward.h forward-inline.h \ + fragment.c fragment.h \ + gremlin.c gremlin.h \ + helper.c helper.h \ + httpdigest.c httpdigest.h \ + lladdr.c lladdr.h \ + init.c init.h \ + integer.h \ + interval.c interval.h \ + list.c list.h \ + lzo.c lzo.h \ + manage.c manage.h \ + mbuf.c mbuf.h \ + memdbg.h \ + misc.c misc.h \ + mroute.c mroute.h \ + mss.c mss.h \ + mstats.c mstats.h \ + mtcp.c mtcp.h \ + mtu.c mtu.h \ + mudp.c mudp.h \ + multi.c multi.h \ + ntlm.c ntlm.h \ + occ.c occ.h occ-inline.h \ + pkcs11.c pkcs11.h pkcs11_backend.h \ + pkcs11_openssl.c \ + pkcs11_polarssl.c \ + openvpn.c openvpn.h \ + options.c options.h \ + otime.c otime.h \ + packet_id.c packet_id.h \ + perf.c perf.h \ + pf.c pf.h pf-inline.h \ + ping.c ping.h ping-inline.h \ + plugin.c plugin.h \ + pool.c pool.h \ + proto.c proto.h \ + proxy.c proxy.h \ + ps.c ps.h \ + push.c push.h \ + pushlist.h \ + reliable.c reliable.h \ + route.c route.h \ + schedule.c schedule.h \ + session_id.c session_id.h \ + shaper.c shaper.h \ + sig.c sig.h \ + socket.c socket.h \ + socks.c socks.h \ + ssl.c ssl.h ssl_backend.h \ + ssl_openssl.c ssl_openssl.h \ + ssl_polarssl.c ssl_polarssl.h \ + ssl_common.h \ + ssl_verify.c ssl_verify.h ssl_verify_backend.h \ + ssl_verify_openssl.c ssl_verify_openssl.h \ + ssl_verify_polarssl.c ssl_verify_polarssl.h \ + status.c status.h \ + syshead.h \ + tun.c tun.h \ + win32.h win32.c \ + cryptoapi.h cryptoapi.c diff --git a/base64.c b/src/openvpn/base64.c similarity index 100% rename from base64.c rename to src/openvpn/base64.c diff --git a/base64.h b/src/openvpn/base64.h similarity index 100% rename from base64.h rename to src/openvpn/base64.h diff --git a/basic.h b/src/openvpn/basic.h similarity index 100% rename from basic.h rename to src/openvpn/basic.h diff --git a/buffer.c b/src/openvpn/buffer.c similarity index 100% rename from buffer.c rename to src/openvpn/buffer.c diff --git a/buffer.h b/src/openvpn/buffer.h similarity index 100% rename from buffer.h rename to src/openvpn/buffer.h diff --git a/circ_list.h b/src/openvpn/circ_list.h similarity index 100% rename from circ_list.h rename to src/openvpn/circ_list.h diff --git a/clinat.c b/src/openvpn/clinat.c similarity index 100% rename from clinat.c rename to src/openvpn/clinat.c diff --git a/clinat.h b/src/openvpn/clinat.h similarity index 100% rename from clinat.h rename to src/openvpn/clinat.h diff --git a/common.h b/src/openvpn/common.h similarity index 100% rename from common.h rename to src/openvpn/common.h diff --git a/compat.c b/src/openvpn/compat.c similarity index 100% rename from compat.c rename to src/openvpn/compat.c diff --git a/compat.h b/src/openvpn/compat.h similarity index 100% rename from compat.h rename to src/openvpn/compat.h diff --git a/crypto.c b/src/openvpn/crypto.c similarity index 100% rename from crypto.c rename to src/openvpn/crypto.c diff --git a/crypto.h b/src/openvpn/crypto.h similarity index 100% rename from crypto.h rename to src/openvpn/crypto.h diff --git a/crypto_backend.h b/src/openvpn/crypto_backend.h similarity index 100% rename from crypto_backend.h rename to src/openvpn/crypto_backend.h diff --git a/crypto_openssl.c b/src/openvpn/crypto_openssl.c similarity index 100% rename from crypto_openssl.c rename to src/openvpn/crypto_openssl.c diff --git a/crypto_openssl.h b/src/openvpn/crypto_openssl.h similarity index 100% rename from crypto_openssl.h rename to src/openvpn/crypto_openssl.h diff --git a/crypto_polarssl.c b/src/openvpn/crypto_polarssl.c similarity index 100% rename from crypto_polarssl.c rename to src/openvpn/crypto_polarssl.c diff --git a/crypto_polarssl.h b/src/openvpn/crypto_polarssl.h similarity index 100% rename from crypto_polarssl.h rename to src/openvpn/crypto_polarssl.h diff --git a/cryptoapi.c b/src/openvpn/cryptoapi.c similarity index 100% rename from cryptoapi.c rename to src/openvpn/cryptoapi.c diff --git a/cryptoapi.h b/src/openvpn/cryptoapi.h similarity index 100% rename from cryptoapi.h rename to src/openvpn/cryptoapi.h diff --git a/dhcp.c b/src/openvpn/dhcp.c similarity index 100% rename from dhcp.c rename to src/openvpn/dhcp.c diff --git a/dhcp.h b/src/openvpn/dhcp.h similarity index 100% rename from dhcp.h rename to src/openvpn/dhcp.h diff --git a/errlevel.h b/src/openvpn/errlevel.h similarity index 100% rename from errlevel.h rename to src/openvpn/errlevel.h diff --git a/error.c b/src/openvpn/error.c similarity index 100% rename from error.c rename to src/openvpn/error.c diff --git a/error.h b/src/openvpn/error.h similarity index 100% rename from error.h rename to src/openvpn/error.h diff --git a/event.c b/src/openvpn/event.c similarity index 100% rename from event.c rename to src/openvpn/event.c diff --git a/event.h b/src/openvpn/event.h similarity index 100% rename from event.h rename to src/openvpn/event.h diff --git a/fdmisc.c b/src/openvpn/fdmisc.c similarity index 100% rename from fdmisc.c rename to src/openvpn/fdmisc.c diff --git a/fdmisc.h b/src/openvpn/fdmisc.h similarity index 100% rename from fdmisc.h rename to src/openvpn/fdmisc.h diff --git a/forward-inline.h b/src/openvpn/forward-inline.h similarity index 100% rename from forward-inline.h rename to src/openvpn/forward-inline.h diff --git a/forward.c b/src/openvpn/forward.c similarity index 100% rename from forward.c rename to src/openvpn/forward.c diff --git a/forward.h b/src/openvpn/forward.h similarity index 100% rename from forward.h rename to src/openvpn/forward.h diff --git a/fragment.c b/src/openvpn/fragment.c similarity index 100% rename from fragment.c rename to src/openvpn/fragment.c diff --git a/fragment.h b/src/openvpn/fragment.h similarity index 100% rename from fragment.h rename to src/openvpn/fragment.h diff --git a/gremlin.c b/src/openvpn/gremlin.c similarity index 100% rename from gremlin.c rename to src/openvpn/gremlin.c diff --git a/gremlin.h b/src/openvpn/gremlin.h similarity index 100% rename from gremlin.h rename to src/openvpn/gremlin.h diff --git a/helper.c b/src/openvpn/helper.c similarity index 100% rename from helper.c rename to src/openvpn/helper.c diff --git a/helper.h b/src/openvpn/helper.h similarity index 100% rename from helper.h rename to src/openvpn/helper.h diff --git a/httpdigest.c b/src/openvpn/httpdigest.c similarity index 100% rename from httpdigest.c rename to src/openvpn/httpdigest.c diff --git a/httpdigest.h b/src/openvpn/httpdigest.h similarity index 100% rename from httpdigest.h rename to src/openvpn/httpdigest.h diff --git a/init.c b/src/openvpn/init.c similarity index 100% rename from init.c rename to src/openvpn/init.c diff --git a/init.h b/src/openvpn/init.h similarity index 100% rename from init.h rename to src/openvpn/init.h diff --git a/integer.h b/src/openvpn/integer.h similarity index 100% rename from integer.h rename to src/openvpn/integer.h diff --git a/interval.c b/src/openvpn/interval.c similarity index 100% rename from interval.c rename to src/openvpn/interval.c diff --git a/interval.h b/src/openvpn/interval.h similarity index 100% rename from interval.h rename to src/openvpn/interval.h diff --git a/list.c b/src/openvpn/list.c similarity index 100% rename from list.c rename to src/openvpn/list.c diff --git a/list.h b/src/openvpn/list.h similarity index 100% rename from list.h rename to src/openvpn/list.h diff --git a/lladdr.c b/src/openvpn/lladdr.c similarity index 100% rename from lladdr.c rename to src/openvpn/lladdr.c diff --git a/lladdr.h b/src/openvpn/lladdr.h similarity index 100% rename from lladdr.h rename to src/openvpn/lladdr.h diff --git a/lzo.c b/src/openvpn/lzo.c similarity index 100% rename from lzo.c rename to src/openvpn/lzo.c diff --git a/lzo.h b/src/openvpn/lzo.h similarity index 100% rename from lzo.h rename to src/openvpn/lzo.h diff --git a/manage.c b/src/openvpn/manage.c similarity index 100% rename from manage.c rename to src/openvpn/manage.c diff --git a/manage.h b/src/openvpn/manage.h similarity index 100% rename from manage.h rename to src/openvpn/manage.h diff --git a/mbuf.c b/src/openvpn/mbuf.c similarity index 100% rename from mbuf.c rename to src/openvpn/mbuf.c diff --git a/mbuf.h b/src/openvpn/mbuf.h similarity index 100% rename from mbuf.h rename to src/openvpn/mbuf.h diff --git a/memdbg.h b/src/openvpn/memdbg.h similarity index 100% rename from memdbg.h rename to src/openvpn/memdbg.h diff --git a/misc.c b/src/openvpn/misc.c similarity index 100% rename from misc.c rename to src/openvpn/misc.c diff --git a/misc.h b/src/openvpn/misc.h similarity index 100% rename from misc.h rename to src/openvpn/misc.h diff --git a/mroute.c b/src/openvpn/mroute.c similarity index 100% rename from mroute.c rename to src/openvpn/mroute.c diff --git a/mroute.h b/src/openvpn/mroute.h similarity index 100% rename from mroute.h rename to src/openvpn/mroute.h diff --git a/mss.c b/src/openvpn/mss.c similarity index 100% rename from mss.c rename to src/openvpn/mss.c diff --git a/mss.h b/src/openvpn/mss.h similarity index 100% rename from mss.h rename to src/openvpn/mss.h diff --git a/mstats.c b/src/openvpn/mstats.c similarity index 100% rename from mstats.c rename to src/openvpn/mstats.c diff --git a/mstats.h b/src/openvpn/mstats.h similarity index 100% rename from mstats.h rename to src/openvpn/mstats.h diff --git a/mtcp.c b/src/openvpn/mtcp.c similarity index 100% rename from mtcp.c rename to src/openvpn/mtcp.c diff --git a/mtcp.h b/src/openvpn/mtcp.h similarity index 100% rename from mtcp.h rename to src/openvpn/mtcp.h diff --git a/mtu.c b/src/openvpn/mtu.c similarity index 100% rename from mtu.c rename to src/openvpn/mtu.c diff --git a/mtu.h b/src/openvpn/mtu.h similarity index 100% rename from mtu.h rename to src/openvpn/mtu.h diff --git a/mudp.c b/src/openvpn/mudp.c similarity index 100% rename from mudp.c rename to src/openvpn/mudp.c diff --git a/mudp.h b/src/openvpn/mudp.h similarity index 100% rename from mudp.h rename to src/openvpn/mudp.h diff --git a/multi.c b/src/openvpn/multi.c similarity index 100% rename from multi.c rename to src/openvpn/multi.c diff --git a/multi.h b/src/openvpn/multi.h similarity index 100% rename from multi.h rename to src/openvpn/multi.h diff --git a/ntlm.c b/src/openvpn/ntlm.c similarity index 100% rename from ntlm.c rename to src/openvpn/ntlm.c diff --git a/ntlm.h b/src/openvpn/ntlm.h similarity index 100% rename from ntlm.h rename to src/openvpn/ntlm.h diff --git a/occ-inline.h b/src/openvpn/occ-inline.h similarity index 100% rename from occ-inline.h rename to src/openvpn/occ-inline.h diff --git a/occ.c b/src/openvpn/occ.c similarity index 100% rename from occ.c rename to src/openvpn/occ.c diff --git a/occ.h b/src/openvpn/occ.h similarity index 100% rename from occ.h rename to src/openvpn/occ.h diff --git a/openvpn.c b/src/openvpn/openvpn.c similarity index 100% rename from openvpn.c rename to src/openvpn/openvpn.c diff --git a/openvpn.h b/src/openvpn/openvpn.h similarity index 100% rename from openvpn.h rename to src/openvpn/openvpn.h diff --git a/options.c b/src/openvpn/options.c similarity index 100% rename from options.c rename to src/openvpn/options.c diff --git a/options.h b/src/openvpn/options.h similarity index 100% rename from options.h rename to src/openvpn/options.h diff --git a/otime.c b/src/openvpn/otime.c similarity index 100% rename from otime.c rename to src/openvpn/otime.c diff --git a/otime.h b/src/openvpn/otime.h similarity index 100% rename from otime.h rename to src/openvpn/otime.h diff --git a/packet_id.c b/src/openvpn/packet_id.c similarity index 100% rename from packet_id.c rename to src/openvpn/packet_id.c diff --git a/packet_id.h b/src/openvpn/packet_id.h similarity index 100% rename from packet_id.h rename to src/openvpn/packet_id.h diff --git a/perf.c b/src/openvpn/perf.c similarity index 100% rename from perf.c rename to src/openvpn/perf.c diff --git a/perf.h b/src/openvpn/perf.h similarity index 100% rename from perf.h rename to src/openvpn/perf.h diff --git a/pf-inline.h b/src/openvpn/pf-inline.h similarity index 100% rename from pf-inline.h rename to src/openvpn/pf-inline.h diff --git a/pf.c b/src/openvpn/pf.c similarity index 100% rename from pf.c rename to src/openvpn/pf.c diff --git a/pf.h b/src/openvpn/pf.h similarity index 100% rename from pf.h rename to src/openvpn/pf.h diff --git a/ping-inline.h b/src/openvpn/ping-inline.h similarity index 100% rename from ping-inline.h rename to src/openvpn/ping-inline.h diff --git a/ping.c b/src/openvpn/ping.c similarity index 100% rename from ping.c rename to src/openvpn/ping.c diff --git a/ping.h b/src/openvpn/ping.h similarity index 100% rename from ping.h rename to src/openvpn/ping.h diff --git a/pkcs11.c b/src/openvpn/pkcs11.c similarity index 100% rename from pkcs11.c rename to src/openvpn/pkcs11.c diff --git a/pkcs11.h b/src/openvpn/pkcs11.h similarity index 100% rename from pkcs11.h rename to src/openvpn/pkcs11.h diff --git a/pkcs11_backend.h b/src/openvpn/pkcs11_backend.h similarity index 100% rename from pkcs11_backend.h rename to src/openvpn/pkcs11_backend.h diff --git a/pkcs11_openssl.c b/src/openvpn/pkcs11_openssl.c similarity index 100% rename from pkcs11_openssl.c rename to src/openvpn/pkcs11_openssl.c diff --git a/pkcs11_polarssl.c b/src/openvpn/pkcs11_polarssl.c similarity index 100% rename from pkcs11_polarssl.c rename to src/openvpn/pkcs11_polarssl.c diff --git a/plugin.c b/src/openvpn/plugin.c similarity index 100% rename from plugin.c rename to src/openvpn/plugin.c diff --git a/plugin.h b/src/openvpn/plugin.h similarity index 100% rename from plugin.h rename to src/openvpn/plugin.h diff --git a/pool.c b/src/openvpn/pool.c similarity index 100% rename from pool.c rename to src/openvpn/pool.c diff --git a/pool.h b/src/openvpn/pool.h similarity index 100% rename from pool.h rename to src/openvpn/pool.h diff --git a/proto.c b/src/openvpn/proto.c similarity index 100% rename from proto.c rename to src/openvpn/proto.c diff --git a/proto.h b/src/openvpn/proto.h similarity index 100% rename from proto.h rename to src/openvpn/proto.h diff --git a/proxy.c b/src/openvpn/proxy.c similarity index 100% rename from proxy.c rename to src/openvpn/proxy.c diff --git a/proxy.h b/src/openvpn/proxy.h similarity index 100% rename from proxy.h rename to src/openvpn/proxy.h diff --git a/ps.c b/src/openvpn/ps.c similarity index 100% rename from ps.c rename to src/openvpn/ps.c diff --git a/ps.h b/src/openvpn/ps.h similarity index 100% rename from ps.h rename to src/openvpn/ps.h diff --git a/push.c b/src/openvpn/push.c similarity index 100% rename from push.c rename to src/openvpn/push.c diff --git a/push.h b/src/openvpn/push.h similarity index 100% rename from push.h rename to src/openvpn/push.h diff --git a/pushlist.h b/src/openvpn/pushlist.h similarity index 100% rename from pushlist.h rename to src/openvpn/pushlist.h diff --git a/reliable.c b/src/openvpn/reliable.c similarity index 100% rename from reliable.c rename to src/openvpn/reliable.c diff --git a/reliable.h b/src/openvpn/reliable.h similarity index 100% rename from reliable.h rename to src/openvpn/reliable.h diff --git a/route.c b/src/openvpn/route.c similarity index 100% rename from route.c rename to src/openvpn/route.c diff --git a/route.h b/src/openvpn/route.h similarity index 100% rename from route.h rename to src/openvpn/route.h diff --git a/schedule.c b/src/openvpn/schedule.c similarity index 100% rename from schedule.c rename to src/openvpn/schedule.c diff --git a/schedule.h b/src/openvpn/schedule.h similarity index 100% rename from schedule.h rename to src/openvpn/schedule.h diff --git a/session_id.c b/src/openvpn/session_id.c similarity index 100% rename from session_id.c rename to src/openvpn/session_id.c diff --git a/session_id.h b/src/openvpn/session_id.h similarity index 100% rename from session_id.h rename to src/openvpn/session_id.h diff --git a/shaper.c b/src/openvpn/shaper.c similarity index 100% rename from shaper.c rename to src/openvpn/shaper.c diff --git a/shaper.h b/src/openvpn/shaper.h similarity index 100% rename from shaper.h rename to src/openvpn/shaper.h diff --git a/sig.c b/src/openvpn/sig.c similarity index 100% rename from sig.c rename to src/openvpn/sig.c diff --git a/sig.h b/src/openvpn/sig.h similarity index 100% rename from sig.h rename to src/openvpn/sig.h diff --git a/socket.c b/src/openvpn/socket.c similarity index 100% rename from socket.c rename to src/openvpn/socket.c diff --git a/socket.h b/src/openvpn/socket.h similarity index 100% rename from socket.h rename to src/openvpn/socket.h diff --git a/socks.c b/src/openvpn/socks.c similarity index 100% rename from socks.c rename to src/openvpn/socks.c diff --git a/socks.h b/src/openvpn/socks.h similarity index 100% rename from socks.h rename to src/openvpn/socks.h diff --git a/ssl.c b/src/openvpn/ssl.c similarity index 100% rename from ssl.c rename to src/openvpn/ssl.c diff --git a/ssl.h b/src/openvpn/ssl.h similarity index 100% rename from ssl.h rename to src/openvpn/ssl.h diff --git a/ssl_backend.h b/src/openvpn/ssl_backend.h similarity index 100% rename from ssl_backend.h rename to src/openvpn/ssl_backend.h diff --git a/ssl_common.h b/src/openvpn/ssl_common.h similarity index 100% rename from ssl_common.h rename to src/openvpn/ssl_common.h diff --git a/ssl_openssl.c b/src/openvpn/ssl_openssl.c similarity index 100% rename from ssl_openssl.c rename to src/openvpn/ssl_openssl.c diff --git a/ssl_openssl.h b/src/openvpn/ssl_openssl.h similarity index 100% rename from ssl_openssl.h rename to src/openvpn/ssl_openssl.h diff --git a/ssl_polarssl.c b/src/openvpn/ssl_polarssl.c similarity index 100% rename from ssl_polarssl.c rename to src/openvpn/ssl_polarssl.c diff --git a/ssl_polarssl.h b/src/openvpn/ssl_polarssl.h similarity index 100% rename from ssl_polarssl.h rename to src/openvpn/ssl_polarssl.h diff --git a/ssl_verify.c b/src/openvpn/ssl_verify.c similarity index 100% rename from ssl_verify.c rename to src/openvpn/ssl_verify.c diff --git a/ssl_verify.h b/src/openvpn/ssl_verify.h similarity index 100% rename from ssl_verify.h rename to src/openvpn/ssl_verify.h diff --git a/ssl_verify_backend.h b/src/openvpn/ssl_verify_backend.h similarity index 100% rename from ssl_verify_backend.h rename to src/openvpn/ssl_verify_backend.h diff --git a/ssl_verify_openssl.c b/src/openvpn/ssl_verify_openssl.c similarity index 100% rename from ssl_verify_openssl.c rename to src/openvpn/ssl_verify_openssl.c diff --git a/ssl_verify_openssl.h b/src/openvpn/ssl_verify_openssl.h similarity index 100% rename from ssl_verify_openssl.h rename to src/openvpn/ssl_verify_openssl.h diff --git a/ssl_verify_polarssl.c b/src/openvpn/ssl_verify_polarssl.c similarity index 100% rename from ssl_verify_polarssl.c rename to src/openvpn/ssl_verify_polarssl.c diff --git a/ssl_verify_polarssl.h b/src/openvpn/ssl_verify_polarssl.h similarity index 100% rename from ssl_verify_polarssl.h rename to src/openvpn/ssl_verify_polarssl.h diff --git a/status.c b/src/openvpn/status.c similarity index 100% rename from status.c rename to src/openvpn/status.c diff --git a/status.h b/src/openvpn/status.h similarity index 100% rename from status.h rename to src/openvpn/status.h diff --git a/syshead.h b/src/openvpn/syshead.h similarity index 100% rename from syshead.h rename to src/openvpn/syshead.h diff --git a/tun.c b/src/openvpn/tun.c similarity index 100% rename from tun.c rename to src/openvpn/tun.c diff --git a/tun.h b/src/openvpn/tun.h similarity index 100% rename from tun.h rename to src/openvpn/tun.h diff --git a/win32.c b/src/openvpn/win32.c similarity index 100% rename from win32.c rename to src/openvpn/win32.c diff --git a/win32.h b/src/openvpn/win32.h similarity index 100% rename from win32.h rename to src/openvpn/win32.h diff --git a/src/openvpnserv/Makefile.am b/src/openvpnserv/Makefile.am new file mode 100644 index 00000000..7ce33753 --- /dev/null +++ b/src/openvpnserv/Makefile.am @@ -0,0 +1,20 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in + +if WIN32 +sbin_PROGRAMS = openvpnserv +endif + +openvpnserv_SOURCES = \ + openvpnserv.c \ + service.h service.c diff --git a/service-win32/openvpnserv.c b/src/openvpnserv/openvpnserv.c similarity index 100% rename from service-win32/openvpnserv.c rename to src/openvpnserv/openvpnserv.c diff --git a/service-win32/service.c b/src/openvpnserv/service.c similarity index 100% rename from service-win32/service.c rename to src/openvpnserv/service.c diff --git a/service-win32/service.h b/src/openvpnserv/service.h similarity index 100% rename from service-win32/service.h rename to src/openvpnserv/service.h diff --git a/plugins/README b/src/plugins/README similarity index 100% rename from plugins/README rename to src/plugins/README diff --git a/plugins/auth-pam/Makefile b/src/plugins/auth-pam/Makefile similarity index 96% rename from plugins/auth-pam/Makefile rename to src/plugins/auth-pam/Makefile index d45a203c..c0b9c79e 100755 --- a/plugins/auth-pam/Makefile +++ b/src/plugins/auth-pam/Makefile @@ -13,7 +13,7 @@ else endif # This directory is where we will look for openvpn-plugin.h -CPPFLAGS=-I../.. +CPPFLAGS=-I../../../include CC=gcc CFLAGS=-O2 -Wall diff --git a/plugins/auth-pam/README b/src/plugins/auth-pam/README similarity index 100% rename from plugins/auth-pam/README rename to src/plugins/auth-pam/README diff --git a/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c similarity index 100% rename from plugins/auth-pam/auth-pam.c rename to src/plugins/auth-pam/auth-pam.c diff --git a/plugins/auth-pam/pamdl.c b/src/plugins/auth-pam/pamdl.c similarity index 100% rename from plugins/auth-pam/pamdl.c rename to src/plugins/auth-pam/pamdl.c diff --git a/plugins/auth-pam/pamdl.h b/src/plugins/auth-pam/pamdl.h similarity index 100% rename from plugins/auth-pam/pamdl.h rename to src/plugins/auth-pam/pamdl.h diff --git a/plugins/defer/README b/src/plugins/defer/README similarity index 100% rename from plugins/defer/README rename to src/plugins/defer/README diff --git a/plugins/examples/build b/src/plugins/defer/build similarity index 89% rename from plugins/examples/build rename to src/plugins/defer/build index 7605595b..0612c080 100755 --- a/plugins/examples/build +++ b/src/plugins/defer/build @@ -6,7 +6,7 @@ # # This directory is where we will look for openvpn-plugin.h -CPPFLAGS="${CPPFLAGS:--I../..}" +CPPFLAGS="${CPPFLAGS:--I../../../include}" CC="${CC:-gcc}" CFLAGS="${CFLAGS:--O2 -Wall -g}" diff --git a/plugins/defer/simple.c b/src/plugins/defer/simple.c similarity index 100% rename from plugins/defer/simple.c rename to src/plugins/defer/simple.c diff --git a/plugins/defer/simple.def b/src/plugins/defer/simple.def similarity index 100% rename from plugins/defer/simple.def rename to src/plugins/defer/simple.def diff --git a/plugins/examples/winbuild b/src/plugins/defer/winbuild similarity index 95% rename from plugins/examples/winbuild rename to src/plugins/defer/winbuild index 97e724a5..82927d96 100755 --- a/plugins/examples/winbuild +++ b/src/plugins/defer/winbuild @@ -5,7 +5,7 @@ # # This directory is where we will look for openvpn-plugin.h -INCLUDE="-I.." +INCLUDE="-I../../../build" CC_FLAGS="-O2 -Wall" diff --git a/plugins/down-root/Makefile b/src/plugins/down-root/Makefile similarity index 93% rename from plugins/down-root/Makefile rename to src/plugins/down-root/Makefile index 9659b7fd..e66c99ae 100755 --- a/plugins/down-root/Makefile +++ b/src/plugins/down-root/Makefile @@ -3,7 +3,7 @@ # # This directory is where we will look for openvpn-plugin.h -CPPFLAGS=-I../.. +CPPFLAGS=-I../../../include CC=gcc CFLAGS=-O2 -Wall diff --git a/plugins/down-root/README b/src/plugins/down-root/README similarity index 100% rename from plugins/down-root/README rename to src/plugins/down-root/README diff --git a/plugins/down-root/down-root.c b/src/plugins/down-root/down-root.c similarity index 100% rename from plugins/down-root/down-root.c rename to src/plugins/down-root/down-root.c diff --git a/plugins/examples/README b/src/plugins/examples/README similarity index 100% rename from plugins/examples/README rename to src/plugins/examples/README diff --git a/plugins/defer/build b/src/plugins/examples/build similarity index 91% rename from plugins/defer/build rename to src/plugins/examples/build index 9629c11f..bbb05f7c 100755 --- a/plugins/defer/build +++ b/src/plugins/examples/build @@ -6,7 +6,7 @@ # # This directory is where we will look for openvpn-plugin.h -CPPFLAGS="${CPPFLAGS:--I../..}" +CPPFLAGS="${CPPFLAGS:--I../../..}" CC="${CC:-gcc}" CFLAGS="${CFLAGS:--O2 -Wall -g}" diff --git a/plugins/examples/log.c b/src/plugins/examples/log.c similarity index 100% rename from plugins/examples/log.c rename to src/plugins/examples/log.c diff --git a/plugins/examples/log_v3.c b/src/plugins/examples/log_v3.c similarity index 100% rename from plugins/examples/log_v3.c rename to src/plugins/examples/log_v3.c diff --git a/plugins/examples/simple.c b/src/plugins/examples/simple.c similarity index 100% rename from plugins/examples/simple.c rename to src/plugins/examples/simple.c diff --git a/plugins/examples/simple.def b/src/plugins/examples/simple.def similarity index 100% rename from plugins/examples/simple.def rename to src/plugins/examples/simple.def diff --git a/plugins/defer/winbuild b/src/plugins/examples/winbuild similarity index 94% rename from plugins/defer/winbuild rename to src/plugins/examples/winbuild index 97e724a5..decf05f8 100755 --- a/plugins/defer/winbuild +++ b/src/plugins/examples/winbuild @@ -5,7 +5,7 @@ # # This directory is where we will look for openvpn-plugin.h -INCLUDE="-I.." +INCLUDE="-I../../../include" CC_FLAGS="-O2 -Wall" diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 00000000..6ae845ba --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,24 @@ +# +# OpenVPN -- An application to securely tunnel IP networks +# over a single UDP port, with support for SSL/TLS-based +# session authentication and key exchange, +# packet encryption, packet authentication, and +# packet compression. +# +# Copyright (C) 2002-2010 OpenVPN Technologies, Inc. +# Copyright (C) 2006-2012 Alon Bar-Lev +# + +MAINTAINERCLEANFILES = \ + $(srcdir)/Makefile.in + +test_scripts = t_lpback.sh t_cltsrv.sh + +TESTS_ENVIRONMENT = top_srcdir="$(top_srcdir)" +TESTS = $(test_scripts) + +dist_noinst_SCRIPTS = \ + $(test_scripts) \ + t_cltsrv-down.sh \ + t_client.sh + diff --git a/t_client.rc-sample b/tests/t_client.rc-sample similarity index 92% rename from t_client.rc-sample rename to tests/t_client.rc-sample index e766b5db..dcb3e4ae 100644 --- a/t_client.rc-sample +++ b/tests/t_client.rc-sample @@ -7,9 +7,10 @@ # # define these - if empty, no tests will run # -CA_CERT="/home/openvpn-test-ca/keys/ca.crt" -CLIENT_KEY="/home/openvpn-test-ca/keys/client-test.key" -CLIENT_CERT="/home/openvpn-test-ca/keys/client-test.crt" +top_srcdir="${top_srcdir:-..}" +CA_CERT="${top_srcdir}/sample/sample-keys/ca.crt" +CLIENT_KEY="${top_srcdir}/sample/sample-keys/client.key" +CLIENT_CERT="${top_srcdir}/sample/sample-keys/client.crt" # # remote host (used as macro below) # diff --git a/t_client.sh.in b/tests/t_client.sh.in similarity index 95% rename from t_client.sh.in rename to tests/t_client.sh.in index 47839dee..7ba124c9 100755 --- a/t_client.sh.in +++ b/tests/t_client.sh.in @@ -12,17 +12,16 @@ # - for "ping6" checks: fping6 binary in $PATH # -if [ -r ./t_client.rc ] ; then - . ./t_client.rc -elif [ -r "${srcdir}"/t_client.rc ] ; then +srcdir="${srcdir:-.}" +top_builddir="${top_builddir:-..}" +if [ -r "${srcdir}"/t_client.rc ] ; then . "${srcdir}"/t_client.rc else - echo "$0: cannot find 't_client.rc' in current directory or" >&2 - echo "$0: source dir ('${srcdir}'). SKIPPING TEST." >&2 + echo "$0: cannot find 't_client.rc' in ('${srcdir}'). SKIPPING TEST." >&2 exit 77 fi -if [ ! -x ./openvpn ] +if [ ! -x "${top_builddir}/src/openvpn/openvpn" ] then echo "no (executable) openvpn binary in current directory. FAIL." >&2 exit 1 @@ -228,8 +227,8 @@ do continue fi - echo " run ./openvpn $openvpn_conf" - $RUN_SUDO ./openvpn $openvpn_conf >$LOGDIR/$SUF:openvpn.log & + echo " run openvpn $openvpn_conf" + $RUN_SUDO "${top_builddir}/src/openvpn/openvpn" $openvpn_conf >$LOGDIR/$SUF:openvpn.log & opid=$! # make sure openvpn client is terminated in case shell exits diff --git a/t_cltsrv-down.sh b/tests/t_cltsrv-down.sh similarity index 100% rename from t_cltsrv-down.sh rename to tests/t_cltsrv-down.sh diff --git a/t_cltsrv.sh b/tests/t_cltsrv.sh similarity index 76% rename from t_cltsrv.sh rename to tests/t_cltsrv.sh index 5bcbfc70..752251e4 100755 --- a/t_cltsrv.sh +++ b/tests/t_cltsrv.sh @@ -19,6 +19,9 @@ # 02110-1301, USA. set -e +srcdir="${srcdir:-.}" +top_srcdir="${top_srcdir:-..}" +top_builddir="${top_builddir:-..}" trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15 trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3 addopts= @@ -41,8 +44,9 @@ esac # make sure that the --down script is executable -- fail (rather than # skip) test if it isn't. -downscript="t_cltsrv-down.sh" -test -x "${srcdir}"/$downscript || chmod +x "${srcdir}"/$downscript || { echo >&2 "$downscript is not executable, failing." ; exit 1 ; } +downscript="../tests/t_cltsrv-down.sh" +root="${top_srcdir}/sample" +test -x "${root}/${downscript}" || chmod +x "${root}/${downscript}" || { echo >&2 "${root}/${downscript} is not executable, failing." ; exit 1 ; } echo "The following test will take about two minutes." >&2 echo "If the addresses are in use, this test will retry up to two times." >&2 @@ -51,8 +55,8 @@ success=0 for i in 1 2 3 ; do set +e ( - ./openvpn --script-security 2 --cd "${srcdir}" ${addopts} --setenv role srv --down "$downscript" --tls-exit --ping-exit 180 --config sample-config-files/loopback-server & - ./openvpn --script-security 2 --cd "${srcdir}" ${addopts} --setenv role clt --down "$downscript" --tls-exit --ping-exit 180 --config sample-config-files/loopback-client + "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${root}" ${addopts} --setenv role srv --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-server" & + "${top_builddir}/src/openvpn/openvpn" --script-security 2 --cd "${top_srcdir}/sample" ${addopts} --setenv role clt --down "${downscript}" --tls-exit --ping-exit 180 --config "sample-config-files/loopback-client" ) 3>log.$$.signal >log.$$ 2>&1 e1=$? wait $! diff --git a/t_lpback.sh b/tests/t_lpback.sh similarity index 84% rename from t_lpback.sh rename to tests/t_lpback.sh index b860de42..40767a1b 100755 --- a/t_lpback.sh +++ b/tests/t_lpback.sh @@ -19,11 +19,12 @@ # 02110-1301, USA. set -e +top_builddir="${top_builddir:-..}" trap "rm -f key.$$ log.$$ ; trap 0 ; exit 77" 1 2 15 trap "rm -f key.$$ log.$$ ; exit 1" 0 3 -./openvpn --genkey --secret key.$$ +"${top_builddir}/src/openvpn/openvpn" --genkey --secret key.$$ set +e -( ./openvpn --test-crypto --secret key.$$ ) >log.$$ 2>&1 +( "${top_builddir}/src/openvpn/openvpn" --test-crypto --secret key.$$ ) >log.$$ 2>&1 e=$? if [ $e != 0 ] ; then cat log.$$ ; fi rm key.$$ log.$$