Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f561e14271 |
@@ -1,6 +0,0 @@
|
||||
*.sh -crlf
|
||||
*.ac -crlf
|
||||
*.am -crlf
|
||||
|
||||
#Content files are C file
|
||||
*.inc linguist-language=C
|
||||
@@ -1,50 +0,0 @@
|
||||
---
|
||||
name: "🐞 Report a Bug"
|
||||
about: Create a report to help us improve nDPI
|
||||
title: ''
|
||||
labels: 'bug'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Describe the bug
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
### Expected behavior
|
||||
A clear and concise description of what you expected to happen.
|
||||
### Obtained behavior
|
||||
A clear and concise description of what happening.
|
||||
|
||||
## nDPI Environment (please complete the following information):
|
||||
* OS name: [e.g. Ubuntu].
|
||||
* OS version: [e.g. 18.04]
|
||||
* Architecture: [e.g. arm64]
|
||||
* nDPI version or commit hash: [e.g. 4.0-stable or 937357e4bc55610f116f66d15a8e0fc1e260c02c].
|
||||
* nDPI compilation flags used: if you are building from source [e.g. --with-pcre --disable-gcrypt].
|
||||
* Attach the `config.log` file generated after `./configure` ran (if you are building from source).
|
||||
|
||||
## How to reproduce the reported bug
|
||||
|
||||
### Reproducible using ndpiReader?
|
||||
- [x] The reported bug is reproducible using ndpiReader.
|
||||
- [x] The reported bug is not reproducible using ndpiReader.
|
||||
|
||||
### If applicable, the used ndpiReader options:
|
||||
|
||||
``` shell
|
||||
ndpiReader -q -t -i wlo1 -T 20 -U 20
|
||||
```
|
||||
|
||||
### If your bug is reproducible using a pcap, please attach a pcap file (or a valid link to download it)
|
||||
|
||||
Example: test.pcap
|
||||
|
||||
### Steps to reproduce the behavior:
|
||||
1. Run '...'
|
||||
2. Set '....'
|
||||
3. Do '....'
|
||||
4. See error
|
||||
|
||||
## Additional context
|
||||
Add any other context about the problem here.
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
name: "💡 Suggest an Improvement or Feature"
|
||||
about: Suggest an idea or a feature for nDPI
|
||||
title: ''
|
||||
labels: 'enhancement'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I always need to [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
name: General question
|
||||
about: Ask a question about nDPI
|
||||
title: ''
|
||||
labels: 'question'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
Type your question in a clear and concise way to help the community answering it.
|
||||
@@ -1,289 +0,0 @@
|
||||
name: Build
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
types: [opened, synchronize, reopened]
|
||||
release:
|
||||
types: [created]
|
||||
jobs:
|
||||
test:
|
||||
name: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.gcrypt }} ${{ matrix.compiler }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} ${{ matrix.msan }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false # Debugging purposes, switch to true when all issues on big endian is solved
|
||||
matrix:
|
||||
os: ["ubuntu-latest", "ubuntu-18.04", "macOS-latest", "macos-11"]
|
||||
arch: ["x86_64"]
|
||||
gcrypt: ["--disable-gcrypt", ""]
|
||||
compiler: ["default-cc"]
|
||||
pcre: [""]
|
||||
maxminddb: [""]
|
||||
msan: [""]
|
||||
include:
|
||||
- compiler: "gcc-7"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "gcc-10"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "clang-7"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "clang-12"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
os: ubuntu-18.04
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
os: macOS-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "" # Disable sanitizer on macos
|
||||
- compiler: "default-cc"
|
||||
os: macos-11
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "" # Disable sanitizer on macos
|
||||
- compiler: "default-cc"
|
||||
os: ubuntu-latest
|
||||
arch: "arm64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "" # Disable sanitizer on arm64
|
||||
- compiler: "default-cc"
|
||||
os: ubuntu-latest
|
||||
arch: "armhf"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
os: ubuntu-latest
|
||||
arch: "s390x"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: ""
|
||||
steps:
|
||||
- name: Setup multiarch/qemu-user-static
|
||||
if: startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Install Ubuntu Prerequisites
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev
|
||||
sudo apt-get install gcc-mingw-w64 libc6-dev
|
||||
sudo apt-get install doxygen python3-sphinx python3-sphinx-rtd-theme python3-breathe python3-pip
|
||||
sudo apt-get install rrdtool librrd-dev
|
||||
- name: Install Ubuntu Prerequisites (libgcrypt)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.gcrypt, '--disable-gcrypt')
|
||||
run: |
|
||||
sudo apt-get install libgcrypt20-dev
|
||||
- name: Install Ubuntu Prerequisites (libpcre)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.pcre, '--with-pcre')
|
||||
run: |
|
||||
sudo apt-get install libpcre3-dev
|
||||
- name: Install Ubuntu Prerequisites (maxminddb)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.maxminddb, '--with-maxminddb')
|
||||
run: |
|
||||
sudo apt-get install libmaxminddb-dev
|
||||
- name: Setup Ubuntu specified compiler (gcc)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'gcc')
|
||||
run: |
|
||||
sudo apt-get install ${{ matrix.compiler }}
|
||||
- name: Setup Ubuntu specified compiler (clang)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'clang')
|
||||
run: |
|
||||
sudo apt-get install ${{ matrix.compiler }}
|
||||
- name: Installing MacOS prerequisites
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
brew install autoconf automake libtool pkg-config gettext json-c
|
||||
brew install coreutils
|
||||
brew install rrdtool
|
||||
- name: Install MacOS Prerequisites (libgcrypt)
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.gcrypt, '--disable-gcrypt')
|
||||
run: |
|
||||
brew install libgcrypt
|
||||
- name: Install MacOS Prerequisites (libpcre)
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.pcre, '--with-pcre')
|
||||
run: |
|
||||
brew install pcre
|
||||
- name: Install MacOS Prerequisites (maxminddb)
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.maxminddb, '--with-maxminddb')
|
||||
run: |
|
||||
brew install libmaxminddb
|
||||
- name: Configure nDPI on Ubuntu
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'default-cc')
|
||||
run: |
|
||||
env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
|
||||
- name: Configure nDPI on MacOS
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'default-cc')
|
||||
run: |
|
||||
env CC=clang CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
|
||||
- name: Configure nDPI with specified GCC version on Ubuntu
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'gcc')
|
||||
run: |
|
||||
env CC=${{ matrix.compiler }} CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
|
||||
- name: Configure nDPI with specified CLANG on Ubuntu
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'clang')
|
||||
run: |
|
||||
env CC=${{ matrix.compiler }} CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
|
||||
- name: Build nDPI
|
||||
if: startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
make all
|
||||
make -C example ndpiSimpleIntegration
|
||||
make -C rrdtool
|
||||
make -C python
|
||||
- name: Install nDPI
|
||||
if: startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
make install DESTDIR=$(realpath _install)
|
||||
ls -alhHR _install
|
||||
- name: Test nDPI [DIFF]
|
||||
if: startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
./tests/do.sh
|
||||
- name: Test nDPI [UNIT]
|
||||
if: startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
./tests/do-unit.sh
|
||||
- name: Test nDPI [DGA]
|
||||
if: startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
./tests/do-dga.sh
|
||||
- name: Generate tarball
|
||||
if: startsWith(matrix.os, 'ubuntu-latest') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
make dist
|
||||
- name: Generate documentation
|
||||
if: startsWith(matrix.os, 'ubuntu-latest') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
pip3 install --user sphinxcontrib.swaggerdoc
|
||||
make -C doc text
|
||||
make -C doc html
|
||||
- name: Configure nDPI [Mingw-w64] (runs only on ubuntu jobs)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
make distclean && ./autogen.sh --host=x86_64-w64-mingw32 ${{ matrix.gcrypt }} ${{ matrix.pcre }} ${{ matrix.maxminddb }}
|
||||
- name: Build nDPI [Mingw-w64] (runs only on ubuntu jobs)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
make all
|
||||
- name: Display qemu specified architecture (arm64 - little endian)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'arm64')
|
||||
uses: docker://multiarch/ubuntu-core:arm64-bionic
|
||||
with:
|
||||
args: >
|
||||
bash -c
|
||||
"uname -a &&
|
||||
lscpu | grep Endian
|
||||
"
|
||||
- name: Configure, compile and test using qemu for the specified architecture (arm64 - little endian)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'arm64')
|
||||
uses: docker://multiarch/ubuntu-core:arm64-bionic
|
||||
with:
|
||||
args: >
|
||||
bash -c
|
||||
"apt-get -y update &&
|
||||
apt-get -y install git autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev libgcrypt20-dev libpcre3-dev libmaxminddb-dev rrdtool librrd-dev &&
|
||||
env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} &&
|
||||
make all &&
|
||||
make -C example ndpiSimpleIntegration &&
|
||||
make -C rrdtool &&
|
||||
make -C python &&
|
||||
./tests/do.sh &&
|
||||
./tests/do-unit.sh
|
||||
"
|
||||
- name: Display qemu specified architecture (armhf - little endian)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'armhf')
|
||||
uses: docker://multiarch/ubuntu-core:armhf-bionic
|
||||
with:
|
||||
args: >
|
||||
bash -c
|
||||
"uname -a &&
|
||||
lscpu | grep Endian
|
||||
"
|
||||
- name: Configure, compile and test using qemu for the specified architecture (armhf - little endian)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'armhf')
|
||||
uses: docker://multiarch/ubuntu-core:armhf-bionic
|
||||
with:
|
||||
args: >
|
||||
bash -c
|
||||
"apt-get -y update &&
|
||||
apt-get -y install git autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev libgcrypt20-dev libpcre3-dev libmaxminddb-dev rrdtool librrd-dev &&
|
||||
env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} &&
|
||||
make all &&
|
||||
make -C example ndpiSimpleIntegration &&
|
||||
make -C rrdtool &&
|
||||
make -C python &&
|
||||
./tests/do.sh &&
|
||||
./tests/do-unit.sh
|
||||
"
|
||||
- name: Display qemu specified architecture (s390x - big endian)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 's390x')
|
||||
uses: docker://multiarch/ubuntu-core:s390x-bionic
|
||||
with:
|
||||
args: >
|
||||
bash -c
|
||||
"uname -a &&
|
||||
lscpu | grep Endian
|
||||
"
|
||||
- name: Configure and compile (no tests) using qemu for the specified architecture (s390x - big endian)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 's390x')
|
||||
uses: docker://multiarch/ubuntu-core:s390x-bionic
|
||||
with: #./tests/do.sh disabled because we know we have some problems with big-endian machines
|
||||
args: >
|
||||
bash -c
|
||||
"apt-get -y update &&
|
||||
apt-get -y install git autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev libgcrypt20-dev libpcre3-dev libmaxminddb-dev rrdtool librrd-dev &&
|
||||
env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} &&
|
||||
make all &&
|
||||
make -C example ndpiSimpleIntegration &&
|
||||
make -C rrdtool &&
|
||||
make -C python &&
|
||||
./tests/do-unit.sh
|
||||
"
|
||||
@@ -1,34 +0,0 @@
|
||||
name: CIFuzz
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
Fuzzing:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
sanitizer: [address, undefined, memory]
|
||||
steps:
|
||||
- name: Build Fuzzers - ${{ matrix.sanitizer }}
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'ndpi'
|
||||
dry-run: false
|
||||
sanitizer: ${{ matrix.sanitizer }}
|
||||
- name: Run Fuzzers - ${{ matrix.sanitizer }}
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'ndpi'
|
||||
fuzz-seconds: 600
|
||||
dry-run: false
|
||||
sanitizer: ${{ matrix.sanitizer }}
|
||||
- name: Check Crash (fails when a crash is detected)
|
||||
# Run Fuzzers return success even when setting dry-run to false.
|
||||
# A temporal workaround is to trigger failure manually if we fing crash files.
|
||||
run: |
|
||||
exit $(ls out/artifacts |wc -l)
|
||||
- name: Upload Crash (upload detected crash as artifacts)
|
||||
uses: actions/upload-artifact@v1
|
||||
if: failure()
|
||||
with:
|
||||
name: ${{ matrix.sanitizer }}-artifacts
|
||||
path: ./out/artifacts
|
||||
+32
-62
@@ -1,81 +1,51 @@
|
||||
*.[oa]
|
||||
*~
|
||||
/aclocal.m4
|
||||
/autom4te.cache/
|
||||
*o.cmd
|
||||
*.lo
|
||||
*.obj
|
||||
*o.cmd
|
||||
*.ko
|
||||
*.swp
|
||||
*.in
|
||||
*.la
|
||||
.libs
|
||||
.dirstamp
|
||||
.autotools
|
||||
compile
|
||||
/compile
|
||||
.cproject
|
||||
.project
|
||||
.settings
|
||||
stamp-h1
|
||||
/configure
|
||||
/configure.ac
|
||||
/config.guess
|
||||
/config.h
|
||||
/config.h.in
|
||||
/config.sub
|
||||
/config.log
|
||||
/config.status
|
||||
/config.sub
|
||||
/configure
|
||||
/configure.tmp
|
||||
.cproject
|
||||
/depcomp
|
||||
.dirstamp
|
||||
/example/.deps/
|
||||
/example/Makefile
|
||||
/example/ndpiReader
|
||||
/example/Makefile.dpdk
|
||||
/example/build
|
||||
/example/ndpiSimpleIntegration
|
||||
*.in
|
||||
/install-sh
|
||||
*.ko
|
||||
*.la
|
||||
/libndpi.pc
|
||||
.libs
|
||||
/libtool
|
||||
*.lo
|
||||
/ltmain.sh
|
||||
/missing
|
||||
/Makefile
|
||||
/libndpi.pc
|
||||
/libtool
|
||||
/src/lib/Makefile
|
||||
/src/include/Makefile
|
||||
/example/ndpiReader
|
||||
/example/Makefile
|
||||
/aclocal.m4
|
||||
/m4/libtool.m4
|
||||
/m4/lt~obsolete.m4
|
||||
/m4/ltoptions.m4
|
||||
/m4/ltsugar.m4
|
||||
/m4/ltversion.m4
|
||||
/Makefile
|
||||
/missing
|
||||
*.[o]
|
||||
*.obj
|
||||
*o.cmd
|
||||
*o.cmd
|
||||
.project
|
||||
.settings
|
||||
/src/include/Makefile
|
||||
/src/include/ndpi_config.h
|
||||
/src/include/ndpi_api.h
|
||||
/src/include/ndpi_define.h
|
||||
/m4/lt~obsolete.m4
|
||||
/autom4te.cache/
|
||||
/compile
|
||||
/example/.deps/
|
||||
/src/lib/.deps/
|
||||
/src/lib/Makefile
|
||||
/src/lib/protocols/.deps/
|
||||
/src/lib/third_party/src/.deps/
|
||||
stamp-h1
|
||||
*.swp
|
||||
/src/include/ndpi_define.h
|
||||
/test-driver
|
||||
/tests/Makefile
|
||||
/fuzz/.deps/
|
||||
/fuzz/Makefile
|
||||
/fuzz/fuzz_ndpi_reader
|
||||
/fuzz/fuzz_ndpi_reader_with_main
|
||||
/fuzz/fuzz_process_packet
|
||||
/fuzz/fuzz_process_packet_with_main
|
||||
/python/Makefile
|
||||
/tests/dga/Makefile
|
||||
/tests/do.sh
|
||||
/tests/unit/Makefile
|
||||
/example/libndpiReader.a
|
||||
/example/ndpiReader.exe
|
||||
/src/lib/libndpi.a
|
||||
/src/lib/libndpi.so*
|
||||
/src/lib/libndpi
|
||||
/src/lib/libndpi-4.1.0.dll
|
||||
/src/lib/libndpi.4
|
||||
/tests/dga/dga_evaluate
|
||||
/tests/unit/unit
|
||||
/tags
|
||||
/rrdtool/Makefile
|
||||
/rrdtool/rrd_anomaly
|
||||
/rrdtool/rrd_similarity
|
||||
/tests/performance/Makefile
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
/**
|
||||
* @name Suspicious packet->payload based integer arithmetic
|
||||
* @description An arithmetic operation influenced array access is suspicious
|
||||
* if it uses an integer value that is likely to be network-controlled, and
|
||||
* may require a closer manual audit.
|
||||
* @kind problem
|
||||
* @problem.severity warning
|
||||
* @id cpp/packet-payload-integer-arithmetic
|
||||
* @tags audit security
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
import semmle.code.cpp.dataflow.TaintTracking
|
||||
import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
|
||||
|
||||
/** A source of an integer value that is likely to come from the network.
|
||||
* This is produced by an invocation of a macro of the form `ntoh*` or `get_u_int*_t`,
|
||||
* called with `packet->payload` as an argument.
|
||||
*/
|
||||
|
||||
class NetworkMacro extends Macro {
|
||||
NetworkMacro() { this.getName().regexpMatch("^ntoh(ll|l|s)") }
|
||||
}
|
||||
|
||||
class NetworkIntegerSource extends Expr {
|
||||
NetworkIntegerSource() {
|
||||
exists(MacroInvocation mi |
|
||||
this = mi.getExpr() and
|
||||
mi.getUnexpandedArgument(0).regexpMatch(".*packet->payload.*") |
|
||||
// catch all get_u_int*_t(x)
|
||||
mi.getMacroName().regexpMatch("^get_u_int(64|32|16|8)_t") and
|
||||
// dedup ntoh*(get_u_int*_t(x)) since we'll catch those in the next case
|
||||
not mi.getOutermostMacroAccess().getMacro() instanceof NetworkMacro
|
||||
or
|
||||
// catch all ntoh*(x) ... this will also catch the nested cases
|
||||
mi.getMacro() instanceof NetworkMacro
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class ArithmeticOperation extends Operation {
|
||||
ArithmeticOperation() {
|
||||
this instanceof UnaryArithmeticOperation or this instanceof BinaryArithmeticOperation
|
||||
}
|
||||
}
|
||||
|
||||
class NetworkToArrayAccess extends TaintTracking::Configuration {
|
||||
NetworkToArrayAccess() { this = "NetworkToArrayAccess" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
source.asExpr() instanceof NetworkIntegerSource
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
exists(ArrayExpr ae | sink.asExpr() = ae.getArrayOffset())
|
||||
}
|
||||
}
|
||||
|
||||
class NetworkToArithmetic extends TaintTracking::Configuration {
|
||||
NetworkToArithmetic() { this = "NetworkToArithmetic" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
source.asExpr() instanceof NetworkIntegerSource
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
exists (Assignment assign |
|
||||
sink.asExpr() = assign.getRValue().(ArithmeticOperation) or
|
||||
sink.asExpr() = assign.(AssignArithmeticOperation)
|
||||
) or
|
||||
exists(LocalVariable var |
|
||||
sink.asExpr() = var.getInitializer().getExpr().(ArithmeticOperation)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// find audit candidates based on suspicious network integer use
|
||||
from NetworkIntegerSource source, Expr sink1, Expr sink2, NetworkToArithmetic config1, NetworkToArrayAccess config2
|
||||
where config1.hasFlow(DataFlow::exprNode(source), DataFlow::exprNode(sink1))
|
||||
// or this if you want integer arithmeric _OR_ array accesses
|
||||
and config2.hasFlow(DataFlow::exprNode(source), DataFlow::exprNode(sink2))
|
||||
select source, "Suspicious use of network integer arithmetic."
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
language: c
|
||||
|
||||
os:
|
||||
- osx
|
||||
- linux
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
# osx use always clang for build...
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
|
||||
install:
|
||||
#macos
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
|
||||
#linux
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update || true; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install build-essential; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libpcap-dev libtool autoconf automake autogen; fi
|
||||
|
||||
before_script:
|
||||
- ./autogen.sh
|
||||
# - lcov --directory . --zerocounters
|
||||
|
||||
script:
|
||||
- ./configure
|
||||
- make
|
||||
|
||||
after_script:
|
||||
- cd tests
|
||||
- ./do.sh
|
||||
|
||||
#after_success:
|
||||
#- cd ${TRAVIS_BUILD_DIR}
|
||||
#- lcov --directory . --capture --output-file coverage.info # capture coverage info
|
||||
#- lcov --remove coverage.info 'tests/*' 'packages/*' 'm4/*' 'doc/*' --output-file coverage.info
|
||||
#- lcov --list coverage.info # debug before upload
|
||||
#- coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info # uploads to coveralls
|
||||
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- packager@ntop.org
|
||||
on_success: never
|
||||
on_failure: always
|
||||
+2
-619
@@ -1,622 +1,5 @@
|
||||
# CHANGELOG
|
||||
|
||||
#### nDPI 4.2 (Feb 2022)
|
||||
|
||||
## New Features
|
||||
- Add a "confidence" field indicating the reliability of the classification
|
||||
- Add risk exceptions for services and domain names via ndpi_add_domain_risk_exceptions()
|
||||
- Add ability to report whether a protocol is encrypted
|
||||
|
||||
## New Supported Protocols and Services
|
||||
- Add protocol detection for:
|
||||
- Badoo
|
||||
- Cassandra
|
||||
- EthernetIP
|
||||
|
||||
## Improvements
|
||||
- Reduce memory footprint
|
||||
- Improve protocol detection for:
|
||||
- BitTorrent
|
||||
- ICloud Private Relay
|
||||
- IMAP, POP3, SMTP
|
||||
- Log4J/Log4Shell
|
||||
- Microsoft Azure
|
||||
- Pandora TV
|
||||
- RTP
|
||||
- RTSP
|
||||
- Salesforce
|
||||
- STUN
|
||||
- Whatsapp
|
||||
- QUICv2
|
||||
- Zoom
|
||||
- Add flow risk:
|
||||
- NDPI_CLEAR_TEXT_CREDENTIALS
|
||||
- NDPI_POSSIBLE_EXPLOIT (Log4J)
|
||||
- NDPI_TLS_FATAL_ALERT
|
||||
- NDPI_TLS_CERTIFICATE_ABOUT_TO_EXPIRE
|
||||
- Update WhatsAPP and Instagram addresses
|
||||
- Update the list of default ports for QUIC
|
||||
- Update WindowsUpdate URLs
|
||||
- Add support for the .goog Google TLD
|
||||
- Add googletagmanager.com
|
||||
- Add bitmaps and API for handling compressed bitmaps
|
||||
- Add JA3 in risk exceptions
|
||||
- Add entropy calculation to check for suspicious (encrypted) payload
|
||||
- Add extraction of hostname in SMTP
|
||||
- Add RDP over UDP dissection
|
||||
- Add support for TLS over IPV6 in Subject Alt Names field
|
||||
- Improve JSON and CSV serialization
|
||||
- Improve IPv6 support for almost all dissectors
|
||||
- Improve CI and unit tests, add arm64, armhf and s390x as part of CI
|
||||
- Improve WHOIS detection, reduce false positives
|
||||
- Improve DGA detection for skipping potential DGAs of known/popular domain names
|
||||
- Improve user agent analysis
|
||||
- Reworked HTTP protocol dissection including HTTP proxy and HTTP connect
|
||||
|
||||
## Changes
|
||||
- TLS obsolete protocol is set when TLS < 1.2 (used to be 1.1)
|
||||
- Numeric IPs are not considered for DGA checks
|
||||
- Differentiate between standard Amazon stuff (i.e market) and AWS
|
||||
- Remove Playstation VUE protocol
|
||||
- Remove pandora.tv from Pandora protocol
|
||||
- Remove outdated SoulSeek dissector
|
||||
|
||||
## Fixes
|
||||
- Fix race conditions
|
||||
- Fix dissectors to be big-endian friendly
|
||||
- Fix heap overflow in realloc wrapper
|
||||
- Fix errors in Kerberos, TLS, H323, Netbios, CSGO, Bittorrent
|
||||
- Fix wrong tuple comparison
|
||||
- Fix ndpi_serialize_string_int64
|
||||
- Fix Grease values parsing
|
||||
- Fix certificate mismatch check
|
||||
- Fix null-dereference read for Zattoo with IPv6
|
||||
- Fix dissectors initialization for XBox, Diameter
|
||||
- Fix confidence for STUN classifications
|
||||
- Fix FreeBSD support
|
||||
- Fix old GQUIC versions on big-endian machines
|
||||
- Fix aho-corasick on big-endian machines
|
||||
- Fix DGA false positive
|
||||
- Fix integer overflow for QUIC
|
||||
- Fix HTTP false positives
|
||||
- Fix SonarCloud-CI support
|
||||
- Fix clashes setting the hostname on similar protocols (FTP, SMTP)
|
||||
- Fix some invalid TLS guesses
|
||||
- Fix crash on ARM (Raspberry)
|
||||
- Fix DNS (including fragmented DNS) dissection
|
||||
- Fix parsing of IPv6 packets with extension headers
|
||||
- Fix extraction of Realm attribute in STUN
|
||||
- Fix support for START-TLS sessions in FTP
|
||||
- Fix TCP retransmissions for multiple dissectors
|
||||
- Fix DES initialisation
|
||||
- Fix Git protocol dissection
|
||||
- Fix certificate mismatch for TLS flows with no client hello observed
|
||||
- Fix old versions of GQUIC on big-endian machines
|
||||
|
||||
## Misc
|
||||
- Add tool for generating automatically the Azure IP list
|
||||
|
||||
#### nDPI 4.0 (July 2021)
|
||||
|
||||
## New Features
|
||||
- Add API for computing RSI (Relative Strenght Index)
|
||||
- Add GeoIP support
|
||||
- Add fragments management
|
||||
- Add API for jitter calculation
|
||||
- Add single exponential smoothing API
|
||||
- Add timeseries forecasting support implementing Holt-Winters with confidence interval
|
||||
- Add support for MAC to radi tree and expose the full API to applications
|
||||
- Add JA3+, with ALPN and elliptic curve
|
||||
- Add double exponential smoothing implementation
|
||||
- Extended API for managing flow risks
|
||||
- Add flow risk score
|
||||
- New flow risks:
|
||||
- Desktop or File Sharing Session
|
||||
- HTTP suspicious content (useful for tracking trickbot)
|
||||
- Malicious JA3
|
||||
- Malicious SHA1
|
||||
- Risky domain
|
||||
- Risky AS
|
||||
- TLS Certificate Validity Too Long
|
||||
- TLS Suspicious Extension
|
||||
|
||||
## New Supported Protocols and Services
|
||||
- New protocols:
|
||||
- AmongUs
|
||||
- AVAST SecureDNS
|
||||
- CPHA (CheckPoint High Availability Protocol)
|
||||
- DisneyPlus
|
||||
- DTLS
|
||||
- Genshin Impact
|
||||
- HP Virtual Machine Group Management (hpvirtgrp)
|
||||
- Mongodb
|
||||
- Pinterest
|
||||
- Reddit
|
||||
- Snapchat VoIP calls
|
||||
- Tumblr
|
||||
- Virtual Asssitant (Alexa, Siri)
|
||||
- Z39.50
|
||||
- Add protocols to HTTP as subprotocols
|
||||
- Add detection of TLS browser type
|
||||
- Add connectionless DCE/RPC detection
|
||||
|
||||
## Improvements
|
||||
- 2.5x speed bump. Example ndpiReader with a long mixed pcap
|
||||
v3.4 - nDPI throughput: 1.29 M pps / 3.35 Gb/sec
|
||||
v4.0 - nDPI throughput: 3.35 M pps / 8.68 Gb/sec
|
||||
- Improve detection/dissection of:
|
||||
- AnyDesk
|
||||
- DNS
|
||||
- Hulu
|
||||
- DCE/RPC (avoid false positives)
|
||||
- dnscrypt
|
||||
- Facebook (add new networks)
|
||||
- Fortigate
|
||||
- FTP Control
|
||||
- HTTP
|
||||
- Fix user-agent parsing
|
||||
- Fix logs when NDPI_ENABLE_DEBUG_MESSAGES is defined
|
||||
- IEC104
|
||||
- IEC60870
|
||||
- IRC
|
||||
- Netbios
|
||||
- Netflix
|
||||
- Ookla speedtest (detection over IPv6)
|
||||
- openspeedtest.com
|
||||
- Outlook / MicrosoftMail
|
||||
- QUIC
|
||||
- update to draft-33
|
||||
- improve handling of SNI
|
||||
- support for fragmented Client Hello
|
||||
- support for DNS-over-QUIC
|
||||
- RTSP
|
||||
- RTSP via HTTP
|
||||
- SNMP (reimplemented)
|
||||
- Skype
|
||||
- SSH
|
||||
- Steam (Steam Datagram Relay - SDR)
|
||||
- STUN (avoid false positives, improved Skype detection)
|
||||
- TeamViewer (add new hosts)
|
||||
- TOR (update hosts)
|
||||
- TLS
|
||||
- Certificate Subject matching
|
||||
- Check for common ALPNs
|
||||
- Reworked fingerprint calculation
|
||||
- Fix extraction for TLS signature algorithms
|
||||
- Fix ClientHello parsing
|
||||
- UPnP
|
||||
- wireguard
|
||||
- Improve DGA detection
|
||||
- Improve JA3
|
||||
- Improve Mining detection
|
||||
- Improve string matching algorithm
|
||||
- Improve ndpi_pref_enable_tls_block_dissection
|
||||
- Optimize speed and memory size
|
||||
- Update ahocorasick library
|
||||
- Improve subprotocols detection
|
||||
|
||||
## Fixes
|
||||
- Fix partial application matching
|
||||
- Fix multiple segfault and leaks
|
||||
- Fix uninitialized memory use
|
||||
- Fix release of patterns allocated in ndpi_add_string_to_automa
|
||||
- Fix return value of ndpi_match_string_subprotocol
|
||||
- Fix setting of flow risks on 32 bit machines
|
||||
- Fix TLS certificate threshold
|
||||
- Fix a memory error in TLS JA3 code
|
||||
- Fix false positives in Z39.50
|
||||
- Fix off-by-one memory error for TLS-JA3
|
||||
- Fix bug in ndpi_lru_find_cache
|
||||
- Fix invalid xbox and playstation port guesses
|
||||
- Fix CAPWAP tunnel decoding
|
||||
- Fix parsing of DLT_PPP datalink type
|
||||
- Fix dissection of QUIC initial packets coalesced with 0-RTT one
|
||||
- Fix parsing of GTP headers
|
||||
- Add bitmap boundary checks
|
||||
|
||||
## Misc
|
||||
- Update download category name
|
||||
- Update category labels
|
||||
- Renamed Skype in Skype_Teams (the protocol is now shared across these apps)
|
||||
- Add IEC analysis wireshark plugin
|
||||
- Flow risk visualization in Wireshark
|
||||
- ndpiReader
|
||||
- add statistics about nDPI performance
|
||||
- fix memory leak
|
||||
- fix collecting of risks statistics
|
||||
- Move installed libraries from /usr/local to /usr
|
||||
- Improve NDPI_API_VERSION generation
|
||||
- Update ndpi_ptree_match_addr prototype
|
||||
|
||||
#### nDPI 3.4 (October 2020)
|
||||
|
||||
## New Features
|
||||
* Completely reworked and extended QUIC dissector
|
||||
* Added flow risk concept to move nDPI towards result interpretation
|
||||
* Added ndpi_dpi2json() API call
|
||||
* Added DGA risk for names that look like a DGA
|
||||
* Added HyperLogLog cardinality estimator API calls
|
||||
* Added ndpi_bin_XXX API calls to handle bin handling
|
||||
* Fully fuzzy tested code that has greatly improved reliability and robustness
|
||||
|
||||
## New Supported Protocols and Services
|
||||
* QUIC
|
||||
* SMBv1
|
||||
* WebSocket
|
||||
* TLS: added ESNI support
|
||||
* SOAP
|
||||
* DNScrypt
|
||||
|
||||
## Improvements
|
||||
* Python CFFI bindings
|
||||
* Various TLS extensions and fixes including extendede metadata support
|
||||
* Added various pcap files for testing corner cases in protocols
|
||||
* Various improvements in JSON/Binary data serialization
|
||||
* CiscoVPN
|
||||
* H323
|
||||
* MDNS
|
||||
* MySQL 8
|
||||
* IEC 60870-5-104
|
||||
* DoH/DoT dissection improvements
|
||||
* Office365 renamed to Microsoft365
|
||||
* Major protocol dissection improvement in particular with unknwon traffic
|
||||
* Improvement in Telegram v6 protocol support
|
||||
* HTTP improvements to detect file download/upload and binary files
|
||||
* BitTorrent and WhatsApp dissection improvement
|
||||
* Spotify
|
||||
* Added detection of malformed packets
|
||||
* Fuzzy testing support has been greatly improved
|
||||
* SSH code cleanup
|
||||
|
||||
## Fixes
|
||||
* Fixed various memory leaks and race conditions in protocol decoding
|
||||
* NATS, CAPWAP dissector
|
||||
* Removed HyperScan support that greatly simplified the code
|
||||
* ARM platform fixes on memory alignment
|
||||
* Wireshark extcap support
|
||||
* DPDK support
|
||||
* OpenWRT, OpenBSD support
|
||||
* MINGW compiler support
|
||||
|
||||
## MISC
|
||||
* Created demo app for nDPI newcomers
|
||||
* Removed obsolete pplive and pando protocols
|
||||
|
||||
#### nDPI 3.2 (February 2020)
|
||||
|
||||
## New Features
|
||||
* New API calls
|
||||
* Protocol detection: ndpi_is_protocol_detected
|
||||
* Categories: ndpi_load_categories_file / ndpi_load_category
|
||||
* JSON/TLV serialization: ndpi_serialize_string_boolean / ndpi_serialize_uint32_boolean
|
||||
* Patricia tree: ndpi_load_ipv4_ptree
|
||||
* Module initialization: ndpi_init_detection_module / ndpi_finalize_initalization
|
||||
* Base64 encoding: ndpi_base64_encode
|
||||
* JSON exprot: ndpi_flow2json
|
||||
* Print protocol: ndpi_get_l4_proto_name / ndpi_get_l4_proto_info
|
||||
* Libfuzz integration
|
||||
* Implemented Community ID hash (API call ndpi_flowv6_flow_hash and ndpi_flowv4_flow_hash)
|
||||
* Detection of RCE in HTTP GET requests via PCRE
|
||||
* Integration of the libinjection library to detect SQL injections and XSS type attacks in HTTP requests
|
||||
|
||||
## New Supported Protocols and Services
|
||||
* TLS
|
||||
* Added ALPN support
|
||||
* Added export of supported version in TLS header
|
||||
* Added Telnet dissector with metadata extraction
|
||||
* Added Zabbix dissector
|
||||
* Added POP3/IMAP metadata extraction
|
||||
* Added FTP user/password extraction
|
||||
* Added NetBIOS metadata extraction
|
||||
* Added Kerberos metadata extraction
|
||||
* Implemented SQL Injection and XSS attack detection
|
||||
* Host-based detection improvements and changes
|
||||
* Added Microsoft range
|
||||
* Added twitch.tv website
|
||||
* Added brasilbandalarga.com.br and .eaqbr.com.br as EAQ
|
||||
* Added 20.180.0.0/14, 20.184.0.0/13 range as Skype
|
||||
* Added 52.84.0.0/14 range as Amazon
|
||||
* Added ^pastebin.com
|
||||
* Changed 13.64.0.0/11 range from Skype to Microsoft
|
||||
* Refreshed Whatsapp server list, added *whatsapp-*.fbcdn.net IPs
|
||||
* Added public DNSoverHTTPS servers
|
||||
|
||||
## Improvements
|
||||
* Reworked and improved the TLS dissector
|
||||
* Reworked Kerberos dissector
|
||||
* Improved DNS response decoding
|
||||
* Support for DNS continuous flow dissection
|
||||
* Improved Python bindings
|
||||
* Improved Ethereum support
|
||||
* Improved categories detection with streaming and HTTP
|
||||
* Support for IP-based detection to compute the application protocol
|
||||
* Renamed protocol 104 to IEC60870 (more meaningful)
|
||||
* Added failed authentication support with FTP
|
||||
* Renamed DNSoverHTTPS to handle bot DoH and DoT
|
||||
* Implemented stacked DPI decoding
|
||||
* Improvements for CapWAP and Bloomberg
|
||||
* Improved SMB dissection
|
||||
* Improved SSH dissection
|
||||
* Added capwap support
|
||||
* Modified API signatures for ndpi_ssl_version2str / ndpi_detection_giveup
|
||||
* Removed ndpi_pref_http_dont_dissect_response / ndpi_pref_dns_dont_dissect_response (replaced by ndpi_extra_dissection_possible)
|
||||
|
||||
## Fixes
|
||||
* Fixed memory invalid access in SMTP and leaks in TLS
|
||||
* Fixed a few memory leaks
|
||||
* Fixrd invalid memory access in a few protocol dissectors (HTTP, memcached, Citrix, STUN, DNS, Amazon Video, TLS, Viber)
|
||||
* Fixed IPv6 address format across the various platforms/distributions
|
||||
* Fixed infinite loop in ndpi_workflow_process_packet
|
||||
* Fixed SHA1 certificate detection
|
||||
* Fixed custom protocol detection
|
||||
* Fixed SMTP dissection (including email)
|
||||
* Fixed Telnet dissection and invalid password report
|
||||
* Fixed invalid category matching in HTTP
|
||||
* Fixed Skype and STUN false positives
|
||||
* Fixed SQL Injection detection
|
||||
* Fixed invalid SMBv1 detection
|
||||
* Fixed SSH dissection
|
||||
* Fixed ndpi_ssl_version2str
|
||||
* Fixed ndpi_extra_dissection_possible
|
||||
* Fixed out of bounds read in ndpi_match_custom_category
|
||||
|
||||
## Misc
|
||||
* ndpiReader
|
||||
* CSV output enhancements
|
||||
* Added tunnelling decapsulation
|
||||
* Improved HTTP reporting
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 3.0 (October 2019)
|
||||
|
||||
## New Features
|
||||
* nDPI now reports the protocol ASAP even when specific fields have not yet been dissected because such packets have not yet been observed. This is important for inline applications that can immediately act on traffic. Applications that need full dissection need to call the new API function ndpi_extra_dissection_possible() to check if metadata dissection has been completely performed or if there is more to read before declaring it completed.
|
||||
* TLS (formerly identified as SSL in nDPI v2.x) is now dissected more deeply, certificate validity is extracted as well certificate SHA-1.
|
||||
* nDPIreader can now export data in CSV format with option `-C`
|
||||
* Implemented Sequence of Packet Length and Time (SPLT) and Byte Distribution (BD) as specified by Cisco Joy (https://github.com/cisco/joy). This allows malware activities on encrypted TLS streams. Read more at https://blogs.cisco.com/security/detecting-encrypted-malware-traffic-without-decryption
|
||||
* Available as library and in `ndpiReader` with option `-J`
|
||||
* Promoted usage of protocol categories rather than protocol identifiers in order to classify protocols. This allows application protocols to be clustered in families and thus better managed by users/developers rather than using hundred of protocols unknown to most of the people.
|
||||
* Added Inter-Arrival Time (IAT) calculation used to detect protocol misbehaviour (e.g. slow-DoS detection)
|
||||
* Added data analysis features for computign metrics such as entropy, average, stddev, variance on a single and consistent place that will prevent when possible. This should ease traffic analysis on monitoring/security applications. New API calls have been implemented such as ndpi_data_XXX() to handle these calculations.
|
||||
* Initial release of Python bindings available under nDPI/python.
|
||||
* Implemented search of human readable strings for promoting data exfiltration detection
|
||||
* Available as library and in `ndpiReader` with option `-e`
|
||||
* Fingerprints
|
||||
* JA3 (https://github.com/salesforce/ja3)
|
||||
* HASSH (https://github.com/salesforce/hassh)
|
||||
* DHCP
|
||||
* Implemented a library to serialize/deserialize data in both Type-Length-Value (TLV) and JSON format
|
||||
* Used by nProbe/ntopng to exchange data via ZMQ
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* DTLS (i.e. TLS over UDP)
|
||||
* Hulu
|
||||
* TikTok/Musical.ly
|
||||
* WhatsApp Video
|
||||
* DNSoverHTTPS
|
||||
* Datasaver
|
||||
* Line protocol
|
||||
* Google Duo and Hangout merged
|
||||
* WireGuard VPN
|
||||
* IMO
|
||||
* Zoom.us
|
||||
|
||||
## Improvements
|
||||
|
||||
* TLS
|
||||
* Organizations
|
||||
* Ciphers
|
||||
* Certificate analysis
|
||||
* Added PUBLISH/SUBSCRIBE methods to SIP
|
||||
* Implemented STUN cache to enhance matching of STUN-based protocols
|
||||
* Dissection improvements
|
||||
* Viber
|
||||
* WhatsApp
|
||||
* AmazonVideo
|
||||
* SnapChat
|
||||
* FTP
|
||||
* QUIC
|
||||
* OpenVPN support for UDP-based VPNs
|
||||
* Facebook Messenger mobile
|
||||
* Various improvements for STUN, Hangout and Duo
|
||||
* Added new categories: CUSTOM_CATEGORY_ANTIMALWARE, NDPI_PROTOCOL_CATEGORY_MUSIC, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_CATEGORY_SHOPPING, NDPI_PROTOCOL_CATEGORY_PRODUCTIVITY and NDPI_PROTOCOL_CATEGORY_FILE_SHARING
|
||||
* Added NDPI_PROTOCOL_DANGEROUS classification
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fixed the dissection of certain invalid DNS responses
|
||||
* Fixed Spotify dissection
|
||||
* Fixed false positives with FTP and FTP_DATA
|
||||
* Fix to discard STUN over TCP flows
|
||||
* Fixed MySQL dissector
|
||||
* Fix category detection due to missing initialization
|
||||
* Fix DNS rsp_addr missing in some tiny responses
|
||||
* Various hardening fixes
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.8 (March 2019)
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* Added Modbus over TCP dissector
|
||||
|
||||
## Improvements
|
||||
|
||||
* Wireshark Lua plugin compatibility with Wireshark 3
|
||||
* Improved MDNS dissection
|
||||
* Improved HTTP response code handling
|
||||
* Full dissection of HTTP responses
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fixed false positive mining detection
|
||||
* Fixed invalid TCP DNS dissection
|
||||
* Releasing buffers upon `realloc` failures
|
||||
* ndpiReader: Prevents references after free
|
||||
* Endianness fixes
|
||||
* Fixed IPv6 HTTP traffic dissection
|
||||
* Fixed H.323 detection
|
||||
|
||||
## Other
|
||||
|
||||
* Disabled ookla statistics which need to be improved
|
||||
* Support for custom protocol files of arbitrary length
|
||||
* Update radius.c to RFC2865
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.6 (December 2018)
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* New Bitcoin, Ethereum, ZCash, Monero dissectors all identified as Mining
|
||||
* New Signal.org dissector
|
||||
* New Nest Log Sink dissector
|
||||
* New UPnP dissector
|
||||
* Added support for SMBv1 traffic, split from SMBv23
|
||||
|
||||
## Improvements
|
||||
|
||||
* Improved Skype detection, merged Skype call in/out into Skype Call
|
||||
* Improved heuristics for Skype, Teredo, Netbios
|
||||
* Improved SpeedTest (Ookla) detection
|
||||
* Improved WhatsApp detection
|
||||
* Improved WeChat detection
|
||||
* Improved Facebook Messenger detection
|
||||
* Improved Messenger/Hangout detection
|
||||
* Improved SSL detection, prevent false positives
|
||||
* Improved guess for UDP protocols
|
||||
* Improved STUN detection
|
||||
* Added more Ubuntu servers
|
||||
* Added missing categorization with giveup/guess
|
||||
* Optimizations for TCP flows that do not start with a SYN packet (early giveup)
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fixed eDonkey false positives
|
||||
* Fixed Dropbox dissector
|
||||
* Fixed Spotify dissector
|
||||
* Fixed custom protocol loading
|
||||
* Fixed missing Application Data packet for TLS
|
||||
* Fixed buffer overflows
|
||||
* Fixed custom categories match by IP
|
||||
* Fixed category field not accounted in ndpi_get_proto_category
|
||||
* Fixed null pointer dereference in ndpi_detection_process_packet
|
||||
* Fixed compilation on Mac
|
||||
|
||||
## Other
|
||||
|
||||
* Deb and RPM packages: ndpi with shared libraries and binaries, ndpi-dev with headers and static libraries
|
||||
* Protocols now have an optional subprotocol: Spotify cannot have subprotocols, DNS can (DNS.Spotify)
|
||||
* New API functions:
|
||||
* ndpi_fill_ip_protocol_category to handle ICMP flows category
|
||||
* ndpi_flowv4_flow_hash and ndpi_flowv6_flow_hash to support the Community ID Flow Hashing (https://github.com/corelight/community-id-spec)
|
||||
* ndpi_protocol2id to print the protocol as ID
|
||||
* ndpi_get_custom_category_match to search host in custom categories
|
||||
* Changed ndpi_detection_giveup API: guess is now part of the call
|
||||
* Added DPDK support to ndpiReader
|
||||
* Removed Musical.ly protocol (service no longer used)
|
||||
* Custom categories have now priority over protocol related categories
|
||||
* Improved clang support
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.4 (August 2018)
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* Showmax.com
|
||||
* Musical.ly
|
||||
* RapidVideo
|
||||
* VidTO streaming service
|
||||
* Apache JServ Protocol
|
||||
* Facebook Messenger
|
||||
* FacebookZero protocol
|
||||
|
||||
## Improvements
|
||||
|
||||
* Improved YouTube support
|
||||
* Improved Netflix support
|
||||
* Updated Google Hangout detection
|
||||
* Updated Twitter address range
|
||||
* Updated Viber ports, subnet and domain
|
||||
* Updated AmazonVideo detection
|
||||
* Updated list of FaceBook sites
|
||||
* Initial Skype in/out support
|
||||
* Improved Tor detection
|
||||
* Improved hyperscan support and category definition
|
||||
* Custom categories loading, extended ndpiReader (`-c <file>`) for loading name-based categories
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fixes for Instagram flows classified as Facebook
|
||||
* Fixed Spotify detection
|
||||
* Fixed minimum packet payload length for SSDP
|
||||
* Fixed length check in MSN, x-steam-sid, Tor certificate name
|
||||
* Increase client's maximum payload length for SSH
|
||||
* Fixed end-of-line bounds handling
|
||||
* Fixed substring matching
|
||||
* Fix for handling IP address based custom categories
|
||||
* Repaired wrong timestamp calculation
|
||||
* Fixed memory leak
|
||||
* Optimized memory usage
|
||||
|
||||
## Other/Changes
|
||||
|
||||
* New API calls:
|
||||
* `ndpi_set_detection_preferences()`
|
||||
* `ndpi_load_hostname_category()`
|
||||
* `ndpi_enable_loaded_categories()`
|
||||
* `ndpi_fill_protocol_category()`
|
||||
* `ndpi_process_extra_packet()`
|
||||
* Skype CallIn/CallOut are now set as Skype.SkypeCallOut Skype.SkypeCallIn
|
||||
* Added support for SMTPS on port 587
|
||||
* Changed RTP from VoIP to Media category
|
||||
* Added site unavailable category
|
||||
* Added custom categories CUSTOM_CATEGORY_MINING, CUSTOM_CATEGORY_MALWARE, CUSTOM_CATEGORY_ADVERTISEMENT, CUSTOM_CATEGORY_BANNED_SITE
|
||||
* Implemented hash-based categories
|
||||
* Converted some not popular protocols to NDPI_PROTOCOL_GENERIC with category detection
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.2.2 (April 2018)
|
||||
|
||||
## Main New Features
|
||||
|
||||
* Hyperscan support
|
||||
* `ndpi_get_api_version` API call to be used in applications that are dynamically linking with nDPI
|
||||
* `--enable-debug-messages` to enable debug information output
|
||||
* Increased number of protocols to 512
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* GoogleDocs
|
||||
* GoogleServices
|
||||
* AmazonVideo
|
||||
* ApplePush
|
||||
* Diameter
|
||||
* GooglePlus
|
||||
* WhatsApp file exchage
|
||||
|
||||
## Improvements
|
||||
|
||||
* WhatsApp detection
|
||||
* Amazon detection
|
||||
* Improved Google Drive
|
||||
* Improved Spotify support
|
||||
* Improved SNI matching when using office365
|
||||
* Improved HostShield VPN
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fixed invalid RTP/Skype detection
|
||||
* Fixed possible out-of-bounds due to malformed DHCP packets
|
||||
* Fixed buffer overflow in function `ndpi_debug_printf`
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.2 (December 2017)
|
||||
|
||||
@@ -677,7 +60,7 @@
|
||||
* Ubiquity AirControl 2
|
||||
* HEP (Extensible Encapsulation Protocol)
|
||||
* WhatsApp Voice vs WhatsApp (chat, no voice)
|
||||
* Viber
|
||||
* Viber
|
||||
* Wechat
|
||||
* Github
|
||||
* Hotmail
|
||||
@@ -706,7 +89,7 @@
|
||||
* Improved HTTP subprotocol matching
|
||||
* Implemented DHCP host name extraction
|
||||
* Updated Facebook detection by ip server ranges
|
||||
* Updated Twitter networks
|
||||
* Updated Twitter networks
|
||||
* Improved Microsoft detection
|
||||
* Enhanced Google detection
|
||||
* Improved BT-uTP protocol dissection
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# How to contribute
|
||||
|
||||
Please keep all code, comments, issues and pull requests in English, otherwise they will be **removed**.
|
||||
|
||||
## Found a bug?
|
||||
|
||||
- First, check there are no already open issues for the bug. See [here](https://github.com/ntop/nDPI/issues).
|
||||
- If there is not open issue addressing the bug, [open a new one](https://github.com/ntop/nDPI/issues/new).
|
||||
- Make sure to include a **descriptive and clear title and description**, including the **version of nDPI** being used.
|
||||
- Try to include steps to reproduce the bug.
|
||||
- If applicable, try to provide a stacktrace.
|
||||
- Providing a simple test case which shows the bug would help resolve the issue faster.
|
||||
|
||||
## Written a new protocol dissector?
|
||||
|
||||
- Ensure you have followed the guide in the [README](https://github.com/ntop/nDPI#how-to-add-a-new-protocol-dissector).
|
||||
- Open a new pull request with a **clear, descriptive** title.
|
||||
- Ensure the pull request passes CI testing. Any pull request which fails CI will be **ignored**.
|
||||
- If possible, add a new test for the new protocol. See [existing tests](https://github.com/ntop/nDPI/tree/dev/tests) for examples.
|
||||
|
||||
## Written a fix for a bug?
|
||||
|
||||
- Open a new pull request with a **clear, descriptive** title.
|
||||
- If there is an open issue for the bug, ensure the description of the pull request contains `Fixes #issue_number`.
|
||||
- Ensure the pull request passes CI testing. Any pull request which fails CI will be **ignored**.
|
||||
|
||||
Finally, thank you for your contributions.
|
||||
+2
-8
@@ -1,14 +1,8 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
SUBDIRS = src/lib @EXTRA_TARGETS@
|
||||
|
||||
if BUILD_FUZZTARGETS
|
||||
SUBDIRS += fuzz
|
||||
endif
|
||||
SUBDIRS = src/lib example tests
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libndpi.pc
|
||||
|
||||
EXTRA_DIST = README.md CHANGELOG.md CONTRIBUTING.md autogen.sh wireshark python windows utils packages example/MacOS doc/api.rst doc/conf.py doc/flow_risks.rst doc/guide/nDPI_QuickStartGuide.pages doc/guide/nDPI_QuickStartGuide.pdf doc/img/logo.png doc/index.rst doc/Makefile doc/what_is_ndpi.rst
|
||||
|
||||
changelog:
|
||||
git log --since={`curl -s https://github.com/ntop/ndpi/releases | grep datetime | head -n1 | egrep -o "[0-9]+\-[0-9]+\-[0-9]+"`} --name-only --pretty=format:" - %s" | grep "^ " > CHANGELOG.latest
|
||||
EXTRA_DIST = libndpi.sym autogen.sh
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
## Compiling nDPI with Fuzzer
|
||||
|
||||
- Install the latest clang (sudo apt-get install clang-10)
|
||||
- Export environamental variables to prefer clang over g++ (of installed)
|
||||
- export CC=/usr/bin/clang-10
|
||||
- export CPP=/usr/bin/clang-cpp-10
|
||||
- export CXX=/usr/bin/clang++-10
|
||||
- export LD=/usr/bin/ld.lld-10
|
||||
- Run autogen.sh
|
||||
- ./autogen.sh --with-sanitizer --enable-fuzztargets
|
||||
|
||||
|
||||
## Testing nDPI with ClusterFuzz Artifacts
|
||||
- Download the artifact (example clusterfuzz-testcase-fuzz_process_packet-4992218834796544)
|
||||
- Run nDPI against the artifact
|
||||
- Example: ./fuzz/fuzz_process_packet_with_main clusterfuzz-testcase-fuzz_process_packet-4992218834796544
|
||||
|
||||
The output is the error report
|
||||
```
|
||||
./fuzz/fuzz_process_packet_with_main /tmp/clusterfuzz-testcase-fuzz_process_packet-4992218834796544
|
||||
AddressSanitizer:DEADLYSIGNAL
|
||||
=================================================================
|
||||
==11590==ERROR: AddressSanitizer: SEGV on unknown address 0x61a100000087 (pc 0x00000056e6a4 bp 0x7ffd624fa170 sp 0x7ffd624fa090 T0)
|
||||
==11590==The signal is caused by a READ memory access.
|
||||
#0 0x56e6a4 in quic_len /home/deri/nDPI/src/lib/protocols/quic.c:203:12
|
||||
#1 0x575d6b in decrypt_initial_packet /home/deri/nDPI/src/lib/protocols/quic.c:993:16
|
||||
#2 0x571776 in get_clear_payload /home/deri/nDPI/src/lib/protocols/quic.c:1302:21
|
||||
#3 0x56f149 in ndpi_search_quic /home/deri/nDPI/src/lib/protocols/quic.c:1658:19
|
||||
#4 0x503935 in check_ndpi_detection_func /home/deri/nDPI/src/lib/ndpi_main.c:4683:6
|
||||
#5 0x5056fb in check_ndpi_udp_flow_func /home/deri/nDPI/src/lib/ndpi_main.c:4742:10
|
||||
#6 0x505152 in ndpi_check_flow_func /home/deri/nDPI/src/lib/ndpi_main.c:4775:12
|
||||
#7 0x5174cf in ndpi_detection_process_packet /home/deri/nDPI/src/lib/ndpi_main.c:5545:15
|
||||
#8 0x4c709b in LLVMFuzzerTestOneInput /home/deri/nDPI/fuzz/fuzz_process_packet.c:30:3
|
||||
#9 0x4c7640 in main /home/deri/nDPI/fuzz/fuzz_process_packet.c:90:17
|
||||
#10 0x7f888e5dabf6 in __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
|
||||
#11 0x41c399 in _start (/home/deri/nDPI/fuzz/fuzz_process_packet_with_main+0x41c399)
|
||||
|
||||
AddressSanitizer can not provide additional info.
|
||||
SUMMARY: AddressSanitizer: SEGV /home/deri/nDPI/src/lib/protocols/quic.c:203:12 in quic_len
|
||||
==11590==ABORTING
|
||||
```
|
||||
@@ -1,14 +1,11 @@
|
||||
![ntop][ntopng_logo] ![ntop][ntop_logo]
|
||||
# nDPI
|
||||
|
||||
[](https://github.com/ntop/nDPI/actions?query=workflow%3ABuild)
|
||||
[](https://lgtm.com/projects/g/ntop/nDPI/context:cpp)
|
||||
[](https://lgtm.com/projects/g/ntop/nDPI/alerts)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:ndpi)
|
||||
[](https://travis-ci.org/ntop/nDPI)
|
||||
|
||||
## What is nDPI ?
|
||||
|
||||
nDPI® is an open source LGPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. We have tried to push them into the OpenDPI source tree but nobody answered emails so we have decided to create our own source tree
|
||||
nDPI is an open source LGPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. We have tried to push them into the OpenDPI source tree but nobody answered emails so we have decided to create our own source tree
|
||||
|
||||
### How To Compile nDPI
|
||||
|
||||
@@ -26,14 +23,6 @@ Please note that the pre-requisites for compilation include:
|
||||
- GNU tools (autogen, automake, autoconf, libtool)
|
||||
- GNU C compiler (gcc)
|
||||
|
||||
On Debian/Ubuntu systems do:
|
||||
- sudo apt-get install build-essential git bison flex libpcap-dev libtool libtool-bin autoconf pkg-config automake autogen libjson-c-dev libnuma-dev libgcrypt20-dev libpcre2-dev
|
||||
|
||||
FreeBSD
|
||||
- sudo pkg install gcc git autoconf automake libtool devel/pkgconf json-c gmake
|
||||
|
||||
Remember to use gmake and not make on FreeBSD
|
||||
|
||||
### How To Add A New Protocol Dissector
|
||||
|
||||
The entire procedure of adding new protocols in detail:
|
||||
@@ -45,24 +34,28 @@ The entire procedure of adding new protocols in detail:
|
||||
5. Choose (do not change anything) a selection bitmask from: src/include/ndpi_define.h
|
||||
6. Add a new entry in ndpi_set_protocol_detection_bitmask2 in: src/lib/ndpi_main.c
|
||||
7. Set protocol default ports in ndpi_init_protocol_defaults in: src/lib/ndpi_main.c
|
||||
8. ./autogen.sh
|
||||
9. make
|
||||
10. make check
|
||||
8. Add the new protocol file to: src/lib/Makefile.am
|
||||
9. ./autogen.sh
|
||||
10. ./configure
|
||||
11. make
|
||||
12. make check
|
||||
|
||||
### How to use nDPI to Block Selected Traffic
|
||||
You can use nDPI to selectively block selected Internet traffic by embedding it onto an application (remember that nDPI is just a library). Both [ntopng](https://github.com/ntop/ntopng) and [nProbe cento](http://www.ntop.org/products/netflow/nprobe-cento/) can do this.
|
||||
|
||||
### nDPI Paper Citation
|
||||
|
||||
- Deri, Luca, et al. [nDPI: Open-source high-speed deep packet inspection](http://luca.ntop.org/nDPI.pdf) 2014 International Wireless Communications and Mobile Computing Conference (IWCMC). IEEE, 2014.
|
||||
|
||||
### nDPI-Related Projects
|
||||
- [nfstream](https://github.com/aouinizied/nfstream)
|
||||
You can use nDPI to selectively block selected Internet traffic by embedding it onto an application (remember that nDPI us just a library). Both [ntopng](https://github.com/ntop/ntopng) and [nProbe cento](http://www.ntop.org/products/netflow/nprobe-cento/) can do this.
|
||||
|
||||
### DISCLAIMER
|
||||
While we do our best to detect network protocols, we cannot guarantee that our software is error free and 100% accurate in protocol detection. Please make sure that you respect the privacy of users and you have proper authorization to listen, capture and inspect network traffic.
|
||||
|
||||
nDPI is a registered trademark in the US and EU.
|
||||
### Creating A Source File Tar Ball
|
||||
|
||||
If you want to distribute a source tar file of nDPI do:
|
||||
|
||||
- make dist
|
||||
|
||||
To ensure that a tar file includes all necessary files and to run tests on distribution do:
|
||||
|
||||
- make distcheck
|
||||
|
||||
[ntopng_logo]: https://camo.githubusercontent.com/0f789abcef232035c05e0d2e82afa3cc3be46485/687474703a2f2f7777772e6e746f702e6f72672f77702d636f6e74656e742f75706c6f6164732f323031312f30382f6e746f706e672d69636f6e2d313530783135302e706e67
|
||||
|
||||
|
||||
+4
-5
@@ -5,18 +5,17 @@ Prerequisites
|
||||
- GNU autotools/libtool
|
||||
- libpcap or PF_RING (optional but recommended)
|
||||
- apt-get install libjson-c-dev (for JSON support)
|
||||
- libgcrypt20-dev (for QUIC support)
|
||||
|
||||
On Ubuntu/Debian
|
||||
- apt-get install build-essential
|
||||
- apt-get install git autoconf automake autogen libpcap-dev libtool libgcrypt20-dev
|
||||
- apt-get install git autoconf automake autogen libpcap-dev libtool
|
||||
|
||||
On Fedora/CentOS
|
||||
- yum groupinstall "Development tools"
|
||||
- yum install git autoconf automake autogen libpcap-devel libtool libgcrypt-devel
|
||||
- yum install git autoconf automake autogen libpcap-devel libtool
|
||||
|
||||
On MacOSX (using http://brew.sh)
|
||||
brew install autoconf automake libtool git libgcrypt
|
||||
brew install autoconf automake libtool git
|
||||
|
||||
On FreeBSD
|
||||
- pkg install autoconf automake libtool gmake git libgcrypt
|
||||
- pkg install autoconf automake libtool gmake git
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
Tor
|
||||
---
|
||||
|
||||
Tor protocol can use SSL to hide itself. These are examples:
|
||||
|
||||
TCP 37.128.208.46:9001 <-> 172.16.253.130:2078 [VLAN: 0][proto: 91/SSL][132 pkts/93834 bytes][SSL client: www.jwrpsthzrih.com]
|
||||
TCP 172.16.253.130:2021 <-> 75.147.140.249:443 [VLAN: 0][proto: 91/SSL][28 pkts/8053 bytes][SSL client: www.5akw23dx.com]
|
||||
TCP 172.16.253.130:2077 <-> 77.247.181.163:443 [VLAN: 0][proto: 91/SSL][136 pkts/94329 bytes][SSL client: www.fk4pprq42hsvl2wey.com]
|
||||
|
||||
It can be detected by analyzing the SSL client certificate and checking the name that does not match to a real host in
|
||||
addition of being a bit weird. As doing DNS resolution is not a task for nDPI we let applications do and then recognize
|
||||
SSL-tunnelled connections.
|
||||
|
||||
See http://www.netresec.com/?page=Blog&month=2013-04&post=Detecting-TOR-Communication-in-Network-Traffic
|
||||
|
||||
For this reason nDPI uses a heuristic, non-DNS based, approach to detect tor communications. If possible, apps
|
||||
should validate the certificate using the DNS. This is not something nDPI can afford to do for performance
|
||||
reasons
|
||||
+13
-17
@@ -1,13 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm -f configure config.h config.h.in
|
||||
NDPI_MAJOR="2"
|
||||
NDPI_MINOR="2"
|
||||
NDPI_PATCH="0"
|
||||
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
||||
|
||||
AUTOCONF=$(command -v autoconf)
|
||||
AUTOMAKE=$(command -v automake)
|
||||
LIBTOOL=$(command -v libtool)
|
||||
LIBTOOLIZE=$(command -v libtoolize)
|
||||
AUTORECONF=$(command -v autoreconf)
|
||||
PKG_CONFIG=$(command -v pkg-config)
|
||||
/bin/rm -f configure config.h config.h.in src/lib/Makefile.in
|
||||
|
||||
AUTOCONF=$(which autoconf)
|
||||
AUTOMAKE=$(which automake)
|
||||
LIBTOOL=$(which libtool)
|
||||
LIBTOOLIZE=$(which libtoolize)
|
||||
AUTORECONF=$(which autoreconf)
|
||||
|
||||
if test -z $AUTOCONF; then
|
||||
echo "autoconf is missing: please install it and try again"
|
||||
@@ -29,14 +33,6 @@ if test -z $AUTORECONF; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if test -z $PKG_CONFIG; then
|
||||
echo "pkg-config is missing: please install it (apt-get install pkg-config) and try again"
|
||||
exit
|
||||
fi
|
||||
|
||||
cat configure.seed | sed "s/@NDPI_MAJOR@/$NDPI_MAJOR/g" | sed "s/@NDPI_MINOR@/$NDPI_MINOR/g" | sed "s/@NDPI_PATCH@/$NDPI_PATCH/g" | sed "s/@NDPI_VERSION_SHORT@/$NDPI_VERSION_SHORT/g" > configure.ac
|
||||
autoreconf -ivf
|
||||
|
||||
echo "./configure $@"
|
||||
chmod +x configure
|
||||
./configure $@
|
||||
|
||||
./configure $*
|
||||
|
||||
-309
@@ -1,309 +0,0 @@
|
||||
AC_INIT([libndpi], [4.2.0])
|
||||
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
AC_PREFIX_DEFAULT(/usr)
|
||||
|
||||
EXTRA_TARGETS="example tests tests/unit tests/dga"
|
||||
AC_ARG_WITH(only-libndpi, AS_HELP_STRING([--with-only-libndpi], [Build only libndpi (no examples, tests etc)]))
|
||||
AS_IF([test "${with_only_libndpi+set}" = set],[
|
||||
EXTRA_TARGETS=""
|
||||
])
|
||||
|
||||
AC_ARG_WITH(sanitizer, AS_HELP_STRING([--with-sanitizer], [Build with support for address, undefined and leak sanitizer]))
|
||||
AC_ARG_ENABLE(fuzztargets, AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no])
|
||||
AS_IF([test "x$enable_fuzztargets" = "xyes"], [BUILD_FUZZTARGETS=1], [BUILD_FUZZTARGETS=0])
|
||||
AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"])
|
||||
|
||||
AS_IF([test "${with_sanitizer+set}" = set],[
|
||||
CFLAGS="${CFLAGS} -g3 -O0 -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
|
||||
LDFLAGS="${LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak"
|
||||
])
|
||||
|
||||
LT_INIT
|
||||
LT_LIB_M
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
SYSTEM=`uname -s`
|
||||
if test $SYSTEM = "Darwin"; then
|
||||
dnl> AC_PROG_CC(clang gcc)
|
||||
AM_PROG_CC_C_O(clang gcc)
|
||||
AC_PROG_CXX(clang++ g++)
|
||||
AC_PROG_CC_STDC(clang gcc)
|
||||
else
|
||||
AC_PROG_CC_C_O
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC_STDC
|
||||
fi
|
||||
|
||||
dnl> Can't iuse AM_PROG_AR because not all of our Makefiles are automake (yet?)
|
||||
AC_CHECK_TOOL(AR, ar, [false])
|
||||
|
||||
AC_LANG_WERROR
|
||||
|
||||
NDPI_MAJOR=`echo "${PACKAGE_VERSION}" | cut -d . -f 1`
|
||||
NDPI_MINOR=`echo "${PACKAGE_VERSION}" | cut -d . -f 2`
|
||||
NDPI_PATCH=`echo "${PACKAGE_VERSION}" | cut -d . -f 3`
|
||||
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
||||
|
||||
AC_DEFINE_UNQUOTED(NDPI_MAJOR_RELEASE, "${NDPI_MAJOR}", [nDPI major release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_MINOR_RELEASE, "${NDPI_MINOR}", [nDPI minor release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_PATCH_LEVEL, "${NDPI_PATCH}", [nDPI patch level])
|
||||
|
||||
# .git as directory in a cloned repo
|
||||
# .git as file in submodule based integration
|
||||
if test -d ".git" || test -f ".git" ; then :
|
||||
GIT_TAG=`git log -1 --format=%h`
|
||||
GIT_DATE=`git log -1 --format=%cd`
|
||||
#
|
||||
# On CentOS 6 `git rev-list HEAD --count` does not work
|
||||
#
|
||||
#
|
||||
GIT_NUM=`git log --pretty=oneline | wc -l | tr -d '[[:space:]]'`
|
||||
GIT_RELEASE="${PACKAGE_VERSION}-${GIT_NUM}-${GIT_TAG}"
|
||||
|
||||
A=`git log src/include/ndpi_typedefs.h|wc -l`
|
||||
B=`git log src/include/ndpi_protocol_ids.h|wc -l`
|
||||
C=`git log src/include/ndpi_api.h.in|wc -l`
|
||||
NDPI_API_VERSION=$((A+B+C))
|
||||
else
|
||||
GIT_RELEASE="${PACKAGE_VERSION}"
|
||||
GIT_DATE=`date -u -r CHANGELOG.md`
|
||||
if test -z "$SOURCE_DATE_EPOCH" ; then :
|
||||
SOURCE_DATE_EPOCH=`date +%s`
|
||||
fi
|
||||
NDPI_API_VERSION=`echo $SOURCE_DATE_EPOCH | cut -c7-10`
|
||||
fi
|
||||
|
||||
NDPI_API_VERSION=`echo $NDPI_API_VERSION | sed 's/^0*//'`
|
||||
|
||||
echo "Setting API version to $NDPI_API_VERSION"
|
||||
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
|
||||
|
||||
if ! test "${with_only_libndpi+set}" = set; then :
|
||||
dnl> used by json-c for unit tests
|
||||
PKG_CHECK_MODULES([JSONC], [json-c], [JSONC_LIBS="${pkg_cv_JSONC_LIBS}" JSONC_CFLAGS="${pkg_cv_JSONC_CFLAGS}"])
|
||||
AC_CHECK_LIB([json-c], [json_object_put], [], [
|
||||
AC_MSG_WARN([JSON-C not available. Disabled unit test.])
|
||||
JSONC_LIBS=""
|
||||
JSONC_CFLAGS=""
|
||||
EXTRA_TARGETS="example tests tests/dga"
|
||||
])
|
||||
AX_PTHREAD([],[
|
||||
AC_MSG_WARN([POSIX Threads not available. Building library only.])
|
||||
JSONC_LIBS=""
|
||||
JSONC_CFLAGS=""
|
||||
EXTRA_TARGETS=""
|
||||
])
|
||||
fi
|
||||
|
||||
LIBS="$LIBS $JSONC_LIBS"
|
||||
CFLAGS="-W -Wall -Wno-unused-parameter -Wno-unused-function $CFLAGS $JSONC_CFLAGS"
|
||||
|
||||
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h math.h float.h])
|
||||
AC_CHECK_LIB([m], [sqrt], [], [LIBM="-lm"])
|
||||
AC_CHECK_LIB([rrd], [rrd_fetch_r], [LIBRRD=-lrrd])
|
||||
|
||||
if test "x$ac_cv_lib_rrd_rrd_fetch_r" = xyes; then :
|
||||
AC_DEFINE_UNQUOTED(HAVE_RRDTOOL, "1", [rrdtool is present])
|
||||
EXTRA_TARGETS="$EXTRA_TARGETS rrdtool"
|
||||
fi
|
||||
|
||||
ADDITIONAL_LIBS="$LIBRRD $LIBM"
|
||||
PCAP_HOME=$HOME/PF_RING/userland
|
||||
|
||||
DPDK_TARGET=
|
||||
AC_MSG_CHECKING([DPDK (used by ndpiReader)])
|
||||
if test -d $HOME/DPDK; then :
|
||||
AC_MSG_RESULT(yes)
|
||||
DPDK_TARGET=dpdk
|
||||
else
|
||||
AC_MSG_RESULT([no (missing $HOME/DPDK)])
|
||||
fi
|
||||
|
||||
if ! test -d $PCAP_HOME; then :
|
||||
PCAP_HOME=`pwd`/../../PF_RING/userland
|
||||
fi
|
||||
SHORT_MACHINE=`uname -m | cut -b1-3`
|
||||
if test $SHORT_MACHINE = "arm"; then
|
||||
LIBNUMA=""
|
||||
else
|
||||
AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
|
||||
fi
|
||||
|
||||
MACHINE=`uname -m`
|
||||
|
||||
CUSTOM_NDPI=
|
||||
|
||||
if test -d ../nDPI-custom; then :
|
||||
CUSTOM_NDPI="-DCUSTOM_NDPI_PROTOCOLS"
|
||||
AC_MSG_RESULT([Compiling with custom nDPI protocols])
|
||||
fi
|
||||
|
||||
if test -d ../ndpi-pro; then :
|
||||
with_maxminddb=1
|
||||
fi
|
||||
|
||||
case "$host" in
|
||||
*-*-mingw32*|*-*-msys)
|
||||
PCAP_INC=""
|
||||
PCAP_LIB=""
|
||||
case "$host" in
|
||||
x86_64-*)
|
||||
BUILD_MINGW_X64=1
|
||||
;;
|
||||
i686-*)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unsupported MingW cross compiler.])
|
||||
;;
|
||||
esac
|
||||
CFLAGS="${CFLAGS}"
|
||||
LIBS="${LIBS} -lws2_32"
|
||||
BUILD_MINGW=1
|
||||
;;
|
||||
*)
|
||||
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
||||
echo "Using libpcap from $PCAP_HOME"
|
||||
PCAP_INC="-I $PCAP_HOME/libpcap"
|
||||
PFRING_LIB=
|
||||
if test -f $PCAP_HOME/lib/libpfring.a; then :
|
||||
PFRING_LIB=$PCAP_HOME/lib/libpfring.a
|
||||
fi
|
||||
|
||||
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PFRING_LIB $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`"
|
||||
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
|
||||
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
|
||||
# The dlopen() function is in libdl on GLIBC-based systems
|
||||
# and in the C library for *BSD systems
|
||||
AC_CHECK_LIB([dl], [dlopen], [DL_LIB="-ldl"],[AC_CHECK_LIB([c],
|
||||
[dlopen], [DL_LIB="-lc"],
|
||||
[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ])
|
||||
elif test "${with_only_libndpi+set}" != set; then :
|
||||
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
|
||||
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
|
||||
AC_MSG_ERROR([Missing libpcap(-dev) library required to compile the example application.])
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_ARG_ENABLE([debug-messages],
|
||||
AS_HELP_STRING([--enable-debug-messages], [Define NDPI_ENABLE_DEBUG_MESSAGES=1]), [
|
||||
AC_DEFINE(NDPI_ENABLE_DEBUG_MESSAGES, 1, [Enable ndpi_debug_messages]) ])
|
||||
|
||||
AS_IF([test "x$enable_fuzztargets" = "xyes"], [
|
||||
AC_PROG_CXX
|
||||
AC_LANG_PUSH(C++)
|
||||
tmp_saved_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
AX_CHECK_COMPILE_FLAG([-fsanitize=fuzzer],,
|
||||
[AC_MSG_ERROR([--enable-fuzztargets requires -fsanitize=fuzzer which is only supported by LLVM])],
|
||||
[-Werror])
|
||||
AS_IF([test "x$LIB_FUZZING_ENGINE" = "x"], [
|
||||
LIB_FUZZING_ENGINE=-fsanitize=fuzzer
|
||||
AC_SUBST(LIB_FUZZING_ENGINE)
|
||||
])
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $LIB_FUZZING_ENGINE"
|
||||
AC_MSG_CHECKING([whether $CXX accepts $LIB_FUZZING_ENGINE])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *Data, size_t Size);
|
||||
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *Data, size_t Size) {
|
||||
(void)Data;
|
||||
(void)Size;
|
||||
return 0;
|
||||
}
|
||||
]])],
|
||||
[ AC_MSG_RESULT(yes)
|
||||
has_sanitizefuzzer=yes],
|
||||
[ AC_MSG_RESULT(no) ]
|
||||
)
|
||||
_AC_LANG_PREFIX[]FLAGS=$tmp_saved_flags
|
||||
AC_LANG_POP()
|
||||
])
|
||||
AM_CONDITIONAL([HAS_FUZZLDFLAGS], [test "x$has_sanitizefuzzer" = "xyes"])
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
||||
|
||||
dnl> GCRYPT
|
||||
GCRYPT_ENABLED=1
|
||||
AC_ARG_ENABLE([gcrypt],
|
||||
[AS_HELP_STRING([--disable-gcrypt], [Avoid compiling with libgcrypt/libgpg-error, even if they are present. QUIC sub-classification may be missing])],
|
||||
[GCRYPT_ENABLED=0],
|
||||
[AC_CHECK_LIB(gcrypt, gcry_cipher_checktag)])
|
||||
AS_IF([test ${GCRYPT_ENABLED} -eq 1], [
|
||||
if test "x$ac_cv_lib_gcrypt_gcry_cipher_checktag" = xyes; then :
|
||||
ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lgcrypt"
|
||||
else
|
||||
$as_unset ac_cv_lib_gcrypt_gcry_cipher_checktag
|
||||
AC_CHECK_LIB(gpg-error, gpg_strerror_r)
|
||||
AC_CHECK_LIB(gcrypt, gcry_cipher_checktag)
|
||||
if test "x$ac_cv_lib_gcrypt_gcry_cipher_checktag" = xyes -a "x$ac_cv_lib_gpg_error_gpg_strerror_r" = xyes; then :
|
||||
ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lgcrypt -lgpg-error"
|
||||
else
|
||||
GCRYPT_ENABLED=0
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
dnl> PCRE
|
||||
PCRE_ENABLED=0
|
||||
AC_ARG_WITH(pcre, [ --with-pcre Enable nDPI build with libpcre])
|
||||
if test "${with_pcre+set}" = set; then :
|
||||
AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE_UNQUOTED(HAVE_PCRE, 1, [libpcre(-dev) is present]))
|
||||
if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then :
|
||||
ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lpcre"
|
||||
PCRE_ENABLED=1
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl> GeoIP
|
||||
AC_ARG_WITH(maxminddb, [ --with-maxminddb Enable nDPI build with libmaxminddb])
|
||||
if test "${with_maxminddb+set}" = set; then :
|
||||
AC_CHECK_LIB([maxminddb], [MMDB_lookup_sockaddr])
|
||||
AC_HAVE_HEADERS(maxminddb.h)
|
||||
if test ".${ac_cv_lib_maxminddb_MMDB_lookup_sockaddr}" = ".yes" && test ".${ac_cv_header_maxminddb_h}" = ".yes"; then
|
||||
ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lmaxminddb"
|
||||
AC_DEFINE_UNQUOTED(HAVE_MAXMINDDB, 1, [MaxMind DB support])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl> Curl
|
||||
dnl> AC_CHECK_LIB([curl], [curl_easy_perform])
|
||||
dnl> if test ${ac_cv_lib_curl_curl_easy_perform} = "no"; then
|
||||
dnl> echo "Please install libcurl4-openssl-dev (http://curl.haxx.se/) in order to enable curl support"
|
||||
dnl> else
|
||||
dnl> ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lcurl"
|
||||
dnl> AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [curl is present])
|
||||
dnl> fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile tests/unit/Makefile tests/performance/Makefile tests/dga/Makefile rrdtool/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile fuzz/Makefile src/include/ndpi_api.h])
|
||||
AC_CONFIG_FILES([tests/do.sh], [chmod +x tests/do.sh])
|
||||
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
||||
AC_SUBST(GIT_RELEASE)
|
||||
AC_SUBST(NDPI_MAJOR)
|
||||
AC_SUBST(NDPI_MINOR)
|
||||
AC_SUBST(NDPI_PATCH)
|
||||
AC_SUBST(NDPI_VERSION_SHORT)
|
||||
AC_SUBST(PCAP_INC)
|
||||
AC_SUBST(PCAP_LIB)
|
||||
AC_SUBST(ADDITIONAL_LIBS)
|
||||
AC_SUBST(DL_LIB)
|
||||
AC_SUBST(DPDK_TARGET)
|
||||
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
AC_SUBST(CUSTOM_NDPI)
|
||||
AC_SUBST(NDPI_API_VERSION)
|
||||
AC_SUBST(EXTRA_TARGETS)
|
||||
AC_SUBST(BUILD_MINGW)
|
||||
AC_SUBST(BUILD_MINGW_X64)
|
||||
AC_SUBST(BUILD_FUZZTARGETS)
|
||||
AC_SUBST(JSONC_CFLAGS)
|
||||
AC_SUBST(JSONC_LIBS)
|
||||
AC_SUBST(GCRYPT_ENABLED)
|
||||
AC_SUBST(PCRE_ENABLED)
|
||||
AC_OUTPUT
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
AC_INIT([libndpi], [@NDPI_VERSION_SHORT@])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
LT_INIT
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AX_PTHREAD
|
||||
|
||||
NDPI_MAJOR="@NDPI_MAJOR@"
|
||||
NDPI_MINOR="@NDPI_MINOR@"
|
||||
NDPI_PATCH="@NDPI_PATCH@"
|
||||
|
||||
AC_DEFINE_UNQUOTED(NDPI_MAJOR_RELEASE, "${NDPI_MAJOR}", [nDPI major release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_MINOR_RELEASE, "${NDPI_MINOR}", [nDPI minor release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_PATCH_LEVEL, "${NDPI_PATCH}", [nDPI patch level])
|
||||
|
||||
if test -d ".git"; then :
|
||||
GIT_TAG=`git log -1 --format=%h`
|
||||
GIT_DATE=`git log -1 --format=%cd`
|
||||
#
|
||||
# On CentOS 6 `git rev-list HEAD --count` does not work
|
||||
#
|
||||
#
|
||||
GIT_NUM=`git log --pretty=oneline | wc -l | tr -d '[[:space:]]'`
|
||||
GIT_RELEASE="${PACKAGE_VERSION}-${GIT_NUM}-${GIT_TAG}"
|
||||
else
|
||||
GIT_RELEASE="${PACKAGE_VERSION}"
|
||||
GIT_DATE=`date`
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
|
||||
|
||||
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
|
||||
|
||||
PCAP_HOME=$HOME/PF_RING/userland
|
||||
|
||||
if test -d $PCAP_HOME; then :
|
||||
echo -n ""
|
||||
else
|
||||
PCAP_HOME=`pwd`/../../PF_RING/userland
|
||||
fi
|
||||
SHORT_MACHINE=`uname -m | cut -b1-3`
|
||||
if test $SHORT_MACHINE = "arm"; then
|
||||
LIBNUMA=""
|
||||
else
|
||||
AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
|
||||
fi
|
||||
|
||||
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
||||
echo "Using libpcap from $PCAP_HOME"
|
||||
PCAP_INC="-I $PCAP_HOME/libpcap"
|
||||
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`"
|
||||
|
||||
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
|
||||
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
|
||||
# The dlopen() function is in libdl on GLIBC-based systems
|
||||
# and in the C library for *BSD systems
|
||||
AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"],
|
||||
[AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"],
|
||||
[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ])
|
||||
else
|
||||
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
|
||||
|
||||
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
|
||||
echo ""
|
||||
echo "ERROR: Missing libpcap(-dev) library required to compile the example application"
|
||||
echo "ERROR: Please install it and try again"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl> https://github.com/json-c/json-c
|
||||
AC_ARG_ENABLE([json-c],
|
||||
AS_HELP_STRING([--disable-json-c], [Disable json-c support]))
|
||||
|
||||
AS_IF([test "x$enable_json_c" != "xno"], [
|
||||
PKG_CONFIG_PATH=/usr/local/share/pkgconfig:$PKG_CONFIG_PATH
|
||||
pkg-config --exists json-c
|
||||
AS_IF([test "$?" == "0"],
|
||||
[
|
||||
CFLAGS="$CFLAGS $(pkg-config --cflags json-c)"
|
||||
LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)"
|
||||
AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]))
|
||||
],
|
||||
[
|
||||
JSONC_HOME="$HOME/json-c"
|
||||
if test -d "$JSONC_HOME"; then :
|
||||
CFLAGS="$CFLAGS -I $JSONC_HOME"
|
||||
LDFLAGS="$LDFLAGS $JSONC_HOME/.libs/libjson-c.a"
|
||||
AC_MSG_RESULT([Found json-c in $JSONC_HOME])
|
||||
AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present])
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
||||
|
||||
AC_CONFIG_FILES([Makefile src/lib/Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
AC_SUBST(GIT_RELEASE)
|
||||
AC_SUBST(NDPI_MAJOR)
|
||||
AC_SUBST(NDPI_MINOR)
|
||||
AC_SUBST(NDPI_PATCH)
|
||||
AC_SUBST(SVN_DATE)
|
||||
AC_SUBST(JSON_C_LIB)
|
||||
AC_SUBST(PCAP_INC)
|
||||
AC_SUBST(PCAP_LIB)
|
||||
AC_SUBST(DL_LIB)
|
||||
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
|
||||
AC_OUTPUT
|
||||
-231
@@ -1,231 +0,0 @@
|
||||
# Makefile for Sphinx documentation
|
||||
#
|
||||
|
||||
# You can set these variables from the command line.
|
||||
SPHINXOPTS =
|
||||
SPHINXBUILD = sphinx-build
|
||||
PAPER =
|
||||
BUILDDIR = _build
|
||||
|
||||
# User-friendly check for sphinx-build
|
||||
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
|
||||
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
|
||||
endif
|
||||
|
||||
# Internal variables.
|
||||
PAPEROPT_a4 = -D latex_paper_size=a4
|
||||
PAPEROPT_letter = -D latex_paper_size=letter
|
||||
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
# the i18n builder cannot share the environment and doctrees with the others
|
||||
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@echo "Please use \`make <target>' where <target> is one of"
|
||||
@echo " release to make standalone HTML files for ntop documentation release"
|
||||
@echo " html to make standalone HTML files"
|
||||
@echo " dirhtml to make HTML files named index.html in directories"
|
||||
@echo " singlehtml to make a single large HTML file"
|
||||
@echo " pickle to make pickle files"
|
||||
@echo " json to make JSON files"
|
||||
@echo " htmlhelp to make HTML files and a HTML help project"
|
||||
@echo " qthelp to make HTML files and a qthelp project"
|
||||
@echo " applehelp to make an Apple Help Book"
|
||||
@echo " devhelp to make HTML files and a Devhelp project"
|
||||
@echo " epub to make an epub"
|
||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||
@echo " text to make text files"
|
||||
@echo " man to make manual pages"
|
||||
@echo " texinfo to make Texinfo files"
|
||||
@echo " info to make Texinfo files and run them through makeinfo"
|
||||
@echo " gettext to make PO message catalogs"
|
||||
@echo " changes to make an overview of all changed/added/deprecated items"
|
||||
@echo " xml to make Docutils-native XML files"
|
||||
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
|
||||
@echo " linkcheck to check all external links for integrity"
|
||||
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
|
||||
@echo " coverage to run coverage check of the documentation (if enabled)"
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(BUILDDIR)/*
|
||||
cd doxygen; make clean
|
||||
|
||||
.PHONY: html
|
||||
html:
|
||||
cd doxygen; make
|
||||
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
|
||||
|
||||
.PHONY: release
|
||||
release:
|
||||
make clean
|
||||
@{ \
|
||||
git_root=$$(git rev-parse --show-toplevel);\
|
||||
version=$$(grep -Po '^NTOPNG_SHORT_VERSION="\K.+(?=")' $${git_root}/configure.ac);\
|
||||
echo Release version $${version};\
|
||||
sed -i "s/version = u'.*'/version = u'$${version}'/" conf.py;\
|
||||
sed -i "s/release = u'.*'/release = u'$${version}'/" conf.py;\
|
||||
}
|
||||
make html
|
||||
|
||||
.PHONY: dirhtml
|
||||
dirhtml:
|
||||
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
|
||||
|
||||
.PHONY: singlehtml
|
||||
singlehtml:
|
||||
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
|
||||
@echo
|
||||
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
|
||||
|
||||
.PHONY: pickle
|
||||
pickle:
|
||||
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
|
||||
@echo
|
||||
@echo "Build finished; now you can process the pickle files."
|
||||
|
||||
.PHONY: json
|
||||
json:
|
||||
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
|
||||
@echo
|
||||
@echo "Build finished; now you can process the JSON files."
|
||||
|
||||
.PHONY: htmlhelp
|
||||
htmlhelp:
|
||||
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run HTML Help Workshop with the" \
|
||||
".hhp project file in $(BUILDDIR)/htmlhelp."
|
||||
|
||||
.PHONY: qthelp
|
||||
qthelp:
|
||||
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
|
||||
@echo
|
||||
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
|
||||
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
|
||||
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ntop.qhcp"
|
||||
@echo "To view the help file:"
|
||||
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ntop.qhc"
|
||||
|
||||
.PHONY: applehelp
|
||||
applehelp:
|
||||
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
|
||||
@echo
|
||||
@echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
|
||||
@echo "N.B. You won't be able to view it unless you put it in" \
|
||||
"~/Library/Documentation/Help or install it in your application" \
|
||||
"bundle."
|
||||
|
||||
.PHONY: devhelp
|
||||
devhelp:
|
||||
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
|
||||
@echo
|
||||
@echo "Build finished."
|
||||
@echo "To view the help file:"
|
||||
@echo "# mkdir -p $$HOME/.local/share/devhelp/ntop"
|
||||
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ntop"
|
||||
@echo "# devhelp"
|
||||
|
||||
.PHONY: epub
|
||||
epub:
|
||||
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
|
||||
@echo
|
||||
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
|
||||
|
||||
.PHONY: latex
|
||||
latex:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo
|
||||
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
|
||||
@echo "Run \`make' in that directory to run these through (pdf)latex" \
|
||||
"(use \`make latexpdf' here to do that automatically)."
|
||||
|
||||
.PHONY: latexpdf
|
||||
latexpdf:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through pdflatex..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: latexpdfja
|
||||
latexpdfja:
|
||||
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
|
||||
@echo "Running LaTeX files through platex and dvipdfmx..."
|
||||
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
|
||||
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
|
||||
|
||||
.PHONY: text
|
||||
text:
|
||||
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
|
||||
@echo
|
||||
@echo "Build finished. The text files are in $(BUILDDIR)/text."
|
||||
|
||||
.PHONY: man
|
||||
man:
|
||||
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
|
||||
@echo
|
||||
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
|
||||
|
||||
.PHONY: texinfo
|
||||
texinfo:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo
|
||||
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
|
||||
@echo "Run \`make' in that directory to run these through makeinfo" \
|
||||
"(use \`make info' here to do that automatically)."
|
||||
|
||||
.PHONY: info
|
||||
info:
|
||||
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
|
||||
@echo "Running Texinfo files through makeinfo..."
|
||||
make -C $(BUILDDIR)/texinfo info
|
||||
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
|
||||
|
||||
.PHONY: gettext
|
||||
gettext:
|
||||
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
|
||||
@echo
|
||||
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
|
||||
|
||||
.PHONY: changes
|
||||
changes:
|
||||
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
|
||||
@echo
|
||||
@echo "The overview file is in $(BUILDDIR)/changes."
|
||||
|
||||
.PHONY: linkcheck
|
||||
linkcheck:
|
||||
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
|
||||
@echo
|
||||
@echo "Link check complete; look for any errors in the above output " \
|
||||
"or in $(BUILDDIR)/linkcheck/output.txt."
|
||||
|
||||
.PHONY: doctest
|
||||
doctest:
|
||||
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
|
||||
@echo "Testing of doctests in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/doctest/output.txt."
|
||||
|
||||
.PHONY: coverage
|
||||
coverage:
|
||||
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
|
||||
@echo "Testing of coverage in the sources finished, look at the " \
|
||||
"results in $(BUILDDIR)/coverage/python.txt."
|
||||
|
||||
.PHONY: xml
|
||||
xml:
|
||||
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
|
||||
@echo
|
||||
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
|
||||
|
||||
.PHONY: pseudoxml
|
||||
pseudoxml:
|
||||
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
|
||||
@echo
|
||||
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
|
||||
@@ -1,4 +0,0 @@
|
||||
nDPI Programming API
|
||||
####################
|
||||
|
||||
Placeholder
|
||||
-291
@@ -1,291 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import sys
|
||||
import os
|
||||
import sphinx_rtd_theme
|
||||
|
||||
# If extensions (or modules to document with autodoc) are in another directory,
|
||||
# add these directories to sys.path here. If the directory is relative to the
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
sys.path.append( "breathe/" )
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If documentation needs a minimal Sphinx version, state it here.
|
||||
#needs_sphinx = '1.0'
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.intersphinx',
|
||||
'breathe'
|
||||
]
|
||||
|
||||
# Workaround for platforms where swaggerdoc is not available
|
||||
if not os.environ.get("PYTHON_SKIP_SWAGGERDOC"):
|
||||
extensions.append('sphinxcontrib.swaggerdoc')
|
||||
|
||||
breathe_projects = { "apidoc" : "doxygen/xml/" }
|
||||
breathe_default_project = "apidoc"
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
||||
# The suffix(es) of source filenames.
|
||||
# You can specify multiple suffix as a list of string:
|
||||
source_suffix = ['.rst', '.md']
|
||||
#source_suffix = '.rst'
|
||||
|
||||
# The encoding of source files.
|
||||
#source_encoding = 'utf-8-sig'
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'nDPI'
|
||||
copyright = u'2021, ntop and contributors'
|
||||
author = u'ntop.org'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'4.1'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'4.1'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
|
||||
# There are two options for replacing |today|: either, you set today to some
|
||||
# non-false value, then it is used:
|
||||
#today = ''
|
||||
# Else, today_fmt is used as the format for a strftime call.
|
||||
#today_fmt = '%B %d, %Y'
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
exclude_patterns = ['_build', 'README.md', 'example.rst']
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
#default_role = None
|
||||
|
||||
# If true, '()' will be appended to :func: etc. cross-reference text.
|
||||
#add_function_parentheses = True
|
||||
|
||||
# If true, the current module name will be prepended to all description
|
||||
# unit titles (such as .. function::).
|
||||
#add_module_names = True
|
||||
|
||||
# If true, sectionauthor and moduleauthor directives will be shown in the
|
||||
# output. They are ignored by default.
|
||||
#show_authors = False
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
|
||||
# A list of ignored prefixes for module index sorting.
|
||||
#modindex_common_prefix = []
|
||||
|
||||
# If true, keep warnings as "system message" paragraphs in the built documents.
|
||||
#keep_warnings = False
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
||||
|
||||
# -- Options for HTML output ----------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#html_theme = 'alabaster'
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
#html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
# The name for this set of Sphinx documents. If None, it defaults to
|
||||
# "<project> v<release> documentation".
|
||||
#html_title = None
|
||||
|
||||
# A shorter title for the navigation bar. Default is the same as html_title.
|
||||
#html_short_title = None
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
html_logo = "img/logo.png"
|
||||
|
||||
# The name of an image file (relative to this directory) to use as a favicon of
|
||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
|
||||
# Add any extra paths that contain custom files (such as robots.txt or
|
||||
# .htaccess) here, relative to this directory. These files are copied
|
||||
# directly to the root of the documentation.
|
||||
#html_extra_path = []
|
||||
|
||||
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
|
||||
# using the given strftime format.
|
||||
#html_last_updated_fmt = '%b %d, %Y'
|
||||
|
||||
# If true, SmartyPants will be used to convert quotes and dashes to
|
||||
# typographically correct entities.
|
||||
#html_use_smartypants = True
|
||||
|
||||
# Custom sidebar templates, maps document names to template names.
|
||||
#html_sidebars = {}
|
||||
|
||||
# Additional templates that should be rendered to pages, maps page names to
|
||||
# template names.
|
||||
#html_additional_pages = {}
|
||||
|
||||
# If false, no module index is generated.
|
||||
#html_domain_indices = True
|
||||
|
||||
# If false, no index is generated.
|
||||
#html_use_index = True
|
||||
|
||||
# If true, the index is split into individual pages for each letter.
|
||||
#html_split_index = False
|
||||
|
||||
# If true, links to the reST sources are added to the pages.
|
||||
#html_show_sourcelink = True
|
||||
|
||||
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
|
||||
#html_show_sphinx = True
|
||||
|
||||
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
|
||||
#html_show_copyright = True
|
||||
|
||||
# If true, an OpenSearch description file will be output, and all pages will
|
||||
# contain a <link> tag referring to it. The value of this option must be the
|
||||
# base URL from which the finished HTML is served.
|
||||
#html_use_opensearch = ''
|
||||
|
||||
# This is the file name suffix for HTML files (e.g. ".xhtml").
|
||||
#html_file_suffix = None
|
||||
|
||||
# Language to be used for generating the HTML full-text search index.
|
||||
# Sphinx supports the following languages:
|
||||
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
|
||||
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
|
||||
#html_search_language = 'en'
|
||||
|
||||
# A dictionary with options for the search language support, empty by default.
|
||||
# Now only 'ja' uses this config value
|
||||
#html_search_options = {'type': 'default'}
|
||||
|
||||
# The name of a javascript file (relative to the configuration directory) that
|
||||
# implements a search results scorer. If empty, the default will be used.
|
||||
#html_search_scorer = 'scorer.js'
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'ntopdoc'
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'nDPI.tex', u'nDPI Documentation',
|
||||
u'ntop', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
# the title page.
|
||||
#latex_logo = None
|
||||
|
||||
# For "manual" documents, if this is true, then toplevel headings are parts,
|
||||
# not chapters.
|
||||
#latex_use_parts = False
|
||||
|
||||
# If true, show page references after internal links.
|
||||
#latex_show_pagerefs = False
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#latex_show_urls = False
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#latex_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#latex_domain_indices = True
|
||||
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
||||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'nDPI', u'nDPI Documentation',
|
||||
[author], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
#man_show_urls = False
|
||||
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
||||
# Grouping the document tree into Texinfo files. List of tuples
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'nDPI', u'nDPI Documentation',
|
||||
author, 'ntop and contributors', 'Deep Packet Inspection toolkit',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
#texinfo_appendices = []
|
||||
|
||||
# If false, no module index is generated.
|
||||
#texinfo_domain_indices = True
|
||||
|
||||
# How to display URL addresses: 'footnote', 'no', or 'inline'.
|
||||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
|
||||
intersphinx_mapping = {'https://docs.python.org/': None}
|
||||
|
||||
def setup(app):
|
||||
app.add_stylesheet('css/ntop.css')
|
||||
@@ -1,255 +0,0 @@
|
||||
nDPI Flow Risks
|
||||
###############
|
||||
|
||||
nDPI is designed not just to detect application protocols in traffic flows but also to evaluate potential security risks associated with the traffic. In nDPI parlance this is called a "flow risk". Flows can have multiple risks detected hence nDPI reports them with a bitmap. Each risk detected corresponds to a bit in the flow risk bitmap. You can read more about `ndpi_risk_enum <https://github.com/ntop/nDPI/blob/dev/src/include/ndpi_typedefs.h>`_ for the list of all numeric risks currently supported.
|
||||
|
||||
Below you can find a description of each flow risk so that you can easily understand when a risk is triggered and its meaning. The flow risks are listed in numerical order as they are defined in ndpi_risk_enum.
|
||||
|
||||
.. _Risk 001:
|
||||
|
||||
NDPI_URL_POSSIBLE_XSS
|
||||
=====================
|
||||
HTTP only: this risk indicates a possible `XSS (Cross Side Scripting) <https://en.wikipedia.org/wiki/Cross-site_scripting>`_ attack.
|
||||
|
||||
.. _Risk 002:
|
||||
|
||||
NDPI_URL_POSSIBLE_SQL_INJECTION
|
||||
===============================
|
||||
HTTP only: this risk indicates a possible `SQL Injection attack <https://en.wikipedia.org/wiki/SQL_injection>`_.
|
||||
|
||||
.. _Risk 003:
|
||||
|
||||
NDPI_URL_POSSIBLE_RCE_INJECTION
|
||||
===============================
|
||||
HTTP only: this risk indicates a possible `RCE (Remote Code Execution) attack <https://en.wikipedia.org/wiki/Arbitrary_code_execution>`_.
|
||||
|
||||
.. _Risk 004:
|
||||
|
||||
NDPI_BINARY_APPLICATION_TRANSFER
|
||||
================================
|
||||
HTTP only: this risk indicates that a binary application is downloaded/uploaded. Detected applications include Windows binaries, Linux executables, Unix scripts and Android apps.
|
||||
|
||||
.. _Risk 005:
|
||||
|
||||
NDPI_KNOWN_PROTOCOL_ON_NON_STANDARD_PORT
|
||||
========================================
|
||||
This risk indicates a known protocol used on a non standard port. Example HTTP is supposed to use TCP/80, and in case it is detected on TCP/1234 this risk is detected.
|
||||
|
||||
.. _Risk 006:
|
||||
|
||||
NDPI_TLS_SELFSIGNED_CERTIFICATE
|
||||
===============================
|
||||
TLS/QUIC only: this risk is triggered when a `self-signed certificate <https://en.wikipedia.org/wiki/Self-signed_certificate>`_ is used.
|
||||
|
||||
.. _Risk 007:
|
||||
|
||||
NDPI_TLS_OBSOLETE_VERSION
|
||||
=========================
|
||||
Risk 0triggered when TLS version is older than 1.1.
|
||||
|
||||
.. _Risk 008:
|
||||
|
||||
NDPI_TLS_WEAK_CIPHER
|
||||
====================
|
||||
Risk 0triggered when an unsafe TLS cipher is used. See `this page <https://community.qualys.com/thread/18212-how-does-qualys-determine-the-server-cipher-suites>`_ for a list of insecure ciphers.
|
||||
|
||||
.. _Risk 009:
|
||||
|
||||
NDPI_TLS_CERTIFICATE_EXPIRED
|
||||
============================
|
||||
Risk 0triggered when a TLS certificate is expired, i.e. the current date falls outside of the certificate validity dates.
|
||||
|
||||
.. _Risk 010:
|
||||
|
||||
NDPI_TLS_CERTIFICATE_MISMATCH
|
||||
=============================
|
||||
Risk 0triggered when a TLS certificate does not match the hostname we're accessing. Example you do http://www.aaa.com and the TLS certificate returned is for www.bbb.com.
|
||||
|
||||
.. _Risk 011:
|
||||
|
||||
NDPI_HTTP_SUSPICIOUS_USER_AGENT
|
||||
===============================
|
||||
HTTP only: this risk is triggered whenever the user agent contains suspicious characters or its format is suspicious. Example: <?php something ?> is a typical suspicious user agent.
|
||||
|
||||
.. _Risk 012:
|
||||
|
||||
NDPI_HTTP_NUMERIC_IP_HOST
|
||||
=========================
|
||||
HTTP only: this risk is triggered whenever we're accessing a host using its IP rather than its symbolic name. Example http://1.2.3.4.
|
||||
|
||||
.. _Risk 013:
|
||||
|
||||
NDPI_HTTP_SUSPICIOUS_URL
|
||||
========================
|
||||
HTTP only: this risk is triggered whenever the accessed URL is suspicious. Example: http://127.0.0.1/msadc/..%255c../..%255c../..%255c../winnt/system32/cmd.exe.
|
||||
|
||||
.. _Risk 014:
|
||||
|
||||
NDPI_HTTP_SUSPICIOUS_HEADER
|
||||
===========================
|
||||
HTTP only: this risk is triggered whenever the HTTP peader contains suspicious entries such as Uuid, TLS_version, Osname that are unexpected on the HTTP header.
|
||||
|
||||
.. _Risk 015:
|
||||
|
||||
NDPI_TLS_NOT_CARRYING_HTTPS
|
||||
===========================
|
||||
TLS only: this risk indicates that this TLS flow will not be used to transport HTTP content. Example VPNs use TLS to encrypt data rather to carry HTTP. This is useful to spot this type of cases.
|
||||
|
||||
.. _Risk 016:
|
||||
|
||||
NDPI_SUSPICIOUS_DGA_DOMAIN
|
||||
==========================
|
||||
A `DGA <https://en.wikipedia.org/wiki/Domain_generation_algorithm>`_ is used to generate domain names often used by malwares. This risk indicates that this domain name can (but it's not 100% sure) a DGA as its name is suspicious.
|
||||
|
||||
.. _Risk 017:
|
||||
|
||||
NDPI_MALFORMED_PACKET
|
||||
=====================
|
||||
This risk is generated when a packet (e.g. a DNS packet) has an unexpected formt. This can indicate a protocol error or more often an attempt to jeopardize a valid protocol to carry other type of data.
|
||||
|
||||
.. _Risk 018:
|
||||
|
||||
NDPI_SSH_OBSOLETE_CLIENT_VERSION_OR_CIPHER
|
||||
==========================================
|
||||
This risk is generated whenever a SSH client uses an obsolete SSH protocol version or insecure ciphers.
|
||||
|
||||
.. _Risk 019:
|
||||
|
||||
NDPI_SSH_OBSOLETE_SERVER_VERSION_OR_CIPHER
|
||||
==========================================
|
||||
This risk is generated whenever a SSH server uses an obsolete SSH protocol version or insecure ciphers.
|
||||
|
||||
.. _Risk 020:
|
||||
|
||||
NDPI_SMB_INSECURE_VERSION
|
||||
=========================
|
||||
This risk indicates that the `SMB <https://en.wikipedia.org/wiki/Server_Message_Block>`_ version used is insecure (i.e. v1).
|
||||
|
||||
.. _Risk 021:
|
||||
|
||||
NDPI_TLS_SUSPICIOUS_ESNI_USAGE
|
||||
==============================
|
||||
`SNI <https://en.wikipedia.org/wiki/Server_Name_Indication>`_ is a way to carry in TLS the host/domain name we're accessing. ESNI means encrypted SNI and it is a way to mask SNI (carried in clear text in the TLS header) with encryption. While this practice is legal, it could be used for hiding data or for attacks such as a suspicious `domain fronting <https://github.com/SixGenInc/Noctilucent/blob/master/docs/>`_.
|
||||
|
||||
.. _Risk 022:
|
||||
|
||||
NDPI_UNSAFE_PROTOCOL
|
||||
====================
|
||||
This risk indicates that the protocol used is insecure and that a secure protocol should be used (e.g. Telnet vs SSH).
|
||||
|
||||
.. _Risk 023:
|
||||
|
||||
NDPI_DNS_SUSPICIOUS_TRAFFIC
|
||||
===========================
|
||||
This risk is returned when DNS traffic returns an unexpected/obsolete `record type <https://en.wikipedia.org/wiki/List_of_DNS_record_types>`_.
|
||||
|
||||
.. _Risk 024:
|
||||
|
||||
NDPI_TLS_MISSING_SNI
|
||||
====================
|
||||
TLS needs to carry the the `SNI <https://en.wikipedia.org/wiki/Server_Name_Indication>`_ of the remote server we're accessing. Unfortunately SNI is optional in TLS so it can be omitted. In this case this risk is triggered as this is a non-standard situation that indicates a potential security problem or a protocol using TLS for other purposes (or a protocol bug).
|
||||
|
||||
.. _Risk 025:
|
||||
|
||||
NDPI_HTTP_SUSPICIOUS_CONTENT
|
||||
============================
|
||||
HTTP only: risk reported when HTTP carries content in expected format. Example the HTTP header indicates that the context is text/html but the real content is not readeable (i.e. it can transport binary data). In general this is an attempt to use a valid MIME type to carry data that does not match the type.
|
||||
|
||||
.. _Risk 026:
|
||||
|
||||
NDPI_RISKY_ASN
|
||||
==============
|
||||
This is a placeholder for traffic exchanged with `ASN <https://en.wikipedia.org/wiki/Autonomous_system_(Internet)>`_ that are considered risky. nDPI does not fill this risk that instead should be filled by aplications sitting on top of nDPI (e.g. ntopng).
|
||||
|
||||
.. _Risk 027:
|
||||
|
||||
NDPI_RISKY_DOMAIN
|
||||
=================
|
||||
This is a placeholder for traffic exchanged with domain names that are considered risky. nDPI does not fill this risk that instead should be filled by aplications sitting on top of nDPI (e.g. ntopng).
|
||||
|
||||
.. _Risk 028:
|
||||
|
||||
NDPI_MALICIOUS_JA3
|
||||
==================
|
||||
`JA3 <https://engineering.salesforce.com/tls-fingerprinting-with-ja3-and-ja3s-247362855967>`_ is a method to fingerprint TLS traffic. This risk indicates that the JA3 of the TLS connection is considered suspicious (i.e. it has been found in known malware JA3 blacklists). nDPI does not fill this risk that instead should be filled by aplications sitting on top of nDPI (e.g. ntopng).
|
||||
|
||||
.. _Risk 029:
|
||||
|
||||
NDPI_MALICIOUS_SHA1_CERTIFICATE
|
||||
===============================
|
||||
TLS certificates are uniquely identified with a `SHA1 <https://en.wikipedia.org/wiki/SHA-1>`_ hash value. If such hash is found on a blacklist, this risk can be used. As for other risks, this is a placeholder as nDPI does not fill this risk that instead should be filled by aplications sitting on top of nDPI (e.g. ntopng).
|
||||
|
||||
.. _Risk 030:
|
||||
|
||||
NDPI_DESKTOP_OR_FILE_SHARING_SESSION
|
||||
====================================
|
||||
This risk is set when the flow carries desktop or file sharing sessions (e.g. TeamViewer or AnyDesk just to mention two).
|
||||
|
||||
.. _Risk 031:
|
||||
|
||||
NDPI_TLS_UNCOMMON_ALPN
|
||||
======================
|
||||
This risk is set when the `ALPN <https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation>`_ (it indicates the protocol carried into this TLS flow, for instance HTTP/1.1) is uncommon with respect to the list of expected values.
|
||||
|
||||
.. _Risk 032:
|
||||
|
||||
NDPI_TLS_CERT_VALIDITY_TOO_LONG
|
||||
===============================
|
||||
From 01/09/2020 TLS certificates lifespan is limited to 13 months. This risk is triggered for certificates not respecting this directive.
|
||||
|
||||
.. _Risk 033:
|
||||
|
||||
NDPI_TLS_SUSPICIOUS_EXTENSION
|
||||
=============================
|
||||
This risk is triggered when the domain name (SNI extension) is not printable and thus it is a problem.
|
||||
|
||||
.. _Risk 034:
|
||||
|
||||
NDPI_TLS_FATAL_ALERT
|
||||
====================
|
||||
This risk is triggered when a TLS fatal alert is detected in the TLS flow. See `this page <https://techcommunity.microsoft.com/t5/iis-support-blog/ssl-tls-alert-protocol-and-the-alert-codes/ba-p/377132>`_ for details.
|
||||
|
||||
.. _Risk 035:
|
||||
|
||||
NDPI_SUSPICIOUS_ENTROPY
|
||||
=======================
|
||||
This risk is used to detect suspicious data carried in ICMP packets whose entropy (used to measure how data is distributed, hence to indirectly guess the type of data carried on) is suspicious and thus that it can indicate a data leak.
|
||||
|
||||
.. _Risk 036:
|
||||
|
||||
NDPI_CLEAR_TEXT_CREDENTIALS
|
||||
===========================
|
||||
Clear text protocols are not bad per-se, but they should be avoided when they carry credentials as they can be intercepted by malicious users. This risk is triggered whenever clear text protocols (e.g. FTP, HTTP, IMAP...) contain credentials in clear text (read it as nDPI does not trigger this risk for HTTP connections that do not carry credentials).
|
||||
|
||||
.. _Risk 037:
|
||||
|
||||
NDPI_DNS_LARGE_PACKET
|
||||
=====================
|
||||
`DNS <https://en.wikipedia.org/wiki/Domain_Name_System>`_ packets over UDP should be limited to 512 bytes. DNS packets over this threshold indicate a potential security risk (e.g. use DNS to carry data) or a misconfiguration.
|
||||
|
||||
.. _Risk 038:
|
||||
|
||||
NDPI_DNS_FRAGMENTED
|
||||
===================
|
||||
|
||||
UDP `DNS <https://en.wikipedia.org/wiki/Domain_Name_System>`_ packets cannot be fragmented. If so, this indicates a potential security risk (e.g. use DNS to carry data) or a misconfiguration.
|
||||
|
||||
.. _Risk 039:
|
||||
|
||||
NDPI_INVALID_CHARACTERS
|
||||
=======================
|
||||
The risk is set whenever a dissected protocol contains characters not allowed in that protocol field.
|
||||
For example a DNS hostname must only contain a subset of all printable characters or else this risk is set.
|
||||
Additionally, some TLS protocol fields are checked for printable characters as well.
|
||||
|
||||
.. _Risk 040:
|
||||
|
||||
NDPI_POSSIBLE_EXPLOIT
|
||||
=====================
|
||||
The risk is set whenever a possible exploit (e.g. Log4J/Log4Shell) is detected.
|
||||
|
||||
.. _Risk 041:
|
||||
|
||||
NDPI_TLS_CERTIFICATE_ABOUT_TO_EXPIRE
|
||||
===================================
|
||||
The risk is set whenever a TLS certificate is close to the expiration date.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB |
@@ -1,37 +0,0 @@
|
||||
nDPI Documentation
|
||||
====================
|
||||
|
||||
nDPI is an open source DPI (Deep Packet Inspection) toolkit for traffic analysis.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: User's Guide
|
||||
|
||||
what_is_ndpi
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: Developer's Guide
|
||||
|
||||
api
|
||||
flow_risks
|
||||
|
||||
.. toctree::
|
||||
:caption: Other Products
|
||||
|
||||
ntopng <https://www.ntop.org/guides/ntopng/>
|
||||
nProbe <https://www.ntop.org/guides/nprobe/>
|
||||
nProbe Cento <https://www.ntop.org/guides/cento/>
|
||||
n2disk <https://www.ntop.org/guides/n2disk/>
|
||||
PF_RING <https://www.ntop.org/guides/pf_ring/>
|
||||
nEdge <https://www.ntop.org/guides/nedge/>
|
||||
nScrub <https://www.ntop.org/guides/nscrub/>
|
||||
nBox <https://www.ntop.org/guides/nbox/>
|
||||
|
||||
.. Indices and tables
|
||||
.. ==================
|
||||
..
|
||||
.. * :ref:`genindex`
|
||||
.. * :ref:`modindex`
|
||||
.. * :ref:`search`
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,56 +0,0 @@
|
||||
What is nDPI
|
||||
##############
|
||||
|
||||
nDPI is a DPI (Deep Packet Inspection) toolkit able to:
|
||||
|
||||
- Detect application protocol on traffic flows
|
||||
- Analize encrypted traffic flows via ET (Encrypted Traffic Analysis)
|
||||
- Extract selected protocol metadata from traffic
|
||||
- Implement APIs for analysing traffic
|
||||
|
||||
Releases and Features
|
||||
---------------------
|
||||
|
||||
nDPI development lifecycle is typically 6 to 9 months. The history of changes and features implemented by every release, is available on its `Changelog <https://github.com/ntop/nDPI/blob/dev/CHANGELOG.md>`_.
|
||||
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
nDPI is open source and available on `GitHub
|
||||
<https://github.com/ntop/nDPI>`_. In addition, pre-compiled, binary
|
||||
nDPI packages are available both for Linux and other platforms. Installation
|
||||
instructions for binary packages are available below.
|
||||
|
||||
Installing on Linux
|
||||
-------------------
|
||||
|
||||
Installation instructions can be found at
|
||||
http://packages.ntop.org/. Development and stable builds are
|
||||
available. Stable builds are intended for production environments whereas
|
||||
development builds are intended for testing or early feature access.
|
||||
|
||||
|
||||
Software Updates
|
||||
================
|
||||
|
||||
General instructions for updating the software can be found at
|
||||
http://packages.ntop.org/ together with the installation instructions.
|
||||
Depending on the Operating System, nDPI supports also automatic updates
|
||||
through the GUI as described in the below sections.
|
||||
|
||||
Updating the Software on Linux
|
||||
------------------------------
|
||||
|
||||
Instructions for updating the software via command line can be found
|
||||
at http://packages.ntop.org/. For example on Ubuntu/Debian systems the
|
||||
below commands will update the repository, check for updates and install
|
||||
the latest software update if any:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
apt-get update
|
||||
apt-get upgrade
|
||||
|
||||
.. _AvailableVersions:
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# How to use?
|
||||
|
||||
You need to first compile the nDPI library as usual:
|
||||
|
||||
- ./autogen.sh
|
||||
- ./configure
|
||||
- make
|
||||
|
||||
Then open the Xcode project and you are ready to go. The default behavior is to analyze an embeded pcap file `capture.pcap`. You can change the behavior by changing command line input in `ViewController.m` file.
|
||||
|
||||
# What does the XCode project do?
|
||||
|
||||
It's a dummy Mac App project with a **Run** button. It doesn't modify any nDPI code except that it renamed the `main` function to `orginal_main` in `ndpiReader.c` (because the Mac App has it's own main function) and call the `orginal_main` with synthetic command line input from `ViewController.m` file when the **Run** button is clicked.
|
||||
|
||||
It also fixes some problems when compiling with Xcode. Some are listed below:
|
||||
- Add missed `NDPI_LOG_DEBUG2` macro definition implementation (defined as `NDPI_LOG_DEBUG2_XCODE_PROJ` in `ViewController.m`)
|
||||
- Add an empty ndpi_utils.h file to make `protocols/attic/ftp.c` and `protocols/attic/secondlife.c` can compile
|
||||
- Specially treat `ndpi_patricia.c` by not adding it into compilation source, since it's directly included in `ndpi_main.c`
|
||||
File diff suppressed because it is too large
Load Diff
Generated
-7
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:ndpiExample.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@interface AppDelegate ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
// Insert code here to initialize your application
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||
// Insert code here to tear down your application
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -1,732 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
<scene sceneID="JPo-4y-FX3">
|
||||
<objects>
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="ndpiExample" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="ndpiExample" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About ndpiExample" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
|
||||
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
||||
<menuItem title="Services" id="NMo-om-nkz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
||||
<menuItem title="Hide ndpiExample" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit ndpiExample" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="dMs-cI-mzQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="File" id="bib-Uj-vzu">
|
||||
<items>
|
||||
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="tXI-mr-wws">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="vNY-rz-j42">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
|
||||
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
|
||||
<connections>
|
||||
<action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
|
||||
<connections>
|
||||
<action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
|
||||
<connections>
|
||||
<action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
|
||||
<connections>
|
||||
<action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
|
||||
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
|
||||
<connections>
|
||||
<action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="5QF-Oa-p0T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
|
||||
<connections>
|
||||
<action selector="undo:" target="Ady-hI-5gd" id="M6e-cu-g7V"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
|
||||
<connections>
|
||||
<action selector="redo:" target="Ady-hI-5gd" id="oIA-Rs-6OD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
|
||||
<connections>
|
||||
<action selector="cut:" target="Ady-hI-5gd" id="YJe-68-I9s"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
|
||||
<connections>
|
||||
<action selector="copy:" target="Ady-hI-5gd" id="G1f-GL-Joy"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
|
||||
<connections>
|
||||
<action selector="paste:" target="Ady-hI-5gd" id="UvS-8e-Qdg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="Ady-hI-5gd" id="cEh-KX-wJQ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="pa3-QI-u2k">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="delete:" target="Ady-hI-5gd" id="0Mk-Ml-PaM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
|
||||
<menuItem title="Find" id="4EN-yA-p0u">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Find" id="1b7-l0-nxx">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="cD7-Qs-BN4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="WD3-Gg-5AJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="NDo-RZ-v9R"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="HOh-sY-3ay"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="U76-nv-p5D"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="Ady-hI-5gd" id="IOG-6D-g5B"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="Ady-hI-5gd" id="vFj-Ks-hy3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="Ady-hI-5gd" id="fz7-VC-reM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
|
||||
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="Ady-hI-5gd" id="7w6-Qz-0kB"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="Ady-hI-5gd" id="muD-Qn-j4w"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="Ady-hI-5gd" id="2lM-Qi-WAP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="9ic-FL-obx">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="Ady-hI-5gd" id="oku-mr-iSq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
|
||||
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="Ady-hI-5gd" id="3IJ-Se-DZD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="Ady-hI-5gd" id="ptq-xd-QOA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="Ady-hI-5gd" id="oCt-pO-9gS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" id="cwL-P1-jid">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="Ady-hI-5gd" id="Gip-E3-Fov"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Data Detectors" id="tRr-pd-1PS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDataDetection:" target="Ady-hI-5gd" id="R1I-Nq-Kbl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="Ady-hI-5gd" id="DvP-Fe-Py6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="2oI-Rn-ZJC">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="Ady-hI-5gd" id="sPh-Tk-edu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="Ady-hI-5gd" id="iUZ-b5-hil"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="Ady-hI-5gd" id="26H-TL-nsh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="xrE-MZ-jX0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="Ady-hI-5gd" id="654-Ng-kyl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="Ady-hI-5gd" id="dX8-6p-jy9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Format" id="jxT-CU-nIS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Format" id="GEO-Iw-cKr">
|
||||
<items>
|
||||
<menuItem title="Font" id="Gi5-1S-RQB">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
|
||||
<items>
|
||||
<menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
|
||||
<connections>
|
||||
<action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
|
||||
<connections>
|
||||
<action selector="underline:" target="Ady-hI-5gd" id="FYS-2b-JAY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
|
||||
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
|
||||
<menuItem title="Kern" id="jBQ-r6-VK2">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Kern" id="tlD-Oa-oAM">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="GUa-eO-cwY">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardKerning:" target="Ady-hI-5gd" id="6dk-9l-Ckg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="cDB-IK-hbR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffKerning:" target="Ady-hI-5gd" id="U8a-gz-Maa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Tighten" id="46P-cB-AYj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="tightenKerning:" target="Ady-hI-5gd" id="hr7-Nz-8ro"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Loosen" id="ogc-rX-tC1">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="loosenKerning:" target="Ady-hI-5gd" id="8i4-f9-FKE"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Ligatures" id="o6e-r0-MWq">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="agt-UL-0e3">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardLigatures:" target="Ady-hI-5gd" id="7uR-wd-Dx6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="J7y-lM-qPV">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffLigatures:" target="Ady-hI-5gd" id="iX2-gA-Ilz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use All" id="xQD-1f-W4t">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useAllLigatures:" target="Ady-hI-5gd" id="KcB-kA-TuK"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Baseline" id="OaQ-X3-Vso">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Baseline" id="ijk-EB-dga">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="3Om-Ey-2VK">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unscript:" target="Ady-hI-5gd" id="0vZ-95-Ywn"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Superscript" id="Rqc-34-cIF">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="superscript:" target="Ady-hI-5gd" id="3qV-fo-wpU"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Subscript" id="I0S-gh-46l">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="subscript:" target="Ady-hI-5gd" id="Q6W-4W-IGz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Raise" id="2h7-ER-AoG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="raiseBaseline:" target="Ady-hI-5gd" id="4sk-31-7Q9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Lower" id="1tx-W0-xDw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowerBaseline:" target="Ady-hI-5gd" id="OF1-bc-KW4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
|
||||
<menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
|
||||
<connections>
|
||||
<action selector="orderFrontColorPanel:" target="Ady-hI-5gd" id="mSX-Xz-DV3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
|
||||
<menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyFont:" target="Ady-hI-5gd" id="GJO-xA-L4q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteFont:" target="Ady-hI-5gd" id="JfD-CL-leO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Text" id="Fal-I4-PZk">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Text" id="d9c-me-L2H">
|
||||
<items>
|
||||
<menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
|
||||
<connections>
|
||||
<action selector="alignLeft:" target="Ady-hI-5gd" id="zUv-R1-uAa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
|
||||
<connections>
|
||||
<action selector="alignCenter:" target="Ady-hI-5gd" id="spX-mk-kcS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Justify" id="J5U-5w-g23">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="alignJustified:" target="Ady-hI-5gd" id="ljL-7U-jND"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
|
||||
<connections>
|
||||
<action selector="alignRight:" target="Ady-hI-5gd" id="r48-bG-YeY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
|
||||
<menuItem title="Writing Direction" id="H1b-Si-o9J">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
|
||||
<items>
|
||||
<menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="YGs-j5-SAR">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="Lbh-J2-qVU">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="jFq-tB-4Kx">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
|
||||
<menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="Nop-cj-93Q">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="BgM-ve-c93">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="RB4-Sm-HuC">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
|
||||
<menuItem title="Show Ruler" id="vLm-3I-IUL">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleRuler:" target="Ady-hI-5gd" id="FOx-HJ-KwY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyRuler:" target="Ady-hI-5gd" id="71i-fW-3W2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteRuler:" target="Ady-hI-5gd" id="cSh-wd-qM2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="H8h-7b-M4v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="View" id="HyV-fh-RgO">
|
||||
<items>
|
||||
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
|
||||
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleSourceList:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleFullScreen:" target="Ady-hI-5gd" id="dU3-MA-1Rq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="aUF-d1-5bR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="R4o-n2-Eq4">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
|
||||
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="wpr-3q-Mcd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="ndpiExample Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="0.0"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
|
||||
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
|
||||
</connections>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="250"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
|
||||
<view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Jdf-YK-4JB">
|
||||
<rect key="frame" x="23" y="173" width="64" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Run" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="1eG-Fb-Ybk">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="onRunButtonClicked:" target="XfG-lQ-9wD" id="zyK-t7-vwt"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
</viewController>
|
||||
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="655"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2018年 ZengYingpei. All rights reserved.</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface ViewController : NSViewController
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "ViewController.h"
|
||||
#include "ndpi_api.h"
|
||||
|
||||
// Declare the orginal_main defined in ndpiReader.c here
|
||||
extern int orginal_main(int argc, char **argv);
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
- (void)setRepresentedObject:(id)representedObject {
|
||||
[super setRepresentedObject:representedObject];
|
||||
|
||||
// Update the view, if already loaded.
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)onRunButtonClicked:(id)sender
|
||||
{
|
||||
char* args[10];
|
||||
|
||||
extern int optind;
|
||||
optind = 1; // reset the parse of getopt_long
|
||||
|
||||
// Check the "nDPI_QuickStartGuide.pdf" for comand option explanation.
|
||||
|
||||
/* Following code it to execute below command (remember to change args[2] to
|
||||
* absolute path):
|
||||
* ./ndpiReader -i capture.pcap
|
||||
*/
|
||||
args[0] = (char*)"ndpiReader";
|
||||
args[1] = (char*)"-i";
|
||||
NSString* pcap_file = [[NSBundle mainBundle]pathForResource:@"capture" ofType:@"pcap"];
|
||||
args[2] = (char*)[pcap_file cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
// Change to you pcap file path if you want.
|
||||
//args[2] = (char*)"/Users/zengyingpei/Documents/code/nDPI/example/MacOS/ndpiExample/ndpiExample/capture.pcap";
|
||||
// Remember to change below number of args when you change to other command inputs.
|
||||
orginal_main(3, args);
|
||||
|
||||
|
||||
|
||||
/* Following code it to execute below command:
|
||||
* ./ndpiReader -i en1 -s 10 -p protos.txt
|
||||
* The process seems to be not support re-entering. You may have to re-run the App.
|
||||
*/
|
||||
/*
|
||||
args[0] = (char*)"ndpiReader";
|
||||
args[1] = (char*)"-i";
|
||||
args[2] = (char*)"en0";
|
||||
args[3] = (char*)"-s";
|
||||
args[4] = (char*)"10";
|
||||
args[5] = (char*)"-p";
|
||||
NSString* proto_file = [[NSBundle mainBundle]pathForResource:@"protos" ofType:@"txt"];
|
||||
args[6] = (char*)[proto_file cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
//args[6] = (char*)"/Users/zengyingpei/Documents/code/nDPI/example/protos.txt";
|
||||
orginal_main(7, args);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
// In order to fix the missing of NDPI_LOG_DEBUG2 (used in ndpi_main.c), we define
|
||||
// NDPI_LOG_DEBUG2 as NDPI_LOG_DEBUG2_XCODE_PROJ.
|
||||
|
||||
void vNDPI_LOG_DEBUG2_XCODE_PROJ(struct ndpi_detection_module_struct * ndpi_struct,
|
||||
const char *format, va_list ap)
|
||||
{
|
||||
vprintf(format, ap);
|
||||
}
|
||||
|
||||
void NDPI_LOG_DEBUG2_XCODE_PROJ(struct ndpi_detection_module_struct * ndpi_struct,
|
||||
const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vNDPI_LOG_DEBUG2_XCODE_PROJ(ndpi_struct, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
@end
|
||||
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
||||
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ndpi_utils_h
|
||||
#define ndpi_utils_h
|
||||
|
||||
// Empty placeholder head file. Just to make the compilations of protocols/attic/ftp.c and
|
||||
// protocols/attic/secondlife.c don't break.
|
||||
|
||||
#endif /* ndpi_utils_h */
|
||||
@@ -0,0 +1,12 @@
|
||||
bin_PROGRAMS = ndpiReader
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src/include @PCAP_INC@
|
||||
AM_CFLAGS = @PTHREAD_CFLAGS@ # --coverage
|
||||
|
||||
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@ @DL_LIB@ -lm
|
||||
AM_LDFLAGS = -static @DL_LIB@
|
||||
|
||||
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c ndpi_util.h uthash.h
|
||||
|
||||
ndpiReader.o: ndpiReader.c
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
#
|
||||
# Run 'make -f Makefile.dpdk' to compile the DPDK examples
|
||||
#
|
||||
# See http://core.dpdk.org/doc/quick-start/ for DPDK installation and setup
|
||||
#
|
||||
ifeq ($(RTE_SDK),)
|
||||
#$(error "Please define RTE_SDK environment variable")
|
||||
RTE_SDK = $(HOME)/DPDK
|
||||
RTE_TARGET = build
|
||||
endif
|
||||
|
||||
# Default target, can be overridden by command line or environment
|
||||
RTE_TARGET ?= x86_64-native-linuxapp-gcc
|
||||
|
||||
include $(RTE_SDK)/mk/rte.vars.mk
|
||||
|
||||
APP = ndpiReader.dpdk
|
||||
LIBNDPI = $(PWD)/../src/lib/libndpi.a
|
||||
|
||||
SRCS-y := reader_util.c intrusion_detection.c ndpiReader.c
|
||||
|
||||
CFLAGS += -g
|
||||
CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-parameter -I $(PWD)/../src/include @CFLAGS@ -DUSE_DPDK
|
||||
LDLIBS = $(LIBNDPI) @PCAP_LIB@ @LIBS@ @ADDITIONAL_LIBS@ -lpthread @LDFLAGS@
|
||||
|
||||
include $(RTE_SDK)/mk/rte.extapp.mk
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
AR=@AR@
|
||||
CC=@CC@
|
||||
CXX=@CXX@
|
||||
BUILD_MINGW=@BUILD_MINGW@
|
||||
BUILD_MINGW_X64=@BUILD_MINGW_X64@
|
||||
SRCHOME=../src
|
||||
CFLAGS=-g -fPIC -DPIC -I$(SRCHOME)/include @PCAP_INC@ @CFLAGS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
LIBNDPI=$(SRCHOME)/lib/libndpi.a
|
||||
LIBS=$(LIBNDPI) @PCAP_LIB@ @LIBS@ @ADDITIONAL_LIBS@
|
||||
HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)/include/ndpi_api.h \
|
||||
$(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h
|
||||
OBJS=ndpiReader.o reader_util.o intrusion_detection.o
|
||||
PREFIX?=@prefix@
|
||||
|
||||
ifneq ($(BUILD_MINGW),)
|
||||
SUFFIX:=.exe
|
||||
CFLAGS+=-I@srcdir@/../windows/WpdPack/Include -I@srcdir@/../windows/WpdPack/Include/pcap
|
||||
LIBS+=-Wl,-Bstatic -lpthread -Wl,-Bdynamic
|
||||
|
||||
ifneq ($(BUILD_MINGW_X64),)
|
||||
LIBS+=@srcdir@/../windows/WpdPack/Lib/x64/wpcap.lib
|
||||
else
|
||||
LIBS+=@srcdir@/../windows/WpdPack/Lib/wpcap.lib
|
||||
endif
|
||||
|
||||
else
|
||||
|
||||
LIBS+=-lpthread
|
||||
|
||||
endif
|
||||
|
||||
all: ndpiReader$(SUFFIX) @DPDK_TARGET@
|
||||
|
||||
EXECUTABLE_SOURCES := ndpiReader.c ndpiSimpleIntegration.c
|
||||
COMMON_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard *.c ))
|
||||
|
||||
libndpiReader.a: $(COMMON_SOURCES:%.c=%.o) $(LIBNDPI)
|
||||
$(AR) rsv libndpiReader.a $(COMMON_SOURCES:%.c=%.o)
|
||||
|
||||
ndpiReader$(SUFFIX): libndpiReader.a $(LIBNDPI) ndpiReader.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) ndpiReader.o libndpiReader.a $(LIBS) -o $@
|
||||
|
||||
ndpiSimpleIntegration$(SUFFIX): ndpiSimpleIntegration.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
|
||||
|
||||
%.o: %.c $(HEADERS) Makefile
|
||||
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
|
||||
|
||||
install: ndpiReader$(SUFFIX)
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/bin/
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/share/ndpi
|
||||
cp ndpiReader$(SUFFIX) $(DESTDIR)$(PREFIX)/bin/
|
||||
cp protos.txt $(DESTDIR)$(PREFIX)/share/ndpi/ndpiProtos.txt
|
||||
cp mining_hosts.txt $(DESTDIR)$(PREFIX)/share/ndpi/ndpiCustomCategory.txt
|
||||
[ -f ndpiSimpleIntegration$(SUFFIX) ] && cp ndpiSimpleIntegration$(SUFFIX) $(DESTDIR)$(PREFIX)/bin/ndpiSimpleIntegration$(SUFFIX) || true
|
||||
[ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
|
||||
[ -f ndpiReader.dpdk ] && cp ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
|
||||
|
||||
dpdk:
|
||||
$(MAKE) -f Makefile.dpdk
|
||||
|
||||
check:
|
||||
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I$(SRCHOME)/include *.c
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o ndpiReader ndpiSimpleIntegration ndpiReader$(SUFFIX) ndpiSimpleIntegration$(SUFFIX) ndpiReader.dpdk
|
||||
/bin/rm -f .*.dpdk.cmd .*.o.cmd *.dpdk.map .*.o.d
|
||||
/bin/rm -f _install _postbuild _postinstall _preinstall
|
||||
/bin/rm -rf build
|
||||
|
||||
distdir:
|
||||
cp categories.txt mining_hosts.txt protos.txt README.DPDK '$(distdir)/'
|
||||
find . -maxdepth 1 -type f -name '*.c' -o -name '*.h' -o -name '*.py' | xargs -I'{}' cp '{}' '$(distdir)/{}'
|
||||
|
||||
distclean: clean
|
||||
/bin/rm -f Makefile.dpdk
|
||||
/bin/rm -f Makefile
|
||||
@@ -1,31 +0,0 @@
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
You need to install and compile DPDK in your HOME directory as explained in
|
||||
See http://core.dpdk.org/doc/quick-start/ for DPDK installation and setup
|
||||
|
||||
Once DPDK is built make sure to create a symbolic link
|
||||
|
||||
$ cd
|
||||
$ ln -s dpdk-18.08 DPDK
|
||||
|
||||
so the build process will use the DPDK directory letting you have multiple
|
||||
DPDK versions available on your system
|
||||
|
||||
|
||||
Build
|
||||
-----
|
||||
Everything will happen automagically but if you want to do it by hand
|
||||
do: make -f Makefile.dpdk
|
||||
|
||||
|
||||
Run Application
|
||||
---------------
|
||||
Supposing to capture packets from device eno1 you can start the
|
||||
application as follows:
|
||||
|
||||
sudo ./build/ndpiReader -c 1 --vdev=net_pcap0,iface=eno1 -- -v 1
|
||||
|
||||
NOTE:
|
||||
- ndpiReader without DPDK support sits in this directory
|
||||
- ndpiReader with DPDK support can be found inside the ./build directory
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual C++ Express 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pcapExample", "pcapExample\pcapExample.vcxproj", "{F6A2C0AE-2110-438A-87E4-7C1CFCE064C6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F6A2C0AE-2110-438A-87E4-7C1CFCE064C6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F6A2C0AE-2110-438A-87E4-7C1CFCE064C6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F6A2C0AE-2110-438A-87E4-7C1CFCE064C6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F6A2C0AE-2110-438A-87E4-7C1CFCE064C6}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
// pcapExample.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F6A2C0AE-2110-438A-87E4-7C1CFCE064C6}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>pcapExample</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>C:\ntop\nprobe\nprobe-win-32;C:\ntop\winpcap\Include;C:\ntop\dependencies\nDPI\src\lib\third_party\include;C:\ntop\dependencies\nDPI\src\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>Wsock32.lib;Ws2_32.lib;C:\ntop\winpcap\Lib\Packet.lib;C:\ntop\winpcap\Lib\wpcap.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\..\..\nprobe\nprobe-win-32\getopt.c" />
|
||||
<ClCompile Include="..\..\..\..\..\nprobe\nprobe-win-32\getopt1.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\ndpi_main.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\afp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\aimini.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\applejuice.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\armagetron.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\battlefield.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\bgp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\bittorrent.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ciscovpn.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\citrix.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\corba.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\crossfire.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dcerpc.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dhcp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dhcpv6.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\directconnect.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\directdownloadlink.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dns.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dofus.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dropbox.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\edonkey.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\fasttrack.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\feidian.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\fiesta.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\filetopia.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\flash.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\florensia.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ftp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\gadu_gadu.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\gnutella.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\gtp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\guildwars.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\h323.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\halflife2_and_mods.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\http.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\http_activesync.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\i23v5.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\iax.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\icecast.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\imesh.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ipp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\irc.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\jabber.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\kerberos.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\kontiki.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ldap.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\lotus_notes.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mail_imap.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mail_pop.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mail_smtp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\maplestory.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mdns.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\meebo.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mgcp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mms.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\msn.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mssql.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mysql.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\netbios.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\netflow.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\nfs.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\noe.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\non_tcp_udp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ntp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\openft.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\openvpn.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\oracle.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\oscar.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pando.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pcanywhere.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\popo.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\postgres.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pplive.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ppstream.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pptp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\qq.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\quake.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\quic.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\radius.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rdp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rsync.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rtcp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rtp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rtsp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\sflow.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\shoutcast.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\sip.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\skinny.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\skype.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\smb.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\snmp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\socrates.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\sopcast.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\soulseek.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\spotify.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ssdp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ssh.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ssl.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\stealthnet.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\steam.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\stun.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\syslog.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tcp_udp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tds.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\teamspeak.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\teamviewer.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\telnet.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tftp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\thunder.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tor.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tvants.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tvuplayer.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\usenet.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\veohtv.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\viber.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\vmware.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\vnc.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\warcraft3.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\winmx.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\world_of_kung_fu.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\world_of_warcraft.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\xbox.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\xdmcp.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\yahoo.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\zattoo.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\third_party\src\ahocorasick.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\third_party\src\node.c" />
|
||||
<ClCompile Include="..\..\..\src\lib\third_party\src\sort.c" />
|
||||
<ClCompile Include="..\..\pcapReader.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\..\..\nprobe\nprobe-win-32\getopt.h" />
|
||||
<ClInclude Include="..\..\..\src\include\linux_compat.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_api.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_debug_functions.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_define.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_macros.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_main.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_protocols.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_protocols_osdpi.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_protocol_history.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_public_functions.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_structs.h" />
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_utils.h" />
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\actypes.h" />
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\ahocorasick.h" />
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\node.h" />
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\sort.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,465 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\pcapReader.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\ndpi_main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\zattoo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\afp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\aimini.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\applejuice.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\armagetron.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\battlefield.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\bgp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\bittorrent.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ciscovpn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\citrix.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\corba.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\crossfire.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dcerpc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dhcp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dhcpv6.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\directconnect.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\directdownloadlink.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dns.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dofus.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\dropbox.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\edonkey.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\fasttrack.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\feidian.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\fiesta.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\filetopia.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\flash.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\florensia.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ftp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\gadu_gadu.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\gnutella.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\gtp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\guildwars.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\h323.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\halflife2_and_mods.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\http.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\http_activesync.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\i23v5.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\iax.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\icecast.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\imesh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ipp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\irc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\jabber.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\kerberos.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\kontiki.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ldap.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\lotus_notes.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mail_imap.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mail_pop.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mail_smtp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\maplestory.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mdns.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\meebo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mgcp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mms.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\msn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mssql.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\mysql.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\netbios.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\netflow.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\nfs.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\noe.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\non_tcp_udp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ntp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\openft.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\openvpn.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\oracle.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\oscar.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pando.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pcanywhere.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\popo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\postgres.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pplive.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ppstream.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\pptp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\qq.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\quake.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\quic.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\radius.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rdp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rsync.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rtcp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rtp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\rtsp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\sflow.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\shoutcast.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\sip.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\skinny.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\skype.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\smb.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\snmp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\socrates.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\sopcast.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\soulseek.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\spotify.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ssdp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ssh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\ssl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\stealthnet.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\steam.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\stun.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\syslog.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tcp_udp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tds.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\teamspeak.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\teamviewer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\telnet.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tftp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\thunder.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tor.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tvants.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\tvuplayer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\usenet.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\veohtv.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\viber.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\vmware.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\vnc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\warcraft3.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\winmx.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\world_of_kung_fu.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\world_of_warcraft.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\xbox.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\xdmcp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\protocols\yahoo.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\third_party\src\ahocorasick.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\third_party\src\node.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\lib\third_party\src\sort.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\nprobe\nprobe-win-32\getopt.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\..\..\nprobe\nprobe-win-32\getopt1.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\actypes.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\ahocorasick.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\node.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\lib\third_party\include\sort.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_api.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_debug_functions.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_define.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_macros.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_main.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_protocol_history.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_protocols.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_protocols_osdpi.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_public_functions.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_structs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\ndpi_utils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\include\linux_compat.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\..\..\nprobe\nprobe-win-32\getopt.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
||||
@@ -1,3 +0,0 @@
|
||||
# Format: name\tcategory_id
|
||||
internetbadguys.com 100
|
||||
144.139.247.220 100
|
||||
@@ -1,109 +0,0 @@
|
||||
################################################################
|
||||
# abuse.ch Suricata JA3 Fingerprint Blacklist (CSV) #
|
||||
# For Suricata 4.1.0 or newer #
|
||||
# Last updated: 2020-04-09 06:48:14 UTC #
|
||||
# #
|
||||
# Terms Of Use: https://sslbl.abuse.ch/blacklist/ #
|
||||
# For questions please contact sslbl [at] abuse.ch #
|
||||
################################################################
|
||||
#
|
||||
# ja3_md5,Firstseen,Lastseen,Listingreason
|
||||
b386946a5a44d1ddcc843bc75336dfce,2017-07-14 18:08:15,2019-07-27 20:42:54,Dridex
|
||||
8991a387e4cc841740f25d6f5139f92d,2017-07-14 19:02:03,2019-07-28 00:34:38,Adware
|
||||
cb98a24ee4b9134448ffb5714fd870ac,2017-07-14 19:48:28,2019-05-22 03:22:38,Dridex
|
||||
1aa7bf8b97e540ca5edd75f7b8384bfa,2017-07-14 20:23:38,2019-07-28 01:38:22,TrickBot
|
||||
3d89c0dfb1fa44911b8fa7523ef8dedb,2017-07-15 04:23:45,2021-02-01 18:23:25,Adware
|
||||
bc6c386f480ee97b9d9e52d472b772d8,2017-07-15 10:57:38,2021-02-21 13:13:30,Adware
|
||||
8f52d1ce303fb4a6515836aec3cc16b1,2017-07-15 19:05:11,2019-07-27 20:00:57,TrickBot
|
||||
d6f04b5a910115f4b50ecec09d40a1df,2017-07-15 19:42:24,2018-10-14 08:12:51,Dridex
|
||||
35c0a31c481927f022a3b530255ac080,2017-07-15 19:43:19,2021-02-06 03:21:55,Tofsee
|
||||
d551fafc4f40f1dec2bb45980bfa9492,2017-07-15 19:59:29,2020-11-16 13:06:20,Adware
|
||||
e330bca99c8a5256ae126a55c4c725c5,2017-07-15 19:59:29,2021-01-13 00:29:37,Adware
|
||||
b8f81673c0e1d29908346f3bab892b9b,2017-07-16 01:32:03,2018-12-17 06:08:03,Adware
|
||||
83e04bc58d402f9633983cbf22724b02,2017-07-16 01:32:03,2021-01-14 14:23:42,Adware
|
||||
70722097d1fe1d78d8c2164640ab6df4,2017-07-16 02:39:08,2021-02-22 04:56:57,Tofsee
|
||||
9c2589e1c0e9f533a022c6205f9719e1,2017-07-16 08:37:17,2021-02-19 08:46:32,Adware
|
||||
849b04bdbd1d2b983f6e8a457e0632a8,2017-07-16 08:37:17,2021-02-19 08:46:32,Adware
|
||||
16efcf0e00504ddfedde13bfea997952,2017-07-16 19:45:45,2020-12-23 15:10:32,Adware
|
||||
4d7a28d6f2263ed61de88ca66eb011e3,2017-07-16 21:20:29,2020-12-08 18:10:55,Tofsee
|
||||
550dce18de1bb143e69d6dd9413b8355,2017-07-16 22:17:20,2018-12-21 07:04:50,Adware
|
||||
c50f6a8b9173676b47ba6085bd0c6cee,2017-07-16 22:38:41,2019-05-21 09:42:17,TrickBot
|
||||
20dd18bdd3209ea718989030a6f93364,2017-07-18 10:22:58,2019-04-28 09:23:31,Adware
|
||||
8498fe4268764dbf926a38283e9d3d8f,2017-07-18 10:22:58,2020-12-31 02:06:27,Adware
|
||||
590a232d04d56409fab72e752a8a2634,2017-07-18 18:53:24,2020-10-11 20:48:33,Tofsee
|
||||
51a7ad14509fd614c7bb3a50c4982b8c,2017-07-19 07:28:19,2019-07-14 11:58:32,JBifrost
|
||||
96eba628dcb2b47607192ba74a3b55ba,2017-07-19 18:53:48,2021-01-04 12:45:08,Tofsee
|
||||
df5c30e670dba99f9270ed36060cf054,2017-07-20 17:44:07,2018-04-11 15:57:59,Tofsee
|
||||
098f55e27d8c4b0a590102cbdb3a5f3a,2017-07-21 09:52:01,2019-04-08 01:09:54,Adware
|
||||
46efd49abcca8ea9baa932da68fdb529,2017-07-22 14:07:36,2021-02-20 20:45:32,Adware
|
||||
29085f03f8e8a03f0b399c5c7cf0b0b8,2017-07-22 14:07:36,2021-02-21 20:56:01,Adware
|
||||
d7150af4514b868defb854db0f62a441,2017-07-23 09:39:24,2018-07-24 01:04:58,Tofsee
|
||||
03e186a7f83285e93341de478334006e,2017-07-24 18:17:14,2021-02-13 23:55:58,Tofsee
|
||||
3cda52da4ade09f1f781ad2e82dcfa20,2017-07-30 18:41:36,2019-05-21 17:34:18,Quakbot
|
||||
b13d01846ad7a14a70bf030a16775c78,2017-08-08 07:12:49,2021-02-21 01:32:12,Adware
|
||||
1543a7c46633acf71e8401baccbd0568,2017-08-08 21:32:28,2020-11-10 05:30:17,Tofsee
|
||||
1d095e68489d3c535297cd8dffb06cb9,2017-08-12 19:56:28,2020-10-28 11:06:23,Tofsee
|
||||
93d056782d649deb51cda44ecb714bb0,2017-08-28 12:20:47,2019-04-15 23:47:27,Adware
|
||||
698e36219f3979420fa2581b21dac7ec,2017-08-28 12:20:47,2020-12-31 02:06:31,Adware
|
||||
1712287800ac91b34cadd5884ce85568,2017-08-28 16:01:59,2021-01-23 09:36:32,TorrentLocker
|
||||
5e573c9c9f8ba720ef9b18e9fce2e2f7,2017-08-30 13:44:56,2021-02-17 17:11:34,Adware
|
||||
f6fd83a21f9f3c5f9ff7b5c63bbc179d,2017-10-20 08:03:21,2018-11-06 06:42:12,Adware
|
||||
92579701f145605e9edc0b01a901c6d5,2017-10-23 00:10:48,2021-02-18 22:56:49,Adware
|
||||
a61299f9b501adcf680b9275d79d4ac6,2017-11-04 18:03:59,2020-04-21 17:08:24,Tofsee
|
||||
b2b61db7b9490a60d270ccb20b462826,2017-11-14 20:12:03,2021-02-18 22:56:49,Adware
|
||||
7dcce5b76c8b17472d024758970a406b,2017-11-22 12:42:46,2020-12-22 15:15:49,Tofsee
|
||||
534ce2dbc413c68e908363b5df0ae5e0,2017-12-22 09:36:21,2019-07-27 15:22:33,TrickBot
|
||||
fb00055a1196aeea8d1bc609885ba953,2018-01-01 22:49:25,2019-04-09 06:58:58,TrickBot
|
||||
a50a861119aceb0ccc74902e8fddb618,2018-01-02 08:16:23,2018-07-05 02:33:08,Tofsee
|
||||
e7643725fcff971e3051fe0e47fc2c71,2018-01-31 08:06:13,2020-03-25 16:19:48,Tofsee
|
||||
7c410ce832e848a3321432c9a82e972b,2018-01-31 20:04:25,2021-02-21 22:51:31,Tofsee
|
||||
da949afd9bd6df820730f8f171584a71,2018-02-03 05:19:37,2021-02-21 05:20:43,Tofsee
|
||||
906004246f3ba5e755b043c057254a29,2018-03-11 08:25:38,2018-04-14 00:59:16,Tofsee
|
||||
fd80fa9c6120cdeea8520510f3c644ac,2018-03-11 09:34:30,2021-02-21 22:16:39,Tofsee
|
||||
b90bdbe961a648f0427db21aaa6ccb59,2018-03-11 10:37:43,2020-05-29 23:39:01,Tofsee
|
||||
1fe4c7a3544eb27afec2adfb3a3dbf60,2018-03-11 19:23:08,2021-02-20 11:19:52,Tofsee
|
||||
c201b92f8b483fa388be174d6689f534,2018-03-12 13:43:52,2021-01-28 06:17:06,Gozi
|
||||
9f62c4f26b90d3d757bea609e82f2eaf,2018-03-13 06:23:41,2020-12-18 16:07:31,Tofsee
|
||||
1be3ecebe5aa9d3654e6e703d81f6928,2018-03-13 11:50:02,2021-02-14 23:03:13,Ransomware.Troldesh
|
||||
e3b2ab1f9a56f2fb4c9248f2f41631fa,2018-03-15 01:06:34,2021-02-22 10:36:48,Tofsee
|
||||
dff8a0aa1c904aaea76c5bf624e88333,2018-03-18 09:41:15,2020-10-27 09:50:24,Tofsee
|
||||
17fd49722f8d11f3d76dce84f8e099a7,2018-03-19 23:02:27,2020-12-09 11:32:21,Tofsee
|
||||
911479ac8a0813ed1241b3686ccdade9,2018-03-19 23:24:59,2020-03-30 04:09:18,Tofsee
|
||||
c5deb9465d47232dd48772f9c4d14679,2018-03-22 15:42:48,2021-02-17 07:39:32,Tofsee
|
||||
f22bdd57e3a52de86cda40da2d84e83b,2018-03-27 13:40:19,2019-01-20 14:31:39,Tofsee
|
||||
d18a4da84af59e1108862a39bae7c9d4,2018-04-03 00:40:51,2021-02-06 01:53:12,Tofsee
|
||||
2d8794cb7b52b777bee2695e79c15760,2018-04-04 06:56:37,2021-02-10 08:22:31,Ransomware
|
||||
40adfd923eb82b89d8836ba37a19bca1,2018-04-15 15:49:08,2021-02-21 22:22:56,CoinMiner
|
||||
1aee0238942d453d679fc1e37a303387,2018-05-13 01:59:49,2021-02-10 13:19:24,Tofsee
|
||||
2092e1fffb45d7e4a19a57f9bc5e203a,2018-05-16 21:59:36,2018-09-05 01:58:33,Adware
|
||||
bffa4501966196d3d6e90cee1f88fc89,2018-06-07 15:08:04,2020-03-16 00:03:44,Tofsee
|
||||
807fca46d9d0cf63adf4e5e80e414bbe,2018-06-07 16:51:03,2021-02-20 03:15:38,Tofsee
|
||||
fb58831f892190644fe44e25bc830b45,2018-06-08 12:07:59,2019-05-31 21:02:37,Adware
|
||||
0cc1e84568e471aa1d62ad4158ade6b5,2018-06-24 10:50:47,2021-02-10 21:48:57,Tofsee
|
||||
d2935c58fe676744fecc8614ee5356c7,2018-08-14 21:48:41,2021-02-21 21:44:55,Adwind
|
||||
8916410db85077a5460817142dcbc8de,2018-08-21 12:32:28,2021-02-21 20:02:19,TrickBot
|
||||
c5235d3a8b9934b7fbbd204d50bc058d,2018-08-23 17:36:08,2019-10-13 05:11:09,Gootkit
|
||||
57f3642b4e37e28f5cbe3020c9331b4c,2018-08-28 15:54:53,2021-02-22 11:09:43,Gozi
|
||||
e62a5f4d538cbf169c2af71bec2399b4,2018-08-30 15:45:40,2021-02-21 20:36:55,TrickBot
|
||||
51c64c77e60f3980eea90869b68c58a8,2018-08-30 21:04:57,2021-02-21 22:09:16,Dridex
|
||||
7691297bcb20a41233fd0a0baa0a3628,2018-09-17 02:50:05,2021-02-21 17:05:57,Adware
|
||||
7dd50e112cd23734a310b90f6f44a7cd,2018-09-17 17:54:58,2021-02-22 11:14:04,Quakbot
|
||||
52c7396a501e4fecbdfa99c5408334ac,2018-09-18 00:29:04,2019-12-03 17:24:02,Tofsee
|
||||
f735bbc6b69723b9df7b0e7ef27872af,2018-10-02 18:04:16,2021-02-19 06:55:39,TrickBot
|
||||
49ed2ef3f1321e5f044f1e71b0e6fdd5,2018-10-02 18:04:17,2021-02-19 06:55:39,TrickBot
|
||||
d76ee64fb7273733cbe455ac81c292e6,2018-11-16 13:26:39,2018-11-18 19:19:36,Tofsee
|
||||
8f6c918dcb585ebbea05e2cc94530e3d,2018-11-16 13:26:41,2020-05-06 15:45:21,Tofsee
|
||||
34f14a69ad7009ca5863379218af17f3,2018-11-17 05:17:22,2021-01-28 08:19:18,Tofsee
|
||||
c2b4710c6888a5d47befe865c8e6fb19,2018-11-29 20:46:04,2020-12-16 15:08:09,Tofsee
|
||||
decfb48a53789ebe081b88aabb58ee34,2018-12-21 09:06:16,2021-02-16 12:28:53,Adwind
|
||||
08a8a4e85b25ac42e1490bc85cfdb5ce,2019-01-30 02:48:34,2020-10-27 09:50:19,Tofsee
|
||||
c0220cd64849a629397a9cb68f78a0ea,2019-03-24 00:12:32,2021-02-13 05:13:33,Tofsee
|
||||
7a29c223fb122ec64d10f0a159e07996,2019-06-09 22:55:29,2020-10-27 09:50:26,Tofsee
|
||||
44dab16d680ef93487bc16ad23b3ffb1,2019-06-09 22:55:29,2020-10-27 09:50:25,Tofsee
|
||||
70a04365be5bbd4653698bebeb43ce68,2019-07-02 06:26:56,2020-05-30 04:19:00,Tofsee
|
||||
d81d654effb94714a4086734fa0adad9,2019-07-16 23:29:02,2020-10-27 09:50:21,Tofsee
|
||||
25d74b7b4b779eb1efd4b31d26d651c6,2019-08-03 20:15:33,2020-07-14 21:43:25,Tofsee
|
||||
fc2299d5b2964cd242c5a2c8c531a5f0,2019-08-09 23:56:32,2021-02-22 08:49:18,Tofsee
|
||||
32926ca3e59f0413d0b98725454594f5,2019-09-12 06:56:10,2020-10-27 21:49:31,Tofsee
|
||||
ffefafdb86336d057eda5fdf02b3d5ce,2019-10-26 07:31:49,2020-07-25 00:14:09,Tofsee
|
||||
# END (98) entries
|
||||
|
@@ -1,262 +0,0 @@
|
||||
# NoCoin Filter List
|
||||
# Blocking Web Browser Bitcoin Mining
|
||||
#
|
||||
# Homepage: https://github.com/hoshsadiq/adblock-nocoin-list/
|
||||
# Contribute: https://github.com/hoshsadiq/adblock-nocoin-list/issues
|
||||
# Changelog: https://github.com/hoshsadiq/adblock-nocoin-list/commits/master/hosts.txt
|
||||
# License: https://mit-license.org/
|
||||
#
|
||||
# Last modified: 24 April 2018
|
||||
#
|
||||
|
||||
cnhv.co 99
|
||||
coin-hive.com 99
|
||||
coinhive.com 99
|
||||
authedmine.com 99
|
||||
gus.host 99
|
||||
load.jsecoin.com 99
|
||||
miner.pr0gramm.com 99
|
||||
minemytraffic.com 99
|
||||
ppoi.org 99
|
||||
projectpoi.com 99
|
||||
crypto-loot.com 99
|
||||
coinerra.com 99
|
||||
coin-have.com 99
|
||||
minero.pw 99
|
||||
minero-proxy-01.now.sh 99
|
||||
minero-proxy-02.now.sh 99
|
||||
minero-proxy-03.now.sh 99
|
||||
api.inwemo.com 99
|
||||
rocks.io 99
|
||||
adminer.com 99
|
||||
ad-miner.com 99
|
||||
jsccnn.com 99
|
||||
jscdndel.com 99
|
||||
coinhiveproxy.com 99
|
||||
coinblind.com 99
|
||||
coinnebula.com 99
|
||||
monerominer.rocks 99
|
||||
cdn.cloudcoins.co 99
|
||||
coinlab.biz 99
|
||||
go.megabanners.cf 99
|
||||
baiduccdn1.com 99
|
||||
wsp.marketgid.com 99
|
||||
papoto.com 99
|
||||
flare-analytics.com 99
|
||||
www.sparechange.io 99
|
||||
static.sparechange.io 99
|
||||
miner.nablabee.com 99
|
||||
m.anyfiles.ovh 99
|
||||
www.freecontent.bid 99
|
||||
www.freecontent.loan 99
|
||||
www.freecontent.win 99
|
||||
www.cryptonoter.com 99
|
||||
www.mutuza.win 99
|
||||
cryweb.github.io 99
|
||||
crywebber.github.io 99
|
||||
crypto-webminer.com 99
|
||||
cdn.adless.io 99
|
||||
hegrinhar.com 99
|
||||
verresof.com 99
|
||||
hemnes.win 99
|
||||
tidafors.xyz 99
|
||||
moneone.ga 99
|
||||
plexcoin.info 99
|
||||
www.monkeyminer.net 99
|
||||
go2.mercy.ga 99
|
||||
coinpirate.cf 99
|
||||
d.cpufan.club 99
|
||||
krb.devphp.org.ua 99
|
||||
nfwebminer.com 99
|
||||
cfcdist.gdn 99
|
||||
node.cfcdist.gdn 99
|
||||
webxmr.com 99
|
||||
xmr.mining.best 99
|
||||
webminepool.com 99
|
||||
webminepool.tk 99
|
||||
hive.tubetitties.com 99
|
||||
playerassets.info 99
|
||||
tokyodrift.ga 99
|
||||
webassembly.stream 99
|
||||
okeyletsgo.ml 99
|
||||
candid.zone 99
|
||||
webmine.pro 99
|
||||
andlache.com 99
|
||||
bablace.com 99
|
||||
bewaslac.com 99
|
||||
biberukalap.com 99
|
||||
bowithow.com 99
|
||||
butcalve.com 99
|
||||
evengparme.com 99
|
||||
gridiogrid.com 99
|
||||
hatcalter.com 99
|
||||
kedtise.com 99
|
||||
ledinund.com 99
|
||||
nathetsof.com 99
|
||||
renhertfo.com 99
|
||||
rintindown.com 99
|
||||
sparnove.com 99
|
||||
witthethim.com 99
|
||||
1q2w3.fun 99
|
||||
1q2w3.me 99
|
||||
cryptoloot.pro 99
|
||||
bjorksta.men 99
|
||||
crypto.csgocpu.com 99
|
||||
noblock.pro 99
|
||||
miner.cryptobara.com 99
|
||||
digger.cryptobara.com 99
|
||||
dev.cryptobara.com 99
|
||||
reservedoffers.club 99
|
||||
mine.torrent.pw 99
|
||||
host.d-ns.ga 99
|
||||
abc.pema.cl 99
|
||||
mine.nahnoji.cz 99
|
||||
webmine.cz 99
|
||||
intactoffers.club 99
|
||||
analytics.blue 99
|
||||
smectapop12.pl 99
|
||||
berserkpl.net.pl 99
|
||||
hodlers.party 99
|
||||
hodling.faith 99
|
||||
chainblock.science 99
|
||||
minescripts.info 99
|
||||
cdn.minescripts.info 99
|
||||
miner.nablabee.com 99
|
||||
wss.nablabee.com 99
|
||||
clickwith.bid 99
|
||||
dronml.ml 99
|
||||
niematego.tk 99
|
||||
tulip18.com 99
|
||||
p.estream.to 99
|
||||
didnkinrab.com 99
|
||||
ledhenone.com 99
|
||||
losital.ru 99
|
||||
mebablo.com 99
|
||||
moonsade.com 99
|
||||
nebabrop.com 99
|
||||
pearno.com 99
|
||||
rintinwa.com 99
|
||||
willacrit.com 99
|
||||
www2.adfreetv.ch 99
|
||||
minr.pw 99
|
||||
new.minr.pw 99
|
||||
test.minr.pw 99
|
||||
staticsfs.host 99
|
||||
cdn-code.host 99
|
||||
g-content.bid 99
|
||||
ad.g-content.bid 99
|
||||
cdn.static-cnt.bid 99
|
||||
cnt.statistic.date 99
|
||||
cdn.jquery-uim.download 99
|
||||
cdn-jquery.host 99
|
||||
p1.interestingz.pw 99
|
||||
kippbeak.cf 99
|
||||
pasoherb.gq 99
|
||||
axoncoho.tk 99
|
||||
depttake.ga 99
|
||||
flophous.cf 99
|
||||
pr0gram.org 99
|
||||
authedmine.eu 99
|
||||
www.monero-miner.com 99
|
||||
www.datasecu.download 99
|
||||
www.jquery-cdn.download 99
|
||||
www.etzbnfuigipwvs.ru 99
|
||||
www.terethat.ru 99
|
||||
freshrefresher.com 99
|
||||
api.pzoifaum.info 99
|
||||
ws.pzoifaum.info 99
|
||||
api.bhzejltg.info 99
|
||||
ws.bhzejltg.info 99
|
||||
d.cfcnet.top 99
|
||||
vip.cfcnet.top 99
|
||||
eu.cfcnet.top 99
|
||||
as.cfcnet.top 99
|
||||
us.cfcnet.top 99
|
||||
eu.cfcdist.loan 99
|
||||
as.cfcdist.loan 99
|
||||
us.cfcdist.loan 99
|
||||
gustaver.ddns.net 99
|
||||
worker.salon.com 99
|
||||
s2.appelamule.com 99
|
||||
mepirtedic.com 99
|
||||
cdn.streambeam.io 99
|
||||
adzjzewsma.cf 99
|
||||
ffinwwfpqi.gq 99
|
||||
ininmacerad.pro 99
|
||||
mhiobjnirs.gq 99
|
||||
open-hive-server-1.pp.ua 99
|
||||
pool.hws.ru 99
|
||||
pool.etn.spacepools.org 99
|
||||
api.aalbbh84.info 99
|
||||
www.aymcsx.ru 99
|
||||
aeros01.tk 99
|
||||
aeros02.tk 99
|
||||
aeros03.tk 99
|
||||
aeros04.tk 99
|
||||
aeros05.tk 99
|
||||
aeros06.tk 99
|
||||
aeros07.tk 99
|
||||
aeros08.tk 99
|
||||
aeros09.tk 99
|
||||
aeros10.tk 99
|
||||
aeros11.tk 99
|
||||
aeros12.tk 99
|
||||
npcdn1.now.sh 99
|
||||
mxcdn2.now.sh 99
|
||||
sxcdn6.now.sh 99
|
||||
mxcdn1.now.sh 99
|
||||
sxcdn02.now.sh 99
|
||||
sxcdn4.now.sh 99
|
||||
jqcdn2.herokuapp.com 99
|
||||
sxcdn1.herokuapp.com 99
|
||||
sxcdn5.herokuapp.com 99
|
||||
wpcdn1.herokuapp.com 99
|
||||
jqcdn01.herokuapp.com 99
|
||||
jqcdn03.herokuapp.com 99
|
||||
1q2w3.website 99
|
||||
video.videos.vidto.me 99
|
||||
video.streaming.estream.to 99
|
||||
eth-pocket.de 99
|
||||
xvideosharing.site 99
|
||||
bestcoinsignals.com 99
|
||||
eucsoft.com 99
|
||||
traviilo.com 99
|
||||
wasm24.ru 99
|
||||
xmr.cool 99
|
||||
api.netflare.info 99
|
||||
cdnjs.cloudflane.com 99
|
||||
www.cloudflane.com 99
|
||||
hide.ovh 99
|
||||
graftpool.ovh 99
|
||||
encoding.ovh 99
|
||||
altavista.ovh 99
|
||||
scaleway.ovh 99
|
||||
nexttime.ovh 99
|
||||
never.ovh 99
|
||||
2giga.download 99
|
||||
support.2giga.link 99
|
||||
webminerpool.com 99
|
||||
minercry.pt 99
|
||||
adplusplus.fr 99
|
||||
|
||||
# Does not seem to work anymore, but keeping it here just in case it gets revived
|
||||
azvjudwr.info 99
|
||||
jroqvbvw.info 99
|
||||
jyhfuqoh.info 99
|
||||
kdowqlpt.info 99
|
||||
xbasfbno.info 99
|
||||
|
||||
# These were Obfuscated
|
||||
1beb2a44.space 99
|
||||
300ca0d0.space 99
|
||||
310ca263.space 99
|
||||
320ca3f6.space 99
|
||||
330ca589.space 99
|
||||
340ca71c.space 99
|
||||
360caa42.space 99
|
||||
370cabd5.space 99
|
||||
3c0cb3b4.space 99
|
||||
3d0cb547.space 99
|
||||
|
||||
imageshack.us 99
|
||||
img265.imageshack.us 99
|
||||
@@ -1,136 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright (C) 2019 - ntop.org
|
||||
#
|
||||
# nDPI is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# nDPI is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
#
|
||||
# Usage
|
||||
#
|
||||
# 1) Generate a CSV file using the ndpiReader tool. Example:
|
||||
# ./ndpiReader -C sample.json -i sample.pcap
|
||||
#
|
||||
# 2) Open Google Chrome and type in the URL 'chrome://tracing/'
|
||||
#
|
||||
# 3) Inside Chrome click on 'Load' or drop sample.json in the
|
||||
# Chrome window to visualize the output
|
||||
#
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
||||
protos = {}
|
||||
lastId = 1
|
||||
|
||||
def get_timestamp(seen):
|
||||
tok = seen.split(".")
|
||||
return int(tok[0]) * 1000 + int(tok[1])
|
||||
|
||||
def get_record(toks, csv_fields):
|
||||
global protos
|
||||
global lastId
|
||||
|
||||
if len(toks) < 11:
|
||||
return None
|
||||
|
||||
record = dict()
|
||||
ndpiProtocol = toks[10]
|
||||
|
||||
ndpi_protos = ndpiProtocol.split(".")
|
||||
if(len(ndpi_protos) == 1):
|
||||
app_proto = ndpi_protos[0]
|
||||
else:
|
||||
app_proto = ndpi_protos[1]
|
||||
|
||||
id = protos.get(ndpiProtocol)
|
||||
if(id == None):
|
||||
lastId = lastId + 1
|
||||
protos[ndpiProtocol] = lastId
|
||||
id = lastId
|
||||
#print(ndpiProtocol+"="+str(id))
|
||||
|
||||
ip_address = toks[5]
|
||||
server_name = toks[11]
|
||||
record["cat"] = "flow"
|
||||
record["pid"] = ip_address
|
||||
record["tid"] = ndpiProtocol # id
|
||||
record["ts"] = get_timestamp(toks[2])
|
||||
record["ph"] = "X"
|
||||
record["name"] = app_proto
|
||||
|
||||
if(server_name == ""):
|
||||
args = {}
|
||||
else:
|
||||
args = { "name": server_name }
|
||||
record["args"] = args
|
||||
record["dur"] = get_timestamp(toks[3]) - record["ts"]
|
||||
|
||||
# if we do not have the legend we just return
|
||||
if csv_fields is None:
|
||||
return record
|
||||
|
||||
# Otherwise we just add everything we find as a string
|
||||
if(0):
|
||||
idx = 0
|
||||
for tok in toks:
|
||||
name = csv_fields[idx]
|
||||
idx += 1
|
||||
record["args"][name] = str(tok)
|
||||
|
||||
return record
|
||||
|
||||
def get_record_dict(filename):
|
||||
csv_fields = None
|
||||
records = []
|
||||
fin = open(filename, "r");
|
||||
for line in fin:
|
||||
line = line.replace("\n","")
|
||||
|
||||
# Get the legend if present
|
||||
if line[0] == '#':
|
||||
csv_fields = []
|
||||
line = line.replace("#", "")
|
||||
toks = line.split(",")
|
||||
for tok in toks:
|
||||
csv_fields.append(tok)
|
||||
continue
|
||||
|
||||
toks = line.split(",")
|
||||
flow_id = int(toks[0])
|
||||
record = get_record(toks, csv_fields)
|
||||
if record is None:
|
||||
print("Error while parsing " + line)
|
||||
continue
|
||||
|
||||
records.append(record)
|
||||
|
||||
json_dict = dict()
|
||||
json_dict["traceEvents"] = records
|
||||
|
||||
return json_dict
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 3:
|
||||
print("ndpi2json <csv_file> <json_file>")
|
||||
sys.exit(0)
|
||||
|
||||
record_dict = get_record_dict(sys.argv[1])
|
||||
#print(record_dict)
|
||||
#json_string = json.dumps(json_dict)
|
||||
#print(json_string)
|
||||
|
||||
with open(sys.argv[2], 'w') as fp:
|
||||
json.dump(record_dict, fp)
|
||||
print("Written " + str(len(record_dict["traceEvents"])) + " records")
|
||||
+1394
-2708
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,961 @@
|
||||
/*
|
||||
* ndpi_util.c
|
||||
*
|
||||
* Copyright (C) 2011-17 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <winsock2.h> /* winsock.h is included automatically */
|
||||
#include <process.h>
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifndef ETH_P_IP
|
||||
#define ETH_P_IP 0x0800 /* IPv4 */
|
||||
#endif
|
||||
|
||||
#ifndef ETH_P_IPv6
|
||||
#define ETH_P_IPV6 0x86dd /* IPv6 */
|
||||
#endif
|
||||
|
||||
#define SLARP 0x8035 /* Cisco Slarp */
|
||||
#define CISCO_D_PROTO 0x2000 /* Cisco Discovery Protocol */
|
||||
|
||||
#define VLAN 0x8100
|
||||
#define MPLS_UNI 0x8847
|
||||
#define MPLS_MULTI 0x8848
|
||||
#define PPPoE 0x8864
|
||||
#define SNAP 0xaa
|
||||
#define BSTP 0x42 /* Bridge Spanning Tree Protocol */
|
||||
|
||||
/* mask for FCF */
|
||||
#define WIFI_DATA 0x2 /* 0000 0010 */
|
||||
#define FCF_TYPE(fc) (((fc) >> 2) & 0x3) /* 0000 0011 = 0x3 */
|
||||
#define FCF_SUBTYPE(fc) (((fc) >> 4) & 0xF) /* 0000 1111 = 0xF */
|
||||
#define FCF_TO_DS(fc) ((fc) & 0x0100)
|
||||
#define FCF_FROM_DS(fc) ((fc) & 0x0200)
|
||||
|
||||
/* mask for Bad FCF presence */
|
||||
#define BAD_FCS 0x50 /* 0101 0000 */
|
||||
|
||||
#define GTP_U_V1_PORT 2152
|
||||
#define TZSP_PORT 37008
|
||||
|
||||
#ifndef DLT_LINUX_SLL
|
||||
#define DLT_LINUX_SLL 113
|
||||
#endif
|
||||
|
||||
#include "ndpi_main.h"
|
||||
#include "ndpi_util.h"
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
void ndpi_free_flow_info_half(struct ndpi_flow_info *flow) {
|
||||
if(flow->ndpi_flow) { ndpi_flow_free(flow->ndpi_flow); flow->ndpi_flow = NULL; }
|
||||
if(flow->src_id) { ndpi_free(flow->src_id); flow->src_id = NULL; }
|
||||
if(flow->dst_id) { ndpi_free(flow->dst_id); flow->dst_id = NULL; }
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
extern u_int32_t current_ndpi_memory, max_ndpi_memory;
|
||||
|
||||
/**
|
||||
* @brief malloc wrapper function
|
||||
*/
|
||||
static void *malloc_wrapper(size_t size) {
|
||||
current_ndpi_memory += size;
|
||||
|
||||
if(current_ndpi_memory > max_ndpi_memory)
|
||||
max_ndpi_memory = current_ndpi_memory;
|
||||
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
/**
|
||||
* @brief free wrapper function
|
||||
*/
|
||||
static void free_wrapper(void *freeable) {
|
||||
free(freeable);
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs, pcap_t * pcap_handle) {
|
||||
set_ndpi_malloc(malloc_wrapper), set_ndpi_free(free_wrapper);
|
||||
set_ndpi_flow_malloc(NULL), set_ndpi_flow_free(NULL);
|
||||
/* TODO: just needed here to init ndpi malloc wrapper */
|
||||
struct ndpi_detection_module_struct * module = ndpi_init_detection_module();
|
||||
|
||||
struct ndpi_workflow * workflow = ndpi_calloc(1, sizeof(struct ndpi_workflow));
|
||||
|
||||
workflow->pcap_handle = pcap_handle;
|
||||
workflow->prefs = *prefs;
|
||||
workflow->ndpi_struct = module;
|
||||
|
||||
if(workflow->ndpi_struct == NULL) {
|
||||
NDPI_LOG(0, NULL, NDPI_LOG_ERROR, "global structure initialization failed\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
workflow->ndpi_flows_root = ndpi_calloc(workflow->prefs.num_roots, sizeof(void *));
|
||||
return workflow;
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
void ndpi_flow_info_freer(void *node) {
|
||||
struct ndpi_flow_info *flow = (struct ndpi_flow_info*)node;
|
||||
|
||||
ndpi_free_flow_info_half(flow);
|
||||
ndpi_free(flow);
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
void ndpi_workflow_free(struct ndpi_workflow * workflow) {
|
||||
int i;
|
||||
|
||||
for(i=0; i<workflow->prefs.num_roots; i++)
|
||||
ndpi_tdestroy(workflow->ndpi_flows_root[i], ndpi_flow_info_freer);
|
||||
|
||||
ndpi_exit_detection_module(workflow->ndpi_struct);
|
||||
free(workflow->ndpi_flows_root);
|
||||
free(workflow);
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
int ndpi_workflow_node_cmp(const void *a, const void *b) {
|
||||
struct ndpi_flow_info *fa = (struct ndpi_flow_info*)a;
|
||||
struct ndpi_flow_info *fb = (struct ndpi_flow_info*)b;
|
||||
|
||||
if(fa->hashval < fb->hashval) return(-1); else if(fa->hashval > fb->hashval) return(1);
|
||||
|
||||
/* Flows have the same hash */
|
||||
|
||||
if(fa->vlan_id < fb->vlan_id ) return(-1); else { if(fa->vlan_id > fb->vlan_id ) return(1); }
|
||||
if(fa->protocol < fb->protocol ) return(-1); else { if(fa->protocol > fb->protocol ) return(1); }
|
||||
|
||||
if(
|
||||
(
|
||||
(fa->src_ip == fb->src_ip )
|
||||
&& (fa->src_port == fb->src_port)
|
||||
&& (fa->dst_ip == fb->dst_ip )
|
||||
&& (fa->dst_port == fb->dst_port)
|
||||
)
|
||||
||
|
||||
(
|
||||
(fa->src_ip == fb->dst_ip )
|
||||
&& (fa->src_port == fb->dst_port)
|
||||
&& (fa->dst_ip == fb->src_ip )
|
||||
&& (fa->dst_port == fb->src_port)
|
||||
)
|
||||
)
|
||||
return(0);
|
||||
|
||||
if(fa->src_ip < fb->src_ip ) return(-1); else { if(fa->src_ip > fb->src_ip ) return(1); }
|
||||
if(fa->src_port < fb->src_port) return(-1); else { if(fa->src_port > fb->src_port) return(1); }
|
||||
if(fa->dst_ip < fb->dst_ip ) return(-1); else { if(fa->dst_ip > fb->dst_ip ) return(1); }
|
||||
if(fa->dst_port < fb->dst_port) return(-1); else { if(fa->dst_port > fb->dst_port) return(1); }
|
||||
|
||||
return(0); /* notreached */
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
static void patchIPv6Address(char *str) {
|
||||
int i = 0, j = 0;
|
||||
|
||||
while(str[i] != '\0') {
|
||||
if((str[i] == ':')
|
||||
&& (str[i+1] == '0')
|
||||
&& (str[i+2] == ':')) {
|
||||
str[j++] = ':';
|
||||
str[j++] = ':';
|
||||
i += 3;
|
||||
} else
|
||||
str[j++] = str[i++];
|
||||
}
|
||||
if(str[j] != '\0') str[j] = '\0';
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow,
|
||||
const u_int8_t version,
|
||||
u_int16_t vlan_id,
|
||||
const struct ndpi_iphdr *iph,
|
||||
const struct ndpi_ipv6hdr *iph6,
|
||||
u_int16_t ip_offset,
|
||||
u_int16_t ipsize,
|
||||
u_int16_t l4_packet_len,
|
||||
struct ndpi_tcphdr **tcph,
|
||||
struct ndpi_udphdr **udph,
|
||||
u_int16_t *sport, u_int16_t *dport,
|
||||
struct ndpi_id_struct **src,
|
||||
struct ndpi_id_struct **dst,
|
||||
u_int8_t *proto,
|
||||
u_int8_t **payload,
|
||||
u_int16_t *payload_len,
|
||||
u_int8_t *src_to_dst_direction) {
|
||||
u_int32_t idx, l4_offset, hashval;
|
||||
struct ndpi_flow_info flow;
|
||||
void *ret;
|
||||
u_int8_t *l3, *l4;
|
||||
|
||||
/*
|
||||
Note: to keep things simple (ndpiReader is just a demo app)
|
||||
we handle IPv6 a-la-IPv4.
|
||||
*/
|
||||
if(version == IPVERSION) {
|
||||
if(ipsize < 20)
|
||||
return NULL;
|
||||
|
||||
if((iph->ihl * 4) > ipsize || ipsize < ntohs(iph->tot_len)
|
||||
/* || (iph->frag_off & htons(0x1FFF)) != 0 */)
|
||||
return NULL;
|
||||
|
||||
l4_offset = iph->ihl * 4;
|
||||
l3 = (u_int8_t*)iph;
|
||||
} else {
|
||||
l4_offset = sizeof(struct ndpi_ipv6hdr);
|
||||
l3 = (u_int8_t*)iph6;
|
||||
}
|
||||
|
||||
if(l4_packet_len < 64)
|
||||
workflow->stats.packet_len[0]++;
|
||||
else if(l4_packet_len >= 64 && l4_packet_len < 128)
|
||||
workflow->stats.packet_len[1]++;
|
||||
else if(l4_packet_len >= 128 && l4_packet_len < 256)
|
||||
workflow->stats.packet_len[2]++;
|
||||
else if(l4_packet_len >= 256 && l4_packet_len < 1024)
|
||||
workflow->stats.packet_len[3]++;
|
||||
else if(l4_packet_len >= 1024 && l4_packet_len < 1500)
|
||||
workflow->stats.packet_len[4]++;
|
||||
else if(l4_packet_len >= 1500)
|
||||
workflow->stats.packet_len[5]++;
|
||||
|
||||
if(l4_packet_len > workflow->stats.max_packet_len)
|
||||
workflow->stats.max_packet_len = l4_packet_len;
|
||||
|
||||
*proto = iph->protocol;
|
||||
l4 = ((u_int8_t *) l3 + l4_offset);
|
||||
|
||||
if(iph->protocol == IPPROTO_TCP && l4_packet_len >= 20) {
|
||||
u_int tcp_len;
|
||||
|
||||
// tcp
|
||||
workflow->stats.tcp_count++;
|
||||
*tcph = (struct ndpi_tcphdr *)l4;
|
||||
*sport = ntohs((*tcph)->source), *dport = ntohs((*tcph)->dest);
|
||||
tcp_len = ndpi_min(4*(*tcph)->doff, l4_packet_len);
|
||||
*payload = &l4[tcp_len];
|
||||
*payload_len = ndpi_max(0, l4_packet_len-4*(*tcph)->doff);
|
||||
} else if(iph->protocol == IPPROTO_UDP && l4_packet_len >= 8) {
|
||||
// udp
|
||||
|
||||
workflow->stats.udp_count++;
|
||||
*udph = (struct ndpi_udphdr *)l4;
|
||||
*sport = ntohs((*udph)->source), *dport = ntohs((*udph)->dest);
|
||||
*payload = &l4[sizeof(struct ndpi_udphdr)];
|
||||
*payload_len = ndpi_max(0, l4_packet_len-sizeof(struct ndpi_udphdr));
|
||||
} else {
|
||||
// non tcp/udp protocols
|
||||
*sport = *dport = 0;
|
||||
}
|
||||
|
||||
flow.protocol = iph->protocol, flow.vlan_id = vlan_id;
|
||||
flow.src_ip = iph->saddr, flow.dst_ip = iph->daddr;
|
||||
flow.src_port = htons(*sport), flow.dst_port = htons(*dport);
|
||||
flow.hashval = hashval = flow.protocol + flow.vlan_id + flow.src_ip + flow.dst_ip + flow.src_port + flow.dst_port;
|
||||
idx = hashval % workflow->prefs.num_roots;
|
||||
ret = ndpi_tfind(&flow, &workflow->ndpi_flows_root[idx], ndpi_workflow_node_cmp);
|
||||
|
||||
if(ret == NULL) {
|
||||
if(workflow->stats.ndpi_flow_count == workflow->prefs.max_ndpi_flows) {
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_ERROR,
|
||||
"maximum flow count (%u) has been exceeded\n",
|
||||
workflow->prefs.max_ndpi_flows);
|
||||
exit(-1);
|
||||
} else {
|
||||
struct ndpi_flow_info *newflow = (struct ndpi_flow_info*)malloc(sizeof(struct ndpi_flow_info));
|
||||
|
||||
if(newflow == NULL) {
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_ERROR, "[NDPI] %s(1): not enough memory\n", __FUNCTION__);
|
||||
return(NULL);
|
||||
} else
|
||||
workflow->num_allocated_flows++;
|
||||
|
||||
memset(newflow, 0, sizeof(struct ndpi_flow_info));
|
||||
newflow->hashval = hashval;
|
||||
newflow->protocol = iph->protocol, newflow->vlan_id = vlan_id;
|
||||
newflow->src_ip = iph->saddr, newflow->dst_ip = iph->daddr;
|
||||
newflow->src_port = htons(*sport), newflow->dst_port = htons(*dport);
|
||||
newflow->ip_version = version;
|
||||
|
||||
if(version == IPVERSION) {
|
||||
inet_ntop(AF_INET, &newflow->src_ip, newflow->src_name, sizeof(newflow->src_name));
|
||||
inet_ntop(AF_INET, &newflow->dst_ip, newflow->dst_name, sizeof(newflow->dst_name));
|
||||
} else {
|
||||
inet_ntop(AF_INET6, &iph6->ip6_src, newflow->src_name, sizeof(newflow->src_name));
|
||||
inet_ntop(AF_INET6, &iph6->ip6_dst, newflow->dst_name, sizeof(newflow->dst_name));
|
||||
/* For consistency across platforms replace :0: with :: */
|
||||
patchIPv6Address(newflow->src_name), patchIPv6Address(newflow->dst_name);
|
||||
}
|
||||
|
||||
if((newflow->ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT)) == NULL) {
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_ERROR, "[NDPI] %s(2): not enough memory\n", __FUNCTION__);
|
||||
free(newflow);
|
||||
return(NULL);
|
||||
} else
|
||||
memset(newflow->ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
|
||||
|
||||
if((newflow->src_id = ndpi_malloc(SIZEOF_ID_STRUCT)) == NULL) {
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_ERROR, "[NDPI] %s(3): not enough memory\n", __FUNCTION__);
|
||||
free(newflow);
|
||||
return(NULL);
|
||||
} else
|
||||
memset(newflow->src_id, 0, SIZEOF_ID_STRUCT);
|
||||
|
||||
if((newflow->dst_id = ndpi_malloc(SIZEOF_ID_STRUCT)) == NULL) {
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_ERROR, "[NDPI] %s(4): not enough memory\n", __FUNCTION__);
|
||||
free(newflow);
|
||||
return(NULL);
|
||||
} else
|
||||
memset(newflow->dst_id, 0, SIZEOF_ID_STRUCT);
|
||||
|
||||
ndpi_tsearch(newflow, &workflow->ndpi_flows_root[idx], ndpi_workflow_node_cmp); /* Add */
|
||||
workflow->stats.ndpi_flow_count++;
|
||||
|
||||
*src = newflow->src_id, *dst = newflow->dst_id;
|
||||
|
||||
return newflow;
|
||||
}
|
||||
} else {
|
||||
struct ndpi_flow_info *flow = *(struct ndpi_flow_info**)ret;
|
||||
|
||||
if(flow->src_ip == iph->saddr
|
||||
&& flow->dst_ip == iph->daddr
|
||||
&& flow->src_port == htons(*sport)
|
||||
&& flow->dst_port == htons(*dport)
|
||||
)
|
||||
*src = flow->src_id, *dst = flow->dst_id, *src_to_dst_direction = 1;
|
||||
else
|
||||
*src = flow->dst_id, *dst = flow->src_id, *src_to_dst_direction = 0, flow->bidirectional = 1;
|
||||
|
||||
return flow;
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************** */
|
||||
|
||||
static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflow,
|
||||
u_int16_t vlan_id,
|
||||
const struct ndpi_ipv6hdr *iph6,
|
||||
u_int16_t ip_offset,
|
||||
struct ndpi_tcphdr **tcph,
|
||||
struct ndpi_udphdr **udph,
|
||||
u_int16_t *sport, u_int16_t *dport,
|
||||
struct ndpi_id_struct **src,
|
||||
struct ndpi_id_struct **dst,
|
||||
u_int8_t *proto,
|
||||
u_int8_t **payload,
|
||||
u_int16_t *payload_len,
|
||||
u_int8_t *src_to_dst_direction) {
|
||||
struct ndpi_iphdr iph;
|
||||
|
||||
memset(&iph, 0, sizeof(iph));
|
||||
iph.version = IPVERSION;
|
||||
iph.saddr = iph6->ip6_src.u6_addr.u6_addr32[2] + iph6->ip6_src.u6_addr.u6_addr32[3];
|
||||
iph.daddr = iph6->ip6_dst.u6_addr.u6_addr32[2] + iph6->ip6_dst.u6_addr.u6_addr32[3];
|
||||
iph.protocol = iph6->ip6_ctlun.ip6_un1.ip6_un1_nxt;
|
||||
|
||||
if(iph.protocol == IPPROTO_DSTOPTS /* IPv6 destination option */) {
|
||||
u_int8_t *options = (u_int8_t*)iph6 + sizeof(const struct ndpi_ipv6hdr);
|
||||
|
||||
iph.protocol = options[0];
|
||||
}
|
||||
|
||||
return(get_ndpi_flow_info(workflow, 6, vlan_id, &iph, iph6, ip_offset,
|
||||
sizeof(struct ndpi_ipv6hdr),
|
||||
ntohs(iph6->ip6_ctlun.ip6_un1.ip6_un1_plen),
|
||||
tcph, udph, sport, dport,
|
||||
src, dst, proto, payload, payload_len, src_to_dst_direction));
|
||||
}
|
||||
|
||||
/* ****************************************************** */
|
||||
|
||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow) {
|
||||
if(!flow->ndpi_flow) return;
|
||||
|
||||
snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s",
|
||||
flow->ndpi_flow->host_server_name);
|
||||
|
||||
/* BITTORRENT */
|
||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_BITTORRENT) {
|
||||
int i, j, n = 0;
|
||||
|
||||
for(i=0, j = 0; j < sizeof(flow->bittorent_hash)-1; i++) {
|
||||
sprintf(&flow->bittorent_hash[j], "%02x", flow->ndpi_flow->protos.bittorrent.hash[i]);
|
||||
j += 2, n += flow->ndpi_flow->protos.bittorrent.hash[i];
|
||||
}
|
||||
|
||||
if(n == 0) flow->bittorent_hash[0] = '\0';
|
||||
}
|
||||
/* MDNS */
|
||||
else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_MDNS) {
|
||||
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.mdns.answer);
|
||||
}
|
||||
/* UBNTAC2 */
|
||||
else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UBNTAC2) {
|
||||
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.ubntac2.version);
|
||||
}
|
||||
if(flow->detected_protocol.app_protocol != NDPI_PROTOCOL_DNS) {
|
||||
/* SSH */
|
||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_SSH) {
|
||||
snprintf(flow->ssh_ssl.client_info, sizeof(flow->ssh_ssl.client_info), "%s",
|
||||
flow->ndpi_flow->protos.ssh.client_signature);
|
||||
snprintf(flow->ssh_ssl.server_info, sizeof(flow->ssh_ssl.server_info), "%s",
|
||||
flow->ndpi_flow->protos.ssh.server_signature);
|
||||
}
|
||||
/* SSL */
|
||||
else if((flow->detected_protocol.app_protocol == NDPI_PROTOCOL_SSL)
|
||||
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_SSL)) {
|
||||
snprintf(flow->ssh_ssl.client_info, sizeof(flow->ssh_ssl.client_info), "%s",
|
||||
flow->ndpi_flow->protos.ssl.client_certificate);
|
||||
snprintf(flow->ssh_ssl.server_info, sizeof(flow->ssh_ssl.server_info), "%s",
|
||||
flow->ndpi_flow->protos.ssl.server_certificate);
|
||||
}
|
||||
}
|
||||
|
||||
if(flow->detection_completed && !flow->check_extra_packets) {
|
||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN) {
|
||||
if (workflow->__flow_giveup_callback != NULL)
|
||||
workflow->__flow_giveup_callback(workflow, flow, workflow->__flow_giveup_udata);
|
||||
} else {
|
||||
if (workflow->__flow_detected_callback != NULL)
|
||||
workflow->__flow_detected_callback(workflow, flow, workflow->__flow_detected_udata);
|
||||
}
|
||||
|
||||
ndpi_free_flow_info_half(flow);
|
||||
}
|
||||
}
|
||||
|
||||
/* ****************************************************** */
|
||||
|
||||
/**
|
||||
Function to process the packet:
|
||||
determine the flow of a packet and try to decode it
|
||||
@return: 0 if success; else != 0
|
||||
|
||||
@Note: ipsize = header->len - ip_offset ; rawsize = header->len
|
||||
*/
|
||||
static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
||||
const u_int64_t time,
|
||||
u_int16_t vlan_id,
|
||||
const struct ndpi_iphdr *iph,
|
||||
struct ndpi_ipv6hdr *iph6,
|
||||
u_int16_t ip_offset,
|
||||
u_int16_t ipsize, u_int16_t rawsize) {
|
||||
struct ndpi_id_struct *src, *dst;
|
||||
struct ndpi_flow_info *flow = NULL;
|
||||
struct ndpi_flow_struct *ndpi_flow = NULL;
|
||||
u_int8_t proto;
|
||||
struct ndpi_tcphdr *tcph = NULL;
|
||||
struct ndpi_udphdr *udph = NULL;
|
||||
u_int16_t sport, dport, payload_len;
|
||||
u_int8_t *payload;
|
||||
u_int8_t src_to_dst_direction = 1;
|
||||
struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN };
|
||||
|
||||
if(iph)
|
||||
flow = get_ndpi_flow_info(workflow, IPVERSION, vlan_id, iph, NULL,
|
||||
ip_offset, ipsize,
|
||||
ntohs(iph->tot_len) - (iph->ihl * 4),
|
||||
&tcph, &udph, &sport, &dport,
|
||||
&src, &dst, &proto,
|
||||
&payload, &payload_len, &src_to_dst_direction);
|
||||
else
|
||||
flow = get_ndpi_flow_info6(workflow, vlan_id, iph6, ip_offset,
|
||||
&tcph, &udph, &sport, &dport,
|
||||
&src, &dst, &proto,
|
||||
&payload, &payload_len, &src_to_dst_direction);
|
||||
|
||||
if(flow != NULL) {
|
||||
workflow->stats.ip_packet_count++;
|
||||
workflow->stats.total_wire_bytes += rawsize + 24 /* CRC etc */,
|
||||
workflow->stats.total_ip_bytes += rawsize;
|
||||
ndpi_flow = flow->ndpi_flow;
|
||||
|
||||
if(src_to_dst_direction)
|
||||
flow->src2dst_packets++, flow->src2dst_bytes += rawsize;
|
||||
else
|
||||
flow->dst2src_packets++, flow->dst2src_bytes += rawsize;
|
||||
|
||||
flow->last_seen = time;
|
||||
} else { // flow is NULL
|
||||
workflow->stats.total_discarded_bytes++;
|
||||
return(nproto);
|
||||
}
|
||||
|
||||
/* Protocol already detected */
|
||||
if(flow->detection_completed) {
|
||||
if(flow->check_extra_packets && ndpi_flow != NULL && ndpi_flow->check_extra_packets) {
|
||||
if(ndpi_flow->num_extra_packets_checked == 0 && ndpi_flow->max_extra_packets_to_check == 0) {
|
||||
/* Protocols can set this, but we set it here in case they didn't */
|
||||
ndpi_flow->max_extra_packets_to_check = MAX_EXTRA_PACKETS_TO_CHECK;
|
||||
}
|
||||
if(ndpi_flow->num_extra_packets_checked < ndpi_flow->max_extra_packets_to_check) {
|
||||
ndpi_process_extra_packet(workflow->ndpi_struct, ndpi_flow,
|
||||
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
||||
ipsize, time, src, dst);
|
||||
if (ndpi_flow->check_extra_packets == 0) {
|
||||
flow->check_extra_packets = 0;
|
||||
process_ndpi_collected_info(workflow, flow);
|
||||
}
|
||||
}
|
||||
} else if (ndpi_flow != NULL) {
|
||||
/* If this wasn't NULL we should do the half free */
|
||||
/* TODO: When half_free is deprecated, get rid of this */
|
||||
ndpi_free_flow_info_half(flow);
|
||||
}
|
||||
|
||||
return(flow->detected_protocol);
|
||||
}
|
||||
|
||||
flow->detected_protocol = ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
||||
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
||||
ipsize, time, src, dst);
|
||||
|
||||
if((flow->detected_protocol.app_protocol != NDPI_PROTOCOL_UNKNOWN)
|
||||
|| ((proto == IPPROTO_UDP) && ((flow->src2dst_packets + flow->dst2src_packets) > 8))
|
||||
|| ((proto == IPPROTO_TCP) && ((flow->src2dst_packets + flow->dst2src_packets) > 10))) {
|
||||
/* New protocol detected or give up */
|
||||
flow->detection_completed = 1;
|
||||
/* Check if we should keep checking extra packets */
|
||||
if (ndpi_flow->check_extra_packets)
|
||||
flow->check_extra_packets = 1;
|
||||
|
||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN)
|
||||
flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct,
|
||||
flow->ndpi_flow);
|
||||
process_ndpi_collected_info(workflow, flow);
|
||||
}
|
||||
|
||||
return(flow->detected_protocol);
|
||||
}
|
||||
|
||||
/* ****************************************************** */
|
||||
|
||||
struct ndpi_proto ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
|
||||
const struct pcap_pkthdr *header,
|
||||
const u_char *packet) {
|
||||
/*
|
||||
* Declare pointers to packet headers
|
||||
*/
|
||||
/* --- Ethernet header --- */
|
||||
const struct ndpi_ethhdr *ethernet;
|
||||
/* --- LLC header --- */
|
||||
const struct ndpi_llc_header_snap *llc;
|
||||
|
||||
/* --- Cisco HDLC header --- */
|
||||
const struct ndpi_chdlc *chdlc;
|
||||
|
||||
/* --- Radio Tap header --- */
|
||||
const struct ndpi_radiotap_header *radiotap;
|
||||
/* --- Wifi header --- */
|
||||
const struct ndpi_wifi_header *wifi;
|
||||
|
||||
/* --- MPLS header --- */
|
||||
struct ndpi_mpls_header *mpls;
|
||||
|
||||
/** --- IP header --- **/
|
||||
struct ndpi_iphdr *iph;
|
||||
/** --- IPv6 header --- **/
|
||||
struct ndpi_ipv6hdr *iph6;
|
||||
|
||||
struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN };
|
||||
|
||||
/* lengths and offsets */
|
||||
u_int16_t eth_offset = 0;
|
||||
u_int16_t radio_len;
|
||||
u_int16_t fc;
|
||||
u_int16_t type = 0;
|
||||
int wifi_len = 0;
|
||||
int pyld_eth_len = 0;
|
||||
int check;
|
||||
u_int64_t time;
|
||||
u_int16_t ip_offset = 0, ip_len;
|
||||
u_int16_t frag_off = 0, vlan_id = 0;
|
||||
u_int8_t proto = 0;
|
||||
u_int32_t label;
|
||||
|
||||
/* counters */
|
||||
u_int8_t vlan_packet = 0;
|
||||
|
||||
/* Increment raw packet counter */
|
||||
workflow->stats.raw_packet_count++;
|
||||
|
||||
/* setting time */
|
||||
time = ((uint64_t) header->ts.tv_sec) * TICK_RESOLUTION + header->ts.tv_usec / (1000000 / TICK_RESOLUTION);
|
||||
|
||||
/* safety check */
|
||||
if(workflow->last_time > time) {
|
||||
/* printf("\nWARNING: timestamp bug in the pcap file (ts delta: %llu, repairing)\n", ndpi_thread_info[thread_id].last_time - time); */
|
||||
time = workflow->last_time;
|
||||
}
|
||||
/* update last time value */
|
||||
workflow->last_time = time;
|
||||
|
||||
/*** check Data Link type ***/
|
||||
const int datalink_type = pcap_datalink(workflow->pcap_handle);
|
||||
|
||||
datalink_check:
|
||||
switch(datalink_type) {
|
||||
case DLT_NULL:
|
||||
if(ntohl(*((u_int32_t*)&packet[eth_offset])) == 2)
|
||||
type = ETH_P_IP;
|
||||
else
|
||||
type = ETH_P_IPV6;
|
||||
|
||||
ip_offset = 4 + eth_offset;
|
||||
break;
|
||||
|
||||
/* Cisco PPP in HDLC-like framing - 50 */
|
||||
case DLT_PPP_SERIAL:
|
||||
chdlc = (struct ndpi_chdlc *) &packet[eth_offset];
|
||||
ip_offset = sizeof(struct ndpi_chdlc); /* CHDLC_OFF = 4 */
|
||||
type = ntohs(chdlc->proto_code);
|
||||
break;
|
||||
|
||||
/* Cisco PPP - 9 or 104 */
|
||||
case DLT_C_HDLC:
|
||||
case DLT_PPP:
|
||||
chdlc = (struct ndpi_chdlc *) &packet[eth_offset];
|
||||
ip_offset = sizeof(struct ndpi_chdlc); /* CHDLC_OFF = 4 */
|
||||
type = ntohs(chdlc->proto_code);
|
||||
break;
|
||||
|
||||
/* IEEE 802.3 Ethernet - 1 */
|
||||
case DLT_EN10MB:
|
||||
ethernet = (struct ndpi_ethhdr *) &packet[eth_offset];
|
||||
ip_offset = sizeof(struct ndpi_ethhdr) + eth_offset;
|
||||
check = ntohs(ethernet->h_proto);
|
||||
|
||||
if(check <= 1500)
|
||||
pyld_eth_len = check;
|
||||
else if (check >= 1536)
|
||||
type = check;
|
||||
|
||||
if(pyld_eth_len != 0) {
|
||||
llc = (struct ndpi_llc_header_snap *)(&packet[ip_offset]);
|
||||
/* check for LLC layer with SNAP extension */
|
||||
if(llc->dsap == SNAP || llc->ssap == SNAP) {
|
||||
type = llc->snap.proto_ID;
|
||||
ip_offset += + 8;
|
||||
}
|
||||
/* No SNAP extension - Spanning Tree pkt must be discarted */
|
||||
else if(llc->dsap == BSTP || llc->ssap == BSTP) {
|
||||
goto v4_warning;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/* Linux Cooked Capture - 113 */
|
||||
case DLT_LINUX_SLL:
|
||||
type = (packet[eth_offset+14] << 8) + packet[eth_offset+15];
|
||||
ip_offset = 16 + eth_offset;
|
||||
break;
|
||||
|
||||
/* Radiotap link-layer - 127 */
|
||||
case DLT_IEEE802_11_RADIO:
|
||||
radiotap = (struct ndpi_radiotap_header *) &packet[eth_offset];
|
||||
radio_len = radiotap->len;
|
||||
|
||||
/* Check Bad FCS presence */
|
||||
if((radiotap->flags & BAD_FCS) == BAD_FCS) {
|
||||
workflow->stats.total_discarded_bytes += header->len;
|
||||
return(nproto);
|
||||
}
|
||||
|
||||
/* Calculate 802.11 header length (variable) */
|
||||
wifi = (struct ndpi_wifi_header*)( packet + eth_offset + radio_len);
|
||||
fc = wifi->fc;
|
||||
|
||||
/* check wifi data presence */
|
||||
if(FCF_TYPE(fc) == WIFI_DATA) {
|
||||
if((FCF_TO_DS(fc) && FCF_FROM_DS(fc) == 0x0) ||
|
||||
(FCF_TO_DS(fc) == 0x0 && FCF_FROM_DS(fc)))
|
||||
wifi_len = 26; /* + 4 byte fcs */
|
||||
} else /* no data frames */
|
||||
break;
|
||||
|
||||
/* Check ether_type from LLC */
|
||||
llc = (struct ndpi_llc_header_snap*)(packet + eth_offset + wifi_len + radio_len);
|
||||
if(llc->dsap == SNAP)
|
||||
type = ntohs(llc->snap.proto_ID);
|
||||
|
||||
/* Set IP header offset */
|
||||
ip_offset = wifi_len + radio_len + sizeof(struct ndpi_llc_header_snap) + eth_offset;
|
||||
break;
|
||||
|
||||
case DLT_RAW:
|
||||
ip_offset = eth_offset = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* printf("Unknown datalink %d\n", datalink_type); */
|
||||
return(nproto);
|
||||
}
|
||||
|
||||
/* check ether type */
|
||||
switch(type) {
|
||||
case VLAN:
|
||||
vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF;
|
||||
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
|
||||
ip_offset += 4;
|
||||
vlan_packet = 1;
|
||||
// double tagging for 802.1Q
|
||||
if(type == 0x8100) {
|
||||
vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF;
|
||||
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
|
||||
ip_offset += 4;
|
||||
}
|
||||
break;
|
||||
case MPLS_UNI:
|
||||
case MPLS_MULTI:
|
||||
mpls = (struct ndpi_mpls_header *) &packet[ip_offset];
|
||||
label = ntohl(mpls->label);
|
||||
/* label = ntohl(*((u_int32_t*)&packet[ip_offset])); */
|
||||
workflow->stats.mpls_count++;
|
||||
type = ETH_P_IP, ip_offset += 4;
|
||||
|
||||
while((label & 0x100) != 0x100) {
|
||||
ip_offset += 4;
|
||||
label = ntohl(mpls->label);
|
||||
}
|
||||
break;
|
||||
case PPPoE:
|
||||
workflow->stats.pppoe_count++;
|
||||
type = ETH_P_IP;
|
||||
ip_offset += 8;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
workflow->stats.vlan_count += vlan_packet;
|
||||
|
||||
iph_check:
|
||||
/* Check and set IP header size and total packet length */
|
||||
iph = (struct ndpi_iphdr *) &packet[ip_offset];
|
||||
|
||||
/* just work on Ethernet packets that contain IP */
|
||||
if(type == ETH_P_IP && header->caplen >= ip_offset) {
|
||||
frag_off = ntohs(iph->frag_off);
|
||||
|
||||
proto = iph->protocol;
|
||||
if(header->caplen < header->len) {
|
||||
static u_int8_t cap_warning_used = 0;
|
||||
|
||||
if(cap_warning_used == 0) {
|
||||
if(!workflow->prefs.quiet_mode)
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_DEBUG, "\n\nWARNING: packet capture size is smaller than packet size, DETECTION MIGHT NOT WORK CORRECTLY\n\n");
|
||||
cap_warning_used = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(iph->version == IPVERSION) {
|
||||
ip_len = ((u_int16_t)iph->ihl * 4);
|
||||
iph6 = NULL;
|
||||
|
||||
if(iph->protocol == IPPROTO_IPV6) {
|
||||
ip_offset += ip_len;
|
||||
goto iph_check;
|
||||
}
|
||||
|
||||
if((frag_off & 0x1FFF) != 0) {
|
||||
static u_int8_t ipv4_frags_warning_used = 0;
|
||||
workflow->stats.fragmented_count++;
|
||||
|
||||
if(ipv4_frags_warning_used == 0) {
|
||||
if(!workflow->prefs.quiet_mode)
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_DEBUG, "\n\nWARNING: IPv4 fragments are not handled by this demo (nDPI supports them)\n");
|
||||
ipv4_frags_warning_used = 1;
|
||||
}
|
||||
|
||||
workflow->stats.total_discarded_bytes += header->len;
|
||||
return(nproto);
|
||||
}
|
||||
} else if(iph->version == 6) {
|
||||
iph6 = (struct ndpi_ipv6hdr *)&packet[ip_offset];
|
||||
proto = iph6->ip6_ctlun.ip6_un1.ip6_un1_nxt;
|
||||
ip_len = sizeof(struct ndpi_ipv6hdr);
|
||||
|
||||
if(proto == IPPROTO_DSTOPTS /* IPv6 destination option */) {
|
||||
|
||||
u_int8_t *options = (u_int8_t*)&packet[ip_offset+ip_len];
|
||||
proto = options[0];
|
||||
ip_len += 8 * (options[1] + 1);
|
||||
}
|
||||
iph = NULL;
|
||||
|
||||
} else {
|
||||
static u_int8_t ipv4_warning_used = 0;
|
||||
|
||||
v4_warning:
|
||||
if(ipv4_warning_used == 0) {
|
||||
if(!workflow->prefs.quiet_mode)
|
||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_DEBUG, "\n\nWARNING: only IPv4/IPv6 packets are supported in this demo (nDPI supports both IPv4 and IPv6), all other packets will be discarded\n\n");
|
||||
ipv4_warning_used = 1;
|
||||
}
|
||||
workflow->stats.total_discarded_bytes += header->len;
|
||||
return(nproto);
|
||||
}
|
||||
|
||||
if(workflow->prefs.decode_tunnels && (proto == IPPROTO_UDP)) {
|
||||
struct ndpi_udphdr *udp = (struct ndpi_udphdr *)&packet[ip_offset+ip_len];
|
||||
u_int16_t sport = ntohs(udp->source), dport = ntohs(udp->dest);
|
||||
|
||||
if((sport == GTP_U_V1_PORT) || (dport == GTP_U_V1_PORT)) {
|
||||
/* Check if it's GTPv1 */
|
||||
u_int offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr);
|
||||
u_int8_t flags = packet[offset];
|
||||
u_int8_t message_type = packet[offset+1];
|
||||
|
||||
if((((flags & 0xE0) >> 5) == 1 /* GTPv1 */) &&
|
||||
(message_type == 0xFF /* T-PDU */)) {
|
||||
|
||||
ip_offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr)+8; /* GTPv1 header len */
|
||||
if(flags & 0x04) ip_offset += 1; /* next_ext_header is present */
|
||||
if(flags & 0x02) ip_offset += 4; /* sequence_number is present (it also includes next_ext_header and pdu_number) */
|
||||
if(flags & 0x01) ip_offset += 1; /* pdu_number is present */
|
||||
|
||||
iph = (struct ndpi_iphdr *) &packet[ip_offset];
|
||||
|
||||
if(iph->version != IPVERSION) {
|
||||
// printf("WARNING: not good (packet_id=%u)!\n", (unsigned int)workflow->stats.raw_packet_count);
|
||||
goto v4_warning;
|
||||
}
|
||||
}
|
||||
} else if((sport == TZSP_PORT) || (dport == TZSP_PORT)) {
|
||||
/* https://en.wikipedia.org/wiki/TZSP */
|
||||
u_int offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr);
|
||||
u_int8_t version = packet[offset];
|
||||
u_int8_t type = packet[offset+1];
|
||||
u_int16_t encapsulates = ntohs(*((u_int16_t*)&packet[offset+2]));
|
||||
|
||||
if((version == 1) && (type == 0) && (encapsulates == 1)) {
|
||||
u_int8_t stop = 0;
|
||||
|
||||
offset += 4;
|
||||
|
||||
while((!stop) && (offset < header->caplen)) {
|
||||
u_int8_t tag_type = packet[offset];
|
||||
u_int8_t tag_len;
|
||||
|
||||
switch(tag_type) {
|
||||
case 0: /* PADDING Tag */
|
||||
tag_len = 1;
|
||||
break;
|
||||
case 1: /* END Tag */
|
||||
tag_len = 1, stop = 1;
|
||||
break;
|
||||
default:
|
||||
tag_len = packet[offset+1];
|
||||
break;
|
||||
}
|
||||
|
||||
offset += tag_len;
|
||||
|
||||
if(offset >= header->caplen)
|
||||
return(nproto); /* Invalid packet */
|
||||
else {
|
||||
eth_offset = offset;
|
||||
goto datalink_check;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* process the packet */
|
||||
return(packet_processing(workflow, time, vlan_id, iph, iph6,
|
||||
ip_offset, header->caplen - ip_offset, header->caplen));
|
||||
}
|
||||
|
||||
/* ********************************************************** */
|
||||
/* http://home.thep.lu.se/~bjorn/crc/crc32_fast.c */
|
||||
/* ********************************************************** */
|
||||
|
||||
static uint32_t crc32_for_byte(uint32_t r) {
|
||||
int j;
|
||||
for(j = 0; j < 8; ++j)
|
||||
r = (r & 1? 0: (uint32_t)0xEDB88320L) ^ r >> 1;
|
||||
return r ^ (uint32_t)0xFF000000L;
|
||||
}
|
||||
|
||||
/* Any unsigned integer type with at least 32 bits may be used as
|
||||
* accumulator type for fast crc32-calulation, but unsigned long is
|
||||
* probably the optimal choice for most systems. */
|
||||
typedef unsigned long accum_t;
|
||||
|
||||
static void init_tables(uint32_t* table, uint32_t* wtable) {
|
||||
size_t i, j, k, w;
|
||||
for(i = 0; i < 0x100; ++i)
|
||||
table[i] = crc32_for_byte(i);
|
||||
for(k = 0; k < sizeof(accum_t); ++k)
|
||||
for(i = 0; i < 0x100; ++i) {
|
||||
for(j = w = 0; j < sizeof(accum_t); ++j)
|
||||
w = table[(uint8_t)(j == k? w ^ i: w)] ^ w >> 8;
|
||||
wtable[(k << 8) + i] = w ^ (k? wtable[0]: 0);
|
||||
}
|
||||
}
|
||||
|
||||
static void __crc32(const void* data, size_t n_bytes, uint32_t* crc) {
|
||||
static uint32_t table[0x100], wtable[0x100*sizeof(accum_t)];
|
||||
size_t n_accum = n_bytes/sizeof(accum_t);
|
||||
size_t i, j;
|
||||
if(!*table)
|
||||
init_tables(table, wtable);
|
||||
for(i = 0; i < n_accum; ++i) {
|
||||
accum_t a = *crc ^ ((accum_t*)data)[i];
|
||||
for(j = *crc = 0; j < sizeof(accum_t); ++j)
|
||||
*crc ^= wtable[(j << 8) + (uint8_t)(a >> 8*j)];
|
||||
}
|
||||
for(i = n_accum*sizeof(accum_t); i < n_bytes; ++i)
|
||||
*crc = table[(uint8_t)*crc ^ ((uint8_t*)data)[i]] ^ *crc >> 8;
|
||||
}
|
||||
|
||||
u_int32_t ethernet_crc32(const void* data, size_t n_bytes) {
|
||||
u_int32_t crc = 0;
|
||||
__crc32(data, n_bytes, &crc);
|
||||
return crc;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* ndpi_util.h
|
||||
*
|
||||
* Copyright (C) 2011-16 - ntop.org
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This module contains routines to help setup a simple nDPI program.
|
||||
*
|
||||
* If you concern about performance or have to integrate nDPI in your
|
||||
* application, you could need to reimplement them yourself.
|
||||
*
|
||||
* WARNING: this API is unstable! Use it at your own risk!
|
||||
*/
|
||||
#ifndef __NDPI_UTIL_H__
|
||||
#define __NDPI_UTIL_H__
|
||||
|
||||
#include <pcap.h>
|
||||
|
||||
#define MAX_NUM_READER_THREADS 16
|
||||
#define IDLE_SCAN_PERIOD 10 /* msec (use TICK_RESOLUTION = 1000) */
|
||||
#define MAX_IDLE_TIME 30000
|
||||
#define IDLE_SCAN_BUDGET 1024
|
||||
#define NUM_ROOTS 512
|
||||
#define MAX_EXTRA_PACKETS_TO_CHECK 7
|
||||
#define MAX_NDPI_FLOWS 200000000
|
||||
#define TICK_RESOLUTION 1000
|
||||
#define MAX_NUM_IP_ADDRESS 5 /* len of ip address array */
|
||||
#define UPDATED_TREE 1
|
||||
#define AGGRESSIVE_PERCENT 95.00
|
||||
#define DIR_SRC 10
|
||||
#define DIR_DST 20
|
||||
#define PORT_ARRAY_SIZE 20
|
||||
#define HOST_ARRAY_SIZE 20
|
||||
#define FLOWS_PACKETS_THRESHOLD 0.9
|
||||
#define FLOWS_PERCENT_THRESHOLD 1.0
|
||||
#define FLOWS_PERCENT_THRESHOLD_2 0.2
|
||||
#define FLOWS_THRESHOLD 1000
|
||||
#define PKTS_PERCENT_THRESHOLD 0.1
|
||||
#define MAX_TABLE_SIZE_1 4096
|
||||
#define MAX_TABLE_SIZE_2 8192
|
||||
#define INIT_VAL -1
|
||||
|
||||
// flow tracking
|
||||
typedef struct ndpi_flow_info {
|
||||
u_int32_t hashval;
|
||||
u_int32_t src_ip;
|
||||
u_int32_t dst_ip;
|
||||
u_int16_t src_port;
|
||||
u_int16_t dst_port;
|
||||
u_int8_t detection_completed, protocol, bidirectional, check_extra_packets;
|
||||
u_int16_t vlan_id;
|
||||
struct ndpi_flow_struct *ndpi_flow;
|
||||
char src_name[48], dst_name[48];
|
||||
u_int8_t ip_version;
|
||||
u_int64_t last_seen;
|
||||
u_int64_t src2dst_bytes, dst2src_bytes;
|
||||
u_int32_t src2dst_packets, dst2src_packets;
|
||||
|
||||
// result only, not used for flow identification
|
||||
ndpi_protocol detected_protocol;
|
||||
|
||||
char info[96];
|
||||
char host_server_name[192];
|
||||
char bittorent_hash[41];
|
||||
|
||||
struct {
|
||||
char client_info[48], server_info[48];
|
||||
} ssh_ssl;
|
||||
|
||||
void *src_id, *dst_id;
|
||||
} ndpi_flow_info_t;
|
||||
|
||||
|
||||
// flow statistics info
|
||||
typedef struct ndpi_stats {
|
||||
u_int32_t guessed_flow_protocols;
|
||||
u_int64_t raw_packet_count;
|
||||
u_int64_t ip_packet_count;
|
||||
u_int64_t total_wire_bytes, total_ip_bytes, total_discarded_bytes;
|
||||
u_int64_t protocol_counter[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int64_t protocol_counter_bytes[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int32_t protocol_flows[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int32_t ndpi_flow_count;
|
||||
u_int64_t tcp_count, udp_count;
|
||||
u_int64_t mpls_count, pppoe_count, vlan_count, fragmented_count;
|
||||
u_int64_t packet_len[6];
|
||||
u_int16_t max_packet_len;
|
||||
} ndpi_stats_t;
|
||||
|
||||
|
||||
// flow preferences
|
||||
typedef struct ndpi_workflow_prefs {
|
||||
u_int8_t decode_tunnels;
|
||||
u_int8_t quiet_mode;
|
||||
u_int32_t num_roots;
|
||||
u_int32_t max_ndpi_flows;
|
||||
} ndpi_workflow_prefs_t;
|
||||
|
||||
struct ndpi_workflow;
|
||||
|
||||
/** workflow, flow, user data */
|
||||
typedef void (*ndpi_workflow_callback_ptr) (struct ndpi_workflow *, struct ndpi_flow_info *, void *);
|
||||
|
||||
|
||||
// workflow main structure
|
||||
typedef struct ndpi_workflow {
|
||||
u_int64_t last_time;
|
||||
|
||||
struct ndpi_workflow_prefs prefs;
|
||||
struct ndpi_stats stats;
|
||||
|
||||
ndpi_workflow_callback_ptr __flow_detected_callback;
|
||||
void * __flow_detected_udata;
|
||||
ndpi_workflow_callback_ptr __flow_giveup_callback;
|
||||
void * __flow_giveup_udata;
|
||||
|
||||
/* outside referencies */
|
||||
pcap_t *pcap_handle;
|
||||
|
||||
/* allocated by prefs */
|
||||
void **ndpi_flows_root;
|
||||
struct ndpi_detection_module_struct *ndpi_struct;
|
||||
u_int32_t num_allocated_flows;
|
||||
} ndpi_workflow_t;
|
||||
|
||||
|
||||
/* TODO: remove wrappers parameters and use ndpi global, when their initialization will be fixed... */
|
||||
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs, pcap_t * pcap_handle);
|
||||
|
||||
|
||||
/* workflow main free function */
|
||||
void ndpi_workflow_free(struct ndpi_workflow * workflow);
|
||||
|
||||
|
||||
/** Free flow_info ndpi support structures but not the flow_info itself
|
||||
*
|
||||
* TODO remove! Half freeing things is bad!
|
||||
*/
|
||||
void ndpi_free_flow_info_half(struct ndpi_flow_info *flow);
|
||||
|
||||
|
||||
/* Process a packet and update the workflow */
|
||||
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||
const struct pcap_pkthdr *header,
|
||||
const u_char *packet);
|
||||
|
||||
|
||||
/* flow callbacks for complete detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_detected_callback = callback;
|
||||
workflow->__flow_detected_udata = udata;
|
||||
}
|
||||
|
||||
/* flow callbacks for sufficient detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_giveup_callback = callback;
|
||||
workflow->__flow_giveup_udata = udata;
|
||||
}
|
||||
|
||||
/* compare two nodes in workflow */
|
||||
int ndpi_workflow_node_cmp(const void *a, const void *b);
|
||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow);
|
||||
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
||||
void ndpi_flow_info_freer(void *node);
|
||||
#endif
|
||||
+5
-39
@@ -10,49 +10,15 @@ tcp:3000@ntop
|
||||
# Format:
|
||||
# host:"<value>",host:"<value>",.....@<subproto>
|
||||
|
||||
host:"disneyplus.com",host:"cdn.registerdisney.go.com",host:"disney-portal.my.onetrust.com",host:"disneyplus.bn5x.net",host:"disney-plus.net"@DisneyPlus
|
||||
host:"*.lvlt.dash.us.aiv-cdn.net.c.footprint.net"@AmazonVideo
|
||||
host:"api-global.netflix.com"@Netflix
|
||||
host:"googlesyndication.com"@Google
|
||||
host:"venere.com"@Venere
|
||||
host:"kataweb.it",host:"repubblica.it"@Repubblica
|
||||
host:"ntop"@ntop
|
||||
# IP based Subprotocols
|
||||
# Format:
|
||||
# ip:<value>,ip:<value>,.....@<subproto>
|
||||
|
||||
#
|
||||
# NOTES
|
||||
# 1) the port of a custom protocol is optional but if
|
||||
# specified it must match the port.
|
||||
# 2) you can specify up to 1 port per IP address
|
||||
# 3) if you specify a custom ip:<IP>:<PORT> rule,
|
||||
# even if the <PORT> doesn't match the <IP>
|
||||
# (if best match during the search) will
|
||||
# have priority as best match. Example if
|
||||
# you specify a <Google IP>:<port 9999> and
|
||||
# in your traffic have match for such IP but
|
||||
# with a port other than 9999, the IP address
|
||||
# begin a best match will hve preference over
|
||||
# <Google IP> so this protocol will not be
|
||||
# detected as <L7 proto>.Google but only
|
||||
# as <L7 proto>
|
||||
#
|
||||
ip:213.75.170.11@CustomProtocol
|
||||
|
||||
ip:213.75.170.11/32:443@CustomProtocol
|
||||
ip:8.248.73.247:443@AmazonPrime
|
||||
ip:54.80.47.130@AmazonPrime
|
||||
|
||||
#
|
||||
# Risk Exceptions
|
||||
#
|
||||
# ip_risk_mask: used to mask flow risks for IP addresses
|
||||
# host_risk_mask: used to mask exceptions for domain names and hosts
|
||||
#
|
||||
# Syntax: <name>=<64 bit mask to be put in AND with the risk
|
||||
#
|
||||
# For IPs, the flow risk is put in AND (source IP mask OR destination IP mask)
|
||||
# For Flows with a hostname (e.g. TLS) the risk is also put in AND with the host_risk_mask
|
||||
#ip_risk_mask:192.168.1.0/24=0
|
||||
#ip_risk_mask:10.196.157.228=0
|
||||
host_risk_mask:".home"=0
|
||||
|
||||
|
||||
# Custom certification autorities we trust
|
||||
trusted_issuer_dn:"CN=813845657003339838, O=Code42, OU=TEST, ST=MN, C=US"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,367 +0,0 @@
|
||||
/*
|
||||
* ndpi_util.h
|
||||
*
|
||||
* Copyright (C) 2011-22 - ntop.org
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This module contains routines to help setup a simple nDPI program.
|
||||
*
|
||||
* If you concern about performance or have to integrate nDPI in your
|
||||
* application, you could need to reimplement them yourself.
|
||||
*
|
||||
* WARNING: this API is just a demo od nDPI usage: Use it at your own risk!
|
||||
*/
|
||||
#ifndef __NDPI_UTIL_H__
|
||||
#define __NDPI_UTIL_H__
|
||||
|
||||
#include "../src/lib/third_party/include/uthash.h"
|
||||
#include <pcap.h>
|
||||
#include "ndpi_includes.h"
|
||||
#include "ndpi_classify.h"
|
||||
#include "ndpi_typedefs.h"
|
||||
|
||||
#ifdef USE_DPDK
|
||||
#include <rte_eal.h>
|
||||
#include <rte_ether.h>
|
||||
#include <rte_ethdev.h>
|
||||
#include <rte_cycles.h>
|
||||
#include <rte_lcore.h>
|
||||
#include <rte_mbuf.h>
|
||||
|
||||
#define RX_RING_SIZE 128
|
||||
#define TX_RING_SIZE 512
|
||||
#define NUM_MBUFS 8191
|
||||
#define MBUF_CACHE_SIZE 250
|
||||
#define BURST_SIZE 32
|
||||
#define PREFETCH_OFFSET 3
|
||||
|
||||
extern int dpdk_port_init(int port, struct rte_mempool *mbuf_pool);
|
||||
extern int dpdk_port_deinit(int port);
|
||||
#endif
|
||||
|
||||
#define PLEN_MAX 1504
|
||||
#define PLEN_BIN_LEN 32
|
||||
#define PLEN_NUM_BINS 48 /* 47*32 = 1504 */
|
||||
#define MAX_NUM_BIN_PKTS 256
|
||||
|
||||
/* ETTA Spec defiintions for feature readiness */
|
||||
#define ETTA_MIN_PACKETS 10
|
||||
#define ETTA_MIN_OCTETS 4000
|
||||
/** maximum line length */
|
||||
#define LINEMAX 512
|
||||
#define MAX_BYTE_COUNT_ARRAY_LENGTH 256
|
||||
#define MAX_NUM_PKTS 10
|
||||
|
||||
#define MAX_NUM_READER_THREADS 16
|
||||
#define IDLE_SCAN_PERIOD 10 /* msec (use TICK_RESOLUTION = 1000) */
|
||||
#define MAX_IDLE_TIME 30000
|
||||
#define IDLE_SCAN_BUDGET 1024
|
||||
#define NUM_ROOTS 512
|
||||
#define MAX_EXTRA_PACKETS_TO_CHECK 7
|
||||
#define MAX_NDPI_FLOWS 200000000
|
||||
#define TICK_RESOLUTION 1000
|
||||
#define MAX_NUM_IP_ADDRESS 5 /* len of ip address array */
|
||||
#define UPDATED_TREE 1
|
||||
#define AGGRESSIVE_PERCENT 95.00
|
||||
#define DIR_SRC 10
|
||||
#define DIR_DST 20
|
||||
#define PORT_ARRAY_SIZE 20
|
||||
#define HOST_ARRAY_SIZE 20
|
||||
#define FLOWS_PACKETS_THRESHOLD 0.9
|
||||
#define FLOWS_PERCENT_THRESHOLD 1.0
|
||||
#define FLOWS_PERCENT_THRESHOLD_2 0.2
|
||||
#define FLOWS_THRESHOLD 1000
|
||||
#define PKTS_PERCENT_THRESHOLD 0.1
|
||||
#define MAX_TABLE_SIZE_1 4096
|
||||
#define MAX_TABLE_SIZE_2 8192
|
||||
#define INIT_VAL -1
|
||||
|
||||
|
||||
// inner hash table (ja3 -> security state)
|
||||
typedef struct ndpi_ja3_info {
|
||||
char * ja3;
|
||||
ndpi_cipher_weakness unsafe_cipher;
|
||||
UT_hash_handle hh;
|
||||
} ndpi_ja3_info;
|
||||
|
||||
// external hash table (host ip -> <ip string, hash table ja3c, hash table ja3s>)
|
||||
// used to aggregate ja3 fingerprints by hosts
|
||||
typedef struct ndpi_host_ja3_fingerprints {
|
||||
u_int32_t ip;
|
||||
char *ip_string;
|
||||
char *dns_name;
|
||||
ndpi_ja3_info *host_client_info_hasht;
|
||||
ndpi_ja3_info *host_server_info_hasht;
|
||||
|
||||
UT_hash_handle hh;
|
||||
} ndpi_host_ja3_fingerprints;
|
||||
|
||||
|
||||
//inner hash table
|
||||
typedef struct ndpi_ip_dns{
|
||||
u_int32_t ip;
|
||||
char *ip_string;
|
||||
char *dns_name; //server name if any;
|
||||
UT_hash_handle hh;
|
||||
} ndpi_ip_dns;
|
||||
|
||||
//hash table ja3 -> <host, ip, security>, used to aggregate host by ja3 fingerprints
|
||||
typedef struct ndpi_ja3_fingerprints_host{
|
||||
char *ja3; //key
|
||||
ndpi_cipher_weakness unsafe_cipher;
|
||||
ndpi_ip_dns *ipToDNS_ht;
|
||||
UT_hash_handle hh;
|
||||
} ndpi_ja3_fingerprints_host;
|
||||
|
||||
struct flow_metrics {
|
||||
float entropy, average, stddev;
|
||||
};
|
||||
|
||||
struct ndpi_entropy {
|
||||
// Entropy fields
|
||||
u_int16_t src2dst_pkt_len[MAX_NUM_PKTS]; /*!< array of packet appdata lengths */
|
||||
pkt_timeval src2dst_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
|
||||
u_int16_t dst2src_pkt_len[MAX_NUM_PKTS]; /*!< array of packet appdata lengths */
|
||||
pkt_timeval dst2src_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
|
||||
pkt_timeval src2dst_start; /*!< first packet arrival time */
|
||||
pkt_timeval dst2src_start; /*!< first packet arrival time */
|
||||
u_int32_t src2dst_opackets; /*!< non-zero packet counts */
|
||||
u_int32_t dst2src_opackets; /*!< non-zero packet counts */
|
||||
u_int16_t src2dst_pkt_count; /*!< packet counts */
|
||||
u_int16_t dst2src_pkt_count; /*!< packet counts */
|
||||
u_int32_t src2dst_l4_bytes; /*!< packet counts */
|
||||
u_int32_t dst2src_l4_bytes; /*!< packet counts */
|
||||
u_int32_t src2dst_byte_count[MAX_BYTE_COUNT_ARRAY_LENGTH]; /*!< number of occurences of each byte */
|
||||
u_int32_t dst2src_byte_count[MAX_BYTE_COUNT_ARRAY_LENGTH]; /*!< number of occurences of each byte */
|
||||
u_int32_t src2dst_num_bytes;
|
||||
u_int32_t dst2src_num_bytes;
|
||||
double src2dst_bd_mean;
|
||||
double src2dst_bd_variance;
|
||||
double dst2src_bd_mean;
|
||||
double dst2src_bd_variance;
|
||||
float score;
|
||||
};
|
||||
|
||||
// flow tracking
|
||||
typedef struct ndpi_flow_info {
|
||||
u_int32_t flow_id;
|
||||
u_int32_t hashval;
|
||||
u_int32_t src_ip; /* network order */
|
||||
u_int32_t dst_ip; /* network order */
|
||||
u_int16_t src_port; /* network order */
|
||||
u_int16_t dst_port; /* network order */
|
||||
u_int8_t detection_completed, protocol, bidirectional, check_extra_packets;
|
||||
u_int16_t vlan_id;
|
||||
ndpi_packet_tunnel tunnel_type;
|
||||
struct ndpi_flow_struct *ndpi_flow;
|
||||
char src_name[48], dst_name[48];
|
||||
u_int8_t ip_version;
|
||||
u_int32_t cwr_count, src2dst_cwr_count, dst2src_cwr_count;
|
||||
u_int32_t ece_count, src2dst_ece_count, dst2src_ece_count;
|
||||
u_int32_t urg_count, src2dst_urg_count, dst2src_urg_count;
|
||||
u_int32_t ack_count, src2dst_ack_count, dst2src_ack_count;
|
||||
u_int32_t psh_count, src2dst_psh_count, dst2src_psh_count;
|
||||
u_int32_t syn_count, src2dst_syn_count, dst2src_syn_count;
|
||||
u_int32_t fin_count, src2dst_fin_count, dst2src_fin_count;
|
||||
u_int32_t rst_count, src2dst_rst_count, dst2src_rst_count;
|
||||
u_int32_t c_to_s_init_win, s_to_c_init_win;
|
||||
u_int64_t first_seen_ms, last_seen_ms;
|
||||
u_int64_t src2dst_bytes, dst2src_bytes;
|
||||
u_int64_t src2dst_goodput_bytes, dst2src_goodput_bytes;
|
||||
u_int32_t src2dst_packets, dst2src_packets;
|
||||
u_int32_t has_human_readeable_strings;
|
||||
char human_readeable_string_buffer[32];
|
||||
|
||||
// result only, not used for flow identification
|
||||
ndpi_protocol detected_protocol;
|
||||
ndpi_confidence_t confidence;
|
||||
|
||||
// Flow data analysis
|
||||
pkt_timeval src2dst_last_pkt_time, dst2src_last_pkt_time, flow_last_pkt_time;
|
||||
struct ndpi_analyze_struct *iat_c_to_s, *iat_s_to_c, *iat_flow,
|
||||
*pktlen_c_to_s, *pktlen_s_to_c;
|
||||
|
||||
char info[255];
|
||||
char flow_extra_info[16];
|
||||
char host_server_name[80]; /* Hostname/SNI */
|
||||
char *bittorent_hash;
|
||||
char *dhcp_fingerprint;
|
||||
char *dhcp_class_ident;
|
||||
ndpi_risk risk;
|
||||
|
||||
struct {
|
||||
u_int16_t ssl_version;
|
||||
char server_info[64],
|
||||
client_hassh[33], server_hassh[33], *server_names,
|
||||
*tls_alpn, *tls_supported_versions,
|
||||
*tls_issuerDN, *tls_subjectDN,
|
||||
ja3_client[33], ja3_server[33],
|
||||
sha1_cert_fingerprint[20];
|
||||
u_int8_t sha1_cert_fingerprint_set;
|
||||
struct tls_heuristics browser_heuristics;
|
||||
|
||||
struct {
|
||||
u_int16_t cipher_suite;
|
||||
char *esni;
|
||||
} encrypted_sni;
|
||||
|
||||
time_t notBefore, notAfter;
|
||||
u_int16_t server_cipher;
|
||||
ndpi_cipher_weakness client_unsafe_cipher, server_unsafe_cipher;
|
||||
} ssh_tls;
|
||||
|
||||
struct {
|
||||
char url[256], request_content_type[64], content_type[64], user_agent[256];
|
||||
u_int response_status_code;
|
||||
} http;
|
||||
|
||||
struct {
|
||||
char *username, *password;
|
||||
} telnet;
|
||||
|
||||
void *src_id, *dst_id;
|
||||
|
||||
struct ndpi_entropy *entropy;
|
||||
struct ndpi_entropy *last_entropy;
|
||||
|
||||
/* Payload lenght bins */
|
||||
#ifdef DIRECTION_BINS
|
||||
struct ndpi_bin payload_len_bin_src2dst, payload_len_bin_dst2src;
|
||||
#else
|
||||
struct ndpi_bin payload_len_bin;
|
||||
#endif
|
||||
} ndpi_flow_info_t;
|
||||
|
||||
|
||||
// flow statistics info
|
||||
typedef struct ndpi_stats {
|
||||
u_int32_t guessed_flow_protocols;
|
||||
u_int64_t raw_packet_count;
|
||||
u_int64_t ip_packet_count;
|
||||
u_int64_t total_wire_bytes, total_ip_bytes, total_discarded_bytes;
|
||||
u_int64_t protocol_counter[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int64_t protocol_counter_bytes[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int32_t protocol_flows[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int32_t ndpi_flow_count;
|
||||
u_int32_t flow_count[3];
|
||||
u_int64_t tcp_count, udp_count;
|
||||
u_int64_t mpls_count, pppoe_count, vlan_count, fragmented_count;
|
||||
u_int64_t packet_len[6];
|
||||
u_int16_t max_packet_len;
|
||||
u_int64_t dpi_packet_count[3];
|
||||
u_int64_t flow_confidence[NDPI_CONFIDENCE_MAX];
|
||||
} ndpi_stats_t;
|
||||
|
||||
|
||||
// flow preferences
|
||||
typedef struct ndpi_workflow_prefs {
|
||||
u_int8_t decode_tunnels;
|
||||
u_int8_t quiet_mode;
|
||||
u_int8_t ignore_vlanid;
|
||||
u_int32_t num_roots;
|
||||
u_int32_t max_ndpi_flows;
|
||||
} ndpi_workflow_prefs_t;
|
||||
|
||||
struct ndpi_workflow;
|
||||
|
||||
/** workflow, flow, user data */
|
||||
typedef void (*ndpi_workflow_callback_ptr) (struct ndpi_workflow *, struct ndpi_flow_info *, void *);
|
||||
|
||||
|
||||
// workflow main structure
|
||||
typedef struct ndpi_workflow {
|
||||
u_int64_t last_time;
|
||||
|
||||
struct ndpi_workflow_prefs prefs;
|
||||
struct ndpi_stats stats;
|
||||
|
||||
ndpi_workflow_callback_ptr __flow_detected_callback;
|
||||
void * __flow_detected_udata;
|
||||
ndpi_workflow_callback_ptr __flow_giveup_callback;
|
||||
void * __flow_giveup_udata;
|
||||
|
||||
/* outside referencies */
|
||||
pcap_t *pcap_handle;
|
||||
|
||||
/* allocated by prefs */
|
||||
void **ndpi_flows_root;
|
||||
struct ndpi_detection_module_struct *ndpi_struct;
|
||||
u_int32_t num_allocated_flows;
|
||||
} ndpi_workflow_t;
|
||||
|
||||
|
||||
/* TODO: remove wrappers parameters and use ndpi global, when their initialization will be fixed... */
|
||||
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs, pcap_t * pcap_handle);
|
||||
|
||||
|
||||
/* workflow main free function */
|
||||
void ndpi_workflow_free(struct ndpi_workflow * workflow);
|
||||
|
||||
|
||||
/** Free flow_info ndpi support structures but not the flow_info itself
|
||||
*
|
||||
* TODO remove! Half freeing things is bad!
|
||||
*/
|
||||
void ndpi_free_flow_info_half(struct ndpi_flow_info *flow);
|
||||
|
||||
|
||||
/* Process a packet and update the workflow */
|
||||
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||
const struct pcap_pkthdr *header,
|
||||
const u_char *packet,
|
||||
ndpi_risk *flow_risk,
|
||||
FILE * csv_fp);
|
||||
|
||||
int ndpi_is_datalink_supported(int datalink_type);
|
||||
|
||||
/* flow callbacks for complete detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_detected_callback = callback;
|
||||
workflow->__flow_detected_udata = udata;
|
||||
}
|
||||
|
||||
/* flow callbacks for sufficient detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_giveup_callback = callback;
|
||||
workflow->__flow_giveup_udata = udata;
|
||||
}
|
||||
|
||||
/* compare two nodes in workflow */
|
||||
int ndpi_workflow_node_cmp(const void *a, const void *b);
|
||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow, FILE * csv_fp);
|
||||
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
||||
void ndpi_flow_info_free_data(struct ndpi_flow_info *flow);
|
||||
void ndpi_flow_info_freer(void *node);
|
||||
const char* print_cipher_id(u_int32_t cipher);
|
||||
float ndpi_flow_get_byte_count_entropy(const uint32_t byte_count[256], unsigned int num_bytes);
|
||||
|
||||
extern int nDPI_LogLevel;
|
||||
|
||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
#define LOG(log_level, args...) \
|
||||
{ \
|
||||
if(log_level <= nDPI_LogLevel) \
|
||||
printf(args); \
|
||||
}
|
||||
#else
|
||||
#define LOG(...) {}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,11 +0,0 @@
|
||||
# https://www.spamhaus.org/statistics/tlds/
|
||||
.fail
|
||||
.viajes
|
||||
.exposed
|
||||
.london
|
||||
.work
|
||||
.gq
|
||||
.ml
|
||||
.surk
|
||||
.tk
|
||||
.xyz
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,52 +0,0 @@
|
||||
bin_PROGRAMS = fuzz_process_packet fuzz_process_packet_with_main fuzz_ndpi_reader fuzz_ndpi_reader_with_main
|
||||
|
||||
fuzz_process_packet_SOURCES = fuzz_process_packet.c
|
||||
fuzz_process_packet_CFLAGS =
|
||||
fuzz_process_packet_LDADD = ../src/lib/libndpi.a
|
||||
fuzz_process_packet_LDFLAGS = $(ADDITIONAL_LIBS) $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_process_packet_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_process_packet_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_process_packet_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_process_packet_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_process_packet_with_main_SOURCES = fuzz_process_packet.c
|
||||
fuzz_process_packet_with_main_CFLAGS = -DBUILD_MAIN
|
||||
fuzz_process_packet_with_main_LDADD = ../src/lib/libndpi.a
|
||||
fuzz_process_packet_with_main_LDFLAGS = $(ADDITIONAL_LIBS) $(LIBS)
|
||||
# force usage of CXX for linker
|
||||
fuzz_process_packet_with_main_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_process_packet_with_main_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ndpi_reader_SOURCES = fuzz_ndpi_reader.c
|
||||
fuzz_ndpi_reader_CFLAGS = -I../example/
|
||||
fuzz_ndpi_reader_LDADD = ../example/libndpiReader.a ../src/lib/libndpi.a
|
||||
fuzz_ndpi_reader_LDFLAGS = $(PCAP_LIB) $(ADDITIONAL_LIBS) $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_ndpi_reader_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ndpi_reader_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_ndpi_reader_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ndpi_reader_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ndpi_reader_with_main_SOURCES = fuzz_ndpi_reader.c
|
||||
fuzz_ndpi_reader_with_main_CFLAGS = -I../example/ -DBUILD_MAIN
|
||||
fuzz_ndpi_reader_with_main_LDADD = ../src/lib/libndpi.a
|
||||
fuzz_ndpi_reader_with_main_LDFLAGS = ../example/libndpiReader.a $(PCAP_LIB) $(ADDITIONAL_LIBS) $(LIBS)
|
||||
# force usage of CXX for linker
|
||||
fuzz_ndpi_reader_with_main_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ndpi_reader_with_main_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
# required for Google oss-fuzz
|
||||
# see https://github.com/google/oss-fuzz/tree/master/projects/ndpi
|
||||
testpcaps := $(wildcard ../tests/pcap/*.pcap*)
|
||||
|
||||
fuzz_ndpi_reader_seed_corpus.zip: $(testpcaps)
|
||||
zip -r fuzz_ndpi_reader_seed_corpus.zip $(testpcaps)
|
||||
@@ -1,175 +0,0 @@
|
||||
#include "reader_util.h"
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#include <pcap/pcap.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct ndpi_workflow_prefs *prefs = NULL;
|
||||
|
||||
int nDPI_LogLevel = 0;
|
||||
char *_debug_protocols = NULL;
|
||||
u_int32_t current_ndpi_memory = 0, max_ndpi_memory = 0;
|
||||
u_int8_t enable_protocol_guess = 1, enable_payload_analyzer = 0;
|
||||
u_int8_t enable_flow_stats = 0;
|
||||
u_int8_t human_readeable_string_len = 5;
|
||||
u_int8_t max_num_udp_dissected_pkts = 16 /* 8 is enough for most protocols, Signal requires more */, max_num_tcp_dissected_pkts = 80 /* due to telnet */;
|
||||
|
||||
int bufferToFile(const char * name, const uint8_t *Data, size_t Size) {
|
||||
FILE * fd;
|
||||
if (remove(name) != 0) {
|
||||
if (errno != ENOENT) {
|
||||
perror("remove failed");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
fd = fopen(name, "wb");
|
||||
if (fd == NULL) {
|
||||
perror("open failed");
|
||||
return -2;
|
||||
}
|
||||
if (fwrite (Data, 1, Size, fd) != Size) {
|
||||
fclose(fd);
|
||||
return -3;
|
||||
}
|
||||
fclose(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
pcap_t * pkts;
|
||||
const u_char *pkt;
|
||||
struct pcap_pkthdr *header;
|
||||
int r;
|
||||
char errbuf[PCAP_ERRBUF_SIZE];
|
||||
NDPI_PROTOCOL_BITMASK all;
|
||||
char * pcap_path = tempnam("/tmp", "fuzz-ndpi-reader");
|
||||
|
||||
if (prefs == NULL) {
|
||||
prefs = calloc(sizeof(struct ndpi_workflow_prefs), 1);
|
||||
if (prefs == NULL) {
|
||||
//should not happen
|
||||
return 1;
|
||||
}
|
||||
prefs->decode_tunnels = 1;
|
||||
prefs->num_roots = 16;
|
||||
prefs->max_ndpi_flows = 1024;
|
||||
prefs->quiet_mode = 0;
|
||||
}
|
||||
bufferToFile(pcap_path, Data, Size);
|
||||
|
||||
pkts = pcap_open_offline(pcap_path, errbuf);
|
||||
if (pkts == NULL) {
|
||||
remove(pcap_path);
|
||||
free(pcap_path);
|
||||
return 0;
|
||||
}
|
||||
if (ndpi_is_datalink_supported(pcap_datalink(pkts)) == 0)
|
||||
{
|
||||
/* Do not fail if the datalink type is not supported (may happen often during fuzzing). */
|
||||
pcap_close(pkts);
|
||||
remove(pcap_path);
|
||||
free(pcap_path);
|
||||
return 0;
|
||||
}
|
||||
struct ndpi_workflow * workflow = ndpi_workflow_init(prefs, pkts);
|
||||
// enable all protocols
|
||||
NDPI_BITMASK_SET_ALL(all);
|
||||
ndpi_set_protocol_detection_bitmask2(workflow->ndpi_struct, &all);
|
||||
memset(workflow->stats.protocol_counter, 0,
|
||||
sizeof(workflow->stats.protocol_counter));
|
||||
memset(workflow->stats.protocol_counter_bytes, 0,
|
||||
sizeof(workflow->stats.protocol_counter_bytes));
|
||||
memset(workflow->stats.protocol_flows, 0,
|
||||
sizeof(workflow->stats.protocol_flows));
|
||||
ndpi_finalize_initialization(workflow->ndpi_struct);
|
||||
|
||||
header = NULL;
|
||||
r = pcap_next_ex(pkts, &header, &pkt);
|
||||
while (r > 0) {
|
||||
if(header->caplen >= 42 /* ARP+ size */) {
|
||||
/* allocate an exact size buffer to check overflows */
|
||||
uint8_t *packet_checked = malloc(header->caplen);
|
||||
|
||||
if(packet_checked) {
|
||||
ndpi_risk flow_risk;
|
||||
|
||||
memcpy(packet_checked, pkt, header->caplen);
|
||||
ndpi_workflow_process_packet(workflow, header, packet_checked, &flow_risk, NULL);
|
||||
free(packet_checked);
|
||||
}
|
||||
}
|
||||
|
||||
r = pcap_next_ex(pkts, &header, &pkt);
|
||||
}
|
||||
ndpi_workflow_free(workflow);
|
||||
pcap_close(pkts);
|
||||
|
||||
remove(pcap_path);
|
||||
free(pcap_path);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef BUILD_MAIN
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
FILE * pcap_file;
|
||||
long pcap_file_size;
|
||||
uint8_t * pcap_buffer;
|
||||
int test_retval;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s: [pcap-file]\n",
|
||||
(argc > 0 ? argv[0] : "fuzz_ndpi_reader_with_main"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
pcap_file = fopen(argv[1], "r");
|
||||
if (pcap_file == NULL) {
|
||||
perror("fopen failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fseek(pcap_file, 0, SEEK_END) != 0) {
|
||||
perror("fseek(SEEK_END) failed");
|
||||
fclose(pcap_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pcap_file_size = ftell(pcap_file);
|
||||
if (pcap_file_size < 0) {
|
||||
perror("ftell failed");
|
||||
fclose(pcap_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fseek(pcap_file, 0, SEEK_SET) != 0) {
|
||||
perror("fseek(0, SEEK_SET) failed");
|
||||
fclose(pcap_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pcap_buffer = malloc(pcap_file_size);
|
||||
if (pcap_buffer == NULL) {
|
||||
perror("malloc failed");
|
||||
fclose(pcap_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fread(pcap_buffer, sizeof(*pcap_buffer), pcap_file_size, pcap_file) != (size_t)pcap_file_size) {
|
||||
perror("fread failed");
|
||||
fclose(pcap_file);
|
||||
free(pcap_buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
test_retval = LLVMFuzzerTestOneInput(pcap_buffer, pcap_file_size);
|
||||
fclose(pcap_file);
|
||||
free(pcap_buffer);
|
||||
|
||||
return test_retval;
|
||||
}
|
||||
#endif
|
||||
@@ -1,90 +0,0 @@
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct ndpi_detection_module_struct *ndpi_info_mod = NULL;
|
||||
|
||||
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||
uint8_t protocol_was_guessed;
|
||||
|
||||
if (ndpi_info_mod == NULL) {
|
||||
ndpi_info_mod = ndpi_init_detection_module(ndpi_enable_ja3_plus);
|
||||
NDPI_PROTOCOL_BITMASK all, debug_bitmask;
|
||||
NDPI_BITMASK_SET_ALL(all);
|
||||
NDPI_BITMASK_SET_ALL(debug_bitmask);
|
||||
ndpi_set_protocol_detection_bitmask2(ndpi_info_mod, &all);
|
||||
ndpi_set_log_level(ndpi_info_mod, 4);
|
||||
ndpi_set_debug_bitmask(ndpi_info_mod, debug_bitmask);
|
||||
ndpi_finalize_initialization(ndpi_info_mod);
|
||||
}
|
||||
|
||||
struct ndpi_flow_struct *ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT);
|
||||
memset(ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
|
||||
ndpi_detection_process_packet(ndpi_info_mod, ndpi_flow, Data, Size, 0);
|
||||
ndpi_detection_giveup(ndpi_info_mod, ndpi_flow, 1, &protocol_was_guessed);
|
||||
ndpi_free_flow(ndpi_flow);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef BUILD_MAIN
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
FILE * data_file;
|
||||
long data_file_size;
|
||||
uint8_t * data_buffer;
|
||||
int test_retval;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s: [data-file]\n",
|
||||
(argc > 0 ? argv[0] : "fuzz_process_packet_with_main"));
|
||||
return 1;
|
||||
}
|
||||
|
||||
data_file = fopen(argv[1], "r");
|
||||
if (data_file == NULL) {
|
||||
perror("fopen failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fseek(data_file, 0, SEEK_END) != 0) {
|
||||
perror("fseek(SEEK_END) failed");
|
||||
fclose(data_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
data_file_size = ftell(data_file);
|
||||
if (data_file_size < 0) {
|
||||
perror("ftell failed");
|
||||
fclose(data_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fseek(data_file, 0, SEEK_SET) != 0) {
|
||||
perror("fseek(0, SEEK_SET) failed");
|
||||
fclose(data_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
data_buffer = malloc(data_file_size);
|
||||
if (data_buffer == NULL) {
|
||||
perror("malloc failed");
|
||||
fclose(data_file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fread(data_buffer, sizeof(*data_buffer), data_file_size, data_file) != (size_t)data_file_size) {
|
||||
perror("fread failed");
|
||||
fclose(data_file);
|
||||
free(data_buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
test_retval = LLVMFuzzerTestOneInput(data_buffer, data_file_size);
|
||||
fclose(data_file);
|
||||
free(data_buffer);
|
||||
|
||||
return test_retval;
|
||||
}
|
||||
#endif
|
||||
+2
-2
@@ -6,5 +6,5 @@ includedir=@includedir@
|
||||
Name: libndpi
|
||||
Description: deep packet inspection library
|
||||
Version: @VERSION@
|
||||
Libs: -L${libdir} -lndpi @ADDITIONAL_LIBS@
|
||||
Cflags: -I${includedir}/ndpi
|
||||
Libs: -L${libdir} -lndpi
|
||||
Cflags: -I${includedir}/libndpi-@VERSION@
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
ndpi_dump_protocols
|
||||
ndpi_strnstr
|
||||
ndpi_detection_giveup
|
||||
ndpi_get_proto_name
|
||||
ndpi_free
|
||||
ndpi_flow_free
|
||||
ndpi_guess_undetected_protocol
|
||||
ndpi_tfind
|
||||
ndpi_tsearch
|
||||
ndpi_set_protocol_detection_bitmask2
|
||||
ndpi_detection_get_sizeof_ndpi_id_struct
|
||||
ndpi_detection_get_sizeof_ndpi_flow_struct
|
||||
ndpi_load_protocols_file
|
||||
ndpi_tdestroy
|
||||
ndpi_exit_detection_module
|
||||
ndpi_l4_detection_process_packet
|
||||
ndpi_detection_process_packet
|
||||
ndpi_twalk
|
||||
ndpi_tdelete
|
||||
ndpi_revision
|
||||
ndpi_init_detection_module
|
||||
ndpi_get_num_supported_protocols
|
||||
ndpi_set_proto_defaults
|
||||
ndpi_get_protocol_id
|
||||
ndpi_find_port_based_protocol
|
||||
ndpi_get_http_method
|
||||
ndpi_get_http_url
|
||||
ndpi_get_http_content_type
|
||||
ndpi_free_flow
|
||||
ndpi_get_proto_breed
|
||||
ndpi_get_proto_breed_name
|
||||
ndpi_get_proto_by_id
|
||||
ndpi_get_proto_by_name
|
||||
ndpi_get_protocol_id_master_proto
|
||||
ndpi_guess_protocol_id
|
||||
ndpi_protocol2name
|
||||
ndpi_get_lower_proto
|
||||
ndpi_is_proto
|
||||
ndpi_malloc
|
||||
ndpi_calloc
|
||||
ndpi_set_detected_protocol
|
||||
ndpi_match_string_subprotocol
|
||||
ndpi_init_automa
|
||||
ndpi_free_automa
|
||||
ndpi_add_string_value_to_automa
|
||||
ndpi_add_string_to_automa
|
||||
ndpi_finalize_automa
|
||||
ndpi_match_string
|
||||
ndpi_match_string_id
|
||||
set_ndpi_malloc
|
||||
set_ndpi_flow_malloc
|
||||
set_ndpi_free
|
||||
set_ndpi_flow_free
|
||||
set_ndpi_debug_function
|
||||
ndpi_category_str
|
||||
ndpi_get_proto_category
|
||||
ndpi_netbios_name_interpret
|
||||
ndpi_category_set_name
|
||||
ndpi_category_get_name
|
||||
ndpi_is_custom_category
|
||||
ndpi_is_subprotocol_informative
|
||||
@@ -1,53 +0,0 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
#serial 6
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
+115
-153
@@ -1,5 +1,5 @@
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
@@ -14,24 +14,20 @@
|
||||
# flags that are needed. (The user can also force certain compiler
|
||||
# flags/libs to be tested by setting these environment variables.)
|
||||
#
|
||||
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
|
||||
# needed for multi-threaded programs (defaults to the value of CC
|
||||
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
|
||||
# special cc_r/CC_r compiler alias.)
|
||||
# Also sets PTHREAD_CC to any special C compiler that is needed for
|
||||
# multi-threaded programs (defaults to the value of CC otherwise). (This
|
||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also to link with them as well. For example, you might link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threaded programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
|
||||
# CC="$PTHREAD_CC"
|
||||
# CXX="$PTHREAD_CXX"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
|
||||
@@ -59,7 +55,6 @@
|
||||
#
|
||||
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
|
||||
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
|
||||
# Copyright (c) 2019 Marc Stevens <marc.stevens@cwi.nl>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
@@ -72,7 +67,7 @@
|
||||
# Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
# with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
# gives unlimited permission to copy, distribute and modify the configure
|
||||
@@ -87,7 +82,7 @@
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 31
|
||||
#serial 23
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
@@ -109,7 +104,6 @@ if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_LIBS="$LIBS"
|
||||
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
|
||||
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
|
||||
@@ -129,12 +123,10 @@ fi
|
||||
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
|
||||
# libraries is broken (non-POSIX).
|
||||
|
||||
# Create a list of thread flags to try. Items with a "," contain both
|
||||
# C compiler flags (before ",") and linker flags (after ","). Other items
|
||||
# starting with a "-" are C compiler flags, and remaining items are
|
||||
# library names, except for "none" which indicates that we try without
|
||||
# any flags at all, and "pthread-config" which is a program returning
|
||||
# the flags for the Pth emulation library.
|
||||
# Create a list of thread flags to try. Items starting with a "-" are
|
||||
# C compiler flags, and other items are library names, except for "none"
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
@@ -202,47 +194,14 @@ case $host_os in
|
||||
# that too in a future libc.) So we'll check first for the
|
||||
# standard Solaris way of linking pthreads (-mt -lpthread).
|
||||
|
||||
ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
|
||||
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Are we compiling with Clang?
|
||||
|
||||
AC_CACHE_CHECK([whether $CC is Clang],
|
||||
[ax_cv_PTHREAD_CLANG],
|
||||
[ax_cv_PTHREAD_CLANG=no
|
||||
# Note that Autoconf sets GCC=yes for Clang as well as GCC
|
||||
if test "x$GCC" = "xyes"; then
|
||||
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
|
||||
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
|
||||
# if defined(__clang__) && defined(__llvm__)
|
||||
AX_PTHREAD_CC_IS_CLANG
|
||||
# endif
|
||||
],
|
||||
[ax_cv_PTHREAD_CLANG=yes])
|
||||
fi
|
||||
])
|
||||
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
||||
|
||||
|
||||
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
||||
|
||||
# Note that for GCC and Clang -pthread generally implies -lpthread,
|
||||
# except when -nostdlib is passed.
|
||||
# This is problematic using libtool to build C++ shared libraries with pthread:
|
||||
# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
|
||||
# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
|
||||
# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
|
||||
# To solve this, first try -pthread together with -lpthread for GCC
|
||||
|
||||
AS_IF([test "x$GCC" = "xyes"],
|
||||
[ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
|
||||
|
||||
# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
|
||||
|
||||
AS_IF([test "x$ax_pthread_clang" = "xyes"],
|
||||
[ax_pthread_flags="-pthread,-lpthread -pthread"])
|
||||
|
||||
[ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
|
||||
|
||||
# The presence of a feature test macro requesting re-entrant function
|
||||
# definitions is, on some systems, a strong hint that pthreads support is
|
||||
@@ -265,6 +224,101 @@ AS_IF([test "x$ax_pthread_check_macro" = "x--"],
|
||||
[ax_pthread_check_cond=0],
|
||||
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
|
||||
|
||||
# Are we compiling with Clang?
|
||||
|
||||
AC_CACHE_CHECK([whether $CC is Clang],
|
||||
[ax_cv_PTHREAD_CLANG],
|
||||
[ax_cv_PTHREAD_CLANG=no
|
||||
# Note that Autoconf sets GCC=yes for Clang as well as GCC
|
||||
if test "x$GCC" = "xyes"; then
|
||||
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
|
||||
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
|
||||
# if defined(__clang__) && defined(__llvm__)
|
||||
AX_PTHREAD_CC_IS_CLANG
|
||||
# endif
|
||||
],
|
||||
[ax_cv_PTHREAD_CLANG=yes])
|
||||
fi
|
||||
])
|
||||
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
||||
|
||||
ax_pthread_clang_warning=no
|
||||
|
||||
# Clang needs special handling, because older versions handle the -pthread
|
||||
# option in a rather... idiosyncratic way
|
||||
|
||||
if test "x$ax_pthread_clang" = "xyes"; then
|
||||
|
||||
# Clang takes -pthread; it has never supported any other flag
|
||||
|
||||
# (Note 1: This will need to be revisited if a system that Clang
|
||||
# supports has POSIX threads in a separate library. This tends not
|
||||
# to be the way of modern systems, but it's conceivable.)
|
||||
|
||||
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
||||
# to get POSIX threads support; the API is always present and
|
||||
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
||||
# -pthread does define _REENTRANT, and while the Darwin headers
|
||||
# ignore this macro, third-party headers might not.)
|
||||
|
||||
PTHREAD_CFLAGS="-pthread"
|
||||
PTHREAD_LIBS=
|
||||
|
||||
ax_pthread_ok=yes
|
||||
|
||||
# However, older versions of Clang make a point of warning the user
|
||||
# that, in an invocation where only linking and no compilation is
|
||||
# taking place, the -pthread option has no effect ("argument unused
|
||||
# during compilation"). They expect -pthread to be passed in only
|
||||
# when source code is being compiled.
|
||||
#
|
||||
# Problem is, this is at odds with the way Automake and most other
|
||||
# C build frameworks function, which is that the same flags used in
|
||||
# compilation (CFLAGS) are also used in linking. Many systems
|
||||
# supported by AX_PTHREAD require exactly this for POSIX threads
|
||||
# support, and in fact it is often not straightforward to specify a
|
||||
# flag that is used only in the compilation phase and not in
|
||||
# linking. Such a scenario is extremely rare in practice.
|
||||
#
|
||||
# Even though use of the -pthread flag in linking would only print
|
||||
# a warning, this can be a nuisance for well-run software projects
|
||||
# that build with -Werror. So if the active version of Clang has
|
||||
# this misfeature, we search for an option to squash it.
|
||||
|
||||
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
||||
# Create an alternate version of $ac_link that compiles and
|
||||
# links in two steps (.c -> .o, .o -> exe) instead of one
|
||||
# (.c -> exe), because the warning occurs only in the second
|
||||
# step
|
||||
ax_pthread_save_ac_link="$ac_link"
|
||||
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
||||
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
|
||||
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
||||
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
|
||||
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[ac_link="$ax_pthread_2step_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[break])
|
||||
])
|
||||
done
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
|
||||
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
||||
])
|
||||
|
||||
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
||||
no | unknown) ;;
|
||||
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
||||
esac
|
||||
|
||||
fi # $ax_pthread_clang = yes
|
||||
|
||||
if test "x$ax_pthread_ok" = "xno"; then
|
||||
for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||
@@ -274,10 +328,10 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
*,*)
|
||||
PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
|
||||
PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
|
||||
AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
|
||||
-mt,pthread)
|
||||
AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
|
||||
PTHREAD_CFLAGS="-mt"
|
||||
PTHREAD_LIBS="-lpthread"
|
||||
;;
|
||||
|
||||
-*)
|
||||
@@ -317,13 +371,7 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||
# if $ax_pthread_check_cond
|
||||
# error "$ax_pthread_check_macro must be defined"
|
||||
# endif
|
||||
static void *some_global = NULL;
|
||||
static void routine(void *a)
|
||||
{
|
||||
/* To avoid any unused-parameter or
|
||||
unused-but-set-parameter warning. */
|
||||
some_global = a;
|
||||
}
|
||||
static void routine(void *a) { a = 0; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
pthread_create(&th, 0, start_routine, 0);
|
||||
@@ -345,80 +393,6 @@ for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Clang needs special handling, because older versions handle the -pthread
|
||||
# option in a rather... idiosyncratic way
|
||||
|
||||
if test "x$ax_pthread_clang" = "xyes"; then
|
||||
|
||||
# Clang takes -pthread; it has never supported any other flag
|
||||
|
||||
# (Note 1: This will need to be revisited if a system that Clang
|
||||
# supports has POSIX threads in a separate library. This tends not
|
||||
# to be the way of modern systems, but it's conceivable.)
|
||||
|
||||
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
||||
# to get POSIX threads support; the API is always present and
|
||||
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
||||
# -pthread does define _REENTRANT, and while the Darwin headers
|
||||
# ignore this macro, third-party headers might not.)
|
||||
|
||||
# However, older versions of Clang make a point of warning the user
|
||||
# that, in an invocation where only linking and no compilation is
|
||||
# taking place, the -pthread option has no effect ("argument unused
|
||||
# during compilation"). They expect -pthread to be passed in only
|
||||
# when source code is being compiled.
|
||||
#
|
||||
# Problem is, this is at odds with the way Automake and most other
|
||||
# C build frameworks function, which is that the same flags used in
|
||||
# compilation (CFLAGS) are also used in linking. Many systems
|
||||
# supported by AX_PTHREAD require exactly this for POSIX threads
|
||||
# support, and in fact it is often not straightforward to specify a
|
||||
# flag that is used only in the compilation phase and not in
|
||||
# linking. Such a scenario is extremely rare in practice.
|
||||
#
|
||||
# Even though use of the -pthread flag in linking would only print
|
||||
# a warning, this can be a nuisance for well-run software projects
|
||||
# that build with -Werror. So if the active version of Clang has
|
||||
# this misfeature, we search for an option to squash it.
|
||||
|
||||
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
||||
# Create an alternate version of $ac_link that compiles and
|
||||
# links in two steps (.c -> .o, .o -> exe) instead of one
|
||||
# (.c -> exe), because the warning occurs only in the second
|
||||
# step
|
||||
ax_pthread_save_ac_link="$ac_link"
|
||||
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
||||
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
|
||||
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
||||
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
|
||||
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[ac_link="$ax_pthread_2step_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[break])
|
||||
])
|
||||
done
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
|
||||
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
||||
])
|
||||
|
||||
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
||||
no | unknown) ;;
|
||||
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
||||
esac
|
||||
|
||||
fi # $ax_pthread_clang = yes
|
||||
|
||||
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_pthread_ok" = "xyes"; then
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
@@ -464,8 +438,7 @@ if test "x$ax_pthread_ok" = "xyes"; then
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_PRIO_INHERIT;
|
||||
return i;]])],
|
||||
[[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
@@ -487,28 +460,18 @@ if test "x$ax_pthread_ok" = "xyes"; then
|
||||
[#handle absolute path differently from PATH based program lookup
|
||||
AS_CASE(["x$CC"],
|
||||
[x/*],
|
||||
[
|
||||
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
|
||||
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
|
||||
],
|
||||
[
|
||||
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
|
||||
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
|
||||
]
|
||||
)
|
||||
])
|
||||
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
|
||||
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
|
||||
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
|
||||
|
||||
AC_SUBST([PTHREAD_LIBS])
|
||||
AC_SUBST([PTHREAD_CFLAGS])
|
||||
AC_SUBST([PTHREAD_CC])
|
||||
AC_SUBST([PTHREAD_CXX])
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test "x$ax_pthread_ok" = "xyes"; then
|
||||
@@ -520,4 +483,3 @@ else
|
||||
fi
|
||||
AC_LANG_POP
|
||||
])dnl AX_PTHREAD
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
ubuntu
|
||||
@@ -1 +0,0 @@
|
||||
/usr/lib
|
||||
@@ -1,86 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libndpi
|
||||
PKG_VERSION:=4.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/ntop/nDPI/tar.gz/$(PKG_VERSION)?
|
||||
PKG_HASH:=dc9b291c7fde94edb45fb0f222e0d93c93f8d6d37f4efba20ebd9c655bfcedf9
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/nDPI-$(PKG_VERSION)
|
||||
|
||||
PKG_MAINTAINER:=Banglang Huang <banglang.huang@foxmail.com>, Toni Uhlig <matzeton@googlemail.com>
|
||||
PKG_LICENSE:=LGPL-3.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_REMOVE_FILES:=autogen.sh
|
||||
PKG_BUILD_DEPENDS:=libpcap
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/uclibc++.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_LIBNDPI_GCRYPT),)
|
||||
CONFIGURE_ARGS += --disable-gcrypt
|
||||
endif
|
||||
|
||||
define Package/libndpi
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Library for deep-packet inspection
|
||||
URL:=https://github.com/ntop/nDPI
|
||||
DEPENDS:=$(CXX_DEPENDS) +LIBNDPI_GCRYPT:libgcrypt +libpcap +libjson-c
|
||||
endef
|
||||
|
||||
define Package/libndpi/description
|
||||
nDPI is an open source LGPLv3 library for deep-packet inspection.
|
||||
Based on OpenDPI it includes ntop extensions.
|
||||
endef
|
||||
|
||||
define Package/libndpi/config
|
||||
config LIBNDPI_GCRYPT
|
||||
bool "GCrypt support"
|
||||
depends on PACKAGE_libndpi
|
||||
default n
|
||||
help
|
||||
This option enables QUIC client hello decryption.
|
||||
Disabled by default.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
$(PKG_UNPACK)
|
||||
$(Build/Patch)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/ndpi
|
||||
$(CP) $(PKG_BUILD_DIR)/src/include/*.h \
|
||||
$(1)/usr/include/ndpi/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_BUILD_DIR)/libndpi.pc \
|
||||
$(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libndpi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
|
||||
$(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
|
||||
$(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libndpi))
|
||||
@@ -1,86 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libndpi
|
||||
# Avoid a specfic version
|
||||
PKG_VERSION:=dev
|
||||
PKG_RELEASE:=1
|
||||
|
||||
# Compile it from soucre
|
||||
SOURCE_DIR:=/home/deri/openwrt-dependencies/nDPI/
|
||||
|
||||
PKG_MAINTAINER:=Luca Deri <deri@ntop.org>
|
||||
PKG_LICENSE:=LGPL-3.0-or-later
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_REMOVE_FILES:=autogen.sh
|
||||
PKG_BUILD_DEPENDS:=libpcap
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/uclibc++.mk
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
ifeq ($(CONFIG_LIBNDPI_GCRYPT),)
|
||||
CONFIGURE_ARGS += --disable-gcrypt
|
||||
endif
|
||||
|
||||
define Package/libndpi
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Library for deep-packet inspection
|
||||
URL:=https://github.com/ntop/nDPI
|
||||
DEPENDS:=$(CXX_DEPENDS) +LIBNDPI_GCRYPT:libgcrypt +libpcap +libjson-c
|
||||
endef
|
||||
|
||||
define Package/libndpi/description
|
||||
nDPI is an open source LGPLv3 library for deep-packet inspection.
|
||||
Based on OpenDPI it includes ntop extensions.
|
||||
endef
|
||||
|
||||
define Package/libndpi/config
|
||||
config LIBNDPI_GCRYPT
|
||||
bool "GCrypt support"
|
||||
depends on PACKAGE_libndpi
|
||||
default n
|
||||
help
|
||||
This option enables QUIC client hello decryption.
|
||||
Disabled by default.
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
cp -r $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
|
||||
$(PKG_UNPACK)
|
||||
$(Build/Patch)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
$(INSTALL_DIR) $(1)/usr/include/ndpi
|
||||
$(CP) $(PKG_BUILD_DIR)/src/include/*.h \
|
||||
$(1)/usr/include/ndpi/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
|
||||
$(1)/usr/lib/
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
|
||||
$(CP) $(PKG_BUILD_DIR)/libndpi.pc \
|
||||
$(1)/usr/lib/pkgconfig/
|
||||
endef
|
||||
|
||||
define Package/libndpi/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/
|
||||
$(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.so* \
|
||||
$(1)/usr/lib/
|
||||
$(INSTALL_DIR) $(1)/usr/bin/
|
||||
$(CP) $(PKG_BUILD_DIR)/example/ndpiReader \
|
||||
$(1)/usr/bin/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,libndpi))
|
||||
@@ -1,32 +0,0 @@
|
||||
Howto Compile libndpi on OpenWRT
|
||||
-------------------------------
|
||||
|
||||
cd myopenwrt_directory
|
||||
mkdir package/network/services/libndpi
|
||||
cd package/network/services/libndpi
|
||||
|
||||
# (a) Stable version
|
||||
ln -s ~/nDPI/packages/openwrt/Makefile .
|
||||
|
||||
# (b) Dev version
|
||||
cp ~/nDPI/packages/openwrt/Makefile.dev Makefile
|
||||
|
||||
cd myopenwrt_directory
|
||||
make menuconfig
|
||||
|
||||
Go under libraries and select
|
||||
|
||||
<M> libndpi.............................. nDPI Deep Packet Inspection Library
|
||||
|
||||
|
||||
Build Commands
|
||||
--------------
|
||||
|
||||
If you want to build just libndpi do:
|
||||
make -j1 V=s package/network/services/libndpi/clean
|
||||
make -j1 V=s package/network/services/libndpi/compile
|
||||
|
||||
Other Documents
|
||||
---------------
|
||||
https://openwrt.org/packages/pkgdata/libndpi
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# RPM Build Process
|
||||
#
|
||||
APPL=ndpi
|
||||
PLATFORM=@PLATFORM@
|
||||
GIT_REVISION=@GIT_REVISION@
|
||||
PACKAGE_VERSION=@PACKAGE_VERSION@
|
||||
PACKAGE=$(APPL)-$(PACKAGE_VERSION)-$(GIT_REVISION).$(PLATFORM).rpm
|
||||
DEV_PACKAGE=$(APPL)-dev-$(PACKAGE_VERSION)-$(GIT_REVISION).$(PLATFORM).rpm
|
||||
PACKAGE_PATH=$(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
|
||||
|
||||
package: build-rpm
|
||||
|
||||
build-src:
|
||||
cd ../..; ./autogen.sh; ./configure; make clean; make
|
||||
|
||||
cleanup-rpm:
|
||||
rm -rf $(HOME)/rpmbuild/BUILD/ndpi* $(HOME)/rpmbuild/SOURCES/ndpi*
|
||||
|
||||
build-rpm: build-src cleanup-rpm
|
||||
-rm -rf ndpi-@PACKAGE_VERSION@
|
||||
mkdir -p ndpi-@PACKAGE_VERSION@/packages
|
||||
cp ndpi.spec.in ndpi-@PACKAGE_VERSION@/packages
|
||||
cp ../../Makefile.* ../../libtool ../../configure* ../../config.* ../../install-sh ../../autogen.sh ndpi-@PACKAGE_VERSION@
|
||||
cp -rf ../../src ndpi-@PACKAGE_VERSION@
|
||||
cp ../../CHANGELOG.md ../../COPYING ndpi-@PACKAGE_VERSION@
|
||||
\rm -f ndpi-@PACKAGE_VERSION@/config.status
|
||||
mkdir -p $(HOME)/rpmbuild/SOURCES
|
||||
tar cvfz $(HOME)/rpmbuild/SOURCES/ndpi-@PACKAGE_VERSION@.tgz ndpi-@PACKAGE_VERSION@
|
||||
@rm -f $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
|
||||
@rpmbuild -bb ./$(APPL).spec --define "buildnumber $(GIT_REVISION)"
|
||||
@if [[ $EUID -ne 0 ]]; then @RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE); fi
|
||||
@if [[ $EUID -ne 0 ]]; then @RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(DEV_PACKAGE); fi
|
||||
@echo ""
|
||||
@echo "Package contents:"
|
||||
@rpm -qpl $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
|
||||
@echo "The package is now available in $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)"
|
||||
|
||||
Vendored
-4479
File diff suppressed because it is too large
Load Diff
@@ -1,63 +0,0 @@
|
||||
AC_INIT([Makefile.in], 1.0)
|
||||
|
||||
DATE=`date -R`
|
||||
KERNEL=`uname -r`
|
||||
PLATFORM=`uname -p`
|
||||
MACHINE=`uname -m`
|
||||
SHORT_MACHINE=`uname -m | cut -b1-3`
|
||||
|
||||
EXTN=""
|
||||
if test $MACHINE = "x86_64"; then
|
||||
EXTN="amd64"
|
||||
else
|
||||
if test $SHORT_MACHINE = "aar"; then
|
||||
EXTN="arm64"
|
||||
else
|
||||
if test $SHORT_MACHINE = "arm"; then
|
||||
EXTN="armhf"
|
||||
else
|
||||
if test $SHORT_MACHINE = "mip"; then
|
||||
EXTN="mips"
|
||||
else
|
||||
EXTN="i386"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
PACKAGE_VERSION=`../version.sh --release`
|
||||
MAJOR_RELEASE=`../version.sh --major-release`
|
||||
GIT_REVISION=`../version.sh --revision`
|
||||
|
||||
CENTOS_RELEASE=`cat /etc/centos-release | cut -d ' ' -f 3|cut -d '.' -f 1`
|
||||
if test $CENTOS_RELEASE = "release"; then
|
||||
CENTOS_RELEASE=`cat /etc/centos-release | cut -d ' ' -f 4|cut -d '.' -f 1`
|
||||
fi
|
||||
|
||||
RPM_SIGN_CMD="rpm --addsign"
|
||||
if test "$CENTOS_RELEASE" -ne 8; then
|
||||
RPM_SIGN_CMD="./rpm-sign.exp"
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([maxminddb], [MMDB_lookup_sockaddr])
|
||||
AC_HAVE_HEADERS(maxminddb.h)
|
||||
if test ".${ac_cv_lib_maxminddb_MMDB_lookup_sockaddr}" = ".yes" &&
|
||||
test ".${ac_cv_header_maxminddb_h}" = ".yes"; then
|
||||
GEOIP_DEP="libmaxminddb"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile ndpi.spec])
|
||||
|
||||
AC_SUBST(PACKAGE_VERSION)
|
||||
AC_SUBST(PLATFORM)
|
||||
AC_SUBST(GEOIP_DEP)
|
||||
AC_SUBST(MACHINE)
|
||||
AC_SUBST(EXTN)
|
||||
AC_SUBST(DATE)
|
||||
AC_SUBST(KERNEL)
|
||||
AC_SUBST(GIT_REVISION)
|
||||
AC_SUBST(MAJOR_RELEASE)
|
||||
AC_SUBST(RPM_SIGN_CMD)
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
Summary: L7 DPI library
|
||||
Name: ndpi
|
||||
Version: @PACKAGE_VERSION@
|
||||
Release: %{buildnumber}
|
||||
License: LGPL
|
||||
Group: Networking/Utilities
|
||||
URL: http://www.ntop.org/products/deep-packet-inspection/ndpi/
|
||||
Source: ndpi-%{version}.tgz
|
||||
Packager: Luca Deri <deri@ntop.org>
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
||||
%{?el8:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||
%{?el7:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils @GEOIP_DEP@ }
|
||||
AutoReqProv: no
|
||||
|
||||
%define debug_package %{nil}
|
||||
|
||||
# Make sure .build-id is not part of the package
|
||||
%define _build_id_links none
|
||||
|
||||
%description
|
||||
nDPI Open and Extensible LGPLv3 Deep Packet Inspection Library.
|
||||
|
||||
%package dev
|
||||
Summary: Header files and development libraries for %{name}
|
||||
Group: Development/Libraries
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description dev
|
||||
This package contains the header files and development libraries
|
||||
for %{name}. If you like to develop programs using %{name},
|
||||
you will need to install %{name}-dev.
|
||||
|
||||
%prep
|
||||
|
||||
%setup -q
|
||||
|
||||
# Execution order:
|
||||
# install: pre -> (copy) -> post
|
||||
# upgrade: pre -> (copy) -> post -> preun (old) -> (delete old) -> postun (old)
|
||||
# un-install: preun -> (delete) -> postun
|
||||
|
||||
%pre
|
||||
|
||||
%post
|
||||
|
||||
%build
|
||||
PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||
|
||||
%define includedir /usr/include/ndpi
|
||||
%{?el6:%define libdir /usr/lib}
|
||||
%{?el7:%define libdir /usr/lib}
|
||||
%{?el8:%define libdir /usr/lib64}
|
||||
%define bindir /usr/bin
|
||||
|
||||
%install
|
||||
PATH=/usr/bin:/bin:/usr/sbin:/sbin
|
||||
if [ -d $RPM_BUILD_ROOT ]; then
|
||||
\rm -rf $RPM_BUILD_ROOT
|
||||
fi
|
||||
mkdir -p $RPM_BUILD_ROOT%{includedir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{libdir}
|
||||
mkdir -p $RPM_BUILD_ROOT%{bindir}
|
||||
cd $HOME/nDPI; make DESTDIR=$RPM_BUILD_ROOT install;
|
||||
rm $RPM_BUILD_ROOT/usr/lib/libndpi.so
|
||||
rm $RPM_BUILD_ROOT/usr/lib/libndpi.so.?
|
||||
cd $RPM_BUILD_ROOT/usr/lib/; ln -s libndpi.so.@PACKAGE_VERSION@ libndpi.so.@MAJOR_RELEASE@; cd -
|
||||
cd $RPM_BUILD_ROOT/usr/lib/; ln -s libndpi.so.@PACKAGE_VERSION@ libndpi.so; cd -
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
|
||||
cp $HOME/nDPI/packages/etc/ld.so.conf.d/ndpi.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d
|
||||
rm -rf $RPM_BUILD_ROOT/usr/sbin/ndpi
|
||||
strip $RPM_BUILD_ROOT%{bindir}/*
|
||||
rm -fr %{buildroot}%{includedir}/ndpi_win32.h
|
||||
#sed -i -e "s/#include \"ndpi_win32.h\"//g" %{buildroot}%{includedir}/ndpi_main.h
|
||||
|
||||
%clean
|
||||
rm -fr $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
|
||||
/usr/lib/libndpi.so
|
||||
/usr/lib/libndpi.so.@MAJOR_RELEASE@
|
||||
/usr/lib/libndpi.so.@PACKAGE_VERSION@
|
||||
/usr/bin/ndpiReader
|
||||
/usr/share/ndpi/ndpiCustomCategory.txt
|
||||
/usr/share/ndpi/ndpiProtos.txt
|
||||
/etc/ld.so.conf.d/ndpi.conf
|
||||
%{libdir}/pkgconfig/libndpi.pc
|
||||
|
||||
%preun
|
||||
|
||||
%files dev
|
||||
%defattr(-,root,root,-)
|
||||
|
||||
%{includedir}
|
||||
/usr/lib/libndpi.a
|
||||
|
||||
%changelog
|
||||
* Mon Nov 19 2018 Alfredo Cardigliano <cardigliano@ntop.org> 2.5
|
||||
- Initial package version
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
### rpm-sign.exp -- Sign RPMs by sending the passphrase.
|
||||
|
||||
spawn rpm --addsign {*}$argv
|
||||
expect -exact "Enter pass phrase: "
|
||||
send -- "\r"
|
||||
expect eof
|
||||
|
||||
## end of rpm-sign.exp
|
||||
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# Change it according to your setup
|
||||
#
|
||||
NDPI_HOME=$(PWD)/../..
|
||||
NDPI_BUILD=${NDPI_HOME}/packages/ubuntu
|
||||
|
||||
all: clean ndpi
|
||||
|
||||
ndpi:
|
||||
\rm -rf ./usr ./debian/tmp ./debian/ndpi-dev
|
||||
mkdir -p ./usr/local ./debian/ndpi-dev
|
||||
mkdir -p ./usr/local/ndpi/lib ./usr/local/ndpi/bin ./ndpi-dev/usr/local/include/ndpi/
|
||||
cd ${NDPI_HOME}; ./autogen.sh; ./configure; make
|
||||
cp $(NDPI_HOME)/lib/libndpi.a $(NDPI_HOME)/lib/libndpi.so* ./usr/local/ndpi/lib/
|
||||
cp $(NDPI_HOME)/example/ndpiReader ./usr/local/ndpi/bin/
|
||||
cp $(NDPI_HOME)/src/include/*.h ndpi-dev/usr/local/include/ndpi/
|
||||
-rm -fr ndpi-dev/usr/local/include/nprobe/ndpi/.svn ndpi-dev/usr/local/include/ndpi/Makefile* ndpi-dev/usr/local/include/ndpi/ndpi_win32.h* ndpi-dev/usr/local/include/ndpi/include
|
||||
-find ./usr/local/lib -name "*.la" -exec /bin/rm {} ';'
|
||||
@echo
|
||||
@find . -name "*~" -exec /bin/rm {} ';'
|
||||
dpkg-buildpackage -rfakeroot -d -us -uc
|
||||
dpkg-sig --sign builder -k 7921DF34 ../ndpi*deb
|
||||
@\rm -f ../ndpi*dsc ../ndpi*.gz ../ndpi*changes
|
||||
@/bin/mv ../ndpi*deb .
|
||||
@echo
|
||||
@echo "Package built."
|
||||
@/bin/ls ndpi*deb
|
||||
@echo "-------------------------------"
|
||||
-dpkg --contents ndpi*amd64.deb
|
||||
@echo "-------------------------------"
|
||||
@echo "-------------------------------"
|
||||
-dpkg --contents ndpi*all.deb
|
||||
@echo "-------------------------------"
|
||||
|
||||
distclean:
|
||||
echo "dummy distclean"
|
||||
|
||||
install:
|
||||
echo "dummy install"
|
||||
|
||||
clean:
|
||||
-rm -rf *~ *deb debian/tmp ./usr
|
||||
+22
-23
@@ -1,43 +1,42 @@
|
||||
#
|
||||
# Change it according to your setup
|
||||
#
|
||||
NDPI_HOME=$(PWD)/../..
|
||||
NDPI_BUILD="$(realpath ${NDPI_HOME}/packages/ubuntu)"
|
||||
NDPI_BUILD=${NDPI_HOME}/packages/ubuntu
|
||||
|
||||
all: clean ndpi
|
||||
|
||||
ndpi:
|
||||
\rm -rf ./debian/ndpi-tmp ./debian/ndpi-dev-tmp ./debian/ndpi ./debian/ndpi-dev
|
||||
mkdir -p ./debian/ndpi-tmp ./debian/ndpi-dev-tmp
|
||||
mkdir -p ./debian/ndpi-tmp/usr/lib ./debian/ndpi-tmp/usr/bin
|
||||
mkdir -p ./debian/ndpi-dev-tmp/usr/lib ./debian/ndpi-dev-tmp/usr/include/ndpi ./debian/ndpi-dev-tmp/usr/lib/pkgconfig
|
||||
cd ${NDPI_HOME}; ./autogen.sh; ./configure; $(MAKE)
|
||||
cp $(NDPI_HOME)/src/lib/libndpi.so.@NDPI_VERS@ ./debian/ndpi-tmp/usr/lib/
|
||||
cd ./debian/ndpi-tmp/usr/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so; cd -
|
||||
cd ./debian/ndpi-tmp/usr/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so.@MAJOR_RELEASE@; cd -
|
||||
cp $(NDPI_HOME)/src/lib/libndpi.a ./debian/ndpi-dev-tmp/usr/lib/
|
||||
cp $(NDPI_HOME)/example/ndpiReader ./debian/ndpi-tmp/usr/bin/
|
||||
cp $(NDPI_HOME)/src/include/*.h ./debian/ndpi-dev-tmp/usr/include/ndpi/
|
||||
cp $(NDPI_HOME)/libndpi.pc ./debian/ndpi-dev-tmp/usr/lib/pkgconfig/
|
||||
-rm -fr ./debian/ndpi-dev-tmp/usr/include/ndpi/ndpi_win32.h*
|
||||
\rm -rf ./usr ./debian/tmp ./debian/ndpi-dev
|
||||
mkdir -p ./usr/local ./debian/ndpi-dev
|
||||
mkdir -p ./usr/local/ndpi/lib ./usr/local/ndpi/bin ./ndpi-dev/usr/local/include/ndpi/
|
||||
cd ${NDPI_HOME}; ./autogen.sh; ./configure; make
|
||||
cp $(NDPI_HOME)/lib/libndpi.a $(NDPI_HOME)/lib/libndpi.so* ./usr/local/ndpi/lib/
|
||||
cp $(NDPI_HOME)/example/ndpiReader ./usr/local/ndpi/bin/
|
||||
cp $(NDPI_HOME)/src/include/*.h ndpi-dev/usr/local/include/ndpi/
|
||||
-rm -fr ndpi-dev/usr/local/include/nprobe/ndpi/.svn ndpi-dev/usr/local/include/ndpi/Makefile* ndpi-dev/usr/local/include/ndpi/ndpi_win32.h* ndpi-dev/usr/local/include/ndpi/include
|
||||
-find ./usr/local/lib -name "*.la" -exec /bin/rm {} ';'
|
||||
@echo
|
||||
@find ./debian/ndpi-tmp -name "*~" -exec /bin/rm {} ';'
|
||||
@find ./debian/ndpi-dev-tmp -name "*~" -exec /bin/rm {} ';'
|
||||
@find . -name "*~" -exec /bin/rm {} ';'
|
||||
dpkg-buildpackage -rfakeroot -d -us -uc
|
||||
dpkg-sig --sign builder -k D1EB60BE ../ndpi*deb
|
||||
dpkg-sig --sign builder -k 7921DF34 ../ndpi*deb
|
||||
@\rm -f ../ndpi*dsc ../ndpi*.gz ../ndpi*changes
|
||||
@/bin/mv ../ndpi*deb .
|
||||
@echo
|
||||
@echo "Package built."
|
||||
@/bin/ls ndpi*deb
|
||||
@echo "-------------------------------"
|
||||
-dpkg --contents ndpi_*.deb
|
||||
-dpkg --contents ndpi*amd64.deb
|
||||
@echo "-------------------------------"
|
||||
@echo "-------------------------------"
|
||||
-dpkg --contents ndpi-dev_*.deb
|
||||
-dpkg --contents ndpi*all.deb
|
||||
@echo "-------------------------------"
|
||||
|
||||
distclean:
|
||||
-cd ${NDPI_HOME} && $(MAKE) distclean
|
||||
echo "dummy distclean"
|
||||
|
||||
install:
|
||||
cd ${NDPI_HOME}; $(MAKE) install DESTDIR="${NDPI_BUILD}/debian/tmp" AM_UPDATE_INFO_DIR=no
|
||||
echo "dummy install"
|
||||
|
||||
clean:
|
||||
-cd ${NDPI_HOME} && $(MAKE) clean
|
||||
-rm -rf *~ *deb ./usr ./debian/ndpi ./debian/ndpi-dev ./debian/ndpi ./debian/ndpi-dev
|
||||
-rm -rf *~ *deb debian/tmp ./usr
|
||||
|
||||
Vendored
+21
-1624
File diff suppressed because it is too large
Load Diff
@@ -1,49 +1,32 @@
|
||||
AC_INIT([Makefile.in], 1.0)
|
||||
|
||||
NDPI_VERS=`cat ../../config.h | grep -w VERSION | cut -d \" -f 2`
|
||||
PFRING_VERS=`cat $HOME/PF_RING/kernel/linux/pf_ring.h | grep RING_VERSION | head -1 | cut -d '"' -f 2`
|
||||
SVN_RELEASE=`svn info ../.. | grep "^Revision"|cut -d " " -f 2`
|
||||
PFRING_SVN_RELEASE=`svn info $HOME/PF_RING | grep "^Revision"|cut -d " " -f 2`
|
||||
MACHINE=`uname -m`
|
||||
|
||||
if test $MACHINE = "x86_64"; then
|
||||
EXTN="amd64"
|
||||
else
|
||||
EXTN="i386"
|
||||
fi
|
||||
|
||||
DATE=`date -R`
|
||||
KERNEL=`uname -r`
|
||||
MACHINE=`uname -m`
|
||||
SHORT_MACHINE=`uname -m | cut -b1-3`
|
||||
|
||||
EXTN=""
|
||||
if test $MACHINE = "x86_64"; then
|
||||
EXTN="amd64"
|
||||
else
|
||||
if test $SHORT_MACHINE = "aar"; then
|
||||
EXTN="arm64"
|
||||
else
|
||||
if test $SHORT_MACHINE = "arm"; then
|
||||
EXTN="armhf"
|
||||
else
|
||||
if test $SHORT_MACHINE = "mip"; then
|
||||
EXTN="mips"
|
||||
else
|
||||
EXTN="i386"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
NDPI_VERS=`$(dirname "${0}")/../version.sh --release`
|
||||
MAJOR_RELEASE=`$(dirname "${0}")/../version.sh --major-release`
|
||||
GIT_REVISION=`$(dirname "${0}")/../version.sh --revision`
|
||||
|
||||
AC_CHECK_LIB([maxminddb], [MMDB_lookup_sockaddr])
|
||||
AC_HAVE_HEADERS(maxminddb.h)
|
||||
if test ".${ac_cv_lib_maxminddb_MMDB_lookup_sockaddr}" = ".yes" &&
|
||||
test ".${ac_cv_header_maxminddb_h}" = ".yes"; then
|
||||
GEOIP_DEP=", libmaxminddb0"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile debian/changelog debian/files debian/control])
|
||||
|
||||
AC_SUBST(NDPI_VERS)
|
||||
AC_SUBST(GEOIP_DEP)
|
||||
AC_SUBST(PFRING_VERS)
|
||||
AC_SUBST(MACHINE)
|
||||
AC_SUBST(EXTN)
|
||||
AC_SUBST(DATE)
|
||||
AC_SUBST(KERNEL)
|
||||
AC_SUBST(GIT_REVISION)
|
||||
AC_SUBST(MAJOR_RELEASE)
|
||||
AC_SUBST(SVN_RELEASE)
|
||||
AC_SUBST(PFRING_SVN_RELEASE)
|
||||
|
||||
AC_CONFIG_FILES(Makefile)
|
||||
AC_CONFIG_FILES(debian/changelog)
|
||||
AC_CONFIG_FILES(debian/files)
|
||||
AC_CONFIG_FILES(debian/control)
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
This directory contains the files needed to build the package
|
||||
named 'ndpi' for the Debian GNU/Linux distribution.
|
||||
named 'nprobe' for the Debian GNU/Linux distribution.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
ndpi (@NDPI_VERS@-@GIT_REVISION@) stable; urgency=high
|
||||
ndpi (@NDPI_VERS@-@SVN_RELEASE@) stable; urgency=high
|
||||
* Last packaged version
|
||||
|
||||
-- Luca Deri <deri@ntop.org> @DATE@
|
||||
|
||||
@@ -1 +1 @@
|
||||
9
|
||||
1
|
||||
|
||||
@@ -2,25 +2,27 @@ Source: ndpi
|
||||
Section: free
|
||||
Priority: optional
|
||||
Maintainer: Luca Deri <deri@ntop.org>
|
||||
Standards-Version: @NDPI_VERS@
|
||||
Standards-Version: @NDPI_VERSION@
|
||||
Build-Depends:
|
||||
Build-Conflicts:
|
||||
|
||||
Package: ndpi
|
||||
Architecture: @EXTN@
|
||||
Depends: libnuma1 @GEOIP_DEP@
|
||||
Depends: pfring (=@PFRING_VERS@-@PFRING_SVN_RELEASE@), libnuma
|
||||
Recommends:
|
||||
Suggests:
|
||||
Pre-Depends:
|
||||
Conflicts:
|
||||
Provides:
|
||||
Replaces:
|
||||
Description: A L7 DPI library.
|
||||
Description: A network probe.
|
||||
|
||||
Package: ndpi-dev
|
||||
Section: libdevel
|
||||
Architecture: @EXTN@
|
||||
Architecture: all
|
||||
Depends: ndpi (= ${binary:Version}), ${misc:Depends}
|
||||
Conflicts:
|
||||
Description: Development library and header files for ndpi
|
||||
Description: development library and header files for ndpi
|
||||
Headers, static libraries, and documentation for the ndpi library
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
usr/local/ndpi
|
||||
|
||||
@@ -17,7 +17,18 @@ esac
|
||||
|
||||
umask 022
|
||||
|
||||
# Update shared libs
|
||||
echo "/usr/local/lib\n" > /etc/ld.so.conf.d/nprobe.conf
|
||||
echo "Rebuilding ld cache..."
|
||||
/sbin/ldconfig
|
||||
|
||||
echo "Adding the nprobe startup script"
|
||||
update-rc.d nprobe defaults 93 >/dev/null
|
||||
|
||||
echo "Making the /etc/nprobe directory..."
|
||||
mkdir -p /etc/nprobe/
|
||||
|
||||
echo "Making the /var/log/nprobe directory..."
|
||||
mkdir -p /var/log/nprobe
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
set -e
|
||||
|
||||
#\/bin/rm /etc/ld.so.conf.d/nprobe.conf
|
||||
/sbin/ldconfig
|
||||
|
||||
# Not needed: upstart does it
|
||||
if [ "$1" = "purge" ] ; then
|
||||
update-rc.d nprobe remove >/dev/null
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# preinst script
|
||||
# preinst script for nbox
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
@@ -13,6 +13,9 @@ set -e
|
||||
|
||||
case "$1" in
|
||||
install|upgrade)
|
||||
if test -f /usr/local/sbin/nprobe; then
|
||||
rm /usr/local/sbin/nprobe
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
@@ -27,4 +30,6 @@ esac
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
# Only shut the daemon down if we're really removing the package. If this is
|
||||
# an upgrade, we will instead do a restart in the postinst... this keeps nprobe
|
||||
# from being left shut down for a long time, which could pose problems.
|
||||
case "$1" in
|
||||
upgrade)
|
||||
;;
|
||||
*)
|
||||
/etc/init.d/nprobe stop
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user