Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
40a9e0f
Create travis_sh.yml
zarfld Jun 18, 2025
37af2f5
Create OpenAvnu_Build.yml
zarfld Jun 18, 2025
2e716e1
mrpd: guard SOCKET typedef on linux
zarfld Jun 18, 2025
47c32d0
Update OpenAvnu_Build.yml
zarfld Jun 18, 2025
5884568
Merge pull request #6 from zarfld/codex/typedef-socket-for-linux-if-n…
zarfld Jun 18, 2025
0350340
Increase response buffer sizes and use snprintf
zarfld Jun 18, 2025
cf431b8
Create travis_sh.yml
zarfld Jun 18, 2025
7a3dac3
Create OpenAvnu_Build.yml
zarfld Jun 18, 2025
b891551
Delete .github/workflows directory
zarfld Jun 18, 2025
9d6b2d1
Merge pull request #7 from zarfld/codex/review-buffer-sizes-in-mrpd.c…
zarfld Jun 18, 2025
8e1f459
Update README.rst
zarfld Jun 18, 2025
4ac1b3a
Update README.rst
zarfld Jun 18, 2025
ad85d1d
Fix thread stack size check and static PTP data
zarfld Jun 18, 2025
4927897
Update OpenAvnu_Build.yml
zarfld Jun 18, 2025
6af635d
Update travis_sh.yml
zarfld Jun 18, 2025
dd7ed28
Merge pull request #8 from zarfld/codex/add-conditional-check-for-pth…
zarfld Jun 18, 2025
cad4341
maap: fix logging buffer sizes and update pcap API
zarfld Jun 18, 2025
6b64dbe
Merge pull request #9 from zarfld/codex/increase-buffer-size-and-upda…
zarfld Jun 18, 2025
b6e03a4
Fix constant comparison and tighten log formatting
zarfld Jun 18, 2025
e3da448
Merge pull request #11 from zarfld/codex/clean-up-constant-comparison…
zarfld Jun 18, 2025
f3b7eea
fix: mark fallthrough in talker mrp
zarfld Jun 18, 2025
7d5c3c6
Update talker_mrp_client.c
zarfld Jun 18, 2025
51314ae
Merge pull request #12 from zarfld/codex/fix-implicit-fallthrough-in-…
zarfld Jun 18, 2025
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
100 changes: 100 additions & 0 deletions .github/workflows/OpenAvnu_Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: OpenAvnu Build CI

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: false # wir setzen die URLs gleich manuell

- name: Set up dependencies
run: |
sudo apt update
sudo apt install -y \
git build-essential cmake g++ \
libpcap-dev libnl-3-dev libnl-genl-3-dev \
uuid-dev libavahi-client-dev \
linux-headers-generic libglib2.0-dev \
libpci-dev libsndfile1-dev libjack-dev \
libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

- name: Fix submodule URLs
run: |
git config --file .gitmodules submodule.avdecc-lib.url https://github.com/AVnu/avdecc-lib.git
git config --file .gitmodules submodule.lib/atl_avb.url https://github.com/zarfld/atl_avb.git
git config --file .gitmodules submodule.lib/igb_avb.url https://github.com/AVnu/igb_avb.git
git config --file .gitmodules submodule.thirdparty/cpputest.url https://github.com/cpputest/cpputest.git
git submodule sync
git submodule update --init --recursive

- name: Build daemons/maap seperately
run: |
make -C daemons/maap
continue-on-error: true

- name: Build daemons/mrpd seperately
run: |
make -C daemons/mrpd
continue-on-error: true

- name: Build daemons/shaper seperately
run: |
make -C daemons/shaper
continue-on-error: true

- name: Build examples/simple_listener seperately
run: |
make -C examples/simple_listener
continue-on-error: true

- name: Build examples/simple_talker seperately
run: |
make -C examples/simple_talker
continue-on-error: true

- name: Build all
run: |
make all

- name: Build lib/igb_avb/lib
run: |
make -C lib/igb_avb/lib all

# ───────────────────────────────────────────────────────────────
# Fehlerbehandlung: nur ausführen, wenn obiger Build fehlschlägt
# ───────────────────────────────────────────────────────────────

- name: Print directory contents on failure
if: failure()
run: |
echo "::group::Directory structure"
find . -type f | sort
echo "::endgroup::"

- name: Show last 100 lines of all *.log or *.txt
if: failure()
run: |
find . -type f \( -name "*.log" -o -name "*.txt" \) -exec echo "::group::{}" \; -exec tail -n 100 {} \; -exec echo "::endgroup::" \;

- name: Upload build output (if any)
if: failure()
uses: actions/upload-artifact@v4
with:
name: build-output-on-failure
path: |
lib/**/lib*.a
**/*.o
**/*.log
**/*.txt
89 changes: 89 additions & 0 deletions .github/workflows/travis_sh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build and Test

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake

- name: Set up dependencies
run: |
sudo apt update
sudo apt install -y \
git build-essential cmake g++ \
libpcap-dev libnl-3-dev libnl-genl-3-dev \
uuid-dev libavahi-client-dev \
linux-headers-generic libglib2.0-dev \
libpci-dev libsndfile1-dev libjack-dev \
libasound2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

- name: Fix submodule URLs
run: |
git config --file .gitmodules submodule.avdecc-lib.url https://github.com/AVnu/avdecc-lib.git
git config --file .gitmodules submodule.lib/atl_avb.url https://github.com/zarfld/atl_avb.git
git config --file .gitmodules submodule.lib/igb_avb.url https://github.com/AVnu/igb_avb.git
git config --file .gitmodules submodule.thirdparty/cpputest.url https://github.com/cpputest/cpputest.git
git submodule sync
git submodule update --init --recursive

- name: Run legacy make tasks
run: |
set -ev
make daemons_all
make examples_all
make avtp_pipeline

- name: Run legacy make avdecc
run: |
make avtp_avdecc
continue-on-error: true

- name: Update to latest CppUTest
run: |
cd thirdparty/cpputest
git checkout master
git pull origin master

- name: Configure and build CppUTest
run: |
mkdir -p cpputest_build
cd cpputest_build
cmake ../thirdparty/cpputest \
-DCPPUTEST_USE_STD_CPP_LIB=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/cpputest_install
make
make install

- name: Configure CMake project
run: |
mkdir build
cd build
cmake .. -G "Unix Makefiles" \
-DCMAKE_CXX_FLAGS="-fexceptions -funwind-tables" \
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/cpputest_install

- name: Build project
run: |
cd build
make

- name: Run tests
run: |
cd build
ARGS=--output-on-failure make test
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
.. image:: avnu_logo.png

|
.. image:: https://github.com/zarfld/OpenAvnu/actions/workflows/travis_sh.yml/badge.svg?branch=open-avb-next
:target: https://github.com/zarfld/OpenAvnu/actions/workflows/travis_sh.yml
:alt: Build status

.. image:: https://travis-ci.org/AVnu/OpenAvnu.svg?branch=open-avb-next
:target: https://travis-ci.org/AVnu/OpenAvnu

OpenAvnu
========
Expand Down
4 changes: 2 additions & 2 deletions daemons/maap/common/maap_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define LOG_MSG_LEN 1024

// The length of the full message
#define LOG_FULL_MSG_LEN 1024
#define LOG_FULL_MSG_LEN 2048

#ifndef TRUE
#define TRUE 1
Expand Down Expand Up @@ -135,7 +135,7 @@ static const int MAAP_LOG_FROM_THREAD = TRUE;
static const int MAAP_LOG_PULL_MODE = FALSE;

// When using the MAAP_LOG_FROM_THREAD option. These defines control the behavior of the msg queue
#define LOG_QUEUE_MSG_LEN 256
#define LOG_QUEUE_MSG_LEN 2048
#define LOG_QUEUE_MSG_SIZE (LOG_QUEUE_MSG_LEN + 1)
#define LOG_QUEUE_MSG_CNT 82
#define LOG_QUEUE_SLEEP_MSEC 100
Expand Down
40 changes: 20 additions & 20 deletions daemons/maap/linux/src/maap_log_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,35 +104,35 @@ void maapLogRTRender(log_queue_item_t *pLogItem)
strcat((char *)pLogItem->msg, pLogRTItem->pFormat);
break;
case LOG_RT_DATATYPE_NOW_TS:
sprintf(rt_msg, "[%lu:%09lu] ", pLogRTItem->data.nowTS.tv_sec, pLogRTItem->data.nowTS.tv_nsec);
snprintf(rt_msg, sizeof(rt_msg), "[%lu:%09lu] ", pLogRTItem->data.nowTS.tv_sec, pLogRTItem->data.nowTS.tv_nsec);
strcat((char *)pLogItem->msg, rt_msg);
break;
case LOG_RT_DATATYPE_U16:
sprintf(rt_msg, pLogRTItem->pFormat, pLogRTItem->data.unsignedShortVar);
snprintf(rt_msg, sizeof(rt_msg), pLogRTItem->pFormat, pLogRTItem->data.unsignedShortVar);
strcat((char *)pLogItem->msg, rt_msg);
break;
case LOG_RT_DATATYPE_S16:
sprintf(rt_msg, pLogRTItem->pFormat, pLogRTItem->data.signedShortVar);
snprintf(rt_msg, sizeof(rt_msg), pLogRTItem->pFormat, pLogRTItem->data.signedShortVar);
strcat((char *)pLogItem->msg, rt_msg);
break;
case LOG_RT_DATATYPE_U32:
sprintf(rt_msg, pLogRTItem->pFormat, pLogRTItem->data.unsignedLongVar);
snprintf(rt_msg, sizeof(rt_msg), pLogRTItem->pFormat, pLogRTItem->data.unsignedLongVar);
strcat((char *)pLogItem->msg, rt_msg);
break;
case LOG_RT_DATATYPE_S32:
sprintf(rt_msg, pLogRTItem->pFormat, pLogRTItem->data.signedLongVar);
snprintf(rt_msg, sizeof(rt_msg), pLogRTItem->pFormat, pLogRTItem->data.signedLongVar);
strcat((char *)pLogItem->msg, rt_msg);
break;
case LOG_RT_DATATYPE_U64:
sprintf(rt_msg, pLogRTItem->pFormat, pLogRTItem->data.unsignedLongLongVar);
snprintf(rt_msg, sizeof(rt_msg), pLogRTItem->pFormat, pLogRTItem->data.unsignedLongLongVar);
strcat((char *)pLogItem->msg, rt_msg);
break;
case LOG_RT_DATATYPE_S64:
sprintf(rt_msg, pLogRTItem->pFormat, pLogRTItem->data.signedLongLongVar);
snprintf(rt_msg, sizeof(rt_msg), pLogRTItem->pFormat, pLogRTItem->data.signedLongLongVar);
strcat((char *)pLogItem->msg, rt_msg);
break;
case LOG_RT_DATATYPE_FLOAT:
sprintf(rt_msg, pLogRTItem->pFormat, pLogRTItem->data.floatVar);
snprintf(rt_msg, sizeof(rt_msg), pLogRTItem->pFormat, pLogRTItem->data.floatVar);
strcat((char *)pLogItem->msg, rt_msg);
break;
default:
Expand Down Expand Up @@ -250,7 +250,7 @@ void maapLogFn(

LOG_LOCK();

vsprintf(msg, fmt, args);
vsnprintf(msg, sizeof(msg), fmt, args);

if (MAAP_LOG_FILE_INFO && path) {
char* file = strrchr(path, '/');
Expand All @@ -260,33 +260,33 @@ void maapLogFn(
file += 1;
else
file = (char*)path;
sprintf(file_msg, " %s:%d", file, line);
snprintf(file_msg, sizeof(file_msg), " %s:%d", file, line);
}
if (MAAP_LOG_PROC_INFO) {
sprintf(proc_msg, " P:%5.5d", GET_PID());
snprintf(proc_msg, sizeof(proc_msg), " P:%5.5d", GET_PID());
}
if (MAAP_LOG_THREAD_INFO) {
sprintf(thread_msg, " T:%lu", THREAD_SELF());
snprintf(thread_msg, sizeof(thread_msg), " T:%lu", THREAD_SELF());
}
if (MAAP_LOG_TIME_INFO) {
time_t tNow = time(NULL);
struct tm tmNow;
localtime_r(&tNow, &tmNow);

sprintf(time_msg, "%2.2d:%2.2d:%2.2d", tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec);
snprintf(time_msg, sizeof(time_msg), "%2.2d:%2.2d:%2.2d", tmNow.tm_hour, tmNow.tm_min, tmNow.tm_sec);
}
if (MAAP_LOG_TIMESTAMP_INFO) {
struct timespec nowTS;
clock_gettime(CLOCK_REALTIME, &nowTS);

sprintf(timestamp_msg, "%lu:%09lu", nowTS.tv_sec, nowTS.tv_nsec);
snprintf(timestamp_msg, sizeof(timestamp_msg), "%lu:%09lu", nowTS.tv_sec, nowTS.tv_nsec);
}

// using sprintf and puts allows using static buffers rather than heap.
if (MAAP_LOG_EXTRA_NEWLINE)
/* int32_t full_msg_len = */ sprintf(full_msg, "[%s%s%s%s %s %s%s] %s: %s\n", time_msg, timestamp_msg, proc_msg, thread_msg, company, component, file_msg, tag, msg);
else
/* int32_t full_msg_len = */ sprintf(full_msg, "[%s%s%s%s %s %s%s] %s: %s", time_msg, timestamp_msg, proc_msg, thread_msg, company, component, file_msg, tag, msg);
if (MAAP_LOG_EXTRA_NEWLINE)
/* int32_t full_msg_len = */ snprintf(full_msg, sizeof(full_msg), "[%s%s%s%s %s %s%s] %s: %s\n", time_msg, timestamp_msg, proc_msg, thread_msg, company, component, file_msg, tag, msg);
else
/* int32_t full_msg_len = */ snprintf(full_msg, sizeof(full_msg), "[%s%s%s%s %s %s%s] %s: %s", time_msg, timestamp_msg, proc_msg, thread_msg, company, component, file_msg, tag, msg);

if (!MAAP_LOG_FROM_THREAD && !MAAP_LOG_PULL_MODE) {
fputs(full_msg, MAAP_LOG_OUTPUT_FD);
Expand All @@ -297,8 +297,8 @@ void maapLogFn(
if (elem) {
log_queue_item_t *pLogItem = (log_queue_item_t *)maapLogQueueData(elem);
pLogItem->bRT = FALSE;
strncpy((char *)pLogItem->msg, full_msg, LOG_QUEUE_MSG_LEN);
maapLogQueueHeadPush(logQueue);
snprintf((char *)pLogItem->msg, LOG_QUEUE_MSG_SIZE, "%s", full_msg);
maapLogQueueHeadPush(logQueue);
}
}
}
Expand Down
22 changes: 12 additions & 10 deletions daemons/maap/test/maap_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,18 @@ int main(int argc, char *argv[]) {
bpf_u_int32 mask;
bpf_u_int32 net;

if (argc < 2) {
dev = pcap_lookupdev(errbuf);
if (dev == NULL) {
fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
fprintf(stderr, "Try specifying the device you want: %s <device>\n", argv[0]);
return 2;
}
} else {
dev = argv[1];
}
if (argc < 2) {
pcap_if_t *alldevs;
if (pcap_findalldevs(&alldevs, errbuf) == -1 || alldevs == NULL) {
fprintf(stderr, "Couldn't find default device: %s\n", errbuf);
fprintf(stderr, "Try specifying the device you want: %s <device>\n", argv[0]);
return 2;
}
dev = alldevs->name;
pcap_freealldevs(alldevs);
} else {
dev = argv[1];
}

if (pcap_lookupnet(dev, &net, &mask, errbuf) == -1) {
fprintf(stderr, "Couldn't get netmask for device: %s\n", dev);
Expand Down
Loading