mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2025-07-07 00:04:57 +03:00
Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
080edcdb81 | |||
079ef10e1f | |||
b02dd7ca53 | |||
919cb2ae75 | |||
5f7d9b8c11 | |||
3411625177 | |||
32ccec317a | |||
7f8926e0c1 | |||
1af74e50ad | |||
8da2464831 | |||
b5125e566c | |||
5e75a1fb99 | |||
0e4f2a3864 | |||
4e4db36c11 | |||
18f7bfe33f | |||
103b6eb194 | |||
ae34141b7a | |||
292670cfa2 | |||
9ae379bc31 | |||
8908f4a933 | |||
60acfae417 | |||
092fe96676 | |||
1cb225c0ba | |||
ef6b15bda2 | |||
aff8566957 | |||
374ba7fc7d | |||
c1f522c10e | |||
5fe90bb180 | |||
fe71635603 | |||
97393bbe45 | |||
b34d036647 | |||
7d1fced672 | |||
e50cf278cd | |||
5b11e6bffd | |||
a6ac9456b5 | |||
ddf4c28789 | |||
139fffe6e0 | |||
c1d6ddf361 | |||
b72292edd1 | |||
3429e1bf31 | |||
cf6eef4841 | |||
99a029c7c4 | |||
f061557aad | |||
8173eb4509 | |||
a3b5484587 | |||
63513259c0 | |||
966a5e6dea | |||
91c5d5feb8 |
@ -2,11 +2,13 @@ version: '{build}'
|
||||
|
||||
image:
|
||||
- Visual Studio 2015
|
||||
- Visual Studio 2017
|
||||
- Ubuntu1604
|
||||
- Ubuntu1804
|
||||
|
||||
skip_branch_with_pr: true
|
||||
configuration: Release
|
||||
|
||||
skip_branch_with_pr: true
|
||||
clone_depth: 1
|
||||
|
||||
init:
|
||||
@ -14,16 +16,61 @@ init:
|
||||
|
||||
install: git submodule update --init --recursive
|
||||
|
||||
build_script:
|
||||
- cmd: >-
|
||||
src\BuildAll.cmd
|
||||
exit %errorlevel%
|
||||
- sh: >-
|
||||
./configure && make package -C tmp
|
||||
|
||||
artifacts:
|
||||
for:
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- image: Visual Studio 2015
|
||||
build_script:
|
||||
- src\BuildAll.cmd
|
||||
- exit %errorlevel%
|
||||
artifacts:
|
||||
- path: output\pkg\*\*
|
||||
name: Windows
|
||||
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- image: Visual Studio 2017
|
||||
init:
|
||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||
before_build:
|
||||
- configure
|
||||
build_script:
|
||||
- nmake
|
||||
after_build:
|
||||
- 7z a "%APPVEYOR_BUILD_FOLDER%\build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip" "%APPVEYOR_BUILD_FOLDER%\build\*.exe"
|
||||
- 7z a "%APPVEYOR_BUILD_FOLDER%\build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip" "%APPVEYOR_BUILD_FOLDER%\build\hamcore.se2"
|
||||
artifacts:
|
||||
- path: build\%APPVEYOR_PROJECT_NAME%_%APPVEYOR_BUILD_VERSION%_Windows_x64_%CONFIGURATION%.zip
|
||||
name: Windows
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- image: Ubuntu1604
|
||||
before_build:
|
||||
- ./configure
|
||||
build_script:
|
||||
- make package -C tmp
|
||||
after_build:
|
||||
- .ci/appveyor_afterbuild.sh
|
||||
on_failure:
|
||||
- sudo journalctl -xe --no-pager
|
||||
artifacts:
|
||||
- path: build/*.deb
|
||||
name: Ubuntu
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- image: Ubuntu1804
|
||||
before_build:
|
||||
- ./configure
|
||||
build_script:
|
||||
- make package -C tmp
|
||||
- .ci/memory-leak-test.sh
|
||||
after_build:
|
||||
- .ci/appveyor_afterbuild.sh
|
||||
on_failure:
|
||||
- sudo journalctl -xe --no-pager
|
||||
artifacts:
|
||||
- path: build/*.deb
|
||||
name: Ubuntu
|
||||
|
12
.ci/appveyor_afterbuild.sh
Executable file
12
.ci/appveyor_afterbuild.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
sudo dpkg -i build/softether-common*.deb
|
||||
sudo dpkg -i build/softether-vpnbridge*.deb
|
||||
sudo dpkg -i build/softether-vpnclient*.deb
|
||||
sudo dpkg -i build/softether-vpncmd*.deb
|
||||
sudo dpkg -i build/softether-vpnserver*.deb
|
||||
|
||||
sudo systemctl restart softether-vpnserver
|
||||
|
7
.ci/memory-leak-test.sh
Executable file
7
.ci/memory-leak-test.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
echo -n | ./build/vpntest s | grep -Fq 'NO MEMORY LEAKS'
|
||||
echo -n | ./build/vpntest c | grep -Fq 'NO MEMORY LEAKS'
|
||||
echo -n | ./build/vpntest b | grep -Fq 'NO MEMORY LEAKS'
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -25,6 +25,7 @@ x64_Debug
|
||||
*.user
|
||||
*.ncb
|
||||
*.opt
|
||||
*.suo
|
||||
!/src/BuildFiles/**/*
|
||||
|
||||
# Applied for 'developer_tools/stbchecker/'
|
||||
@ -204,3 +205,4 @@ developer_tools/stbchecker/**/ASALocalRun/
|
||||
developer_tools/stbchecker/**/*.binlog
|
||||
developer_tools/stbchecker/**/*.nvuser
|
||||
developer_tools/stbchecker/**/.mfractor/
|
||||
|
||||
|
@ -10,14 +10,8 @@
|
||||
script:
|
||||
- ./configure
|
||||
- make package -C tmp
|
||||
|
||||
bionic:
|
||||
<<: *ubuntu_def
|
||||
image: ubuntu:bionic
|
||||
|
||||
xenial:
|
||||
<<: *ubuntu_def
|
||||
image: ubuntu:xenial
|
||||
- dpkg -i build/softether-vpn*.deb
|
||||
- .ci/memory-leak-test.sh
|
||||
|
||||
trusty:
|
||||
<<: *ubuntu_def
|
||||
|
7
.gitmodules
vendored
7
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[submodule "src/Mayaqua/cpu_features"]
|
||||
path = src/Mayaqua/cpu_features
|
||||
[submodule "src/Mayaqua/3rdparty/cpu_features"]
|
||||
path = src/Mayaqua/3rdparty/cpu_features
|
||||
url = https://github.com/google/cpu_features.git
|
||||
[submodule "src/Mayaqua/3rdparty/zlib"]
|
||||
path = src/Mayaqua/3rdparty/zlib
|
||||
url = https://github.com/madler/zlib.git
|
||||
|
14
.travis.yml
14
.travis.yml
@ -54,16 +54,12 @@ matrix:
|
||||
directories:
|
||||
- ${HOME}/Library/Caches/Homebrew
|
||||
before_install:
|
||||
- brew update && brew upgrade
|
||||
- brew update
|
||||
script:
|
||||
- ./configure
|
||||
- make -C tmp
|
||||
- otool -L build/vpnserver/vpnserver
|
||||
- sudo make -C tmp install
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages: [ debhelper, devscripts, fakeroot, cmake3, dh-exec ]
|
||||
- otool -L build/vpnserver
|
||||
- .ci/memory-leak-test.sh
|
||||
|
||||
cache:
|
||||
directories:
|
||||
@ -83,6 +79,6 @@ script:
|
||||
- export LDFLAGS="-L${HOME}/opt/lib"
|
||||
- ./configure
|
||||
- make -C tmp
|
||||
- ldd build/vpnserver/vpnserver
|
||||
- sudo LD_LIBRARY_PATH="${HOME}/opt/lib:${LD_LIBRARY_PATH:-}" make -C tmp install
|
||||
- ldd build/vpnserver
|
||||
- if [ "${BUILD_DEB}" = "1" ]; then make package -C tmp; fi
|
||||
- .ci/memory-leak-test.sh
|
||||
|
@ -1,14 +1,14 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
|
||||
project(SoftEtherVPN
|
||||
VERSION 5.01.9660
|
||||
VERSION 5.01.9662
|
||||
LANGUAGES C
|
||||
)
|
||||
|
||||
set(default_build_type "Release")
|
||||
|
||||
# Check that submodules are present only if source was downloaded with git
|
||||
if(EXISTS "${SoftEtherVPN_SOURCE_DIR}/.git" AND NOT EXISTS "${SoftEtherVPN_SOURCE_DIR}/src/Mayaqua/cpu_features/CMakeLists.txt")
|
||||
if(EXISTS "${SoftEtherVPN_SOURCE_DIR}/.git" AND NOT EXISTS "${SoftEtherVPN_SOURCE_DIR}/src/Mayaqua/3rdparty/cpu_features/CMakeLists.txt")
|
||||
message (FATAL_ERROR "Submodules are not initialized. Run\n\tgit submodule update --init --recursive")
|
||||
endif()
|
||||
|
||||
@ -22,39 +22,51 @@ string(REGEX REPLACE "VERSION_MINOR ([0-9]+)" "\\1" CurrentBuild_MINOR ${temp})
|
||||
string(REGEX MATCH "VERSION_BUILD ([0-9]+)" temp ${CurrentBuild})
|
||||
string(REGEX REPLACE "VERSION_BUILD ([0-9]+)" "\\1" CurrentBuild_BUILD ${temp})
|
||||
|
||||
if (NOT ${PROJECT_VERSION} VERSION_EQUAL "${CurrentBuild_MAJOR}.${CurrentBuild_MINOR}.${CurrentBuild_BUILD}")
|
||||
if(NOT ${PROJECT_VERSION} VERSION_EQUAL "${CurrentBuild_MAJOR}.${CurrentBuild_MINOR}.${CurrentBuild_BUILD}")
|
||||
message (FATAL_ERROR "PROJECT_VERSION does not match to src/CurrentBuild.txt")
|
||||
endif()
|
||||
|
||||
include(CheckIncludeFile)
|
||||
Check_Include_File(sys/auxv.h HAVE_SYS_AUXV)
|
||||
if(UNIX)
|
||||
include(GNUInstallDirs)
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
include(CheckIncludeFile)
|
||||
Check_Include_File(sys/auxv.h HAVE_SYS_AUXV)
|
||||
endif()
|
||||
|
||||
configure_file("${SoftEtherVPN_SOURCE_DIR}/AUTHORS.TXT" "${SoftEtherVPN_SOURCE_DIR}/src/bin/hamcore/authors.txt" COPYONLY)
|
||||
|
||||
set(BUILD_DIRECTORY ${SoftEtherVPN_SOURCE_DIR}/build)
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
# Packaging
|
||||
set(CPACK_COMPONENTS_ALL vpnserver vpnclient vpnbridge vpncmd)
|
||||
set(CPACK_PACKAGE_DIRECTORY ${BUILD_DIRECTORY})
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_PACKAGE_VENDOR "SoftEther")
|
||||
set(CPACK_PACKAGE_NAME "softether")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${SoftEtherVPN_SOURCE_DIR}/description")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN is an open-source cross-platform multi-protocol VPN program, created as an academic project in the University of Tsukuba.")
|
||||
if(UNIX)
|
||||
# Packaging
|
||||
set(CPACK_COMPONENTS_ALL common vpnserver vpnclient vpnbridge vpncmd)
|
||||
set(CPACK_PACKAGE_DIRECTORY ${BUILD_DIRECTORY})
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_PACKAGE_VENDOR "SoftEther")
|
||||
set(CPACK_PACKAGE_NAME "softether")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${SoftEtherVPN_SOURCE_DIR}/description")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SoftEther VPN is an open-source cross-platform multi-protocol VPN program, created as an academic project in the University of Tsukuba.")
|
||||
|
||||
# DEB
|
||||
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "net")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Unknown")
|
||||
# DEB
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEBUG ON)
|
||||
endif()
|
||||
|
||||
# RPM
|
||||
set(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
set(CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
|
||||
set(CPACK_DEB_COMPONENT_INSTALL ON)
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
||||
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "net")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Unknown")
|
||||
|
||||
include(CPack)
|
||||
# RPM
|
||||
set(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
|
||||
set(CPACK_RPM_PACKAGE_GROUP "Applications/Internet")
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
|
||||
|
||||
include(CPack)
|
||||
endif()
|
||||
|
@ -1,6 +1,6 @@
|
||||
# SoftEther VPN
|
||||
|
||||
[](https://ci.appveyor.com/project/softethervpn/softethervpn) [](https://travis-ci.org/SoftEtherVPN/SoftEtherVPN) [](https://scan.coverity.com/projects/softethervpn-softethervpn)
|
||||
[](https://ci.appveyor.com/project/softethervpn/softethervpn) [](https://travis-ci.org/SoftEtherVPN/SoftEtherVPN) [](https://gitlab.com/SoftEther/SoftEtherVPN/pipelines) [](https://scan.coverity.com/projects/softethervpn-softethervpn)
|
||||
|
||||
- [SoftEther VPN](#softether-vpn)
|
||||
- [BOARD MEMBERS OF THIS REPOSITORY](#board-members-of-this-repository)
|
||||
|
33
configure.cmd
Normal file
33
configure.cmd
Normal file
@ -0,0 +1,33 @@
|
||||
@echo off
|
||||
|
||||
echo ---------------------------------------------------------------------
|
||||
echo SoftEther VPN for Windows
|
||||
echo.
|
||||
echo Copyright (c) SoftEther VPN Project at University of Tsukuba, Japan.
|
||||
echo Copyright (c) Daiyuu Nobori. All Rights Reserved.
|
||||
echo.
|
||||
echo This program is free software; you can redistribute it and/or
|
||||
echo modify it under the terms of the GNU General Public License
|
||||
echo version 2 as published by the Free Software Foundation.
|
||||
echo.
|
||||
echo Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.
|
||||
echo ---------------------------------------------------------------------
|
||||
echo.
|
||||
|
||||
echo Welcome to the corner-cutting configure script !
|
||||
echo.
|
||||
|
||||
if not exist "tmp" (
|
||||
mkdir tmp
|
||||
)
|
||||
|
||||
cd tmp
|
||||
|
||||
cmake -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ..
|
||||
|
||||
if %errorlevel% == 0 (
|
||||
echo.
|
||||
echo The Makefile is generated. Run 'nmake' to build SoftEther VPN.
|
||||
) else (
|
||||
cd ..
|
||||
)
|
@ -1,8 +1,7 @@
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# Creates wrapper scripts and installs them in the user's binaries directory, which is usually "/usr/local/bin".
|
||||
# This is required because symlinks use the folder they are in as working directory.
|
||||
macro(install_wrapper_script component target)
|
||||
if(UNIX)
|
||||
# Creates wrapper scripts and installs them in the user's binaries directory, which is usually "/usr/local/bin".
|
||||
# This is required because symlinks use the folder they are in as working directory.
|
||||
macro(install_wrapper_script component target)
|
||||
get_filename_component(file_name ${target} NAME)
|
||||
|
||||
file(WRITE ${CMAKE_SOURCE_DIR}/tmp/script/${file_name} "#!/bin/sh\n")
|
||||
@ -14,25 +13,8 @@ macro(install_wrapper_script component target)
|
||||
DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
endmacro(install_wrapper_script)
|
||||
|
||||
macro(install_systemd_service component file_path binary_path)
|
||||
get_filename_component(file_name ${file_path} NAME)
|
||||
get_filename_component(binary_directory ${binary_path} DIRECTORY)
|
||||
|
||||
file(READ ${file_path} FILE_CONTENT)
|
||||
string(REPLACE "[DIRECTORY]" ${binary_directory} FILE_CONTENT ${FILE_CONTENT})
|
||||
string(REPLACE "[BINARY]" ${binary_path} FILE_CONTENT ${FILE_CONTENT})
|
||||
file(WRITE ${CMAKE_SOURCE_DIR}/tmp/systemd/${file_name} ${FILE_CONTENT})
|
||||
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/tmp/systemd/${file_name}
|
||||
COMPONENT ${component}
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
endmacro(install_systemd_service)
|
||||
endmacro(install_wrapper_script)
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
add_definitions(-D_DEBUG -DDEBUG)
|
||||
@ -43,7 +25,10 @@ if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(COMPILER_ARCHITECTURE "x64")
|
||||
add_definitions(-DCPU_64)
|
||||
else()
|
||||
set(COMPILER_ARCHITECTURE "x86")
|
||||
endif()
|
||||
|
||||
add_definitions(-D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_SAFE -DTHREADSAFE -D_FILE_OFFSET_BITS=64)
|
||||
@ -52,7 +37,7 @@ add_definitions(-D_REENTRANT -DREENTRANT -D_THREAD_SAFE -D_THREADSAFE -DTHREAD_S
|
||||
include_directories(.)
|
||||
|
||||
if(WIN32)
|
||||
message(FATAL_ERROR "Windows compilation via CMake is currently not supported.")
|
||||
add_definitions(-DWIN32 -D_WINDOWS -D_CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@ -101,111 +86,47 @@ add_subdirectory(hamcorebuilder)
|
||||
|
||||
# vpnserver
|
||||
add_subdirectory(vpnserver)
|
||||
get_target_property(VPNSERVER_RUNTIME_OUTPUT_DIRECTORY vpnserver RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
# vpnclient
|
||||
add_subdirectory(vpnclient)
|
||||
get_target_property(VPNCLIENT_RUNTIME_OUTPUT_DIRECTORY vpnclient RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
# vpnbridge
|
||||
add_subdirectory(vpnbridge)
|
||||
get_target_property(VPNBRIDGE_RUNTIME_OUTPUT_DIRECTORY vpnbridge RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
# vpncmd
|
||||
add_subdirectory(vpncmd)
|
||||
get_target_property(VPNCMD_RUNTIME_OUTPUT_DIRECTORY vpncmd RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
# vpntest
|
||||
add_subdirectory(vpntest)
|
||||
get_target_property(VPNTEST_RUNTIME_OUTPUT_DIRECTORY vpntest RUNTIME_OUTPUT_DIRECTORY)
|
||||
|
||||
# hamcore.se2 archive file
|
||||
add_custom_target(hamcore-archive-build
|
||||
ALL
|
||||
COMMAND hamcorebuilder ${CMAKE_SOURCE_DIR}/src/bin/hamcore/ ${CMAKE_SOURCE_DIR}/tmp/hamcore.se2
|
||||
COMMAND hamcorebuilder "${CMAKE_SOURCE_DIR}/src/bin/hamcore/" "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
DEPENDS hamcorebuilder
|
||||
COMMENT "Building hamcore.se2 archive file..."
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
# Copy hamcore.se2 to vpnserver's directory
|
||||
add_custom_command(TARGET hamcore-archive-build
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tmp/hamcore.se2 ${VPNSERVER_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
if(WIN32)
|
||||
# PenCore
|
||||
add_subdirectory(PenCore)
|
||||
add_dependencies(hamcore-archive-build PenCore)
|
||||
|
||||
# Copy hamcore.se2 to vpnclient's directory
|
||||
add_custom_command(TARGET hamcore-archive-build
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tmp/hamcore.se2 ${VPNCLIENT_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
# vpnsmgr
|
||||
add_subdirectory(vpnsmgr)
|
||||
|
||||
# Copy hamcore.se2 to vpnbridge's directory
|
||||
add_custom_command(TARGET hamcore-archive-build
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tmp/hamcore.se2 ${VPNBRIDGE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
# vpncmgr
|
||||
add_subdirectory(vpncmgr)
|
||||
endif()
|
||||
|
||||
# Copy hamcore.se2 to vpncmd's directory
|
||||
add_custom_command(TARGET hamcore-archive-build
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tmp/hamcore.se2 ${VPNCMD_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
|
||||
# Copy hamcore.se2 to vpntest's directory
|
||||
add_custom_command(TARGET hamcore-archive-build
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/tmp/hamcore.se2 ${VPNTEST_RUNTIME_OUTPUT_DIRECTORY}
|
||||
)
|
||||
|
||||
# Copy "vpnserver" directory to /usr/lib(exec)/softether/, install launch script and systemd service
|
||||
install(DIRECTORY ${VPNSERVER_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMPONENT "vpnserver"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether"
|
||||
PATTERN "*"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnserver" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")
|
||||
install_systemd_service("vpnserver" "${CMAKE_SOURCE_DIR}/systemd/softether-vpnserver.service" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")
|
||||
|
||||
# Copy "vpnclient" directory to /usr/lib(exec)/softether/, install launch script and systemd service
|
||||
install(DIRECTORY ${VPNCLIENT_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMPONENT "vpnclient"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether"
|
||||
PATTERN "*"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnclient" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")
|
||||
install_systemd_service("vpnclient" "${CMAKE_SOURCE_DIR}/systemd/softether-vpnclient.service" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")
|
||||
|
||||
# Copy "vpnbridge" directory to /usr/lib(exec)/softether/, install launch script and systemd service
|
||||
install(DIRECTORY ${VPNBRIDGE_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMPONENT "vpnbridge"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether"
|
||||
PATTERN "*"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnbridge" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnbridge/vpnbridge")
|
||||
install_systemd_service("vpnbridge" "${CMAKE_SOURCE_DIR}/systemd/softether-vpnbridge.service" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnbridge/vpnbridge")
|
||||
|
||||
# Copy "vpncmd" directory to /usr/lib(exec)/softether/, install launch script and systemd service
|
||||
install(DIRECTORY ${VPNCMD_RUNTIME_OUTPUT_DIRECTORY}
|
||||
COMPONENT "vpncmd"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether"
|
||||
PATTERN "*"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install_wrapper_script("vpncmd" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpncmd/vpncmd")
|
||||
|
||||
# Print message after installing the targets
|
||||
install(CODE "message(\"\n----------------------------------------------------------------------------------------------------------------------------\")")
|
||||
install(CODE "message(\"Build completed successfully.\n\")")
|
||||
install(CODE "message(\"Execute 'vpnserver start' to run the SoftEther VPN Server background service.\")")
|
||||
install(CODE "message(\"Execute 'vpnbridge start' to run the SoftEther VPN Bridge background service.\")")
|
||||
install(CODE "message(\"Execute 'vpnclient start' to run the SoftEther VPN Client background service.\")")
|
||||
install(CODE "message(\"Execute 'vpncmd' to run the SoftEther VPN Command-Line Utility to configure VPN Server, VPN Bridge or VPN Client.\")")
|
||||
install(CODE "message(\"----------------------------------------------------------------------------------------------------------------------------\n\")")
|
||||
if(UNIX)
|
||||
# Print message after installing the targets
|
||||
install(CODE "message(\"\n----------------------------------------------------------------------------------------------------------------------------\")")
|
||||
install(CODE "message(\"Build completed successfully.\n\")")
|
||||
install(CODE "message(\"Execute 'vpnserver start' to run the SoftEther VPN Server background service.\")")
|
||||
install(CODE "message(\"Execute 'vpnbridge start' to run the SoftEther VPN Bridge background service.\")")
|
||||
install(CODE "message(\"Execute 'vpnclient start' to run the SoftEther VPN Client background service.\")")
|
||||
install(CODE "message(\"Execute 'vpncmd' to run the SoftEther VPN Command-Line Utility to configure VPN Server, VPN Bridge or VPN Client.\")")
|
||||
install(CODE "message(\"----------------------------------------------------------------------------------------------------------------------------\n\")")
|
||||
endif()
|
||||
|
@ -136,19 +136,23 @@ UINT GetEthDeviceHash()
|
||||
{
|
||||
#ifdef OS_UNIX
|
||||
// UNIX
|
||||
UINT num;
|
||||
UINT num = 0;
|
||||
UINT i;
|
||||
char tmp[4096];
|
||||
UCHAR hash[SHA1_SIZE];
|
||||
TOKEN_LIST *t = GetEthList();
|
||||
|
||||
num = t->NumTokens;
|
||||
tmp[0] = 0;
|
||||
for (i = 0;i < t->NumTokens;i++)
|
||||
|
||||
if (t != NULL)
|
||||
{
|
||||
num = t->NumTokens;
|
||||
for (i = 0; i < t->NumTokens; i++)
|
||||
{
|
||||
StrCat(tmp, sizeof(tmp), t->Token[i]);
|
||||
}
|
||||
FreeToken(t);
|
||||
}
|
||||
|
||||
Sha0(hash, tmp, StrLen(tmp));
|
||||
|
||||
|
@ -1,22 +1,37 @@
|
||||
file(GLOB SOURCES_CEDAR "*.c")
|
||||
file(GLOB HEADERS_CEDAR "*.h")
|
||||
|
||||
add_library(cedar STATIC ${SOURCES_CEDAR} ${HEADERS_CEDAR})
|
||||
if(WIN32)
|
||||
enable_language(CXX)
|
||||
file(GLOB SOURCES_CEDAR_CPP "*.cpp")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
add_library(cedar STATIC ${SOURCES_CEDAR} ${SOURCES_CEDAR_CPP} ${HEADERS_CEDAR})
|
||||
else()
|
||||
add_library(cedar SHARED ${SOURCES_CEDAR} ${SOURCES_CEDAR_CPP} ${HEADERS_CEDAR})
|
||||
endif()
|
||||
|
||||
set_target_properties(cedar
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Cedar"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
find_library(LIB_READLINE readline)
|
||||
find_package(Curses REQUIRED)
|
||||
if(WIN32)
|
||||
target_include_directories(cedar PRIVATE winpcap)
|
||||
endif()
|
||||
|
||||
target_link_libraries(cedar ${LIB_READLINE} ${CURSES_LIBRARIES})
|
||||
if(UNIX)
|
||||
find_library(LIB_READLINE readline)
|
||||
find_package(Curses REQUIRED)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
target_link_libraries(cedar pcap)
|
||||
target_link_libraries(cedar PRIVATE ${LIB_READLINE} ${CURSES_LIBRARIES})
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||
target_link_libraries(cedar PRIVATE mayaqua pcap)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Version
|
||||
@ -54,3 +69,11 @@ message(STATUS "Build time: ${BUILD_HOUR}:${BUILD_MINUTE}:${BUILD_SECOND}")
|
||||
|
||||
add_definitions(-DBUILD_DATE_D=${BUILD_DAY} -DBUILD_DATE_M=${BUILD_MONTH} -DBUILD_DATE_Y=${BUILD_YEAR})
|
||||
add_definitions(-DBUILD_DATE_HO=${BUILD_HOUR} -DBUILD_DATE_MI=${BUILD_MINUTE} -DBUILD_DATE_SE=${BUILD_SECOND})
|
||||
|
||||
if(UNIX)
|
||||
install(TARGETS cedar
|
||||
COMPONENT "common"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
|
@ -2287,7 +2287,7 @@ void MakeLogFileNameStringFromTick(LOG *g, char *str, UINT size, UINT64 tick, UI
|
||||
break;
|
||||
|
||||
default: // Without switching
|
||||
snprintf(str, size, "");
|
||||
snprintf(str, size, "%s");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -7094,8 +7094,7 @@ PACK *PackLoginWithOpenVPNCertificate(char *hubname, char *username, X *x)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
wcstombs(cn_username, x->subject_name->CommonName, 127);
|
||||
cn_username[127] = '\0';
|
||||
UniToStr(cn_username, sizeof(cn_username), x->subject_name->CommonName);
|
||||
PackAddStr(p, "username", cn_username);
|
||||
}
|
||||
else
|
||||
|
@ -1,5 +1,5 @@
|
||||
VERSION_MAJOR 5
|
||||
VERSION_MINOR 1
|
||||
VERSION_BUILD 9660
|
||||
VERSION_BUILD 9662
|
||||
BUILD_NAME unstable
|
||||
BUILD_DATE 20181015_142500
|
||||
BUILD_DATE 20181030_164618
|
||||
|
1
src/Mayaqua/3rdparty/zlib
vendored
Submodule
1
src/Mayaqua/3rdparty/zlib
vendored
Submodule
Submodule src/Mayaqua/3rdparty/zlib added at cacf7f1d4e
@ -1,47 +1,87 @@
|
||||
file(GLOB SOURCES_MAYAQUA "*.c")
|
||||
file(GLOB HEADERS_MAYAQUA "*.h")
|
||||
|
||||
add_library(mayaqua STATIC ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
||||
if(WIN32)
|
||||
add_library(mayaqua STATIC ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
||||
else()
|
||||
add_library(mayaqua SHARED ${SOURCES_MAYAQUA} ${HEADERS_MAYAQUA})
|
||||
endif()
|
||||
|
||||
target_include_directories(mayaqua PUBLIC .)
|
||||
|
||||
set_target_properties(mayaqua
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/tmp/Mayaqua"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
if(WIN32)
|
||||
add_subdirectory(3rdparty/zlib)
|
||||
|
||||
# In some cases libiconv is not included in libc
|
||||
find_library(LIB_ICONV iconv)
|
||||
target_include_directories(mayaqua PRIVATE win32_inc)
|
||||
target_include_directories(mayaqua PRIVATE 3rdparty/zlib)
|
||||
|
||||
if(HAVE_SYS_AUXV)
|
||||
add_subdirectory(cpu_features)
|
||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||
find_library(LIB_SSL
|
||||
NAMES libssl ssleay32
|
||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/x64_${CMAKE_BUILD_TYPE}"
|
||||
)
|
||||
|
||||
find_library(LIB_CRYPTO
|
||||
NAMES libcrypto libeay32
|
||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/x64_${CMAKE_BUILD_TYPE}"
|
||||
)
|
||||
else()
|
||||
find_library(LIB_SSL
|
||||
NAMES libssl ssleay32
|
||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/Win32_${CMAKE_BUILD_TYPE}"
|
||||
)
|
||||
|
||||
find_library(LIB_CRYPTO
|
||||
NAMES libcrypto libeay32
|
||||
HINTS "${CMAKE_SOURCE_DIR}/src/BuildFiles/Library/vs2017/Win32_${CMAKE_BUILD_TYPE}"
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(mayaqua PRIVATE zlibstatic ${LIB_SSL} ${LIB_CRYPTO})
|
||||
endif()
|
||||
|
||||
target_include_directories(mayaqua PRIVATE cpu_features/include)
|
||||
if(UNIX)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
target_link_libraries(mayaqua OpenSSL::SSL OpenSSL::Crypto Threads::Threads ZLIB::ZLIB)
|
||||
# In some cases libiconv is not included in libc
|
||||
find_library(LIB_ICONV iconv)
|
||||
|
||||
if(HAVE_SYS_AUXV)
|
||||
target_link_libraries(mayaqua cpu_features)
|
||||
else()
|
||||
find_library(LIB_RT rt)
|
||||
|
||||
target_link_libraries(mayaqua PRIVATE OpenSSL::SSL OpenSSL::Crypto Threads::Threads ZLIB::ZLIB)
|
||||
|
||||
if(HAVE_SYS_AUXV)
|
||||
add_subdirectory(3rdparty/cpu_features)
|
||||
set_property(TARGET cpu_features PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
target_link_libraries(mayaqua PRIVATE cpu_features)
|
||||
else()
|
||||
add_definitions(-DSKIP_CPU_FEATURES)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_library(LIB_RT rt)
|
||||
if(LIB_RT)
|
||||
target_link_libraries(mayaqua rt)
|
||||
endif()
|
||||
if(LIB_RT)
|
||||
target_link_libraries(mayaqua PRIVATE rt)
|
||||
endif()
|
||||
|
||||
if(LIB_ICONV)
|
||||
target_link_libraries(mayaqua ${LIB_ICONV})
|
||||
endif()
|
||||
if(LIB_ICONV)
|
||||
target_link_libraries(mayaqua PRIVATE ${LIB_ICONV})
|
||||
endif()
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||
target_link_libraries(mayaqua nsl socket)
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS")
|
||||
target_link_libraries(mayaqua PRIVATE nsl socket)
|
||||
endif()
|
||||
|
||||
install(TARGETS mayaqua
|
||||
COMPONENT "common"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
endif()
|
||||
|
@ -2357,6 +2357,7 @@ bool RsaCheck()
|
||||
ret = BN_set_word(e, RSA_F4);
|
||||
if (ret == 0)
|
||||
{
|
||||
BN_free(e);
|
||||
Debug("BN_set_word: err=%s\n", ERR_error_string(ERR_get_error(), errbuf));
|
||||
return false;
|
||||
}
|
||||
@ -2366,6 +2367,7 @@ bool RsaCheck()
|
||||
{
|
||||
rsa = RSA_new();
|
||||
ret = RSA_generate_key_ex(rsa, bit, e, NULL);
|
||||
BN_free(e);
|
||||
}
|
||||
Unlock(openssl_lock);
|
||||
if (ret == 0)
|
||||
@ -2438,6 +2440,7 @@ bool RsaGen(K **priv, K **pub, UINT bit)
|
||||
ret = BN_set_word(e, RSA_F4);
|
||||
if (ret == 0)
|
||||
{
|
||||
BN_free(e);
|
||||
Debug("BN_set_word: err=%s\n", ERR_error_string(ERR_get_error(), errbuf));
|
||||
return false;
|
||||
}
|
||||
@ -2447,6 +2450,7 @@ bool RsaGen(K **priv, K **pub, UINT bit)
|
||||
{
|
||||
rsa = RSA_new();
|
||||
ret = RSA_generate_key_ex(rsa, bit, e, NULL);
|
||||
BN_free(e);
|
||||
}
|
||||
Unlock(openssl_lock);
|
||||
if (ret == 0)
|
||||
|
@ -945,6 +945,8 @@ TABLE *ParseTableLine(char *line, char *prefix, UINT prefix_size, LIST *replace_
|
||||
UniReplaceStrEx(tmp, tmp_size, tmp, (wchar_t *)r->name, r->unistr, false);
|
||||
}
|
||||
|
||||
Free(unistr);
|
||||
|
||||
unistr = CopyUniStr(tmp);
|
||||
|
||||
Free(tmp);
|
||||
|
14
src/PenCore/CMakeLists.txt
Normal file
14
src/PenCore/CMakeLists.txt
Normal file
@ -0,0 +1,14 @@
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "PenCore is needed only on Windows.")
|
||||
endif()
|
||||
|
||||
add_library(PenCore SHARED pencore.c pencore.rc)
|
||||
|
||||
set_target_properties(PenCore
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/bin/hamcore"
|
||||
)
|
||||
|
||||
target_link_libraries(PenCore cedar mayaqua)
|
@ -164,7 +164,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
Print("\nProcessing...\n");
|
||||
|
||||
#ifdef WIN32
|
||||
BuildHamcore(dst_filename, src_dir, false);
|
||||
#else
|
||||
BuildHamcore(dst_filename, src_dir, true);
|
||||
#endif
|
||||
|
||||
Print("\nDone.\n");
|
||||
}
|
||||
|
@ -1,10 +1,41 @@
|
||||
add_executable(vpnbridge vpnbridge.c)
|
||||
set(VPNBRIDGE_SOURCES vpnbridge.c)
|
||||
|
||||
if(WIN32)
|
||||
set(VPNBRIDGE_SOURCES ${VPNBRIDGE_SOURCES} vpnbridge.rc)
|
||||
endif()
|
||||
|
||||
add_executable(vpnbridge ${VPNBRIDGE_SOURCES})
|
||||
|
||||
set_target_properties(vpnbridge
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnbridge"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnbridge"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnbridge"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
target_link_libraries(vpnbridge cedar mayaqua)
|
||||
|
||||
if(UNIX)
|
||||
# Copy binary and "hamcore.se2" to /usr/lib(exec)/softether/, install launch script and systemd service
|
||||
install(TARGETS vpnbridge
|
||||
COMPONENT "vpnbridge"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnbridge"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
COMPONENT "vpnbridge"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnbridge"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnbridge" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnbridge/vpnbridge")
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnbridge.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnbridge.service)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnbridge.service
|
||||
COMPONENT "vpnbridge"
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,10 +1,41 @@
|
||||
add_executable(vpnclient vpncsvc.c)
|
||||
set(VPNCLIENT_SOURCES vpncsvc.c vpncsvc.h)
|
||||
|
||||
if(WIN32)
|
||||
set(VPNCLIENT_SOURCES ${VPNCLIENT_SOURCES} vpnclient.rc)
|
||||
endif()
|
||||
|
||||
add_executable(vpnclient ${VPNCLIENT_SOURCES})
|
||||
|
||||
set_target_properties(vpnclient
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnclient"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnclient"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnclient"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
target_link_libraries(vpnclient cedar mayaqua)
|
||||
|
||||
if(UNIX)
|
||||
# Copy binary and "hamcore.se2" to /usr/lib(exec)/softether/, install launch script and systemd service
|
||||
install(TARGETS vpnclient
|
||||
COMPONENT "vpnclient"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnclient"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
COMPONENT "vpnclient"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnclient"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnclient" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnclient.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service
|
||||
COMPONENT "vpnclient"
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,10 +1,33 @@
|
||||
add_executable(vpncmd vpncmd.c)
|
||||
set(VPNCMD_SOURCES vpncmd.c)
|
||||
|
||||
if(WIN32)
|
||||
set(VPNCMD_SOURCES ${VPNCMD_SOURCES} vpncmd.rc)
|
||||
endif()
|
||||
|
||||
add_executable(vpncmd ${VPNCMD_SOURCES})
|
||||
|
||||
set_target_properties(vpncmd
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpncmd"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpncmd"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpncmd"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
target_link_libraries(vpncmd cedar mayaqua)
|
||||
|
||||
if(UNIX)
|
||||
# Copy binary and "hamcore.se2" to /usr/lib(exec)/softether/, install launch script
|
||||
install(TARGETS vpncmd
|
||||
COMPONENT "vpncmd"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpncmd"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
COMPONENT "vpncmd"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpncmd"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install_wrapper_script("vpncmd" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpncmd/vpncmd")
|
||||
endif()
|
||||
|
22
src/vpncmgr/CMakeLists.txt
Normal file
22
src/vpncmgr/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "VPN Client Manager is available only for Windows.")
|
||||
endif()
|
||||
|
||||
set(VPNCMGR_SOURCES vpncmgr.c vpncmgr.rc)
|
||||
|
||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||
set(VPNCMGR_SOURCES ${VPNCMGR_SOURCES} ${CMAKE_SOURCE_DIR}/src/BuildFiles/Manifests/x64_user.manifest)
|
||||
else()
|
||||
set(VPNCMGR_SOURCES ${VPNCMGR_SOURCES} ${CMAKE_SOURCE_DIR}/src/BuildFiles/Manifests/x86_user.manifest)
|
||||
endif()
|
||||
|
||||
add_executable(vpncmgr WIN32 ${VPNCMGR_SOURCES})
|
||||
|
||||
set_target_properties(vpncmgr
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
target_link_libraries(vpncmgr cedar mayaqua)
|
@ -1,10 +1,41 @@
|
||||
add_executable(vpnserver vpnserver.c)
|
||||
set(VPNSERVER_SOURCES vpnserver.c)
|
||||
|
||||
if(WIN32)
|
||||
set(VPNSERVER_SOURCES ${VPNSERVER_SOURCES} vpnserver.rc)
|
||||
endif()
|
||||
|
||||
add_executable(vpnserver ${VPNSERVER_SOURCES})
|
||||
|
||||
set_target_properties(vpnserver
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnserver"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnserver"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnserver"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
target_link_libraries(vpnserver cedar mayaqua)
|
||||
|
||||
if(UNIX)
|
||||
# Copy binary and "hamcore.se2" to /usr/lib(exec)/softether/, install launch script and systemd service
|
||||
install(TARGETS vpnserver
|
||||
COMPONENT "vpnserver"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnserver"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
||||
)
|
||||
|
||||
install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
||||
COMPONENT "vpnserver"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnserver"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
|
||||
install_wrapper_script("vpnserver" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnserver/vpnserver")
|
||||
if(EXISTS "/lib/systemd/system")
|
||||
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnserver.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnserver.service)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnserver.service
|
||||
COMPONENT "vpnserver"
|
||||
DESTINATION "/lib/systemd/system"
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
22
src/vpnsmgr/CMakeLists.txt
Normal file
22
src/vpnsmgr/CMakeLists.txt
Normal file
@ -0,0 +1,22 @@
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "VPN Server Manager is available only for Windows.")
|
||||
endif()
|
||||
|
||||
set(VPNSMGR_SOURCES vpnsmgr.c vpnsmgr.rc)
|
||||
|
||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||
set(VPNSMGR_SOURCES ${VPNSMGR_SOURCES} ${CMAKE_SOURCE_DIR}/src/BuildFiles/Manifests/x64_user.manifest)
|
||||
else()
|
||||
set(VPNSMGR_SOURCES ${VPNSMGR_SOURCES} ${CMAKE_SOURCE_DIR}/src/BuildFiles/Manifests/x86_user.manifest)
|
||||
endif()
|
||||
|
||||
add_executable(vpnsmgr WIN32 ${VPNSMGR_SOURCES})
|
||||
|
||||
set_target_properties(vpnsmgr
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
target_link_libraries(vpnsmgr cedar mayaqua)
|
@ -1,10 +1,20 @@
|
||||
add_executable(vpntest vpntest.c vpntest.h)
|
||||
set(VPNTEST_SOURCES vpntest.c vpntest.h)
|
||||
|
||||
if(WIN32)
|
||||
if(${COMPILER_ARCHITECTURE} STREQUAL "x64")
|
||||
set(VPNTEST_SOURCES ${VPNTEST_SOURCES} ${CMAKE_SOURCE_DIR}/src/BuildFiles/Manifests/x64_user.manifest)
|
||||
else()
|
||||
set(VPNTEST_SOURCES ${VPNTEST_SOURCES} ${CMAKE_SOURCE_DIR}/src/BuildFiles/Manifests/x86_user.manifest)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_executable(vpntest ${VPNTEST_SOURCES})
|
||||
|
||||
set_target_properties(vpntest
|
||||
PROPERTIES
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpntest"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpntest"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpntest"
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
||||
)
|
||||
|
||||
target_link_libraries(vpntest cedar mayaqua)
|
||||
|
@ -101,11 +101,12 @@ TEST_LIST test_list[] =
|
||||
};
|
||||
|
||||
// Test function
|
||||
void TestMain(char *cmd)
|
||||
int TestMain(char *cmd)
|
||||
{
|
||||
char tmp[MAX_SIZE];
|
||||
bool first = true;
|
||||
bool exit_now = false;
|
||||
int status = 0;
|
||||
|
||||
Print("SoftEther VPN Project\n");
|
||||
Print("vpntest: VPN Server / VPN Client / VPN Bridge test program\n");
|
||||
@ -204,6 +205,7 @@ void TestMain(char *cmd)
|
||||
}
|
||||
if (b == false)
|
||||
{
|
||||
status = 2;
|
||||
Print("Invalid Command: %s\n\n", cmd);
|
||||
}
|
||||
}
|
||||
@ -216,6 +218,7 @@ void TestMain(char *cmd)
|
||||
}
|
||||
}
|
||||
Print("Exiting...\n\n");
|
||||
return status;
|
||||
}
|
||||
|
||||
// Main function
|
||||
@ -225,6 +228,7 @@ int main(int argc, char *argv[])
|
||||
UINT i;
|
||||
char cmd[MAX_SIZE];
|
||||
char *s;
|
||||
int status = 0;
|
||||
|
||||
InitProcessCallOnce();
|
||||
|
||||
@ -252,10 +256,10 @@ int main(int argc, char *argv[])
|
||||
EnableProbe(true);
|
||||
InitCedar();
|
||||
SetHamMode();
|
||||
TestMain(cmdline);
|
||||
status = TestMain(cmdline);
|
||||
FreeCedar();
|
||||
FreeMayaqua();
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
[Unit]
|
||||
Description=SoftEther VPN Bridge
|
||||
After=network.target auditd.service
|
||||
ConditionPathExists=![DIRECTORY]/do_not_run
|
||||
ConditionPathExists=!${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge/do_not_run
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-[DIRECTORY]
|
||||
ExecStart=[BINARY] start
|
||||
ExecStop=[BINARY] stop
|
||||
EnvironmentFile=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge
|
||||
ExecStart=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge start
|
||||
ExecStop=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge/vpnbridge stop
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
|
||||
@ -16,7 +16,7 @@ PrivateTmp=yes
|
||||
ProtectHome=yes
|
||||
ProtectSystem=full
|
||||
ReadOnlyDirectories=/
|
||||
ReadWriteDirectories=-[DIRECTORY]
|
||||
ReadWriteDirectories=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnbridge
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
||||
|
||||
[Install]
|
||||
|
@ -1,13 +1,13 @@
|
||||
[Unit]
|
||||
Description=SoftEther VPN Client
|
||||
After=network.target auditd.service
|
||||
ConditionPathExists=![DIRECTORY]/do_not_run
|
||||
ConditionPathExists=!${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient/do_not_run
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-[DIRECTORY]
|
||||
ExecStart=[BINARY] start
|
||||
ExecStop=[BINARY] stop
|
||||
EnvironmentFile=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient
|
||||
ExecStart=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient start
|
||||
ExecStop=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient/vpnclient stop
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
|
||||
@ -16,7 +16,7 @@ PrivateTmp=yes
|
||||
ProtectHome=yes
|
||||
ProtectSystem=full
|
||||
ReadOnlyDirectories=/
|
||||
ReadWriteDirectories=-[DIRECTORY]
|
||||
ReadWriteDirectories=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnclient
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
||||
|
||||
[Install]
|
||||
|
@ -1,13 +1,13 @@
|
||||
[Unit]
|
||||
Description=SoftEther VPN Server
|
||||
After=network.target auditd.service
|
||||
ConditionPathExists=![DIRECTORY]/do_not_run
|
||||
ConditionPathExists=!${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver/do_not_run
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-[DIRECTORY]
|
||||
ExecStart=[BINARY] start
|
||||
ExecStop=[BINARY] stop
|
||||
EnvironmentFile=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver
|
||||
ExecStart=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver start
|
||||
ExecStop=${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver/vpnserver stop
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
|
||||
@ -16,7 +16,7 @@ PrivateTmp=yes
|
||||
ProtectHome=yes
|
||||
ProtectSystem=full
|
||||
ReadOnlyDirectories=/
|
||||
ReadWriteDirectories=-[DIRECTORY]
|
||||
ReadWriteDirectories=-${CPACK_PACKAGING_INSTALL_PREFIX}/libexec/softether/vpnserver
|
||||
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SYS_NICE CAP_SYS_ADMIN CAP_SETUID
|
||||
|
||||
[Install]
|
||||
|
Reference in New Issue
Block a user