Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2f476c869 | ||
|
|
e6c3c0139a | ||
|
|
aad896c2a8 | ||
|
|
1a6a9593fb | ||
|
|
6cb40ac75e | ||
|
|
50591238e5 | ||
|
|
291acb9459 | ||
|
|
47c2ad1b5f | ||
|
|
6491568e15 | ||
|
|
28ac30d827 | ||
|
|
db74459ca2 | ||
|
|
d2bc3ea209 | ||
|
|
cd9d456994 | ||
|
|
579f1b05db | ||
|
|
7e41309fa9 | ||
|
|
3091dc3c48 | ||
|
|
01bf295a19 | ||
|
|
f88648fbc8 | ||
|
|
18b9589e50 | ||
|
|
9847c2ccbb | ||
|
|
335b336968 | ||
|
|
70eb619b86 | ||
|
|
b3b8feabf1 | ||
|
|
d9cf798753 | ||
|
|
cbb2eb8c8f | ||
|
|
6474125c93 | ||
|
|
5100cc0eae | ||
|
|
49ed41142c | ||
|
|
659649d2e9 | ||
|
|
5246656ae0 | ||
|
|
f828dfc202 | ||
|
|
591158bb92 | ||
|
|
667e77c609 | ||
|
|
a499f369a5 | ||
|
|
fbf6bd2be8 | ||
|
|
212598b45e | ||
|
|
8b0e735f67 | ||
|
|
d9c963061b | ||
|
|
30b72eae64 | ||
|
|
475f54e9d1 | ||
|
|
34dfe7d375 | ||
|
|
06789406ad | ||
|
|
1ebc510bcb | ||
|
|
90ffa1fc2c | ||
|
|
f942cef2f1 | ||
|
|
7fce8f02d2 | ||
|
|
3986a951d8 | ||
|
|
22356fa69b | ||
|
|
e00b06926e | ||
|
|
dc9409ae12 | ||
|
|
2b4321b5c3 | ||
|
|
6b16ad709e | ||
|
|
3407db11cd | ||
|
|
326a2fb7ed | ||
|
|
eef175e579 | ||
|
|
9af00fdb4c | ||
|
|
6c2cfb34f7 | ||
|
|
5171309c43 | ||
|
|
c77ec63ed8 | ||
|
|
30afa082e4 | ||
|
|
ea64f8b0da | ||
|
|
e2310751f1 | ||
|
|
47b5e45f13 | ||
|
|
31275398aa | ||
|
|
c1166c37d1 | ||
|
|
5420b6359b | ||
|
|
5e47871256 | ||
|
|
1585503809 | ||
|
|
60636a9a88 | ||
|
|
fcf4b25bc3 | ||
|
|
0efc4a706d | ||
|
|
fb7416cb9d | ||
|
|
32c62faa78 | ||
|
|
363deeb23d | ||
|
|
131f68117b | ||
|
|
05cef1d69a | ||
|
|
71ef54f561 | ||
|
|
f9c217e42a | ||
|
|
36c1b72118 | ||
|
|
6dd42d19f7 | ||
|
|
5d3ac78250 | ||
|
|
f56b083bc3 | ||
|
|
79be44ddea | ||
|
|
dcdd7562f4 | ||
|
|
66b759ca69 | ||
|
|
529492e81f | ||
|
|
1076455c01 | ||
|
|
2d486aeed8 | ||
|
|
00c35e48a2 | ||
|
|
8380b505f4 | ||
|
|
564d622cc9 | ||
|
|
a067350098 | ||
|
|
50216991bd | ||
|
|
3707553906 | ||
|
|
b8fec1e3ce | ||
|
|
979330392e | ||
|
|
11898f0268 | ||
|
|
78176d2b7b | ||
|
|
64633939e0 | ||
|
|
f717be19cb | ||
|
|
9c6c15cd6b | ||
|
|
3adccc98f7 | ||
|
|
79f3199339 | ||
|
|
23042b3c9a | ||
|
|
e819899221 | ||
|
|
b92541a08e | ||
|
|
c54a8f8cfa | ||
|
|
3b5f32f261 | ||
|
|
7798b964fe | ||
|
|
44e2e0beea | ||
|
|
32a9b8fd14 | ||
|
|
5a7f58d23f | ||
|
|
6aaca82d0e | ||
|
|
07a81f5e15 | ||
|
|
c9a2eb54c1 | ||
|
|
8a59581668 | ||
|
|
5950ad7ef8 | ||
|
|
4b720c4f3c | ||
|
|
480791a057 | ||
|
|
076bd3d1f4 | ||
|
|
d8e4111a9d | ||
|
|
9c1029ff6c | ||
|
|
56f14ebee4 | ||
|
|
aa5d06bb1a | ||
|
|
025ca46981 | ||
|
|
521afe7e1f | ||
|
|
c7e53724dc | ||
|
|
85f25fad6d | ||
|
|
b63279af8d | ||
|
|
5281fcf3cd | ||
|
|
462da90a21 | ||
|
|
a2acd09263 | ||
|
|
957b01aa71 | ||
|
|
ac31c1ba98 | ||
|
|
3aaae46c66 | ||
|
|
53882ef736 | ||
|
|
21da70fd75 | ||
|
|
d4a20ba6a8 | ||
|
|
4204e2f614 | ||
|
|
38199a589f | ||
|
|
b19cd086b4 | ||
|
|
e935ee77bf | ||
|
|
6a9fc935eb | ||
|
|
06bb9a9c57 | ||
|
|
6e7a1022b2 | ||
|
|
76d058360e | ||
|
|
9fa6119f14 | ||
|
|
be38c3d90e | ||
|
|
6ba79afc23 | ||
|
|
12a1b0d7a3 | ||
|
|
029ca0797a | ||
|
|
a5dd00eedb | ||
|
|
b98f79eaa6 | ||
|
|
16e57f64cd | ||
|
|
9e47e49ade | ||
|
|
df54e8b926 | ||
|
|
01949c47da | ||
|
|
52a2c0589e | ||
|
|
12368ba2d5 | ||
|
|
053dbd73a6 | ||
|
|
8f631fa19d | ||
|
|
344392868b | ||
|
|
0624afd422 | ||
|
|
c3f5307a3d | ||
|
|
e6412949f1 | ||
|
|
ea74d87fd8 | ||
|
|
5e0880dac6 | ||
|
|
26e36a19bf | ||
|
|
aea81e4a1a | ||
|
|
39b9f6752c | ||
|
|
73b4019561 | ||
|
|
3b5d8177f7 | ||
|
|
f8c6e9d714 | ||
|
|
da588f6a30 | ||
|
|
ee7a30385b | ||
|
|
809535e0a2 | ||
|
|
57fb117571 | ||
|
|
78feabfad7 | ||
|
|
54306411a4 | ||
|
|
f2280c90a4 | ||
|
|
e09ebab0c2 | ||
|
|
d18824a73f | ||
|
|
d2d20a8aa4 | ||
|
|
fbf7fe2424 | ||
|
|
ced9658c63 | ||
|
|
d896ce7469 | ||
|
|
77cb8ccaea | ||
|
|
35dc6e27ae | ||
|
|
61e297b851 | ||
|
|
1d1082342f | ||
|
|
f5e366d8c4 | ||
|
|
8d52491508 | ||
|
|
caf602c4a9 | ||
|
|
bf8c9c2625 | ||
|
|
f024e72eff | ||
|
|
9561f37998 | ||
|
|
13e592275a | ||
|
|
3f9434b81d | ||
|
|
00e6ee3dc3 | ||
|
|
a06c399530 | ||
|
|
cd12a86088 | ||
|
|
61bc528159 | ||
|
|
811717e7c1 | ||
|
|
cb8f4f87bf | ||
|
|
dfd8cbc4e1 | ||
|
|
d88a73397d | ||
|
|
90ec8040e6 | ||
|
|
f1f8afdddf | ||
|
|
7fd8406916 | ||
|
|
b5a8c6bae8 | ||
|
|
ee957e0831 | ||
|
|
50645e11d8 | ||
|
|
2787c2390c | ||
|
|
441e43c167 |
+36
-33
@@ -1,51 +1,54 @@
|
|||||||
*.[oa]
|
|
||||||
*~
|
*~
|
||||||
*o.cmd
|
/aclocal.m4
|
||||||
*.lo
|
/autom4te.cache/
|
||||||
*.obj
|
|
||||||
*o.cmd
|
|
||||||
*.ko
|
|
||||||
*.swp
|
|
||||||
*.in
|
|
||||||
*.la
|
|
||||||
.libs
|
|
||||||
.dirstamp
|
|
||||||
.autotools
|
.autotools
|
||||||
.cproject
|
compile
|
||||||
.project
|
/compile
|
||||||
.settings
|
|
||||||
stamp-h1
|
|
||||||
/configure
|
|
||||||
/configure.ac
|
|
||||||
/config.guess
|
/config.guess
|
||||||
/config.h
|
/config.h
|
||||||
/config.h.in
|
/config.h.in
|
||||||
/config.sub
|
|
||||||
/config.log
|
/config.log
|
||||||
/config.status
|
/config.status
|
||||||
|
/config.sub
|
||||||
|
/configure
|
||||||
|
/configure.ac
|
||||||
|
/configure.tmp
|
||||||
|
.cproject
|
||||||
/depcomp
|
/depcomp
|
||||||
/install-sh
|
.dirstamp
|
||||||
/ltmain.sh
|
/example/.deps/
|
||||||
/missing
|
|
||||||
/Makefile
|
|
||||||
/libndpi.pc
|
|
||||||
/libtool
|
|
||||||
/src/lib/Makefile
|
|
||||||
/src/include/Makefile
|
|
||||||
/example/ndpiReader
|
|
||||||
/example/Makefile
|
/example/Makefile
|
||||||
/aclocal.m4
|
/example/ndpiReader
|
||||||
|
*.in
|
||||||
|
/install-sh
|
||||||
|
*.ko
|
||||||
|
*.la
|
||||||
|
/libndpi.pc
|
||||||
|
.libs
|
||||||
|
/libtool
|
||||||
|
*.lo
|
||||||
|
/ltmain.sh
|
||||||
/m4/libtool.m4
|
/m4/libtool.m4
|
||||||
|
/m4/lt~obsolete.m4
|
||||||
/m4/ltoptions.m4
|
/m4/ltoptions.m4
|
||||||
/m4/ltsugar.m4
|
/m4/ltsugar.m4
|
||||||
/m4/ltversion.m4
|
/m4/ltversion.m4
|
||||||
/m4/lt~obsolete.m4
|
/Makefile
|
||||||
/autom4te.cache/
|
/missing
|
||||||
/compile
|
*.[oa]
|
||||||
/example/.deps/
|
*.obj
|
||||||
|
*o.cmd
|
||||||
|
*o.cmd
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
/src/include/Makefile
|
||||||
|
/src/include/ndpi_config.h
|
||||||
|
/src/include/ndpi_define.h
|
||||||
/src/lib/.deps/
|
/src/lib/.deps/
|
||||||
|
/src/lib/Makefile
|
||||||
/src/lib/protocols/.deps/
|
/src/lib/protocols/.deps/
|
||||||
/src/lib/third_party/src/.deps/
|
/src/lib/third_party/src/.deps/
|
||||||
/src/include/ndpi_define.h
|
stamp-h1
|
||||||
|
*.swp
|
||||||
/test-driver
|
/test-driver
|
||||||
/tests/Makefile
|
/tests/Makefile
|
||||||
|
|||||||
@@ -1,5 +1,98 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
#### 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)
|
#### nDPI 2.2 (December 2017)
|
||||||
|
|
||||||
|
|||||||
+18
-8
@@ -1,17 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NDPI_MAJOR="2"
|
NDPI_MAJOR="2"
|
||||||
NDPI_MINOR="1"
|
NDPI_MINOR="4"
|
||||||
NDPI_PATCH="0"
|
NDPI_PATCH="0"
|
||||||
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
||||||
|
|
||||||
/bin/rm -f configure config.h config.h.in src/lib/Makefile.in
|
rm -f configure config.h config.h.in src/lib/Makefile.in
|
||||||
|
|
||||||
AUTOCONF=$(which autoconf)
|
AUTOCONF=$(command -v autoconf)
|
||||||
AUTOMAKE=$(which automake)
|
AUTOMAKE=$(command -v automake)
|
||||||
LIBTOOL=$(which libtool)
|
LIBTOOL=$(command -v libtool)
|
||||||
LIBTOOLIZE=$(which libtoolize)
|
LIBTOOLIZE=$(command -v libtoolize)
|
||||||
AUTORECONF=$(which autoreconf)
|
AUTORECONF=$(command -v autoreconf)
|
||||||
|
|
||||||
if test -z $AUTOCONF; then
|
if test -z $AUTOCONF; then
|
||||||
echo "autoconf is missing: please install it and try again"
|
echo "autoconf is missing: please install it and try again"
|
||||||
@@ -33,6 +33,16 @@ if test -z $AUTORECONF; then
|
|||||||
exit
|
exit
|
||||||
fi
|
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
|
cat configure.seed | sed \
|
||||||
|
-e "s/@NDPI_MAJOR@/$NDPI_MAJOR/g" \
|
||||||
|
-e "s/@NDPI_MINOR@/$NDPI_MINOR/g" \
|
||||||
|
-e "s/@NDPI_PATCH@/$NDPI_PATCH/g" \
|
||||||
|
-e "s/@NDPI_VERSION_SHORT@/$NDPI_VERSION_SHORT/g" \
|
||||||
|
> configure.ac
|
||||||
|
|
||||||
autoreconf -ivf
|
autoreconf -ivf
|
||||||
|
cat configure | sed "s/#define PACKAGE/#define NDPI_PACKAGE/g" | sed "s/#define VERSION/#define NDPI_VERSION/g" > configure.tmp
|
||||||
|
cat configure.tmp > configure
|
||||||
|
|
||||||
|
chmod +x configure
|
||||||
./configure $*
|
./configure $*
|
||||||
|
|||||||
+31
-2
@@ -51,6 +51,29 @@ else
|
|||||||
AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
|
AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
HS_LIB=
|
||||||
|
HS_INC=
|
||||||
|
|
||||||
|
AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
|
||||||
|
|
||||||
|
if test "${with_hyperscan+set}" = set; then
|
||||||
|
BKP=$LIBS
|
||||||
|
LIBS="$LIBS -lstdc++ -lm"
|
||||||
|
AC_CHECK_LIB([hs], [hs_compile_multi], AC_DEFINE_UNQUOTED(HAVE_HYPERSCAN, 1, [Intel Hyperscan is present]))
|
||||||
|
LIBS=$BKP
|
||||||
|
|
||||||
|
if test "x$ac_cv_lib_hs_hs_compile_multi" = xyes; then :
|
||||||
|
AC_CHECK_LIB([m], [pow])
|
||||||
|
AC_CHECK_LIB([stdc++], [main])
|
||||||
|
HS_INC=`pkg-config --cflags libhs`
|
||||||
|
HS_LIB=`pkg-config --libs libhs`
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([Intel Hyperscan not found, exiting. See https://github.com/intel/hyperscan/blob/master/doc/dev-reference/getting_started.rst for install/build instructions])
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
||||||
echo "Using libpcap from $PCAP_HOME"
|
echo "Using libpcap from $PCAP_HOME"
|
||||||
PCAP_INC="-I $PCAP_HOME/libpcap"
|
PCAP_INC="-I $PCAP_HOME/libpcap"
|
||||||
@@ -98,10 +121,14 @@ AS_IF([test "x$enable_json_c" != "xno"], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
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]) ])
|
||||||
|
|
||||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
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_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h])
|
||||||
AC_CONFIG_HEADERS(config.h)
|
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
||||||
AC_SUBST(GIT_RELEASE)
|
AC_SUBST(GIT_RELEASE)
|
||||||
AC_SUBST(NDPI_MAJOR)
|
AC_SUBST(NDPI_MAJOR)
|
||||||
AC_SUBST(NDPI_MINOR)
|
AC_SUBST(NDPI_MINOR)
|
||||||
@@ -111,6 +138,8 @@ AC_SUBST(JSON_C_LIB)
|
|||||||
AC_SUBST(PCAP_INC)
|
AC_SUBST(PCAP_INC)
|
||||||
AC_SUBST(PCAP_LIB)
|
AC_SUBST(PCAP_LIB)
|
||||||
AC_SUBST(DL_LIB)
|
AC_SUBST(DL_LIB)
|
||||||
|
AC_SUBST(HS_LIB)
|
||||||
|
AC_SUBST(HS_INC)
|
||||||
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# 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
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:ndpiExample.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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
@@ -0,0 +1,58 @@
|
|||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,732 @@
|
|||||||
|
<?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>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?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>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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.
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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);
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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 */
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
bin_PROGRAMS = ndpiReader
|
bin_PROGRAMS = ndpiReader
|
||||||
|
|
||||||
AM_CPPFLAGS = -I$(top_srcdir)/src/include @PCAP_INC@
|
AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/lib/third_party/include @PCAP_INC@ @HS_INC@
|
||||||
AM_CFLAGS = @PTHREAD_CFLAGS@ # --coverage
|
AM_CFLAGS = @PTHREAD_CFLAGS@ # --coverage
|
||||||
|
|
||||||
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@ @DL_LIB@ -lm
|
LDADD = $(top_builddir)/src/lib/libndpi.a @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@ @DL_LIB@ @HS_LIB@ -lm
|
||||||
AM_LDFLAGS = -static @DL_LIB@
|
AM_LDFLAGS = -static @DL_LIB@ @HS_LIB@
|
||||||
|
|
||||||
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c ndpi_util.h uthash.h
|
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c ndpi_util.h uthash.h
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,262 @@
|
|||||||
|
# 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
|
||||||
+161
-47
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpiReader.c
|
* ndpiReader.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-17 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -18,6 +18,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "ndpi_config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef linux
|
#ifdef linux
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
@@ -43,7 +47,6 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "../config.h"
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
#include "uthash.h"
|
#include "uthash.h"
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -64,6 +67,7 @@ static FILE *results_file = NULL;
|
|||||||
static char *results_path = NULL;
|
static char *results_path = NULL;
|
||||||
static char * bpfFilter = NULL; /**< bpf filter */
|
static char * bpfFilter = NULL; /**< bpf filter */
|
||||||
static char *_protoFilePath = NULL; /**< Protocol file path */
|
static char *_protoFilePath = NULL; /**< Protocol file path */
|
||||||
|
static char *_customCategoryFilePath= NULL; /**< Custom categories file path */
|
||||||
#ifdef HAVE_JSON_C
|
#ifdef HAVE_JSON_C
|
||||||
static char *_statsFilePath = NULL; /**< Top stats file path */
|
static char *_statsFilePath = NULL; /**< Top stats file path */
|
||||||
static char *_diagnoseFilePath = NULL; /**< Top stats file path */
|
static char *_diagnoseFilePath = NULL; /**< Top stats file path */
|
||||||
@@ -77,7 +81,9 @@ static json_object *jArray_topStats;
|
|||||||
static u_int8_t live_capture = 0;
|
static u_int8_t live_capture = 0;
|
||||||
static u_int8_t undetected_flows_deleted = 0;
|
static u_int8_t undetected_flows_deleted = 0;
|
||||||
/** User preferences **/
|
/** User preferences **/
|
||||||
static u_int8_t enable_protocol_guess = 1, verbose = 0, nDPI_traceLevel = 0, json_flag = 0;
|
static u_int8_t enable_protocol_guess = 1, verbose = 0, json_flag = 0;
|
||||||
|
int nDPI_LogLevel = 0;
|
||||||
|
char *_debug_protocols = NULL;
|
||||||
static u_int8_t stats_flag = 0, bpf_filter_flag = 0;
|
static u_int8_t stats_flag = 0, bpf_filter_flag = 0;
|
||||||
#ifdef HAVE_JSON_C
|
#ifdef HAVE_JSON_C
|
||||||
static u_int8_t file_first_time = 1;
|
static u_int8_t file_first_time = 1;
|
||||||
@@ -105,7 +111,6 @@ struct flow_info {
|
|||||||
|
|
||||||
static struct flow_info *all_flows;
|
static struct flow_info *all_flows;
|
||||||
|
|
||||||
|
|
||||||
struct info_pair {
|
struct info_pair {
|
||||||
u_int32_t addr;
|
u_int32_t addr;
|
||||||
u_int8_t version; /* IP version */
|
u_int8_t version; /* IP version */
|
||||||
@@ -138,7 +143,6 @@ struct port_stats {
|
|||||||
|
|
||||||
struct port_stats *srcStats = NULL, *dstStats = NULL;
|
struct port_stats *srcStats = NULL, *dstStats = NULL;
|
||||||
|
|
||||||
|
|
||||||
// struct to hold count of flows received by destination ports
|
// struct to hold count of flows received by destination ports
|
||||||
struct port_flow_info {
|
struct port_flow_info {
|
||||||
u_int32_t port; /* key */
|
u_int32_t port; /* key */
|
||||||
@@ -225,7 +229,7 @@ static void help(u_int long_help) {
|
|||||||
|
|
||||||
printf("ndpiReader -i <file|device> [-f <filter>][-s <duration>][-m <duration>]\n"
|
printf("ndpiReader -i <file|device> [-f <filter>][-s <duration>][-m <duration>]\n"
|
||||||
" [-p <protos>][-l <loops> [-q][-d][-h][-t][-v <level>]\n"
|
" [-p <protos>][-l <loops> [-q][-d][-h][-t][-v <level>]\n"
|
||||||
" [-n <threads>] [-w <file>] [-j <file>] [-x <file>] \n\n"
|
" [-n <threads>][-w <file>][-c <file>][-j <file>][-x <file>]\n\n"
|
||||||
"Usage:\n"
|
"Usage:\n"
|
||||||
" -i <file.pcap|device> | Specify a pcap file/playlist to read packets from or a\n"
|
" -i <file.pcap|device> | Specify a pcap file/playlist to read packets from or a\n"
|
||||||
" | device for live capture (comma-separated list)\n"
|
" | device for live capture (comma-separated list)\n"
|
||||||
@@ -244,6 +248,7 @@ static void help(u_int long_help) {
|
|||||||
" -q | Quiet mode\n"
|
" -q | Quiet mode\n"
|
||||||
" -t | Dissect GTP/TZSP tunnels\n"
|
" -t | Dissect GTP/TZSP tunnels\n"
|
||||||
" -r | Print nDPI version and git revision\n"
|
" -r | Print nDPI version and git revision\n"
|
||||||
|
" -c <path> | Load custom categories from the specified file\n"
|
||||||
" -w <path> | Write test output on the specified file. This is useful for\n"
|
" -w <path> | Write test output on the specified file. This is useful for\n"
|
||||||
" | testing purposes in order to compare results across runs\n"
|
" | testing purposes in order to compare results across runs\n"
|
||||||
" -h | This help\n"
|
" -h | This help\n"
|
||||||
@@ -251,6 +256,9 @@ static void help(u_int long_help) {
|
|||||||
" | 1 = verbose\n"
|
" | 1 = verbose\n"
|
||||||
" | 2 = very verbose\n"
|
" | 2 = very verbose\n"
|
||||||
" | 3 = port stats\n"
|
" | 3 = port stats\n"
|
||||||
|
" -V <1-4> | nDPI logging level\n"
|
||||||
|
" | 1 - trace, 2 - debug, 3 - full debug\n"
|
||||||
|
" | >3 - full debug + dbg_proto = all\n"
|
||||||
" -b <file.json> | Specify a file to write port based diagnose statistics\n"
|
" -b <file.json> | Specify a file to write port based diagnose statistics\n"
|
||||||
" -x <file.json> | Produce bpf filters for specified diagnose file. Use\n"
|
" -x <file.json> | Produce bpf filters for specified diagnose file. Use\n"
|
||||||
" | this option only for .json files generated with -b flag.\n");
|
" | this option only for .json files generated with -b flag.\n");
|
||||||
@@ -267,6 +275,7 @@ static void help(u_int long_help) {
|
|||||||
" --extcap-capture-filter\n"
|
" --extcap-capture-filter\n"
|
||||||
" --fifo <path to file or pipe>\n"
|
" --fifo <path to file or pipe>\n"
|
||||||
" --debug\n"
|
" --debug\n"
|
||||||
|
" --dbg-proto proto|num[,...]\n"
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -289,7 +298,8 @@ static struct option longopts[] = {
|
|||||||
{ "capture", no_argument, NULL, '5'},
|
{ "capture", no_argument, NULL, '5'},
|
||||||
{ "extcap-capture-filter", required_argument, NULL, '6'},
|
{ "extcap-capture-filter", required_argument, NULL, '6'},
|
||||||
{ "fifo", required_argument, NULL, '7'},
|
{ "fifo", required_argument, NULL, '7'},
|
||||||
{ "debug", optional_argument, NULL, '8'},
|
{ "debug", no_argument, NULL, '8'},
|
||||||
|
{ "dbg-proto", required_argument, NULL, 257},
|
||||||
{ "ndpi-proto-filter", required_argument, NULL, '9'},
|
{ "ndpi-proto-filter", required_argument, NULL, '9'},
|
||||||
|
|
||||||
/* ndpiReader options */
|
/* ndpiReader options */
|
||||||
@@ -337,6 +347,8 @@ struct ndpi_proto_sorter {
|
|||||||
char name[16];
|
char name[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
int cmpProto(const void *_a, const void *_b) {
|
int cmpProto(const void *_a, const void *_b) {
|
||||||
struct ndpi_proto_sorter *a = (struct ndpi_proto_sorter*)_a;
|
struct ndpi_proto_sorter *a = (struct ndpi_proto_sorter*)_a;
|
||||||
struct ndpi_proto_sorter *b = (struct ndpi_proto_sorter*)_b;
|
struct ndpi_proto_sorter *b = (struct ndpi_proto_sorter*)_b;
|
||||||
@@ -344,6 +356,8 @@ int cmpProto(const void *_a, const void *_b) {
|
|||||||
return(strcmp(a->name, b->name));
|
return(strcmp(a->name, b->name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
int cmpFlows(const void *_a, const void *_b) {
|
int cmpFlows(const void *_a, const void *_b) {
|
||||||
struct ndpi_flow_info *fa = ((struct flow_info*)_a)->flow;
|
struct ndpi_flow_info *fa = ((struct flow_info*)_a)->flow;
|
||||||
struct ndpi_flow_info *fb = ((struct flow_info*)_b)->flow;
|
struct ndpi_flow_info *fb = ((struct flow_info*)_b)->flow;
|
||||||
@@ -363,9 +377,13 @@ int cmpFlows(const void *_a, const void *_b) {
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
void extcap_config() {
|
void extcap_config() {
|
||||||
int i, argidx = 0;
|
int i, argidx = 0;
|
||||||
struct ndpi_proto_sorter *protos;
|
struct ndpi_proto_sorter *protos;
|
||||||
|
u_int ndpi_num_supported_protocols = ndpi_get_ndpi_num_supported_protocols(ndpi_info_mod);
|
||||||
|
ndpi_proto_defaults_t *proto_defaults = ndpi_get_proto_defaults(ndpi_info_mod);
|
||||||
|
|
||||||
/* -i <interface> */
|
/* -i <interface> */
|
||||||
printf("arg {number=%d}{call=-i}{display=Capture Interface}{type=string}"
|
printf("arg {number=%d}{call=-i}{display=Capture Interface}{type=string}"
|
||||||
@@ -373,22 +391,22 @@ void extcap_config() {
|
|||||||
printf("arg {number=%d}{call=-i}{display=Pcap File to Analyze}{type=fileselect}"
|
printf("arg {number=%d}{call=-i}{display=Pcap File to Analyze}{type=fileselect}"
|
||||||
"{tooltip=The pcap file to analyze (if the interface is unspecified)}\n", argidx++);
|
"{tooltip=The pcap file to analyze (if the interface is unspecified)}\n", argidx++);
|
||||||
|
|
||||||
protos = (struct ndpi_proto_sorter*)malloc(sizeof(struct ndpi_proto_sorter) * ndpi_info_mod->ndpi_num_supported_protocols);
|
protos = (struct ndpi_proto_sorter*)malloc(sizeof(struct ndpi_proto_sorter) * ndpi_num_supported_protocols);
|
||||||
if(!protos) exit(0);
|
if(!protos) exit(0);
|
||||||
|
|
||||||
for(i=0; i<(int) ndpi_info_mod->ndpi_num_supported_protocols; i++) {
|
for(i=0; i<(int) ndpi_num_supported_protocols; i++) {
|
||||||
protos[i].id = i;
|
protos[i].id = i;
|
||||||
snprintf(protos[i].name, sizeof(protos[i].name), "%s", ndpi_info_mod->proto_defaults[i].protoName);
|
snprintf(protos[i].name, sizeof(protos[i].name), "%s", proto_defaults[i].protoName);
|
||||||
}
|
}
|
||||||
|
|
||||||
qsort(protos, ndpi_info_mod->ndpi_num_supported_protocols, sizeof(struct ndpi_proto_sorter), cmpProto);
|
qsort(protos, ndpi_num_supported_protocols, sizeof(struct ndpi_proto_sorter), cmpProto);
|
||||||
|
|
||||||
printf("arg {number=%d}{call=-9}{display=nDPI Protocol Filter}{type=selector}"
|
printf("arg {number=%d}{call=-9}{display=nDPI Protocol Filter}{type=selector}"
|
||||||
"{tooltip=nDPI Protocol to be filtered}\n", argidx);
|
"{tooltip=nDPI Protocol to be filtered}\n", argidx);
|
||||||
|
|
||||||
printf("value {arg=%d}{value=%d}{display=%s}\n", argidx, -1, "All Protocols (no nDPI filtering)");
|
printf("value {arg=%d}{value=%d}{display=%s}\n", argidx, -1, "All Protocols (no nDPI filtering)");
|
||||||
|
|
||||||
for(i=0; i<(int)ndpi_info_mod->ndpi_num_supported_protocols; i++)
|
for(i=0; i<(int)ndpi_num_supported_protocols; i++)
|
||||||
printf("value {arg=%d}{value=%d}{display=%s (%d)}\n", argidx, protos[i].id,
|
printf("value {arg=%d}{value=%d}{display=%s (%d)}\n", argidx, protos[i].id,
|
||||||
protos[i].name, protos[i].id);
|
protos[i].name, protos[i].id);
|
||||||
|
|
||||||
@@ -439,7 +457,7 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
if(trace) fprintf(trace, " #### %s #### \n", __FUNCTION__);
|
if(trace) fprintf(trace, " #### %s #### \n", __FUNCTION__);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((opt = getopt_long(argc, argv, "df:g:i:hp:l:s:tv:V:n:j:rp:w:q0123:456:7:89:m:b:x:", longopts, &option_idx)) != EOF) {
|
while ((opt = getopt_long(argc, argv, "c:df:g:i:hp:l:s:tv:V:n:j:rp:w:q0123:456:7:89:m:b:x:", longopts, &option_idx)) != EOF) {
|
||||||
#ifdef DEBUG_TRACE
|
#ifdef DEBUG_TRACE
|
||||||
if(trace) fprintf(trace, " #### -%c [%s] #### \n", opt, optarg ? optarg : "");
|
if(trace) fprintf(trace, " #### -%c [%s] #### \n", opt, optarg ? optarg : "");
|
||||||
#endif
|
#endif
|
||||||
@@ -497,6 +515,10 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
_protoFilePath = optarg;
|
_protoFilePath = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'c':
|
||||||
|
_customCategoryFilePath = optarg;
|
||||||
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
capture_for = atoi(optarg);
|
capture_for = atoi(optarg);
|
||||||
capture_until = capture_for + time(NULL);
|
capture_until = capture_for + time(NULL);
|
||||||
@@ -515,8 +537,12 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'V':
|
case 'V':
|
||||||
printf("%d\n",atoi(optarg) );
|
nDPI_LogLevel = atoi(optarg);
|
||||||
nDPI_traceLevel = atoi(optarg);
|
if(nDPI_LogLevel < 0) nDPI_LogLevel = 0;
|
||||||
|
if(nDPI_LogLevel > 3) {
|
||||||
|
nDPI_LogLevel = 3;
|
||||||
|
_debug_protocols = strdup("all");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
@@ -525,7 +551,7 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
|
|
||||||
case 'j':
|
case 'j':
|
||||||
#ifndef HAVE_JSON_C
|
#ifndef HAVE_JSON_C
|
||||||
printf("WARNING: this copy of ndpiReader has been compiled without JSON-C: json export disabled\n");
|
printf("WARNING: this copy of ndpiReader has been compiled without json-c: JSON export disabled\n");
|
||||||
#else
|
#else
|
||||||
_jsonFilePath = optarg;
|
_jsonFilePath = optarg;
|
||||||
json_flag = 1;
|
json_flag = 1;
|
||||||
@@ -542,6 +568,7 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
|
|
||||||
case 'q':
|
case 'q':
|
||||||
quiet_mode = 1;
|
quiet_mode = 1;
|
||||||
|
nDPI_LogLevel = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Extcap */
|
/* Extcap */
|
||||||
@@ -570,7 +597,8 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '8':
|
case '8':
|
||||||
nDPI_traceLevel = 9;
|
nDPI_LogLevel = NDPI_LOG_DEBUG_EXTRA;
|
||||||
|
_debug_protocols = strdup("all");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '9':
|
case '9':
|
||||||
@@ -578,6 +606,10 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
if (extcap_packet_filter == NDPI_PROTOCOL_UNKNOWN) extcap_packet_filter = atoi(optarg);
|
if (extcap_packet_filter == NDPI_PROTOCOL_UNKNOWN) extcap_packet_filter = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 257:
|
||||||
|
_debug_protocols = strdup(optarg);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
help(0);
|
help(0);
|
||||||
break;
|
break;
|
||||||
@@ -628,12 +660,12 @@ static void parseOptions(int argc, char **argv) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief From IPPROTO to string NAME
|
* @brief From IPPROTO to string NAME
|
||||||
*/
|
*/
|
||||||
static char* ipProto2Name(u_int16_t proto_id) {
|
static char* ipProto2Name(u_int16_t proto_id) {
|
||||||
|
|
||||||
static char proto[8];
|
static char proto[8];
|
||||||
|
|
||||||
switch(proto_id) {
|
switch(proto_id) {
|
||||||
@@ -661,12 +693,12 @@ static char* ipProto2Name(u_int16_t proto_id) {
|
|||||||
return(proto);
|
return(proto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A faster replacement for inet_ntoa().
|
* @brief A faster replacement for inet_ntoa().
|
||||||
*/
|
*/
|
||||||
char* intoaV4(u_int32_t addr, char* buf, u_int16_t bufLen) {
|
char* intoaV4(u_int32_t addr, char* buf, u_int16_t bufLen) {
|
||||||
|
|
||||||
char *cp, *retStr;
|
char *cp, *retStr;
|
||||||
uint byte;
|
uint byte;
|
||||||
int n;
|
int n;
|
||||||
@@ -695,6 +727,8 @@ char* intoaV4(u_int32_t addr, char* buf, u_int16_t bufLen) {
|
|||||||
return(retStr);
|
return(retStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Print the flow
|
* @brief Print the flow
|
||||||
*/
|
*/
|
||||||
@@ -734,6 +768,12 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
|
|||||||
flow->detected_protocol.app_protocol,
|
flow->detected_protocol.app_protocol,
|
||||||
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, flow->detected_protocol.app_protocol));
|
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, flow->detected_protocol.app_protocol));
|
||||||
|
|
||||||
|
if(flow->detected_protocol.category != 0)
|
||||||
|
fprintf(out, "[cat: %s/%u]",
|
||||||
|
ndpi_category_get_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
|
flow->detected_protocol.category),
|
||||||
|
(unsigned int)flow->detected_protocol.category);
|
||||||
|
|
||||||
fprintf(out, "[%u pkts/%llu bytes ", flow->src2dst_packets, (long long unsigned int) flow->src2dst_bytes);
|
fprintf(out, "[%u pkts/%llu bytes ", flow->src2dst_packets, (long long unsigned int) flow->src2dst_bytes);
|
||||||
fprintf(out, "%s %u pkts/%llu bytes]",
|
fprintf(out, "%s %u pkts/%llu bytes]",
|
||||||
(flow->dst2src_packets > 0) ? "<->" : "->",
|
(flow->dst2src_packets > 0) ? "<->" : "->",
|
||||||
@@ -758,16 +798,20 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
|
|||||||
json_object_object_add(jObj,"host_b.port",json_object_new_int(ntohs(flow->dst_port)));
|
json_object_object_add(jObj,"host_b.port",json_object_new_int(ntohs(flow->dst_port)));
|
||||||
|
|
||||||
if(flow->detected_protocol.master_protocol)
|
if(flow->detected_protocol.master_protocol)
|
||||||
json_object_object_add(jObj,"detected.master_protocol",json_object_new_int(flow->detected_protocol.master_protocol));
|
json_object_object_add(jObj,"detected.master_protocol",
|
||||||
|
json_object_new_int(flow->detected_protocol.master_protocol));
|
||||||
|
|
||||||
json_object_object_add(jObj,"detected.app_protocol",json_object_new_int(flow->detected_protocol.app_protocol));
|
json_object_object_add(jObj,"detected.app_protocol",
|
||||||
|
json_object_new_int(flow->detected_protocol.app_protocol));
|
||||||
|
|
||||||
if(flow->detected_protocol.master_protocol) {
|
if(flow->detected_protocol.master_protocol) {
|
||||||
char tmp[256];
|
char tmp[256];
|
||||||
|
|
||||||
snprintf(tmp, sizeof(tmp), "%s.%s",
|
snprintf(tmp, sizeof(tmp), "%s.%s",
|
||||||
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, flow->detected_protocol.master_protocol),
|
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct, flow->detected_protocol.app_protocol));
|
flow->detected_protocol.master_protocol),
|
||||||
|
ndpi_get_proto_name(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
|
flow->detected_protocol.app_protocol));
|
||||||
|
|
||||||
json_object_object_add(jObj,"detected.protocol.name",
|
json_object_object_add(jObj,"detected.protocol.name",
|
||||||
json_object_new_string(tmp));
|
json_object_new_string(tmp));
|
||||||
@@ -802,12 +846,13 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Unknown Proto Walker
|
* @brief Unknown Proto Walker
|
||||||
*/
|
*/
|
||||||
static void node_print_unknown_proto_walker(const void *node, ndpi_VISIT which, int depth, void *user_data) {
|
static void node_print_unknown_proto_walker(const void *node,
|
||||||
|
ndpi_VISIT which, int depth, void *user_data) {
|
||||||
struct ndpi_flow_info *flow = *(struct ndpi_flow_info**)node;
|
struct ndpi_flow_info *flow = *(struct ndpi_flow_info**)node;
|
||||||
u_int16_t thread_id = *((u_int16_t*)user_data);
|
u_int16_t thread_id = *((u_int16_t*)user_data);
|
||||||
|
|
||||||
@@ -820,11 +865,13 @@ static void node_print_unknown_proto_walker(const void *node, ndpi_VISIT which,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Known Proto Walker
|
* @brief Known Proto Walker
|
||||||
*/
|
*/
|
||||||
static void node_print_known_proto_walker(const void *node, ndpi_VISIT which, int depth, void *user_data) {
|
static void node_print_known_proto_walker(const void *node,
|
||||||
|
ndpi_VISIT which, int depth, void *user_data) {
|
||||||
struct ndpi_flow_info *flow = *(struct ndpi_flow_info**)node;
|
struct ndpi_flow_info *flow = *(struct ndpi_flow_info**)node;
|
||||||
u_int16_t thread_id = *((u_int16_t*)user_data);
|
u_int16_t thread_id = *((u_int16_t*)user_data);
|
||||||
|
|
||||||
@@ -837,6 +884,7 @@ static void node_print_known_proto_walker(const void *node, ndpi_VISIT which, in
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Guess Undetected Protocol
|
* @brief Guess Undetected Protocol
|
||||||
@@ -856,6 +904,7 @@ static u_int16_t node_guess_undetected_protocol(u_int16_t thread_id, struct ndpi
|
|||||||
return(flow->detected_protocol.app_protocol);
|
return(flow->detected_protocol.app_protocol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Proto Guess Walker
|
* @brief Proto Guess Walker
|
||||||
@@ -875,6 +924,7 @@ static void node_proto_guess_walker(const void *node, ndpi_VISIT which, int dept
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_ndpi_collected_info(ndpi_thread_info[thread_id].workflow, flow);
|
process_ndpi_collected_info(ndpi_thread_info[thread_id].workflow, flow);
|
||||||
|
|
||||||
ndpi_thread_info[thread_id].workflow->stats.protocol_counter[flow->detected_protocol.app_protocol] += flow->src2dst_packets + flow->dst2src_packets;
|
ndpi_thread_info[thread_id].workflow->stats.protocol_counter[flow->detected_protocol.app_protocol] += flow->src2dst_packets + flow->dst2src_packets;
|
||||||
ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes[flow->detected_protocol.app_protocol] += flow->src2dst_bytes + flow->dst2src_bytes;
|
ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes[flow->detected_protocol.app_protocol] += flow->src2dst_bytes + flow->dst2src_bytes;
|
||||||
ndpi_thread_info[thread_id].workflow->stats.protocol_flows[flow->detected_protocol.app_protocol]++;
|
ndpi_thread_info[thread_id].workflow->stats.protocol_flows[flow->detected_protocol.app_protocol]++;
|
||||||
@@ -982,7 +1032,6 @@ void updateTopIpAddress(u_int32_t addr, u_int8_t version, const char *proto,
|
|||||||
int min = count;
|
int min = count;
|
||||||
int update = 0;
|
int update = 0;
|
||||||
int min_i = 0;
|
int min_i = 0;
|
||||||
int r;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if(count == 0) return;
|
if(count == 0) return;
|
||||||
@@ -1116,6 +1165,7 @@ static struct receiver *cutBackTo(struct receiver **receivers, u_int32_t size, u
|
|||||||
}
|
}
|
||||||
|
|
||||||
return(NULL);
|
return(NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *********************************************** */
|
/* *********************************************** */
|
||||||
@@ -1320,7 +1370,6 @@ static void port_stats_walker(const void *node, ndpi_VISIT which, int depth, voi
|
|||||||
* @brief Idle Scan Walker
|
* @brief Idle Scan Walker
|
||||||
*/
|
*/
|
||||||
static void node_idle_scan_walker(const void *node, ndpi_VISIT which, int depth, void *user_data) {
|
static void node_idle_scan_walker(const void *node, ndpi_VISIT which, int depth, void *user_data) {
|
||||||
|
|
||||||
struct ndpi_flow_info *flow = *(struct ndpi_flow_info **) node;
|
struct ndpi_flow_info *flow = *(struct ndpi_flow_info **) node;
|
||||||
u_int16_t thread_id = *((u_int16_t *) user_data);
|
u_int16_t thread_id = *((u_int16_t *) user_data);
|
||||||
|
|
||||||
@@ -1352,7 +1401,6 @@ static void node_idle_scan_walker(const void *node, ndpi_VISIT which, int depth,
|
|||||||
static void on_protocol_discovered(struct ndpi_workflow * workflow,
|
static void on_protocol_discovered(struct ndpi_workflow * workflow,
|
||||||
struct ndpi_flow_info * flow,
|
struct ndpi_flow_info * flow,
|
||||||
void * udata) {
|
void * udata) {
|
||||||
|
|
||||||
const u_int16_t thread_id = (uintptr_t) udata;
|
const u_int16_t thread_id = (uintptr_t) udata;
|
||||||
|
|
||||||
if(verbose > 1) {
|
if(verbose > 1) {
|
||||||
@@ -1380,7 +1428,7 @@ static void debug_printf(u_int32_t protocol, void *id_struct,
|
|||||||
struct tm result;
|
struct tm result;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(log_level <= nDPI_traceLevel) {
|
if(log_level <= nDPI_LogLevel) {
|
||||||
char buf[8192], out_buf[8192];
|
char buf[8192], out_buf[8192];
|
||||||
char theDate[32];
|
char theDate[32];
|
||||||
const char *extra_msg = "";
|
const char *extra_msg = "";
|
||||||
@@ -1412,7 +1460,6 @@ static void debug_printf(u_int32_t protocol, void *id_struct,
|
|||||||
* @brief Setup for detection begin
|
* @brief Setup for detection begin
|
||||||
*/
|
*/
|
||||||
static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
|
static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
|
||||||
|
|
||||||
NDPI_PROTOCOL_BITMASK all;
|
NDPI_PROTOCOL_BITMASK all;
|
||||||
struct ndpi_workflow_prefs prefs;
|
struct ndpi_workflow_prefs prefs;
|
||||||
|
|
||||||
@@ -1426,23 +1473,71 @@ static void setupDetection(u_int16_t thread_id, pcap_t * pcap_handle) {
|
|||||||
ndpi_thread_info[thread_id].workflow = ndpi_workflow_init(&prefs, pcap_handle);
|
ndpi_thread_info[thread_id].workflow = ndpi_workflow_init(&prefs, pcap_handle);
|
||||||
|
|
||||||
/* Preferences */
|
/* Preferences */
|
||||||
ndpi_thread_info[thread_id].workflow->ndpi_struct->http_dont_dissect_response = 0;
|
ndpi_set_detection_preferences(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
ndpi_thread_info[thread_id].workflow->ndpi_struct->dns_dissect_response = 0;
|
ndpi_pref_http_dont_dissect_response, 0);
|
||||||
|
ndpi_set_detection_preferences(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
|
ndpi_pref_dns_dissect_response, 0);
|
||||||
|
ndpi_set_detection_preferences(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
|
ndpi_pref_enable_category_substring_match, 1);
|
||||||
|
|
||||||
ndpi_workflow_set_flow_detected_callback(ndpi_thread_info[thread_id].workflow,
|
ndpi_workflow_set_flow_detected_callback(ndpi_thread_info[thread_id].workflow,
|
||||||
on_protocol_discovered, (void *)(uintptr_t)thread_id);
|
on_protocol_discovered,
|
||||||
|
(void *)(uintptr_t)thread_id);
|
||||||
|
|
||||||
// enable all protocols
|
// enable all protocols
|
||||||
NDPI_BITMASK_SET_ALL(all);
|
NDPI_BITMASK_SET_ALL(all);
|
||||||
ndpi_set_protocol_detection_bitmask2(ndpi_thread_info[thread_id].workflow->ndpi_struct, &all);
|
ndpi_set_protocol_detection_bitmask2(ndpi_thread_info[thread_id].workflow->ndpi_struct, &all);
|
||||||
|
|
||||||
// clear memory for results
|
// clear memory for results
|
||||||
memset(ndpi_thread_info[thread_id].workflow->stats.protocol_counter, 0, sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_counter));
|
memset(ndpi_thread_info[thread_id].workflow->stats.protocol_counter, 0,
|
||||||
memset(ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes, 0, sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes));
|
sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_counter));
|
||||||
memset(ndpi_thread_info[thread_id].workflow->stats.protocol_flows, 0, sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_flows));
|
memset(ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes, 0,
|
||||||
|
sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_counter_bytes));
|
||||||
|
memset(ndpi_thread_info[thread_id].workflow->stats.protocol_flows, 0,
|
||||||
|
sizeof(ndpi_thread_info[thread_id].workflow->stats.protocol_flows));
|
||||||
|
|
||||||
if(_protoFilePath != NULL)
|
if(_protoFilePath != NULL)
|
||||||
ndpi_load_protocols_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _protoFilePath);
|
ndpi_load_protocols_file(ndpi_thread_info[thread_id].workflow->ndpi_struct, _protoFilePath);
|
||||||
|
|
||||||
|
if(_customCategoryFilePath) {
|
||||||
|
FILE *fd = fopen(_customCategoryFilePath, "r");
|
||||||
|
|
||||||
|
if(fd) {
|
||||||
|
while(fd) {
|
||||||
|
char buffer[512], *line, *name, *category;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if(!(line = fgets(buffer, sizeof(buffer), fd)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if(((i = strlen(line)) <= 1) || (line[0] == '#'))
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
line[i-1] = '\0';
|
||||||
|
|
||||||
|
name = strtok(line, "\t");
|
||||||
|
if(name) {
|
||||||
|
category = strtok(NULL, "\t");
|
||||||
|
|
||||||
|
if(category) {
|
||||||
|
int fields[4];
|
||||||
|
|
||||||
|
// printf("Loading %s\t%s\n", name, category);
|
||||||
|
|
||||||
|
if(sscanf(name, "%d.%d.%d.%d", &fields[0], &fields[1], &fields[2], &fields[3]) == 4)
|
||||||
|
ndpi_load_ip_category(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
|
name, (ndpi_protocol_category_t)atoi(category));
|
||||||
|
else
|
||||||
|
ndpi_load_hostname_category(ndpi_thread_info[thread_id].workflow->ndpi_struct,
|
||||||
|
name, (ndpi_protocol_category_t)atoi(category));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ndpi_enable_loaded_categories(ndpi_thread_info[thread_id].workflow->ndpi_struct);
|
||||||
|
} else
|
||||||
|
printf("ERROR: Unable to read file %s\n", _customCategoryFilePath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1530,7 +1625,9 @@ static void json_open_stats_file() {
|
|||||||
|
|
||||||
static void json_close_stats_file() {
|
static void json_close_stats_file() {
|
||||||
json_object *jObjFinal = json_object_new_object();
|
json_object *jObjFinal = json_object_new_object();
|
||||||
json_object_object_add(jObjFinal,"duration.in.seconds",json_object_new_int(pcap_analysis_duration));
|
|
||||||
|
json_object_object_add(jObjFinal,"duration.in.seconds",
|
||||||
|
json_object_new_int(pcap_analysis_duration));
|
||||||
json_object_object_add(jObjFinal,"statistics", jArray_topStats);
|
json_object_object_add(jObjFinal,"statistics", jArray_topStats);
|
||||||
fprintf(stats_fp,"%s\n",json_object_to_json_string(jObjFinal));
|
fprintf(stats_fp,"%s\n",json_object_to_json_string(jObjFinal));
|
||||||
fclose(stats_fp);
|
fclose(stats_fp);
|
||||||
@@ -1819,6 +1916,7 @@ static void printResults(u_int64_t tot_usec) {
|
|||||||
char buf[32];
|
char buf[32];
|
||||||
#ifdef HAVE_JSON_C
|
#ifdef HAVE_JSON_C
|
||||||
FILE *json_fp = NULL;
|
FILE *json_fp = NULL;
|
||||||
|
u_int8_t dont_close_json_fp = 0;
|
||||||
json_object *jObj_main = NULL, *jObj_trafficStats, *jArray_detProto = NULL, *jObj;
|
json_object *jObj_main = NULL, *jObj_trafficStats, *jArray_detProto = NULL, *jObj;
|
||||||
#endif
|
#endif
|
||||||
long long unsigned int breed_stats[NUM_BREEDS] = { 0 };
|
long long unsigned int breed_stats[NUM_BREEDS] = { 0 };
|
||||||
@@ -1831,8 +1929,10 @@ static void printResults(u_int64_t tot_usec) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for(i=0; i<NUM_ROOTS; i++) {
|
for(i=0; i<NUM_ROOTS; i++) {
|
||||||
ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[i], node_proto_guess_walker, &thread_id);
|
ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[i],
|
||||||
if(verbose == 3 || stats_flag) ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[i], port_stats_walker, &thread_id);
|
node_proto_guess_walker, &thread_id);
|
||||||
|
if(verbose == 3 || stats_flag) ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[i],
|
||||||
|
port_stats_walker, &thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stats aggregation */
|
/* Stats aggregation */
|
||||||
@@ -1866,7 +1966,7 @@ static void printResults(u_int64_t tot_usec) {
|
|||||||
|
|
||||||
if(!quiet_mode) {
|
if(!quiet_mode) {
|
||||||
printf("\nnDPI Memory statistics:\n");
|
printf("\nnDPI Memory statistics:\n");
|
||||||
printf("\tnDPI Memory (once): %-13s\n", formatBytes(sizeof(struct ndpi_detection_module_struct), buf, sizeof(buf)));
|
printf("\tnDPI Memory (once): %-13s\n", formatBytes(ndpi_get_ndpi_detection_module_size(), buf, sizeof(buf)));
|
||||||
printf("\tFlow Memory (per flow): %-13s\n", formatBytes(sizeof(struct ndpi_flow_struct), buf, sizeof(buf)));
|
printf("\tFlow Memory (per flow): %-13s\n", formatBytes(sizeof(struct ndpi_flow_struct), buf, sizeof(buf)));
|
||||||
printf("\tActual Memory: %-13s\n", formatBytes(current_ndpi_memory, buf, sizeof(buf)));
|
printf("\tActual Memory: %-13s\n", formatBytes(current_ndpi_memory, buf, sizeof(buf)));
|
||||||
printf("\tPeak Memory: %-13s\n", formatBytes(max_ndpi_memory, buf, sizeof(buf)));
|
printf("\tPeak Memory: %-13s\n", formatBytes(max_ndpi_memory, buf, sizeof(buf)));
|
||||||
@@ -1927,10 +2027,14 @@ static void printResults(u_int64_t tot_usec) {
|
|||||||
|
|
||||||
if(json_flag) {
|
if(json_flag) {
|
||||||
#ifdef HAVE_JSON_C
|
#ifdef HAVE_JSON_C
|
||||||
if((json_fp = fopen(_jsonFilePath,"w")) == NULL) {
|
if(!strcmp(_jsonFilePath, "-"))
|
||||||
|
json_fp = stderr, dont_close_json_fp = 1;
|
||||||
|
else if((json_fp = fopen(_jsonFilePath,"w")) == NULL) {
|
||||||
printf("Error creating .json file %s\n", _jsonFilePath);
|
printf("Error creating .json file %s\n", _jsonFilePath);
|
||||||
json_flag = 0;
|
json_flag = 0;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if(json_flag) {
|
||||||
jObj_main = json_object_new_object();
|
jObj_main = json_object_new_object();
|
||||||
jObj_trafficStats = json_object_new_object();
|
jObj_trafficStats = json_object_new_object();
|
||||||
jArray_detProto = json_object_new_array();
|
jArray_detProto = json_object_new_array();
|
||||||
@@ -2081,7 +2185,7 @@ static void printResults(u_int64_t tot_usec) {
|
|||||||
json_object_object_add(jObj_main,"unknown.flows",jArray_unknown_flows);
|
json_object_object_add(jObj_main,"unknown.flows",jArray_unknown_flows);
|
||||||
|
|
||||||
fprintf(json_fp,"%s\n",json_object_to_json_string(jObj_main));
|
fprintf(json_fp,"%s\n",json_object_to_json_string(jObj_main));
|
||||||
fclose(json_fp);
|
if(!dont_close_json_fp) fclose(json_fp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2313,11 +2417,11 @@ static void pcap_process_packet(u_char *args,
|
|||||||
if(live_capture) {
|
if(live_capture) {
|
||||||
if(ndpi_thread_info[thread_id].last_idle_scan_time + IDLE_SCAN_PERIOD < ndpi_thread_info[thread_id].workflow->last_time) {
|
if(ndpi_thread_info[thread_id].last_idle_scan_time + IDLE_SCAN_PERIOD < ndpi_thread_info[thread_id].workflow->last_time) {
|
||||||
/* scan for idle flows */
|
/* scan for idle flows */
|
||||||
ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[ndpi_thread_info[thread_id].idle_scan_idx], node_idle_scan_walker, &thread_id);
|
ndpi_twalk(ndpi_thread_info[thread_id].workflow->ndpi_flows_root[ndpi_thread_info[thread_id].idle_scan_idx],
|
||||||
|
node_idle_scan_walker, &thread_id);
|
||||||
|
|
||||||
/* remove idle flows (unfortunately we cannot do this inline) */
|
/* remove idle flows (unfortunately we cannot do this inline) */
|
||||||
while(ndpi_thread_info[thread_id].num_idle_flows > 0) {
|
while(ndpi_thread_info[thread_id].num_idle_flows > 0) {
|
||||||
|
|
||||||
/* search and delete the idle flow from the "ndpi_flow_root" (see struct reader thread) - here flows are the node of a b-tree */
|
/* search and delete the idle flow from the "ndpi_flow_root" (see struct reader thread) - here flows are the node of a b-tree */
|
||||||
ndpi_tdelete(ndpi_thread_info[thread_id].idle_flows[--ndpi_thread_info[thread_id].num_idle_flows],
|
ndpi_tdelete(ndpi_thread_info[thread_id].idle_flows[--ndpi_thread_info[thread_id].num_idle_flows],
|
||||||
&ndpi_thread_info[thread_id].workflow->ndpi_flows_root[ndpi_thread_info[thread_id].idle_scan_idx],
|
&ndpi_thread_info[thread_id].workflow->ndpi_flows_root[ndpi_thread_info[thread_id].idle_scan_idx],
|
||||||
@@ -2395,6 +2499,7 @@ static void pcap_process_packet(u_char *args,
|
|||||||
memset(&ndpi_thread_info[thread_id].workflow->stats, 0, sizeof(struct ndpi_stats));
|
memset(&ndpi_thread_info[thread_id].workflow->stats, 0, sizeof(struct ndpi_stats));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!quiet_mode)
|
||||||
printf("\n-------------------------------------------\n\n");
|
printf("\n-------------------------------------------\n\n");
|
||||||
|
|
||||||
memcpy(&begin, &end, sizeof(begin));
|
memcpy(&begin, &end, sizeof(begin));
|
||||||
@@ -3119,9 +3224,18 @@ static void produceBpfFilter(char *filePath) {
|
|||||||
/**
|
/**
|
||||||
@brief MAIN FUNCTION
|
@brief MAIN FUNCTION
|
||||||
**/
|
**/
|
||||||
|
#ifdef APP_HAS_OWN_MAIN
|
||||||
|
int orginal_main(int argc, char **argv) {
|
||||||
|
#else
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if(ndpi_get_api_version() != NDPI_API_VERSION) {
|
||||||
|
printf("nDPI Library version mismatch: please make sure this code and the nDPI library are in sync\n");
|
||||||
|
return(-1);
|
||||||
|
}
|
||||||
|
|
||||||
automataUnitTest();
|
automataUnitTest();
|
||||||
|
|
||||||
ndpi_info_mod = ndpi_init_detection_module();
|
ndpi_info_mod = ndpi_init_detection_module();
|
||||||
|
|||||||
+135
-18
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_util.c
|
* ndpi_util.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-17 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,6 +21,10 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "ndpi_config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@@ -105,7 +109,69 @@ static void free_wrapper(void *freeable) {
|
|||||||
|
|
||||||
/* ***************************************************** */
|
/* ***************************************************** */
|
||||||
|
|
||||||
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs, pcap_t * pcap_handle) {
|
static uint16_t ndpi_get_proto_id(struct ndpi_detection_module_struct *ndpi_mod, const char *name) {
|
||||||
|
uint16_t proto_id;
|
||||||
|
char *e;
|
||||||
|
unsigned long p = strtol(name,&e,0);
|
||||||
|
ndpi_proto_defaults_t *proto_defaults = ndpi_get_proto_defaults(ndpi_mod);
|
||||||
|
|
||||||
|
if(e && !*e) {
|
||||||
|
if(p < NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS &&
|
||||||
|
proto_defaults[p].protoName) return (uint16_t)p;
|
||||||
|
return NDPI_PROTOCOL_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(proto_id=NDPI_PROTOCOL_UNKNOWN; proto_id < NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS; proto_id++) {
|
||||||
|
if(proto_defaults[proto_id].protoName &&
|
||||||
|
!strcasecmp(proto_defaults[proto_id].protoName,name))
|
||||||
|
return proto_id;
|
||||||
|
}
|
||||||
|
return NDPI_PROTOCOL_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ***************************************************** */
|
||||||
|
|
||||||
|
static NDPI_PROTOCOL_BITMASK debug_bitmask;
|
||||||
|
static char _proto_delim[] = " \t,:;";
|
||||||
|
static int parse_debug_proto(struct ndpi_detection_module_struct *ndpi_mod, char *str) {
|
||||||
|
char *n;
|
||||||
|
uint16_t proto;
|
||||||
|
char op=1;
|
||||||
|
for(n = strtok(str,_proto_delim); n && *n; n = strtok(NULL,_proto_delim)) {
|
||||||
|
if(*n == '-') {
|
||||||
|
op = 0;
|
||||||
|
n++;
|
||||||
|
} else if(*n == '+') {
|
||||||
|
op = 1;
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
if(!strcmp(n,"all")) {
|
||||||
|
if(op)
|
||||||
|
NDPI_BITMASK_SET_ALL(debug_bitmask);
|
||||||
|
else
|
||||||
|
NDPI_BITMASK_RESET(debug_bitmask);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
proto = ndpi_get_proto_id(ndpi_mod, n);
|
||||||
|
if(proto == NDPI_PROTOCOL_UNKNOWN && strcmp(n,"unknown") && strcmp(n,"0")) {
|
||||||
|
fprintf(stderr,"Invalid protocol %s\n",n);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if(op)
|
||||||
|
NDPI_BITMASK_ADD(debug_bitmask,proto);
|
||||||
|
else
|
||||||
|
NDPI_BITMASK_DEL(debug_bitmask,proto);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ***************************************************** */
|
||||||
|
|
||||||
|
extern char *_debug_protocols;
|
||||||
|
static int _debug_protocols_ok = 0;
|
||||||
|
|
||||||
|
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_malloc(malloc_wrapper), set_ndpi_free(free_wrapper);
|
||||||
set_ndpi_flow_malloc(NULL), set_ndpi_flow_free(NULL);
|
set_ndpi_flow_malloc(NULL), set_ndpi_flow_free(NULL);
|
||||||
/* TODO: just needed here to init ndpi malloc wrapper */
|
/* TODO: just needed here to init ndpi malloc wrapper */
|
||||||
@@ -122,7 +188,22 @@ struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * pre
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ndpi_set_log_level(module, nDPI_LogLevel);
|
||||||
|
|
||||||
|
if(_debug_protocols != NULL && ! _debug_protocols_ok) {
|
||||||
|
if(parse_debug_proto(module,_debug_protocols))
|
||||||
|
exit(-1);
|
||||||
|
_debug_protocols_ok = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||||
|
NDPI_BITMASK_RESET(module->debug_bitmask);
|
||||||
|
if(_debug_protocols_ok)
|
||||||
|
module->debug_bitmask = debug_bitmask;
|
||||||
|
#endif
|
||||||
|
|
||||||
workflow->ndpi_flows_root = ndpi_calloc(workflow->prefs.num_roots, sizeof(void *));
|
workflow->ndpi_flows_root = ndpi_calloc(workflow->prefs.num_roots, sizeof(void *));
|
||||||
|
|
||||||
return workflow;
|
return workflow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -296,6 +377,25 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
idx = hashval % workflow->prefs.num_roots;
|
idx = hashval % workflow->prefs.num_roots;
|
||||||
ret = ndpi_tfind(&flow, &workflow->ndpi_flows_root[idx], ndpi_workflow_node_cmp);
|
ret = ndpi_tfind(&flow, &workflow->ndpi_flows_root[idx], ndpi_workflow_node_cmp);
|
||||||
|
|
||||||
|
|
||||||
|
/* to avoid two nodes in one binary tree for a flow */
|
||||||
|
int is_changed = 0;
|
||||||
|
if(ret == NULL) {
|
||||||
|
u_int32_t orig_src_ip = flow.src_ip;
|
||||||
|
u_int16_t orig_src_port = flow.src_port;
|
||||||
|
u_int32_t orig_dst_ip = flow.dst_ip;
|
||||||
|
u_int16_t orig_dst_port = flow.dst_port;
|
||||||
|
|
||||||
|
flow.src_ip = orig_dst_ip;
|
||||||
|
flow.src_port = orig_dst_port;
|
||||||
|
flow.dst_ip = orig_src_ip;
|
||||||
|
flow.dst_port = orig_src_port;
|
||||||
|
|
||||||
|
is_changed = 1;
|
||||||
|
|
||||||
|
ret = ndpi_tfind(&flow, &workflow->ndpi_flows_root[idx], ndpi_workflow_node_cmp);
|
||||||
|
}
|
||||||
|
|
||||||
if(ret == NULL) {
|
if(ret == NULL) {
|
||||||
if(workflow->stats.ndpi_flow_count == workflow->prefs.max_ndpi_flows) {
|
if(workflow->stats.ndpi_flow_count == workflow->prefs.max_ndpi_flows) {
|
||||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_ERROR,
|
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_ERROR,
|
||||||
@@ -359,6 +459,17 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
} else {
|
} else {
|
||||||
struct ndpi_flow_info *flow = *(struct ndpi_flow_info**)ret;
|
struct ndpi_flow_info *flow = *(struct ndpi_flow_info**)ret;
|
||||||
|
|
||||||
|
if(is_changed) {
|
||||||
|
if(flow->src_ip == iph->saddr
|
||||||
|
&& flow->dst_ip == iph->daddr
|
||||||
|
&& flow->src_port == htons(*sport)
|
||||||
|
&& flow->dst_port == htons(*dport)
|
||||||
|
)
|
||||||
|
*src = flow->dst_id, *dst = flow->src_id, *src_to_dst_direction = 0, flow->bidirectional = 1;
|
||||||
|
else
|
||||||
|
*src = flow->src_id, *dst = flow->dst_id, *src_to_dst_direction = 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
if(flow->src_ip == iph->saddr
|
if(flow->src_ip == iph->saddr
|
||||||
&& flow->dst_ip == iph->daddr
|
&& flow->dst_ip == iph->daddr
|
||||||
&& flow->src_port == htons(*sport)
|
&& flow->src_port == htons(*sport)
|
||||||
@@ -367,7 +478,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
*src = flow->src_id, *dst = flow->dst_id, *src_to_dst_direction = 1;
|
*src = flow->src_id, *dst = flow->dst_id, *src_to_dst_direction = 1;
|
||||||
else
|
else
|
||||||
*src = flow->dst_id, *dst = flow->src_id, *src_to_dst_direction = 0, flow->bidirectional = 1;
|
*src = flow->dst_id, *dst = flow->src_id, *src_to_dst_direction = 0, flow->bidirectional = 1;
|
||||||
|
}
|
||||||
return flow;
|
return flow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -393,7 +504,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflo
|
|||||||
iph.version = IPVERSION;
|
iph.version = IPVERSION;
|
||||||
iph.saddr = iph6->ip6_src.u6_addr.u6_addr32[2] + iph6->ip6_src.u6_addr.u6_addr32[3];
|
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.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;
|
iph.protocol = iph6->ip6_hdr.ip6_un1_nxt;
|
||||||
|
|
||||||
if(iph.protocol == IPPROTO_DSTOPTS /* IPv6 destination option */) {
|
if(iph.protocol == IPPROTO_DSTOPTS /* IPv6 destination option */) {
|
||||||
u_int8_t *options = (u_int8_t*)iph6 + sizeof(const struct ndpi_ipv6hdr);
|
u_int8_t *options = (u_int8_t*)iph6 + sizeof(const struct ndpi_ipv6hdr);
|
||||||
@@ -403,9 +514,10 @@ static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflo
|
|||||||
|
|
||||||
return(get_ndpi_flow_info(workflow, 6, vlan_id, &iph, iph6, ip_offset,
|
return(get_ndpi_flow_info(workflow, 6, vlan_id, &iph, iph6, ip_offset,
|
||||||
sizeof(struct ndpi_ipv6hdr),
|
sizeof(struct ndpi_ipv6hdr),
|
||||||
ntohs(iph6->ip6_ctlun.ip6_un1.ip6_un1_plen),
|
ntohs(iph6->ip6_hdr.ip6_un1_plen),
|
||||||
tcph, udph, sport, dport,
|
tcph, udph, sport, dport,
|
||||||
src, dst, proto, payload, payload_len, src_to_dst_direction));
|
src, dst, proto, payload,
|
||||||
|
payload_len, src_to_dst_direction));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ****************************************************** */
|
/* ****************************************************** */
|
||||||
@@ -421,7 +533,9 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
|||||||
int i, j, n = 0;
|
int i, j, n = 0;
|
||||||
|
|
||||||
for(i=0, j = 0; j < sizeof(flow->bittorent_hash)-1; i++) {
|
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]);
|
sprintf(&flow->bittorent_hash[j], "%02x",
|
||||||
|
flow->ndpi_flow->protos.bittorrent.hash[i]);
|
||||||
|
|
||||||
j += 2, n += flow->ndpi_flow->protos.bittorrent.hash[i];
|
j += 2, n += flow->ndpi_flow->protos.bittorrent.hash[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -447,9 +561,9 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
|||||||
else if((flow->detected_protocol.app_protocol == NDPI_PROTOCOL_SSL)
|
else if((flow->detected_protocol.app_protocol == NDPI_PROTOCOL_SSL)
|
||||||
|| (flow->detected_protocol.master_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",
|
snprintf(flow->ssh_ssl.client_info, sizeof(flow->ssh_ssl.client_info), "%s",
|
||||||
flow->ndpi_flow->protos.ssl.client_certificate);
|
flow->ndpi_flow->protos.stun_ssl.ssl.client_certificate);
|
||||||
snprintf(flow->ssh_ssl.server_info, sizeof(flow->ssh_ssl.server_info), "%s",
|
snprintf(flow->ssh_ssl.server_info, sizeof(flow->ssh_ssl.server_info), "%s",
|
||||||
flow->ndpi_flow->protos.ssl.server_certificate);
|
flow->ndpi_flow->protos.stun_ssl.ssl.server_certificate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -548,7 +662,8 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
return(flow->detected_protocol);
|
return(flow->detected_protocol);
|
||||||
}
|
}
|
||||||
|
|
||||||
flow->detected_protocol = ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
flow->detected_protocol =
|
||||||
|
ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
||||||
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
||||||
ipsize, time, src, dst);
|
ipsize, time, src, dst);
|
||||||
|
|
||||||
@@ -592,7 +707,10 @@ struct ndpi_proto ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
|
|||||||
const struct ndpi_wifi_header *wifi;
|
const struct ndpi_wifi_header *wifi;
|
||||||
|
|
||||||
/* --- MPLS header --- */
|
/* --- MPLS header --- */
|
||||||
struct ndpi_mpls_header *mpls;
|
union mpls {
|
||||||
|
uint32_t u32;
|
||||||
|
struct ndpi_mpls_header mpls;
|
||||||
|
} mpls;
|
||||||
|
|
||||||
/** --- IP header --- **/
|
/** --- IP header --- **/
|
||||||
struct ndpi_iphdr *iph;
|
struct ndpi_iphdr *iph;
|
||||||
@@ -749,15 +867,15 @@ struct ndpi_proto ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
|
|||||||
break;
|
break;
|
||||||
case MPLS_UNI:
|
case MPLS_UNI:
|
||||||
case MPLS_MULTI:
|
case MPLS_MULTI:
|
||||||
mpls = (struct ndpi_mpls_header *) &packet[ip_offset];
|
mpls.u32 = *((uint32_t *) &packet[ip_offset]);
|
||||||
label = ntohl(mpls->label);
|
mpls.u32 = ntohl(mpls.u32);
|
||||||
/* label = ntohl(*((u_int32_t*)&packet[ip_offset])); */
|
|
||||||
workflow->stats.mpls_count++;
|
workflow->stats.mpls_count++;
|
||||||
type = ETH_P_IP, ip_offset += 4;
|
type = ETH_P_IP, ip_offset += 4;
|
||||||
|
|
||||||
while((label & 0x100) != 0x100) {
|
while(!mpls.mpls.s) {
|
||||||
|
mpls.u32 = *((uint32_t *) &packet[ip_offset]);
|
||||||
|
mpls.u32 = ntohl(mpls.u32);
|
||||||
ip_offset += 4;
|
ip_offset += 4;
|
||||||
label = ntohl(mpls->label);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PPPoE:
|
case PPPoE:
|
||||||
@@ -815,7 +933,7 @@ struct ndpi_proto ndpi_workflow_process_packet (struct ndpi_workflow * workflow,
|
|||||||
}
|
}
|
||||||
} else if(iph->version == 6) {
|
} else if(iph->version == 6) {
|
||||||
iph6 = (struct ndpi_ipv6hdr *)&packet[ip_offset];
|
iph6 = (struct ndpi_ipv6hdr *)&packet[ip_offset];
|
||||||
proto = iph6->ip6_ctlun.ip6_un1.ip6_un1_nxt;
|
proto = iph6->ip6_hdr.ip6_un1_nxt;
|
||||||
ip_len = sizeof(struct ndpi_ipv6hdr);
|
ip_len = sizeof(struct ndpi_ipv6hdr);
|
||||||
|
|
||||||
if(proto == IPPROTO_DSTOPTS /* IPv6 destination option */) {
|
if(proto == IPPROTO_DSTOPTS /* IPv6 destination option */) {
|
||||||
@@ -958,4 +1076,3 @@ u_int32_t ethernet_crc32(const void* data, size_t n_bytes) {
|
|||||||
__crc32(data, n_bytes, &crc);
|
__crc32(data, n_bytes, &crc);
|
||||||
return crc;
|
return crc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_util.h
|
* ndpi_util.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-16 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
* If you concern about performance or have to integrate nDPI in your
|
* If you concern about performance or have to integrate nDPI in your
|
||||||
* application, you could need to reimplement them yourself.
|
* application, you could need to reimplement them yourself.
|
||||||
*
|
*
|
||||||
* WARNING: this API is unstable! Use it at your own risk!
|
* WARNING: this API is just a demo od nDPI usage: Use it at your own risk!
|
||||||
*/
|
*/
|
||||||
#ifndef __NDPI_UTIL_H__
|
#ifndef __NDPI_UTIL_H__
|
||||||
#define __NDPI_UTIL_H__
|
#define __NDPI_UTIL_H__
|
||||||
@@ -75,7 +75,7 @@ typedef struct ndpi_flow_info {
|
|||||||
ndpi_protocol detected_protocol;
|
ndpi_protocol detected_protocol;
|
||||||
|
|
||||||
char info[96];
|
char info[96];
|
||||||
char host_server_name[192];
|
char host_server_name[256];
|
||||||
char bittorent_hash[41];
|
char bittorent_hash[41];
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
@@ -179,4 +179,7 @@ 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);
|
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);
|
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
||||||
void ndpi_flow_info_freer(void *node);
|
void ndpi_flow_info_freer(void *node);
|
||||||
|
|
||||||
|
extern int nDPI_LogLevel;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+14
@@ -15,6 +15,7 @@ ndpi_tdestroy
|
|||||||
ndpi_exit_detection_module
|
ndpi_exit_detection_module
|
||||||
ndpi_l4_detection_process_packet
|
ndpi_l4_detection_process_packet
|
||||||
ndpi_detection_process_packet
|
ndpi_detection_process_packet
|
||||||
|
ndpi_process_extra_packet
|
||||||
ndpi_twalk
|
ndpi_twalk
|
||||||
ndpi_tdelete
|
ndpi_tdelete
|
||||||
ndpi_revision
|
ndpi_revision
|
||||||
@@ -22,6 +23,7 @@ ndpi_init_detection_module
|
|||||||
ndpi_get_num_supported_protocols
|
ndpi_get_num_supported_protocols
|
||||||
ndpi_set_proto_defaults
|
ndpi_set_proto_defaults
|
||||||
ndpi_get_protocol_id
|
ndpi_get_protocol_id
|
||||||
|
ndpi_get_category_id
|
||||||
ndpi_find_port_based_protocol
|
ndpi_find_port_based_protocol
|
||||||
ndpi_get_http_method
|
ndpi_get_http_method
|
||||||
ndpi_get_http_url
|
ndpi_get_http_url
|
||||||
@@ -59,3 +61,15 @@ ndpi_category_set_name
|
|||||||
ndpi_category_get_name
|
ndpi_category_get_name
|
||||||
ndpi_is_custom_category
|
ndpi_is_custom_category
|
||||||
ndpi_is_subprotocol_informative
|
ndpi_is_subprotocol_informative
|
||||||
|
ndpi_set_proto_category
|
||||||
|
ndpi_get_api_version
|
||||||
|
ndpi_network_ptree_match
|
||||||
|
ndpi_check_flow_func
|
||||||
|
ndpi_fill_protocol_category
|
||||||
|
ndpi_load_hostname_category
|
||||||
|
ndpi_enable_loaded_categories
|
||||||
|
ndpi_set_detection_preferences
|
||||||
|
ndpi_get_proto_defaults
|
||||||
|
ndpi_get_ndpi_num_supported_protocols
|
||||||
|
ndpi_get_ndpi_num_custom_protocols
|
||||||
|
ndpi_get_ndpi_detection_module_size
|
||||||
|
|||||||
+101
-57
@@ -31,6 +31,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* The #define below is used for apps that dynamically link with nDPI to make
|
||||||
|
sure that datastructures and in sync across versions
|
||||||
|
*/
|
||||||
|
#define NDPI_API_VERSION 1
|
||||||
|
|
||||||
#define SIZEOF_ID_STRUCT ( sizeof(struct ndpi_id_struct) )
|
#define SIZEOF_ID_STRUCT ( sizeof(struct ndpi_id_struct) )
|
||||||
#define SIZEOF_FLOW_STRUCT ( sizeof(struct ndpi_flow_struct) )
|
#define SIZEOF_FLOW_STRUCT ( sizeof(struct ndpi_flow_struct) )
|
||||||
|
|
||||||
@@ -73,7 +78,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
u_int32_t ndpi_detection_get_sizeof_ndpi_id_struct(void);
|
u_int32_t ndpi_detection_get_sizeof_ndpi_id_struct(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* nDPI personal allocation and free functions
|
* nDPI personal allocation and free functions
|
||||||
**/
|
**/
|
||||||
@@ -110,7 +114,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
char* ndpi_strncasestr(const char *s, const char *find, size_t slen);
|
char* ndpi_strncasestr(const char *s, const char *find, size_t slen);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the nDPI protocol id for IP-based protocol detection
|
* Returns the nDPI protocol id for IP-based protocol detection
|
||||||
*
|
*
|
||||||
@@ -120,8 +123,8 @@ extern "C" {
|
|||||||
* @return the nDPI protocol ID
|
* @return the nDPI protocol ID
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_struct, struct in_addr *pin);
|
u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct in_addr *pin);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init single protocol match
|
* Init single protocol match
|
||||||
@@ -130,7 +133,8 @@ extern "C" {
|
|||||||
* @par match = the struct passed to match the protocol
|
* @par match = the struct passed to match the protocol
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void ndpi_init_protocol_match(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol_match *match);
|
void ndpi_init_protocol_match(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
ndpi_protocol_match *match);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new initialized detection module
|
* Returns a new initialized detection module
|
||||||
@@ -148,7 +152,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
void ndpi_free_flow(struct ndpi_flow_struct *flow);
|
void ndpi_free_flow(struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables cache support.
|
* Enables cache support.
|
||||||
* In nDPI is used for some protocol (i.e. Skype)
|
* In nDPI is used for some protocol (i.e. Skype)
|
||||||
@@ -158,8 +161,8 @@ extern "C" {
|
|||||||
* @par port = unsigned int for the port number
|
* @par port = unsigned int for the port number
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void ndpi_enable_cache(struct ndpi_detection_module_struct *ndpi_mod, char* host, u_int port);
|
void ndpi_enable_cache(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
char* host, u_int port);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys the detection module
|
* Destroys the detection module
|
||||||
@@ -169,7 +172,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_struct);
|
void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_struct);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a single protocol bitmask
|
* Sets a single protocol bitmask
|
||||||
* This function does not increment the index of the callback_buffer
|
* This function does not increment the index of the callback_buffer
|
||||||
@@ -184,16 +186,17 @@ extern "C" {
|
|||||||
* @par b_add_detection_bitmask = if set as "true" add the protocol bitmask to the detection bitmask
|
* @par b_add_detection_bitmask = if set as "true" add the protocol bitmask to the detection bitmask
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void ndpi_set_bitmask_protocol_detection(char *label, struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_set_bitmask_protocol_detection(char *label,
|
||||||
|
struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
const NDPI_PROTOCOL_BITMASK *detection_bitmask,
|
const NDPI_PROTOCOL_BITMASK *detection_bitmask,
|
||||||
const u_int32_t idx,
|
const u_int32_t idx,
|
||||||
u_int16_t ndpi_protocol_id,
|
u_int16_t ndpi_protocol_id,
|
||||||
void (*func) (struct ndpi_detection_module_struct *, struct ndpi_flow_struct *flow),
|
void (*func) (struct ndpi_detection_module_struct *,
|
||||||
|
struct ndpi_flow_struct *flow),
|
||||||
const NDPI_SELECTION_BITMASK_PROTOCOL_SIZE ndpi_selection_bitmask,
|
const NDPI_SELECTION_BITMASK_PROTOCOL_SIZE ndpi_selection_bitmask,
|
||||||
u_int8_t b_save_bitmask_unknow,
|
u_int8_t b_save_bitmask_unknow,
|
||||||
u_int8_t b_add_detection_bitmask);
|
u_int8_t b_add_detection_bitmask);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the protocol bitmask2
|
* Sets the protocol bitmask2
|
||||||
*
|
*
|
||||||
@@ -204,7 +207,6 @@ extern "C" {
|
|||||||
void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
const NDPI_PROTOCOL_BITMASK * detection_bitmask);
|
const NDPI_PROTOCOL_BITMASK * detection_bitmask);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to be called before we give up with detection for a given flow.
|
* Function to be called before we give up with detection for a given flow.
|
||||||
* This function reduces the NDPI_UNKNOWN_PROTOCOL detection
|
* This function reduces the NDPI_UNKNOWN_PROTOCOL detection
|
||||||
@@ -261,8 +263,6 @@ extern "C" {
|
|||||||
const u_int64_t current_tick,
|
const u_int64_t current_tick,
|
||||||
struct ndpi_id_struct *src,
|
struct ndpi_id_struct *src,
|
||||||
struct ndpi_id_struct *dst);
|
struct ndpi_id_struct *dst);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the main protocol of the passed flows for the detected module
|
* Get the main protocol of the passed flows for the detected module
|
||||||
*
|
*
|
||||||
@@ -275,6 +275,20 @@ extern "C" {
|
|||||||
u_int16_t ndpi_get_flow_masterprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
u_int16_t ndpi_get_flow_masterprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow);
|
struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API call that is called internally by ndpi_detection_process_packet or by apps
|
||||||
|
* that want to avoid calling ndpi_detection_process_packet as they have already
|
||||||
|
* parsed the packet and thus want to avoid this.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @par ndpi_struct = the detection module
|
||||||
|
* @par flow = the flow given for the detection module
|
||||||
|
* @par ndpi_selection_bitmask = the protocol selected bitmask
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void ndpi_check_flow_func(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
|
NDPI_SELECTION_BITMASK_PROTOCOL_SIZE *ndpi_selection_packet);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the pointer to the layer 4 packet
|
* Query the pointer to the layer 4 packet
|
||||||
@@ -292,7 +306,6 @@ extern "C" {
|
|||||||
u_int8_t ndpi_detection_get_l4(const u_int8_t *l3, u_int16_t l3_len, const u_int8_t **l4_return, u_int16_t *l4_len_return,
|
u_int8_t ndpi_detection_get_l4(const u_int8_t *l3, u_int16_t l3_len, const u_int8_t **l4_return, u_int16_t *l4_len_return,
|
||||||
u_int8_t *l4_protocol_return, u_int32_t flags);
|
u_int8_t *l4_protocol_return, u_int32_t flags);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search and return the protocol based on matched ports
|
* Search and return the protocol based on matched ports
|
||||||
*
|
*
|
||||||
@@ -309,8 +322,6 @@ extern "C" {
|
|||||||
u_int16_t sport,
|
u_int16_t sport,
|
||||||
u_int32_t dhost,
|
u_int32_t dhost,
|
||||||
u_int16_t dport);
|
u_int16_t dport);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search and return the protocol guessed that is undetected
|
* Search and return the protocol guessed that is undetected
|
||||||
*
|
*
|
||||||
@@ -329,14 +340,13 @@ extern "C" {
|
|||||||
u_int16_t sport,
|
u_int16_t sport,
|
||||||
u_int32_t dhost,
|
u_int32_t dhost,
|
||||||
u_int16_t dport);
|
u_int16_t dport);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the string passed match with a protocol
|
* Check if the string passed match with a protocol
|
||||||
*
|
*
|
||||||
* @par ndpi_struct = the detection module
|
* @par ndpi_struct = the detection module
|
||||||
* @par string_to_match = the string to match
|
* @par string_to_match = the string to match
|
||||||
* @par string_to_match_len = the length of the string
|
* @par string_to_match_len = the length of the string
|
||||||
|
* @par ret_match = completed returned match information
|
||||||
* @par is_host_match = value of the second field of struct ndpi_automa
|
* @par is_host_match = value of the second field of struct ndpi_automa
|
||||||
* @return the ID of the matched subprotocol
|
* @return the ID of the matched subprotocol
|
||||||
*
|
*
|
||||||
@@ -344,9 +354,8 @@ extern "C" {
|
|||||||
int ndpi_match_string_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_match_string_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
char *string_to_match,
|
char *string_to_match,
|
||||||
u_int string_to_match_len,
|
u_int string_to_match_len,
|
||||||
|
ndpi_protocol_match_result *ret_match,
|
||||||
u_int8_t is_host_match);
|
u_int8_t is_host_match);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the host passed match with a protocol
|
* Check if the host passed match with a protocol
|
||||||
*
|
*
|
||||||
@@ -354,6 +363,7 @@ extern "C" {
|
|||||||
* @par flow = the flow where match the host
|
* @par flow = the flow where match the host
|
||||||
* @par string_to_match = the string to match
|
* @par string_to_match = the string to match
|
||||||
* @par string_to_match_len = the length of the string
|
* @par string_to_match_len = the length of the string
|
||||||
|
* @par ret_match = completed returned match information
|
||||||
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
||||||
* @return the ID of the matched subprotocol
|
* @return the ID of the matched subprotocol
|
||||||
*
|
*
|
||||||
@@ -362,6 +372,7 @@ extern "C" {
|
|||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
char *string_to_match,
|
char *string_to_match,
|
||||||
u_int string_to_match_len,
|
u_int string_to_match_len,
|
||||||
|
ndpi_protocol_match_result *ret_match,
|
||||||
u_int16_t master_protocol_id);
|
u_int16_t master_protocol_id);
|
||||||
|
|
||||||
|
|
||||||
@@ -372,6 +383,7 @@ extern "C" {
|
|||||||
* @par flow = the flow where match the host
|
* @par flow = the flow where match the host
|
||||||
* @par string_to_match = the string to match
|
* @par string_to_match = the string to match
|
||||||
* @par string_to_match_len = the length of the string
|
* @par string_to_match_len = the length of the string
|
||||||
|
* @par ret_match = completed returned match information
|
||||||
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
||||||
* @return the ID of the matched subprotocol
|
* @return the ID of the matched subprotocol
|
||||||
*
|
*
|
||||||
@@ -380,9 +392,20 @@ extern "C" {
|
|||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
char *string_to_match,
|
char *string_to_match,
|
||||||
u_int string_to_match_len,
|
u_int string_to_match_len,
|
||||||
|
ndpi_protocol_match_result *ret_match,
|
||||||
u_int16_t master_protocol_id);
|
u_int16_t master_protocol_id);
|
||||||
|
/**
|
||||||
|
* Exclude protocol from search
|
||||||
|
*
|
||||||
|
* @par ndpi_struct = the detection module
|
||||||
|
* @par flow = the flow where match the host
|
||||||
|
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void ndpi_exclude_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
|
u_int16_t master_protocol_id,
|
||||||
|
const char *_file, const char *_func,int _line);
|
||||||
/**
|
/**
|
||||||
* Check if the string -bigram_to_match- match with a bigram of -automa-
|
* Check if the string -bigram_to_match- match with a bigram of -automa-
|
||||||
*
|
*
|
||||||
@@ -406,7 +429,8 @@ extern "C" {
|
|||||||
* @return the buffer contains the master_protocol and protocol name
|
* @return the buffer contains the master_protocol and protocol name
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol proto, char *buf, u_int buf_len);
|
char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
ndpi_protocol proto, char *buf, u_int buf_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find out if a given category is custom/user-defined
|
* Find out if a given category is custom/user-defined
|
||||||
@@ -480,7 +504,8 @@ extern "C" {
|
|||||||
* @par proto = the struct ndpi_protocol contain the protocols name
|
* @par proto = the struct ndpi_protocol contain the protocols name
|
||||||
* @return the protocol category
|
* @return the protocol category
|
||||||
*/
|
*/
|
||||||
ndpi_protocol_category_t ndpi_get_proto_category(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol proto);
|
ndpi_protocol_category_t ndpi_get_proto_category(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
ndpi_protocol proto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the protocol name associated to the ID
|
* Get the protocol name associated to the ID
|
||||||
@@ -501,8 +526,8 @@ extern "C" {
|
|||||||
* @return the breed ID associated to the protocol
|
* @return the breed ID associated to the protocol
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
ndpi_protocol_breed_t ndpi_get_proto_breed(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t proto);
|
ndpi_protocol_breed_t ndpi_get_proto_breed(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
u_int16_t proto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the string name of the protocol breed
|
* Return the string name of the protocol breed
|
||||||
@@ -512,19 +537,28 @@ extern "C" {
|
|||||||
* @return the string name of the breed ID
|
* @return the string name of the breed ID
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *ndpi_struct, ndpi_protocol_breed_t breed_id);
|
char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
ndpi_protocol_breed_t breed_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the ID of the protocol
|
* Return the ID of the protocol
|
||||||
*
|
*
|
||||||
* @par ndpi_mod = the detection module
|
* @par ndpi_mod = the detection module
|
||||||
* @par proto = the ID of the protocol
|
* @par proto = the protocol name
|
||||||
* @return the string name of the breed ID
|
* @return the ID of the protocol
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int ndpi_get_protocol_id(struct ndpi_detection_module_struct *ndpi_mod, char *proto);
|
int ndpi_get_protocol_id(struct ndpi_detection_module_struct *ndpi_mod, char *proto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the ID of the category
|
||||||
|
*
|
||||||
|
* @par ndpi_mod = the detection module
|
||||||
|
* @par proto = the category name
|
||||||
|
* @return the ID of the category
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int ndpi_get_category_id(struct ndpi_detection_module_struct *ndpi_mod, char *cat);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the list of the supported protocols
|
* Write the list of the supported protocols
|
||||||
@@ -533,7 +567,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
void ndpi_dump_protocols(struct ndpi_detection_module_struct *mod);
|
void ndpi_dump_protocols(struct ndpi_detection_module_struct *mod);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a file and load the protocols
|
* Read a file and load the protocols
|
||||||
*
|
*
|
||||||
@@ -549,8 +582,8 @@ extern "C" {
|
|||||||
* -1 else
|
* -1 else
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int ndpi_load_protocols_file(struct ndpi_detection_module_struct *ndpi_mod, char* path);
|
int ndpi_load_protocols_file(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
char* path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the total number of the supported protocols
|
* Get the total number of the supported protocols
|
||||||
@@ -561,7 +594,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the nDPI version release
|
* Get the nDPI version release
|
||||||
*
|
*
|
||||||
@@ -570,7 +602,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
char* ndpi_revision(void);
|
char* ndpi_revision(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the automa for the protocol search
|
* Set the automa for the protocol search
|
||||||
*
|
*
|
||||||
@@ -578,10 +609,10 @@ extern "C" {
|
|||||||
* @par automa = the automa to match
|
* @par automa = the automa to match
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void ndpi_set_automa(struct ndpi_detection_module_struct *ndpi_struct, void* automa);
|
void ndpi_set_automa(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
void* automa);
|
||||||
|
|
||||||
|
/* NDPI_PROTOCOL_HTTP */
|
||||||
#ifdef NDPI_PROTOCOL_HTTP
|
|
||||||
/**
|
/**
|
||||||
* Retrieve information for HTTP flows
|
* Retrieve information for HTTP flows
|
||||||
*
|
*
|
||||||
@@ -590,8 +621,8 @@ extern "C" {
|
|||||||
* @return the HTTP method information about the flow
|
* @return the HTTP method information about the flow
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
ndpi_http_method ndpi_get_http_method(struct ndpi_detection_module_struct *ndpi_mod, struct ndpi_flow_struct *flow);
|
ndpi_http_method ndpi_get_http_method(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the HTTP url
|
* Get the HTTP url
|
||||||
@@ -601,8 +632,8 @@ extern "C" {
|
|||||||
* @return the HTTP method information about the flow
|
* @return the HTTP method information about the flow
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char* ndpi_get_http_url(struct ndpi_detection_module_struct *ndpi_mod, struct ndpi_flow_struct *flow);
|
char* ndpi_get_http_url(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the HTTP content-type
|
* Get the HTTP content-type
|
||||||
@@ -612,11 +643,10 @@ extern "C" {
|
|||||||
* @return the HTTP method information about the flow
|
* @return the HTTP method information about the flow
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
char* ndpi_get_http_content_type(struct ndpi_detection_module_struct *ndpi_mod, struct ndpi_flow_struct *flow);
|
char* ndpi_get_http_content_type(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
#endif
|
struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
|
/* NDPI_PROTOCOL_TOR */
|
||||||
#ifdef NDPI_PROTOCOL_TOR
|
|
||||||
/**
|
/**
|
||||||
* Check if the flow could be detected as TOR protocol
|
* Check if the flow could be detected as TOR protocol
|
||||||
*
|
*
|
||||||
@@ -629,7 +659,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
int ndpi_is_ssl_tor(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_is_ssl_tor(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow, char *certificate);
|
struct ndpi_flow_struct *flow, char *certificate);
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Wrappers functions */
|
/* Wrappers functions */
|
||||||
/**
|
/**
|
||||||
@@ -640,7 +669,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
void* ndpi_init_automa(void);
|
void* ndpi_init_automa(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free Aho-Corasick automata allocated with ndpi_init_automa();
|
* Free Aho-Corasick automata allocated with ndpi_init_automa();
|
||||||
*
|
*
|
||||||
@@ -649,7 +677,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
void ndpi_free_automa(void *_automa);
|
void ndpi_free_automa(void *_automa);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a string to match to an automata
|
* Add a string to match to an automata
|
||||||
*
|
*
|
||||||
@@ -661,7 +688,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
int ndpi_add_string_value_to_automa(void *_automa, char *str, unsigned long num);
|
int ndpi_add_string_value_to_automa(void *_automa, char *str, unsigned long num);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a string to match to an automata. Same as ndpi_add_string_value_to_automa() with num set to 1
|
* Add a string to match to an automata. Same as ndpi_add_string_value_to_automa() with num set to 1
|
||||||
*
|
*
|
||||||
@@ -672,7 +698,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
int ndpi_add_string_to_automa(void *_automa, char *str);
|
int ndpi_add_string_to_automa(void *_automa, char *str);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finalize the automa (necessary before start searching)
|
* Finalize the automa (necessary before start searching)
|
||||||
*
|
*
|
||||||
@@ -681,7 +706,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
void ndpi_finalize_automa(void *_automa);
|
void ndpi_finalize_automa(void *_automa);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a string to match to an automata
|
* Add a string to match to an automata
|
||||||
*
|
*
|
||||||
@@ -692,6 +716,23 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
int ndpi_match_string(void *_automa, char *string_to_match);
|
int ndpi_match_string(void *_automa, char *string_to_match);
|
||||||
|
|
||||||
|
void ndpi_load_ip_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
char *ip_address_and_mask, ndpi_protocol_category_t category);
|
||||||
|
int ndpi_load_hostname_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
char *name, ndpi_protocol_category_t category);
|
||||||
|
int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_struct);
|
||||||
|
void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
|
ndpi_protocol *ret);
|
||||||
|
int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
ndpi_detection_preference pref,
|
||||||
|
int value);
|
||||||
|
|
||||||
|
ndpi_proto_defaults_t* ndpi_get_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod);
|
||||||
|
u_int ndpi_get_ndpi_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||||
|
u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||||
|
u_int ndpi_get_ndpi_detection_module_size();
|
||||||
|
void ndpi_set_log_level(struct ndpi_detection_module_struct *ndpi_mod, u_int l);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a string to match to an automata
|
* Add a string to match to an automata
|
||||||
@@ -704,14 +745,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
int ndpi_match_string_id(void *_automa, char *string_to_match, unsigned long *id);
|
int ndpi_match_string_id(void *_automa, char *string_to_match, unsigned long *id);
|
||||||
|
|
||||||
|
|
||||||
/* Utility functions to set ndpi malloc/free/print wrappers */
|
/* Utility functions to set ndpi malloc/free/print wrappers */
|
||||||
void set_ndpi_malloc(void* (*__ndpi_malloc)(size_t size));
|
void set_ndpi_malloc(void* (*__ndpi_malloc)(size_t size));
|
||||||
void set_ndpi_free(void (*__ndpi_free)(void *ptr));
|
void set_ndpi_free(void (*__ndpi_free)(void *ptr));
|
||||||
void set_ndpi_flow_malloc(void* (*__ndpi_flow_malloc)(size_t size));
|
void set_ndpi_flow_malloc(void* (*__ndpi_flow_malloc)(size_t size));
|
||||||
void set_ndpi_flow_free(void (*__ndpi_flow_free)(void *ptr));
|
void set_ndpi_flow_free(void (*__ndpi_flow_free)(void *ptr));
|
||||||
void set_ndpi_debug_function(struct ndpi_detection_module_struct *ndpi_str, ndpi_debug_function_ptr ndpi_debug_printf);
|
void set_ndpi_debug_function(struct ndpi_detection_module_struct *ndpi_str,
|
||||||
|
ndpi_debug_function_ptr ndpi_debug_printf);
|
||||||
|
void * ndpi_malloc(size_t size);
|
||||||
|
void * ndpi_calloc(unsigned long count, size_t size);
|
||||||
|
void ndpi_free(void *ptr);
|
||||||
|
u_int8_t ndpi_get_api_version();
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -183,21 +183,64 @@
|
|||||||
#define NDPI_LOG(proto, m, log_level, args...) \
|
#define NDPI_LOG(proto, m, log_level, args...) \
|
||||||
{ \
|
{ \
|
||||||
struct ndpi_detection_module_struct *mod = (struct ndpi_detection_module_struct*) m; \
|
struct ndpi_detection_module_struct *mod = (struct ndpi_detection_module_struct*) m; \
|
||||||
if(mod != NULL) { \
|
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||||
mod->ndpi_debug_print_file=__FILE__; \
|
(*(mod->ndpi_debug_printf))(proto, mod, log_level, __FILE__, __FUNCTION__, __LINE__, args); \
|
||||||
mod->ndpi_debug_print_function=__FUNCTION__; \
|
|
||||||
mod->ndpi_debug_print_line=__LINE__; \
|
|
||||||
(*(mod->ndpi_debug_printf))(proto, mod, log_level, args); \
|
|
||||||
} \
|
|
||||||
}
|
}
|
||||||
#else /* NDPI_ENABLE_DEBUG_MESSAGES */
|
|
||||||
|
/* We must define NDPI_CURRENT_PROTO before include ndpi_main.h !!!
|
||||||
|
*
|
||||||
|
* #include "ndpi_protocol_ids.h"
|
||||||
|
* #define NDPI_CURRENT_PROTO NDPI_PROTOCOL_XXXX
|
||||||
|
* #include "ndpi_api.h"
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NDPI_CURRENT_PROTO
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTO_UNKNOWN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NDPI_LOG_ERR(mod, args...) \
|
||||||
|
if(mod && mod->ndpi_log_level >= NDPI_LOG_ERROR) { \
|
||||||
|
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||||
|
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_ERROR , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define NDPI_LOG_INFO(mod, args...) \
|
||||||
|
if(mod && mod->ndpi_log_level >= NDPI_LOG_TRACE) { \
|
||||||
|
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||||
|
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_TRACE , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define NDPI_LOG_DBG(mod, args...) \
|
||||||
|
if(mod && mod->ndpi_log_level >= NDPI_LOG_DEBUG) { \
|
||||||
|
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||||
|
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_DEBUG , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define NDPI_LOG_DBG2(mod, args...) \
|
||||||
|
if(mod && mod->ndpi_log_level >= NDPI_LOG_DEBUG_EXTRA) { \
|
||||||
|
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||||
|
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_DEBUG_EXTRA , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#else /* not defined NDPI_ENABLE_DEBUG_MESSAGES */
|
||||||
# ifdef WIN32
|
# ifdef WIN32
|
||||||
# define NDPI_LOG(...) {}
|
# define NDPI_LOG(...) {}
|
||||||
|
# define NDPI_LOG_ERR(...) {}
|
||||||
|
# define NDPI_LOG_INFO(...) {}
|
||||||
|
# define NDPI_LOG_DBG(...) {}
|
||||||
|
# define NDPI_LOG_DBG2(...) {}
|
||||||
# else
|
# else
|
||||||
#define NDPI_LOG(proto, mod, log_level, args...) {}
|
# define NDPI_LOG(proto, mod, log_level, args...) { /* printf(args); */ }
|
||||||
|
# define NDPI_LOG_ERR(mod, args...) { printf(args); }
|
||||||
|
# define NDPI_LOG_INFO(mod, args...) { /* printf(args); */ }
|
||||||
|
# define NDPI_LOG_DBG(mod, args...) { /* printf(args); */ }
|
||||||
|
# define NDPI_LOG_DBG2(mod, args...) { /* printf(args); */ }
|
||||||
# endif
|
# endif
|
||||||
#endif /* NDPI_ENABLE_DEBUG_MESSAGES */
|
#endif /* NDPI_ENABLE_DEBUG_MESSAGES */
|
||||||
|
|
||||||
|
#define NDPI_EXCLUDE_PROTO(mod,flow) ndpi_exclude_protocol(mod, flow, NDPI_CURRENT_PROTO, __FILE__, __FUNCTION__, __LINE__)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* macro for getting the string len of a static string
|
* macro for getting the string len of a static string
|
||||||
*
|
*
|
||||||
@@ -209,7 +252,7 @@
|
|||||||
#define NDPI_COMPARE_IPV6_ADDRESS_STRUCTS(x,y) \
|
#define NDPI_COMPARE_IPV6_ADDRESS_STRUCTS(x,y) \
|
||||||
((((u_int64_t *)(x))[0]) < (((u_int64_t *)(y))[0]) || ( (((u_int64_t *)(x))[0]) == (((u_int64_t *)(y))[0]) && (((u_int64_t *)(x))[1]) < (((u_int64_t *)(y))[1])) )
|
((((u_int64_t *)(x))[0]) < (((u_int64_t *)(y))[0]) || ( (((u_int64_t *)(x))[0]) == (((u_int64_t *)(y))[0]) && (((u_int64_t *)(x))[1]) < (((u_int64_t *)(y))[1])) )
|
||||||
|
|
||||||
#define NDPI_NUM_BITS 256
|
#define NDPI_NUM_BITS 512
|
||||||
|
|
||||||
#define NDPI_BITS /* 32 */ (sizeof(ndpi_ndpi_mask) * 8 /* number of bits in a byte */) /* bits per mask */
|
#define NDPI_BITS /* 32 */ (sizeof(ndpi_ndpi_mask) * 8 /* number of bits in a byte */) /* bits per mask */
|
||||||
#define howmanybits(x, y) (((x)+((y)-1))/(y))
|
#define howmanybits(x, y) (((x)+((y)-1))/(y))
|
||||||
|
|||||||
+43
-21
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_main.h
|
* ndpi_main.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-16 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -53,35 +53,55 @@ extern "C" {
|
|||||||
extern u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
|
extern u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
|
||||||
u_int32_t net, u_int32_t num_bits);
|
u_int32_t net, u_int32_t num_bits);
|
||||||
|
|
||||||
u_int16_t ntohs_ndpi_bytestream_to_number(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
u_int16_t ntohs_ndpi_bytestream_to_number(const u_int8_t * str,
|
||||||
|
u_int16_t max_chars_to_read,
|
||||||
u_int32_t ndpi_bytestream_to_number(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
u_int16_t * bytes_read);
|
||||||
u_int64_t ndpi_bytestream_to_number64(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
|
||||||
u_int32_t ndpi_bytestream_dec_or_hex_to_number(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
|
||||||
u_int64_t ndpi_bytestream_dec_or_hex_to_number64(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
|
||||||
u_int32_t ndpi_bytestream_to_ipv4(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
|
||||||
|
|
||||||
|
u_int32_t ndpi_bytestream_to_number(const u_int8_t * str, u_int16_t max_chars_to_read,
|
||||||
|
u_int16_t * bytes_read);
|
||||||
|
u_int64_t ndpi_bytestream_to_number64(const u_int8_t * str, u_int16_t max_chars_to_read,
|
||||||
|
u_int16_t * bytes_read);
|
||||||
|
u_int32_t ndpi_bytestream_dec_or_hex_to_number(const u_int8_t * str,
|
||||||
|
u_int16_t max_chars_to_read,
|
||||||
|
u_int16_t * bytes_read);
|
||||||
|
u_int64_t ndpi_bytestream_dec_or_hex_to_number64(const u_int8_t * str,
|
||||||
|
u_int16_t max_chars_to_read,
|
||||||
|
u_int16_t * bytes_read);
|
||||||
|
u_int32_t ndpi_bytestream_to_ipv4(const u_int8_t * str, u_int16_t max_chars_to_read,
|
||||||
|
u_int16_t * bytes_read);
|
||||||
|
|
||||||
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
u_int16_t upper_detected_protocol,
|
u_int16_t upper_detected_protocol,
|
||||||
u_int16_t lower_detected_protocol);
|
u_int16_t lower_detected_protocol);
|
||||||
|
|
||||||
extern void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
extern void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
extern void ndpi_parse_packet_line_info_any(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
struct ndpi_flow_struct *flow);
|
||||||
|
extern void ndpi_parse_packet_line_info_any(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
extern u_int16_t ndpi_check_for_email_address(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int16_t counter);
|
extern u_int16_t ndpi_check_for_email_address(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow, u_int16_t counter);
|
||||||
|
|
||||||
extern void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
|
extern void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
u_int16_t upper_detected_protocol,
|
u_int16_t upper_detected_protocol,
|
||||||
u_int16_t lower_detected_protocol);
|
u_int16_t lower_detected_protocol);
|
||||||
extern void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
|
extern void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
u_int16_t upper_detected_protocol,
|
u_int16_t upper_detected_protocol,
|
||||||
u_int16_t lower_detected_protocol);
|
u_int16_t lower_detected_protocol);
|
||||||
extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol_breed_t protoBreed, u_int16_t protoId,
|
extern void ndpi_int_change_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
u_int16_t tcp_alias_protoId[2], u_int16_t udp_alias_protoId[2], char *protoName,
|
struct ndpi_flow_struct *flow,
|
||||||
|
ndpi_protocol_category_t protocol_category);
|
||||||
|
|
||||||
|
extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
ndpi_protocol_breed_t protoBreed, u_int16_t protoId,
|
||||||
|
u_int16_t tcp_alias_protoId[2],
|
||||||
|
u_int16_t udp_alias_protoId[2], char *protoName,
|
||||||
ndpi_protocol_category_t protoCategory,
|
ndpi_protocol_category_t protoCategory,
|
||||||
ndpi_port_range *tcpDefPorts, ndpi_port_range *udpDefPorts);
|
ndpi_port_range *tcpDefPorts,
|
||||||
|
ndpi_port_range *udpDefPorts);
|
||||||
|
|
||||||
extern void ndpi_int_reset_packet_protocol(struct ndpi_packet_struct *packet);
|
extern void ndpi_int_reset_packet_protocol(struct ndpi_packet_struct *packet);
|
||||||
extern void ndpi_int_reset_protocol(struct ndpi_flow_struct *flow);
|
extern void ndpi_int_reset_protocol(struct ndpi_flow_struct *flow);
|
||||||
@@ -91,8 +111,10 @@ extern "C" {
|
|||||||
extern void ndpi_packet_src_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
extern void ndpi_packet_src_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
||||||
extern void ndpi_packet_dst_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
extern void ndpi_packet_dst_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
||||||
|
|
||||||
extern char *ndpi_get_ip_string(struct ndpi_detection_module_struct *ndpi_struct, const ndpi_ip_addr_t * ip);
|
extern char *ndpi_get_ip_string(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
extern char *ndpi_get_packet_src_ip_string(struct ndpi_detection_module_struct *ndpi_struct, const struct ndpi_packet_struct *packet);
|
const ndpi_ip_addr_t * ip);
|
||||||
|
extern char *ndpi_get_packet_src_ip_string(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
const struct ndpi_packet_struct *packet);
|
||||||
extern char* ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_mod, u_int id);
|
extern char* ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_mod, u_int id);
|
||||||
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_mod, const char *name);
|
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_mod, const char *name);
|
||||||
|
|
||||||
@@ -103,12 +125,12 @@ extern "C" {
|
|||||||
extern u_int8_t ndpi_is_proto(ndpi_protocol p, u_int16_t proto);
|
extern u_int8_t ndpi_is_proto(ndpi_protocol p, u_int16_t proto);
|
||||||
|
|
||||||
extern u_int16_t ndpi_get_lower_proto(ndpi_protocol p);
|
extern u_int16_t ndpi_get_lower_proto(ndpi_protocol p);
|
||||||
extern int ndpi_get_protocol_id_master_proto(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t protocol_id,
|
extern int ndpi_get_protocol_id_master_proto(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
u_int16_t protocol_id,
|
||||||
u_int16_t** tcp_master_proto,
|
u_int16_t** tcp_master_proto,
|
||||||
u_int16_t** udp_master_proto);
|
u_int16_t** udp_master_proto);
|
||||||
#ifdef NDPI_PROTOCOL_NETBIOS
|
#/* NDPI_PROTOCOL_NETBIOS */
|
||||||
int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len);
|
int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||||
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
|||||||
+259
-246
@@ -2,7 +2,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_protocol_ids.h
|
* ndpi_protocol_ids.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-17 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -33,252 +33,265 @@
|
|||||||
#define NDPI_DETECTION_SUPPORT_IPV6
|
#define NDPI_DETECTION_SUPPORT_IPV6
|
||||||
#define NDPI_PROTOCOL_SIZE 2
|
#define NDPI_PROTOCOL_SIZE 2
|
||||||
|
|
||||||
#define NDPI_PROTOCOL_UNKNOWN 0
|
typedef enum {
|
||||||
|
NDPI_PROTOCOL_UNKNOWN = 0,
|
||||||
|
NDPI_PROTOCOL_FTP_CONTROL = 1, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_MAIL_POP = 2,
|
||||||
|
NDPI_PROTOCOL_MAIL_SMTP = 3,
|
||||||
|
NDPI_PROTOCOL_MAIL_IMAP = 4,
|
||||||
|
NDPI_PROTOCOL_DNS = 5,
|
||||||
|
NDPI_PROTOCOL_IPP = 6,
|
||||||
|
NDPI_PROTOCOL_HTTP = 7,
|
||||||
|
NDPI_PROTOCOL_MDNS = 8,
|
||||||
|
NDPI_PROTOCOL_NTP = 9,
|
||||||
|
NDPI_PROTOCOL_NETBIOS = 10,
|
||||||
|
NDPI_PROTOCOL_NFS = 11,
|
||||||
|
NDPI_PROTOCOL_SSDP = 12,
|
||||||
|
NDPI_PROTOCOL_BGP = 13,
|
||||||
|
NDPI_PROTOCOL_SNMP = 14,
|
||||||
|
NDPI_PROTOCOL_XDMCP = 15,
|
||||||
|
NDPI_PROTOCOL_SMB = 16,
|
||||||
|
NDPI_PROTOCOL_SYSLOG = 17,
|
||||||
|
NDPI_PROTOCOL_DHCP = 18,
|
||||||
|
NDPI_PROTOCOL_POSTGRES = 19,
|
||||||
|
NDPI_PROTOCOL_MYSQL = 20,
|
||||||
|
NDPI_PROTOCOL_HOTMAIL = 21,
|
||||||
|
NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK = 22,
|
||||||
|
NDPI_PROTOCOL_MAIL_POPS = 23,
|
||||||
|
NDPI_PROTOCOL_APPLEJUICE = 24,
|
||||||
|
NDPI_PROTOCOL_DIRECTCONNECT = 25,
|
||||||
|
NDPI_PROTOCOL_NTOP = 26,
|
||||||
|
NDPI_PROTOCOL_COAP = 27,
|
||||||
|
NDPI_PROTOCOL_VMWARE = 28,
|
||||||
|
NDPI_PROTOCOL_MAIL_SMTPS = 29,
|
||||||
|
NDPI_PROTOCOL_FBZERO = 30,
|
||||||
|
NDPI_PROTOCOL_UBNTAC2 = 31, /* Ubiquity UBNT AirControl = 2 - Thomas Fjellstrom <thomas+ndpi@fjellstrom.ca> */
|
||||||
|
NDPI_PROTOCOL_KONTIKI = 32,
|
||||||
|
NDPI_PROTOCOL_OPENFT = 33,
|
||||||
|
NDPI_PROTOCOL_FASTTRACK = 34,
|
||||||
|
NDPI_PROTOCOL_GNUTELLA = 35,
|
||||||
|
NDPI_PROTOCOL_EDONKEY = 36, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_BITTORRENT = 37,
|
||||||
|
NDPI_PROTOCOL_SKYPE_CALL_OUT = 38,
|
||||||
|
NDPI_PROTOCOL_MUSICALLY = 39,
|
||||||
|
NDPI_PROTOCOL_MEMCACHED = 40, /* Memcached - Darryl Sokoloski <darryl@egloo.ca> */
|
||||||
|
|
||||||
|
NDPI_PROTOCOL_FREE_41 = 41, /* Free */
|
||||||
|
NDPI_PROTOCOL_FREE_42 = 42, /* Free */
|
||||||
|
NDPI_PROTOCOL_FREE_43 = 43, /* Free */
|
||||||
|
NDPI_PROTOCOL_FREE_44 = 44, /* Free */
|
||||||
|
NDPI_PROTOCOL_FREE_45 = 45, /* Free */
|
||||||
|
NDPI_PROTOCOL_FREE_46 = 46, /* Free */
|
||||||
|
|
||||||
|
NDPI_PROTOCOL_XBOX = 47,
|
||||||
|
NDPI_PROTOCOL_QQ = 48,
|
||||||
|
NDPI_PROTOCOL_SKYPE_CALL_IN = 49,
|
||||||
|
NDPI_PROTOCOL_RTSP = 50,
|
||||||
|
NDPI_PROTOCOL_MAIL_IMAPS = 51,
|
||||||
|
NDPI_PROTOCOL_ICECAST = 52,
|
||||||
|
NDPI_PROTOCOL_PPLIVE = 53, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_PPSTREAM = 54,
|
||||||
|
NDPI_PROTOCOL_ZATTOO = 55,
|
||||||
|
NDPI_PROTOCOL_SHOUTCAST = 56,
|
||||||
|
NDPI_PROTOCOL_SOPCAST = 57,
|
||||||
|
NDPI_PROTOCOL_TVANTS = 58,
|
||||||
|
NDPI_PROTOCOL_TVUPLAYER = 59,
|
||||||
|
NDPI_PROTOCOL_HTTP_DOWNLOAD = 60,
|
||||||
|
NDPI_PROTOCOL_QQLIVE = 61,
|
||||||
|
NDPI_PROTOCOL_THUNDER = 62,
|
||||||
|
NDPI_PROTOCOL_SOULSEEK = 63,
|
||||||
|
NDPI_PROTOCOL_SSL_NO_CERT = 64,
|
||||||
|
NDPI_PROTOCOL_IRC = 65,
|
||||||
|
NDPI_PROTOCOL_AYIYA = 66,
|
||||||
|
NDPI_PROTOCOL_UNENCRYPTED_JABBER = 67,
|
||||||
|
NDPI_PROTOCOL_MSN = 68,
|
||||||
|
NDPI_PROTOCOL_OSCAR = 69,
|
||||||
|
NDPI_PROTOCOL_YAHOO = 70,
|
||||||
|
NDPI_PROTOCOL_BATTLEFIELD = 71,
|
||||||
|
NDPI_PROTOCOL_GOOGLE_PLUS = 72,
|
||||||
|
NDPI_PROTOCOL_IP_VRRP = 73,
|
||||||
|
NDPI_PROTOCOL_STEAM = 74, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_HALFLIFE2 = 75,
|
||||||
|
NDPI_PROTOCOL_WORLDOFWARCRAFT = 76,
|
||||||
|
NDPI_PROTOCOL_TELNET = 77,
|
||||||
|
NDPI_PROTOCOL_STUN = 78,
|
||||||
|
NDPI_PROTOCOL_IP_IPSEC = 79,
|
||||||
|
NDPI_PROTOCOL_IP_GRE = 80,
|
||||||
|
NDPI_PROTOCOL_IP_ICMP = 81,
|
||||||
|
NDPI_PROTOCOL_IP_IGMP = 82,
|
||||||
|
NDPI_PROTOCOL_IP_EGP = 83,
|
||||||
|
NDPI_PROTOCOL_IP_SCTP = 84,
|
||||||
|
NDPI_PROTOCOL_IP_OSPF = 85,
|
||||||
|
NDPI_PROTOCOL_IP_IP_IN_IP = 86,
|
||||||
|
NDPI_PROTOCOL_RTP = 87,
|
||||||
|
NDPI_PROTOCOL_RDP = 88,
|
||||||
|
NDPI_PROTOCOL_VNC = 89,
|
||||||
|
NDPI_PROTOCOL_PCANYWHERE = 90,
|
||||||
|
NDPI_PROTOCOL_SSL = 91,
|
||||||
|
NDPI_PROTOCOL_SSH = 92,
|
||||||
|
NDPI_PROTOCOL_USENET = 93,
|
||||||
|
NDPI_PROTOCOL_MGCP = 94,
|
||||||
|
NDPI_PROTOCOL_IAX = 95,
|
||||||
|
NDPI_PROTOCOL_TFTP = 96,
|
||||||
|
NDPI_PROTOCOL_AFP = 97,
|
||||||
|
NDPI_PROTOCOL_STEALTHNET = 98,
|
||||||
|
NDPI_PROTOCOL_AIMINI = 99,
|
||||||
|
NDPI_PROTOCOL_SIP = 100,
|
||||||
|
NDPI_PROTOCOL_TRUPHONE = 101,
|
||||||
|
NDPI_PROTOCOL_IP_ICMPV6 = 102,
|
||||||
|
NDPI_PROTOCOL_DHCPV6 = 103,
|
||||||
|
NDPI_PROTOCOL_ARMAGETRON = 104,
|
||||||
|
NDPI_PROTOCOL_CROSSFIRE = 105,
|
||||||
|
NDPI_PROTOCOL_DOFUS = 106,
|
||||||
|
NDPI_PROTOCOL_FIESTA = 107,
|
||||||
|
NDPI_PROTOCOL_FLORENSIA = 108,
|
||||||
|
NDPI_PROTOCOL_GUILDWARS = 109,
|
||||||
|
NDPI_PROTOCOL_HTTP_ACTIVESYNC = 110,
|
||||||
|
NDPI_PROTOCOL_KERBEROS = 111,
|
||||||
|
NDPI_PROTOCOL_LDAP = 112,
|
||||||
|
NDPI_PROTOCOL_MAPLESTORY = 113,
|
||||||
|
NDPI_PROTOCOL_MSSQL_TDS = 114,
|
||||||
|
NDPI_PROTOCOL_PPTP = 115,
|
||||||
|
NDPI_PROTOCOL_WARCRAFT3 = 116,
|
||||||
|
NDPI_PROTOCOL_WORLD_OF_KUNG_FU = 117,
|
||||||
|
NDPI_PROTOCOL_SLACK = 118,
|
||||||
|
NDPI_PROTOCOL_FACEBOOK = 119,
|
||||||
|
NDPI_PROTOCOL_TWITTER = 120,
|
||||||
|
NDPI_PROTOCOL_DROPBOX = 121,
|
||||||
|
NDPI_PROTOCOL_GMAIL = 122,
|
||||||
|
NDPI_PROTOCOL_GOOGLE_MAPS = 123,
|
||||||
|
NDPI_PROTOCOL_YOUTUBE = 124,
|
||||||
|
NDPI_PROTOCOL_SKYPE = 125,
|
||||||
|
NDPI_PROTOCOL_GOOGLE = 126,
|
||||||
|
NDPI_PROTOCOL_DCERPC = 127,
|
||||||
|
NDPI_PROTOCOL_NETFLOW = 128,
|
||||||
|
NDPI_PROTOCOL_SFLOW = 129,
|
||||||
|
NDPI_PROTOCOL_HTTP_CONNECT = 130,
|
||||||
|
NDPI_PROTOCOL_HTTP_PROXY = 131,
|
||||||
|
NDPI_PROTOCOL_CITRIX = 132, /* It also includes the old NDPI_PROTOCOL_CITRIX_ONLINE */
|
||||||
|
NDPI_PROTOCOL_NETFLIX = 133,
|
||||||
|
NDPI_PROTOCOL_LASTFM = 134,
|
||||||
|
NDPI_PROTOCOL_WAZE = 135,
|
||||||
|
NDPI_PROTOCOL_YOUTUBE_UPLOAD = 136, /* Upload files to youtube */
|
||||||
|
NDPI_PROTOCOL_GENERIC = 137, /* Generic protocol used for category matching */
|
||||||
|
NDPI_PROTOCOL_CHECKMK = 138,
|
||||||
|
NDPI_PROTOCOL_AJP = 139, /* Leonn Paiva <leonn.paiva@gmail.com> */
|
||||||
|
NDPI_PROTOCOL_APPLE = 140,
|
||||||
|
NDPI_PROTOCOL_WEBEX = 141,
|
||||||
|
NDPI_PROTOCOL_WHATSAPP = 142,
|
||||||
|
NDPI_PROTOCOL_APPLE_ICLOUD = 143,
|
||||||
|
NDPI_PROTOCOL_VIBER = 144,
|
||||||
|
NDPI_PROTOCOL_APPLE_ITUNES = 145,
|
||||||
|
NDPI_PROTOCOL_RADIUS = 146,
|
||||||
|
NDPI_PROTOCOL_WINDOWS_UPDATE = 147,
|
||||||
|
NDPI_PROTOCOL_TEAMVIEWER = 148, /* xplico.org */
|
||||||
|
NDPI_PROTOCOL_TUENTI = 149,
|
||||||
|
NDPI_PROTOCOL_LOTUS_NOTES = 150,
|
||||||
|
NDPI_PROTOCOL_SAP = 151,
|
||||||
|
NDPI_PROTOCOL_GTP = 152,
|
||||||
|
NDPI_PROTOCOL_UPNP = 153,
|
||||||
|
NDPI_PROTOCOL_LLMNR = 154,
|
||||||
|
NDPI_PROTOCOL_REMOTE_SCAN = 155,
|
||||||
|
NDPI_PROTOCOL_SPOTIFY = 156,
|
||||||
|
NDPI_PROTOCOL_MESSENGER = 157,
|
||||||
|
NDPI_PROTOCOL_H323 = 158, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_OPENVPN = 159, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_NOE = 160, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_CISCOVPN = 161, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_TEAMSPEAK = 162, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_TOR = 163, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_SKINNY = 164, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_RTCP = 165, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_RSYNC = 166, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_ORACLE = 167, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_CORBA = 168, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_UBUNTUONE = 169, /* Remy Mudingay <mudingay@ill.fr> */
|
||||||
|
NDPI_PROTOCOL_WHOIS_DAS = 170,
|
||||||
|
NDPI_PROTOCOL_COLLECTD = 171,
|
||||||
|
NDPI_PROTOCOL_SOCKS = 172, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_NINTENDO = 173,
|
||||||
|
NDPI_PROTOCOL_RTMP = 174, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_FTP_DATA = 175, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_WIKIPEDIA = 176, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_ZMQ = 177,
|
||||||
|
NDPI_PROTOCOL_AMAZON = 178, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_EBAY = 179, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_CNN = 180, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_MEGACO = 181, /* Gianluca Costa <g.costa@xplico.org> */
|
||||||
|
NDPI_PROTOCOL_REDIS = 182,
|
||||||
|
NDPI_PROTOCOL_PANDO = 183, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||||
|
NDPI_PROTOCOL_VHUA = 184,
|
||||||
|
NDPI_PROTOCOL_TELEGRAM = 185, /* Gianluca Costa <g.costa@xplico.org> */
|
||||||
|
NDPI_PROTOCOL_VEVO = 186,
|
||||||
|
NDPI_PROTOCOL_PANDORA = 187,
|
||||||
|
NDPI_PROTOCOL_QUIC = 188, /* Andrea Buscarinu <andrea.buscarinu@gmail.com> - Michele Campus <michelecampus5@gmail.com> */
|
||||||
|
NDPI_PROTOCOL_WHATSAPP_VOICE = 189,
|
||||||
|
NDPI_PROTOCOL_EAQ = 190,
|
||||||
|
NDPI_PROTOCOL_OOKLA = 191,
|
||||||
|
NDPI_PROTOCOL_AMQP = 192,
|
||||||
|
NDPI_PROTOCOL_KAKAOTALK = 193, /* KakaoTalk Chat (no voice call) */
|
||||||
|
NDPI_PROTOCOL_KAKAOTALK_VOICE = 194, /* KakaoTalk Voice */
|
||||||
|
NDPI_PROTOCOL_TWITCH = 195, /* Edoardo Dominici <edoaramis@gmail.com> */
|
||||||
|
NDPI_PROTOCOL_FREE_196 = 196, /* Free */
|
||||||
|
NDPI_PROTOCOL_WECHAT = 197,
|
||||||
|
NDPI_PROTOCOL_MPEGTS = 198,
|
||||||
|
NDPI_PROTOCOL_SNAPCHAT = 199,
|
||||||
|
NDPI_PROTOCOL_SINA = 200,
|
||||||
|
NDPI_PROTOCOL_HANGOUT = 201,
|
||||||
|
NDPI_PROTOCOL_IFLIX = 202, /* www.vizuamatix.com R&D team & M.Mallawaarachchie <manoj_ws@yahoo.com> */
|
||||||
|
NDPI_PROTOCOL_GITHUB = 203,
|
||||||
|
NDPI_PROTOCOL_BJNP = 204,
|
||||||
|
NDPI_PROTOCOL_FREE_205 = 205, /* Free */
|
||||||
|
NDPI_PROTOCOL_VIDTO = 206,
|
||||||
|
NDPI_PROTOCOL_SMPP = 207, /* Damir Franusic <df@release14.org> */
|
||||||
|
NDPI_PROTOCOL_DNSCRYPT = 208,
|
||||||
|
NDPI_PROTOCOL_TINC = 209, /* William Guglielmo <william@deselmo.com> */
|
||||||
|
NDPI_PROTOCOL_DEEZER = 210,
|
||||||
|
NDPI_PROTOCOL_INSTAGRAM = 211, /* Andrea Buscarinu <andrea.buscarinu@gmail.com> */
|
||||||
|
NDPI_PROTOCOL_MICROSOFT = 212,
|
||||||
|
NDPI_PROTOCOL_STARCRAFT = 213, /* Matteo Bracci <matteobracci1@gmail.com> */
|
||||||
|
NDPI_PROTOCOL_TEREDO = 214,
|
||||||
|
NDPI_PROTOCOL_HOTSPOT_SHIELD = 215,
|
||||||
|
NDPI_PROTOCOL_HEP = 216, /* sipcapture.org QXIP BV */
|
||||||
|
NDPI_PROTOCOL_GOOGLE_DRIVE = 217,
|
||||||
|
NDPI_PROTOCOL_OCS = 218,
|
||||||
|
NDPI_PROTOCOL_OFFICE_365 = 219,
|
||||||
|
NDPI_PROTOCOL_CLOUDFLARE = 220,
|
||||||
|
NDPI_PROTOCOL_MS_ONE_DRIVE = 221,
|
||||||
|
NDPI_PROTOCOL_MQTT = 222,
|
||||||
|
NDPI_PROTOCOL_RX = 223,
|
||||||
|
NDPI_PROTOCOL_APPLESTORE = 224,
|
||||||
|
NDPI_PROTOCOL_OPENDNS = 225,
|
||||||
|
NDPI_PROTOCOL_GIT = 226,
|
||||||
|
NDPI_PROTOCOL_DRDA = 227,
|
||||||
|
NDPI_PROTOCOL_PLAYSTORE = 228,
|
||||||
|
NDPI_PROTOCOL_SOMEIP = 229,
|
||||||
|
NDPI_PROTOCOL_FIX = 230,
|
||||||
|
NDPI_PROTOCOL_PLAYSTATION = 231,
|
||||||
|
NDPI_PROTOCOL_PASTEBIN = 232, /* Paulo Angelo <pa@pauloangelo.com> */
|
||||||
|
NDPI_PROTOCOL_LINKEDIN = 233, /* Paulo Angelo <pa@pauloangelo.com> */
|
||||||
|
NDPI_PROTOCOL_SOUNDCLOUD = 234,
|
||||||
|
NDPI_PROTOCOL_CSGO = 235, /* Counter-Strike Global Offensive, Dota = 2 */
|
||||||
|
NDPI_PROTOCOL_LISP = 236,
|
||||||
|
NDPI_PROTOCOL_DIAMETER = 237,
|
||||||
|
NDPI_PROTOCOL_APPLE_PUSH = 238,
|
||||||
|
NDPI_PROTOCOL_GOOGLE_SERVICES = 239,
|
||||||
|
NDPI_PROTOCOL_AMAZON_VIDEO = 240,
|
||||||
|
NDPI_PROTOCOL_GOOGLE_DOCS = 241,
|
||||||
|
NDPI_PROTOCOL_WHATSAPP_FILES = 242, /* Videos, pictures, voice messages... */
|
||||||
|
/*
|
||||||
|
IMPORTANT
|
||||||
|
before allocating a new identifier please fill up
|
||||||
|
one of those named NDPI_PROTOCOL_FREE_XXX and not used
|
||||||
|
(placeholders to avoid protocol renumbering)
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* IMPORTANT:NDPI_LAST_IMPLEMENTED_PROTOCOL MUST BE THE LAST ELEMENT */
|
||||||
|
NDPI_LAST_IMPLEMENTED_PROTOCOL
|
||||||
|
} ndpi_protocol_id_t;
|
||||||
|
|
||||||
#define NDPI_PROTOCOL_NO_MASTER_PROTO NDPI_PROTOCOL_UNKNOWN
|
#define NDPI_PROTOCOL_NO_MASTER_PROTO NDPI_PROTOCOL_UNKNOWN
|
||||||
|
#define NDPI_MAX_SUPPORTED_PROTOCOLS NDPI_LAST_IMPLEMENTED_PROTOCOL
|
||||||
#define NDPI_PROTOCOL_UNKNOWN 0
|
|
||||||
#define NDPI_PROTOCOL_FTP_CONTROL 1 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_MAIL_POP 2
|
|
||||||
#define NDPI_PROTOCOL_MAIL_SMTP 3
|
|
||||||
#define NDPI_PROTOCOL_MAIL_IMAP 4
|
|
||||||
#define NDPI_PROTOCOL_DNS 5
|
|
||||||
#define NDPI_PROTOCOL_IPP 6
|
|
||||||
#define NDPI_PROTOCOL_HTTP 7
|
|
||||||
#define NDPI_PROTOCOL_MDNS 8
|
|
||||||
#define NDPI_PROTOCOL_NTP 9
|
|
||||||
#define NDPI_PROTOCOL_NETBIOS 10
|
|
||||||
#define NDPI_PROTOCOL_NFS 11
|
|
||||||
#define NDPI_PROTOCOL_SSDP 12
|
|
||||||
#define NDPI_PROTOCOL_BGP 13
|
|
||||||
#define NDPI_PROTOCOL_SNMP 14
|
|
||||||
#define NDPI_PROTOCOL_XDMCP 15
|
|
||||||
#define NDPI_PROTOCOL_SMB 16
|
|
||||||
#define NDPI_PROTOCOL_SYSLOG 17
|
|
||||||
#define NDPI_PROTOCOL_DHCP 18
|
|
||||||
#define NDPI_PROTOCOL_POSTGRES 19
|
|
||||||
#define NDPI_PROTOCOL_MYSQL 20
|
|
||||||
#define NDPI_PROTOCOL_HOTMAIL 21
|
|
||||||
#define NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK 22
|
|
||||||
#define NDPI_PROTOCOL_MAIL_POPS 23
|
|
||||||
#define NDPI_PROTOCOL_APPLEJUICE 24
|
|
||||||
#define NDPI_PROTOCOL_DIRECTCONNECT 25
|
|
||||||
#define NDPI_PROTOCOL_SOCRATES 26
|
|
||||||
#define NDPI_PROTOCOL_COAP 27
|
|
||||||
#define NDPI_PROTOCOL_VMWARE 28
|
|
||||||
#define NDPI_PROTOCOL_MAIL_SMTPS 29
|
|
||||||
#define NDPI_PROTOCOL_FILETOPIA 30
|
|
||||||
#define NDPI_PROTOCOL_UBNTAC2 31 /* Ubiquity UBNT AirControl 2 - Thomas Fjellstrom <thomas+ndpi@fjellstrom.ca> */
|
|
||||||
#define NDPI_PROTOCOL_KONTIKI 32
|
|
||||||
#define NDPI_PROTOCOL_OPENFT 33
|
|
||||||
#define NDPI_PROTOCOL_FASTTRACK 34
|
|
||||||
#define NDPI_PROTOCOL_GNUTELLA 35
|
|
||||||
#define NDPI_PROTOCOL_EDONKEY 36 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_BITTORRENT 37
|
|
||||||
#define NDPI_PROTOCOL_EPP 38
|
|
||||||
#define NDPI_CONTENT_AVI 39
|
|
||||||
#define NDPI_CONTENT_FLASH 40
|
|
||||||
#define NDPI_CONTENT_OGG 41
|
|
||||||
#define NDPI_CONTENT_MPEG 42
|
|
||||||
#define NDPI_CONTENT_QUICKTIME 43
|
|
||||||
#define NDPI_CONTENT_REALMEDIA 44
|
|
||||||
#define NDPI_CONTENT_WINDOWSMEDIA 45
|
|
||||||
#define NDPI_CONTENT_MMS 46
|
|
||||||
#define NDPI_PROTOCOL_XBOX 47
|
|
||||||
#define NDPI_PROTOCOL_QQ 48
|
|
||||||
#define NDPI_PROTOCOL_MOVE 49
|
|
||||||
#define NDPI_PROTOCOL_RTSP 50
|
|
||||||
#define NDPI_PROTOCOL_MAIL_IMAPS 51
|
|
||||||
#define NDPI_PROTOCOL_ICECAST 52
|
|
||||||
#define NDPI_PROTOCOL_PPLIVE 53 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_PPSTREAM 54
|
|
||||||
#define NDPI_PROTOCOL_ZATTOO 55
|
|
||||||
#define NDPI_PROTOCOL_SHOUTCAST 56
|
|
||||||
#define NDPI_PROTOCOL_SOPCAST 57
|
|
||||||
#define NDPI_PROTOCOL_TVANTS 58
|
|
||||||
#define NDPI_PROTOCOL_TVUPLAYER 59
|
|
||||||
#define NDPI_PROTOCOL_HTTP_DOWNLOAD 60
|
|
||||||
#define NDPI_PROTOCOL_QQLIVE 61
|
|
||||||
#define NDPI_PROTOCOL_THUNDER 62
|
|
||||||
#define NDPI_PROTOCOL_SOULSEEK 63
|
|
||||||
#define NDPI_PROTOCOL_SSL_NO_CERT 64
|
|
||||||
#define NDPI_PROTOCOL_IRC 65
|
|
||||||
#define NDPI_PROTOCOL_AYIYA 66
|
|
||||||
#define NDPI_PROTOCOL_UNENCRYPTED_JABBER 67
|
|
||||||
#define NDPI_PROTOCOL_MSN 68
|
|
||||||
#define NDPI_PROTOCOL_OSCAR 69
|
|
||||||
#define NDPI_PROTOCOL_YAHOO 70
|
|
||||||
#define NDPI_PROTOCOL_BATTLEFIELD 71
|
|
||||||
#define NDPI_PROTOCOL_QUAKE 72
|
|
||||||
#define NDPI_PROTOCOL_IP_VRRP 73
|
|
||||||
#define NDPI_PROTOCOL_STEAM 74 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_HALFLIFE2 75
|
|
||||||
#define NDPI_PROTOCOL_WORLDOFWARCRAFT 76
|
|
||||||
#define NDPI_PROTOCOL_TELNET 77
|
|
||||||
#define NDPI_PROTOCOL_STUN 78
|
|
||||||
#define NDPI_PROTOCOL_IP_IPSEC 79
|
|
||||||
#define NDPI_PROTOCOL_IP_GRE 80
|
|
||||||
#define NDPI_PROTOCOL_IP_ICMP 81
|
|
||||||
#define NDPI_PROTOCOL_IP_IGMP 82
|
|
||||||
#define NDPI_PROTOCOL_IP_EGP 83
|
|
||||||
#define NDPI_PROTOCOL_IP_SCTP 84
|
|
||||||
#define NDPI_PROTOCOL_IP_OSPF 85
|
|
||||||
#define NDPI_PROTOCOL_IP_IP_IN_IP 86
|
|
||||||
#define NDPI_PROTOCOL_RTP 87
|
|
||||||
#define NDPI_PROTOCOL_RDP 88
|
|
||||||
#define NDPI_PROTOCOL_VNC 89
|
|
||||||
#define NDPI_PROTOCOL_PCANYWHERE 90
|
|
||||||
#define NDPI_PROTOCOL_SSL 91
|
|
||||||
#define NDPI_PROTOCOL_SSH 92
|
|
||||||
#define NDPI_PROTOCOL_USENET 93
|
|
||||||
#define NDPI_PROTOCOL_MGCP 94
|
|
||||||
#define NDPI_PROTOCOL_IAX 95
|
|
||||||
#define NDPI_PROTOCOL_TFTP 96
|
|
||||||
#define NDPI_PROTOCOL_AFP 97
|
|
||||||
#define NDPI_PROTOCOL_STEALTHNET 98
|
|
||||||
#define NDPI_PROTOCOL_AIMINI 99
|
|
||||||
#define NDPI_PROTOCOL_SIP 100
|
|
||||||
#define NDPI_PROTOCOL_TRUPHONE 101
|
|
||||||
#define NDPI_PROTOCOL_IP_ICMPV6 102
|
|
||||||
#define NDPI_PROTOCOL_DHCPV6 103
|
|
||||||
#define NDPI_PROTOCOL_ARMAGETRON 104
|
|
||||||
#define NDPI_PROTOCOL_CROSSFIRE 105
|
|
||||||
#define NDPI_PROTOCOL_DOFUS 106
|
|
||||||
#define NDPI_PROTOCOL_FIESTA 107
|
|
||||||
#define NDPI_PROTOCOL_FLORENSIA 108
|
|
||||||
#define NDPI_PROTOCOL_GUILDWARS 109
|
|
||||||
#define NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC 110 /*avoid large declarations in the future*/
|
|
||||||
#define NDPI_PROTOCOL_KERBEROS 111
|
|
||||||
#define NDPI_PROTOCOL_LDAP 112
|
|
||||||
#define NDPI_PROTOCOL_MAPLESTORY 113
|
|
||||||
#define NDPI_PROTOCOL_MSSQL_TDS 114
|
|
||||||
#define NDPI_PROTOCOL_PPTP 115
|
|
||||||
#define NDPI_PROTOCOL_WARCRAFT3 116
|
|
||||||
#define NDPI_PROTOCOL_WORLD_OF_KUNG_FU 117
|
|
||||||
#define NDPI_PROTOCOL_SLACK 118
|
|
||||||
#define NDPI_PROTOCOL_FACEBOOK 119
|
|
||||||
#define NDPI_PROTOCOL_TWITTER 120
|
|
||||||
#define NDPI_PROTOCOL_DROPBOX 121
|
|
||||||
#define NDPI_PROTOCOL_GMAIL 122
|
|
||||||
#define NDPI_PROTOCOL_GOOGLE_MAPS 123
|
|
||||||
#define NDPI_PROTOCOL_YOUTUBE 124
|
|
||||||
#define NDPI_PROTOCOL_SKYPE 125
|
|
||||||
#define NDPI_PROTOCOL_GOOGLE 126
|
|
||||||
#define NDPI_PROTOCOL_DCERPC 127
|
|
||||||
#define NDPI_PROTOCOL_NETFLOW 128
|
|
||||||
#define NDPI_PROTOCOL_SFLOW 129
|
|
||||||
#define NDPI_PROTOCOL_HTTP_CONNECT 130
|
|
||||||
#define NDPI_PROTOCOL_HTTP_PROXY 131
|
|
||||||
#define NDPI_PROTOCOL_CITRIX 132
|
|
||||||
#define NDPI_PROTOCOL_NETFLIX 133
|
|
||||||
#define NDPI_PROTOCOL_LASTFM 134
|
|
||||||
#define NDPI_PROTOCOL_WAZE 135
|
|
||||||
#define NDPI_PROTOCOL_YOUTUBE_UPLOAD 136 /* Upload files to youtube */
|
|
||||||
#define NDPI_PROTOCOL_ICQ 137
|
|
||||||
#define NDPI_PROTOCOL_CHECKMK 138
|
|
||||||
#define NDPI_PROTOCOL_CITRIX_ONLINE 139
|
|
||||||
#define NDPI_PROTOCOL_APPLE 140
|
|
||||||
#define NDPI_PROTOCOL_WEBEX 141
|
|
||||||
#define NDPI_PROTOCOL_WHATSAPP 142
|
|
||||||
#define NDPI_PROTOCOL_APPLE_ICLOUD 143
|
|
||||||
#define NDPI_PROTOCOL_VIBER 144
|
|
||||||
#define NDPI_PROTOCOL_APPLE_ITUNES 145
|
|
||||||
#define NDPI_PROTOCOL_RADIUS 146
|
|
||||||
#define NDPI_PROTOCOL_WINDOWS_UPDATE 147
|
|
||||||
#define NDPI_PROTOCOL_TEAMVIEWER 148 /* xplico.org */
|
|
||||||
#define NDPI_PROTOCOL_TUENTI 149
|
|
||||||
#define NDPI_PROTOCOL_LOTUS_NOTES 150
|
|
||||||
#define NDPI_PROTOCOL_SAP 151
|
|
||||||
#define NDPI_PROTOCOL_GTP 152
|
|
||||||
#define NDPI_PROTOCOL_UPNP 153
|
|
||||||
#define NDPI_PROTOCOL_LLMNR 154
|
|
||||||
#define NDPI_PROTOCOL_REMOTE_SCAN 155
|
|
||||||
#define NDPI_PROTOCOL_SPOTIFY 156
|
|
||||||
#define NDPI_CONTENT_WEBM 157
|
|
||||||
#define NDPI_PROTOCOL_H323 158 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_OPENVPN 159 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_NOE 160 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_CISCOVPN 161 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_TEAMSPEAK 162 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_TOR 163 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_SKINNY 164 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_RTCP 165 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_RSYNC 166 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_ORACLE 167 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_CORBA 168 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_UBUNTUONE 169 /* Remy Mudingay <mudingay@ill.fr> */
|
|
||||||
#define NDPI_PROTOCOL_WHOIS_DAS 170
|
|
||||||
#define NDPI_PROTOCOL_COLLECTD 171
|
|
||||||
#define NDPI_PROTOCOL_SOCKS 172 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
/* The Lync protocol is now skype for business and this the old id 173 can now be recycled */
|
|
||||||
#define NDPI_PROTOCOL_NINTENDO 173
|
|
||||||
#define NDPI_PROTOCOL_RTMP 174 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_FTP_DATA 175 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_WIKIPEDIA 176 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_ZMQ 177
|
|
||||||
#define NDPI_PROTOCOL_AMAZON 178 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_EBAY 179 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_CNN 180 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_MEGACO 181 /* Gianluca Costa <g.costa@xplico.org> */
|
|
||||||
#define NDPI_PROTOCOL_REDIS 182
|
|
||||||
#define NDPI_PROTOCOL_PANDO 183 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
|
||||||
#define NDPI_PROTOCOL_VHUA 184
|
|
||||||
#define NDPI_PROTOCOL_TELEGRAM 185 /* Gianluca Costa <g.costa@xplico.org> */
|
|
||||||
#define NDPI_PROTOCOL_VEVO 186
|
|
||||||
#define NDPI_PROTOCOL_PANDORA 187
|
|
||||||
#define NDPI_PROTOCOL_QUIC 188 /* Andrea Buscarinu <andrea.buscarinu@gmail.com> - Michele Campus <michelecampus5@gmail.com> */
|
|
||||||
#define NDPI_PROTOCOL_WHATSAPP_VOICE 189
|
|
||||||
#define NDPI_PROTOCOL_EAQ 190
|
|
||||||
#define NDPI_PROTOCOL_OOKLA 191
|
|
||||||
#define NDPI_PROTOCOL_AMQP 192
|
|
||||||
#define NDPI_PROTOCOL_KAKAOTALK 193 /* KakaoTalk Chat (no voice call) */
|
|
||||||
#define NDPI_PROTOCOL_KAKAOTALK_VOICE 194 /* KakaoTalk Voice */
|
|
||||||
#define NDPI_PROTOCOL_TWITCH 195 /* Edoardo Dominici <edoaramis@gmail.com> */
|
|
||||||
#define NDPI_PROTOCOL_QUICKPLAY 196 /* Streaming service used by various services such as hooq.tv */
|
|
||||||
#define NDPI_PROTOCOL_WECHAT 197
|
|
||||||
#define NDPI_PROTOCOL_MPEGTS 198
|
|
||||||
#define NDPI_PROTOCOL_SNAPCHAT 199
|
|
||||||
#define NDPI_PROTOCOL_SINA 200
|
|
||||||
#define NDPI_PROTOCOL_HANGOUT 201
|
|
||||||
#define NDPI_PROTOCOL_IFLIX 202 /* www.vizuamatix.com R&D team & M.Mallawaarachchie <manoj_ws@yahoo.com> */
|
|
||||||
#define NDPI_PROTOCOL_GITHUB 203
|
|
||||||
#define NDPI_PROTOCOL_BJNP 204
|
|
||||||
#define NDPI_PROTOCOL_1KXUN 205
|
|
||||||
#define NDPI_PROTOCOL_IQIYI 206
|
|
||||||
#define NDPI_PROTOCOL_SMPP 207 /* Damir Franusic <df@release14.org> */
|
|
||||||
#define NDPI_PROTOCOL_DNSCRYPT 208
|
|
||||||
#define NDPI_PROTOCOL_TINC 209 /* William Guglielmo <william@deselmo.com> */
|
|
||||||
#define NDPI_PROTOCOL_DEEZER 210
|
|
||||||
#define NDPI_PROTOCOL_INSTAGRAM 211 /* Andrea Buscarinu <andrea.buscarinu@gmail.com> */
|
|
||||||
#define NDPI_PROTOCOL_MICROSOFT 212
|
|
||||||
#define NDPI_PROTOCOL_STARCRAFT 213 /* Matteo Bracci <matteobracci1@gmail.com> */
|
|
||||||
#define NDPI_PROTOCOL_TEREDO 214
|
|
||||||
#define NDPI_PROTOCOL_HOTSPOT_SHIELD 215
|
|
||||||
#define NDPI_PROTOCOL_HEP 216 /* sipcapture.org QXIP BV */
|
|
||||||
#define NDPI_PROTOCOL_GOOGLE_DRIVE 217
|
|
||||||
#define NDPI_PROTOCOL_OCS 218
|
|
||||||
#define NDPI_PROTOCOL_OFFICE_365 219
|
|
||||||
#define NDPI_PROTOCOL_CLOUDFLARE 220
|
|
||||||
#define NDPI_PROTOCOL_MS_ONE_DRIVE 221
|
|
||||||
#define NDPI_PROTOCOL_MQTT 222
|
|
||||||
#define NDPI_PROTOCOL_RX 223
|
|
||||||
#define NDPI_PROTOCOL_APPLESTORE 224
|
|
||||||
#define NDPI_PROTOCOL_OPENDNS 225
|
|
||||||
#define NDPI_PROTOCOL_GIT 226
|
|
||||||
#define NDPI_PROTOCOL_DRDA 227
|
|
||||||
#define NDPI_PROTOCOL_PLAYSTORE 228
|
|
||||||
#define NDPI_PROTOCOL_SOMEIP 229
|
|
||||||
#define NDPI_PROTOCOL_FIX 230
|
|
||||||
#define NDPI_PROTOCOL_PLAYSTATION 231
|
|
||||||
#define NDPI_PROTOCOL_PASTEBIN 232 /* Paulo Angelo <pa@pauloangelo.com> */
|
|
||||||
#define NDPI_PROTOCOL_LINKEDIN 233 /* Paulo Angelo <pa@pauloangelo.com> */
|
|
||||||
#define NDPI_PROTOCOL_SOUNDCLOUD 234
|
|
||||||
#define NDPI_PROTOCOL_CSGO 235 /* Counter-Strike Global Offensive, Dota 2 */
|
|
||||||
#define NDPI_PROTOCOL_LISP 236
|
|
||||||
|
|
||||||
/* UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE */
|
|
||||||
#define NDPI_LAST_IMPLEMENTED_PROTOCOL NDPI_PROTOCOL_LISP
|
|
||||||
|
|
||||||
#define NDPI_MAX_SUPPORTED_PROTOCOLS (NDPI_LAST_IMPLEMENTED_PROTOCOL + 1)
|
|
||||||
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
|
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_protocols.h
|
* ndpi_protocols.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-16 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -52,6 +52,7 @@ u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struc
|
|||||||
void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
/* Applications and other protocols. */
|
/* Applications and other protocols. */
|
||||||
|
void ndpi_search_diameter(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
void ndpi_search_lisp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_lisp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
@@ -201,7 +202,10 @@ void ndpi_search_smpp(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
void ndpi_search_tinc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_tinc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
void ndpi_search_csgo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_csgo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
|
void ndpi_search_ajp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
|
void ndpi_search_memcached(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
/* --- INIT FUNCTIONS --- */
|
/* --- INIT FUNCTIONS --- */
|
||||||
|
void init_diameter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_applejuice_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_applejuice_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
@@ -229,7 +233,6 @@ void init_eaq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
void init_edonkey_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_edonkey_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_fasttrack_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_fasttrack_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_fiesta_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_fiesta_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_filetopia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
|
||||||
void init_florensia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_florensia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_ftp_control_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_ftp_control_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_ftp_data_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_ftp_data_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
@@ -350,5 +353,9 @@ void init_fix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
void init_nintendo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_nintendo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_csgo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_csgo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_checkmk_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_checkmk_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
|
void init_apple_push_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
|
void init_whatsapp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
|
void init_ajp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
|
void init_fbzero_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
|
void init_memcached_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
#endif /* __NDPI_PROTOCOLS_H__ */
|
#endif /* __NDPI_PROTOCOLS_H__ */
|
||||||
|
|||||||
+334
-269
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_typedefs.h
|
* ndpi_typedefs.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-16 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -25,23 +25,20 @@
|
|||||||
#define __NDPI_TYPEDEFS_H__
|
#define __NDPI_TYPEDEFS_H__
|
||||||
|
|
||||||
#include "ndpi_define.h"
|
#include "ndpi_define.h"
|
||||||
#include "../lib/third_party/include/libcache.h"
|
|
||||||
|
|
||||||
#define BT_ANNOUNCE
|
|
||||||
#define SNAP_EXT
|
|
||||||
|
|
||||||
|
/* Needed to have access to HAVE_* defines */
|
||||||
|
#include "ndpi_config.h"
|
||||||
|
|
||||||
/* NDPI_LOG_LEVEL */
|
/* NDPI_LOG_LEVEL */
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
NDPI_LOG_ERROR,
|
NDPI_LOG_ERROR,
|
||||||
NDPI_LOG_TRACE,
|
NDPI_LOG_TRACE,
|
||||||
NDPI_LOG_DEBUG
|
NDPI_LOG_DEBUG,
|
||||||
|
NDPI_LOG_DEBUG_EXTRA
|
||||||
} ndpi_log_level_t;
|
} ndpi_log_level_t;
|
||||||
|
|
||||||
/* NDPI_VISIT */
|
/* NDPI_VISIT */
|
||||||
typedef enum
|
typedef enum {
|
||||||
{
|
|
||||||
ndpi_preorder,
|
ndpi_preorder,
|
||||||
ndpi_postorder,
|
ndpi_postorder,
|
||||||
ndpi_endorder,
|
ndpi_endorder,
|
||||||
@@ -49,8 +46,7 @@ typedef enum
|
|||||||
} ndpi_VISIT;
|
} ndpi_VISIT;
|
||||||
|
|
||||||
/* NDPI_NODE */
|
/* NDPI_NODE */
|
||||||
typedef struct node_t
|
typedef struct node_t {
|
||||||
{
|
|
||||||
char *key;
|
char *key;
|
||||||
struct node_t *left, *right;
|
struct node_t *left, *right;
|
||||||
} ndpi_node;
|
} ndpi_node;
|
||||||
@@ -59,15 +55,15 @@ typedef struct node_t
|
|||||||
typedef u_int32_t ndpi_ndpi_mask;
|
typedef u_int32_t ndpi_ndpi_mask;
|
||||||
|
|
||||||
/* NDPI_PROTO_BITMASK_STRUCT */
|
/* NDPI_PROTO_BITMASK_STRUCT */
|
||||||
typedef struct ndpi_protocol_bitmask_struct
|
typedef struct ndpi_protocol_bitmask_struct {
|
||||||
{
|
|
||||||
ndpi_ndpi_mask fds_bits[NDPI_NUM_FDS_BITS];
|
ndpi_ndpi_mask fds_bits[NDPI_NUM_FDS_BITS];
|
||||||
} ndpi_protocol_bitmask_struct_t;
|
} ndpi_protocol_bitmask_struct_t;
|
||||||
|
|
||||||
/* NDPI_DEBUG_FUNCTION_PTR (cast) */
|
/* NDPI_DEBUG_FUNCTION_PTR (cast) */
|
||||||
typedef void (*ndpi_debug_function_ptr) (u_int32_t protocol, void *module_struct,
|
typedef void (*ndpi_debug_function_ptr) (u_int32_t protocol, void *module_struct,
|
||||||
ndpi_log_level_t log_level, const char *format, ...);
|
ndpi_log_level_t log_level, const char *file,
|
||||||
|
const char *func, unsigned line,
|
||||||
|
const char *format, ...);
|
||||||
|
|
||||||
/* ************************************************************ */
|
/* ************************************************************ */
|
||||||
/* ******************* NDPI NETWORKS HEADERS ****************** */
|
/* ******************* NDPI NETWORKS HEADERS ****************** */
|
||||||
@@ -177,7 +173,15 @@ struct ndpi_wifi_header
|
|||||||
PACK_ON
|
PACK_ON
|
||||||
struct ndpi_mpls_header
|
struct ndpi_mpls_header
|
||||||
{
|
{
|
||||||
|
/* Before using this strcut to parse an MPLS header, you will need to convert
|
||||||
|
* the 4-byte data to the correct endianess with ntohl(). */
|
||||||
|
#if defined(__LITTLE_ENDIAN__)
|
||||||
|
u_int32_t ttl:8, s:1, exp:3, label:20;
|
||||||
|
#elif defined(__BIG_ENDIAN__)
|
||||||
u_int32_t label:20, exp:3, s:1, ttl:8;
|
u_int32_t label:20, exp:3, s:1, ttl:8;
|
||||||
|
#else
|
||||||
|
# error "Byte order must be defined"
|
||||||
|
#endif
|
||||||
} PACK_OFF;
|
} PACK_OFF;
|
||||||
|
|
||||||
/* ++++++++++++++++++++++++ IP header ++++++++++++++++++++++++ */
|
/* ++++++++++++++++++++++++ IP header ++++++++++++++++++++++++ */
|
||||||
@@ -205,34 +209,27 @@ struct ndpi_iphdr {
|
|||||||
/* +++++++++++++++++++++++ IPv6 header +++++++++++++++++++++++ */
|
/* +++++++++++++++++++++++ IPv6 header +++++++++++++++++++++++ */
|
||||||
/* rfc3542 */
|
/* rfc3542 */
|
||||||
|
|
||||||
struct ndpi_in6_addr
|
struct ndpi_in6_addr {
|
||||||
{
|
union {
|
||||||
union
|
|
||||||
{
|
|
||||||
u_int8_t u6_addr8[16];
|
u_int8_t u6_addr8[16];
|
||||||
u_int16_t u6_addr16[8];
|
u_int16_t u6_addr16[8];
|
||||||
u_int32_t u6_addr32[4];
|
u_int32_t u6_addr32[4];
|
||||||
} u6_addr; /* 128-bit IP6 address */
|
} u6_addr; /* 128-bit IP6 address */
|
||||||
};
|
};
|
||||||
|
|
||||||
PACK_ON
|
struct ndpi_ip6_hdrctl {
|
||||||
struct ndpi_ipv6hdr
|
|
||||||
{
|
|
||||||
union
|
|
||||||
{
|
|
||||||
struct ndpi_ip6_hdrctl
|
|
||||||
{
|
|
||||||
u_int32_t ip6_un1_flow;
|
u_int32_t ip6_un1_flow;
|
||||||
u_int16_t ip6_un1_plen;
|
u_int16_t ip6_un1_plen;
|
||||||
u_int8_t ip6_un1_nxt;
|
u_int8_t ip6_un1_nxt;
|
||||||
u_int8_t ip6_un1_hlim;
|
u_int8_t ip6_un1_hlim;
|
||||||
} ip6_un1;
|
};
|
||||||
u_int8_t ip6_un2_vfc;
|
|
||||||
} ip6_ctlun;
|
|
||||||
|
|
||||||
|
/* PACK_ON */
|
||||||
|
struct ndpi_ipv6hdr {
|
||||||
|
struct ndpi_ip6_hdrctl ip6_hdr;
|
||||||
struct ndpi_in6_addr ip6_src;
|
struct ndpi_in6_addr ip6_src;
|
||||||
struct ndpi_in6_addr ip6_dst;
|
struct ndpi_in6_addr ip6_dst;
|
||||||
} PACK_OFF;
|
} /* PACK_OFF */;
|
||||||
|
|
||||||
/* +++++++++++++++++++++++ TCP header +++++++++++++++++++++++ */
|
/* +++++++++++++++++++++++ TCP header +++++++++++++++++++++++ */
|
||||||
|
|
||||||
@@ -311,8 +308,7 @@ struct ndpi_icmphdr {
|
|||||||
/* ******************* ********************* ****************** */
|
/* ******************* ********************* ****************** */
|
||||||
/* ************************************************************ */
|
/* ************************************************************ */
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_BITTORRENT
|
/* NDPI_PROTOCOL_BITTORRENT */
|
||||||
|
|
||||||
typedef struct spinlock {
|
typedef struct spinlock {
|
||||||
volatile int val;
|
volatile int val;
|
||||||
} spinlock_t;
|
} spinlock_t;
|
||||||
@@ -351,10 +347,8 @@ struct bt_announce { // 192 bytes
|
|||||||
u_int8_t name_len,
|
u_int8_t name_len,
|
||||||
name[192 - 4*10 - 2 - 1]; // 149 bytes
|
name[192 - 4*10 - 2 - 1]; // 149 bytes
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_TINC
|
|
||||||
|
|
||||||
|
/* NDPI_PROTOCOL_TINC */
|
||||||
#define TINC_CACHE_MAX_SIZE 10
|
#define TINC_CACHE_MAX_SIZE 10
|
||||||
|
|
||||||
PACK_ON struct tinc_cache_entry {
|
PACK_ON struct tinc_cache_entry {
|
||||||
@@ -363,8 +357,6 @@ PACK_ON struct tinc_cache_entry {
|
|||||||
u_int16_t dst_port;
|
u_int16_t dst_port;
|
||||||
} PACK_OFF;
|
} PACK_OFF;
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
HTTP_METHOD_UNKNOWN = 0,
|
HTTP_METHOD_UNKNOWN = 0,
|
||||||
HTTP_METHOD_OPTIONS,
|
HTTP_METHOD_OPTIONS,
|
||||||
@@ -385,229 +377,227 @@ struct ndpi_id_struct {
|
|||||||
to compare this, use:
|
to compare this, use:
|
||||||
**/
|
**/
|
||||||
NDPI_PROTOCOL_BITMASK detected_protocol_bitmask;
|
NDPI_PROTOCOL_BITMASK detected_protocol_bitmask;
|
||||||
#ifdef NDPI_PROTOCOL_RTSP
|
/* NDPI_PROTOCOL_RTSP */
|
||||||
ndpi_ip_addr_t rtsp_ip_address;
|
ndpi_ip_addr_t rtsp_ip_address;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SIP
|
/* NDPI_PROTOCOL_YAHOO */
|
||||||
#ifdef NDPI_PROTOCOL_YAHOO
|
|
||||||
u_int32_t yahoo_video_lan_timer;
|
u_int32_t yahoo_video_lan_timer;
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
/* NDPI_PROTOCOL_IRC_MAXPORT % 2 must be 0 */
|
/* NDPI_PROTOCOL_IRC_MAXPORT % 2 must be 0 */
|
||||||
#ifdef NDPI_PROTOCOL_IRC
|
/* NDPI_PROTOCOL_IRC */
|
||||||
#define NDPI_PROTOCOL_IRC_MAXPORT 8
|
#define NDPI_PROTOCOL_IRC_MAXPORT 8
|
||||||
u_int16_t irc_port[NDPI_PROTOCOL_IRC_MAXPORT];
|
u_int16_t irc_port[NDPI_PROTOCOL_IRC_MAXPORT];
|
||||||
u_int32_t last_time_port_used[NDPI_PROTOCOL_IRC_MAXPORT];
|
u_int32_t last_time_port_used[NDPI_PROTOCOL_IRC_MAXPORT];
|
||||||
u_int32_t irc_ts;
|
u_int32_t irc_ts;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_GNUTELLA
|
/* NDPI_PROTOCOL_GNUTELLA */
|
||||||
u_int32_t gnutella_ts;
|
u_int32_t gnutella_ts;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_BATTLEFIELD
|
/* NDPI_PROTOCOL_BATTLEFIELD */
|
||||||
u_int32_t battlefield_ts;
|
u_int32_t battlefield_ts;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_THUNDER
|
/* NDPI_PROTOCOL_THUNDER */
|
||||||
u_int32_t thunder_ts;
|
u_int32_t thunder_ts;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_RTSP
|
/* NDPI_PROTOCOL_RTSP */
|
||||||
u_int32_t rtsp_timer;
|
u_int32_t rtsp_timer;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_OSCAR
|
/* NDPI_PROTOCOL_OSCAR */
|
||||||
u_int32_t oscar_last_safe_access_time;
|
u_int32_t oscar_last_safe_access_time;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_ZATTOO
|
/* NDPI_PROTOCOL_ZATTOO */
|
||||||
u_int32_t zattoo_ts;
|
u_int32_t zattoo_ts;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_UNENCRYPTED_JABBER
|
/* NDPI_PROTOCOL_UNENCRYPTED_JABBER */
|
||||||
u_int32_t jabber_stun_or_ft_ts;
|
u_int32_t jabber_stun_or_ft_ts;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_DIRECTCONNECT
|
/* NDPI_PROTOCOL_DIRECTCONNECT */
|
||||||
u_int32_t directconnect_last_safe_access_time;
|
u_int32_t directconnect_last_safe_access_time;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SOULSEEK
|
/* NDPI_PROTOCOL_SOULSEEK */
|
||||||
u_int32_t soulseek_last_safe_access_time;
|
u_int32_t soulseek_last_safe_access_time;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_DIRECTCONNECT
|
/* NDPI_PROTOCOL_DIRECTCONNECT */
|
||||||
u_int16_t detected_directconnect_port;
|
u_int16_t detected_directconnect_port;
|
||||||
u_int16_t detected_directconnect_udp_port;
|
u_int16_t detected_directconnect_udp_port;
|
||||||
u_int16_t detected_directconnect_ssl_port;
|
u_int16_t detected_directconnect_ssl_port;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_BITTORRENT
|
/* NDPI_PROTOCOL_BITTORRENT */
|
||||||
#define NDPI_BT_PORTS 8
|
#define NDPI_BT_PORTS 8
|
||||||
u_int16_t bt_port_t[NDPI_BT_PORTS];
|
u_int16_t bt_port_t[NDPI_BT_PORTS];
|
||||||
u_int16_t bt_port_u[NDPI_BT_PORTS];
|
u_int16_t bt_port_u[NDPI_BT_PORTS];
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_UNENCRYPTED_JABBER
|
/* NDPI_PROTOCOL_UNENCRYPTED_JABBER */
|
||||||
#define JABBER_MAX_STUN_PORTS 6
|
#define JABBER_MAX_STUN_PORTS 6
|
||||||
u_int16_t jabber_voice_stun_port[JABBER_MAX_STUN_PORTS];
|
u_int16_t jabber_voice_stun_port[JABBER_MAX_STUN_PORTS];
|
||||||
u_int16_t jabber_file_transfer_port[2];
|
u_int16_t jabber_file_transfer_port[2];
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_GNUTELLA
|
/* NDPI_PROTOCOL_GNUTELLA */
|
||||||
u_int16_t detected_gnutella_port;
|
u_int16_t detected_gnutella_port;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_GNUTELLA
|
/* NDPI_PROTOCOL_GNUTELLA */
|
||||||
u_int16_t detected_gnutella_udp_port1;
|
u_int16_t detected_gnutella_udp_port1;
|
||||||
u_int16_t detected_gnutella_udp_port2;
|
u_int16_t detected_gnutella_udp_port2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SOULSEEK
|
/* NDPI_PROTOCOL_SOULSEEK */
|
||||||
u_int16_t soulseek_listen_port;
|
u_int16_t soulseek_listen_port;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_IRC
|
/* NDPI_PROTOCOL_IRC */
|
||||||
u_int8_t irc_number_of_port;
|
u_int8_t irc_number_of_port;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_OSCAR
|
/* NDPI_PROTOCOL_OSCAR */
|
||||||
u_int8_t oscar_ssl_session_id[33];
|
u_int8_t oscar_ssl_session_id[33];
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_UNENCRYPTED_JABBER
|
/* NDPI_PROTOCOL_UNENCRYPTED_JABBER */
|
||||||
u_int8_t jabber_voice_stun_used_ports;
|
u_int8_t jabber_voice_stun_used_ports;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SIP
|
/* NDPI_PROTOCOL_SIP */
|
||||||
#ifdef NDPI_PROTOCOL_YAHOO
|
/* NDPI_PROTOCOL_YAHOO */
|
||||||
u_int32_t yahoo_video_lan_dir:1;
|
u_int32_t yahoo_video_lan_dir:1;
|
||||||
#endif
|
|
||||||
#endif
|
/* NDPI_PROTOCOL_YAHOO */
|
||||||
#ifdef NDPI_PROTOCOL_YAHOO
|
|
||||||
u_int32_t yahoo_conf_logged_in:1;
|
u_int32_t yahoo_conf_logged_in:1;
|
||||||
u_int32_t yahoo_voice_conf_logged_in:1;
|
u_int32_t yahoo_voice_conf_logged_in:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_RTSP
|
/* NDPI_PROTOCOL_RTSP */
|
||||||
u_int32_t rtsp_ts_set:1;
|
u_int32_t rtsp_ts_set:1;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ************************************************** */
|
/* ************************************************** */
|
||||||
|
|
||||||
struct ndpi_flow_tcp_struct {
|
struct ndpi_flow_tcp_struct {
|
||||||
#ifdef NDPI_PROTOCOL_MAIL_SMTP
|
/* NDPI_PROTOCOL_MAIL_SMTP */
|
||||||
u_int16_t smtp_command_bitmask;
|
u_int16_t smtp_command_bitmask;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_MAIL_POP
|
/* NDPI_PROTOCOL_MAIL_POP */
|
||||||
u_int16_t pop_command_bitmask;
|
u_int16_t pop_command_bitmask;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_QQ
|
/* NDPI_PROTOCOL_QQ */
|
||||||
u_int16_t qq_nxt_len;
|
u_int16_t qq_nxt_len;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_TDS
|
/* NDPI_PROTOCOL_WHATSAPP */
|
||||||
|
u_int8_t wa_matched_so_far;
|
||||||
|
|
||||||
|
/* NDPI_PROTOCOL_TDS */
|
||||||
u_int8_t tds_login_version;
|
u_int8_t tds_login_version;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_IRC
|
/* NDPI_PROTOCOL_IRC */
|
||||||
u_int8_t irc_stage;
|
u_int8_t irc_stage;
|
||||||
u_int8_t irc_port;
|
u_int8_t irc_port;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_H323
|
/* NDPI_PROTOCOL_H323 */
|
||||||
u_int8_t h323_valid_packets;
|
u_int8_t h323_valid_packets;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_GNUTELLA
|
/* NDPI_PROTOCOL_GNUTELLA */
|
||||||
u_int8_t gnutella_msg_id[3];
|
u_int8_t gnutella_msg_id[3];
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_IRC
|
/* NDPI_PROTOCOL_IRC */
|
||||||
u_int32_t irc_3a_counter:3;
|
u_int32_t irc_3a_counter:3;
|
||||||
u_int32_t irc_stage2:5;
|
u_int32_t irc_stage2:5;
|
||||||
u_int32_t irc_direction:2;
|
u_int32_t irc_direction:2;
|
||||||
u_int32_t irc_0x1000_full:1;
|
u_int32_t irc_0x1000_full:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SOULSEEK
|
/* NDPI_PROTOCOL_SOULSEEK */
|
||||||
u_int32_t soulseek_stage:2;
|
u_int32_t soulseek_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_FILETOPIA
|
/* NDPI_PROTOCOL_TDS */
|
||||||
u_int32_t filetopia_stage:2;
|
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_TDS
|
|
||||||
u_int32_t tds_stage:3;
|
u_int32_t tds_stage:3;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_USENET
|
/* NDPI_PROTOCOL_USENET */
|
||||||
u_int32_t usenet_stage:2;
|
u_int32_t usenet_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_IMESH
|
/* NDPI_PROTOCOL_IMESH */
|
||||||
u_int32_t imesh_stage:4;
|
u_int32_t imesh_stage:4;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_HTTP
|
/* NDPI_PROTOCOL_HTTP */
|
||||||
u_int32_t http_setup_dir:2;
|
u_int32_t http_setup_dir:2;
|
||||||
u_int32_t http_stage:2;
|
u_int32_t http_stage:2;
|
||||||
u_int32_t http_empty_line_seen:1;
|
u_int32_t http_empty_line_seen:1;
|
||||||
u_int32_t http_wait_for_retransmission:1;
|
u_int32_t http_wait_for_retransmission:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_GNUTELLA
|
/* NDPI_PROTOCOL_GNUTELLA */
|
||||||
u_int32_t gnutella_stage:2; // 0 - 2
|
u_int32_t gnutella_stage:2; // 0 - 2
|
||||||
#endif
|
|
||||||
#ifdef NDPI_CONTENT_MMS
|
/* NDPI_CONTENT_MMS */
|
||||||
u_int32_t mms_stage:2;
|
u_int32_t mms_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_YAHOO
|
/* NDPI_PROTOCOL_YAHOO */
|
||||||
u_int32_t yahoo_sip_comm:1;
|
u_int32_t yahoo_sip_comm:1;
|
||||||
u_int32_t yahoo_http_proxy_stage:2;
|
u_int32_t yahoo_http_proxy_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_MSN
|
/* NDPI_PROTOCOL_MSN */
|
||||||
u_int32_t msn_stage:3;
|
u_int32_t msn_stage:3;
|
||||||
u_int32_t msn_ssl_ft:2;
|
u_int32_t msn_ssl_ft:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SSH
|
/* NDPI_PROTOCOL_SSH */
|
||||||
u_int32_t ssh_stage:3;
|
u_int32_t ssh_stage:3;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_VNC
|
/* NDPI_PROTOCOL_VNC */
|
||||||
u_int32_t vnc_stage:2; // 0 - 3
|
u_int32_t vnc_stage:2; // 0 - 3
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_TELNET
|
/* NDPI_PROTOCOL_TELNET */
|
||||||
u_int32_t telnet_stage:2; // 0 - 2
|
u_int32_t telnet_stage:2; // 0 - 2
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SSL
|
/* NDPI_PROTOCOL_SSL */
|
||||||
u_int8_t ssl_stage:2, ssl_seen_client_cert:1, ssl_seen_server_cert:1; // 0 - 5
|
u_int8_t ssl_seen_client_cert:1, ssl_seen_server_cert:1, ssl_stage:2; // 0 - 5
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_POSTGRES
|
/* NDPI_PROTOCOL_POSTGRES */
|
||||||
u_int32_t postgres_stage:3;
|
u_int32_t postgres_stage:3;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK
|
/* NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK */
|
||||||
u_int32_t ddlink_server_direction:1;
|
u_int32_t ddlink_server_direction:1;
|
||||||
#endif
|
|
||||||
u_int32_t seen_syn:1;
|
u_int32_t seen_syn:1;
|
||||||
u_int32_t seen_syn_ack:1;
|
u_int32_t seen_syn_ack:1;
|
||||||
u_int32_t seen_ack:1;
|
u_int32_t seen_ack:1;
|
||||||
#ifdef NDPI_PROTOCOL_ICECAST
|
|
||||||
|
/* NDPI_PROTOCOL_ICECAST */
|
||||||
u_int32_t icecast_stage:1;
|
u_int32_t icecast_stage:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_DOFUS
|
/* NDPI_PROTOCOL_DOFUS */
|
||||||
u_int32_t dofus_stage:1;
|
u_int32_t dofus_stage:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_FIESTA
|
/* NDPI_PROTOCOL_FIESTA */
|
||||||
u_int32_t fiesta_stage:2;
|
u_int32_t fiesta_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_WORLDOFWARCRAFT
|
/* NDPI_PROTOCOL_WORLDOFWARCRAFT */
|
||||||
u_int32_t wow_stage:2;
|
u_int32_t wow_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV
|
/* NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV */
|
||||||
u_int32_t veoh_tv_stage:2;
|
u_int32_t veoh_tv_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SHOUTCAST
|
/* NDPI_PROTOCOL_SHOUTCAST */
|
||||||
u_int32_t shoutcast_stage:2;
|
u_int32_t shoutcast_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_RTP
|
/* NDPI_PROTOCOL_RTP */
|
||||||
u_int32_t rtp_special_packets_seen:1;
|
u_int32_t rtp_special_packets_seen:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_MAIL_POP
|
/* NDPI_PROTOCOL_MAIL_POP */
|
||||||
u_int32_t mail_pop_stage:2;
|
u_int32_t mail_pop_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_MAIL_IMAP
|
/* NDPI_PROTOCOL_MAIL_IMAP */
|
||||||
u_int32_t mail_imap_stage:3, mail_imap_starttls:2;
|
u_int32_t mail_imap_stage:3, mail_imap_starttls:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SKYPE
|
/* NDPI_PROTOCOL_SKYPE */
|
||||||
u_int8_t skype_packet_id;
|
u_int8_t skype_packet_id;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_CITRIX
|
/* NDPI_PROTOCOL_CITRIX */
|
||||||
u_int8_t citrix_packet_id;
|
u_int8_t citrix_packet_id;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_LOTUS_NOTES
|
/* NDPI_PROTOCOL_LOTUS_NOTES */
|
||||||
u_int8_t lotus_notes_packet_id;
|
u_int8_t lotus_notes_packet_id;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_TEAMVIEWER
|
/* NDPI_PROTOCOL_TEAMVIEWER */
|
||||||
u_int8_t teamviewer_stage;
|
u_int8_t teamviewer_stage;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_ZMQ
|
/* NDPI_PROTOCOL_ZMQ */
|
||||||
u_int8_t prev_zmq_pkt_len;
|
u_int8_t prev_zmq_pkt_len;
|
||||||
u_char prev_zmq_pkt[10];
|
u_char prev_zmq_pkt[10];
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_PPSTREAM
|
/* NDPI_PROTOCOL_PPSTREAM */
|
||||||
u_int32_t ppstream_stage:3;
|
u_int32_t ppstream_stage:3;
|
||||||
#endif
|
|
||||||
|
/* NDPI_PROTOCOL_MEMCACHED */
|
||||||
|
u_int8_t memcached_matches;
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
__attribute__ ((__packed__))
|
__attribute__ ((__packed__))
|
||||||
@@ -617,50 +607,52 @@ struct ndpi_flow_tcp_struct {
|
|||||||
/* ************************************************** */
|
/* ************************************************** */
|
||||||
|
|
||||||
struct ndpi_flow_udp_struct {
|
struct ndpi_flow_udp_struct {
|
||||||
#ifdef NDPI_PROTOCOL_BATTLEFIELD
|
/* NDPI_PROTOCOL_BATTLEFIELD */
|
||||||
u_int32_t battlefield_msg_id;
|
u_int32_t battlefield_msg_id;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SNMP
|
/* NDPI_PROTOCOL_SNMP */
|
||||||
u_int32_t snmp_msg_id;
|
u_int32_t snmp_msg_id;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_BATTLEFIELD
|
/* NDPI_PROTOCOL_BATTLEFIELD */
|
||||||
u_int32_t battlefield_stage:3;
|
u_int32_t battlefield_stage:3;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SNMP
|
/* NDPI_PROTOCOL_SNMP */
|
||||||
u_int32_t snmp_stage:2;
|
u_int32_t snmp_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_PPSTREAM
|
/* NDPI_PROTOCOL_PPSTREAM */
|
||||||
u_int32_t ppstream_stage:3; // 0 - 7
|
u_int32_t ppstream_stage:3; // 0 - 7
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_HALFLIFE2
|
/* NDPI_PROTOCOL_HALFLIFE2 */
|
||||||
u_int32_t halflife2_stage:2; // 0 - 2
|
u_int32_t halflife2_stage:2; // 0 - 2
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_TFTP
|
/* NDPI_PROTOCOL_TFTP */
|
||||||
u_int32_t tftp_stage:1;
|
u_int32_t tftp_stage:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_AIMINI
|
/* NDPI_PROTOCOL_AIMINI */
|
||||||
u_int32_t aimini_stage:5;
|
u_int32_t aimini_stage:5;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_XBOX
|
/* NDPI_PROTOCOL_XBOX */
|
||||||
u_int32_t xbox_stage:1;
|
u_int32_t xbox_stage:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_WINDOWS_UPDATE
|
/* NDPI_PROTOCOL_WINDOWS_UPDATE */
|
||||||
u_int32_t wsus_stage:1;
|
u_int32_t wsus_stage:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SKYPE
|
/* NDPI_PROTOCOL_SKYPE */
|
||||||
u_int8_t skype_packet_id;
|
u_int8_t skype_packet_id;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_TEAMVIEWER
|
/* NDPI_PROTOCOL_TEAMVIEWER */
|
||||||
u_int8_t teamviewer_stage;
|
u_int8_t teamviewer_stage;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_EAQ
|
/* NDPI_PROTOCOL_EAQ */
|
||||||
u_int8_t eaq_pkt_id;
|
u_int8_t eaq_pkt_id;
|
||||||
u_int32_t eaq_sequence;
|
u_int32_t eaq_sequence;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_RX
|
/* NDPI_PROTOCOL_RX */
|
||||||
u_int32_t rx_conn_epoch;
|
u_int32_t rx_conn_epoch;
|
||||||
u_int32_t rx_conn_id;
|
u_int32_t rx_conn_id;
|
||||||
#endif
|
|
||||||
|
/* NDPI_PROTOCOL_MEMCACHED */
|
||||||
|
u_int8_t memcached_matches;
|
||||||
}
|
}
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
__attribute__ ((__packed__))
|
__attribute__ ((__packed__))
|
||||||
@@ -690,7 +682,6 @@ struct ndpi_packet_struct {
|
|||||||
u_int16_t detected_protocol_stack[NDPI_PROTOCOL_SIZE];
|
u_int16_t detected_protocol_stack[NDPI_PROTOCOL_SIZE];
|
||||||
u_int8_t detected_subprotocol_stack[NDPI_PROTOCOL_SIZE];
|
u_int8_t detected_subprotocol_stack[NDPI_PROTOCOL_SIZE];
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
__attribute__ ((__packed__))
|
__attribute__ ((__packed__))
|
||||||
#endif
|
#endif
|
||||||
@@ -713,7 +704,8 @@ struct ndpi_packet_struct {
|
|||||||
struct ndpi_int_one_line_struct http_x_session_type;
|
struct ndpi_int_one_line_struct http_x_session_type;
|
||||||
struct ndpi_int_one_line_struct server_line;
|
struct ndpi_int_one_line_struct server_line;
|
||||||
struct ndpi_int_one_line_struct http_method;
|
struct ndpi_int_one_line_struct http_method;
|
||||||
struct ndpi_int_one_line_struct http_response; /* the first "word" in this pointer is the response code in the packet (200, etc) */
|
struct ndpi_int_one_line_struct http_response; /* the first "word" in this pointer is the
|
||||||
|
response code in the packet (200, etc) */
|
||||||
u_int8_t http_num_headers; /* number of found (valid) header lines in HTTP request or response */
|
u_int8_t http_num_headers; /* number of found (valid) header lines in HTTP request or response */
|
||||||
|
|
||||||
u_int16_t l3_packet_len;
|
u_int16_t l3_packet_len;
|
||||||
@@ -748,17 +740,17 @@ struct ndpi_subprotocol_conf_struct {
|
|||||||
void (*func) (struct ndpi_detection_module_struct *, char *attr, char *value, int protocol_id);
|
void (*func) (struct ndpi_detection_module_struct *, char *attr, char *value, int protocol_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u_int16_t port_low, port_high;
|
u_int16_t port_low, port_high;
|
||||||
} ndpi_port_range;
|
} ndpi_port_range;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NDPI_PROTOCOL_SAFE = 0, /* Surely doesn’t provide risks for the network. (e.g., a news site) */
|
NDPI_PROTOCOL_SAFE = 0, /* Surely doesn't provide risks for the network. (e.g., a news site) */
|
||||||
NDPI_PROTOCOL_ACCEPTABLE, /* Probably doesn’t provide risks, but could be malicious (e.g., Dropbox) */
|
NDPI_PROTOCOL_ACCEPTABLE, /* Probably doesn't provide risks, but could be malicious (e.g., Dropbox) */
|
||||||
NDPI_PROTOCOL_FUN, /* Pure fun protocol, which may be prohibited by the user policy (e.g., Netflix) */
|
NDPI_PROTOCOL_FUN, /* Pure fun protocol, which may be prohibited by the user policy (e.g., Netflix) */
|
||||||
NDPI_PROTOCOL_UNSAFE, /* Probably provides risks, but could be a normal traffic. Unencrypted protocols with clear pass should be here (e.g., telnet) */
|
NDPI_PROTOCOL_UNSAFE, /* Probably provides risks, but could be a normal traffic. Unencrypted protocols with clear pass should be here (e.g., telnet) */
|
||||||
NDPI_PROTOCOL_POTENTIALLY_DANGEROUS, /* Surely is dangerous (ex. Tor). Be prepared to troubles */
|
NDPI_PROTOCOL_POTENTIALLY_DANGEROUS, /* Surely is dangerous (ex. Tor). Be prepared to troubles */
|
||||||
|
NDPI_PROTOCOL_TRACKER_ADS, /* Trackers, Advertisements... */
|
||||||
NDPI_PROTOCOL_UNRATED /* No idea, not implemented or impossible to classify */
|
NDPI_PROTOCOL_UNRATED /* No idea, not implemented or impossible to classify */
|
||||||
} ndpi_protocol_breed_t;
|
} ndpi_protocol_breed_t;
|
||||||
|
|
||||||
@@ -771,7 +763,7 @@ typedef enum {
|
|||||||
NDPI_PROTOCOL_CATEGORY_VPN, /* Virtual Private Networks */
|
NDPI_PROTOCOL_CATEGORY_VPN, /* Virtual Private Networks */
|
||||||
NDPI_PROTOCOL_CATEGORY_MAIL, /* Protocols to send/receive/sync emails */
|
NDPI_PROTOCOL_CATEGORY_MAIL, /* Protocols to send/receive/sync emails */
|
||||||
NDPI_PROTOCOL_CATEGORY_DATA_TRANSFER, /* AFS/NFS and similar protocols */
|
NDPI_PROTOCOL_CATEGORY_DATA_TRANSFER, /* AFS/NFS and similar protocols */
|
||||||
NDPI_PROTOCOL_CATEGORY_WEB, /* Web protocols and services */
|
NDPI_PROTOCOL_CATEGORY_WEB, /* Web/mobile protocols and services */
|
||||||
NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, /* Social networks */
|
NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, /* Social networks */
|
||||||
NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, /* Download, FTP, file transfer/sharing */
|
NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, /* Download, FTP, file transfer/sharing */
|
||||||
NDPI_PROTOCOL_CATEGORY_GAME, /* Online games */
|
NDPI_PROTOCOL_CATEGORY_GAME, /* Online games */
|
||||||
@@ -783,9 +775,10 @@ typedef enum {
|
|||||||
NDPI_PROTOCOL_CATEGORY_NETWORK, /* Network infrastructure protocols */
|
NDPI_PROTOCOL_CATEGORY_NETWORK, /* Network infrastructure protocols */
|
||||||
NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, /* Software for collaborative development, including Webmail */
|
NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, /* Software for collaborative development, including Webmail */
|
||||||
NDPI_PROTOCOL_CATEGORY_RPC, /* High level network communication protocols */
|
NDPI_PROTOCOL_CATEGORY_RPC, /* High level network communication protocols */
|
||||||
NDPI_PROTOCOL_CATEGORY_NETWORK_TOOL, /* Network administration and monitor protocols */
|
NDPI_PROTOCOL_CATEGORY_STREAMING, /* Streaming protocols */
|
||||||
NDPI_PROTOCOL_CATEGORY_SYSTEM_OS, /* System/Operating System level applications */
|
NDPI_PROTOCOL_CATEGORY_SYSTEM_OS, /* System/Operating System level applications */
|
||||||
NDPI_PROTOCOL_CATEGORY_SW_UPDATE, /* Software update */
|
NDPI_PROTOCOL_CATEGORY_SW_UPDATE, /* Software update */
|
||||||
|
|
||||||
/* See #define NUM_CUSTOM_CATEGORIES */
|
/* See #define NUM_CUSTOM_CATEGORIES */
|
||||||
NDPI_PROTOCOL_CATEGORY_CUSTOM_1, /* User custom category 1 */
|
NDPI_PROTOCOL_CATEGORY_CUSTOM_1, /* User custom category 1 */
|
||||||
NDPI_PROTOCOL_CATEGORY_CUSTOM_2, /* User custom category 2 */
|
NDPI_PROTOCOL_CATEGORY_CUSTOM_2, /* User custom category 2 */
|
||||||
@@ -793,6 +786,23 @@ typedef enum {
|
|||||||
NDPI_PROTOCOL_CATEGORY_CUSTOM_4, /* User custom category 4 */
|
NDPI_PROTOCOL_CATEGORY_CUSTOM_4, /* User custom category 4 */
|
||||||
NDPI_PROTOCOL_CATEGORY_CUSTOM_5, /* User custom category 5 */
|
NDPI_PROTOCOL_CATEGORY_CUSTOM_5, /* User custom category 5 */
|
||||||
|
|
||||||
|
/* Payload Content */
|
||||||
|
NDPI_CONTENT_CATEGORY_AVI,
|
||||||
|
NDPI_CONTENT_CATEGORY_FLASH,
|
||||||
|
NDPI_CONTENT_CATEGORY_OGG,
|
||||||
|
NDPI_CONTENT_CATEGORY_MPEG,
|
||||||
|
NDPI_CONTENT_CATEGORY_QUICKTIME,
|
||||||
|
NDPI_CONTENT_CATEGORY_REALMEDIA,
|
||||||
|
NDPI_CONTENT_CATEGORY_WINDOWSMEDIA,
|
||||||
|
NDPI_CONTENT_CATEGORY_WEBM,
|
||||||
|
|
||||||
|
/* Some custom categories */
|
||||||
|
CUSTOM_CATEGORY_MINING = 99,
|
||||||
|
CUSTOM_CATEGORY_MALWARE = 100,
|
||||||
|
CUSTOM_CATEGORY_ADVERTISEMENT = 101,
|
||||||
|
CUSTOM_CATEGORY_BANNED_SITE = 102,
|
||||||
|
CUSTOM_CATEGORY_SITE_UNAVAILABLE = 103,
|
||||||
|
|
||||||
NDPI_PROTOCOL_NUM_CATEGORIES /*
|
NDPI_PROTOCOL_NUM_CATEGORIES /*
|
||||||
NOTE: Keep this as last member
|
NOTE: Keep this as last member
|
||||||
Unused as value but useful to getting the number of elements
|
Unused as value but useful to getting the number of elements
|
||||||
@@ -800,6 +810,14 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
} ndpi_protocol_category_t;
|
} ndpi_protocol_category_t;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ndpi_pref_http_dont_dissect_response = 0,
|
||||||
|
ndpi_pref_dns_dissect_response,
|
||||||
|
ndpi_pref_direction_detect_disable,
|
||||||
|
ndpi_pref_disable_metadata_export,
|
||||||
|
ndpi_pref_enable_category_substring_match,
|
||||||
|
} ndpi_detection_preference;
|
||||||
|
|
||||||
/* ntop extensions */
|
/* ntop extensions */
|
||||||
typedef struct ndpi_proto_defaults {
|
typedef struct ndpi_proto_defaults {
|
||||||
char *protoName;
|
char *protoName;
|
||||||
@@ -822,7 +840,13 @@ typedef struct _ndpi_automa {
|
|||||||
} ndpi_automa;
|
} ndpi_automa;
|
||||||
|
|
||||||
typedef struct ndpi_proto {
|
typedef struct ndpi_proto {
|
||||||
|
/*
|
||||||
|
Note
|
||||||
|
below we do not use ndpi_protocol_id_t as users can define their own
|
||||||
|
custom protocols and thus the typedef could be too short in size.
|
||||||
|
*/
|
||||||
u_int16_t master_protocol /* e.g. HTTP */, app_protocol /* e.g. FaceBook */;
|
u_int16_t master_protocol /* e.g. HTTP */, app_protocol /* e.g. FaceBook */;
|
||||||
|
ndpi_protocol_category_t category;
|
||||||
} ndpi_protocol;
|
} ndpi_protocol;
|
||||||
|
|
||||||
#define NDPI_PROTOCOL_NULL { NDPI_PROTOCOL_UNKNOWN , NDPI_PROTOCOL_UNKNOWN }
|
#define NDPI_PROTOCOL_NULL { NDPI_PROTOCOL_UNKNOWN , NDPI_PROTOCOL_UNKNOWN }
|
||||||
@@ -830,6 +854,16 @@ typedef struct ndpi_proto {
|
|||||||
#define NUM_CUSTOM_CATEGORIES 5
|
#define NUM_CUSTOM_CATEGORIES 5
|
||||||
#define CUSTOM_CATEGORY_LABEL_LEN 32
|
#define CUSTOM_CATEGORY_LABEL_LEN 32
|
||||||
|
|
||||||
|
#ifdef HAVE_HYPERSCAN
|
||||||
|
struct hs_list {
|
||||||
|
char *expression;
|
||||||
|
unsigned int id;
|
||||||
|
struct hs_list *next;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NDPI_LIB_COMPILATION
|
||||||
|
|
||||||
struct ndpi_detection_module_struct {
|
struct ndpi_detection_module_struct {
|
||||||
NDPI_PROTOCOL_BITMASK detection_bitmask;
|
NDPI_PROTOCOL_BITMASK detection_bitmask;
|
||||||
NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask;
|
NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask;
|
||||||
@@ -859,12 +893,15 @@ struct ndpi_detection_module_struct {
|
|||||||
|
|
||||||
ndpi_default_ports_tree_node_t *tcpRoot, *udpRoot;
|
ndpi_default_ports_tree_node_t *tcpRoot, *udpRoot;
|
||||||
|
|
||||||
|
ndpi_log_level_t ndpi_log_level; /* default error */
|
||||||
|
|
||||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||||
/* debug callback, only set when debug is used */
|
/* debug callback, only set when debug is used */
|
||||||
ndpi_debug_function_ptr ndpi_debug_printf;
|
ndpi_debug_function_ptr ndpi_debug_printf;
|
||||||
const char *ndpi_debug_print_file;
|
const char *ndpi_debug_print_file;
|
||||||
const char *ndpi_debug_print_function;
|
const char *ndpi_debug_print_function;
|
||||||
u_int32_t ndpi_debug_print_line;
|
u_int32_t ndpi_debug_print_line;
|
||||||
|
NDPI_PROTOCOL_BITMASK debug_bitmask;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* misc parameters */
|
/* misc parameters */
|
||||||
@@ -884,6 +921,19 @@ struct ndpi_detection_module_struct {
|
|||||||
subprotocol_automa, /* Used for HTTP subprotocol_detection */
|
subprotocol_automa, /* Used for HTTP subprotocol_detection */
|
||||||
bigrams_automa, impossible_bigrams_automa; /* TOR */
|
bigrams_automa, impossible_bigrams_automa; /* TOR */
|
||||||
|
|
||||||
|
struct {
|
||||||
|
#ifdef HAVE_HYPERSCAN
|
||||||
|
struct hs *hostnames;
|
||||||
|
unsigned int num_to_load;
|
||||||
|
struct hs_list *to_load;
|
||||||
|
#else
|
||||||
|
ndpi_automa hostnames, hostnames_shadow;
|
||||||
|
#endif
|
||||||
|
void *hostnames_hash;
|
||||||
|
void *ipAddresses, *ipAddresses_shadow; /* Patricia */
|
||||||
|
u_int8_t categories_loaded;
|
||||||
|
} custom_categories;
|
||||||
|
|
||||||
/* IP-based protocol detection */
|
/* IP-based protocol detection */
|
||||||
void *protocols_ptree;
|
void *protocols_ptree;
|
||||||
|
|
||||||
@@ -914,26 +964,32 @@ struct ndpi_detection_module_struct {
|
|||||||
char ip_string[NDPI_IP_STRING_SIZE];
|
char ip_string[NDPI_IP_STRING_SIZE];
|
||||||
#endif
|
#endif
|
||||||
u_int8_t ip_version_limit;
|
u_int8_t ip_version_limit;
|
||||||
#ifdef NDPI_PROTOCOL_BITTORRENT
|
/* NDPI_PROTOCOL_BITTORRENT */
|
||||||
struct hash_ip4p_table *bt_ht;
|
struct hash_ip4p_table *bt_ht;
|
||||||
#ifdef NDPI_DETECTION_SUPPORT_IPV6
|
#ifdef NDPI_DETECTION_SUPPORT_IPV6
|
||||||
struct hash_ip4p_table *bt6_ht;
|
struct hash_ip4p_table *bt6_ht;
|
||||||
#endif
|
#endif
|
||||||
#ifdef BT_ANNOUNCE
|
|
||||||
|
/* BT_ANNOUNCE */
|
||||||
struct bt_announce *bt_ann;
|
struct bt_announce *bt_ann;
|
||||||
int bt_ann_len;
|
int bt_ann_len;
|
||||||
#endif
|
|
||||||
#endif
|
/* NDPI_PROTOCOL_TINC */
|
||||||
#ifdef NDPI_PROTOCOL_TINC
|
struct cache *tinc_cache;
|
||||||
cache_t tinc_cache;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ndpi_proto_defaults_t proto_defaults[NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS];
|
ndpi_proto_defaults_t proto_defaults[NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS];
|
||||||
|
|
||||||
u_int8_t http_dont_dissect_response:1, dns_dissect_response:1,
|
u_int8_t http_dont_dissect_response:1, dns_dissect_response:1,
|
||||||
direction_detect_disable:1; /* disable internal detection of packet direction */
|
direction_detect_disable:1, /* disable internal detection of packet direction */
|
||||||
|
disable_metadata_export:1, /* No metadata is exported */
|
||||||
|
enable_category_substring_match:1 /* Default is perfect match */
|
||||||
|
;
|
||||||
|
|
||||||
|
void *hyperscan; /* Intel Hyperscan */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif /* NDPI_LIB_COMPILATION */
|
||||||
|
|
||||||
struct ndpi_flow_struct {
|
struct ndpi_flow_struct {
|
||||||
u_int16_t detected_protocol_stack[NDPI_PROTOCOL_SIZE];
|
u_int16_t detected_protocol_stack[NDPI_PROTOCOL_SIZE];
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@@ -942,7 +998,7 @@ struct ndpi_flow_struct {
|
|||||||
u_int16_t protocol_stack_info;
|
u_int16_t protocol_stack_info;
|
||||||
|
|
||||||
/* init parameter, internal used to set up timestamp,... */
|
/* init parameter, internal used to set up timestamp,... */
|
||||||
u_int16_t guessed_protocol_id, guessed_host_protocol_id;
|
u_int16_t guessed_protocol_id, guessed_host_protocol_id, guessed_category;
|
||||||
|
|
||||||
u_int8_t protocol_id_already_guessed:1, host_already_guessed:1, init_finished:1, setup_packet_direction:1, packet_direction:1, check_extra_packets:1;
|
u_int8_t protocol_id_already_guessed:1, host_already_guessed:1, init_finished:1, setup_packet_direction:1, packet_direction:1, check_extra_packets:1;
|
||||||
|
|
||||||
@@ -966,8 +1022,7 @@ struct ndpi_flow_struct {
|
|||||||
} l4;
|
} l4;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Pointer to src or dst
|
Pointer to src or dst that identifies the
|
||||||
that identifies the
|
|
||||||
server of this connection
|
server of this connection
|
||||||
*/
|
*/
|
||||||
struct ndpi_id_struct *server_id;
|
struct ndpi_id_struct *server_id;
|
||||||
@@ -1001,10 +1056,18 @@ struct ndpi_flow_struct {
|
|||||||
u_int8_t version;
|
u_int8_t version;
|
||||||
} ntp;
|
} ntp;
|
||||||
|
|
||||||
|
struct {
|
||||||
struct {
|
struct {
|
||||||
char client_certificate[48], server_certificate[48];
|
char client_certificate[48], server_certificate[48];
|
||||||
} ssl;
|
} ssl;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u_int8_t num_udp_pkts, num_processed_pkts, num_binding_requests, is_skype;
|
||||||
|
} stun;
|
||||||
|
|
||||||
|
/* We can have STUN over SSL thus they need to live together */
|
||||||
|
} stun_ssl;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char client_signature[48], server_signature[48];
|
char client_signature[48], server_signature[48];
|
||||||
} ssh;
|
} ssh;
|
||||||
@@ -1040,97 +1103,93 @@ struct ndpi_flow_struct {
|
|||||||
/* protocols which have marked a connection as this connection cannot be protocol XXX, multiple u_int64_t */
|
/* protocols which have marked a connection as this connection cannot be protocol XXX, multiple u_int64_t */
|
||||||
NDPI_PROTOCOL_BITMASK excluded_protocol_bitmask;
|
NDPI_PROTOCOL_BITMASK excluded_protocol_bitmask;
|
||||||
|
|
||||||
u_int8_t num_stun_udp_pkts;
|
ndpi_protocol_category_t category;
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_REDIS
|
/* NDPI_PROTOCOL_REDIS */
|
||||||
u_int8_t redis_s2d_first_char, redis_d2s_first_char;
|
u_int8_t redis_s2d_first_char, redis_d2s_first_char;
|
||||||
#endif
|
|
||||||
u_int16_t packet_counter; // can be 0 - 65000
|
u_int16_t packet_counter; // can be 0 - 65000
|
||||||
u_int16_t packet_direction_counter[2];
|
u_int16_t packet_direction_counter[2];
|
||||||
u_int16_t byte_counter[2];
|
u_int16_t byte_counter[2];
|
||||||
#ifdef NDPI_PROTOCOL_BITTORRENT
|
/* NDPI_PROTOCOL_BITTORRENT */
|
||||||
u_int8_t bittorrent_stage; // can be 0 - 255
|
u_int8_t bittorrent_stage; // can be 0 - 255
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_DIRECTCONNECT
|
/* NDPI_PROTOCOL_DIRECTCONNECT */
|
||||||
u_int32_t directconnect_stage:2; // 0 - 1
|
u_int32_t directconnect_stage:2; // 0 - 1
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SIP
|
/* NDPI_PROTOCOL_YAHOO */
|
||||||
#ifdef NDPI_PROTOCOL_YAHOO
|
|
||||||
u_int32_t sip_yahoo_voice:1;
|
u_int32_t sip_yahoo_voice:1;
|
||||||
#endif
|
|
||||||
#endif
|
/* NDPI_PROTOCOL_HTTP */
|
||||||
#ifdef NDPI_PROTOCOL_HTTP
|
|
||||||
u_int32_t http_detected:1;
|
u_int32_t http_detected:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_RTSP
|
/* NDPI_PROTOCOL_RTSP */
|
||||||
u_int32_t rtsprdt_stage:2;
|
u_int32_t rtsprdt_stage:2;
|
||||||
u_int32_t rtsp_control_flow:1;
|
u_int32_t rtsp_control_flow:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_YAHOO
|
/* NDPI_PROTOCOL_YAHOO */
|
||||||
u_int32_t yahoo_detection_finished:2;
|
u_int32_t yahoo_detection_finished:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_ZATTOO
|
/* NDPI_PROTOCOL_ZATTOO */
|
||||||
u_int32_t zattoo_stage:3;
|
u_int32_t zattoo_stage:3;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_QQ
|
/* NDPI_PROTOCOL_QQ */
|
||||||
u_int32_t qq_stage:3;
|
u_int32_t qq_stage:3;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_THUNDER
|
/* NDPI_PROTOCOL_THUNDER */
|
||||||
u_int32_t thunder_stage:2; // 0 - 3
|
u_int32_t thunder_stage:2; // 0 - 3
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_OSCAR
|
/* NDPI_PROTOCOL_OSCAR */
|
||||||
u_int32_t oscar_ssl_voice_stage:3;
|
u_int32_t oscar_ssl_voice_stage:3;
|
||||||
u_int32_t oscar_video_voice:1;
|
u_int32_t oscar_video_voice:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_FLORENSIA
|
/* NDPI_PROTOCOL_FLORENSIA */
|
||||||
u_int32_t florensia_stage:1;
|
u_int32_t florensia_stage:1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_SOCKS
|
/* NDPI_PROTOCOL_SOCKS */
|
||||||
u_int32_t socks5_stage:2; // 0 - 3
|
u_int32_t socks5_stage:2; // 0 - 3
|
||||||
u_int32_t socks4_stage:2; // 0 - 3
|
u_int32_t socks4_stage:2; // 0 - 3
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_EDONKEY
|
/* NDPI_PROTOCOL_EDONKEY */
|
||||||
u_int32_t edonkey_stage:2; // 0 - 3
|
u_int32_t edonkey_stage:2; // 0 - 3
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_FTP_CONTROL
|
/* NDPI_PROTOCOL_FTP_CONTROL */
|
||||||
u_int32_t ftp_control_stage:2;
|
u_int32_t ftp_control_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_RTMP
|
/* NDPI_PROTOCOL_RTMP */
|
||||||
u_int32_t rtmp_stage:2;
|
u_int32_t rtmp_stage:2;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_PANDO
|
/* NDPI_PROTOCOL_PANDO */
|
||||||
u_int32_t pando_stage:3;
|
u_int32_t pando_stage:3;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_STEAM
|
/* NDPI_PROTOCOL_STEAM */
|
||||||
u_int32_t steam_stage:3;
|
u_int32_t steam_stage:3;
|
||||||
u_int32_t steam_stage1:3; // 0 - 4
|
u_int32_t steam_stage1:3; // 0 - 4
|
||||||
u_int32_t steam_stage2:2; // 0 - 2
|
u_int32_t steam_stage2:2; // 0 - 2
|
||||||
u_int32_t steam_stage3:2; // 0 - 2
|
u_int32_t steam_stage3:2; // 0 - 2
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_PPLIVE
|
/* NDPI_PROTOCOL_PPLIVE */
|
||||||
u_int32_t pplive_stage1:3; // 0 - 6
|
u_int32_t pplive_stage1:3; // 0 - 6
|
||||||
u_int32_t pplive_stage2:2; // 0 - 2
|
u_int32_t pplive_stage2:2; // 0 - 2
|
||||||
u_int32_t pplive_stage3:2; // 0 - 2
|
u_int32_t pplive_stage3:2; // 0 - 2
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_STARCRAFT
|
/* NDPI_PROTOCOL_STARCRAFT */
|
||||||
u_int32_t starcraft_udp_stage : 3; // 0-7
|
u_int32_t starcraft_udp_stage : 3; // 0-7
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_OPENVPN
|
/* NDPI_PROTOCOL_OPENVPN */
|
||||||
u_int8_t ovpn_session_id[8];
|
u_int8_t ovpn_session_id[8];
|
||||||
u_int8_t ovpn_counter;
|
u_int8_t ovpn_counter;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_TINC
|
/* NDPI_PROTOCOL_TINC */
|
||||||
u_int8_t tinc_state;
|
u_int8_t tinc_state;
|
||||||
struct tinc_cache_entry tinc_cache_entry;
|
struct tinc_cache_entry tinc_cache_entry;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_CSGO
|
/* NDPI_PROTOCOL_CSGO */
|
||||||
u_int8_t csgo_strid[18],csgo_state,csgo_s2;
|
u_int8_t csgo_strid[18],csgo_state,csgo_s2;
|
||||||
u_int32_t csgo_id2;
|
u_int32_t csgo_id2;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
/* NDPI_PROTOCOL_1KXUN || NDPI_PROTOCOL_IQIYI */
|
||||||
u_int16_t kxun_counter, iqiyi_counter;
|
u_int16_t kxun_counter, iqiyi_counter;
|
||||||
#endif
|
|
||||||
|
|
||||||
/* internal structures to save functions calls */
|
/* internal structures to save functions calls */
|
||||||
struct ndpi_packet_struct packet;
|
struct ndpi_packet_struct packet;
|
||||||
@@ -1140,9 +1199,9 @@ struct ndpi_flow_struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *string_to_match, *proto_name;
|
char *string_to_match, *string2_to_match, *pattern_to_match, *proto_name;
|
||||||
int protocol_id;
|
int protocol_id;
|
||||||
ndpi_protocol_category_t proto_category;
|
ndpi_protocol_category_t protocol_category;
|
||||||
ndpi_protocol_breed_t protocol_breed;
|
ndpi_protocol_breed_t protocol_breed;
|
||||||
} ndpi_protocol_match;
|
} ndpi_protocol_match;
|
||||||
|
|
||||||
@@ -1152,4 +1211,10 @@ typedef struct {
|
|||||||
u_int8_t value;
|
u_int8_t value;
|
||||||
} ndpi_network;
|
} ndpi_network;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int protocol_id;
|
||||||
|
ndpi_protocol_category_t protocol_category;
|
||||||
|
ndpi_protocol_breed_t protocol_breed;
|
||||||
|
} ndpi_protocol_match_result;
|
||||||
|
|
||||||
#endif /* __NDPI_TYPEDEFS_H__ */
|
#endif /* __NDPI_TYPEDEFS_H__ */
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# Simple non-autotools dependent makefile
|
||||||
|
#
|
||||||
|
# ./autogen.sh
|
||||||
|
# cd src/lib
|
||||||
|
# make -f Makefile.simple
|
||||||
|
#
|
||||||
|
CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -g
|
||||||
|
RANLIB = ranlib
|
||||||
|
|
||||||
|
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o
|
||||||
|
HEADERS = $(wildcard ../include/*.h)
|
||||||
|
|
||||||
|
all: libndpi.a
|
||||||
|
|
||||||
|
ndpi_main.c: ndpi_content_match.c.inc
|
||||||
|
|
||||||
|
libndpi.a: $(OBJECTS)
|
||||||
|
ar rc $@ $(OBJECTS)
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
%.o: %.c $(HEADERS) Makefile
|
||||||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
/bin/rm -f libndpi.a $(OBJECTS)
|
||||||
@@ -1,178 +0,0 @@
|
|||||||
lib_LTLIBRARIES = libndpi.la
|
|
||||||
|
|
||||||
CFLAGS += -fPIC -DPIC # --coverage
|
|
||||||
libndpi_la_CPPFLAGS = -I$(top_srcdir)/src/include/ -I$(top_srcdir)/src/lib/third_party/include/
|
|
||||||
libndpi_la_LDFLAGS = -version-info 1:0:0 -export-symbols $(top_srcdir)/libndpi.sym
|
|
||||||
|
|
||||||
libndpi_la_includedir = $(includedir)/libndpi-@VERSION@/libndpi
|
|
||||||
|
|
||||||
libndpi_la_include_HEADERS = ../include/ndpi_api.h \
|
|
||||||
../include/ndpi_define.h \
|
|
||||||
../include/ndpi_main.h \
|
|
||||||
../include/ndpi_includes.h \
|
|
||||||
../include/ndpi_protocol_ids.h \
|
|
||||||
../include/ndpi_protocols.h \
|
|
||||||
../include/ndpi_typedefs.h
|
|
||||||
|
|
||||||
libndpi_la_SOURCES = ndpi_content_match.c.inc \
|
|
||||||
ndpi_main.c \
|
|
||||||
protocols/afp.c \
|
|
||||||
protocols/aimini.c \
|
|
||||||
protocols/applejuice.c \
|
|
||||||
protocols/armagetron.c \
|
|
||||||
protocols/ayiya.c \
|
|
||||||
protocols/amqp.c \
|
|
||||||
protocols/battlefield.c \
|
|
||||||
protocols/bgp.c \
|
|
||||||
protocols/bittorrent.c \
|
|
||||||
protocols/bjnp.c \
|
|
||||||
protocols/checkmk.c \
|
|
||||||
protocols/ciscovpn.c \
|
|
||||||
protocols/citrix.c \
|
|
||||||
protocols/coap.c \
|
|
||||||
protocols/collectd.c \
|
|
||||||
protocols/corba.c \
|
|
||||||
protocols/crossfire.c \
|
|
||||||
protocols/csgo.c \
|
|
||||||
protocols/dcerpc.c \
|
|
||||||
protocols/dhcp.c \
|
|
||||||
protocols/dhcpv6.c \
|
|
||||||
protocols/directconnect.c \
|
|
||||||
protocols/directdownloadlink.c \
|
|
||||||
protocols/dns.c \
|
|
||||||
protocols/dofus.c \
|
|
||||||
protocols/drda.c \
|
|
||||||
protocols/dropbox.c \
|
|
||||||
protocols/eaq.c \
|
|
||||||
protocols/edonkey.c \
|
|
||||||
protocols/fasttrack.c \
|
|
||||||
protocols/fiesta.c \
|
|
||||||
protocols/fix.c \
|
|
||||||
protocols/filetopia.c \
|
|
||||||
protocols/florensia.c \
|
|
||||||
protocols/ftp_control.c \
|
|
||||||
protocols/ftp_data.c \
|
|
||||||
protocols/git.c \
|
|
||||||
protocols/gnutella.c \
|
|
||||||
protocols/gtp.c \
|
|
||||||
protocols/guildwars.c \
|
|
||||||
protocols/hangout.c \
|
|
||||||
protocols/h323.c \
|
|
||||||
protocols/halflife2_and_mods.c \
|
|
||||||
protocols/hep.c \
|
|
||||||
protocols/http_activesync.c \
|
|
||||||
protocols/http.c \
|
|
||||||
protocols/iax.c \
|
|
||||||
protocols/icecast.c \
|
|
||||||
protocols/ipp.c \
|
|
||||||
protocols/irc.c \
|
|
||||||
protocols/jabber.c \
|
|
||||||
protocols/kakaotalk_voice.c \
|
|
||||||
protocols/kerberos.c \
|
|
||||||
protocols/kontiki.c \
|
|
||||||
protocols/ldap.c \
|
|
||||||
protocols/lotus_notes.c \
|
|
||||||
protocols/lisp.c \
|
|
||||||
protocols/mail_imap.c \
|
|
||||||
protocols/mail_pop.c \
|
|
||||||
protocols/mail_smtp.c \
|
|
||||||
protocols/maplestory.c \
|
|
||||||
protocols/mdns.c \
|
|
||||||
protocols/megaco.c \
|
|
||||||
protocols/mgcp.c \
|
|
||||||
protocols/mms.c \
|
|
||||||
protocols/mpegts.c \
|
|
||||||
protocols/mqtt.c \
|
|
||||||
protocols/msn.c \
|
|
||||||
protocols/mssql_tds.c \
|
|
||||||
protocols/mysql.c \
|
|
||||||
protocols/netbios.c \
|
|
||||||
protocols/netflow.c \
|
|
||||||
protocols/nintendo.c \
|
|
||||||
protocols/nfs.c \
|
|
||||||
protocols/noe.c \
|
|
||||||
protocols/non_tcp_udp.c \
|
|
||||||
protocols/ntp.c \
|
|
||||||
protocols/openft.c \
|
|
||||||
protocols/openvpn.c \
|
|
||||||
protocols/oracle.c \
|
|
||||||
protocols/oscar.c \
|
|
||||||
protocols/pando.c \
|
|
||||||
protocols/pcanywhere.c \
|
|
||||||
protocols/postgres.c \
|
|
||||||
protocols/pplive.c \
|
|
||||||
protocols/ppstream.c \
|
|
||||||
protocols/pptp.c \
|
|
||||||
protocols/qq.c \
|
|
||||||
protocols/quake.c \
|
|
||||||
protocols/quic.c \
|
|
||||||
protocols/radius.c \
|
|
||||||
protocols/rdp.c \
|
|
||||||
protocols/redis_net.c \
|
|
||||||
protocols/rsync.c \
|
|
||||||
protocols/rtcp.c \
|
|
||||||
protocols/rtmp.c \
|
|
||||||
protocols/rtp.c \
|
|
||||||
protocols/rtsp.c \
|
|
||||||
protocols/rx.c \
|
|
||||||
protocols/sflow.c \
|
|
||||||
protocols/shoutcast.c \
|
|
||||||
protocols/sip.c \
|
|
||||||
protocols/skinny.c \
|
|
||||||
protocols/skype.c \
|
|
||||||
protocols/smb.c \
|
|
||||||
protocols/snmp.c \
|
|
||||||
protocols/socks45.c \
|
|
||||||
protocols/socrates.c \
|
|
||||||
protocols/sopcast.c \
|
|
||||||
protocols/soulseek.c \
|
|
||||||
protocols/spotify.c \
|
|
||||||
protocols/ssdp.c \
|
|
||||||
protocols/ssh.c \
|
|
||||||
protocols/ssl.c \
|
|
||||||
protocols/starcraft.c \
|
|
||||||
protocols/stealthnet.c \
|
|
||||||
protocols/steam.c \
|
|
||||||
protocols/stun.c \
|
|
||||||
protocols/syslog.c \
|
|
||||||
protocols/tcp_udp.c \
|
|
||||||
protocols/teamspeak.c \
|
|
||||||
protocols/teamviewer.c \
|
|
||||||
protocols/telegram.c \
|
|
||||||
protocols/telnet.c \
|
|
||||||
protocols/tftp.c \
|
|
||||||
protocols/thunder.c \
|
|
||||||
protocols/tor.c \
|
|
||||||
protocols/teredo.c \
|
|
||||||
protocols/tvants.c \
|
|
||||||
protocols/tvuplayer.c \
|
|
||||||
protocols/ubntac2.c \
|
|
||||||
protocols/usenet.c \
|
|
||||||
protocols/viber.c \
|
|
||||||
protocols/vhua.c \
|
|
||||||
protocols/vmware.c \
|
|
||||||
protocols/vnc.c \
|
|
||||||
protocols/warcraft3.c \
|
|
||||||
protocols/whoisdas.c \
|
|
||||||
protocols/world_of_kung_fu.c \
|
|
||||||
protocols/world_of_warcraft.c \
|
|
||||||
protocols/xbox.c \
|
|
||||||
protocols/xdmcp.c \
|
|
||||||
protocols/yahoo.c \
|
|
||||||
protocols/zattoo.c \
|
|
||||||
protocols/zeromq.c \
|
|
||||||
protocols/smpp.c \
|
|
||||||
protocols/tinc.c \
|
|
||||||
protocols/someip.c \
|
|
||||||
third_party/include/actypes.h \
|
|
||||||
third_party/include/ahocorasick.h \
|
|
||||||
third_party/include/ndpi_patricia.h \
|
|
||||||
third_party/include/node.h \
|
|
||||||
third_party/include/sort.h \
|
|
||||||
third_party/include/libcache.h \
|
|
||||||
third_party/src/ahocorasick.c \
|
|
||||||
third_party/src/node.c \
|
|
||||||
third_party/src/sort.c \
|
|
||||||
third_party/src/libcache.c
|
|
||||||
|
|
||||||
EXTRA_DIST = third_party/src/ndpi_patricia.c
|
|
||||||
+469
-370
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_content_match.c
|
* ndpi_content_match.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2017 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -71,7 +71,6 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xB92D0600 /* 185.45.6.0/23 */, 23, NDPI_PROTOCOL_TWITTER },
|
{ 0xB92D0600 /* 185.45.6.0/23 */, 23, NDPI_PROTOCOL_TWITTER },
|
||||||
{ 0xBC40E000 /* 188.64.224.0/21 */, 21, NDPI_PROTOCOL_TWITTER },
|
{ 0xBC40E000 /* 188.64.224.0/21 */, 21, NDPI_PROTOCOL_TWITTER },
|
||||||
{ 0xC02C4400 /* 192.44.68.0/23 */, 23, NDPI_PROTOCOL_TWITTER },
|
{ 0xC02C4400 /* 192.44.68.0/23 */, 23, NDPI_PROTOCOL_TWITTER },
|
||||||
{ 0xC030EC00 /* 192.48.236.0/23 */, 23, NDPI_PROTOCOL_TWITTER },
|
|
||||||
{ 0xC0854C00 /* 192.133.76.0/22 */, 22, NDPI_PROTOCOL_TWITTER },
|
{ 0xC0854C00 /* 192.133.76.0/22 */, 22, NDPI_PROTOCOL_TWITTER },
|
||||||
{ 0xC7109C00 /* 199.16.156.0/22 */, 22, NDPI_PROTOCOL_TWITTER },
|
{ 0xC7109C00 /* 199.16.156.0/22 */, 22, NDPI_PROTOCOL_TWITTER },
|
||||||
{ 0xC73B9400 /* 199.59.148.0/22 */, 22, NDPI_PROTOCOL_TWITTER },
|
{ 0xC73B9400 /* 199.59.148.0/22 */, 22, NDPI_PROTOCOL_TWITTER },
|
||||||
@@ -82,14 +81,21 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
/*
|
/*
|
||||||
WhatsApp Inc.
|
WhatsApp Inc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ 0x3216C6CC /* 50.22.198.204/30 */, 30, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x3216C6CC /* 50.22.198.204/30 */, 30, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E2720 /* 75.126.39.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x4B7E2720 /* 75.126.39.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x6CA8B460 /* 108.168.180.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8B460 /* 108.168.180.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9E553A00 /* 158.85.58.0/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E553A00 /* 158.85.58.0/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9E55FE40 /* 158.85.254.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E55FE40 /* 158.85.254.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92C5360 /* 169.44.82.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DD6E0 /* 169.45.214.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DDBE0 /* 169.45.219.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DF860 /* 169.45.248.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F05C0 /* 169.47.5.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xA92F2320 /* 169.47.35.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xA92F2320 /* 169.47.35.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xA93743E0 /* 169.55.67.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xA9373CAA /* 169.55.60.170/32 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93C4F00 /* 169.60.79.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93F4C11 /* 169.63.76.0/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93F4940 /* 169.63.73.64/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xA93764A0 /* 169.55.100.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xA93764A0 /* 169.55.100.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xA937EBA0 /* 169.55.235.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xA937EBA0 /* 169.55.235.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xADC0A220 /* 173.192.162.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xADC0A220 /* 173.192.162.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
@@ -98,7 +104,8 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xC60BFB20 /* 198.11.251.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xC60BFB20 /* 198.11.251.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xD02B73C0 /* 208.43.115.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xD02B73C0 /* 208.43.115.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xD02B7A80 /* 208.43.122.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xD02B7A80 /* 208.43.122.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
/* Files */
|
||||||
|
{ 0xB93CD835 /* 185.60.216.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
WeChat
|
WeChat
|
||||||
@@ -216,59 +223,9 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x344D0000 /* 52.77.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
{ 0x344D0000 /* 52.77.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x344E0000 /* 52.78.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
{ 0x344E0000 /* 52.78.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x344F0000 /* 52.79.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
{ 0x344F0000 /* 52.79.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x3452BB00 /* 52.82.187.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
{ 0x34520000 /* 52.82.0.0/14 */, 14, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x34530000 /* 52.83.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
{ 0x34580000 /* 52.88.0.0/13 */, 13, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x34540000 /* 52.84.0.0/15 */, 15, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x34560000 /* 52.86.0.0/15 */, 15, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x34580000 /* 52.88.0.0/15 */, 15, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345A0000 /* 52.90.0.0/15 */, 15, NDPI_PROTOCOL_AMAZON },
|
{ 0x345A0000 /* 52.90.0.0/15 */, 15, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x345C0000 /* 52.92.0.0/20 */, 20, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C1000 /* 52.92.16.0/20 */, 20, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C2000 /* 52.92.32.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C2800 /* 52.92.40.0/21 */, 21, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C3000 /* 52.92.48.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C3400 /* 52.92.52.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C3800 /* 52.92.56.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C3C00 /* 52.92.60.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C4000 /* 52.92.64.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C4400 /* 52.92.68.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C4800 /* 52.92.72.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C4C00 /* 52.92.76.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C5400 /* 52.92.84.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345C5800 /* 52.92.88.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345CF800 /* 52.92.248.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345CFC00 /* 52.92.252.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345D0000 /* 52.93.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0000 /* 52.94.0.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0400 /* 52.94.4.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0500 /* 52.94.5.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0600 /* 52.94.6.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0700 /* 52.94.7.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0800 /* 52.94.8.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0900 /* 52.94.9.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0A00 /* 52.94.10.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0B00 /* 52.94.11.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0C00 /* 52.94.12.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0D00 /* 52.94.13.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0E00 /* 52.94.14.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E0F00 /* 52.94.15.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E1100 /* 52.94.17.0/24 */, 24, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E1800 /* 52.94.24.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E1C00 /* 52.94.28.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E2000 /* 52.94.32.0/20 */, 20, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E3000 /* 52.94.48.0/20 */, 20, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E4000 /* 52.94.64.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E5000 /* 52.94.80.0/20 */, 20, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E6000 /* 52.94.96.0/20 */, 20, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345E7000 /* 52.94.112.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345ECC00 /* 52.94.204.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345ECE00 /* 52.94.206.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345ED000 /* 52.94.208.0/21 */, 21, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345ED800 /* 52.94.216.0/21 */, 21, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345EE000 /* 52.94.224.0/20 */, 20, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345EF000 /* 52.94.240.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345EFC00 /* 52.94.252.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345EFE00 /* 52.94.254.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
|
||||||
{ 0x345F0000 /* 52.95.0.0/21 */, 21, NDPI_PROTOCOL_AMAZON },
|
{ 0x345F0000 /* 52.95.0.0/21 */, 21, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x345F0A00 /* 52.95.10.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
{ 0x345F0A00 /* 52.95.10.0/23 */, 23, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x345F0C00 /* 52.95.12.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
{ 0x345F0C00 /* 52.95.12.0/22 */, 22, NDPI_PROTOCOL_AMAZON },
|
||||||
@@ -584,18 +541,31 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xC0AD4000 /* 192.173.64.0/18 */, 18, NDPI_PROTOCOL_NETFLIX },
|
{ 0xC0AD4000 /* 192.173.64.0/18 */, 18, NDPI_PROTOCOL_NETFLIX },
|
||||||
{ 0xC6266000 /* 198.38.96.0/19 */, 19, NDPI_PROTOCOL_NETFLIX },
|
{ 0xC6266000 /* 198.38.96.0/19 */, 19, NDPI_PROTOCOL_NETFLIX },
|
||||||
{ 0xC62D3000 /* 198.45.48.0/20 */, 20, NDPI_PROTOCOL_NETFLIX },
|
{ 0xC62D3000 /* 198.45.48.0/20 */, 20, NDPI_PROTOCOL_NETFLIX },
|
||||||
{ 0xD04B4C00 /* 208.75.76.0/22 */, 22, NDPI_PROTOCOL_NETFLIX },
|
{ 0xD194D687 /* 209.148.214.135/21 */, 21, NDPI_PROTOCOL_NETFLIX },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Cloudflare, Inc.
|
Cloudflare, Inc.
|
||||||
origin AS13335, AS132892, AS203898, AS394536
|
origin AS13335, AS132892, AS203898, AS394536
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ 0x4044C000 /* 64.68.192.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0x321ff200 /* 50.31.242.0/23 */, 23, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x6715f400 /* 103.21.244.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x6716c800 /* 103.22.200.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x671f0400 /* 103.31.4.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0x68100000 /* 104.16.0.0/12 */, 12, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0x68100000 /* 104.16.0.0/12 */, 12, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0x6CA2C000 /* 108.162.192.0/18 */, 18, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0x6CA2C000 /* 108.162.192.0/18 */, 18, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x83004800 /* 131.0.72.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0x8D654400 /* 141.101.68.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0x8D654400 /* 141.101.68.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0x8D654500 /* 141.101.69.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0x8D654500 /* 141.101.69.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d656000 /* 141.101.96.0/21 */, 21, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d654000 /* 141.101.64.0/20 */, 20, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d655000 /* 141.101.80.0/21 */, 21, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d655800 /* 141.101.88.0/19 */, 19, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d656800 /* 141.101.104.0/21 */, 21, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d657000 /* 141.101.112.0/21 */, 21, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d657800 /* 141.101.120.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0x8d657c00 /* 141.101.124.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0xbe5df000 /* 190.93.240.0/20 */, 20, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0xA29E0000 /* 162.158.0.0/15 */, 15, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0xA29E0000 /* 162.158.0.0/15 */, 15, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0xA2FB5200 /* 162.251.82.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0xA2FB5200 /* 162.251.82.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0xAC400000 /* 172.64.0.0/13 */, 13, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0xAC400000 /* 172.64.0.0/13 */, 13, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
@@ -609,6 +579,7 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xBC726B00 /* 188.114.107.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0xBC726B00 /* 188.114.107.0/24 */, 24, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0xBC726C00 /* 188.114.108.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0xBC726C00 /* 188.114.108.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0xC6298000 /* 198.41.128.0/17 */, 17, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0xC6298000 /* 198.41.128.0/17 */, 17, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
{ 0xc5eaf000 /* 197.234.240.0/22 */, 22, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
{ 0xC71B8000 /* 199.27.128.0/21 */, 21, NDPI_PROTOCOL_CLOUDFLARE },
|
{ 0xC71B8000 /* 199.27.128.0/21 */, 21, NDPI_PROTOCOL_CLOUDFLARE },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -637,10 +608,10 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
/* Teamviewer 159.122.189.32-63 */
|
/* Teamviewer 159.122.189.32-63 */
|
||||||
{ 0x9F7ABD30 /* 159.122.189.32 */, 21, NDPI_PROTOCOL_TEAMVIEWER },
|
{ 0x9F7ABD30 /* 159.122.189.32 */, 21, NDPI_PROTOCOL_TEAMVIEWER },
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
IFLIX services -by www.vizuamatix.com R&D team
|
IFLIX services -by www.vizuamatix.com R&D team
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ 0x344D0000 /* 52.77.0.0 */, 16, NDPI_PROTOCOL_IFLIX },
|
{ 0x344D0000 /* 52.77.0.0 */, 16, NDPI_PROTOCOL_IFLIX },
|
||||||
{ 0x34DC0000 /* 52.220.0.0 */, 16, NDPI_PROTOCOL_IFLIX },
|
{ 0x34DC0000 /* 52.220.0.0 */, 16, NDPI_PROTOCOL_IFLIX },
|
||||||
{ 0x344A0000 /* 52.74.0.0 */, 16, NDPI_PROTOCOL_IFLIX },
|
{ 0x344A0000 /* 52.74.0.0 */, 16, NDPI_PROTOCOL_IFLIX },
|
||||||
@@ -650,13 +621,14 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x36C09600 /* 54.192.150.0 */, 24, NDPI_PROTOCOL_IFLIX },
|
{ 0x36C09600 /* 54.192.150.0 */, 24, NDPI_PROTOCOL_IFLIX },
|
||||||
{ 0x344AC0F7 /* 52.74.192.247 */, 32, NDPI_PROTOCOL_IFLIX },
|
{ 0x344AC0F7 /* 52.74.192.247 */, 32, NDPI_PROTOCOL_IFLIX },
|
||||||
{ 0x0215E718 /* 2.21.231.24 */, 32, NDPI_PROTOCOL_IFLIX },
|
{ 0x0215E718 /* 2.21.231.24 */, 32, NDPI_PROTOCOL_IFLIX },
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Citrix GotoMeeting (AS16815, AS21866)
|
Citrix GotoMeeting (AS16815, AS21866)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ 0xD873D000 /* 216.115.208.0 */, 20, NDPI_PROTOCOL_CITRIX_ONLINE },
|
{ 0xD873D000 /* 216.115.208.0 */, 20, NDPI_PROTOCOL_CITRIX },
|
||||||
{ 0xD8DB7000 /* 216.219.112.0 */, 20, NDPI_PROTOCOL_CITRIX_ONLINE },
|
{ 0xD8DB7000 /* 216.219.112.0 */, 20, NDPI_PROTOCOL_CITRIX },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Cisco Webex LLC
|
Cisco Webex LLC
|
||||||
@@ -680,12 +652,16 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
https://whois.arin.net/rest/nets;q=AWS-VIBER-MEDIA?showDetails=true&showARIN=false&showNonArinTopLevelNet=false&ext=netref2
|
https://whois.arin.net/rest/nets;q=AWS-VIBER-MEDIA?showDetails=true&showARIN=false&showNonArinTopLevelNet=false&ext=netref2
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
{ 0x0DE61550 /* 13.230.21.80/28 */, 28, NDPI_PROTOCOL_VIBER },
|
||||||
|
{ 0x0D39B480 /* 13.57.180.128/28 */, 28, NDPI_PROTOCOL_VIBER },
|
||||||
|
{ 0x012C30400 /* 18.195.4.0/23 */, 23, NDPI_PROTOCOL_VIBER },
|
||||||
|
{ 0x012C45500 /* 18.196.85.0/25 */, 25, NDPI_PROTOCOL_VIBER },
|
||||||
|
{ 0x022E8A340 /* 34.232.163.64/28 */, 28, NDPI_PROTOCOL_VIBER },
|
||||||
|
{ 0x022F67200 /* 34.246.114.0/23 */, 23, NDPI_PROTOCOL_VIBER },
|
||||||
{ 0x3400FC00 /* 52.0.252.0/22 */, 22, NDPI_PROTOCOL_VIBER },
|
{ 0x3400FC00 /* 52.0.252.0/22 */, 22, NDPI_PROTOCOL_VIBER },
|
||||||
{ 0x3640BFF0 /* 54.64.191.240/28 */, 28, NDPI_PROTOCOL_VIBER },
|
{ 0x3640BFF0 /* 54.64.191.240/28 */, 28, NDPI_PROTOCOL_VIBER },
|
||||||
{ 0x36A5FFD0 /* 54.165.255.208/28 */, 28, NDPI_PROTOCOL_VIBER },
|
{ 0x36A5FFD0 /* 54.165.255.208/28 */, 28, NDPI_PROTOCOL_VIBER },
|
||||||
{ 0x36A5FFE0 /* 54.165.255.224/27 */, 27, NDPI_PROTOCOL_VIBER },
|
{ 0x36A5FFE0 /* 54.165.255.224/27 */, 27, NDPI_PROTOCOL_VIBER },
|
||||||
{ 0x36A93FA0 /* 54.169.63.160/27 */, 27, NDPI_PROTOCOL_VIBER },
|
|
||||||
{ 0x36A93FC0 /* 54.169.63.192/26 */, 26, NDPI_PROTOCOL_VIBER },
|
|
||||||
{ 0x36DBBFA0 /* 54.219.191.160/28 */, 28, NDPI_PROTOCOL_VIBER },
|
{ 0x36DBBFA0 /* 54.219.191.160/28 */, 28, NDPI_PROTOCOL_VIBER },
|
||||||
{ 0x36E8FB90 /* 54.232.251.144/28 */, 28, NDPI_PROTOCOL_VIBER },
|
{ 0x36E8FB90 /* 54.232.251.144/28 */, 28, NDPI_PROTOCOL_VIBER },
|
||||||
|
|
||||||
@@ -7949,6 +7925,7 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
Valve Corporation (Steam)
|
Valve Corporation (Steam)
|
||||||
origin AS32590
|
origin AS32590
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{ 0x2D79B800 /* 45.121.184.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
{ 0x2D79B800 /* 45.121.184.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
||||||
{ 0x670A7C00 /* 103.10.124.0/23 */, 23, NDPI_PROTOCOL_STEAM },
|
{ 0x670A7C00 /* 103.10.124.0/23 */, 23, NDPI_PROTOCOL_STEAM },
|
||||||
{ 0x671C3600 /* 103.28.54.0/23 */, 23, NDPI_PROTOCOL_STEAM },
|
{ 0x671C3600 /* 103.28.54.0/23 */, 23, NDPI_PROTOCOL_STEAM },
|
||||||
@@ -7967,9 +7944,17 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xD040C900 /* 208.64.201.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
{ 0xD040C900 /* 208.64.201.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
||||||
{ 0xD04EA400 /* 208.78.164.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
{ 0xD04EA400 /* 208.78.164.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
||||||
|
|
||||||
|
/*
|
||||||
|
VidTO
|
||||||
|
*/
|
||||||
|
{ 0x51111030 /* 81.17.16.48/32 */, 32, NDPI_PROTOCOL_VIDTO },
|
||||||
|
{ 0x5fb7329d /* 95.183.50.157/32 */, 32, NDPI_PROTOCOL_VIDTO },
|
||||||
|
{ 0x577824f2 /* 87.120.36.242/32 */, 32, NDPI_PROTOCOL_VIDTO },
|
||||||
|
|
||||||
{ 0x0, 0, 0 }
|
{ 0x0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* ****************************************************** */
|
/* ****************************************************** */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -8022,302 +8007,417 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* ****************************************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
Each part of a domain name can be no longer than 63 characters. There are no single-digit top-level domains and none contain digits. It doesn't look like ICANN will approve such domains either.
|
||||||
|
|
||||||
|
https://www.regular-expressions.info/email.html
|
||||||
|
|
||||||
|
(?i) is to make searches case insensitive
|
||||||
|
|
||||||
|
(?:) is a non-capturing group used to allow patterns such as .co.uk or .com.cn
|
||||||
|
The non-capturing group is used in a nested fashion to capture the
|
||||||
|
.co, and then, optionally, another m.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TLD "(?i)(?:\\.co(?:m)?)?\\.[a-z]{2,63}$"
|
||||||
|
|
||||||
|
/* ****************************************************** */
|
||||||
|
|
||||||
ndpi_protocol_match host_match[] = {
|
ndpi_protocol_match host_match[] = {
|
||||||
{ "amazon.", "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ "s3.ll.dash.row.aiv-cdn.net", NULL, "s3\\.ll\\.dash\\.row\\.aiv-cdn\\.net", "AmazonVideo", NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ "amazon.com", "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ "s3-dub.cf.dash.row.aiv-cdn.net", NULL, "s3-dub\\.cf\\.dash\\.row\\.aiv-cdn\\.net", "AmazonVideo", NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ "images-amazon.com", "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "dmqdd6hw24ucf.cloudfront.net", NULL, "dmqdd6hw24ucf\\.cloudfront\\.net", "AmazonVideo", NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ "amazonaws.com", "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_UNSAFE },
|
{ "d25xi40x97liuc.cloudfront.net", NULL, "d25xi40x97liuc\\.cloudfront\\.net", "AmazonVideo", NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ "amazon-adsystem.com", "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".aiv-delivery.net", NULL, "\\.aiv-delivery\\.net", "AmazonVideo", NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ ".cloudfront.net", "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "amazon.", NULL, NULL, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "amazon.com", NULL, "amazon" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "images-amazon.com", NULL, "images-amazon" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "amazonaws.com", NULL, "amazonaws" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "amazon-adsystem.com", NULL, "amazon-adsystem" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".cloudfront.net", NULL, "\\.cloudfront" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ ".apple.com", "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ ".push.apple.com", NULL, "\\.push\\.apple" TLD, "ApplePush", NDPI_PROTOCOL_APPLE_PUSH, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
||||||
{ ".apple-dns.net", "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ ".apple-dns.net", NULL, "\\.apple-dns" TLD, "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ ".mzstatic.com", "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ ".mzstatic.com", NULL, "\\.mzstatic" TLD, "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ ".aaplimg.com", "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ ".aaplimg.com", NULL, "\\.aaplimg" TLD, "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ ".icloud.com", "AppleiCloud", NDPI_PROTOCOL_APPLE_ICLOUD, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "aaplimg.com", NULL, "aaplimg" TLD, "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
{ "iosapps.itunes.apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE }, /* iOS */
|
{ ".apple.com", NULL, "\\.apple" TLD, "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ "osxapps.itunes.apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE }, /* MacOS */
|
{ ".icloud.com", NULL, "\\.icloud\\.com", "AppleiCloud", NDPI_PROTOCOL_APPLE_ICLOUD, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "buy.itunes.apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "iosapps.itunes.apple.com", NULL, "iosapps\\.itunes\\.apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE }, /* iOS */
|
||||||
{ "su.itunes.apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "osxapps.itunes.apple.com", NULL, "osxapps\\.itunes\\.apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE }, /* MacOS */
|
||||||
{ "se.itunes.apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "buy.itunes.apple.com", NULL, "buy\\.itunes\\.apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
{ "myapp.itunes.apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "su.itunes.apple.com", NULL, "su\\.itunes\\.apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
{ "swscan.apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "se.itunes.apple.com", NULL, "se\\.itunes\\.apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
{ "itunes-apple.com", "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "myapp.itunes.apple.com", NULL, "myapp\\.itunes\\.apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
{ "itunes.apple.com", "AppleiTunes", NDPI_PROTOCOL_APPLE_ITUNES, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
|
{ "swscan.apple.com", NULL, "swscan\\.apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "itunes-apple.com", NULL, "itunes-apple" TLD, "AppleStore", NDPI_PROTOCOL_APPLESTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
{ ".cnn.c", "CNN", NDPI_PROTOCOL_CNN, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ "itunes.apple.com", NULL, "itunes\\.apple" TLD, "AppleiTunes", NDPI_PROTOCOL_APPLE_ITUNES, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ ".cnn.net", "CNN", NDPI_PROTOCOL_CNN, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ "tlnk.io", NULL, "tlnk" TLD, "AppleiTunes", NDPI_PROTOCOL_APPLE_ITUNES, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".dropbox.com", "DropBox", NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".dropbox-dns.com", "DropBox", NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "log.getdropbox.com", "DropBox", NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ ".ebay.", "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE }, /* or FUN */
|
|
||||||
{ ".ebay.com", "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".ebaystatic.com", "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".ebaydesc.com", "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".ebayrtm.com", "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".ebaystratus.com", "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".ebayimg.com", "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
|
|
||||||
{ "facebook.com", "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "fbstatic-a.akamaihd.net", "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".fbcdn.net", "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "fbcdn-", "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".facebook.net", "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".speedtest.net", "Ookla", NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_CATEGORY_NETWORK_TOOL, NDPI_PROTOCOL_SAFE },
|
|
||||||
|
|
||||||
{ "drive-thirdparty.", "GoogleDrive", NDPI_PROTOCOL_GOOGLE_DRIVE, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "docs.", "GoogleDrive", NDPI_PROTOCOL_GOOGLE_DRIVE, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".docs.", "GoogleDrive", NDPI_PROTOCOL_GOOGLE_DRIVE, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "drive.", "GoogleDrive", NDPI_PROTOCOL_GOOGLE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ "android.clients.google.com", "PlayStore", NDPI_PROTOCOL_PLAYSTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ "ggpht.com", "PlayStore", NDPI_PROTOCOL_PLAYSTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
|
||||||
|
|
||||||
{ "google.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".google.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".gstatic.com", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".googlesyndication.com", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".googletagservices.com", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".2mdn.net", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".doubleclick.net", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE }, /* Ads */
|
|
||||||
{ "googleads.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "google-analytics.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ "googleusercontent.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "googleadservices.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "googleapis.com", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "1e100.net", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ "maps.google.", "GoogleMaps", NDPI_PROTOCOL_GOOGLE_MAPS, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ "maps.gstatic.com", "GoogleMaps", NDPI_PROTOCOL_GOOGLE_MAPS, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
|
|
||||||
{ ".gmail.", "GMail", NDPI_PROTOCOL_GMAIL, NDPI_PROTOCOL_CATEGORY_MAIL, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "mail.google.", "GMail", NDPI_PROTOCOL_GMAIL, NDPI_PROTOCOL_CATEGORY_MAIL, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ "mail.outlook.com", "Hotmail", NDPI_PROTOCOL_HOTMAIL, NDPI_PROTOCOL_CATEGORY_MAIL, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ ".last.fm", "LastFM", NDPI_PROTOCOL_LASTFM, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ "msn.com", "MSN", NDPI_PROTOCOL_MSN, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE }, /*News site*/
|
|
||||||
|
|
||||||
{ "netflix.com", "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "nflxext.com", "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "nflximg.com", "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "nflximg.net", "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "nflxvideo.net", "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".skype.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".skypeassets.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".skypedata.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".skypeecs-", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".skypeforbusiness.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".lync.com", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "e7768.b.akamaiedge.net", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "e4593.dspg.akamaiedge.net","Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "e4593.g.akamaiedge.net", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ ".tuenti.com", "Tuenti", NDPI_PROTOCOL_TUENTI, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ ".twttr.com", "Twitter", NDPI_PROTOCOL_TWITTER, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "twitter.", "Twitter", NDPI_PROTOCOL_TWITTER, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "twimg.com", "Twitter", NDPI_PROTOCOL_TWITTER, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".viber.com", "Viber", NDPI_PROTOCOL_VIBER, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".cdn.viber.com", "Viber", NDPI_PROTOCOL_VIBER, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ "wikipedia.", "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ "wikimedia.", "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ "mediawiki.", "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ "wikimediafoundation.", "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
|
|
||||||
{ ".whatsapp.", "WhatsApp", NDPI_PROTOCOL_WHATSAPP, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ ".yahoo.", "Yahoo", NDPI_PROTOCOL_YAHOO, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".yimg.com", "Yahoo", NDPI_PROTOCOL_YAHOO, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ "yahooapis.", "Yahoo", NDPI_PROTOCOL_YAHOO, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ "upload.youtube.com", "YouTubeUpload", NDPI_PROTOCOL_YOUTUBE_UPLOAD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "upload.video.google.com", "YouTubeUpload", NDPI_PROTOCOL_YOUTUBE_UPLOAD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "youtube.", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "youtu.be.", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "yt3.ggpht.com", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".googlevideo.com", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".ytimg.com", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "youtube-nocookie.", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "ggpht.com", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "googleusercontent.com", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".vevo.com", "Vevo", NDPI_PROTOCOL_VEVO, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".spotify.", "Spotify", NDPI_PROTOCOL_SPOTIFY, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "audio-fa.scdn.co", "Spotify", NDPI_PROTOCOL_SPOTIFY, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
|
|
||||||
{ ".pandora.com", "Pandora", NDPI_PROTOCOL_PANDORA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".cnn.c", NULL, "\\.cnn" TLD, "CNN", NDPI_PROTOCOL_CNN, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".cnn.net", NULL, NULL, "CNN", NDPI_PROTOCOL_CNN, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
{ ".torproject.org", "Tor", NDPI_PROTOCOL_TOR, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
{ ".dropbox.com", NULL, "\\.dropbox" TLD, "DropBox", NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".dropboxstatic.com", NULL, "\\.dropboxstatic" TLD, "DropBox", NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".dropbox-dns.com", NULL, "\\.dropbox-dns" TLD, "DropBox", NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "log.getdropbox.com", NULL, "log\\.getdropbox" TLD, "DropBox", NDPI_PROTOCOL_DROPBOX, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ ".kakao.com", "KakaoTalk", NDPI_PROTOCOL_KAKAOTALK, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".ebay.", NULL, "\\.ebay" TLD, "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE }, /* or FUN */
|
||||||
|
{ ".ebay.com", NULL, NULL, "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ "ttvnw.net", "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".ebaystatic.com", NULL, "\\.ebaystatic" TLD, "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ "static-cdn.jtvnw.net", "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".ebaydesc.com", NULL, "\\.ebaydesc" TLD, "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ "www-cdn.jtvnw.net", "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".ebayrtm.com", NULL, "\\.ebayrtm" TLD, "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".ebaystratus.com", NULL, "\\.ebaystratus" TLD, "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
{ "quickplay.com", "QuickPlay", NDPI_PROTOCOL_QUICKPLAY, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".ebayimg.com", NULL, "\\.ebayimg" TLD, "eBay", NDPI_PROTOCOL_EBAY, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
{ ".qq.com", "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".gtimg.com", "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".weibo.com", "Sina(Weibo)", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".sinaimg.cn", "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".sinajs.cn", "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".sina.cn", "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".sina.com.cn", "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
/* https://support.cipafilter.com/index.php?/Knowledgebase/Article/View/117/0/snapchat---how-to-block */
|
|
||||||
{ "feelinsonice.appspot.com", "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "feelinsonice-hrd.appspot.com", "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "feelinsonice.com", "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".snapchat.", "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".snapads.", "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
/* Detected "instagram.c10r.facebook.com". Omitted "*amazonaws.com" and "*facebook.com" CDNs e.g. "ig-telegraph-shv-04-frc3.facebook.com" */
|
/* Detected "instagram.c10r.facebook.com". Omitted "*amazonaws.com" and "*facebook.com" CDNs e.g. "ig-telegraph-shv-04-frc3.facebook.com" */
|
||||||
{ ".cdninstagram.com", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
{ ".instagram.", NULL, "\\.instagram" TLD, "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ "instagram.", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
{ "instagram.", NULL, "instagram" TLD, "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ ".instagram.", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
{ ".cdninstagram.com", NULL, "\\.cdninstagram" TLD, "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ "igcdn-photos-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "instagramimages-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "instagramstatic-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".waze.com", "Waze", NDPI_PROTOCOL_WAZE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "igcdn-photos-", NULL, "igcdn-photos-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "instagramimages-", NULL, "instagramimages-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "instagramstatic-", NULL, "instagramstatic-", "Instagram", NDPI_PROTOCOL_INSTAGRAM, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".deezer.com", "Deezer", NDPI_PROTOCOL_DEEZER, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "facebook.com", NULL, "facebook" TLD, "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "fbstatic-a.akamaihd.net", NULL, "fbstatic-a\\.akamaihd" TLD, "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".fbcdn.net", NULL, "\\.fbcdn" TLD, "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "fbcdn-", NULL, "fbcdn-", "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".facebook.net", NULL, "\\.facebook" TLD, "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".fbsbx.com", NULL, "\\.fbsbx" TLD, "Facebook", NDPI_PROTOCOL_FACEBOOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".microsoft.com", "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ ".speedtest.net", NULL, "\\.speedtest" TLD, "Ookla", NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_SAFE },
|
||||||
{ "i-msdn.sec.s-msft.com", "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_SYSTEM_OS, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "i2-msdn.sec.s-msft.com", "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_SYSTEM_OS, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".webtrends.com", "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".msecnd.net", "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "bing.com", "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
|
||||||
{ ".visualstudio.com", "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_SAFE },
|
|
||||||
|
|
||||||
{ "bn1301.storage.live.com", "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE,NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "ntop.org", NULL, "ntop\\.org$", "ntop", NDPI_PROTOCOL_NTOP, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_SAFE },
|
||||||
{ "*.gateway.messenger.live.com", "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "skyapi.live.net", "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "d.docs.live.net", "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ "update.microsoft.com", "WindowsUpdate", NDPI_PROTOCOL_WINDOWS_UPDATE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "docs.googleusercontent.com", NULL, "docs\\.googleusercontent" TLD, "GoogleDocs", NDPI_PROTOCOL_GOOGLE_DOCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".windowsupdate.com", "WindowsUpdate", NDPI_PROTOCOL_WINDOWS_UPDATE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
{ "docs.googleusercontent.com", NULL, "docs.googleusercontent" TLD, "GoogleDocs", NDPI_PROTOCOL_GOOGLE_DOCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "docs.google.com", NULL, "docs.google" TLD, "GoogleDocs", NDPI_PROTOCOL_GOOGLE_DOCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ "worldofwarcraft.com", "WorldOfWarcraft", NDPI_PROTOCOL_WORLDOFWARCRAFT, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
{ "drive-thirdparty.googleusercontent.com", NULL, "drive-thirdparty\\.googleusercontent" TLD, "GoogleDrive", NDPI_PROTOCOL_GOOGLE_DRIVE, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "drive.google.com", NULL, "drive.google" TLD, "GoogleDrive", NDPI_PROTOCOL_GOOGLE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ ".anchorfree.", "HotspotShield", NDPI_PROTOCOL_HOTSPOT_SHIELD, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
{ "android.clients.google.com", NULL, "android\\.clients\\.google" TLD, "PlayStore", NDPI_PROTOCOL_PLAYSTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
{ "hotspotshield.com", "HotspotShield", NDPI_PROTOCOL_HOTSPOT_SHIELD, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
{ "ggpht.com", NULL, "ggpht" TLD, "PlayStore", NDPI_PROTOCOL_PLAYSTORE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
{ ".webex.com", "Webex", NDPI_PROTOCOL_WEBEX, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
/*
|
||||||
|
See https://better.fyi/trackers/
|
||||||
|
|
||||||
{ ".ocsdomain.com", "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
DoubleClick by Google (2mdn.net)
|
||||||
{ "ocs.fr", "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
DoubleClick by Google (doubleclick.net)
|
||||||
{ ".ocs.fr", "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
DoubleClick by Google, Inc. (dmtry.com)
|
||||||
{ ".labgency.ws", "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
Google AdSense by Google (google.com)
|
||||||
|
Google AdSense by Google (google.se)
|
||||||
|
Google AdSense by Google (googleadservices.com)
|
||||||
|
Google Analytics by Google (google-analytics.com)
|
||||||
|
Google APIs by Google (ajax.googleapis.com)
|
||||||
|
Google Fonts by Google (fonts.googleapis.com)
|
||||||
|
Google Interactive Media Ads (imasdk.googleapis.com)
|
||||||
|
Google Syndication (googlesyndication.com)
|
||||||
|
Google Tag Manager by Google (googletagmanager.com)
|
||||||
|
Google Tag Manager by Google (googletagservices.com)
|
||||||
|
Gstatic by Google (gstatic.com)
|
||||||
|
*/
|
||||||
|
|
||||||
{ ".iflix.com", "IFLIX", NDPI_PROTOCOL_IFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".app.iflixcorp.com", "IFLIX", NDPI_PROTOCOL_IFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".images.iflixassets.com", "IFLIX", NDPI_PROTOCOL_IFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ "crl.microsoft.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "evsecure-ocsp.verisign.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
/* Google Advertisements */
|
||||||
{ "evsecure-aia.verisign.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".googlesyndication.com", NULL, "\\.googlesyndication" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_TRACKER_ADS },
|
||||||
{ "evsecure-crl.verisign.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "googleads.", NULL, "googleads\\.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_TRACKER_ADS },
|
||||||
{ ".omniroot.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".doubleclick.net", NULL, "\\.doubleclick" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_TRACKER_ADS },
|
||||||
{ ".microsoftonline.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "googleadservices.", NULL, "googleadservices\\.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_TRACKER_ADS },
|
||||||
{ ".office365.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".2mdn.net", NULL, "\\.2mdn" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_TRACKER_ADS },
|
||||||
{ ".office.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".dmtry.com", NULL, "\\.dmtry" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_TRACKER_ADS },
|
||||||
{ ".msocsp.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "google-analytics.", NULL, "google-analytics\\.", "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_TRACKER_ADS },
|
||||||
{ ".msocdn.com", "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "gtv1.com", NULL, "gtv1" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
/* Google Hangout */
|
||||||
|
{ "images2-hangout-opensocial.googleusercontent.com", NULL, "images2-hangout-opensocial\\.googleusercontent" TLD, "GoogleHangout", NDPI_PROTOCOL_HANGOUT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
/* Google Services */
|
||||||
|
{ "googleapis.com", NULL, "googleapis" TLD, "GoogleServices", NDPI_PROTOCOL_GOOGLE_SERVICES, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".googletagservices.com", NULL, "\\.googletagservices" TLD, "GoogleServices", NDPI_PROTOCOL_GOOGLE_SERVICES, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "mtalk.google.com", NULL, "mtalk\\.google" TLD, "GoogleServices", NDPI_PROTOCOL_GOOGLE_SERVICES, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ "plus.google.com", NULL, "plus\\.google" TLD, "GooglePlus", NDPI_PROTOCOL_GOOGLE_PLUS, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "plus.url.google.com", NULL, "plus\\.url\\.google" TLD, "GooglePlus", NDPI_PROTOCOL_GOOGLE_PLUS, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
/* http://check.googlezip.net/connect [check browser connectivity] */
|
||||||
|
{ ".googlezip.net", NULL, "\\.googlezip" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
|
{ "googleusercontent.com", NULL, "googleusercontent" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "1e100.net", NULL, "1e100" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ "maps.google.", NULL, "maps\\.google" TLD, "GoogleMaps", NDPI_PROTOCOL_GOOGLE_MAPS, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "maps.gstatic.com", NULL, "maps\\.gstatic" TLD, "GoogleMaps", NDPI_PROTOCOL_GOOGLE_MAPS, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
|
{ ".gmail.", NULL, "\\.gmail" TLD, "GMail", NDPI_PROTOCOL_GMAIL, NDPI_PROTOCOL_CATEGORY_MAIL, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "mail.google.", NULL, "mail\\.google" TLD, "GMail", NDPI_PROTOCOL_GMAIL, NDPI_PROTOCOL_CATEGORY_MAIL, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ "google.", NULL, "google" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".google.", NULL, NULL, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".gstatic.com", NULL, "\\.gstatic" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
|
{ "mail.outlook.com", NULL, "mail\\.outlook" TLD, "Hotmail", NDPI_PROTOCOL_HOTMAIL, NDPI_PROTOCOL_CATEGORY_MAIL, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ ".last.fm", NULL, "\\.last\\.fm$", "LastFM", NDPI_PROTOCOL_LASTFM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ "msn.com", NULL, "msn" TLD, "MSN", NDPI_PROTOCOL_MSN, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE }, /* News site */
|
||||||
|
|
||||||
|
{ "netflix.com", NULL, "netflix" TLD, "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "nflxext.com", NULL, "nflxext" TLD, "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "nflximg.com", NULL, "nflximg" TLD, "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "nflximg.net", NULL, "nflximg" TLD, "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "nflxvideo.net", NULL, "nflxvideo" TLD, "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "nflxso.net", NULL, "nflxso" TLD, "NetFlix", NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".skype.", NULL, "\\.skype\\.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".skypeassets.", NULL, "\\.skypeassets\\.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".skypedata.", NULL, "\\.skypedata\\.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".skypeecs-", NULL, "\\.skypeecs-", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".skypeforbusiness.", NULL, "\\.skypeforbusiness\\.", "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".lync.com", NULL, "\\.lync" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "e7768.b.akamaiedge.net", NULL, "e7768\\.b\\.akamaiedge" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "e4593.dspg.akamaiedge.net", NULL, "e4593\\.dspg\\.akamaiedge" TLD,"Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "e4593.g.akamaiedge.net", NULL, "e4593\\.g\\.akamaiedge" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ ".tuenti.com", NULL, "\\.tuenti" TLD, "Tuenti", NDPI_PROTOCOL_TUENTI, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ ".twttr.com", NULL, "\\.twttr" TLD, "Twitter", NDPI_PROTOCOL_TWITTER, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "twitter.", NULL, "twitter" TLD, "Twitter", NDPI_PROTOCOL_TWITTER, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "twimg.com", NULL, "twimg" TLD, "Twitter", NDPI_PROTOCOL_TWITTER, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".viber.com", NULL, "\\.viber" TLD, "Viber", NDPI_PROTOCOL_VIBER, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".cdn.viber.com", NULL, NULL, "Viber", NDPI_PROTOCOL_VIBER, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".viber.it", NULL, NULL, "Viber", NDPI_PROTOCOL_VIBER, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ "wikipedia.", NULL, "wikipedia" TLD, "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "wikimedia.", NULL, "wikimedia" TLD, "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "mediawiki.", NULL, "mediawiki" TLD, "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "wikimediafoundation.", NULL, "wikimediafoundation" TLD, "Wikipedia", NDPI_PROTOCOL_WIKIPEDIA, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
|
{ "mmg-fna.whatsapp.net", NULL, "mmg-fna\\.whatsapp" TLD, "WhatsAppFiles", NDPI_PROTOCOL_WHATSAPP_FILES, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".whatsapp.", NULL, "\\.whatsapp" TLD, "WhatsApp", NDPI_PROTOCOL_WHATSAPP, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ ".yahoo.", NULL, "\\.yahoo" TLD, "Yahoo", NDPI_PROTOCOL_YAHOO, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".yimg.com", NULL, "\\.yimg" TLD, "Yahoo", NDPI_PROTOCOL_YAHOO, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "yahooapis.", NULL, "yahooapis" TLD, "Yahoo", NDPI_PROTOCOL_YAHOO, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ "upload.youtube.com", NULL, "upload\\.youtube" TLD, "YouTubeUpload", NDPI_PROTOCOL_YOUTUBE_UPLOAD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "upload.video.google.com", NULL, "upload\\.video\\.google" TLD, "YouTubeUpload", NDPI_PROTOCOL_YOUTUBE_UPLOAD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "youtubei.googleapis.com", NULL, "youtubei\\.googleapis" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "youtube.", NULL, "youtube" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "youtu.be.", NULL, "youtu\\.be" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "yt3.ggpht.com", NULL, "yt3\\.ggpht" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".googlevideo.com", NULL, "\\.googlevideo" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".ytimg.com", NULL, "\\.ytimg" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "youtube-nocookie.", NULL, "youtube-nocookie" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "ggpht.com", NULL, "ggpht" TLD, "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".vevo.com", NULL, "\\.vevo" TLD, "Vevo", NDPI_PROTOCOL_VEVO, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".spotify.", NULL, "\\.spotify" TLD, "Spotify", NDPI_PROTOCOL_SPOTIFY, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "audio-fa.scdn.co", NULL, "audio-fa\\.scdn" TLD, "Spotify", NDPI_PROTOCOL_SPOTIFY, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ "edge-mqtt.facebook.com", NULL, "edge-mqtt\\.facebook" TLD, "Messenger", NDPI_PROTOCOL_MESSENGER, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".pandora.com", NULL, "\\.pandora" TLD, "Pandora", NDPI_PROTOCOL_PANDORA, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".torproject.org", NULL, "\\.torproject\\.org$", "Tor", NDPI_PROTOCOL_TOR, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
||||||
|
|
||||||
|
{ ".kakao.com", NULL, "\\.kakao" TLD, "KakaoTalk", NDPI_PROTOCOL_KAKAOTALK, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ "ttvnw.net", NULL, "ttvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "static-cdn.jtvnw.net", NULL, "static-cdn\\.jtvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "www-cdn.jtvnw.net", NULL, "www-cdn\\.jtvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".qq.com", NULL, "\\.qq" TLD, "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".gtimg.com", NULL, "\\.gtimg" TLD, "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".weibo.com", NULL, "\\.weibo" TLD, "Sina(Weibo)", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".weibo.cn", NULL, NULL, "Sina(Weibo)", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".sinaimg.cn", NULL, "\\.sinaimg" TLD, "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".sinajs.cn", NULL, "\\.sinajs" TLD, "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".sina.cn", NULL, "\\.sina" TLD, "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".sina.com.cn", NULL, "\\.sina\\.com\\.cn$", "Sina", NDPI_PROTOCOL_SINA, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
/* https://support.cipafilter.com/index.php?/Knowledgebase/Article/View/117/0/snapchat---how-to-block */
|
||||||
|
{ "feelinsonice.appspot.com", NULL, "\\.appspot" TLD, "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "feelinsonice-hrd.appspot.com", NULL, "feelinsonice-hrd\\.appspot" TLD, "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "feelinsonice.com", NULL, "\\.feelsonice" TLD, "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".snapchat.", NULL, "\\.snapchat" TLD, "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".snapads.", NULL, "\\.snapads" TLD, "Snapchat", NDPI_PROTOCOL_SNAPCHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".waze.com", NULL, "\\.waze" TLD, "Waze", NDPI_PROTOCOL_WAZE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ ".deezer.com", NULL, "\\.deezer" TLD, "Deezer", NDPI_PROTOCOL_DEEZER, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".microsoft.com", NULL, "\\.microsoft" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "i-msdn.sec.s-msft.com", NULL, "i-msdn.sec\\.s-msft" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_SYSTEM_OS, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "i2-msdn.sec.s-msft.com", NULL, "i2-msdn\\.sec\\.s-msft" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_SYSTEM_OS, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".webtrends.com", NULL, "\\.webtrends" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".msecnd.net", NULL, "\\.msecnd" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "bing.com", NULL, "bing" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".visualstudio.com", NULL, "\\.visualstudio" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ "login.live.com", NULL, "login\\.live" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
|
{ "bn1301.storage.live.com", NULL, "bn1301\\.storage\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE,NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "*.gateway.messenger.live.com", NULL, "\\*\\.gateway\\.messenger\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "skyapi.live.net", NULL, "skyapi\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "d.docs.live.net", NULL, "d\\.docs\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "onedrive.live.com", NULL, "onedrive\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ "update.microsoft.com", NULL, "update\\.microsoft" TLD, "WindowsUpdate", NDPI_PROTOCOL_WINDOWS_UPDATE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".windowsupdate.com", NULL, "\\.windowsupdate" TLD, "WindowsUpdate", NDPI_PROTOCOL_WINDOWS_UPDATE, NDPI_PROTOCOL_CATEGORY_SW_UPDATE, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
|
{ "worldofwarcraft.com", NULL, "worldofwarcraft" TLD, "WorldOfWarcraft", NDPI_PROTOCOL_WORLDOFWARCRAFT, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".anchorfree.", NULL, "\\.anchorfree" TLD, "HotspotShield", NDPI_PROTOCOL_HOTSPOT_SHIELD, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
||||||
|
{ "hotspotshield.com", NULL, "hotspotshield" TLD, "HotspotShield", NDPI_PROTOCOL_HOTSPOT_SHIELD, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
||||||
|
{ ".northghost.com", NULL, "\\.northghost" TLD, "HotspotShield", NDPI_PROTOCOL_HOTSPOT_SHIELD, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
||||||
|
|
||||||
|
{ ".webex.com", NULL, "\\.webex" TLD, "Webex", NDPI_PROTOCOL_WEBEX, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
{ ".ocsdomain.com", NULL, "\\.ocsdomain" TLD, "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "ocs.fr", NULL, "ocs" TLD, "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".ocs.fr", NULL, NULL, "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".labgency.ws", NULL, ".labgency" TLD, "OCS", NDPI_PROTOCOL_OCS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".iflix.com", NULL, "\\.iflix" TLD, "IFLIX", NDPI_PROTOCOL_IFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".app.iflixcorp.com", NULL, "\\.app\\.iflixcorp" TLD, "IFLIX", NDPI_PROTOCOL_IFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".images.iflixassets.com", NULL, "\\.images\\.iflixassets" TLD, "IFLIX", NDPI_PROTOCOL_IFLIX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ "crl.microsoft.com", NULL, "crl\\.microsoft" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "evsecure-ocsp.verisign.com", NULL, "evsecure-ocsp\\.verisign" TLD,"Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "evsecure-aia.verisign.com", NULL, "evsecure-aia\\.verisign" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "evsecure-crl.verisign.com", NULL, "evsecure-crl\\.verisign" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".omniroot.com", NULL, "\\.omniroot" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".microsoftonline.com", NULL, "\\.microsoftonline" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".office365.com", NULL, "\\.office365" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".office.com", NULL, "\\.office" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "office.net", NULL, NULL, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".msocsp.com", NULL, "\\.msocsp" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".msocdn.com", NULL, "\\.msocdn" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "officeapps.live.com", NULL, "officeapps\\.live" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "outlook.live.com", NULL, "outlook\\.live" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "office.live.com", NULL, "office\\.live" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".onenote.", NULL, "\\.onenote" TLD, "Office365", NDPI_PROTOCOL_OFFICE_365, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
/* http://www.urlquery.net/report.php?id=1453233646161 */
|
/* http://www.urlquery.net/report.php?id=1453233646161 */
|
||||||
{ "lifedom.top", "Cloudflare", NDPI_PROTOCOL_CLOUDFLARE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "lifedom.top", NULL, "lifedom" TLD, "Cloudflare", NDPI_PROTOCOL_CLOUDFLARE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "coby.ns.cloudflare.com", "Cloudflare", NDPI_PROTOCOL_CLOUDFLARE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "coby.ns.cloudflare.com", NULL, "coby\\.ns\\.cloudflare" TLD, "Cloudflare", NDPI_PROTOCOL_CLOUDFLARE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "amanda.ns.cloudflare.com", "Cloudflare", NDPI_PROTOCOL_CLOUDFLARE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "amanda.ns.cloudflare.com", NULL, "amanda\\.ns\\.cloudflare" TLD, "Cloudflare", NDPI_PROTOCOL_CLOUDFLARE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ "d295hzzivaok4k.cloudfront.net","OpenDNS", NDPI_PROTOCOL_OPENDNS, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "d295hzzivaok4k.cloudfront.net", NULL, "d295hzzivaok4k\\.cloudfront" TLD,"OpenDNS", NDPI_PROTOCOL_OPENDNS, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".opendns.com", "OpenDNS", NDPI_PROTOCOL_OPENDNS, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".opendns.com", NULL, "\\.opendns" TLD, "OpenDNS", NDPI_PROTOCOL_OPENDNS, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
/* https://get.slack.help/hc/en-us/articles/205138367-Troubleshooting-Slack-connection-issues */
|
/* https://get.slack.help/hc/en-us/articles/205138367-Troubleshooting-Slack-connection-issues */
|
||||||
{ "slack.com", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "slack.com", NULL, "slack" TLD, "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".slack-msgs.com", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".slack-msgs.com", NULL, "\\.slack-msgs" TLD, "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "slack-files.com", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "slack-files.com", NULL, "slack-files" TLD, "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "slack-imgs.com", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "slack-imgs.com", NULL, "slack-imgs" TLD, "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".slack-edge.com", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".slack-edge.com", NULL, "\\.slack-edge" TLD, "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".slack-core.com", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".slack-core.com", NULL, "\\.slack-core" TLD, "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "slack-redir.net", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "slack-redir.net", NULL, "slack-redir" TLD, "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
/* Detected "slack-assets2.s3-us-west-2.amazonaws.com.". Omitted "*amazonaws.com" CDN, but no generic pattern to use on first part */
|
/* Detected "slack-assets2.s3-us-west-2.amazonaws.com.". Omitted "*amazonaws.com" CDN, but no generic pattern to use on first part */
|
||||||
{ "slack-assets2.s3-", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "slack-assets2.s3-", NULL, "slack-assets2\\.s3-", "Slack", NDPI_PROTOCOL_SLACK, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ "github.com", "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "zhiliaoapp.com", NULL, "zhiliaoapp" TLD, "Musical.ly", NDPI_PROTOCOL_MUSICALLY, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ ".github.com", "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "muscdn.com", NULL, "muscdn" TLD, "Musical.ly", NDPI_PROTOCOL_MUSICALLY, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ "github.io", "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "livelycdn.com", NULL, "livelycdn" TLD, "Musical.ly", NDPI_PROTOCOL_MUSICALLY, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ ".github.io", "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "direct.ly", NULL, "direct\\.ly$", "Musical.ly", NDPI_PROTOCOL_MUSICALLY, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ "githubusercontent.com", "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ ".githubusercontent.com", "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ ".iqiyi.com", "iQIYI", NDPI_PROTOCOL_IQIYI, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "github.com", NULL, "github" TLD, "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".qiyi.com", "iQIYI", NDPI_PROTOCOL_IQIYI, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".github.com", NULL, "\\.github" TLD, "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".71.am", "iQIYI", NDPI_PROTOCOL_IQIYI, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "github.io", NULL, NULL, "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".qiyipic.com", "iQIYI", NDPI_PROTOCOL_IQIYI, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".github.io", NULL, NULL, "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "githubusercontent.com", NULL, "githubusercontent" TLD, "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".githubusercontent.com", NULL, "\\.githubusercontent" TLD, "Github", NDPI_PROTOCOL_GITHUB, NDPI_PROTOCOL_CATEGORY_COLLABORATIVE, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ ".ppstream.com", "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".steampowered.com", NULL, "\\.steampowered" TLD, "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
{ ".pps.tv", "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "steamcommunity.com", NULL, "steamcommunity" TLD, "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".steamcontent.com", NULL, "\\.steamcontent" TLD, "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".steamstatic.com", NULL, "\\.steamstatic" TLD, "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "steamcommunity-a.akamaihd.net", NULL, "steamcommunity-a\\.akamaihd" TLD,"Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".1kxun.", "1kxun", NDPI_PROTOCOL_1KXUN, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".wechat.com", NULL, "\\.wechat\\.com", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
{ "tcad.wedolook.com", "1kxun", NDPI_PROTOCOL_1KXUN, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".wechat.org", NULL, "\\.wechat\\.org", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".wechatapp.com", NULL, "\\.wechatapp" TLD, "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".we.chat", NULL, "\\.we\\.chat", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".wx.", NULL, "\\.wx\\.", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".weixin.", NULL, "\\.weixin\\.", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".mmsns.qpic.cn", NULL, "\\.mmsns\\.qpic" TLD, "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".steampowered.com", "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
{ "dnscrypt.org", NULL, "dnscrypt\\.org$", "DNScrypt", NDPI_PROTOCOL_DNSCRYPT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "steamcommunity.com", "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".steamcontent.com", "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".steamstatic.com", "Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "steamcommunity-a.akamaihd.net","Steam", NDPI_PROTOCOL_STEAM, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".wechat.com", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
{ "torrent.", NULL, "torrent" TLD, "BitTorrent", NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_UNSAFE },
|
||||||
{ ".wechat.org", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
{ "torrents.", NULL, "torrents" TLD, "BitTorrent", NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_UNSAFE },
|
||||||
{ ".wechatapp.com", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
{ "torrentz.", NULL, "torrentz" TLD, "BitTorrent", NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_UNSAFE },
|
||||||
{ ".we.chat", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".wx.", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".weixin.", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".mmsns.qpic.cn", "WeChat", NDPI_PROTOCOL_WECHAT, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ "dnscrypt.org", "DNScrypt", NDPI_PROTOCOL_DNSCRYPT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".nintendo.net", NULL, "\\.nintendo" TLD, "Nintendo", NDPI_PROTOCOL_NINTENDO, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".nintendo.com", NULL, NULL, "Nintendo", NDPI_PROTOCOL_NINTENDO, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ "torrent.", "BitTorrent", NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_UNSAFE },
|
{ ".playstation.net", NULL, "\\.playstation" TLD, "Playstation", NDPI_PROTOCOL_PLAYSTATION, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
{ "torrents.", "BitTorrent", NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_UNSAFE },
|
{ ".playstation.com", NULL, NULL, "Playstation", NDPI_PROTOCOL_PLAYSTATION, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
{ "torrentz.", "BitTorrent", NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_UNSAFE },
|
{ ".sonyentertainmentnetwork.com", NULL, "\\.sonyentertainmentnetwork" TLD,"Playstation", NDPI_PROTOCOL_PLAYSTATION, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".nintendo.net", "Nintendo", NDPI_PROTOCOL_NINTENDO, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
{ ".linkedin.com", NULL, "\\.linkedin" TLD, "LinkedIn", NDPI_PROTOCOL_LINKEDIN, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ ".nintendo.com", "Nintendo", NDPI_PROTOCOL_NINTENDO, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
{ ".licdn.com", NULL, "\\.licdn" TLD, "LinkedIn", NDPI_PROTOCOL_LINKEDIN, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ ".playstation.net", "Playstation", NDPI_PROTOCOL_PLAYSTATION, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".playstation.com", "Playstation", NDPI_PROTOCOL_PLAYSTATION, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
|
||||||
{ ".sonyentertainmentnetwork.com","Playstation", NDPI_PROTOCOL_PLAYSTATION, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ ".pastebin.com", "Pastebin", NDPI_PROTOCOL_PASTEBIN, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
{ ".sndcdn.com", NULL, "\\.sndcdn" TLD, "SoundCloud", NDPI_PROTOCOL_SOUNDCLOUD, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".soundcloud.com", NULL, "\\.soundcloud" TLD, "SoundCloud", NDPI_PROTOCOL_SOUNDCLOUD, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "getrockerbox.com", NULL, "getrockerbox" TLD, "SoundCloud", NDPI_PROTOCOL_SOUNDCLOUD, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".linkedin.com", "LinkedIn", NDPI_PROTOCOL_LINKEDIN, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
{ "web.telegram.org", NULL, "web\\.telegram" TLD, "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".licdn.com", "LinkedIn", NDPI_PROTOCOL_LINKEDIN, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
{ "tdesktop.com", NULL, "tdesktop" TLD, "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "tupdate.com", NULL, "tupdate" TLD, "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ ".sndcdn.com", "SoundCloud", NDPI_PROTOCOL_SOUNDCLOUD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".pastebin.com", NULL, "\\.pastebin" TLD, "Pastebin", NDPI_PROTOCOL_PASTEBIN, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
||||||
{ ".soundcloud.com", "SoundCloud", NDPI_PROTOCOL_SOUNDCLOUD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
{ "getrockerbox.com", "SoundCloud", NDPI_PROTOCOL_SOUNDCLOUD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
|
||||||
|
|
||||||
{ "web.telegram.org", "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".ppstream.com", NULL, "\\.ppstream" TLD, "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ "tdesktop.com", "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".pps.tv", NULL, "\\.pps\\.tv$", "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ "tupdate.com", "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ ".icq.", "ICQ", NDPI_PROTOCOL_ICQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
/*
|
||||||
{ "icq.", "ICQ", NDPI_PROTOCOL_ICQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
VidTO streaming service
|
||||||
|
NOTE: this is a possible candidate for NDPI_PROTOCOL_GENERIC
|
||||||
|
*/
|
||||||
|
{ ".vidto.me", NULL, "\\.vidto" TLD, "VidTO", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".vidto.se", NULL, NULL, "VidTO", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ NULL, 0 }
|
/*
|
||||||
|
Not so popular services without a protocl dissector (and thus not worth a protocolId) that are handled/detected by categpory rather
|
||||||
|
than by protocol id. They are bound to a generic protocol (NDPI_PROTOCOL_GENERIC) and placed onto the right category
|
||||||
|
*/
|
||||||
|
{ "quickplay.com", NULL, "quickplay" TLD, "QuickPlay", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".iqiyi.com", NULL, "\\.iqiyi" TLD, "iQIYI", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".qiyi.com", NULL, "\\.qiyi" TLD, "iQIYI", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".71.am", NULL, "\\.71" TLD, "iQIYI", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".qiyipic.com", NULL, "\\.qiyipic" TLD, "iQIYI", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ ".1kxun.", NULL, "\\.1kxun\\.", "1kxun", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "tcad.wedolook.com", NULL, "tcad\\.wedolook" TLD, "1kxun", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ "baidu.com", NULL, "baidu" TLD, "baidu", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ "icq.", NULL, "icq" TLD, "ICQ", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".icq.", NULL, NULL, "ICQ", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
|
||||||
|
/* RapidVideo streaming */
|
||||||
|
{ ".rapidvideo.com", NULL, "\\.rapidvideo" TLD, "RapidVideo", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
{ ".playercdn.net", NULL, "\\.playercdn" TLD, "RapidVideo", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
/* showmax.com video streaming */
|
||||||
|
{ "showmax.com", NULL, "showmax" TLD, "Showmax", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "showmax.akamaized.net", NULL, "showmax\\.akamaized" TLD, "Showmax", NDPI_PROTOCOL_GENERIC, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ NULL, NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -8325,57 +8425,56 @@ ndpi_protocol_match host_match[] = {
|
|||||||
Mime-type content match match
|
Mime-type content match match
|
||||||
*/
|
*/
|
||||||
ndpi_protocol_match content_match[] = {
|
ndpi_protocol_match content_match[] = {
|
||||||
{ "audio/mpeg", NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "audio/mpeg", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "audio/x-mpeg", NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "audio/x-mpeg", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "audio/mpeg3", NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "audio/mpeg3", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "audio/mp4a", NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "audio/mp4a", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/mpeg", NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/mpeg", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/nsv", NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/nsv", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "misc/ultravox", NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "misc/ultravox", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "audio/ogg", NULL, NDPI_CONTENT_OGG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "audio/ogg", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_OGG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/ogg", NULL, NDPI_CONTENT_OGG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/ogg", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_OGG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/ogg", NULL, NDPI_CONTENT_OGG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/ogg", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_OGG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ ".adobe.", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ ".adobe.", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/flv", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/flv", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/x-flv", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/x-flv", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/x-fcs", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/x-fcs", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/x-shockwave-flash",NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "application/x-shockwave-flash",NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "video/flash", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/flash", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/flv", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/flv", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "flv-application/octet-stream", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "flv-application/octet-stream", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/futuresplash", NULL, NDPI_CONTENT_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/futuresplash", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_FLASH, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/quicktime", NULL, NDPI_CONTENT_QUICKTIME, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/quicktime", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_QUICKTIME, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/mp4", NULL, NDPI_CONTENT_QUICKTIME, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/mp4", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_QUICKTIME, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/x-m4v", NULL, NDPI_CONTENT_QUICKTIME, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/x-m4v", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_QUICKTIME, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "audio/x-pn-realaudio", NULL, NDPI_CONTENT_REALMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "audio/x-pn-realaudio", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_REALMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/vnd.rn-realmedia", NULL, NDPI_CONTENT_REALMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/vnd.rn-realmedia", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_REALMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/x-ms-", NULL, NDPI_CONTENT_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/x-ms-", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "asf", NULL, NDPI_CONTENT_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "asf", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "asx", NULL, NDPI_CONTENT_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "asx", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/x-msvideo", NULL, NDPI_CONTENT_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/x-msvideo", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "audio/x-wav", NULL, NDPI_CONTENT_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "audio/x-wav", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/vnd.ms.wms-hdr.asfv1", NULL, NDPI_CONTENT_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/vnd.ms.wms-hdr.asfv1", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "NSPlayer/", NULL, NDPI_CONTENT_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "NSPlayer/", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/x-mms-framed", NULL, NDPI_CONTENT_MMS, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "Xbox Live Client/", NULL, NULL, NULL, NDPI_PROTOCOL_XBOX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "Xbox Live Client/", NULL, NDPI_PROTOCOL_XBOX, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "Windows-Update-Agent", NULL, NULL, NULL, NDPI_PROTOCOL_WINDOWS_UPDATE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "Windows-Update-Agent", NULL, NDPI_PROTOCOL_WINDOWS_UPDATE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "audio/webm", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WEBM, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "audio/webm", NULL, NDPI_CONTENT_WEBM, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "video/webm", NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_WEBM, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "video/webm", NULL, NDPI_CONTENT_WEBM, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/x-rtsp-tunnelled", NULL, NULL, NULL, NDPI_PROTOCOL_RTSP, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/x-rtsp-tunnelled", NULL, NDPI_PROTOCOL_RTSP, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/vnd.apple.mpegurl",NULL, NULL, NULL, NDPI_CONTENT_CATEGORY_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
||||||
{ "application/vnd.apple.mpegurl",NULL, NDPI_CONTENT_MPEG, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
|
{ "application/x-tar", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "application/x-tar", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "application/octet-stream", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "application/octet-stream", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "application/mac-binary", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "application/mac-binary", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "/x-bzip", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "/x-bzip", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "/x-gzip", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "/x-gzip", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "/x-zip", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "/x-zip", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "/zip", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "/zip", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "binhex", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "binhex", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "/base64", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "/base64", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "application/gnutar", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "application/gnutar", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "application/x-compressed", NULL, NULL, NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "application/x-compressed", NULL, NDPI_PROTOCOL_HTTP_DOWNLOAD, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
|
|
||||||
{ NULL, 0 }
|
{ NULL, NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ****************************************************** */
|
/* ****************************************************** */
|
||||||
|
|||||||
+1124
-260
File diff suppressed because it is too large
Load Diff
+11
-10
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* afp.c
|
* afp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-11 by ipoque GmbH
|
||||||
* Copyright (C) 2011-16 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,9 +23,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_AFP
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AFP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
struct afpHeader {
|
struct afpHeader {
|
||||||
u_int8_t flags, command;
|
u_int8_t flags, command;
|
||||||
@@ -43,6 +45,8 @@ void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search AFP\n");
|
||||||
|
|
||||||
if (packet->payload_packet_len >= sizeof(struct afpHeader)) {
|
if (packet->payload_packet_len >= sizeof(struct afpHeader)) {
|
||||||
struct afpHeader *h = (struct afpHeader*)packet->payload;
|
struct afpHeader *h = (struct afpHeader*)packet->payload;
|
||||||
|
|
||||||
@@ -64,7 +68,7 @@ void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
get_u_int32_t(packet->payload, 8) == htonl(packet->payload_packet_len - 16) &&
|
get_u_int32_t(packet->payload, 8) == htonl(packet->payload_packet_len - 16) &&
|
||||||
get_u_int32_t(packet->payload, 12) == 0 && get_u_int16_t(packet->payload, 16) == htons(0x0104)) {
|
get_u_int32_t(packet->payload, 12) == 0 && get_u_int16_t(packet->payload, 16) == htons(0x0104)) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP: DSI OpenSession detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found AFP: DSI OpenSession\n");
|
||||||
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -73,14 +77,13 @@ void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
&& ((h->command >= 1) && (h->command <= 8))
|
&& ((h->command >= 1) && (h->command <= 8))
|
||||||
&& (h->reserved == 0)
|
&& (h->reserved == 0)
|
||||||
&& (packet->payload_packet_len >= (sizeof(struct afpHeader)+ntohl(h->length)))) {
|
&& (packet->payload_packet_len >= (sizeof(struct afpHeader)+ntohl(h->length)))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP: DSI detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found AFP: DSI\n");
|
||||||
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP excluded.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AFP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -95,5 +98,3 @@ void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+37
-41
@@ -2,7 +2,7 @@
|
|||||||
* aimini.c
|
* aimini.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,9 +23,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_AIMINI
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AIMINI
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_aimini_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
|
static void ndpi_int_aimini_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
|
||||||
@@ -50,43 +52,40 @@ static u_int8_t is_special_aimini_host(struct ndpi_int_one_line_struct host_line
|
|||||||
void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search aimini\n");
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "search aimini.\n");
|
|
||||||
|
|
||||||
if (packet->udp != NULL) {
|
if (packet->udp != NULL) {
|
||||||
if (flow->l4.udp.aimini_stage == 0) {
|
if (flow->l4.udp.aimini_stage == 0) {
|
||||||
if (packet->payload_packet_len == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b) {
|
if (packet->payload_packet_len == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b) {
|
||||||
flow->l4.udp.aimini_stage = 1;
|
flow->l4.udp.aimini_stage = 1;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 1.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 1\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 136
|
if (packet->payload_packet_len == 136
|
||||||
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
|
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
|
||||||
flow->l4.udp.aimini_stage = 4;
|
flow->l4.udp.aimini_stage = 4;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 4.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 4\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
|
if (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
|
||||||
flow->l4.udp.aimini_stage = 7;
|
flow->l4.udp.aimini_stage = 7;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 7.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 7\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
|
if (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
|
||||||
flow->l4.udp.aimini_stage = 10;
|
flow->l4.udp.aimini_stage = 10;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 10.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 10\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
|
if (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
|
||||||
flow->l4.udp.aimini_stage = 13;
|
flow->l4.udp.aimini_stage = 13;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 13.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 13\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
|
if (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
|
||||||
flow->l4.udp.aimini_stage = 16;
|
flow->l4.udp.aimini_stage = 16;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 16.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 16\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,7 +95,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if (flow->l4.udp.aimini_stage == 1 && packet->payload_packet_len > 100
|
if (flow->l4.udp.aimini_stage == 1 && packet->payload_packet_len > 100
|
||||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115) {
|
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115) {
|
||||||
flow->l4.udp.aimini_stage = 2;
|
flow->l4.udp.aimini_stage = 2;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 2.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 2\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 2 &&
|
if (flow->l4.udp.aimini_stage == 2 &&
|
||||||
@@ -104,14 +103,14 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
(packet->payload_packet_len == 64 && get_u_int16_t(packet->payload, 0) == htons(0x010b)) ||
|
(packet->payload_packet_len == 64 && get_u_int16_t(packet->payload, 0) == htons(0x010b)) ||
|
||||||
(packet->payload_packet_len == 88 && get_u_int16_t(packet->payload, 0) == ntohs(0x0115)))) {
|
(packet->payload_packet_len == 88 && get_u_int16_t(packet->payload, 0) == ntohs(0x0115)))) {
|
||||||
flow->l4.udp.aimini_stage = 3;
|
flow->l4.udp.aimini_stage = 3;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 3.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 3\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 3
|
if (flow->l4.udp.aimini_stage == 3
|
||||||
&& ((packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)
|
&& ((packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)
|
||||||
|| (packet->payload_packet_len == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b)
|
|| (packet->payload_packet_len == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b)
|
||||||
|| (packet->payload_packet_len > 100 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115))) {
|
|| (packet->payload_packet_len > 100 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "found aimini (64, 0x010b), (>300, 0x0115), "
|
NDPI_LOG_INFO(ndpi_struct, "found aimini (64, 0x010b), (>300, 0x0115), "
|
||||||
"(16, 0x010c || 64, 0x010b), (16, 0x010c || 64, 0x010b || >100, 0x0115).\n");
|
"(16, 0x010c || 64, 0x010b), (16, 0x010c || 64, 0x010b || >100, 0x0115).\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -122,14 +121,14 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if (flow->l4.udp.aimini_stage == 4 && packet->payload_packet_len == 136
|
if (flow->l4.udp.aimini_stage == 4 && packet->payload_packet_len == 136
|
||||||
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
|
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
|
||||||
flow->l4.udp.aimini_stage = 5;
|
flow->l4.udp.aimini_stage = 5;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 5.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 5\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 5 && (packet->payload_packet_len == 136
|
if (flow->l4.udp.aimini_stage == 5 && (packet->payload_packet_len == 136
|
||||||
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9
|
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165))) {
|
|| ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165))) {
|
||||||
flow->l4.udp.aimini_stage = 6;
|
flow->l4.udp.aimini_stage = 6;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 6.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 6\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 6 && ((packet->payload_packet_len == 136
|
if (flow->l4.udp.aimini_stage == 6 && ((packet->payload_packet_len == 136
|
||||||
@@ -137,7 +136,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
|| ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9))
|
|| ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9))
|
||||||
|| (packet->payload_packet_len == 32
|
|| (packet->payload_packet_len == 32
|
||||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"found aimini (136, 0x01c9), (136, 0x01c9)," "(136, 0x01c9),(136, 0x01c9 || 32, 0x01ca).\n");
|
"found aimini (136, 0x01c9), (136, 0x01c9)," "(136, 0x01c9),(136, 0x01c9 || 32, 0x01ca).\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -148,18 +147,18 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if (flow->l4.udp.aimini_stage == 7 && packet->payload_packet_len == 88
|
if (flow->l4.udp.aimini_stage == 7 && packet->payload_packet_len == 88
|
||||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
|
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
|
||||||
flow->l4.udp.aimini_stage = 8;
|
flow->l4.udp.aimini_stage = 8;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 8.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 8\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 8
|
if (flow->l4.udp.aimini_stage == 8
|
||||||
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
|
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
|
||||||
flow->l4.udp.aimini_stage = 9;
|
flow->l4.udp.aimini_stage = 9;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 9.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 9\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 9
|
if (flow->l4.udp.aimini_stage == 9
|
||||||
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
|
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"found aimini (88, 0x0101), (88, 0x0101)," "(88, 0x0101),(88, 0x0101).\n");
|
"found aimini (88, 0x0101), (88, 0x0101)," "(88, 0x0101),(88, 0x0101).\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -170,19 +169,19 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if (flow->l4.udp.aimini_stage == 10 && packet->payload_packet_len == 104
|
if (flow->l4.udp.aimini_stage == 10 && packet->payload_packet_len == 104
|
||||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
|
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
|
||||||
flow->l4.udp.aimini_stage = 11;
|
flow->l4.udp.aimini_stage = 11;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 11.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 11\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 11
|
if (flow->l4.udp.aimini_stage == 11
|
||||||
&& (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102)) {
|
&& (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102)) {
|
||||||
flow->l4.udp.aimini_stage = 12;
|
flow->l4.udp.aimini_stage = 12;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 12.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 12\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 12
|
if (flow->l4.udp.aimini_stage == 12
|
||||||
&& ((packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102)
|
&& ((packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102)
|
||||||
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"found aimini (104, 0x0102), (104, 0x0102), " "(104, 0x0102), (104, 0x0102).\n");
|
"found aimini (104, 0x0102), (104, 0x0102), " "(104, 0x0102), (104, 0x0102).\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -193,20 +192,20 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if (flow->l4.udp.aimini_stage == 13 && packet->payload_packet_len == 32
|
if (flow->l4.udp.aimini_stage == 13 && packet->payload_packet_len == 32
|
||||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
|
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
|
||||||
flow->l4.udp.aimini_stage = 14;
|
flow->l4.udp.aimini_stage = 14;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 14.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 14\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 14
|
if (flow->l4.udp.aimini_stage == 14
|
||||||
&& ((packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca)
|
&& ((packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca)
|
||||||
|| (packet->payload_packet_len == 136 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0166))) {
|
|| (packet->payload_packet_len == 136 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0166))) {
|
||||||
flow->l4.udp.aimini_stage = 15;
|
flow->l4.udp.aimini_stage = 15;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 15.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 15\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 15
|
if (flow->l4.udp.aimini_stage == 15
|
||||||
&& ((packet->payload_packet_len == 136 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0166)
|
&& ((packet->payload_packet_len == 136 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0166)
|
||||||
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"found aimini (32,0x01ca), (32,0x01ca), (32,0x01ca), ((136, 0x0166)||(32,0x01ca)).\n");
|
"found aimini (32,0x01ca), (32,0x01ca), (32,0x01ca), ((136, 0x0166)||(32,0x01ca)).\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -217,18 +216,18 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if (flow->l4.udp.aimini_stage == 16 && packet->payload_packet_len == 16
|
if (flow->l4.udp.aimini_stage == 16 && packet->payload_packet_len == 16
|
||||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
|
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
|
||||||
flow->l4.udp.aimini_stage = 17;
|
flow->l4.udp.aimini_stage = 17;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 17.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 17\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 17
|
if (flow->l4.udp.aimini_stage == 17
|
||||||
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
|
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
|
||||||
flow->l4.udp.aimini_stage = 18;
|
flow->l4.udp.aimini_stage = 18;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 18.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "stage = 18\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.udp.aimini_stage == 18
|
if (flow->l4.udp.aimini_stage == 18
|
||||||
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
|
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"found aimini (16, 0x010c), (16, 0x010c), (16, 0x010c), (16, 0x010c).\n");
|
"found aimini (16, 0x010c), (16, 0x010c), (16, 0x010c), (16, 0x010c).\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -238,11 +237,11 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
(memcmp(packet->payload, "GET /player/", NDPI_STATICSTRING_LEN("GET /player/")) == 0)) ||
|
(memcmp(packet->payload, "GET /player/", NDPI_STATICSTRING_LEN("GET /player/")) == 0)) ||
|
||||||
(packet->payload_packet_len > NDPI_STATICSTRING_LEN("GET /play/?fid=") &&
|
(packet->payload_packet_len > NDPI_STATICSTRING_LEN("GET /play/?fid=") &&
|
||||||
(memcmp(packet->payload, "GET /play/?fid=", NDPI_STATICSTRING_LEN("GET /play/?fid=")) == 0))) {
|
(memcmp(packet->payload, "GET /play/?fid=", NDPI_STATICSTRING_LEN("GET /play/?fid=")) == 0))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "HTTP packet detected.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "HTTP packet detected\n");
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
if (packet->host_line.ptr != NULL && packet->host_line.len > 11
|
if (packet->host_line.ptr != NULL && packet->host_line.len > 11
|
||||||
&& (memcmp(&packet->host_line.ptr[packet->host_line.len - 11], ".aimini.net", 11) == 0)) {
|
&& (memcmp(&packet->host_line.ptr[packet->host_line.len - 11], ".aimini.net", 11) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "AIMINI HTTP traffic detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found AIMINI HTTP traffic\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -255,8 +254,8 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
NDPI_STATICSTRING_LEN("download/")) == 0) {
|
NDPI_STATICSTRING_LEN("download/")) == 0) {
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
if (is_special_aimini_host(packet->host_line) == 1) {
|
if (is_special_aimini_host(packet->host_line) == 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"AIMINI HTTP traffic detected.\n");
|
"found AIMINI HTTP traffic\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -266,8 +265,8 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
NDPI_STATICSTRING_LEN("upload/")) == 0) {
|
NDPI_STATICSTRING_LEN("upload/")) == 0) {
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
if (is_special_aimini_host(packet->host_line) == 1) {
|
if (is_special_aimini_host(packet->host_line) == 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"AIMINI HTTP traffic detected.\n");
|
"found AIMINI HTTP traffic detected.\n");
|
||||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -276,8 +275,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "exclude aimini.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AIMINI);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,5 +291,3 @@ void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -0,0 +1,149 @@
|
|||||||
|
/*
|
||||||
|
* ajp.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 by Leonn Paiva <leonn.paiva@gmail.com>
|
||||||
|
*
|
||||||
|
* 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 "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AJP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
enum ajp_direction {
|
||||||
|
AJP_SERVER_TO_CONTAINER = 0x1234,
|
||||||
|
AJP_CONTAINER_TO_SERVER = 0x4142
|
||||||
|
};
|
||||||
|
|
||||||
|
enum ajp_packet_type {
|
||||||
|
AJP_UNKNOWN = 0,
|
||||||
|
|
||||||
|
/* packet types */
|
||||||
|
AJP_FORWARD_REQUEST = 2,
|
||||||
|
AJP_SEND_BODY_CHUNK = 3,
|
||||||
|
AJP_SEND_HEADERS = 4,
|
||||||
|
AJP_END_RESPONSE = 5,
|
||||||
|
AJP_GET_BODY_CHUNK = 6,
|
||||||
|
AJP_SHUTDOWN = 7,
|
||||||
|
AJP_PING = 8,
|
||||||
|
AJP_CPONG = 9,
|
||||||
|
AJP_CPING = 10,
|
||||||
|
AJP_BODY = 11
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ajp_header {
|
||||||
|
uint16_t magic;
|
||||||
|
uint16_t len;
|
||||||
|
uint8_t code;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void set_ajp_detected(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
|
|
||||||
|
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
|
||||||
|
ndpi_search_tcp_or_udp(ndpi_struct, flow);
|
||||||
|
|
||||||
|
/* If no custom protocol has been detected */
|
||||||
|
/* if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) */
|
||||||
|
ndpi_int_reset_protocol(flow);
|
||||||
|
ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id, NDPI_PROTOCOL_AJP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************************************/
|
||||||
|
|
||||||
|
static void ndpi_check_ajp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow)
|
||||||
|
{
|
||||||
|
struct ajp_header ajp_hdr;
|
||||||
|
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
if (packet->payload_packet_len < 5 /* ajp_header size*/) {
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ajp_hdr = *((struct ajp_header *) (packet->payload));
|
||||||
|
ajp_hdr.magic = ntohs(ajp_hdr.magic);
|
||||||
|
ajp_hdr.len = ntohs(ajp_hdr.len);
|
||||||
|
|
||||||
|
if (ajp_hdr.len > 0 && ajp_hdr.magic == AJP_SERVER_TO_CONTAINER) {
|
||||||
|
if (ajp_hdr.code == AJP_FORWARD_REQUEST || ajp_hdr.code == AJP_SHUTDOWN
|
||||||
|
|| ajp_hdr.code == AJP_PING || ajp_hdr.code == AJP_CPING) {
|
||||||
|
|
||||||
|
set_ajp_detected(ndpi_struct, flow);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "Invalid AJP request type");
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
} else if (ajp_hdr.len > 0 && ajp_hdr.magic == AJP_CONTAINER_TO_SERVER) {
|
||||||
|
if (ajp_hdr.code == AJP_SEND_BODY_CHUNK || ajp_hdr.code == AJP_SEND_HEADERS
|
||||||
|
|| ajp_hdr.code == AJP_END_RESPONSE || ajp_hdr.code == AJP_GET_BODY_CHUNK
|
||||||
|
|| ajp_hdr.code == AJP_CPONG) {
|
||||||
|
|
||||||
|
set_ajp_detected(ndpi_struct, flow);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "Invalid AJP response type");
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
NDPI_LOG_DBG(ndpi_struct,"Invalid AJP packet\n");
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ndpi_search_ajp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow)
|
||||||
|
{
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
// Break after 20 packets.
|
||||||
|
if(flow->packet_counter > 20) {
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search AJP\n");
|
||||||
|
ndpi_check_ajp(ndpi_struct, flow);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************* */
|
||||||
|
|
||||||
|
|
||||||
|
void init_ajp_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
|
{
|
||||||
|
ndpi_set_bitmask_protocol_detection("AJP", ndpi_struct, detection_bitmask,
|
||||||
|
*id, NDPI_PROTOCOL_AJP, ndpi_search_ajp,
|
||||||
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
|
ADD_TO_DETECTION_BITMASK);
|
||||||
|
|
||||||
|
*id += 1;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* amqp.c
|
* amqp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-17 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -18,9 +18,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AMQP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
#ifdef NDPI_PROTOCOL_AMQP
|
|
||||||
|
|
||||||
PACK_ON
|
PACK_ON
|
||||||
struct amqp_header {
|
struct amqp_header {
|
||||||
@@ -39,7 +42,7 @@ static void ndpi_int_amqp_add_connection(struct ndpi_detection_module_struct *nd
|
|||||||
void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AMQP, ndpi_struct, NDPI_LOG_DEBUG, "search amqp. \n");
|
NDPI_LOG_DBG(ndpi_struct, "search amqp\n");
|
||||||
|
|
||||||
if (packet->tcp != NULL) {
|
if (packet->tcp != NULL) {
|
||||||
if(packet->payload_packet_len > sizeof(struct amqp_header)) {
|
if(packet->payload_packet_len > sizeof(struct amqp_header)) {
|
||||||
@@ -57,7 +60,7 @@ void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
u_int16_t method = htons(h->method);
|
u_int16_t method = htons(h->method);
|
||||||
|
|
||||||
if(method <= 120 /* Method basic NACK */) {
|
if(method <= 120 /* Method basic NACK */) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_AMQP, ndpi_struct, NDPI_LOG_DEBUG, "found amqp over tcp. \n");
|
NDPI_LOG_INFO(ndpi_struct, "found amqp over tcp\n");
|
||||||
ndpi_int_amqp_add_connection(ndpi_struct, flow);
|
ndpi_int_amqp_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -65,6 +68,8 @@ void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,4 +85,3 @@ void init_amqp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* apple_push.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 by 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 "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_APPLE_PUSH
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
static void ndpi_check_apple_push(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
/* https://support.apple.com/en-us/HT203609 */
|
||||||
|
if(((ntohl(packet->iph->saddr) & 0xFF000000 /* 255.0.0.0 */) == 0x11000000 /* 17.0.0.0/8 */)
|
||||||
|
|| ((ntohl(packet->iph->daddr) & 0xFF000000 /* 255.0.0.0 */) == 0x11000000 /* 17.0.0.0/8 */)) {
|
||||||
|
u_int16_t apple_push_port = ntohs(5223);
|
||||||
|
u_int16_t notification_apn_port = ntohs(2195);
|
||||||
|
u_int16_t apn_feedback_port = ntohs(2196);
|
||||||
|
|
||||||
|
if(((packet->tcp->source == apple_push_port) || (packet->tcp->dest == apple_push_port))
|
||||||
|
|| ((packet->tcp->source == notification_apn_port) || (packet->tcp->dest == notification_apn_port))
|
||||||
|
|| ((packet->tcp->source == apn_feedback_port) || (packet->tcp->dest == apn_feedback_port))
|
||||||
|
) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found apple_push\n");
|
||||||
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLE_PUSH, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ndpi_search_apple_push(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
|
{
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search apple_push\n");
|
||||||
|
|
||||||
|
/* skip marked packets */
|
||||||
|
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_APPLE_PUSH)
|
||||||
|
ndpi_check_apple_push(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void init_apple_push_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
|
{
|
||||||
|
ndpi_set_bitmask_protocol_detection("APPLE_PUSH", ndpi_struct, detection_bitmask, *id,
|
||||||
|
NDPI_PROTOCOL_APPLE_PUSH,
|
||||||
|
ndpi_search_apple_push,
|
||||||
|
NDPI_SELECTION_BITMASK_PROTOCOL_TCP,
|
||||||
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
|
ADD_TO_DETECTION_BITMASK);
|
||||||
|
*id += 1;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* applejuice.c
|
* applejuice.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,9 +22,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_APPLEJUICE
|
||||||
#ifdef NDPI_PROTOCOL_APPLEJUICE
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
@@ -37,21 +39,18 @@ void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "search applejuice.\n");
|
NDPI_LOG_DBG(ndpi_struct, "search applejuice\n");
|
||||||
|
|
||||||
if ((packet->payload_packet_len > 7) && (packet->payload[6] == 0x0d)
|
if ((packet->payload_packet_len > 7) && (packet->payload[6] == 0x0d)
|
||||||
&& (packet->payload[7] == 0x0a)
|
&& (packet->payload[7] == 0x0a)
|
||||||
&& (memcmp(packet->payload, "ajprot", 6) == 0)) {
|
&& (memcmp(packet->payload, "ajprot", 6) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "detected applejuice.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found applejuice\n");
|
||||||
ndpi_int_applejuice_add_connection(ndpi_struct, flow);
|
ndpi_int_applejuice_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "exclude applejuice.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_APPLEJUICE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -66,5 +65,3 @@ void init_applejuice_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* armagetron.c
|
* armagetron.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,27 +22,24 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ARMAGETRON
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_ARMAGETRON
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_armagetron_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_armagetron_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
|
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "search armagetron.\n");
|
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search armagetron\n");
|
||||||
|
|
||||||
if (packet->payload_packet_len > 10) {
|
if (packet->payload_packet_len > 10) {
|
||||||
/* login request */
|
/* login request */
|
||||||
@@ -52,7 +49,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
goto exclude;
|
goto exclude;
|
||||||
if (get_u_int16_t(packet->payload, 6) == htons(0x0008)
|
if (get_u_int16_t(packet->payload, 6) == htons(0x0008)
|
||||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "detected armagetron.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found armagetron\n");
|
||||||
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -65,7 +62,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
goto exclude;
|
goto exclude;
|
||||||
if (get_u_int32_t(packet->payload, 6) == htonl(0x00000500) && get_u_int32_t(packet->payload, 6 + 4) == htonl(0x00010000)
|
if (get_u_int32_t(packet->payload, 6) == htonl(0x00000500) && get_u_int32_t(packet->payload, 6 + 4) == htonl(0x00010000)
|
||||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "detected armagetron.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found armagetron\n");
|
||||||
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -85,7 +82,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
&& (get_u_int32_t(packet->payload, 6 + 10 + val) == htonl(0x00010000)
|
&& (get_u_int32_t(packet->payload, 6 + 10 + val) == htonl(0x00010000)
|
||||||
|| get_u_int32_t(packet->payload, 6 + 10 + val) == htonl(0x00000001))
|
|| get_u_int32_t(packet->payload, 6 + 10 + val) == htonl(0x00000001))
|
||||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "detected armagetron.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found armagetron\n");
|
||||||
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -94,8 +91,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
}
|
}
|
||||||
|
|
||||||
exclude:
|
exclude:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "exclude armagetron.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_ARMAGETRON);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,6 +107,3 @@ void init_armagetron_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* flash.c
|
* flash.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* ftp.c
|
* ftp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* manolito.c
|
* manolito.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* popo.c
|
* popo.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* secondlife.c
|
* secondlife.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ayiya.c
|
* ayiya.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -26,9 +26,11 @@
|
|||||||
http://tools.ietf.org/html/rfc4891
|
http://tools.ietf.org/html/rfc4891
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AYIYA
|
||||||
#ifdef NDPI_PROTOCOL_AYIYA
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
struct ayiya {
|
struct ayiya {
|
||||||
u_int8_t flags[3];
|
u_int8_t flags[3];
|
||||||
@@ -42,6 +44,8 @@ void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search AYIYA\n");
|
||||||
|
|
||||||
if(packet->udp && (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)) {
|
if(packet->udp && (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)) {
|
||||||
/* Ayiya is udp based, port 5072 */
|
/* Ayiya is udp based, port 5072 */
|
||||||
if ((packet->udp->source == htons(5072) || packet->udp->dest == htons(5072))
|
if ((packet->udp->source == htons(5072) || packet->udp->dest == htons(5072))
|
||||||
@@ -55,13 +59,15 @@ void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
|
|
||||||
now = flow->packet.tick_timestamp;
|
now = flow->packet.tick_timestamp;
|
||||||
|
|
||||||
if((epoch >= (now - fiveyears)) && (epoch <= (now+86400 /* 1 day */)))
|
if((epoch >= (now - fiveyears)) && (epoch <= (now+86400 /* 1 day */))) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found AYIYA\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AYIYA);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,5 +83,3 @@ void init_ayiya_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* battlefield.c
|
* battlefield.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,10 +22,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BATTLEFIELD
|
||||||
#ifdef NDPI_PROTOCOL_BATTLEFIELD
|
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
static void ndpi_int_battlefield_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_battlefield_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
@@ -53,12 +54,12 @@ void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, s
|
|||||||
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_BATTLEFIELD) {
|
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_BATTLEFIELD) {
|
||||||
if (src != NULL && ((u_int32_t)
|
if (src != NULL && ((u_int32_t)
|
||||||
(packet->tick_timestamp - src->battlefield_ts) < ndpi_struct->battlefield_timeout)) {
|
(packet->tick_timestamp - src->battlefield_ts) < ndpi_struct->battlefield_timeout)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"battlefield : save src connection packet detected\n");
|
"battlefield : save src connection packet detected\n");
|
||||||
src->battlefield_ts = packet->tick_timestamp;
|
src->battlefield_ts = packet->tick_timestamp;
|
||||||
} else if (dst != NULL && ((u_int32_t)
|
} else if (dst != NULL && ((u_int32_t)
|
||||||
(packet->tick_timestamp - dst->battlefield_ts) < ndpi_struct->battlefield_timeout)) {
|
(packet->tick_timestamp - dst->battlefield_ts) < ndpi_struct->battlefield_timeout)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"battlefield : save dst connection packet detected\n");
|
"battlefield : save dst connection packet detected\n");
|
||||||
dst->battlefield_ts = packet->tick_timestamp;
|
dst->battlefield_ts = packet->tick_timestamp;
|
||||||
}
|
}
|
||||||
@@ -74,8 +75,7 @@ void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, s
|
|||||||
}
|
}
|
||||||
} else if (flow->l4.udp.battlefield_stage == 2 - packet->packet_direction) {
|
} else if (flow->l4.udp.battlefield_stage == 2 - packet->packet_direction) {
|
||||||
if (packet->payload_packet_len > 8 && get_u_int32_t(packet->payload, 0) == flow->l4.udp.battlefield_msg_id) {
|
if (packet->payload_packet_len > 8 && get_u_int32_t(packet->payload, 0) == flow->l4.udp.battlefield_msg_id) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found Battlefield message and reply detected\n");
|
||||||
NDPI_LOG_DEBUG, "Battlefield message and reply detected.\n");
|
|
||||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -91,28 +91,26 @@ void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, s
|
|||||||
} else if (flow->l4.udp.battlefield_stage == 4 - packet->packet_direction) {
|
} else if (flow->l4.udp.battlefield_stage == 4 - packet->packet_direction) {
|
||||||
if (packet->payload_packet_len == 7
|
if (packet->payload_packet_len == 7
|
||||||
&& (packet->payload[0] == 0x02 || packet->payload[packet->payload_packet_len - 1] == 0xe0)) {
|
&& (packet->payload[0] == 0x02 || packet->payload[packet->payload_packet_len - 1] == 0xe0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct, "found Battlefield message and reply detected\n");
|
||||||
"Battlefield message and reply detected.\n");
|
|
||||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload_packet_len == 18 && memcmp(&packet->payload[5], "battlefield2\x00", 13) == 0) {
|
if (packet->payload_packet_len == 18 && memcmp(&packet->payload[5], "battlefield2\x00", 13) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG, "Battlefield 2 hello packet detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Battlefield 2 hello packet detected\n");
|
||||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
} else if (packet->payload_packet_len > 10 &&
|
} else if (packet->payload_packet_len > 10 &&
|
||||||
(memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\x50\xb9\x10\x11", 10) == 0
|
(memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\x50\xb9\x10\x11", 10) == 0
|
||||||
|| memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\x30\xb9\x10\x11", 10) == 0
|
|| memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\x30\xb9\x10\x11", 10) == 0
|
||||||
|| memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\xa0\x98\x00\x11", 10) == 0)) {
|
|| memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\xa0\x98\x00\x11", 10) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG, "Battlefield safe pattern detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Battlefield safe pattern detected\n");
|
||||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BATTLEFIELD);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -126,5 +124,3 @@ void init_battlefield_dissector(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+12
-8
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* bgp.c
|
* bgp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 - ntop.org
|
* Copyright (C) 2016-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -20,9 +20,13 @@
|
|||||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_BGP
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BGP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
/* this detection also works asymmetrically */
|
/* this detection also works asymmetrically */
|
||||||
void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -30,6 +34,8 @@ void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int16_t bgp_port = htons(179);
|
u_int16_t bgp_port = htons(179);
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search BGP\n");
|
||||||
|
|
||||||
if(packet->tcp) {
|
if(packet->tcp) {
|
||||||
if(packet->payload_packet_len > 18
|
if(packet->payload_packet_len > 18
|
||||||
&& packet->payload[18] < 5
|
&& packet->payload[18] < 5
|
||||||
@@ -38,13 +44,13 @@ void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
&& (get_u_int64_t(packet->payload, 8) == 0xffffffffffffffffULL)
|
&& (get_u_int64_t(packet->payload, 8) == 0xffffffffffffffffULL)
|
||||||
&& (ntohs(get_u_int16_t(packet->payload, 16)) <= packet->payload_packet_len)) {
|
&& (ntohs(get_u_int16_t(packet->payload, 16)) <= packet->payload_packet_len)) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BGP, ndpi_struct, NDPI_LOG_DEBUG, "BGP detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found BGP\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* exclude BGP */
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BGP);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -59,5 +65,3 @@ void init_bgp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* bittorrent.c
|
* bittorrent.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,8 +23,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
#ifdef NDPI_PROTOCOL_BITTORRENT
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BITTORRENT
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#define NDPI_PROTOCOL_UNSAFE_DETECTION 0
|
#define NDPI_PROTOCOL_UNSAFE_DETECTION 0
|
||||||
#define NDPI_PROTOCOL_SAFE_DETECTION 1
|
#define NDPI_PROTOCOL_SAFE_DETECTION 1
|
||||||
|
|
||||||
@@ -51,7 +55,8 @@ static u_int8_t is_utp_pkt(const u_int8_t *payload, u_int payload_len) {
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
|
static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
int bt_offset, int check_hash,
|
int bt_offset, int check_hash,
|
||||||
const u_int8_t save_detection, const u_int8_t encrypted_connection)
|
const u_int8_t save_detection, const u_int8_t encrypted_connection)
|
||||||
{
|
{
|
||||||
@@ -67,8 +72,10 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc
|
|||||||
} else
|
} else
|
||||||
bt_hash = (const char*)&flow->packet.payload[28];
|
bt_hash = (const char*)&flow->packet.payload[28];
|
||||||
|
|
||||||
|
if(!ndpi_struct->disable_metadata_export) {
|
||||||
if(bt_hash) memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
|
if(bt_hash) memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
@@ -87,8 +94,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
|
|
||||||
if(flow->packet_counter == 2 && packet->payload_packet_len > 20) {
|
if(flow->packet_counter == 2 && packet->payload_packet_len > 20) {
|
||||||
if(memcmp(&packet->payload[0], "BitTorrent protocol", 19) == 0) {
|
if(memcmp(&packet->payload[0], "BitTorrent protocol", 19) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: plain\n");
|
||||||
ndpi_struct, NDPI_LOG_TRACE, "BT: plain BitTorrent protocol detected\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, 19, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, 19, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -99,7 +105,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
/* test for match 0x13+"BitTorrent protocol" */
|
/* test for match 0x13+"BitTorrent protocol" */
|
||||||
if(packet->payload[0] == 0x13) {
|
if(packet->payload[0] == 0x13) {
|
||||||
if(memcmp(&packet->payload[1], "BitTorrent protocol", 19) == 0) {
|
if(memcmp(&packet->payload[1], "BitTorrent protocol", 19) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_TRACE, "BT: plain BitTorrent protocol detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found BT: plain\n");
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, 20, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, 20, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -108,8 +114,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(packet->payload_packet_len > 23 && memcmp(packet->payload, "GET /webseed?info_hash=", 23) == 0) {
|
if(packet->payload_packet_len > 23 && memcmp(packet->payload, "GET /webseed?info_hash=", 23) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: plain webseed\n");
|
||||||
NDPI_LOG_TRACE, "BT: plain webseed BitTorrent protocol detected\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -119,8 +124,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
/* no asymmetric detection possible for answer of pattern "GET /data?fid=". */
|
/* no asymmetric detection possible for answer of pattern "GET /data?fid=". */
|
||||||
if(packet->payload_packet_len > 60
|
if(packet->payload_packet_len > 60
|
||||||
&& memcmp(packet->payload, "GET /data?fid=", 14) == 0 && memcmp(&packet->payload[54], "&size=", 6) == 0) {
|
&& memcmp(packet->payload, "GET /data?fid=", 14) == 0 && memcmp(&packet->payload[54], "&size=", 6) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: plain Bitcomet persistent seed\n");
|
||||||
NDPI_LOG_TRACE, "BT: plain Bitcomet persistent seed protocol detected\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -140,8 +144,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
&& ((packet->user_agent_line.len > 8 && memcmp(packet->user_agent_line.ptr, "Azureus ", 8) == 0)
|
&& ((packet->user_agent_line.len > 8 && memcmp(packet->user_agent_line.ptr, "Azureus ", 8) == 0)
|
||||||
|| (packet->user_agent_line.len >= 10 && memcmp(packet->user_agent_line.ptr, "BitTorrent", 10) == 0)
|
|| (packet->user_agent_line.len >= 10 && memcmp(packet->user_agent_line.ptr, "BitTorrent", 10) == 0)
|
||||||
|| (packet->user_agent_line.len >= 11 && memcmp(packet->user_agent_line.ptr, "BTWebClient", 11) == 0))) {
|
|| (packet->user_agent_line.len >= 11 && memcmp(packet->user_agent_line.ptr, "BTWebClient", 11) == 0))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: Azureus /Bittorrent user agent\n");
|
||||||
NDPI_LOG_TRACE, "Azureus /Bittorrent user agent line detected\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -151,8 +154,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
&& (packet->user_agent_line.len >= 9 && memcmp(packet->user_agent_line.ptr, "Shareaza ", 9) == 0)
|
&& (packet->user_agent_line.len >= 9 && memcmp(packet->user_agent_line.ptr, "Shareaza ", 9) == 0)
|
||||||
&& (packet->parsed_lines > 8 && packet->line[8].ptr != 0
|
&& (packet->parsed_lines > 8 && packet->line[8].ptr != 0
|
||||||
&& packet->line[8].len >= 9 && memcmp(packet->line[8].ptr, "X-Queue: ", 9) == 0)) {
|
&& packet->line[8].len >= 9 && memcmp(packet->line[8].ptr, "X-Queue: ", 9) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: Shareaza detected\n");
|
||||||
NDPI_LOG_TRACE, "Bittorrent Shareaza detected.\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -186,7 +188,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
&& packet->line[8].ptr != NULL
|
&& packet->line[8].ptr != NULL
|
||||||
&& packet->line[8].len > 22 && memcmp(packet->line[8].ptr, "Cache-Control: no-cache", 23) == 0) {
|
&& packet->line[8].len > 22 && memcmp(packet->line[8].ptr, "Cache-Control: no-cache", 23) == 0) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_TRACE, "Bitcomet LTS detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found BT: Bitcomet LTS\n");
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -211,7 +213,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
&& packet->line[6].ptr != NULL
|
&& packet->line[6].ptr != NULL
|
||||||
&& packet->line[6].len > 21 && memcmp(packet->line[6].ptr, "Connection: Keep-Alive", 22) == 0) {
|
&& packet->line[6].len > 21 && memcmp(packet->line[6].ptr, "Connection: Keep-Alive", 22) == 0) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_TRACE, "FlashGet detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found BT: FlashGet\n");
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -232,7 +234,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
&& packet->line[5].ptr != NULL
|
&& packet->line[5].ptr != NULL
|
||||||
&& packet->line[5].len > 21 && memcmp(packet->line[5].ptr, "Connection: Keep-Alive", 22) == 0) {
|
&& packet->line[5].len > 21 && memcmp(packet->line[5].ptr, "Connection: Keep-Alive", 22) == 0) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_TRACE, "FlashGet detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found BT: FlashGet\n");
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -250,8 +252,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, " BT stat: tracker info hash found\n");
|
||||||
NDPI_LOG_TRACE, " BT stat: tracker info hash found\n");
|
|
||||||
|
|
||||||
/* len is > 50, so save operation here */
|
/* len is > 50, so save operation here */
|
||||||
len -= 10;
|
len -= 10;
|
||||||
@@ -300,8 +301,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: tracker info hash parsed\n");
|
||||||
NDPI_LOG_TRACE, " BT stat: tracker info hash parsed\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -329,8 +329,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
/* did not see this pattern anywhere */
|
/* did not see this pattern anywhere */
|
||||||
if((memcmp(&packet->payload[0], pattern_20_bytes, 20) == 0)
|
if((memcmp(&packet->payload[0], pattern_20_bytes, 20) == 0)
|
||||||
&& (memcmp(&packet->payload[52], pattern_12_bytes, 12) == 0)) {
|
&& (memcmp(&packet->payload[52], pattern_12_bytes, 12) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: Warez - Plain\n");
|
||||||
NDPI_LOG_TRACE, "BT: Warez - Plain BitTorrent protocol detected\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -344,9 +343,7 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
|||||||
/* haven't fount this pattern anywhere */
|
/* haven't fount this pattern anywhere */
|
||||||
if(packet->host_line.ptr != NULL
|
if(packet->host_line.ptr != NULL
|
||||||
&& packet->host_line.len >= 9 && memcmp(packet->host_line.ptr, "ip2p.com:", 9) == 0) {
|
&& packet->host_line.len >= 9 && memcmp(packet->host_line.ptr, "ip2p.com:", 9) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: Warez - Plain Host: ip2p.com: pattern\n");
|
||||||
ndpi_struct, NDPI_LOG_TRACE,
|
|
||||||
"BT: Warez - Plain BitTorrent protocol detected due to Host: ip2p.com: pattern\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -370,13 +367,11 @@ static void ndpi_int_search_bittorrent_tcp(struct ndpi_detection_module_struct *
|
|||||||
/* exclude stage 0 detection from next run */
|
/* exclude stage 0 detection from next run */
|
||||||
flow->bittorrent_stage = 1;
|
flow->bittorrent_stage = 1;
|
||||||
if(ndpi_int_search_bittorrent_tcp_zero(ndpi_struct, flow) != 0) {
|
if(ndpi_int_search_bittorrent_tcp_zero(ndpi_struct, flow) != 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "stage 0 has detected something, returning\n");
|
||||||
"stage 0 has detected something, returning\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "stage 0 has no direct detection, fall through\n");
|
||||||
"stage 0 has no direct detection, fall through\n");
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -392,7 +387,7 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
|| (packet->udp
|
|| (packet->udp
|
||||||
&& ((ntohs(packet->udp->source) == 3544) /* teredo.c */
|
&& ((ntohs(packet->udp->source) == 3544) /* teredo.c */
|
||||||
|| (ntohs(packet->udp->dest) == 3544))))) {
|
|| (ntohs(packet->udp->dest) == 3544))))) {
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BITTORRENT);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -481,8 +476,7 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
if(bt_proto && (packet->payload_packet_len > 47))
|
if(bt_proto && (packet->payload_packet_len > 47))
|
||||||
memcpy(flow->protos.bittorrent.hash, &bt_proto[27], 20);
|
memcpy(flow->protos.bittorrent.hash, &bt_proto[27], 20);
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT,
|
NDPI_LOG_INFO(ndpi_struct, "found BT: plain\n");
|
||||||
ndpi_struct, NDPI_LOG_TRACE, "BT: plain BitTorrent protocol detected\n");
|
|
||||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 0,
|
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 0,
|
||||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||||
return;
|
return;
|
||||||
@@ -491,8 +485,7 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BITTORRENT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -508,5 +501,3 @@ void init_bittorrent_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+10
-14
@@ -1,13 +1,14 @@
|
|||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BJNP
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_BJNP
|
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_bjnp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_bjnp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
u_int8_t due_to_correlation)
|
u_int8_t due_to_correlation) {
|
||||||
{
|
ndpi_set_detected_protocol(ndpi_struct, flow,
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BJNP, NDPI_PROTOCOL_UNKNOWN);
|
NDPI_PROTOCOL_BJNP, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -23,22 +24,21 @@ static void ndpi_check_bjnp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
|| (memcmp((const char *)packet->payload, "BJNB", 4) == 0)
|
|| (memcmp((const char *)packet->payload, "BJNB", 4) == 0)
|
||||||
|| (memcmp((const char *)packet->payload, "MFNP", 4) == 0)
|
|| (memcmp((const char *)packet->payload, "MFNP", 4) == 0)
|
||||||
) {
|
) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BJNP, ndpi_struct, NDPI_LOG_DEBUG, "Found bjnp.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found bjnp\n");
|
||||||
ndpi_int_bjnp_add_connection(ndpi_struct, flow, 0);
|
ndpi_int_bjnp_add_connection(ndpi_struct, flow, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BJNP, ndpi_struct, NDPI_LOG_DEBUG, "exclude bjnp.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BJNP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_bjnp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_bjnp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_BJNP, ndpi_struct, NDPI_LOG_DEBUG, "bjnp detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search bjnp\n");
|
||||||
|
|
||||||
/* skip marked packets */
|
/* skip marked packets */
|
||||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_BJNP) {
|
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_BJNP) {
|
||||||
@@ -59,7 +59,3 @@ void init_bjnp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* btlib.c
|
* btlib.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
* Contributed by Vitaly Lavrov <vel21ripn@gmail.com>
|
* Contributed by Vitaly Lavrov <vel21ripn@gmail.com>
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
@@ -22,6 +22,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifndef NDPI_NO_STD_INC
|
#ifndef NDPI_NO_STD_INC
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -29,17 +31,17 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
|
||||||
|
/*
|
||||||
typedef unsigned char u_int8_t;
|
typedef unsigned char u_int8_t;
|
||||||
typedef unsigned short int u_int16_t;
|
typedef unsigned short int u_int16_t;
|
||||||
typedef unsigned long long int u_int64_t;
|
typedef unsigned long long int u_int64_t;
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef signed long long int i_int64_t;
|
|
||||||
|
|
||||||
#include "btlib.h"
|
#include "btlib.h"
|
||||||
|
|
||||||
int bt_parse_debug = 0;
|
int bt_parse_debug = 0;
|
||||||
@@ -90,6 +92,7 @@ static char *print_id_ip6_p(char *s,const struct bt_nodes6_data *b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
void dump_bt_proto_struct(struct bt_parse_protocol *p) {
|
void dump_bt_proto_struct(struct bt_parse_protocol *p) {
|
||||||
char b20h[128];
|
char b20h[128];
|
||||||
int i;
|
int i;
|
||||||
@@ -155,7 +158,9 @@ void dump_bt_proto_struct(struct bt_parse_protocol *p) {
|
|||||||
if(p->interval) printf("\tinterval\t%d\n",p->interval);
|
if(p->interval) printf("\tinterval\t%d\n",p->interval);
|
||||||
if(p->min_interval) printf("\tmin interval\t%d\n",p->min_interval);
|
if(p->min_interval) printf("\tmin interval\t%d\n",p->min_interval);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BTLIB_DEBUG
|
||||||
static void _print_safe_str(char *msg,char *k,const u_int8_t *s,size_t l) {
|
static void _print_safe_str(char *msg,char *k,const u_int8_t *s,size_t l) {
|
||||||
static const char *th="0123456789abcdef?";
|
static const char *th="0123456789abcdef?";
|
||||||
char *buf = (char*)ndpi_malloc((size_t)(l*3+2));
|
char *buf = (char*)ndpi_malloc((size_t)(l*3+2));
|
||||||
@@ -181,8 +186,13 @@ static void _print_safe_str(char *msg,char *k,const u_int8_t *s,size_t l) {
|
|||||||
static void print_safe_str(char *msg,bt_parse_data_cb_t *cbd) {
|
static void print_safe_str(char *msg,bt_parse_data_cb_t *cbd) {
|
||||||
_print_safe_str(msg,cbd->buf,cbd->v.s.s,cbd->v.s.l);
|
_print_safe_str(msg,cbd->buf,cbd->v.s.s,cbd->v.s.l);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEBUG_TRACE(cmd) { if(bt_parse_debug) cmd; }
|
#define DEBUG_TRACE(cmd) { if(bt_parse_debug) cmd; }
|
||||||
|
|
||||||
|
#else
|
||||||
|
#define DEBUG_TRACE(cmd) ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define STREQ(a,b) !strcmp(a,b)
|
#define STREQ(a,b) !strcmp(a,b)
|
||||||
|
|
||||||
|
|
||||||
@@ -408,8 +418,8 @@ void cb_data(bt_parse_data_cb_t *cbd,int *ret) {
|
|||||||
const u_int8_t *bt_decode(const u_int8_t *b, size_t *l, int *ret, bt_parse_data_cb_t *cbd) {
|
const u_int8_t *bt_decode(const u_int8_t *b, size_t *l, int *ret, bt_parse_data_cb_t *cbd) {
|
||||||
|
|
||||||
unsigned int n=0,neg=0;
|
unsigned int n=0,neg=0;
|
||||||
i_int64_t d = 0;
|
int64_t d = 0;
|
||||||
register u_int8_t c;
|
u_int8_t c;
|
||||||
|
|
||||||
if(*l == 0) return NULL;
|
if(*l == 0) return NULL;
|
||||||
if(cbd->level > BDEC_MAXDEPT) goto bad_data;
|
if(cbd->level > BDEC_MAXDEPT) goto bad_data;
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ typedef struct bt_parse_data_cb {
|
|||||||
int level;
|
int level;
|
||||||
int t;
|
int t;
|
||||||
union {
|
union {
|
||||||
i_int64_t i;
|
int64_t i;
|
||||||
b_elem_s_t s;
|
b_elem_s_t s;
|
||||||
} v;
|
} v;
|
||||||
} bt_parse_data_cb_t;
|
} bt_parse_data_cb_t;
|
||||||
|
|||||||
Executable → Regular
+5
-6
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* checkmk.c
|
* checkmk.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-17 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,10 +21,12 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CHECKMK
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_CHECKMK
|
|
||||||
|
|
||||||
static void ndpi_int_checkmk_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_checkmk_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow)
|
||||||
@@ -78,6 +80,3 @@ void init_checkmk_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -4,9 +4,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CISCOVPN
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
#ifdef NDPI_PROTOCOL_CISCOVPN
|
|
||||||
|
|
||||||
static void ndpi_int_ciscovpn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_ciscovpn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
@@ -20,15 +23,15 @@ void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
u_int16_t tdport = 0, tsport = 0;
|
u_int16_t tdport = 0, tsport = 0;
|
||||||
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "search CISCOVPN.\n");
|
NDPI_LOG_DBG(ndpi_struct, "search CISCOVPN\n");
|
||||||
|
|
||||||
if(packet->tcp != NULL) {
|
if(packet->tcp != NULL) {
|
||||||
tsport = ntohs(packet->tcp->source), tdport = ntohs(packet->tcp->dest);
|
tsport = ntohs(packet->tcp->source), tdport = ntohs(packet->tcp->dest);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "calculated CISCOVPN over tcp ports.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "calculated CISCOVPN over tcp ports\n");
|
||||||
}
|
}
|
||||||
if(packet->udp != NULL) {
|
if(packet->udp != NULL) {
|
||||||
usport = ntohs(packet->udp->source), udport = ntohs(packet->udp->dest);
|
usport = ntohs(packet->udp->source), udport = ntohs(packet->udp->dest);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "calculated CISCOVPN over udp ports.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "calculated CISCOVPN over udp ports\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if((tdport == 10000 && tsport == 10000) ||
|
if((tdport == 10000 && tsport == 10000) ||
|
||||||
@@ -42,8 +45,9 @@ void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
|
|
||||||
{
|
{
|
||||||
/* This is a good query 17010000*/
|
/* This is a good query 17010000*/
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "found CISCOVPN.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found CISCOVPN\n");
|
||||||
ndpi_int_ciscovpn_add_connection(ndpi_struct, flow);
|
ndpi_int_ciscovpn_add_connection(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if(
|
else if(
|
||||||
(
|
(
|
||||||
@@ -59,11 +63,10 @@ void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
|
|
||||||
|
|
||||||
/* This is a good query fe577e2b */
|
/* This is a good query fe577e2b */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "found CISCOVPN.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found CISCOVPN\n");
|
||||||
ndpi_int_ciscovpn_add_connection(ndpi_struct, flow);
|
ndpi_int_ciscovpn_add_connection(ndpi_struct, flow);
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "exclude CISCOVPN.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CISCOVPN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -79,5 +82,3 @@ void init_ciscovpn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+11
-12
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* citrix.c
|
* citrix.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-15 - ntop.org
|
* Copyright (C) 2012-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,10 +21,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CITRIX
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_CITRIX
|
|
||||||
|
|
||||||
/* ************************************ */
|
/* ************************************ */
|
||||||
|
|
||||||
@@ -45,26 +47,25 @@ static void ndpi_check_citrix(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
char citrix_header[] = { 0x07, 0x07, 0x49, 0x43, 0x41, 0x00 };
|
char citrix_header[] = { 0x07, 0x07, 0x49, 0x43, 0x41, 0x00 };
|
||||||
|
|
||||||
if(memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0) {
|
if(memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found citrix\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if(payload_len > 4) {
|
} else if(payload_len > 4) {
|
||||||
char citrix_header[] = { 0x1a, 0x43, 0x47, 0x50, 0x2f, 0x30, 0x31 };
|
char citrix_header[] = { 0x1a, 0x43, 0x47, 0x50, 0x2f, 0x30, 0x31 };
|
||||||
|
|
||||||
if((memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0)
|
if((memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0)
|
||||||
|| (ndpi_strnstr((const char *)packet->payload, "Citrix.TcpProxyService", payload_len) != NULL)) {
|
|| (ndpi_strnstr((const char *)packet->payload, "Citrix.TcpProxyService", payload_len) != NULL)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found citrix\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CITRIX);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
} else if(flow->l4.tcp.citrix_packet_id > 3)
|
} else if(flow->l4.tcp.citrix_packet_id > 3) {
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CITRIX);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -74,7 +75,7 @@ void ndpi_search_citrix(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "citrix detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search citrix\n");
|
||||||
|
|
||||||
/* skip marked packets */
|
/* skip marked packets */
|
||||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_CITRIX)
|
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_CITRIX)
|
||||||
@@ -92,5 +93,3 @@ void init_citrix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+10
-12
@@ -21,9 +21,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_COAP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
#ifdef NDPI_PROTOCOL_COAP
|
|
||||||
|
|
||||||
#define CON 0
|
#define CON 0
|
||||||
#define NO_CON 1
|
#define NO_CON 1
|
||||||
@@ -116,14 +119,12 @@ void ndpi_search_coap (struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
u_int16_t d_port = ntohs(flow->packet.udp->dest);
|
u_int16_t d_port = ntohs(flow->packet.udp->dest);
|
||||||
|
|
||||||
if((!isCoAPport(s_port) && !isCoAPport(d_port))
|
if((!isCoAPport(s_port) && !isCoAPport(d_port))
|
||||||
|| (packet->payload_packet_len < 4) // header too short
|
|| (packet->payload_packet_len < 4) ) { // header too short
|
||||||
) {
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_COAP, ndpi_struct, NDPI_LOG_DEBUG, "excluding Coap\n");
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_COAP);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_COAP, ndpi_struct, NDPI_LOG_DEBUG, "calculating coap over udp.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "calculating coap over udp\n");
|
||||||
|
|
||||||
// check values in header
|
// check values in header
|
||||||
if(h->version == 1) {
|
if(h->version == 1) {
|
||||||
@@ -133,7 +134,7 @@ void ndpi_search_coap (struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
(h->code >= 128 && h->code <= 134) || (h->code >= 140 && h->code <= 143) ||
|
(h->code >= 128 && h->code <= 134) || (h->code >= 140 && h->code <= 143) ||
|
||||||
(h->code >= 160 && h->code <= 165)) {
|
(h->code >= 160 && h->code <= 165)) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_COAP, ndpi_struct, NDPI_LOG_DEBUG, "Coap found...\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Coap\n");
|
||||||
ndpi_int_coap_add_connection(ndpi_struct,flow);
|
ndpi_int_coap_add_connection(ndpi_struct,flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -142,8 +143,7 @@ void ndpi_search_coap (struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_COAP, ndpi_struct, NDPI_LOG_DEBUG, "Excluding Coap ...\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_COAP);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,5 +161,3 @@ void init_coap_dissector (struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
*id +=1;
|
*id +=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // NDPI_PROTOCOL_COAP
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* collectd.c
|
* collectd.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014 - ntop.org
|
* Copyright (C) 2014-18 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -19,16 +19,19 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_COLLECTD
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_COLLECTD
|
|
||||||
|
|
||||||
void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int len = 0;
|
u_int len = 0;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "search collectd.\n");
|
NDPI_LOG_DBG(ndpi_struct, "search collectd\n");
|
||||||
|
|
||||||
if (packet->udp == NULL) return;
|
if (packet->udp == NULL) return;
|
||||||
|
|
||||||
@@ -43,12 +46,9 @@ void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(len == packet->payload_packet_len) {
|
if(len == packet->payload_packet_len) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "found COLLECTD.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found COLLECTD\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD, NDPI_PROTOCOL_UNKNOWN);
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "exclude COLLECTD.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_COLLECTD);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -18,10 +18,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CORBA
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_CORBA
|
|
||||||
static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct
|
static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
@@ -31,18 +33,17 @@ void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "search for CORBA.\n");
|
NDPI_LOG_DBG(ndpi_struct, "search for CORBA\n");
|
||||||
if(packet->tcp != NULL) {
|
if(packet->tcp != NULL) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "calculating CORBA over tcp.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "calculating CORBA over tcp\n");
|
||||||
/* Corba General Inter-ORB Protocol -> GIOP */
|
/* Corba General Inter-ORB Protocol -> GIOP */
|
||||||
if ((packet->payload_packet_len >= 24 && packet->payload_packet_len <= 144) &&
|
if ((packet->payload_packet_len >= 24 && packet->payload_packet_len <= 144) &&
|
||||||
memcmp(packet->payload, "GIOP", 4) == 0) {
|
memcmp(packet->payload, "GIOP", 4) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "found corba.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found corba\n");
|
||||||
ndpi_int_corba_add_connection(ndpi_struct, flow);
|
ndpi_int_corba_add_connection(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "exclude CORBA.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CORBA);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,4 +58,3 @@ void init_corba_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* crossfire.c
|
* crossfire.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-15 - ntop.org
|
* Copyright (C) 2012-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,10 +21,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
/* include files */
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CROSSFIRE
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
#ifdef NDPI_PROTOCOL_CROSSFIRE
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_crossfire_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_crossfire_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
@@ -38,18 +39,14 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search crossfire\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "search crossfire.\n");
|
|
||||||
|
|
||||||
|
|
||||||
if (packet->udp != 0) {
|
if (packet->udp != 0) {
|
||||||
if (packet->payload_packet_len == 25 && get_u_int32_t(packet->payload, 0) == ntohl(0xc7d91999)
|
if (packet->payload_packet_len == 25
|
||||||
|
&& get_u_int32_t(packet->payload, 0) == ntohl(0xc7d91999)
|
||||||
&& get_u_int16_t(packet->payload, 4) == ntohs(0x0200)
|
&& get_u_int16_t(packet->payload, 4) == ntohs(0x0200)
|
||||||
&& get_u_int16_t(packet->payload, 22) == ntohs(0x7d00)
|
&& get_u_int16_t(packet->payload, 22) == ntohs(0x7d00)) {
|
||||||
) {
|
NDPI_LOG_INFO(ndpi_struct, "found Crossfire: udp packet\n");
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "Crossfire: found udp packet.\n");
|
|
||||||
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -67,7 +64,7 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
&& (memcmp(packet->host_line.ptr, "crossfire", 9) == 0
|
&& (memcmp(packet->host_line.ptr, "crossfire", 9) == 0
|
||||||
|| memcmp(packet->host_line.ptr, "www.crossfire", 13) == 0))
|
|| memcmp(packet->host_line.ptr, "www.crossfire", 13) == 0))
|
||||||
) {
|
) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "Crossfire: found HTTP request.\n");
|
NDPI_LOG_DBG(ndpi_struct, "found Crossfire: HTTP request\n");
|
||||||
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -75,8 +72,7 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "exclude crossfire.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CROSSFIRE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -90,5 +86,3 @@ void init_crossfire_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+16
-18
@@ -20,49 +20,49 @@
|
|||||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CSGO
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_CSGO
|
|
||||||
|
|
||||||
void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct ndpi_flow_struct* flow) {
|
void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct ndpi_flow_struct* flow) {
|
||||||
struct ndpi_packet_struct* packet = &flow->packet;
|
struct ndpi_packet_struct* packet = &flow->packet;
|
||||||
|
|
||||||
if (packet->udp != NULL) {
|
if (packet->udp != NULL) {
|
||||||
uint32_t w = htonl(get_u_int32_t(packet->payload, 0));
|
uint32_t w = htonl(get_u_int32_t(packet->payload, 0));
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "CSGO: word %08x\n", w);
|
NDPI_LOG_DBG2(ndpi_struct, "CSGO: word %08x\n", w);
|
||||||
|
|
||||||
if (!flow->csgo_state && packet->payload_packet_len == 23 && w == 0xfffffffful) {
|
if (!flow->csgo_state && packet->payload_packet_len == 23 && w == 0xfffffffful) {
|
||||||
if (!memcmp(packet->payload + 5, "connect0x", 9)) {
|
if (!memcmp(packet->payload + 5, "connect0x", 9)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo connect0x.\n");
|
|
||||||
flow->csgo_state++;
|
flow->csgo_state++;
|
||||||
memcpy(flow->csgo_strid, packet->payload + 5, 18);
|
memcpy(flow->csgo_strid, packet->payload + 5, 18);
|
||||||
|
NDPI_LOG_DBG2(ndpi_struct, "Found csgo connect0x\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flow->csgo_state == 1 && packet->payload_packet_len >= 42 && w == 0xfffffffful) {
|
if (flow->csgo_state == 1 && packet->payload_packet_len >= 42 && w == 0xfffffffful) {
|
||||||
if (!memcmp(packet->payload + 24, flow->csgo_strid, 18)) {
|
if (!memcmp(packet->payload + 24, flow->csgo_strid, 18)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo connect0x reply.\n");
|
|
||||||
flow->csgo_state++;
|
flow->csgo_state++;
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
NDPI_LOG_INFO( ndpi_struct, "found csgo connect0x reply\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 8 && ( w == 0x3a180000 || w == 0x39180000) ) {
|
if (packet->payload_packet_len == 8 && ( w == 0x3a180000 || w == 0x39180000) ) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo udp 8b.\n");
|
NDPI_LOG_INFO( ndpi_struct, "found csgo udp 8b\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len >= 36 && w == 0x56533031ul) {
|
if (packet->payload_packet_len >= 36 && w == 0x56533031ul) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo udp.\n");
|
NDPI_LOG_INFO( ndpi_struct, "found csgo udp\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len >= 36 && w == 0x01007364) {
|
if (packet->payload_packet_len >= 36 && w == 0x01007364) {
|
||||||
uint32_t w2 = htonl(get_u_int32_t(packet->payload, 4));
|
uint32_t w2 = htonl(get_u_int32_t(packet->payload, 4));
|
||||||
if (w2 == 0x70696e67) {
|
if (w2 == 0x70696e67) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo udp ping.\n");
|
NDPI_LOG_INFO( ndpi_struct, "found csgo udp ping\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -73,11 +73,11 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
|||||||
if (!flow->csgo_s2) {
|
if (!flow->csgo_s2) {
|
||||||
flow->csgo_id2 = w2;
|
flow->csgo_id2 = w2;
|
||||||
flow->csgo_s2 = 1;
|
flow->csgo_s2 = 1;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo udp 0d1d step1.\n");
|
NDPI_LOG_DBG2( ndpi_struct, "Found csgo udp 0d1d step1\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->csgo_s2 == 1 && flow->csgo_id2 == w2) {
|
if (flow->csgo_s2 == 1 && flow->csgo_id2 == w2) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo udp 0d1d step1 DUP.\n");
|
NDPI_LOG_DBG2( ndpi_struct, "Found csgo udp 0d1d step1 DUP\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
flow->csgo_s2 = 3;
|
flow->csgo_s2 = 3;
|
||||||
@@ -85,7 +85,7 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
|||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 15) {
|
if (packet->payload_packet_len == 15) {
|
||||||
if (flow->csgo_s2 == 1 && flow->csgo_id2 == w2) {
|
if (flow->csgo_s2 == 1 && flow->csgo_id2 == w2) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo udp 0d1d.\n");
|
NDPI_LOG_INFO( ndpi_struct, "found csgo udp 0d1d\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -94,23 +94,23 @@ void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct n
|
|||||||
}
|
}
|
||||||
if (packet->payload_packet_len >= 140 && (w == 0x02124c6c || w == 0x02125c6c) &&
|
if (packet->payload_packet_len >= 140 && (w == 0x02124c6c || w == 0x02125c6c) &&
|
||||||
!memcmp(&packet->payload[3], "lta\000mob\000tpc\000bhj\000bxd\000tae\000urg\000gkh\000", 32)) {
|
!memcmp(&packet->payload[3], "lta\000mob\000tpc\000bhj\000bxd\000tae\000urg\000gkh\000", 32)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo dictionary udp.\n");
|
NDPI_LOG_INFO( ndpi_struct, "found csgo dictionary udp\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len >= 33 && packet->iph && packet->iph->daddr == 0xffffffff &&
|
if (packet->payload_packet_len >= 33 && packet->iph && packet->iph->daddr == 0xffffffff &&
|
||||||
!memcmp(&packet->payload[17], "LanSearch", 9)) {
|
!memcmp(&packet->payload[17], "LanSearch", 9)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_CSGO, ndpi_struct, NDPI_LOG_DEBUG, "Found csgo LanSearch udp.\n");
|
NDPI_LOG_INFO( ndpi_struct, "found csgo LanSearch udp\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flow->packet_counter > 20)
|
if (flow->packet_counter > 20)
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CSGO);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_csgo_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
void init_csgo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
{
|
||||||
ndpi_set_bitmask_protocol_detection("CSGO", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("CSGO", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_CSGO,
|
NDPI_PROTOCOL_CSGO,
|
||||||
ndpi_search_csgo,
|
ndpi_search_csgo,
|
||||||
@@ -120,5 +120,3 @@ void init_csgo_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dcerpc.c
|
* dcerpc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-13 by ntop.org
|
* Copyright (C) 2011-18 by ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,10 +21,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DCERPC
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_DCERPC
|
|
||||||
|
|
||||||
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
|
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -36,20 +38,21 @@ void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search DCERPC\n");
|
||||||
|
|
||||||
if((packet->tcp != NULL)
|
if((packet->tcp != NULL)
|
||||||
&& (packet->payload_packet_len >= 64)
|
&& (packet->payload_packet_len >= 64)
|
||||||
&& (packet->payload[0] == 0x05) /* version 5 */
|
&& (packet->payload[0] == 0x05) /* version 5 */
|
||||||
&& (packet->payload[2] < 16) /* Packet type */
|
&& (packet->payload[2] < 16) /* Packet type */
|
||||||
&& (((packet->payload[9]<<8) | packet->payload[8]) == packet->payload_packet_len) /* Packet Length */
|
&& (((packet->payload[9]<<8) | packet->payload[8]) == packet->payload_packet_len) /* Packet Length */
|
||||||
) {
|
) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DCERPC, ndpi_struct, NDPI_LOG_DEBUG, "DCERPC match\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DCERPC\n");
|
||||||
ndpi_int_dcerpc_add_connection(ndpi_struct, flow);
|
ndpi_int_dcerpc_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(packet->payload_packet_len>1){
|
if(packet->payload_packet_len>1)
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DCERPC);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -64,4 +67,3 @@ void init_dcerpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+30
-21
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dhcp.c
|
* dhcp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 - ntop.org
|
* Copyright (C) 2016-18 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -18,10 +18,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DHCP
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_DHCP
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
/* freeradius/src/lib/dhcp.c */
|
/* freeradius/src/lib/dhcp.c */
|
||||||
#define DHCP_CHADDR_LEN 16
|
#define DHCP_CHADDR_LEN 16
|
||||||
@@ -61,8 +62,7 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search DHCP\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
/* this detection also works for asymmetric dhcp traffic */
|
/* this detection also works for asymmetric dhcp traffic */
|
||||||
|
|
||||||
@@ -70,24 +70,29 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
if(packet->udp) {
|
if(packet->udp) {
|
||||||
dhcp_packet_t *dhcp = (dhcp_packet_t*)packet->payload;
|
dhcp_packet_t *dhcp = (dhcp_packet_t*)packet->payload;
|
||||||
|
|
||||||
if((packet->payload_packet_len >= 244)
|
if((packet->payload_packet_len >= 244 /* 244 is the offset of options[0] in dhcp_packet_t */)
|
||||||
&& (packet->udp->source == htons(67) || packet->udp->source == htons(68))
|
&& (packet->udp->source == htons(67) || packet->udp->source == htons(68))
|
||||||
&& (packet->udp->dest == htons(67) || packet->udp->dest == htons(68))
|
&& (packet->udp->dest == htons(67) || packet->udp->dest == htons(68))
|
||||||
&& (dhcp->magic == htonl(DHCP_OPTION_MAGIC_NUMBER))) {
|
&& (dhcp->magic == htonl(DHCP_OPTION_MAGIC_NUMBER))) {
|
||||||
int i = 0, foundValidMsgType = 0;
|
u_int i = 0, foundValidMsgType = 0;
|
||||||
|
|
||||||
while(i < DHCP_VEND_LEN) {
|
u_int dhcp_options_size = ndpi_min(DHCP_VEND_LEN /* maximum size of options in dhcp_packet_t */,
|
||||||
|
packet->payload_packet_len - 244);
|
||||||
|
|
||||||
|
while(i + 1 /* for the len */ < dhcp_options_size) {
|
||||||
u_int8_t id = dhcp->options[i];
|
u_int8_t id = dhcp->options[i];
|
||||||
|
|
||||||
if(id == 0xFF)
|
if(id == 0xFF)
|
||||||
break;
|
break;
|
||||||
else {
|
else {
|
||||||
u_int8_t len = dhcp->options[i+1];
|
/* Prevent malformed packets to cause out-of-bounds accesses */
|
||||||
|
u_int8_t len = ndpi_min(dhcp->options[i+1] /* len as found in the packet */,
|
||||||
|
dhcp_options_size - (i+2) /* 1 for the type and 1 for the value */);
|
||||||
|
|
||||||
if(len == 0) break;
|
if(len == 0) break;
|
||||||
|
|
||||||
#ifdef DHCP_DEBUG
|
#ifdef DHCP_DEBUG
|
||||||
printf("[DHCP] Id=%d [len=%d]\n", id, len);
|
NDPI_LOG_DBG2(ndpi_struct, "[DHCP] Id=%d [len=%d]\n", id, len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(id == 53 /* DHCP Message Type */) {
|
if(id == 53 /* DHCP Message Type */) {
|
||||||
@@ -95,35 +100,41 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
|
|
||||||
if(msg_type <= 8) foundValidMsgType = 1;
|
if(msg_type <= 8) foundValidMsgType = 1;
|
||||||
} else if(id == 55 /* Parameter Request List / Fingerprint */) {
|
} else if(id == 55 /* Parameter Request List / Fingerprint */) {
|
||||||
u_int idx, offset = 0,
|
if(!ndpi_struct->disable_metadata_export) {
|
||||||
hex_len = ndpi_min(len * 2, sizeof(flow->protos.dhcp.fingerprint));
|
u_int idx, offset = 0;
|
||||||
|
|
||||||
for(idx=0; idx<len; idx++) {
|
for(idx = 0; idx < len && offset < sizeof(flow->protos.dhcp.fingerprint) - 2; idx++) {
|
||||||
snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
||||||
sizeof(flow->protos.dhcp.fingerprint)-offset-1,
|
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
||||||
"%02X", dhcp->options[i+2+idx] & 0xFF);
|
"%02X", dhcp->options[i+2+idx] & 0xFF);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flow->protos.dhcp.fingerprint[sizeof(flow->protos.dhcp.fingerprint) - 1] = '\0';
|
||||||
|
}
|
||||||
} else if(id == 60 /* Class Identifier */) {
|
} else if(id == 60 /* Class Identifier */) {
|
||||||
|
if(!ndpi_struct->disable_metadata_export) {
|
||||||
char *name = (char*)&dhcp->options[i+2];
|
char *name = (char*)&dhcp->options[i+2];
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
j = ndpi_min(len, sizeof(flow->protos.dhcp.class_ident)-1);
|
j = ndpi_min(len, sizeof(flow->protos.dhcp.class_ident)-1);
|
||||||
strncpy((char*)flow->protos.dhcp.class_ident, name, j);
|
strncpy((char*)flow->protos.dhcp.class_ident, name, j);
|
||||||
flow->protos.dhcp.class_ident[j] = '\0';
|
flow->protos.dhcp.class_ident[j] = '\0';
|
||||||
|
}
|
||||||
} else if(id == 12 /* Host Name */) {
|
} else if(id == 12 /* Host Name */) {
|
||||||
|
if(!ndpi_struct->disable_metadata_export) {
|
||||||
char *name = (char*)&dhcp->options[i+2];
|
char *name = (char*)&dhcp->options[i+2];
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
#ifdef DHCP_DEBUG
|
#ifdef DHCP_DEBUG
|
||||||
printf("[DHCP] ");
|
NDPI_LOG_DBG2(ndpi_struct, "[DHCP] '%.*s'\n",name,len);
|
||||||
while(j < len) { printf("%c", name[j]); j++; }
|
// while(j < len) { printf( "%c", name[j]); j++; }; printf("\n");
|
||||||
printf("\n");
|
|
||||||
#endif
|
#endif
|
||||||
j = ndpi_min(len, sizeof(flow->host_server_name)-1);
|
j = ndpi_min(len, sizeof(flow->host_server_name)-1);
|
||||||
strncpy((char*)flow->host_server_name, name, j);
|
strncpy((char*)flow->host_server_name, name, j);
|
||||||
flow->host_server_name[j] = '\0';
|
flow->host_server_name[j] = '\0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
i += len + 2;
|
i += len + 2;
|
||||||
}
|
}
|
||||||
@@ -132,14 +143,14 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
//get_u_int16_t(packet->payload, 240) == htons(0x3501)) {
|
//get_u_int16_t(packet->payload, 240) == htons(0x3501)) {
|
||||||
|
|
||||||
if(foundValidMsgType) {
|
if(foundValidMsgType) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DHCP, ndpi_struct, NDPI_LOG_DEBUG, "DHCP found\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DHCP\n");
|
||||||
ndpi_int_dhcp_add_connection(ndpi_struct, flow);
|
ndpi_int_dhcp_add_connection(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCP);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -153,5 +164,3 @@ void init_dhcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* dhcpv6.c
|
* dhcpv6.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,12 +22,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DHCPV6
|
||||||
|
|
||||||
/* include files */
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
#ifdef NDPI_PROTOCOL_DHCPV6
|
|
||||||
|
|
||||||
static void ndpi_int_dhcpv6_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_dhcpv6_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow)
|
||||||
@@ -40,21 +40,19 @@ void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search DHCPv6\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
if (packet->payload_packet_len >= 4 &&
|
if (packet->payload_packet_len >= 4 &&
|
||||||
(packet->udp->source == htons(546) || packet->udp->source == htons(547)) &&
|
(packet->udp->source == htons(546) || packet->udp->source == htons(547)) &&
|
||||||
(packet->udp->dest == htons(546) || packet->udp->dest == htons(547)) &&
|
(packet->udp->dest == htons(546) || packet->udp->dest == htons(547)) &&
|
||||||
packet->payload[0] >= 1 && packet->payload[0] <= 13) {
|
packet->payload[0] >= 1 && packet->payload[0] <= 13) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DHCPV6, ndpi_struct, NDPI_LOG_DEBUG, "DHCPv6 detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DHCPv6\n");
|
||||||
ndpi_int_dhcpv6_add_connection(ndpi_struct, flow);
|
ndpi_int_dhcpv6_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DHCPV6, ndpi_struct, NDPI_LOG_DEBUG, "DHCPv6 excluded.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCPV6);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -68,5 +66,3 @@ void init_dhcpv6_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -0,0 +1,129 @@
|
|||||||
|
/*
|
||||||
|
* diameter.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 - 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/>.
|
||||||
|
*
|
||||||
|
* Based on code of:
|
||||||
|
* Michele Campus - <campus@ntop.org>
|
||||||
|
*/
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DIAMETER
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
|
// Header Flags possibile values
|
||||||
|
#define DIAMETER_REQUEST 0X80
|
||||||
|
#define DIAMETER_PROXYABLE 0X40
|
||||||
|
#define DIAMETER_ERROR 0X20
|
||||||
|
#define DIAMETER_RETRASM 0X10
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
AC = 271,
|
||||||
|
AS = 274,
|
||||||
|
CC = 272,
|
||||||
|
CE = 257,
|
||||||
|
DW = 280,
|
||||||
|
DP = 282,
|
||||||
|
RA = 258,
|
||||||
|
ST = 275
|
||||||
|
} com_type_t;
|
||||||
|
|
||||||
|
#define DIAM_HEADER_LEN 20
|
||||||
|
|
||||||
|
// DIAMETER header
|
||||||
|
struct diameter_header_t
|
||||||
|
{
|
||||||
|
u_int8_t version;
|
||||||
|
u_int8_t length[3];
|
||||||
|
u_int8_t flags;
|
||||||
|
u_int8_t com_code[3];
|
||||||
|
u_int32_t app_id;
|
||||||
|
u_int32_t hop_id;
|
||||||
|
u_int32_t end_id;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Check packet
|
||||||
|
int is_diameter(struct ndpi_packet_struct *packet, int size_payload)
|
||||||
|
{
|
||||||
|
// check param
|
||||||
|
if(!packet || size_payload == 0) return -1;
|
||||||
|
|
||||||
|
// cast to diameter header
|
||||||
|
struct diameter_header_t *diameter = (struct diameter_header_t *) packet;
|
||||||
|
|
||||||
|
// check if the packet is diameter
|
||||||
|
if(diameter->version == 0x01 &&
|
||||||
|
(diameter->flags == DIAMETER_REQUEST ||
|
||||||
|
diameter->flags == DIAMETER_PROXYABLE ||
|
||||||
|
diameter->flags == DIAMETER_ERROR ||
|
||||||
|
diameter->flags == DIAMETER_RETRASM)) {
|
||||||
|
|
||||||
|
u_int16_t com_code = diameter->com_code[2] + (diameter->com_code[1] << 8) + (diameter->com_code[0] << 8);
|
||||||
|
|
||||||
|
if(com_code == AC || com_code == AS ||
|
||||||
|
com_code == CC || com_code == CE ||
|
||||||
|
com_code == DW || com_code == DP ||
|
||||||
|
com_code == RA || com_code == ST)
|
||||||
|
return 0; // OK
|
||||||
|
}
|
||||||
|
// wrong packet
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ndpi_search_diameter(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow)
|
||||||
|
{
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
// Diameter is on TCP
|
||||||
|
if(packet->tcp) {
|
||||||
|
|
||||||
|
/* Check if it's diameter */
|
||||||
|
int ret = is_diameter(packet, packet->payload_packet_len);
|
||||||
|
if(ret != 0) {
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found Diameter\n");
|
||||||
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIAMETER, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else { // UDP
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void init_diameter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
||||||
|
NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
|
{
|
||||||
|
ndpi_set_bitmask_protocol_detection("Diameter", ndpi_struct, detection_bitmask, *id,
|
||||||
|
NDPI_PROTOCOL_DIAMETER, ndpi_search_diameter,
|
||||||
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD,
|
||||||
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK);
|
||||||
|
|
||||||
|
*id += 1;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
* directconnect.c
|
* directconnect.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,8 +23,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
#ifdef NDPI_PROTOCOL_DIRECTCONNECT
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DIRECTCONNECT
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
//#define NDPI_DEBUG_DIRECTCONNECT
|
//#define NDPI_DEBUG_DIRECTCONNECT
|
||||||
//#define NDPI_DIRECTCONNECT_PORT_DEBUG
|
//#define NDPI_DIRECTCONNECT_PORT_DEBUG
|
||||||
@@ -58,9 +62,7 @@ static u_int16_t parse_binf_message(struct ndpi_detection_module_struct
|
|||||||
if (memcmp(&payload[i], "DCTM", 4) == 0) {
|
if (memcmp(&payload[i], "DCTM", 4) == 0) {
|
||||||
if (memcmp(&payload[i + 15], "ADCS", 4) == 0) {
|
if (memcmp(&payload[i + 15], "ADCS", 4) == 0) {
|
||||||
ssl_port = ntohs_ndpi_bytestream_to_number(&payload[i + 25], 5, &bytes_read);
|
ssl_port = ntohs_ndpi_bytestream_to_number(&payload[i + 25], 5, &bytes_read);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "DC ssl port parsed %d\n", ssl_port);
|
||||||
NDPI_LOG_DEBUG, "directconnect ssl port parsed %d", ssl_port);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -77,7 +79,6 @@ static void ndpi_int_directconnect_add_connection(struct ndpi_detection_module_s
|
|||||||
{
|
{
|
||||||
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
struct ndpi_id_struct *src = flow->src;
|
struct ndpi_id_struct *src = flow->src;
|
||||||
struct ndpi_id_struct *dst = flow->dst;
|
struct ndpi_id_struct *dst = flow->dst;
|
||||||
|
|
||||||
@@ -89,13 +90,11 @@ static void ndpi_int_directconnect_add_connection(struct ndpi_detection_module_s
|
|||||||
if (packet->tcp != NULL
|
if (packet->tcp != NULL
|
||||||
&& flow->setup_packet_direction != packet->packet_direction && src->detected_directconnect_port == 0) {
|
&& flow->setup_packet_direction != packet->packet_direction && src->detected_directconnect_port == 0) {
|
||||||
src->detected_directconnect_port = packet->tcp->source;
|
src->detected_directconnect_port = packet->tcp->source;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "DC tcp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
||||||
NDPI_LOG_DEBUG, "directconnect tcp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
|
||||||
}
|
}
|
||||||
if (packet->udp != NULL && src->detected_directconnect_udp_port == 0) {
|
if (packet->udp != NULL && src->detected_directconnect_udp_port == 0) {
|
||||||
src->detected_directconnect_udp_port = packet->udp->source;
|
src->detected_directconnect_udp_port = packet->udp->source;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "DC udp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
||||||
NDPI_LOG_DEBUG, "directconnect udp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,8 +112,8 @@ static void ndpi_int_directconnect_add_connection(struct ndpi_detection_module_s
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
dst->detected_directconnect_port = packet->tcp->dest;
|
dst->detected_directconnect_port = packet->tcp->dest;
|
||||||
NDPI_LOG (NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
NDPI_LOG_DEBUG, "directconnect tcp PORT %u for dst\n",
|
"DC tcp PORT %u for dst\n",
|
||||||
ntohs (dst->detected_directconnect_port));
|
ntohs (dst->detected_directconnect_port));
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
@@ -148,14 +147,12 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
if (dst != NULL) {
|
if (dst != NULL) {
|
||||||
dst->detected_directconnect_ssl_port =
|
dst->detected_directconnect_ssl_port =
|
||||||
ntohs_ndpi_bytestream_to_number(&packet->payload[25], 5, &bytes_read);
|
ntohs_ndpi_bytestream_to_number(&packet->payload[25], 5, &bytes_read);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "DC ssl port parsed %d\n", ntohs(dst->detected_directconnect_ssl_port));
|
||||||
NDPI_LOG_DEBUG, "directconnect ssl port parsed %d", ntohs(dst->detected_directconnect_ssl_port));
|
|
||||||
}
|
}
|
||||||
if (src != NULL) {
|
if (src != NULL) {
|
||||||
src->detected_directconnect_ssl_port =
|
src->detected_directconnect_ssl_port =
|
||||||
ntohs_ndpi_bytestream_to_number(&packet->payload[25], 5, &bytes_read);
|
ntohs_ndpi_bytestream_to_number(&packet->payload[25], 5, &bytes_read);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "DC ssl port parsed %d\n", ntohs(src->detected_directconnect_ssl_port));
|
||||||
NDPI_LOG_DEBUG, "directconnect ssl port parsed %d", ntohs(src->detected_directconnect_ssl_port));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -168,15 +165,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
if ((u_int32_t)
|
if ((u_int32_t)
|
||||||
(packet->tick_timestamp -
|
(packet->tick_timestamp -
|
||||||
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
|
||||||
src->directconnect_last_safe_access_time = packet->tick_timestamp;
|
src->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(src->detected_directconnect_port));
|
||||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_port));
|
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
src->detected_directconnect_port = 0;
|
src->detected_directconnect_port = 0;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "resetting src port due to timeout\n");
|
||||||
NDPI_LOG_DEBUG, "resetting src port due to timeout");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,15 +179,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
if ((u_int32_t)
|
if ((u_int32_t)
|
||||||
(packet->tick_timestamp -
|
(packet->tick_timestamp -
|
||||||
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
|
||||||
src->directconnect_last_safe_access_time = packet->tick_timestamp;
|
src->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(src->detected_directconnect_ssl_port));
|
||||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_ssl_port));
|
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
src->detected_directconnect_ssl_port = 0;
|
src->detected_directconnect_ssl_port = 0;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "resetting src port due to timeout\n");
|
||||||
NDPI_LOG_DEBUG, "resetting src port due to timeout");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,15 +197,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
if ((u_int32_t)
|
if ((u_int32_t)
|
||||||
(packet->tick_timestamp -
|
(packet->tick_timestamp -
|
||||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
|
||||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(dst->detected_directconnect_port));
|
||||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_port));
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
dst->detected_directconnect_port = 0;
|
dst->detected_directconnect_port = 0;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG(ndpi_struct, "resetting dst port due to timeout\n");
|
||||||
NDPI_LOG_DEBUG, "resetting dst port due to timeout");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,16 +211,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
if ((u_int32_t)
|
if ((u_int32_t)
|
||||||
(packet->tick_timestamp -
|
(packet->tick_timestamp -
|
||||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
|
||||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG(ndpi_struct, "found DC using port %d\n", ntohs(dst->detected_directconnect_ssl_port));
|
||||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_ssl_port));
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
dst->detected_directconnect_ssl_port = 0;
|
dst->detected_directconnect_ssl_port = 0;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "resetting dst port due to timeout\n");
|
||||||
NDPI_LOG_DEBUG, "resetting dst port due to timeout");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -242,8 +230,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
if (packet->payload[0] == '$'
|
if (packet->payload[0] == '$'
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == '|'
|
&& packet->payload[packet->payload_packet_len - 1] == '|'
|
||||||
&& (memcmp(&packet->payload[1], "Lock ", 5) == 0)) {
|
&& (memcmp(&packet->payload[1], "Lock ", 5) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "maybe first dc connect to hub detected\n");
|
||||||
NDPI_LOG_DEBUG, "maybe first dc connect to hub detected\n");
|
|
||||||
flow->directconnect_stage = 1;
|
flow->directconnect_stage = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -251,8 +238,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
&& packet->payload[0] == '$'
|
&& packet->payload[0] == '$'
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == '|'
|
&& packet->payload[packet->payload_packet_len - 1] == '|'
|
||||||
&& (memcmp(&packet->payload[1], "MyNick ", 7) == 0)) {
|
&& (memcmp(&packet->payload[1], "MyNick ", 7) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "maybe first dc connect between peers detected\n");
|
||||||
NDPI_LOG_DEBUG, "maybe first dc connect between peers detected\n");
|
|
||||||
flow->directconnect_stage = 2;
|
flow->directconnect_stage = 2;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -262,15 +248,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
/* did not see this pattern in any trace */
|
/* did not see this pattern in any trace */
|
||||||
if (memcmp(&packet->payload[0], "HSUP ADBAS0", 11) == 0
|
if (memcmp(&packet->payload[0], "HSUP ADBAS0", 11) == 0
|
||||||
|| memcmp(&packet->payload[0], "HSUP ADBASE", 11) == 0) {
|
|| memcmp(&packet->payload[0], "HSUP ADBASE", 11) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC HSUP ADBAS0 E\n");
|
||||||
NDPI_LOG_DEBUG, "found directconnect HSUP ADBAS0 E\n");
|
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
||||||
return;
|
return;
|
||||||
/* did not see this pattern in any trace */
|
/* did not see this pattern in any trace */
|
||||||
} else if (memcmp(&packet->payload[0], "CSUP ADBAS0", 11) == 0 ||
|
} else if (memcmp(&packet->payload[0], "CSUP ADBAS0", 11) == 0 ||
|
||||||
memcmp(&packet->payload[0], "CSUP ADBASE", 11) == 0) {
|
memcmp(&packet->payload[0], "CSUP ADBASE", 11) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC CSUP ADBAS0 E\n");
|
||||||
NDPI_LOG_DEBUG, "found directconnect CSUP ADBAS0 E\n");
|
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_ADC_PEER);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_ADC_PEER);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -283,19 +267,14 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
/* did not see this pattern in any trace */
|
/* did not see this pattern in any trace */
|
||||||
if (memcmp(&packet->payload[0], "HSUP ADBAS0", 11) == 0
|
if (memcmp(&packet->payload[0], "HSUP ADBAS0", 11) == 0
|
||||||
|| memcmp(&packet->payload[0], "HSUP ADBASE", 11) == 0) {
|
|| memcmp(&packet->payload[0], "HSUP ADBASE", 11) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC HSUP ADBAS E in second packet\n");
|
||||||
NDPI_LOG_DEBUG, "found directconnect HSUP ADBAS E in second packet\n");
|
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
/* did not see this pattern in any trace */
|
/* did not see this pattern in any trace */
|
||||||
} else if (memcmp(&packet->payload[0], "CSUP ADBAS0", 11) == 0 ||
|
} else if (memcmp(&packet->payload[0], "CSUP ADBAS0", 11) == 0 ||
|
||||||
memcmp(&packet->payload[0], "CSUP ADBASE", 11) == 0) {
|
memcmp(&packet->payload[0], "CSUP ADBASE", 11) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC HSUP ADBAS0 E in second packet\n");
|
||||||
NDPI_LOG_DEBUG, "found directconnect HSUP ADBAS0 E in second packet\n");
|
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_ADC_PEER);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_ADC_PEER);
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -304,12 +283,11 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
if (packet->payload_packet_len > 6) {
|
if (packet->payload_packet_len > 6) {
|
||||||
if ((packet->payload[0] == '$' || packet->payload[0] == '<')
|
if ((packet->payload[0] == '$' || packet->payload[0] == '<')
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == '|') {
|
&& packet->payload[packet->payload_packet_len - 1] == '|') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "second dc detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DC second\n");
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "second dc not detected\n");
|
NDPI_LOG_DBG2(ndpi_struct, "second dc not detected\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -317,23 +295,17 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
|||||||
/* get client hello answer or server message */
|
/* get client hello answer or server message */
|
||||||
if (packet->payload_packet_len > 6) {
|
if (packet->payload_packet_len > 6) {
|
||||||
if (packet->payload[0] == '$' && packet->payload[packet->payload_packet_len - 1] == '|') {
|
if (packet->payload[0] == '$' && packet->payload[packet->payload_packet_len - 1] == '|') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC between peers\n");
|
||||||
NDPI_LOG_DEBUG, "second dc between peers detected\n");
|
|
||||||
|
|
||||||
|
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "second dc between peers not detected\n");
|
||||||
NDPI_LOG_DEBUG, "second dc between peers not detected\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DIRECTCONNECT);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -352,15 +324,13 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
|||||||
(packet->tick_timestamp -
|
(packet->tick_timestamp -
|
||||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||||
|
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
|
||||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found DC using udp port %d\n", ntohs(dst->detected_directconnect_udp_port));
|
||||||
NDPI_LOG_DEBUG, "marking using dc udp port\n %d", ntohs(dst->detected_directconnect_udp_port));
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
dst->detected_directconnect_udp_port = 0;
|
dst->detected_directconnect_udp_port = 0;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "resetting dst udp port due to timeout\n");
|
||||||
NDPI_LOG_DEBUG, "resetting dst udp port due to timeout");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,23 +350,18 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
|||||||
if (packet->payload[pos] == '(') {
|
if (packet->payload[pos] == '(') {
|
||||||
pos = pos - 44;
|
pos = pos - 44;
|
||||||
if (pos > 2 && memcmp(&packet->payload[pos], "TTH:", 4) == 0) {
|
if (pos > 2 && memcmp(&packet->payload[pos], "TTH:", 4) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "dc udp detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DC udp\n");
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
flow->directconnect_stage++;
|
flow->directconnect_stage++;
|
||||||
|
if (flow->directconnect_stage < 3)
|
||||||
if (flow->directconnect_stage < 3) {
|
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
if (dst != NULL
|
if (dst != NULL
|
||||||
&& NDPI_COMPARE_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, NDPI_PROTOCOL_DIRECTCONNECT)) {
|
&& NDPI_COMPARE_PROTOCOL_TO_BITMASK(dst->detected_protocol_bitmask, NDPI_PROTOCOL_DIRECTCONNECT)) {
|
||||||
if (packet->payload[0] == '$'
|
if (packet->payload[0] == '$'
|
||||||
@@ -411,7 +376,7 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
|||||||
if (packet->payload[pos] == '(') {
|
if (packet->payload[pos] == '(') {
|
||||||
pos = pos - 44;
|
pos = pos - 44;
|
||||||
if (pos > 2 && memcmp(&packet->payload[pos], "TTH:", 4) == 0) {
|
if (pos > 2 && memcmp(&packet->payload[pos], "TTH:", 4) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "dc udp detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DC udp\n");
|
||||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -420,15 +385,11 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
|||||||
flow->directconnect_stage++;
|
flow->directconnect_stage++;
|
||||||
if (flow->directconnect_stage < 3)
|
if (flow->directconnect_stage < 3)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG(ndpi_struct, "excluded DC at stage %d \n", flow->directconnect_stage);
|
||||||
"excluded at stage %d \n", flow->directconnect_stage);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DIRECTCONNECT);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DIRECTCONNECT);
|
||||||
|
|
||||||
@@ -442,7 +403,7 @@ void ndpi_search_directconnect(struct ndpi_detection_module_struct
|
|||||||
struct ndpi_id_struct *src = flow->src;
|
struct ndpi_id_struct *src = flow->src;
|
||||||
struct ndpi_id_struct *dst = flow->dst;
|
struct ndpi_id_struct *dst = flow->dst;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search DC\n");
|
||||||
|
|
||||||
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_DIRECTCONNECT) {
|
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_DIRECTCONNECT) {
|
||||||
if (src != NULL && ((u_int32_t)
|
if (src != NULL && ((u_int32_t)
|
||||||
@@ -458,8 +419,7 @@ void ndpi_search_directconnect(struct ndpi_detection_module_struct
|
|||||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||||
} else {
|
} else {
|
||||||
packet->detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN;
|
packet->detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "skipping as unknown due to timeout\n");
|
||||||
NDPI_LOG_DEBUG, "directconnect: skipping as unknown due to timeout\n");
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -483,5 +443,3 @@ void init_directconnect_dissector(struct ndpi_detection_module_struct *ndpi_stru
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* directdownloadlink.c
|
* directdownloadlink.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-14svn - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,8 +23,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
#ifdef NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef NDPI_DEBUG_DIRECT_DOWNLOAD_LINK
|
#ifdef NDPI_DEBUG_DIRECT_DOWNLOAD_LINK
|
||||||
@@ -52,15 +55,12 @@ static void ndpi_int_direct_download_link_add_connection(struct ndpi_detection_m
|
|||||||
u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
u_int16_t filename_start = 0;
|
u_int16_t filename_start = 0;
|
||||||
u_int8_t i = 1;
|
u_int8_t i = 1;
|
||||||
u_int16_t host_line_len_without_port;
|
u_int16_t host_line_len_without_port;
|
||||||
|
|
||||||
if (packet->payload_packet_len < 100) {
|
if (packet->payload_packet_len < 100) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: Packet too small.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: Packet too small\n");
|
||||||
goto end_ddl_nothing_found;
|
goto end_ddl_nothing_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,10 +68,10 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
|
|
||||||
if (memcmp(packet->payload, "POST ", 5) == 0) {
|
if (memcmp(packet->payload, "POST ", 5) == 0) {
|
||||||
filename_start = 5; // POST
|
filename_start = 5; // POST
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: POST FOUND\n");
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: POST FOUND\n");
|
||||||
} else if (memcmp(packet->payload, "GET ", 4) == 0) {
|
} else if (memcmp(packet->payload, "GET ", 4) == 0) {
|
||||||
filename_start = 4; // GET
|
filename_start = 4; // GET
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: GET FOUND\n");
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: GET FOUND\n");
|
||||||
} else {
|
} else {
|
||||||
goto end_ddl_nothing_found;
|
goto end_ddl_nothing_found;
|
||||||
}
|
}
|
||||||
@@ -79,16 +79,15 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
|
|
||||||
if (packet->host_line.ptr == NULL) {
|
if (packet->host_line.ptr == NULL) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: NO HOST FOUND\n");
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: NO HOST FOUND\n");
|
||||||
goto end_ddl_nothing_found;
|
goto end_ddl_nothing_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: Host: found\n");
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: Host: found\n");
|
||||||
|
|
||||||
if (packet->line[0].len < 9 + filename_start
|
if (packet->line[0].len < 9 + filename_start
|
||||||
|| memcmp(&packet->line[0].ptr[packet->line[0].len - 9], " HTTP/1.", 8) != 0) {
|
|| memcmp(&packet->line[0].ptr[packet->line[0].len - 9], " HTTP/1.", 8) != 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: PACKET NOT HTTP CONFORM.\nXXX%.*sXXX\n",
|
||||||
NDPI_LOG_DEBUG, "DDL: PACKET NOT HTTP CONFORM.\nXXX%.*sXXX\n",
|
|
||||||
8, &packet->line[0].ptr[packet->line[0].len - 9]);
|
8, &packet->line[0].ptr[packet->line[0].len - 9]);
|
||||||
goto end_ddl_nothing_found;
|
goto end_ddl_nothing_found;
|
||||||
}
|
}
|
||||||
@@ -100,11 +99,11 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
i = 2;
|
i = 2;
|
||||||
while (host_line_len_without_port >= i && packet->host_line.ptr[host_line_len_without_port - i] >= '0'
|
while (host_line_len_without_port >= i && packet->host_line.ptr[host_line_len_without_port - i] >= '0'
|
||||||
&& packet->host_line.ptr[host_line_len_without_port - i] <= '9') {
|
&& packet->host_line.ptr[host_line_len_without_port - i] <= '9') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: number found\n");
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: number found\n");
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (host_line_len_without_port >= i && packet->host_line.ptr[host_line_len_without_port - i] == ':') {
|
if (host_line_len_without_port >= i && packet->host_line.ptr[host_line_len_without_port - i] == ':') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: ':' found\n");
|
NDPI_LOG_DBG2(ndpi_struct, "DDL: ':' found\n");
|
||||||
host_line_len_without_port = host_line_len_without_port - i;
|
host_line_len_without_port = host_line_len_without_port - i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -694,12 +693,12 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
end_ddl_nothing_found:
|
end_ddl_nothing_found:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"Nothing Found\n");
|
"Nothing Found\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
end_ddl_found:
|
end_ddl_found:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: DIRECT DOWNLOAD LINK FOUND\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DIRECT DOWNLOAD LINK\n");
|
||||||
ndpi_int_direct_download_link_add_connection(ndpi_struct, flow);
|
ndpi_int_direct_download_link_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -709,15 +708,12 @@ void ndpi_search_direct_download_link_tcp(struct ndpi_detection_module_struct *n
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
/* struct ndpi_id_struct *src=ndpi_struct->src; */
|
|
||||||
/* struct ndpi_id_struct *dst=ndpi_struct->dst; */
|
|
||||||
|
|
||||||
/* do not detect again if it is already ddl */
|
/* do not detect again if it is already ddl */
|
||||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK) {
|
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK) {
|
||||||
if (search_ddl_domains(ndpi_struct, flow) != 0) {
|
if (search_ddl_domains(ndpi_struct, flow) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -733,4 +729,4 @@ void init_directdownloadlink_dissector(struct ndpi_detection_module_struct *ndpi
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
+19
-17
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dns.c
|
* dns.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-16 - ntop.org
|
* Copyright (C) 2012-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,9 +21,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DNS
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_DNS
|
|
||||||
|
|
||||||
#define FLAGS_MASK 0x8000
|
#define FLAGS_MASK 0x8000
|
||||||
|
|
||||||
@@ -64,7 +67,7 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
u_int8_t is_query;
|
u_int8_t is_query;
|
||||||
u_int16_t s_port = 0, d_port = 0;
|
u_int16_t s_port = 0, d_port = 0;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "search DNS.\n");
|
NDPI_LOG_DBG(ndpi_struct, "search DNS\n");
|
||||||
|
|
||||||
if(flow->packet.udp != NULL) {
|
if(flow->packet.udp != NULL) {
|
||||||
s_port = ntohs(flow->packet.udp->source);
|
s_port = ntohs(flow->packet.udp->source);
|
||||||
@@ -75,8 +78,8 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
d_port = ntohs(flow->packet.tcp->dest);
|
d_port = ntohs(flow->packet.tcp->dest);
|
||||||
x = 2;
|
x = 2;
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "exclude DNS.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DNS);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((s_port == 53 || d_port == 53 || d_port == 5355)
|
if((s_port == 53 || d_port == 53 || d_port == 5355)
|
||||||
@@ -116,7 +119,7 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
x++;
|
x++;
|
||||||
flow->protos.dns.query_type = get16(&x, flow->packet.payload);
|
flow->protos.dns.query_type = get16(&x, flow->packet.payload);
|
||||||
#ifdef DNS_DEBUG
|
#ifdef DNS_DEBUG
|
||||||
printf("[%s:%d] query_type=%2d\n", __FILE__, __LINE__, flow->protos.dns.query_type);
|
NDPI_LOG_DBG2(ndpi_struct, "query_type=%2d\n", flow->protos.dns.query_type);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
} else
|
} else
|
||||||
@@ -177,8 +180,7 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(invalid) {
|
if(invalid) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "exclude DNS.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DNS);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,15 +207,18 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
flow->protos.dns.num_queries = (u_int8_t)dns_header.num_queries,
|
flow->protos.dns.num_queries = (u_int8_t)dns_header.num_queries,
|
||||||
flow->protos.dns.num_answers = (u_int8_t) (dns_header.num_answers + dns_header.authority_rrs + dns_header.additional_rrs);
|
flow->protos.dns.num_answers = (u_int8_t) (dns_header.num_answers + dns_header.authority_rrs + dns_header.additional_rrs);
|
||||||
|
|
||||||
if(j > 0)
|
if(j > 0) {
|
||||||
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
||||||
(char *)flow->host_server_name,
|
(char *)flow->host_server_name,
|
||||||
strlen((const char*)flow->host_server_name),
|
strlen((const char*)flow->host_server_name),
|
||||||
|
&ret_match,
|
||||||
NDPI_PROTOCOL_DNS);
|
NDPI_PROTOCOL_DNS);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DNS_DEBUG
|
#ifdef DNS_DEBUG
|
||||||
printf("[%s:%d] [num_queries=%d][num_answers=%d][reply_code=%u][rsp_type=%u][host_server_name=%s]\n",
|
NDPI_LOG_DBG2(ndpi_struct, "[num_queries=%d][num_answers=%d][reply_code=%u][rsp_type=%u][host_server_name=%s]\n",
|
||||||
__FILE__, __LINE__,
|
|
||||||
flow->protos.dns.num_queries, flow->protos.dns.num_answers,
|
flow->protos.dns.num_queries, flow->protos.dns.num_answers,
|
||||||
flow->protos.dns.reply_code, flow->protos.dns.rsp_type, flow->host_server_name
|
flow->protos.dns.reply_code, flow->protos.dns.rsp_type, flow->host_server_name
|
||||||
);
|
);
|
||||||
@@ -224,11 +229,10 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
Do not set the protocol with DNS if ndpi_match_host_subprotocol() has
|
Do not set the protocol with DNS if ndpi_match_host_subprotocol() has
|
||||||
matched a subprotocol
|
matched a subprotocol
|
||||||
**/
|
**/
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "found DNS.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DNS\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, (d_port == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, (d_port == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS, NDPI_PROTOCOL_UNKNOWN);
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "exclude DNS.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DNS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,5 +249,3 @@ void init_dns_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+41
-49
@@ -2,7 +2,7 @@
|
|||||||
* dofus.c
|
* dofus.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,77 +22,67 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DOFUS
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_DOFUS
|
|
||||||
|
|
||||||
static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found dofus\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search dofus\n");
|
||||||
|
|
||||||
/* Dofus v 1.x.x */
|
/* Dofus v 1.x.x */
|
||||||
if (packet->payload_packet_len == 13 && get_u_int16_t(packet->payload, 1) == ntohs(0x0508)
|
if (packet->payload_packet_len == 13 && get_u_int16_t(packet->payload, 1) == ntohs(0x0508)
|
||||||
&& get_u_int16_t(packet->payload, 5) == ntohs(0x04a0)
|
&& get_u_int16_t(packet->payload, 5) == ntohs(0x04a0)
|
||||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == ntohs(0x0194)) {
|
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == ntohs(0x0194)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
|
||||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len == 3 && memcmp(packet->payload, "HG", 2) == 0
|
if (flow->l4.tcp.dofus_stage == 0) {
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
if (packet->payload_packet_len == 3 && memcmp(packet->payload, "HG", 2) == 0
|
||||||
flow->l4.tcp.dofus_stage = 1;
|
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
goto maybe_dofus;
|
||||||
return;
|
|
||||||
}
|
if (packet->payload_packet_len == 12 && memcmp(packet->payload, "Af", 2) == 0
|
||||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len == 35 && memcmp(packet->payload, "HC", 2) == 0
|
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
goto maybe_dofus;
|
||||||
flow->l4.tcp.dofus_stage = 1;
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
if (packet->payload_packet_len == 35 && memcmp(packet->payload, "HC", 2) == 0
|
||||||
return;
|
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||||
}
|
goto maybe_dofus;
|
||||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len > 2 && packet->payload[0] == 'A'
|
|
||||||
|
if (packet->payload_packet_len > 2 && packet->payload[0] == 'A'
|
||||||
&& (packet->payload[1] == 'x' || packet->payload[1] == 'X')
|
&& (packet->payload[1] == 'x' || packet->payload[1] == 'X')
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||||
flow->l4.tcp.dofus_stage = 1;
|
goto maybe_dofus;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
|
||||||
return;
|
if (packet->payload_packet_len > 2 && memcmp(packet->payload, "Ad", 2)
|
||||||
|
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||||
|
goto maybe_dofus;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len == 12 && memcmp(packet->payload, "Af", 2) == 0
|
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
|
||||||
flow->l4.tcp.dofus_stage = 1;
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len > 2 && memcmp(packet->payload, "Ad", 2)
|
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
|
||||||
flow->l4.tcp.dofus_stage = 1;
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (packet->payload_packet_len == 11 && memcmp(packet->payload, "AT", 2) == 0 && packet->payload[10] == 0x00) {
|
|
||||||
if (flow->l4.tcp.dofus_stage == 1) {
|
if (flow->l4.tcp.dofus_stage == 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
if (packet->payload_packet_len == 11 && memcmp(packet->payload, "AT", 2) == 0
|
||||||
|
&& packet->payload[10] == 0x00) {
|
||||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
if (packet->payload_packet_len == 5
|
||||||
if (flow->l4.tcp.dofus_stage == 1 && packet->payload_packet_len == 5
|
&& packet->payload[0] == 'A' && packet->payload[4] == 0x00
|
||||||
&& packet->payload[0] == 'A' && packet->payload[4] == 0x00 && (packet->payload[1] == 'T'
|
&& (packet->payload[1] == 'T' || packet->payload[1] == 'k')) {
|
||||||
|| packet->payload[1] == 'k')) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus asym.\n");
|
|
||||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* end Dofus 1.x.x */
|
/* end Dofus 1.x.x */
|
||||||
|
|
||||||
|
|
||||||
@@ -109,7 +99,6 @@ void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if (packet->payload_packet_len == 49 && ntohs(get_u_int16_t(packet->payload, 15)) + 17 != packet->payload_packet_len) {
|
if (packet->payload_packet_len == 49 && ntohs(get_u_int16_t(packet->payload, 15)) + 17 != packet->payload_packet_len) {
|
||||||
goto exclude;
|
goto exclude;
|
||||||
}
|
}
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
|
||||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -120,7 +109,6 @@ void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
goto exclude;
|
goto exclude;
|
||||||
len2 = ntohs(get_u_int16_t(packet->payload, 5 + len));
|
len2 = ntohs(get_u_int16_t(packet->payload, 5 + len));
|
||||||
if (5 + len + 2 + len2 == packet->payload_packet_len) {
|
if (5 + len + 2 + len2 == packet->payload_packet_len) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
|
||||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -135,16 +123,20 @@ void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
if ((12 + len + 2 + len2 + 1) > packet->payload_packet_len)
|
if ((12 + len + 2 + len2 + 1) > packet->payload_packet_len)
|
||||||
goto exclude;
|
goto exclude;
|
||||||
if (12 + len + 2 + len2 + 1 == packet->payload_packet_len && packet->payload[12 + len + 2 + len2] == 0x01) {
|
if (12 + len + 2 + len2 + 1 == packet->payload_packet_len && packet->payload[12 + len + 2 + len2] == 0x01) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
|
||||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exclude:
|
exclude:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "exclude dofus.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DOFUS);
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
|
maybe_dofus:
|
||||||
|
flow->l4.tcp.dofus_stage = 1;
|
||||||
|
NDPI_LOG_DBG2(ndpi_struct, "maybe dofus\n");
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void init_dofus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
void init_dofus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
{
|
{
|
||||||
@@ -157,4 +149,4 @@ void init_dofus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* drda.c
|
* drda.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-16 - ntop.org
|
* Copyright (C) 2012-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -17,9 +17,11 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_DRDA
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DRDA
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
struct ndpi_drda_hdr {
|
struct ndpi_drda_hdr {
|
||||||
u_int16_t length;
|
u_int16_t length;
|
||||||
@@ -38,6 +40,8 @@ void ndpi_search_drda(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
u_int16_t payload_len = packet->payload_packet_len;
|
u_int16_t payload_len = packet->payload_packet_len;
|
||||||
u_int count = 0; // prevent integer overflow
|
u_int count = 0; // prevent integer overflow
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search DRDA\n");
|
||||||
|
|
||||||
if(packet->tcp != NULL) {
|
if(packet->tcp != NULL) {
|
||||||
|
|
||||||
/* check port */
|
/* check port */
|
||||||
@@ -71,15 +75,14 @@ void ndpi_search_drda(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
}
|
}
|
||||||
if(count != payload_len) goto no_drda;
|
if(count != payload_len) goto no_drda;
|
||||||
}
|
}
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DRDA, ndpi_struct, NDPI_LOG_DEBUG, "found DRDA.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found DRDA\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DRDA, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DRDA, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
no_drda:
|
no_drda:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DRDA, ndpi_struct, NDPI_LOG_DEBUG, "exclude DRDA.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DRDA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -98,5 +101,3 @@ void init_drda_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* NDPI_PROTOCOL_DRDA */
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dropbox.c
|
* dropbox.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-16 by ntop.org
|
* Copyright (C) 2012-18 by ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,10 +21,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DROPBOX
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_DROPBOX
|
|
||||||
|
|
||||||
#define DB_LSP_PORT 17500
|
#define DB_LSP_PORT 17500
|
||||||
|
|
||||||
@@ -51,7 +53,7 @@ static void ndpi_check_dropbox(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
if(payload_len > 2) {
|
if(payload_len > 2) {
|
||||||
if(strncmp((const char *)packet->payload, "{\"host_int\"", 11) == 0) {
|
if(strncmp((const char *)packet->payload, "{\"host_int\"", 11) == 0) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DROPBOX, ndpi_struct, NDPI_LOG_DEBUG, "Found dropbox.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found dropbox\n");
|
||||||
ndpi_int_dropbox_add_connection(ndpi_struct, flow, 0);
|
ndpi_int_dropbox_add_connection(ndpi_struct, flow, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -59,15 +61,14 @@ static void ndpi_check_dropbox(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DROPBOX, ndpi_struct, NDPI_LOG_DEBUG, "exclude dropbox.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DROPBOX);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_dropbox(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_dropbox(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_DROPBOX, ndpi_struct, NDPI_LOG_DEBUG, "dropbox detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search dropbox\n");
|
||||||
|
|
||||||
/* skip marked packets */
|
/* skip marked packets */
|
||||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_DROPBOX) {
|
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_DROPBOX) {
|
||||||
@@ -88,7 +89,3 @@ void init_dropbox_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+21
-18
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* eaq.c
|
* eaq.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 - ntop.org
|
* Copyright (C) 2015-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -24,12 +24,16 @@
|
|||||||
|
|
||||||
http://www.brasilbandalarga.com.br
|
http://www.brasilbandalarga.com.br
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_EAQ
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#define EAQ_DEFAULT_PORT 6000
|
#define EAQ_DEFAULT_PORT 6000
|
||||||
#define EAQ_DEFAULT_SIZE 16
|
#define EAQ_DEFAULT_SIZE 16
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_EAQ
|
|
||||||
static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_UNKNOWN);
|
||||||
@@ -40,13 +44,12 @@ void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int16_t sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
u_int16_t sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
||||||
|
|
||||||
if((packet->payload_packet_len != EAQ_DEFAULT_SIZE)
|
NDPI_LOG_DBG(ndpi_struct, "search eaq\n");
|
||||||
|| ((sport != EAQ_DEFAULT_PORT) && (dport != EAQ_DEFAULT_PORT))) {
|
|
||||||
exclude_eaq:
|
do {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EAQ, ndpi_struct, NDPI_LOG_DEBUG, "Exclude eaq.\n");
|
if( (packet->payload_packet_len != EAQ_DEFAULT_SIZE) ||
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_EAQ);
|
((sport != EAQ_DEFAULT_PORT) && (dport != EAQ_DEFAULT_PORT)) )
|
||||||
return;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
if(packet->udp != NULL) {
|
if(packet->udp != NULL) {
|
||||||
u_int32_t seq = (packet->payload[0] * 1000) + (packet->payload[1] * 100) + (packet->payload[2] * 10) + packet->payload[3];
|
u_int32_t seq = (packet->payload[0] * 1000) + (packet->payload[1] * 100) + (packet->payload[2] * 10) + packet->payload[3];
|
||||||
@@ -54,19 +57,21 @@ void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
if(flow->l4.udp.eaq_pkt_id == 0)
|
if(flow->l4.udp.eaq_pkt_id == 0)
|
||||||
flow->l4.udp.eaq_sequence = seq;
|
flow->l4.udp.eaq_sequence = seq;
|
||||||
else {
|
else {
|
||||||
if((flow->l4.udp.eaq_sequence == seq) || ((flow->l4.udp.eaq_sequence+1) == seq)) {
|
if( (flow->l4.udp.eaq_sequence != seq) &&
|
||||||
; /* Looks good */
|
((flow->l4.udp.eaq_sequence+1) != seq)) break;
|
||||||
} else
|
|
||||||
goto exclude_eaq;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(++flow->l4.udp.eaq_pkt_id == 4) {
|
if(++flow->l4.udp.eaq_pkt_id == 4) {
|
||||||
/* We have collected enough packets so we assume it's EAQ */
|
/* We have collected enough packets so we assume it's EAQ */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EAQ, ndpi_struct, NDPI_LOG_DEBUG, "found eaq.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found eaq\n");
|
||||||
ndpi_int_eaq_add_connection(ndpi_struct, flow);
|
ndpi_int_eaq_add_connection(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
goto exclude_eaq;
|
} while(0);
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -81,5 +86,3 @@ void init_eaq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+11
-10
@@ -23,10 +23,13 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_EDONKEY
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_EDONKEY
|
|
||||||
static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
@@ -159,24 +162,23 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
/* Break after 20 packets. */
|
/* Break after 20 packets. */
|
||||||
if (flow->packet_counter > 20) {
|
if (flow->packet_counter > 20) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "Exclude EDONKEY.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_EDONKEY);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we so far detected the protocol in the request or not. */
|
/* Check if we so far detected the protocol in the request or not. */
|
||||||
if (flow->edonkey_stage == 0) {
|
if (flow->edonkey_stage == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "EDONKEY stage 0: \n");
|
NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage 0: \n");
|
||||||
|
|
||||||
if (ndpi_edonkey_payload_check(packet->payload, payload_len)) {
|
if (ndpi_edonkey_payload_check(packet->payload, payload_len)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "Possible EDONKEY request detected, we will look further for the response...\n");
|
NDPI_LOG_DBG2(ndpi_struct, "Possible EDONKEY request detected, we will look further for the response\n");
|
||||||
|
|
||||||
/* Encode the direction of the packet in the stage, so we will know when we need to look for the response packet. */
|
/* Encode the direction of the packet in the stage, so we will know when we need to look for the response packet. */
|
||||||
flow->edonkey_stage = packet->packet_direction + 1;
|
flow->edonkey_stage = packet->packet_direction + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "EDONKEY stage %u: \n", flow->edonkey_stage);
|
NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage %u: \n", flow->edonkey_stage);
|
||||||
|
|
||||||
/* At first check, if this is for sure a response packet (in another direction. If not, do nothing now and return. */
|
/* At first check, if this is for sure a response packet (in another direction. If not, do nothing now and return. */
|
||||||
if ((flow->edonkey_stage - packet->packet_direction) == 1) {
|
if ((flow->edonkey_stage - packet->packet_direction) == 1) {
|
||||||
@@ -185,10 +187,10 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
/* This is a packet in another direction. Check if we find the proper response. */
|
/* This is a packet in another direction. Check if we find the proper response. */
|
||||||
if ((payload_len == 0) || (ndpi_edonkey_payload_check(packet->payload, payload_len))) {
|
if ((payload_len == 0) || (ndpi_edonkey_payload_check(packet->payload, payload_len))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "Found EDONKEY.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found EDONKEY\n");
|
||||||
ndpi_int_edonkey_add_connection(ndpi_struct, flow);
|
ndpi_int_edonkey_add_connection(ndpi_struct, flow);
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "The reply did not seem to belong to EDONKEY, resetting the stage to 0...\n");
|
NDPI_LOG_DBG2(ndpi_struct, "The reply did not seem to belong to EDONKEY, resetting the stage to 0\n");
|
||||||
flow->edonkey_stage = 0;
|
flow->edonkey_stage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,7 +200,7 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "EDONKEY detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search EDONKEY\n");
|
||||||
|
|
||||||
/* skip marked packets */
|
/* skip marked packets */
|
||||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_EDONKEY) {
|
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_EDONKEY) {
|
||||||
@@ -221,4 +223,3 @@ void init_edonkey_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* fasttrack.c
|
* fasttrack.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,11 +22,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FASTTRACK
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_FASTTRACK
|
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_fasttrack_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_fasttrack_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -39,13 +39,12 @@ void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search FASTTRACK\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
if ( (packet->payload != NULL)
|
if ( (packet->payload != NULL)
|
||||||
&& (packet->payload_packet_len > 6)
|
&& (packet->payload_packet_len > 6)
|
||||||
&& (ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a)) {
|
&& (ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "detected 0d0a at the end of the packet.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "detected 0d0a at the end of the packet\n");
|
||||||
|
|
||||||
if (memcmp(packet->payload, "GIVE ", 5) == 0 && packet->payload_packet_len >= 8) {
|
if (memcmp(packet->payload, "GIVE ", 5) == 0 && packet->payload_packet_len >= 8) {
|
||||||
u_int16_t i;
|
u_int16_t i;
|
||||||
@@ -56,20 +55,20 @@ void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "FASTTRACK GIVE DETECTED\n");
|
NDPI_LOG_INFO(ndpi_struct, "found FASTTRACK\n");
|
||||||
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload_packet_len > 50 && memcmp(packet->payload, "GET /", 5) == 0) {
|
if (packet->payload_packet_len > 50 && memcmp(packet->payload, "GET /", 5) == 0) {
|
||||||
u_int8_t a = 0;
|
u_int8_t a = 0;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "detected GET /. \n");
|
NDPI_LOG_DBG2(ndpi_struct, "detected GET /. \n");
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
for (a = 0; a < packet->parsed_lines; a++) {
|
for (a = 0; a < packet->parsed_lines; a++) {
|
||||||
if ((packet->line[a].len > 17 && memcmp(packet->line[a].ptr, "X-Kazaa-Username: ", 18) == 0)
|
if ((packet->line[a].len > 17 && memcmp(packet->line[a].ptr, "X-Kazaa-Username: ", 18) == 0)
|
||||||
|| (packet->line[a].len > 23 && memcmp(packet->line[a].ptr, "User-Agent: PeerEnabler/", 24) == 0)) {
|
|| (packet->line[a].len > 23 && memcmp(packet->line[a].ptr, "User-Agent: PeerEnabler/", 24) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"detected X-Kazaa-Username: || User-Agent: PeerEnabler/\n");
|
"found FASTTRACK X-Kazaa-Username: || User-Agent: PeerEnabler/\n");
|
||||||
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -78,8 +77,7 @@ void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
}
|
}
|
||||||
|
|
||||||
exclude_fasttrack:
|
exclude_fasttrack:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "fasttrack/kazaa excluded.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FASTTRACK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -94,5 +92,3 @@ void init_fasttrack_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -0,0 +1,131 @@
|
|||||||
|
/*
|
||||||
|
* fbzero.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2018 - 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/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
/* https://code.facebook.com/posts/608854979307125/building-zero-protocol-for-fast-secure-mobile-connections/ */
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FBZERO
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
PACK_ON
|
||||||
|
struct fbzero_tag {
|
||||||
|
char tag[4];
|
||||||
|
u_int32_t tag_offset_len;
|
||||||
|
} PACK_OFF;
|
||||||
|
|
||||||
|
PACK_ON
|
||||||
|
struct fbzero_header {
|
||||||
|
u_int8_t flags;
|
||||||
|
char version[3];
|
||||||
|
u_int8_t unknown;
|
||||||
|
u_int32_t len;
|
||||||
|
char tag[4];
|
||||||
|
u_int16_t tag_number, _pad;
|
||||||
|
} PACK_OFF;
|
||||||
|
|
||||||
|
/* **************************************************************************** */
|
||||||
|
|
||||||
|
void ndpi_search_fbzero(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search FacebookZero\n");
|
||||||
|
|
||||||
|
if(packet->payload_packet_len > sizeof(struct fbzero_header)) {
|
||||||
|
struct fbzero_header *h = (struct fbzero_header*)packet->payload;
|
||||||
|
struct fbzero_tag *t;
|
||||||
|
u_int offset = sizeof(struct fbzero_header), i, data_offset, tag_number, data_prev_offset = 0;
|
||||||
|
|
||||||
|
if((h->flags & 0x01) == 0)
|
||||||
|
goto fbzero_not_found;
|
||||||
|
|
||||||
|
if((h->version[0] != 'Q')
|
||||||
|
|| (h->version[1] != 'T')
|
||||||
|
|| (h->version[2] != 'V'))
|
||||||
|
goto fbzero_not_found;
|
||||||
|
|
||||||
|
if(h->unknown != 0x30)
|
||||||
|
goto fbzero_not_found;
|
||||||
|
|
||||||
|
t = (struct fbzero_tag*)&packet->payload[offset];
|
||||||
|
tag_number = h->tag_number;
|
||||||
|
data_offset = offset + tag_number*sizeof(struct fbzero_tag);
|
||||||
|
|
||||||
|
if(strncmp(h->tag, "CHLO", 4))
|
||||||
|
goto fbzero_not_found;
|
||||||
|
|
||||||
|
for(i=0; i<h->tag_number; i++) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[FBZERO] %u) %c%c%c%c\n", i, t->tag[0], t->tag[1], t->tag[2], t->tag[3]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
offset += sizeof(struct fbzero_tag);
|
||||||
|
|
||||||
|
if((t->tag[0] == 'S') && (t->tag[1] == 'N')
|
||||||
|
&& (t->tag[2] == 'I') && (t->tag[3] == '\0')) {
|
||||||
|
char *value = (char*)&packet->payload[data_offset + data_prev_offset];
|
||||||
|
u_int tag_len = t->tag_offset_len-data_prev_offset, max_len;
|
||||||
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
|
max_len = ndpi_min(tag_len, sizeof(flow->host_server_name)-1);
|
||||||
|
|
||||||
|
strncpy((char*)flow->host_server_name, value, max_len);
|
||||||
|
flow->host_server_name[max_len] = '\0';
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
printf("[FBZERO] SNI [@%u][len: %u][%s]\n", tag_len,
|
||||||
|
t->tag_offset_len-data_prev_offset, flow->host_server_name);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FBZERO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
|
||||||
|
ndpi_match_host_subprotocol(ndpi_struct, flow, (char *)flow->host_server_name,
|
||||||
|
strlen((const char *)flow->host_server_name),
|
||||||
|
&ret_match,
|
||||||
|
NDPI_PROTOCOL_FBZERO);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_prev_offset = t->tag_offset_len;
|
||||||
|
t = (struct fbzero_tag*)&packet->payload[offset];
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fbzero_not_found:
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************************************** */
|
||||||
|
|
||||||
|
void init_fbzero_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
||||||
|
NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
||||||
|
ndpi_set_bitmask_protocol_detection("FacebookZero", ndpi_struct, detection_bitmask, *id,
|
||||||
|
NDPI_PROTOCOL_FBZERO,
|
||||||
|
ndpi_search_fbzero,
|
||||||
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
||||||
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
|
ADD_TO_DETECTION_BITMASK);
|
||||||
|
*id += 1;
|
||||||
|
}
|
||||||
|
|
||||||
+12
-15
@@ -2,7 +2,7 @@
|
|||||||
* fiesta.c
|
* fiesta.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,9 +22,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* include files */
|
#include "ndpi_protocol_ids.h"
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
#ifdef NDPI_PROTOCOL_FIESTA
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FIESTA
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_fiesta_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_fiesta_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -36,17 +38,14 @@ void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search fiesta\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "search fiesta.\n");
|
|
||||||
|
|
||||||
if (flow->l4.tcp.fiesta_stage == 0 && packet->payload_packet_len == 5
|
if (flow->l4.tcp.fiesta_stage == 0 && packet->payload_packet_len == 5
|
||||||
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0407)
|
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0407)
|
||||||
&& (packet->payload[2] == 0x08)
|
&& (packet->payload[2] == 0x08)
|
||||||
&& (packet->payload[4] == 0x00 || packet->payload[4] == 0x01)) {
|
&& (packet->payload[4] == 0x00 || packet->payload[4] == 0x01)) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "maybe fiesta symmetric, first packet.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "maybe fiesta symmetric, first packet\n");
|
||||||
flow->l4.tcp.fiesta_stage = 1 + packet->packet_direction;
|
flow->l4.tcp.fiesta_stage = 1 + packet->packet_direction;
|
||||||
goto maybe_fiesta;
|
goto maybe_fiesta;
|
||||||
}
|
}
|
||||||
@@ -54,7 +53,7 @@ void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
&& ((packet->payload_packet_len > 1 && packet->payload_packet_len - 1 == packet->payload[0])
|
&& ((packet->payload_packet_len > 1 && packet->payload_packet_len - 1 == packet->payload[0])
|
||||||
|| (packet->payload_packet_len > 3 && packet->payload[0] == 0
|
|| (packet->payload_packet_len > 3 && packet->payload[0] == 0
|
||||||
&& get_l16(packet->payload, 1) == packet->payload_packet_len - 3))) {
|
&& get_l16(packet->payload, 1) == packet->payload_packet_len - 3))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "Maybe fiesta.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "Maybe fiesta\n");
|
||||||
goto maybe_fiesta;
|
goto maybe_fiesta;
|
||||||
}
|
}
|
||||||
if (flow->l4.tcp.fiesta_stage == (1 + packet->packet_direction)) {
|
if (flow->l4.tcp.fiesta_stage == (1 + packet->packet_direction)) {
|
||||||
@@ -79,16 +78,15 @@ void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "exclude fiesta.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FIESTA);
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
maybe_fiesta:
|
maybe_fiesta:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "Stage is set to %d.\n", flow->l4.tcp.fiesta_stage);
|
NDPI_LOG_DBG2(ndpi_struct, "Stage is set to %d\n", flow->l4.tcp.fiesta_stage);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
add_fiesta:
|
add_fiesta:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "detected fiesta.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found fiesta\n");
|
||||||
ndpi_int_fiesta_add_connection(ndpi_struct, flow);
|
ndpi_int_fiesta_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -105,4 +103,3 @@ void init_fiesta_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,95 +0,0 @@
|
|||||||
/*
|
|
||||||
* filetopia.c
|
|
||||||
*
|
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
|
||||||
* Copyright (C) 2011-15 - 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 "ndpi_protocols.h"
|
|
||||||
#ifdef NDPI_PROTOCOL_FILETOPIA
|
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_filetopia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
|
||||||
{
|
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FILETOPIA, NDPI_PROTOCOL_UNKNOWN);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
|
||||||
{
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
if (flow->l4.tcp.filetopia_stage == 0) {
|
|
||||||
if (packet->payload_packet_len >= 50 && packet->payload_packet_len <= 70
|
|
||||||
&& packet->payload[0] == 0x03 && packet->payload[1] == 0x9a
|
|
||||||
&& packet->payload[3] == 0x22 && packet->payload[packet->payload_packet_len - 1] == 0x2b) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FILETOPIA, ndpi_struct, NDPI_LOG_DEBUG, "Filetopia stage 1 detected\n");
|
|
||||||
flow->l4.tcp.filetopia_stage = 1;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (flow->l4.tcp.filetopia_stage == 1) {
|
|
||||||
if (packet->payload_packet_len >= 100 && packet->payload[0] == 0x03
|
|
||||||
&& packet->payload[1] == 0x9a && (packet->payload[3] == 0x22 || packet->payload[3] == 0x23)) {
|
|
||||||
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < 10; i++) { // check 10 bytes for valid ASCII printable characters
|
|
||||||
if (!(packet->payload[5 + i] >= 0x20 && packet->payload[5 + i] <= 0x7e)) {
|
|
||||||
goto end_filetopia_nothing_found;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FILETOPIA, ndpi_struct, NDPI_LOG_DEBUG, "Filetopia stage 2 detected\n");
|
|
||||||
flow->l4.tcp.filetopia_stage = 2;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} else if (flow->l4.tcp.filetopia_stage == 2) {
|
|
||||||
if (packet->payload_packet_len >= 4 && packet->payload_packet_len <= 100
|
|
||||||
&& packet->payload[0] == 0x03 && packet->payload[1] == 0x9a
|
|
||||||
&& (packet->payload[3] == 0x22 || packet->payload[3] == 0x23)) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FILETOPIA, ndpi_struct, NDPI_LOG_DEBUG, "Filetopia detected\n");
|
|
||||||
ndpi_int_filetopia_add_connection(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
end_filetopia_nothing_found:
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FILETOPIA);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void init_filetopia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
|
||||||
{
|
|
||||||
ndpi_set_bitmask_protocol_detection("Filetopia", ndpi_struct, detection_bitmask, *id,
|
|
||||||
NDPI_PROTOCOL_FILETOPIA,
|
|
||||||
ndpi_search_filetopia_tcp,
|
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
|
||||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
|
||||||
ADD_TO_DETECTION_BITMASK);
|
|
||||||
*id += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+12
-10
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* fix.c
|
* fix.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017 - ntop.org
|
* Copyright (C) 2017-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -20,14 +20,19 @@
|
|||||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_FIX
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FIX
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search FIX\n");
|
||||||
if(packet->tcp) {
|
if(packet->tcp) {
|
||||||
// 8=
|
// 8=
|
||||||
if(packet->payload[0] == 0x38 && packet->payload[1] == 0x3d) {
|
if(packet->payload[0] == 0x38 && packet->payload[1] == 0x3d) {
|
||||||
@@ -37,7 +42,7 @@ void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
packet->payload[4] == 0x58 &&
|
packet->payload[4] == 0x58 &&
|
||||||
packet->payload[5] == 0x2e) {
|
packet->payload[5] == 0x2e) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIX, ndpi_struct, NDPI_LOG_DEBUG, "FIX detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found FIX\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -47,14 +52,14 @@ void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
packet->payload[4] == 0x39 &&
|
packet->payload[4] == 0x39 &&
|
||||||
packet->payload[5] == 0x3d) {
|
packet->payload[5] == 0x3d) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FIX, ndpi_struct, NDPI_LOG_DEBUG, "FIX detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found FIX\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* exclude FIX */
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FIX);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -68,6 +73,3 @@ void init_fix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* florensia.c
|
* florensia.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,10 +22,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FLORENSIA
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_api.h"
|
||||||
#ifdef NDPI_PROTOCOL_FLORENSIA
|
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_florensia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_florensia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -37,44 +38,40 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search florensia\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "search florensia.\n");
|
|
||||||
|
|
||||||
if (packet->tcp != NULL) {
|
if (packet->tcp != NULL) {
|
||||||
if (packet->payload_packet_len == 5 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
if (packet->payload_packet_len == 5 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||||
&& packet->payload[2] == 0x65 && packet->payload[4] == 0xff) {
|
&& packet->payload[2] == 0x65 && packet->payload[4] == 0xff) {
|
||||||
if (flow->florensia_stage == 1) {
|
if (flow->florensia_stage == 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||||
flow->florensia_stage = 1;
|
flow->florensia_stage = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len > 8 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
if (packet->payload_packet_len > 8 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0201) && get_u_int32_t(packet->payload, 4) == htonl(0xFFFFFFFF)) {
|
&& get_u_int16_t(packet->payload, 2) == htons(0x0201) && get_u_int32_t(packet->payload, 4) == htonl(0xFFFFFFFF)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||||
flow->florensia_stage = 1;
|
flow->florensia_stage = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 406 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
if (packet->payload_packet_len == 406 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||||
&& packet->payload[2] == 0x63) {
|
&& packet->payload[2] == 0x63) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||||
flow->florensia_stage = 1;
|
flow->florensia_stage = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 12 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
if (packet->payload_packet_len == 12 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0301)) {
|
&& get_u_int16_t(packet->payload, 2) == htons(0x0301)) {
|
||||||
if (flow->florensia_stage == 1) {
|
if (flow->florensia_stage == 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||||
flow->florensia_stage = 1;
|
flow->florensia_stage = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -82,19 +79,19 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str
|
|||||||
if (flow->florensia_stage == 1) {
|
if (flow->florensia_stage == 1) {
|
||||||
if (packet->payload_packet_len == 8 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
if (packet->payload_packet_len == 8 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0302) && get_u_int32_t(packet->payload, 4) == htonl(0xFFFFFFFF)) {
|
&& get_u_int16_t(packet->payload, 2) == htons(0x0302) && get_u_int32_t(packet->payload, 4) == htonl(0xFFFFFFFF)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia asymmetrically.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found florensia asymmetrically\n");
|
||||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 24 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
if (packet->payload_packet_len == 24 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0202)
|
&& get_u_int16_t(packet->payload, 2) == htons(0x0202)
|
||||||
&& get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == htonl(0xFFFFFFFF)) {
|
&& get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == htonl(0xFFFFFFFF)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->packet_counter < 10 && get_l16(packet->payload, 0) == packet->payload_packet_len) {
|
if (flow->packet_counter < 10 && get_l16(packet->payload, 0) == packet->payload_packet_len) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,20 +100,19 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str
|
|||||||
if (packet->udp != NULL) {
|
if (packet->udp != NULL) {
|
||||||
if (flow->florensia_stage == 0 && packet->payload_packet_len == 6
|
if (flow->florensia_stage == 0 && packet->payload_packet_len == 6
|
||||||
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0503) && get_u_int32_t(packet->payload, 2) == htonl(0xFFFF0000)) {
|
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0503) && get_u_int32_t(packet->payload, 2) == htonl(0xFFFF0000)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||||
flow->florensia_stage = 1;
|
flow->florensia_stage = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->florensia_stage == 1 && packet->payload_packet_len == 8
|
if (flow->florensia_stage == 1 && packet->payload_packet_len == 8
|
||||||
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0500) && get_u_int16_t(packet->payload, 4) == htons(0x4191)) {
|
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0500) && get_u_int16_t(packet->payload, 4) == htons(0x4191)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "exclude florensia.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FLORENSIA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -131,5 +127,3 @@ void init_florensia_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ftp_control.c
|
* ftp_control.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 - ntop.org
|
* Copyright (C) 2016-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,10 +21,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FTP_CONTROL
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_FTP_CONTROL
|
|
||||||
|
|
||||||
static void ndpi_int_ftp_control_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
static void ndpi_int_ftp_control_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_CONTROL, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_CONTROL, NDPI_PROTOCOL_UNKNOWN);
|
||||||
@@ -944,31 +946,29 @@ static void ndpi_check_ftp_control(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
|
|
||||||
/* Exclude SMTP, which uses similar commands. */
|
/* Exclude SMTP, which uses similar commands. */
|
||||||
if (packet->tcp->dest == htons(25) || packet->tcp->source == htons(25)) {
|
if (packet->tcp->dest == htons(25) || packet->tcp->source == htons(25)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "Exclude FTP_CONTROL.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FTP_CONTROL);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Break after 20 packets. */
|
/* Break after 20 packets. */
|
||||||
if (flow->packet_counter > 20) {
|
if (flow->packet_counter > 20) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "Exclude FTP_CONTROL.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FTP_CONTROL);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we so far detected the protocol in the request or not. */
|
/* Check if we so far detected the protocol in the request or not. */
|
||||||
if (flow->ftp_control_stage == 0) {
|
if (flow->ftp_control_stage == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "FTP_CONTROL stage 0: \n");
|
NDPI_LOG_DBG2(ndpi_struct, "FTP_CONTROL stage 0: \n");
|
||||||
|
|
||||||
if ((payload_len > 0) && ndpi_ftp_control_check_request(packet->payload, payload_len)) {
|
if ((payload_len > 0) && ndpi_ftp_control_check_request(packet->payload, payload_len)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "Possible FTP_CONTROL request detected, we will look further for the response...\n");
|
NDPI_LOG_DBG2(ndpi_struct, "Possible FTP_CONTROL request detected, we will look further for the response..\n");
|
||||||
|
|
||||||
/* Encode the direction of the packet in the stage, so we will know when we need to look for the response packet. */
|
/* Encode the direction of the packet in the stage, so we will know when we need to look for the response packet. */
|
||||||
flow->ftp_control_stage = packet->packet_direction + 1;
|
flow->ftp_control_stage = packet->packet_direction + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "FTP_CONTROL stage %u: \n", flow->ftp_control_stage);
|
NDPI_LOG_DBG2(ndpi_struct, "FTP_CONTROL stage %u: \n", flow->ftp_control_stage);
|
||||||
|
|
||||||
/* At first check, if this is for sure a response packet (in another direction. If not, do nothing now and return. */
|
/* At first check, if this is for sure a response packet (in another direction. If not, do nothing now and return. */
|
||||||
if ((flow->ftp_control_stage - packet->packet_direction) == 1) {
|
if ((flow->ftp_control_stage - packet->packet_direction) == 1) {
|
||||||
@@ -977,10 +977,10 @@ static void ndpi_check_ftp_control(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
|
|
||||||
/* This is a packet in another direction. Check if we find the proper response. */
|
/* This is a packet in another direction. Check if we find the proper response. */
|
||||||
if ((payload_len > 0) && ndpi_ftp_control_check_response(packet->payload, payload_len)) {
|
if ((payload_len > 0) && ndpi_ftp_control_check_response(packet->payload, payload_len)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "Found FTP_CONTROL.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found FTP_CONTROL\n");
|
||||||
ndpi_int_ftp_control_add_connection(ndpi_struct, flow);
|
ndpi_int_ftp_control_add_connection(ndpi_struct, flow);
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "The reply did not seem to belong to FTP_CONTROL, resetting the stage to 0...\n");
|
NDPI_LOG_DBG2(ndpi_struct, "The reply did not seem to belong to FTP_CONTROL, resetting the stage to 0\n");
|
||||||
flow->ftp_control_stage = 0;
|
flow->ftp_control_stage = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -990,7 +990,7 @@ static void ndpi_check_ftp_control(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
void ndpi_search_ftp_control(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
void ndpi_search_ftp_control(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_CONTROL, ndpi_struct, NDPI_LOG_DEBUG, "FTP_CONTROL detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search FTP_CONTROL\n");
|
||||||
|
|
||||||
/* skip marked packets */
|
/* skip marked packets */
|
||||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_FTP_CONTROL) {
|
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_FTP_CONTROL) {
|
||||||
@@ -1012,5 +1012,3 @@ void init_ftp_control_dissector(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ftp_data.c
|
* ftp_data.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 - ntop.org
|
* Copyright (C) 2016-18 - ntop.org
|
||||||
*
|
*
|
||||||
* The signature is based on the Libprotoident library.
|
* The signature is based on the Libprotoident library.
|
||||||
*
|
*
|
||||||
@@ -23,9 +23,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FTP_DATA
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_FTP_DATA
|
|
||||||
static void ndpi_int_ftp_data_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
static void ndpi_int_ftp_data_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FTP_DATA, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
@@ -223,22 +226,21 @@ static void ndpi_check_ftp_data(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
|| ndpi_match_ftp_data_port(ndpi_struct, flow)
|
|| ndpi_match_ftp_data_port(ndpi_struct, flow)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_DATA, ndpi_struct, NDPI_LOG_DEBUG, "Possible FTP_DATA request detected...\n");
|
NDPI_LOG_INFO(ndpi_struct, "found FTP_DATA request\n");
|
||||||
ndpi_int_ftp_data_add_connection(ndpi_struct, flow);
|
ndpi_int_ftp_data_add_connection(ndpi_struct, flow);
|
||||||
} else
|
} else
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FTP_DATA);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_ftp_data(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
void ndpi_search_ftp_data(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
|
|
||||||
/* Break after 20 packets. */
|
/* Break after 20 packets. */
|
||||||
if(flow->packet_counter > 20) {
|
if(flow->packet_counter > 20) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_DATA, ndpi_struct, NDPI_LOG_DEBUG, "Exclude FTP_DATA.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FTP_DATA);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_FTP_DATA, ndpi_struct, NDPI_LOG_DEBUG, "FTP_DATA detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search FTP_DATA\n");
|
||||||
ndpi_check_ftp_data(ndpi_struct, flow);
|
ndpi_check_ftp_data(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,5 +256,3 @@ void init_ftp_data_dissector(struct ndpi_detection_module_struct *ndpi_struct, u
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+10
-8
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* git.c
|
* git.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-16 - ntop.org
|
* Copyright (C) 2012-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -17,10 +17,14 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GIT
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_GIT
|
|
||||||
|
|
||||||
#define GIT_PORT 9418
|
#define GIT_PORT 9418
|
||||||
|
|
||||||
@@ -29,6 +33,8 @@ void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct * packet = &flow->packet;
|
struct ndpi_packet_struct * packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search Git\n");
|
||||||
|
|
||||||
if((packet->tcp != NULL) && (packet->payload_packet_len > 4)) {
|
if((packet->tcp != NULL) && (packet->payload_packet_len > 4)) {
|
||||||
if((ntohs(packet->tcp->source) == GIT_PORT)
|
if((ntohs(packet->tcp->source) == GIT_PORT)
|
||||||
|| (ntohs(packet->tcp->dest) == GIT_PORT)) {
|
|| (ntohs(packet->tcp->dest) == GIT_PORT)) {
|
||||||
@@ -52,21 +58,19 @@ void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(found_git) {
|
if(found_git) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GIT, ndpi_struct, NDPI_LOG_DEBUG, "found Git.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Git\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GIT, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GIT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GIT, ndpi_struct, NDPI_LOG_DEBUG, "exclude Git.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_GIT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* ***************************************************************** */
|
/* ***************************************************************** */
|
||||||
|
|
||||||
|
|
||||||
void init_git_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
void init_git_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
||||||
NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
{
|
{
|
||||||
@@ -79,5 +83,3 @@ void init_git_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* NDPI_PROTOCOL_GIT */
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* gnutella.c
|
* gnutella.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,12 +22,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
/* include files */
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GNUTELLA
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_GNUTELLA
|
|
||||||
|
|
||||||
static void ndpi_int_gnutella_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_gnutella_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow/* , */
|
struct ndpi_flow_struct *flow/* , */
|
||||||
@@ -38,22 +38,21 @@ static void ndpi_int_gnutella_add_connection(struct ndpi_detection_module_struct
|
|||||||
struct ndpi_id_struct *dst = flow->dst;
|
struct ndpi_id_struct *dst = flow->dst;
|
||||||
|
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GNUTELLA, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found GNUTELLA\n");
|
||||||
|
|
||||||
if (src != NULL) {
|
if (src != NULL) {
|
||||||
src->gnutella_ts = packet->tick_timestamp;
|
src->gnutella_ts = packet->tick_timestamp;
|
||||||
if (packet->udp != NULL) {
|
if (packet->udp != NULL) {
|
||||||
if (!src->detected_gnutella_udp_port1) {
|
if (!src->detected_gnutella_udp_port1) {
|
||||||
src->detected_gnutella_udp_port1 = (packet->udp->source);
|
src->detected_gnutella_udp_port1 = (packet->udp->source);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
NDPI_LOG_DEBUG, "GNUTELLA UDP PORT1 DETECTED as %u\n",
|
"GNUTELLA UDP PORT1 DETECTED as %u\n", src->detected_gnutella_udp_port1);
|
||||||
src->detected_gnutella_udp_port1);
|
|
||||||
|
|
||||||
} else if ((ntohs(packet->udp->source) != src->detected_gnutella_udp_port1)
|
} else if ((ntohs(packet->udp->source) != src->detected_gnutella_udp_port1)
|
||||||
&& !src->detected_gnutella_udp_port2) {
|
&& !src->detected_gnutella_udp_port2) {
|
||||||
src->detected_gnutella_udp_port2 = (packet->udp->source);
|
src->detected_gnutella_udp_port2 = (packet->udp->source);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
NDPI_LOG_DEBUG, "GNUTELLA UDP PORT2 DETECTED as %u\n",
|
"GNUTELLA UDP PORT2 DETECTED as %u\n", src->detected_gnutella_udp_port2);
|
||||||
src->detected_gnutella_udp_port2);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,16 +70,17 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
struct ndpi_id_struct *dst = flow->dst;
|
struct ndpi_id_struct *dst = flow->dst;
|
||||||
|
|
||||||
u_int16_t c;
|
u_int16_t c;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search GNUTELLA\n");
|
||||||
|
|
||||||
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_GNUTELLA) {
|
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_GNUTELLA) {
|
||||||
if (src != NULL && ((u_int32_t)
|
if (src != NULL && ((u_int32_t)
|
||||||
(packet->tick_timestamp - src->gnutella_ts) < ndpi_struct->gnutella_timeout)) {
|
(packet->tick_timestamp - src->gnutella_ts) < ndpi_struct->gnutella_timeout)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "save src connection packet detected\n");
|
||||||
NDPI_LOG_DEBUG, "gnutella : save src connection packet detected\n");
|
|
||||||
src->gnutella_ts = packet->tick_timestamp;
|
src->gnutella_ts = packet->tick_timestamp;
|
||||||
} else if (dst != NULL && ((u_int32_t)
|
} else if (dst != NULL && ((u_int32_t)
|
||||||
(packet->tick_timestamp - dst->gnutella_ts) < ndpi_struct->gnutella_timeout)) {
|
(packet->tick_timestamp - dst->gnutella_ts) < ndpi_struct->gnutella_timeout)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "save dst connection packet detected\n");
|
||||||
NDPI_LOG_DEBUG, "gnutella : save dst connection packet detected\n");
|
|
||||||
dst->gnutella_ts = packet->tick_timestamp;
|
dst->gnutella_ts = packet->tick_timestamp;
|
||||||
}
|
}
|
||||||
if (src != NULL && (packet->tick_timestamp - src->gnutella_ts) > ndpi_struct->gnutella_timeout) {
|
if (src != NULL && (packet->tick_timestamp - src->gnutella_ts) > ndpi_struct->gnutella_timeout) {
|
||||||
@@ -102,13 +102,11 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
if (packet->tcp != NULL) {
|
if (packet->tcp != NULL) {
|
||||||
/* this case works asymmetrically */
|
/* this case works asymmetrically */
|
||||||
if (packet->payload_packet_len > 10 && memcmp(packet->payload, "GNUTELLA/", 9) == 0) {
|
if (packet->payload_packet_len > 10 && memcmp(packet->payload, "GNUTELLA/", 9) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "GNUTELLA DETECTED\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* this case works asymmetrically */
|
/* this case works asymmetrically */
|
||||||
if (packet->payload_packet_len > 17 && memcmp(packet->payload, "GNUTELLA CONNECT/", 17) == 0) {
|
if (packet->payload_packet_len > 17 && memcmp(packet->payload, "GNUTELLA CONNECT/", 17) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "GNUTELLA DETECTED\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -123,7 +121,6 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
|| (packet->line[c].len > 7 && memcmp(packet->line[c].ptr, "X-Queue:", 8) == 0)
|
|| (packet->line[c].len > 7 && memcmp(packet->line[c].ptr, "X-Queue:", 8) == 0)
|
||||||
|| (packet->line[c].len > 36 && memcmp(packet->line[c].ptr,
|
|| (packet->line[c].len > 36 && memcmp(packet->line[c].ptr,
|
||||||
"Content-Type: application/x-gnutella-", 37) == 0)) {
|
"Content-Type: application/x-gnutella-", 37) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG, "DETECTED GNUTELLA GET.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -135,7 +132,6 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
&& memcmp(packet->user_agent_line.ptr, "BearShare Lite ", 15) == 0)
|
&& memcmp(packet->user_agent_line.ptr, "BearShare Lite ", 15) == 0)
|
||||||
|| (packet->accept_line.ptr != NULL && packet->accept_line.len > 24
|
|| (packet->accept_line.ptr != NULL && packet->accept_line.len > 24
|
||||||
&& memcmp(packet->accept_line.ptr, "application n/x-gnutella", 24) == 0)) {
|
&& memcmp(packet->accept_line.ptr, "application n/x-gnutella", 24) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG, "DETECTED GNUTELLA GET.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,8 +147,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (c < (packet->payload_packet_len - 9) && memcmp(&packet->payload[c], "urn:sha1:", 9) == 0) {
|
if (c < (packet->payload_packet_len - 9) && memcmp(&packet->payload[c], "urn:sha1:", 9) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct, "detected GET /get/ or GET /uri-res/\n");
|
||||||
"detected GET /get/ or GET /uri-res/.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,14 +156,14 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
/* answer to this packet is HTTP/1.1 ..... Content-Type: application/x-gnutella-packets,
|
/* answer to this packet is HTTP/1.1 ..... Content-Type: application/x-gnutella-packets,
|
||||||
* it is searched in the upper paragraph. */
|
* it is searched in the upper paragraph. */
|
||||||
if (packet->payload_packet_len > 30 && memcmp(packet->payload, "HEAD /gnutella/push-proxy?", 26) == 0) {
|
if (packet->payload_packet_len > 30 && memcmp(packet->payload, "HEAD /gnutella/push-proxy?", 26) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected HEAD /gnutella/push-proxy?\n");
|
NDPI_LOG_DBG2(ndpi_struct, "detected HEAD /gnutella/push-proxy?\n");
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* haven't found any trace with this pattern */
|
/* haven't found any trace with this pattern */
|
||||||
if (packet->payload_packet_len == 46
|
if (packet->payload_packet_len == 46
|
||||||
&& memcmp(packet->payload, "\x50\x55\x53\x48\x20\x67\x75\x69\x64\x3a", 10) == 0) {
|
&& memcmp(packet->payload, "\x50\x55\x53\x48\x20\x67\x75\x69\x64\x3a", 10) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"detected \x50\x55\x53\x48\x20\x67\x75\x69\x64\x3a\n");
|
"detected \x50\x55\x53\x48\x20\x67\x75\x69\x64\x3a\n");
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -189,8 +184,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
44) == 0) || (end - c > 10 && memcmp(&packet->payload[c], "\r\nX-Queue:", 10) == 0)
|
44) == 0) || (end - c > 10 && memcmp(&packet->payload[c], "\r\nX-Queue:", 10) == 0)
|
||||||
|| (end - c > 13 && memcmp(&packet->payload[c], "\r\nX-Features:", 13) == 0)) {
|
|| (end - c > 13 && memcmp(&packet->payload[c], "\r\nX-Features:", 13) == 0)) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA,
|
NDPI_LOG_DBG2(ndpi_struct, "FOXY :: GNUTELLA GET 2 DETECTED\n");
|
||||||
ndpi_struct, NDPI_LOG_TRACE, "FOXY :: GNUTELLA GET 2 DETECTED\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -202,7 +196,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
if (packet->payload_packet_len > 1 && packet->payload[packet->payload_packet_len - 1] == 0x0a
|
if (packet->payload_packet_len > 1 && packet->payload[packet->payload_packet_len - 1] == 0x0a
|
||||||
&& packet->payload[packet->payload_packet_len - 2] == 0x0a) {
|
&& packet->payload[packet->payload_packet_len - 2] == 0x0a) {
|
||||||
if (packet->payload_packet_len > 3 && memcmp(packet->payload, "GIV", 3) == 0) {
|
if (packet->payload_packet_len > 3 && memcmp(packet->payload, "GIV", 3) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "MORPHEUS GIV DETECTED\n");
|
NDPI_LOG_DBG2(ndpi_struct, "MORPHEUS GIV DETECTED\n");
|
||||||
/* Not Excluding the flow now.. We shall Check the next Packet too for Gnutella Patterns */
|
/* Not Excluding the flow now.. We shall Check the next Packet too for Gnutella Patterns */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -211,21 +205,21 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
if (packet->payload_packet_len == 46 && get_u_int32_t(packet->payload, 0) == htonl(0x802c0103) &&
|
if (packet->payload_packet_len == 46 && get_u_int32_t(packet->payload, 0) == htonl(0x802c0103) &&
|
||||||
get_u_int32_t(packet->payload, 4) == htonl(0x01000300) && get_u_int32_t(packet->payload, 8) == htonl(0x00002000) &&
|
get_u_int32_t(packet->payload, 4) == htonl(0x01000300) && get_u_int32_t(packet->payload, 8) == htonl(0x00002000) &&
|
||||||
get_u_int16_t(packet->payload, 12) == htons(0x0034)) {
|
get_u_int16_t(packet->payload, 12) == htons(0x0034)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected gnutella len == 46.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella len == 46\n");
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 49 &&
|
if (packet->payload_packet_len == 49 &&
|
||||||
memcmp(packet->payload, "\x80\x2f\x01\x03\x01\x00\x06\x00\x00\x00\x20\x00\x00\x34\x00\x00\xff\x4d\x6c",
|
memcmp(packet->payload, "\x80\x2f\x01\x03\x01\x00\x06\x00\x00\x00\x20\x00\x00\x34\x00\x00\xff\x4d\x6c",
|
||||||
19) == 0) {
|
19) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected gnutella len == 49.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella len == 49\n");
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 89 && memcmp(&packet->payload[43], "\x20\x4d\x6c", 3) == 0 &&
|
if (packet->payload_packet_len == 89 && memcmp(&packet->payload[43], "\x20\x4d\x6c", 3) == 0 &&
|
||||||
memcmp(packet->payload, "\x16\x03\x01\x00\x54\x01\x00\x00\x50\x03\x01\x4d\x6c", 13) == 0 &&
|
memcmp(packet->payload, "\x16\x03\x01\x00\x54\x01\x00\x00\x50\x03\x01\x4d\x6c", 13) == 0 &&
|
||||||
memcmp(&packet->payload[76], "\x00\x02\x00\x34\x01\x00\x00\x05", 8) == 0) {
|
memcmp(&packet->payload[76], "\x00\x02\x00\x34\x01\x00\x00\x05", 8) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"detected gnutella asymmetrically len == 388.\n");
|
"detected gnutella asymmetrically len == 388.\n");
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -235,7 +229,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
&& get_u_int16_t(packet->payload, 8) == htons(0x4903)
|
&& get_u_int16_t(packet->payload, 8) == htons(0x4903)
|
||||||
&& get_u_int16_t(packet->payload, 76) == htons(0x0002)
|
&& get_u_int16_t(packet->payload, 76) == htons(0x0002)
|
||||||
&& get_u_int32_t(packet->payload, 78) == htonl(0x00340100)) {
|
&& get_u_int32_t(packet->payload, 78) == htonl(0x00340100)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_TRACE, "detected len == 82.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "detected len == 82\n");
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -244,7 +238,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
if (src != NULL && (packet->udp->source == src->detected_gnutella_udp_port1 ||
|
if (src != NULL && (packet->udp->source == src->detected_gnutella_udp_port1 ||
|
||||||
packet->udp->source == src->detected_gnutella_udp_port2) &&
|
packet->udp->source == src->detected_gnutella_udp_port2) &&
|
||||||
(packet->tick_timestamp - src->gnutella_ts) < ndpi_struct->gnutella_timeout) {
|
(packet->tick_timestamp - src->gnutella_ts) < ndpi_struct->gnutella_timeout) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG, "port based detection\n\n");
|
NDPI_LOG_DBG2(ndpi_struct, "port based detection\n\n");
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
/* observations:
|
/* observations:
|
||||||
@@ -257,8 +251,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
&& packet->payload[16] == 0x41 && packet->payload[17] == 0x01
|
&& packet->payload[16] == 0x41 && packet->payload[17] == 0x01
|
||||||
&& packet->payload[18] == 0x00 && packet->payload[19] == 0x00
|
&& packet->payload[18] == 0x00 && packet->payload[19] == 0x00
|
||||||
&& packet->payload[20] == 0x00 && packet->payload[21] == 0x00 && packet->payload[22] == 0x00) {
|
&& packet->payload[20] == 0x00 && packet->payload[21] == 0x00 && packet->payload[22] == 0x00) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 23\n");
|
||||||
"detected gnutella udp, len = 23.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -267,29 +260,25 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
&& packet->payload[26] == 0x50 && packet->payload[27] == 0x40
|
&& packet->payload[26] == 0x50 && packet->payload[27] == 0x40
|
||||||
&& packet->payload[28] == 0x83 && packet->payload[29] == 0x53
|
&& packet->payload[28] == 0x83 && packet->payload[29] == 0x53
|
||||||
&& packet->payload[30] == 0x43 && packet->payload[31] == 0x50 && packet->payload[32] == 0x41) {
|
&& packet->payload[30] == 0x43 && packet->payload[31] == 0x50 && packet->payload[32] == 0x41) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 35\n");
|
||||||
"detected gnutella udp, len = 35.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 32
|
if (packet->payload_packet_len == 32
|
||||||
&& (memcmp(&packet->payload[16], "\x31\x01\x00\x09\x00\x00\x00\x4c\x49\x4d\x45", 11) == 0)) {
|
&& (memcmp(&packet->payload[16], "\x31\x01\x00\x09\x00\x00\x00\x4c\x49\x4d\x45", 11) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 32\n");
|
||||||
"detected gnutella udp, len = 32.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 34 && (memcmp(&packet->payload[25], "SCP@", 4) == 0)
|
if (packet->payload_packet_len == 34 && (memcmp(&packet->payload[25], "SCP@", 4) == 0)
|
||||||
&& (memcmp(&packet->payload[30], "DNA@", 4) == 0)) {
|
&& (memcmp(&packet->payload[30], "DNA@", 4) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 34\n");
|
||||||
"detected gnutella udp, len = 34.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((packet->payload_packet_len == 73 || packet->payload_packet_len == 96)
|
if ((packet->payload_packet_len == 73 || packet->payload_packet_len == 96)
|
||||||
&& memcmp(&packet->payload[32], "urn:sha1:", 9) == 0) {
|
&& memcmp(&packet->payload[32], "urn:sha1:", 9) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 73,96\n");
|
||||||
"detected gnutella udp, len = 73,96.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -308,8 +297,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
&& (memcmp(&packet->payload[6], "\x01\x01\x5c\x1b\x50\x55\x53\x48\x48\x10", 10) == 0))
|
&& (memcmp(&packet->payload[6], "\x01\x01\x5c\x1b\x50\x55\x53\x48\x48\x10", 10) == 0))
|
||||||
|| (packet->payload_packet_len > 200 && packet->payload_packet_len < 300 && packet->payload[3] == 0x03)
|
|| (packet->payload_packet_len > 200 && packet->payload_packet_len < 300 && packet->payload[3] == 0x03)
|
||||||
|| (packet->payload_packet_len > 300 && (packet->payload[3] == 0x01 || packet->payload[3] == 0x03))) {
|
|| (packet->payload_packet_len > 300 && (packet->payload[3] == 0x01 || packet->payload[3] == 0x03))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, GND\n");
|
||||||
"detected gnutella udp, GND.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -317,15 +305,13 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
|
|
||||||
if ((packet->payload_packet_len == 32)
|
if ((packet->payload_packet_len == 32)
|
||||||
&& memcmp(&packet->payload[16], "\x31\x01\x00\x09\x00\x00\x00", 7) == 0) {
|
&& memcmp(&packet->payload[16], "\x31\x01\x00\x09\x00\x00\x00", 7) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 32 ii\n");
|
||||||
"detected gnutella udp, len = 32 ii.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((packet->payload_packet_len == 23)
|
if ((packet->payload_packet_len == 23)
|
||||||
&& memcmp(&packet->payload[16], "\x00\x01\x00\x00\x00\x00\x00", 7) == 0) {
|
&& memcmp(&packet->payload[16], "\x00\x01\x00\x00\x00\x00\x00", 7) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "detected gnutella udp, len = 23 ii\n");
|
||||||
"detected gnutella udp, len = 23 ii.\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -350,8 +336,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
&& flow->l4.tcp.gnutella_msg_id[1] == packet->payload[2]
|
&& flow->l4.tcp.gnutella_msg_id[1] == packet->payload[2]
|
||||||
&& flow->l4.tcp.gnutella_msg_id[2] == packet->payload[4]
|
&& flow->l4.tcp.gnutella_msg_id[2] == packet->payload[4]
|
||||||
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
|
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
|
||||||
NDPI_LOG_TRACE, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -361,15 +346,14 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
&& flow->l4.tcp.gnutella_msg_id[1] == packet->payload[2]
|
&& flow->l4.tcp.gnutella_msg_id[1] == packet->payload[2]
|
||||||
&& flow->l4.tcp.gnutella_msg_id[2] == packet->payload[4]
|
&& flow->l4.tcp.gnutella_msg_id[2] == packet->payload[4]
|
||||||
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
|
&& NDPI_SRC_OR_DST_HAS_PROTOCOL(src, dst, NDPI_PROTOCOL_GNUTELLA)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GNUTELLA, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
|
||||||
NDPI_LOG_TRACE, "GNUTELLA DETECTED due to message ID match (NEONet protocol)\n");
|
|
||||||
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
ndpi_int_gnutella_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_GNUTELLA);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -385,5 +369,3 @@ void init_gnutella_dissector(struct ndpi_detection_module_struct *ndpi_struct, u
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* gtp.c
|
* gtp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -18,9 +18,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_GTP
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GTP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
struct gtp_header_generic {
|
struct gtp_header_generic {
|
||||||
u_int8_t flags, message_type;
|
u_int8_t flags, message_type;
|
||||||
@@ -50,7 +52,7 @@ static void ndpi_check_gtp(struct ndpi_detection_module_struct *ndpi_struct, str
|
|||||||
u_int16_t message_len = ntohs(gtp->message_len);
|
u_int16_t message_len = ntohs(gtp->message_len);
|
||||||
|
|
||||||
if(message_len <= (payload_len-sizeof(struct gtp_header_generic))) {
|
if(message_len <= (payload_len-sizeof(struct gtp_header_generic))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GTP, ndpi_struct, NDPI_LOG_DEBUG, "Found gtp.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found gtp\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_GTP, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -58,7 +60,7 @@ static void ndpi_check_gtp(struct ndpi_detection_module_struct *ndpi_struct, str
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_GTP);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +68,7 @@ void ndpi_search_gtp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GTP, ndpi_struct, NDPI_LOG_DEBUG, "gtp detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search gtp\n");
|
||||||
|
|
||||||
/* skip marked packets */
|
/* skip marked packets */
|
||||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_GTP)
|
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_GTP)
|
||||||
@@ -85,5 +87,3 @@ void init_gtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* guildwars.c
|
* guildwars.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,9 +22,11 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_GUILDWARS
|
||||||
#ifdef NDPI_PROTOCOL_GUILDWARS
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_guildwars_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_guildwars_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -36,34 +38,30 @@ void ndpi_search_guildwars_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search guildwars\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GUILDWARS, ndpi_struct, NDPI_LOG_DEBUG, "search guildwars.\n");
|
|
||||||
|
|
||||||
if (packet->payload_packet_len == 64 && get_u_int16_t(packet->payload, 1) == ntohs(0x050c)
|
if (packet->payload_packet_len == 64 && get_u_int16_t(packet->payload, 1) == ntohs(0x050c)
|
||||||
&& memcmp(&packet->payload[50], "@2&P", 4) == 0) {
|
&& memcmp(&packet->payload[50], "@2&P", 4) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GUILDWARS, ndpi_struct, NDPI_LOG_DEBUG, "GuildWars version 29.350: found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found GuildWars version 29.350\n");
|
||||||
ndpi_int_guildwars_add_connection(ndpi_struct, flow);
|
ndpi_int_guildwars_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 16 && get_u_int16_t(packet->payload, 1) == ntohs(0x040c)
|
if (packet->payload_packet_len == 16 && get_u_int16_t(packet->payload, 1) == ntohs(0x040c)
|
||||||
&& get_u_int16_t(packet->payload, 4) == ntohs(0xa672)
|
&& get_u_int16_t(packet->payload, 4) == ntohs(0xa672)
|
||||||
&& packet->payload[8] == 0x01 && packet->payload[12] == 0x04) {
|
&& packet->payload[8] == 0x01 && packet->payload[12] == 0x04) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GUILDWARS, ndpi_struct, NDPI_LOG_DEBUG, "GuildWars version 29.350: found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found GuildWars version 29.350\n");
|
||||||
ndpi_int_guildwars_add_connection(ndpi_struct, flow);
|
ndpi_int_guildwars_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 21 && get_u_int16_t(packet->payload, 0) == ntohs(0x0100)
|
if (packet->payload_packet_len == 21 && get_u_int16_t(packet->payload, 0) == ntohs(0x0100)
|
||||||
&& get_u_int32_t(packet->payload, 5) == ntohl(0xf1001000)
|
&& get_u_int32_t(packet->payload, 5) == ntohl(0xf1001000)
|
||||||
&& packet->payload[9] == 0x01) {
|
&& packet->payload[9] == 0x01) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GUILDWARS, ndpi_struct, NDPI_LOG_DEBUG, "GuildWars version 216.107.245.50: found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found GuildWars version 216.107.245.50\n");
|
||||||
ndpi_int_guildwars_add_connection(ndpi_struct, flow);
|
ndpi_int_guildwars_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_GUILDWARS, ndpi_struct, NDPI_LOG_DEBUG, "exclude guildwars.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_GUILDWARS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -78,5 +76,3 @@ void init_guildwars_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+16
-14
@@ -1,15 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
* h323.c
|
* h323.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 ntop.org
|
* Copyright (C) 2015-18 ntop.org
|
||||||
* Copyright (C) 2013 Remy Mudingay <mudingay@ill.fr>
|
* Copyright (C) 2013 Remy Mudingay <mudingay@ill.fr>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_H323
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_H323
|
|
||||||
|
|
||||||
struct tpkt {
|
struct tpkt {
|
||||||
u_int8_t version, reserved;
|
u_int8_t version, reserved;
|
||||||
@@ -21,10 +23,10 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int16_t dport = 0, sport = 0;
|
u_int16_t dport = 0, sport = 0;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "search H323.\n");
|
NDPI_LOG_DBG(ndpi_struct, "search H323\n");
|
||||||
|
|
||||||
if(packet->tcp != NULL) {
|
if(packet->tcp != NULL) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "calculated dport over tcp.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "calculated dport over tcp\n");
|
||||||
|
|
||||||
/* H323 */
|
/* H323 */
|
||||||
if(packet->payload_packet_len >= 3
|
if(packet->payload_packet_len >= 3
|
||||||
@@ -44,6 +46,7 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
/* ISO 8073/X.224 */
|
/* ISO 8073/X.224 */
|
||||||
if((packet->payload[5] == 0xE0 /* CC Connect Request */)
|
if((packet->payload[5] == 0xE0 /* CC Connect Request */)
|
||||||
|| (packet->payload[5] == 0xD0 /* CC Connect Confirm */)) {
|
|| (packet->payload[5] == 0xD0 /* CC Connect Confirm */)) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found RDP\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -52,23 +55,24 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
flow->l4.tcp.h323_valid_packets++;
|
flow->l4.tcp.h323_valid_packets++;
|
||||||
|
|
||||||
if(flow->l4.tcp.h323_valid_packets >= 2) {
|
if(flow->l4.tcp.h323_valid_packets >= 2) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* This is not H.323 */
|
/* This is not H.323 */
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_H323);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(packet->udp != NULL) {
|
} else if(packet->udp != NULL) {
|
||||||
sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "calculated dport over udp.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "calculated dport over udp\n");
|
||||||
|
|
||||||
if(packet->payload_packet_len >= 6 && packet->payload[0] == 0x80 && packet->payload[1] == 0x08 &&
|
if(packet->payload_packet_len >= 6 && packet->payload[0] == 0x80 && packet->payload[1] == 0x08 &&
|
||||||
(packet->payload[2] == 0xe7 || packet->payload[2] == 0x26) &&
|
(packet->payload[2] == 0xe7 || packet->payload[2] == 0x26) &&
|
||||||
packet->payload[4] == 0x00 && packet->payload[5] == 0x00)
|
packet->payload[4] == 0x00 && packet->payload[5] == 0x00)
|
||||||
{
|
{
|
||||||
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -77,19 +81,19 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
{
|
{
|
||||||
if(packet->payload[0] == 0x16 && packet->payload[1] == 0x80 && packet->payload[4] == 0x06 && packet->payload[5] == 0x00)
|
if(packet->payload[0] == 0x16 && packet->payload[1] == 0x80 && packet->payload[4] == 0x06 && packet->payload[5] == 0x00)
|
||||||
{
|
{
|
||||||
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if(packet->payload_packet_len >= 20 && packet->payload_packet_len <= 117)
|
else if(packet->payload_packet_len >= 20 && packet->payload_packet_len <= 117)
|
||||||
{
|
{
|
||||||
NDPI_LOG(NDPI_PROTOCOL_H323, ndpi_struct, NDPI_LOG_DEBUG, "found H323 broadcast.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found H323 broadcast\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_H323, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_H323);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,5 +112,3 @@ void init_h323_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* halflife2_and_mods.c
|
* halflife2_and_mods.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,8 +23,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
#ifdef NDPI_PROTOCOL_HALFLIFE2
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HALFLIFE2
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_halflife2_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_halflife2_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -36,15 +39,14 @@ void ndpi_search_halflife2(struct ndpi_detection_module_struct *ndpi_struct, str
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search halflife2\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
if (flow->l4.udp.halflife2_stage == 0) {
|
if (flow->l4.udp.halflife2_stage == 0) {
|
||||||
if (packet->payload_packet_len >= 20
|
if (packet->payload_packet_len >= 20
|
||||||
&& get_u_int32_t(packet->payload, 0) == 0xFFFFFFFF
|
&& get_u_int32_t(packet->payload, 0) == 0xFFFFFFFF
|
||||||
&& get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == htonl(0x30303000)) {
|
&& get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == htonl(0x30303000)) {
|
||||||
flow->l4.udp.halflife2_stage = 1 + packet->packet_direction;
|
flow->l4.udp.halflife2_stage = 1 + packet->packet_direction;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HALFLIFE2, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"halflife2 client req detected, waiting for server reply\n");
|
"halflife2 client req detected, waiting for server reply\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -53,13 +55,12 @@ void ndpi_search_halflife2(struct ndpi_detection_module_struct *ndpi_struct, str
|
|||||||
&& get_u_int32_t(packet->payload, 0) == 0xFFFFFFFF
|
&& get_u_int32_t(packet->payload, 0) == 0xFFFFFFFF
|
||||||
&& get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == htonl(0x30303000)) {
|
&& get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == htonl(0x30303000)) {
|
||||||
ndpi_int_halflife2_add_connection(ndpi_struct, flow);
|
ndpi_int_halflife2_add_connection(ndpi_struct, flow);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HALFLIFE2, ndpi_struct, NDPI_LOG_DEBUG, "halflife2 server reply detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found halflife2\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HALFLIFE2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -74,5 +75,3 @@ void init_halflife2_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* hangout.c
|
* hangout.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-16 - ntop.org
|
* Copyright (C) 2012-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -17,9 +17,13 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HANGOUT
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_HANGOUT
|
|
||||||
|
|
||||||
/* https://support.google.com/a/answer/1279090?hl=en */
|
/* https://support.google.com/a/answer/1279090?hl=en */
|
||||||
#define HANGOUT_UDP_LOW_PORT 19302
|
#define HANGOUT_UDP_LOW_PORT 19302
|
||||||
@@ -73,19 +77,20 @@ void ndpi_search_hangout(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct * packet = &flow->packet;
|
struct ndpi_packet_struct * packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search Hangout\n");
|
||||||
|
|
||||||
if((packet->payload_packet_len > 24) && is_google_flow(ndpi_struct, flow)) {
|
if((packet->payload_packet_len > 24) && is_google_flow(ndpi_struct, flow)) {
|
||||||
if(
|
if(
|
||||||
((packet->udp != NULL) && (isHangoutUDPPort(ntohs(packet->udp->source)) || isHangoutUDPPort(ntohs(packet->udp->dest))))
|
((packet->udp != NULL) && (isHangoutUDPPort(ntohs(packet->udp->source)) || isHangoutUDPPort(ntohs(packet->udp->dest))))
|
||||||
||
|
||
|
||||||
((packet->tcp != NULL) && (isHangoutTCPPort(ntohs(packet->tcp->source)) || isHangoutTCPPort(ntohs(packet->tcp->dest))))) {
|
((packet->tcp != NULL) && (isHangoutTCPPort(ntohs(packet->tcp->source)) || isHangoutTCPPort(ntohs(packet->tcp->dest))))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HANGOUT, ndpi_struct, NDPI_LOG_DEBUG, "Found Hangout.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Hangout\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HANGOUT, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HANGOUT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HANGOUT, ndpi_struct, NDPI_LOG_DEBUG, "No Hangout.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HANGOUT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***************************************************************** */
|
/* ***************************************************************** */
|
||||||
@@ -102,4 +107,3 @@ void init_hangout_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* NDPI_PROTOCOL_HANGOUT */
|
|
||||||
|
|||||||
+11
-9
@@ -2,7 +2,7 @@
|
|||||||
* hep.c
|
* hep.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
* Copyright (C) 2011-15 - QXIP BV
|
* Copyright (C) 2011-15 - QXIP BV
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
@@ -24,8 +24,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
#ifdef NDPI_PROTOCOL_HEP
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HEP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_hep_add_connection(struct ndpi_detection_module_struct
|
static void ndpi_int_hep_add_connection(struct ndpi_detection_module_struct
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
@@ -39,17 +43,17 @@ void ndpi_search_hep(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
const u_int8_t *packet_payload = packet->payload;
|
const u_int8_t *packet_payload = packet->payload;
|
||||||
u_int32_t payload_len = packet->payload_packet_len;
|
u_int32_t payload_len = packet->payload_packet_len;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HEP, ndpi_struct, NDPI_LOG_DEBUG, "searching for HEP.\n");
|
NDPI_LOG_DBG(ndpi_struct, "searching HEP\n");
|
||||||
|
|
||||||
if(payload_len > 10) {
|
if(payload_len > 10) {
|
||||||
if(memcmp(packet_payload, "HEP3", 4) == 0) {
|
if(memcmp(packet_payload, "HEP3", 4) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HEP, ndpi_struct, NDPI_LOG_DEBUG, "found HEP3.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HEP3\n");
|
||||||
ndpi_int_hep_add_connection(ndpi_struct, flow);
|
ndpi_int_hep_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HEP, ndpi_struct, NDPI_LOG_DEBUG, "exclude HEP.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HEP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -64,5 +68,3 @@ void init_hep_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+204
-183
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* http.c
|
* http.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-17 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -20,16 +20,19 @@
|
|||||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "ndpi_protocols.h"
|
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_HTTP
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HTTP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
/* global variables used for 1kxun protocol and iqiyi service */
|
/* global variables used for 1kxun protocol and iqiyi service */
|
||||||
|
|
||||||
static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
u_int32_t protocol) {
|
u_int16_t category) {
|
||||||
|
|
||||||
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
|
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
|
||||||
/* This is HTTP and it is not a sub protocol (e.g. skype or dropbox) */
|
/* This is HTTP and it is not a sub protocol (e.g. skype or dropbox) */
|
||||||
@@ -37,18 +40,18 @@ static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *nd
|
|||||||
ndpi_search_tcp_or_udp(ndpi_struct, flow);
|
ndpi_search_tcp_or_udp(ndpi_struct, flow);
|
||||||
|
|
||||||
/* If no custom protocol has been detected */
|
/* If no custom protocol has been detected */
|
||||||
/* if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) */
|
|
||||||
if(protocol == NDPI_PROTOCOL_HTTP) {
|
if(flow->guessed_host_protocol_id != NDPI_PROTOCOL_UNKNOWN) {
|
||||||
ndpi_int_reset_protocol(flow);
|
ndpi_int_reset_protocol(flow);
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id, protocol);
|
ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id, NDPI_PROTOCOL_HTTP);
|
||||||
} else
|
} else
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, protocol, NDPI_PROTOCOL_HTTP);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
|
||||||
flow->http_detected = 1;
|
flow->http_detected = 1, flow->guessed_category = category;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NDPI_CONTENT_FLASH
|
#ifdef NDPI_CONTENT_CATEGORY_FLASH
|
||||||
static void flash_check_http_payload(struct ndpi_detection_module_struct
|
static void flash_check_http_payload(struct ndpi_detection_module_struct
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
@@ -63,19 +66,19 @@ static void flash_check_http_payload(struct ndpi_detection_module_struct
|
|||||||
if(memcmp(pos, "FLV", 3) == 0 && pos[3] == 0x01 && (pos[4] == 0x01 || pos[4] == 0x04 || pos[4] == 0x05)
|
if(memcmp(pos, "FLV", 3) == 0 && pos[3] == 0x01 && (pos[4] == 0x01 || pos[4] == 0x04 || pos[4] == 0x05)
|
||||||
&& pos[5] == 0x00 && pos[6] == 0x00 && pos[7] == 0x00 && pos[8] == 0x09) {
|
&& pos[5] == 0x00 && pos[6] == 0x00 && pos[7] == 0x00 && pos[8] == 0x09) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_CONTENT_FLASH, ndpi_struct, NDPI_LOG_DEBUG, "Flash content in HTTP detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Flash content in HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_FLASH);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_CATEGORY_FLASH);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NDPI_CONTENT_AVI
|
#ifdef NDPI_CONTENT_CATEGORY_AVI
|
||||||
static void avi_check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void avi_check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_CONTENT_AVI, ndpi_struct, NDPI_LOG_DEBUG, "called avi_check_http_payload: %u %u %u\n",
|
NDPI_LOG_DBG2(ndpi_struct, "called avi_check_http_payload: %u %u %u\n",
|
||||||
packet->empty_line_position_set, flow->l4.tcp.http_empty_line_seen, packet->empty_line_position);
|
packet->empty_line_position_set, flow->l4.tcp.http_empty_line_seen, packet->empty_line_position);
|
||||||
|
|
||||||
if(packet->empty_line_position_set == 0 && flow->l4.tcp.http_empty_line_seen == 0)
|
if(packet->empty_line_position_set == 0 && flow->l4.tcp.http_empty_line_seen == 0)
|
||||||
@@ -90,8 +93,8 @@ static void avi_check_http_payload(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
if(flow->l4.tcp.http_empty_line_seen == 1) {
|
if(flow->l4.tcp.http_empty_line_seen == 1) {
|
||||||
if(packet->payload_packet_len > 20 && memcmp(packet->payload, "RIFF", 4) == 0
|
if(packet->payload_packet_len > 20 && memcmp(packet->payload, "RIFF", 4) == 0
|
||||||
&& memcmp(packet->payload + 8, "AVI LIST", 8) == 0) {
|
&& memcmp(packet->payload + 8, "AVI LIST", 8) == 0) {
|
||||||
NDPI_LOG(NDPI_CONTENT_AVI, ndpi_struct, NDPI_LOG_DEBUG, "Avi content in HTTP detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Avi content in HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_AVI);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_CATEGORY_AVI);
|
||||||
}
|
}
|
||||||
flow->l4.tcp.http_empty_line_seen = 0;
|
flow->l4.tcp.http_empty_line_seen = 0;
|
||||||
return;
|
return;
|
||||||
@@ -105,24 +108,23 @@ static void avi_check_http_payload(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
u_int32_t p = packet->empty_line_position + 2;
|
u_int32_t p = packet->empty_line_position + 2;
|
||||||
|
|
||||||
// check for avi header
|
// check for avi header
|
||||||
NDPI_LOG(NDPI_CONTENT_AVI, ndpi_struct, NDPI_LOG_DEBUG, "p = %u\n", p);
|
NDPI_LOG_DBG2(ndpi_struct, "p = %u\n", p);
|
||||||
|
|
||||||
if((p + 16) <= packet->payload_packet_len && memcmp(&packet->payload[p], "RIFF", 4) == 0
|
if((p + 16) <= packet->payload_packet_len && memcmp(&packet->payload[p], "RIFF", 4) == 0
|
||||||
&& memcmp(&packet->payload[p + 8], "AVI LIST", 8) == 0) {
|
&& memcmp(&packet->payload[p + 8], "AVI LIST", 8) == 0) {
|
||||||
NDPI_LOG(NDPI_CONTENT_AVI, ndpi_struct, NDPI_LOG_DEBUG, "Avi content in HTTP detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Avi content in HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_AVI);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_CATEGORY_AVI);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_TEAMVIEWER
|
|
||||||
static void teamviewer_check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void teamviewer_check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
const u_int8_t *pos;
|
const u_int8_t *pos;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_TEAMVIEWER, ndpi_struct, NDPI_LOG_DEBUG, "called teamviewer_check_http_payload: %u %u %u\n",
|
NDPI_LOG_DBG2(ndpi_struct, "called teamviewer_check_http_payload: %u %u %u\n",
|
||||||
packet->empty_line_position_set, flow->l4.tcp.http_empty_line_seen, packet->empty_line_position);
|
packet->empty_line_position_set, flow->l4.tcp.http_empty_line_seen, packet->empty_line_position);
|
||||||
|
|
||||||
if(packet->empty_line_position_set == 0 || (packet->empty_line_position + 5) > (packet->payload_packet_len))
|
if(packet->empty_line_position_set == 0 || (packet->empty_line_position + 5) > (packet->payload_packet_len))
|
||||||
@@ -131,27 +133,24 @@ static void teamviewer_check_http_payload(struct ndpi_detection_module_struct *n
|
|||||||
pos = &packet->payload[packet->empty_line_position] + 2;
|
pos = &packet->payload[packet->empty_line_position] + 2;
|
||||||
|
|
||||||
if(pos[0] == 0x17 && pos[1] == 0x24) {
|
if(pos[0] == 0x17 && pos[1] == 0x24) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_TEAMVIEWER, ndpi_struct, NDPI_LOG_DEBUG, "TeamViewer content in HTTP detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found TeamViewer content in HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TEAMVIEWER);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TEAMVIEWER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_RTSP
|
|
||||||
static void rtsp_parse_packet_acceptline(struct ndpi_detection_module_struct
|
static void rtsp_parse_packet_acceptline(struct ndpi_detection_module_struct
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
if(packet->accept_line.len >= 28 && memcmp(packet->accept_line.ptr, "application/x-rtsp-tunnelled", 28) == 0) {
|
if(packet->accept_line.len >= 28 && memcmp(packet->accept_line.ptr, "application/x-rtsp-tunnelled", 28) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_RTSP, ndpi_struct, NDPI_LOG_DEBUG, "RTSP accept line detected\n");
|
NDPI_LOG_INFO(ndpi_struct, "found RTSP accept line\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTSP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTSP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static void setHttpUserAgent(struct ndpi_flow_struct *flow, char *ua) {
|
static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow, char *ua) {
|
||||||
if ( !strcmp(ua, "Windows NT 5.0")) ua = "Windows 2000";
|
if ( !strcmp(ua, "Windows NT 5.0")) ua = "Windows 2000";
|
||||||
else if(!strcmp(ua, "Windows NT 5.1")) ua = "Windows XP";
|
else if(!strcmp(ua, "Windows NT 5.1")) ua = "Windows XP";
|
||||||
else if(!strcmp(ua, "Windows NT 5.2")) ua = "Windows Server 2003";
|
else if(!strcmp(ua, "Windows NT 5.2")) ua = "Windows Server 2003";
|
||||||
@@ -165,12 +164,15 @@ static void setHttpUserAgent(struct ndpi_flow_struct *flow, char *ua) {
|
|||||||
* https://github.com/ua-parser/uap-core/blob/master/regexes.yaml */
|
* https://github.com/ua-parser/uap-core/blob/master/regexes.yaml */
|
||||||
|
|
||||||
//printf("==> %s\n", ua);
|
//printf("==> %s\n", ua);
|
||||||
|
if(!ndpi_struct->disable_metadata_export) {
|
||||||
snprintf((char*)flow->protos.http.detected_os, sizeof(flow->protos.http.detected_os), "%s", ua);
|
snprintf((char*)flow->protos.http.detected_os, sizeof(flow->protos.http.detected_os), "%s", ua);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void parseHttpSubprotocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
static void parseHttpSubprotocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
if((flow->l4.tcp.http_stage == 0) || (flow->http.url && flow->http_detected)) {
|
if((flow->l4.tcp.http_stage == 0) || (flow->http.url && flow->http_detected)) {
|
||||||
char *double_col = strchr((char*)flow->host_server_name, ':');
|
char *double_col = strchr((char*)flow->host_server_name, ':');
|
||||||
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
if(double_col) double_col[0] = '\0';
|
if(double_col) double_col[0] = '\0';
|
||||||
|
|
||||||
@@ -181,6 +183,7 @@ static void parseHttpSubprotocol(struct ndpi_detection_module_struct *ndpi_struc
|
|||||||
*/
|
*/
|
||||||
ndpi_match_host_subprotocol(ndpi_struct, flow, (char *)flow->host_server_name,
|
ndpi_match_host_subprotocol(ndpi_struct, flow, (char *)flow->host_server_name,
|
||||||
strlen((const char *)flow->host_server_name),
|
strlen((const char *)flow->host_server_name),
|
||||||
|
&ret_match,
|
||||||
NDPI_PROTOCOL_HTTP);
|
NDPI_PROTOCOL_HTTP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,12 +202,12 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
||||||
/* PPStream */
|
/* PPStream */
|
||||||
if(flow->l4.tcp.ppstream_stage > 0 && flow->iqiyi_counter == 0) {
|
if(flow->l4.tcp.ppstream_stage > 0 && flow->iqiyi_counter == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_PPSTREAM, ndpi_struct, NDPI_LOG_DEBUG, "PPStream found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found PPStream\n");
|
||||||
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM); */
|
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM); */
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_HTTP);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_HTTP);
|
||||||
}
|
}
|
||||||
else if(flow->iqiyi_counter > 0) {
|
else if(flow->iqiyi_counter > 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IQIYI, ndpi_struct, NDPI_LOG_DEBUG, "iQiyi found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found iQiyi\n");
|
||||||
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_IQIYI); */
|
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_IQIYI); */
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IQIYI, NDPI_PROTOCOL_HTTP);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IQIYI, NDPI_PROTOCOL_HTTP);
|
||||||
}
|
}
|
||||||
@@ -213,7 +216,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
||||||
/* 1KXUN */
|
/* 1KXUN */
|
||||||
if(flow->kxun_counter > 0) {
|
if(flow->kxun_counter > 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_1KXUN, ndpi_struct, NDPI_LOG_DEBUG, "1kxun found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found 1kxun\n");
|
||||||
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_1KXUN); */
|
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_1KXUN); */
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_1KXUN, NDPI_PROTOCOL_HTTP);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_1KXUN, NDPI_PROTOCOL_HTTP);
|
||||||
}
|
}
|
||||||
@@ -325,17 +328,18 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(token)
|
if(token)
|
||||||
setHttpUserAgent(flow, token);
|
setHttpUserAgent(ndpi_struct, flow, token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(memcmp(ua, "netflix-ios-app", 15) == 0) {
|
else if(memcmp(ua, "netflix-ios-app", 15) == 0) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found netflix\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NETFLIX);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NETFLIX);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "User Agent Type line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "User Agent Type line found %.*s\n",
|
||||||
packet->user_agent_line.len, packet->user_agent_line.ptr);
|
packet->user_agent_line.len, packet->user_agent_line.ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -343,26 +347,36 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
if(packet->host_line.ptr != NULL) {
|
if(packet->host_line.ptr != NULL) {
|
||||||
u_int len;
|
u_int len;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HOST line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "HOST line found %.*s\n",
|
||||||
packet->host_line.len, packet->host_line.ptr);
|
packet->host_line.len, packet->host_line.ptr);
|
||||||
|
|
||||||
/* call ndpi_match_host_subprotocol to see if there is a match with known-host HTTP subprotocol */
|
/* call ndpi_match_host_subprotocol to see if there is a match with known-host HTTP subprotocol */
|
||||||
if((ndpi_struct->http_dont_dissect_response) || flow->http_detected)
|
if((ndpi_struct->http_dont_dissect_response) || flow->http_detected) {
|
||||||
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
||||||
(char*)packet->host_line.ptr,
|
(char*)packet->host_line.ptr,
|
||||||
packet->host_line.len,
|
packet->host_line.len,
|
||||||
|
&ret_match,
|
||||||
NDPI_PROTOCOL_HTTP);
|
NDPI_PROTOCOL_HTTP);
|
||||||
|
}
|
||||||
|
|
||||||
/* Copy result for nDPI apps */
|
/* Copy result for nDPI apps */
|
||||||
|
if(!ndpi_struct->disable_metadata_export) {
|
||||||
len = ndpi_min(packet->host_line.len, sizeof(flow->host_server_name)-1);
|
len = ndpi_min(packet->host_line.len, sizeof(flow->host_server_name)-1);
|
||||||
strncpy((char*)flow->host_server_name, (char*)packet->host_line.ptr, len);
|
strncpy((char*)flow->host_server_name, (char*)packet->host_line.ptr, len);
|
||||||
flow->host_server_name[len] = '\0', flow->server_id = flow->dst;
|
flow->host_server_name[len] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
flow->server_id = flow->dst;
|
||||||
|
|
||||||
if(packet->forwarded_line.ptr) {
|
if(packet->forwarded_line.ptr) {
|
||||||
len = ndpi_min(packet->forwarded_line.len, sizeof(flow->protos.http.nat_ip)-1);
|
len = ndpi_min(packet->forwarded_line.len, sizeof(flow->protos.http.nat_ip)-1);
|
||||||
|
if(!ndpi_struct->disable_metadata_export) {
|
||||||
strncpy((char*)flow->protos.http.nat_ip, (char*)packet->forwarded_line.ptr, len);
|
strncpy((char*)flow->protos.http.nat_ip, (char*)packet->forwarded_line.ptr, len);
|
||||||
flow->protos.http.nat_ip[len] = '\0';
|
flow->protos.http.nat_ip[len] = '\0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(ndpi_struct->http_dont_dissect_response)
|
if(ndpi_struct->http_dont_dissect_response)
|
||||||
parseHttpSubprotocol(ndpi_struct, flow);
|
parseHttpSubprotocol(ndpi_struct, flow);
|
||||||
@@ -387,14 +401,20 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
|
|
||||||
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
|
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
|
||||||
&& ((ndpi_struct->http_dont_dissect_response) || flow->http_detected)
|
&& ((ndpi_struct->http_dont_dissect_response) || flow->http_detected)
|
||||||
&& (packet->http_origin.len > 0))
|
&& (packet->http_origin.len > 0)) {
|
||||||
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
||||||
(char *)packet->http_origin.ptr,
|
(char *)packet->http_origin.ptr,
|
||||||
packet->http_origin.len,
|
packet->http_origin.len,
|
||||||
|
&ret_match,
|
||||||
NDPI_PROTOCOL_HTTP);
|
NDPI_PROTOCOL_HTTP);
|
||||||
|
}
|
||||||
|
|
||||||
if(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) {
|
if(flow->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) {
|
||||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_HTTP) {
|
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_HTTP) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP/%s\n",
|
||||||
|
ndpi_get_proto_name(ndpi_struct, packet->detected_protocol_stack[0]));
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0]);
|
ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0]);
|
||||||
return; /* We have identified a sub-protocol so we're done */
|
return; /* We have identified a sub-protocol so we're done */
|
||||||
}
|
}
|
||||||
@@ -409,55 +429,51 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
|
|
||||||
/* check for accept line */
|
/* check for accept line */
|
||||||
if(packet->accept_line.ptr != NULL) {
|
if(packet->accept_line.ptr != NULL) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "Accept line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "Accept line found %.*s\n",
|
||||||
packet->accept_line.len, packet->accept_line.ptr);
|
packet->accept_line.len, packet->accept_line.ptr);
|
||||||
#ifdef NDPI_PROTOCOL_RTSP
|
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask,
|
||||||
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask, NDPI_PROTOCOL_RTSP) != 0) {
|
NDPI_PROTOCOL_RTSP) != 0) {
|
||||||
rtsp_parse_packet_acceptline(ndpi_struct, flow);
|
rtsp_parse_packet_acceptline(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* search for line startin with "Icy-MetaData" */
|
/* search for line startin with "Icy-MetaData" */
|
||||||
#ifdef NDPI_CONTENT_MPEG
|
|
||||||
for (a = 0; a < packet->parsed_lines; a++) {
|
for (a = 0; a < packet->parsed_lines; a++) {
|
||||||
if(packet->line[a].len > 11 && memcmp(packet->line[a].ptr, "Icy-MetaData", 12) == 0) {
|
if(packet->line[a].len > 11 && memcmp(packet->line[a].ptr, "Icy-MetaData", 12) == 0) {
|
||||||
NDPI_LOG(NDPI_CONTENT_MPEG, ndpi_struct, NDPI_LOG_DEBUG, "MPEG: Icy-MetaData found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found MPEG: Icy-MetaData\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_MPEG);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_CONTENT_CATEGORY_MPEG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef NDPI_CONTENT_AVI
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(packet->content_line.ptr != NULL && packet->content_line.len != 0) {
|
if(packet->content_line.ptr != NULL && packet->content_line.len != 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "Content Type line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "Content Type line found %.*s\n",
|
||||||
packet->content_line.len, packet->content_line.ptr);
|
packet->content_line.len, packet->content_line.ptr);
|
||||||
|
|
||||||
if((ndpi_struct->http_dont_dissect_response) || flow->http_detected)
|
if((ndpi_struct->http_dont_dissect_response) || flow->http_detected) {
|
||||||
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
ndpi_match_content_subprotocol(ndpi_struct, flow,
|
ndpi_match_content_subprotocol(ndpi_struct, flow,
|
||||||
(char*)packet->content_line.ptr, packet->content_line.len,
|
(char*)packet->content_line.ptr, packet->content_line.len,
|
||||||
NDPI_PROTOCOL_HTTP);
|
&ret_match, NDPI_PROTOCOL_HTTP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "called check_http_payload.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "called check_http_payload\n");
|
||||||
|
|
||||||
#ifdef NDPI_CONTENT_FLASH
|
#ifdef NDPI_CONTENT_CATEGORY_FLASH
|
||||||
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask, NDPI_CONTENT_FLASH) != 0)
|
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask, NDPI_CONTENT_CATEGORY_FLASH) != 0)
|
||||||
flash_check_http_payload(ndpi_struct, flow);
|
flash_check_http_payload(ndpi_struct, flow);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_AVI
|
#ifdef NDPI_CONTENT_CATEGORY_AVI
|
||||||
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask, NDPI_CONTENT_AVI) != 0)
|
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask, NDPI_CONTENT_CATEGORY_AVI) != 0)
|
||||||
avi_check_http_payload(ndpi_struct, flow);
|
avi_check_http_payload(ndpi_struct, flow);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_PROTOCOL_TEAMVIEWER
|
|
||||||
teamviewer_check_http_payload(ndpi_struct, flow);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
teamviewer_check_http_payload(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -466,106 +482,100 @@ static void check_http_payload(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
* @returnvalue 0 if no valid request has been found
|
* @returnvalue 0 if no valid request has been found
|
||||||
* @returnvalue >0 indicates start of filename but not necessarily in packet limit
|
* @returnvalue >0 indicates start of filename but not necessarily in packet limit
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define STATIC_STRING_L(a) {.str=a, .len=sizeof(a)-1 }
|
||||||
|
|
||||||
|
static struct l_string {
|
||||||
|
const char *str;
|
||||||
|
size_t len;
|
||||||
|
} http_methods[] = {
|
||||||
|
STATIC_STRING_L("GET "),
|
||||||
|
STATIC_STRING_L("POST "),
|
||||||
|
STATIC_STRING_L("OPTIONS "),
|
||||||
|
STATIC_STRING_L("HEAD "),
|
||||||
|
STATIC_STRING_L("PUT "),
|
||||||
|
STATIC_STRING_L("DELETE "),
|
||||||
|
STATIC_STRING_L("CONNECT "),
|
||||||
|
STATIC_STRING_L("PROPFIND "),
|
||||||
|
STATIC_STRING_L("REPORT ") };
|
||||||
|
static const char *http_fs = "CDGHOPR";
|
||||||
|
|
||||||
|
static uint8_t non_ctrl(uint8_t c) {
|
||||||
|
return c < 32 ? '.':c;
|
||||||
|
}
|
||||||
|
|
||||||
static u_int16_t http_request_url_offset(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static u_int16_t http_request_url_offset(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
int i;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "====>>>> HTTP: %c%c%c%c [len: %u]\n",
|
NDPI_LOG_DBG2(ndpi_struct, "====>>>> HTTP: %c%c%c%c [len: %u]\n",
|
||||||
packet->payload[0], packet->payload[1], packet->payload[2], packet->payload[3],
|
non_ctrl(packet->payload[0]), non_ctrl(packet->payload[1]),
|
||||||
|
non_ctrl(packet->payload[2]), non_ctrl(packet->payload[3]),
|
||||||
packet->payload_packet_len);
|
packet->payload_packet_len);
|
||||||
|
|
||||||
|
/* Check first char */
|
||||||
|
if(!strchr(http_fs,packet->payload[0])) return 0;
|
||||||
/**
|
/**
|
||||||
FIRST PAYLOAD PACKET FROM CLIENT
|
FIRST PAYLOAD PACKET FROM CLIENT
|
||||||
**/
|
**/
|
||||||
|
for(i=0; i < sizeof(http_methods)/sizeof(http_methods[0]); i++) {
|
||||||
/* check if the packet starts with POST or GET */
|
if(packet->payload_packet_len >= http_methods[i].len &&
|
||||||
if(packet->payload_packet_len >= 4 && memcmp(packet->payload, "GET ", 4) == 0) {
|
memcmp(packet->payload,http_methods[i].str,http_methods[i].len) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: GET FOUND\n");
|
NDPI_LOG_DBG2(ndpi_struct, "HTTP: %sFOUND\n",http_methods[i].str);
|
||||||
return 4;
|
return http_methods[i].len;
|
||||||
} else if(packet->payload_packet_len >= 5 && memcmp(packet->payload, "POST ", 5) == 0) {
|
}
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: POST FOUND\n");
|
|
||||||
return 5;
|
|
||||||
} else if(packet->payload_packet_len >= 8 && memcmp(packet->payload, "OPTIONS ", 8) == 0) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: OPTIONS FOUND\n");
|
|
||||||
return 8;
|
|
||||||
} else if(packet->payload_packet_len >= 5 && memcmp(packet->payload, "HEAD ", 5) == 0) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: HEAD FOUND\n");
|
|
||||||
return 5;
|
|
||||||
} else if(packet->payload_packet_len >= 4 && memcmp(packet->payload, "PUT ", 4) == 0) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: PUT FOUND\n");
|
|
||||||
return 4;
|
|
||||||
} else if(packet->payload_packet_len >= 7 && memcmp(packet->payload, "DELETE ", 7) == 0) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: DELETE FOUND\n");
|
|
||||||
return 7;
|
|
||||||
} else if(packet->payload_packet_len >= 8 && memcmp(packet->payload, "CONNECT ", 8) == 0) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: CONNECT FOUND\n");
|
|
||||||
return 8;
|
|
||||||
} else if(packet->payload_packet_len >= 9 && memcmp(packet->payload, "PROPFIND ", 9) == 0) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: PROFIND FOUND\n");
|
|
||||||
return 9;
|
|
||||||
} else if(packet->payload_packet_len >= 7 && memcmp(packet->payload, "REPORT ", 7) == 0) {
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: REPORT FOUND\n");
|
|
||||||
return 7;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void http_bitmask_exclude(struct ndpi_flow_struct *flow)
|
static void http_bitmask_exclude_other(struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP);
|
#ifdef NDPI_CONTENT_CATEGORY_MPEG
|
||||||
#ifdef NDPI_CONTENT_MPEG
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_MPEG);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_MPEG);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_QUICKTIME
|
#ifdef NDPI_CONTENT_CATEGORY_QUICKTIME
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_QUICKTIME);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_QUICKTIME);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_WINDOWSMEDIA
|
#ifdef NDPI_CONTENT_CATEGORY_WINDOWSMEDIA
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_WINDOWSMEDIA);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_WINDOWSMEDIA);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_REALMEDIA
|
#ifdef NDPI_CONTENT_CATEGORY_REALMEDIA
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_REALMEDIA);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_REALMEDIA);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_AVI
|
#ifdef NDPI_CONTENT_CATEGORY_AVI
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_AVI);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_AVI);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_OGG
|
#ifdef NDPI_CONTENT_CATEGORY_OGG
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_OGG);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_OGG);
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_PROTOCOL_MOVE
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MOVE);
|
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_XBOX
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_XBOX);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_XBOX);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************************************/
|
/*************************************************************************************************/
|
||||||
|
|
||||||
static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int16_t filename_start; /* the filename in the request method line, e.g., "GET filename_start..."*/
|
u_int16_t filename_start; /* the filename in the request method line, e.g., "GET filename_start..."*/
|
||||||
|
|
||||||
packet->packet_lines_parsed_complete = 0;
|
packet->packet_lines_parsed_complete = 0;
|
||||||
|
|
||||||
/* Check if we so far detected the protocol in the request or not. */
|
/* Check if we so far detected the protocol in the request or not. */
|
||||||
if(flow->l4.tcp.http_stage == 0) { /* Expected a request */
|
if(flow->l4.tcp.http_stage == 0) {
|
||||||
|
/* Expected a request */
|
||||||
flow->http_detected = 0;
|
flow->http_detected = 0;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP stage %d: \n",
|
NDPI_LOG_DBG2(ndpi_struct, "HTTP stage %d: \n", flow->l4.tcp.http_stage);
|
||||||
flow->l4.tcp.http_stage);
|
|
||||||
|
|
||||||
filename_start = http_request_url_offset(ndpi_struct, flow);
|
filename_start = http_request_url_offset(ndpi_struct, flow);
|
||||||
|
|
||||||
if(filename_start == 0) { /* not a regular request. In the HTTP first stage, may be a truncated flow or other protocols */
|
if(filename_start == 0) { /* not a regular request. In the HTTP first stage, may be a truncated flow or other protocols */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "Filename HTTP not found, we look for possible truncate flow..\n");
|
||||||
"Filename HTTP not found, we look for possible truncate flow...\n");
|
|
||||||
|
|
||||||
if(packet->payload_packet_len >= 7 && memcmp(packet->payload, "HTTP/1.", 7) == 0) {
|
if(packet->payload_packet_len >= 7 && memcmp(packet->payload, "HTTP/1.", 7) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP response\n");
|
||||||
"HTTP response found (truncated flow ?)\n");
|
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -577,6 +587,24 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((packet->payload_packet_len == 40) && (flow->l4.tcp.http_stage == 0)) {
|
||||||
|
/*
|
||||||
|
-> QR O06L0072-6L91-4O43-857J-K8OO172L6L51
|
||||||
|
<- QNUUX 2.5 2017-08-15.1314.4jn12m5
|
||||||
|
-> MXFWUXJM 31625365
|
||||||
|
*/
|
||||||
|
|
||||||
|
if((packet->payload[2] == ' ')
|
||||||
|
&& (packet->payload[11] == '-')
|
||||||
|
&& (packet->payload[16] == '-')
|
||||||
|
&& (packet->payload[21] == '-')
|
||||||
|
&& (packet->payload[26] == '-')
|
||||||
|
&& (packet->payload[39] == 0x0A)
|
||||||
|
)
|
||||||
|
flow->l4.tcp.http_stage = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if((packet->payload_packet_len == 23) && (memcmp(packet->payload, "<policy-file-request/>", 23) == 0)) {
|
if((packet->payload_packet_len == 23) && (memcmp(packet->payload, "<policy-file-request/>", 23) == 0)) {
|
||||||
/*
|
/*
|
||||||
<policy-file-request/>
|
<policy-file-request/>
|
||||||
@@ -589,18 +617,18 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "Exclude HTTP\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
http_bitmask_exclude(flow);
|
http_bitmask_exclude_other(flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"Filename HTTP found: %d, we look for line info..\n", filename_start);
|
"Filename HTTP found: %d, we look for line info..\n", filename_start);
|
||||||
|
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
|
|
||||||
if(packet->parsed_lines <= 1) {
|
if(packet->parsed_lines <= 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"Found just one line, we will look further for the next packet...\n");
|
"Found just one line, we will look further for the next packet...\n");
|
||||||
|
|
||||||
packet->http_method.ptr = packet->line[0].ptr;
|
packet->http_method.ptr = packet->line[0].ptr;
|
||||||
@@ -611,7 +639,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"Found more than one line, we look further for the next packet...\n");
|
"Found more than one line, we look further for the next packet...\n");
|
||||||
|
|
||||||
if(packet->line[0].len >= (9 + filename_start)
|
if(packet->line[0].len >= (9 + filename_start)
|
||||||
@@ -642,7 +670,8 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
|
|
||||||
/* Check for additional field introduced by Steam */
|
/* Check for additional field introduced by Steam */
|
||||||
int x = 1;
|
int x = 1;
|
||||||
if((memcmp(packet->line[x].ptr, "x-steam-sid", 11)) == 0) {
|
if(packet->line[x].len >= 11 && (memcmp(packet->line[x].ptr, "x-steam-sid", 11)) == 0) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found STEAM\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_STEAM);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_STEAM);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -652,6 +681,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
x = 1;
|
x = 1;
|
||||||
while(packet->line[x].len != 0) {
|
while(packet->line[x].len != 0) {
|
||||||
if(packet->line[x].len >= 12 && (memcmp(packet->line[x].ptr, "X-FB-SIM-HNI", 12)) == 0) {
|
if(packet->line[x].len >= 12 && (memcmp(packet->line[x].ptr, "X-FB-SIM-HNI", 12)) == 0) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found FACEBOOK\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FACEBOOK);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FACEBOOK);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
@@ -704,19 +734,19 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
|
|
||||||
if((packet->http_url_name.len > 7)
|
if((packet->http_url_name.len > 7)
|
||||||
&& (!strncmp((const char*) packet->http_url_name.ptr, "http://", 7))) {
|
&& (!strncmp((const char*) packet->http_url_name.ptr, "http://", 7))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP_PROXY Found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP_PROXY\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_PROXY);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_PROXY);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(filename_start == 8 && (memcmp(packet->payload, "CONNECT ", 8) == 0)) {
|
if(filename_start == 8 && (memcmp(packet->payload, "CONNECT ", 8) == 0)) {
|
||||||
/* nathan@getoffmalawn.com */
|
/* nathan@getoffmalawn.com */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP_CONNECT Found.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP_CONNECT\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_CONNECT);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_CONNECT);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"HTTP START Found, we will look for sub-protocols (content and host)...\n");
|
"HTTP START Found, we will look for sub-protocols (content and host)...\n");
|
||||||
|
|
||||||
if(packet->host_line.ptr != NULL) {
|
if(packet->host_line.ptr != NULL) {
|
||||||
@@ -729,10 +759,11 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
|
|
||||||
if(ndpi_struct->http_dont_dissect_response) {
|
if(ndpi_struct->http_dont_dissect_response) {
|
||||||
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) /* No subprotocol found */
|
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) /* No subprotocol found */
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
||||||
} else {
|
} else {
|
||||||
flow->http_detected = 1;
|
flow->http_detected = 1;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"HTTP START Found, we will look further for the response...\n");
|
"HTTP START Found, we will look further for the response...\n");
|
||||||
flow->l4.tcp.http_stage = packet->packet_direction + 1; // packet_direction 0: stage 1, packet_direction 1: stage 2
|
flow->l4.tcp.http_stage = packet->packet_direction + 1; // packet_direction 0: stage 1, packet_direction 1: stage 2
|
||||||
}
|
}
|
||||||
@@ -742,23 +773,26 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP: REQUEST NOT HTTP CONFORM\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
http_bitmask_exclude(flow);
|
http_bitmask_exclude_other(flow);
|
||||||
|
|
||||||
} else if((flow->l4.tcp.http_stage == 1) || (flow->l4.tcp.http_stage == 2)) {
|
} else if((flow->l4.tcp.http_stage == 1) || (flow->l4.tcp.http_stage == 2)) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP stage %u: \n",
|
NDPI_LOG_DBG2(ndpi_struct, "HTTP stage %u: \n", flow->l4.tcp.http_stage);
|
||||||
flow->l4.tcp.http_stage);
|
|
||||||
|
|
||||||
|
if((packet->payload_packet_len == 34) && (flow->l4.tcp.http_stage == 1)) {
|
||||||
|
if((packet->payload[5] == ' ') && (packet->payload[9] == ' ')) {
|
||||||
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(flow->l4.tcp.http_stage == 1) {
|
|
||||||
if((packet->payload_packet_len > 6) && memcmp(packet->payload, "HELLO ", 6) == 0) {
|
if((packet->payload_packet_len > 6) && memcmp(packet->payload, "HELLO ", 6) == 0) {
|
||||||
/* This looks like Ookla */
|
/* This looks like Ookla */
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OOKLA);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OOKLA);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
At first check, if this is for sure a response packet (in another direction. If not, if HTTP is detected do nothing now and return,
|
At first check, if this is for sure a response packet (in another direction. If not, if HTTP is detected do nothing now and return,
|
||||||
@@ -769,7 +803,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
if(flow->http_detected)
|
if(flow->http_detected)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
" SECOND PAYLOAD TRAFFIC FROM CLIENT, FIRST PACKET MIGHT HAVE BEEN HTTP...UNKNOWN TRAFFIC, HERE FOR HTTP again.. \n");
|
" SECOND PAYLOAD TRAFFIC FROM CLIENT, FIRST PACKET MIGHT HAVE BEEN HTTP...UNKNOWN TRAFFIC, HERE FOR HTTP again.. \n");
|
||||||
|
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
@@ -780,14 +814,13 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
if(packet->parsed_lines <= 1) {
|
if(packet->parsed_lines <= 1) {
|
||||||
/* wait some packets in case request is split over more than 2 packets */
|
/* wait some packets in case request is split over more than 2 packets */
|
||||||
if(flow->packet_counter < 5) {
|
if(flow->packet_counter < 5) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "line still not finished, search next packet\n");
|
||||||
"line still not finished, search next packet\n");
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
/* stop parsing here */
|
/* stop parsing here */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "exclude HTTP: PACKET DOES NOT HAVE A LINE STRUCTURE\n");
|
||||||
"HTTP: PACKET DOES NOT HAVE A LINE STRUCTURE\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
http_bitmask_exclude(flow);
|
http_bitmask_exclude_other(flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -795,11 +828,11 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
if(packet->line[0].len >= 9
|
if(packet->line[0].len >= 9
|
||||||
&& memcmp(&packet->line[0].ptr[packet->line[0].len - 9], " HTTP/1.", 8) == 0) {
|
&& memcmp(&packet->line[0].ptr[packet->line[0].len - 9], " HTTP/1.", 8) == 0) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "Found HTTP.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"HTTP START Found in 2. packet, we will look further for the response....\n");
|
"HTTP START Found in 2. packet, we will look further for the response....\n");
|
||||||
flow->http_detected = 1;
|
flow->http_detected = 1;
|
||||||
}
|
}
|
||||||
@@ -817,15 +850,17 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
*/
|
*/
|
||||||
if((packet->parsed_lines == 1) && (packet->packet_direction == 1 /* server -> client */)) {
|
if((packet->parsed_lines == 1) && (packet->packet_direction == 1 /* server -> client */)) {
|
||||||
/* In Apache if you do "GET /\n\n" the response comes without any header */
|
/* In Apache if you do "GET /\n\n" the response comes without any header */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "Found HTTP. (apache)\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP. (apache)\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we already detected the HTTP request, we can add the connection and then check for the sub-protocol */
|
/* If we already detected the HTTP request, we can add the connection and then check for the sub-protocol */
|
||||||
if(flow->http_detected)
|
if(flow->http_detected) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
||||||
|
}
|
||||||
|
|
||||||
/* Parse packet line and we look for the subprotocols */
|
/* Parse packet line and we look for the subprotocols */
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
@@ -836,14 +871,13 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(packet->empty_line_position_set != 0 || flow->l4.tcp.http_empty_line_seen == 1) {
|
if(packet->empty_line_position_set != 0 || flow->l4.tcp.http_empty_line_seen == 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "empty line. check_http_payload.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "empty line. check_http_payload\n");
|
||||||
check_http_payload(ndpi_struct, flow);
|
check_http_payload(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
flow->l4.tcp.http_stage = 0;
|
flow->l4.tcp.http_stage = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
@@ -852,8 +886,8 @@ void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
/* Break after 20 packets. */
|
/* Break after 20 packets. */
|
||||||
if(flow->packet_counter > 20) {
|
if(flow->packet_counter > 20) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "Exclude HTTP.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
http_bitmask_exclude(flow);
|
http_bitmask_exclude_other(flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -861,7 +895,7 @@ void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP, ndpi_struct, NDPI_LOG_DEBUG, "HTTP detection...\n");
|
NDPI_LOG_DBG(ndpi_struct, "search HTTP\n");
|
||||||
ndpi_check_http_tcp(ndpi_struct, flow);
|
ndpi_check_http_tcp(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -916,9 +950,9 @@ void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
|
|
||||||
#ifdef NDPI_CONTENT_MPEG
|
#ifdef NDPI_CONTENT_CATEGORY_MPEG
|
||||||
ndpi_set_bitmask_protocol_detection("MPEG", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("MPEG", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_MPEG,
|
NDPI_CONTENT_CATEGORY_MPEG,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
@@ -926,52 +960,52 @@ void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_FLASH
|
#ifdef NDPI_CONTENT_CATEGORY_FLASH
|
||||||
ndpi_set_bitmask_protocol_detection("Flash", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("Flash", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_FLASH,
|
NDPI_CONTENT_CATEGORY_FLASH,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_QUICKTIME
|
#ifdef NDPI_CONTENT_CATEGORY_QUICKTIME
|
||||||
ndpi_set_bitmask_protocol_detection("QuickTime", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("QuickTime", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_QUICKTIME,
|
NDPI_CONTENT_CATEGORY_QUICKTIME,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_REALMEDIA
|
#ifdef NDPI_CONTENT_CATEGORY_REALMEDIA
|
||||||
ndpi_set_bitmask_protocol_detection("RealMedia", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("RealMedia", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_REALMEDIA,
|
NDPI_CONTENT_CATEGORY_REALMEDIA,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_WINDOWSMEDIA
|
#ifdef NDPI_CONTENT_CATEGORY_WINDOWSMEDIA
|
||||||
ndpi_set_bitmask_protocol_detection("WindowsMedia", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("WindowsMedia", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_WINDOWSMEDIA,
|
NDPI_CONTENT_CATEGORY_WINDOWSMEDIA,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_MMS
|
#ifdef NDPI_CONTENT_CATEGORY_MMS
|
||||||
ndpi_set_bitmask_protocol_detection("MMS", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("MMS", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_MMS,
|
NDPI_CONTENT_CATEGORY_MMS,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_PROTOCOL_XBOX
|
|
||||||
ndpi_set_bitmask_protocol_detection("Xbox", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("Xbox", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_XBOX,
|
NDPI_PROTOCOL_XBOX,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
@@ -979,8 +1013,7 @@ void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_QQ
|
|
||||||
ndpi_set_bitmask_protocol_detection("QQ", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("QQ", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_QQ,
|
NDPI_PROTOCOL_QQ,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
@@ -988,28 +1021,19 @@ void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
|
||||||
#ifdef NDPI_CONTENT_AVI
|
#ifdef NDPI_CONTENT_CATEGORY_AVI
|
||||||
ndpi_set_bitmask_protocol_detection("AVI", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("AVI", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_AVI,
|
NDPI_CONTENT_CATEGORY_AVI,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
*id += 1;
|
*id += 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef NDPI_CONTENT_OGG
|
#ifdef NDPI_CONTENT_CATEGORY_OGG
|
||||||
ndpi_set_bitmask_protocol_detection("OggVorbis", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("OggVorbis", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_CONTENT_OGG,
|
NDPI_CONTENT_CATEGORY_OGG,
|
||||||
ndpi_search_http_tcp,
|
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
|
||||||
ADD_TO_DETECTION_BITMASK);
|
|
||||||
*id += 1;
|
|
||||||
#endif
|
|
||||||
#ifdef NDPI_PROTOCOL_MOVE
|
|
||||||
ndpi_set_bitmask_protocol_detection("Move", ndpi_struct, detection_bitmask, *id,
|
|
||||||
NDPI_PROTOCOL_MOVE,
|
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||||
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
@@ -1026,11 +1050,11 @@ void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
|
|
||||||
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_PROTOCOL_QQ);
|
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_PROTOCOL_QQ);
|
||||||
|
|
||||||
#ifdef NDPI_CONTENT_FLASH
|
#ifdef NDPI_CONTENT_CATEGORY_FLASH
|
||||||
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_CONTENT_FLASH);
|
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_FLASH);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_CONTENT_MMS);
|
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_CONTENT_CATEGORY_MMS);
|
||||||
|
|
||||||
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_PROTOCOL_XBOX);
|
NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[a].excluded_protocol_bitmask, NDPI_PROTOCOL_XBOX);
|
||||||
|
|
||||||
@@ -1042,7 +1066,4 @@ void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
a++;
|
a++;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* http_activesync.c
|
* http_activesync.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -24,39 +24,41 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
#ifdef NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_HTTP_ACTIVESYNC
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
static void ndpi_int_activesync_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_activesync_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, NDPI_PROTOCOL_HTTP);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_ACTIVESYNC, NDPI_PROTOCOL_HTTP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_activesync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_activesync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search activesync\n");
|
||||||
if (packet->tcp != NULL) {
|
if (packet->tcp != NULL) {
|
||||||
|
|
||||||
if (packet->payload_packet_len > 150
|
if (packet->payload_packet_len > 150
|
||||||
&& ((memcmp(packet->payload, "OPTIONS /Microsoft-Server-ActiveSync?", 37) == 0)
|
&& ((memcmp(packet->payload, "OPTIONS /Microsoft-Server-ActiveSync?", 37) == 0)
|
||||||
|| (memcmp(packet->payload, "POST /Microsoft-Server-ActiveSync?", 34) == 0))) {
|
|| (memcmp(packet->payload, "POST /Microsoft-Server-ActiveSync?", 34) == 0))) {
|
||||||
ndpi_int_activesync_add_connection(ndpi_struct, flow);
|
ndpi_int_activesync_add_connection(ndpi_struct, flow);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct, "found ActiveSync \n");
|
||||||
" flow marked as ActiveSync \n");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, ndpi_struct, NDPI_LOG_DEBUG, "exclude activesync\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void init_http_activesync_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
void init_http_activesync_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
{
|
{
|
||||||
ndpi_set_bitmask_protocol_detection("HTTP_Application_ActiveSync", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("HTTP_Application_ActiveSync", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC,
|
NDPI_PROTOCOL_HTTP_ACTIVESYNC,
|
||||||
ndpi_search_activesync,
|
ndpi_search_activesync,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
||||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
@@ -65,4 +67,3 @@ void init_http_activesync_dissector(struct ndpi_detection_module_struct *ndpi_st
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+9
-11
@@ -2,7 +2,7 @@
|
|||||||
* iax.c
|
* iax.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,9 +23,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IAX
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_IAX
|
|
||||||
|
|
||||||
#define NDPI_IAX_MAX_INFORMATION_ELEMENTS 15
|
#define NDPI_IAX_MAX_INFORMATION_ELEMENTS 15
|
||||||
|
|
||||||
@@ -58,7 +61,7 @@ static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_stru
|
|||||||
&& packet->payload[11] <= 15) {
|
&& packet->payload[11] <= 15) {
|
||||||
|
|
||||||
if (packet->payload_packet_len == 12) {
|
if (packet->payload_packet_len == 12) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IAX, ndpi_struct, NDPI_LOG_DEBUG, "found IAX.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found IAX\n");
|
||||||
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -66,7 +69,7 @@ static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_stru
|
|||||||
for (i = 0; i < NDPI_IAX_MAX_INFORMATION_ELEMENTS; i++) {
|
for (i = 0; i < NDPI_IAX_MAX_INFORMATION_ELEMENTS; i++) {
|
||||||
packet_len = packet_len + 2 + packet->payload[packet_len + 1];
|
packet_len = packet_len + 2 + packet->payload[packet_len + 1];
|
||||||
if (packet_len == packet->payload_packet_len) {
|
if (packet_len == packet->payload_packet_len) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IAX, ndpi_struct, NDPI_LOG_DEBUG, "found IAX.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found IAX\n");
|
||||||
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
ndpi_int_iax_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -77,16 +80,13 @@ static void ndpi_search_setup_iax(struct ndpi_detection_module_struct *ndpi_stru
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IAX);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_iax(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_iax(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_flow_struct *flow=ndpi_struct->flow;
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
if(packet->udp
|
if(packet->udp
|
||||||
&& (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN))
|
&& (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN))
|
||||||
@@ -105,5 +105,3 @@ void init_iax_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+16
-16
@@ -2,7 +2,7 @@
|
|||||||
* icecast.c
|
* icecast.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,11 +22,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ICECAST
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_ICECAST
|
|
||||||
|
|
||||||
static void ndpi_int_icecast_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_icecast_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ICECAST, NDPI_PROTOCOL_UNKNOWN);
|
||||||
@@ -37,17 +38,17 @@ void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, s
|
|||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int8_t i;
|
u_int8_t i;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ICECAST, ndpi_struct, NDPI_LOG_DEBUG, "search icecast.\n");
|
NDPI_LOG_DBG(ndpi_struct, "search icecast\n");
|
||||||
|
|
||||||
if((packet->payload_packet_len < 500 &&
|
if((packet->payload_packet_len < 500 &&
|
||||||
packet->payload_packet_len >= 7 && memcmp(packet->payload, "SOURCE ", 7) == 0)
|
packet->payload_packet_len >= 7 && memcmp(packet->payload, "SOURCE ", 7) == 0)
|
||||||
|| flow->l4.tcp.icecast_stage) {
|
|| flow->l4.tcp.icecast_stage) {
|
||||||
ndpi_parse_packet_line_info_any(ndpi_struct, flow);
|
ndpi_parse_packet_line_info_any(ndpi_struct, flow);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ICECAST, ndpi_struct, NDPI_LOG_DEBUG, "Icecast lines=%d\n", packet->parsed_lines);
|
NDPI_LOG_DBG2(ndpi_struct, "Icecast lines=%d\n", packet->parsed_lines);
|
||||||
for (i = 0; i < packet->parsed_lines; i++) {
|
for (i = 0; i < packet->parsed_lines; i++) {
|
||||||
if(packet->line[i].ptr != NULL && packet->line[i].len > 4
|
if(packet->line[i].ptr != NULL && packet->line[i].len > 4
|
||||||
&& memcmp(packet->line[i].ptr, "ice-", 4) == 0) {
|
&& memcmp(packet->line[i].ptr, "ice-", 4) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ICECAST, ndpi_struct, NDPI_LOG_DEBUG, "Icecast detected.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Icecast\n");
|
||||||
ndpi_int_icecast_add_connection(ndpi_struct, flow);
|
ndpi_int_icecast_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -58,13 +59,13 @@ void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, s
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef NDPI_PROTOCOL_HTTP
|
|
||||||
if(NDPI_FLOW_PROTOCOL_EXCLUDED(ndpi_struct, flow, NDPI_PROTOCOL_HTTP)) {
|
if(NDPI_FLOW_PROTOCOL_EXCLUDED(ndpi_struct, flow, NDPI_PROTOCOL_HTTP)) {
|
||||||
goto icecast_exclude;
|
goto icecast_exclude;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (packet->packet_direction == flow->setup_packet_direction && flow->packet_counter < 10) {
|
if((packet->packet_direction == flow->setup_packet_direction)
|
||||||
|
&& (flow->packet_counter < 10)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,20 +74,21 @@ void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, s
|
|||||||
|
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
|
|
||||||
if (packet->server_line.ptr != NULL && packet->server_line.len > NDPI_STATICSTRING_LEN("Icecast") &&
|
if((packet->server_line.ptr != NULL)
|
||||||
memcmp(packet->server_line.ptr, "Icecast", NDPI_STATICSTRING_LEN("Icecast")) == 0) {
|
&& (packet->server_line.len > NDPI_STATICSTRING_LEN("Icecast"))
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ICECAST, ndpi_struct, NDPI_LOG_DEBUG, "Icecast detected.\n");
|
&& memcmp(packet->server_line.ptr, "Icecast",
|
||||||
|
NDPI_STATICSTRING_LEN("Icecast")) == 0) {
|
||||||
/* TODO maybe store the previous protocol type as subtype?
|
/* TODO maybe store the previous protocol type as subtype?
|
||||||
* e.g. ogg or mpeg
|
* e.g. ogg or mpeg
|
||||||
*/
|
*/
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found Icecast\n");
|
||||||
ndpi_int_icecast_add_connection(ndpi_struct, flow);
|
ndpi_int_icecast_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
icecast_exclude:
|
icecast_exclude:
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_ICECAST);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_ICECAST, ndpi_struct, NDPI_LOG_DEBUG, "Icecast excluded.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -101,5 +103,3 @@ void init_icecast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+17
-20
@@ -2,7 +2,7 @@
|
|||||||
* ipp.c
|
* ipp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,10 +22,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IPP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_IPP
|
|
||||||
|
|
||||||
static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
|
struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
|
||||||
@@ -36,22 +38,20 @@ static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndp
|
|||||||
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
u_int8_t i;
|
u_int8_t i;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "search ipp\n");
|
NDPI_LOG_DBG(ndpi_struct, "search ipp\n");
|
||||||
|
|
||||||
if (packet->payload_packet_len > 20) {
|
if (packet->payload_packet_len > 20) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"searching for a payload with a pattern like 'number(1to8)blanknumber(1to3)ipp://.\n");
|
"searching for a payload with a pattern like 'number(1to8)blanknumber(1to3)ipp://.\n");
|
||||||
/* this pattern means that there is a printer saying that his state is idle,
|
/* this pattern means that there is a printer saying that his state is idle,
|
||||||
* means that he is not printing anything at the moment */
|
* means that he is not printing anything at the moment */
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
if (packet->payload[i] < '0' || packet->payload[i] > '9') {
|
if (packet->payload[i] < '0' || packet->payload[i] > '9') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "payload does not begin with a number.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "payload does not begin with a number\n");
|
||||||
goto search_for_next_pattern;
|
goto search_for_next_pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,37 +60,37 @@ void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
if (!((packet->payload[i] >= '0' && packet->payload[i] <= '9') ||
|
if (!((packet->payload[i] >= '0' && packet->payload[i] <= '9') ||
|
||||||
(packet->payload[i] >= 'a' && packet->payload[i] <= 'f') ||
|
(packet->payload[i] >= 'a' && packet->payload[i] <= 'f') ||
|
||||||
(packet->payload[i] >= 'A' && packet->payload[i] <= 'F')) || i > 8) {
|
(packet->payload[i] >= 'A' && packet->payload[i] <= 'F')) || i > 8) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"read symbols while the symbol is a number.\n");
|
"read symbols while the symbol is a number.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload[i++] != ' ') {
|
if (packet->payload[i++] != ' ') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "there is no blank following the number.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "there is no blank following the number\n");
|
||||||
goto search_for_next_pattern;
|
goto search_for_next_pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload[i] < '0' || packet->payload[i] > '9') {
|
if (packet->payload[i] < '0' || packet->payload[i] > '9') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "no number following the blank.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "no number following the blank\n");
|
||||||
goto search_for_next_pattern;
|
goto search_for_next_pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
i++;
|
i++;
|
||||||
if (packet->payload[i] < '0' || packet->payload[i] > '9' || i > 12) {
|
if (packet->payload[i] < '0' || packet->payload[i] > '9' || i > 12) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"read symbols while the symbol is a number.\n");
|
"read symbols while the symbol is a number.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (memcmp(&packet->payload[i], " ipp://", 7) != 0) {
|
if (memcmp(&packet->payload[i], " ipp://", 7) != 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "the string ' ipp://' does not follow.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "the string ' ipp://' does not follow\n");
|
||||||
goto search_for_next_pattern;
|
goto search_for_next_pattern;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "found ipp\n");
|
NDPI_LOG_INFO(ndpi_struct, "found ipp\n");
|
||||||
ndpi_int_ipp_add_connection(ndpi_struct, flow);
|
ndpi_int_ipp_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -101,13 +101,12 @@ void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
if (packet->content_line.ptr != NULL && packet->content_line.len > 14
|
if (packet->content_line.ptr != NULL && packet->content_line.len > 14
|
||||||
&& memcmp(packet->content_line.ptr, "application/ipp", 15) == 0) {
|
&& memcmp(packet->content_line.ptr, "application/ipp", 15) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "found ipp via POST ... application/ipp.\n");
|
NDPI_LOG_INFO(ndpi_struct, "found ipp via POST ... application/ipp\n");
|
||||||
ndpi_int_ipp_add_connection(ndpi_struct, flow);
|
ndpi_int_ipp_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IPP, ndpi_struct, NDPI_LOG_DEBUG, "no ipp detected.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IPP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -122,5 +121,3 @@ void init_ipp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+67
-96
@@ -2,7 +2,7 @@
|
|||||||
* irc.c
|
* irc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,9 +23,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IRC
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_IRC
|
|
||||||
#define NDPI_IRC_FIND_LESS(time_err,less) {int t1 = 0; \
|
#define NDPI_IRC_FIND_LESS(time_err,less) {int t1 = 0; \
|
||||||
u_int32_t timestamp = time_err[0]; \
|
u_int32_t timestamp = time_err[0]; \
|
||||||
for(t1=0;t1 < NDPI_PROTOCOL_IRC_MAXPORT;t1++) { \
|
for(t1=0;t1 < NDPI_PROTOCOL_IRC_MAXPORT;t1++) { \
|
||||||
@@ -68,7 +71,7 @@ static u_int8_t ndpi_check_for_NOTICE_or_PRIVMSG(struct ndpi_detection_module_st
|
|||||||
for (i = 0; i < packet->payload_packet_len - 7; i++) {
|
for (i = 0; i < packet->payload_packet_len - 7; i++) {
|
||||||
if (packet->payload[i] == 'N' || packet->payload[i] == 'P') {
|
if (packet->payload[i] == 'N' || packet->payload[i] == 'P') {
|
||||||
if (memcmp(&packet->payload[i + 1], "OTICE ", 6) == 0 || memcmp(&packet->payload[i + 1], "RIVMSG ", 7) == 0) {
|
if (memcmp(&packet->payload[i + 1], "OTICE ", 6) == 0 || memcmp(&packet->payload[i + 1], "RIVMSG ", 7) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "found NOTICE or PRIVMSG\n");
|
NDPI_LOG_DBG2(ndpi_struct, "found NOTICE or PRIVMSG\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,7 +100,7 @@ static u_int8_t ndpi_check_for_Nickname(struct ndpi_detection_module_struct *ndp
|
|||||||
if ((((packetl - (i + 1)) >= 4) && memcmp(&packet->payload[i + 1], "ick=", 4) == 0)
|
if ((((packetl - (i + 1)) >= 4) && memcmp(&packet->payload[i + 1], "ick=", 4) == 0)
|
||||||
|| (((packetl - (i + 1)) >= 8) && (memcmp(&packet->payload[i + 1], "ickname=", 8) == 0))
|
|| (((packetl - (i + 1)) >= 8) && (memcmp(&packet->payload[i + 1], "ickname=", 8) == 0))
|
||||||
|| (((packetl - (i + 1)) >= 8) && (memcmp(&packet->payload[i + 1], "ickName=", 8) == 0))) {
|
|| (((packetl - (i + 1)) >= 8) && (memcmp(&packet->payload[i + 1], "ickName=", 8) == 0))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "found HTTP IRC Nickname pattern\n");
|
NDPI_LOG_DBG2(ndpi_struct, "found HTTP IRC Nickname pattern\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +120,7 @@ static u_int8_t ndpi_check_for_cmd(struct ndpi_detection_module_struct *ndpi_str
|
|||||||
for (i = 0; i < packet->payload_packet_len - 4; i++) {
|
for (i = 0; i < packet->payload_packet_len - 4; i++) {
|
||||||
if (packet->payload[i] == 'c') {
|
if (packet->payload[i] == 'c') {
|
||||||
if (memcmp(&packet->payload[i + 1], "md=", 3) == 0) {
|
if (memcmp(&packet->payload[i + 1], "md=", 3) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "found HTTP IRC cmd pattern \n");
|
NDPI_LOG_DBG2(ndpi_struct, "found HTTP IRC cmd pattern \n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,8 +153,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG(ndpi_struct, "start fast detect\n");
|
||||||
"called ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast\n");
|
|
||||||
|
|
||||||
/* case 1: len 1460, len 1460, len 1176 several times in one direction, than len = 4, 4096, 8192 in the other direction */
|
/* case 1: len 1460, len 1460, len 1176 several times in one direction, than len = 4, 4096, 8192 in the other direction */
|
||||||
if (packet->payload_packet_len == 1460
|
if (packet->payload_packet_len == 1460
|
||||||
@@ -177,7 +179,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 0x1000
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 0x1000
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||||
0x2000)) {
|
0x2000)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1460,1460,1176,<-4096||8192");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1460,1460,1176,<-4096||8192");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -188,27 +190,27 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
1 + packet->packet_direction))) {
|
1 + packet->packet_direction))) {
|
||||||
flow->l4.tcp.irc_stage2 = 4;
|
flow->l4.tcp.irc_stage2 = 4;
|
||||||
flow->l4.tcp.irc_direction = 1 + packet->packet_direction;
|
flow->l4.tcp.irc_direction = 1 + packet->packet_direction;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "len = 1448 first\n");
|
NDPI_LOG_DBG2(ndpi_struct, "len = 1448 first\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 1448 && flow->l4.tcp.irc_stage2 == 4
|
if (packet->payload_packet_len == 1448 && flow->l4.tcp.irc_stage2 == 4
|
||||||
&& flow->l4.tcp.irc_direction == 1 + packet->packet_direction) {
|
&& flow->l4.tcp.irc_direction == 1 + packet->packet_direction) {
|
||||||
flow->l4.tcp.irc_stage2 = 5;
|
flow->l4.tcp.irc_stage2 = 5;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "len = 1448 second \n");
|
NDPI_LOG_DBG2(ndpi_struct, "len = 1448 second \n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 1200 && flow->l4.tcp.irc_stage2 == 5
|
if (packet->payload_packet_len == 1200 && flow->l4.tcp.irc_stage2 == 5
|
||||||
&& flow->l4.tcp.irc_direction == 1 + packet->packet_direction) {
|
&& flow->l4.tcp.irc_direction == 1 + packet->packet_direction) {
|
||||||
flow->l4.tcp.irc_stage2 = 6;
|
flow->l4.tcp.irc_stage2 = 6;
|
||||||
flow->l4.tcp.irc_0x1000_full = 1;
|
flow->l4.tcp.irc_0x1000_full = 1;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "len = 1200 \n");
|
NDPI_LOG_DBG2(ndpi_struct, "len = 1200 \n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 4 && (flow->l4.tcp.irc_stage2 == 6 || flow->l4.tcp.irc_0x1000_full == 1)
|
if (packet->payload_packet_len == 4 && (flow->l4.tcp.irc_stage2 == 6 || flow->l4.tcp.irc_0x1000_full == 1)
|
||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 0x1000
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 0x1000
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||||
0x2000)) {
|
0x2000)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1448,1448,1200,<-4096||8192");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1448,1448,1200,<-4096||8192");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -225,7 +227,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1380
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1380
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||||
2760)) {
|
2760)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1380,<-1380||2760");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1380,<-1380||2760");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -240,7 +242,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1200
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1200
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||||
2400)) {
|
2400)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1200,<-1200||2400");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1200,<-1200||2400");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -255,7 +257,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1024
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1024
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||||
2048)) {
|
2048)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1024,<-1024||2048");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1024,<-1024||2048");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -270,7 +272,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1248
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1248
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||||
2496)) {
|
2496)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1248,<-1248||2496");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1248,<-1248||2496");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -285,7 +287,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1448
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && (ntohs(get_u_int16_t(packet->payload, 2)) == 1448
|
||||||
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
|| ntohs(get_u_int16_t(packet->payload, 2)) ==
|
||||||
2896)) {
|
2896)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1448,<-1448||2896");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1448,<-1448||2896");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -308,8 +310,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
if (packet->payload_packet_len == 4
|
if (packet->payload_packet_len == 4
|
||||||
&& flow->l4.tcp.irc_stage2 == 14
|
&& flow->l4.tcp.irc_stage2 == 14
|
||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 8192) {
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 8192) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1448,1448,1448,1448,1448,952,<-8192");
|
||||||
"IRC SSL detected: ->1448,1448,1448,1448,1448,952,<-8192");
|
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -342,8 +343,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
if (packet->payload_packet_len == 4
|
if (packet->payload_packet_len == 4
|
||||||
&& flow->l4.tcp.irc_stage2 == 19
|
&& flow->l4.tcp.irc_stage2 == 19
|
||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 7168) {
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 7168) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1024,1448,1448,1200,1448,600,<-7168");
|
||||||
"IRC SSL detected: ->1024,1448,1448,1200,1448,600,<-7168");
|
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -356,7 +356,7 @@ u_int8_t ndpi_search_irc_ssl_detect_ninety_percent_but_very_fast(struct ndpi_det
|
|||||||
if (packet->payload_packet_len == 4
|
if (packet->payload_packet_len == 4
|
||||||
&& flow->l4.tcp.irc_stage2 == 20
|
&& flow->l4.tcp.irc_stage2 == 20
|
||||||
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 2404) {
|
&& flow->l4.tcp.irc_direction == 2 - packet->packet_direction && ntohs(get_u_int16_t(packet->payload, 2)) == 2404) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC SSL detected: ->1024,1380 <-2404");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC SSL: ->1024,1380 <-2404");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
@@ -385,26 +385,26 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
u_int16_t http_content_ptr_len = 0;
|
u_int16_t http_content_ptr_len = 0;
|
||||||
u_int8_t space = 0;
|
u_int8_t space = 0;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "irc : search irc\n");
|
NDPI_LOG_DBG(ndpi_struct, "search irc\n");
|
||||||
if (flow->detected_protocol_stack[0] != NDPI_PROTOCOL_IRC && flow->packet_counter > 70) {
|
if (flow->detected_protocol_stack[0] != NDPI_PROTOCOL_IRC && flow->packet_counter > 70) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "exclude irc, packet_counter > 70\n");
|
NDPI_LOG_DBG(ndpi_struct, "exclude irc, packet_counter > 70\n");
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IRC);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IRC);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (flow->detected_protocol_stack[0] != NDPI_PROTOCOL_IRC && flow->packet_counter > 30 &&
|
if (flow->detected_protocol_stack[0] != NDPI_PROTOCOL_IRC && flow->packet_counter > 30 &&
|
||||||
flow->l4.tcp.irc_stage2 == 0) {
|
flow->l4.tcp.irc_stage2 == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "packet_counter > 30, exclude irc.\n");
|
NDPI_LOG_DBG(ndpi_struct, "exclude irc, packet_counter > 30\n");
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IRC);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IRC);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_IRC) {
|
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_IRC) {
|
||||||
if (src != NULL && ((u_int32_t)
|
if (src != NULL && ((u_int32_t)
|
||||||
(packet->tick_timestamp - src->irc_ts) < ndpi_struct->irc_timeout)) {
|
(packet->tick_timestamp - src->irc_ts) < ndpi_struct->irc_timeout)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "irc : save src connection packet detected\n");
|
NDPI_LOG_DBG2(ndpi_struct, "irc : save src connection packet detected\n");
|
||||||
src->irc_ts = packet->tick_timestamp;
|
src->irc_ts = packet->tick_timestamp;
|
||||||
} else if (dst != NULL && ((u_int32_t)
|
} else if (dst != NULL && ((u_int32_t)
|
||||||
(packet->tick_timestamp - dst->irc_ts) < ndpi_struct->irc_timeout)) {
|
(packet->tick_timestamp - dst->irc_ts) < ndpi_struct->irc_timeout)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "irc : save dst connection packet detected\n");
|
NDPI_LOG_DBG2(ndpi_struct, "irc : save dst connection packet detected\n");
|
||||||
dst->irc_ts = packet->tick_timestamp;
|
dst->irc_ts = packet->tick_timestamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -426,8 +426,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
for (counter = 0; counter < dst->irc_number_of_port; counter++) {
|
for (counter = 0; counter < dst->irc_number_of_port; counter++) {
|
||||||
if (dst->irc_port[counter] == sport || dst->irc_port[counter] == dport) {
|
if (dst->irc_port[counter] == sport || dst->irc_port[counter] == dport) {
|
||||||
dst->last_time_port_used[counter] = packet->tick_timestamp;
|
dst->last_time_port_used[counter] = packet->tick_timestamp;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_INFO(ndpi_struct, "found IRC: dest port matched with the DCC port");
|
||||||
"dest port matched with the DCC port and the flow is marked as IRC");
|
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -437,9 +436,8 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
for (counter = 0; counter < src->irc_number_of_port; counter++) {
|
for (counter = 0; counter < src->irc_number_of_port; counter++) {
|
||||||
if (src->irc_port[counter] == sport || src->irc_port[counter] == dport) {
|
if (src->irc_port[counter] == sport || src->irc_port[counter] == dport) {
|
||||||
src->last_time_port_used[counter] = packet->tick_timestamp;
|
src->last_time_port_used[counter] = packet->tick_timestamp;
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found IRC: Source port matched with the DCC port");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
|
||||||
"Source port matched with the DCC port and the flow is marked as IRC");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -468,8 +466,8 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
|| (memcmp(&packet->payload[c1], "irc.discostars.de1", 18)
|
|| (memcmp(&packet->payload[c1], "irc.discostars.de1", 18)
|
||||||
== 0)
|
== 0)
|
||||||
|| (memcmp(&packet->payload[c1], "irc.rizon.net", 13) == 0)) {
|
|| (memcmp(&packet->payload[c1], "irc.rizon.net", 13) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"IRC SSL detected with :- irc.hackthissite.org0 | irc.gamepad.ca1 | dungeon.axenet.org0 "
|
"found IRC SSL: - irc.hackthissite.org0 | irc.gamepad.ca1 | dungeon.axenet.org0 "
|
||||||
"| dazed.nuggethaus.net | irc.indymedia.org | irc.discostars.de1 ");
|
"| dazed.nuggethaus.net | irc.indymedia.org | irc.discostars.de1 ");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
break;
|
break;
|
||||||
@@ -499,14 +497,14 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
if (packet->line[i].ptr[0] == ':') {
|
if (packet->line[i].ptr[0] == ':') {
|
||||||
flow->l4.tcp.irc_3a_counter++;
|
flow->l4.tcp.irc_3a_counter++;
|
||||||
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "0x3a. seven times. found irc.");
|
NDPI_LOG_INFO(ndpi_struct, "found irc. 0x3a. seven times.");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
goto detected_irc;
|
goto detected_irc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "0x3a. seven times. found irc.");
|
NDPI_LOG_INFO(ndpi_struct, "found irc. 0x3a. seven times.");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
goto detected_irc;
|
goto detected_irc;
|
||||||
}
|
}
|
||||||
@@ -521,19 +519,19 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
|| (memcmp(packet->payload, "NOTICE ", 7) == 0)
|
|| (memcmp(packet->payload, "NOTICE ", 7) == 0)
|
||||||
|| (memcmp(packet->payload, "PRIVMSG ", 8) == 0)
|
|| (memcmp(packet->payload, "PRIVMSG ", 8) == 0)
|
||||||
|| (memcmp(packet->payload, "VERSION ", 8) == 0)) {
|
|| (memcmp(packet->payload, "VERSION ", 8) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"USER, NICK, PASS, NOTICE, PRIVMSG one time");
|
"USER, NICK, PASS, NOTICE, PRIVMSG one time");
|
||||||
if (flow->l4.tcp.irc_stage == 2) {
|
if (flow->l4.tcp.irc_stage == 2) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "found irc");
|
NDPI_LOG_INFO(ndpi_struct, "found irc");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
flow->l4.tcp.irc_stage = 3;
|
flow->l4.tcp.irc_stage = 3;
|
||||||
}
|
}
|
||||||
if (flow->l4.tcp.irc_stage == 1) {
|
if (flow->l4.tcp.irc_stage == 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "second time, stage=2");
|
NDPI_LOG_DBG2(ndpi_struct, "second time, stage=2");
|
||||||
flow->l4.tcp.irc_stage = 2;
|
flow->l4.tcp.irc_stage = 2;
|
||||||
}
|
}
|
||||||
if (flow->l4.tcp.irc_stage == 0) {
|
if (flow->l4.tcp.irc_stage == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "first time, stage=1");
|
NDPI_LOG_DBG2(ndpi_struct, "first time, stage=1");
|
||||||
flow->l4.tcp.irc_stage = 1;
|
flow->l4.tcp.irc_stage = 1;
|
||||||
}
|
}
|
||||||
/* irc packets can have either windows line breaks (0d0a) or unix line breaks (0a) */
|
/* irc packets can have either windows line breaks (0d0a) or unix line breaks (0a) */
|
||||||
@@ -541,13 +539,11 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
&& packet->payload[packet->payload_packet_len - 1] == 0x0a) {
|
&& packet->payload[packet->payload_packet_len - 1] == 0x0a) {
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
if (packet->parsed_lines > 1) {
|
if (packet->parsed_lines > 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct, "packet contains more than one line");
|
||||||
"packet contains more than one line");
|
|
||||||
for (c = 1; c < packet->parsed_lines; c++) {
|
for (c = 1; c < packet->parsed_lines; c++) {
|
||||||
if (packet->line[c].len > 4 && (memcmp(packet->line[c].ptr, "NICK ", 5) == 0
|
if (packet->line[c].len > 4 && (memcmp(packet->line[c].ptr, "NICK ", 5) == 0
|
||||||
|| memcmp(packet->line[c].ptr, "USER ", 5) == 0)) {
|
|| memcmp(packet->line[c].ptr, "USER ", 5) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct,
|
NDPI_LOG_INFO(ndpi_struct, "found IRC: two icq signal words in the same packet");
|
||||||
NDPI_LOG_TRACE, "two icq signal words in the same packet");
|
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
flow->l4.tcp.irc_stage = 3;
|
flow->l4.tcp.irc_stage = 3;
|
||||||
return;
|
return;
|
||||||
@@ -558,14 +554,12 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
} else if (packet->payload[packet->payload_packet_len - 1] == 0x0a) {
|
} else if (packet->payload[packet->payload_packet_len - 1] == 0x0a) {
|
||||||
ndpi_parse_packet_line_info_any(ndpi_struct, flow);
|
ndpi_parse_packet_line_info_any(ndpi_struct, flow);
|
||||||
if (packet->parsed_lines > 1) {
|
if (packet->parsed_lines > 1) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct, "packet contains more than one line");
|
||||||
"packet contains more than one line");
|
|
||||||
for (c = 1; c < packet->parsed_lines; c++) {
|
for (c = 1; c < packet->parsed_lines; c++) {
|
||||||
if (packet->line[c].len > 4 && (memcmp(packet->line[c].ptr, "NICK ", 5) == 0
|
if (packet->line[c].len > 4 && (memcmp(packet->line[c].ptr, "NICK ", 5) == 0
|
||||||
|| memcmp(packet->line[c].ptr, "USER ",
|
|| memcmp(packet->line[c].ptr, "USER ",
|
||||||
5) == 0)) {
|
5) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_INFO(ndpi_struct, "found IRC: two icq signal words in the same packet");
|
||||||
"two icq signal words in the same packet");
|
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
flow->l4.tcp.irc_stage = 3;
|
flow->l4.tcp.irc_stage = 3;
|
||||||
return;
|
return;
|
||||||
@@ -597,7 +591,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
&& (ndpi_check_for_IRC_traces(packet->http_url_name.ptr, packet->http_url_name.len)))
|
&& (ndpi_check_for_IRC_traces(packet->http_url_name.ptr, packet->http_url_name.len)))
|
||||||
|| ((packet->referer_line.ptr)
|
|| ((packet->referer_line.ptr)
|
||||||
&& (ndpi_check_for_IRC_traces(packet->referer_line.ptr, packet->referer_line.len)))) {
|
&& (ndpi_check_for_IRC_traces(packet->referer_line.ptr, packet->referer_line.len)))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"IRC detected from the Http URL/ Referer header ");
|
"IRC detected from the Http URL/ Referer header ");
|
||||||
flow->l4.tcp.irc_stage = 1;
|
flow->l4.tcp.irc_stage = 1;
|
||||||
// HTTP POST Request body is not in the same packet.
|
// HTTP POST Request body is not in the same packet.
|
||||||
@@ -616,22 +610,21 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
|| (((packet->payload_packet_len - http_content_ptr_len) > 5)
|
|| (((packet->payload_packet_len - http_content_ptr_len) > 5)
|
||||||
&& (memcmp(packet->payload + http_content_ptr_len, "item=", 5) == 0)
|
&& (memcmp(packet->payload + http_content_ptr_len, "item=", 5) == 0)
|
||||||
&& (ndpi_check_for_cmd(ndpi_struct, flow) != 0))) {
|
&& (ndpi_check_for_cmd(ndpi_struct, flow) != 0))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "IRC Nickname, cmd, one time");
|
NDPI_LOG_INFO(ndpi_struct, "found IRC: Nickname, cmd, one time");
|
||||||
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
ndpi_int_irc_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
detected_irc:
|
detected_irc:
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "detected_irc:");
|
NDPI_LOG_DBG2(ndpi_struct, "detected_irc:");
|
||||||
|
|
||||||
if (flow->detected_protocol_stack[0] == NDPI_PROTOCOL_IRC) {
|
if (flow->detected_protocol_stack[0] == NDPI_PROTOCOL_IRC) {
|
||||||
/* maybe this can be deleted at the end */
|
/* maybe this can be deleted at the end */
|
||||||
|
|
||||||
if (packet->payload[packet->payload_packet_len - 2] != 0x0d
|
if (packet->payload[packet->payload_packet_len - 2] != 0x0d
|
||||||
&& packet->payload[packet->payload_packet_len - 1] == 0x0a) {
|
&& packet->payload[packet->payload_packet_len - 1] == 0x0a) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "ndpi_parse_packet_line_info_any(ndpi_struct, flow);");
|
||||||
"ndpi_parse_packet_line_info_any(ndpi_struct, flow);");
|
|
||||||
ndpi_parse_packet_line_info_any(ndpi_struct, flow);
|
ndpi_parse_packet_line_info_any(ndpi_struct, flow);
|
||||||
} else if (packet->payload[packet->payload_packet_len - 2] == 0x0d) {
|
} else if (packet->payload[packet->payload_packet_len - 2] == 0x0d) {
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
@@ -640,27 +633,27 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
}
|
}
|
||||||
for (i = 0; i < packet->parsed_lines; i++) {
|
for (i = 0; i < packet->parsed_lines; i++) {
|
||||||
if (packet->line[i].len > 6 && memcmp(packet->line[i].ptr, "NOTICE ", 7) == 0) {
|
if (packet->line[i].len > 6 && memcmp(packet->line[i].ptr, "NOTICE ", 7) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "NOTICE");
|
NDPI_LOG_DBG2(ndpi_struct, "NOTICE");
|
||||||
for (j = 7; j < packet->line[i].len - 8; j++) {
|
for (j = 7; j < packet->line[i].len - 8; j++) {
|
||||||
if (packet->line[i].ptr[j] == ':') {
|
if (packet->line[i].ptr[j] == ':') {
|
||||||
if (memcmp(&packet->line[i].ptr[j + 1], "DCC SEND ", 9) == 0
|
if (memcmp(&packet->line[i].ptr[j + 1], "DCC SEND ", 9) == 0
|
||||||
|| memcmp(&packet->line[i].ptr[j + 1], "DCC CHAT ", 9) == 0) {
|
|| memcmp(&packet->line[i].ptr[j + 1], "DCC CHAT ", 9) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
"found NOTICE and DCC CHAT or DCC SEND.");
|
"found NOTICE and DCC CHAT or DCC SEND.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len > 0 && packet->payload[0] == 0x3a /* 0x3a = ':' */ ) {
|
if (packet->payload_packet_len > 0 && packet->payload[0] == 0x3a /* 0x3a = ':' */ ) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "3a");
|
NDPI_LOG_DBG2(ndpi_struct, "3a");
|
||||||
for (j = 1; j < packet->line[i].len - 9; j++) {
|
for (j = 1; j < packet->line[i].len - 9; j++) {
|
||||||
if (packet->line[i].ptr[j] == ' ') {
|
if (packet->line[i].ptr[j] == ' ') {
|
||||||
j++;
|
j++;
|
||||||
if (packet->line[i].ptr[j] == 'P') {
|
if (packet->line[i].ptr[j] == 'P') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "P");
|
NDPI_LOG_DBG2(ndpi_struct, "P");
|
||||||
j++;
|
j++;
|
||||||
if (memcmp(&packet->line[i].ptr[j], "RIVMSG ", 7) == 0)
|
if (memcmp(&packet->line[i].ptr[j], "RIVMSG ", 7) == 0)
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "RIVMSG");
|
NDPI_LOG_DBG2(ndpi_struct, "RIVMSG");
|
||||||
h = j + 7;
|
h = j + 7;
|
||||||
goto read_privmsg;
|
goto read_privmsg;
|
||||||
}
|
}
|
||||||
@@ -668,25 +661,24 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (packet->line[i].len > 7 && (memcmp(packet->line[i].ptr, "PRIVMSG ", 8) == 0)) {
|
if (packet->line[i].len > 7 && (memcmp(packet->line[i].ptr, "PRIVMSG ", 8) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG, "PRIVMSG ");
|
NDPI_LOG_DBG2(ndpi_struct, "PRIVMSG ");
|
||||||
h = 7;
|
h = 7;
|
||||||
read_privmsg:
|
read_privmsg:
|
||||||
for (j = h; j < packet->line[i].len - 9; j++) {
|
for (j = h; j < packet->line[i].len - 9; j++) {
|
||||||
if (packet->line[i].ptr[j] == ':') {
|
if (packet->line[i].ptr[j] == ':') {
|
||||||
if (memcmp(&packet->line[i].ptr[j + 1], "xdcc ", 5) == 0) {
|
if (memcmp(&packet->line[i].ptr[j + 1], "xdcc ", 5) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "xdcc should match.");
|
NDPI_LOG_DBG2(ndpi_struct, "xdcc should match.");
|
||||||
}
|
}
|
||||||
j += 2;
|
j += 2;
|
||||||
if (memcmp(&packet->line[i].ptr[j], "DCC ", 4) == 0) {
|
if (memcmp(&packet->line[i].ptr[j], "DCC ", 4) == 0) {
|
||||||
j += 4;
|
j += 4;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "found DCC.");
|
NDPI_LOG_DBG2(ndpi_struct, "found DCC.");
|
||||||
if (memcmp(&packet->line[i].ptr[j], "SEND ", 5) == 0
|
if (memcmp(&packet->line[i].ptr[j], "SEND ", 5) == 0
|
||||||
|| (memcmp(&packet->line[i].ptr[j], "CHAT", 4) == 0)
|
|| (memcmp(&packet->line[i].ptr[j], "CHAT", 4) == 0)
|
||||||
|| (memcmp(&packet->line[i].ptr[j], "chat", 4) == 0)
|
|| (memcmp(&packet->line[i].ptr[j], "chat", 4) == 0)
|
||||||
|| (memcmp(&packet->line[i].ptr[j], "sslchat", 7) == 0)
|
|| (memcmp(&packet->line[i].ptr[j], "sslchat", 7) == 0)
|
||||||
|| (memcmp(&packet->line[i].ptr[j], "TSEND", 5) == 0)) {
|
|| (memcmp(&packet->line[i].ptr[j], "TSEND", 5) == 0)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct, "found CHAT,chat,sslchat,TSEND.");
|
||||||
"found CHAT,chat,sslchat,TSEND.");
|
|
||||||
j += 4;
|
j += 4;
|
||||||
|
|
||||||
while (packet->line[i].len > j &&
|
while (packet->line[i].len > j &&
|
||||||
@@ -699,35 +691,29 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
|
|
||||||
if (packet->line[i].ptr[j] == ' ') {
|
if (packet->line[i].ptr[j] == ' ') {
|
||||||
space++;
|
space++;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "space %u.", space);
|
NDPI_LOG_DBG2(ndpi_struct, "space %u.", space);
|
||||||
}
|
}
|
||||||
if (space == 3) {
|
if (space == 3) {
|
||||||
j++;
|
j++;
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "read port.");
|
NDPI_LOG_DBG2(ndpi_struct, "read port.");
|
||||||
if (src != NULL) {
|
if (src != NULL) {
|
||||||
k = j;
|
k = j;
|
||||||
port =
|
port =
|
||||||
ntohs_ndpi_bytestream_to_number
|
ntohs_ndpi_bytestream_to_number
|
||||||
(&packet->line[i].ptr[j], packet->payload_packet_len - j, &j);
|
(&packet->line[i].ptr[j], packet->payload_packet_len - j, &j);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "port %u.",
|
NDPI_LOG_DBG2(ndpi_struct, "port %u.",
|
||||||
port);
|
port);
|
||||||
j = k;
|
j = k;
|
||||||
// hier jetzt überlegen, wie die ports abgespeichert werden sollen
|
// hier jetzt überlegen, wie die ports abgespeichert werden sollen
|
||||||
if (src->irc_number_of_port < NDPI_PROTOCOL_IRC_MAXPORT)
|
if (src->irc_number_of_port < NDPI_PROTOCOL_IRC_MAXPORT)
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE,
|
NDPI_LOG_DBG2(ndpi_struct, "src->irc_number_of_port < NDPI_PROTOCOL_IRC_MAXPORT.");
|
||||||
"src->irc_number_of_port < NDPI_PROTOCOL_IRC_MAXPORT.");
|
|
||||||
if (src->irc_number_of_port < NDPI_PROTOCOL_IRC_MAXPORT && port != 0) {
|
if (src->irc_number_of_port < NDPI_PROTOCOL_IRC_MAXPORT && port != 0) {
|
||||||
if (!ndpi_is_duplicate(src, port)) {
|
if (!ndpi_is_duplicate(src, port)) {
|
||||||
src->irc_port[src->irc_number_of_port]
|
src->irc_port[src->irc_number_of_port]
|
||||||
= port;
|
= port;
|
||||||
src->irc_number_of_port++;
|
src->irc_number_of_port++;
|
||||||
NDPI_LOG
|
NDPI_LOG_DBG2(ndpi_struct, "found port=%d jjeeeeeeeeeeeeeeeeeeeeeeeee",
|
||||||
(NDPI_PROTOCOL_IRC,
|
|
||||||
ndpi_struct,
|
|
||||||
NDPI_LOG_DEBUG, "found port=%d",
|
|
||||||
ntohs(get_u_int16_t(src->irc_port, 0)));
|
ntohs(get_u_int16_t(src->irc_port, 0)));
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG,
|
|
||||||
"jjeeeeeeeeeeeeeeeeeeeeeeeee");
|
|
||||||
}
|
}
|
||||||
src->irc_ts = packet->tick_timestamp;
|
src->irc_ts = packet->tick_timestamp;
|
||||||
} else if (port != 0 && src->irc_number_of_port == NDPI_PROTOCOL_IRC_MAXPORT) {
|
} else if (port != 0 && src->irc_number_of_port == NDPI_PROTOCOL_IRC_MAXPORT) {
|
||||||
@@ -735,11 +721,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
less = 0;
|
less = 0;
|
||||||
NDPI_IRC_FIND_LESS(src->last_time_port_used, less);
|
NDPI_IRC_FIND_LESS(src->last_time_port_used, less);
|
||||||
src->irc_port[less] = port;
|
src->irc_port[less] = port;
|
||||||
NDPI_LOG
|
NDPI_LOG_DBG2(ndpi_struct, "found port=%d", ntohs(get_u_int16_t(src->irc_port, 0)));
|
||||||
(NDPI_PROTOCOL_IRC,
|
|
||||||
ndpi_struct,
|
|
||||||
NDPI_LOG_DEBUG, "found port=%d",
|
|
||||||
ntohs(get_u_int16_t(src->irc_port, 0)));
|
|
||||||
}
|
}
|
||||||
src->irc_ts = packet->tick_timestamp;
|
src->irc_ts = packet->tick_timestamp;
|
||||||
}
|
}
|
||||||
@@ -750,8 +732,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
if (dst != NULL) {
|
if (dst != NULL) {
|
||||||
port = ntohs_ndpi_bytestream_to_number
|
port = ntohs_ndpi_bytestream_to_number
|
||||||
(&packet->line[i].ptr[j], packet->payload_packet_len - j, &j);
|
(&packet->line[i].ptr[j], packet->payload_packet_len - j, &j);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_TRACE, "port %u.",
|
NDPI_LOG_DBG2(ndpi_struct, "port %u.", port);
|
||||||
port);
|
|
||||||
// hier das gleiche wie oben.
|
// hier das gleiche wie oben.
|
||||||
/* hier werden NDPI_PROTOCOL_IRC_MAXPORT ports pro irc flows mitgespeichert. könnte man denn nicht ein-
|
/* hier werden NDPI_PROTOCOL_IRC_MAXPORT ports pro irc flows mitgespeichert. könnte man denn nicht ein-
|
||||||
* fach an die dst oder src einen flag setzten, dass dieser port für eine bestimmte
|
* fach an die dst oder src einen flag setzten, dass dieser port für eine bestimmte
|
||||||
@@ -762,13 +743,8 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
dst->irc_port[dst->irc_number_of_port]
|
dst->irc_port[dst->irc_number_of_port]
|
||||||
= port;
|
= port;
|
||||||
dst->irc_number_of_port++;
|
dst->irc_number_of_port++;
|
||||||
NDPI_LOG
|
NDPI_LOG_DBG2(ndpi_struct, "found port=%d", ntohs(get_u_int16_t(dst->irc_port, 0)));
|
||||||
(NDPI_PROTOCOL_IRC,
|
NDPI_LOG_DBG2(ndpi_struct, "juuuuuuuuuuuuuuuu");
|
||||||
ndpi_struct,
|
|
||||||
NDPI_LOG_DEBUG, "found port=%d",
|
|
||||||
ntohs(get_u_int16_t(dst->irc_port, 0)));
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_IRC, ndpi_struct, NDPI_LOG_DEBUG,
|
|
||||||
"juuuuuuuuuuuuuuuu");
|
|
||||||
}
|
}
|
||||||
dst->irc_ts = packet->tick_timestamp;
|
dst->irc_ts = packet->tick_timestamp;
|
||||||
} else if (port != 0 && dst->irc_number_of_port == NDPI_PROTOCOL_IRC_MAXPORT) {
|
} else if (port != 0 && dst->irc_number_of_port == NDPI_PROTOCOL_IRC_MAXPORT) {
|
||||||
@@ -777,11 +753,7 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
NDPI_IRC_FIND_LESS(dst->last_time_port_used, less);
|
NDPI_IRC_FIND_LESS(dst->last_time_port_used, less);
|
||||||
dst->irc_port[less] = port;
|
dst->irc_port[less] = port;
|
||||||
|
|
||||||
NDPI_LOG
|
NDPI_LOG_DBG2(ndpi_struct, "found port=%d", ntohs(get_u_int16_t(dst->irc_port, 0)));
|
||||||
(NDPI_PROTOCOL_IRC,
|
|
||||||
ndpi_struct,
|
|
||||||
NDPI_LOG_DEBUG, "found port=%d",
|
|
||||||
ntohs(get_u_int16_t(dst->irc_port, 0)));
|
|
||||||
}
|
}
|
||||||
dst->irc_ts = packet->tick_timestamp;
|
dst->irc_ts = packet->tick_timestamp;
|
||||||
}
|
}
|
||||||
@@ -804,8 +776,8 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
{
|
{
|
||||||
ndpi_set_bitmask_protocol_detection("IRC", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("IRC", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_IRC,
|
NDPI_PROTOCOL_IRC,
|
||||||
@@ -817,4 +789,3 @@ void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+39
-54
@@ -2,7 +2,7 @@
|
|||||||
* jabber.c
|
* jabber.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,20 +22,20 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_UNENCRYPTED_JABBER
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_UNENCRYPTED_JABBER
|
|
||||||
struct jabber_string {
|
struct jabber_string {
|
||||||
char *string;
|
char *string;
|
||||||
u_int ndpi_protocol;
|
u_int ndpi_protocol;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct jabber_string jabber_strings[] = {
|
static struct jabber_string jabber_strings[] = {
|
||||||
#ifdef NDPI_PROTOCOL_TRUPHONE
|
|
||||||
{ "='im.truphone.com'", NDPI_PROTOCOL_TRUPHONE },
|
{ "='im.truphone.com'", NDPI_PROTOCOL_TRUPHONE },
|
||||||
{ "=\"im.truphone.com\"", NDPI_PROTOCOL_TRUPHONE },
|
{ "=\"im.truphone.com\"", NDPI_PROTOCOL_TRUPHONE },
|
||||||
#endif
|
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -70,51 +70,47 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
|
|
||||||
u_int16_t x;
|
u_int16_t x;
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_TRACE, "JABBER detection....\n");
|
NDPI_LOG_DBG(ndpi_struct, "search JABBER\n");
|
||||||
|
|
||||||
/* search for jabber file transfer */
|
/* search for jabber file transfer */
|
||||||
/* this part is working asymmetrically */
|
/* this part is working asymmetrically */
|
||||||
if (packet->tcp != NULL && packet->tcp->syn != 0 && packet->payload_packet_len == 0) {
|
if (packet->tcp != NULL && packet->tcp->syn != 0 && packet->payload_packet_len == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG, "check jabber syn\n");
|
NDPI_LOG_DBG2(ndpi_struct, "check jabber syn\n");
|
||||||
if (src != NULL && src->jabber_file_transfer_port[0] != 0) {
|
if (src != NULL && src->jabber_file_transfer_port[0] != 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "src jabber ft port set, ports are: %u, %u\n",
|
||||||
"src jabber ft port set, ports are: %u, %u\n", ntohs(src->jabber_file_transfer_port[0]),
|
ntohs(src->jabber_file_transfer_port[0]),
|
||||||
ntohs(src->jabber_file_transfer_port[1]));
|
ntohs(src->jabber_file_transfer_port[1]));
|
||||||
if (((u_int32_t)
|
if (((u_int32_t)
|
||||||
(packet->tick_timestamp - src->jabber_stun_or_ft_ts)) >= ndpi_struct->jabber_file_transfer_timeout) {
|
(packet->tick_timestamp - src->jabber_stun_or_ft_ts)) >= ndpi_struct->jabber_file_transfer_timeout) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "JABBER src stun timeout %u %u\n",
|
||||||
NDPI_LOG_DEBUG, "JABBER src stun timeout %u %u\n", src->jabber_stun_or_ft_ts,
|
src->jabber_stun_or_ft_ts, packet->tick_timestamp);
|
||||||
packet->tick_timestamp);
|
|
||||||
src->jabber_file_transfer_port[0] = 0;
|
src->jabber_file_transfer_port[0] = 0;
|
||||||
src->jabber_file_transfer_port[1] = 0;
|
src->jabber_file_transfer_port[1] = 0;
|
||||||
} else if (src->jabber_file_transfer_port[0] == packet->tcp->dest
|
} else if (src->jabber_file_transfer_port[0] == packet->tcp->dest
|
||||||
|| src->jabber_file_transfer_port[0] == packet->tcp->source
|
|| src->jabber_file_transfer_port[0] == packet->tcp->source
|
||||||
|| src->jabber_file_transfer_port[1] == packet->tcp->dest
|
|| src->jabber_file_transfer_port[1] == packet->tcp->dest
|
||||||
|| src->jabber_file_transfer_port[1] == packet->tcp->source) {
|
|| src->jabber_file_transfer_port[1] == packet->tcp->source) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct, "found jabber file transfer\n");
|
||||||
"found jabber file transfer.\n");
|
|
||||||
|
|
||||||
ndpi_int_jabber_add_connection(ndpi_struct, flow,
|
ndpi_int_jabber_add_connection(ndpi_struct, flow,
|
||||||
NDPI_PROTOCOL_UNENCRYPTED_JABBER);
|
NDPI_PROTOCOL_UNENCRYPTED_JABBER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dst != NULL && dst->jabber_file_transfer_port[0] != 0) {
|
if (dst != NULL && dst->jabber_file_transfer_port[0] != 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "dst jabber ft port set, ports are: %u, %u\n",
|
||||||
"dst jabber ft port set, ports are: %u, %u\n", ntohs(dst->jabber_file_transfer_port[0]),
|
ntohs(dst->jabber_file_transfer_port[0]),
|
||||||
ntohs(dst->jabber_file_transfer_port[1]));
|
ntohs(dst->jabber_file_transfer_port[1]));
|
||||||
if (((u_int32_t)
|
if (((u_int32_t)
|
||||||
(packet->tick_timestamp - dst->jabber_stun_or_ft_ts)) >= ndpi_struct->jabber_file_transfer_timeout) {
|
(packet->tick_timestamp - dst->jabber_stun_or_ft_ts)) >= ndpi_struct->jabber_file_transfer_timeout) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "JABBER dst stun timeout %u %u\n",
|
||||||
NDPI_LOG_DEBUG, "JABBER dst stun timeout %u %u\n", dst->jabber_stun_or_ft_ts,
|
dst->jabber_stun_or_ft_ts, packet->tick_timestamp);
|
||||||
packet->tick_timestamp);
|
|
||||||
dst->jabber_file_transfer_port[0] = 0;
|
dst->jabber_file_transfer_port[0] = 0;
|
||||||
dst->jabber_file_transfer_port[1] = 0;
|
dst->jabber_file_transfer_port[1] = 0;
|
||||||
} else if (dst->jabber_file_transfer_port[0] == packet->tcp->dest
|
} else if (dst->jabber_file_transfer_port[0] == packet->tcp->dest
|
||||||
|| dst->jabber_file_transfer_port[0] == packet->tcp->source
|
|| dst->jabber_file_transfer_port[0] == packet->tcp->source
|
||||||
|| dst->jabber_file_transfer_port[1] == packet->tcp->dest
|
|| dst->jabber_file_transfer_port[1] == packet->tcp->dest
|
||||||
|| dst->jabber_file_transfer_port[1] == packet->tcp->source) {
|
|| dst->jabber_file_transfer_port[1] == packet->tcp->source) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_INFO(ndpi_struct, "found jabber file transfer\n");
|
||||||
"found jabber file transfer.\n");
|
|
||||||
|
|
||||||
ndpi_int_jabber_add_connection(ndpi_struct, flow,
|
ndpi_int_jabber_add_connection(ndpi_struct, flow,
|
||||||
NDPI_PROTOCOL_UNENCRYPTED_JABBER);
|
NDPI_PROTOCOL_UNENCRYPTED_JABBER);
|
||||||
@@ -135,17 +131,17 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
/* check for google jabber voip connections ... */
|
/* check for google jabber voip connections ... */
|
||||||
/* need big packet */
|
/* need big packet */
|
||||||
if (packet->payload_packet_len < 100) {
|
if (packet->payload_packet_len < 100) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG, "packet too small, return.\n");
|
NDPI_LOG_DBG2(ndpi_struct, "packet too small, return\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* need message to or type for file-transfer */
|
/* need message to or type for file-transfer */
|
||||||
if (memcmp(packet->payload, "<iq from=\"", 8) == 0 || memcmp(packet->payload, "<iq from=\'", 8) == 0) {
|
if (memcmp(packet->payload, "<iq from=\"", 8) == 0 || memcmp(packet->payload, "<iq from=\'", 8) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG, "JABBER <iq from=\".\n");
|
NDPI_LOG_DBG2(ndpi_struct, "JABBER <iq from=\"\n");
|
||||||
lastlen = packet->payload_packet_len - 11;
|
lastlen = packet->payload_packet_len - 11;
|
||||||
for (x = 10; x < lastlen; x++) {
|
for (x = 10; x < lastlen; x++) {
|
||||||
if (packet->payload[x] == 'p') {
|
if (packet->payload[x] == 'p') {
|
||||||
if (memcmp(&packet->payload[x], "port=", 5) == 0) {
|
if (memcmp(&packet->payload[x], "port=", 5) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG, "port=\n");
|
NDPI_LOG_DBG2(ndpi_struct, "port=\n");
|
||||||
if (src != NULL) {
|
if (src != NULL) {
|
||||||
src->jabber_stun_or_ft_ts = packet->tick_timestamp;
|
src->jabber_stun_or_ft_ts = packet->tick_timestamp;
|
||||||
}
|
}
|
||||||
@@ -155,30 +151,25 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
}
|
}
|
||||||
x += 6;
|
x += 6;
|
||||||
j_port = ntohs_ndpi_bytestream_to_number(&packet->payload[x], packet->payload_packet_len, &x);
|
j_port = ntohs_ndpi_bytestream_to_number(&packet->payload[x], packet->payload_packet_len, &x);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "JABBER port : %u\n", ntohs(j_port));
|
||||||
NDPI_LOG_DEBUG, "JABBER port : %u\n", ntohs(j_port));
|
|
||||||
if (src != NULL) {
|
if (src != NULL) {
|
||||||
if (src->jabber_file_transfer_port[0] == 0 || src->jabber_file_transfer_port[0] == j_port) {
|
if (src->jabber_file_transfer_port[0] == 0 || src->jabber_file_transfer_port[0] == j_port) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "src->jabber_file_transfer_port[0] = j_port = %u;\n",
|
||||||
NDPI_LOG_DEBUG, "src->jabber_file_transfer_port[0] = j_port = %u;\n",
|
|
||||||
ntohs(j_port));
|
ntohs(j_port));
|
||||||
src->jabber_file_transfer_port[0] = j_port;
|
src->jabber_file_transfer_port[0] = j_port;
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "src->jabber_file_transfer_port[1] = j_port = %u;\n",
|
||||||
NDPI_LOG_DEBUG, "src->jabber_file_transfer_port[1] = j_port = %u;\n",
|
|
||||||
ntohs(j_port));
|
ntohs(j_port));
|
||||||
src->jabber_file_transfer_port[1] = j_port;
|
src->jabber_file_transfer_port[1] = j_port;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dst != NULL) {
|
if (dst != NULL) {
|
||||||
if (dst->jabber_file_transfer_port[0] == 0 || dst->jabber_file_transfer_port[0] == j_port) {
|
if (dst->jabber_file_transfer_port[0] == 0 || dst->jabber_file_transfer_port[0] == j_port) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "dst->jabber_file_transfer_port[0] = j_port = %u;\n",
|
||||||
NDPI_LOG_DEBUG, "dst->jabber_file_transfer_port[0] = j_port = %u;\n",
|
|
||||||
ntohs(j_port));
|
ntohs(j_port));
|
||||||
dst->jabber_file_transfer_port[0] = j_port;
|
dst->jabber_file_transfer_port[0] = j_port;
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "dst->jabber_file_transfer_port[1] = j_port = %u;\n",
|
||||||
NDPI_LOG_DEBUG, "dst->jabber_file_transfer_port[1] = j_port = %u;\n",
|
|
||||||
ntohs(j_port));
|
ntohs(j_port));
|
||||||
dst->jabber_file_transfer_port[1] = j_port;
|
dst->jabber_file_transfer_port[1] = j_port;
|
||||||
}
|
}
|
||||||
@@ -191,7 +182,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
|
|
||||||
} else if (memcmp(packet->payload, "<iq to=\"", 8) == 0 || memcmp(packet->payload, "<iq to=\'", 8) == 0
|
} else if (memcmp(packet->payload, "<iq to=\"", 8) == 0 || memcmp(packet->payload, "<iq to=\'", 8) == 0
|
||||||
|| memcmp(packet->payload, "<iq type=", 9) == 0) {
|
|| memcmp(packet->payload, "<iq type=", 9) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG, "JABBER <iq to=\"/type=\"\n");
|
NDPI_LOG_DBG2(ndpi_struct, "JABBER <iq to=\"/type=\"\n");
|
||||||
lastlen = packet->payload_packet_len - 21;
|
lastlen = packet->payload_packet_len - 21;
|
||||||
for (x = 8; x < lastlen; x++) {
|
for (x = 8; x < lastlen; x++) {
|
||||||
/* invalid character */
|
/* invalid character */
|
||||||
@@ -199,7 +190,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload[x] == '@') {
|
if (packet->payload[x] == '@') {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG, "JABBER @\n");
|
NDPI_LOG_DBG2(ndpi_struct, "JABBER @\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -211,7 +202,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
for (; x < lastlen; x++) {
|
for (; x < lastlen; x++) {
|
||||||
if (packet->payload[x] == 'p') {
|
if (packet->payload[x] == 'p') {
|
||||||
if (memcmp(&packet->payload[x], "port=", 5) == 0) {
|
if (memcmp(&packet->payload[x], "port=", 5) == 0) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG, "port=\n");
|
NDPI_LOG_DBG2(ndpi_struct, "port=\n");
|
||||||
if (src != NULL) {
|
if (src != NULL) {
|
||||||
src->jabber_stun_or_ft_ts = packet->tick_timestamp;
|
src->jabber_stun_or_ft_ts = packet->tick_timestamp;
|
||||||
}
|
}
|
||||||
@@ -222,8 +213,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
|
|
||||||
x += 6;
|
x += 6;
|
||||||
j_port = ntohs_ndpi_bytestream_to_number(&packet->payload[x], packet->payload_packet_len, &x);
|
j_port = ntohs_ndpi_bytestream_to_number(&packet->payload[x], packet->payload_packet_len, &x);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "JABBER port : %u\n", ntohs(j_port));
|
||||||
NDPI_LOG_DEBUG, "JABBER port : %u\n", ntohs(j_port));
|
|
||||||
|
|
||||||
if (src != NULL && src->jabber_voice_stun_used_ports < JABBER_MAX_STUN_PORTS - 1) {
|
if (src != NULL && src->jabber_voice_stun_used_ports < JABBER_MAX_STUN_PORTS - 1) {
|
||||||
if (packet->payload[5] == 'o') {
|
if (packet->payload[5] == 'o') {
|
||||||
@@ -232,12 +222,11 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
} else {
|
} else {
|
||||||
if (src->jabber_file_transfer_port[0] == 0
|
if (src->jabber_file_transfer_port[0] == 0
|
||||||
|| src->jabber_file_transfer_port[0] == j_port) {
|
|| src->jabber_file_transfer_port[0] == j_port) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "src->jabber_file_transfer_port[0] = j_port = %u;\n",
|
||||||
"src->jabber_file_transfer_port[0] = j_port = %u;\n", ntohs(j_port));
|
ntohs(j_port));
|
||||||
src->jabber_file_transfer_port[0] = j_port;
|
src->jabber_file_transfer_port[0] = j_port;
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "src->jabber_file_transfer_port[1] = j_port = %u;\n",
|
||||||
NDPI_LOG_DEBUG, "src->jabber_file_transfer_port[1] = j_port = %u;\n",
|
|
||||||
ntohs(j_port));
|
ntohs(j_port));
|
||||||
src->jabber_file_transfer_port[1] = j_port;
|
src->jabber_file_transfer_port[1] = j_port;
|
||||||
}
|
}
|
||||||
@@ -251,12 +240,11 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
} else {
|
} else {
|
||||||
if (dst->jabber_file_transfer_port[0] == 0
|
if (dst->jabber_file_transfer_port[0] == 0
|
||||||
|| dst->jabber_file_transfer_port[0] == j_port) {
|
|| dst->jabber_file_transfer_port[0] == j_port) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_DEBUG,
|
NDPI_LOG_DBG2(ndpi_struct, "dst->jabber_file_transfer_port[0] = j_port = %u;\n",
|
||||||
"dst->jabber_file_transfer_port[0] = j_port = %u;\n", ntohs(j_port));
|
ntohs(j_port));
|
||||||
dst->jabber_file_transfer_port[0] = j_port;
|
dst->jabber_file_transfer_port[0] = j_port;
|
||||||
} else {
|
} else {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "dst->jabber_file_transfer_port[1] = j_port = %u;\n",
|
||||||
NDPI_LOG_DEBUG, "dst->jabber_file_transfer_port[1] = j_port = %u;\n",
|
|
||||||
ntohs(j_port));
|
ntohs(j_port));
|
||||||
dst->jabber_file_transfer_port[1] = j_port;
|
dst->jabber_file_transfer_port[1] = j_port;
|
||||||
}
|
}
|
||||||
@@ -291,17 +279,14 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flow->packet_counter < 3) {
|
if (flow->packet_counter < 3) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct, "packet_counter: %u\n", flow->packet_counter);
|
||||||
NDPI_LOG_DEBUG, "packet_counter: %u\n", flow->packet_counter);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_UNENCRYPTED_JABBER, ndpi_struct, NDPI_LOG_TRACE, "JABBER Excluded.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_UNENCRYPTED_JABBER);
|
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_TRUPHONE
|
ndpi_exclude_protocol(ndpi_struct, flow, NDPI_PROTOCOL_TRUPHONE,
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TRUPHONE);
|
__FILE__,__FUNCTION__,__LINE__);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -316,4 +301,4 @@ void init_jabber_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
|||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* kakaotalk_voice.c
|
* kakaotalk_voice.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015 - ntop.org
|
* Copyright (C) 2015-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -24,13 +24,18 @@
|
|||||||
|
|
||||||
http://www.kakao.com/services/talk/voices
|
http://www.kakao.com/services/talk/voices
|
||||||
*/
|
*/
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_KAKAOTALK_VOICE
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_KAKAOTALK_VOICE
|
|
||||||
void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search kakaotalk_voice\n");
|
||||||
|
|
||||||
if(packet->iph
|
if(packet->iph
|
||||||
&& packet->udp
|
&& packet->udp
|
||||||
&& (packet->payload_packet_len >= 4)
|
&& (packet->payload_packet_len >= 4)
|
||||||
@@ -48,18 +53,19 @@ void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struc
|
|||||||
|
|
||||||
if(((ntohl(packet->iph->saddr) & 0xFFFF0000 /* 255.255.0.0 */) == 0x01C90000 /* 1.201.0.0/16 */)
|
if(((ntohl(packet->iph->saddr) & 0xFFFF0000 /* 255.255.0.0 */) == 0x01C90000 /* 1.201.0.0/16 */)
|
||||||
|| ((ntohl(packet->iph->daddr) & 0xFFFF0000 /* 255.255.0.0 */) == 0x01C90000 /* 1.201.0.0/16 */)) {
|
|| ((ntohl(packet->iph->daddr) & 0xFFFF0000 /* 255.255.0.0 */) == 0x01C90000 /* 1.201.0.0/16 */)) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found kakaotalk_voice\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KAKAOTALK_VOICE, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KAKAOTALK_VOICE, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_KAKAOTALK_VOICE, ndpi_struct, NDPI_LOG_DEBUG, "Exclude kakaotalk_voice.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_KAKAOTALK_VOICE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_kakaotalk_voice_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
void init_kakaotalk_voice_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
{
|
{
|
||||||
ndpi_set_bitmask_protocol_detection("KakaoTalk_Voice", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("KakaoTalk_Voice", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_KAKAOTALK_VOICE,
|
NDPI_PROTOCOL_KAKAOTALK_VOICE,
|
||||||
@@ -70,4 +76,3 @@ void init_kakaotalk_voice_dissector(struct ndpi_detection_module_struct *ndpi_st
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* kerberos.c
|
* kerberos.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,24 +22,26 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_KERBEROS
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_KERBEROS
|
|
||||||
|
|
||||||
static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "trace KERBEROS\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search KERBEROS\n");
|
||||||
|
|
||||||
/* I have observed 0a,0c,0d,0e at packet->payload[19/21], maybe there are other possibilities */
|
/* I have observed 0a,0c,0d,0e at packet->payload[19/21], maybe there are other possibilities */
|
||||||
if (packet->payload_packet_len >= 4 && ntohl(get_u_int32_t(packet->payload, 0)) == packet->payload_packet_len - 4) {
|
if (packet->payload_packet_len >= 4 && ntohl(get_u_int32_t(packet->payload, 0)) == packet->payload_packet_len - 4) {
|
||||||
@@ -47,7 +49,6 @@ void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
packet->payload[14] == 0x05 &&
|
packet->payload[14] == 0x05 &&
|
||||||
(packet->payload[19] == 0x0a ||
|
(packet->payload[19] == 0x0a ||
|
||||||
packet->payload[19] == 0x0c || packet->payload[19] == 0x0d || packet->payload[19] == 0x0e)) {
|
packet->payload[19] == 0x0c || packet->payload[19] == 0x0d || packet->payload[19] == 0x0e)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_KERBEROS, ndpi_struct, NDPI_LOG_DEBUG, "found KERBEROS\n");
|
|
||||||
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -56,18 +57,12 @@ void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
packet->payload[16] == 0x05 &&
|
packet->payload[16] == 0x05 &&
|
||||||
(packet->payload[21] == 0x0a ||
|
(packet->payload[21] == 0x0a ||
|
||||||
packet->payload[21] == 0x0c || packet->payload[21] == 0x0d || packet->payload[21] == 0x0e)) {
|
packet->payload[21] == 0x0c || packet->payload[21] == 0x0d || packet->payload[21] == 0x0e)) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_KERBEROS, ndpi_struct, NDPI_LOG_DEBUG, "found KERBEROS\n");
|
|
||||||
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_LOG(NDPI_PROTOCOL_KERBEROS, ndpi_struct, NDPI_LOG_DEBUG, "no KERBEROS detected.\n");
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_KERBEROS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -83,4 +78,3 @@ void init_kerberos_dissector(struct ndpi_detection_module_struct *ndpi_struct, u
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+12
-12
@@ -2,7 +2,7 @@
|
|||||||
* kontiki.c
|
* kontiki.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,48 +23,49 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_KONTIKI
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_KONTIKI
|
|
||||||
|
|
||||||
static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found Kontiki UDP\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search Kontiki\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
|
|
||||||
if (packet->payload_packet_len == 4 && (get_u_int32_t(packet->payload, 0) == htonl(0x02010100))) {
|
if (packet->payload_packet_len == 4 && (get_u_int32_t(packet->payload, 0) == htonl(0x02010100))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_KONTIKI, ndpi_struct, NDPI_LOG_DEBUG, "Kontiki UDP detected.\n");
|
|
||||||
ndpi_int_kontiki_add_connection(ndpi_struct, flow);
|
ndpi_int_kontiki_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload_packet_len > 0 && packet->payload[0] == 0x02) {
|
if (packet->payload_packet_len > 0 && packet->payload[0] == 0x02) {
|
||||||
|
|
||||||
if (packet->payload_packet_len == 20 && (get_u_int32_t(packet->payload, 16) == htonl(0x02040100))) {
|
if (packet->payload_packet_len == 20 && (get_u_int32_t(packet->payload, 16) == htonl(0x02040100))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_KONTIKI, ndpi_struct, NDPI_LOG_DEBUG, "Kontiki UDP detected.\n");
|
|
||||||
ndpi_int_kontiki_add_connection(ndpi_struct, flow);
|
ndpi_int_kontiki_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (packet->payload_packet_len == 16 && (get_u_int32_t(packet->payload, 12) == htonl(0x000004e4))) {
|
if (packet->payload_packet_len == 16 && (get_u_int32_t(packet->payload, 12) == htonl(0x000004e4))) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_KONTIKI, ndpi_struct, NDPI_LOG_DEBUG, "Kontiki UDP detected.\n");
|
|
||||||
ndpi_int_kontiki_add_connection(ndpi_struct, flow);
|
ndpi_int_kontiki_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_KONTIKI);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_kontiki_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
void init_kontiki_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
{
|
{
|
||||||
ndpi_set_bitmask_protocol_detection("Kontiki", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("Kontiki", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_KONTIKI,
|
NDPI_PROTOCOL_KONTIKI,
|
||||||
@@ -76,4 +77,3 @@ void init_kontiki_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
+11
-19
@@ -2,7 +2,7 @@
|
|||||||
* ldap.c
|
* ldap.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
* Copyright (C) 2011-18 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -22,10 +22,12 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_LDAP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_LDAP
|
|
||||||
|
|
||||||
static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow)
|
||||||
@@ -37,15 +39,7 @@ void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
NDPI_LOG_DBG(ndpi_struct, "search ldap\n");
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
// u_int16_t dport;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_LDAP, ndpi_struct, NDPI_LOG_DEBUG, "search ldap\n");
|
|
||||||
|
|
||||||
|
|
||||||
if (packet->payload_packet_len >= 14 && packet->payload[0] == 0x30) {
|
if (packet->payload_packet_len >= 14 && packet->payload[0] == 0x30) {
|
||||||
|
|
||||||
@@ -55,14 +49,14 @@ void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
|
|
||||||
if (packet->payload[3] == 0x01 &&
|
if (packet->payload[3] == 0x01 &&
|
||||||
(packet->payload[5] == 0x60 || packet->payload[5] == 0x61) && packet->payload[6] == 0x07) {
|
(packet->payload[5] == 0x60 || packet->payload[5] == 0x61) && packet->payload[6] == 0x07) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_LDAP, ndpi_struct, NDPI_LOG_DEBUG, "found ldap simple type 1\n");
|
NDPI_LOG_INFO(ndpi_struct, "found ldap simple type 1\n");
|
||||||
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload[3] == 0x02 &&
|
if (packet->payload[3] == 0x02 &&
|
||||||
(packet->payload[6] == 0x60 || packet->payload[6] == 0x61) && packet->payload[7] == 0x07) {
|
(packet->payload[6] == 0x60 || packet->payload[6] == 0x61) && packet->payload[7] == 0x07) {
|
||||||
NDPI_LOG(NDPI_PROTOCOL_LDAP, ndpi_struct, NDPI_LOG_DEBUG, "found ldap simple type 2\n");
|
NDPI_LOG_INFO(ndpi_struct, "found ldap simple type 2\n");
|
||||||
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -75,7 +69,7 @@ void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
(packet->payload[9] == 0x60 || packet->payload[9] == 0x61 || packet->payload[9] == 0x63 ||
|
(packet->payload[9] == 0x60 || packet->payload[9] == 0x61 || packet->payload[9] == 0x63 ||
|
||||||
packet->payload[9] == 0x64) && packet->payload[10] == 0x84) {
|
packet->payload[9] == 0x64) && packet->payload[10] == 0x84) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_LDAP, ndpi_struct, NDPI_LOG_DEBUG, "found ldap type 1\n");
|
NDPI_LOG_INFO(ndpi_struct, "found ldap type 1\n");
|
||||||
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -84,7 +78,7 @@ void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
(packet->payload[10] == 0x60 || packet->payload[10] == 0x61 || packet->payload[10] == 0x63 ||
|
(packet->payload[10] == 0x60 || packet->payload[10] == 0x61 || packet->payload[10] == 0x63 ||
|
||||||
packet->payload[10] == 0x64) && packet->payload[11] == 0x84) {
|
packet->payload[10] == 0x64) && packet->payload[11] == 0x84) {
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_LDAP, ndpi_struct, NDPI_LOG_DEBUG, "found ldap type 2\n");
|
NDPI_LOG_INFO(ndpi_struct, "found ldap type 2\n");
|
||||||
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
ndpi_int_ldap_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -92,8 +86,7 @@ void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct n
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NDPI_LOG(NDPI_PROTOCOL_LDAP, ndpi_struct, NDPI_LOG_DEBUG, "ldap excluded.\n");
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_LDAP);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -109,4 +102,3 @@ void init_ldap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
|||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user