Skip to content

Commit c2c2692

Browse files
committed
Switch to built-in FEC in Botan3
1 parent 7b8a311 commit c2c2692

23 files changed

+328
-1521
lines changed

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
1010

1111
if(${CMAKE_SYSTEM_NAME} MATCHES "^DragonFly?" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
1212
include_directories("/usr/local/include")
13-
include_directories("/usr/local/include/botan-2")
13+
include_directories("/usr/local/include/botan-3")
1414
endif()
1515
if(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
1616
include_directories("/usr/pkg/include")
17-
include_directories("/usr/pkg/include/botan-2")
17+
include_directories("/usr/pkg/include/botan-3")
1818
endif()
1919
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
20-
include_directories("/usr/include/botan-2")
20+
include_directories("/usr/include/botan-3")
2121
endif()
2222

2323
find_package(Threads REQUIRED)
@@ -35,6 +35,8 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
3535
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
3636
endif()
3737

38+
add_compile_options("$<$<CXX_COMPILER_ID:AppleClang,Clang>:-fexperimental-library>")
39+
3840
add_executable(${PROJECT_NAME} src/main.cpp)
3941

4042
add_subdirectory(src)

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,6 @@ root soft nofile 300000
521521
### 线程池
522522
udphop 使用的线程池来自于 [task-thread-pool](https://github.com/alugowski/task-thread-pool),用于多连接时的并行加解密处理。
523523
524-
### FEC
525-
526-
UDPHop 所用的 FEC 采用 Reed-Solomon 编码, FEC 代码库来自于 [fecpp](https://github.com/randombit/fecpp),并作了些许修改。
527-
528524
### 版面
529525
代码写得很随意,想到哪写到哪,因此版面混乱。
530526

README_EN.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,6 @@ root soft nofile 300000
519519
### Thread Pool
520520
The thread pool used by UDPHop comes from [task-thread-pool](https://github.com/alugowski/task-thread-pool), uses for parallel encryption and decryption processing in multiple connections.
521521
522-
### FEC
523-
524-
The FEC used by UDPHop uses Reed-Solomon coding, and the FEC code library comes from [fecpp](https://github.com/randombit/fecpp) with some modifications.
525-
526522
### Layout
527523
The code is written very casually, wherever I think of writing, so the layout is messy.
528524

sln/udphop/udphop.vcxproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
</ProjectConfiguration>
2020
</ItemGroup>
2121
<ItemGroup>
22-
<ClCompile Include="..\..\src\3rd_party\fecpp.cpp" />
23-
<ClCompile Include="..\..\src\3rd_party\fecpp_ssse3.cpp" />
2422
<ClCompile Include="..\..\src\main.cpp" />
2523
<ClCompile Include="..\..\src\modes\client.cpp" />
2624
<ClCompile Include="..\..\src\networks\connections.cpp" />
@@ -33,7 +31,6 @@
3331
<ClCompile Include="..\..\src\shares\share_defines.cpp" />
3432
</ItemGroup>
3533
<ItemGroup>
36-
<ClInclude Include="..\..\src\3rd_party\fecpp.hpp" />
3734
<ClInclude Include="..\..\src\3rd_party\task_thread_pool.hpp" />
3835
<ClInclude Include="..\..\src\modes\client.hpp" />
3936
<ClInclude Include="..\..\src\networks\connections.hpp" />

sln/udphop/udphop.vcxproj.filters

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@
5757
<ClCompile Include="..\..\src\shares\configurations.cpp">
5858
<Filter>Source Files\shares</Filter>
5959
</ClCompile>
60-
<ClCompile Include="..\..\src\3rd_party\fecpp.cpp">
61-
<Filter>Source Files\3rd_party</Filter>
62-
</ClCompile>
63-
<ClCompile Include="..\..\src\3rd_party\fecpp_ssse3.cpp">
64-
<Filter>Source Files\3rd_party</Filter>
65-
</ClCompile>
6660
<ClCompile Include="..\..\src\modes\server.cpp">
6761
<Filter>Source Files\modes</Filter>
6862
</ClCompile>
@@ -101,9 +95,6 @@
10195
<ClInclude Include="..\..\src\shares\configurations.hpp">
10296
<Filter>Header Files\shares</Filter>
10397
</ClInclude>
104-
<ClInclude Include="..\..\src\3rd_party\fecpp.hpp">
105-
<Filter>Header Files\3rd_party</Filter>
106-
</ClInclude>
10798
<ClInclude Include="..\..\src\3rd_party\task_thread_pool.hpp">
10899
<Filter>Header Files\3rd_party</Filter>
109100
</ClInclude>

src/3rd_party/CMakeLists.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
set(THISLIB_NAME THRID_PARTIES)
1+
#set(THISLIB_NAME THRID_PARTIES)
22

3-
add_library(${THISLIB_NAME} STATIC "fecpp.cpp" "fecpp_ssse3.cpp")
4-
string( TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" cmake_system_processor_lower )
5-
if (cmake_system_processor_lower MATCHES "x86" OR cmake_system_processor_lower MATCHES "amd64" OR cmake_system_processor_lower MATCHES "i[36]86")
6-
set_source_files_properties(fecpp_ssse3.cpp PROPERTIES COMPILE_FLAGS "$<$<NOT:$<C_COMPILER_ID:MSVC>:-mssse3>")
7-
set_source_files_properties(fecpp_ssse3.cpp PROPERTIES COMPILE_FLAGS "$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-mssse3>")
8-
endif()
3+
#add_library(${THISLIB_NAME} STATIC "fecpp.cpp" "fecpp_ssse3.cpp")
4+
#string( TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" cmake_system_processor_lower )
5+
#if (cmake_system_processor_lower MATCHES "x86" OR cmake_system_processor_lower MATCHES "amd64" OR cmake_system_processor_lower MATCHES "i[36]86")
6+
# set_source_files_properties(fecpp_ssse3.cpp PROPERTIES COMPILE_FLAGS "$<$<NOT:$<C_COMPILER_ID:MSVC>:-mssse3>")
7+
# set_source_files_properties(fecpp_ssse3.cpp PROPERTIES COMPILE_FLAGS "$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-mssse3>")
8+
#endif()
99

10-
target_link_libraries(${THISLIB_NAME} PRIVATE SHAREDEFINES)
11-
set(THREADS_PREFER_PTHREAD_FLAG ON)
12-
find_package(Threads REQUIRED)
13-
target_link_libraries(${THISLIB_NAME} PUBLIC Threads::Threads)
10+
#target_link_libraries(${THISLIB_NAME} PRIVATE SHAREDEFINES)
11+
#set(THREADS_PREFER_PTHREAD_FLAG ON)
12+
#find_package(Threads REQUIRED)
13+
#target_link_libraries(${THISLIB_NAME} PUBLIC Threads::Threads)

src/3rd_party/fec_license.txt

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)