fuse-transport 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fuse_transport-0.1.0/.gitignore +29 -0
- fuse_transport-0.1.0/CMakeLists.txt +332 -0
- fuse_transport-0.1.0/CMakePresets.json +40 -0
- fuse_transport-0.1.0/LICENSE +21 -0
- fuse_transport-0.1.0/PKG-INFO +146 -0
- fuse_transport-0.1.0/README.md +281 -0
- fuse_transport-0.1.0/bench/CMakeLists.txt +14 -0
- fuse_transport-0.1.0/bench/README.md +226 -0
- fuse_transport-0.1.0/bench/RESULTS.md +371 -0
- fuse_transport-0.1.0/bench/fuse_bench.cpp +392 -0
- fuse_transport-0.1.0/bench/fuse_filebench.cpp +749 -0
- fuse_transport-0.1.0/bench/fuse_latbench.cpp +315 -0
- fuse_transport-0.1.0/bench/fuse_netem.cpp +239 -0
- fuse_transport-0.1.0/bench/quic/Cargo.lock +1015 -0
- fuse_transport-0.1.0/bench/quic/Cargo.toml +20 -0
- fuse_transport-0.1.0/bench/quic/src/bin/quic_latbench.rs +229 -0
- fuse_transport-0.1.0/bench/quic/src/main.rs +223 -0
- fuse_transport-0.1.0/bench/run_file_benchmark.sh +110 -0
- fuse_transport-0.1.0/bench/run_network_matrix.sh +118 -0
- fuse_transport-0.1.0/cmake/FuseWolfSSL.cmake +100 -0
- fuse_transport-0.1.0/cmake/fuse.pc.in +19 -0
- fuse_transport-0.1.0/cmake/fuseConfig.cmake.in +11 -0
- fuse_transport-0.1.0/docs/ROADMAP.md +186 -0
- fuse_transport-0.1.0/docs/SDK.md +320 -0
- fuse_transport-0.1.0/docs/USAGE.md +193 -0
- fuse_transport-0.1.0/examples/CMakeLists.txt +27 -0
- fuse_transport-0.1.0/examples/echo_client.cpp +34 -0
- fuse_transport-0.1.0/examples/echo_server.c +49 -0
- fuse_transport-0.1.0/examples/quickstart_recv.cpp +44 -0
- fuse_transport-0.1.0/examples/quickstart_send.cpp +46 -0
- fuse_transport-0.1.0/examples/sdk/echo_client.c +62 -0
- fuse_transport-0.1.0/examples/sdk/echo_client.py +26 -0
- fuse_transport-0.1.0/examples/sdk/echo_server.c +86 -0
- fuse_transport-0.1.0/examples/sdk/echo_server.py +43 -0
- fuse_transport-0.1.0/examples/stage1_receiver.cpp +108 -0
- fuse_transport-0.1.0/examples/stage1_sender.cpp +165 -0
- fuse_transport-0.1.0/include/fuse/connection.h +44 -0
- fuse_transport-0.1.0/include/fuse/crypto.h +73 -0
- fuse_transport-0.1.0/include/fuse/fuse.h +13 -0
- fuse_transport-0.1.0/include/fuse/fuse.hpp +150 -0
- fuse_transport-0.1.0/include/fuse/packet.h +49 -0
- fuse_transport-0.1.0/include/fuse/proto/aux.hpp +80 -0
- fuse_transport-0.1.0/include/fuse/proto/block.hpp +62 -0
- fuse_transport-0.1.0/include/fuse/proto/congestion.hpp +115 -0
- fuse_transport-0.1.0/include/fuse/proto/dtls.hpp +133 -0
- fuse_transport-0.1.0/include/fuse/proto/hash.hpp +26 -0
- fuse_transport-0.1.0/include/fuse/proto/orchestrator.hpp +128 -0
- fuse_transport-0.1.0/include/fuse/proto/reassembly.hpp +77 -0
- fuse_transport-0.1.0/include/fuse/proto/receiver.hpp +84 -0
- fuse_transport-0.1.0/include/fuse/proto/registry.hpp +73 -0
- fuse_transport-0.1.0/include/fuse/proto/routing.hpp +66 -0
- fuse_transport-0.1.0/include/fuse/proto/send_queue.hpp +75 -0
- fuse_transport-0.1.0/include/fuse/proto/session_crypto.hpp +86 -0
- fuse_transport-0.1.0/include/fuse/proto/setup.hpp +180 -0
- fuse_transport-0.1.0/include/fuse/proto/spsc_queue.hpp +60 -0
- fuse_transport-0.1.0/include/fuse/proto/topology.hpp +46 -0
- fuse_transport-0.1.0/include/fuse/proto/udp.hpp +96 -0
- fuse_transport-0.1.0/include/fuse/proto/wire.hpp +118 -0
- fuse_transport-0.1.0/include/fuse/proto/worker.hpp +129 -0
- fuse_transport-0.1.0/include/fuse/sdk.h +204 -0
- fuse_transport-0.1.0/include/fuse/socket.h +52 -0
- fuse_transport-0.1.0/include/fuse/transfer.hpp +122 -0
- fuse_transport-0.1.0/include/fuse/types.h +36 -0
- fuse_transport-0.1.0/include/fuse/varint.h +38 -0
- fuse_transport-0.1.0/include/fuse/version.h.in +9 -0
- fuse_transport-0.1.0/pyproject.toml +120 -0
- fuse_transport-0.1.0/python/README.md +124 -0
- fuse_transport-0.1.0/python/fuse/__init__.py +415 -0
- fuse_transport-0.1.0/python/fuse/__main__.py +95 -0
- fuse_transport-0.1.0/python/fuse/_native.py +170 -0
- fuse_transport-0.1.0/python/fuse/py.typed +0 -0
- fuse_transport-0.1.0/python/tests/test_sdk.py +213 -0
- fuse_transport-0.1.0/scripts/install.sh +193 -0
- fuse_transport-0.1.0/scripts/make_release.sh +87 -0
- fuse_transport-0.1.0/src/connection.c +56 -0
- fuse_transport-0.1.0/src/crypto.c +159 -0
- fuse_transport-0.1.0/src/packet.c +104 -0
- fuse_transport-0.1.0/src/proto/aux.cpp +145 -0
- fuse_transport-0.1.0/src/proto/block.cpp +82 -0
- fuse_transport-0.1.0/src/proto/dtls.cpp +281 -0
- fuse_transport-0.1.0/src/proto/orchestrator.cpp +198 -0
- fuse_transport-0.1.0/src/proto/reassembly.cpp +74 -0
- fuse_transport-0.1.0/src/proto/receiver.cpp +131 -0
- fuse_transport-0.1.0/src/proto/registry.cpp +58 -0
- fuse_transport-0.1.0/src/proto/sdk.cpp +867 -0
- fuse_transport-0.1.0/src/proto/session_crypto.cpp +155 -0
- fuse_transport-0.1.0/src/proto/setup.cpp +236 -0
- fuse_transport-0.1.0/src/proto/topology.cpp +65 -0
- fuse_transport-0.1.0/src/proto/transfer.cpp +649 -0
- fuse_transport-0.1.0/src/proto/udp.cpp +235 -0
- fuse_transport-0.1.0/src/proto/worker.cpp +163 -0
- fuse_transport-0.1.0/src/socket.c +127 -0
- fuse_transport-0.1.0/src/varint.c +64 -0
- fuse_transport-0.1.0/tests/CMakeLists.txt +46 -0
- fuse_transport-0.1.0/tests/proto/test_aux.cpp +130 -0
- fuse_transport-0.1.0/tests/proto/test_block.cpp +110 -0
- fuse_transport-0.1.0/tests/proto/test_congestion.cpp +123 -0
- fuse_transport-0.1.0/tests/proto/test_dtls.cpp +201 -0
- fuse_transport-0.1.0/tests/proto/test_flags.cpp +200 -0
- fuse_transport-0.1.0/tests/proto/test_orchestrator.cpp +173 -0
- fuse_transport-0.1.0/tests/proto/test_receiver.cpp +120 -0
- fuse_transport-0.1.0/tests/proto/test_registry.cpp +71 -0
- fuse_transport-0.1.0/tests/proto/test_sdk.cpp +418 -0
- fuse_transport-0.1.0/tests/proto/test_session_crypto.cpp +206 -0
- fuse_transport-0.1.0/tests/proto/test_setup.cpp +309 -0
- fuse_transport-0.1.0/tests/proto/test_stage1_loopback.cpp +273 -0
- fuse_transport-0.1.0/tests/proto/test_topology.cpp +112 -0
- fuse_transport-0.1.0/tests/proto/test_transfer.cpp +167 -0
- fuse_transport-0.1.0/tests/proto/test_wire.cpp +57 -0
- fuse_transport-0.1.0/tests/proto/test_worker.cpp +196 -0
- fuse_transport-0.1.0/tests/test_crypto.cpp +109 -0
- fuse_transport-0.1.0/tests/test_packet.cpp +83 -0
- fuse_transport-0.1.0/tests/test_varint.cpp +79 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
build/
|
|
2
|
+
build-*/
|
|
3
|
+
out/
|
|
4
|
+
cmake-build-*/
|
|
5
|
+
CMakeFiles/
|
|
6
|
+
CMakeCache.txt
|
|
7
|
+
cmake_install.cmake
|
|
8
|
+
CTestTestfile.cmake
|
|
9
|
+
Testing/
|
|
10
|
+
compile_commands.json
|
|
11
|
+
_deps/
|
|
12
|
+
*.o
|
|
13
|
+
*.obj
|
|
14
|
+
*.so
|
|
15
|
+
*.so.*
|
|
16
|
+
*.dylib
|
|
17
|
+
*.a
|
|
18
|
+
*.dll
|
|
19
|
+
*.exe
|
|
20
|
+
.cache/
|
|
21
|
+
.vscode/
|
|
22
|
+
.idea/
|
|
23
|
+
|
|
24
|
+
# Rust benchmark baseline build artifacts
|
|
25
|
+
bench/quic/target/
|
|
26
|
+
dist/
|
|
27
|
+
dist-py/
|
|
28
|
+
__pycache__/
|
|
29
|
+
*.pyc
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
|
2
|
+
|
|
3
|
+
project(fuse
|
|
4
|
+
VERSION 0.1.0
|
|
5
|
+
DESCRIPTION "Fuse: an experimental low-latency transport protocol"
|
|
6
|
+
HOMEPAGE_URL "https://github.com/kamalkoushikd/fuse-nw"
|
|
7
|
+
LANGUAGES C CXX
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
|
11
|
+
set(FUSE_IS_TOP_LEVEL ON)
|
|
12
|
+
else()
|
|
13
|
+
set(FUSE_IS_TOP_LEVEL OFF)
|
|
14
|
+
endif()
|
|
15
|
+
|
|
16
|
+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
|
17
|
+
|
|
18
|
+
include(GNUInstallDirs)
|
|
19
|
+
include(CMakePackageConfigHelpers)
|
|
20
|
+
include(GenerateExportHeader)
|
|
21
|
+
|
|
22
|
+
set(CMAKE_C_STANDARD 11)
|
|
23
|
+
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
24
|
+
set(CMAKE_C_EXTENSIONS OFF)
|
|
25
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
26
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
27
|
+
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
28
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
29
|
+
|
|
30
|
+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
31
|
+
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type" FORCE)
|
|
32
|
+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel)
|
|
33
|
+
endif()
|
|
34
|
+
|
|
35
|
+
option(BUILD_SHARED_LIBS "Build fuse as a shared library" ON)
|
|
36
|
+
option(FUSE_BUILD_TESTS "Build the fuse test suite" ${FUSE_IS_TOP_LEVEL})
|
|
37
|
+
option(FUSE_BUILD_EXAMPLES "Build the fuse example programs" ${FUSE_IS_TOP_LEVEL})
|
|
38
|
+
option(FUSE_BUILD_BENCH "Build the fuse benchmark harness" ${FUSE_IS_TOP_LEVEL})
|
|
39
|
+
option(FUSE_WITH_CRYPTO "Enable the wolfSSL-backed handshake/crypto module" ON)
|
|
40
|
+
option(FUSE_FETCH_WOLFSSL "Fetch and build wolfSSL from source if it isn't found on the system" ON)
|
|
41
|
+
option(FUSE_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
|
|
42
|
+
|
|
43
|
+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
44
|
+
message(WARNING "fuse targets Linux; other platforms are untested")
|
|
45
|
+
endif()
|
|
46
|
+
|
|
47
|
+
if(FUSE_WITH_CRYPTO)
|
|
48
|
+
include(FuseWolfSSL)
|
|
49
|
+
endif()
|
|
50
|
+
|
|
51
|
+
configure_file(
|
|
52
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/include/fuse/version.h.in"
|
|
53
|
+
"${CMAKE_CURRENT_BINARY_DIR}/include/fuse/version.h"
|
|
54
|
+
@ONLY
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
add_library(fuse
|
|
58
|
+
src/varint.c
|
|
59
|
+
src/packet.c
|
|
60
|
+
src/socket.c
|
|
61
|
+
src/connection.c
|
|
62
|
+
src/crypto.c
|
|
63
|
+
)
|
|
64
|
+
add_library(fuse::fuse ALIAS fuse)
|
|
65
|
+
|
|
66
|
+
generate_export_header(fuse
|
|
67
|
+
BASE_NAME fuse
|
|
68
|
+
EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/include/fuse/export.h"
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
target_include_directories(fuse
|
|
72
|
+
PUBLIC
|
|
73
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
74
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
|
75
|
+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
76
|
+
PRIVATE
|
|
77
|
+
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
set_target_properties(fuse PROPERTIES
|
|
81
|
+
VERSION ${PROJECT_VERSION}
|
|
82
|
+
SOVERSION ${PROJECT_VERSION_MAJOR}
|
|
83
|
+
C_VISIBILITY_PRESET hidden
|
|
84
|
+
CXX_VISIBILITY_PRESET hidden
|
|
85
|
+
VISIBILITY_INLINES_HIDDEN ON
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
|
|
89
|
+
target_compile_options(fuse PRIVATE -Wall -Wextra)
|
|
90
|
+
if(FUSE_WARNINGS_AS_ERRORS)
|
|
91
|
+
target_compile_options(fuse PRIVATE -Werror)
|
|
92
|
+
endif()
|
|
93
|
+
endif()
|
|
94
|
+
|
|
95
|
+
if(FUSE_WITH_CRYPTO)
|
|
96
|
+
target_compile_definitions(fuse PUBLIC FUSE_WITH_CRYPTO=1)
|
|
97
|
+
target_link_libraries(fuse PRIVATE wolfssl::wolfssl)
|
|
98
|
+
else()
|
|
99
|
+
target_compile_definitions(fuse PUBLIC FUSE_WITH_CRYPTO=0)
|
|
100
|
+
endif()
|
|
101
|
+
|
|
102
|
+
# --- fuse_proto: the staged datagram transport (Fuse work plan) ------------
|
|
103
|
+
#
|
|
104
|
+
# This is the protocol described in the staged build plan: a custom
|
|
105
|
+
# datagram block layer with per-stream registries, bitmask loss tracking,
|
|
106
|
+
# and (in later stages) worker threads and per-stream congestion control.
|
|
107
|
+
# It is intentionally a separate target from the `fuse` C library above and
|
|
108
|
+
# does NOT link wolfSSL — encryption is an opt-in later stage (DTLS/PSK),
|
|
109
|
+
# not a dependency of the core data plane.
|
|
110
|
+
|
|
111
|
+
add_library(fuse_proto
|
|
112
|
+
src/proto/block.cpp
|
|
113
|
+
src/proto/aux.cpp
|
|
114
|
+
src/proto/registry.cpp
|
|
115
|
+
src/proto/receiver.cpp
|
|
116
|
+
src/proto/udp.cpp
|
|
117
|
+
src/proto/setup.cpp
|
|
118
|
+
src/proto/worker.cpp
|
|
119
|
+
src/proto/reassembly.cpp
|
|
120
|
+
src/proto/topology.cpp
|
|
121
|
+
src/proto/dtls.cpp
|
|
122
|
+
src/proto/orchestrator.cpp
|
|
123
|
+
src/proto/session_crypto.cpp
|
|
124
|
+
src/proto/transfer.cpp
|
|
125
|
+
src/proto/sdk.cpp
|
|
126
|
+
)
|
|
127
|
+
add_library(fuse::proto ALIAS fuse_proto)
|
|
128
|
+
|
|
129
|
+
# Stage 7: optional DTLS/PSK encryption. Compiled in when the wolfSSL crypto
|
|
130
|
+
# backend is enabled; encryption still defaults to OFF at runtime
|
|
131
|
+
# (encryption_required=false). Without it, requiring encryption fails closed
|
|
132
|
+
# rather than silently running in plaintext.
|
|
133
|
+
if(FUSE_WITH_CRYPTO)
|
|
134
|
+
target_compile_definitions(fuse_proto PUBLIC FUSE_PROTO_WITH_DTLS=1)
|
|
135
|
+
target_link_libraries(fuse_proto PRIVATE wolfssl::wolfssl)
|
|
136
|
+
else()
|
|
137
|
+
target_compile_definitions(fuse_proto PUBLIC FUSE_PROTO_WITH_DTLS=0)
|
|
138
|
+
endif()
|
|
139
|
+
|
|
140
|
+
find_package(Threads REQUIRED)
|
|
141
|
+
|
|
142
|
+
# Optional NUMA binding for topology-aware placement (Stage 6). Compiled in
|
|
143
|
+
# only when libnuma's development headers are present; otherwise the NUMA
|
|
144
|
+
# hook degrades to a documented no-op and CPU pinning still works.
|
|
145
|
+
find_path(FUSE_NUMA_INCLUDE_DIR numa.h)
|
|
146
|
+
find_library(FUSE_NUMA_LIBRARY numa)
|
|
147
|
+
if(FUSE_NUMA_INCLUDE_DIR AND FUSE_NUMA_LIBRARY)
|
|
148
|
+
message(STATUS "fuse: libnuma found, enabling NUMA-aware placement")
|
|
149
|
+
target_compile_definitions(fuse_proto PRIVATE FUSE_HAVE_NUMA=1)
|
|
150
|
+
target_include_directories(fuse_proto PRIVATE ${FUSE_NUMA_INCLUDE_DIR})
|
|
151
|
+
target_link_libraries(fuse_proto PRIVATE ${FUSE_NUMA_LIBRARY})
|
|
152
|
+
else()
|
|
153
|
+
message(STATUS "fuse: libnuma not found, NUMA hook will be a no-op (CPU pinning still active)")
|
|
154
|
+
target_compile_definitions(fuse_proto PRIVATE FUSE_HAVE_NUMA=0)
|
|
155
|
+
endif()
|
|
156
|
+
|
|
157
|
+
target_include_directories(fuse_proto
|
|
158
|
+
PUBLIC
|
|
159
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
160
|
+
# version.h is generated, so the build tree needs the binary dir too.
|
|
161
|
+
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
|
162
|
+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# Worker threads (Stage 3) use std::thread; Threads is part of the public
|
|
166
|
+
# link interface so downstream consumers of fuse::proto link pthread too.
|
|
167
|
+
target_link_libraries(fuse_proto PUBLIC Threads::Threads)
|
|
168
|
+
|
|
169
|
+
# NOTE: unlike the C `fuse` library, fuse_proto does not yet use an export
|
|
170
|
+
# header, so its public symbols must stay visible (default visibility) for
|
|
171
|
+
# the shared library to export them. Revisit with generate_export_header
|
|
172
|
+
# once the Stage 1+ API surface settles.
|
|
173
|
+
set_target_properties(fuse_proto PROPERTIES
|
|
174
|
+
VERSION ${PROJECT_VERSION}
|
|
175
|
+
SOVERSION ${PROJECT_VERSION_MAJOR}
|
|
176
|
+
# Without this the target exports as `fuse::fuse_proto`, since the
|
|
177
|
+
# `fuse::proto` ALIAS above exists only in the build tree. Downstream
|
|
178
|
+
# users would then have to link a different name than the one used
|
|
179
|
+
# in-tree and in the docs.
|
|
180
|
+
EXPORT_NAME proto
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
184
|
+
target_compile_options(fuse_proto PRIVATE -Wall -Wextra)
|
|
185
|
+
if(FUSE_WARNINGS_AS_ERRORS)
|
|
186
|
+
target_compile_options(fuse_proto PRIVATE -Werror)
|
|
187
|
+
endif()
|
|
188
|
+
endif()
|
|
189
|
+
|
|
190
|
+
# --- Installation ---------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
# Let the installed libraries find their siblings (notably libwolfssl, which
|
|
193
|
+
# is installed alongside them) from wherever the package ends up.
|
|
194
|
+
#
|
|
195
|
+
# This matters more than it looks: modern linkers emit RUNPATH rather than
|
|
196
|
+
# RPATH, and the loader consults RUNPATH only for an object's *direct*
|
|
197
|
+
# dependencies. So an executable's rpath does NOT help libfuse_proto.so find
|
|
198
|
+
# libwolfssl.so — without $ORIGIN here, anything installed outside the system
|
|
199
|
+
# library path fails at run time with a missing-library error, even though it
|
|
200
|
+
# linked cleanly.
|
|
201
|
+
set_target_properties(fuse fuse_proto PROPERTIES
|
|
202
|
+
INSTALL_RPATH "$ORIGIN"
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
install(TARGETS fuse fuse_proto
|
|
206
|
+
EXPORT fuse-targets
|
|
207
|
+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
208
|
+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
209
|
+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
install(DIRECTORY include/fuse
|
|
213
|
+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
214
|
+
FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp"
|
|
215
|
+
)
|
|
216
|
+
install(FILES
|
|
217
|
+
"${CMAKE_CURRENT_BINARY_DIR}/include/fuse/version.h"
|
|
218
|
+
"${CMAKE_CURRENT_BINARY_DIR}/include/fuse/export.h"
|
|
219
|
+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fuse
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
install(EXPORT fuse-targets
|
|
223
|
+
FILE fuse-targets.cmake
|
|
224
|
+
NAMESPACE fuse::
|
|
225
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fuse
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
configure_package_config_file(
|
|
229
|
+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/fuseConfig.cmake.in"
|
|
230
|
+
"${CMAKE_CURRENT_BINARY_DIR}/fuseConfig.cmake"
|
|
231
|
+
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fuse
|
|
232
|
+
)
|
|
233
|
+
write_basic_package_version_file(
|
|
234
|
+
"${CMAKE_CURRENT_BINARY_DIR}/fuseConfigVersion.cmake"
|
|
235
|
+
VERSION ${PROJECT_VERSION}
|
|
236
|
+
COMPATIBILITY SameMajorVersion
|
|
237
|
+
)
|
|
238
|
+
install(FILES
|
|
239
|
+
"${CMAKE_CURRENT_BINARY_DIR}/fuseConfig.cmake"
|
|
240
|
+
"${CMAKE_CURRENT_BINARY_DIR}/fuseConfigVersion.cmake"
|
|
241
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/fuse
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
# fuse.pc's `prefix=` line must reflect the prefix actually in effect
|
|
245
|
+
# at install time (which `cmake --install --prefix` and CPack's
|
|
246
|
+
# packaging-time re-rooting both override), not the prefix seen at
|
|
247
|
+
# configure time. configure_file() alone would bake in the latter, so
|
|
248
|
+
# the substitution is deferred into an install(CODE) script, where
|
|
249
|
+
# CMAKE_INSTALL_PREFIX is re-evaluated as the real target of this
|
|
250
|
+
# particular install.
|
|
251
|
+
if(FUSE_WITH_CRYPTO)
|
|
252
|
+
set(FUSE_PC_REQUIRES_PRIVATE "wolfssl")
|
|
253
|
+
else()
|
|
254
|
+
set(FUSE_PC_REQUIRES_PRIVATE "")
|
|
255
|
+
endif()
|
|
256
|
+
|
|
257
|
+
install(CODE "
|
|
258
|
+
file(READ \"${CMAKE_CURRENT_SOURCE_DIR}/cmake/fuse.pc.in\" _fuse_pc_content)
|
|
259
|
+
string(REPLACE \"@CMAKE_INSTALL_PREFIX@\" \"\${CMAKE_INSTALL_PREFIX}\" _fuse_pc_content \"\${_fuse_pc_content}\")
|
|
260
|
+
string(REPLACE \"@CMAKE_INSTALL_LIBDIR@\" \"${CMAKE_INSTALL_LIBDIR}\" _fuse_pc_content \"\${_fuse_pc_content}\")
|
|
261
|
+
string(REPLACE \"@CMAKE_INSTALL_INCLUDEDIR@\" \"${CMAKE_INSTALL_INCLUDEDIR}\" _fuse_pc_content \"\${_fuse_pc_content}\")
|
|
262
|
+
string(REPLACE \"@PROJECT_DESCRIPTION@\" \"${PROJECT_DESCRIPTION}\" _fuse_pc_content \"\${_fuse_pc_content}\")
|
|
263
|
+
string(REPLACE \"@PROJECT_VERSION@\" \"${PROJECT_VERSION}\" _fuse_pc_content \"\${_fuse_pc_content}\")
|
|
264
|
+
string(REPLACE \"@PROJECT_HOMEPAGE_URL@\" \"${PROJECT_HOMEPAGE_URL}\" _fuse_pc_content \"\${_fuse_pc_content}\")
|
|
265
|
+
string(REPLACE \"@FUSE_PC_REQUIRES_PRIVATE@\" \"${FUSE_PC_REQUIRES_PRIVATE}\" _fuse_pc_content \"\${_fuse_pc_content}\")
|
|
266
|
+
file(WRITE \"${CMAKE_CURRENT_BINARY_DIR}/fuse.pc\" \"\${_fuse_pc_content}\")
|
|
267
|
+
")
|
|
268
|
+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/fuse.pc"
|
|
269
|
+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
# --- Subprojects -----------------------------------------------------------
|
|
273
|
+
|
|
274
|
+
if(FUSE_BUILD_TESTS)
|
|
275
|
+
enable_testing()
|
|
276
|
+
add_subdirectory(tests)
|
|
277
|
+
endif()
|
|
278
|
+
|
|
279
|
+
if(FUSE_BUILD_EXAMPLES)
|
|
280
|
+
add_subdirectory(examples)
|
|
281
|
+
endif()
|
|
282
|
+
|
|
283
|
+
if(FUSE_BUILD_BENCH)
|
|
284
|
+
add_subdirectory(bench)
|
|
285
|
+
endif()
|
|
286
|
+
|
|
287
|
+
# --- Packaging (CPack) ------------------------------------------------------
|
|
288
|
+
#
|
|
289
|
+
# Produces a single combined package per generator (library, headers,
|
|
290
|
+
# CMake/pkg-config files, and - since FUSE_FETCH_WOLFSSL builds and
|
|
291
|
+
# installs its own wolfSSL alongside fuse - that too). This is
|
|
292
|
+
# deliberately not split into separate runtime/-dev packages yet: doing
|
|
293
|
+
# that properly would require retrofitting COMPONENT tags onto
|
|
294
|
+
# wolfSSL's own install() rules, which fuse doesn't control. A single
|
|
295
|
+
# "install everything needed to build against and run fuse" package is
|
|
296
|
+
# the standard approach for a pre-1.0 library distributed outside of a
|
|
297
|
+
# distro's own repositories.
|
|
298
|
+
|
|
299
|
+
if(FUSE_IS_TOP_LEVEL)
|
|
300
|
+
set(CPACK_PACKAGE_NAME "fuse")
|
|
301
|
+
set(CPACK_PACKAGE_VENDOR "The Fuse Project")
|
|
302
|
+
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
|
|
303
|
+
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
|
|
304
|
+
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
|
|
305
|
+
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PROJECT_DESCRIPTION}")
|
|
306
|
+
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
|
307
|
+
set(CPACK_PACKAGE_CONTACT "The Fuse Project <kamalkoushik24@gmail.com>")
|
|
308
|
+
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr")
|
|
309
|
+
set(CPACK_STRIP_FILES ON)
|
|
310
|
+
|
|
311
|
+
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
|
|
312
|
+
set(CPACK_DEBIAN_PACKAGE_SECTION "libdevel")
|
|
313
|
+
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
|
|
314
|
+
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
|
|
315
|
+
|
|
316
|
+
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
|
|
317
|
+
set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
|
|
318
|
+
set(CPACK_RPM_PACKAGE_AUTOREQPROV ON)
|
|
319
|
+
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
|
|
320
|
+
|
|
321
|
+
set(CPACK_GENERATOR "TGZ")
|
|
322
|
+
find_program(FUSE_DPKG_DEB_EXECUTABLE dpkg-deb)
|
|
323
|
+
find_program(FUSE_RPMBUILD_EXECUTABLE rpmbuild)
|
|
324
|
+
if(FUSE_DPKG_DEB_EXECUTABLE)
|
|
325
|
+
list(APPEND CPACK_GENERATOR "DEB")
|
|
326
|
+
endif()
|
|
327
|
+
if(FUSE_RPMBUILD_EXECUTABLE)
|
|
328
|
+
list(APPEND CPACK_GENERATOR "RPM")
|
|
329
|
+
endif()
|
|
330
|
+
|
|
331
|
+
include(CPack)
|
|
332
|
+
endif()
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 6,
|
|
3
|
+
"cmakeMinimumRequired": { "major": 3, "minor": 21, "patch": 0 },
|
|
4
|
+
"configurePresets": [
|
|
5
|
+
{
|
|
6
|
+
"name": "default",
|
|
7
|
+
"displayName": "Default (Release)",
|
|
8
|
+
"binaryDir": "${sourceDir}/build/${presetName}",
|
|
9
|
+
"cacheVariables": {
|
|
10
|
+
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"name": "debug",
|
|
15
|
+
"displayName": "Debug",
|
|
16
|
+
"inherits": "default",
|
|
17
|
+
"cacheVariables": {
|
|
18
|
+
"CMAKE_BUILD_TYPE": "Debug"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "no-crypto",
|
|
23
|
+
"displayName": "No crypto (fast core-only build, no wolfSSL fetch)",
|
|
24
|
+
"inherits": "default",
|
|
25
|
+
"cacheVariables": {
|
|
26
|
+
"FUSE_WITH_CRYPTO": "OFF"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"buildPresets": [
|
|
31
|
+
{ "name": "default", "configurePreset": "default" },
|
|
32
|
+
{ "name": "debug", "configurePreset": "debug" },
|
|
33
|
+
{ "name": "no-crypto", "configurePreset": "no-crypto" }
|
|
34
|
+
],
|
|
35
|
+
"testPresets": [
|
|
36
|
+
{ "name": "default", "configurePreset": "default", "output": { "outputOnFailure": true } },
|
|
37
|
+
{ "name": "debug", "configurePreset": "debug", "output": { "outputOnFailure": true } },
|
|
38
|
+
{ "name": "no-crypto", "configurePreset": "no-crypto", "output": { "outputOnFailure": true } }
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The Fuse Project Authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fuse-transport
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Socket-style Python bindings for the Fuse UDP transport protocol
|
|
5
|
+
Keywords: networking,transport,udp,protocol,sockets,quic
|
|
6
|
+
Author: Kamal Koushik D
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
License-File: LICENSE
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Topic :: System :: Networking
|
|
15
|
+
Classifier: Typing :: Typed
|
|
16
|
+
Project-URL: Homepage, https://github.com/kamalkoushikd/fuse-nw
|
|
17
|
+
Project-URL: Documentation, https://github.com/kamalkoushikd/fuse-nw/blob/main/docs/SDK.md
|
|
18
|
+
Project-URL: Source, https://github.com/kamalkoushikd/fuse-nw
|
|
19
|
+
Project-URL: Issues, https://github.com/kamalkoushikd/fuse-nw/issues
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# fuse-transport
|
|
24
|
+
|
|
25
|
+
Socket-style Python bindings for [Fuse](https://github.com/kamalkoushikd/fuse-nw),
|
|
26
|
+
an experimental UDP transport with **per-stream congestion control** — so a
|
|
27
|
+
stalled bulk transfer cannot throttle unrelated latency-sensitive traffic on
|
|
28
|
+
the same session, which is the thing QUIC's connection-wide controller cannot
|
|
29
|
+
do.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pip install fuse-transport
|
|
33
|
+
# or
|
|
34
|
+
uv add fuse-transport
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Linux only. Wheels bundle the compiled transport and its wolfSSL, so there is
|
|
38
|
+
no compiler, no CMake, and no system library to install.
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import fuse
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Server
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
import threading
|
|
48
|
+
import fuse
|
|
49
|
+
|
|
50
|
+
def handle(conn):
|
|
51
|
+
with conn:
|
|
52
|
+
for message in conn: # iterates until the peer closes
|
|
53
|
+
conn.send(b"ECHO:" + message)
|
|
54
|
+
|
|
55
|
+
with fuse.listen(port=4433) as server:
|
|
56
|
+
for conn in server: # iterates incoming connections
|
|
57
|
+
threading.Thread(target=handle, args=(conn,), daemon=True).start()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Client
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
import fuse
|
|
64
|
+
|
|
65
|
+
with fuse.connect("192.0.2.10", 4433, timeout=5) as conn:
|
|
66
|
+
conn.send(b"hello") # str is UTF-8 encoded for you
|
|
67
|
+
print(conn.recv(timeout=5).decode())
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Two ways this differs from a TCP socket
|
|
71
|
+
|
|
72
|
+
**Messages, not a byte stream.** One `send` becomes exactly one `recv`.
|
|
73
|
+
Boundaries are preserved (like `SOCK_SEQPACKET`), so you never length-prefix,
|
|
74
|
+
never scan for delimiters, and a partial read cannot happen.
|
|
75
|
+
|
|
76
|
+
**`send` means delivered.** It returns once the peer has acknowledged the
|
|
77
|
+
message, not when it was queued locally. A successful send is proof of arrival.
|
|
78
|
+
|
|
79
|
+
Retransmission, ordering, congestion control and adaptive block sizing are
|
|
80
|
+
handled underneath.
|
|
81
|
+
|
|
82
|
+
## Encryption
|
|
83
|
+
|
|
84
|
+
Set the same key on both ends for AES-256-GCM:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
fuse.listen(port=4433, key="shared-secret")
|
|
88
|
+
fuse.connect("192.0.2.10", 4433, key="shared-secret")
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A client presenting the wrong key is rejected during the handshake and never
|
|
92
|
+
exchanges data. Note this is a **pre-shared key, so there is no forward
|
|
93
|
+
secrecy**: someone who records traffic and later obtains the key can decrypt
|
|
94
|
+
it. If that matters, run Fuse inside a tunnel that provides it.
|
|
95
|
+
|
|
96
|
+
## API
|
|
97
|
+
|
|
98
|
+
| call | notes |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `fuse.listen(port, bind="0.0.0.0", key=None, timeout=None)` | → `Listener` |
|
|
101
|
+
| `fuse.connect(host, port, key=None, timeout=None)` | → `Connection` |
|
|
102
|
+
| `Listener.accept(timeout=None)` | → `Connection`; iterate the listener for a loop |
|
|
103
|
+
| `Listener.port` | actual port (pass `port=0` to let the OS pick) |
|
|
104
|
+
| `Connection.send(data)` | `bytes` / `bytearray` / `memoryview` / `str` |
|
|
105
|
+
| `Connection.recv(timeout=None)` | → `bytes`; iterate for a message loop |
|
|
106
|
+
| `Connection.peer` | `(address, port)` |
|
|
107
|
+
| `Connection.stats` | counters, including `rtt_us` |
|
|
108
|
+
| `Connection.closed` | `bool` |
|
|
109
|
+
| `.close()` | also via `with` blocks; idempotent |
|
|
110
|
+
|
|
111
|
+
Timeouts are **seconds** (float): `None` waits indefinitely, `0` polls.
|
|
112
|
+
|
|
113
|
+
Exceptions all derive from `fuse.FuseError`: `Timeout`, `ConnectionClosed`,
|
|
114
|
+
`AuthError`, `ConfigError`, `MessageTooLarge`.
|
|
115
|
+
|
|
116
|
+
Blocking calls release the GIL, so other threads keep running while one is
|
|
117
|
+
parked in `recv`.
|
|
118
|
+
|
|
119
|
+
## Checking an install
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
python -m fuse selftest
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Prints the version, which library got loaded, and whether encryption is
|
|
126
|
+
available, then runs a loopback round-trip — which also confirms this kernel
|
|
127
|
+
supports the socket features Fuse needs.
|
|
128
|
+
|
|
129
|
+
## Also in this project
|
|
130
|
+
|
|
131
|
+
A C/C++ SDK with the same API (`#include <fuse/sdk.h>`), and a separate
|
|
132
|
+
higher-throughput API for moving whole files or large buffers. Both come from
|
|
133
|
+
the standalone installer:
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
curl -fsSL https://github.com/kamalkoushikd/fuse-nw/releases/latest/download/install.sh | sh
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- **Full SDK guide:** https://github.com/kamalkoushikd/fuse-nw/blob/main/docs/SDK.md
|
|
140
|
+
- **Benchmarks vs QUIC:** https://github.com/kamalkoushikd/fuse-nw/blob/main/bench/RESULTS.md
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
MIT. Note that the bundled wolfSSL is GPLv2 (a commercial license is
|
|
145
|
+
available from wolfSSL Inc.), so a wheel that links it is a combined work
|
|
146
|
+
subject to the GPL when redistributed.
|