Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
# its own sanitizer flags for local use). WORKDIR is the project root.

# fuzz_parse: the OSC packet parser (untrusted bytes -> ReceivedPacket/...).
$CXX $CXXFLAGS -std=c++17 -I osctap \
$CXX $CXXFLAGS -std=c++17 -I . \
fuzz/fuzz_parse.cpp \
$LIB_FUZZING_ENGINE \
-o "$OUT/fuzz_parse"

# fuzz_deframe: the OSC-over-TCP stream deframer + parser (length-prefix
# reassembly across arbitrary chunk boundaries, bounded-buffer / DoS guard).
$CXX $CXXFLAGS -std=c++17 -I osctap \
$CXX $CXXFLAGS -std=c++17 -I . \
fuzz/fuzz_deframe.cpp \
$LIB_FUZZING_ENGINE \
-o "$OUT/fuzz_deframe"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
- name: Cross-compile the socket loopback tests for win32
run: |
for t in OscUdpTest OscTcpTest OscMulticastTest; do
x86_64-w64-mingw32-g++ -std=c++17 -O1 -static -I . -I osctap \
x86_64-w64-mingw32-g++ -std=c++17 -O1 -static -I . \
tests/$t.cpp -o $t.exe -lws2_32 -lwinmm
done

Expand Down
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ add_library(tap::osc ALIAS oscpack)

# Public headers now live under osctap/ (prefix <osctap/...>); the top-level
# oscpack/ tree is a thin redirect shim kept for <oscpack/...> compatibility.
# Adding osctap/ to the search path lets the in-tree quoted "osc/..."/"ip/..."
# includes resolve, while the repo root (added to the INTERFACE below) keeps
# both <osctap/...> and the deprecated <oscpack/...> prefixes working.
include_directories(osctap)

# Every include — in the headers themselves and in the in-tree consumers — is
# written with the full "osctap/..." prefix, so the repo root on the INTERFACE
# below is the only search path needed; it also keeps the deprecated
# <oscpack/...> prefix working.
target_include_directories(oscpack INTERFACE .)
if(WIN32)
target_link_libraries(oscpack INTERFACE ws2_32 winmm)
Expand Down
2 changes: 1 addition & 1 deletion android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(OSCTAP_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/.." CACHE PATH "Path to the OscTap repo root")

add_library(osctap_jni SHARED osctap_jni.cpp)
target_include_directories(osctap_jni PRIVATE ${OSCTAP_ROOT} ${OSCTAP_ROOT}/osctap)
target_include_directories(osctap_jni PRIVATE ${OSCTAP_ROOT})

# Parsing untrusted OSC throws on malformed input; keep exceptions enabled so the
# bridge can catch and surface a Java exception instead of aborting. (RTTI is not
Expand Down
4 changes: 2 additions & 2 deletions android/osctap_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#include <jni.h>

#include "osc/OscOutboundPacketStream.h"
#include "osc/OscReceivedElements.h"
#include "osctap/osc/OscOutboundPacketStream.h"
#include "osctap/osc/OscReceivedElements.h"

namespace {

Expand Down
6 changes: 3 additions & 3 deletions demos/osc_send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include <cstring>
#include <iostream>

#include "ip/IpEndpointName.h"
#include "ip/UdpSocket.h"
#include "osc/OscOutboundPacketStream.h"
#include "osctap/ip/IpEndpointName.h"
#include "osctap/ip/UdpSocket.h"
#include "osctap/osc/OscOutboundPacketStream.h"

namespace {

Expand Down
8 changes: 4 additions & 4 deletions demos/pi5_hub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
#include <iostream>
#include <string>

#include "ip/IpEndpointName.h"
#include "ip/UdpSocket.h"
#include "osc/OscOutboundPacketStream.h"
#include "osc/OscPacketListener.h"
#include "osctap/ip/IpEndpointName.h"
#include "osctap/ip/UdpSocket.h"
#include "osctap/osc/OscOutboundPacketStream.h"
#include "osctap/osc/OscPacketListener.h"

namespace {

Expand Down
6 changes: 3 additions & 3 deletions demos/tcp_send.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <cstring>
#include <iostream>

#include "ip/IpEndpointName.h"
#include "ip/TcpSocket.h"
#include "osc/OscOutboundPacketStream.h"
#include "osctap/ip/IpEndpointName.h"
#include "osctap/ip/TcpSocket.h"
#include "osctap/osc/OscOutboundPacketStream.h"

namespace {

Expand Down
6 changes: 3 additions & 3 deletions demos/tcp_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#include <cstdlib>
#include <iostream>

#include "ip/IpEndpointName.h"
#include "ip/TcpSocket.h"
#include "osc/OscPacketListener.h"
#include "osctap/ip/IpEndpointName.h"
#include "osctap/ip/TcpSocket.h"
#include "osctap/osc/OscPacketListener.h"

namespace {

Expand Down
8 changes: 4 additions & 4 deletions docs/EMBEDDED_PICO2W.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ header-only, so there is no library to compile or link.
# After pico_sdk_init() and your add_executable(osc_demo ...)

target_include_directories(osc_demo PRIVATE
${OSCTAP_DIR}) # repo root: enables <osctap/osc/...> and the
# in-tree quoted "osc/..." includes
${OSCTAP_DIR}) # repo root: all includes use the
# osctap/... prefix

target_compile_definitions(osc_demo PRIVATE
OSCTAP_FREESTANDING) # drop hosted-only facilities
Expand Down Expand Up @@ -128,7 +128,7 @@ dispatch there (off the realtime thread), then read with the throw-free
accessors in your hot loop. *Illustrative — adapt names to your SDK version:*

```cpp
#include "osc/OscReceivedElements.h"
#include "osctap/osc/OscReceivedElements.h"

static void on_osc_packet(void* /*arg*/, struct udp_pcb* /*pcb*/,
struct pbuf* p, const ip_addr_t* /*addr*/, u16_t /*port*/)
Expand Down Expand Up @@ -164,7 +164,7 @@ static void on_osc_packet(void* /*arg*/, struct udp_pcb* /*pcb*/,
Serialize into a stack buffer (no heap), then ship it through an lwIP `pbuf`:

```cpp
#include "osc/OscOutboundPacketStream.h"
#include "osctap/osc/OscOutboundPacketStream.h"

void send_fader(udp_pcb* pcb, const ip_addr_t* dst, uint16_t port, float v)
{
Expand Down
10 changes: 5 additions & 5 deletions docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ target_link_libraries(myapp PRIVATE oscpack) # header-only INTERFACE target
Or just point at the headers:

```sh
g++ -std=c++17 -I path/to/OscTap -I path/to/OscTap/osctap myapp.cpp -o myapp
g++ -std=c++17 -I path/to/OscTap myapp.cpp -o myapp
```

Public headers live under `<osctap/...>`; the old `<oscpack/...>` paths and the
Expand All @@ -37,8 +37,8 @@ Serialize into a buffer **you** own (no heap allocation), then put the bytes on
the wire. The buffer can be on the stack.

```cpp
#include "osc/OscOutboundPacketStream.h"
#include "ip/UdpSocket.h"
#include "osctap/osc/OscOutboundPacketStream.h"
#include "osctap/ip/UdpSocket.h"

int main()
{
Expand Down Expand Up @@ -66,8 +66,8 @@ Subclass `OscPacketListener` (it unpacks bundles for you and bounds nesting
depth), bind a socket, and run the receive loop.

```cpp
#include "osc/OscPacketListener.h"
#include "ip/UdpSocket.h"
#include "osctap/osc/OscPacketListener.h"
#include "osctap/ip/UdpSocket.h"
#include <cstring>
#include <iostream>

Expand Down
4 changes: 2 additions & 2 deletions docs/INTEGRATION_PI5_PICO_ANDROID.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ contract, the Pico does two things.
**Receive `/led` and `/pwm`** in the lwIP `udp_recv` callback:

```cpp
#include "osc/OscReceivedElements.h"
#include "osctap/osc/OscReceivedElements.h"

static void on_osc(void*, udp_pcb*, pbuf* p, const ip_addr_t*, u16_t) {
if (!p) return;
Expand All @@ -122,7 +122,7 @@ static void on_osc(void*, udp_pcb*, pbuf* p, const ip_addr_t*, u16_t) {
(buffer on the stack, no heap):

```cpp
#include "osc/OscOutboundPacketStream.h"
#include "osctap/osc/OscOutboundPacketStream.h"

void publish_temp(udp_pcb* pcb, const ip_addr_t* hub, uint16_t port, float c) {
char buffer[64];
Expand Down
10 changes: 5 additions & 5 deletions docs/OSC_OVER_TCP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ transport-agnostic and usable on its own (e.g. over a serial link or your own
socket loop):

```cpp
#include "osc/OscStreamFraming.h"
#include "osctap/osc/OscStreamFraming.h"

// Decode: feed received bytes in whatever chunks arrive; the deframer reassembles
// complete packets and calls your sink once per packet.
Expand All @@ -43,8 +43,8 @@ UDP `UdpListeningReceiveSocket` — the listener contract is identical, so exist
listeners work unchanged.

```cpp
#include "ip/TcpSocket.h"
#include "osc/OscPacketListener.h"
#include "osctap/ip/TcpSocket.h"
#include "osctap/osc/OscPacketListener.h"

class MyListener : public osctap::OscPacketListener {
protected:
Expand All @@ -71,8 +71,8 @@ partial writes; `TCP_NODELAY` is on (Nagle off — without it OSC-over-TCP laten
is a classic footgun).

```cpp
#include "ip/TcpSocket.h"
#include "osc/OscOutboundPacketStream.h"
#include "osctap/ip/TcpSocket.h"
#include "osctap/osc/OscOutboundPacketStream.h"

osctap::TcpTransmitSocket client( osctap::IpEndpointName( "127.0.0.1", 9000 ) );

Expand Down
2 changes: 1 addition & 1 deletion docs/STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ cmake --build build-fs --target OscFreestandingTest && ./build-fs/OscFreestandin
may lack the TSan runtime, so the CI job uses GCC).
- **ClusterFuzzLite builds the fuzzer via `.clusterfuzzlite/build.sh`, not CMake** —
it compiles `fuzz/fuzz_parse.cpp` directly with the OSS-Fuzz toolchain's
`$CXXFLAGS`/`$LIB_FUZZING_ENGINE` and `-I osctap`. The `cflite_*` workflows build an
`$CXXFLAGS`/`$LIB_FUZZING_ENGINE` and `-I .` (the repo root). The `cflite_*` workflows build an
OSS-Fuzz Docker image, so they're slower than the rest of CI. Local fuzzing still goes
through CMake (`OSCTAP_BUILD_FUZZERS` / `OSCTAP_FUZZER_STANDALONE`).

Expand Down
8 changes: 4 additions & 4 deletions examples/OscDump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ namespace std {
}
#endif

#include "ip/PacketListener.h"
#include "ip/UdpSocket.h"
#include "osc/OscPrintReceivedElements.h"
#include "osc/OscReceivedElements.h"
#include "osctap/ip/PacketListener.h"
#include "osctap/ip/UdpSocket.h"
#include "osctap/osc/OscPrintReceivedElements.h"
#include "osctap/osc/OscReceivedElements.h"
using namespace oscpack; // deprecated alias for osctap, intentionally exercised here

class OscDumpPacketListener : public PacketListener {
Expand Down
6 changes: 3 additions & 3 deletions examples/SimpleReceive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#include <cstring>
#include <iostream>

#include "ip/UdpSocket.h"
#include "osc/OscPacketListener.h"
#include "osc/OscReceivedElements.h"
#include "osctap/ip/UdpSocket.h"
#include "osctap/osc/OscPacketListener.h"
#include "osctap/osc/OscReceivedElements.h"

using namespace oscpack; // OscTap's deprecated oscpack:: alias, exercised here

Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
For a typed command-line sender see demos/osc_send.cpp.
*/

#include "ip/UdpSocket.h"
#include "osc/OscOutboundPacketStream.h"
#include "osctap/ip/UdpSocket.h"
#include "osctap/osc/OscOutboundPacketStream.h"

using namespace oscpack; // OscTap's deprecated oscpack:: alias, exercised here

Expand Down
4 changes: 2 additions & 2 deletions fuzz/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ so out-of-bounds reads surface under AddressSanitizer.
Requires Clang with the libFuzzer + sanitizer runtimes installed.

```sh
clang++ -std=c++17 -g -O1 -I osctap \
clang++ -std=c++17 -g -O1 -I . \
-fsanitize=fuzzer,address,undefined \
fuzz/fuzz_parse.cpp -o fuzz_parse
./fuzz_parse fuzz/corpus # seed corpus bootstraps coverage
Expand All @@ -33,7 +33,7 @@ runs a bounded, deterministic random-mutation loop over them. Useful for CI
smoke tests, crash-repro replay, and sanitizer coverage without libFuzzer.

```sh
g++ -std=c++17 -g -O1 -I osctap -fsanitize=address,undefined \
g++ -std=c++17 -g -O1 -I . -fsanitize=address,undefined \
fuzz/fuzz_parse.cpp fuzz/standalone_main.cpp -o fuzz_parse_standalone
./fuzz_parse_standalone fuzz/corpus/*
```
Expand Down
4 changes: 2 additions & 2 deletions fuzz/fuzz_deframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include <exception>
#include <vector>

#include "osc/OscReceivedElements.h"
#include "osc/OscStreamFraming.h"
#include "osctap/osc/OscReceivedElements.h"
#include "osctap/osc/OscStreamFraming.h"

using namespace oscpack;

Expand Down
4 changes: 2 additions & 2 deletions fuzz/fuzz_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <sstream>
#include <vector>

#include "osc/OscPrintReceivedElements.h"
#include "osc/OscReceivedElements.h"
#include "osctap/osc/OscPrintReceivedElements.h"
#include "osctap/osc/OscReceivedElements.h"

using namespace oscpack;

Expand Down
4 changes: 2 additions & 2 deletions osctap/ip/AbstractUdpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

#include <cstring> // size_t

#include "IpEndpointName.h"
#include "NetworkingUtils.h"
#include "osctap/ip/IpEndpointName.h"
#include "osctap/ip/NetworkingUtils.h"

namespace tap::osc {
class PacketListener;
Expand Down
2 changes: 1 addition & 1 deletion osctap/ip/IpEndpointName.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include <cstdio>

#include "NetworkingUtils.h"
#include "osctap/ip/NetworkingUtils.h"

namespace tap::osc {
class IpEndpointName {
Expand Down
4 changes: 2 additions & 2 deletions osctap/ip/NetworkingUtils.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#if defined(_WIN32)
#include "ip/win32/NetworkingUtils.h"
#include "osctap/ip/win32/NetworkingUtils.h"
#else
#include "ip/posix/NetworkingUtils.h"
#include "osctap/ip/posix/NetworkingUtils.h"
#endif
4 changes: 2 additions & 2 deletions osctap/ip/TcpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// server, TCP_NODELAY, frame-size cap. SLIP/TLS/WebSocket/epoll are deferred.

#if defined(_WIN32)
#include "win32/TcpSocket.h"
#include "osctap/ip/win32/TcpSocket.h"
#else
#include "posix/TcpSocket.h"
#include "osctap/ip/posix/TcpSocket.h"
#endif

namespace tap::osc {
Expand Down
8 changes: 4 additions & 4 deletions osctap/ip/UdpSocket.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once
#include "AbstractUdpSocket.h"
#include "ip/NetworkingUtils.h"
#include "osctap/ip/AbstractUdpSocket.h"
#include "osctap/ip/NetworkingUtils.h"

#if defined(_WIN32)
#include "win32/UdpSocket.h"
#include "osctap/ip/win32/UdpSocket.h"
#else
#include "posix/UdpSocket.h"
#include "osctap/ip/posix/UdpSocket.h"
#endif

namespace tap::osc {
Expand Down
8 changes: 4 additions & 4 deletions osctap/ip/posix/TcpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

#include <netinet/tcp.h> // TCP_NODELAY

#include "ip/IpEndpointName.h" // complete type before the helpers below use it
#include "ip/PacketListener.h"
#include "ip/posix/UdpSocket.h"
#include "osc/OscStreamFraming.h"
#include "osctap/ip/IpEndpointName.h" // complete type before the helpers below use it
#include "osctap/ip/PacketListener.h"
#include "osctap/ip/posix/UdpSocket.h"
#include "osctap/osc/OscStreamFraming.h"

namespace tap::osc {
namespace posix {
Expand Down
6 changes: 3 additions & 3 deletions osctap/ip/posix/UdpSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
#include <sys/types.h>
#include <unistd.h>

#include "ip/AbstractUdpSocket.h"
#include "ip/PacketListener.h"
#include "ip/TimerListener.h"
#include "osctap/ip/AbstractUdpSocket.h"
#include "osctap/ip/PacketListener.h"
#include "osctap/ip/TimerListener.h"

namespace tap::osc {

Expand Down
Loading
Loading