Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi committed May 29, 2023
1 parent 7c2b0c1 commit f3b12d8
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 274 deletions.
58 changes: 9 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ jobs:
matrix:
# ubuntu-latest == ubuntu-22.04
# macOS-latest == macos-12
os: ["ubuntu-latest", "ubuntu-20.04", "macOS-latest", "macos-11", "windows-latest"]
#os: ["ubuntu-latest", "ubuntu-20.04", "macOS-latest", "macos-11", "windows-latest"]
os: ["macos-11"]
arch: ["x86_64"]
gcrypt: ["--with-local-libgcrypt", ""]
gcrypt: [""]
compiler: ["cc"]
ar: ["ar"]
ranlib: ["ranlib"]
Expand All @@ -89,23 +90,6 @@ jobs:
nBPF: [""]
lto_gold_linker: [""]
include:
- compiler: "gcc-7" # "Oldest" gcc easily available
os: ubuntu-20.04
arch: "x86_64"
gcrypt: ""
pcre: "--with-pcre"
maxminddb: "--with-maxminddb"
msan: "--with-sanitizer"
nBPF: ""
- compiler: "gcc-12" # "Newest" gcc easily available
os: ubuntu-22.04
arch: "x86_64"
gcrypt: ""
pcre: "--with-pcre"
maxminddb: "--with-maxminddb"
msan: "--with-sanitizer"
nBPF: ""
lto_gold_linker: "--with-lto-and-gold-linker"
- compiler: "clang-7" # "Oldest" clang easily available
os: ubuntu-20.04
arch: "x86_64"
Expand All @@ -125,30 +109,6 @@ jobs:
msan: "--with-sanitizer"
nBPF: ""
lto_gold_linker: "--with-lto-and-gold-linker"
- compiler: "cc"
os: ubuntu-latest
arch: "x86_64"
gcrypt: ""
pcre: "--with-pcre"
maxminddb: "--with-maxminddb"
msan: "--with-thread-sanitizer"
nBPF: ""
- compiler: "cc"
os: ubuntu-latest
arch: "x86_64"
gcrypt: ""
pcre: "--with-pcre"
maxminddb: "--with-maxminddb"
msan: "--with-sanitizer"
nBPF: "nBPF"
- compiler: "clang-14"
os: ubuntu-22.04
arch: "x86_64"
gcrypt: ""
pcre: "--with-pcre"
maxminddb: "--with-maxminddb"
msan: "--with-memory-sanitizer"
nBPF: ""
- compiler: "cc"
os: macOS-latest
arch: "x86_64"
Expand Down Expand Up @@ -372,7 +332,7 @@ jobs:
make all &&
make -C example ndpiSimpleIntegration &&
make -C rrdtool &&
make check VERBOSE=1
./tests/do.sh
"
- name: Display qemu specified architecture (armhf - little endian)
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'armhf')
Expand All @@ -393,10 +353,10 @@ jobs:
apt-get -y install git wdiff colordiff autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev libgcrypt20-dev libpcre3-dev libmaxminddb-dev rrdtool librrd-dev &&
git config --global --add safe.directory $(realpath .) &&
env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} --enable-tls-sigs &&
make all &&
make -C example ndpiSimpleIntegration &&
make -C rrdtool &&
make check VERBOSE=1
make -j $(nproc) all &&
make -j $(nproc) -C example ndpiSimpleIntegration &&
make -j $(nproc) -C rrdtool &&
./tests/do.sh
"
- name: Display qemu specified architecture (s390x - big endian)
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 's390x')
Expand All @@ -420,5 +380,5 @@ jobs:
make all &&
make -C example ndpiSimpleIntegration &&
make -C rrdtool &&
make check VERBOSE=1
./tests/do.sh
"
3 changes: 2 additions & 1 deletion example/reader_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ void ndpi_analyze_payload(struct ndpi_flow_info *flow,
struct packet_id_stats *p;

#ifdef DEBUG_PAYLOAD
u_int16_t i;
for(i=0; i<payload_len; i++)
printf("%c", isprint(payload[i]) ? payload[i] : '.');
printf("\n");
Expand Down Expand Up @@ -228,7 +229,7 @@ static void print_payload_stat(struct payload_stats *p, FILE *out) {
}

fprintf(out, "]");
for(; i<16; i++) printf(" ");
for(; i<16; i++) fprintf(out, " ");
fprintf(out, "[");

for(i=0; i<p->pattern_len; i++) {
Expand Down
2 changes: 1 addition & 1 deletion tests/cfgs/enable_payload_stat/config.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-F -P 4:8:10:128:25
-P 4:8:10:16:25
Loading

0 comments on commit f3b12d8

Please sign in to comment.