Permalink
Browse files

Initial SVN import of n2n v2

  • Loading branch information...
lucaderi committed Oct 23, 2016
1 parent faaa47e commit b1e9ce6d2a77e453e771ed21670a80effc830a16
Showing with 19,669 additions and 0 deletions.
  1. +131 −0 CMakeLists.txt
  2. +674 −0 COPYING
  3. +255 −0 HACKING
  4. +50 −0 INSTALL
  5. +101 −0 Makefile
  6. +6 −0 NEW_FEATURES.txt
  7. +112 −0 README.md
  8. +110 −0 benchmark.c
  9. +7 −0 debian/README.Debian
  10. +27 −0 debian/changelog
  11. +1 −0 debian/compat
  12. +51 −0 debian/control
  13. +23 −0 debian/copyright
  14. +21 −0 debian/n2n-edge.default
  15. +1 −0 debian/n2n-edge.docs
  16. +129 −0 debian/n2n-edge.init
  17. +1 −0 debian/n2n-edge.install
  18. +2 −0 debian/n2n-edge.manpages
  19. +121 −0 debian/n2n-supernode.init
  20. +1 −0 debian/n2n-supernode.install
  21. +1 −0 debian/n2n-supernode.manpages
  22. +5 −0 debian/rules
  23. +208 −0 edge.8
  24. +2,412 −0 edge.c
  25. +44 −0 gen_keyfile.py
  26. +417 −0 lzoconf.h
  27. +1,807 −0 lzodefs.h
  28. +4,112 −0 minilzo.c
  29. +106 −0 minilzo.h
  30. +455 −0 n2n.c
  31. +254 −0 n2n.h
  32. +52 −0 n2n.spec
  33. +203 −0 n2n_keyfile.c
  34. +101 −0 n2n_keyfile.h
  35. +78 −0 n2n_transforms.h
  36. +156 −0 n2n_v2.7
  37. +321 −0 n2n_wire.h
  38. +55 −0 openwrt/kamikaze/Makefile
  39. +30 −0 scripts/mk_SRPM.sh
  40. +46 −0 scripts/mk_deb.sh
  41. +116 −0 scripts/mk_tar.sh
  42. +793 −0 sn.c
  43. +43 −0 supernode.1
  44. +24 −0 test.c
  45. +597 −0 transform_aes.c
  46. +84 −0 transform_null.c
  47. +487 −0 transform_tf.c
  48. +132 −0 tuntap_freebsd.c
  49. +165 −0 tuntap_linux.c
  50. +146 −0 tuntap_netbsd.c
  51. +132 −0 tuntap_osx.c
  52. +1,031 −0 twofish.c
  53. +292 −0 twofish.h
  54. +3 −0 version.c
  55. +4 −0 win32/CMakeLists.txt
  56. +26 −0 win32/DotNet/n2n.sln
  57. BIN win32/DotNet/n2n.suo
  58. +300 −0 win32/DotNet/n2n.vcproj
  59. +226 −0 win32/DotNet/supernode.vcproj
  60. +1,074 −0 win32/getopt.c
  61. +169 −0 win32/getopt.h
  62. +188 −0 win32/getopt1.c
  63. +109 −0 win32/n2n_win32.h
  64. +3 −0 win32/version-msvc.c
  65. +310 −0 win32/wintap.c
  66. +67 −0 win32/wintap.h
  67. +461 −0 wire.c
@@ -0,0 +1,131 @@
project(n2n)
cmake_minimum_required(VERSION 2.6)

# N2n information
set(N2N_VERSION 2.1.0)
set(N2N_OSNAME ${CMAKE_SYSTEM})

# N2n specific params
if(NOT DEFINED N2N_OPTION_AES)
set(N2N_OPTION_AES ON)
endif(NOT DEFINED N2N_OPTION_AES)

add_definitions(-DN2N_VERSION='\"${N2N_VERSION}\"' -DN2N_OSNAME='\"${N2N_OSNAME}\"')

if(N2N_OPTION_AES)
add_definitions(-DN2N_HAVE_AES)
endif(N2N_OPTION_AES)

# Build information
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS OFF)
endif(NOT DEFINED BUILD_SHARED_LIBS)

if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE None)
endif(NOT DEFINED CMAKE_BUILD_TYPE)
#set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_BUILD_TYPE Release)

#Ultrasparc64 users experiencing SIGBUS should try the following gcc options
#(thanks to Robert Gibbon)
#PLATOPTS_SPARC64=-mcpu=ultrasparc -pipe -fomit-frame-pointer -ffast-math -finline-functions -fweb -frename-registers -mapp-regs

# None
set(CMAKE_C_FLAGS "-Wall -Wshadow -Wpointer-arith -Wmissing-declarations -Wnested-externs")
set(CMAKE_CXX_FLAGS "-Wall -Wshadow -Wpointer-arith -Wmissing-declarations -Wnested-externs")
# Debug
set(CMAKE_C_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
# Release
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")

## DEBUG FOR CMAKE
#message(${N2N_VERSION})
#message(${N2N_OSNAME})
##message(${CMAKE_BUILD_TYPE})
#message(${N2N_OPTION_AES})
## DEBUG FOR CMAKE

add_library(n2n n2n.c
n2n_keyfile.c
wire.c
minilzo.c
twofish.c
transform_null.c
transform_tf.c
transform_aes.c
tuntap_freebsd.c
tuntap_netbsd.c
tuntap_linux.c
tuntap_osx.c
version.c
)

if(DEFINED WIN32)
add_subdirectory(win32)
target_link_libraries(n2n n2n_win32)
endif(DEFINED WIN32)

if(N2N_OPTION_AES)
target_link_libraries(n2n crypto)
endif(N2N_OPTION_AES)

# For Solaris (or OpenSolaris?)
#target_link_libraries(n2n socket nsl)

add_executable(edge edge.c)
target_link_libraries(edge n2n)

add_executable(supernode sn.c)
target_link_libraries(supernode n2n)

add_executable(test test.c)
target_link_libraries(test n2n)

add_executable(benchmark benchmark.c)
target_link_libraries(benchmark n2n)

install(TARGETS edge supernode
RUNTIME DESTINATION sbin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

# Documentation
if(DEFINED UNIX)
add_dependencies(n2n doc)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc)
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/edge.8.gz
COMMAND gzip -c ${PROJECT_SOURCE_DIR}/edge.8 > ${PROJECT_BINARY_DIR}/doc/edge.8.gz
DEPENDS ${PROJECT_SOURCE_DIR}/edge.8
)

add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/supernode.1.gz
COMMAND gzip -c ${PROJECT_SOURCE_DIR}/supernode.1 > ${PROJECT_BINARY_DIR}/doc/supernode.1.gz
DEPENDS ${PROJECT_SOURCE_DIR}/supernode.1
)

add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc/n2n_v2.7.gz
COMMAND gzip -c ${PROJECT_SOURCE_DIR}/n2n_v2.7 > ${PROJECT_BINARY_DIR}/doc/n2n_v2.7.gz
DEPENDS ${PROJECT_SOURCE_DIR}/n2n_v2.7
)

add_custom_target(doc DEPENDS ${PROJECT_BINARY_DIR}/doc/edge.8.gz
${PROJECT_BINARY_DIR}/doc/supernode.1.gz
${PROJECT_BINARY_DIR}/doc/n2n_v2.7.gz
)

set_source_files_properties(${PROJECT_BINARY_DIR}/doc/edge.8.gz
${PROJECT_BINARY_DIR}/doc/supernode.1.gz
${PROJECT_BINARY_DIR}/doc/n2n_v2.7.gz
PROPERTIES GENERATED 1)

install(FILES ${PROJECT_BINARY_DIR}/doc/edge.8.gz
DESTINATION /usr/share/man8)
install(FILES ${PROJECT_BINARY_DIR}/doc/supernode.1.gz
DESTINATION /usr/share/man1)
install(FILES ${PROJECT_BINARY_DIR}/doc/n2n_v2.7.gz
DESTINATION /usr/share/man7)
endif(DEFINED UNIX)
Oops, something went wrong.

0 comments on commit b1e9ce6

Please sign in to comment.