Compare commits

...
1838 Commits
Author SHA1 Message Date
Luca Deri 2ce4223e37 Silenced warning message 2019-10-21 15:36:38 +02:00
Luca Deri 6a38ede42b Updated nDPI API ndpi_ssl_version2str ndpi_get_l4_proto_name 2019-10-11 18:19:50 +02:00
emanuele-f 206ce0a317 Fix invalid memory accesses 2019-10-04 14:58:43 +02:00
emanuele-f 2184e0f7c2 Fix out of bounds read in ndpi_match_custom_category 2019-10-04 14:58:35 +02:00
Luca Deri 0a46cba821 Optimized ndpi_extra_dissection_possible() 2019-10-04 14:16:07 +02:00
Luca Deri f719ef4fb0 Moved to v3 2019-10-04 07:45:22 +00:00
Luca Deri d8067cdc1d Extended changelog for v3 2019-10-04 09:42:43 +02:00
Luca Deri 67dbcb7375 Fixed invalid network searchthat caused categories to be set randomly 2019-10-04 07:19:20 +00:00
Luca Deri 3180f279c8 Merge pull request #792 from ntop/ndpi_streaming
Move Hulu and Disney+ to category match.
2019-10-03 22:35:31 +02:00
Simone Mainardi 1982e6cef9 Adds nDPI 3.0 changelog 2019-10-03 20:04:26 +02:00
emanuele-f d2f0a8d493 Add missing results 2019-10-03 16:26:14 +02:00
emanuele-f 37cb113c45 Handle TCP DNS replies and add is_reply flag 2019-10-03 16:19:15 +02:00
emanuele-f 04a97fa72b Fix DNS reply dissection issues 2019-10-03 15:52:55 +02:00
Ravi Kerur 8897aa6acb Move Hulu and Disney+ to category match.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-10-02 20:03:18 -07:00
Luca Deri c247a9d191 Code cleanup 2019-10-02 23:25:05 +02:00
Luca Deri 4fd7e5734a Manual merge of pull #769 2019-10-02 23:01:29 +02:00
Luca Deri 3dbf7bbabb Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-10-02 20:58:02 +02:00
Luca Deri 8f20e482ce Improved Viber protocol dissection
Added Hulu dissection
2019-10-02 20:57:17 +02:00
Luca Deri 329a33ed59 Merge pull request #791 from ntop/ndpi_hs
Fix crash due to recent code changes when using hyperscan and mining_…
2019-10-02 20:50:19 +02:00
Ravi Kerur 77edf1f680 Fix crash due to recent code changes when using hyperscan and mining_hosts.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-10-02 09:32:39 -07:00
emanuele-f 7f510c10fe Fix double free after b19bfa1e20 2019-10-02 16:26:52 +02:00
Luca Deri a559ba20b1 Merge pull request #790 from emanuele-f/managed_strings
Fixes leaks in ndpi_add_host_url_subprotocol
2019-10-02 15:30:33 +02:00
emanuele-f b19bfa1e20 Fixes leaks in ndpi_add_host_url_subprotocol
It is now possible to deallocate strings in ac_automata_release via
an additional parameter
2019-10-02 14:02:19 +02:00
Luca Deri 6a22bee2ca Added URL in results 2019-10-01 12:26:15 +02:00
Luca Deri e45237a93f Removed http:// from HTTP url
Reported URL in ndpiReader
2019-10-01 12:25:39 +02:00
Luca Deri a62cf10233 Added SSH handling in ndpi_extra_dissection_possible() 2019-09-30 23:23:52 +02:00
Luca Deri 1361c8fbdf Updated the logic of ndpi_is_subprotocol_informative() 2019-09-30 17:28:41 +02:00
Luca Deri f2a5bbef17 Reworked categories handling
Removed GenericProtocol and replaced with categories
Removed ndpi_pref_enable_category_substring_match option: substring matching is now default
2019-09-29 21:46:41 +02:00
Luca Deri 016d568c2b Merge pull request #787 from bohmax/explanation-file
Adding explanation file
2019-09-29 18:32:46 +02:00
bohmax 02609114d3 Add files via upload 2019-09-29 11:10:46 +02:00
Luca Deri 53ea3481ea Fixed ICMP parsing bug introduced by pull #770 2019-09-29 08:10:12 +02:00
Luca Deri 59b8399923 Merge pull request #778 from choyos/dev
Added support for dissection of DNP3 and IEC104 protocols
2019-09-29 08:02:49 +02:00
Luca Deri 3b06d2191c Merge pull request #770 from ntop/ndpi_icmp
Add icmp and icmp6 to calculate splt and bd values.
2019-09-29 07:59:02 +02:00
Luca Deri e9df2b187c Merge pull request #786 from ntop/ndpi_ac_vpn
Add Cisco anyconnect VPN signature.
2019-09-29 07:58:27 +02:00
Ravi Kerur bc1b266174 Add Cisco anyconnect VPN signature.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-28 19:52:53 -07:00
Luca Deri b0c68dc29b Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-09-27 17:35:08 +02:00
Luca Deri c839dcb74c Improved category handlign in subprotocols
Further DNS dissection fixes
Fixed WeChat invalid category
2019-09-27 17:34:22 +02:00
emanuele-f 05aa27e477 Add test for custom categories match on HTTP and SSL flows 2019-09-27 14:01:12 +02:00
Luca Deri 7c788f0779 Fixed partial string matches 2019-09-27 13:42:41 +02:00
emanuele-f 5099646938 Fix missing strdup on ndpi_load_hostname_category 2019-09-27 12:09:51 +02:00
emanuele-f 277b4a060a Add categories test PCAP 2019-09-27 10:15:20 +02:00
Luca Deri 17f560a1cd Added ndpi_extra_dissection_possible() API call 2019-09-26 23:50:02 +02:00
Luca Deri 194cdcf581 Fixed false positive with STUN detection 2019-09-26 22:18:56 +02:00
Luca Deri 7de9fd7170 Updated instagram check 2019-09-26 22:08:21 +02:00
Luca Deri 0e9918464b Added Zoom protocol support removing invalid STUN/Skype detections 2019-09-26 21:52:42 +02:00
Luca Deri ce40155377 Merge pull request #783 from ntop/ndpi_ps_vue
Ndpi ps vue
2019-09-26 19:37:49 +02:00
emanuele-f 4dc60f151d Restructure DNS search code 2019-09-26 13:20:13 +02:00
emanuele-f 937dcb38ea Fix bad protocols returned in ndpi_detection_giveup when detection is already complete 2019-09-26 12:15:49 +02:00
Ravi Kerur 4170eb3a1d Modified logic and test pcap file included.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-25 16:21:22 -07:00
Ravi Kerur c3a5650071 Initial PS_VUE support based on public IP.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-25 15:20:19 -07:00
Luca Deri 62fa0908a3 Improved packet datastructure cleanup after packet processing
Cleaned up code of steam dissector
Added steam test pcap
2019-09-25 23:59:22 +02:00
Ravi Kerur d2c0b9872d Initial Zoom detection based on IP and ports.
Following IP and ports are reported by Zoom support
to open up in firewall.

https://support.zoom.us/hc/en-us/articles/201362683-Network-Firewall-or-Proxy-Server-Settings-for-Zoom

Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-25 12:59:34 -07:00
Alfredo Cardigliano 3709e673d9 New serializer APIs ndpi_serialize_start_of_block / ndpi_serialize_end_of_block (JSON only) 2019-09-25 17:19:33 +02:00
Luca Deri 0b62c0ad45 Merge pull request #781 from marco-testa/dev
Update dissector stun.c
2019-09-24 16:39:46 +02:00
Luca 0ed679e795 Improves IAT calculation 2019-09-24 16:37:42 +02:00
marco-testa b706730e10 Loaded in the wrong place 2019-09-24 09:45:34 +02:00
marco-testa bd83847027 Changed the packets handling with STUN msg_type > 0x000C and other fixes.
Eliminated double call to the ndpi_int_stun_add_connection function.
2019-09-24 09:43:47 +02:00
marco-testa d3348ff730 Changed the packets handling with STUN msg_type > 0x000C and other fixes.
Eliminated double call to the ndpi_int_stun_add_connection function.
2019-09-24 09:41:58 +02:00
Ravi Kerur e29032085d Merge branch 'dev' of https://github.com/ntop/nDPI into ndpi_icmp 2019-09-23 17:06:43 -07:00
Luca Deri 19dbcaa3a9 Fixes #777 2019-09-23 18:04:55 +02:00
Luca Deri 3f56b2476a Merge pull request #780 from bohmax/fix_wrap
Fix wrap
2019-09-23 17:48:02 +02:00
bohmax 8246467022 Add files via upload 2019-09-23 17:40:34 +02:00
bohmax 90c28e9d63 Delete ndpi_typestruct.py 2019-09-23 17:40:16 +02:00
Luca Deri 64513b1c0e Rewritten qq dissector 2019-09-23 17:39:58 +02:00
Ravi Kerur e8d501158e Restore protocol extraction to original method.
Add microseconds to time series if milliseconds returns 0.

Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-21 10:38:04 -07:00
Ravi Kerur d92015a092 Merge branch 'dev' of https://github.com/ntop/nDPI into ndpi_icmp 2019-09-21 10:16:10 -07:00
Luca Deri 5c2e495792 ndpiReader now report protocol category and breed
Modified TikTok category to Fun
2019-09-21 09:52:44 +02:00
Luca Deri 421f819b8a Added signal test pcap 2019-09-21 09:40:20 +02:00
Luca Deri ab9246f51f Adedd DTLS check in STUN
Uodated (C)
2019-09-21 09:16:56 +02:00
Ravi Kerur e2e05cd499 Merge branch 'dev' of https://github.com/ntop/nDPI into ndpi_icmp 2019-09-20 10:54:58 -07:00
Luca bdcc6dc173 STUN protocol dissector code cleanup 2019-09-20 18:47:39 +02:00
Luca f9716c5139 Unified WhatsApp Video and Audio under WhatsAppCall 2019-09-20 17:37:41 +02:00
choyos bae36d2e25 added dnp3 and iec104 pcaps for tests 2019-09-20 13:35:46 +02:00
choyos cbda4c2af1 Added support for industrial protocols DNP3, IEC 60780-5-104 2019-09-20 13:29:49 +02:00
Luca f678486393 Improved STUN-based protocol heuristic both in terms of accuracy and packets necessary for the detection 2019-09-20 07:29:02 +02:00
emanuele-f 518df786ed Add ndpi_parse_ip_string and ndpi_get_ip_string API 2019-09-19 16:08:47 +02:00
Luca Deri 16da3f58cc Fixed JA3C compuration wtih SSL (no TLS) traffic 2019-09-19 00:01:44 +02:00
Luca Deri cf0ca7db51 Improved STUN caching 2019-09-18 23:31:25 +02:00
Luca Deri 0d8a161d15 Further line update 2019-09-18 23:24:41 +02:00
Luca Deri 487110693c Line protocol update 2019-09-18 23:23:13 +02:00
Luca Deri 3287dfbff4 Added dissection of TLS version in supported_versions of Hello packets 2019-09-18 14:20:01 +02:00
Luca Deri ac1f7d71dd New instagram testing set 2019-09-18 12:23:55 +02:00
Luca Deri a716d5a317 Improved Line protocol heuristic 2019-09-18 12:14:23 +02:00
Ravi Kerur 7e3fd16b0d Merge branch 'dev' of https://github.com/ntop/nDPI into ndpi_icmp 2019-09-17 17:01:17 -07:00
emanuele-f e152e687a5 Fix notBefore/notAfter broken in previous commit 2019-09-17 18:43:11 +02:00
emanuele-f 10e560a508 Fix notBefore/notAfter issues 2019-09-17 18:09:17 +02:00
Luca Deri 2fc68a441d Improved -C output 2019-09-17 12:07:00 +02:00
Luca Deri 64ed0ac6b3 Various STUN improvements 2019-09-17 00:11:17 +02:00
Ravi Kerur ce79626679 Merge branch 'dev' of https://github.com/ntop/nDPI into ndpi_icmp 2019-09-16 13:56:17 -07:00
Luca Deri 8f4e8d8254 Code cleanup 2019-09-15 22:56:55 +02:00
Luca Deri 62c9766cc1 Warnign fix 2019-09-15 22:43:43 +02:00
Luca Deri f0013e826e Added python bindings for nDPI 2019-09-15 22:32:18 +02:00
Luca Deri 5fd79567f0 Merge pull request #767 from LocutusOfBorg/fix-cross-ftbfs
Fix cross-build from source, because of direct pkg-config check calls
2019-09-15 20:57:13 +02:00
Luca Deri 11e9fd8cef As TLS certificate fingerprint is computed, TLS without certificate protocol has been removed
Various improvemenets in detection quality
2019-09-15 12:18:24 +02:00
Luca Deri 2b0945b88d TLS disection improvements 2019-09-15 10:56:08 +02:00
Ravi Kerur 23780a655d Fix protocol for v4 and v6.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-14 18:38:18 -07:00
Ravi Kerur 9f83bf4624 Add icmp and icmp6 to calculate splt and bd values.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-09-14 10:06:37 -07:00
Luca Deri 00e639d513 TLS certificate hash is not reported 2019-09-14 15:00:52 +02:00
Luca Deri 659f75138c TLS cerficate hash calculation 2019-09-14 12:38:58 +02:00
Alfredo Cardigliano d7c2ced475 Fix ndpi_serializer_rollback_snapshot with single records 2019-09-11 20:04:32 +02:00
Helmut Grohne 2e01a1fe53 Fix cross-build from source, because of direct pkg-config check calls
ndpi fails to cross build from source, because configure.seed hard codes
the build architecture pkg-config. It is best to use PKG_CHECK_MODULES
instead. Please consider applying the attached patch.

See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939286
2019-09-11 19:11:42 +02:00
Luca Deri e687a73cb2 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-09-11 17:14:52 +02:00
Luca Deri 6966e0d19b Added STUN check to avoid false positives
Added fingerprint comments in SSH/TLS
Added netflow test pcap
2019-09-11 17:13:49 +02:00
Alfredo Cardigliano 7d9ed162c7 Optimized memory utlization resizing serialization buffer buffer 2019-09-11 16:32:40 +02:00
Alfredo Cardigliano 848c9db4fb Added ndpi_init_serializer_ll() to specify low-level settings for optimizing memory allocations 2019-09-11 16:10:18 +02:00
Alfredo Cardigliano 16fe2574b1 Fix ndpi_serializer_rollback_snapshot with JSON 2019-09-11 11:32:11 +02:00
Luca Deri c3c975a51a Renamed snapshot API call 2019-09-11 09:45:29 +02:00
Alfredo Cardigliano a265b50a66 Support for nDPI serializer snapshot set/reset 2019-09-10 20:24:36 +02:00
Luca Deri 67a1455619 ndpi_serializer_set_buffer_len() fix 2019-09-10 23:55:00 +02:00
Luca Deri 844e2bab3b warnng fix 2019-09-10 22:46:37 +02:00
Luca Deri b1583cc29e Added ndpi_serializer_set_buffer_len() API call 2019-09-10 22:45:52 +02:00
Luca Deri 0f9107bef3 Fixed timezone conversion 2019-09-10 22:15:23 +02:00
Luca Deri 068611e8ba Changes in validity format 2019-09-10 21:44:42 +02:00
Luca Deri 1f417fe67d Validity format fix 2019-09-10 21:44:04 +02:00
Alfredo Cardigliano 8186b72c11 Added ndpi_deserialize_clone_all to the public API 2019-09-10 19:30:52 +02:00
Alfredo Cardigliano 4c0cc80771 New API ndpi_deserialize_clone_all to clone an record from TLV to a different format (e.g. JSON) 2019-09-10 18:57:28 +02:00
Alfredo Cardigliano 9c8c165a2c Added ndpi_deserialize_clone to the public API 2019-09-10 17:32:13 +02:00
Alfredo Cardigliano 84ce1861a2 New API ndpi_deserialize_clone to clone an element from a deserialized TLV to another TLV 2019-09-10 17:30:15 +02:00
Alfredo Cardigliano 990d06d10c TLC EOR/Unknown items size 2019-09-10 16:40:29 +02:00
Alfredo Cardigliano 3e1c811780 Added ndpi_deserialize_get_format() to read the serialization format 2019-09-10 15:02:02 +02:00
Alfredo Cardigliano b96b618443 nDPI serialization: uint key compression, new deserialization API 2019-09-10 14:47:47 +02:00
Luca Deri 65bdd0de9a Uddated results 2019-09-10 00:43:03 +02:00
Luca Deri 086c511a11 Parsed TLS certificate validity 2019-09-10 00:34:48 +02:00
Luca Deri c5fffce96c Added IMO dissector
Fixed TLS/UDP detection
Reduced UBNT buffer for saving space
2019-09-09 21:17:53 +02:00
Luca Deri d457b07f9f Refreshed Tor node list 2019-09-08 21:42:33 +02:00
Luca a0a8149833 Skype STUN enhancements 2019-09-06 10:41:53 +02:00
Luca 241cfb319b Enhanced Signal detection 2019-09-05 10:45:08 +02:00
Luca 9b80c6314d Enhanced STUN cache 2019-09-05 10:23:07 +02:00
Luca Deri 3d21c33409 Compilation fix when JSON-C is not present 2019-09-03 18:45:51 +02:00
Luca b3c88a7e24 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-09-03 18:39:36 +02:00
Luca 886d575157 Added -C to generate CSV analysis files
Improved IAT and byte distribution
2019-09-03 18:38:54 +02:00
Alfredo Cardigliano 2a8f9c3a81 Return value fix in ndpi_deserialize_* 2019-09-03 11:44:32 +02:00
Alfredo Cardigliano 2cbad47d7b Added vxlan header 2019-09-03 02:26:40 +02:00
Luca Deri eb154bac69 Added ndpi_alloc_data_analysis APi call 2019-09-02 22:12:46 +02:00
Alfredo Cardigliano ab178e62f5 Transparently handle int8/16 deserialization 2019-09-02 17:29:08 +02:00
Luca Deri bc4c48fa0b Added packetIDs with -P 2019-09-02 14:47:37 +02:00
Luca Deri 5d5d056849 Added payload memory free 2019-09-02 14:14:13 +02:00
Luca Deri f1ad951bf6 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-09-02 14:00:45 +02:00
Luca Deri d0436e7b29 Added new parameter to -P 2019-09-02 14:00:18 +02:00
Alfredo Cardigliano 2616dcb424 TLV signed int compression 2019-09-02 12:33:16 +02:00
Luca Deri eb6afa17c0 Added ndpi_serialize_string_binary() call 2019-09-02 10:18:54 +02:00
Alfredo Cardigliano 77409a3833 TLV: encoding uint 32/64 as 16/8 bit whenever possible 2019-08-30 11:00:04 +02:00
Alfredo Cardigliano 49a02c9b96 TLV deserialization of uint16/uint8/int16/int8 when deserializing uint32/uint64/int32/int64 2019-08-30 10:31:54 +02:00
emanuele-f 1bf23dc2a8 Fix mangled stack by invalid sscanf 2019-08-29 22:40:29 +02:00
emanuele-f fce2cd9817 Fix memory corruptions in ndpi_node handler
Crash occurred with clang version 6.0.0-1ubuntu2 on ubuntu 18
2019-08-29 20:13:19 +02:00
emanuele-f 2c4495e483 Add missing lib 2019-08-29 17:55:51 +02:00
emanuele-f 6781485c42 Warning fix 2019-08-29 16:49:44 +02:00
emanuele-f d27e7e2786 Add missing pack_on on ajp struct 2019-08-29 16:47:33 +02:00
Luca Deri 68f6310222 AJP crash fix 2019-08-29 16:17:43 +02:00
Luca c328452687 Average calculation fix 2019-08-29 16:08:18 +02:00
Luca Deri 536b520750 Added stub for ndpi_free_memory_at_termination() (TODO) 2019-08-29 15:47:34 +02:00
Luca Deri 8b8fd25626 Compilation fix on systems without JSON-C 2019-08-29 15:35:29 +02:00
emanuele-f e98eb294c7 Add missing json cleanup 2019-08-29 15:25:52 +02:00
Luca b1270fc7bb Uodated results 2019-08-29 15:23:01 +02:00
Luca 9eb1676b4b Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-08-29 15:22:46 +02:00
emanuele-f aea91781aa Fix alignment issue on IPv6 structs 2019-08-29 14:50:17 +02:00
Luca 9a6f6d9fe4 Implemented IAT (Inter Arrival Time) stats 2019-08-29 13:40:44 +02:00
Luca e4e40e3c70 Added entropy, average, stddev, variance, bytes ratio calculation 2019-08-28 14:02:39 +02:00
Luca Deri 84aeee49bd Disable debug code 2019-08-27 10:45:33 +02:00
Luca Deri 6011790d79 Entropy calculation example 2019-08-27 10:44:41 +02:00
Luca 2acffb4163 Initial work towards traffic classification 2019-08-27 12:56:15 +02:00
Luca Deri b837f3753d SSH hash fix 2019-08-26 19:13:45 +02:00
Alfredo Cardigliano d043cd2ac7 Serialization/deserialization of int32/int64/float with uint key 2019-08-26 12:55:23 +02:00
Alfredo Cardigliano dbf8c24ecb Fix ndpi_serialize_end_of_record in JSON mode 2019-08-24 03:08:07 +02:00
Alfredo Cardigliano c50709a8d0 Fix ndpi_reset_serializer 2019-08-24 02:56:17 +02:00
emanuele-f 1231b81839 Add more length checks in HASSH
This to prevent possible crashes on invalid packets
2019-08-23 11:36:35 +02:00
Luca Deri d2fe21ddff Enhanced -P in ndpiReader so that it can now specify additional parameters 2019-08-22 23:42:07 +02:00
Luca Deri 2134f83948 Warning fixes 2019-08-22 20:04:15 +02:00
Luca Deri 3d3cae1f20 SSH test file 2019-08-22 19:36:36 +02:00
Luca Deri 1e8a43d51e Merge pull request #758 from tansly/wireguard
Add support for WireGuard VPN
2019-08-22 19:31:51 +02:00
Luca Deri e7c0ac37d8 Implemented HASSH (https://github.com/salesforce/hassh) 2019-08-22 19:25:58 +02:00
Luca Deri 385e848a0f Disabled weak (port-based) teamspeak detection 2019-08-22 15:37:31 +02:00
Luca Deri 9f42a4482a Initial work workards payload analysis 2019-08-21 19:01:56 +02:00
Luca fdeecf5d41 Implemented STUN cache to enhance matching of STUN-based protocols 2019-08-12 14:16:28 +02:00
Luca 51ac583d83 Improved google duo detection 2019-08-12 11:59:57 +02:00
emanuele-f e226f99e4e Fix possible intoaV4 1 byte overflow 2019-08-09 17:02:15 +02:00
emanuele-f f73dc61ff8 Add NDPI_PROTOCOL_DANGEROUS classification 2019-08-09 10:04:56 +02:00
Luca 90547c4fd2 Added SMBv1 test file 2019-08-08 23:33:40 +02:00
Luca c6e832be18 Various TLS/STUN improvememnts 2019-08-08 18:09:12 +02:00
Luca cce8a6026f Reworked SSL/TLS field naming 2019-08-08 15:20:05 +02:00
Luca 419160f351 Implemented DTLS support
Renamed ssl to tls
2019-08-08 12:45:27 +02:00
Luca Deri 3c4a959c1e Updated results when adding client hello 2019-08-07 20:06:31 +02:00
Luca 800deb3f54 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-08-07 20:00:59 +02:00
Luca 49f5beab84 Added client SSL hello 2019-08-07 19:35:33 +02:00
emanuele-f a6fe581d48 Change SMBv1 breed to potentially dangerous
https://techcommunity.microsoft.com/t5/Storage-at-Microsoft/Stop-using-SMB1/ba-p/425858
2019-08-07 12:39:07 +02:00
Luca Deri ff1234cce3 Changes in QUIC dissector to avoid miing QUIC with STUN 2019-08-06 23:13:47 +02:00
Luca Deri 32665e6417 Removed non-ASCII chars from JSON header 2019-07-31 00:11:40 +02:00
Luca Deri b2f7a52f98 Serialization fix 2019-07-30 23:46:20 +02:00
Luca Deri 4ebc8d54f4 Compilation fix 2019-07-30 22:51:54 +02:00
Luca Deri 9c3e623bb4 Split serialization code from ndpi_utils 2019-07-30 22:48:55 +02:00
Luca Deri e1b7005c2b Minro change 2019-07-30 10:28:30 +02:00
Luca Deri 398e9718ea JSON serialization fixes 2019-07-30 08:04:39 +02:00
Luca a0be9ea639 Fixed wrong detection of RTP as WhatsApp voice 2019-07-29 16:28:56 +02:00
Luca Deri fbe87ed640 Fixed CSV initialization 2019-07-29 00:41:29 +02:00
Luca Deri 23af4d8211 Initial CSV implementation 2019-07-29 00:33:48 +02:00
Luca Deri bfc3a00e6c Fix for ndpi_serialize_string_uint32_format with JSON 2019-07-28 23:02:55 +02:00
Luca Deri 40f55e2d06 Added string/float support in (de)serialization 2019-07-27 17:48:23 +02:00
Luca Deri 3e044a759b Code cleanup 2019-07-27 17:24:32 +02:00
Luca Deri 5c38e7b126 Better messenger traffic guess 2019-07-25 17:23:32 +02:00
Alfredo Cardigliano 32c61d3ea1 RPM spec cleanup 2019-07-25 14:23:11 +02:00
Alfredo Cardigliano ea80c4dacc Removed conflict with nprobe-dev 2019-07-25 11:59:01 +02:00
Luca Deri 7f66f1053f Updated google docs detection in wechat.pcap 2019-07-25 09:13:46 +02:00
Luca Deri 734305e111 Updated Google docs category 2019-07-25 08:58:44 +02:00
Luca Deri 3369716fc3 Added SPLT (sequence of packet length and time) and BD (byte distribution) with -J 2019-07-24 23:55:07 +02:00
Yağmur Oymak cdf61de129 Add test for WireGuard 2019-07-24 19:18:20 +03:00
Yağmur Oymak 786ea3c0f9 Merge branch 'dev' into wireguard
Conflicts:
	src/include/ndpi_protocols.h
	src/lib/ndpi_main.c

Get upstream developments.
2019-07-24 19:16:44 +03:00
Yağmur Oymak 9a899c54c9 Harden WireGuard detection
Exploit the fixed size handshake messages and sender/receiver indices.
2019-07-24 18:51:29 +03:00
Luca Deri 2148568347 Added int32/int64 (with sign) serialization/deserialization 2019-07-24 15:20:31 +02:00
Luca Deri 5c6c64ed1d Warnign fix 2019-07-24 14:16:38 +02:00
Luca Deri b99ef159ed Added missing result for nest 2019-07-24 11:32:15 +02:00
lucaderi a9ce7ccb83 Packages fixes 2019-07-24 08:47:36 +02:00
Luca Deri b715467da6 Added -e option to ndpiReader for searchign human readeable strings lenght
Default human readeable strings lenght is not 5 chars (used to be 8)
2019-07-24 00:25:00 +02:00
Luca Deri 63173e7360 Updated results with new dissection 2019-07-24 00:13:07 +02:00
Luca Deri d398b0aba6 Simplified makefile
Fixed warning
2019-07-23 22:45:31 +02:00
Luca Deri 8ff68a58f2 Merge pull request #759 from themadprofessor/patch-2
Create CONTRIBUTING.md
2019-07-23 22:33:29 +02:00
Luca Deri f55391f99d Merge pull request #760 from ntop/nDPI-SPLT-BD
Ndpi splt bd
2019-07-23 22:32:59 +02:00
Ravi Kerur a262f8dd29 Add SPLT and BD classification to the lib.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-07-23 10:00:34 -07:00
Ravi Kerur c6ca6ec712 Add new datastructures.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-07-23 09:56:32 -07:00
Ravi Kerur 1ec160d4c9 nDPI ovs changes.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-07-23 09:56:24 -07:00
Ravi Kerur 6b8234d938 Xbox and PS4 static port classification.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-07-23 09:56:15 -07:00
Ravi Kerur b6db991710 Amazon video static classification.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-07-23 09:56:05 -07:00
Ravi Kerur 6ff9b8b90e Add default port based iperf classification.
Signed-off-by: Ravi Kerur <ravi.kerur@viasat.com>
2019-07-23 09:55:32 -07:00
Stuart Reilly e781ddfa43 Create CONTRIBUTING.md
Add simple contribution guidelines.
2019-07-23 10:47:25 +01:00
Yağmur Oymak a0d8ce4159 Add support for WireGuard VPN 2019-07-23 12:00:23 +03:00
Luca Deri 974abaa275 Merged Google Hangout and Duo as they are pretty similar from the network standpoint and from the features they implement 2019-07-22 23:24:40 +02:00
Luca Deri ccea4669de Improved WhatsApp detection 2019-07-22 23:06:25 +02:00
Luca Deri db36294dcb Warnign fix 2019-07-22 21:42:55 +02:00
Alfredo Cardigliano b13780c6e0 Serialization of arrays in JSON format 2019-07-22 17:24:04 +02:00
Luca Deri 6d00b59bb8 Compilarion fix
Updated SIP result
2019-07-22 16:08:44 +02:00
Luca Deri 72b05fed75 STUN, Hangout, Duo dissection improvements 2019-07-21 08:17:28 +02:00
Alfredo Cardigliano e2d2ca5fe0 Added braces in JSON object serialization 2019-07-19 19:55:21 +02:00
Alfredo Cardigliano d43cfe1ead JSON serialization fixes in buffer offset and room computarion, string escape 2019-07-19 17:33:17 +00:00
Luca Deri 11004de056 Restored serializerUnitTest() after fixes 2019-07-19 16:54:48 +02:00
Alfredo Cardigliano f3faaec9d8 serializer char* parameters are now const 2019-07-19 14:36:41 +00:00
Alfredo Cardigliano 8350b7269f Fix Makefile.dpdk 2019-07-19 10:00:12 +00:00
Luca Deri 6bce0c4a9c Added support for Google Duo 2019-07-19 00:48:07 +02:00
Luca Deri 4bda18a079 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-07-18 15:14:06 +02:00
Luca Deri 46499a53aa Improved Facebook messnger mobile detection 2019-07-18 15:13:48 +02:00
Luca Deri 57ef7c1276 Added QUIC 046 support 2019-07-18 15:00:24 +02:00
Luca Deri b8867642fc Refresh after data leak detection 2019-07-18 11:49:53 +02:00
Luca Deri e902478bd3 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-07-18 11:38:43 +02:00
Luca Deri b50635cb89 Renamed ndpi_util.c -> reader_util.c
Added crash fix with IPv6
2019-07-18 11:38:16 +02:00
Luca Deri cbb31fa204 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-07-18 11:26:17 +02:00
Luca Deri 20bac32e1f Improvements for dta dissection 2019-07-18 11:24:44 +02:00
Luca Deri f394102b80 Merge pull request #752 from marcopiangatello/dev
ndpi_has_human_readeable_string Test
2019-07-18 07:32:38 +02:00
Alfredo Cardigliano dc375aed81 Corruptioon fix 2019-07-18 00:01:52 +02:00
Alfredo Cardigliano c85f7de2c1 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-07-17 22:06:15 +02:00
Alfredo Cardigliano ac3a618458 Improved deserialization safety checks 2019-07-17 22:06:00 +02:00
Alfredo Cardigliano 6081e46ad9 Fix memory corruption (reworked space computation and safety checks) 2019-07-17 21:20:51 +02:00
Alfredo Cardigliano c990d6bbd9 Deserialization boundary check fix, new end_of_record type 2019-07-17 17:58:14 +02:00
marcopiangatello 4ad12dcd19 Update ndpiReader.c 2019-07-17 17:09:33 +02:00
marcopiangatello dea4f784e2 Update ndpiReader.c 2019-07-17 16:55:49 +02:00
marcopiangatello 20c3d90163 Update ndpiReader.c 2019-07-17 16:53:24 +02:00
marcopiangatello 7053721aae Add files via upload 2019-07-17 16:50:38 +02:00
marcopiangatello adcb05d213 Delete ndpiReader.c 2019-07-17 16:50:25 +02:00
marcopiangatello 11639dcc8b Update ndpiReader.c 2019-07-17 16:34:13 +02:00
marcopiangatello 44dd09b438 Add files via upload 2019-07-17 16:08:22 +02:00
marcopiangatello 7280fc7d31 Delete ndpi_util.h 2019-07-17 16:08:00 +02:00
marcopiangatello e93ccab279 Delete ndpi_util.c 2019-07-17 16:07:53 +02:00
marcopiangatello 5294945554 Delete ndpiReader.c 2019-07-17 16:07:45 +02:00
Luca Deri 9ca87a620a Added extar check
Warning fix
2019-07-17 15:31:48 +02:00
Luca Deri b54863edc6 Merge pull request #747 from themadprofessor/travis-gcc
Add more compilers to travis
2019-07-17 15:26:47 +02:00
Stuart Reilly 065d0c7e9f Add ubuntu toolchain to clang builds 2019-07-17 12:14:45 +01:00
Stuart Reilly e2fcb942e8 Add clang-7 2019-07-17 11:44:44 +01:00
Stuart Reilly cfdf832d3a Remove brew update 2019-07-17 11:44:44 +01:00
Stuart Reilly 098c4228fb Make travis more explicit 2019-07-17 11:44:44 +01:00
Stuart Reilly 79a0cfbcdb Remove gcc7, add clang 8 2019-07-17 11:44:44 +01:00
Stuart Reilly e923ca4f17 Add gcc-8 and gcc-9 2019-07-17 11:44:44 +01:00
Stuart Reilly 95ba3fa142 Add gcc-7 to travis.yml 2019-07-17 11:44:38 +01:00
Alfredo Cardigliano 2fcc4f3e73 Added ndpi_serialization_uint32_uint64 and ndpi_serialization_string_uint64 2019-07-17 10:10:41 +00:00
Alfredo Cardigliano 1657686eb4 Moved json2tlv to ntopng 2019-07-17 08:55:46 +00:00
Alfredo Cardigliano c0835968af ZMQ export in json2tlv 2019-07-16 16:04:04 +00:00
Alfredo Cardigliano 4b2fbdb277 json2tlv tool to convert from JSON to TLV and run performance tests 2019-07-16 13:31:26 +00:00
Alfredo Cardigliano 2ce4adf09d Added ndpi_serialization_string_uint32 2019-07-16 12:31:41 +02:00
Luca Deri 1777841ec1 Line dissection improvements 2019-07-16 00:02:34 +02:00
Luca Deri f570eccf81 Fixes #741 2019-07-15 23:53:28 +02:00
Luca 67dfddd065 Line fix 2019-07-15 16:25:53 +02:00
Luca 9a4d01cb26 Lenght fix 2019-07-15 16:17:23 +02:00
Luca Deri 5c758d4564 Reworked output
-v 1 now prints only unknown flows
-v 2 now prints all flows
2019-07-15 14:45:25 +02:00
emanuele-f fc531334ae Remove Werror 2019-07-15 09:31:15 +02:00
Luca Deri 5a018e0bc0 Added Line protocol dissection
Add fix for discarding STUN over TCP flows
2019-07-15 00:19:45 +02:00
Luca Deri f8fb1f838c Fixes #740 2019-07-14 12:25:08 +02:00
Luca Deri 7b16c68e92 JA3 format cleanup 2019-07-13 19:32:51 +02:00
Luca Deri af2dc0860c Merge pull request #734 from glpaparelli/dev
fixed the printing layout, even with IPv6
2019-07-13 18:44:03 +02:00
Luca Deri acd3db13f8 Fixes #735 2019-07-13 18:39:18 +02:00
Luca Deri c8a867bf29 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-07-13 18:38:20 +02:00
Luca Deri 17c49b2e6d Updated test resultss after export changes 2019-07-13 18:37:57 +02:00
Luca Deri 9bdc021f98 Merge pull request #736 from themadprofessor/patch-1
Fix invalid function prototype
2019-07-13 18:36:09 +02:00
Luca Deri c65025f7b0 Merge pull request #737 from themadprofessor/dev
Add compiler warnings and fix them
2019-07-13 18:34:40 +02:00
Luca Deri ea32d535eb initial work towards simple serilizer/deserialier 2019-07-13 18:32:22 +02:00
Stuart Reilly 92c769f206 Solve remaining warnings 2019-07-12 16:41:39 +01:00
Stuart Reilly 343ee0c9b6 Merge branch 'dev' of github.com:themadprofessor/nDPI into github 2019-07-12 16:28:38 +01:00
Stuart Reilly 8b1c68aed3 Add compiler warnings and fix them 2019-07-12 16:01:22 +01:00
Stuart Reilly 929cbbb7fc Add compiler warnings and fix them 2019-07-12 15:59:11 +01:00
Stuart Reilly 22e323528e Fix invalid function prototype
Solves a warning when compiling with strict-prototypes.
2019-07-12 15:02:20 +01:00
Giulio Paparelli 52533c3b66 all fixed 2019-07-12 12:06:10 +02:00
Luca Deri 563215a05e Compilation fix 2019-07-12 07:24:07 +02:00
Luca Deri 4ac60d88d7 Improved whatsapp dissection 2019-07-11 22:49:24 +02:00
Luca Deri 3e2e616507 Dissection improvents
Fixed QUIC dissection
Disabled debug message
2019-07-11 22:35:50 +02:00
Luca Deri da7e595fcf Fixed uninitialized variable that caused weird errors 2019-07-10 19:27:27 +02:00
Luca Deri 829a284d48 Fix that caused nDPI to provide false positive results with pattern matching 2019-07-10 16:08:12 +02:00
Luca Deri c0d9dc9969 Typo 2019-07-03 18:03:44 +02:00
Luca Deri cc15389729 Improved protocol guess 2019-07-02 23:25:55 +02:00
Luca edd4f2e37d Remvoed debug info 2019-07-02 15:28:40 +02:00
Luca Deri 8205f2c6f1 Various TLS improvements 2019-07-02 00:05:17 +02:00
Luca Deri dd9db5d0b7 SSL ciphers improvements 2019-07-01 23:25:48 +02:00
Luca Deri 9590b18fdd Fixed invalid changes in ndpi_get_proto_category() and ndpi_get_proto_name() dur to https://github.com/ntop/nDPI/pull/731/commits/4b717276614e20feada22e6fe29ea2099ba9fd37 2019-07-01 23:16:43 +02:00
Luca Deri 7cb7a12f96 Merge pull request #731 from themadprofessor/dev
Stability Fixes
2019-07-01 20:02:49 +02:00
Stuart Reilly 5ce5bae99d Merge remote-tracking branch 'upstream' into dev 2019-07-01 17:49:14 +01:00
Luca Deri 8fdef484f6 Minor change 2019-07-01 12:51:55 +02:00
Luca Deri 65e842effa Merge pull request #730 from hoermto/hoermto-patch-alpine
Alpine linux: "ln -F" not supported in alpine
2019-06-30 15:34:00 +02:00
Luca Deri 2c43b61798 Added DNSoverHTTPS detection 2019-06-30 12:36:58 +02:00
Luca Deri a1ac31062d Added ndpi_has_human_readeable_string for detecting human-readeable strings in buffers 2019-06-30 11:59:51 +02:00
Luca Deri 06b05e21c6 Improvemnts in SSL certificate detection 2019-06-30 08:19:51 +02:00
Luca Deri 3f460ad5a9 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-06-29 17:34:45 +02:00
Luca Deri e9e647f043 ntohl Portability fixes 2019-06-29 17:34:08 +02:00
Luca Deri e8c84f3c5d Initial implementation of datasaver protocol support 2019-06-29 13:04:06 +02:00
Stuart Reilly f3161309ff Fix missing braces 2019-06-28 16:21:49 +01:00
Stuart Reilly ef1b8e36a0 Fix potential NULL dref in btlib.c 2019-06-28 16:12:42 +01:00
Stuart Reilly 79634a6789 Fix two resource leaks 2019-06-28 16:11:33 +01:00
Stuart Reilly d8ec0a9229 Move NULL checks to start of functions 2019-06-28 16:08:36 +01:00
Stuart Reilly bc1b4885de Fix potential NULL deref in libcache 2019-06-28 16:00:32 +01:00
Stuart Reilly 4b71727661 Fix two potential OOB reads in ndpi_main.c 2019-06-28 15:55:00 +01:00
Stuart Reilly cc39ef0946 Remove duplicate defintions and fix function prototypes 2019-06-28 15:53:11 +01:00
hoermto e47c0c3e49 Makefile: ln -F not supported in alpine
removed -F option from makefile for alpine support. Actually not sure the relevance of -F flag for other OS
2019-06-28 15:54:59 +02:00
Luca Deri 81d3fc8a24 Dissection improvements 2019-06-27 16:38:36 +02:00
Luca Deri cc51253007 Removed debug message 2019-06-25 16:30:51 +02:00
Luca Deri a4d797f832 WhatsApp improvements for video/audio detection 2019-06-25 15:18:49 +02:00
Luca Deri 6ed8ccfa46 Merge pull request #723 from lance-wyvern/dev
OICQ protocol version:0x371b
2019-06-22 15:42:15 +02:00
Luca Deri c4f513f6e7 Merge pull request #717 from weiyanhua100/dev
add null process for malloc.
2019-06-22 15:40:25 +02:00
Luca Deri 4ea8eaf103 Merge pull request #724 from themadprofessor/fix_dhcp_tests
Fix tests broken by new DHCP fingerprinting
2019-06-22 15:40:08 +02:00
Luca Deri 00ed2653fe Further WhatsApp improvements 2019-06-21 19:06:41 +02:00
Luca Deri 179b93d625 Better UDP flow handling 2019-06-21 12:14:57 +02:00
Luca Deri 3e43e77b1c Cleanup 2019-06-21 12:14:51 +02:00
Luca Deri b66606bc16 Improved OpenVPN support for UDP-based VPNs 2019-06-21 12:01:07 +02:00
Luca Deri b6ac750e21 Added WhatsApp Video 2019-06-20 23:16:36 +02:00
Luca Deri 936a95e10e WhatsApp improvements 2019-06-20 23:11:16 +02:00
Luca Deri 13e8354f37 JSON-C fix 2019-06-20 22:16:53 +02:00
Luca Deri 0fe7f16ecf Fixed invalid false positive 2019-06-20 21:11:21 +02:00
Stuart Reilly 784f4e4bba Add dhcp fingerprints to expected results 2019-06-19 13:20:55 +01:00
zhenxian.wang 1e616b227b new QQ version:0x3823 2019-06-19 15:58:30 +08:00
Luca 4830aa9a14 DHCP fingerprint is now in human readeable format 2019-06-18 17:44:05 +02:00
Luca 5f26149938 Added DHCP fingerpring handling 2019-06-18 17:36:39 +02:00
zhenxian.wang 1891f687b6 new QQ version 2019-06-18 18:04:46 +08:00
Luca Deri 41b75485eb SSL cipher improvements 2019-06-16 21:42:12 +02:00
Luca Deri 1a3f2b3f0d Reworked SSL cipher handling 2019-06-16 16:05:13 +02:00
Luca Deri 5b7a08bac3 Added SSL cipher print 2019-06-16 10:08:21 +02:00
weiyanhua e814cd0b9e add null process for malloc. 2019-06-13 15:05:22 +08:00
Luca Deri 709a87c8d4 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-06-05 23:15:42 +02:00
Luca Deri 4e8055742e Added fix for discarding core protocols as subprotocols 2019-06-05 23:15:06 +02:00
lucaderi 3979c28cac Added missing antimalware category 2019-06-03 19:50:18 +02:00
Luca Deri e6813846b8 Adds CUSTOM_CATEGORY_ANTIMALWARE category referenced by #710. 2019-06-03 08:18:24 +02:00
Luca Deri 165decdf6c Merge pull request #691 from pallas/fix-double-strdup
Fix double-strdup memory leak in ndpi_handle_rule
2019-06-03 08:10:01 +02:00
Luca Deri 4441bc7033 Merge pull request #711 from dfranusic/dev
Added PUBLISH/SUBSCRIBE/MESSAGE methods to SIP
2019-06-03 08:05:26 +02:00
Damir Franusic a015cb7f48 Merge remote-tracking branch 'upstream/dev' into dev 2019-05-31 15:21:04 +02:00
Damir Franusic 5c7e0a0319 SIP Message extension
* RFC 3248
2019-05-31 15:19:07 +02:00
Luca Deri c43bec826d Updated results with the new SSL dissection
Added RDP dissector
2019-05-30 11:15:50 +02:00
Luca a3b564eb92 Warning fix 2019-05-29 18:54:17 +02:00
Damir Franusic 1b9955e9ef Added PUBLISH/SUBSCRIBE methods to SIP 2019-05-29 17:12:32 +02:00
Luca Deri 5da363cbde Fixed MySQL dissector
SSL dissector now reports the protocol version
Fixed bug in ndpiReader that ivalidates in some cases the protocl dissection and used to slow down the dissection
2019-05-28 23:35:49 +02:00
Luca Deri 53119e71f4 Added ndpi_is_safe_ssl_cipher(0 call 2019-05-23 00:16:05 +02:00
Luca Deri fcc9c76249 Disabled debug 2019-05-22 21:19:22 +02:00
Luca Deri f29f9bbb38 Update SSL server ciphers 2019-05-22 12:37:27 +02:00
Luca Deri 04b543caa9 SSL certificate analysis improvement 2019-05-20 22:30:53 +02:00
Luca Deri 3f9383c343 Added missing definitions 2019-05-20 22:13:21 +02:00
Luca Deri 0d2f8f4498 Implements #705 2019-05-20 22:02:21 +02:00
Luca Deri 53e64df8e2 Removed debug code 2019-05-20 15:40:09 +02:00
Luca Deri f97be61e8b Fixed JA3 decoding
Made ndpi_process_extra_packet() optional
2019-05-20 15:32:50 +02:00
Luca Deri 9604386698 Merge pull request #704 from TelecomsSansFrontieres/dev
Adding 2 missing Whatsapp IPs
2019-05-18 11:18:07 +02:00
Luca Deri 7b2d9adbdf Merge pull request #707 from zyingp/xcode_fix
Fix the Xcode project
2019-05-18 11:17:47 +02:00
Luca d592902553 JA3 hardeding code 2019-05-15 17:55:01 +02:00
Yingpei Zeng 08ca25c9c8 Fix the Xcode project 2019-05-15 09:56:10 +08:00
Luca Deri e5a95cf92e Skept GREASE in SSL JA3 fingerprint 2019-05-13 23:22:19 +02:00
Clément BRUGUERA 1a2b8a98a6 Adding 2 missing Whatsapp IPs 2019-05-13 17:26:19 +02:00
Luca Deri 0d0d6893fc JA3 fixes 2019-05-12 15:25:14 +02:00
Luca Deri 3b185a00fa Disabled debug traces 2019-05-11 00:53:02 +02:00
Luca Deri a00ad9fc92 Initial JA3 support (https://github.com/salesforce/ja3) for SSL 2019-05-11 00:50:56 +02:00
Luca Deri b96e6a9e2d Merge pull request #696 from pallas/avoid-hyperscan-leak
Avoid leaking hyperscan struct
2019-05-08 12:13:23 +02:00
emanuele-f ea1ea99ce1 Add allowed site category 2019-05-06 12:01:53 +02:00
Luca Deri e99a0abfba Hardening fixes for packer parsing 2019-05-03 18:08:12 +02:00
cardigliano 361ab030bc ndpi_handle_rule accepted formats 2019-04-29 09:44:39 +02:00
Derrick Lyndon Pallas 33d17dbf1f Avoid leaking hyperscan struct 2019-04-22 17:02:11 +00:00
Alfredo Cardigliano 8a09ca2180 Fixed RPM pkgconfig path 2019-04-19 11:44:10 +02:00
Alfredo Cardigliano 1bbb992ca6 Fixed pkgconfig path (installing libndpi.pc in the default location) 2019-04-19 11:38:34 +02:00
emanuele-f 4dd51a165c Fix DNS rsp_addr missing in some tiny responses 2019-04-15 19:54:17 +02:00
Luca Deri 8365afee8d Merge pull request #688 from Dark-Vex/whatsapp
Added new Whatsapp addresses ntop/nDPI issue #683
2019-04-12 19:39:20 +02:00
emanuele-f 0961caec1b Add missing fclose in ndpiReader 2019-04-12 19:39:01 +02:00
Luca Deri 1bf9351a67 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-04-12 19:33:17 +02:00
Luca Deri 3cb0b3fc7b Fixes #692 2019-04-12 19:32:44 +02:00
Luca Deri ffb1b9c14f Merge pull request #690 from pallas/make-path-const
Make path const in ndpi_load_protocols_file
2019-04-12 19:25:27 +02:00
Luca Deri 82817c1cac Merge pull request #687 from Dark-Vex/viber
Added Viber IPs issue #684
2019-04-12 19:25:00 +02:00
Luca Deri 173a04007f Merge pull request #682 from chiehmin/dev
Parse HTTP PATCH method
2019-04-12 19:24:14 +02:00
Luca Deri 83d5627c4d Merge pull request #694 from pallas/avoid-csgo-short-read
csgo: fix invalid read on short packet
2019-04-12 19:20:14 +02:00
Luca Deri 6f8a01ca18 Merge pull request #695 from pallas/avoid-memcached-short-read
memcached: fix invalid read on short packet
2019-04-12 19:19:46 +02:00
emanuele-f 5b6526cc5a Add missing newlines 2019-04-12 17:25:38 +02:00
emanuele-f 5e24b32467 Fix category detection 2019-04-12 17:08:32 +02:00
Luca Deri 2f14b8abbf Added test file for FTP 2019-04-12 12:19:11 +02:00
Derrick Lyndon Pallas 74715b12b0 memcached: fix invalid read on short packet 2019-04-06 01:00:44 +00:00
Derrick Lyndon Pallas 7415af5086 csgo: fix invalid read on short packet 2019-04-06 00:31:41 +00:00
Derrick Lyndon Pallas 85776a532d Fix double-strdup memory leak in ndpi_handle_rule
proto is being strdup'd both in the call to ndpi_set_proto_defaults and
inside of that function as well, leaking the memory.
2019-04-05 19:00:39 +00:00
Derrick Lyndon Pallas bb2f35fe79 Make path const in ndpi_load_protocols_file 2019-04-05 18:48:42 +00:00
Luca 1290706fad Tests result fix
Merge branch 'dev' of https://github.com/ntop/nDPI into dev
2019-04-05 12:51:59 +02:00
Luca 4e7fa82aff Fixed false positive with FTP_DATA protocol
Added coherency in application protol guess by exploiting the host server name
Various protocol optimizations
2019-04-05 12:47:58 +02:00
emanuele-f 796472cf84 Fix category detection due to missing initialization 2019-04-05 10:11:17 +02:00
Luca Deri a455e0d8d4 Improved flow category guess 2019-04-02 23:01:03 +02:00
Dark-Vex 55c4108d8b [FIX] Added new whatsapp addresses ntop/nDPI issue #683 2019-04-02 16:47:49 +02:00
Daniele De Lorenzi 2ef19c7e49 [FIX] Added IPs reported in ntop/nDPI issue #684 2019-04-02 16:04:01 +02:00
Daniele De Lorenzi e27022b698 Merge pull request #11 from ntop/dev
Add all dev branch modifications
2019-04-02 15:49:54 +02:00
Luca Deri 153c77c2cd Improvements with category detection 2019-04-01 18:40:14 +02:00
Luca Deri 6693151052 Added custom category support to ndpi_get_partial_detection() 2019-04-01 16:12:44 +02:00
Luca Deri 1915a63cf2 Implemented ndpi_process_partial_detection() API call to handle partial matches due to the nDPI specified configuration 2019-04-01 12:30:51 +02:00
emanuele-f c496c7975f Add DNS response address 2019-03-29 19:58:10 +01:00
Luca Deri 8dbe7818eb Improvments for AmazonVideo 2019-03-27 07:00:11 +01:00
chiehminw 1df5b453cb Parse HTTP PATCH method
HTTP PATCH is introduced in RFC 5789 (https://tools.ietf.org/html/rfc5789)

Signed-off-by: chiehminw <chiehminw@synology.com>
2019-03-26 11:46:57 +08:00
Luca Deri 0b5e5a5f82 SSL cleanup 2019-03-25 22:08:39 +01:00
Luca Deri f47be6ef60 Added SSL organization support 2019-03-23 10:32:18 +01:00
Luca Deri f592b9fc31 Merge pull request #681 from chiehmin/certificate-parsing
Parse server certificate organization
2019-03-23 09:58:54 +01:00
Luca Deri 6b1f158322 Merge pull request #675 from chiehmin/dev
Respect CXX variable during configure
2019-03-23 09:54:17 +01:00
Luca Deri 99748cddcc Merge pull request #679 from chiehmin/link-use-relative-path
Use relative path for library link
2019-03-23 09:53:35 +01:00
Luca Deri e2cd89e354 Merge pull request #678 from madpilot78/FreeBSD_endian.h
The le32toh() function used in some places on BSD OSes requires sys/en…
2019-03-23 09:53:05 +01:00
Luca Deri e5f6f68cd6 Merge pull request #677 from chiehmin/add-http-method-prefix
Add NDPI prefix for HTTP_METHOD enum to avoid name collisions
2019-03-23 09:52:34 +01:00
Luca Deri e2ad6bf79f Merge pull request #673 from vel21ripn/dns_fix_name
More accurate hostname verification in a DNS query.
2019-03-23 09:51:53 +01:00
Luca Deri ef9f395cb6 Merge pull request #665 from vel21ripn/whatsapp
Fix whatsapp signature detecting.
2019-03-23 09:49:35 +01:00
Luca Deri e6f8a66197 Merge pull request #662 from bmwiedemann/date
Use ChangeLog date instead of build date
2019-03-23 09:49:06 +01:00
Luca 5656a41f69 Improved snapchat detection 2019-03-22 12:36:42 +01:00
chiehminw 96ed31874d we only need one dot to confirm it is a valid domain name
github.com is valid but can not be retreive by server certificate
parsing

Signed-off-by: chiehminw <chiehminw@synology.com>
2019-03-20 17:47:51 +08:00
chiehminw db91837647 retreive ssl certificate origanization
Signed-off-by: chiehminw <chiehminw@synology.com>
2019-03-20 17:47:48 +08:00
emanuele-f 6c9fbc2ddb Fix invalid categories labels array length and add check 2019-03-18 13:29:59 +01:00
Luca Deri 7237f7081f Improved FTP dissection 2019-03-14 22:07:21 +01:00
Luca Deri 54f90c7556 Added fix to avoid FTP false positives 2019-03-14 21:50:09 +01:00
chiehminw 43890b31fc Use relative path for library link
relative link path can preserve link relation after packaging and
doplying to new machine

ex:
$ make DESTDIR=/tmp/ndpi install
$ tar czf ndpi.tar.gz /tmp/ndpi
$ tar xf ndpi.tar.gz -C /lib

Orignal install script will caused the /lib/libndpi.so.2 links to
/tmp/ndpi/libndpi.so.2.9.0 which is not intended

Signed-off-by: chiehminw <chiehminw@synology.com>
2019-03-13 15:04:10 +08:00
Guido Falsi b1282da542 The le32toh() function used in some places on BSD OSes require sys/endian.h to be included. 2019-03-12 18:12:18 +01:00
Luca 22e431ca67 Sporify fix 2019-03-12 18:01:14 +01:00
chiehminw b1bd7d6f8c Add NDPI prefix for HTTP_METHOD enum to avoid name collisions
ref: https://stackoverflow.com/questions/35380279/avoid-name-collisions-with-enum-in-c-c99

Signed-off-by: chiehminw <chiehminw@synology.com>
2019-03-12 16:11:33 +08:00
Luca Deri 6c1d236a03 Category cleanup 2019-03-10 21:44:11 +01:00
Luca Deri 89d548f9d3 Removed categories based on file content 2019-03-10 21:18:19 +01:00
Luca fde4380422 Proto cleanup 2019-03-08 20:17:11 +01:00
Luca Deri aaa686b9fe Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-03-08 15:59:26 +00:00
Luca Deri 03b0aa7185 Added new categories
- NDPI_PROTOCOL_CATEGORY_MUSIC
- NDPI_PROTOCOL_CATEGORY_VIDEO
- NDPI_PROTOCOL_CATEGORY_SHOPPING
- NDPI_PROTOCOL_CATEGORY_PRODUCTIVITY
- NDPI_PROTOCOL_CATEGORY_FILE_SHARING

Protocol vs category rework
2019-03-08 15:58:21 +00:00
chiehminw 518dbbc96b Respect CXX variable during configure
commit 6ac83ce7eb use CXX to link ndpiReader however CXX is not
properly set in configure step

Fixes: 6ac83ce7eb ("Fixes broken hyperscan compilation")
Signed-off-by: chiehminw <chiehminw@synology.com>
2019-03-06 15:27:50 +08:00
Simone Mainardi 59f683858b Fixes possibly broken dissection of invalid DNS responses 2019-03-04 18:48:38 +01:00
Luca Deri c339211ac7 Re-Added TikTok/Musical.ly protocol 2019-03-03 21:07:54 +01:00
Simone Mainardi 93582a4204 Bump to version 2.9 2019-03-01 18:06:28 +01:00
Simone Mainardi 5bb53cf995 Changelog update 2019-03-01 18:02:24 +01:00
Luca 05ef62781f Fixes for wireshark 3 2019-03-01 15:19:05 +01:00
Luca d283538146 Fixed false positive mining detection 2019-03-01 12:56:33 +01:00
Vitaly Lavrov a99754d88b More accurate hostname verification in a DNS query. 2019-02-27 15:26:11 +03:00
Luca Deri de16b01bb2 Improved MDNS dissection 2019-02-24 11:03:06 +01:00
Luca Deri 47669abd44 Added extra check to avoid nDPI wrong matches 2019-02-21 23:29:06 +01:00
emanuele-f ab3833a708 Fix invalid TCP DNS dissection 2019-02-19 17:17:02 +01:00
Luca Deri dc8d582b18 Fixes #671 2019-02-14 10:31:42 +01:00
emanuele-f a035763afd Change ndpi_fill_ip_protocol_category to pass IPs explicitly 2019-02-12 17:28:30 +01:00
Luca Deri 0c4fada265 Fix for avoid wrong substring match to happen 2019-02-10 23:52:24 +01:00
Luca Deri ddf0066c11 Aligned DNS to HTTP dissection 2019-02-07 22:44:48 +01:00
Vitaly Lavrov 476fbbfe4e Fix whatsapp signature detecting. 2019-01-31 11:27:40 +03:00
cardigliano 2ec41c1732 Releasing old buffer if realloc fails 2019-01-31 09:12:04 +01:00
Alfredo Cardigliano 6a98aec2ca Support for protocol file files of arbitrary length 2019-01-30 08:44:32 +00:00
Bernhard M. Wiedemann e91123e17a Use ChangeLog date instead of build date
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good.

This date call works with GNU date and BSD date.
Also use UTC/gmtime to be independent of timezone.
2019-01-24 14:27:10 +01:00
Luca Deri e2ffcd7229 Improved HTTP response code handling 2019-01-23 00:53:56 +01:00
Luca Deri efa96da3e0 Fixes #657 2019-01-20 23:47:24 +01:00
Luca Deri b9ae650146 Merge pull request #659 from cavedon/direction-endianness
Compute packet_direction consistently independently from endianness
2019-01-20 23:18:46 +01:00
Luca Deri 72edc508eb Merge pull request #661 from pcein/propagate-prefix
Propagate prefix settings to Makefiles
2019-01-20 23:17:46 +01:00
Pramode 81649d9979 Propagate prefix settings to Makefiles
A "make install" was failing because the --prefix flag
setting was not being propagated to the Makefiles.
2019-01-20 19:09:07 +05:30
Luca Deri 7efe1f06ee Removed debug code 2019-01-17 22:03:39 +01:00
Luca Deri 85155d5899 Removed debug code 2019-01-17 00:42:45 +01:00
Luca Deri d088a968a9 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2019-01-17 00:41:05 +01:00
Luca Deri efef99cbad Removed this party LRU and replaced with home grown 2019-01-17 00:40:28 +01:00
Luca Deri f3b0878a37 Warnign fixes
Updated test results
2019-01-17 00:39:45 +01:00
Luca Deri c856e0a563 Disabled ookla statistics: needs to be improved 2019-01-16 22:30:55 +01:00
Ludovico Cavedon 2c672a4ea2 Compute packet_direction consistently independently from endianness
Ensure packet_direction is computed in the same way on little endian and
big endian architectures.
This change will convert IP addresses and port from little endian to host
endian (instead of converting from network endian to host endian) so
that it does not change the behavior on little endian architecture where
ndpi is usually developed.
A better (but more invasive) change would be to use the ntoh*()
functions and then adjust all affected tests.
2019-01-16 01:15:43 -08:00
Ludovico Cavedon 0cb4bae275 QUIC: convert little endian offsets to host endianness
Offset in the QUIC protocol are little endian. Reading them as uint32_t
works on little endian architectures, but breaks on big endian ones.
This change applies the proper conversion and fixes running the
http_ipv6 and quic tests on big endian architectures.
2019-01-15 23:49:26 -08:00
Simone Mainardi 2ade0be365 Fixes ookla lru cache use with IPv6 2019-01-15 09:56:33 +01:00
Luca Deri f2f2dbe381 Fix for IPv6 HTTP traffic 2019-01-14 20:03:06 +01:00
Luca Deri 60eee5f9e9 Merge pull request #649 from Dark-Vex/dev
Bank website detected as TOR from SSL Dissector (bigram check)
2019-01-13 11:12:12 +01:00
Luca Deri 4a6b0d7de5 Merge pull request #654 from u-devel/patch-1
Update radius.c to RFC2865
2019-01-13 11:11:10 +01:00
Luca Deri f41ffe136a Merge pull request #655 from u-devel/dev
FIX H.323 broken detection
2019-01-13 11:10:36 +01:00
u-devel 1d155ab2eb FIX H.323 broken detection
TPKT header length field can have value more then 255, and in fact in all of the cases I've met it is more then 255.
Thus checking real H.323 packet like this:
(packet->payload[2] == 0x00)
stop detecting H.323 conversation at all.
2019-01-13 00:07:45 +06:00
u-devel 396f794bf4 Update radius.c to RFC2865
According to RFC2865 code can have value up to 13, also payload length ranges should be applied.
2019-01-12 23:49:24 +06:00
Luca Deri 97bdfe295d nDPi now finally honours dissection of HTTP responses 2019-01-07 00:28:29 +01:00
Luca Deri 5241c9f3cf Added Modbus over TCP dissector 2018-12-21 18:25:44 +01:00
Luca Deri 91da00f470 Updated results 2018-12-21 17:31:51 +01:00
Alfredo Cardigliano c7260b6436 Moved to 2.7 2018-12-21 10:50:23 +01:00
Daniele De Lorenzi c51405e99b Bank website detected as TOR from SSL Dissector (bigram check)
Commented "vp" for vpbank.com
2018-12-20 11:11:32 +01:00
Daniele De Lorenzi 2aea4da9ad Merge pull request #10 from ntop/dev
Repo sync
2018-12-20 11:04:03 +01:00
Alfredo Cardigliano d3be349fa0 Changelog update 2018-12-20 09:16:59 +01:00
Luca Deri 92ad057332 Added Ookla cache 2018-12-17 22:33:58 +01:00
emanuele-f d2b2aba6e8 Expose ndpi_fill_ip_protocol_category api to handle ICMP flows category 2018-12-12 11:31:07 +01:00
Luca Deri c1d31bb409 Fixed eDonkey false positives 2018-12-12 08:58:34 +01:00
Alfredo Cardigliano 181ec4992b Deb fix (shared lib links) 2018-12-10 16:54:01 +01:00
Alfredo Cardigliano 60337330bf Creating shared lib with major version 2018-12-10 16:33:09 +01:00
Alfredo Cardigliano af0fd3b96d RPM fix 2018-12-10 16:18:53 +01:00
Luca Deri e7cf989c7a Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-12-10 12:19:53 +01:00
Luca Deri 2a1313ffd5 Improvements in SpeedTest (Ookla) detection 2018-12-10 12:19:34 +01:00
Luca Deri 140ed9887b Merge pull request #639 from madpilot78/Create_libndpi.so.MAJOR_link
Also create the libndpi.so.2 link.
2018-12-10 02:30:05 -08:00
Alfredo Cardigliano b2c00b3b24 Added script to get the package version 2018-12-07 15:50:23 +01:00
Luca Deri 70d0566480 Build fix 2018-12-05 06:58:29 +01:00
Luca Deri 067c3dad44 Merge pull request #645 from vitalivanov/pull_example_dpdk_cleanups
build: cleanup of dpdk examples.
2018-12-04 15:43:18 -08:00
Luca be2934f9ad Added the concept of protocols that can have subprotocols. Example Spotify cannot have subprotocols, DNS can (DNS.Spotify)
Merged Skype call in/out in Skype Call
2018-11-30 18:41:16 +01:00
Luca 2993d9d37e Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-11-30 08:40:37 +01:00
Luca bae75c8f9b Fix for custom protocol load 2018-11-30 08:39:54 +01:00
lucaderi b6be0eebf6 Fix for shared library symbolic link 2018-11-30 06:53:41 +01:00
Luca Deri d63e000a45 Fixed package signing 2018-11-30 00:57:34 +01:00
Vitaliy Ivanov fd963538f3 build: cleanup of dpdk examples.
- clean install dependencies on example binary
- add more rules to clean command

Signed-off-by: Vitaliy Ivanov <vitaliyi@interfacemasters.com>
2018-11-29 13:40:37 +02:00
Luca c09284ba27 Improved heuristics
Used the host guessed protocol if upper protocol has not been detected
2018-11-29 08:44:41 +01:00
Luca 622519e90e Warning fix 2018-11-29 07:53:41 +01:00
Luca Deri f1e5ed4766 Merge pull request #642 from vitalivanov/pull_buildsys_improvements
Pull buildsys improvements
2018-11-28 23:20:34 +01:00
Vitaliy Ivanov a3abbc3ebb build: do not fail if example app is not present.
Signed-off-by: Vitaliy Ivanov <vitaliyi@interfacemasters.com>
2018-11-28 19:23:27 +02:00
Vitaliy Ivanov 8df6b5c1bf build: install example binaries to dst dir.
make install DESTDIR=/build/nDPI/

Signed-off-by: Vitaliy Ivanov <vitaliyi@interfacemasters.com>
2018-11-28 17:40:01 +02:00
Vitaliy Ivanov 9cbf25a76f build: cleanup .so.X.X.X if present.
Signed-off-by: Vitaliy Ivanov <vitaliyi@interfacemasters.com>
2018-11-28 16:56:22 +02:00
Vitaliy Ivanov 923ba84f65 gitignore: ignore dpdk artifacts.
Also similarly to shared libraries do not hide static lib.

Signed-off-by: Vitaliy Ivanov <vitaliyi@interfacemasters.com>
2018-11-28 16:43:17 +02:00
Vitaliy Ivanov ea7e7c753b build: correct example dpdk linking with pcap.
- take libpcap from configure information.
- clean up distclean.

Signed-off-by: Vitaliy Ivanov <vitaliyi@interfacemasters.com>
2018-11-28 16:40:34 +02:00
Luca 5429063546 Improved WhatsApp detection 2018-11-28 00:24:41 +01:00
Luca 54deb1302d Added Signal.org dissector 2018-11-28 00:09:44 +01:00
Luca Deri f15aed6c46 Renamed internal function 2018-11-21 23:25:27 +01:00
Luca Deri e9dd5985b3 Made configure more friendly
Added time measurement in ndpiReader (processing and setup time)
2018-11-21 17:22:15 +01:00
Luca Deri 669fdf6b5f Improved skype, teredo, netbios heuristics
Changed ndpi_detection_giveup() API: guess is now part of the call
2018-11-21 00:32:32 +01:00
Alfredo Cardigliano 21504c8492 rpm spec file 2018-11-19 19:01:53 +01:00
Luca Deri 12adb25665 Improved Skype detection
Update test results
Added initialization for some free protocols
2018-11-19 18:28:18 +01:00
Luca Deri 5259ba2bcb Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-11-19 18:28:10 +01:00
Alfredo Cardigliano babb1c864c removed -r not supported on all systems 2018-11-19 18:25:12 +01:00
Luca Deri 582da8d4bb Improved WeChat support
Removed Musical.ly protocol as the service has been merged with another one and thus it is no longer used
Improved guess for UDP protocols
2018-11-19 18:24:33 +01:00
Alfredo Cardigliano 1537669178 rpm package 2018-11-19 18:02:06 +01:00
Alfredo Cardigliano b0cfe0b9cc settins arch for -dev package as it contains static libs 2018-11-19 15:27:24 +01:00
Alfredo Cardigliano 30305cf4fa deb dependency fix 2018-11-19 15:13:38 +01:00
Alfredo Cardigliano 219951760f ubuntu ndpi/ndpi-dev package (testing) 2018-11-19 11:16:28 +01:00
emanuele-f 0ee451040d Warning fix 2018-11-18 12:50:53 +01:00
Alfredo Cardigliano 22c2568c27 commented out debug print 2018-11-16 19:21:57 +01:00
Luca Deri 6e6b825e92 Improved skype heuristic 2018-11-15 16:18:45 +01:00
Guido Falsi 8c63f25478 Also create the libndpi.so.2 link.
This is created bydefault by all build tools for libraries and required in certain cases. FreeBSD linker requires it when using SONAME.
2018-11-15 09:09:52 +01:00
Luca Deri 977751efdb Added ndpi_flowv4_flow_hash and ndpi_flowv6_flow_hash skeletons for
implementing https://github.com/corelight/community-id-spec
2018-11-14 15:24:15 +01:00
Luca Deri 771a6e9aab Merge pull request #636 from 2miksyn/dev
Improve SSL detection, prevent false positive SSL detection
2018-11-14 00:36:29 +01:00
Luca 2b4554ad44 Updated test results 2018-11-13 15:35:17 +01:00
emanuele-f 9e72884c7b Add OpenWrt Makefile 2018-11-13 09:58:31 +01:00
Luca Deri 71b2c19cf2 Added DPDK support to ndpiReader 2018-11-10 16:10:22 +01:00
kyrol 6d929bf4cc Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-11-09 14:53:33 +01:00
kyrol de9b2b202e FIX missing Application Data pkt for TLS 2018-11-09 14:52:32 +01:00
Luca Deri b31337db4a Improved Skype detection 2018-11-09 11:31:08 +01:00
Mikhail Smirnov 8f8ca40f63 Improve SSL detection, prevent false positive SSL detection 2018-11-09 00:46:25 +03:00
Luca Deri b98373f390 Improved Messenger/Hangout detection 2018-11-08 22:31:58 +01:00
Luca Deri 8e6640605a Removed skype false positives
better STUP detection
2018-11-08 22:13:05 +01:00
Luca Deri 9c5a4a6d1f Added UPnP test pcap
updated Nintendo test ourcome
2018-11-07 22:45:29 +01:00
Luca Deri e240bbd4a4 Implemented UPnP dissector 2018-11-07 22:43:33 +01:00
Luca Deri f7e7ef2f30 Improved SSL decoding 2018-11-03 10:05:13 +01:00
Luca 875b1e0dd5 Better clang check 2018-11-01 09:36:11 +01:00
Luca Deri 6a4324f451 Merge pull request #628 from madpilot78/Respect_DESTDIR_and_PREFIX
Make the examples Makefile respect DESTDIR and PREFIX env vars.
2018-11-01 09:20:38 +01:00
Luca Deri de37d08c24 Merge pull request #632 from madpilot78/Add_SONAME
Add SONAME property to shared library
2018-11-01 09:20:05 +01:00
Guido Falsi 00827903ef The OS variable was not being populated by default. 2018-10-29 23:15:28 +01:00
Guido Falsi 023830f5ab Try to fix build on Mac. 2018-10-29 21:24:08 +01:00
Guido Falsi c2169b3dca Add command line options to correctly populate the shared object SONAME property. 2018-10-29 17:06:58 +01:00
Luca 01444f79e1 Added NDPI_MIN_NUM_STUN_DETECTION constant 2018-10-29 14:47:53 +01:00
Luca ecdece83fe Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-10-29 14:44:53 +01:00
Michele Campus d7478c6ed3 Merge pull request #630 from pchaigno/fix-typo
Fix typo in README
2018-10-16 11:01:41 +02:00
Paul Chaignon b467005fac Fix typo in README 2018-10-16 10:14:09 +02:00
Guido Falsi b7b12d5b4e Make the examples Makefile respect DESTDIR and PREFIX env vars. 2018-10-12 17:22:13 +02:00
Luca 952215c0ac Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-10-11 17:47:10 +02:00
Luca 3e5db956a8 Added further ubuntu servers 2018-10-11 17:47:00 +02:00
kyrol a62f90073a fix domain name checking for https://github.com/ntop/nDPI/issues/617 2018-10-11 16:16:55 +02:00
emanuele-f 6789d41993 Fix category match not using client certificate 2018-10-11 12:40:11 +02:00
emanuele-f 4b4f4be3a5 Add -g flag 2018-10-11 12:27:13 +02:00
emanuele-f 40294f3aed Custom categories have now priority over protocol related categories 2018-10-10 15:56:46 +02:00
emanuele-f 67a1a07ac1 Fix custom categories match by IP not working 2018-10-10 13:33:02 +02:00
emanuele-f cdf197ccfe Add function to search host in custom categories 2018-10-10 13:29:49 +02:00
emanuele-f 6ff6c2e5af Fix category field not accounted in ndpi_get_proto_category
Fixes #627
2018-10-10 10:43:51 +02:00
Luca Deri cf0c8be63d Merge pull request #616 from wang-xuefei/dev
remake clean or remake install failed.
2018-10-09 17:45:23 +03:00
root 1d56c9aa1b fix remake 2018-10-02 23:54:01 +08:00
Luca Deri ab2f3cefc8 Merge pull request #612 from xcorail/dev
Add LGTM code quality badges
2018-10-02 10:07:04 +02:00
Luca Deri 3cbdbc1db5 Merge pull request #610 from eglooca/pr-nest-log-sink
New dissector: Nest Log Sink
2018-10-02 10:06:07 +02:00
Luca Deri 90ca91caa8 Renamed files to avoid name clashes during compilation with other libs 2018-09-29 08:38:00 +02:00
Luca Deri 1f24adc9cd Renamed source files to avoid clashes 2018-09-29 08:28:26 +02:00
Xavier RENE-CORAIL a1f7ab776e Add LGTM.com code quality badges 2018-09-27 13:00:00 +02:00
Luca Deri f639c237a1 Added check for not going beyond the string lenght 2018-09-24 09:57:51 +02:00
Darryl Sokoloski 46ebf541e1 Removed unused varaibles.
Signed-off-by: Darryl Sokoloski <darryl@sokoloski.ca>
2018-09-19 22:05:39 -04:00
Darryl Sokoloski 53910f0737 Added missing declarations for nest_log_sink dissector.
Signed-off-by: Darryl Sokoloski <darryl@sokoloski.ca>
2018-09-19 22:05:03 -04:00
Darryl Sokoloski 31f62c5cf5 New dissector: Nest Log Sink
This is a dissector for the Nest Log Sink protocol which is used by the Nest Protect (https://nest.com/ca/smoke-co-alarm/overview/).

Signed-off-by: Darryl Sokoloski <darryl@sokoloski.ca>
2018-09-19 21:25:16 -04:00
Luca 7117f0532c Mapped the mining category in ndpi_category_get_name() 2018-09-18 18:32:08 +02:00
Luca c6b427c252 Implementation of Bitcoin, Ethereum, ZCash, Monero dissectors all identified as mining
Implements #503
2018-09-18 18:13:04 +02:00
Luca Deri b0f9f76b79 Addes support for SMBv1 traffic that has been split from SMBv23 2018-09-17 23:15:44 +02:00
Luca 8689d3293a Added ndpi_protocol2id() API call 2018-09-17 17:57:47 +02:00
Luca Deri 51fdd12d23 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-09-13 00:11:09 +02:00
Luca Deri 24110acafc Merge pull request #606 from eglooca/pr-fix-parse-packet-line-info
Prevent missing text lines and invalid reads past end-of-buffer.
2018-09-13 01:11:01 +03:00
Michele Campus f6f242b899 Merge pull request #604 from DanieleDeSensi/dev
Bug fix and performance improvement for spotify dissector.
2018-09-13 00:09:56 +02:00
Luca Deri e8c738282d Improved Facebook Messenger support 2018-09-13 00:04:19 +02:00
Darryl Sokoloski c0ed50d5b0 Prevent invalid reads past end-of-buffer.
The recent revert commit applied to ndpi_parse_packet_line_info resurrects an old bug where the last lines in packets that end with a CR+NL will not be parsed.  This revert commit is an attempt to prevent invalid reads past the end of the packet buffer.  This PR moves the end-of-bounds test to before the 16-bit read and returns if true.  This fixes the case where a text line ends aligned to the buffer-end boundary, and it fixes the invalid read issue.

Signed-off-by: Darryl Sokoloski <darryl@sokoloski.ca>
2018-09-11 17:16:12 -04:00
Daniele De Sensi f48c7ab8e6 Fixed bug in spotify dissector (subnet /24 was matched as /22).
Slight performance improvements in spotify dissector (avoid doing ntohl and masking in each and all if conditions).
2018-09-11 12:41:05 +02:00
诟屍 adcb82d2b5 parse protocol's string_to_match into hex which could be match by hyperscan (#589)
* if one protocol do not have it's regex (pattern_to_match)
then parse it's string (string_to_match) into hex
so we can match every protocol with hyperscan

* fix string2hex()

* fix init_hyperscan():
check return value of string2hex()
2018-09-11 10:46:13 +02:00
Simone Mainardi 6ac83ce7eb Fixes broken hyperscan compilation 2018-09-11 10:43:04 +02:00
Luca b9ae0f8888 Fixes #578 2018-09-11 10:07:39 +03:00
Luca Deri 7b4d335944 Merge pull request #603 from pavlosantoniou/dev
Avoid possible NULL pointer dereference in ndpi_detection_process_packet
2018-09-11 10:04:15 +03:00
Luca 9bf05c3534 Indentation fix 2018-09-11 09:33:09 +03:00
Luca 1075283d8e Fixes #601 2018-09-11 09:26:01 +03:00
Pavlos Antoniou 77ea1c25bd Avoid possible NULL pointer dereference in ndpi_detection_process_packet 2018-09-09 08:20:54 +00:00
Luca Deri 6373c355cf Added fix for out of boundary memory access
Fixes warning
2018-09-05 23:23:54 +02:00
Campus 225826ce83 FIX: dropbox dissector. UPD: updated pcap file with new dropbox pkts 2018-09-05 16:10:07 +02:00
Luca Deri 0c3989b40f Merge pull request #596 from madpilot78/Add_back_pkgconfig_file
Add back pkgconfig file. It is required by ntopng to find the install…
2018-08-30 11:29:12 +02:00
Luca Deri 4a2525241f Merge pull request #598 from madpilot78/include_hyperscan_fix
Move the configure include file inclusion and code depending on it in…
2018-08-30 11:28:41 +02:00
Luca ed5b04791e Added missing -lpthread 2018-08-30 11:26:49 +02:00
Luca 71b28e0774 Cleanup 2018-08-30 11:19:09 +02:00
Luca 33d6f2d52f Added missing file 2018-08-30 11:17:19 +02:00
Luca e4f01976a6 Added missing categorization when giveup/guess is called
Added optimization for TCP flows that do not start with a SYN packet: early giveup is performed
Code cleanup
2018-08-30 11:10:30 +02:00
Luca 0a33e439bd Better clang handling 2018-08-30 10:05:53 +02:00
Luca f948f3525f Cleaned up makefile
Used clang instead of gcc on MacOS
2018-08-30 09:59:39 +02:00
Guido Falsi 396e72f4fe Move the configure include file inclusion and code depending on it in code protected by the NDPI_LIB_COMPILATION define, this should avoid it polluting the environment when including this file from ntopng. 2018-08-27 17:45:38 +02:00
Guido Falsi d31a29bf6a Adapt pkgconfig file include path to new Makefile install location. 2018-08-26 00:35:01 +02:00
Guido Falsi 405e2f8dd0 Add back pkgconfig file. It is required by ntopng to find the installed shared library. 2018-08-25 23:42:20 +02:00
Luca a98c0a81be Added target for shared liubrary creation
Added target for install
Fixes #593
2018-08-25 10:50:16 +02:00
Campus 2f83375eec Merge branch 'eglooca-pr-remove-autoconf-include' into dev 2018-08-23 12:09:51 +02:00
Campus 2b9b996148 Merge branch 'pr-remove-autoconf-include' of https://github.com/eglooca/ndpi-pr into eglooca-pr-remove-autoconf-include 2018-08-23 12:01:14 +02:00
Michele Campus 48f3104774 Merge pull request #591 from alm-A/patch-2
README add protocol : removed Makefile.am step
2018-08-23 12:00:02 +02:00
Michele Campus b8571475c9 Merge pull request #592 from alm-A/patch-3
ndpi_typedefs.h : missing include
2018-08-23 11:59:31 +02:00
Campus ff83bfbad0 ADD: add prototype of function ht_free in hash.h - DEL: delete include file .c in ndpi_main.c 2018-08-23 11:22:21 +02:00
alm-A dd307af215 ndpi_typedefs.h : missing include
include to ndpi_protocol_ids.h needed for:
- NDPI_PROTOCOL_SIZE
- NDPI_MAX_SUPPORTED_PROTOCOLS
- NDPI_MAX_NUM_CUSTOM_PROTOCOLS
2018-08-22 16:37:59 +02:00
alm-A 58a784e342 README add protocol : removed Makefile.am step 2018-08-22 16:18:44 +02:00
Luca Deri 89b3b085af Moved to 2.5.0 2018-08-22 08:45:13 +02:00
Simone Mainardi e6c3c0139a Updates changelog release date 2018-08-21 18:13:54 +02:00
Simone Mainardi aad896c2a8 Updates ChangeLog 2018-08-21 18:12:36 +02:00
Luca Deri 1a6a9593fb Changed type to ease compilation accross platforms 2018-08-20 14:49:59 +02:00
Luca Deri 6cb40ac75e Compilation fix 2018-08-20 12:39:55 +02:00
Luca Deri 50591238e5 Merge pull request #586 from eglooca/pr-sys-types-include-for-actypes-h
Include <sys/types.h> for u_int16_t.
2018-08-17 14:18:27 +02:00
Simone Mainardi 291acb9459 Hyperscan regex for domains such as .com.cn or .co.uk 2018-08-17 13:13:26 +02:00
Simone Mainardi 47c2ad1b5f Webex category fix 2018-08-17 12:59:19 +02:00
Simone Mainardi 6491568e15 Fixes hyperscan WeChat detection 2018-08-17 12:48:53 +02:00
Simone Mainardi 28ac30d827 Fixes hyperscan skype detection 2018-08-17 12:41:35 +02:00
Simone Mainardi db74459ca2 Fixes weibo detection 2018-08-17 12:29:08 +02:00
Simone Mainardi d2bc3ea209 Initial hyperscan support for all protocols 2018-08-17 12:00:28 +02:00
Darryl Sokoloski cd9d456994 Include sys/types.h for u_int16_t.
On various embedded environments (OpenWrt, EdgeOS), <sys/types.h> must be included for u_intX_t types.  The Hyperscan changes made recently introducted a u_int16_t member in actypes.h which is undeclared in certainly environments without this include.

Signed-off-by: Darryl Sokoloski <darryl@sokoloski.ca>
2018-08-16 22:31:23 -04:00
Darryl Sokoloski 06befec642 Remove autoconf include from typedefs headers.
Including this file in any "public" API header breaks all projects that also use autotools because macros such as PACKAGE_VERSION will be redefined.

Signed-off-by: Darryl Sokoloski <darryl@sokoloski.ca>
2018-08-16 22:24:15 -04:00
Simone Mainardi 579f1b05db Adds hyperscan support for Apple and Dropbox 2018-08-16 19:42:04 +02:00
Simone Mainardi 7e41309fa9 Hyperscan compilation fix 2018-08-16 15:43:35 +02:00
Luca Deri 3091dc3c48 Fix for #400 2018-08-16 15:23:30 +02:00
Luca Deri 01bf295a19 Completed custom category implementation 2018-08-16 14:57:44 +02:00
Luca Deri f88648fbc8 Tests update 2018-08-16 12:05:07 +02:00
Luca Deri 18b9589e50 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-08-16 12:03:23 +02:00
Luca Deri 9847c2ccbb Generic protocol cleanup (work in progress) 2018-08-16 12:03:09 +02:00
Simone Mainardi 335b336968 Hyperscan compilation fixes 2018-08-16 11:47:10 +02:00
Luca Deri 70eb619b86 Merge pull request #584 from eglooca/pr-memcached
Added new dissector for Memcached.
2018-08-16 09:36:35 +02:00
Darryl Sokoloski b3b8feabf1 Added new dissector for Memcached.
Signed-off-by: Darryl Sokoloski <darryl@sokoloski.ca>
2018-08-15 16:47:21 -04:00
Luca Deri d9cf798753 Updated YouTube support 2018-08-06 10:34:45 +02:00
Luca Deri cbb2eb8c8f Merge pull request #576 from eglooca/pr-ssdp-min-length
Adjust the SSDP dissector's minimum packet length
2018-07-25 08:18:17 +02:00
Luca Deri 6474125c93 Merge pull request #577 from eglooca/pr-parse-packet-line-info-length
Fix end-of-line bounds handling.
2018-07-25 08:17:32 +02:00
Luca Deri 5100cc0eae Added checks for missing protocol initialization
Fixed missing LOG_ERR initialization
Fixed logging warnings
2018-07-23 14:58:16 +02:00
Luca Deri 49ed41142c Fixed SEGV with undepcified protos 2018-07-22 21:06:10 +02:00
Luca Deri 659649d2e9 Fixed warning 2018-07-21 18:23:48 +02:00
Luca 5246656ae0 Fixed required library prefix 2018-07-21 16:27:05 +02:00
Luca f828dfc202 Added comment about typedefs 2018-07-21 16:17:12 +02:00
Luca 591158bb92 Defined type ndpi_protocol_id_t for protocol identifiers 2018-07-21 16:09:32 +02:00
Luca 667e77c609 Major code cleanup
Converted some not popular protocols to NDPI_PROTOCOL_GENERIC with category detection
2018-07-21 16:02:54 +02:00
Luca a499f369a5 Updated results based on the new output format 2018-07-21 15:20:11 +02:00
Darryl Sokoloski fbf6bd2be8 Fix end-of-line bounds handling.
The existing implementation misses ending lines and as a result, fails
to match certain protocols (SMTP for example, which needs to see at
least 3 commain/response matches).  It appears from the commit history
that an attempt was made (end-1) to prevent reads past payload length.

This can be ensured by simply not reading any payload that is < 3 bytes.

The updated logic for this loop is:
- Payload length is >= 3 bytes, or return.
- Loop over payload, compare for EOL (CR + NL) sequence.
- If found, process string.
- If index 'a' plus two is less than payload length, increment 'a' by
  one and continue.
- Loop return always increments index 'a' by one.
2018-07-20 13:51:17 -04:00
Darryl Sokoloski 212598b45e Added example SSDP M-SEARCH capture file. 2018-07-20 13:28:38 -04:00
Darryl Sokoloski 8b0e735f67 Decreased minimum packet payload length down to 19 from 100 for SSDP.
The minimum packet payload length is: "NOTIFY * HTTP/1.1" + 0x0d + 0x0a (19 bytes).
2018-07-20 13:26:44 -04:00
Simone Mainardi d9c963061b Fixes invalid NDPI_MAX_SUPPORTED_PROTOCOLS 2018-07-20 18:52:00 +02:00
Luca Deri 30b72eae64 Changed RTP from VoIP to Media category 2018-07-18 21:29:26 +02:00
Luca Deri 475f54e9d1 Fixed name clash 2018-07-18 17:33:28 +02:00
Luca Deri 34dfe7d375 Improved tor detection to limit false positives 2018-07-17 18:21:06 +02:00
Luca Deri 06789406ad Pattern match improvements 2018-07-17 17:49:59 +02:00
Luca Deri 1ebc510bcb Fied substring matching 2018-07-17 15:48:24 +02:00
Luca Deri 90ffa1fc2c Updated twitter invalid address range
Using content substring match in category search
2018-07-16 09:21:34 +02:00
Michele Campus f942cef2f1 Merge pull request #573 from protohuf/dev
Added showmax.com detection
2018-07-02 23:04:31 +02:00
Marcus Hufvudsson 7fce8f02d2 Added showmax.com detection 2018-07-02 19:54:37 +02:00
Luca 3986a951d8 Suppressed invalid messages with -q
-j now accepts - as stdout
2018-06-21 16:13:18 +02:00
Luca Deri 22356fa69b Added site unavailable category 2018-06-11 17:01:20 +02:00
Luca Deri e00b06926e Fix for handling IP address based custom categories 2018-06-11 16:22:02 +02:00
Luca Deri dc9409ae12 Added missing include 2018-06-05 23:02:24 +02:00
Daniele De Lorenzi 3b1047b0c8 Merge pull request #9 from ntop/dev
updates from dev
2018-05-31 16:29:04 +02:00
Simone Mainardi 2b4321b5c3 Fixes invalid NDPI_MAX_SUPPORTED_PROTOCOLS
Fixes https://github.com/ntop/nDPI/commit/c77ec63e
2018-05-31 16:19:48 +02:00
Luca Deri 6b16ad709e Fix for #560 2018-05-29 22:50:18 +02:00
Campus 3407db11cd added new viber pcap and updated results 2018-05-29 20:37:02 +02:00
Luca Deri 326a2fb7ed Fix for https://github.com/ntop/nDPI/issues/572 2018-05-28 18:18:19 +02:00
Luca Deri eef175e579 Merge pull request #571 from Dark-Vex/rapidvideo
Added Rapidvideo
2018-05-28 17:27:53 +02:00
Daniele De Lorenzi 7989b8d969 Merge pull request #8 from Dark-Vex/rapidvideo
Added RapidVideo
2018-05-25 22:03:14 +02:00
Daniele De Lorenzi 9af00fdb4c Merge branch 'dev' into rapidvideo 2018-05-25 21:57:38 +02:00
Daniele De Lorenzi 6c2cfb34f7 Merge pull request #7 from Dark-Vex/vidto
Added VidTO streaming service
2018-05-25 21:51:15 +02:00
Daniele 5171309c43 Added RapidVideo 2018-05-25 21:41:14 +02:00
Daniele c77ec63ed8 Added VidTO streaming service 2018-05-25 20:34:37 +02:00
Daniele De Lorenzi 30afa082e4 Merge pull request #6 from ntop/dev
Merge branch 'Dark-Vex-viber' into dev
2018-05-25 18:54:26 +02:00
Daniele De Lorenzi ea64f8b0da Merge pull request #5 from Dark-Vex/viber
Viber
2018-05-25 18:52:06 +02:00
Daniele De Lorenzi e2310751f1 Updated Viber ports
New ports taken from
https://support.viber.com/customer/portal/articles/1506350-opening-ports-for-viber-desktop
2018-05-24 12:14:09 +02:00
Daniele De Lorenzi 47b5e45f13 Updated Viber subnet and domain
Added the new subnet, added viber.it and removed the old subnet 54.169.X since are no more part of viber network

daniele@bart:~$ whois 54.169.63.160
[Querying whois.arin.net]
[whois.arin.net]

#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#
# If you see inaccuracies in the results, please report at
# https://www.arin.net/resources/whois_reporting/index.html
#


NetRange:       54.160.0.0 - 54.175.255.255
CIDR:           54.160.0.0/12
NetName:        AMAZON-2011L
NetHandle:      NET-54-160-0-0-1
Parent:         NET54 (NET-54-0-0-0-0)
NetType:        Direct Allocation
OriginAS:       
Organization:   Amazon Technologies Inc. (AT-88-Z)
RegDate:        2014-06-20
Updated:        2014-06-20
Ref:            https://whois.arin.net/rest/net/NET-54-160-0-0-1
2018-05-24 12:14:09 +02:00
Campus 31275398aa Merge branch 'Dark-Vex-viber' into dev 2018-05-24 11:40:51 +02:00
Daniele De Lorenzi c1166c37d1 Updated Viber ports
New ports taken from
https://support.viber.com/customer/portal/articles/1506350-opening-ports-for-viber-desktop
2018-05-24 11:16:32 +02:00
Daniele De Lorenzi 5420b6359b Updated Viber subnet and domain
Added the new subnet, added viber.it and removed the old subnet 54.169.X since are no more part of viber network

daniele@bart:~$ whois 54.169.63.160
[Querying whois.arin.net]
[whois.arin.net]

#
# ARIN WHOIS data and services are subject to the Terms of Use
# available at: https://www.arin.net/whois_tou.html
#
# If you see inaccuracies in the results, please report at
# https://www.arin.net/resources/whois_reporting/index.html
#


NetRange:       54.160.0.0 - 54.175.255.255
CIDR:           54.160.0.0/12
NetName:        AMAZON-2011L
NetHandle:      NET-54-160-0-0-1
Parent:         NET54 (NET-54-0-0-0-0)
NetType:        Direct Allocation
OriginAS:       
Organization:   Amazon Technologies Inc. (AT-88-Z)
RegDate:        2014-06-20
Updated:        2014-06-20
Ref:            https://whois.arin.net/rest/net/NET-54-160-0-0-1
2018-05-24 11:12:15 +02:00
Daniele De Lorenzi 5e47871256 Merge pull request #1 from ntop/dev
fetch new commit
2018-05-24 10:57:28 +02:00
Luca Deri 1585503809 Added Musical.ly support 2018-05-23 22:53:03 +02:00
Campus 60636a9a88 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-05-23 18:32:04 +02:00
Campus fcf4b25bc3 update google hangout detection from string 2018-05-23 18:31:27 +02:00
Luca 0efc4a706d Added custom categories
CUSTOM_CATEGORY_MINING = 99
 CUSTOM_CATEGORY_MALWARE = 100
 CUSTOM_CATEGORY_ADVERTISEMENT = 101
 CUSTOM_CATEGORY_BANNED_SITE = 102

Updated test results
2018-05-23 17:49:07 +02:00
Luca Deri fb7416cb9d Merge pull request #565 from Dark-Vex/dev
SMTPS on port 587 is not detected and Updated AmazonVideo
2018-05-23 16:53:26 +02:00
Daniele De Lorenzi 32c62faa78 Updated AmazonVideo
Updated CDN list of PrimeVideo
2018-05-22 11:28:17 +02:00
Daniele De Lorenzi 363deeb23d Added support for SMTPS on port 587
Added support for SMTPS on port 587
2018-05-21 17:26:00 +02:00
Daniele De Lorenzi 131f68117b Update ssl.c
Added support for SMTPS on port 587
2018-05-21 17:23:32 +02:00
Michele Campus 05cef1d69a Merge pull request #564 from Dark-Vex/dev
Cloudflare detection
2018-05-21 16:31:11 +02:00
Daniele De Lorenzi 71ef54f561 Update ndpi_content_match.c.inc
Removed 64.68.192.0 since is no more part of Cloudflare according to the whois data

NetRange:       64.68.192.0 - 64.68.207.255
CIDR:           64.68.192.0/20
NetName:        EDNS
NetHandle:      NET-64-68-192-0-1
Parent:         NET64 (NET-64-0-0-0-0)
NetType:        Direct Assignment
OriginAS:       AS16686
Organization:   easyDNS Technologies, Inc. (EASYD-2)
RegDate:        2008-06-12
Updated:        2012-03-02
Comment:        ARINA51-ARIN
Ref:            https://whois.arin.net/rest/net/NET-64-68-192-0-1
2018-05-21 08:14:01 +02:00
Daniele De Lorenzi f9c217e42a Update ndpi_content_match.c.inc
Updated Cloudflare subnet
2018-05-19 20:21:26 +02:00
Luca Deri 36c1b72118 Updated test resuls 2018-05-18 23:22:14 +02:00
Luca Deri 6dd42d19f7 Implemented Facebook Messenger (mobile) support
Code cleanup
2018-05-18 23:10:00 +02:00
Luca Deri 5d3ac78250 Fixed memory leak
Optimized memory usage
2018-05-18 10:15:05 +02:00
Luca Deri f56b083bc3 Implemented FacebookZero protocol support
https://code.facebook.com/posts/608854979307125/building-zero-protocol-for-fast-secure-mobile-connections/

Discontinued filetopia protocol
2018-05-18 00:55:21 +02:00
Campus 79be44ddea fix spotify detection 2018-05-17 22:54:03 +02:00
Luca Deri dcdd7562f4 Implemented hash-based categories 2018-05-16 00:09:12 +02:00
Luca Deri 66b759ca69 Hidden ndpi_detection_module_struct definition 2018-05-14 22:58:14 +02:00
Luca Deri 529492e81f Updated test results 2018-05-14 21:42:19 +02:00
Luca Deri 1076455c01 Added ndpi_set_detection_preferences() APi call 2018-05-14 21:40:27 +02:00
Luca Deri 2d486aeed8 Skype CallIn/CallOut are not set as
Skype.SkypeCallOut
Skype.SkypeCallIn
2018-05-14 19:23:15 +02:00
Luca Deri 00c35e48a2 Added
- ndpi_load_hostname_category()
- ndpi_enable_loaded_categories()

in the list of exported API calls
2018-05-11 16:04:47 +02:00
Luca Deri 8380b505f4 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-05-11 13:49:11 +02:00
Luca Deri 564d622cc9 Added ndpi_fill_protocol_category call
Introduced intitial Skype in/out support
2018-05-11 13:48:14 +02:00
Luca Deri a067350098 Hyperscan fixes 2018-05-11 09:06:07 +02:00
Luca Deri 50216991bd Improved hyperscan support and category definition 2018-05-10 23:46:35 +02:00
Alfredo Cardigliano 3707553906 host_server_name size fix 2018-05-05 10:01:02 +00:00
Michele Campus b8fec1e3ce Merge pull request #557 from dsokoloski/pr-gitignore-updates
Clean-up/sort: .gitignore
2018-05-04 18:50:44 +02:00
Michele Campus 979330392e Merge pull request #558 from gozzy/dev
SSH: increase client's maximum payload length from 100 to 500
2018-05-04 18:49:56 +02:00
Alexander Gozman 11898f0268 SSH: increase client's maximum payload length from 100 to 500
According to RFC4253, a client may send additional data right after
its identification string (before receiving the server's identification
string). For instance, PuTTY sends supported ciphers. This exceeds
100 bytes and nDPI fails to detect such SSH sessions.
2018-05-04 07:17:17 +00:00
Luca Deri 78176d2b7b Added timeseries dump (disabled by default) 2018-05-02 00:11:55 +02:00
Luca Deri 64633939e0 Added NetFlix block for Rogers 2018-04-28 10:07:54 +02:00
emanuele-f f717be19cb Fix custom categories matching 2018-04-27 15:02:51 +02:00
Darryl Sokoloski 9c6c15cd6b Clean-up/sort: .gitignore 2018-04-26 16:33:58 -04:00
Luca 3adccc98f7 Implemented custom category loading.
Modified ndpiReader with -c <file> (use mining_hosts.txt as example) for loading name-based categories
2018-04-26 21:10:59 +02:00
Michele Campus 79f3199339 Merge pull request #553 from dsokoloski/pr-debug-call-back
Added missing file, func, and line parameters to call-back typedef.
2018-04-26 11:45:36 +02:00
Campus 23042b3c9a Merge branch 'dsokoloski-pr-autoconf-config-include-fix' into dev 2018-04-26 11:43:59 +02:00
Campus e819899221 Merge branch 'pr-autoconf-config-include-fix' of https://github.com/dsokoloski/nDPI into dsokoloski-pr-autoconf-config-include-fix 2018-04-26 11:43:00 +02:00
Luca Deri b92541a08e Added flow and timing support 2018-04-26 00:04:26 +02:00
Darryl Sokoloski c54a8f8cfa Moved ndpi_config.h from ndpi_main.h to ndpi_main.c, and example source files. 2018-04-24 10:21:47 -04:00
Darryl Sokoloski 3b5f32f261 Added missing file, func, and line parameters to debug call-back typedef. 2018-04-24 10:20:06 -04:00
Luca Deri 7798b964fe Replaces outdates socrates protocol with ntop 2018-04-24 15:48:46 +02:00
Campus 44e2e0beea Merge branch 'leonn-AJP_protocol' into dev 2018-04-23 15:50:06 +02:00
Campus 32a9b8fd14 Merge branch 'AJP_protocol' of https://github.com/leonn/nDPI into leonn-AJP_protocol 2018-04-23 15:48:46 +02:00
Leonn 5a7f58d23f 💡 Add Apache JServ Protocol Dissector 2018-04-22 01:54:28 -03:00
Luca 6aaca82d0e Added fbsbx.com to the list of FaceBook sites 2018-04-18 18:25:11 +02:00
Luca Deri 07a81f5e15 Updated results 2018-04-16 14:21:59 +02:00
Luca Deri c9a2eb54c1 Merge pull request #539 from felix-jia/fix-mem-leak
Fixed memory leak when flow is zeroed out.
2018-04-16 14:19:00 +02:00
Luca Deri 8a59581668 Merge pull request #547 from zyingp/free-after-detect
Fix several bugs found by Address Sanitizer (ASan)
2018-04-16 14:16:09 +02:00
Yingpei Zeng 5950ad7ef8 Add length check before several memcmps in msn.c [ASan detected]. 2018-04-16 18:47:49 +08:00
Yingpei Zeng 4b720c4f3c Add length check before do memcmp to "x-steam-sid" in http.c 2018-04-16 16:07:01 +08:00
Yingpei Zeng 480791a057 Add length check before checking a Tor certificate name 2018-04-16 16:01:31 +08:00
Yingpei Zeng 076bd3d1f4 Add a new file to Xcode project 2018-04-16 10:48:30 +08:00
NETAGO d8e4111a9d Improved netflix support 2018-04-13 16:36:33 -04:00
Michele Campus 9c1029ff6c Merge pull request #543 from vel21ripn/fix_packet_time
Repaired wrong timestamp calculation.
2018-04-09 16:44:38 +02:00
Michele Campus 56f14ebee4 Merge pull request #545 from vpiserchia/dev
added ndpi_process_extra_packet to exported symbols
2018-04-09 16:40:05 +02:00
Vito Piserchia aa5d06bb1a added ndpi_process_extra_packet to exported symbols 2018-04-09 00:37:34 +02:00
Vitaly Lavrov 025ca46981 Repaired wrong timestamp calculation.
Fixed incorrect type conversion.
  Hardcoded constant replaced by structure field.
2018-04-06 22:56:43 +03:00
Simone Mainardi 521afe7e1f Adds version 2.2.2 ChangeLog 2018-04-06 17:12:47 +02:00
Luca Deri c7e53724dc Added protocol placeholders for undefined protocols 2018-04-06 11:34:26 +02:00
Luca Deri 85f25fad6d Removed NDPI_PROTOCOL_MOVE protocol no longer used
Merged NDPI_PROTOCOL_CITRIX_ONLINE with NDPI_PROTOCOL_CITRIX
2018-04-05 23:08:10 +02:00
Luca Deri b63279af8d Updated WhatsApp address range 2018-04-03 18:13:42 +02:00
Felix Jia 5281fcf3cd Fixed memory leak when flow is zeroed out. 2018-03-26 10:20:03 +13:00
Luca Deri 462da90a21 Added API calls
ndpi_network_ptree_match
ndpi_check_flow_func

ndpi_config.h is now installed with "make install"
2018-03-23 19:05:32 +01:00
Luca a2acd09263 Added ndpi_get_api_version() API call to be used in applications that
are dynamically linking with nDPI, to make sure the APIs are in sync
2018-03-21 18:33:08 +01:00
Michele Campus 957b01aa71 Merge pull request #531 from zyingp/dev-autogen
Add chmod +x to the generated configure file in autogen.sh
2018-03-13 19:44:43 +01:00
Yingpei Zeng ac31c1ba98 Add chmod +x to the generated configure file
Fix an error when running autogen.sh on Ubuntu (16.04 LTS):
./autogen.sh: 49: ./autogen.sh: ./configure: Permission denied
2018-03-06 15:14:38 +08:00
Michele Campus 3aaae46c66 Merge pull request #529 from sparlane/office365_sni
Improve SNI matching when using office365
2018-03-05 15:01:40 +01:00
Scott Parlane 53882ef736 Improve SNI matching when using office365
Adds additional SNIs that are used when accessing
office365 applications, these didn't have any existing
match.
2018-03-05 13:16:30 +13:00
Luca Deri 21da70fd75 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-03-01 20:54:17 +01:00
Luca Deri d4a20ba6a8 Increased number of protocols to 512
Implemented WhatsApp file exchage support (added test pcap)
2018-03-01 20:52:06 +01:00
Campus 4204e2f614 Merge branch 'dillinger79-dev' into dev 2018-03-01 16:28:32 +01:00
dillinger79 38199a589f Update ndpi_main.c 2018-03-01 15:45:26 +02:00
dillinger79 b19cd086b4 Merge pull request #3 from ntop/dev
update to latest
2018-03-01 14:13:50 +02:00
Luca Deri e935ee77bf Updated results after the latest RTP fixes 2018-02-21 08:37:03 +01:00
Luca Deri 6a9fc935eb Added fix for invalid RTP/Skype detection
Added change in config.h generated by nDPI to avoid name clashes (the GNU autotools are really outdated)
2018-02-21 08:18:37 +01:00
Luca Deri 06bb9a9c57 Remove too strict check for RTP 2018-02-21 07:43:59 +01:00
Luca Deri 6e7a1022b2 Added PACKAGE_XXX rename to avoid name clashes when nDPI is used inside another project that use the autotools 2018-02-19 18:50:23 +01:00
Campus 76d058360e Merge branch 'bjornfor-for-upstream' into dev 2018-02-18 19:49:27 +01:00
Bjørn Forsman 9fa6119f14 autogen.sh: break overlong sed line 2018-02-18 18:47:42 +01:00
Bjørn Forsman be38c3d90e autogen.sh: which -> command -v
command -v is a POSIX standard, available in all POSIX sh. which is not.
Prefer command -v for portability.
2018-02-18 18:46:04 +01:00
Bjørn Forsman 6ba79afc23 autogen.sh: /bin/rm -> rm
For portability, don't assume that /bin/rm exists, rely on $PATH lookup
instead.

This fixes building in sandboxed Nix(pkgs) builds.
2018-02-18 18:45:09 +01:00
Campus 12a1b0d7a3 Merge branch 'vel21ripn-config_gebug' into dev 2018-02-16 22:20:07 +01:00
Campus 029ca0797a Merge branch 'config_gebug' of https://github.com/vel21ripn/nDPI into vel21ripn-config_gebug 2018-02-16 22:18:43 +01:00
Michele Campus a5dd00eedb Merge pull request #523 from zyingp/dev
[For Xcode project] Fix some typos and add Macro definitions for Release build as well
2018-02-16 22:14:52 +01:00
Campus b98f79eaa6 Merge branch 'vel21ripn-libcache' into dev 2018-02-16 22:10:20 +01:00
Campus 16e57f64cd Merge branch 'libcache' of https://github.com/vel21ripn/nDPI into vel21ripn-libcache 2018-02-16 22:08:21 +01:00
Campus 9e47e49ade fix wrong increment for MPLS double header 2018-02-15 21:26:38 +01:00
Luca Deri df54e8b926 Improved numeric to protocol conversion 2018-02-12 21:44:48 +01:00
Luca 01949c47da Fixed typo 2018-02-12 11:08:37 +01:00
Luca Deri 52a2c0589e Updadate last protocol id
Updated tests with new protocols
2018-02-11 21:11:36 +01:00
Luca Deri 12368ba2d5 Implemented supporto for GoogleDocs and AmazonVideo
Fixed various bugs in detecting Google Drive
Improved Spotify support
2018-02-11 19:36:13 +01:00
Yingpei Zeng 053dbd73a6 [For Xcode project] Change some typos in README.md and add macro definition for release build as well 2018-02-11 13:58:09 +08:00
Yingpei Zeng 8f631fa19d Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2018-02-11 11:09:51 +08:00
Luca Deri 344392868b Added 179 to the default BGP port list 2018-02-09 18:24:35 +01:00
Vitaly Lavrov 0624afd422 Added option --enable-debug-messages.
The configurator option "--enable-debug-messages" is added to enable
debug information output (define NDPI_ENABLE_DEBUG_MESSAGES=1).
Mandatory inclusion of the file ndpi_config.h in all the compiled files.
2018-02-07 16:31:35 +03:00
Vitaly Lavrov c3f5307a3d Update libcache
Using ndpi_calloc(), ndpi_free() in libcache.
Fixing warnings about mixing declaration and code.
2018-02-06 14:06:38 +03:00
zyingp e6412949f1 Merge pull request #1 from ntop/dev
Merge the latest main branch
2018-02-05 09:32:28 +08:00
Luca Deri ea74d87fd8 Merge pull request #519 from zyingp/dev
Add an Xcode project for easier debugging on MacOS
2018-02-04 10:01:39 -08:00
ZengYingpei 5e0880dac6 Reset optind of getopt_long for synthesizing command line input stably in the Xcode project 2018-02-04 15:34:04 +08:00
ZengYingpei 26e36a19bf Unify Copyright declaration for all added files of the Xcode project 2018-02-04 14:35:56 +08:00
ZengYingpei aea81e4a1a Add an Xcode project for debugging under MacOS (add all missed files) 2018-02-04 14:21:52 +08:00
ZengYingpei 39b9f6752c Add an Xcode project for debugging under MacOS 2018-02-04 14:19:38 +08:00
Campus 73b4019561 update results for test pcap 2018-02-03 19:56:14 +01:00
Campus 3b5d8177f7 fix wrong conversion dec to hex 2018-02-03 17:06:28 +01:00
Simone Mainardi f8c6e9d714 Fixes possible out-of-bounds due to malformed DHCP packets 2018-01-31 17:15:55 +01:00
Luca Deri da588f6a30 Improved hyperscan support 2018-01-26 23:40:23 +01:00
Luca ee7a30385b Added minor hardening code in STUN 2018-01-26 19:45:41 +01:00
Michele Campus 809535e0a2 Merge pull request #510 from vel21ripn/dev
Fix buffer overflow in function ndpi_debug_printf()
2018-01-26 15:04:38 +01:00
Vitaly Lavrov 57fb117571 Fix buffer overflow in function ndpi_debug_printf() 2018-01-26 13:03:17 +03:00
Luca Deri 78feabfad7 Inital hyperscan work 2018-01-24 22:11:05 +01:00
Luca Deri 54306411a4 Merge pull request #508 from emanuele-f/hyperscan
Initial support for Intel hyperscan pattern matching library
2018-01-24 18:09:12 +01:00
Luca Deri f2280c90a4 Merge pull request #482 from hvanderheide/dev
Revert the revert of 2155dd9 after fixing ntopng Travis
2018-01-24 18:08:44 +01:00
emanuele-f e09ebab0c2 Initial support for Intel hyperscan pattern matching library. 2018-01-24 16:47:23 +01:00
Luca Deri d18824a73f Cleaned up Amazon IP range
Improved HostShield VPN
2018-01-19 14:33:43 +01:00
Luca Deri d2d20a8aa4 Warnign fix 2018-01-16 16:39:30 +01:00
Luca Deri fbf7fe2424 Implemented Google services detection
Refreshed google-based services support
2018-01-16 15:57:45 +01:00
Luca Deri ced9658c63 Added ApplePush support 2018-01-15 20:13:34 +01:00
Hidde van der Heide d896ce7469 Merge remote-tracking branch 'upstream/dev' into dev 2018-01-10 10:40:54 +01:00
Michele Campus 77cb8ccaea Merge pull request #506 from cavedon/dev
Fix MPLS header parsing in ndpiReader.
2018-01-09 22:13:57 +01:00
Ludovico Cavedon 35dc6e27ae Fix MPLS header parsing in ndpiReader.
Reported at https://bugs.debian.org/886133.
The current parsing for the MPLS header in examples/ndpi_util.c has
multiple issues:
- the bitfield order is incorrect for little endian architectures
- ntohl() is applied to a 20 bit label, which has unclear purpose
- if multiple labels are detected, the while loop parsing labels will
never exit due to a missing re-read of the mpls label
- the last label is identified by looking inside the label field, while
it should be done by looking at the S bit

This change fixes the above issues.
Notice that bitfield ordering is implementation-dependent, so C
bitfields should not be used in the first place to parse network
packets.
2018-01-09 10:26:10 -08:00
Campus 61e297b851 add missing check for free TCP/UDP root in tree 2018-01-05 00:34:33 +01:00
Campus 1d1082342f added diameter protocol dissector 2018-01-02 13:47:46 +01:00
Luca Deri f5e366d8c4 Added third party libs 2017-12-25 19:57:03 +01:00
Luca Deri 8d52491508 Added simplified makefile
Fixed small warnings
Compilation fixes
2017-12-25 19:26:17 +01:00
Luca Deri caf602c4a9 Merged categories network and network_tool (way too similar)
Replaced former network_tool category with streaming category
2017-12-23 19:40:39 +01:00
Hidde van der Heide bf8c9c2625 Merge remote-tracking branch 'upstream/dev' into dev 2017-12-20 13:19:24 +01:00
Campus f024e72eff Merge branch 'qianguozheng-dev' into dev 2017-12-19 19:56:06 +01:00
qianguozheng 9561f37998 Fix ndpiReader long run crash due to dupilicate nodes exist, cause
double free failed.
2017-12-19 17:37:46 +08:00
Campus 13e592275a Merge branch 'madpilot78-fix_symbols' into dev 2017-12-15 23:51:33 +01:00
Campus 3f9434b81d Merge branch 'fix_symbols' of https://github.com/madpilot78/nDPI into madpilot78-fix_symbols 2017-12-15 23:51:15 +01:00
Luca Deri 00e6ee3dc3 Implemented GooglePlus support that replaced ancient Quake protocol now obsolete 2017-12-15 10:33:01 +01:00
Luca Deri a06c399530 Compilation fixes 2017-12-13 08:04:51 +01:00
Simone Mainardi cd12a86088 Implements ndpi_get_category_id 2017-12-11 20:15:00 +01:00
Luca Deri 61bc528159 Simplified IPv6 datatypes 2017-12-08 18:13:31 +01:00
Campus 811717e7c1 Merge branch 'vel21ripn-dev' into dev 2017-12-07 22:54:49 +01:00
Michele Campus cb8f4f87bf Merge branch 'dev' into dev 2017-12-07 22:45:28 +01:00
Luca dfd8cbc4e1 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-12-07 20:31:15 +01:00
Luca d88a73397d Fix for #491 (SpeedTest/Ookla) 2017-12-07 18:29:46 +01:00
Luca Deri 90ec8040e6 Improved Apple update pattern 2017-12-06 21:39:56 +01:00
Guido Falsi f1f8afdddf Add ndpi_set_proto_category, which is actually uses by ntopng. 2017-12-05 23:10:32 +01:00
Luca Deri 7fd8406916 Fixed invalid symbolic categories 2017-12-05 11:30:29 +01:00
Simone Mainardi b5a8c6bae8 Bump to version 2.3 2017-12-03 19:09:11 +01:00
Simone Mainardi a6c56b5682 2.2 changelog 2017-12-03 16:23:35 +01:00
Campus e5546eb988 Merge branch 'dsokoloski-pull-request' into dev 2017-11-30 21:59:55 +01:00
Darryl Sokoloski 3577072b12 Return before calling ndpi_match_host_subprotocol when dns_dissect_response enabled.
Otherwise responses will never be seen if a host sub-protocol matched.
2017-11-30 14:54:23 -05:00
Luca 5b03443693 Added test pcap for check_mk protocol 2017-11-30 10:15:19 +01:00
Luca Deri 8af18763cc Compilation fixes 2017-11-28 22:05:34 +01:00
Luca Deri 840dab894f Merge pull request #496 from cymaniac/check_mk
Added dissector for protocol check_mk
2017-11-28 21:53:16 +01:00
cymaniac df7015f3a5 Added dissector for protocol check_mk 2017-11-28 21:29:38 +01:00
Luca Deri 8547b50be7 Merge pull request #493 from evengx/dev
Fixed ndpi_win32.h so that it compiles on MinGW+GCC
2017-11-28 17:51:53 +01:00
Luca Deri 7090ef838c Minor optimizations 2017-11-28 00:44:08 +01:00
Jacob Masen-Smith 950f5db3dd Changed MinGW __forceinline strategy to something with less side effects 2017-11-23 20:40:43 -08:00
Luca 8eaf0cefa1 Warning fix 2017-11-23 15:39:20 +01:00
Luca Deri 8b1f8636d1 Further check if a STUN flow will eventually become RTP 2017-11-23 15:25:02 +01:00
Luca Deri 1b5c90cfbe STUN improvements 2017-11-23 14:16:27 +01:00
Jacob Masen-Smith 33e0be73f7 Fixed ndpi_win32.h so that it compiles on MinGW+GCC 2017-11-22 01:11:49 -08:00
Campus 6e62367b56 add ICQ (instant messaging client) detection - deleted unused skyfile protocol 2017-11-20 17:05:15 +01:00
Luca Deri d6176ff668 Improved ndpiReader output
Updated tests
2017-11-19 18:35:26 +01:00
Luca Deri 2831d64f6a Added YouTube Upload protocol (used the identified unused by NDPI_PROTOCOL_SKYFILE_PREPAID) 2017-11-19 18:11:37 +01:00
Campus a4532a4999 update Telegram match 2017-11-11 16:23:14 +01:00
Campus 3caac691d5 removed bigrams for src/lib/ndpi_content_match.c.inc 2017-11-11 15:56:16 +01:00
Hidde van der Heide ee957e0831 Merge remote-tracking branch 'upstream/dev' into dev 2017-11-09 10:14:02 +01:00
Luca c9f32ee76d Fixed begin/end type when capturing live traffic 2017-11-03 17:15:04 +01:00
Luca Deri a488c9b7dc Fixes #485 2017-11-03 09:32:43 +01:00
Vitaly Lavrov 50645e11d8 Merge branch 'dev' into dev 2017-11-02 10:59:21 +03:00
Michele Campus 3e53577936 Merge pull request #486 from vel21ripn/dev-sip
Bug fix. Protocol SIP: command 'CANCEL sip:' is not recognized.
2017-11-01 11:07:37 +01:00
Vitaly Lavrov a0980228ef Bug fix. Protocol SIP: command 'CANCEL sip:' is not recognized.
Add sip.pcap for tests ( Source: https://wiki.wireshark.org/SIP ).
2017-10-31 22:04:14 +03:00
Alfredo Cardigliano 6e6b623057 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-10-30 11:30:14 +01:00
Alfredo Cardigliano 159e6228fe --ndpi-proto-filter now accepts also protocol name 2017-10-30 11:30:09 +01:00
Luca Deri cf07c92538 Dropbox and apple improvements
Fixed warning
2017-10-29 18:31:31 +01:00
Campus 23e08c93b6 Merge branch 'dsokoloski-upstream-dhcp-client-ident' into dev 2017-10-27 09:52:47 +02:00
Darryl Sokoloski 169aa11adc Added DHCP class identifier support. 2017-10-26 21:07:00 -04:00
Alfredo Cardigliano 7e38a4f790 Update README.md 2017-10-26 23:23:29 +02:00
Vitaly Lavrov 2787c2390c Refactoring the debugging output.
levels of debug output:
 0 - ERROR: Only for errors.
 1 - TRACE: Start of each packets and if found protocol.
 2 - DEBUG: Start of searching each protocol and excluding protocols.
 3 - DEBUG_EXTRA: For all other messages.

Added field ndpi_struct->debug_logging for enable debug output of each protocols.

Simple macros for debugging output are added:
NDPI_LOG_ERR(), NDPI_LOG_INFO(), NDPI_LOG_DBG(), NDPI_LOG_DBG2(),
NDPI_EXCLUDE_PROTO()
2017-10-26 20:41:22 +03:00
Hidde van der Heide 441e43c167 Revert the revert of 2155dd9 after fixing ntopng Travis
This reverts commit 4f72b954da.
2017-10-24 17:05:48 +02:00
Simone Mainardi 4f72b954da Undoes 2155dd9 that breaks ntopng Travis 2017-10-23 15:20:30 +02:00
Campus 5dbe705dd3 Merge branch 'hvanderheide-dev' into dev 2017-10-23 11:05:18 +02:00
Hidde van der Heide 2155dd9153 Add libcache to installed headers and removed relative import 2017-10-19 16:10:56 +02:00
Luca Deri f7e95b4ee8 Fixed DHCP layout 2017-10-14 14:23:49 +02:00
Luca Deri 36adc23507 Fixed warning generated by some compilers 2017-10-14 13:15:35 +02:00
Luca Deri 2ee871f5e6 Added Android fingerprint 2017-10-14 12:59:28 +02:00
Luca Deri 39d7738042 Implemented DHCP fingerprinting 2017-10-14 12:29:25 +02:00
Luca Deri 75993242b0 Implemented HTTP User Agent discovery 2017-10-14 11:21:01 +02:00
Luca Deri 83d5a46ec4 Added ndpi_icmphdr datatype 2017-10-13 19:41:34 +02:00
Michele Campus 7f197d12dd Merge pull request #473 from beratx/dev
fixed bug
2017-10-12 11:33:47 +02:00
berat d273b67fd7 fixed bug 2017-10-12 11:18:05 +02:00
Michele Campus aefd16647e Merge pull request #472 from beratx/dev
extended (-b flag) statistics with top receiver stats
2017-10-10 09:15:34 +02:00
berat 98d1c762cd extended (-b flag) statistics with top receiver stats 2017-10-09 22:21:40 +02:00
Luca Deri 2476c3c1b6 Fixed bug in someip dissector (access out of boundary)
Fixed memory leak in ndpiReader
2017-10-08 18:55:40 +02:00
Campus ed830d2474 update README for json install lib 2017-10-06 20:04:26 +02:00
Luca Deri 8bcafff569 Fixes for iQIYI and 1kxun protocols 2017-10-06 19:08:08 +02:00
Luca Deri 9b91623d57 Added ndpi_is_subprotocol_informative() API call 2017-10-06 15:20:36 +02:00
Luca Deri 27d66f6845 Typo 2017-10-06 09:51:42 +02:00
Luca Deri b10e526364 Leak fix 2017-10-05 16:21:32 +02:00
Michele Campus cf26e8429e Merge pull request #469 from vel21ripn/dev
Fix undefined behavior (detected by gcc):
2017-10-03 16:08:14 +02:00
Michele Campus 094ddc2048 Merge pull request #468 from danielengbert/dev
Fixed issue #459 by adding missing symbols.
2017-10-03 15:58:07 +02:00
Vitaly Lavrov 25a4569e67 Fix undefined behavior (detected by gcc):
ndpi_define.h.in:218: Macros NDPI_SET(), NDPI_CLR(), NDPI_ISSET()
  runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

http.c:364: strncpy((char*)flow->protos.http.nat_ip,(char*)packet->forwarded_line.ptr,len);
 runtime error: null pointer passed as argument 2, which is declared to never be null

ndpi_patricia.c:ndpi_comp_with_mask(): int m = ((-1) << (8 - (mask % 8)));
  runtime error: left shift of negative value -1

Original function ndpi_comp_with_mask() is unreadable and slow.
We have only 2 type of address: 32 bit and 128 bit. The optimized version works 6 times faster (IPv4).
2017-10-03 16:43:23 +03:00
dangbert 47f922fa7b Fixed issue #459 by adding missing symbols. 2017-10-02 15:35:22 -04:00
Michele Campus 82c244b04f Merge pull request #466 from vel21ripn/dev-fixerr
Fix error: Use of uninitialized structures in tcp_udp.c
2017-10-02 00:45:17 +02:00
Vitaly Lavrov f80f0eedc0 Fix error: Use of uninitialized structures in tcp_udp.c
Now the test results do not depend on the compiler optimization level and architecture.
2017-10-01 22:43:20 +03:00
Campus 1b162234f0 Merge branch 'vel21ripn-dev-tests' into dev 2017-09-29 12:18:00 +02:00
Campus 3ac47a5104 Merge branch 'dev-tests' of https://github.com/vel21ripn/nDPI into vel21ripn-dev-tests 2017-09-29 12:15:13 +02:00
Vitaly Lavrov b2f0558080 A more predictable sorting of the flows list.
It is necessary for correct testing.
2017-09-29 12:46:27 +03:00
Michele Campus 50624b390e Merge pull request #463 from vel21ripn/dev
Fixed a typo in lisp.c
2017-09-29 10:15:19 +02:00
Vitaly Lavrov 1dd93590e4 Fixed a typo in lisp.c 2017-09-29 10:04:03 +03:00
Campus 662ef2f65b update results after many commits 2017-09-27 16:17:28 +02:00
Michele Campus 83104eb8b6 Merge pull request #460 from beratx/dev
memory improvement again for (-b flag) statistics
2017-09-26 22:36:35 +02:00
emanuele-f cd2a328cc5 Add configure.ac and ndpi_define.h to gitignore 2017-09-26 20:25:40 +02:00
berat f255b10524 memory improvement again for (-b flag) statistics 2017-09-26 17:20:51 +02:00
berat 4ba6ba70c5 memory usage is improved (-b flag) 2017-09-26 17:01:10 +02:00
Michele Campus 0827a6bf8b Merge pull request #457 from la10736/fix_ndpiReader_dependencies
Fix #456: ndpiReader depend from uthash.h heder
2017-09-25 15:21:51 +02:00
Michele Campus 4348109931 Merge pull request #455 from beratx/dev
improved memory usage by (-b flag) statistics
2017-09-25 15:21:23 +02:00
Michele d'Amico 59097a2d30 Fix #456: ndpiReader depend from uthash.h heder 2017-09-25 15:08:55 +02:00
Luca Deri b129487636 Custom protocols are not set as application and no longer master protocols 2017-09-25 14:51:46 +02:00
berat 2c014c5693 improved memory usage by (-b flag) statistics 2017-09-25 12:45:30 +02:00
Michele Campus 80fa0b5f98 Merge pull request #454 from beratx/dev
improved (-x flag) bpf filter condition
2017-09-25 11:25:52 +02:00
berat 688d7c33e4 improved (-x flag) bpf filter condition 2017-09-25 11:14:57 +02:00
berat b0f3852fed improved (-x flag) bpf filter condition 2017-09-25 11:06:47 +02:00
Michele Campus cd595caf8d Merge pull request #452 from beratx/dev
fixed another memory leak
2017-09-25 08:29:04 +02:00
Luca Deri c115903fbb Patch for giving prority in case of match to custom-defined protocols 2017-09-24 22:49:07 +02:00
berat 807db80afc fixed another memory leak 2017-09-24 18:43:31 +02:00
Michele Campus 8939a72ea8 Merge pull request #450 from beratx/dev
fixed memory leak
2017-09-24 15:16:23 +02:00
berat baae16ec2f memory leak fixed 2017-09-23 19:55:47 +02:00
berat 41b40ddf18 memory leak fixed 2017-09-23 19:50:52 +02:00
Luca Deri 8cc2b04f3c Fixed category for email services 2017-09-23 11:34:12 +02:00
Michele Campus 98b3268bfb Merge pull request #449 from beratx/dev
typos and renames
2017-09-22 20:55:02 +02:00
berat f575959cd2 typos and renames 2017-09-22 19:00:27 +02:00
Luca Deri c2002cd48f Removed / from category names that can cause issues in applications 2017-09-21 19:35:03 +02:00
Luca Deri 9fb5981128 Added ndpi_category_set_name() API call 2017-09-19 22:39:00 +02:00
Luca Deri 1a4e57e736 Code rework 2017-09-17 23:34:46 +02:00
Luca Deri d6f7dd9c08 Implemented DHCP field 55 decode 2017-09-17 21:25:55 +02:00
Luca Deri 4176fd5068 Reworked categories 2017-09-15 11:56:40 +02:00
Luca Deri 1808519b5b Reorganized protocol families
Added new API calls ndpi_set_proto_breed() and ndpi_set_proto_category() for overwriting nDPI protocol specifications
2017-09-15 11:23:34 +02:00
Luca Deri 83b1b34c18 Added custom 5 protocol categories to be used by applications. They are currently empty
Added ndpi_is_custom_category() to check if a defined category is custom
2017-09-15 11:13:25 +02:00
Campus b4d535e184 Merge branch 'huniyaarif1-dev' into dev 2017-09-14 11:45:11 +02:00
huniya arif, xflowResearch f7e9264c36 LISP PROTOCOL by Huniya Arif (xFlowResearch) 2017-09-14 12:52:18 +05:00
huniya arif, xflowResearch d4d4f2a17c Added LISP protocol. By Huniya Arif (xFlowResearch) 2017-09-14 11:38:31 +05:00
huniya arif, xflowResearch d3d6a95da7 Added protocol LISP. By Huniya Arif xFlow Research 2017-09-14 11:05:20 +05:00
Michele Campus 8a6a8ea07e Merge pull request #445 from beratx/dev
Extended filter produced by -b flag
2017-09-13 11:22:04 +02:00
berat ecb048a7bc Extended filter produced by -b flag 2017-09-08 18:00:32 +02:00
Campus 8e8445e02f fix telegram detection 2017-09-03 16:40:41 +02:00
Campus 0e3248b0f7 Merge branch 'k0ste-newfeature' into dev 2017-08-31 11:32:30 +02:00
Campus 0e8756ab46 Merge branch 'newfeature' of https://github.com/k0ste/nDPI into k0ste-newfeature 2017-08-31 11:28:58 +02:00
Luca b2bc6039da Partial fix for #410: added case insensitive HTTP header checks.
If the user will provide a pcap for reproducing further potential issues reported we will consider them
2017-08-29 21:32:52 +02:00
Luca 22beb7714d Implements #376 2017-08-29 20:56:08 +02:00
Luca 299b9435d0 Fixed memory out-of-bound issue
Added extra check for fixing #366
2017-08-29 19:56:32 +02:00
Konstantin Shalygin 31478703c2 Backported CSGO/DOTA2 protocol. 2017-08-26 15:41:04 +07:00
Michele Campus a1367a9d39 Merge pull request #438 from pauloangelo/dev
HTTP respose status code after validation check.
2017-08-21 14:08:45 +02:00
Paulo Angelo 7dc20134c0 Merge remote-tracking branch 'upstream/dev' into dev 2017-08-19 14:21:06 -03:00
Paulo Angelo 63c97753a1 Respose status code after validation check. 2017-08-19 14:19:30 -03:00
Campus 5515c3a109 fix for https://github.com/ntop/nDPI/issues/437 2017-08-18 10:11:41 +02:00
Luca Deri 5547ef06b3 Collapsed email send and receive categories in a new email category 2017-08-17 17:55:52 +02:00
Campus 65b39240aa Merge branch 'pauloangelo-i434' into dev 2017-08-14 10:44:43 +02:00
Paulo Angelo 449e06df77 Code formating and some improvements on HTTP (issue 434) 2017-08-11 17:52:32 -03:00
Paulo Angelo c4885fe260 Merge remote-tracking branch 'upstream/dev' into dev 2017-08-11 13:39:12 -03:00
Paulo Angelo 5a8aa3d72d Windows 10 detection from UA and indentation 2017-08-11 13:38:46 -03:00
Campus 7ad04a2184 Merge branch 'pauloangelo-dev' into dev 2017-08-09 19:41:52 +02:00
Paulo Angelo d8ed5b1005 final revision. 2017-08-09 14:17:07 -03:00
Paulo Angelo 93ceb14302 few classification adjusts 2017-08-09 14:08:28 -03:00
Campus 0326442faf add SoundCloud detection for https://github.com/ntop/nDPI/issues/396 2017-08-09 18:14:41 +02:00
Campus 89f1e663fa update results 2017-08-09 15:57:15 +02:00
Campus 5e2f75f5f0 Merge branch 'pauloangelo-dev' into dev 2017-08-09 15:51:48 +02:00
Paulo Angelo 7cab6efcd5 Issue 118 implementation (risk classification), indentation, and PasteBin&LinkedIn added. 2017-08-08 18:06:33 -03:00
Paulo Angelo d79c5ffc24 Identation and comments only. 2017-08-08 15:48:27 -03:00
Luca 3ba3a08141 Implemented flow sort based on total bytes so that we can (with -v X) immediately spot elephants and mice 2017-08-02 20:15:21 +02:00
Luca Deri 1d4eeaa328 Removed invalid networks from google list 2017-07-30 13:57:12 +02:00
Campus b1f6ac1a84 updated results 2017-07-29 23:48:25 +02:00
Campus a90b97bc10 fix wrong datalink type for Cisco PPP 2017-07-29 23:44:47 +02:00
Michele Campus f336f1a340 Merge pull request #428 from k0ste/newfeature
Added Sony Playstation protocol.
2017-07-29 22:14:52 +02:00
Konstantin Shalygin fbfe3e004c Added Sony Playstation protocol. 2017-07-29 16:52:03 +07:00
Luca 9a809bf673 Improved TeamViewer support 2017-07-29 06:55:50 +02:00
Michele Campus baa761a2e2 Merge pull request #427 from alagoutte/fix_warning
Fix warning
2017-07-28 18:59:47 +02:00
Alexis La Goutte ad401c4192 ndpi_main.c: fix unused variable 'rc' [-Werror,-Wunused-variable] 2017-07-28 13:46:02 +00:00
Alexis La Goutte 5ebc85e705 ndpiReader.c: fix variable ‘fileName’ set but not used [-Werror=unused-but-set-variable] 2017-07-28 13:45:59 +00:00
Alexis La Goutte b021f5bce1 ndpiReader.c fix ‘getTopStats/deleteTopStats/top_stats_sort/scanners_port_sort/scanners_sort/deleteScanners’ defined but not used [-Werror=unused-function] 2017-07-28 13:45:56 +00:00
Alexis La Goutte 5f1131cae2 ndpiReader: fix file_first_time/_statsFilePath defined but not used [-Werror=unused-variable] 2017-07-28 13:45:49 +00:00
Campus f664aee00b results updated 2 2017-07-27 13:37:09 +02:00
Campus 01649f097c results updated 2017-07-27 13:15:37 +02:00
Campus abf5bea425 Merge branch 'MicahLyle-ssl-certificate-fix' into dev 2017-07-27 13:12:12 +02:00
Michele Campus 6ca6d96821 Merge branch 'dev' into ssl-certificate-fix 2017-07-27 13:10:08 +02:00
Luca Deri e6b594a626 Fixed TINC bug (cache usage)
Merged MS Lync with Skype (Microsoft renamed MS Lync in Skype for Business)
Renumbered Nintendo protocols in former MS Lync that was no longer used
Fix for #425
2017-07-27 00:18:15 +02:00
Luca Deri c15f2bda97 Implemented support for Nintendo (switch) gaming protocol 2017-07-26 19:59:46 +02:00
Luca Deri 41c720d951 Added test file for skype conf call 2017-07-26 11:57:51 +02:00
Luca Deri be52d4e9ad Removed unused variable 2017-07-25 16:56:15 +02:00
Luca 7ec3af2156 Removed reference to ndpi_init_placeholder_proto() that is no longer necessary 2017-07-25 16:45:22 +02:00
emanuele-f bab373f992 Add nintendo protocol 2017-07-24 12:06:13 +02:00
Micah Lyle 55d1362924 Updated tests to match new SSL server certificate fix/addition 2017-07-18 12:53:02 -07:00
Micah Lyle 6e85b93442 Implementation for extra packet processing if desired 2017-07-17 18:06:07 -07:00
Micah Lyle 2e13e44b9c Added testing scripts and commited files that only had the server diff on the right 2017-07-14 18:19:49 -07:00
Micah Lyle 0b72c2fce3 Fixed tcp ssl case where client cert got set but server did not 2017-07-14 14:55:03 -07:00
Campus 6d7f5552de changed name from _bpf_filter to bpfFilter to avoid compilation error in OpenBSD caused by redefinition by https://github.com/openbsd/src/blob/master/sys/net/bpf.h#L296 2017-07-13 16:22:34 +02:00
Campus c5bc91145f removed warning compilation for - warning: passing argument 3 of 'pcap_compile' from incompatible pointer type 2017-07-09 18:10:10 +02:00
Campus cfa9a79f67 fix for OpenBSD compile error https://github.com/ntop/nDPI/issues/417 2017-07-07 12:50:06 +02:00
Luca Deri d66e473a2c Code cleanup
Updated test results
Renamed SOMEIP -> someip
2017-07-06 09:28:15 +02:00
Luca Deri 9bfab472e4 Win fix 2017-07-06 08:29:21 +02:00
Campus 1a605e2b77 Merge branch 'beratx-dev' into dev 2017-07-01 11:45:19 +02:00
Campus 5c39d65f8f Merge branch 'dev' of https://github.com/beratx/nDPI into beratx-dev 2017-07-01 11:41:22 +02:00
Luca Deri 5bf6be7eb8 Improved checks on libnuma 2017-06-30 11:32:23 -04:00
berat e857c5fb41 extended bpf filter produced by -x flag to include hosts 2017-06-30 09:52:26 +02:00
Simone Mainardi 4a1ced3709 Removes invalid char in SOME/IP proto name 2017-06-27 12:10:50 +02:00
Campus dbb9724c4e added fix protocol https://github.com/ntop/nDPI/issues/372 2017-06-27 11:38:44 +02:00
Campus 100062a156 Merge branch 'YumingMa-dev' into dev 2017-06-26 12:14:50 +02:00
MaYuming a40507b8b2 fix compiler error about json 2017-06-25 16:58:50 +08:00
MaYuming 592b769f67 fix lync over ICE detection 2017-06-25 11:15:59 +08:00
Campus 5b8d566a79 Merge branch 'beratx-dev' into dev 2017-06-23 12:41:04 +02:00
berat 7235c9a73a Added -x flag. Produces a bpf filter based on diagnose information generated by -b flag 2017-06-23 12:14:31 +02:00
Luca 8395bdac97 Implemented RPC latency 2017-06-20 23:16:59 -04:00
Luca e2119896db Added protocl info in wireshark info columm 2017-06-20 14:19:55 -04:00
Campus 68f1653dec fix lync detection 2017-06-19 20:39:36 +02:00
Campus 30d29f7ac3 Merge branch 'YumingMa-dev' into dev 2017-06-19 20:37:52 +02:00
Campus 117e61c34b Merge branch 'dev' of https://github.com/YumingMa/nDPI into YumingMa-dev 2017-06-19 15:53:36 +02:00
Luca 412cb2e6e8 Label fix 2017-06-17 07:15:50 -04:00
Luca Deri b11390429c Merge pull request #409 from beratx/dev
Added scanner host stats to (-b) diagnose statistics
2017-06-17 07:08:55 -04:00
berat 5a08303c43 Added scanner host stats to (-b) diagnose statistics 2017-06-16 14:10:54 +02:00
Michele Campus 5fef520d0e Merge pull request #408 from beratx/dev
Fixed bug causing wrong results in (-b) diagnose statistics
2017-06-16 11:34:45 +02:00
berat 6edece628e Fixed bug causing wrong results in (-b) diagnose statistics 2017-06-16 11:24:16 +02:00
Luca be749e75a5 Removed tracing 2017-06-15 07:13:29 -04:00
Luca ac5cb53066 mDNS improvemennts to recognize reponses senst to non multicast addresses 2017-06-15 05:25:27 -04:00
Luca 684c924587 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-06-14 21:37:08 -04:00
Luca 090dc752bd Added OOO, restransmission, segment losts 2017-06-14 21:35:46 -04:00
Campus 348159dc3a Merge branch 'alexei-argus-SOMEIP' into dev 2017-06-14 16:04:15 +02:00
alexei-argus d4ca57884b CR fixes #2 2017-06-14 16:50:01 +03:00
alexei-argus 8ec2867433 CR fixes 2017-06-14 16:49:58 +03:00
Yoni.Linder 0aa5ebde5d CR comments and fixes 2017-06-14 16:49:56 +03:00
alexei-argus 6029510ee7 Add CR comments 2017-06-14 16:49:53 +03:00
Yoni.Linder 7d39ba2124 removed debug prints, changed line of documentation 2017-06-14 16:49:50 +03:00
Yoni.Linder ae959f2d78 SOMEIP debug + bug fixes 2017-06-14 16:49:47 +03:00
Yoni.Linder 968085c965 last updated protocol updated to SOMEIP(228) 2017-06-14 16:49:45 +03:00
alexei-argus 62a65aa4cc Fix case-sensitivity issue 2017-06-14 16:47:43 +03:00
Yoni.Linder bc7f0b3686 endianity for ports 2017-06-14 16:46:44 +03:00
alexei-argus 87b49c5249 Fix build errors 2017-06-14 16:46:42 +03:00
Yoni.Linder ef1a84fb39 ndpi someip initial version with hardcoded port enforcing 2017-06-14 16:43:47 +03:00
Luca Deri c46af1291a Improved AppleStore detection
Modified string search matching to match the longest match (and not the first one)
2017-06-13 15:06:27 +02:00
Luca Deri f3f83f2eee Adding AppleStore and PlayStore (work in progress) 2017-06-13 14:48:59 +02:00
MaYuming d9bef8fa46 fix ms-lync detection missing, More detail at https://github.com/ntop/nDPI/issues/401 2017-06-13 17:17:19 +08:00
Campus af3086fb82 add check for whatsapp in ssl 2017-06-09 13:22:58 +02:00
Campus e0366a9965 improved whatsapp and wechat detection by new ip-ranges 2017-06-09 13:15:09 +02:00
Campus 88d47399b5 updated results 2017-06-09 01:18:41 +02:00
Campus 05912a49ae fixed 1kxun application protocol to avoid false positive in udp detection 2017-06-09 01:15:11 +02:00
Michele Campus b462a0845f Merge pull request #398 from kYroL01/dev
added GoogleDrive detection
2017-06-07 18:20:46 +02:00
Campus 39dc99443c added GoogleDrive detection 2017-06-07 18:18:12 +02:00
Michele Campus c2f51cf7ab Merge pull request #395 from pavlosantoniou/dev
Use flag %d to print signed integers in ndpiReader.
2017-06-07 15:03:14 +02:00
Pavlos Antoniou 9c4a446c76 Use flag %d to print signed integers in ndpiReader. 2017-06-07 13:14:37 +02:00
Campus e49c9f36e8 Merge branch 'pavlosantoniou-dev' into dev 2017-06-07 11:27:37 +02:00
Pavlos Antoniou 1467ad68d4 Remove unused variables for ndpiReader.c and tinc.c 2017-06-07 11:18:38 +02:00
Luca Deri 9a4634adbb Fixes for latency calculation 2017-06-06 21:22:46 +02:00
Luca Deri 984eedc5ea Code cleanup 2017-06-06 11:40:30 +02:00
Luca Deri 7bf508df0a Improved ARP/VLAN stats 2017-06-05 18:05:02 +02:00
Luca Deri 5570e6cbee Fixed bug that was preventiv packets to be analyzed properly
Fixed ARP stats calculation
2017-06-03 18:39:43 +02:00
Luca Deri 3e529dd042 Cleanup 2017-06-03 12:38:00 +02:00
Luca Deri 2049e3d655 Added SSL dissection 2017-06-03 11:35:51 +02:00
Luca Deri 2d72e2a2ae Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-06-02 21:48:37 +02:00
Luca Deri 67aa9f2350 Implemented Application/Network latency
Implemented DNS stats
Moved all menu entries unser Tools -> ntop menu
2017-06-02 21:47:55 +02:00
Campus a5268b1137 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-06-02 20:10:58 +02:00
Campus 6b5f640849 improved spotify detection 2017-06-02 20:10:05 +02:00
Michele Campus 1b5b38a3ba Merge pull request #391 from deselmo/dev
Updated libcache's license
2017-06-02 12:13:55 +02:00
William Guglielmo e1b5b54c4c Update license libcache 2017-06-02 00:29:04 +02:00
cardigliano 22b7b407c3 compilation fix 2017-06-01 18:13:31 +02:00
Campus 284bb21d61 Merge branch 'deselmo-dev' into dev 2017-06-01 16:45:24 +02:00
Campus f6eebb9c81 Merge branch 'dev' of https://github.com/deselmo/nDPI into deselmo-dev 2017-05-31 09:57:00 +02:00
William Guglielmo b08fbe46c0 Delete test.c 2017-05-30 21:04:57 +02:00
William Guglielmo 4a751f9d05 Updated libcache 2017-05-30 19:17:41 +02:00
Luca c5c417e526 Snapchat is now detected as sociaal network 2017-05-30 07:03:55 +02:00
William Guglielmo 46284e1537 Update ndpi_typedefs.h 2017-05-29 21:30:30 +02:00
William Guglielmo 694bc039e8 Added tinc protocol detection 2017-05-29 19:09:32 +02:00
Luca d21dbee102 TYpo 2017-05-29 18:58:02 +02:00
Luca 2b9f8f6a89 Fixed nDPI report formatting 2017-05-29 16:46:28 +02:00
Luca Deri 61f8f56719 Implemented network latency dissector 2017-05-26 12:46:19 +02:00
Luca Deri d67d3eed3c Compilation fix for systems that do not have JSON-C installed 2017-05-26 12:11:37 +02:00
Campus 4829222e73 update results after modifications 2017-05-26 11:26:22 +02:00
Campus 554278e678 Merge branch 'beratx-dev' into dev 2017-05-26 11:24:01 +02:00
berat b1ecc45e4f Added timestamp, flow count and app. level protocol to (-b) diagnose statistics 2017-05-26 02:47:46 +02:00
Campus d17ea73273 update 2017-05-25 17:13:43 +02:00
Luca Deri 07b1a93026 Latency calculation (work in progress) 2017-05-25 16:44:48 +02:00
Luca Deri 98dcfd8393 Reworked MAC stats 2017-05-25 10:55:41 +02:00
Luca Deri e1efee8594 Added check for searching JSON-C in home directory if not installed
Fixed type
2017-05-24 10:11:04 -07:00
Luca 993605d4f3 Fixed bug that was forcing the reader to pass several times the same flow
renamed some variables
2017-05-24 18:53:51 +02:00
Luca Deri 904210e87c Split src2dst / dst2src traffic 2017-05-24 16:06:23 +02:00
Luca Deri 50e26ca400 Implemented MAC stats 2017-05-24 00:51:21 +02:00
Luca Deri c723f7e668 Added VLAN / ARP stats 2017-05-23 23:31:43 +02:00
Alfredo Cardigliano 1a20029c82 compilation fixes 2017-05-23 18:56:43 +02:00
Alfredo Cardigliano 26bd42a71c crc32 fix 2017-05-23 18:02:53 +02:00
cardigliano 601f7f59ff forcing quiet mode in extcap mode 2017-05-22 16:55:48 +02:00
Luca Deri b39eb67836 Moved to 2.1.0
Updated test results
2017-05-22 14:44:31 +02:00
Luca Deri cb6aabbf19 Fixed JSON format when -v 3 and -b is used 2017-05-22 14:14:45 +02:00
Luca Deri b89a2dce6f Removed warning 2017-05-22 01:16:38 +02:00
Campus 97a57ac68d Merge branch 'beratx-dev' into dev 2017-05-20 10:20:16 +02:00
Campus a487a58884 Merge branch 'dev' of https://github.com/beratx/nDPI into beratx-dev 2017-05-20 10:19:44 +02:00
Michele Campus ccfe37870c Merge pull request #386 from Manouchehri/brew
Added HEAD for homebrew.
2017-05-20 10:08:34 +02:00
David Manouchehri 867acf717a Added HEAD for homebrew. 2017-05-19 19:34:52 -04:00
berat 6f27a48721 Added -b for saving port based diagnose statistics in json 2017-05-19 23:26:02 +02:00
Michele Campus 185cd4fb30 Merge pull request #383 from pavlosantoniou/dev
Remove unused variable and clarify operator precedence in ndpi_util.c
2017-05-18 16:52:57 +02:00
Pavlos Antoniou 73b3ee51d1 Remove unused variable and clarify operator precedence in ndpi_util.c 2017-05-18 14:08:01 +03:00
Michele Campus b579408711 Merge pull request #382 from pavlosantoniou/dev
Remove redundant check from btlib.c
2017-05-18 12:16:30 +02:00
Pavlos Antoniou ec0e6f98d4 Remove redundant check from btlib.c 2017-05-18 13:08:45 +03:00
Campus b4b682a4bf Merge branch 'pavlosantoniou-dev' into dev 2017-05-18 10:47:17 +02:00
Pavlos Antoniou 167732cae4 Check pointer for NULL before dereferencing 2017-05-18 11:09:56 +03:00
Michele Campus 2b128a2f1b Merge pull request #380 from pavlosantoniou/dev
Use correct subscripts when checking IP array in ndpi_main.c
2017-05-18 10:06:12 +02:00
Pavlos Antoniou f4bba23ba7 use correct subscripts when checking IP array in ndpi_main.c 2017-05-18 10:42:23 +03:00
Luca Deri 724d182939 Restored file selection as the wireshark bug seems to be fixed in 2.3.x wireshark series 2017-05-17 22:33:44 +02:00
Campus ebb6d4499a update Snapchat detection 2017-05-17 17:33:16 +02:00
Campus b2282a49b5 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-05-17 17:20:47 +02:00
Campus a044178b47 Merge branch 'pavlosantoniou-dev' into dev 2017-05-17 17:17:38 +02:00
Luca a874e7869c Typo 2017-05-17 17:12:22 +02:00
Luca cef42b4050 Updated tests instruction 2017-05-17 17:11:54 +02:00
Pavlos Antoniou 0a2cbe4926 Fix buffer overflows in http.c 2017-05-17 18:11:25 +03:00
Luca Deri 99c9f1d36b Updated results are ndpiReader output has been modified 2017-05-17 15:53:52 +02:00
Luca Deri 0091f35e02 Reworked flow structure handler 2017-05-17 15:50:59 +02:00
Simone Mainardi f2730f06a0 Changlogs for the forthcoming release 2017-05-12 14:43:28 +02:00
Campus 5271233774 Merge branch 'alexei-argus-example_caplen_fix' into dev 2017-05-11 15:59:17 +02:00
Campus 5da83360aa Merge branch 'example_caplen_fix' of https://github.com/alexei-argus/nDPI into alexei-argus-example_caplen_fix 2017-05-11 15:50:09 +02:00
Campus cd26942edf delete check for old protocol 2017-05-11 15:48:12 +02:00
alexei-argus 8a7dc10f51 Fix out-of-bounds heap read caused by using header->len instead of header->caplen (as provided in pcap_loop) 2017-05-10 14:16:46 +03:00
Campus c2bbe79a3e Results update 2017-05-09 19:57:47 +02:00
Campus e6dc092b73 Merge branch 'beratx-dev' into dev 2017-05-09 19:52:46 +02:00
berat 5c1954012b Added IPv6 support to Port Stats 2017-05-09 19:32:40 +02:00
Luca 21567e8686 Added missing direction update with non TCP-UDP protocols 2017-05-08 08:29:18 +02:00
Campus 1af3d571d9 fix for https://github.com/ntop/nDPI/issues/371 2017-05-02 16:50:25 +02:00
Luca Deri 442adce51d Fixed invalid ndpi_match_string_id() return code 2017-05-01 23:05:42 +02:00
Luca Deri 3f5e4cb7ee Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-05-01 21:40:02 +02:00
Luca Deri 4c6f9d5c25 Result update 2017-05-01 21:39:46 +02:00
Luca Deri a43244e493 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-05-01 21:36:59 +02:00
Luca Deri 5c2fa2d2e7 Updated results 2017-05-01 21:36:45 +02:00
Luca Deri aa6167bb42 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2017-05-01 21:21:03 +02:00
Luca Deri 205b82f6ba Added new API calls
- ndpi_add_string_value_to_automa
- ndpi_match_string_id
2017-05-01 21:20:43 +02:00
Luca Deri a03a343723 Minor code cleanup 2017-05-01 19:44:46 +02:00
Luca Deri 92d19ae2ed Merge pull request #370 from beratx/dev
Added IP Statistics to Port Stats
2017-05-01 19:36:49 +02:00
berat 32d02836f0 fixed syntax for gcc compiler 2017-05-01 14:37:12 +02:00
berat 4030b52ecb Added IP Statistics to Port Stats 2017-05-01 14:07:41 +02:00
Luca Deri 064b50df81 Added -m for splitting analysis in sub-analysis steps 2017-04-30 10:12:28 +02:00
Luca Deri af5021d571 Fixed warning 2017-04-29 08:32:28 +00:00
Luca e1b905124f Improved SSL dissection 2017-04-27 14:57:04 +02:00
Luca Deri 6cae3a7dce Removed Napatech dependency 2017-04-27 12:17:32 +02:00
Luca Deri d4a16d9e55 Improced extcap configuration window with sorted protocol list
Reported flow stats in Statistics -> nDPI menu
2017-04-25 11:21:40 +02:00
Luca Deri 6c2c885176 Extcap crash fix 2017-04-25 10:42:03 +02:00
Luca Deri 43f18ddb0f Updated Wireshark lua dissector
Added -v to ndpiReader to print port stats
Recomputed protocol test results
2017-04-24 00:45:43 +02:00
Luca Deri b9a2511ea8 Initial Wireshark nDPI integration 2017-04-23 19:58:41 +02:00
Campus c96507b7a4 updated tests pcap 2017-04-21 02:01:09 +02:00
Campus e2f2111637 update bittorrent detection - fix https://github.com/ntop/nDPI/issues/362 2017-04-21 01:42:54 +02:00
Campus 9a94c34b91 fix for https://github.com/ntop/nDPI/issues/364 2017-04-20 23:00:11 +02:00
Campus 6581579d37 update flow thanks to commit a9c01ded17 2017-04-20 17:57:40 +02:00
Luca Deri 4cc54cceb5 Added port stats when verbose mode (-v) is used 2017-04-19 23:31:45 +02:00
Luca Deri a9c01ded17 ndpiReader now prints (-v) the flows with the correct direction 2017-04-19 21:55:49 +02:00
Luca cbc08f7e50 Added DNScrypt test files 2017-04-19 09:58:35 +02:00
Luca 45582194cf Added DNScrypt detection 2017-04-19 09:56:51 +02:00
Luca 56b6c7ed93 Fixed thread crash caused by commit 29cd6ef994 2017-04-19 09:50:54 +02:00
Luca c1db9a830d Compilation fix for old compilers 2017-04-18 17:20:43 +02:00
Luca 4c5de9ef8e Added ethernet checksum reforging and nDPI protocol export in nDPI-extcap reader 2017-04-17 09:38:30 +02:00
Campus 3a21152f4c improved wechat detection 2017-04-15 21:18:50 +02:00
Campus b97e3ee51a add initial detection for WeChat 2017-04-15 11:23:03 +02:00
Campus 2b0809f3dc name correction for llc_snap header and minor fix 2017-04-15 00:40:01 +02:00
Campus 29cd6ef994 fix segmentation fault caused by missing spanning tree check - add control for threads return values 2017-04-15 00:29:53 +02:00
Luca Deri d8b2189cc3 Initial wireshark integration via extcap interface 2017-04-14 00:07:46 +02:00
Michele Campus 3a8c2d0b6f Merge pull request #360 from jaspervandenberg/dev
unified HTTPDownload name with other HTTP protocols (as HTTP_Download)
2017-04-07 17:01:39 +02:00
Jasper van den Berg eed3ba5d1e unified HTTPDownload name with other HTTP protocols (as HTTP_Download) for consistency 2017-04-07 11:47:44 +02:00
Luca bc68949c76 Added AMQP (Advanced Message Queueing Protocol) 2017-04-07 08:05:39 +02:00
Luca e4ef2d8140 Improved Ookla protocol 2017-04-04 14:42:45 +02:00
emanuele-f 0659f9b592 Replace BSD dependent strnstr with ndpi portable one 2017-04-02 11:17:57 +02:00
Luca Deri 0390c8ccfb Added Ookla test pcap
Updated results
2017-04-01 21:39:47 +02:00
Luca Deri 281ba768ec Added Ookla (SpeedTest) protocol detection 2017-04-01 21:33:15 +02:00
Campus 806fae6596 Merge branch 'vpiserchia-set_memory_functions' into dev 2017-03-29 10:59:41 +02:00
Campus 65359e53d8 Merge branch 'set_memory_functions' of https://github.com/vpiserchia/nDPI into vpiserchia-set_memory_functions 2017-03-29 10:46:38 +02:00
Luca Deri 92b1b46fa6 SSL server certificate is now detected 2017-03-21 00:48:16 +01:00
Luca Deri 760d468aca Improved netbios name decoding 2017-03-19 23:42:36 +01:00
Luca Deri 6a5b380bc7 Exported ndpi_netbios_name_interpret() to all nDPI apps 2017-03-19 22:51:13 +01:00
Luca Deri 689d3e7602 Improved netbios dissection 2017-03-19 22:38:13 +01:00
Vito Piserchia 4300208642 Added ndpi_flow_ free/malloc and set_ functions:
Ideally these two new functions will provide more flexibility
in regards of application that want to use specific allocation
approaches, for example storage queues for this structures
from where the application can pop and release the data it
needs.
Semantically they can be set up as the other ndpi_malloc and ndpi_free
functions, that is via the set_ndpi_flow_malloc and set_ndpi_flow_free.
In case a NULL parameter is passed to the above functions the old
approach will be used, that means that the ndpi_malloc will be used as
the ndpi_flow_malloc function and ndpi_free_flow as the ndpi_flow_free one.

Application that use the old functions will be not affected by this change,
and the ndpi_free_flow can be deprecated in the future and made private.
2017-03-16 17:35:10 +01:00
Campus 149818671d minor fix for http 2017-03-16 10:31:36 +01:00
Luca Deri dc1f005823 Tests update 2017-03-15 20:25:08 +01:00
Luca Deri eeb6f9334a Warning fix 2017-03-15 20:21:18 +01:00
Campus 3add72c686 deleted useless function - change macro name 2017-03-15 18:42:44 +01:00
Campus 5de6a96af5 change behaviour for https://github.com/ntop/nDPI/issues/344 - fix skype detection deleting parts that detect host name and ip addr (duplicate behaviour) - improved any detection after fix - added skype host name 2017-03-15 17:28:31 +01:00
Michele Campus 1e014aa95b Merge pull request #348 from jsoref/spelling
Spelling fixes
2017-03-13 14:46:22 +01:00
Luca Deri 9962eb1f08 Fixed invalid QUIC header parsing 2017-03-13 14:33:03 +01:00
Luca Deri 6bc35b92d3 Result file for youtube_quic.pcap 2017-03-13 01:19:35 +01:00
Luca Deri 40aaa05456 Minor changes for tracking Youtube content
Added test pcap for working on quic/youtube dissector
2017-03-13 01:16:58 +01:00
Josh Soref e17f62d261 spelling: values 2017-03-12 22:21:51 +00:00
Josh Soref 65cde78f6d spelling: unknown 2017-03-12 22:11:52 +00:00
Josh Soref 9a5402518c spelling: unencrypted 2017-03-12 22:13:00 +00:00
Josh Soref 11fc826e52 spelling: switch 2017-03-12 22:10:54 +00:00
Josh Soref 249b5d6783 spelling: structure 2017-03-12 22:10:38 +00:00
Josh Soref 7a2dcf0f9f spelling: soulseek 2017-03-12 22:10:05 +00:00
Josh Soref 710d528215 spelling: second 2017-03-12 22:07:00 +00:00
Josh Soref ce0a3e858a spelling: scrupulous 2017-03-12 22:06:44 +00:00
Josh Soref d178bec60e spelling: reset 2017-03-12 22:02:56 +00:00
Josh Soref fba88e225f spelling: remove 2017-03-12 22:06:05 +00:00
Josh Soref 7bac815938 spelling: protocol 2017-03-12 22:00:38 +00:00
Josh Soref 18916e682f spelling: prerequisites 2017-03-12 22:01:58 +00:00
Josh Soref fbe1fb285d spelling: platform 2017-03-12 22:00:21 +00:00
Josh Soref 04014d73d9 spelling: pedantic 2017-03-12 22:00:07 +00:00
Josh Soref 1aa10f5211 spelling: optimization 2017-03-12 21:58:56 +00:00
Josh Soref 35fe91116a spelling: ninety 2017-03-12 21:48:05 +00:00
Josh Soref fa34be1a00 spelling: modified 2017-03-12 21:52:59 +00:00
Josh Soref 7bb615a262 spelling: length 2017-03-12 21:45:36 +00:00
Josh Soref c51f88e62a spelling: interface 2017-03-12 21:44:26 +00:00
Josh Soref 120e3473f8 spelling: initialize 2017-03-12 21:43:57 +00:00
Josh Soref 4a5407feb7 spelling: incomplete 2017-03-12 21:43:45 +00:00
Josh Soref d332370298 spelling: googlesyndication 2017-03-12 21:37:41 +00:00
Josh Soref d5b15c498b spelling: five 2017-03-12 21:34:28 +00:00
Josh Soref 66e93da6f5 spelling: excluding 2017-03-12 21:33:20 +00:00
Josh Soref f8fed9be7e spelling: exclude 2017-03-12 21:33:32 +00:00
Josh Soref 3dbb97413c spelling: encryption 2017-03-12 21:32:57 +00:00
Josh Soref 47f9f54b89 spelling: discarded 2017-03-12 21:32:19 +00:00
Josh Soref e89ce717ba spelling: delivered 2017-03-12 21:31:56 +00:00
Josh Soref 0645625585 spelling: datastructure 2017-03-12 21:31:28 +00:00
Josh Soref e115e0b89e spelling: creating 2017-03-12 21:26:33 +00:00
Josh Soref 6a7ad10ae0 spelling: conservative 2017-03-12 21:22:34 +00:00
Josh Soref 5a2f556ff7 spelling: compatibility 2017-03-12 21:20:18 +00:00
Josh Soref b0e0b29201 spelling: associated 2017-03-09 04:56:31 +00:00
Josh Soref 616b6ce4d5 spelling: address 2017-03-09 04:54:42 +00:00
Luca Deri 6a27b6262d Added disclaimer 2017-03-07 19:25:34 +01:00
Luca Deri 940c185c5d Improved BJNP protocol 2017-03-07 10:40:42 +01:00
Luca Deri f831f30556 Fixed invalid SNMP detection 2017-03-07 10:19:29 +01:00
Campus fd93036b79 better improvement of netflix traffic detection - added netflix pcap and output - change little bit http detection behaviour 2017-03-05 12:38:15 +01:00
Luca Deri 889cdbff3c Fixed bug that can lkead to a crash in iqiyi dissector 2017-02-25 06:31:07 +01:00
Campus a787287bfa fix and improved netflix detection by user-agent 2017-02-22 17:14:52 +01:00
Campus c2c92b2e9b added double tagging 802.1Q in dissection of vlan pkt 2017-02-21 13:04:17 +01:00
Campus e68aeb69eb Merge branch 'k0ste-newfeature' into dev 2017-02-20 17:26:09 +01:00
Campus 846f457db4 update detection and tests 2017-02-20 17:25:19 +01:00
Campus 35ab1b5d1c Merge branch 'newfeature' of https://github.com/k0ste/nDPI into k0ste-newfeature 2017-02-20 16:47:46 +01:00
Campus 76e1bed466 update test dir to fix wrong pcap 2017-02-20 16:45:26 +01:00
Campus 100acbbe7b added missing .out 2017-02-20 16:42:54 +01:00
Konstantin Shalygin 66044578c2 ndpi_content_match: Add origin routes for many services. 2017-02-20 18:26:22 +07:00
Campus eb92c6b676 improved skype detection 2017-02-16 20:11:21 +01:00
Campus af04f78bd7 update Netflix ip-range list 2017-02-16 12:43:52 +01:00
Campus b35c1ab696 minor fix mgcp dissector 2017-02-14 01:23:47 +01:00
Campus 5c1c8b80e2 Merge branch 'numeronove-dev-numeronove-openbsd' into dev 2017-02-13 13:16:14 +01:00
Campus 787ca096e6 Merge branch 'dev-numeronove-openbsd' of https://github.com/numeronove/nDPI into numeronove-dev-numeronove-openbsd 2017-02-13 13:11:54 +01:00
Campus 363b38ceb0 fix dhcp buffer overflow 2017-02-13 13:03:27 +01:00
Luca Deri e2cfc96577 Improvements for exporting info in MDNS and UBNTAC2 protocols
Added test pcap file for UBNTAC2
2017-02-13 01:29:25 +01:00
Luca Deri b16769ddbe Refined guess that does not happen for protocols that have been excluded 2017-02-12 20:14:11 +01:00
Numeronove ffbe5d1e22 Easing OpenBSD build
Addedd macro AM_PROG_CC_C_O in configure.ac, needed to have autogen.sh
manage the error:

    C objects in subdir but `AM_PROG_CC_C_O' not in `configure.ac'

Modified case instance in example/ndpi_util.c, since DLT_LINUX_SLL
isn't defined in OpenBSD pcap.h.
2017-02-11 11:04:59 +01:00
Luca Deri 1d2e67d38c Dissected SSH client/server versions and reported in data structures 2017-02-11 10:48:08 +01:00
Alfredo Cardigliano b6eecd7d0c Update .travis.yml 2017-02-09 22:57:49 +01:00
Campus b229b89c78 fix for https://github.com/ntop/nDPI/issues/339 2017-02-09 17:01:12 +01:00
Simone Mainardi b161a6d7f7 Fix for FreeBSD build 2017-02-04 17:01:40 +01:00
Michele Campus 799e39227c Merge pull request #334 from alagoutte/fix
fix hardcoded value of version in Makefile
2017-02-04 12:22:54 +01:00
Michele Campus 38820ec916 Merge pull request #335 from alagoutte/warning
ndpi_main(.c): fix unused function 'tor_ptree_match' [-Werror,-Wunuse…
2017-02-04 12:22:22 +01:00
Alexis La Goutte be1ee30fa8 ndpi_main(.c): fix unused function 'tor_ptree_match' [-Werror,-Wunused-function] 2017-02-04 10:11:28 +01:00
Alexis La Goutte beb069df64 fix hardcoded value of version in Makefile
Issue report by @clauderobi (issue #333)
2017-02-04 09:01:46 +01:00
Luca Deri 9941045468 Renumbered ids that were changed by mistake
MQTT (NOW 208, latest stable version 222)
RX ( NOW 209, latest stable version 223)
OPENDNS ( NOW 197, latest stable version 225 ).
2017-02-01 18:10:02 +01:00
Luca Deri 8fa2d8f0d6 Improved whatsapp detection 2017-01-31 16:38:31 +01:00
Luca Deri a3d32d9d80 Improved HTTP subprotocol matching 2017-01-31 16:01:58 +01:00
Luca Deri bf35300817 Updated readme 2017-01-31 15:43:14 +01:00
Luca Deri ff9af3166f Updated results for HTTP-subprotocols 2017-01-31 15:06:21 +01:00
Luca Deri 8805d8523b Optimized code to avoid multiple calls to ndpi_network_ptree_match()
HTTP-based subprotocols have not HTTP set as master_protocols
2017-01-31 15:04:24 +01:00
Luca Deri 0610ae2d21 Fixed issues caused by (invalid) protocol renumbering. The problem has been solved and now protocols are in sync with its previous values in the stable version 2017-01-31 13:16:36 +01:00
Campus 5972fca190 Merge branch 'dillinger79-dev' into dev 2017-01-20 16:20:44 +01:00
dillinger79 9f8fedb3b1 Merge pull request #1 from dillinger79/dillinger79-patch-1
Update smpp.c
2017-01-20 11:31:36 +02:00
dillinger79 048ab4b5d3 Merge pull request #2 from dillinger79/dillinger79-patch-2
Add files via upload
2017-01-20 11:31:12 +02:00
dillinger79 8aa1d770f0 Add files via upload
this pcap file causes a busy loop
2017-01-18 18:27:56 +01:00
dillinger79 4e6dda6361 Update smpp.c 2017-01-18 18:21:47 +01:00
Luca e44834e0c5 Fixed warning 2017-01-02 22:05:40 +01:00
Luca Deri 1a3ee31865 Renamed enum constant 2017-01-02 21:52:53 +01:00
Michele Campus 721af38aed Merge pull request #322 from emanuele-f/dev
Add enum items number
2016-12-30 09:51:20 +01:00
emanuele-f 2ac04dba4d Add enum items number 2016-12-29 23:41:09 +01:00
Michele Campus e7fbcc690b Merge pull request #321 from alagoutte/fix_warning
SMPP: fix comparison of unsigned expression >= 0 is always true [-Wer…
2016-12-29 11:26:11 +01:00
Alexis La Goutte f4ce6a8023 SMPP: fix comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare] 2016-12-29 10:14:17 +00:00
Luca Deri 773dbf4ef2 Added BJNP default ports 2016-12-19 17:33:28 +01:00
Luca Deri 5486dcd1f9 Added default AFP port 2016-12-19 14:29:51 +01:00
Campus 61f0eb062e fix indent code and int type to keep conformity of the rest of the code (u_intxx instead uintxx) 2016-12-15 12:15:48 +01:00
Campus b68f197fea Merge branch 'dfranusic-dev' into dev 2016-12-15 12:12:15 +01:00
Campus 39e475b4ea Merge branch 'dev' of https://github.com/dfranusic/nDPI into dfranusic-dev 2016-12-15 12:00:08 +01:00
Damir Franusic f5b8855fed Implemented Short Message Peer-to-Peer (SMPP) dissector 2016-12-14 21:57:33 +01:00
Campus 03e8111e1b Merge branch 'k0ste-newfeature' into dev 2016-12-14 18:21:13 +01:00
Konstantin Shalygin e26b64a0fc Add Valve AS routes and domain names for better Steam detection. 2016-12-14 23:20:42 +07:00
Campus 8b1aa4a7bd improved steam detection 2016-12-13 19:00:34 +01:00
valentina b2b36be6cf Removed "yp" element from "ndpi_en_impossible_bigrams" structure because tor was detected instead of ssl (paypal). 2016-12-11 22:12:26 +01:00
Luca Deri 7d82948bd1 Improvement on ndpi_int_change_protocol() accuracy 2016-12-10 19:30:42 +01:00
Michele Campus f7515514bd Merge pull request #314 from sologub/dev
Fix 'IPVERSION undeclared' error on WIN32
2016-12-07 10:45:43 +01:00
Ruslan Sologub 12a3d80f71 Fix 'IPVERSION undeclared' error on WIN32 2016-12-07 11:36:39 +02:00
Campus ef69a1610a Merge branch 'denisvm-magicnumbers' into dev 2016-12-06 22:23:36 +01:00
Denis Volpato Martins 483eb63408 Removed some magic numbers 2016-12-06 18:48:26 -02:00
Luca Deri b019dcd11a Added missing -ldl library 2016-12-05 19:15:45 +01:00
Luca Deri 163945f4b4 Added check to avoid loops with invalid DHCP packets 2016-12-05 18:25:39 +01:00
Luca Deri 22ee439215 Added memory check in patricia tree
Improved AFP dissection
Updated DHCP test results
2016-12-05 13:58:43 +01:00
Luca Deri 582f5e0f72 Implemented DHCP host name extraction 2016-12-04 21:44:48 +01:00
Campus 5f672dfb42 added comment to function process_packet 2016-12-02 02:32:46 +01:00
Campus 6f31ae722e added prototype of function packet_processing 2016-12-02 02:25:43 +01:00
Campus cc5167c09a Merge branch 'alagoutte-osx' into dev 2016-11-28 21:45:44 +01:00
Alexis La Goutte c6eb41b7bf Remove gcc when build with osx
osx buildbot use always clang for the build
2016-11-28 19:16:09 +01:00
Alexis La Goutte eeef26ae59 Add macOS build on Travis 2016-11-28 10:55:29 +01:00
Alexis La Goutte d53b655c32 Update ax_pthread
for fix issue when build with clang on macos

clang: error: argument unused during compilation: '-pthread'
No need -pthread when linking
2016-11-28 10:45:54 +01:00
Luca Deri be81d33495 Disabled coverage (work in progress) 2016-11-27 12:21:02 +01:00
Luca Deri 035a290ab5 Coverage (work in progress) 2016-11-27 11:52:50 +01:00
Luca Deri c041a723c1 Added coverage 2016-11-27 11:34:52 +01:00
Luca Deri 45ca2ace0b Code cleanup. Added coveralls badge 2016-11-27 10:57:42 +01:00
Luca 424fbb710c Added fixes to properly honour subprotocols 2016-11-26 18:36:08 +02:00
Luca 169a8fb97f Test update 2016-11-25 17:52:19 +02:00
Campus 098812d3cc Merge branch 'mgigante-dev_libdl' into dev 2016-11-24 10:07:10 +01:00
Campus 4eb5297a79 Merge branch 'dev_libdl' of https://github.com/mgigante/nDPI into mgigante-dev_libdl 2016-11-24 10:05:56 +01:00
Marco Gigante c52c738408 Checking for libdl vs. libc during configure 2016-11-23 08:44:07 +01:00
Campus 797eb2c3ca fix initialization of struct ndpi_flow_info *flow 2016-11-22 23:11:24 +01:00
Campus d9a2d9a6bd updated facebook detection (continue) by ip server ranges 2016-11-22 22:57:31 +01:00
Michele Campus 4da4db1e73 Merge pull request #303 from alagoutte/fix_warning
Fix warning
2016-11-22 22:18:11 +01:00
Alexis La Goutte 4c23c3fec9 ndiReader: fix ‘jObj_main/jArray_detProto’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2016-11-22 20:56:14 +01:00
Alexis La Goutte 2ab1faf05a http: unused variable 'no_pps' [-Werror=unused-variable] 2016-11-22 20:56:12 +01:00
Campus f670eefd84 update facebook detection (2) for https://github.com/ntop/nDPI/issues/300#issuecomment-261977387 2016-11-21 17:28:53 +01:00
Campus 4e1c301b2a update facebook detection 2016-11-21 16:14:28 +01:00
Luca Deri b25e3e0917 Compilation fix 2016-11-20 20:24:39 +01:00
Campus f571d7ed3a fix ssl for https://github.com/ntop/nDPI/issues/301 2016-11-20 13:19:20 +01:00
Campus 9abbef7e05 added iqiyi media service and updated ppsetream protocol - added 1kxun media service 2016-11-20 13:07:00 +01:00
Campus 1fbe25f91e fix facebook detection in http dissector 2016-11-18 20:21:08 +01:00
Michele Campus 19ad081bb1 Merge pull request #298 from denisvm/twitter-nets
Update and merge Twitter networks
2016-11-18 10:23:12 +01:00
Denis Volpato Martins 911be714e5 Update and merge Twitter networks 2016-11-17 16:42:16 -02:00
Michele Campus f51fef6027 Merge pull request #296 from sologub/dev
Fix byte packing on Windows
2016-11-15 15:14:29 +01:00
Ruslan Sologub 8761e3a869 Fix byte packing on Windows 2016-11-15 15:47:08 +02:00
Campus b9a1eba152 updated host matching services 2016-11-15 12:44:39 +01:00
Campus 1e19b689c4 minor fix for https://github.com/ntop/nDPI/commit/0f94a46f868e6818790b0c278121c081a63c9eeb 2016-11-15 12:02:02 +01:00
Campus 0f94a46f86 Merge branch 'mkfsn-bjnp-protocol' into dev 2016-11-15 11:50:45 +01:00
mkfsn d9659617e9 Add BJNP Protocol 2016-11-15 17:59:02 +08:00
Luca Deri edf0b2fbfe Updated Twitter networks 2016-11-15 10:19:27 +01:00
Campus 61c8dca469 fixed wrong function call 2016-11-14 13:35:16 +01:00
Campus d86e504779 Merge branch 'alagoutte-warning' into dev 2016-11-13 18:45:50 +01:00
Alexis La Goutte 3d6b4d4dff ndpi_util: fix ‘type/ip_offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 45bcb9927d bittorrent: fix variable ‘peer_id’ set but not used [-Werror=unused-but-set-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 612a07f420 ndpi_main: fix variable 'daddr/saddr' set but not used [-Wunused-but-set-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte d129abcde0 ndpi_util: unused variable 'nDPI_traceLevel' [-Wunused-const-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 6fad364daa ndpi_util: fix unused variable 'ip6_offset/ethernet_2/llc_off/cdp/slarp' [-Wunused-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte dc7a85ee76 ndpiReader: fix unused function 'debug_printf' [-Wunused-function]
Comment the function
2016-11-13 18:22:03 +01:00
Alexis La Goutte 26aec8714e ndpi_main: fix enumeration value 'NDPI_PROTOCOL_CATEGORY_UNSPECIFIED' not handled in switch [-Wswitch] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 65f61fd5b1 rx: fix unused variable 'found' [-Wunused-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 57ad066e66 QUIC: fix unused variable 'begin' [-Wunused-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 2a2a0d4aeb git: fix unused variable 'git_len' [-Wunused-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 1082a234fe bittorrent: fix unused variable 'no_bittorrent' [-Wunused-variable] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 141bb48d76 BGP: fix unused function 'ndpi_int_bgp_add_connection' [-Wunused-function] 2016-11-13 18:22:03 +01:00
Alexis La Goutte 85bb227b45 ndpi_main: fix unused variable 'node/ret' [-Wunused-variable] 2016-11-13 18:22:03 +01:00
Campus 2005979f46 update test results after new services added 2016-11-12 16:38:37 +01:00
Campus 48a206a434 Merge branch 'alagoutte-scan-build' into dev 2016-11-12 16:35:25 +01:00
Alexis La Goutte 3a6d2c7c5f ndpi_main: fix Dereference of null pointer 2016-11-12 16:30:15 +01:00
Alexis La Goutte 800ad1737c COAP: fix typo about checking twice source port
Found via Clang Analyzer (Used d_port variable)
2016-11-12 16:02:32 +01:00
Alexis La Goutte c7eb8d1082 HTTP: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang Analyzer 2016-11-12 16:00:10 +01:00
Michele Campus 4564b973df Merge pull request #289 from mkfsn/service-github
Add Github service
2016-11-11 18:46:22 +01:00
mkfsn 2586618c1b Add Github service 2016-11-12 00:15:31 +08:00
Campus 7758bc821e Merge branch 'vpiserchia-dev' into dev 2016-11-03 23:10:23 +01:00
Campus 78f7f19359 Merge branch 'dev' of https://github.com/vpiserchia/nDPI into vpiserchia-dev 2016-11-03 23:08:44 +01:00
Vito Piserchia 04e45f503b setup the debug function 2016-11-03 17:41:31 +01:00
Campus 58e97c966c Merge branch 'vpiserchia-dev' into dev 2016-11-03 15:39:28 +01:00
Vito Piserchia e3d15ef4e7 Prevent Segfault when building with -DNDPI_ENABLE_DEBUG_MESSAGES 2016-11-03 15:23:06 +01:00
Vito Piserchia 61f1ace43f Fix NDPI_PROTOCOL_MSSQL_TDS macro name 2016-11-03 15:22:04 +01:00
Vito Piserchia 087ca9d0d5 Merge remote-tracking branch 'upstream/dev' into dev 2016-11-03 15:08:56 +01:00
Luca Deri 002b8b04e9 Win fixes 2016-11-03 00:22:51 +01:00
Luca Deri 6f0232763c Added -ldl needed by PF_RING 2016-11-02 20:48:22 +01:00
Vito Piserchia 8169b35fa6 Merge remote-tracking branch 'upstream/dev' into dev 2016-11-02 10:16:16 +01:00
Campus 097ba22a59 minor fix to keep same coherence of type used 2016-10-30 01:14:49 +02:00
Vito Piserchia 78ebb3445a Merge remote-tracking branch 'upstream/dev' into dev 2016-10-25 14:37:31 +02:00
Campus b8fb5fb403 added iflix service 2016-10-24 23:25:29 +02:00
Luca Deri 93f01e614f Added new functions defined in #279 for exporiting them in shared libs
Disabked some search dissectors from Office365
Fixed warning
2016-10-23 13:00:41 +02:00
Luca Deri e9f00a4e8a Merge pull request #279 from emanuele-f/category
Add protocol category ids
2016-10-23 12:54:30 +02:00
emanuele-f 7d0397a8fb Add protocol category ids 2016-10-22 22:22:15 +02:00
Campus 2682ab6791 added skype ip-address server name range 2016-10-20 23:54:15 +02:00
Michele Campus b60e82c702 Merge pull request #278 from mgigante/dev_funcproto
Avoid c99 complains about function prototypes
2016-10-20 17:08:04 +02:00
Marco Gigante bac82eeb8e Avoid c99 complains about function prototypes 2016-10-20 16:01:53 +02:00
Campus 94c134318b fix msn dissector - add pcap for test 2016-10-17 18:43:47 +02:00
Luca Deri 6fd334dcd7 Updated quickstart guide
The new master file for the guide is keynote (deleted docx)
2016-10-15 11:41:40 +02:00
Campus df6b71c5ea fix debug function 2016-10-15 00:47:13 +02:00
Vito Piserchia 4c467d7cad Merge remote-tracking branch 'upstream/dev' into dev 2016-10-13 13:50:29 +02:00
Campus db794beb84 added vnc pcap to test folder 2016-10-12 00:14:46 +02:00
Campus 3b95cd9a11 fix vnc dissector 2016-10-12 00:10:06 +02:00
Campus bbe4717075 removed imesh protocol (iMesh is no longer availlable) 2016-10-09 19:12:15 +02:00
Campus 2c47dca086 fixed some dissector for logic or syntax 2016-10-07 11:37:42 +02:00
Vito Piserchia a17553cbf1 more ignores 2016-10-04 15:42:20 +02:00
Campus 7e8e243e68 fix check for issue https://github.com/ntop/nDPI/issues/272 2016-10-03 14:36:51 +02:00
Luca cf470ec038 Fix for #218 2016-09-28 18:15:51 +02:00
Luca 016623decb Added protos.txt to the list of tests 2016-09-28 17:50:17 +02:00
Luca Deri a0a8c0294d Fix for #249 2016-09-27 19:24:57 +02:00
Campus 9fe92f6145 fixed drda_db2 dissector 2016-09-27 11:17:45 +02:00
Campus 9f3804444e fixed drda_db2 dissector 2016-09-27 11:17:06 +02:00
lucaderi 67ac0b431c Fix for #249 (not sure is enough) 2016-09-27 08:01:15 +02:00
Campus 1f807a1348 fix snaplen for pcap_open_live function - optimal value is described here http://pcap.man.potaroo.net/ 2016-09-26 10:43:44 +02:00
Campus bf778d6df1 fix typo 2016-09-24 16:13:41 +02:00
Campus f8a9faf2fa added adobe flash host name - fix twitter and netflix detection - removed twitter dissector (useless have a dissector that looking for ip range; moved matching in ndpi_content_match.c.inc) 2016-09-24 13:45:28 +02:00
Campus 054f8376e4 deleted meebo dissector (service not availlable anymore) - change Weibo subservice name to Sina service (more correct) 2016-09-24 11:32:47 +02:00
Campus d601b0ce20 fix ftp on tcp 2016-09-22 18:59:56 +02:00
Campus 730c8d6879 fix wrong comment rsync - deleted old tds dissector 2016-09-16 02:19:20 +02:00
Campus dbb3d8280e fix and merge mssql and tds in unique dissector mssql_tds due to latest release + minor fixes 2016-09-16 02:05:14 +02:00
Michele Campus 36956ebf68 Merge pull request #267 from tianzhishuizhu/dev
check udp
2016-09-15 09:50:38 +02:00
tianzhishuizhu 3c8d5bb788 check udp 2016-09-15 10:49:03 +08:00
Michele Campus 9e9b64a7e7 Merge pull request #266 from tianzhishuizhu/dev
check udp
2016-09-14 10:35:07 +02:00
tianzhishuizhu 0a73a9bd9c Merge branch 'dev' of github.com:tianzhishuizhu/nDPI into dev 2016-09-14 16:16:37 +08:00
tianzhishuizhu d9addc9245 check packet udp != NULL 2016-09-14 16:16:24 +08:00
Michele Campus 6b4b7a9083 Merge pull request #265 from tianzhishuizhu/dev
improve readability
2016-09-13 10:51:35 +02:00
tianzhishuizhu afcf567538 Update syslog.c 2016-09-13 15:55:05 +08:00
tianzhishuizhu 2b67b3bc81 improve readability 2016-09-13 15:51:17 +08:00
Michele Campus 3cd6456349 Merge pull request #263 from tianzhishuizhu/dev
payload min length
2016-09-08 15:01:28 +02:00
tianzhishuizhu c10052764b payload min length 2016-09-08 20:55:26 +08:00
Michele Campus 2ae4db34b0 Merge pull request #261 from tianzhishuizhu/dev
optimization for code duplication
2016-09-08 14:48:54 +02:00
tianzhishuizhu 9ddaccbae0 text error 2016-09-08 19:53:03 +08:00
tianzhishuizhu f7ca670ce0 delete variables unused 2016-09-08 19:49:13 +08:00
tianzhishuizhu ce3493952b logical error 2016-09-08 17:02:50 +08:00
tianzhishuizhu ac8aaf0e08 optimization for code duplicationdup 2016-09-08 16:29:39 +08:00
Campus 3ceb19a9c6 fixed dhcp dissector 2016-09-07 10:31:11 +02:00
Luca Deri 95974b0d24 Merge pull request #258 from emanuele-f/facebook
Fix facebook certificate recognition
2016-09-06 08:10:35 +03:00
emanuele-f ba3bf6c3d9 Fix facebook certificate recognition 2016-09-06 00:44:17 +02:00
Campus 7300e88cdb fixed h323 dissector 2016-09-05 00:49:48 +02:00
Michele Campus 7364fcc7df Merge pull request #255 from emanuele-f/openvpn
Fix openvpn with multiple hard_reset_client not being recognized
2016-08-28 01:05:08 +02:00
emanuele-f 562b90d93c Fix openvpn with multiple hard_reset_client not being recognized 2016-08-28 00:41:39 +02:00
Campus 210602476f update Skype ip address range 2016-08-27 22:56:01 +02:00
Campus 58e37f8130 update Skype and MS_OneDrive range IP address 2016-08-27 22:25:28 +02:00
Michele Campus b6802767aa Merge pull request #253 from theirix/fix-drda2
Fix drda in addition to #242
2016-08-22 14:54:56 +02:00
theirix 76f7454049 Fixed drda loop logic 2016-08-22 15:09:06 +03:00
theirix fb687b7217 Fix another overflow in DRDA 2016-08-22 15:09:06 +03:00
Campus b34d418b57 fix indentation ssl.c 2016-08-22 12:03:56 +02:00
Michele Campus 45f8f72bae Merge pull request #252 from emanuele-f/gmail
Add hotmail service and enable full master protocol detection for sub-protocols
2016-08-22 11:56:06 +02:00
emanuele-f 11ca0a01d3 Enable full master protocol detection for sub-protocols 2016-08-22 11:32:57 +02:00
emanuele-f 5f4bbe311e Add Hotmail service 2016-08-22 11:08:22 +02:00
Luca Deri 305e310f0a Merge pull request #251 from Lzz/dev
Fix README.md
2016-08-20 08:28:47 +02:00
yimao ed35c466ae Fix README.md 2016-08-20 11:05:10 +08:00
Michele Campus 48341094a3 Merge pull request #248 from theirix/build-check2
Added instructions how to run tests
2016-08-13 16:22:40 +02:00
theirix fb73ab95ea Added instructions on running tests 2016-08-13 17:17:35 +03:00
theirix 9c4f80449b Fixed dist build 2016-08-13 17:14:01 +03:00
Luca Deri dc88cc4e64 Merge pull request #247 from theirix/build-check
Allowed to run tests by 'make check' in addition to plain do.sh
2016-08-13 13:32:20 +02:00
theirix bee9090a92 Allowed to run tests by 'make check' 2016-08-13 13:35:14 +03:00
Michele Campus d1bf5d2bb6 Merge pull request #245 from denisvm/service-slack
added Slack service
2016-08-13 10:54:27 +02:00
Denis Volpato Martins 9c2eba2009 fix Slack service domains without A DNS RRs and fix slack-imgs.com access 2016-08-12 15:18:11 -03:00
Denis Volpato Martins 44271e7bb8 added Slack service 2016-08-12 15:08:32 -03:00
Campus 5e399498c3 minor fixes 2016-08-12 15:51:41 +02:00
Campus 3bfa021760 fix quic result detection for YouTube 2016-08-12 15:33:34 +02:00
Michele Campus 7853c4a90b Merge pull request #244 from emanuele-f/starttls
Add STARTTLS detection
2016-08-12 15:27:11 +02:00
emanuele-f e7613a3851 Add IMAPS protocol on stack for use on detection giveup 2016-08-12 14:28:16 +02:00
emanuele-f b34e9bf42a Keep previous code 2016-08-12 13:28:40 +02:00
emanuele-f 6e1341c148 Add STARTTLS detection 2016-08-12 13:19:42 +02:00
Campus 92cac451c8 added new Youtube server name to improve detection 2016-08-11 20:06:08 +02:00
Michele Campus 0e04068952 Merge pull request #242 from theirix/fix-drda
Fixed DRDA detection
2016-08-11 09:16:42 +02:00
theirix 0a06b3b208 Fixed DRDA detection 2016-08-11 01:55:24 +03:00
Campus 8bccfa5b10 fixed invalid termination with ipv6 address 2016-08-09 23:00:33 +02:00
Michele Campus 5e1e6a48a4 Merge pull request #241 from theirix/fix-quic
Fixed buffer overflow in QUIC
2016-08-08 09:52:38 +02:00
theirix 4981005572 Fixed QUIC crash 2016-08-07 22:37:36 +03:00
Luca Deri 9e207f7f24 Fix for systems without beXXtoh 2016-08-05 17:29:33 +02:00
Michele Campus 5ec1b685d8 Merge pull request #240 from emanuele-f/openvpn
Add openvpn test pcap
2016-08-05 09:16:49 +02:00
emanuele-f c41571879b Add openvpn test pcap 2016-08-05 01:20:05 +02:00
Michele Campus 62a5f2350b Merge pull request #239 from emanuele-f/openvpn
OpenVPN detection by opcode, packet ID and session ID
2016-08-05 00:21:31 +02:00
emanuele-f 82f10ddc6a OpenVPN detection by opcode, packet ID and session ID 2016-08-04 23:08:09 +02:00
Michele Campus 4fa76bee78 Merge pull request #235 from theirix/fix-overflow-oscar
Fixed overflow in Oscar
2016-07-26 10:37:36 +02:00
theirix 384dee1f95 Fail when Oscar family or type is 0 2016-07-25 18:24:45 +03:00
theirix 3e5033ff13 Fail when Oscar family is 0 2016-07-25 17:44:45 +03:00
theirix 01ac65eee4 Fail fast when Oscar family cannot be detected 2016-07-25 17:02:39 +03:00
Luca Deri da80bd8bb4 Added ndpi_get_proto_by_name() for mapping protocolIDs to protocol names
Added a new parameter to ndpi_guess_protocol_id() to indicate if the guessed protocol has been set by the user through a custom protocols file
2016-07-25 14:52:44 +02:00
theirix 470901dc58 Fixed overflow in Oscar 2016-07-25 15:23:44 +03:00
Michele Campus 32e6a79e9c Merge pull request #234 from theirix/fix-overflows
Fixed payload overflow in MQTT, DNS
2016-07-25 12:12:47 +02:00
theirix d1f0b56adc Fixed payload overflow in MQTT, DNS 2016-07-25 12:58:27 +03:00
Michele Campus 77fc4be458 Merge pull request #233 from theirix/fix-bgp
Fixed BGP payload overflow
2016-07-25 10:22:47 +02:00
theirix 3dec8d1880 Fixed BGP payload overflow 2016-07-25 11:19:00 +03:00
Michele Campus b102caf482 Merge pull request #232 from theirix/dns-int-overflow
Fixed integer overflow in DNS extensions
2016-07-25 10:05:47 +02:00
theirix 7ec9e78e4d Fixed integer overflow in DNS extensions 2016-07-25 10:04:39 +03:00
Campus b6237bc39d minor fixes hangout 2016-07-20 13:31:29 +02:00
Luca Deri 54935e4aa3 Removed un-necessary files 2016-07-20 01:41:26 +02:00
Luca Deri 18b9addc85 Implemented #228 2016-07-20 01:40:16 +02:00
Luca Deri abdccaa8eb Harvested some unused protocols 2016-07-20 00:28:32 +02:00
Luca Deri a93c83fe6b Added check on payload len (#227) 2016-07-12 16:05:49 +02:00
Luca 4fe8d350a2 Added fix to avoid IPv6 formatting differences across platforms 2016-07-12 00:38:07 +02:00
Simone Mainardi 72e3930e08 Fixes nDPI protocol initialization for Git
[NDPI] ndpi_init_protocol_defaults(missing protoId=226) INTERNAL ERROR: not all protocols have been initialized

This is actually a merge of branch 'dev' into 1.8-stable.
2016-07-08 15:23:45 +02:00
Simone Mainardi 31140c8da7 Fixes test cases for QUIC.Google 2016-07-08 15:03:40 +02:00
Luca Deri 47bb46176b Fix for #225 2016-07-05 19:07:16 +02:00
Campus 0e49eb1d17 added drda protocol - fix quic output after commit 87717dd77f 2016-07-02 18:29:02 +02:00
Luca Deri 87717dd77f Added QUICK subprotocol support 2016-06-30 17:03:36 +02:00
Luca Deri 6fb81f146e Refreshed DNS implementation 2016-06-27 11:19:47 +02:00
Campus ff6b193821 minor fixes - deleted useless part on git and quic protos 2016-06-24 13:45:43 +02:00
Campus 96623c0e4f Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2016-06-24 13:19:56 +02:00
Campus 0f089bd49a added git protocol dissector and pcap for test 2016-06-24 13:19:14 +02:00
Luca Deri b318d191a5 Removed variables not used 2016-06-23 23:53:03 +02:00
Luca Deri d0665bb301 Recomputed results due to the previous commit 2016-06-19 21:29:19 +02:00
Luca Deri adbba69988 Removed false positives from CoAP protocol
Improved DNS detection
Added misisng default DropBox port
Fix for #154
Added sample pcap of Tor traffic for regression testing
2016-06-19 21:25:58 +02:00
Luca Deri 539ab241cd Reverted https://github.com/ntop/nDPI/commit/392a14241fa68512099ea6096a640275461af7d0 that prevented Tor dissector to work 2016-06-19 20:48:05 +02:00
Luca Deri f18b7c5e14 Compilation fix 2016-06-15 06:04:07 +02:00
Luca Deri 19324f2904 Enhanced string boundary check to avoid crashes with malformed packets 2016-06-15 06:12:41 +02:00
Luca Deri 6c83cd627f Enhanced string boundary check to avoid crashes with malformed packets 2016-06-14 20:25:23 +02:00
Luca Deri ed09d78ed9 Added 1e100.net to Google 2016-06-12 21:01:59 +02:00
Luca Deri 0b7a392b30 Restored code harvested in
https://github.com/ntop/nDPI/commit/60e7e19dab72a37d57bc7854e702264e7d25886d#diff-0856ce19e6ed4e80946656d41f7edd65L135

DNS reply dissection can now be controlled by a preference as demonstrated in ndpiReader.c
2016-06-07 17:14:16 +02:00
Luca Deri 2379443ef5 Fix on multicast address check on teredo 2016-05-31 12:58:44 +02:00
Luca Deri 8c50b9692e Improved bigram detection (used by Tor) 2016-05-31 12:47:51 +02:00
Luca Deri 787be6ec08 Improved teredo detection by discarding packets sent towards multicast addresses 2016-05-31 12:32:47 +02:00
Luca Deri 72efa329db Enhanced fragments support in ndpiReader
Improved RX protocol dissection and removed port guess as it caused false positives.
2016-05-31 12:20:25 +02:00
Luca Deri a79b338208 Compilation fix due t pack/unpack 2016-05-30 09:09:00 +02:00
Luca Deri 08b2899676 Merge pull request #210 from mscherer/patch-1
Fix typo
2016-05-29 10:10:22 +02:00
Michael Scherer 074e489fe3 Fix typo 2016-05-29 10:09:07 +02:00
Luca Deri f8badefa90 Update homebrew 1.8 formula 2016-05-28 11:00:32 +02:00
Luca Deri d113f8db5a Moved to 1.8 release 2016-05-28 09:24:57 +02:00
Luca Deri db36040fe1 Merge pull request #207 from alagoutte/scan-build
ndpi_main: fix Value stored to 'saddr'/'daddr' is never read
2016-05-28 09:06:34 +02:00
Alexis La Goutte f0c1688b1b ndpi_main: fix Value stored to 'saddr'/'daddr' is never read
ndpi_main.c:3286:7: warning: Value stored to 'saddr' is never read
ndpi_main.c:3290:7: warning: Value stored to 'saddr' is never read
ndpi_main.c:3291:7: warning: Value stored to 'daddr' is never read
2016-05-26 19:52:25 +02:00
Campus 67d3c9e9c8 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2016-05-24 23:33:13 +02:00
Luca Deri ac664940da Merge pull request #206 from theirix/l4-api
Updated ndpi_l4_detection_process_packet
2016-05-24 23:32:53 +02:00
Luca Deri 8eb0829267 Merge pull request #205 from theirix/dns-overflow
Fixed dns buffer overflow
2016-05-24 23:31:54 +02:00
Campus f8ecdc004f added new fb detection - remove old bittorrent functions - fix rx warning 2016-05-24 23:28:43 +02:00
theirix c088672632 Synchronized ndpi_l4_detection_process_packet impl 2016-05-24 23:39:10 +03:00
theirix 552076a36c Fixed dns buffer overflow 2016-05-24 23:34:15 +03:00
Michele Campus a0fe6665b2 Merge pull request #203 from alagoutte/scan-build
fix warning found by Clang Analyzer (scan-build)
2016-05-24 22:04:33 +02:00
Michele Campus b05907f592 Merge pull request #204 from alagoutte/fix_warning
fix warning when use -Wdocumentation CFLAG (clang)
2016-05-24 16:54:13 +02:00
Alexis La Goutte bae6a09a7c ndpi_main(.c): fix Null pointer passed as an argument to a 'nonnull' parameter 2016-05-24 13:46:17 +02:00
Alexis La Goutte 8bc1ed7d86 ndpi_api(.h): fix '@return' command used in a comment that is attached to a function returning void [-Wdocumentation] 2016-05-24 13:19:53 +02:00
Alexis La Goutte 9935cb0e3b ndpi_util.c: fix The right operand of '+' is a garbage value 2016-05-24 08:12:36 +02:00
Alexis La Goutte 594f7074f7 ndpi_util: Value stored to 'fcs' is never read 2016-05-23 23:04:50 +02:00
Alexis La Goutte a6c9d33c09 ndpi_util: replace if / else by switch/case
Fix also
The left operand of '==' is a garbage value
Value stored to 'slarp' is never read
Value stored to 'cdp' is never read
2016-05-23 23:03:26 +02:00
Alexis La Goutte e0e1ed6936 rtcp: fix Value stored to 'sport'/'dport' is never read 2016-05-23 22:32:39 +02:00
Alexis La Goutte 7fb4b42092 bittorrent: fix Value stored to 'a' is never read 2016-05-23 22:30:47 +02:00
Alexis La Goutte 1b3055faef ndpi_main: fix Value stored to 'saddr'/'daddr' is never read 2016-05-23 22:21:50 +02:00
Alexis La Goutte cf905d0c7f FTP: fix Value stored to 'packet' during its initialization is never read 2016-05-23 22:19:05 +02:00
Luca Deri f084bbb6d0 Merge pull request #201 from alagoutte/scan-build
Fix missing break
2016-05-23 21:39:42 +02:00
Luca Deri a2843084d6 Merge pull request #200 from alagoutte/typo
Fix some typo
2016-05-23 21:38:36 +02:00
Alexis La Goutte 3d23ee0e23 RX: fix indent 2016-05-23 19:56:45 +02:00
Alexis La Goutte 92718c4def QUIC: fix typo 2016-05-23 19:56:45 +02:00
Alexis La Goutte e1d3a8ea7d QUIC: remove trailing whitespace 2016-05-23 19:56:45 +02:00
Alexis La Goutte 2f7a9bb789 Fix missing break 2016-05-23 08:01:51 +02:00
Luca Deri ef2cb860a3 Recodede QUIC from scratch to make it more robust and export SNI (server name) as with SSL/HTTP 2016-05-21 15:34:10 +02:00
Campus 1e37916156 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2016-05-17 23:44:05 +02:00
Campus f3fb445166 upgrade quic test pcap with version 33 2016-05-17 23:43:05 +02:00
Michele Campus ac55d8dd8b Merge pull request #193 from backer-and/dev
Fix QUIC
2016-05-17 23:40:01 +02:00
Andrea Buscarinu f517a6a373 Fix QUIC 2016-05-17 23:15:38 +02:00
Campus ccdcf9d82b added OpenDNS service 2016-05-17 18:28:54 +02:00
Campus b7863e2dc2 added Weibo service and pcap test 2016-05-13 01:05:13 +02:00
Campus 6edb280cc7 update test pcap due to modification of quic protocol - improved readability of code 2016-05-12 23:17:41 +02:00
Michele Campus 32847fcfd0 Merge pull request #190 from backer-and/dev
enhance/refactor quic.c
2016-05-12 22:53:41 +02:00
Luca 69bdc44441 Fix for invalid DNS reponse detection 2016-05-12 13:10:23 +02:00
Andrea Buscarinu 4d58e55781 enhance/refactor quic.c 2016-05-11 12:42:30 +02:00
Luca Deri 90843a4228 Merge pull request #188 from alagoutte/QUIC
Enhance QUIC support
2016-05-10 23:50:02 +02:00
Alexis La Goutte d233459195 QUIC: Remove a wrong heuritics
There is always the QUIC version on first frame
2016-05-10 22:21:50 +02:00
Alexis La Goutte 6dab2b8c62 QUIC: Fix trailing whitespace 2016-05-09 19:12:09 +02:00
Michele Campus 86893a2984 Merge pull request #187 from madpilot78/add_needed_symbols
Add symbols needed by ntopng to the shared library export list.
2016-05-09 13:22:23 +02:00
Guido Falsi 3618f066bb Add symbols needed by ntopng to the shared library export list. 2016-05-09 12:36:30 +02:00
Luca Deri 5c149e0363 Simplified ndpi_exit_detection_module() 2016-05-08 11:04:20 +02:00
Luca Deri 22e03ee98a Simplified nDPI initialization function 2016-05-08 10:55:46 +02:00
Luca Deri 18901ca4d6 Added wrappers for substring-search
ndpi_init_automa()
ndpi_free_automa()
ndpi_add_string_to_automa()
ndpi_finalize_automa()
ndpi_match_string()
set_ndpi_malloc()
set_ndpi_free()
2016-05-07 18:45:18 +02:00
Luca Deri d5f77e92f7 Fixed the travis link from master -> dev 2016-05-03 08:59:52 +02:00
Luca Deri d139c31972 Merge pull request #185 from alagoutte/QUIC
Fix test suite
2016-05-03 08:55:47 +02:00
Alexis La Goutte 53550d8bb4 Fix test suite
there is some change with IPv6 Address...
2016-05-03 08:00:57 +02:00
Alexis La Goutte 356f9914cc QUIC: fix test suite after typo change 2016-05-03 07:52:39 +02:00
Luca Deri 6e57c4618e Merge pull request #184 from alagoutte/QUIC
Enhance QUIC support
2016-04-29 11:34:32 +02:00
Alexis La Goutte 9b0bef50de QUIC: fix typo the protocol name is QUIC (and not Quic) 2016-04-29 09:25:28 +02:00
Alexis La Goutte c957a12742 QUIC: last version of QUIC is Q033
Look Recent Changes by Version from QUIC Wire Layout Specification
2016-04-29 09:21:42 +02:00
Campus 1b9aa2ab71 fixed rx protocol for better logic conditions 2016-04-26 18:49:52 +02:00
Campus 1d17ece9ce fix missing conditional and 2016-04-26 15:02:32 +02:00
Campus 34ce35dcfa minor fix makefile 2016-04-26 14:20:23 +02:00
Campus f66cfca2a9 fixed and improved rx protocol detection - there was error on detection when -d option was enabled 2016-04-26 13:48:43 +02:00
Campus 7c1e8ba2bf rework some stuffs - added missing comments on functions 2016-04-24 23:43:22 +02:00
Luca Deri e23446389c Reworked https://github.com/ntop/nDPI/commit/8a4c15ecf5c5c1430e8047324a5e336db2f503f1 to avoid adding (un-needed) pcap dependency in nDPI core 2016-04-24 23:17:18 +02:00
Luca Deri 8cb6172e4b Added #include <sys/types.h>
https://github.com/voidlinux/void-packages/blob/master/srcpkgs/ndpi/patches/types.patch
2016-04-24 22:59:05 +02:00
Luca Deri d427647ce7 Firxed warnings 2016-04-24 10:35:54 +02:00
Luca Deri 8a4c15ecf5 Merge pull request #180 from emanuele-f/dev
High level API and ndpiReader simplification
2016-04-24 10:29:26 +02:00
Luca Deri 1be9194734 Code hardening for #181 2016-04-21 12:04:33 +02:00
emanuele-f 792d2fc79a Remove floating stack pointer causing segmentation fault 2016-04-20 16:20:50 +02:00
emanuele-f 5386aede36 Integrate root flows free and little changes 2016-04-20 15:36:44 +02:00
emanuele-f 4e1317cd0f Fix inline travis complaining 2016-04-20 02:23:37 +02:00
emanuele-f 9ee6442004 Other util API stuff 2016-04-20 01:32:01 +02:00
emanuele-f 6f84b85358 Use calloc to force 0 initialization 2016-04-20 00:03:21 +02:00
emanuele-f d7548e72b2 Fix some issues 2016-04-19 23:35:35 +02:00
emanuele-f 7964e11c7f Add header stuff 2016-04-19 22:39:19 +02:00
emanuele-f a4d0af1f96 Move relevant functions to ndpi_util API module 2016-04-19 22:35:18 +02:00
emanuele-f 282bc16243 add malloc wrapper TODO 2016-04-19 22:19:06 +02:00
emanuele-f 4ba106a525 Change confusing "ndpi_flow" structure name to "ndpi_flow_info" 2016-04-19 19:25:42 +02:00
Michele Campus 1d54092c7d Merge pull request #177 from giomasce/dev
Support RX protocol (used by AFS).
2016-04-16 18:03:26 +02:00
Giovanni Mascellani 4b50045ecd Add file license. 2016-04-15 16:41:23 +02:00
Giovanni Mascellani a6e715f574 Add RX testcase. 2016-04-15 15:47:39 +02:00
Giovanni Mascellani 18f5362a34 Support RX protocol (used by AFS). 2016-04-15 15:21:02 +02:00
Michele Campus a71f525a2b Merge pull request #175 from theirix/reader-asan-2
Combined ASAN overflow detection and buffer modify
2016-04-13 11:06:32 +02:00
theirix efae85de84 Combined ASAN overflow detection and buffer modify
Combined approach from pull request #172 and commit 6a63ea4.
2016-04-13 11:42:59 +03:00
Michele Campus da811fbdd0 Merge pull request #173 from theirix/buffer-overflows
Fixed multiple buffer overflows
2016-04-12 23:41:02 +02:00
theirix d7a2515093 Fixed oscar buffer overflow 2016-04-12 22:26:10 +03:00
Luca Deri 885cc3864e Merge pull request #172 from theirix/reader-asan
Allocate exact-size buffer with address sanitizer
2016-04-12 21:22:38 +02:00
theirix c22d3d3cae Fixed more buffer overflows with small packets 2016-04-12 22:14:13 +03:00
theirix fb3fc0c6de Fixed buffer overflows with safe str search
1. Detected a lot of memory errors using address sanitizer
and ndpi-scapy tool.

2. Added ndpi_match_prefix function that compares strings
with taking care of payload packet len. Almost drop-in
replacement for match_first_bytes function.

3. Replaced unsafe match_first_bytes usage with a ndpi_match_prefix
and additional length checks.
2016-04-12 22:08:30 +03:00
theirix 624f61193c Allocate exact-size buffer with address sanitizer
Allows address sanitizer to detect buffer overflow by
using special packet buffer when compiled with address sanitizer
support (autodetected clang and gcc).
2016-04-12 22:04:47 +03:00
Luca Deri 5a37ee9976 Removed some Tor false positives (more work necessary) 2016-04-06 09:45:38 +02:00
Luca Deri 6a63ea46a4 Added check for alerting when nDPI modified packet payload (should not happen) 2016-04-04 21:40:23 +02:00
Campus f437fac412 fix for test pcap and output 2016-04-04 00:15:57 +02:00
Michele Campus afea67e303 Merge pull request #170 from srzamfir/dev
Mqtt dissector fix
2016-04-04 00:12:13 +02:00
Campus 3d46f3df61 fixed wrong dropbox detection 2016-04-04 00:10:43 +02:00
Michele Campus 697617622c Merge pull request #169 from theirix/build-json-c
Improved autogen.sh, json-c search
2016-04-03 23:58:51 +02:00
Sorin Zamfir 7e9e3903d8 Included test result for CoAP and Mqtt. 2016-04-03 15:05:38 +03:00
Sorin Zamfir 7b66fcff37 Merge remote-tracking branch 'upstream/dev' into dev 2016-04-03 14:45:39 +03:00
Sorin Zamfir 40b219c397 Fixed false positives on skype and KakaoTalk. Tests run smooth now. 2016-04-03 14:16:18 +03:00
Sorin Zamfir b5e74ee3f1 Solved invalid detection on tests. Needs further work to detect one of the flows.
Please enter the commit message for your changes. Lines starting
2016-04-03 02:00:36 +03:00
theirix 6f95182751 Improved detection of json-c package.
- Improved detection code for json-c package to use pkg-config
  with custom search path that includes /usr/local
- Added optional option --disable-json-c to disable json-c package for
  reducing runtime dependencies.
2016-04-01 17:18:33 +03:00
theirix 41d7430442 Call configure with args from autogen 2016-04-01 17:18:23 +03:00
Campus aa86387ba9 improved Microsoft detection (minor fix) 2016-04-01 02:17:58 +02:00
Campus 2a1f44610f improved Microsoft detection 2016-04-01 02:11:51 +02:00
Campus 4704f48daa minox fix dns 2016-03-29 15:07:16 +02:00
Campus 8dacc91d51 fixed dns check host name server 2016-03-29 15:04:15 +02:00
Campus a594273989 fixed coap.c and dropbox.c after detecting wrong detection - added test for dropbox 2016-03-29 00:05:56 +02:00
Campus d9264e415c fixed and improved bittorrent detection for issue https://github.com/ntop/nDPI/issues/164 2016-03-27 01:39:38 +01:00
Luca Deri b3df389bd6 Removed WinMX reference from Makefile 2016-03-23 08:46:24 +01:00
Campus 2998b78797 deleted winmx protocol due to abandoned development since July 2, 2004 2016-03-23 01:27:36 +01:00
Campus 46a526ce26 deleted mqtt.c 2016-03-23 00:35:22 +01:00
Campus 95fffec172 fix for pull request https://github.com/ntop/nDPI/pull/161 2016-03-20 16:10:26 +01:00
Michele Campus 323912371e Merge pull request #161 from srzamfir/dev
Add CoAP and Mqtt (IoT specific protocols) dissectors
2016-03-20 15:51:11 +01:00
Sorin Zamfir 3213d2205a Removed unused type definitions.
Disabled tracing in the example application.
2016-03-20 13:38:29 +02:00
Sorin Zamfir 3dde80ed0f Included test file for coap and mqtt dissectors. 2016-03-20 12:12:42 +02:00
Sorin Zamfir 6f428c03e2 Merge remote-tracking branch 'remotes/iot/dev' into dev
Conflicts:
	src/include/ndpi_protocol_ids.h
	src/lib/ndpi_main.c
2016-03-20 11:53:27 +02:00
Sorin Zamfir 2d5d39db7b Updated with mqtt callbacks. 2016-03-20 11:22:04 +02:00
Sorin Zamfir 28806f3187 Minor changes to a comment 2016-03-19 20:50:38 +02:00
Luca Deri 5349d33abf Fixed unitialized variable 2016-03-19 14:10:26 +01:00
Campus a499da00ba added tcp port 51413 for TCP BT detection 2016-03-19 01:18:48 +01:00
Luca Deri a4d9c8cc3b Fix for https://github.com/ntop/nDPI/issues/159 2016-03-18 11:00:11 +01:00
Luca Deri 27d09c33ce Fix for invalid DNS dissection that caused packet corruption 2016-03-17 08:28:24 +01:00
Campus 5b86186e85 deleted old and not yet good skype ip addr - added new Netflix and CloudFlare IP addr 2016-03-16 10:47:35 +01:00
Campus 3b399f62f4 improved Skype detection - redized Viber pcap for test 2016-03-15 15:03:06 +01:00
Campus 7c511fb2f2 add new detection of Viber (service) 2016-03-15 00:56:09 +01:00
Campus 4370781b49 rework API (part 1) - minor fixes functions 2016-03-14 01:04:50 +01:00
Luca Deri 1cf4926b4e Enhanced Google detection 2016-03-13 21:30:21 +01:00
Campus 7ae06a114d added check_punycode_string for issue https://github.com/ntop/nDPI/issues/157 2016-03-10 11:44:24 +01:00
Campus 8321b2fa66 added support for MS_OneDrive service 2016-03-08 01:49:48 +01:00
Luca Deri ba966634f5 Source code rename to avoid conflicts on Windows 2016-03-06 18:52:43 +01:00
Luca Deri dd12757493 Added check to harden code 2016-03-05 08:22:04 +01:00
Luca Deri 7ea37edfbf Improved protocol detection 2016-03-04 22:13:37 +01:00
Luca Deri 462368f959 Added new ndpi_detection_giveup() API call to call before giving up for a given flow
Code cleanup
2016-03-04 19:15:13 +01:00
Michele Campus 73833e0ef0 Merge pull request #153 from Timothyyy/dev
protocols: sip CANCEL packet detection fix
2016-03-02 11:54:05 +01:00
Timothy 7d699ade0c protocols: sip CANCEL packet detection fix 2016-03-02 11:04:36 +03:00
Luca bc52b8f310 Changed label case 2016-02-29 23:22:34 +01:00
Luca ecb8d117ac Reworked sockets support
Fixed TFTP support
2016-02-29 17:23:05 +01:00
Luca Deri ead8c4933e Removed VEOHTV protocol and replaced with HTTPDownload
Fixed bug that prevented content type to be properly detected
2016-02-28 23:19:13 +01:00
Luca Deri 20374b542d Fixed warning
Reworked protocol initialization
2016-02-27 09:00:02 +01:00
Campus 6df31099c2 typo fixed 2016-02-26 20:48:14 +01:00
Luca Deri b7e2d8f019 Minor BT optimization 2016-02-25 10:25:03 +01:00
Luca Deri 80a35226c5 Improve BT-uTP protocol dissection 2016-02-25 09:58:23 +01:00
Luca Deri e025d696f6 Added trace for BitTorrrent u-TP 2016-02-25 08:31:59 +01:00
Sorin Zamfir 245ca20eea Fixed the bug. Damn comparison. 2016-02-20 00:15:09 +02:00
Sorin Zamfir 8f60ad8874 We have a bug :(. 2016-02-19 21:18:28 +02:00
Sorin Zamfir d18a1edb67 Functional mqtt 2016-02-19 20:22:54 +02:00
Sorin Zamfir a8050635fa Improved Mqtt detection. 3 messages remain for identification 2016-02-19 19:55:03 +02:00
Campus 33fa1989bc improved netflix and amazon cloud detection 2016-02-19 02:00:23 +01:00
Sorin Zamfir 7d3ab6d0b4 Some filtering applied. Not yet functional. 2016-02-18 21:36:06 +02:00
Sorin Zamfir 237102b5f2 First draft of the Mqtt dissector. 2016-02-18 20:29:41 +02:00
Campus 407b4fd1d5 improved facebook detection adding host name match 2016-02-18 00:43:43 +01:00
Campus 882cbd8b4e Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2016-02-18 00:30:02 +01:00
Campus 4c3d9788dd added missing free for idle flow in ndpiReader.c 2016-02-18 00:29:06 +01:00
Luca Deri 59c65118e1 Updated readme 2016-02-17 10:58:52 +01:00
Campus 84976ed5dc fix for https://github.com/ntop/nDPI/issues/148 2016-02-16 12:23:56 +01:00
Luca Deri 15ccb70ae6 Improved WhatsAppVoice detection 2016-02-15 22:16:39 +01:00
Luca Deri e1481f3a90 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2016-02-15 12:00:56 +01:00
Luca Deri 01413c8d9f Disabled list of skype hosts: it looks outdated 2016-02-15 11:55:21 +01:00
Campus 392a14241f fixed ssl/tor bug for https://github.com/ntop/nDPI/issues/147 2016-02-15 11:02:40 +01:00
Luca Deri 16a5c6995c Added ability to extract BitTorrent hash (and eventually peerId) 2016-02-15 09:57:26 +01:00
Campus c7334e7c56 added cloudflare service - minor fixes for test pcap 2016-02-14 19:38:30 +01:00
Luca Deri cc4ceb88a0 Fix for #143 2016-02-12 22:07:37 +01:00
Sorin Zamfir 7ee464709b Functional dissector. Guestimative. 2016-02-11 23:55:21 +02:00
Sorin Zamfir ee5e7449ac First running example. No actual low-level detection.
* logging is now running
* included example capture
* included example log
* skeleton for coap detection
2016-02-08 23:01:22 +02:00
Sorin Zamfir 278a067d43 First skeleton for Coap dissector. 2016-02-07 19:29:30 +02:00
Luca e9f7df081f Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2016-01-21 16:33:20 +01:00
Luca d0b83a7196 Minor change to ndpi_protocol2name() 2016-01-21 13:52:52 +01:00
Luca bc48b770de Added ndpi_automa_match_string_subprotocol call
Fixed DNS dissector decoding bug
2016-01-21 13:25:55 +01:00
Campus e7cb3d324a fixed wrong dns detection for host name server that invalidated test pcaps 2016-01-12 17:21:04 +01:00
Luca Deri 0f3222e489 Fixed compilation errors due to previous commit 2016-01-06 18:11:57 +01:00
Luca Deri a08a0077e6 Hardened DNS dissector 2016-01-06 17:38:41 +01:00
Campus 5336aecde7 added ip range feature for file loaded with -p option to support custom protocols specified 2015-12-31 17:07:22 +01:00
Michele Campus a2c51a586e Merge pull request #132 from pavel-odintsov/dev
Made ndpi memory allocator type compatible with C++ on x686 platforms
2015-12-31 10:27:54 +01:00
Campus 3aa506eb1b added Office 365 URLs and IP address ranges (part 1) 2015-12-29 19:41:15 +01:00
Campus 60e7e19dab wrote new dns dissector - deleted useless part of dns to slim data structures used in nDPI and ntopng 2015-12-29 18:17:52 +01:00
Pavel Odintsov 1b2702df24 Made ndpi memory allocator type compatible with C++ on x686 platforms. Switch from unsigned long to size_t as allocation functions parameter. 2015-12-28 14:08:57 +03:00
Campus 6d37ee2970 added Google server address range 2015-12-24 00:26:31 +01:00
Campus 2aa007fbad Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2015-12-24 00:17:26 +01:00
Campus bfded90875 added OCS service and related pcap for testing 2015-12-24 00:16:33 +01:00
Luca e0c6d80c09 Fix for #131 2015-12-18 11:53:01 +01:00
Campus 237de95285 fixed makefile include header ndpi_includes.h 2015-12-13 17:21:47 +01:00
Luca Deri 357d8c98a3 Merge pull request #128 from lmangani/dev
minor fix for tests after d2c355bdb0
2015-12-10 10:24:25 +01:00
Lorenzo Mangani 5f40394501 minor fix for tests 2015-12-10 00:07:37 +01:00
Luca 41c6d2d031 Improvement for Dropbox detection
Fix for #124
2015-12-08 00:32:30 +08:00
Luca d2c355bdb0 Enhanced QQ support 2015-12-08 00:19:13 +08:00
Luca Deri 6f3d5a7b33 Win fixes 2015-11-30 14:38:16 +01:00
Luca Deri 34491f4be1 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2015-11-30 14:22:01 +01:00
Luca Deri 34e0a74c07 Win fixes 2015-11-30 14:21:50 +01:00
Campus 587f156557 reorganized header files - added ndpi_includes.h 2015-11-30 12:37:15 +01:00
Luca Deri f04c3c6acb Minor fix 2015-11-27 00:29:19 +01:00
Luca Deri 80171b7c54 Removed warning 2015-11-26 23:53:21 +01:00
Luca Deri cb68d4d00a Win32 compilation fixes 2015-11-26 23:47:55 +01:00
Luca Deri 98ef945d2e fixes for packing datastructures 2015-11-26 19:46:51 +01:00
Campus 12b47fece0 fixed missed library netinet/in.h under FreeBSD 2015-11-26 12:32:15 +01:00
Luca Deri bfb44934b7 Fixed IPv6 HTTPs support 2015-11-23 10:08:44 +01:00
Luca Deri 08ca34f5d0 Fix for #119 2015-11-23 10:07:19 +01:00
Luca Deri a46c12c014 Fixed string offset 2015-11-22 23:28:50 +01:00
Luca Deri d24093c4a6 Improvements on netbios name detection 2015-11-22 23:13:50 +01:00
Campus ec034da5c9 fixed potential buff overflow with sizeof control 2015-11-19 20:18:37 +01:00
Campus d5b9e4ccd5 fixed wrong output 6in4tunnel after updates in nDPI 2015-11-19 20:10:46 +01:00
Luca Deri 169c837613 Fix for https://github.com/ntop/nProbe/issues/7 for wrong RTP identification 2015-11-18 10:46:58 +01:00
Luca 33f38dd437 Added ndpi_l4_detection_process_packet function 2015-11-17 14:16:09 +01:00
Simone Mainardi bd7004ecd7 Fixes #116, adds extra #ifndef to prevent redefinitions
Extra #ifndef directives are added to prevent possible redefinitions
of __LITTLE_ENDIAN__ and __BIG_ENDIAN__
2015-11-15 22:44:06 +01:00
lucaderi 8babee0efb Fix for CentOS6 2015-11-12 16:25:12 +01:00
Luca a407da79a9 Update ndpi_ethernet definition 2015-11-12 15:32:44 +01:00
Luca 8399afa607 Removed legacy linux_compat.h file
Updated IPv6 address dump format
2015-11-12 15:23:00 +01:00
Luca 68091c7cdb Added missing prototype 2015-11-12 15:11:28 +01:00
Luca e62be406ce Added missing ndpi_detection_get_sizeof_ndpi_flow_struct(), ndpi_detection_get_sizeof_ndpi_id_struct() functions 2015-11-12 15:09:49 +01:00
Michele Campus dd3a79dac2 Merge pull request #114 from kYroL01/dev
Refactoring nDPI
2015-11-12 14:57:02 +01:00
Campus a4f170604c removed kernel support and #if 0s 2015-11-12 12:08:41 +01:00
Campus 349e0b6fd2 other changes related to refactoring, including Makefile.am modifications 2015-11-12 10:43:32 +01:00
Campus 78eceb43a1 deleted useless or not used functions and #ifdef 2015-11-10 01:12:00 +01:00
Campus 0cd8d939f1 deleted useless header 2015-11-09 14:36:49 +01:00
Campus 9fa2c7404f fixed mdns and tcp/udp protocols after changes 2015-11-09 13:44:23 +01:00
Campus 8cd0a8838a fixing ndpiReader.c after previous changes 2015-11-09 13:39:33 +01:00
Campus d92ffa6771 initial refactoring nDPI - typedef defined only in ndpi_typedef.h 2015-11-09 13:36:35 +01:00
Michele Campus 63cab68a96 Merge pull request #111 from xumjbn/dev
fix dissector QQ unkown bug
2015-10-27 10:33:05 +01:00
xumjbn f6eb2724e2 fix dissector QQ unkown bug 2015-10-28 15:07:26 +08:00
Luca Deri fc6980e0c9 Fix for #86 2015-10-26 13:43:38 +01:00
Luca Deri 7a95a21e09 Fix for #110 2015-10-26 13:21:39 +01:00
Luca Deri 8edd628973 Minor core reorganization 2015-10-26 01:34:39 +01:00
Luca Deri 50e7e959fe Updated test result 2015-10-25 23:26:03 +01:00
Luca Deri b5f70d02b2 Fixed IPv6-in-IPv4 implementation 2015-10-25 23:23:51 +01:00
Luca Deri 76c2fb3de7 Removed linux kernel support 2015-10-24 12:47:23 +02:00
Campus 27ea5c0026 added 6in4 tunneling pcap for test 2015-10-23 17:15:28 +02:00
Campus 59d0af33b8 added support for 6in4 tunneling in ndpiReader.c 2015-10-23 17:14:03 +02:00
Luca Deri 25631a25f7 Implemented MS Lync support 2015-10-22 00:32:48 +02:00
Luca ac9b4f8135 Removed non IP traffic to shrink pcaps 2015-10-20 16:20:59 +02:00
Campus 46694ece47 added new BGP pcap for detection of Cisco datalink layer 2015-10-19 01:58:03 +02:00
Campus 74b016c8b6 fixed BGP detection - added BGP pcap with Cisco hDLC and Cisco SLARP 2015-10-19 01:54:41 +02:00
Campus 7242b08609 deleted useless header 2015-10-16 19:28:53 +02:00
Campus ee0954c8cb Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2015-10-16 17:49:29 +02:00
Campus fd9f4753bb added cisco hdlc datalink type - fix MPLS header - added BGP pcap with cisco hdlc & MPLS header 2015-10-16 17:48:38 +02:00
Luca Deri dc9ad66fe2 Windows changes 2015-10-15 12:44:51 +02:00
Luca Deri 247acce949 Simplified IPv6 typedefs 2015-10-12 09:15:02 +02:00
Luca Deri 91b2e0bff2 Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2015-10-12 01:17:19 +02:00
Luca Deri 17ad351386 Changed to make sure IPv6 defines are properly defined 2015-10-12 01:16:28 +02:00
Luca Deri 72eafff843 Improvements for NetFlix detection 2015-10-11 22:27:03 +02:00
Luca Deri 4ec03b7e87 Added TZSP encapsulation support 2015-10-11 18:35:51 +02:00
Luca Deri 88d466e58e Added fix for Webex protol detection 2015-10-11 17:55:56 +02:00
Luca Deri cf2c59b1d7 Fixed travis link 2015-10-11 17:44:41 +02:00
Luca 93f02c08dc Fixed invalid indexes used in SMTP dissector.
See https://github.com/ntop/nDPI/commit/8c4fada42f8e6dcba42281fdc129e0a32b6050dc#commitcomment-13685139
2015-10-09 15:03:10 +02:00
Michele Campus efac255821 Merge pull request #101 from Tomasu/dev
NDPI_PROTOCOL_KAKAOTALK_VOICE was used instead of NDPI_SERVICE_KAKAOT…
2015-10-08 13:27:57 +02:00
Thomas Fjellstrom 06515b43d8 NDPI_PROTOCOL_KAKAOTALK_VOICE was used instead of NDPI_SERVICE_KAKAOTALK_VOICE 2015-10-08 05:04:16 -06:00
Luca 0e436e66de Reworked copyright to give credit to the developer 2015-10-06 16:24:03 +02:00
Luca Deri 3f2eec75c7 Merge pull request #98 from Tomasu/dev
Add Ubiquity AirControl 2 protocol detector
2015-10-06 16:09:59 +02:00
Thomas Fjellstrom 6519a1e326 add ndpi_malloc, ndpi_calloc and ndpi_set_detected_protocol to list of exported symbols 2015-10-04 20:04:39 -06:00
Thomas Fjellstrom a2ff20990c remove traces of DHCP detector from ubntac2.c 2015-10-04 19:53:25 -06:00
Thomas Fjellstrom 0a6d43c5f6 Add Ubiquity AirControl 2 protocol detection 2015-10-04 19:50:47 -06:00
Thomas Fjellstrom 64a368dd8e add Ubiquity AirControl 2 protocol detection 2015-10-04 19:48:26 -06:00
Campus 1dc03d5741 added radio tap header identification for ieee802.11 packets 2015-10-04 14:00:47 +02:00
Luca Deri e5c2fee022 Travis logo changes 2015-10-03 08:34:18 +02:00
Lorenzo Mangani 00bfba1d77 Update README.md 2015-09-29 01:04:46 +02:00
Luca Deri 76c963a70c Added support for pfring_config 2015-09-23 15:53:01 +02:00
valentina f78f6b59cc Added some tags in order to recognize ebay 2015-09-23 00:53:25 +02:00
Luca Deri faf3c81be3 Merge pull request #96 from mgigante/dbg_mgigante_freebsd81
Remove duplicated function declarations
2015-09-22 16:11:14 +02:00
Marco Gigante a994722bb1 Remove duplicated function declarations 2015-09-22 15:25:09 +02:00
valentina b383475282 Fixed DCE_RPC protocol when the port is different to default port (135) 2015-09-20 23:22:48 +02:00
Luca Deri ce7866a6a6 Added missing symbols
ndpi_get_lower_proto
ndpi_is_proto
2015-09-04 09:00:00 +02:00
Lorenzo Mangani 0dfd6d3986 Merge pull request #92 from lmangani/dev
Added HEP protocol detection support (sipcapture)
2015-09-01 18:11:52 +02:00
Lorenzo Mangani 50757e7afe Remove HEP2 match 2015-09-01 10:02:27 +02:00
Lorenzo Mangani df64a1069e Added HEP protocol detection support (sipcapture) 2015-08-30 23:07:31 +02:00
Luca Deri 9450226675 Merge pull request #91 from rs-dev/steam_NDPI_PARSE_PACKET_LINE_INFO
Make sure packet->user_agent_line.ptr is up to date before using it.
2015-08-30 22:42:33 +02:00
Martin Natano 8f8052735c Make sure packet->user_agent_line.ptr is up to date before using it.
Otherwise we might dereference a stale pointer.
2015-08-28 14:49:51 +02:00
Luca Deri aa6640e1c0 Merge pull request #84 from bcronje/dev
Ensure usage of struct in_addr is in network byte order.
2015-08-27 08:45:05 +02:00
Beyers Cronje 5f1b82d696 Ensure usage of struct in_addr is in network byte order.
Closes issue #81
2015-08-27 01:18:32 +02:00
Luca Deri 19e96f7dd2 Fixes #83. Critical fix: due to an invalid endianess conversion some protocol were not properly indetified 2015-08-26 16:09:24 +02:00
Luca Deri 591d6df489 Merge pull request #80 from bcronje/dev
Do not write to packet.iph, which should be readonly.
2015-08-26 01:18:45 +02:00
Beyers Cronje 8fe318495f Do not write to packet.iph, which should be readonly.
Resolves issue #77
2015-08-26 00:49:01 +02:00
Luca Deri 569c055389 Fir for #79 2015-08-26 00:29:18 +02:00
Luca Deri 26ce076f61 Merge pull request #76 from alagoutte/wdoc
Fix warning when use -Wdocumentation (Clang CFLAG)
2015-08-18 15:20:24 +02:00
Alexis La Goutte 07c7d63d44 Fix warning when use -Wdocumentation
src/include/ndpi_api.h:73:13: error: parameter 'ndpi_malloc' not found in the function declaration [-Werror,-Wdocumentation]
src/include/ndpi_api.h:91:13: error: parameter 'cache' not found in the function declaration [-Werror,-Wdocumentation]
src/include/ndpi_api.h:92:13: error: parameter 'cache' not found in the function declaration [-Werror,-Wdocumentation]
ndpiReader.c:152:22: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
ndpiReader.c:153:36: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
ndpiReader.c:156:39: error: not a Doxygen trailing comment [-Werror,-Wdocumentation]
2015-08-18 14:44:05 +02:00
Luca Deri 0a4c8e2959 Moved to 1.7.1 development branch 2015-08-18 11:58:57 +02:00
Luca Deri 5352c34ba5 Updated homebrew formula for 1.7 release 2015-08-18 11:58:23 +02:00
Luca Deri 41fcb7b1c1 Warning fix 2015-08-18 11:02:29 +02:00
Luca Deri a0bef995b6 Initial work for supporting HotspotShield VPN detection 2015-08-13 12:44:47 +02:00
Luca Deri d6b5d8e2c2 Added teredo protocol support. Fixed #74 2015-08-07 15:56:03 +02:00
Luca Deri 449742e69d Fixed a bug in the STUN dissector courtesy of Asher Yermiyahu
Fixed a bug in the NetFlow dissector that caused flows to be wrongly decoded as Netflow
Updated test results for starcraft and whatsapp
2015-08-03 14:35:31 +02:00
Luca Deri bc786b48fa Merge pull request #73 from c4stan/dev
battle.net removed
2015-07-30 14:33:52 +02:00
m.bracci 506b4e5f81 battle.net removed
battle.net removed, fixed a typo
2015-07-30 14:04:25 +02:00
Luca Deri 8365b127f2 Merge pull request #72 from pavel-odintsov/dev
Enhance NTP support, add protocol version identification; Add pcap ex…
2015-07-29 16:18:19 +02:00
Pavel Odintsov 471ea81594 Enhance NTP support, add protocol version identification; Add pcap examples for NTPv2, NTPv3, NTPv4; Fix bug with identification of NTP monlist packets as QUIC 2015-07-29 14:19:32 +03:00
Luca Deri b0ac39fe28 Various Instagram enhancements 2015-07-27 23:25:47 +02:00
Luca Deri aced1e9673 Improvements to WhatsApp voice 2015-07-25 10:13:47 +02:00
Luca e37be3b43d Fix to limit STUN to UDP only 2015-07-22 16:51:39 +02:00
Luca 6648d19239 Minor starcraft/WoW code cleanup 2015-07-21 17:30:47 +02:00
Luca Deri 8d8a204519 Cleaned up starcraft protocol code
Fixed false-positive in Skype dissector
2015-07-21 14:10:50 +02:00
Luca Deri 2ab10ec9b7 Merge pull request #66 from c4stan/dev
Starcraft 2/Battle.net support
2015-07-21 13:25:46 +02:00
Matteo Bracci 0ce34f341e Update starcraft2.c
Removed debug leftovers
2015-07-20 12:55:14 +02:00
Michele Campus 0d68f8ab5d added free for flow in get_ndpi_flow - deleted dead part in ndpi_typedef.c 2015-07-19 01:21:37 +02:00
Matteo Bracci 3ea5f2f0a6 Update ndpi_protocol_ids.h 2015-07-17 19:00:36 +02:00
Matteo Bracci 912c160ad3 Update ndpi_typedefs.h 2015-07-17 18:50:21 +02:00
Matteo Bracci d9745a2e2c Update ndpi_protocol_ids.h 2015-07-17 18:48:05 +02:00
Matteo Bracci deb96d83d3 Update ndpi_protocol_ids.h 2015-07-17 18:47:50 +02:00
Matteo Bracci e5f3d21f81 Update ndpi_protocol_ids.h 2015-07-17 18:47:31 +02:00
Matteo Bracci eb49f15453 Update ndpi_protocol_ids.h 2015-07-17 18:47:00 +02:00
Matteo Bracci 5165102f81 Update world_of_warcraft.c
Commented the first part of the dissector, as it steals traffic from other Battle.net based protocols.
2015-07-17 18:43:32 +02:00
Matteo Bracci d215d6d861 Update ndpi_protocols.h 2015-07-17 18:42:42 +02:00
Matteo Bracci 0739b577d4 Update starcraft2.c
starcraft2
2015-07-17 15:30:34 +02:00
Matteo Bracci c62e8dadb6 Update ndpi_main.c
starcraft2
2015-07-17 13:53:31 +02:00
Matteo Bracci e29bd2270f Update ndpi_content_match.c.inc
starcraft2
2015-07-17 13:44:50 +02:00
Matteo Bracci aa4bdebf40 Update starcraft2.c 2015-07-17 13:40:35 +02:00
Matteo Bracci 5f460c95cc Create starcraft2.c 2015-07-17 13:38:41 +02:00
Luca Deri 73358d5ec2 Added check for removing characters from nDPI custom-defined protocols that might cause apps to misbehave. 2015-07-16 21:01:30 +02:00
Luca Deri e98108a8be Updated guide courtesy of Sudeepta Bhuyan (#62) 2015-07-14 00:18:39 +02:00
Luca 5af906ad83 Enhanced FTP_DATA recognition (issue #28) 2015-07-13 16:41:51 +02:00
Luca 1d711d849d Added fix for #31 2015-07-13 16:16:58 +02:00
Luca 0b7af2dbbc Fixes for #27 2015-07-13 15:34:47 +02:00
Michele Campus 9d1e99ad0a added Oscar test 2015-07-13 15:01:51 +02:00
Luca Deri f948e76c45 Merge pull request #65 from kYroL01/dev
fixed Oscar family_type
2015-07-13 15:01:11 +02:00
Michele Campus e3e8b5c6e4 fixed Oscar protocol dissector (4) 2015-07-13 01:05:57 +02:00
Michele Campus e4f4cfb1de fixed Oscar protocol dissector (4) 2015-07-13 01:02:23 +02:00
Luca Deri 085d7f0ed4 Removed warnings
Added instagram to the list of tests
2015-07-13 00:05:04 +02:00
Luca Deri f3105f6c81 Merge pull request #64 from backer-and/dev
Added Instagram detection service
2015-07-12 23:54:59 +02:00
backer-and 5c55b970c6 Added Instagram pcap file 2015-07-12 23:38:55 +02:00
backer-and cad7e541b6 Added Instagram detection
Detected "instagram.c10r.facebook.com" host.  Omitted "*amazonaws.com",
"*akamai.com" and "*facebook.com" CDNs e.g. "a1408.dspw43.akamai.net"
2015-07-12 23:15:43 +02:00
Luca Deri 312c7ce1af Merge pull request #63 from kYroL01/dev
Fixed Oscar protocol dissector
2015-07-12 23:05:41 +02:00
backer-and c354ff85a6 Added Instagram as last implemented protocol 2015-07-12 22:49:24 +02:00
Luca fc12541e8a Added word version of the manual 2015-07-12 20:38:41 +02:00
Michele Campus e178653f48 fixed Oscar protocol dissector (3) 2015-07-12 18:30:08 +02:00
Michele Campus 05f2eb6270 fixed Oscar protocol dissector (2) 2015-07-12 18:03:44 +02:00
Michele Campus 0307c85bd3 fixed Oscar protocol dissector 2015-07-12 17:51:21 +02:00
Luca 71ed576e18 Fixed #46 (Deezer support) 2015-07-11 18:54:55 +02:00
Luca 2f347a33d8 Fixes for issues #40 -> #52
Implemented sub-protocol detection for SSL/HTTP/HTTPS
2015-07-11 16:04:58 +02:00
Luca Deri 436af982fd Merge pull request #60 from kYroL01/dev
fixed upper/lower name and init_non_tcp_udp_dissector
2015-07-09 00:29:03 -07:00
Michele Campus 1dd0c912c7 fixed upper/lower name and init_non_tcp_udp_dissector 2015-07-09 00:00:27 +02:00
Michele Campus 824c5f82d3 Merge remote-tracking branch 'upstream/dev' into dev
Conflicts:
	src/include/ndpi_protocols.h
	src/lib/ndpi_main.c
	src/lib/protocols/afp.c
	src/lib/protocols/aimini.c
	src/lib/protocols/applejuice.c
	src/lib/protocols/armagetron.c
	src/lib/protocols/ayiya.c
	src/lib/protocols/battlefield.c
	src/lib/protocols/bgp.c
	src/lib/protocols/bittorrent.c
	src/lib/protocols/ciscovpn.c
	src/lib/protocols/citrix.c
	src/lib/protocols/corba.c
	src/lib/protocols/crossfire.c
	src/lib/protocols/dcerpc.c
	src/lib/protocols/dhcp.c
	src/lib/protocols/dhcpv6.c
	src/lib/protocols/directconnect.c
	src/lib/protocols/directdownloadlink.c
	src/lib/protocols/dns.c
	src/lib/protocols/dofus.c
	src/lib/protocols/dropbox.c
	src/lib/protocols/eaq.c
	src/lib/protocols/edonkey.c
	src/lib/protocols/fasttrack.c
	src/lib/protocols/fiesta.c
	src/lib/protocols/filetopia.c
	src/lib/protocols/florensia.c
	src/lib/protocols/ftp_control.c
	src/lib/protocols/ftp_data.c
	src/lib/protocols/gnutella.c
	src/lib/protocols/gtp.c
	src/lib/protocols/guildwars.c
	src/lib/protocols/h323.c
	src/lib/protocols/halflife2_and_mods.c
	src/lib/protocols/http.c
	src/lib/protocols/http_activesync.c
	src/lib/protocols/iax.c
	src/lib/protocols/icecast.c
	src/lib/protocols/imesh.c
	src/lib/protocols/ipp.c
	src/lib/protocols/irc.c
	src/lib/protocols/jabber.c
	src/lib/protocols/kakaotalk_voice.c
	src/lib/protocols/kerberos.c
	src/lib/protocols/kontiki.c
	src/lib/protocols/ldap.c
	src/lib/protocols/lotus_notes.c
	src/lib/protocols/mail_imap.c
	src/lib/protocols/mail_pop.c
	src/lib/protocols/mail_smtp.c
	src/lib/protocols/maplestory.c
	src/lib/protocols/mdns.c
	src/lib/protocols/meebo.c
	src/lib/protocols/megaco.c
	src/lib/protocols/mgcp.c
	src/lib/protocols/mms.c
	src/lib/protocols/mpegts.c
	src/lib/protocols/msn.c
	src/lib/protocols/mssql.c
	src/lib/protocols/mysql.c
	src/lib/protocols/netbios.c
	src/lib/protocols/netflow.c
	src/lib/protocols/nfs.c
	src/lib/protocols/noe.c
	src/lib/protocols/ntp.c
	src/lib/protocols/openft.c
	src/lib/protocols/openvpn.c
	src/lib/protocols/oracle.c
	src/lib/protocols/oscar.c
	src/lib/protocols/pando.c
	src/lib/protocols/pcanywhere.c
	src/lib/protocols/postgres.c
	src/lib/protocols/pplive.c
	src/lib/protocols/ppstream.c
	src/lib/protocols/pptp.c
	src/lib/protocols/qq.c
	src/lib/protocols/quake.c
	src/lib/protocols/quic.c
	src/lib/protocols/radius.c
	src/lib/protocols/rdp.c
	src/lib/protocols/redis_net.c
	src/lib/protocols/rsync.c
	src/lib/protocols/rtcp.c
	src/lib/protocols/rtmp.c
	src/lib/protocols/rtp.c
	src/lib/protocols/rtsp.c
	src/lib/protocols/sflow.c
	src/lib/protocols/shoutcast.c
	src/lib/protocols/sip.c
	src/lib/protocols/skinny.c
	src/lib/protocols/skype.c
	src/lib/protocols/smb.c
	src/lib/protocols/snmp.c
	src/lib/protocols/socrates.c
	src/lib/protocols/sopcast.c
	src/lib/protocols/soulseek.c
	src/lib/protocols/spotify.c
	src/lib/protocols/ssdp.c
	src/lib/protocols/ssh.c
	src/lib/protocols/ssl.c
	src/lib/protocols/stealthnet.c
	src/lib/protocols/steam.c
	src/lib/protocols/stun.c
	src/lib/protocols/syslog.c
	src/lib/protocols/tds.c
	src/lib/protocols/teamspeak.c
	src/lib/protocols/teamviewer.c
	src/lib/protocols/telegram.c
	src/lib/protocols/telnet.c
	src/lib/protocols/tftp.c
	src/lib/protocols/thunder.c
	src/lib/protocols/tor.c
	src/lib/protocols/tvants.c
	src/lib/protocols/tvuplayer.c
	src/lib/protocols/twitter.c
	src/lib/protocols/usenet.c
	src/lib/protocols/veohtv.c
	src/lib/protocols/vhua.c
	src/lib/protocols/viber.c
	src/lib/protocols/vmware.c
	src/lib/protocols/vnc.c
	src/lib/protocols/warcraft3.c
	src/lib/protocols/whoisdas.c
	src/lib/protocols/winmx.c
	src/lib/protocols/world_of_kung_fu.c
	src/lib/protocols/world_of_warcraft.c
	src/lib/protocols/xbox.c
	src/lib/protocols/xdmcp.c
	src/lib/protocols/yahoo.c
	src/lib/protocols/zattoo.c
	src/lib/protocols/zeromq.c
2015-07-08 22:21:10 +02:00
Luca 5266c726f2 Reworked protocol initialization. Work in progress (more cleanup is needed) 2015-07-08 11:58:55 -07:00
Michele Campus a4b22a612e adding init protocol (2) - removed host_match proto defaults 2015-07-08 12:50:46 +02:00
Michele Campus e222345c85 Merge remote-tracking branch 'upstream/dev' into dev 2015-07-08 10:21:00 +02:00
Michele Campus 2b30cc8f2c adding init protocol (1) 2015-07-07 21:12:49 +02:00
Luca dc1d7bf47f Introduced ndpi_protocol datatype to handle master+subprotocol
Reworked protocol/master_protocol
Added new API call to print protocol/master_protocol
      - ndpi_protocol2name()
2015-07-07 10:50:49 -04:00
Luca f5d6cd511e Added support for Snapchat
Reworked code to better handle host-based protocols
2015-07-05 19:21:12 +02:00
Luca 09c137b27a Merge branch 'dev' of https://github.com/ntop/nDPI into dev 2015-07-01 18:36:54 +02:00
Luca 151f74d596 Reworked skype code 2015-07-01 18:36:33 +02:00
Luca Deri 2ac44376cb Moved to version 1.7.0 2015-07-01 18:14:37 +02:00
Luca 7f807b81fe Added support for subprotocols
Modified ndpiReaded to print subprotocols
2015-07-01 18:12:47 +02:00
Luca 60884f9047 Split former protocol into upper and lower protocol 2015-07-01 17:40:14 +02:00
Luca 49ea23530f Code cleanup for improving readability 2015-07-01 16:57:32 +02:00
Luca 07ebed7fae Removed commented code
Renamed ndpi_int_add_connection() with ndpi_set_detected_protocol()
2015-07-01 16:45:29 +02:00
Luca 857020c475 Added missing type that defaulted to int 2015-07-01 16:40:43 +02:00
Luca Deri 68af5c221d Merge pull request #53 from kYroL01/dev
deleted protocol_type (real-correlated)
2015-07-01 16:32:34 +02:00
Michele Campus 4089227863 no_real for mpegts.c 2015-06-29 17:09:05 +02:00
Michele Campus a968718b52 no_real for mpegts.c 2015-06-29 17:06:04 +02:00
Michele Campus 83d46d02d4 Merge pull request #1 from kYroL01/no_real
No real
2015-06-29 16:56:54 +02:00
Michele Campus 32cdefb7d7 deleted protocol type (real-correlated)_1 2015-06-29 16:33:29 +02:00
Michele Campus 8da7af7b7b deleted protocol type (real-correlated) 2015-06-29 16:24:51 +02:00
Luca 276a35d36d Added test results for mpeg pcap 2015-06-25 03:59:17 -07:00
Luca 7e28cc0981 Added MPEG TS protocol
Fixed possible decoding loop in RTCP dissector
Added test pcap for mpegts
2015-06-25 03:57:50 -07:00
Luca Deri 40292a737a Merge pull request #38 from jnicholls/dns-fix
Account for the skipping of the DNS RR CLASS field by progressing the…
2015-06-24 17:42:00 -07:00
Luca Deri 8d5dda9d33 Merge pull request #36 from kYroL01/dev
fix quic.c
2015-06-24 17:40:21 -07:00
Jarred Nicholls 1d9d0b89ab Account for the skipping of the DNS RR CLASS field by progressing the payload index forward by an extra 2 octets. Remove commented code. 2015-06-24 20:38:01 -04:00
Michele Campus dd834c0eeb fix quic.c 2015-06-24 21:39:25 +02:00
Michele Campus 1d698899f6 fix quic.c 2015-06-24 19:36:35 +02:00
Luca 9bb99ed01d Added acknowldgement section 2015-06-24 08:03:53 -07:00
Luca ce94b7e545 Added support for TIM services generated by tim.com.br and tim.it 2015-06-24 07:57:09 -07:00
Luca 53c0b81dad Reverted fix in quic.c as apparently it invalidates protocol detection
Added testing files for quickplay
2015-06-24 07:49:02 -07:00
Luca 2be84d4d64 Added support for QuickPlay streaming service used by companies like hooq.tv 2015-06-24 07:34:57 -07:00
Luca 806c1a48d5 Added fix for fixing a crash when some CLI combination options are used 2015-06-23 07:06:09 -07:00
Luca Deri 4f691de0b5 Merge pull request #32 from kYroL01/dev
fix quic.c and add libtoolize option to autogen.sh
2015-06-20 18:51:27 +02:00
Michele Campus 37912b6045 fix quic.c and add libtoolize option to autogen.sh 2015-06-20 18:35:04 +02:00
Luca Deri d04979402c Added further check 2015-06-19 15:59:46 +02:00
Luca Deri 8a2493c26a Fixed crash caused by IPv6 traffic and KakaoTalk 2015-06-19 11:39:38 +02:00
Luca b2816d72da Disabled debug messages 2015-06-18 16:31:58 +02:00
Luca 9d361ec772 HTTP response is now dissected so we can match mime types on responses 2015-06-18 16:24:03 +02:00
Luca Deri 5b62fa3464 Merge pull request #29 from commsquare/dev
Allow Host IP based subprotocols to be added in protos.txt
2015-06-18 15:52:24 +02:00
Luca Deri 92e813cca4 Merge pull request #30 from sparkon/dev
Adding more Twitch.tv support
2015-06-18 15:51:59 +02:00
Edoardo Dominici a7b7254ac0 Added Twitch ingestion servers and JustinTV CDN
[ Fixed newline ]
2015-06-17 15:17:45 +02:00
sparkon 23048378d8 Added Twitch ingestion servers and JustinTV CDN 2015-06-17 14:55:07 +02:00
george.vakras@gmail.com b16ff0a3dc Fix ip based protocol example in protos.txt 2015-06-17 14:14:19 +02:00
Luca Deri f97fe9a7b5 Added pcap for SSL regression 2015-06-16 18:34:43 +02:00
Luca Deri 85db524a35 Added fix for detecting SSL certificate decoding. The old code did not discard non-SSL packets thus incrementing a counter when not necessary and thus terminating SSL decoding too early. This causes some SSL certificates not to be properly dissected and thus handled. 2015-06-16 18:31:01 +02:00
Luca 031f1709f2 Test file for mpeg detection 2015-06-15 16:48:50 +02:00
george.vakras@gmail.com 7391fe0c5e Allow loading host IP based protocols from protos.txt 2015-06-15 09:50:13 +02:00
Luca Deri 984eca8a27 Added support for Twitch detection
Minor cosmetic fix in test tool
2015-06-15 00:47:39 +02:00
Luca Deri 8b321fda41 Added testing files for EAQ, KakaoTalk, Torcedor, Meu 2015-06-14 12:28:59 +02:00
Luca Deri 702a9d0867 Improved RTCP decoder
Added detection of KakaoTalk Voice and Chat
2015-06-14 12:21:29 +02:00
Luca Deri 20740e1b68 Added Meu service detection 2015-06-14 11:04:31 +02:00
Luca Deri c4adefe75b Added EAQ protocol support 2015-06-14 10:37:34 +02:00
Luca Deri 11fb7e1796 Added missing L in license 2015-06-12 11:02:44 +02:00
Lorenzo Mangani 12f89fff49 Typo fix in README 2015-06-07 16:25:39 +02:00
Luca Deri f3bb7fb9c2 Added misisng symbols
ndpi_get_proto_by_id
ndpi_get_protocol_id_master_proto
ndpi_guess_protocol_id
2015-06-07 08:36:32 +02:00
Luca 72b205f5c1 Fixed bug that caused configure to generate GIT version information containing spaces
Modified ndpiReader to include flow details in dumps (used for testing)
Rebuilt all test results to include flow details
2015-06-04 19:07:23 +02:00
Luca 4ce9dec54e Reworked the STUN plugin
Added support for WhatsApp Voice vs WhatsApp (chat, no voice)
2015-06-04 18:44:09 +02:00
471 changed files with 55456 additions and 23657 deletions
+44 -25
View File
@@ -1,37 +1,56 @@
*.[oa]
*~
*o.cmd
*.lo
*.obj
*o.cmd
*.ko
*.swp
*.in
*.la
.libs
.dirstamp
stamp-h1
/configure
/aclocal.m4
/autom4te.cache/
.autotools
compile
/compile
/config.guess
/config.h
/config.h.in
/config.sub
/config.log
/config.status
/config.sub
/configure
/configure.ac
/configure.tmp
.cproject
/depcomp
/install-sh
/ltmain.sh
/missing
/Makefile
/libndpi.pc
/libtool
/src/lib/Makefile
/src/include/Makefile
/example/ndpiReader
.dirstamp
/example/.deps/
/example/Makefile
/aclocal.m4
/example/ndpiReader
/example/Makefile.dpdk
/example/build
*.in
/install-sh
*.ko
*.la
/libndpi.pc
.libs
/libtool
*.lo
/ltmain.sh
/m4/libtool.m4
/m4/lt~obsolete.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4
/Makefile
/missing
*.[o]
*.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/Makefile
/src/lib/protocols/.deps/
/src/lib/third_party/src/.deps/
stamp-h1
*.swp
/test-driver
/tests/Makefile
+94 -9
View File
@@ -1,22 +1,107 @@
language: c
compiler:
- clang
- gcc
matrix:
include:
- os: osx
compiler: clang
install:
- sudo apt-get update || true
- sudo apt-get install build-essential
- sudo apt-get install libpcap-dev libtool autoconf automake autogen
- os: linux
compiler: gcc
addons:
apt:
packages:
- libpcap-dev
- autogen
- os: linux
compiler: clang
addons:
apt:
packages:
- libpcap-dev
- autogen
- os: linux
compiler: gcc-8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-8
- libpcap-dev
- autogen
env:
- MATRIX_EVAL="CC=gcc-8 && CXX=g++-8"
- os: linux
compiler: gcc-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-9
- libpcap-dev
- autogen
env:
- MATRIX_EVAL="CC=gcc-9 && CXX=g++-9"
- os: linux
compiler: clang-8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-8
packages:
- clang-8
- libpcap-dev
- autogen
env:
- MATRIX_EVAL="CC=clang-8 && CXX=clang++-8"
- os: linux
compiler: clang-7
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-7
packages:
- clang-7
- libpcap-dev
- autogen
env:
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
before_install:
- eval "${MATRIX_EVAL}"
before_script:
- ./autogen.sh
# - lcov --directory . --zerocounters
script:
- ./configure
- make
after_script:
#after_script:
- cd tests
- ./do.sh
#after_success:
#- cd ${TRAVIS_BUILD_DIR}
#- lcov --directory . --capture --output-file coverage.info # capture coverage info
#- lcov --remove coverage.info 'tests/*' 'packages/*' 'm4/*' 'doc/*' --output-file coverage.info
#- lcov --list coverage.info # debug before upload
#- coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info # uploads to coveralls
notifications:
email:
recipients:
- packager@ntop.org
on_success: never
on_failure: always
+366
View File
@@ -0,0 +1,366 @@
# CHANGELOG
#### nDPI 3.0 (October 2019)
## New Features
* nDPI now reports the protocol ASAP even when specific fields have not yet been dissected because such packets have not yet been observed. This is important for inline applications that can immediately act on traffic. Applications that need full dissection need to call the new API function ndpi_extra_dissection_possible() to check if metadata dissection has been completely performed or if there is more to read before declaring it completed.
* TLS (formerly identified as SSL in nDPI v2.x) is now dissected more deeply, certificate validity is extracted as well certificate SHA-1.
* nDPIreader can now export data in CSV format with option `-C`
* Implemented Sequence of Packet Length and Time (SPLT) and Byte Distribution (BD) as specified by Cisco Joy (https://github.com/cisco/joy). This allows malware activities on encrypted TLS streams. Read more at https://blogs.cisco.com/security/detecting-encrypted-malware-traffic-without-decryption
* Available as library and in `ndpiReader` with option `-J`
* Promoted usage of protocol categories rather than protocol identifiers in order to classify protocols. This allows application protocols to be clustered in families and thus better managed by users/developers rather than using hundred of protocols unknown to most of the people.
* Added Inter-Arrival Time (IAT) calculation used to detect protocol misbehaviour (e.g. slow-DoS detection)
* Added data analysis features for computign metrics such as entropy, average, stddev, variance on a single and consistent place that will prevent when possible. This should ease traffic analysis on monitoring/security applications. New API calls have been implemented such as ndpi_data_XXX() to handle these calculations.
* Initial release of Python bindings available under nDPI/python.
* Implemented search of human readable strings for promoting data exfiltration detection
* Available as library and in `ndpiReader` with option `-e`
* Fingerprints
* JA3 (https://github.com/salesforce/ja3)
* HASSH (https://github.com/salesforce/hassh)
* DHCP
* Implemented a library to serialize/deserialize data in both Type-Length-Value (TLV) and JSON format
* Used by nProbe/ntopng to exchange data via ZMQ
## New Supported Protocols and Services
* DTLS (i.e. TLS over UDP)
* Hulu
* TikTok/Musical.ly
* WhatsApp Video
* DNSoverHTTPS
* Datasaver
* Line protocol
* Google Duo and Hangout merged
* WireGuard VPN
* IMO
* Zoom.us
## Improvements
* TLS
* Organizations
* Ciphers
* Certificate analysis
* Added PUBLISH/SUBSCRIBE methods to SIP
* Implemented STUN cache to enhance matching of STUN-based protocols
* Dissection improvements
* Viber
* WhatsApp
* AmazonVideo
* SnapChat
* FTP
* QUIC
* OpenVPN support for UDP-based VPNs
* Facebook Messenger mobile
* Various improvements for STUN, Hangout and Duo
* Added new categories: CUSTOM_CATEGORY_ANTIMALWARE, NDPI_PROTOCOL_CATEGORY_MUSIC, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_CATEGORY_SHOPPING, NDPI_PROTOCOL_CATEGORY_PRODUCTIVITY and NDPI_PROTOCOL_CATEGORY_FILE_SHARING
* Added NDPI_PROTOCOL_DANGEROUS classification
## Fixes
* Fixed the dissection of certain invalid DNS responses
* Fixed Spotify dissection
* Fixed false positives with FTP and FTP_DATA
* Fix to discard STUN over TCP flows
* Fixed MySQL dissector
* Fix category detection due to missing initialization
* Fix DNS rsp_addr missing in some tiny responses
* Various hardening fixes
------------------------------------------------------------------------
#### nDPI 2.8 (March 2019)
## New Supported Protocols and Services
* Added Modbus over TCP dissector
## Improvements
* Wireshark Lua plugin compatibility with Wireshark 3
* Improved MDNS dissection
* Improved HTTP response code handling
* Full dissection of HTTP responses
## Fixes
* Fixed false positive mining detection
* Fixed invalid TCP DNS dissection
* Releasing buffers upon `realloc` failures
* ndpiReader: Prevents references after free
* Endianness fixes
* Fixed IPv6 HTTP traffic dissection
* Fixed H.323 detection
## Other
* Disabled ookla statistics which need to be improved
* Support for custom protocol files of arbitrary length
* Update radius.c to RFC2865
------------------------------------------------------------------------
#### nDPI 2.6 (December 2018)
## New Supported Protocols and Services
* New Bitcoin, Ethereum, ZCash, Monero dissectors all identified as Mining
* New Signal.org dissector
* New Nest Log Sink dissector
* New UPnP dissector
* Added support for SMBv1 traffic, split from SMBv23
## Improvements
* Improved Skype detection, merged Skype call in/out into Skype Call
* Improved heuristics for Skype, Teredo, Netbios
* Improved SpeedTest (Ookla) detection
* Improved WhatsApp detection
* Improved WeChat detection
* Improved Facebook Messenger detection
* Improved Messenger/Hangout detection
* Improved SSL detection, prevent false positives
* Improved guess for UDP protocols
* Improved STUN detection
* Added more Ubuntu servers
* Added missing categorization with giveup/guess
* Optimizations for TCP flows that do not start with a SYN packet (early giveup)
## Fixes
* Fixed eDonkey false positives
* Fixed Dropbox dissector
* Fixed Spotify dissector
* Fixed custom protocol loading
* Fixed missing Application Data packet for TLS
* Fixed buffer overflows
* Fixed custom categories match by IP
* Fixed category field not accounted in ndpi_get_proto_category
* Fixed null pointer dereference in ndpi_detection_process_packet
* Fixed compilation on Mac
## Other
* Deb and RPM packages: ndpi with shared libraries and binaries, ndpi-dev with headers and static libraries
* Protocols now have an optional subprotocol: Spotify cannot have subprotocols, DNS can (DNS.Spotify)
* New API functions:
- ndpi_fill_ip_protocol_category to handle ICMP flows category
- ndpi_flowv4_flow_hash and ndpi_flowv6_flow_hash to support the Community ID Flow Hashing (https://github.com/corelight/community-id-spec)
- ndpi_protocol2id to print the protocol as ID
- ndpi_get_custom_category_match to search host in custom categories
* Changed ndpi_detection_giveup API: guess is now part of the call
* Added DPDK support to ndpiReader
* Removed Musical.ly protocol (service no longer used)
* Custom categories have now priority over protocol related categories
* Improved clang support
------------------------------------------------------------------------
#### nDPI 2.4 (August 2018)
## New Supported Protocols and Services
* Showmax.com
* Musical.ly
* RapidVideo
* VidTO streaming service
* Apache JServ Protocol
* Facebook Messenger
* FacebookZero protocol
## Improvements
* Improved YouTube support
* Improved Netflix support
* Updated Google Hangout detection
* Updated Twitter address range
* Updated Viber ports, subnet and domain
* Updated AmazonVideo detection
* Updated list of FaceBook sites
* Initial Skype in/out support
* Improved Tor detection
* Improved hyperscan support and category definition
* Custom categories loading, extended ndpiReader (`-c <file>`) for loading name-based categories
## Fixes
* Fixes for Instagram flows classified as Facebook
* Fixed Spotify detection
* Fixed minimum packet payload length for SSDP
* Fixed length check in MSN, x-steam-sid, Tor certificate name
* Increase client's maximum payload length for SSH
* Fixed end-of-line bounds handling
* Fixed substring matching
* Fix for handling IP address based custom categories
* Repaired wrong timestamp calculation
* Fixed memory leak
* Optimized memory usage
## Other/Changes
* New API calls:
* `ndpi_set_detection_preferences()`
* `ndpi_load_hostname_category()`
* `ndpi_enable_loaded_categories()`
* `ndpi_fill_protocol_category()`
* `ndpi_process_extra_packet()`
* Skype CallIn/CallOut are now set as Skype.SkypeCallOut Skype.SkypeCallIn
* Added support for SMTPS on port 587
* Changed RTP from VoIP to Media category
* Added site unavailable category
* Added custom categories CUSTOM_CATEGORY_MINING, CUSTOM_CATEGORY_MALWARE, CUSTOM_CATEGORY_ADVERTISEMENT, CUSTOM_CATEGORY_BANNED_SITE
* Implemented hash-based categories
* Converted some not popular protocols to NDPI_PROTOCOL_GENERIC with category detection
------------------------------------------------------------------------
#### nDPI 2.2.2 (April 2018)
## Main New Features
* Hyperscan support
* `ndpi_get_api_version` API call to be used in applications that are dynamically linking with nDPI
* `--enable-debug-messages` to enable debug information output
* Increased number of protocols to 512
## New Supported Protocols and Services
* GoogleDocs
* GoogleServices
* AmazonVideo
* ApplePush
* Diameter
* GooglePlus
* WhatsApp file exchage
## Improvements
* WhatsApp detection
* Amazon detection
* Improved Google Drive
* Improved Spotify support
* Improved SNI matching when using office365
* Improved HostShield VPN
## Fixes
* Fixed invalid RTP/Skype detection
* Fixed possible out-of-bounds due to malformed DHCP packets
* Fixed buffer overflow in function `ndpi_debug_printf`
------------------------------------------------------------------------
#### nDPI 2.2 (December 2017)
## Main New Features
* Custom protocol categories to allow personalization of protocols-categories mappings
* DHCP fingerprinting
* HTTP User Agent discovery
## New Supported Protocols and Services
* ICQ (instant messaging client)
* YouTube Upload
* LISP
* SoundCloud
* Sony PlayStation
* Nintendo (switch) gaming protocol
## Improvements
* Windows 10 detection from UA and indentation
* Determine STUN flows that turn into RTP
* Fixes for iQIYI and 1kxun
* Android fingerprint
* Added DHCP class identifier support
------------------------------------------------------------------------
#### nDPI 2.0 (May 2017)
## Main New Features
* nDPI Wireshark plugin for Layer-7 protocol dissection. The plugin, available via an extcap interface, passes Wireshark the nDPI-detected protocols by adding an ethernet packet trailer that is then interpreted and displayed inside the Wireshark GUI. Readme: https://github.com/ntop/nDPI/blob/dev/wireshark/README.md
## New Supported Protocols and Services
* STARTTLS
* IMAPS
* DNScrypt
* QUIC (Quick UDP Internet Connections)
* AMQP (Advanced Message Queueing Protocol)
* Ookla (SpeedTest)
* BJNP
* AFP (Apple Filing Protocol)
* SMPP (Short Message Peer-to-Peer)
* VNC
* OpenVPN
* OpenDNS
* RX protocol (used by AFS)
* CoAP and MQTT (IoT specific protocols)
* Cloudflare
* Office 365
* OCS
* MS Lync
* Ubiquity AirControl 2
* HEP (Extensible Encapsulation Protocol)
* WhatsApp Voice vs WhatsApp (chat, no voice)
* Viber
* Wechat
* Github
* Hotmail
* Slack
* Instagram
* Snapchat
* MPEG TS protocol
* Twitch
* KakaoTalk Voice and Chat
* Meu
* EAQ
* iQIYI media service
* Weibo
* PPStream
## Improvements
* SSH client/server version dissection
* Improved SSL dissection
* SSL server certificate detection
* Added double tagging 802.1Q in dissection of vlan-tagged packets
* Improved netBIOS dissection
* Improved Skype detection
* Improved Netflix traffic detection
* Improved HTTP subprotocol matching
* Implemented DHCP host name extraction
* Updated Facebook detection by ip server ranges
* Updated Twitter networks
* Improved Microsoft detection
* Enhanced Google detection
* Improved BT-uTP protocol dissection
* Added detection of Cisco datalink layer (Cisco hDLC and Cisco SLARP)
#### Older releases
#### 2014-03-21
* improved support for eDonkey/eMule/Kademlia
* improved support for PPLive
#### 2014-03-20
* code optimizations
* consistency improvements
* added support for new applications: Pando Media Booster
* improved support for Steam
* added support for new web services: Wikipedia, MSN, Amazon, eBay, CNN
#### 2014-03-19
* added new protocols: FTP, code improvements
#### 2014-03-17
* added new protocols: SOCKSv4, SOCKSv5, RTMP
+27
View File
@@ -0,0 +1,27 @@
# How to contribute
Please keep all code, comments, issues and pull requests in English, otherwise they will be **removed**.
## Found a bug?
- First, check there are no already open issues for the bug. See [here](https://github.com/ntop/nDPI/issues).
- If there is not open issue addressing the bug, [open a new one](https://github.com/ntop/nDPI/issues/new).
- Make sure to include a **descriptive and clear title and description**, including the **version of nDPI** being used.
- Try to include steps to reproduce the bug.
- If applicable, try to provide a stacktrace.
- Providing a simple test case which shows the bug would help resolve the issue faster.
## Written a new protocol dissector?
- Ensure you have followed the guide in the [README](https://github.com/ntop/nDPI#how-to-add-a-new-protocol-dissector).
- Open a new pull request with a **clear, descriptive** title.
- Ensure the pull request passes CI testing. Any pull request which fails CI will be **ignored**.
- If possible, add a new test for the new protocol. See [existing tests](https://github.com/ntop/nDPI/tree/dev/tests) for examples.
## Written a fix for a bug?
- Open a new pull request with a **clear, descriptive** title.
- If there is an open issue for the bug, ensure the description of the pull request contains `Fixes #issue_number`.
- Ensure the pull request passes CI testing. Any pull request which fails CI will be **ignored**.
Finally, thank you for your contributions.
-16
View File
@@ -1,16 +0,0 @@
2014-03-21:
- improved support for eDonkey/eMule/Kademlia
- improved support for PPLive
2014-03-20:
- code optimizations
- consistency improvements
- added support for new applications: Pando Media Booster
- improved support for Steam
- added support for new web services: Wikipedia, MSN, Amazon, eBay, CNN
2014-03-19:
- added new protocols: FTP, code improvements
2014-03-17:
- added new protocols: SOCKSv4, SOCKSv5, RTMP
+2 -3
View File
@@ -1,8 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src/lib example
SUBDIRS = src/lib example tests
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libndpi.pc
EXTRA_DIST = libndpi.sym autogen.sh
EXTRA_DIST = autogen.sh
+36 -11
View File
@@ -1,8 +1,15 @@
# What is nDPI ?
![ntop][ntopng_logo] ![ntop][ntop_logo]
# nDPI
nDPI is an open source GPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. We have tried to push them into the OpenDPI source tree but nobody answered emails so we have decided to create mour own source tree
[![Build Status](https://travis-ci.org/ntop/nDPI.png?branch=dev)](https://travis-ci.org/ntop/nDPI)
[![Code Quality: Cpp](https://img.shields.io/lgtm/grade/cpp/g/ntop/nDPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ntop/nDPI/context:cpp)
[![Total Alerts](https://img.shields.io/lgtm/alerts/g/ntop/nDPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ntop/nDPI/alerts)
# How To Compile nDPI
## What is nDPI ?
nDPI is an open source LGPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. We have tried to push them into the OpenDPI source tree but nobody answered emails so we have decided to create our own source tree
### How To Compile nDPI
In order to compile this library do
@@ -10,28 +17,46 @@ In order to compile this library do
- ./configure
- make
To run tests do additionally:
- cd tests; ./do.sh
Please note that the pre-requisites for compilation include:
- GNU tools (autogen, automake, autoconf, libtool)
- GNU C compiler (gcc)
# How To Add A New Protocol Dissector
### How To Add A New Protocol Dissector
The entire procedure of adding new protocols in detail:
1. Add new protocol together with its unique ID to: src/include/ndpi_protocols_osdpi.h
1. Add new protocol together with its unique ID to: src/include/ndpi_protocol_ids.h
2. Create a new protocol in: src/lib/protocols/
3. Variables to be kept for the duration of the entire flow (as state variables) needs to be placed in: /include/ndpi_structs.h in ndpi_flow_tcp_struct (for TCP only), ndpi_flow_udp_struct (for UDP only), or ndpi_flow_struct (for both).
3. Variables to be kept for the duration of the entire flow (as state variables) need to be placed in: src/include/ndpi_typedefs.h in ndpi_flow_tcp_struct (for TCP only), ndpi_flow_udp_struct (for UDP only), or ndpi_flow_struct (for both).
4. Add a new entry for the search function for the new protocol in: src/include/ndpi_protocols.h
5. Choose (do not change anything) a selection bitmask from: src/include/ndpi_define.h
6. Add a new entry in ndpi_set_protocol_detection_bitmask2 in: src/lib/ndpi_main.c
7. Set protocol default ports in ndpi_init_protocol_defaults in: src/lib/ndpi_main.c
8. Add the new protocol file to: src/lib/Makefile.am
9. ./autogen.sh
10. ./configure
11. make
8. ./autogen.sh
9. make
10. make check
# Creating A Source File Tar Ball
### How to use nDPI to Block Selected Traffic
You can use nDPI to selectively block selected Internet traffic by embedding it onto an application (remember that nDPI is just a library). Both [ntopng](https://github.com/ntop/ntopng) and [nProbe cento](http://www.ntop.org/products/netflow/nprobe-cento/) can do this.
### DISCLAIMER
While we do our best to detect network protocols, we cannot guarantee that our software is error free and 100% accurate in protocol detection. Please make sure that you respect the privacy of users and you have proper authorization to listen, capture and inspect network traffic.
### Creating A Source File Tar Ball
If you want to distribute a source tar file of nDPI do:
- make dist
To ensure that a tar file includes all necessary files and to run tests on distribution do:
- make distcheck
[ntopng_logo]: https://camo.githubusercontent.com/0f789abcef232035c05e0d2e82afa3cc3be46485/687474703a2f2f7777772e6e746f702e6f72672f77702d636f6e74656e742f75706c6f6164732f323031312f30382f6e746f706e672d69636f6e2d313530783135302e706e67
[ntop_logo]: https://camo.githubusercontent.com/58e2a1ecfff62d8ecc9d74633bd1013f26e06cba/687474703a2f2f7777772e6e746f702e6f72672f77702d636f6e74656e742f75706c6f6164732f323031352f30352f6e746f702e706e67
+2 -1
View File
@@ -1,9 +1,10 @@
rerequisites for Compilation
Prerequisites for Compilation
-----------------------------
Prerequisites
- GNU autotools/libtool
- libpcap or PF_RING (optional but recommended)
- apt-get install libjson-c-dev (for JSON support)
On Ubuntu/Debian
- apt-get install build-essential
+1 -1
View File
@@ -8,7 +8,7 @@ TCP 172.16.253.130:2021 <-> 75.147.140.249:443 [VLAN: 0][proto: 91/SSL][28 pkts/
TCP 172.16.253.130:2077 <-> 77.247.181.163:443 [VLAN: 0][proto: 91/SSL][136 pkts/94329 bytes][SSL client: www.fk4pprq42hsvl2wey.com]
It can be detected by analyzing the SSL client certificate and checking the name that does not match to a real host in
addition of begin a bit weird. As doing DNS resolution is not a task for nDPI we let applications do and then recognize
addition of being a bit weird. As doing DNS resolution is not a task for nDPI we let applications do and then recognize
SSL-tunnelled connections.
See http://www.netresec.com/?page=Blog&month=2013-04&post=Detecting-TOR-Communication-in-Network-Traffic
+24 -8
View File
@@ -1,12 +1,17 @@
#!/bin/sh
NDPI_MAJOR="3"
NDPI_MINOR="0"
NDPI_PATCH="0"
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
AUTOCONF=$(which autoconf)
AUTOMAKE=$(which automake)
LIBTOOL=$(which libtool)
AUTORECONF=$(which autoreconf)
AUTOCONF=$(command -v autoconf)
AUTOMAKE=$(command -v automake)
LIBTOOL=$(command -v libtool)
LIBTOOLIZE=$(command -v libtoolize)
AUTORECONF=$(command -v autoreconf)
if test -z $AUTOCONF; then
echo "autoconf is missing: please install it and try again"
@@ -18,8 +23,8 @@ if test -z $AUTOMAKE; then
exit
fi
if test -z $LIBTOOL; then
echo "libtool is missing: please install it and try again"
if test -z $LIBTOOL && test -z $LIBTOOLIZE ; then
echo "libtool and libtoolize is missing: please install it and try again"
exit
fi
@@ -28,5 +33,16 @@ if test -z $AUTORECONF; then
exit
fi
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
./configure
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 $*
-97
View File
@@ -1,97 +0,0 @@
AC_INIT([libndpi], [1.6.0])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects])
LT_INIT
AC_PROG_CC
AX_PTHREAD
if test -d ".git"; then :
GIT_TAG=`git log -1 --format=%h`
GIT_DATE=`git log -1 --format=%cd`
#
# On CentOS 6 `git rev-list HEAD --count` does not work
#
#
GIT_NUM=`git log --pretty=oneline | wc -l`
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
GIT_RELEASE="${PACKAGE_VERSION}-${GIT_BRANCH}-${GIT_NUM}-${GIT_TAG}"
else
GIT_RELEASE="${PACKAGE_VERSION}"
GIT_DATE=`date`
fi
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
PCAP_HOME=$HOME/PF_RING/userland
if test -d $PCAP_HOME; then :
echo -n ""
else
PCAP_HOME=`pwd`/../../PF_RING/userland
fi
SHORT_MACHINE=`uname -m | cut -b1-3`
if test $SHORT_MACHINE = "arm"; then
LIBNUMA=""
else
LIBNUMA="-lnuma"
fi
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
echo "Using libpcap from $PCAP_HOME"
PCAP_INC="-I $PCAP_HOME/libpcap"
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA"
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
else
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
echo ""
echo "ERROR: Missing libpcap(-dev) library required to compile the example application"
echo "ERROR: Please install it and try again"
exit
fi
fi
PKG_CONFIG=$(which pkg-config)
if test -d /usr/local/include/json-c/; then :
CFLAGS="$CFLAGS -I/usr/local/include/json-c/"
LDFLAGS="$LDFLAGS -L/usr/local/lib -ljson-c"
else
if ! test -z "$PKG_CONFIG"; then :
CFLAGS="$CFLAGS $(pkg-config --cflags json-c)"
LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)"
fi
fi
OLD_LIBS=$LIBS
LIBS="-L/opt/napatech3/lib $LIBS"
AC_CHECK_LIB([ntapi],
[NT_Init],
[PCAP_LIB="$PCAP_LIB -L/opt/napatech3/lib -lntapi"],
[], [] )
LIBS=$OLD_LIBS
AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]))
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 libndpi.pc])
AC_CONFIG_HEADERS(config.h)
AC_SUBST(GIT_RELEASE)
AC_SUBST(SVN_DATE)
AC_SUBST(JSON_C_LIB)
AC_SUBST(PCAP_INC)
AC_SUBST(PCAP_LIB)
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
AC_OUTPUT
+159
View File
@@ -0,0 +1,159 @@
AC_INIT([libndpi], [@NDPI_VERSION_SHORT@])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects])
LT_INIT
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CC_STDC
AC_LANG_WERROR
AX_PTHREAD
NDPI_VERSION_SHORT="@NDPI_VERSION_SHORT@"
NDPI_MAJOR="@NDPI_MAJOR@"
NDPI_MINOR="@NDPI_MINOR@"
NDPI_PATCH="@NDPI_PATCH@"
AC_DEFINE_UNQUOTED(NDPI_MAJOR_RELEASE, "${NDPI_MAJOR}", [nDPI major release])
AC_DEFINE_UNQUOTED(NDPI_MINOR_RELEASE, "${NDPI_MINOR}", [nDPI minor release])
AC_DEFINE_UNQUOTED(NDPI_PATCH_LEVEL, "${NDPI_PATCH}", [nDPI patch level])
if test -d ".git"; then :
GIT_TAG=`git log -1 --format=%h`
GIT_DATE=`git log -1 --format=%cd`
#
# On CentOS 6 `git rev-list HEAD --count` does not work
#
#
GIT_NUM=`git log --pretty=oneline | wc -l | tr -d '[[:space:]]'`
GIT_RELEASE="${PACKAGE_VERSION}-${GIT_NUM}-${GIT_TAG}"
else
GIT_RELEASE="${PACKAGE_VERSION}"
GIT_DATE=`date -u -r CHANGELOG.md`
fi
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
PCAP_HOME=$HOME/PF_RING/userland
DPDK_TARGET=
if test -d $HOME/DPDK; then :
echo "Enabling DPDK support in ndpiReader"
DPDK_TARGET=dpdk
else
echo "DPDK support disabled (missing $HOME/DPDK)"
fi
if test -d $PCAP_HOME; then :
echo -n ""
else
PCAP_HOME=`pwd`/../../PF_RING/userland
fi
SHORT_MACHINE=`uname -m | cut -b1-3`
if test $SHORT_MACHINE = "arm"; then
LIBNUMA=""
else
AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
fi
MACHINE=`uname -m`
SYSTEM=`uname -s`
if test $SYSTEM = "Darwin"; then
CC=clang
fi
AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
AS_IF([test "${with_hyperscan+set}" = set],[
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
AS_IF([test "x$ac_cv_lib_hs_hs_compile_multi" = xyes],[
AC_CHECK_LIB([m], [pow])
AC_CHECK_LIB([stdc++], [main])
PKG_CHECK_MODULES([HS],[libhs])
LDFLAGS="$LDFLAGS $HS_LIBS"
AC_MSG_RESULT([compiling with Intel Hyperscan])
],[
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
])
])
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
echo "Using libpcap from $PCAP_HOME"
PCAP_INC="-I $PCAP_HOME/libpcap"
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`"
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
# The dlopen() function is in libdl on GLIBC-based systems
# and in the C library for *BSD systems
AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"],
[AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"],
[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ])
else
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
echo ""
echo "ERROR: Missing libpcap(-dev) library required to compile the example application"
echo "ERROR: Please install it and try again"
exit
fi
fi
dnl> https://github.com/json-c/json-c
AC_ARG_ENABLE([json-c],
AS_HELP_STRING([--disable-json-c], [Disable json-c support]))
AS_IF([test "x$enable_json_c" != "xno"], [
PKG_CHECK_MODULES([JSONC],[json-c],
[
CFLAGS="$CFLAGS $JSONC_CFLAGS"
LDFLAGS="$LDFLAGS $JSONC_LIBS"
AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]))
],
[
JSONC_HOME="$HOME/json-c"
if test -d "$JSONC_HOME"; then :
CFLAGS="$CFLAGS -I $JSONC_HOME"
LDFLAGS="$LDFLAGS $JSONC_HOME/.libs/libjson-c.a"
AC_MSG_RESULT([Found json-c in $JSONC_HOME])
AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present])
fi
])
])
AC_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_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile])
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
AC_SUBST(GIT_RELEASE)
AC_SUBST(NDPI_MAJOR)
AC_SUBST(NDPI_MINOR)
AC_SUBST(NDPI_PATCH)
AC_SUBST(NDPI_VERSION_SHORT)
AC_SUBST(SVN_DATE)
AC_SUBST(JSON_C_LIB)
AC_SUBST(PCAP_INC)
AC_SUBST(PCAP_LIB)
AC_SUBST(DL_LIB)
AC_SUBST(DPDK_TARGET)
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
AC_OUTPUT
Binary file not shown.
Binary file not shown.
+18
View File
@@ -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
@@ -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
@@ -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 */
-12
View File
@@ -1,12 +0,0 @@
bin_PROGRAMS = ndpiReader
AM_CPPFLAGS = -I$(top_srcdir)/src/include @PCAP_INC@
AM_CFLAGS = @PTHREAD_CFLAGS@
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@
AM_LDFLAGS = -static
ndpiReader_SOURCES = ndpiReader.c
ndpiReader.o: ndpiReader.c
+27
View File
@@ -0,0 +1,27 @@
#
# Run 'make -f Makefile.dpdk' to compile the DPDK examples
#
# See http://core.dpdk.org/doc/quick-start/ for DPDK installation and setup
#
ifeq ($(RTE_SDK),)
#$(error "Please define RTE_SDK environment variable")
RTE_SDK = $(HOME)/DPDK
RTE_TARGET = build
endif
# Default target, can be overridden by command line or environment
RTE_TARGET ?= x86_64-native-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
APP = ndpiReader.dpdk
LIBNDPI = $(PWD)/../src/lib/libndpi.a
SRCS-y := reader_util.c ndpiReader.c
CFLAGS += -g
CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-parameter -I $(PWD)/../src/include @CFLAGS@ -DUSE_DPDK
LDLIBS = $(LIBNDPI) @PCAP_LIB@ -lpthread @LDFLAGS@
include $(RTE_SDK)/mk/rte.extapp.mk
+40
View File
@@ -0,0 +1,40 @@
CC=@CC@
CXX=@CXX@
CFLAGS=-g -I../src/include @CFLAGS@
LIBNDPI=../src/lib/libndpi.a
LDFLAGS=$(LIBNDPI) @PCAP_LIB@ -lpthread -lm @LDFLAGS@
OBJS=ndpiReader.o reader_util.o
PREFIX?=@prefix@
all: ndpiReader @DPDK_TARGET@
ndpiReader: $(OBJS) $(LIBNDPI)
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS)
%.o: %.c $(HEADERS) Makefile
$(CC) $(CFLAGS) -c $< -o $@
install:
mkdir -p $(DESTDIR)$(PREFIX)/bin/
mkdir -p $(DESTDIR)$(PREFIX)/sbin/ndpi
cp ndpiReader $(DESTDIR)$(PREFIX)/bin/
cp protos.txt $(DESTDIR)$(PREFIX)/sbin/ndpi/ndpiProtos.txt
cp mining_hosts.txt $(DESTDIR)$(PREFIX)/sbin/ndpi/ndpiCustomCategory.txt
[ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
[ -f ndpiReader.dpdk ] && cp ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
dpdk:
make -f Makefile.dpdk
check:
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I../src/include -I/usr/local/include/json-c *.c
clean:
/bin/rm -f *.o ndpiReader ndpiReader.dpdk
/bin/rm -f .*.dpdk.cmd .*.o.cmd *.dpdk.map .*.o.d
/bin/rm -f _install _postbuild _postinstall _preinstall
/bin/rm -rf build
distclean: clean
/bin/rm -f Makefile.dpdk
/bin/rm -f Makefile
+31
View File
@@ -0,0 +1,31 @@
Prerequisites
-------------
You need to install and compile DPDK in your HOME directory as explained in
See http://core.dpdk.org/doc/quick-start/ for DPDK installation and setup
Once DPDK is built make sure to create a symbolic link
$ cd
$ ln -s dpdk-18.08 DPDK
so the build process will use the DPDK directory letting you have multiple
DPDK versions available on your system
Build
-----
Everything will happen automagically but if you want to do it by hand
do: make -f Makefile.dpdk
Run Application
---------------
Supposing to capture packets from device eno1 you can start the
application as follows:
sudo ./build/ndpiReader -c 1 --vdev=net_pcap0,iface=eno1 -- -v 1
NOTE:
- ndpiReader without DPDK support sits in this directory
- ndpiReader with DPDK support can be found inside the ./build directory
+3
View File
@@ -0,0 +1,3 @@
# Format: name\tcategory_id
internetbadguys.com 100
144.139.247.220 100
+262
View File
@@ -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
+3613 -1206
View File
File diff suppressed because it is too large Load Diff
+13 -3
View File
@@ -10,9 +10,19 @@ tcp:3000@ntop
# Format:
# host:"<value>",host:"<value>",.....@<subproto>
host:"googlesyndacation.com"@Google
host:"googlesyndication.com"@Google
host:"venere.com"@Venere
host:"kataweb.it",host:"repubblica.it"@Repubblica
host:"ntop"@ntop
host:"atv-ext.amazon.com",host:"*.api.amazon.com",host:"*.api.amazonvideo.com"@AmazonVideo
host:"*.amazonaws.com"@AmazonVideo
host:"*.netflix.com"@Netflix
host:"*.lvlt.dash.us.aiv-cdn.net.c.footprint.net"@AmazonVideo
host:"api-global.netflix.com"@Netflix
# IP based Subprotocols
# Format:
# ip:<value>,ip:<value>,.....@<subproto>
ip:213.75.170.11@CustomProtocol
ip:8.248.73.247@AmazonPrime
ip:54.80.47.130@AmazonPrime
File diff suppressed because it is too large Load Diff
+307
View File
@@ -0,0 +1,307 @@
/*
* ndpi_util.h
*
* Copyright (C) 2011-19 - ntop.org
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* nDPI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
*
*/
/**
* This module contains routines to help setup a simple nDPI program.
*
* If you concern about performance or have to integrate nDPI in your
* application, you could need to reimplement them yourself.
*
* WARNING: this API is just a demo od nDPI usage: Use it at your own risk!
*/
#ifndef __NDPI_UTIL_H__
#define __NDPI_UTIL_H__
#include "uthash.h"
#include <pcap.h>
#include "ndpi_classify.h"
#ifdef USE_DPDK
#include <rte_eal.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
#include <rte_cycles.h>
#include <rte_lcore.h>
#include <rte_mbuf.h>
#define RX_RING_SIZE 128
#define TX_RING_SIZE 512
#define NUM_MBUFS 8191
#define MBUF_CACHE_SIZE 250
#define BURST_SIZE 32
#define PREFETCH_OFFSET 3
extern int dpdk_port_init(int port, struct rte_mempool *mbuf_pool);
#endif
/* ETTA Spec defiintions for feature readiness */
#define ETTA_MIN_PACKETS 10
#define ETTA_MIN_OCTETS 4000
/** maximum line length */
#define LINEMAX 512
#define MAX_BYTE_COUNT_ARRAY_LENGTH 256
#define MAX_NUM_PKTS 10
#define MAX_NUM_READER_THREADS 16
#define IDLE_SCAN_PERIOD 10 /* msec (use TICK_RESOLUTION = 1000) */
#define MAX_IDLE_TIME 30000
#define IDLE_SCAN_BUDGET 1024
#define NUM_ROOTS 512
#define MAX_EXTRA_PACKETS_TO_CHECK 7
#define MAX_NDPI_FLOWS 200000000
#define TICK_RESOLUTION 1000
#define MAX_NUM_IP_ADDRESS 5 /* len of ip address array */
#define UPDATED_TREE 1
#define AGGRESSIVE_PERCENT 95.00
#define DIR_SRC 10
#define DIR_DST 20
#define PORT_ARRAY_SIZE 20
#define HOST_ARRAY_SIZE 20
#define FLOWS_PACKETS_THRESHOLD 0.9
#define FLOWS_PERCENT_THRESHOLD 1.0
#define FLOWS_PERCENT_THRESHOLD_2 0.2
#define FLOWS_THRESHOLD 1000
#define PKTS_PERCENT_THRESHOLD 0.1
#define MAX_TABLE_SIZE_1 4096
#define MAX_TABLE_SIZE_2 8192
#define INIT_VAL -1
// inner hash table (ja3 -> security state)
typedef struct ndpi_ja3_info {
char * ja3;
ndpi_cipher_weakness unsafe_cipher;
UT_hash_handle hh;
} ndpi_ja3_info;
// external hash table (host ip -> <ip string, hash table ja3c, hash table ja3s>)
// used to aggregate ja3 fingerprints by hosts
typedef struct ndpi_host_ja3_fingerprints{
u_int32_t ip;
char *ip_string;
char *dns_name;
ndpi_ja3_info *host_client_info_hasht;
ndpi_ja3_info *host_server_info_hasht;
UT_hash_handle hh;
} ndpi_host_ja3_fingerprints;
//inner hash table
typedef struct ndpi_ip_dns{
u_int32_t ip;
char *ip_string;
char *dns_name; //server name if any;
UT_hash_handle hh;
} ndpi_ip_dns;
//hash table ja3 -> <host, ip, security>, used to aggregate host by ja3 fingerprints
typedef struct ndpi_ja3_fingerprints_host{
char *ja3; //key
ndpi_cipher_weakness unsafe_cipher;
ndpi_ip_dns *ipToDNS_ht;
UT_hash_handle hh;
} ndpi_ja3_fingerprints_host;
struct flow_metrics {
float entropy, average, stddev;
};
struct ndpi_entropy {
// Entropy fields
struct timeval src2dst_last_pkt_time, dst2src_last_pkt_time, flow_last_pkt_time;
u_int16_t src2dst_pkt_len[MAX_NUM_PKTS]; /*!< array of packet appdata lengths */
struct timeval src2dst_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
u_int16_t dst2src_pkt_len[MAX_NUM_PKTS]; /*!< array of packet appdata lengths */
struct timeval dst2src_pkt_time[MAX_NUM_PKTS]; /*!< array of arrival times */
struct timeval src2dst_start; /*!< first packet arrival time */
struct timeval dst2src_start; /*!< first packet arrival time */
u_int32_t src2dst_opackets; /*!< non-zero packet counts */
u_int32_t dst2src_opackets; /*!< non-zero packet counts */
u_int16_t src2dst_pkt_count; /*!< packet counts */
u_int16_t dst2src_pkt_count; /*!< packet counts */
u_int32_t src2dst_l4_bytes; /*!< packet counts */
u_int32_t dst2src_l4_bytes; /*!< packet counts */
u_int32_t src2dst_byte_count[MAX_BYTE_COUNT_ARRAY_LENGTH]; /*!< number of occurences of each byte */
u_int32_t dst2src_byte_count[MAX_BYTE_COUNT_ARRAY_LENGTH]; /*!< number of occurences of each byte */
u_int32_t src2dst_num_bytes;
u_int32_t dst2src_num_bytes;
double src2dst_bd_mean;
double src2dst_bd_variance;
double dst2src_bd_mean;
double dst2src_bd_variance;
float score;
};
// flow tracking
typedef struct ndpi_flow_info {
u_int32_t flow_id;
u_int32_t hashval;
u_int32_t src_ip;
u_int32_t dst_ip;
u_int16_t src_port;
u_int16_t dst_port;
u_int8_t detection_completed, protocol, bidirectional, check_extra_packets;
u_int16_t vlan_id;
struct ndpi_flow_struct *ndpi_flow;
char src_name[48], dst_name[48];
u_int8_t ip_version;
u_int64_t first_seen, last_seen;
u_int64_t src2dst_bytes, dst2src_bytes;
u_int32_t src2dst_packets, dst2src_packets;
u_int32_t has_human_readeable_strings;
char human_readeable_string_buffer[32];
// result only, not used for flow identification
ndpi_protocol detected_protocol;
// Flow data analysis
struct ndpi_analyze_struct *iat_c_to_s, *iat_s_to_c, *iat_flow,
*pktlen_c_to_s, *pktlen_s_to_c;
char info[96];
char host_server_name[256];
char bittorent_hash[41];
char dhcp_fingerprint[48];
struct {
u_int16_t ssl_version;
char client_info[64], server_info[64],
client_hassh[33], server_hassh[33],
server_organization[64],
ja3_client[33], ja3_server[33],
sha1_cert_fingerprint[20];
time_t notBefore, notAfter;
u_int16_t server_cipher;
ndpi_cipher_weakness client_unsafe_cipher, server_unsafe_cipher;
} ssh_tls;
struct {
char url[256];
u_int response_status_code;
} http;
void *src_id, *dst_id;
struct ndpi_entropy entropy;
struct ndpi_entropy last_entropy;
} ndpi_flow_info_t;
// flow statistics info
typedef struct ndpi_stats {
u_int32_t guessed_flow_protocols;
u_int64_t raw_packet_count;
u_int64_t ip_packet_count;
u_int64_t total_wire_bytes, total_ip_bytes, total_discarded_bytes;
u_int64_t protocol_counter[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
u_int64_t protocol_counter_bytes[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
u_int32_t protocol_flows[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
u_int32_t ndpi_flow_count;
u_int64_t tcp_count, udp_count;
u_int64_t mpls_count, pppoe_count, vlan_count, fragmented_count;
u_int64_t packet_len[6];
u_int16_t max_packet_len;
} ndpi_stats_t;
// flow preferences
typedef struct ndpi_workflow_prefs {
u_int8_t decode_tunnels;
u_int8_t quiet_mode;
u_int32_t num_roots;
u_int32_t max_ndpi_flows;
} ndpi_workflow_prefs_t;
struct ndpi_workflow;
/** workflow, flow, user data */
typedef void (*ndpi_workflow_callback_ptr) (struct ndpi_workflow *, struct ndpi_flow_info *, void *);
// workflow main structure
typedef struct ndpi_workflow {
u_int64_t last_time;
struct ndpi_workflow_prefs prefs;
struct ndpi_stats stats;
ndpi_workflow_callback_ptr __flow_detected_callback;
void * __flow_detected_udata;
ndpi_workflow_callback_ptr __flow_giveup_callback;
void * __flow_giveup_udata;
/* outside referencies */
pcap_t *pcap_handle;
/* allocated by prefs */
void **ndpi_flows_root;
struct ndpi_detection_module_struct *ndpi_struct;
u_int32_t num_allocated_flows;
} ndpi_workflow_t;
/* TODO: remove wrappers parameters and use ndpi global, when their initialization will be fixed... */
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs, pcap_t * pcap_handle);
/* workflow main free function */
void ndpi_workflow_free(struct ndpi_workflow * workflow);
/** Free flow_info ndpi support structures but not the flow_info itself
*
* TODO remove! Half freeing things is bad!
*/
void ndpi_free_flow_info_half(struct ndpi_flow_info *flow);
/* Process a packet and update the workflow */
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
const struct pcap_pkthdr *header,
const u_char *packet);
/* flow callbacks for complete detected flow
(ndpi_flow_info will be freed right after) */
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
workflow->__flow_detected_callback = callback;
workflow->__flow_detected_udata = udata;
}
/* flow callbacks for sufficient detected flow
(ndpi_flow_info will be freed right after) */
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
workflow->__flow_giveup_callback = callback;
workflow->__flow_giveup_udata = udata;
}
/* compare two nodes in workflow */
int ndpi_workflow_node_cmp(const void *a, const void *b);
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow);
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
void ndpi_flow_info_freer(void *node);
const char* print_cipher_id(u_int32_t cipher);
float ndpi_flow_get_byte_count_entropy(const uint32_t byte_count[256], unsigned int num_bytes);
extern int nDPI_LogLevel;
#endif
+1096
View File
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
src/lib/.libs
+1 -1
View File
@@ -7,4 +7,4 @@ Name: libndpi
Description: deep packet inspection library
Version: @VERSION@
Libs: -L${libdir} -lndpi
Cflags: -I${includedir}/libndpi-@VERSION@
Cflags: -I${includedir}/ndpi
-27
View File
@@ -1,27 +0,0 @@
ndpi_dump_protocols
ndpi_get_proto_name
ndpi_free
ndpi_guess_undetected_protocol
ndpi_tfind
ndpi_tsearch
ndpi_set_protocol_detection_bitmask2
ndpi_detection_get_sizeof_ndpi_id_struct
ndpi_detection_get_sizeof_ndpi_flow_struct
ndpi_load_protocols_file
ndpi_tdestroy
ndpi_exit_detection_module
ndpi_detection_process_packet
ndpi_twalk
ndpi_tdelete
ndpi_revision
ndpi_init_detection_module
ndpi_get_num_supported_protocols
ndpi_set_proto_defaults
ndpi_get_protocol_id
ndpi_find_port_based_protocol
ndpi_get_http_method
ndpi_get_http_url
ndpi_get_http_content_type
ndpi_free_flow
ndpi_get_proto_breed
ndpi_get_proto_breed_name
+270 -117
View File
@@ -19,10 +19,10 @@
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also link it with them as well. e.g. you should link with
# but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threads programs, you may wish to use these
# If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
@@ -30,8 +30,8 @@
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
@@ -82,35 +82,40 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 21
#serial 23
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# requires special compiler flags (e.g. on Tru64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CC="$CC"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
AC_MSG_RESULT([$ax_pthread_ok])
if test x"$ax_pthread_ok" = xno; then
if test "x$ax_pthread_ok" = "xno"; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
CC="$ax_pthread_save_CC"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
fi
# We must check for the threads library under a number of different
@@ -123,7 +128,7 @@ fi
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
@@ -132,82 +137,225 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
# (Note: HP C rejects this with "bad form for `-t' option")
# -pthreads: Solaris/gcc (Note: HP C also rejects)
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# doesn't hurt to check since this sometimes defines pthreads and
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
# is present but should not be used directly; and before -mthreads,
# because the compiler interprets this as "-mt" + "-hreads")
# -mthreads: Mingw32/gcc, Lynx/gcc
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case ${host_os} in
case $host_os in
freebsd*)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
;;
hpux*)
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
# multi-threading and also sets -lpthread."
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
;;
openedition*)
# IBM z/OS requires a feature-test macro to be defined in order to
# enable POSIX threads at all, so give the user a hint if this is
# not set. (We don't define these ourselves, as they can affect
# other portions of the system API in unpredictable ways.)
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
[
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
AX_PTHREAD_ZOS_MISSING
# endif
],
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
;;
solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
# tests will erroneously succeed. (N.B.: The stubs are missing
# pthread_cleanup_push, or rather a function called by this macro,
# so we could check for that, but who knows whether they'll stub
# that too in a future libc.) So we'll check first for the
# standard Solaris way of linking pthreads (-mt -lpthread).
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
;;
esac
# Clang doesn't consider unrecognized options an error unless we specify
# -Werror. We throw in some extra Clang-specific options to ensure that
# this doesn't happen for GCC, which also accepts -Werror.
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
save_CFLAGS="$CFLAGS"
ax_pthread_extra_flags="-Werror"
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
[AC_MSG_RESULT([yes])],
[ax_pthread_extra_flags=
AC_MSG_RESULT([no])])
CFLAGS="$save_CFLAGS"
AS_IF([test "x$GCC" = "xyes"],
[ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
# The presence of a feature test macro requesting re-entrant function
# definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled
case $flag in
case $host_os in
darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT"
;;
aix*)
ax_pthread_check_macro="_THREAD_SAFE"
;;
*)
ax_pthread_check_macro="--"
;;
esac
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
[ax_pthread_check_cond=0],
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
# Are we compiling with Clang?
AC_CACHE_CHECK([whether $CC is Clang],
[ax_cv_PTHREAD_CLANG],
[ax_cv_PTHREAD_CLANG=no
# Note that Autoconf sets GCC=yes for Clang as well as GCC
if test "x$GCC" = "xyes"; then
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
# if defined(__clang__) && defined(__llvm__)
AX_PTHREAD_CC_IS_CLANG
# endif
],
[ax_cv_PTHREAD_CLANG=yes])
fi
])
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
ax_pthread_clang_warning=no
# Clang needs special handling, because older versions handle the -pthread
# option in a rather... idiosyncratic way
if test "x$ax_pthread_clang" = "xyes"; then
# Clang takes -pthread; it has never supported any other flag
# (Note 1: This will need to be revisited if a system that Clang
# supports has POSIX threads in a separate library. This tends not
# to be the way of modern systems, but it's conceivable.)
# (Note 2: On some systems, notably Darwin, -pthread is not needed
# to get POSIX threads support; the API is always present and
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
# -pthread does define _REENTRANT, and while the Darwin headers
# ignore this macro, third-party headers might not.)
PTHREAD_CFLAGS="-pthread"
PTHREAD_LIBS=
ax_pthread_ok=yes
# However, older versions of Clang make a point of warning the user
# that, in an invocation where only linking and no compilation is
# taking place, the -pthread option has no effect ("argument unused
# during compilation"). They expect -pthread to be passed in only
# when source code is being compiled.
#
# Problem is, this is at odds with the way Automake and most other
# C build frameworks function, which is that the same flags used in
# compilation (CFLAGS) are also used in linking. Many systems
# supported by AX_PTHREAD require exactly this for POSIX threads
# support, and in fact it is often not straightforward to specify a
# flag that is used only in the compilation phase and not in
# linking. Such a scenario is extremely rare in practice.
#
# Even though use of the -pthread flag in linking would only print
# a warning, this can be a nuisance for well-run software projects
# that build with -Werror. So if the active version of Clang has
# this misfeature, we search for an option to squash it.
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
# Create an alternate version of $ac_link that compiles and
# links in two steps (.c -> .o, .o -> exe) instead of one
# (.c -> exe), because the warning occurs only in the second
# step
ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
ac_link="$ax_pthread_save_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[ac_link="$ax_pthread_2step_ac_link"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
[break])
])
done
ac_link="$ax_pthread_save_ac_link"
CFLAGS="$ax_pthread_save_CFLAGS"
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
])
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
no | unknown) ;;
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
esac
fi # $ax_pthread_clang = yes
if test "x$ax_pthread_ok" = "xno"; then
for ax_pthread_try_flag in $ax_pthread_flags; do
case $ax_pthread_try_flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-mt,pthread)
AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
PTHREAD_CFLAGS="-mt"
PTHREAD_LIBS="-lpthread"
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
PTHREAD_CFLAGS="$ax_pthread_try_flag"
;;
pthread-config)
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
if test x"$ax_pthread_config" = xno; then continue; fi
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
PTHREAD_LIBS="-l$ax_pthread_try_flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
@@ -218,7 +366,11 @@ for flag in $ax_pthread_flags; do
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
# if $ax_pthread_check_cond
# error "$ax_pthread_check_macro must be defined"
# endif
static void routine(void *a) { a = 0; }
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
@@ -227,16 +379,14 @@ for flag in $ax_pthread_flags; do
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
[ax_pthread_ok=yes],
[])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
AC_MSG_RESULT([$ax_pthread_ok])
if test "x$ax_pthread_ok" = xyes; then
break;
fi
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
@@ -244,71 +394,74 @@ done
fi
# Various other checks:
if test "x$ax_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
if test "x$ax_pthread_ok" = "xyes"; then
ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $attr; return attr /* ; */])],
[attr_name=$attr; break],
[])
done
AC_MSG_RESULT([$attr_name])
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_CACHE_CHECK([for joinable pthread attribute],
[ax_cv_PTHREAD_JOINABLE_ATTR],
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $ax_pthread_attr; return attr /* ; */])],
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
[])
done
])
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
[$ax_cv_PTHREAD_JOINABLE_ATTR],
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
ax_pthread_joinable_attr_defined=yes
])
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case ${host_os} in
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
osf* | hpux*) flag="-D_REENTRANT";;
solaris*)
if test "$GCC" = "yes"; then
flag="-D_REENTRANT"
else
# TODO: What about Clang on Solaris?
flag="-mt -D_REENTRANT"
fi
;;
esac
AC_MSG_RESULT([$flag])
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $host_os in
solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;;
esac
])
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
test "x$ax_pthread_special_flags_added" != "xyes"],
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
ax_pthread_special_flags_added=yes])
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
[ax_cv_PTHREAD_PRIO_INHERIT], [
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
[ax_cv_PTHREAD_PRIO_INHERIT],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
[[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
ax_pthread_prio_inherit_defined=yes
])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
CFLAGS="$ax_pthread_save_CFLAGS"
LIBS="$ax_pthread_save_LIBS"
# More AIX lossage: compile with *_r variant
if test "x$GCC" != xyes; then
if test "x$GCC" != "xyes"; then
case $host_os in
aix*)
AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"],
[x/*],
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
;;
esac
fi
@@ -321,7 +474,7 @@ AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$ax_pthread_ok" = xyes; then
if test "x$ax_pthread_ok" = "xyes"; then
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
:
else
-4
View File
@@ -1,4 +0,0 @@
This package is a GPL implementation of an iptables and netfilter module for
nDPI integration into the Linux kernel.
https://github.com/ewildgoose/ndpi-netfilter
+1
View File
@@ -0,0 +1 @@
ubuntu
+1
View File
@@ -0,0 +1 @@
/usr/local/lib
+16 -6
View File
@@ -1,9 +1,16 @@
require "formula"
class Ndpi < Formula
desc "Deep Packet Inspection (DPI) library"
homepage "http://www.ntop.org/products/ndpi/"
url "https://downloads.sourceforge.net/project/ntop/nDPI/libndpi-1.5.1.tar.gz"
sha1 "0a6ed585545ab6611f3f0ac9efd9eb36bb5481dd"
url "https://downloads.sourceforge.net/project/ntop/nDPI/nDPI-1.8.tgz"
sha256 "f490137a7387b69d0d55e990f2150b86d7b5eaae870e5326e8c2f18c17412443"
bottle do
cellar :any
sha256 "05053767fc3c70557745c348c7352e7c2716c040ca54c5cf8d5306167c878fcb" => :el_capitan
sha256 "34c0269039a0079820eeed862daa28158d9291f73f640a9415da60746d69a662" => :yosemite
sha256 "a2af4dc62c24313593b3a20e45ca9d2d49f8efc0ea5e52fd064001ea441b93e4" => :mavericks
sha256 "1bb200268a4d9df9bbe5d33bc773ee3bcf4b5d4fa00c76a040f16318438c284f" => :mountain_lion
end
depends_on "autoconf" => :build
depends_on "automake" => :build
@@ -11,13 +18,16 @@ class Ndpi < Formula
depends_on "libtool" => :build
depends_on "json-c"
head "https://github.com/ntop/nDPI.git", :branch => "dev"
def install
system "./configure","--prefix=#{prefix}"
system "./autogen.sh"
system "./configure", "--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
system "#{bin}/ndpiReader","-h"
system "#{bin}/ndpiReader", "-i", test_fixtures("test.pcap")
end
end
+59
View File
@@ -0,0 +1,59 @@
#
# Copyright (C) 2018 - ntop.org
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libndpi
PKG_VERSION:=1333.ab2f3ce
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/ntop/nDPI.git
PKG_SOURCE_VERSION:=ab2f3cefc89017d73e67faa4eb4011e7e3f2044d
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_PROTO:=git
PKG_MAINTAINER:=Emanuele Faranda <faranda@ntop.org>
PKG_LICENSE:=GPL3
PKG_BUILD_DEPENDS:=+libpcap
PKG_BUILD_PARALLEL:=1
# autogen fix
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
define Package/libndpi
SECTION:=network
CATEGORY:=Network
#DEPENDS:=+libc +libjson-c +libpthread
TITLE:=nDPI Deep Packet Inspection Library
URL:=https://www.ntop.org
endef
define Package/libndpi/description
Open and Extensible GPLv3 Deep Packet Inspection Library
endef
CONFIGURE_ARGS += \
--with-pic \
--disable-json-c \
define Build/Prepare
$(call Build/Prepare/Default)
endef
define Build/Configure
( cd $(PKG_BUILD_DIR); ./autogen.sh )
$(call Build/Configure/Default)
endef
define Build/InstallDev
$(INSTALL_DIR) $(STAGING_DIR)/usr/local/include/libndpi
$(CP) $(PKG_BUILD_DIR)/src/include/* $(STAGING_DIR)/usr/local/include/libndpi
$(INSTALL_DIR) $(STAGING_DIR)/usr/local/lib
$(CP) $(PKG_BUILD_DIR)/src/lib/libndpi.* $(STAGING_DIR)/usr/local/lib
endef
$(eval $(call BuildPackage,libndpi))
+38
View File
@@ -0,0 +1,38 @@
#
# RPM Build Process
#
APPL=ndpi
PLATFORM=@PLATFORM@
GIT_REVISION=@GIT_REVISION@
PACKAGE_VERSION=@PACKAGE_VERSION@
PACKAGE=$(APPL)-$(PACKAGE_VERSION)-$(GIT_REVISION).$(PLATFORM).rpm
DEV_PACKAGE=$(APPL)-dev-$(PACKAGE_VERSION)-$(GIT_REVISION).$(PLATFORM).rpm
PACKAGE_PATH=$(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
package: build-rpm
build-src:
cd ../..; ./autogen.sh; ./configure; make clean; make
cleanup-rpm:
rm -rf $(HOME)/rpmbuild/BUILD/ndpi* $(HOME)/rpmbuild/SOURCES/ndpi*
build-rpm: build-src cleanup-rpm
-rm -rf ndpi-@PACKAGE_VERSION@
mkdir -p ndpi-@PACKAGE_VERSION@/packages
cp ndpi.spec.in ndpi-@PACKAGE_VERSION@/packages
cp ../../Makefile.* ../../libtool ../../configure* ../../config.* ../../install-sh ../../autogen.sh ndpi-@PACKAGE_VERSION@
cp -rf ../../src ndpi-@PACKAGE_VERSION@
cp ../../CHANGELOG.md ../../COPYING ndpi-@PACKAGE_VERSION@
\rm -f ndpi-@PACKAGE_VERSION@/config.status
mkdir -p $(HOME)/rpmbuild/SOURCES
tar cvfz $(HOME)/rpmbuild/SOURCES/ndpi-@PACKAGE_VERSION@.tgz ndpi-@PACKAGE_VERSION@
@rm -f $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
@rpmbuild -bb ./$(APPL).spec --define "buildnumber $(GIT_REVISION)"
@if [[ $EUID -ne 0 ]]; then ./rpm-sign.exp $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE); fi
@if [[ $EUID -ne 0 ]]; then ./rpm-sign.exp $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(DEV_PACKAGE); fi
@echo ""
@echo "Package contents:"
@rpm -qpl $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
@echo "The package is now available in $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)"
Vendored Executable
+2869
View File
File diff suppressed because it is too large Load Diff
+44
View File
@@ -0,0 +1,44 @@
AC_INIT([Makefile.in], 1.0)
DATE=`date -R`
KERNEL=`uname -r`
PLATFORM=`uname -p`
MACHINE=`uname -m`
SHORT_MACHINE=`uname -m | cut -b1-3`
EXTN=""
if test $MACHINE = "x86_64"; then
EXTN="amd64"
else
if test $SHORT_MACHINE = "aar"; then
EXTN="arm64"
else
if test $SHORT_MACHINE = "arm"; then
EXTN="armhf"
else
if test $SHORT_MACHINE = "mip"; then
EXTN="mips"
else
EXTN="i386"
fi
fi
fi
fi
PACKAGE_VERSION=`../version.sh --release`
MAJOR_RELEASE=`../version.sh --major-release`
GIT_REVISION=`../version.sh --revision`
AC_CONFIG_FILES([Makefile ndpi.spec])
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(PLATFORM)
AC_SUBST(MACHINE)
AC_SUBST(EXTN)
AC_SUBST(DATE)
AC_SUBST(KERNEL)
AC_SUBST(GIT_REVISION)
AC_SUBST(MAJOR_RELEASE)
AC_OUTPUT
+91
View File
@@ -0,0 +1,91 @@
Summary: L7 DPI library
Name: ndpi
Version: @PACKAGE_VERSION@
Release: %{buildnumber}
License: LGPL
Group: Networking/Utilities
URL: http://www.ntop.org/products/deep-packet-inspection/ndpi/
Source: ndpi-%{version}.tgz
Packager: Luca Deri <deri@ntop.org>
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%{?el7:Requires: glibc >= 2.3.4 numactl coreutils }
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils }
AutoReqProv: no
%description
nDPI Open and Extensible LGPLv3 Deep Packet Inspection Library.
%package dev
Summary: Header files and development libraries for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description dev
This package contains the header files and development libraries
for %{name}. If you like to develop programs using %{name},
you will need to install %{name}-dev.
%prep
%setup -q
# Execution order:
# install: pre -> (copy) -> post
# upgrade: pre -> (copy) -> post -> preun (old) -> (delete old) -> postun (old)
# un-install: preun -> (delete) -> postun
%pre
%post
%build
PATH=/usr/bin:/bin:/usr/sbin:/sbin
%define includedir /usr/local/include/ndpi
%define libdir /usr/local/lib
%define bindir /usr/local/bin
%install
PATH=/usr/bin:/bin:/usr/sbin:/sbin
if [ -d $RPM_BUILD_ROOT ]; then
\rm -rf $RPM_BUILD_ROOT
fi
mkdir -p $RPM_BUILD_ROOT%{includedir}
mkdir -p $RPM_BUILD_ROOT%{libdir}
mkdir -p $RPM_BUILD_ROOT%{bindir}
cd $HOME/nDPI; make DESTDIR=$RPM_BUILD_ROOT install;
rm $RPM_BUILD_ROOT%{libdir}/libndpi.so
rm $RPM_BUILD_ROOT%{libdir}/libndpi.so.?
cd $RPM_BUILD_ROOT%{libdir}/; ln -s libndpi.so.@PACKAGE_VERSION@ libndpi.so.@MAJOR_RELEASE@; cd -
cd $RPM_BUILD_ROOT%{libdir}/; ln -s libndpi.so.@PACKAGE_VERSION@ libndpi.so; cd -
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
cp $HOME/nDPI/packages/etc/ld.so.conf.d/ndpi.conf $RPM_BUILD_ROOT/etc/ld.so.conf.d
rm -rf $RPM_BUILD_ROOT/usr/local/sbin/ndpi
strip $RPM_BUILD_ROOT%{bindir}/*
rm -fr %{buildroot}%{includedir}/ndpi_win32.h
#sed -i -e "s/#include \"ndpi_win32.h\"//g" %{buildroot}%{includedir}/ndpi_main.h
%clean
rm -fr $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
/usr/local/lib/libndpi.so
/usr/local/lib/libndpi.so.@MAJOR_RELEASE@
/usr/local/lib/libndpi.so.@PACKAGE_VERSION@
/usr/local/bin/ndpiReader
/etc/ld.so.conf.d/ndpi.conf
%{libdir}/pkgconfig/libndpi.pc
%preun
%files dev
%defattr(-,root,root,-)
%{includedir}
%{libdir}/libndpi.a
%changelog
* Mon Nov 19 2018 Alfredo Cardigliano <cardigliano@ntop.org> 2.5
- Initial package version
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/expect -f
### rpm-sign.exp -- Sign RPMs by sending the passphrase.
spawn rpm --addsign {*}$argv
expect -exact "Enter pass phrase: "
send -- "\r"
expect eof
## end of rpm-sign.exp
-42
View File
@@ -1,42 +0,0 @@
#
# Change it according to your setup
#
NDPI_HOME=$(PWD)/../..
NDPI_BUILD=${NDPI_HOME}/packages/ubuntu
all: clean ndpi
ndpi:
\rm -rf ./usr ./debian/tmp ./debian/ndpi-dev
mkdir -p ./usr/local ./debian/ndpi-dev
mkdir -p ./usr/local/ndpi/lib ./usr/local/ndpi/bin ./ndpi-dev/usr/local/include/ndpi/
cd ${NDPI_HOME}; ./autogen.sh; ./configure; make
cp $(NDPI_HOME)/lib/libndpi.a $(NDPI_HOME)/lib/libndpi.so* ./usr/local/ndpi/lib/
cp $(NDPI_HOME)/example/ndpiReader ./usr/local/ndpi/bin/
cp $(NDPI_HOME)/src/include/*.h ndpi-dev/usr/local/include/ndpi/
-rm -fr ndpi-dev/usr/local/include/nprobe/ndpi/.svn ndpi-dev/usr/local/include/ndpi/Makefile* ndpi-dev/usr/local/include/ndpi/ndpi_win32.h* ndpi-dev/usr/local/include/ndpi/include
-find ./usr/local/lib -name "*.la" -exec /bin/rm {} ';'
@echo
@find . -name "*~" -exec /bin/rm {} ';'
dpkg-buildpackage -rfakeroot -d -us -uc
dpkg-sig --sign builder -k 7921DF34 ../ndpi*deb
@\rm -f ../ndpi*dsc ../ndpi*.gz ../ndpi*changes
@/bin/mv ../ndpi*deb .
@echo
@echo "Package built."
@/bin/ls ndpi*deb
@echo "-------------------------------"
-dpkg --contents ndpi*amd64.deb
@echo "-------------------------------"
@echo "-------------------------------"
-dpkg --contents ndpi*all.deb
@echo "-------------------------------"
distclean:
echo "dummy distclean"
install:
echo "dummy install"
clean:
-rm -rf *~ *deb debian/tmp ./usr
+17 -13
View File
@@ -7,29 +7,33 @@ NDPI_BUILD=${NDPI_HOME}/packages/ubuntu
all: clean ndpi
ndpi:
\rm -rf ./usr ./debian/tmp ./debian/ndpi-dev
mkdir -p ./usr/local ./debian/ndpi-dev
mkdir -p ./usr/local/ndpi/lib ./usr/local/ndpi/bin ./ndpi-dev/usr/local/include/ndpi/
\rm -rf ./debian/ndpi-tmp ./debian/ndpi-dev-tmp ./debian/ndpi ./debian/ndpi-dev
mkdir -p ./debian/ndpi-tmp ./debian/ndpi-dev-tmp
mkdir -p ./debian/ndpi-tmp/usr/local/lib ./debian/ndpi-tmp/usr/local/bin
mkdir -p ./debian/ndpi-dev-tmp/usr/local/lib ./debian/ndpi-dev-tmp/usr/local/include/ndpi
cd ${NDPI_HOME}; ./autogen.sh; ./configure; make
cp $(NDPI_HOME)/lib/libndpi.a $(NDPI_HOME)/lib/libndpi.so* ./usr/local/ndpi/lib/
cp $(NDPI_HOME)/example/ndpiReader ./usr/local/ndpi/bin/
cp $(NDPI_HOME)/src/include/*.h ndpi-dev/usr/local/include/ndpi/
-rm -fr ndpi-dev/usr/local/include/nprobe/ndpi/.svn ndpi-dev/usr/local/include/ndpi/Makefile* ndpi-dev/usr/local/include/ndpi/ndpi_win32.h* ndpi-dev/usr/local/include/ndpi/include
-find ./usr/local/lib -name "*.la" -exec /bin/rm {} ';'
cp $(NDPI_HOME)/src/lib/libndpi.so.@NDPI_VERS@ ./debian/ndpi-tmp/usr/local/lib/
cd ./debian/ndpi-tmp/usr/local/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so; cd -
cd ./debian/ndpi-tmp/usr/local/lib/; ln -s libndpi.so.@NDPI_VERS@ libndpi.so.@MAJOR_RELEASE@; cd -
cp $(NDPI_HOME)/src/lib/libndpi.a ./debian/ndpi-dev-tmp/usr/local/lib/
cp $(NDPI_HOME)/example/ndpiReader ./debian/ndpi-tmp/usr/local/bin/
cp $(NDPI_HOME)/src/include/*.h ./debian/ndpi-dev-tmp/usr/local/include/ndpi/
-rm -fr ./debian/ndpi-dev-tmp/usr/local/include/ndpi/ndpi_win32.h*
@echo
@find . -name "*~" -exec /bin/rm {} ';'
@find ./debian/ndpi-tmp -name "*~" -exec /bin/rm {} ';'
@find ./debian/ndpi-dev-tmp -name "*~" -exec /bin/rm {} ';'
dpkg-buildpackage -rfakeroot -d -us -uc
dpkg-sig --sign builder -k 7921DF34 ../ndpi*deb
dpkg-sig --sign builder -k D1EB60BE ../ndpi*deb
@\rm -f ../ndpi*dsc ../ndpi*.gz ../ndpi*changes
@/bin/mv ../ndpi*deb .
@echo
@echo "Package built."
@/bin/ls ndpi*deb
@echo "-------------------------------"
-dpkg --contents ndpi*amd64.deb
-dpkg --contents ndpi_*.deb
@echo "-------------------------------"
@echo "-------------------------------"
-dpkg --contents ndpi*all.deb
-dpkg --contents ndpi-dev_*.deb
@echo "-------------------------------"
distclean:
@@ -39,4 +43,4 @@ install:
echo "dummy install"
clean:
-rm -rf *~ *deb debian/tmp ./usr
-rm -rf *~ *deb ./usr ./debian/ndpi ./debian/ndpi-dev ./debian/ndpi-tmp ./debian/ndpi-dev-tmp
+42 -25
View File
@@ -583,13 +583,12 @@ PACKAGE_URL=''
ac_subst_vars='LTLIBOBJS
LIBOBJS
PFRING_SVN_RELEASE
SVN_RELEASE
MAJOR_RELEASE
GIT_REVISION
KERNEL
DATE
EXTN
MACHINE
PFRING_VERS
NDPI_VERS
target_alias
host_alias
@@ -610,6 +609,7 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -674,6 +674,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -926,6 +927,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1063,7 +1073,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1216,6 +1226,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1670,20 +1681,35 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
NDPI_VERS=`cat ../../config.h | grep -w VERSION | cut -d \" -f 2`
PFRING_VERS=`cat $HOME/PF_RING/kernel/linux/pf_ring.h | grep RING_VERSION | head -1 | cut -d '"' -f 2`
SVN_RELEASE=`svn info ../.. | grep "^Revision"|cut -d " " -f 2`
PFRING_SVN_RELEASE=`svn info $HOME/PF_RING | grep "^Revision"|cut -d " " -f 2`
MACHINE=`uname -m`
if test $MACHINE = "x86_64"; then
EXTN="amd64"
else
EXTN="i386"
fi
DATE=`date -R`
KERNEL=`uname -r`
MACHINE=`uname -m`
SHORT_MACHINE=`uname -m | cut -b1-3`
EXTN=""
if test $MACHINE = "x86_64"; then
EXTN="amd64"
else
if test $SHORT_MACHINE = "aar"; then
EXTN="arm64"
else
if test $SHORT_MACHINE = "arm"; then
EXTN="armhf"
else
if test $SHORT_MACHINE = "mip"; then
EXTN="mips"
else
EXTN="i386"
fi
fi
fi
fi
NDPI_VERS=`../version.sh --release`
MAJOR_RELEASE=`../version.sh --major-release`
GIT_REVISION=`../version.sh --revision`
ac_config_files="$ac_config_files Makefile debian/changelog debian/files debian/control"
@@ -1694,15 +1720,6 @@ KERNEL=`uname -r`
ac_config_files="$ac_config_files Makefile"
ac_config_files="$ac_config_files debian/changelog"
ac_config_files="$ac_config_files debian/files"
ac_config_files="$ac_config_files debian/control"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
+29 -20
View File
@@ -1,32 +1,41 @@
AC_INIT([Makefile.in], 1.0)
NDPI_VERS=`cat ../../config.h | grep -w VERSION | cut -d \" -f 2`
PFRING_VERS=`cat $HOME/PF_RING/kernel/linux/pf_ring.h | grep RING_VERSION | head -1 | cut -d '"' -f 2`
SVN_RELEASE=`svn info ../.. | grep "^Revision"|cut -d " " -f 2`
PFRING_SVN_RELEASE=`svn info $HOME/PF_RING | grep "^Revision"|cut -d " " -f 2`
MACHINE=`uname -m`
if test $MACHINE = "x86_64"; then
EXTN="amd64"
else
EXTN="i386"
fi
DATE=`date -R`
KERNEL=`uname -r`
MACHINE=`uname -m`
SHORT_MACHINE=`uname -m | cut -b1-3`
EXTN=""
if test $MACHINE = "x86_64"; then
EXTN="amd64"
else
if test $SHORT_MACHINE = "aar"; then
EXTN="arm64"
else
if test $SHORT_MACHINE = "arm"; then
EXTN="armhf"
else
if test $SHORT_MACHINE = "mip"; then
EXTN="mips"
else
EXTN="i386"
fi
fi
fi
fi
NDPI_VERS=`../version.sh --release`
MAJOR_RELEASE=`../version.sh --major-release`
GIT_REVISION=`../version.sh --revision`
AC_CONFIG_FILES([Makefile debian/changelog debian/files debian/control])
AC_SUBST(NDPI_VERS)
AC_SUBST(PFRING_VERS)
AC_SUBST(MACHINE)
AC_SUBST(EXTN)
AC_SUBST(DATE)
AC_SUBST(KERNEL)
AC_SUBST(SVN_RELEASE)
AC_SUBST(PFRING_SVN_RELEASE)
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(debian/changelog)
AC_CONFIG_FILES(debian/files)
AC_CONFIG_FILES(debian/control)
AC_SUBST(GIT_REVISION)
AC_SUBST(MAJOR_RELEASE)
AC_OUTPUT
+1 -1
View File
@@ -1,2 +1,2 @@
This directory contains the files needed to build the package
named 'nprobe' for the Debian GNU/Linux distribution.
named 'ndpi' for the Debian GNU/Linux distribution.
+1 -1
View File
@@ -1,4 +1,4 @@
ndpi (@NDPI_VERS@-@SVN_RELEASE@) stable; urgency=high
ndpi (@NDPI_VERS@-@GIT_REVISION@) stable; urgency=high
* Last packaged version
-- Luca Deri <deri@ntop.org> @DATE@
+1 -1
View File
@@ -1 +1 @@
1
9
+5 -7
View File
@@ -2,27 +2,25 @@ Source: ndpi
Section: free
Priority: optional
Maintainer: Luca Deri <deri@ntop.org>
Standards-Version: @NDPI_VERSION@
Standards-Version: @NDPI_VERS@
Build-Depends:
Build-Conflicts:
Package: ndpi
Architecture: @EXTN@
Depends: pfring (=@PFRING_VERS@-@PFRING_SVN_RELEASE@), libnuma
Depends: libnuma1
Recommends:
Suggests:
Pre-Depends:
Conflicts:
Provides:
Replaces:
Description: A network probe.
Description: A L7 DPI library.
Package: ndpi-dev
Section: libdevel
Architecture: all
Architecture: @EXTN@
Depends: ndpi (= ${binary:Version}), ${misc:Depends}
Conflicts:
Description: development library and header files for ndpi
Headers, static libraries, and documentation for the ndpi library
Description: Development library and header files for ndpi
-1
View File
@@ -1 +0,0 @@
usr/local/ndpi
-11
View File
@@ -17,18 +17,7 @@ esac
umask 022
# Update shared libs
echo "/usr/local/lib\n" > /etc/ld.so.conf.d/nprobe.conf
echo "Rebuilding ld cache..."
/sbin/ldconfig
echo "Adding the nprobe startup script"
update-rc.d nprobe defaults 93 >/dev/null
echo "Making the /etc/nprobe directory..."
mkdir -p /etc/nprobe/
echo "Making the /var/log/nprobe directory..."
mkdir -p /var/log/nprobe
exit 0
-6
View File
@@ -2,12 +2,6 @@
set -e
#\/bin/rm /etc/ld.so.conf.d/nprobe.conf
/sbin/ldconfig
# Not needed: upstart does it
if [ "$1" = "purge" ] ; then
update-rc.d nprobe remove >/dev/null
fi
exit 0
+1 -6
View File
@@ -1,5 +1,5 @@
#! /bin/sh
# preinst script for nbox
# preinst script
#
# see: dh_installdeb(1)
@@ -13,9 +13,6 @@ set -e
case "$1" in
install|upgrade)
if test -f /usr/local/sbin/nprobe; then
rm /usr/local/sbin/nprobe
fi
;;
abort-upgrade)
@@ -30,6 +27,4 @@ esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0
+1 -5
View File
@@ -1,14 +1,10 @@
#!/bin/sh -e
# Only shut the daemon down if we're really removing the package. If this is
# an upgrade, we will instead do a restart in the postinst... this keeps nprobe
# from being left shut down for a long time, which could pose problems.
case "$1" in
upgrade)
;;
*)
/etc/init.d/nprobe stop
;;
esac
exit 0
exit 0
+7 -16
View File
@@ -1,16 +1,7 @@
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
#
# debian/compat
# We should use at least comparibily version 5
# but this requires the whole building process
# to be remade and this is something we leave
# to when we will have more time
# http://www.tin.org/bin/man.cgi?section=7&topic=debhelper
#
export DH_VERBOSE=1
package=ndpi
@@ -37,20 +28,20 @@ binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_clean -k
dh_prep
#dh_clean -k
dh_installdirs
dh_installinit
dh_installman
# install the files into debian/tmp.
cp -r ./usr/ ./debian/tmp
cp -r ./ndpi-dev/* ./debian/ndpi-dev/
-find ./debian/tmp -name .svn -exec /bin/rm -rf {} ';'
-find ./debian/tmp -executable -type f |xargs strip
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
mkdir -p ./debian/ndpi ./debian/ndpi-dev
cp -r ./debian/ndpi-tmp/* ./debian/ndpi/
cp -r ./debian/ndpi-dev-tmp/* ./debian/ndpi-dev/
-find ./debian/ndpi -executable -type f | xargs strip
dh_gencontrol
dh_md5sums
dh_builddeb
+46
View File
@@ -0,0 +1,46 @@
#!/bin/bash
SCRIPTPATH="$(cd "$(dirname "$0")"; pwd -P)"
RELEASE="$(cd ${SCRIPTPATH}; cat ../configure.ac|grep C_INIT|cut -c 21-|rev|cut -c 3-|rev)"
MAJOR_RELEASE="$(cd ${SCRIPTPATH}; cat ../configure.ac|grep C_INIT|cut -c 21-|rev|cut -c 3-|rev|cut -d. -f1)"
REVISION="$(cd ${SCRIPTPATH}; git rev-list --all |wc -l | tr -d '[[:space:]]')"
get_release() {
echo "${RELEASE}"
exit 0
}
get_major_release() {
echo "${MAJOR_RELEASE}"
exit 0
}
get_revision() {
echo "${REVISION}"
exit 0
}
get_version() {
echo "${RELEASE}-${REVISION}"
exit 0
}
case "$1" in
--release)
get_release;
;;
--major-release)
get_major_release;
;;
--revision)
get_revision;
;;
--version)
get_version;
;;
*)
echo "Usage: ${0} {--release|--major-release|--revision|--version}"
exit 1
esac
exit 0
+26
View File
@@ -0,0 +1,26 @@
CC=@CC@
CFLAGS=-I. -I../src/include -I./src/lib/third_party/include -shared -Wl,
#LIBNDPI=../src/lib/libndpi.so.@NDPI_VERSION_SHORT@
LIBNDPI=../src/lib/libndpi.a
LDFLAGS=$(CFILE) $(LIBNDPI) -lpcap
SHARE = -soname,ndpi_wrap
SO=ndpi_wrap.so
OBJS = ndpi_wrap.o
CFILE = ndpi_wrap.c
PIC = -fPIC
PREFIX?=/usr/local
.PHONY: all
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)#do something for linux
SHARE=-install_name,ndpiReader.so
endif
all: $(SO)
$(SO): $(CFILE) $(LIBNDPI) Makefile
$(CC) $(CFLAGS)$(SHARE) -o $@ $(PIC) $(LDFLAGS)
# ln -s $(LIBNDPI) .
clean:
/bin/rm -f $(SO)
+7
View File
@@ -0,0 +1,7 @@
This direcgory contains the Python bindings for nDPI
Usage:
- python3 ndpi_example.py <interface>
- python3 ndpi_example.py <pcap_file>
Code courtesy of Massimo Puddu
+252
View File
@@ -0,0 +1,252 @@
#!/usr/bin/env python3
#
# ndpi_example.py
#
# Copyright (C) 2011-19 - 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/>.
#
from ndpi_typestruct import *
from scapy.all import *
# ------- return type & pcapstruct to declare -------
class workflow(Structure):
_fields_ = [("src_ip", c_uint32),
("dst_ip", c_uint32),
("src_port", c_uint16),
("dst_port", c_uint16),
("protocol", c_uint8),
("packets", c_uint32),
("detected_protocol", ndpi_protocol),
("detection_completed", c_uint8),
("id", c_uint32),
("src_id", POINTER(ndpi_id_struct)),
("dst_id", POINTER(ndpi_id_struct)),
("flow", POINTER(ndpi_flow_struct))]
CMCFUN = CFUNCTYPE(c_int, c_void_p, c_void_p)
GUESS = CFUNCTYPE(None, c_void_p, c_int32, c_int, c_void_p)
FREE = CFUNCTYPE(None, c_void_p)
def node_proto_guess_walker(nodo, which, depth, user_data):
global ndpi_info_mod
flow = cast(nodo, POINTER(POINTER(workflow))).contents.contents
if which == 0 or which == 3: #execute only preorder operation of the tree
if flow.detection_completed == 0: # order for tree operation
flow.detected_protocol = ndpi.ndpi_detection_giveup(ndpi_info_mod, flow.flow, flow.protocol,
int(socket.ntohl(flow.src_ip)), 1)
count_protocol[flow.detected_protocol.app_protocol] += flow.packets
def py_cmp_fun(a, b):
fa = cast(a, POINTER(workflow))
fb = cast(b, POINTER(workflow))
if fa.contents.src_ip < fb.contents.src_ip: return -1
elif fa.contents.src_ip > fb.contents.src_ip: return 1
if fa.contents.src_port < fb.contents.src_port: return -1
elif fa.contents.src_port > fb.contents.src_port: return 1
if fa.contents.dst_ip < fb.contents.dst_ip: return -1
elif fa.contents.dst_ip > fb.contents.dst_ip: return 1
if fa.contents.dst_port < fb.contents.dst_port: return -1
elif fa.contents.dst_port > fb.contents.dst_port: return 1
if fa.contents.protocol < fb.contents.protocol: return -1
elif fa.contents.protocol > fb.contents.protocol: return 1
return 0
def freer(a):
pass
cmp_func = CMCFUN(py_cmp_fun)
guess_walker = GUESS(node_proto_guess_walker)
free_walk = FREE(freer)
# --------------------------------------
# number of anylized packet
packet_number = 0
flow_count = 0
max_num_udp_dissected_pkts = 16
max_num_tcp_dissected_pkts = 10
flows_root = c_void_p(None)
flows_root_ref = pointer(flows_root)
count_protocol = (c_int32 * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + ndpi.ndpi_wrap_ndpi_max_num_custom_protocols() + 1))()
lista = [] # used to avoid impropriate memory deallocation from python
# check ndpi version
if ndpi.ndpi_get_api_version() != ndpi.ndpi_wrap_get_api_version():
print("nDPI Library version mismatch: please make sure this code and the nDPI library are in sync\n")
sys.exit(-1)
# create data structure of ndpi
ndpi_info_mod = ndpi.ndpi_init_detection_module()
if ndpi_info_mod is None:
sys.exit(-1)
def ip2int(ip):
"""
Convert an IP string to long and then c_uint32
"""
packedIP = socket.inet_aton(ip)
return int(struct.unpack("!I", packedIP)[0])
def get_flow(packet):
global flows_root
global flows_root_ref
global flow_count
ip_packet = packet[1]
ip_protocol = ip_packet.proto
transport_packet = None
if ip_protocol == 6 or ip_protocol == 17: transport_packet = packet[2]
if transport_packet is not None:
# to avoid two nodes in one binary tree for a flow
ip_src = ip2int(ip_packet.src)
ip_dst = ip2int(ip_packet.dst)
src_port = transport_packet.sport
dst_port = transport_packet.dport
else: return None
# set flows to correct type and data
ndpi_flow = pointer(ndpi_flow_struct())
memset(ndpi_flow, 0, sizeof(ndpi_flow_struct))
if ip_src > ip_dst:
flow = workflow(ip_src, ip_dst, src_port, dst_port, int(ip_packet.proto), 0, ndpi_protocol(), 0, 0, pointer(ndpi_id_struct()), pointer(ndpi_id_struct()), ndpi_flow)
else:
flow = workflow(ip_dst, ip_src, dst_port, src_port, int(ip_packet.proto), 0, ndpi_protocol(), 0, 0, pointer(ndpi_id_struct()), pointer(ndpi_id_struct()), ndpi_flow)
flow_ref = pointer(flow)
res = ndpi.ndpi_tfind(flow_ref, flows_root_ref, cmp_func)
if res is None:
ndpi.ndpi_tsearch(flow_ref, pointer(flows_root), cmp_func) # add
lista.append(flow)
flow_count += 1
return pointer(flow)
flow = cast(res, POINTER(POINTER(workflow))).contents
return flow
def packetcaptured(packet):
global packet_number
global start_time
global ndpi_info_mod
flow = None
h = pcap_pkthdr()
#getting flow
try:
flow = get_flow(packet)
except AttributeError:
pass # ignore packet
if flow is None: return
#filling pcap_pkthdr
h.len = h.caplen = len(packet)
h.ts.tv_sec = int(packet["IP"].time/1000000)
h.ts.tv_usec = int(packet["IP"].time)
# real work
if int(packet[1].frag) == 0: # not fragmented packet
flow.contents.packets += 1
packet_number += 1
# get ndpi_iphdr address
iphdr_addr = cast(c_char_p(packet[1].build()), c_void_p)
ndpi_flow = flow.contents.flow
if flow.contents.detection_completed is 0:
flow.contents.detected_protocol = ndpi.ndpi_detection_process_packet(ndpi_info_mod, ndpi_flow, cast(iphdr_addr, POINTER(c_uint8)),
int(packet[1].len), h.ts.tv_usec, flow.contents.src_id, flow.contents.dst_id)
flow1 = flow.contents.detected_protocol
valid = False
if flow.contents.protocol == 6: valid = flow.contents.packets > max_num_tcp_dissected_pkts
elif flow.contents.protocol == 17: valid = flow.contents.packets > max_num_udp_dissected_pkts
#should we continue anylizing packet or not?
if valid or flow1.app_protocol is not 0:
if valid or flow1.master_protocol is not 91: #or # 91 is NDPI_PROTOCOL_TLS
flow.contents.detection_completed = 1 #protocol found
if flow1.app_protocol is 0:
flow.contents.detected_protocol = ndpi.ndpi_detection_giveup(ndpi_info_mod, ndpi_flow, 1)
def result():
global flows_root_ref
global ndpi_info_mod
print('\nnumber of anylized packet ' + str(packet_number))
print('number of flows ' + str(flow_count))
ndpi.ndpi_twalk(flows_root_ref.contents, guess_walker, None)
print('\nDetected protocols:')
for i in range(0, ndpi.ndpi_get_num_supported_protocols(ndpi_info_mod)):
if count_protocol[i] > 0:
print(cast(ndpi.ndpi_get_proto_name(ndpi_info_mod, i), c_char_p).value + ': '.encode('UTF-8') + str(count_protocol[i]).encode('UTF-8'))
def free(ndpi_struct):
ndpi.ndpi_tdestroy(flows_root, free_walk)
ndpi.ndpi_exit_detection_module(ndpi_struct)
def initialize(ndpi_struct):
all = NDPI_PROTOCOL_BITMASK()
ndpi.ndpi_wrap_NDPI_BITMASK_SET_ALL(pointer(all))
ndpi.ndpi_set_protocol_detection_bitmask2(ndpi_struct, pointer(all))
print('Using nDPI ' + str(cast(ndpi.ndpi_revision(), c_char_p).value))
initialize(ndpi_info_mod)
if(len(sys.argv) != 2):
print("\nUsage: ndpi_example.py <device>")
sys.exit(0)
if "." in sys.argv[1]:
print('Reading pcap from file ' + sys.argv[1] + '...')
scapy_cap = None
try:
scapy_cap = rdpcap(sys.argv[1])
except FileNotFoundError:
print("\nFile not found")
except Scapy_Exception:
print("\nBad pcap")
else:
for packet in scapy_cap:
packetcaptured(packet)
else:
print('Capturing live traffic from device ' + sys.argv[1] + '...')
try:
sniff(iface=sys.argv[1], prn=packetcaptured)
except KeyboardInterrupt:
print('\nInterrupted\n')
result()
free(ndpi_info_mod)
+773
View File
@@ -0,0 +1,773 @@
#
# ndpi_typestruct.h
#
# Copyright (C) 2019 - ntop.org
#
# nDPI is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nDPI is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with nDPI. If not, see <http://www.gnu.org/licenses/>.
#
import os
from ctypes import *
ndpi = CDLL('./ndpi_wrap.so')
# NDPI_SELECTION_BITMASK_PROTOCOL_SIZE = c_uint32
# ndpi_protocol_category_t, ndpi_protocol_breed_t e ndpi_log_level_t are enum and are imported as c_int
class ndpi_detection_module_struct(Structure):
pass
class ndpi_flow_struct(Structure):
pass
class ndpi_protocol(Structure):
_fields_ = [
("master_protocol", c_uint16),
("app_protocol", c_uint16),
("category", c_int)
]
class timeval(Structure):
_fields_ = [("tv_sec", c_ulong), ("tv_usec", c_ulong)]
class pcap_pkthdr(Structure):
_fields_ = [("ts", timeval), ("caplen", c_uint32), ("len", c_uint32)]
#dal file ../src/include/ndpi_tydedefs.h
class ndpi_ndpi_mask(Structure):
_fields_ = [("fds_bits", c_uint32)]
class NDPI_PROTOCOL_BITMASK(Structure):
_fields_ = [("fds_bits", ndpi_ndpi_mask * ndpi.ndpi_wrap_ndpi_num_fds_bits())]
class ndpi_subprotocol_conf_struct(Structure):
_fields_ = [("func", CFUNCTYPE(c_void_p,POINTER(ndpi_detection_module_struct),c_char_p,c_char_p,c_int))]
class ndpi_automa(Structure):
_fields_ = [
("ac_automa", c_void_p), #Real type is AC_AUTOMATA_t
("ac_automa_finalized", c_uint8)
]
class struct_node_t(Structure):
pass
struct_node_t._fields_ = [
('key', POINTER(c_char)),
('left', POINTER(struct_node_t)),
('right', POINTER(struct_node_t)),
]
class ndpi_call_function_struct(Structure):
_fields_ = [
("detection_bitmask", NDPI_PROTOCOL_BITMASK),
("excluded_protocol_bitmask",NDPI_PROTOCOL_BITMASK),
("ndpi_selection_bitmask", c_uint32),
("func", CFUNCTYPE(None, POINTER(ndpi_detection_module_struct), POINTER(ndpi_flow_struct))),
("detection_feature", c_uint8)
]
class ndpi_proto_defaults_t(Structure):
_fields_ = [
("protoName", POINTER(c_char)),
("protoCategory",c_uint),
("can_have_a_subprotocol", c_uint8),
("protoId", c_uint16),
("protoIdx", c_uint16),
("master_tcp_protoId", c_uint16 * 2),
("master_udp_protoId", c_uint16 * 2),
("protoBreed", c_uint),
("func", CFUNCTYPE(None, POINTER(ndpi_detection_module_struct), POINTER(ndpi_flow_struct))),
]
class ndpi_default_ports_tree_node_t(Structure):
_fields_ = [
("proto", ndpi_proto_defaults_t),
("customUserProto",c_uint8),
("default_port", c_int16)
]
# NDPI_PROTOCOL_BITTORRENT
class spinlock_t(Structure):
_fields_ = [("val", c_int)] #missing volatile
class atomic_t(Structure):
_fields_ = [("counter", c_int)] #missing volatile
class time_t(Structure):
_fields_ = [("counter", c_longlong)] # piattaform dependent
class hash_ip4p_node(Structure):
pass
hash_ip4p_node._fields_ = [
("next", POINTER(hash_ip4p_node)),
("prev", POINTER(hash_ip4p_node)),
("lchg", time_t),
("port", c_uint16),
("count", c_uint16, 12),
("flag", c_uint16, 4),
("ip", c_uint32)
]
class hash_ip4p(Structure):
_fields_ = [
("top", POINTER(hash_ip4p_node)),
("lock",spinlock_t),
("len", c_size_t)
]
class hash_ip4p_table(Structure):
_fields_ = [
("size", c_size_t),
("ipv6",c_int),
("lock", spinlock_t),
("count", atomic_t),
("tbl", hash_ip4p)
]
class bt_announce(Structure): # 192 bytes
_fields_ = [
("hash", c_uint32 * 5),
("ip", c_uint32 * 4),
("time", c_uint32),
("port", c_uint16),
("name_len", c_uint8),
("name", c_uint8 * 149) # 149 bytes
]
class ndpi_lru_cache(Structure): # 192 bytes
_fields_ = [
("num_entries", c_uint32),
("entries", POINTER(c_uint32)),
]
class cache_entry(Structure):
pass
cache_entry._fields_ = [
("item", c_void_p),
("item_size", c_uint32),
("prev", POINTER(cache_entry)),
("next", POINTER(cache_entry))
]
class cache_entry_map(Structure):
pass
cache_entry_map._fields_ = [
("entry", POINTER(cache_entry)),
("next", POINTER(cache_entry_map)),
]
class cache(Structure): # 192 bytes
_fields_ = [
("size", c_uint32),
("max_size", c_uint32),
("head", POINTER(cache_entry)),
("tail", POINTER(cache_entry)),
("map", POINTER(POINTER(cache_entry_map)))
]
class custom_categories(Structure):
_fields_ =[
#Hyperscam
#("hostnames", POINTER(hs)),
#("num_to_load", c_uint),
#("to_load", POINTER(hs_list)),
("hostnames", ndpi_automa),
("hostnames_shadow", ndpi_automa),
("hostnames_hash", c_void_p),
("ipAddresses", c_void_p),
("ipAddresses_shadow", c_void_p), # Patricia
("categories_loaded", c_uint8),
]
ndpi_detection_module_struct._fields_ = [
("detection_bitmask", NDPI_PROTOCOL_BITMASK),
("generic_http_packet_bitmask", NDPI_PROTOCOL_BITMASK),
("current_ts", c_uint32),
("ticks_per_second", c_uint32),
#("user_data", c_void_p), debug
("custom_category_labels", (c_char * ndpi.ndpi_wrap_num_custom_categories()) * ndpi.ndpi_wrap_custom_category_label_len()),
#callback function buffer
("callback_buffer", ndpi_call_function_struct * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + 1)),
("callback_buffer_size", c_uint32),
("callback_buffer_tcp_no_payload", ndpi_call_function_struct * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + 1)),
("callback_buffer_size_tcp_no_payload", c_uint32),
("callback_buffer_tcp_payload", ndpi_call_function_struct * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + 1)),
("callback_buffer_size_tcp_payload", c_uint32),
("callback_buffer_udp", ndpi_call_function_struct * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + 1)),
("callback_buffer_size_udp", c_uint32),
("callback_buffer_non_tcp_udp", ndpi_call_function_struct * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + 1)),
("callback_buffer_size_non_tcp_udp", c_uint32),
("tcpRoot", POINTER(ndpi_default_ports_tree_node_t)),
("udpRoot", POINTER(ndpi_default_ports_tree_node_t)),
("ndpi_log_level", c_uint), #default error
# ifdef NDPI_ENABLE_DEBUG_MESSAGES
#debug callback, only set whendebug is used * /
#ndpi_debug_function_ptr ndpi_debug_printf;
#const char * ndpi_debug_print_file;
#const char * ndpi_debug_print_function;
#u_int32_t ndpi_debug_print_line;
#NDPI_PROTOCOL_BITMASK debug_bitmask;
# endif
#misc parameters
("tcp_max_retransmission_window_size", c_uint32),
("directconnect_connection_ip_tick_timeout", c_uint32),
#subprotocol registration handler
("subprotocol_conf", ndpi_subprotocol_conf_struct * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + 1)),
("ndpi_num_supported_protocols", c_uint),
("ndpi_num_custom_protocols", c_uint),
#HTTP / DNS / HTTPS host matching * /
("host_automa", ndpi_automa), #Used for DNS / HTTPS
("content_automa", ndpi_automa), # Used for HTTP subprotocol_detection
("subprotocol_automa", ndpi_automa), # Used for HTTP subprotocol_detection
("bigrams_automa", ndpi_automa), #TOR
("impossible_bigrams_automa", ndpi_automa), # TOR
("custom_categories", custom_categories),
#IP-based protocol detection
("protocols_ptree", c_void_p),
#irc parameters
("irc_timeout", c_uint32),
#gnutella parameters
("gnutella_timeout", c_uint32),
#battlefield parameters
("battlefield_timeout", c_uint32),
# thunder parameters
("thunder_timeout", c_uint32),
# SoulSeek parameters
("soulseek_connection_ip_tick_timeout", c_uint32),
# rtsp parameters
("rtsp_connection_timeout", c_uint32),
# tvants parameters
("tvants_connection_timeout", c_uint32),
# rstp
("orb_rstp_ts_timeout", c_uint32),
# yahoo
("yahoo_detect_http_connections", c_uint8),
("yahoo_lan_video_timeout", c_uint32),
("zattoo_connection_timeout", c_uint32),
("jabber_stun_timeout", c_uint32),
("jabber_file_transfer_timeout", c_uint32),
# ifdef NDPI_ENABLE_DEBUG_MESSAGES
# define NDPI_IP_STRING_SIZE 40
#char ip_string[NDPI_IP_STRING_SIZE];
# endif
("ip_version_limit", c_uint8),
#NDPI_PROTOCOL_BITTORRENT
("bt_ht", POINTER(hash_ip4p_table)),
# ifdef NDPI_DETECTION_SUPPORT_IPV6
("bt6_ht", POINTER(hash_ip4p_table)),
# endif
# BT_ANNOUNCE
("bt_ann", POINTER(bt_announce)),
("bt_ann_len", c_int),
# NDPI_PROTOCOL_OOKLA
("ookla_cache", POINTER(ndpi_lru_cache)),
# NDPI_PROTOCOL_TINC
("tinc_cache", POINTER(cache)),
("proto_defaults", ndpi_proto_defaults_t * (ndpi.ndpi_wrap_ndpi_max_supported_protocols() + ndpi.ndpi_wrap_ndpi_max_num_custom_protocols())),
("http_dont_dissect_response", c_uint8, 1),
("dns_dont_dissect_response", c_uint8, 1),
("direction_detect_disable", c_uint8, 1), # disable internal detection of packet direction
("disable_metadata_export", c_uint8, 1), # No metadata is exported
("enable_category_substring_match", c_uint8, 1), # Default is perfect match
("hyperscan", c_void_p) # Intel Hyperscan
]
class u6_addr(Union): # 128-bit IP6 address
_fields_ = [
("u6_addr8",c_uint8 * 16),
("u6_addr16",c_uint16 * 8),
("u6_addr32",c_uint32 * 4)
]
class ndpi_in6_addr(Structure):
_fields_ = [("u6_addr", u6_addr)]
class ndpi_ip_addr_t(Union):
_fields_ = [
('ipv4', c_uint32),
('ipv4_u_int8_t', c_uint8 * 4),
('ipv6', ndpi_in6_addr),
]
class ndpi_id_struct(Structure):
_fields_ = [
('detected_protocol_bitmask', NDPI_PROTOCOL_BITMASK),
('rtsp_ip_address', ndpi_ip_addr_t),
('yahoo_video_lan_timer', c_uint32),
('irc_port', c_uint16 * 8),
('last_time_port_used', c_uint32 * 8),
('irc_ts', c_uint32),
('gnutella_ts', c_uint32),
('battlefield_ts', c_uint32),
('thunder_ts', c_uint32),
('rtsp_timer', c_uint32),
('oscar_last_safe_access_time', c_uint32),
('zattoo_ts', c_uint32),
('jabber_stun_or_ft_ts', c_uint32),
('directconnect_last_safe_access_time', c_uint32),
('soulseek_last_safe_access_time', c_uint32),
('detected_directconnect_port', c_uint16),
('detected_directconnect_udp_port', c_uint16),
('detected_directconnect_ssl_port', c_uint16),
('bt_port_t', c_uint16 * 8),
('bt_port_u', c_uint16 * 8),
('jabber_voice_stun_port', c_uint16 * 6),
('jabber_file_transfer_port', c_uint16 * 2),
('detected_gnutella_port', c_uint16),
('detected_gnutella_udp_port1', c_uint16),
('detected_gnutella_udp_port2', c_uint16),
('soulseek_listen_port', c_uint16),
('irc_number_of_port', c_uint8),
('oscar_ssl_session_id', c_uint8 * 33),
('jabber_voice_stun_used_ports', c_uint8),
('yahoo_video_lan_dir', c_uint32, 1),
('yahoo_conf_logged_in', c_uint32, 1),
('yahoo_voice_conf_logged_in', c_uint32, 1),
('rtsp_ts_set', c_uint32, 1),
]
#struct flow
class ndpi_flow_tcp_struct(Structure):
_fields_ = [
# NDPI_PROTOCOL_MAIL_SMTP
('smtp_command_bitmask', c_uint16),
('pop_command_bitmask', c_uint16),
('qq_nxt_len', c_uint16),
('wa_matched_so_far', c_uint8),
('tds_login_version', c_uint8),
('irc_stage', c_uint8),
('irc_port', c_uint8),
('h323_valid_packets', c_uint8),
('gnutella_msg_id', c_uint8 * 3),
('irc_3a_counter', c_uint32, 3),
('irc_stage2', c_uint32, 5),
('irc_direction', c_uint32, 2),
('irc_0x1000_full', c_uint32, 1),
('soulseek_stage', c_uint32, 2),
('tds_stage', c_uint32, 3),
('usenet_stage', c_uint32, 2),
('imesh_stage', c_uint32, 4),
('http_setup_dir', c_uint32, 2),
('http_stage', c_uint32, 2),
('http_empty_line_seen', c_uint32, 1),
('http_wait_for_retransmission', c_uint32, 1),
('gnutella_stage', c_uint32, 2),
('mms_stage', c_uint32, 2),
('yahoo_sip_comm', c_uint32, 1),
('yahoo_http_proxy_stage', c_uint32, 2),
('msn_stage', c_uint32, 3),
('msn_ssl_ft', c_uint32, 2),
('ssh_stage', c_uint32, 3),
('vnc_stage', c_uint32, 2),
('telnet_stage', c_uint32, 2),
('ssl_seen_client_cert', c_uint8, 1),
('ssl_seen_server_cert', c_uint8, 1),
('ssl_seen_certificate', c_uint8, 1),
('ssl_stage', c_uint8, 2),
('postgres_stage', c_uint32, 3),
('ddlink_server_direction', c_uint32, 1),
('seen_syn', c_uint32, 1),
('seen_syn_ack', c_uint32, 1),
('seen_ack', c_uint32, 1),
('icecast_stage', c_uint32, 1),
('dofus_stage', c_uint32, 1),
('fiesta_stage', c_uint32, 2),
('wow_stage', c_uint32, 2),
('veoh_tv_stage', c_uint32, 2),
('shoutcast_stage', c_uint32, 2),
('rtp_special_packets_seen', c_uint32, 1),
('mail_pop_stage', c_uint32, 2),
('mail_imap_stage', c_uint32, 3),
('mail_imap_starttls', c_uint32, 2),
('skype_packet_id', c_uint8),
('citrix_packet_id', c_uint8),
('lotus_notes_packet_id', c_uint8),
('teamviewer_stage', c_uint8),
('prev_zmq_pkt_len', c_uint8),
('prev_zmq_pkt', c_ubyte * 10),
('ppstream_stage', c_uint32, 3),
('memcached_matches', c_uint8),
('nest_log_sink_matches', c_uint8),
]
class ndpi_flow_udp_struct(Structure):
_fields_ = [
('battlefield_msg_id', c_uint32),
('snmp_msg_id', c_uint32),
('battlefield_stage', c_uint32, 3),
('snmp_stage', c_uint32, 2),
('ppstream_stage', c_uint32, 3),
('halflife2_stage', c_uint32, 2),
('tftp_stage', c_uint32, 1),
('aimini_stage', c_uint32, 5),
('xbox_stage', c_uint32, 1),
('wsus_stage', c_uint32, 1),
('skype_packet_id', c_uint8),
('teamviewer_stage', c_uint8),
('eaq_pkt_id', c_uint8),
('eaq_sequence', c_uint32),
('rx_conn_epoch', c_uint32),
('rx_conn_id', c_uint32),
('memcached_matches', c_uint8),
]
# the tcp / udp / other l4 value union used to reduce the number of bytes for tcp or udp protocol states
class l4(Union):
_fields_ = [("tcp", ndpi_flow_tcp_struct),("udp", ndpi_flow_udp_struct)]
class http(Structure):
_fields_ = [
("method", c_int),
("url", c_char_p),
("content_type", c_char_p),
("num_request_headers", c_uint8), ("num_response_headers", c_uint8),
("request_version", c_uint8), # 0=1.0 and 1=1.1. Create an enum for this?
("response_status_code", c_uint16), # 200, 404, etc.
]
class dns(Structure): # the only fields useful for nDPI and ntopng
_fields_ = [
("num_queries", c_uint8), ("num_answers", c_uint8), ("reply_code", c_uint8),
("query_type", c_uint16), ("query_class", c_uint16), ("rsp_type", c_uint16),
("rsp_addr", ndpi_ip_addr_t) # The first address in a DNS response packet
]
class ntp(Structure):
_fields_ = [("request_code", c_uint8), ("version", c_uint8)]
class ssl(Structure):
_fields_ = [
("ssl_version", c_uint8),
("client_certificate", c_char * 64), ("server_certificate", c_char * 64), ("server_organization", c_char * 64),
("ja3_client", c_char * 33), ("ja3_server", c_char * 33),
("server_cipher", c_uint16),
("server_unsafe_cipher", c_int)
]
class stun(Structure):
_fields_ = [
("num_udp_pkts", c_uint8),
("num_processed_pkts", c_uint8),
("num_binding_requests", c_uint8),
("is_skype", c_uint8)
]
class stun_ssl(Union): # We can have STUN over SSL thus they need to live together
_fields_ = [("ssl", ssl),("stun",stun)]
class ssh(Structure):
_fields_ = [("client_signature", c_char * 48), ("server_signature", c_char * 48)]
class mdns(Structure):
_fields_ = [("answer", c_char * 96)]
class ubntac2(Structure):
_fields_ = [("version", c_char * 96)]
class http2(Structure):
_fields_ = [
("detected_os", c_ubyte * 32), #Via HTTP User-Agent
("nat_ip", c_ubyte * 24)
]
class bittorrent(Structure): # Bittorrent hash
_fields_ = [ ("hash", c_ubyte * 20) ]
class dhcp(Structure):
_fields_ = [
("fingerprint", c_char * 48),
("nat_ip", c_char * 48)
]
class protos(Union):
_fields_ = [
("dns", dns),
("ntp", ntp),
("stun_ssl", stun_ssl),
("ssh", ssh),
("mdns", mdns),
("ubntac2", ubntac2),
("http", http2),
("bittorrent", bittorrent),
("dhcp", dhcp)
]
class tinc_cache_entry(Structure):
_fields_ = [
('src_address', c_uint32),
('dst_address', c_uint32),
('dst_port', c_uint16),
]
class struct_ndpi_int_one_line_struct(Structure):
_fields_ = [
('ptr', POINTER(c_uint8)),
('len', c_uint16),
]
class struct_ndpi_iphdr_little_end(Structure):
_fields_ = [
('ihl', c_uint8, 4),
('version', c_uint8, 4),
('tos', c_uint8),
('tot_len', c_uint16),
('id', c_uint16),
('frag_off', c_uint16),
('ttl', c_uint8),
('protocol', c_uint8),
('check', c_uint16),
('saddr', c_uint32),
('daddr', c_uint32)]
class struct_ndpi_ip6_hdrctl(Structure):
_fields_ = [
('ip6_un1_flow', c_uint32),
('ip6_un1_plen', c_uint16),
('ip6_un1_nxt', c_uint8),
('ip6_un1_hlim', c_uint8),
]
class struct_ndpi_ipv6hdr(Structure):
_fields_ = [
('ip6_hdr', struct_ndpi_ip6_hdrctl),
('ip6_src', ndpi_in6_addr),
('ip6_dst', ndpi_in6_addr),
]
class struct_ndpi_tcphdr(Structure):
_fields_ = [
('source', c_uint16),
('dest', c_uint16),
('seq', c_uint32),
('ack_seq', c_uint32),
('res1', c_uint16, 4),
('doff', c_uint16, 4),
('fin', c_uint16, 1),
('syn', c_uint16, 1),
('rst', c_uint16, 1),
('psh', c_uint16, 1),
('ack', c_uint16, 1),
('urg', c_uint16, 1),
('ece', c_uint16, 1),
('cwr', c_uint16, 1),
('window', c_uint16),
('check', c_uint16),
('urg_ptr', c_uint16),
]
class struct_ndpi_udphdr(Structure):
_fields_ = [
('source', c_uint16),
('dest', c_uint16),
('len', c_uint16),
('check', c_uint16),
]
class ndpi_packet_struct(Structure):
_fields_ = [
('iph', POINTER(struct_ndpi_iphdr_little_end)),
('iphv6', POINTER(struct_ndpi_ipv6hdr)),
('tcp', POINTER(struct_ndpi_tcphdr)),
('udp', POINTER(struct_ndpi_udphdr)),
('generic_l4_ptr', POINTER(c_uint8)),
('payload', POINTER(c_uint8)),
('tick_timestamp', c_uint32),
('tick_timestamp_l', c_uint64),
('detected_protocol_stack', c_uint16 * 2),
('detected_subprotocol_stack', c_uint8 * 2),
('protocol_stack_info', c_uint16),
('line', struct_ndpi_int_one_line_struct * 64),
('host_line', struct_ndpi_int_one_line_struct),
('forwarded_line', struct_ndpi_int_one_line_struct),
('referer_line', struct_ndpi_int_one_line_struct),
('content_line', struct_ndpi_int_one_line_struct),
('accept_line', struct_ndpi_int_one_line_struct),
('user_agent_line', struct_ndpi_int_one_line_struct),
('http_url_name', struct_ndpi_int_one_line_struct),
('http_encoding', struct_ndpi_int_one_line_struct),
('http_transfer_encoding', struct_ndpi_int_one_line_struct),
('http_contentlen', struct_ndpi_int_one_line_struct),
('http_cookie', struct_ndpi_int_one_line_struct),
('http_origin', struct_ndpi_int_one_line_struct),
('http_x_session_type', struct_ndpi_int_one_line_struct),
('server_line', struct_ndpi_int_one_line_struct),
('http_method', struct_ndpi_int_one_line_struct),
('http_response', struct_ndpi_int_one_line_struct),
('http_num_headers', c_uint8),
('l3_packet_len', c_uint16),
('l4_packet_len', c_uint16),
('payload_packet_len', c_uint16),
('actual_payload_len', c_uint16),
('num_retried_bytes', c_uint16),
('parsed_lines', c_uint16),
('parsed_unix_lines', c_uint16),
('empty_line_position', c_uint16),
('tcp_retransmission', c_uint8),
('l4_protocol', c_uint8),
('ssl_certificate_detected', c_uint8, 4),
('ssl_certificate_num_checks', c_uint8, 4),
('packet_lines_parsed_complete', c_uint8, 1),
('packet_direction', c_uint8, 1),
('empty_line_position_set', c_uint8, 1),
]
ndpi_flow_struct._fields_ = [
("detected_protocol_stack", c_uint16 * ndpi.ndpi_wrap_ndpi_procol_size()),
("protocol_stack_info", c_uint16),
# init parameter, internal used to set up timestamp,...
("guessed_protocol_id", c_uint16),
("guessed_host_protocol_id", c_uint16),
("guessed_category", c_uint16),
("guessed_header_category", c_uint16),
("protocol_id_already_guessed", c_uint8, 1),
("host_already_guessed", c_uint8, 1),
("init_finished", c_uint8, 1),
("setup_packet_direction", c_uint8, 1),
("packet_direction", c_uint8, 1),
("check_extra_packets", c_uint8, 1),
# if ndpi_struct->direction_detect_disable == 1 tcp sequence number connection tracking
("next_tcp_seq_nr", c_uint32 * 2),
("max_extra_packets_to_check", c_uint8),
("num_extra_packets_checked", c_uint8),
("num_processed_pkts", c_uint8), # <= WARNING it can wrap but we do expect people to giveup earlier
("extra_packets_func", CFUNCTYPE(c_int,POINTER(ndpi_detection_module_struct),POINTER(ndpi_flow_struct))),
("l4", l4),
# Pointer to src or dst that identifies the server of this connection
("server_id", ndpi_id_struct),
# HTTP host or DNS query
("host_server_name", c_ubyte * 256),
# This structure below will not not stay inside the protos
# structure below as HTTP is used by many subprotocols
# such as FaceBook, Google... so it is hard to know
# when to use it or not. Thus we leave it outside for the
# time being.
("http", http),
("protos", protos),
# ALL protocol specific 64 bit variables here
# protocols which have marked a connection as this connection cannot be protocol XXX, multiple u_int64_t
("excluded_protocol_bitmask", NDPI_PROTOCOL_BITMASK),
("category", c_int),
('redis_s2d_first_char', c_uint8),
('redis_d2s_first_char', c_uint8),
('packet_counter', c_uint16),
('packet_direction_counter', c_uint16 * 2),
('byte_counter', c_uint16 * 2),
('bittorrent_stage', c_uint8),
('directconnect_stage', c_uint8, 2),
('sip_yahoo_voice', c_uint8, 1),
('http_detected', c_uint8, 1),
('http_upper_protocol', c_uint16),
('http_lower_protocol', c_uint16),
('rtsprdt_stage', c_uint8, 2),
('rtsp_control_flow', c_uint8, 1),
('yahoo_detection_finished', c_uint8, 2),
('zattoo_stage', c_uint8, 3),
('qq_stage', c_uint8, 3),
('thunder_stage', c_uint8, 2),
('oscar_ssl_voice_stage', c_uint8, 3),
('oscar_video_voice', c_uint8, 1),
('florensia_stage', c_uint8, 1),
('socks5_stage', c_uint8, 2),
('socks4_stage', c_uint8, 2),
('edonkey_stage', c_uint8, 2),
('ftp_control_stage', c_uint8, 2),
('rtmp_stage', c_uint8, 2),
('pando_stage', c_uint8, 3),
('steam_stage1', c_uint16, 3),
('steam_stage2', c_uint16, 2),
('steam_stage3', c_uint16, 2),
('pplive_stage1', c_uint8, 3),
('pplive_stage2', c_uint8, 2),
('pplive_stage3', c_uint8, 2),
('starcraft_udp_stage', c_uint8, 3),
('ovpn_session_id', c_uint8 * 8),
('ovpn_counter', c_uint8),
('tinc_state', c_uint8),
('tinc_cache_entry', tinc_cache_entry),
('csgo_strid', c_uint8 * 18),
('csgo_state', c_uint8),
('csgo_s2', c_uint8),
('csgo_id2', c_uint32),
('kxun_counter', c_uint16),
('iqiyi_counter', c_uint16),
('packet', ndpi_packet_struct),
('flow', POINTER(ndpi_flow_struct)),
('src', POINTER(ndpi_id_struct)),
('dst', POINTER(ndpi_id_struct))
]
ndpi.ndpi_tfind.restype = c_void_p
ndpi.ndpi_tsearch.restype = c_void_p
ndpi.ndpi_revision.restype = c_void_p
ndpi.ndpi_get_proto_name.restype = c_void_p
ndpi.ndpi_get_num_supported_protocols.restype = c_uint
ndpi.ndpi_detection_process_packet.restype = ndpi_protocol
ndpi.ndpi_init_detection_module.restype = POINTER(ndpi_detection_module_struct)
ndpi.ndpi_wrap_NDPI_BITMASK_SET_ALL.argtypes = [POINTER(NDPI_PROTOCOL_BITMASK)]
ndpi.ndpi_set_protocol_detection_bitmask2.argtypes = [POINTER(ndpi_detection_module_struct), POINTER(NDPI_PROTOCOL_BITMASK)]
ndpi.ndpi_tsearch.argtypes = [c_void_p, POINTER(c_void_p), CFUNCTYPE(c_int, c_void_p, c_void_p)]
ndpi.ndpi_twalk.argtypes = [c_void_p, CFUNCTYPE(None, c_void_p, c_int32, c_int, c_void_p), c_void_p]
ndpi.ndpi_tdestroy.argtypes = [c_void_p, CFUNCTYPE(None, c_void_p)]
ndpi.ndpi_detection_giveup.restype = ndpi_protocol
ndpi.ndpi_detection_giveup.argtypes = [POINTER(ndpi_detection_module_struct), POINTER(ndpi_flow_struct), c_uint8]
ndpi.ndpi_detection_process_packet.argtypes = [POINTER(ndpi_detection_module_struct), POINTER(ndpi_flow_struct), POINTER(c_ubyte), c_ushort, c_uint64, POINTER(ndpi_id_struct), POINTER(ndpi_id_struct)]
+60
View File
@@ -0,0 +1,60 @@
/*
* ndpi_wrap.c
*
* Copyright (C) 2011-19 - 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 "sys/types.h"
#include "ndpi_config.h"
#include "ndpi_main.h"
int ndpi_wrap_get_api_version(){
return NDPI_API_VERSION;
}
int ndpi_wrap_ndpi_num_fds_bits(){
return NDPI_NUM_FDS_BITS;
}
int ndpi_wrap_num_custom_categories(){
return NUM_CUSTOM_CATEGORIES;
}
int ndpi_wrap_custom_category_label_len(){
return CUSTOM_CATEGORY_LABEL_LEN;
}
int ndpi_wrap_ndpi_max_supported_protocols(){
return NDPI_MAX_SUPPORTED_PROTOCOLS;
}
int ndpi_wrap_ndpi_max_num_custom_protocols(){
return NDPI_MAX_NUM_CUSTOM_PROTOCOLS;
}
int ndpi_wrap_ndpi_procol_size(){
return NDPI_PROTOCOL_SIZE;
}
void ndpi_wrap_NDPI_BITMASK_SET_ALL(NDPI_PROTOCOL_BITMASK* bitmask){
NDPI_ONE(bitmask);
}
void dummy() {
/* Dummy call just to cause linker to include the ndpi library */
ndpi_tfind(NULL, NULL, NULL);
}
Binary file not shown.
+8 -7
View File
@@ -1,9 +1,10 @@
library_includedir=$(includedir)/libndpi-1.4/libndpi
plibrary_includedir=$(includedir)/libndpi-@VERSION@/libndpi
library_include_HEADERS = ndpi_api.h \
ndpi_debug_functions.h \
ndpi_define.h \
ndpi_macros.h \
ndpi_protocols_osdpi.h \
ndpi_public_functions.h
ndpi_define.h \
ndpi_typedefs.h \
ndpi_main.h \
ndpi_protocol_ids.h \
ndpi_protocols.h \
ndpi_win32.h \
ndpi_includes.h
-188
View File
@@ -1,188 +0,0 @@
/*
* linux_compat.h
*
* 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/>.
*
*/
#ifndef __NDPI_LINUX_COMPAT_H__
#define __NDPI_LINUX_COMPAT_H__
#include "ndpi_define.h"
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <machine/endian.h>
#if _BYTE_ORDER == _LITTLE_ENDIAN
#ifndef __LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__ 1
#endif
#else
#ifndef __BIG_ENDIAN__
#define __BIG_ENDIAN__ 1
#endif
#endif
#endif
#pragma pack(push, 1) /* push current alignment to stack */
#pragma pack(1) /* set alignment to 1 byte boundary */
#pragma pack(pop) /* restore original alignment from stack */
struct ndpi_ethhdr {
u_char h_dest[6]; /* destination eth addr */
u_char h_source[6]; /* source ether addr */
u_int16_t h_proto; /* packet type ID field */
};
struct ndpi_80211q {
u_int16_t vlanId;
u_int16_t protoType;
};
struct ndpi_iphdr {
#if defined(__LITTLE_ENDIAN__)
u_int8_t ihl:4, version:4;
#elif defined(__BIG_ENDIAN__)
u_int8_t version:4, ihl:4;
#else
# error "Byte order must be defined"
#endif
u_int8_t tos;
u_int16_t tot_len;
u_int16_t id;
u_int16_t frag_off;
u_int8_t ttl;
u_int8_t protocol;
u_int16_t check;
u_int32_t saddr;
u_int32_t daddr;
};
#ifdef WIN32
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int uint;
typedef unsigned long u_long;
typedef u_char u_int8_t;
typedef u_short u_int16_t;
typedef uint u_int32_t;
#define _WS2TCPIP_H_ /* Avoid compilation problems */
#define HAVE_SIN6_LEN
/* IPv6 address */
/* Already defined in WS2tcpip.h */
struct ndpi_win_in6_addr
{
union
{
u_int8_t u6_addr8[16];
u_int16_t u6_addr16[8];
u_int32_t u6_addr32[4];
} in6_u;
#ifdef s6_addr
#undef s6_addr
#endif
#ifdef s6_addr16
#undef s6_addr16
#endif
#ifdef s6_addr32
#undef s6_addr32
#endif
#define s6_addr in6_u.u6_addr8
// #define s6_addr16 in6_u.u6_addr16
// #define s6_addr32 in6_u.u6_addr32
};
#define in6_addr win_in6_addr
/* Generic extension header. */
struct ndpi_ip6_ext
{
u_int8_t ip6e_nxt; /* next header. */
u_int8_t ip6e_len; /* length in units of 8 octets. */
};
#define s6_addr16 __u6_addr.__u6_addr16
#define s6_addr32 __u6_addr.__u6_addr32
#else
#ifndef __KERNEL__
#include <arpa/inet.h>
#endif
#endif
struct ndpi_in6_addr {
union {
u_int8_t __u6_addr8[16];
u_int16_t __u6_addr16[8];
u_int32_t __u6_addr32[4];
} __u6_addr; /* 128-bit IP6 address */
};
struct ndpi_ip6_hdr {
union {
struct ndpi_ip6_hdrctl {
u_int32_t ip6_un1_flow;
u_int16_t ip6_un1_plen;
u_int8_t ip6_un1_nxt;
u_int8_t ip6_un1_hlim;
} ip6_un1;
u_int8_t ip6_un2_vfc;
} ip6_ctlun;
struct ndpi_in6_addr ip6_src;
struct ndpi_in6_addr ip6_dst;
};
struct ndpi_tcphdr {
u_int16_t source;
u_int16_t dest;
u_int32_t seq;
u_int32_t ack_seq;
#if defined(__LITTLE_ENDIAN__)
u_int16_t res1:4, doff:4, fin:1, syn:1, rst:1, psh:1, ack:1, urg:1, ece:1, cwr:1;
#elif defined(__BIG_ENDIAN__)
u_int16_t doff:4, res1:4, cwr:1, ece:1, urg:1, ack:1, psh:1, rst:1, syn:1, fin:1;
#else
# error "Byte order must be defined"
#endif
u_int16_t window;
u_int16_t check;
u_int16_t urg_ptr;
};
struct ndpi_udphdr {
u_int16_t source;
u_int16_t dest;
u_int16_t len;
u_int16_t check;
};
#endif
+855 -159
View File
File diff suppressed because it is too large Load Diff
+93
View File
@@ -0,0 +1,93 @@
/*
*
* Copyright (c) 2016 Cisco Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* \file ndpi_classify.h
*
* \brief header file for inline Classification functionality
*/
#ifndef NDPI_CLASSIFY_H
#define NDPI_CLASSIFY_H
#include <stdint.h>
#include <sys/time.h>
/* constants */
#define NUM_PARAMETERS_SPLT_LOGREG 208
#define NUM_PARAMETERS_BD_LOGREG 464
#define MC_BINS_LEN 10
#define MC_BINS_TIME 10
#define MC_BIN_SIZE_TIME 50
#define MC_BIN_SIZE_LEN 150
#define MAX_BIN_LEN 1500
#define NUM_BD_VALUES 256
#define NDPI_TIMESTAMP_LEN 64
/** Classifier parameter type codes */
typedef enum {
SPLT_PARAM_TYPE = 0,
BD_PARAM_TYPE = 1
} classifier_type_codes_t;
extern float parameters_bd[NUM_PARAMETERS_BD_LOGREG];
extern float parameters_splt[NUM_PARAMETERS_SPLT_LOGREG];
/* Classifier functions */
float ndpi_classify(const unsigned short *pkt_len, const struct timeval *pkt_time,
const unsigned short *pkt_len_twin, const struct timeval *pkt_time_twin,
struct timeval start_time, struct timeval start_time_twin, uint32_t max_num_pkt_len,
uint16_t sp, uint16_t dp, uint32_t op, uint32_t ip, uint32_t np_o, uint32_t np_i,
uint32_t ob, uint32_t ib, uint16_t use_bd, const uint32_t *bd, const uint32_t *bd_t);
void ndpi_merge_splt_arrays(const uint16_t *pkt_len, const struct timeval *pkt_time,
const uint16_t *pkt_len_twin, const struct timeval *pkt_time_twin,
struct timeval start_time, struct timeval start_time_twin,
uint16_t s_idx, uint16_t r_idx,
uint16_t *merged_lens, uint16_t *merged_times);
void ndpi_update_params(classifier_type_codes_t param_type, const char *param_file);
void ndpi_flow_info_freer(void *node);
unsigned int ndpi_timer_eq(const struct timeval *a, const struct timeval *b);
unsigned int ndpi_timer_lt(const struct timeval *a, const struct timeval *b);
void ndpi_timer_sub(const struct timeval *a, const struct timeval *b, struct timeval *result);
void ndpi_timer_clear(struct timeval *a);
unsigned int ndpi_timeval_to_milliseconds(struct timeval ts);
unsigned int ndpi_timeval_to_microseconds(struct timeval ts);
void ndpi_log_timestamp(char *log_ts, uint32_t log_ts_len);
#endif /* NDPI_CLASSIFY_H */
@@ -1,7 +1,6 @@
/*
*
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-17 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library based on the OpenDPI and PACE technology by ipoque GmbH
@@ -42,15 +41,22 @@
#endif/* BYTE_ORDER */
#endif/* __OPENBSD__ */
#if 0
#ifndef NDPI_ENABLE_DEBUG_MESSAGES
#define NDPI_ENABLE_DEBUG_MESSAGES
#if __BYTE_ORDER == __LITTLE_ENDIAN
#ifndef __LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__
#endif
#else
#ifndef __BIG_ENDIAN__
#define __BIG_ENDIAN__
#endif
#endif
#ifdef WIN32
#ifndef __LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__ 1
#endif
#endif
#if !(defined(__LITTLE_ENDIAN__) || defined(__BIG_ENDIAN__))
#if defined(__mips__)
@@ -59,13 +65,6 @@
#define __BIG_ENDIAN__
#endif
/* Kernel modules */
#if defined(__LITTLE_ENDIAN)
#define __LITTLE_ENDIAN__
#endif
#if defined(__BIG_ENDIAN)
#define __BIG_ENDIAN__
#endif
/* Everything else */
#if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__))
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
@@ -77,7 +76,7 @@
#endif
#define NDPI_USE_ASYMMETRIC_DETECTION 0
#define NDPI_USE_ASYMMETRIC_DETECTION 0
#define NDPI_SELECTION_BITMASK_PROTOCOL_SIZE u_int32_t
#define NDPI_SELECTION_BITMASK_PROTOCOL_IP (1<<0)
@@ -160,53 +159,88 @@
/* TODO: rebuild all memory areas to have a more aligned memory block here */
/* DEFINITION OF MAX LINE NUMBERS FOR line parse algorithm */
#define NDPI_MAX_PARSE_LINES_PER_PACKET 64
#define NDPI_MAX_PARSE_LINES_PER_PACKET 64
#define MAX_PACKET_COUNTER 65000
#define MAX_DEFAULT_PORTS 5
/**********************
* detection features *
**********************/
#define NDPI_SELECT_DETECTION_WITH_REAL_PROTOCOL ( 1 << 0 )
#define NDPI_DIRECTCONNECT_CONNECTION_IP_TICK_TIMEOUT 600
#define NDPI_IRC_CONNECTION_TIMEOUT 120
#define NDPI_GNUTELLA_CONNECTION_TIMEOUT 60
#define NDPI_BATTLEFIELD_CONNECTION_TIMEOUT 60
#define NDPI_THUNDER_CONNECTION_TIMEOUT 30
#define NDPI_RTSP_CONNECTION_TIMEOUT 5
#define NDPI_TVANTS_CONNECTION_TIMEOUT 5
#define NDPI_YAHOO_DETECT_HTTP_CONNECTIONS 1
#define NDPI_YAHOO_LAN_VIDEO_TIMEOUT 30
#define NDPI_GNUTELLA_CONNECTION_TIMEOUT 60
#define NDPI_BATTLEFIELD_CONNECTION_TIMEOUT 60
#define NDPI_THUNDER_CONNECTION_TIMEOUT 30
#define NDPI_RTSP_CONNECTION_TIMEOUT 5
#define NDPI_TVANTS_CONNECTION_TIMEOUT 5
#define NDPI_YAHOO_DETECT_HTTP_CONNECTIONS 1
#define NDPI_YAHOO_LAN_VIDEO_TIMEOUT 30
#define NDPI_ZATTOO_CONNECTION_TIMEOUT 120
#define NDPI_ZATTOO_FLASH_TIMEOUT 5
#define NDPI_JABBER_STUN_TIMEOUT 30
#define NDPI_JABBER_FT_TIMEOUT 5
#define NDPI_ZATTOO_FLASH_TIMEOUT 5
#define NDPI_JABBER_STUN_TIMEOUT 30
#define NDPI_JABBER_FT_TIMEOUT 5
#define NDPI_SOULSEEK_CONNECTION_IP_TICK_TIMEOUT 600
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
#define NDPI_LOG(proto, mod, log_level, args...) \
{ \
if(mod != NULL) { \
mod->ndpi_debug_print_file=__FILE__; \
mod->ndpi_debug_print_function=__FUNCTION__; \
mod->ndpi_debug_print_line=__LINE__; \
mod->ndpi_debug_printf(proto, mod, log_level, args); \
} \
#define NDPI_LOG(proto, m, log_level, args...) \
{ \
struct ndpi_detection_module_struct *mod = (struct ndpi_detection_module_struct*) m; \
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
(*(mod->ndpi_debug_printf))(proto, mod, log_level, __FILE__, __FUNCTION__, __LINE__, 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"
*
*/
#if defined(WIN32)
#define NDPI_LOG(...) {}
#else
#define NDPI_LOG(proto, mod, log_level, args...) {}
#endif
#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
# define NDPI_LOG(...) {}
# define NDPI_LOG_ERR(...) {}
# define NDPI_LOG_INFO(...) {}
# define NDPI_LOG_DBG(...) {}
# define NDPI_LOG_DBG2(...) {}
# else
# 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 /* 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
*
@@ -216,29 +250,24 @@
/** macro to compare 2 IPv6 addresses with each other to identify the "smaller" IPv6 address */
#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])) )
((x.u6_addr.u6_addr64[0] < y.u6_addr.u6_addr64[0]) || ((x.u6_addr.u6_addr64[0] == y.u6_addr.u6_addr64[0]) && (x.u6_addr.u6_addr64[1] < y.u6_addr.u6_addr64[1])))
#if !defined(__KERNEL__) && !defined(NDPI_IPTABLES_EXT)
#define NDPI_NUM_BITS 256
#else
/* custom protocols not supported */
#define NDPI_NUM_BITS 192
#endif
#define NDPI_NUM_BITS 512
#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 NDPI_SET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] |= (1 << (((u_int32_t)n) % NDPI_BITS)))
#define NDPI_CLR(p, n) ((p)->fds_bits[(n)/NDPI_BITS] &= ~(1 << (((u_int32_t)n) % NDPI_BITS)))
#define NDPI_ISSET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] & (1 << (((u_int32_t)n) % NDPI_BITS)))
#define NDPI_SET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] |= (1ul << (((u_int32_t)n) % NDPI_BITS)))
#define NDPI_CLR(p, n) ((p)->fds_bits[(n)/NDPI_BITS] &= ~(1ul << (((u_int32_t)n) % NDPI_BITS)))
#define NDPI_ISSET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] & (1ul << (((u_int32_t)n) % NDPI_BITS)))
#define NDPI_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
#define NDPI_ONE(p) memset((char *)(p), 0xFF, sizeof(*(p)))
#define NDPI_NUM_FDS_BITS howmanybits(NDPI_NUM_BITS, NDPI_BITS)
#define NDPI_PROTOCOL_BITMASK ndpi_protocol_bitmask_struct_t
#define NDPI_BITMASK_ADD(a,b) NDPI_SET(&a,b)
#define NDPI_BITMASK_DEL(a,b) NDPI_CLR(&a,b)
#define NDPI_BITMASK_RESET(a) NDPI_ZERO(&a)
@@ -246,7 +275,7 @@
#define NDPI_BITMASK_SET(a, b) { memcpy(&a, &b, sizeof(NDPI_PROTOCOL_BITMASK)); }
/* this is a very very tricky macro *g*,
* the compiler will remove all shifts here if the protocol is static...
* the compiler will remove all shifts here if the protocol is static...
*/
#define NDPI_ADD_PROTOCOL_TO_BITMASK(bmask,value) NDPI_SET(&bmask,value)
#define NDPI_DEL_PROTOCOL_FROM_BITMASK(bmask,value) NDPI_CLR(&bmask,value)
@@ -289,21 +318,50 @@
#define get_l32(X,O) get_u_int32_t(X,O)
#elif defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN)
/* convert the bytes from big to little endian */
#ifndef __KERNEL__
# define get_l16(X,O) bswap_16(get_u_int16_t(X,O))
# define get_l32(X,O) bswap_32(get_u_int32_t(X,O))
#else
# define get_l16(X,O) __cpu_to_le16(get_u_int16_t(X,O))
# define get_l32(X,O) __cpu_to_le32(get_u_int32_t(X,O))
#endif
#else
#error "__BYTE_ORDER MUST BE DEFINED !"
#endif /* __BYTE_ORDER */
/* define memory callback function */
#define match_first_bytes(payload,st) (memcmp((payload),(st),(sizeof(st)-1))==0)
#if defined(WIN32) && !defined(snprintf)
#define snprintf _snprintf
#endif
#define NDPI_MAX_DNS_REQUESTS 16
#define NDPI_MIN_NUM_STUN_DETECTION 8
#define NDPI_MAJOR @NDPI_MAJOR@
#define NDPI_MINOR @NDPI_MINOR@
#define NDPI_PATCH @NDPI_PATCH@
/* IMPORTANT: order according to its severity */
#define NDPI_CIPHER_SAFE 0
#define NDPI_CIPHER_WEAK 1
#define NDPI_CIPHER_INSECURE 2
#ifdef __APPLE__
#include <libkern/OSByteOrder.h>
#define htobe16(x) OSSwapHostToBigInt16(x)
#define htole16(x) OSSwapHostToLittleInt16(x)
#define be16toh(x) OSSwapBigToHostInt16(x)
#define le16toh(x) OSSwapLittleToHostInt16(x)
#define htobe32(x) OSSwapHostToBigInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#define be32toh(x) OSSwapBigToHostInt32(x)
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htobe64(x) OSSwapHostToBigInt64(x)
#define htole64(x) OSSwapHostToLittleInt64(x)
#define be64toh(x) OSSwapBigToHostInt64(x)
#define le64toh(x) OSSwapLittleToHostInt64(x)
#endif /* __APPLE__ */
#endif /* __NDPI_DEFINE_INCLUDE_FILE__ */
+70
View File
@@ -0,0 +1,70 @@
/*
* ndpi_includes.h
*
* Copyright (C) 2011-16 - 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_INCLUDES_H__
#define __NDPI_INCLUDES_H__
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <limits.h>
#ifdef WIN32
#include "ndpi_win32.h"
#else
#include <sys/types.h>
#include <sys/param.h>
#include <pthread.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#if !defined __APPLE__ && !defined __FreeBSD__ && !defined __NetBSD__ && !defined __OpenBSD__
#include <endian.h>
#include <byteswap.h>
#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
#include <netinet/in.h>
#if defined __NetBSD__ || defined __OpenBSD__
#include <netinet/in_systm.h>
#ifdef __OpenBSD__
#include <pthread.h>
#endif
#endif
#endif
#endif
#endif /* Win32 */
#endif /* __NDPI_INCLUDES_H__ */
+109 -109
View File
@@ -1,8 +1,7 @@
/*
* ndpi_main.h
*
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-19 - 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
@@ -22,135 +21,136 @@
*
*/
#ifndef __NDPI_MAIN_INCLUDE_FILE__
#define __NDPI_MAIN_INCLUDE_FILE__
#ifndef __NDPI_MAIN_H__
#define __NDPI_MAIN_H__
#ifndef __KERNEL__
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#ifndef WIN32
#include <pthread.h>
#endif
#include <ctype.h>
#include <time.h>
#endif
#ifndef WIN32
#ifndef __KERNEL__
#include <sys/time.h>
#endif
#if !defined __APPLE__ && !defined __FreeBSD__ && !defined __NetBSD__ && !defined __OpenBSD__
#ifndef __KERNEL__
#include <endian.h>
#include <byteswap.h>
#else
#include <asm/byteorder.h>
#include <linux/ctype.h>
#endif
#endif
/* default includes */
#ifndef __KERNEL__
#include <sys/param.h>
#include <limits.h>
#endif
#endif
#include "ndpi_win32.h"
#include "ndpi_unix.h"
#include "ndpi_includes.h"
#include "ndpi_define.h"
#include "ndpi_protocol_ids.h"
#include "ndpi_typedefs.h"
#include "ndpi_api.h"
#include "ndpi_protocols.h"
#ifdef __cplusplus
extern "C" {
#endif
void *ndpi_tdelete(const void * __restrict, void ** __restrict,
int (*)(const void *, const void *));
void *ndpi_tfind(const void *, void *, int (*)(const void *, const void *));
void *ndpi_tsearch(const void *, void**, int (*)(const void *, const void *));
void ndpi_twalk(const void *, void (*)(const void *, ndpi_VISIT, int, void*), void *user_data);
void ndpi_tdestroy(void *vrootp, void (*freefct)(void *));
void *ndpi_tdelete(const void * __restrict, void ** __restrict,
int (*)(const void *, const void *));
void *ndpi_tfind(const void *, void *, int (*)(const void *, const void *));
void *ndpi_tsearch(const void *, void**, int (*)(const void *, const void *));
void ndpi_twalk(const void *, void (*)(const void *, ndpi_VISIT, int, void*), void *user_data);
void ndpi_tdestroy(void *vrootp, void (*freefct)(void *));
int NDPI_BITMASK_COMPARE(NDPI_PROTOCOL_BITMASK a, NDPI_PROTOCOL_BITMASK b);
int NDPI_BITMASK_IS_EMPTY(NDPI_PROTOCOL_BITMASK a);
void NDPI_DUMP_BITMASK(NDPI_PROTOCOL_BITMASK a);
int NDPI_BITMASK_COMPARE(NDPI_PROTOCOL_BITMASK a, NDPI_PROTOCOL_BITMASK b);
int NDPI_BITMASK_IS_EMPTY(NDPI_PROTOCOL_BITMASK a);
void NDPI_DUMP_BITMASK(NDPI_PROTOCOL_BITMASK a);
extern u_int8_t ndpi_net_match(u_int32_t ip_to_check,
u_int32_t net,
u_int32_t num_bits);
extern u_int8_t ndpi_net_match(u_int32_t ip_to_check,
u_int32_t net,
u_int32_t num_bits);
extern u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
u_int32_t net, u_int32_t num_bits);
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_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_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);
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,
struct ndpi_flow_struct *flow,
u_int16_t upper_detected_protocol,
u_int16_t lower_detected_protocol);
void ndpi_int_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol, ndpi_protocol_type_t protocol_type);
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_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);
/* function to parse a packet which has line based information into a line based structure
* this function will also set some well known line pointers like:
* - host, user agent, empty line,....
*/
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_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 void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol, ndpi_protocol_type_t protocol_type);
extern void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t detected_protocol,
ndpi_protocol_type_t protocol_type);
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_port_range *tcpDefPorts, ndpi_port_range *udpDefPorts);
extern void ndpi_int_reset_packet_protocol(struct ndpi_packet_struct *packet);
extern void ndpi_int_reset_protocol(struct ndpi_flow_struct *flow);
extern int ndpi_packet_src_ip_eql(const struct ndpi_packet_struct *packet, const ndpi_ip_addr_t * ip);
extern int ndpi_packet_dst_ip_eql(const struct ndpi_packet_struct *packet, const 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 char *ndpi_get_ip_string(struct ndpi_detection_module_struct *ndpi_struct, 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 u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
u_int8_t proto, u_int16_t sport, u_int16_t dport);
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** udp_master_proto);
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 lower_detected_protocol);
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 lower_detected_protocol);
extern void ndpi_int_change_category(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
ndpi_protocol_category_t protocol_category);
extern u_int8_t ndpi_net_match(u_int32_t ip_to_check,
u_int32_t net,
u_int32_t num_bits);
extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod,
ndpi_protocol_breed_t protoBreed, u_int16_t protoId,
u_int8_t can_have_a_subprotocol,
u_int16_t tcp_alias_protoId[2],
u_int16_t udp_alias_protoId[2], char *protoName,
ndpi_protocol_category_t protoCategory,
ndpi_port_range *tcpDefPorts,
ndpi_port_range *udpDefPorts);
extern u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
u_int32_t net, u_int32_t num_bits);
extern void ndpi_int_reset_packet_protocol(struct ndpi_packet_struct *packet);
extern void ndpi_int_reset_protocol(struct ndpi_flow_struct *flow);
extern int ndpi_packet_src_ip_eql(const struct ndpi_packet_struct *packet, const ndpi_ip_addr_t * ip);
extern int ndpi_packet_dst_ip_eql(const struct ndpi_packet_struct *packet, const 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 int ndpi_parse_ip_string(const char *ip_str, ndpi_ip_addr_t *parsed_ip);
extern char *ndpi_get_ip_string(const ndpi_ip_addr_t * ip, char *buf, u_int buf_len);
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);
extern u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int8_t proto, u_int16_t sport, u_int16_t dport,
u_int8_t *user_defined_proto);
extern u_int8_t ndpi_is_proto(ndpi_protocol proto, u_int16_t 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,
u_int16_t** tcp_master_proto,
u_int16_t** udp_master_proto);
#/* NDPI_PROTOCOL_NETBIOS */
int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len);
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
const char **file, const char **func, u_int32_t * line);
#endif
#include "ndpi_api.h"
/** Checks when the @p payload starts with the string literal @p str.
* When the string is larger than the payload, check fails.
* @return non-zero if check succeeded
*/
int ndpi_match_prefix(const u_int8_t *payload, size_t payload_len,
const char *str, size_t str_len);
#endif /* __NDPI_MAIN_INCLUDE_FILE__ */
/* version of ndpi_match_prefix with string literal */
#define ndpi_match_strprefix(payload, payload_len, str) \
ndpi_match_prefix((payload), (payload_len), (str), (sizeof(str)-1))
#ifdef __cplusplus
}
#endif
#endif /* __NDPI_MAIN_H__ */
+264 -211
View File
@@ -1,8 +1,8 @@
/*
* ndpi_protocol_ids.h
*
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2009-11 - ipoque GmbH
* Copyright (C) 2011-19 - 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
@@ -23,7 +23,7 @@
*/
#ifndef __NDPI_API_INCLUDE_FILE__
#ifndef __NDPI_API_H__
#endif
@@ -31,214 +31,267 @@
#define __NDPI_PROTOCOLS_DEFAULT_H__
#define NDPI_DETECTION_SUPPORT_IPV6
#define NDPI_PROTOCOL_HISTORY_SIZE 3
#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_SMBV1 = 16, /* SMB version 1 */
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 = 38, /* Skype call and videocalls */
NDPI_PROTOCOL_SIGNAL = 39,
NDPI_PROTOCOL_MEMCACHED = 40, /* Memcached - Darryl Sokoloski <darryl@egloo.ca> */
NDPI_PROTOCOL_SMBV23 = 41, /* SMB version 2/3 */
NDPI_PROTOCOL_MINING = 42, /* Bitcoin, Ethereum, ZCash, Monero */
NDPI_PROTOCOL_NEST_LOG_SINK = 43, /* Nest Log Sink (Nest Protect) - Darryl Sokoloski <darryl@egloo.ca> */
NDPI_PROTOCOL_MODBUS = 44, /* Modbus */
NDPI_PROTOCOL_WHATSAPP_CALL = 45, /* WhatsApp video ad audio calls go here */
NDPI_PROTOCOL_DATASAVER = 46, /* Protocols used to save data on Internet communications */
NDPI_PROTOCOL_XBOX = 47,
NDPI_PROTOCOL_QQ = 48,
NDPI_PROTOCOL_TIKTOK = 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_PS_VUE = 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_TLS = 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_HULU = 137,
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_ZOOM = 189, /* Zoom video conference. */
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_DNS_OVER_HTTPS = 196,
NDPI_PROTOCOL_WECHAT = 197,
NDPI_PROTOCOL_MPEGTS = 198,
NDPI_PROTOCOL_SNAPCHAT = 199,
NDPI_PROTOCOL_SINA = 200,
NDPI_PROTOCOL_HANGOUT_DUO = 201, /* Google Hangout ad Duo (merged as they are very similar) */
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_LINE = 205, /* https://en.wikipedia.org/wiki/Line_(software) */
NDPI_PROTOCOL_WIREGUARD = 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_IMO = 216,
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... */
NDPI_PROTOCOL_TARGUS_GETDATA = 243,
NDPI_PROTOCOL_DNP3 = 244,
NDPI_PROTOCOL_104 = 245,
/*
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_IP_VRRP 73
#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_IP_ICMPV6 102
#define NDPI_PROTOCOL_HTTP 7
#define NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV 60
#define NDPI_PROTOCOL_SSL_NO_CERT 64 /* SSL without certificate (Skype, Ultrasurf?) - ntop.org */
#define NDPI_PROTOCOL_SSL 91
#define NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC 110
#define NDPI_PROTOCOL_HTTP_CONNECT 130
#define NDPI_PROTOCOL_HTTP_PROXY 131
#define NDPI_PROTOCOL_SOCKS5 172 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_PROTOCOL_SOCKS4 173 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#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_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_TDS 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_WINMX 27
#define NDPI_PROTOCOL_VMWARE 28
#define NDPI_PROTOCOL_MAIL_SMTPS 29
#define NDPI_PROTOCOL_FILETOPIA 30
#define NDPI_PROTOCOL_IMESH 31
#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_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_QQLIVE 61
#define NDPI_PROTOCOL_THUNDER 62
#define NDPI_PROTOCOL_SOULSEEK 63
#define NDPI_PROTOCOL_IRC 65
#define NDPI_PROTOCOL_AYIYA 66
#define NDPI_PROTOCOL_UNENCRYPED_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_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_RTP 87
#define NDPI_PROTOCOL_RDP 88
#define NDPI_PROTOCOL_VNC 89
#define NDPI_PROTOCOL_PCANYWHERE 90
#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_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_KERBEROS 111
#define NDPI_PROTOCOL_LDAP 112
#define NDPI_PROTOCOL_MAPLESTORY 113
#define NDPI_PROTOCOL_MSSQL 114
#define NDPI_PROTOCOL_PPTP 115
#define NDPI_PROTOCOL_WARCRAFT3 116
#define NDPI_PROTOCOL_WORLD_OF_KUNG_FU 117
#define NDPI_PROTOCOL_MEEBO 118
#define NDPI_PROTOCOL_DROPBOX 121
#define NDPI_PROTOCOL_SKYPE 125
#define NDPI_PROTOCOL_DCERPC 127
#define NDPI_PROTOCOL_NETFLOW 128
#define NDPI_PROTOCOL_SFLOW 129
#define NDPI_PROTOCOL_CITRIX 132
#define NDPI_PROTOCOL_SKYFILE_PREPAID 136
#define NDPI_PROTOCOL_SKYFILE_RUDICS 137
#define NDPI_PROTOCOL_SKYFILE_POSTPAID 138
#define NDPI_PROTOCOL_CITRIX_ONLINE 139
#define NDPI_PROTOCOL_WEBEX 141
#define NDPI_PROTOCOL_VIBER 144
#define NDPI_PROTOCOL_RADIUS 146
#define NDPI_PROTOCOL_WINDOWS_UPDATE 147 /* Thierry Laurion */
#define NDPI_PROTOCOL_TEAMVIEWER 148 /* xplico.org */
#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_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_RTMP 174 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_PROTOCOL_FTP_DATA 175 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_PROTOCOL_ZMQ 177
#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_QUIC 188 /* Andrea Buscarinu <andrea.buscarinu@gmail.com> - Michele Campus <michelecampus5@gmail.com> */
#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_CONTENT_WEBM 157
#define NDPI_SERVICE_FACEBOOK 119
#define NDPI_SERVICE_TWITTER 120
#define NDPI_SERVICE_GMAIL 122
#define NDPI_SERVICE_GOOGLE_MAPS 123
#define NDPI_SERVICE_YOUTUBE 124
#define NDPI_SERVICE_VEVO 186
#define NDPI_SERVICE_GOOGLE 126
#define NDPI_SERVICE_NETFLIX 133
#define NDPI_SERVICE_LASTFM 134
#define NDPI_SERVICE_GROOVESHARK 135
#define NDPI_SERVICE_APPLE 140
#define NDPI_SERVICE_WHATSAPP 142
#define NDPI_SERVICE_APPLE_ICLOUD 143
#define NDPI_SERVICE_APPLE_ITUNES 145
#define NDPI_SERVICE_TUENTI 149
#define NDPI_SERVICE_WIKIPEDIA 176 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_MSN NDPI_PROTOCOL_MSN /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_AMAZON 178 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_EBAY 179 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_CNN 180 /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_DROPBOX NDPI_PROTOCOL_DROPBOX /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_SKYPE NDPI_PROTOCOL_SKYPE /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_VIBER NDPI_PROTOCOL_VIBER /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_YAHOO NDPI_PROTOCOL_YAHOO /* Tomasz Bujlow <tomasz@skatnet.dk> */
#define NDPI_SERVICE_PANDORA 187
/* UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE (NDPI_PROTOCOL_QUIC) */
#define NDPI_LAST_IMPLEMENTED_PROTOCOL 188
#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_PROTOCOL_NO_MASTER_PROTO NDPI_PROTOCOL_UNKNOWN
#define NDPI_MAX_SUPPORTED_PROTOCOLS NDPI_LAST_IMPLEMENTED_PROTOCOL
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
#endif
+212 -17
View File
@@ -1,8 +1,7 @@
/*
* ndpi_protocols.h
*
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-19 - 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
@@ -23,14 +22,29 @@
*/
#ifndef __NDPI_PROTOCOLS_INCLUDE_FILE__
#define __NDPI_PROTOCOLS_INCLUDE_FILE__
#ifndef __NDPI_PROTOCOLS_H__
#define __NDPI_PROTOCOLS_H__
#include "ndpi_main.h"
ndpi_port_range* ndpi_build_default_ports_range(ndpi_port_range *ports,
u_int16_t portA_low, u_int16_t portA_high,
u_int16_t portB_low, u_int16_t portB_high,
u_int16_t portC_low, u_int16_t portC_high,
u_int16_t portD_low, u_int16_t portD_high,
u_int16_t portE_low, u_int16_t portE_high);
ndpi_port_range* ndpi_build_default_ports(ndpi_port_range *ports,
u_int16_t portA,
u_int16_t portB,
u_int16_t portC,
u_int16_t portD,
u_int16_t portE);
/* TCP/UDP protocols */
u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int8_t protocol,
u_int32_t saddr, u_int32_t daddr,
u_int16_t sport, u_int16_t dport);
@@ -38,15 +52,12 @@ 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);
/* 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_bittorrent_init(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t size,u_int32_t timeout);
void ndpi_bittorrent_done(struct ndpi_detection_module_struct *ndpi_struct);
int ndpi_bittorrent_gc(struct hash_ip4p_table *ht,int key,time_t now);
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_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_winmx_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_directconnect(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_i23v5(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
@@ -58,6 +69,7 @@ void ndpi_search_oscar(struct ndpi_detection_module_struct *ndpi_struct, struct
void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_sip(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_imo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_direct_download_link_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_mail_pop_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
@@ -71,7 +83,6 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
void ndpi_search_rtsp_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_ssl_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_mms_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
@@ -117,7 +128,6 @@ void ndpi_search_rdp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
void ndpi_search_snmp(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);
void ndpi_search_syslog(struct ndpi_detection_module_struct*ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_tds_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_mdns(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);
@@ -126,12 +136,12 @@ void ndpi_search_warcraft3(struct ndpi_detection_module_struct *ndpi_struct, str
void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_xdmcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_tftp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_mssql(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_mssql_tds(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_pptp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_stealthnet(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_meebo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_checkmk(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);
void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_maplestory(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
@@ -142,7 +152,6 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str
void ndpi_search_guildwars_tcp(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);
void ndpi_search_dropbox(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_skype(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_citrix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
@@ -174,9 +183,195 @@ void ndpi_search_pando(struct ndpi_detection_module_struct *ndpi_struct, struct
void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_redis(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_zmq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_twitter(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_telegram(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
#endif /* __NDPI_PROTOCOLS_INCLUDE_FILE__ */
void ndpi_search_eaq(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);
void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_starcraft(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_ubntac2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_coap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_mqtt (struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_rx(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_drda(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);
void ndpi_search_smpp(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_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);
void ndpi_search_nest_log_sink(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_wireguard(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_targus_getdata(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_apple_push(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
void ndpi_search_amazon_video(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
/* --- 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_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_armagetron_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ayiya_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_amqp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_battlefield_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_bgp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_bittorrent_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_lisp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_teredo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ciscovpn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_citrix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_corba_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_crossfire_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_dcerpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_dhcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_dhcpv6_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_directconnect_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_dns_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);
void init_directdownloadlink_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_dropbox_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_eaq_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_fiesta_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_data_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_gnutella_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_gtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_guildwars_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_h323_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_halflife2_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_http_activesync_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_iax_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_icecast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ipp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_jabber_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);
void init_kerberos_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);
void init_ldap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_lotus_notes_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mail_imap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mail_pop_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mail_smtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_maplestory_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mdns_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_megaco_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mgpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mining_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mms_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_msn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mpegts_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mssql_tds_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mysql_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_netbios_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_netflow_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_nfs_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_noe_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_non_tcp_udp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ntp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_openft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_openvpn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_oracle_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_oscar_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_pando_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_pcanywhere_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_postgres_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_pplive_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ppstream_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_pptp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_qq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_quake_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_quic_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_radius_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_rdp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_redis_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_rsync_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_rtcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_rtmp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_rtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_rtsp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_sflow_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_shoutcast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_sip_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_imo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_skinny_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_skype_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_smb_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_snmp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_socrates_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_sopcast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_soulseek_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_socks_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_spotify_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ssh_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_tls_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_starcraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_stealthnet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_steam_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_stun_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_syslog_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ssdp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_teamspeak_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_teamviewer_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_telegram_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_telnet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_tftp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_thunder_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_tor_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_tvants_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_tvuplayer_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_usenet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_upnp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_veohtv_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_vhua_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_viber_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_vmware_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_vnc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_warcraft3_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_whois_das_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_world_of_warcraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_world_of_kung_fu_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_xbox_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_xdmcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_yahoo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_zattoo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_zmq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_stracraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ubntac2_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_coap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_mqtt_dissector (struct ndpi_detection_module_struct *ndpi_struct,u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_someip_dissector (struct ndpi_detection_module_struct *ndpi_struct,u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_rx_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_git_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_hangout_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_drda_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_bjnp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_smpp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_tinc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_fix_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_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_amazon_video_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);
void init_nest_log_sink_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_ookla_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_modbus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_line_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_wireguard_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_targus_getdata_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_dnp3_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
void init_104_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
#endif /* __NDPI_PROTOCOLS_H__ */
+1014 -425
View File
File diff suppressed because it is too large Load Diff
+1 -11
View File
@@ -1,8 +1,7 @@
/*
* ndpi_unix.h
*
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-16 - 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
@@ -25,8 +24,6 @@
#ifndef __NDPI_UNIX_INCLUDE_FILE__
#define __NDPI_UNIX_INCLUDE_FILE__
#include "linux_compat.h"
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#include <netinet/in.h>
#if defined(__NetBSD__) || defined(__OpenBSD__)
@@ -38,16 +35,9 @@
#endif
#ifndef WIN32
#ifndef __KERNEL__
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#else
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#endif
#endif
#endif /* __NDPI_UNIX_INCLUDE_FILE__ */
+30 -23
View File
@@ -1,8 +1,7 @@
/*
* ndpi_win32.h
*
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-16 - 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
@@ -22,36 +21,44 @@
*
*/
#ifndef __NDPI_WIN32_INCLUDE_FILE__
#define __NDPI_WIN32_INCLUDE_FILE__
#ifndef __NDPI_WIN32_H__
#define __NDPI_WIN32_H__
#ifdef WIN32
#include <Winsock2.h> /* winsock.h is included automatically */
// fix a MinGW build issue "error: multiple storage classes in declaration specifiers" due to MinGW
// defining extern for __forceinline types
#if (defined(__MINGW32__) || defined(__MINGW64__)) && defined(__GNUC__)
#define MINGW_GCC
#define __mingw_forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
#endif
#include <winsock2.h>
#include <windows.h>
#include <ws2tcpip.h>
#include <process.h>
#include <io.h>
#include <getopt.h> /* getopt from: http://www.pwilson.net/sample.html. */
#include <process.h> /* for getpid() and the exec..() family */
#include <getopt.h> /* getopt from: http://www.pwilson.net/sample.html. */
#include <process.h> /* for getpid() and the exec..() family */
#include <stdint.h>
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#define snprintf _snprintf
extern char* strsep(char **stringp, const char *delim);
#define _WS2TCPIP_H_ /* Avoid compilation problems */
#define IPVERSION 4 /* on *nix it is defined in netinet/ip.h */
extern char* strsep(char **sp, char *sep);
#define __attribute__(x)
#include <stdint.h>
#ifndef __GNUC__
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int uint;
typedef unsigned long u_long;
#endif
typedef u_char u_int8_t;
typedef u_short u_int16_t;
typedef unsigned int u_int32_t;
typedef unsigned __int64 u_int64_t;
typedef u_char u_int8_t;
typedef u_short u_int16_t;
typedef uint u_int32_t;
typedef uint u_int;
typedef unsigned __int64 u_int64_t;
#define pthread_t HANDLE
#define pthread_mutex_t HANDLE
@@ -62,12 +69,12 @@ typedef unsigned __int64 u_int64_t;
#define pthread_rwlock_unlock pthread_mutex_unlock
#define pthread_rwlock_destroy pthread_mutex_destroy
#define gmtime_r(a, b) gmtime(a) /* Already thread safe on windows */
#define gmtime_r(a, b) memcpy(b, gmtime(a), sizeof(struct tm))
#define in_addr_t unsigned long
extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */);
#define sleep(a /* sec */) waitForNextEvent(1000*a /* ms */)
#endif /* Win32 */
#endif /* __NDPI_WIN32_INCLUDE_FILE__ */
#endif /* __NDPI_WIN32_H__ */
-159
View File
@@ -1,159 +0,0 @@
lib_LTLIBRARIES = libndpi.la
CFLAGS += -fPIC -DPIC
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/linux_compat.h \
../include/ndpi_define.h \
../include/ndpi_main.h \
../include/ndpi_protocol_ids.h \
../include/ndpi_protocols.h \
../include/ndpi_typedefs.h \
../include/ndpi_unix.h \
../include/ndpi_win32.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/battlefield.c \
protocols/bgp.c \
protocols/bittorrent.c \
protocols/ciscovpn.c \
protocols/citrix.c \
protocols/collectd.c \
protocols/corba.c \
protocols/crossfire.c \
protocols/dcerpc.c \
protocols/dhcp.c \
protocols/dhcpv6.c \
protocols/directconnect.c \
protocols/directdownloadlink.c \
protocols/dns.c \
protocols/dofus.c \
protocols/dropbox.c \
protocols/edonkey.c \
protocols/fasttrack.c \
protocols/fiesta.c \
protocols/filetopia.c \
protocols/florensia.c \
protocols/ftp_control.c \
protocols/ftp_data.c \
protocols/gnutella.c \
protocols/gtp.c \
protocols/guildwars.c \
protocols/h323.c \
protocols/halflife2_and_mods.c \
protocols/http_activesync.c \
protocols/http.c \
protocols/iax.c \
protocols/icecast.c \
protocols/imesh.c \
protocols/ipp.c \
protocols/irc.c \
protocols/jabber.c \
protocols/kerberos.c \
protocols/kontiki.c \
protocols/ldap.c \
protocols/lotus_notes.c \
protocols/mail_imap.c \
protocols/mail_pop.c \
protocols/mail_smtp.c \
protocols/maplestory.c \
protocols/mdns.c \
protocols/meebo.c \
protocols/megaco.c \
protocols/mgcp.c \
protocols/mms.c \
protocols/msn.c \
protocols/mssql.c \
protocols/mysql.c \
protocols/netbios.c \
protocols/netflow.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/sflow.c \
protocols/shoutcast.c \
protocols/sip.c \
protocols/skinny.c \
protocols/skype.c \
protocols/smb.c \
protocols/snmp.c \
protocols/socks4.c \
protocols/socks5.c \
protocols/socrates.c \
protocols/sopcast.c \
protocols/soulseek.c \
protocols/spotify.c \
protocols/ssdp.c \
protocols/ssh.c \
protocols/ssl.c \
protocols/stealthnet.c \
protocols/steam.c \
protocols/stun.c \
protocols/syslog.c \
protocols/tcp_udp.c \
protocols/tds.c \
protocols/teamspeak.c \
protocols/teamviewer.c \
protocols/telegram.c \
protocols/telnet.c \
protocols/tftp.c \
protocols/thunder.c \
protocols/tor.c \
protocols/tvants.c \
protocols/tvuplayer.c \
protocols/twitter.c \
protocols/usenet.c \
protocols/veohtv.c \
protocols/viber.c \
protocols/vhua.c \
protocols/vmware.c \
protocols/vnc.c \
protocols/warcraft3.c \
protocols/whoisdas.c \
protocols/winmx.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 \
third_party/include/actypes.h \
third_party/include/ahocorasick.h \
third_party/include/node.h \
third_party/include/sort.h \
third_party/src/ahocorasick.c \
third_party/src/node.c \
third_party/src/sort.c
+70
View File
@@ -0,0 +1,70 @@
#
# Simple non-autotools dependent makefile
#
# ./autogen.sh
# cd src/lib
# make Makefile
#
#
# Installation directories
#
prefix = @prefix@
libdir = ${prefix}/lib
includedir = ${prefix}/include/ndpi
CC = @CC@
CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -O2 -g -Wall
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)) $(patsubst ./%.c, ./%.o, $(wildcard ./*.c))
HEADERS = $(wildcard ../include/*.h)
NDPI_VERSION_MAJOR = @NDPI_MAJOR@
NDPI_LIB_STATIC = libndpi.a
NDPI_LIB_SHARED_BASE = libndpi.so
NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@
NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED)
ifneq ($(OS),Windows_NT)
OS := $(shell uname)
endif
ifeq ($(OS),Darwin)
CC=clang
SONAME_FLAG=
else
SONAME_FLAG=-Wl,-soname,$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR)
endif
all: $(NDPI_LIBS)
ndpi_main.c: ndpi_content_match.c.inc
$(NDPI_LIB_STATIC): $(OBJECTS)
ar rc $@ $(OBJECTS)
$(RANLIB) $@
$(NDPI_LIB_SHARED): $(OBJECTS)
$(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS)
ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR)
%.o: %.c $(HEADERS) Makefile
$(CC) $(CFLAGS) -c $< -o $@
clean:
/bin/rm -f $(NDPI_LIB_STATIC) $(OBJECTS) *.o *.so *.lo $(NDPI_LIB_SHARED)
distclean: clean
/bin/rm -f Makefile
cppcheck:
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I ../include *.c protocols/*.c
install: $(NDPI_LIBS)
mkdir -p $(DESTDIR)$(libdir)
cp $(NDPI_LIBS) $(DESTDIR)$(libdir)/
cp -P $(NDPI_LIB_SHARED_BASE) $(DESTDIR)$(libdir)/
cp -P $(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) $(DESTDIR)$(libdir)/
mkdir -p $(DESTDIR)$(includedir)
cp ../include/*.h $(DESTDIR)$(includedir)
+207
View File
@@ -0,0 +1,207 @@
/*
* ndpi_analyze.c
*
* Copyright (C) 2019 - ntop.org
*
* This file is part of nDPI, an open source deep packet inspection
* library.
*
* 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/>.
*
*/
#ifdef HAVE_CONFIG_H
#include "ndpi_config.h"
#endif
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <stdint.h>
#include <math.h>
#include <float.h> /* FLT_EPSILON */
#include "ndpi_api.h"
#include "ndpi_config.h"
/* ********************************************************************************* */
void ndpi_init_data_analysis(struct ndpi_analyze_struct *ret, u_int16_t _max_series_len) {
u_int32_t len;
memset(ret, 0, sizeof(struct ndpi_analyze_struct));
if(_max_series_len > MAX_SERIES_LEN) _max_series_len = MAX_SERIES_LEN;
ret->num_values_array_len = _max_series_len;
if(ret->num_values_array_len > 0) {
len = sizeof(u_int32_t)*ret->num_values_array_len;
if((ret->values = ndpi_malloc(len)) == NULL) {
ndpi_free(ret);
ret = NULL;
} else
memset(ret->values, 0, len);
} else
ret->values = NULL;
}
/* ********************************************************************************* */
struct ndpi_analyze_struct* ndpi_alloc_data_analysis(u_int16_t _max_series_len) {
struct ndpi_analyze_struct *ret = ndpi_malloc(sizeof(struct ndpi_analyze_struct));
if(ret != NULL)
ndpi_init_data_analysis(ret, _max_series_len);
return(ret);
}
/* ********************************************************************************* */
void ndpi_free_data_analysis(struct ndpi_analyze_struct *d) {
if(d->values) ndpi_free(d->values);
ndpi_free(d);
}
/* ********************************************************************************* */
/*
Add a new point to analyze
*/
void ndpi_data_add_value(struct ndpi_analyze_struct *s, const u_int32_t value) {
float tmp_mu;
if(s->sum_total == 0)
s->min_val = s->max_val = value;
else {
if(value < s->min_val) s->min_val = value;
if(value > s->max_val) s->max_val = value;
}
s->sum_total += value, s->num_data_entries++;
if(s->num_values_array_len) {
s->values[s->next_value_insert_index] = value;
if(++s->next_value_insert_index == s->num_values_array_len)
s->next_value_insert_index = 0;
}
/* Update stddev */
tmp_mu = s->stddev.mu;
s->stddev.mu = ((s->stddev.mu * (s->num_data_entries - 1)) + value) / s->num_data_entries;
s->stddev.q = s->stddev.q + (value - tmp_mu)*(value - s->stddev.mu);
}
/* ********************************************************************************* */
/* Compute the average on all values */
float ndpi_data_average(struct ndpi_analyze_struct *s) {
return((s->num_data_entries == 0) ? 0 : ((float)s->sum_total / (float)s->num_data_entries));
}
/* ********************************************************************************* */
/* Return min/max on all values */
u_int32_t ndpi_data_min(struct ndpi_analyze_struct *s) { return(s->min_val); }
u_int32_t ndpi_data_max(struct ndpi_analyze_struct *s) { return(s->max_val); }
/* ********************************************************************************* */
/* Compute the variance on all values */
float ndpi_data_variance(struct ndpi_analyze_struct *s) {
return(s->num_data_entries ? (s->stddev.q / s->num_data_entries) : 0);
}
/* ********************************************************************************* */
/* Compute the standard deviation on all values */
float ndpi_data_stddev(struct ndpi_analyze_struct *s) {
return(sqrt(ndpi_data_variance(s)));
}
/* ********************************************************************************* */
/* Compute the average only on the sliding window */
float ndpi_data_window_average(struct ndpi_analyze_struct *s) {
if(s->num_values_array_len) {
float sum = 0.0;
u_int16_t i, n = ndpi_min(s->num_data_entries, s->num_values_array_len);
for(i=0; i<n; i++)
sum += s->values[i];
return((float)sum / (float)n);
} else
return(0);
}
/* ********************************************************************************* */
/*
Compute entropy on the last sliding window values
*/
float ndpi_data_entropy(struct ndpi_analyze_struct *s) {
if(s->num_values_array_len) {
int i;
float sum = 0.0, total = 0.0;
for(i=0; i<s->num_values_array_len; i++)
total += s->values[i];
for (i=0; i<s->num_values_array_len; i++) {
float tmp = (float)s->values[i] / (float)total;
if(tmp > FLT_EPSILON)
sum -= tmp * logf(tmp);
}
return(sum / logf(2.0));
} else
return(0);
}
/* ********************************************************************************* */
void ndpi_data_print_window_values(struct ndpi_analyze_struct *s) {
if(s->num_values_array_len) {
u_int16_t i, n = ndpi_min(s->num_data_entries, s->num_values_array_len);
for(i=0; i<n; i++)
printf("[%u: %u]", i, s->values[i]);
printf("\n");
}
}
/* ********************************************************************************* */
/*
Upload / download ration
-1 Download
0 Mixed
1 Upload
*/
float ndpi_data_ratio(u_int32_t sent, u_int32_t rcvd) {
float s = (float)((int64_t)sent + (int64_t)rcvd);
float d = (float)((int64_t)sent - (int64_t)rcvd);
return((s == 0) ? 0 : (d/s));
}
const char* ndpi_data_ratio2str(float ratio) {
if(ratio < -0.2) return("Download");
else if(ratio > 0.2) return("Upload");
else return("Mixed");
}
+692
View File
@@ -0,0 +1,692 @@
/*
*
* Copyright (c) 2016 Cisco Systems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
*
* Neither the name of the Cisco Systems, Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/**
* \file ndpi_classify.c
*
* \brief contains the functionality for inline classification
*
*/
#define _GNU_SOURCE
#ifdef HAVE_CONFIG_H
#include "ndpi_config.h"
#endif
#include <stdio.h>
#include <ctype.h>
#include <sys/time.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
#include "ndpi_main.h"
#include "ndpi_classify.h"
/** finds the minimum value between to inputs */
#define min(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a < _b ? _a : _b; })
//bias (1) + w (207)
//const float ndpi_parameters_splt[NUM_PARAMETERS_SPLT_LOGREG] = {
float ndpi_parameters_splt[NUM_PARAMETERS_SPLT_LOGREG] = {
-2.088057846500587456e+00, 7.763936238952200239e-05, 4.404309737393306595e-05, -9.467385027293546973e-02,
4.348947142638090457e-01, -2.091409170053043390e-04, -5.788902107267982974e-04, 4.481443450852441001e-10,
-3.136135459023654537e+00, -1.507730262127600751e+00, -1.204663669965535977e+00, -1.171839254318371104e+00,
4.329302247232582057e-01, 8.310653628092458334e+00, 3.299246725156660176e+00, 0.000000000000000000e+00,
1.847454931582027254e-02, -1.498024139966201096e+00, -7.660670007653060942e-01, -2.908130300830076731e+00,
-1.252564844610269734e+00, -1.910955328742287573e+00, 9.471710980110392697e-01, 2.352302758516665371e+00,
2.982269972214651954e+00, 4.280736383314343918e+00, 4.633629909719495288e+00, -2.198052637823726840e+00,
-1.150759637168392580e+00, 3.420433363184381292e+00, 1.857878113059351077e-02, -1.559806674919653746e+00,
4.197498183183401288e+00, 6.262186949633183453e+00, 1.100694844370524095e+01, 2.778688785515088000e+01,
3.679948298336883195e+00, -2.432801394376875592e+00, 5.133442052706843617e-01, 2.181172654073517680e+00,
-8.577551729671881731e-01, 7.013844214023315926e-01, 3.138233436228588857e+00, 7.319940508466630247e-01,
0.000000000000000000e+00, 3.529209394581482861e+00, 1.464585117707144413e+01, 8.506550226820598359e-01,
-9.060397326548508268e-01, 6.787474954688997641e+00, 8.125411068867387954e+00, 4.515740684104064151e+00,
5.372135582950940069e+00, 9.210951196799497254e-01, 4.802177410869620466e+00, 2.945445016176073594e+01,
1.575032253128311632e+00, -1.355276854364796946e-01, -3.322474764169629502e-01, 3.018397817188666732e+00,
1.186503569922195744e+00, 0.000000000000000000e+00, 8.883242370198487503e-01, 7.248276146728496627e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, -4.831246718433664711e+00, 6.124136970173365002e-01,
4.145693892559814686e-01, 2.683998941637626867e+00, 2.063906603639539039e+00, 2.989801217386735210e+00,
2.262965767379551962e-01, 2.240332214649647380e+00, 5.984550782416063086e+00, 4.587011255338186544e+00,
1.233118485315272039e+01, 1.115223490909697857e+00, -3.682686422016995476e+00, 6.096498453291562258e-01,
1.119275528656461516e+00, 1.377886278915177731e-01, 3.828176805973048324e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 1.442927634029647344e+01, 0.000000000000000000e+00, 5.719118583309401593e-01,
1.993632609731877392e-01, 3.047472271520709430e+00, 5.736784864911910198e+00, 6.677826247219391220e+00,
6.307175478564531090e+00, 3.150295169417364249e+01, 3.738597740702392258e+00, 1.129754590514236234e+01,
6.108506268573830056e+00, 1.605489516792866667e+00, 2.929631990348545489e+00, -2.832543082245212937e-02,
1.358286530670594461e+00, 1.655932469853677924e+00, 6.701964773769768513e-01, 2.131182050917533211e+00,
2.998351165769753468e+00, 7.772095996358327596e+00, 1.285014785269981141e+00, 4.407334784589962418e+00,
1.719858214230612026e+00, -1.012765674651314063e+00, -5.749271123172469133e-01, -3.559614093795681278e+00,
-3.073088477387719397e+00, -4.492469521371540431e+00, -3.753286990415885427e+00, -3.219255423324282273e+00,
-2.806436518181075090e+00, -2.697305948568419875e+00, -7.879608430851776646e-01, 4.625507221739111330e+00,
4.809280703883450414e+00, -3.435194026629848629e+00, -3.218943068168937049e+00, 3.335535704890596698e+00,
2.071359212435486263e+00, 4.538992059175040339e+00, -2.770772323566738038e+01, 2.903047708571506735e+00,
-4.436143805989154032e+00, -2.647991280011542381e-01, 1.737252348126810064e+00, -4.121989655995259128e+00,
3.209709099445720581e-01, 1.012758514896711759e+01, 3.313255624721038295e+00, 4.631467619785444967e+00,
7.668642402146534032e+00, 6.780938812710099128e+00, -3.256164342602652972e+00, 6.749565128319576779e-01,
0.000000000000000000e+00, -4.407265954524525853e+00, 0.000000000000000000e+00, -3.666522115024547901e+01,
-7.886029397826226273e+01, 0.000000000000000000e+00, 0.000000000000000000e+00, -2.261283814517791058e+01,
-4.024317426178160240e+00, 3.213063737030031342e-01, 5.079805145796887800e+00, 1.326813226475260343e+00,
1.233684078112145643e+00, 8.671852503871454232e+00, -2.041800256066371944e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, -1.607347800380474823e+01, -4.430790279223246309e+00, 1.177552465851384511e+00,
6.342921220500139512e+00, -2.466913734548706327e-02, 3.451642566010713065e-01, -6.012767168531006234e+00,
7.328146570137336724e+00, 7.500088131707050465e+00, 0.000000000000000000e+00, -3.547913249211809017e+01,
-3.130964814607208879e+00, 8.247326544297072237e-01, 3.757262485775580418e-01, -2.136528302027558723e+00,
-2.631627236037529793e-01, -2.016718799388414141e+01, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, -7.708602132869285528e-01, -2.602868328868111814e+00, 1.435184800833797958e+00,
0.000000000000000000e+00, -2.080420864280113413e+00, 1.169498351211070819e+00, -1.798334115637199560e+01,
-1.193885252696202670e+01, 0.000000000000000000e+00, 0.000000000000000000e+00, 4.304089297965300709e+00,
-3.020893216686394656e+00, -1.234427481614708721e+00, 0.000000000000000000e+00, 1.853340741926325697e+00,
-2.686000064995862147e+01, -1.672275139058893600e+01, -2.826268691607605987e+01, 0.000000000000000000e+00,
0.000000000000000000e+00, -1.547397429377200817e+00, -4.018181657009961327e+00, -7.289186736637049968e+00,
-7.458655219230571731e+00, -9.625538282761622710e+00, -1.103039457077456298e+01, -6.262675161142102809e+01,
-9.265912629799268885e+00, -8.961543476816615339e+00, -9.622764435629340696e+00, -1.097978292092879826e+01,
};
//bias (1) + w (207)
//const float ndpi_parameters_bd[NUM_PARAMETERS_BD_LOGREG] = {
float ndpi_parameters_bd[NUM_PARAMETERS_BD_LOGREG] = {
-1.678134053325450292e+00, 1.048946534609769413e-04, 9.608725756967682636e-05, -7.515489355100658797e-02,
2.089554874872663892e-01, -1.012058874142656513e-04, -2.917652723373885169e-04, 1.087540461196068741e-10,
-2.594688448425090055e+00, -2.071803573048482061e+00, -1.399303273236228939e+00, -2.089300736641718004e+00,
-8.842347826063630123e-01, 6.476433717022786141e+00, 3.114501282249810377e+00, -2.239127990932460399e+00,
-4.667574389646080291e-01, -2.200651610813817438e+00, -1.674926704401964894e+00, -3.894420410398949706e+00,
-1.232376502509682004e+00, -2.231027070413975189e+00, 7.691948448668822769e-01, 3.222335181407633531e+00,
1.430983188964249919e+00, 2.144317250116257956e+00, 6.596745231472220361e+00, -2.464580889153460852e+00,
-1.923337901965658681e+00, 2.910328594745831943e+00, -3.123244869063500073e-01, -1.683345539896562659e+00,
3.785795988845424898e+00, 5.235473328290667361e+00, 8.512526402199654285e+00, 1.393475907195251473e+01,
1.673386027437856916e+00, -2.910729265724139925e+00, 2.969886703676111184e-01, 1.700051266957717466e+00,
-5.472121114836264733e-01, 1.716354591332415469e-01, 3.177884264837486317e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 1.924354871334499062e-01, 6.568439271753665487e+00, 2.102316342451608644e-01,
-1.132124603237853355e+00, 7.329625148148498859e+00, 6.606460464951361189e+00, 2.844223241371105271e+00,
3.078771172794853683e+00, 0.000000000000000000e+00, 2.656884613648917703e+00, 1.779697712165259205e+01,
0.000000000000000000e+00, -3.457017935109325535e-01, 2.157595478838472414e-01, 3.829196175023549031e+00,
0.000000000000000000e+00, 1.650776974765602867e-01, 1.357223085191380796e-02, 3.946357663253555081e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, -2.155616432815957495e+00, 8.213633570666911687e-01,
1.125480801049912050e-01, 2.684005418659722420e+00, 5.769541257304295900e-01, 1.060883870466023948e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 3.413708974045502664e+00, 2.275281553961784553e+00,
5.176725998383044924e+00, 1.019445219242678835e+00, -1.848344450190015698e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 1.491820649409327126e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 9.379741891282449728e+00, 0.000000000000000000e+00, 5.444605374840002510e-01,
-9.654403640632221173e-02, 2.642171746731144744e+00, 4.626416118226488905e+00, 3.654642208477139498e+00,
3.427412899258296619e+00, 1.490784083593987397e+01, 2.322393214516801141e+00, 6.511453713852694669e+00,
6.949721651828602020e+00, 1.186838154505042375e+00, 2.072129970488261197e+00, 0.000000000000000000e+00,
1.598928631178261561e+00, 5.926083912988970859e-01, -1.612886287403501873e-01, 9.452951868724716045e-01,
2.145707914290207352e+00, 5.391610489831286657e+00, 8.454389313314318866e-01, 2.372736567215404602e+00,
-3.130110237826235764e-01, -2.994989290166069740e+00, -2.571950567149417832e+00, -5.018016256298333921e+00,
-4.851489154898488643e+00, -7.101788768628541249e+00, -5.227281714666618839e+00, -6.351346048086286444e+00,
-4.558191218464671124e+00, -5.293990544168526213e+00, -2.920034449434862345e-01, 5.166915658100844411e+00,
4.642130303354632836e+00, -5.246106907306949951e-01, -3.120281208300208498e+00, 1.544764033379846691e+00,
0.000000000000000000e+00, 3.721469736246234561e+00, -1.083434721745241625e+01, 2.901590918368040395e+00,
-3.602037909234679258e+00, 0.000000000000000000e+00, 2.736307835089097917e+00, -5.037400262764839987e+00,
-1.163050013241316849e+00, 6.565863507998260573e+00, 1.872406036485896097e+00, 2.249439295570562880e+00,
3.276076277814265136e+00, 5.747730113795930684e+00, -2.084335807954610154e+00, 1.812930768433161921e+00,
0.000000000000000000e+00, -4.068875727535363751e+00, -4.509432609364653205e-02, -1.424182063303933710e+01,
-1.743400430675688639e+01, 0.000000000000000000e+00, 0.000000000000000000e+00, -8.986019040369217947e+00,
-2.005955598483518898e+00, 1.514163405869717538e+00, 4.060752357984299010e+00, 1.405971170124569403e+00,
1.383171915541985708e+00, 4.654452090729912506e+00, -3.395023560174311950e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, -8.562968788250293173e+00, -1.939561462845156514e+00, 2.627499899415196793e+00,
4.949794698120698833e+00, 4.355655772643094448e-01, 0.000000000000000000e+00, -1.055190553626396577e+00,
4.757318838337171840e+00, 3.966536148163406938e+00, 0.000000000000000000e+00, -1.190662117721104352e+01,
-1.673945042186458121e+00, 0.000000000000000000e+00, -1.203943763219820356e-02, -1.411827841131889194e+00,
-7.623501643009024109e-01, -6.774873775798392117e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, -1.755294779557688090e+00, 1.542887322103192238e+00,
0.000000000000000000e+00, -8.228978371972577310e-01, 0.000000000000000000e+00, -5.379142925264499553e+00,
-1.144060263986041326e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 4.731108583634047626e+00,
-1.569393147397664556e+00, -3.449886418134247568e-01, 0.000000000000000000e+00, 1.658412661295906920e+00,
-5.077151059809188460e+00, -7.326467579034271260e+00, -1.190177296658179840e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, -1.914781807241187739e+00, -5.438446604150855457e+00,
-5.988893208768400811e+00, -7.886849112491050029e+00, -9.355574940159534947e+00, -1.682361325340106006e+01,
-7.609538696398503888e+00, -7.363350786768400269e+00, -7.366039984795356155e+00, -7.051111570136543882e+00,
2.337391373249395610e+00, -4.374845402801011574e+01, -3.610863365629191080e+00, 7.684297617701028571e+01,
2.162851395732025139e+01, 1.066280518306870562e+01, 8.109257308306457901e+01, 5.149561395669890906e+00,
0.000000000000000000e+00, 3.219993054481156136e+00, 0.000000000000000000e+00, 2.093519725422254396e+01,
-5.225298528278367272e+00, 0.000000000000000000e+00, 2.159597932230871820e+00, -5.205637201784965384e+01,
1.601979388461561982e+01, 6.945290207097973401e+00, 8.036724740759808583e-01, 4.712266457087280536e+00,
2.146353485778652370e+01, 3.470089369007970248e+01, 9.468591086256607170e+00, 9.760488656497257054e-01,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 9.008837970422939323e-01,
0.000000000000000000e+00, 1.462843531299845168e+01, 0.000000000000000000e+00, 0.000000000000000000e+00,
-1.179406942091425847e+01, 0.000000000000000000e+00, 1.642473653464513816e+01, 1.387228776263151175e+01,
0.000000000000000000e+00, 1.613129141280310108e+01, 0.000000000000000000e+00, -1.077318890268341045e+00,
4.189407459072477802e-01, 0.000000000000000000e+00, -1.570052145651456899e+00, 0.000000000000000000e+00,
1.120834605828141939e+01, 4.286417457736029490e+01, 0.000000000000000000e+00, 2.938378293327098945e+01,
1.194087082487160956e+01, 0.000000000000000000e+00, -9.951431855637998813e-02, 3.844291513997798448e-01,
2.362333099868798669e+01, -1.002532136112976957e+01, 2.427817537309562823e+01, 0.000000000000000000e+00,
1.076329692188489773e+01, 1.760895870067486157e+00, 2.080295785135324849e+01, -4.335217053626006134e+01,
-6.272369476984676062e-01, 5.165768790797590881e+00, -4.507215926635629311e-01, 0.000000000000000000e+00,
-4.242472062530233679e+00, -4.931831554080153168e+00, -2.806203935735193777e+00, -2.670377941558885126e+01,
0.000000000000000000e+00, -2.124688439238133242e+01, 0.000000000000000000e+00, 0.000000000000000000e+00,
2.452415244698852970e+00, -1.173727222080745092e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
-1.458125295680756039e+01, -1.757703406512062827e+01, 0.000000000000000000e+00, 3.943626521423988951e+00,
0.000000000000000000e+00, -4.006095410470026152e+00, 1.727171067402430538e+01, -3.412620901789366457e+01,
0.000000000000000000e+00, 1.760073934312834254e+01, 3.266082201875645552e+01, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 1.514535424913179362e+01, 0.000000000000000000e+00,
0.000000000000000000e+00, -3.100487758075622935e-01, 0.000000000000000000e+00, 2.387863228159451978e+01,
1.237098847411416891e+01, 1.154430573879687560e-02, 7.976366278729441817e+00, 0.000000000000000000e+00,
-6.296727640787388447e-01, 1.406230674131906255e+01, 1.430275589872723430e+01, -2.231764570537816184e+00,
0.000000000000000000e+00, 5.003869692542436631e+00, 0.000000000000000000e+00, -5.482127427587509594e+00,
-8.830547931126154992e+00, -5.376776036224484301e+01, -2.918517871695104304e+01, -1.009022417771788049e+01,
-4.811775051355994037e+00, -1.188016976215758547e+01, -2.055483647266791536e+01, -2.482333959706277327e+01,
-1.048392515070836950e+01, -3.837352144714887459e+01, 0.000000000000000000e+00, -9.298440675063780247e+00,
0.000000000000000000e+00, 3.584086297861655890e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 1.184271790014085113e+00,
1.594266439891793219e+01, 0.000000000000000000e+00, 8.473235161049382569e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 6.748879951595517568e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, -1.057534737660506430e+01, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, -3.179879192807419841e+01, 0.000000000000000000e+00, 5.000324879565139824e+00,
0.000000000000000000e+00, 1.229183419446936654e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
4.127983063177185663e+00, 6.616705680943091750e+00, 5.848245769217652601e+00, -1.818944631334333550e+01,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
2.694838778746875274e+00, 0.000000000000000000e+00, 1.463145767737777625e+01, -4.924734438569850603e+00,
0.000000000000000000e+00, 1.877377621310543088e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
1.971941442729244764e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 1.732809836566829187e+00, 2.700285877421266534e+01,
2.915978562591383216e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, -6.999629705176019456e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 1.089611710258455268e+01,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
2.121018958070171934e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
-7.416250358067024706e+00, -1.263327458973565065e+01, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 2.241612733384156897e+01,
0.000000000000000000e+00, 8.607688079645482659e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 1.750217629228628269e+01, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, -1.957769005108392690e+01, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, -3.242393079195928784e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, 0.000000000000000000e+00, 1.348338590741638932e+01, 0.000000000000000000e+00,
-2.000312276678208392e-02, -7.776608146776987640e-01, 0.000000000000000000e+00, 0.000000000000000000e+00,
0.000000000000000000e+00, -5.387825733845168941e+00, 0.000000000000000000e+00, 2.153516224136292934e+01,
0.000000000000000000e+00, 0.000000000000000000e+00, -9.635140703414636576e+00, 2.603288107669730511e+00,
};
/**
* \fn void ndpi_merge_splt_arrays (const uint16_t *pkt_len, const struct timeval *pkt_time,
const uint16_t *pkt_len_twin, const struct timeval *pkt_time_twin,
struct timeval start_time, struct timeval start_time_twin,
uint16_t s_idx, uint16_t r_idx,
uint16_t *merged_lens, uint16_t *merged_times,
uint32_t max_num_pkt_len, uint32_t max_merged_num_pkts)
* \param pkt_len length of the packet
* \param pkt_time time of the packet
* \param pkt_len_twin length of the twin packet
* \param pkt_time_twin time of the twin packet
* \param start_time start time
* \param start_time_twin start time of twin
* \param s_idx s index in the merge
* \param r_idx r index in the merge
* \param merged_lens length of the merge
* \param merged_times time of the merge
* \param max_merged_num_pkts number of packets merged
* \return none
*/
void
ndpi_merge_splt_arrays (const uint16_t *pkt_len, const struct timeval *pkt_time,
const uint16_t *pkt_len_twin, const struct timeval *pkt_time_twin,
struct timeval start_time, struct timeval start_time_twin,
uint16_t s_idx, uint16_t r_idx,
uint16_t *merged_lens, uint16_t *merged_times)
{
int s,r;
struct timeval ts_start = { 0, 0 }; /* initialize to avoid spurious warnings */
struct timeval tmp, tmp_r;
struct timeval start_m;
if (r_idx + s_idx == 0) {
return ;
} else if (r_idx == 0) {
ts_start = pkt_time[0];
tmp = pkt_time[0];
ndpi_timer_sub(&tmp, &start_time, &start_m);
} else if (s_idx == 0) {
ts_start = pkt_time_twin[0];
tmp = pkt_time_twin[0];
ndpi_timer_sub(&tmp, &start_time_twin, &start_m);
} else {
if (ndpi_timer_lt(&start_time, &start_time_twin)) {
ts_start = pkt_time[0];
tmp = pkt_time[0];
ndpi_timer_sub(&tmp, &start_time, &start_m);
} else {
// ts_start = pkt_time_twin[0];
tmp = pkt_time_twin[0];
ndpi_timer_sub(&tmp, &start_time_twin, &start_m);
}
}
s = r = 0;
while ((s < s_idx) || (r < r_idx)) {
if (s >= s_idx) {
merged_lens[s+r] = pkt_len_twin[r];
tmp = pkt_time_twin[r];
ndpi_timer_sub(&tmp, &ts_start, &tmp_r);
merged_times[s+r] = ndpi_timeval_to_milliseconds(tmp_r);
if (merged_times[s+r] == 0)
merged_times[s+r] = ndpi_timeval_to_microseconds(tmp_r);
ts_start = tmp;
r++;
} else if (r >= r_idx) {
merged_lens[s+r] = pkt_len[s];
tmp = pkt_time[s];
ndpi_timer_sub(&tmp, &ts_start, &tmp_r);
merged_times[s+r] = ndpi_timeval_to_milliseconds(tmp_r);
if (merged_times[s+r] == 0)
merged_times[s+r] = ndpi_timeval_to_microseconds(tmp_r);
ts_start = tmp;
s++;
} else {
if (ndpi_timer_lt(&pkt_time[s], &pkt_time_twin[r])) {
merged_lens[s+r] = pkt_len[s];
tmp = pkt_time[s];
ndpi_timer_sub(&tmp, &ts_start, &tmp_r);
merged_times[s+r] = ndpi_timeval_to_milliseconds(tmp_r);
if (merged_times[s+r] == 0)
merged_times[s+r] = ndpi_timeval_to_microseconds(tmp_r);
ts_start = tmp;
s++;
} else {
merged_lens[s+r] = pkt_len_twin[r];
tmp = pkt_time_twin[r];
ndpi_timer_sub(&tmp, &ts_start, &tmp_r);
merged_times[s+r] = ndpi_timeval_to_milliseconds(tmp_r);
if (merged_times[s+r] == 0)
merged_times[s+r] = ndpi_timeval_to_microseconds(tmp_r);
ts_start = tmp;
r++;
}
}
}
merged_times[0] = ndpi_timeval_to_milliseconds(start_m);
if (merged_times[0] == 0)
merged_times[0] = ndpi_timeval_to_microseconds(start_m);
}
/* transform lens array to Markov chain */
static void
ndpi_get_mc_rep_lens (uint16_t *lens, float *length_mc, uint16_t num_packets)
{
float row_sum;
int prev_packet_size = 0;
int cur_packet_size = 0;
int i, j;
for (i = 0; i < MC_BINS_LEN*MC_BINS_LEN; i++) { // init to 0
length_mc[i] = 0.0;
}
if (num_packets == 0) {
// nothing to do
} else if (num_packets == 1) {
cur_packet_size = (int)min(lens[0]/(float)MC_BIN_SIZE_LEN,(uint16_t)MC_BINS_LEN-1);
length_mc[cur_packet_size + cur_packet_size*MC_BINS_LEN] = 1.0;
} else {
for (i = 1; i < num_packets; i++) {
prev_packet_size = (int)min((uint16_t)(lens[i-1]/(float)MC_BIN_SIZE_LEN),(uint16_t)MC_BINS_LEN-1);
cur_packet_size = (int)min((uint16_t)(lens[i]/(float)MC_BIN_SIZE_LEN),(uint16_t)MC_BINS_LEN-1);
length_mc[prev_packet_size*MC_BINS_LEN + cur_packet_size] += 1.0;
}
// normalize rows of Markov chain
for (i = 0; i < MC_BINS_LEN; i++) {
// find sum
row_sum = 0.0;
for (j = 0; j < MC_BINS_LEN; j++) {
row_sum += length_mc[i*MC_BINS_LEN+j];
}
if (row_sum != 0.0) {
for (j = 0; j < MC_BINS_LEN; j++) {
length_mc[i*MC_BINS_LEN+j] /= row_sum;
}
}
}
}
}
/* transform times array to Markov chain */
void
ndpi_get_mc_rep_times (uint16_t *times, float *time_mc, uint16_t num_packets)
{
float row_sum;
int prev_packet_time = 0;
int cur_packet_time = 0;
int i, j;
for (i = 0; i < MC_BINS_TIME*MC_BINS_TIME; i++) { // init to 0
time_mc[i] = 0.0;
}
if (num_packets == 0) {
// nothing to do
} else if (num_packets == 1) {
cur_packet_time = (int)min(times[0]/(float)MC_BIN_SIZE_TIME,(uint16_t)MC_BINS_TIME-1);
time_mc[cur_packet_time + cur_packet_time*MC_BINS_TIME] = 1.0;
} else {
for (i = 1; i < num_packets; i++) {
prev_packet_time = (int)min((uint16_t)(times[i-1]/(float)MC_BIN_SIZE_TIME),(uint16_t)MC_BINS_TIME-1);
cur_packet_time = (int)min((uint16_t)(times[i]/(float)MC_BIN_SIZE_TIME),(uint16_t)MC_BINS_TIME-1);
time_mc[prev_packet_time*MC_BINS_TIME + cur_packet_time] += 1.0;
}
// normalize rows of Markov chain
for (i = 0; i < MC_BINS_TIME; i++) {
// find sum
row_sum = 0.0;
for (j = 0; j < MC_BINS_TIME; j++) {
row_sum += time_mc[i*MC_BINS_TIME+j];
}
if (row_sum != 0.0) {
for (j = 0; j < MC_BINS_TIME; j++) {
time_mc[i*MC_BINS_TIME+j] /= row_sum;
}
}
}
}
}
/**
* \fn float classify (const unsigned short *pkt_len, const struct timeval *pkt_time,
const unsigned short *pkt_len_twin, const struct timeval *pkt_time_twin,
struct timeval start_time, struct timeval start_time_twin, uint32_t max_num_pkt_len,
uint16_t sp, uint16_t dp, uint32_t op, uint32_t ip, uint32_t np_o, uint32_t np_i,
uint32_t ob, uint32_t ib, uint16_t use_bd, const uint32_t *bd, const uint32_t *bd_t)
* \param pkt_len length of the packet
* \param pkt_time time of the packet
* \param pkt_len_twin length of the packet twin
* \param pkt_time_twin time of the packet twin
* \param start_time start time
* \param start_time_twin start time of the twin
* \param max_num_pkt_len maximum len of number of packets
* \param sp
* \param dp
* \param op
* \param ip
* \param np_o
* \param np_i
* \param ob
* \param ib
* \param use_bd
* \param *bd pointer to bd
* \param *bd_t pointer to bd type
* \return float score
*/
float
ndpi_classify (const unsigned short *pkt_len, const struct timeval *pkt_time,
const unsigned short *pkt_len_twin, const struct timeval *pkt_time_twin,
struct timeval start_time, struct timeval start_time_twin, uint32_t max_num_pkt_len,
uint16_t sp, uint16_t dp, uint32_t op, uint32_t ip, uint32_t np_o, uint32_t np_i,
uint32_t ob, uint32_t ib, uint16_t use_bd, const uint32_t *bd, const uint32_t *bd_t)
{
float features[NUM_PARAMETERS_BD_LOGREG] = {1.0};
float mc_lens[MC_BINS_LEN*MC_BINS_LEN];
float mc_times[MC_BINS_TIME*MC_BINS_TIME];
uint32_t i;
float score = 0.0;
uint32_t op_n = min(np_o, max_num_pkt_len);
uint32_t ip_n = min(np_i, max_num_pkt_len);
uint16_t *merged_lens = NULL;
uint16_t *merged_times = NULL;
for (i = 1; i < NUM_PARAMETERS_BD_LOGREG; i++) {
features[i] = 0.0;
}
merged_lens = calloc(1, sizeof(uint16_t)*(op_n + ip_n));
merged_times = calloc(1, sizeof(uint16_t)*(op_n + ip_n));
if (!merged_lens || !merged_times) {
free(merged_lens);
free(merged_times);
return(score);
}
// fill out meta data
features[1] = (float)dp; // destination port
features[2] = (float)sp; // source port
features[3] = (float)ip; // inbound packets
features[4] = (float)op; // outbound packets
features[5] = (float)ib; // inbound bytes
features[6] = (float)ob; // outbound bytes
features[7] = 0.0;// skipping 7 until we process the pkt_time arrays
// find the raw features
ndpi_merge_splt_arrays(pkt_len, pkt_time, pkt_len_twin, pkt_time_twin, start_time, start_time_twin, op_n, ip_n,
merged_lens, merged_times);
// find new duration
for (i = 0; i < op_n+ip_n; i++) {
features[7] += (float)merged_times[i];
}
// get the Markov chain representation for the lengths
ndpi_get_mc_rep_lens(merged_lens, mc_lens, op_n+ip_n);
// get the Markov chain representation for the times
ndpi_get_mc_rep_times(merged_times, mc_times, op_n+ip_n);
// fill out lens/times in feature vector
for (i = 0; i < MC_BINS_LEN*MC_BINS_LEN; i++) {
features[i+8] = mc_lens[i]; // lengths
}
for (i = 0; i < MC_BINS_TIME*MC_BINS_TIME; i++) {
features[i+8+MC_BINS_LEN*MC_BINS_LEN] = mc_times[i]; // times
}
// fill out byte distribution features
if (ob+ib > 100 && use_bd) {
for (i = 0; i < NUM_BD_VALUES; i++) {
if (pkt_len_twin != NULL) {
features[i+8+MC_BINS_LEN*MC_BINS_LEN+MC_BINS_TIME*MC_BINS_TIME] = (bd[i]+bd_t[i])/((float)(ob+ib));
} else {
features[i+8+MC_BINS_LEN*MC_BINS_LEN+MC_BINS_TIME*MC_BINS_TIME] = bd[i]/((float)(ob));
}
}
score = ndpi_parameters_bd[0];
for (i = 1; i < NUM_PARAMETERS_BD_LOGREG; i++) {
score += features[i]*ndpi_parameters_bd[i];
}
} else {
for (i = 0; i < NUM_PARAMETERS_SPLT_LOGREG; i++) {
score += features[i]*ndpi_parameters_splt[i];
}
}
score = min(-score,500.0); // check b/c overflow
free(merged_lens);
free(merged_times);
return 1.0/(1.0+exp(score));
}
/**
* \fn void update_params (char *splt_params, char *bd_params)
* \brief if a user supplies new parameter files, update parameters splt/bd
* \param param_type type of new parameters to update
* \param params file name with new parameters
* \reutrn none
*/
void
ndpi_update_params (classifier_type_codes_t param_type, const char *param_file)
{
float param;
FILE *fp;
int count = 0;
switch (param_type) {
case (SPLT_PARAM_TYPE):
count = 0;
fp = fopen(param_file,"r");
if (fp != NULL) {
while (fscanf(fp, "%f", &param) != EOF) {
ndpi_parameters_splt[count] = param;
count++;
if (count >= NUM_PARAMETERS_SPLT_LOGREG) {
break;
}
}
fclose(fp);
}
break;
case (BD_PARAM_TYPE):
count = 0;
fp = fopen(param_file,"r");
if (fp != NULL) {
while (fscanf(fp, "%f", &param) != EOF) {
ndpi_parameters_bd[count] = param;
count++;
if (count >= NUM_PARAMETERS_BD_LOGREG) {
break;
}
}
fclose(fp);
}
break;
default:
printf("error: unknown paramerter type (%d)", param_type);
break;
}
}
/* *********************************************************************
* ---------------------------------------------------------------------
* Time functions
* For portability and static analysis, we define our own timer
* comparison functions (rather than use non-standard
* timercmp/timersub macros)
* ---------------------------------------------------------------------
* *********************************************************************
*/
/**
* \brief Compare two times to see if they are equal
* \param a First time value
* \param b Second time value
* \return 1 if equal, 0 otherwise
*/
unsigned int
ndpi_timer_eq(const struct timeval *a,
const struct timeval *b)
{
if (a->tv_sec == b->tv_sec && a->tv_usec == b->tv_usec) {
return 1;
}
return 0;
}
unsigned int
ndpi_timer_lt(const struct timeval *a,
const struct timeval *b)
{
return (a->tv_sec == b->tv_sec) ?
(a->tv_usec < b->tv_usec):(a->tv_sec < b->tv_sec);
}
/**
* \brief Calculate the difference betwen two times (result = a - b)
* \param a First time value
* \param b Second time value
* \param result The difference between the two time values
* \return none
*/
void
ndpi_timer_sub(const struct timeval *a,
const struct timeval *b,
struct timeval *result)
{
result->tv_sec = a->tv_sec - b->tv_sec;
result->tv_usec = a->tv_usec - b->tv_usec;
if (result->tv_usec < 0) {
--result->tv_sec;
result->tv_usec += 1000000;
}
}
/**
* \brief Zeroize a timeval.
* \param a Timeval to zero out
* \return none
*/
void
ndpi_timer_clear(struct timeval *a)
{
a->tv_sec = a->tv_usec = 0;
}
/**
* \brief Calculate the milliseconds representation of a timeval.
* \param ts Timeval
* \return unsigned int - Milliseconds
*/
unsigned int
ndpi_timeval_to_milliseconds(struct timeval ts)
{
unsigned int result = ts.tv_usec / 1000 + ts.tv_sec * 1000;
return result;
}
/**
* \brief Calculate the microseconds representation of a timeval.
* \param ts Timeval
* \return unsigned int - Milliseconds
*/
unsigned int
ndpi_timeval_to_microseconds(struct timeval ts)
{
unsigned int result = ts.tv_usec + ts.tv_sec * 1000 * 1000;
return result;
}
void
ndpi_log_timestamp(char *log_ts, uint32_t log_ts_len)
{
struct timeval tv;
time_t nowtime;
struct tm nowtm_r;
char tmbuf[NDPI_TIMESTAMP_LEN];
gettimeofday(&tv, NULL);
nowtime = tv.tv_sec;
localtime_r(&nowtime, &nowtm_r);
strftime(tmbuf, NDPI_TIMESTAMP_LEN, "%H:%M:%S", &nowtm_r);
snprintf(log_ts, log_ts_len, "%s.%06ld", tmbuf, (long)tv.tv_usec);
}
File diff suppressed because it is too large Load Diff
+4609 -3811
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+738
View File
@@ -0,0 +1,738 @@
/*
* ndpi_utils.c
*
* Copyright (C) 2011-19 - 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/>.
*
*/
#ifdef HAVE_CONFIG_H
#include "ndpi_config.h"
#endif
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include "ahocorasick.h"
#include "libcache.h"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_UNKNOWN
#include "ndpi_api.h"
#include "ndpi_config.h"
#include <time.h>
#ifndef WIN32
#include <unistd.h>
#endif
#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
#include <sys/endian.h>
#endif
#include "third_party/include/ndpi_patricia.h"
#include "third_party/include/ht_hash.h"
#define NDPI_CONST_GENERIC_PROTOCOL_NAME "GenericProtocol"
// #define MATCH_DEBUG 1
/* implementation of the punycode check function */
int ndpi_check_punycode_string(char * buffer , int len) {
int i = 0;
while(i++ < len) {
if((buffer[i] == 'x')
&& (buffer[i+1] == 'n')
&& (buffer[i+2] == '-')
&& (buffer[i+3] == '-'))
// is a punycode string
return(1);
}
// not a punycode string
return 0;
}
/* ftp://ftp.cc.uoc.gr/mirrors/OpenBSD/src/lib/libc/stdlib/tsearch.c */
/* find or insert datum into search tree */
void * ndpi_tsearch(const void *vkey, void **vrootp,
int (*compar)(const void *, const void *))
{
ndpi_node *q;
char *key = (char *)vkey;
ndpi_node **rootp = (ndpi_node **)vrootp;
if(rootp == (ndpi_node **)0)
return ((void *)0);
while (*rootp != (ndpi_node *)0) { /* Knuth's T1: */
int r;
if((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */
return ((*rootp)->key); /* we found it! */
rootp = (r < 0) ?
&(*rootp)->left : /* T3: follow left branch */
&(*rootp)->right; /* T4: follow right branch */
}
q = (ndpi_node *) ndpi_malloc(sizeof(ndpi_node)); /* T5: key not found */
if(q != (ndpi_node *)0) { /* make new node */
*rootp = q; /* link new node to old */
q->key = key; /* initialize new node */
q->left = q->right = (ndpi_node *)0;
}
return ((void *)q->key);
}
/* delete node with given key */
void * ndpi_tdelete(const void *vkey, void **vrootp,
int (*compar)(const void *, const void *))
{
ndpi_node **rootp = (ndpi_node **)vrootp;
char *key = (char *)vkey;
ndpi_node *q;
ndpi_node *r;
int cmp;
if(rootp == (ndpi_node **)0 || *rootp == (ndpi_node *)0)
return((void *)0);
while ((cmp = (*compar)(key, (*rootp)->key)) != 0) {
rootp = (cmp < 0) ?
&(*rootp)->left : /* follow left branch */
&(*rootp)->right; /* follow right branch */
if(*rootp == (ndpi_node *)0)
return ((void *)0); /* key not found */
}
r = (*rootp)->right; /* D1: */
if((q = (*rootp)->left) == (ndpi_node *)0) /* Left (ndpi_node *)0? */
q = r;
else if(r != (ndpi_node *)0) { /* Right link is null? */
if(r->left == (ndpi_node *)0) { /* D2: Find successor */
r->left = q;
q = r;
} else { /* D3: Find (ndpi_node *)0 link */
for(q = r->left; q->left != (ndpi_node *)0; q = r->left)
r = q;
r->left = q->right;
q->left = (*rootp)->left;
q->right = (*rootp)->right;
}
}
key = (*rootp)->key;
ndpi_free((ndpi_node *) *rootp); /* D4: Free node */
*rootp = q; /* link parent to new node */
/* Return the key to give the caller a chance to free custom data */
return(key);
}
/* Walk the nodes of a tree */
static void ndpi_trecurse(ndpi_node *root, void (*action)(const void *, ndpi_VISIT, int, void*), int level, void *user_data)
{
if(root->left == (ndpi_node *)0 && root->right == (ndpi_node *)0)
(*action)(root, ndpi_leaf, level, user_data);
else {
(*action)(root, ndpi_preorder, level, user_data);
if(root->left != (ndpi_node *)0)
ndpi_trecurse(root->left, action, level + 1, user_data);
(*action)(root, ndpi_postorder, level, user_data);
if(root->right != (ndpi_node *)0)
ndpi_trecurse(root->right, action, level + 1, user_data);
(*action)(root, ndpi_endorder, level, user_data);
}
}
/* Walk the nodes of a tree */
void ndpi_twalk(const void *vroot, void (*action)(const void *, ndpi_VISIT, int, void *), void *user_data)
{
ndpi_node *root = (ndpi_node *)vroot;
if(root != (ndpi_node *)0 && action != (void (*)(const void *, ndpi_VISIT, int, void*))0)
ndpi_trecurse(root, action, 0, user_data);
}
/* find a node, or return 0 */
void * ndpi_tfind(const void *vkey, void *vrootp,
int (*compar)(const void *, const void *))
{
char *key = (char *)vkey;
ndpi_node **rootp = (ndpi_node **)vrootp;
if(rootp == (ndpi_node **)0)
return ((ndpi_node *)0);
while (*rootp != (ndpi_node *)0) { /* T1: */
int r;
if((r = (*compar)(key, (*rootp)->key)) == 0) /* T2: */
return (*rootp); /* key found */
rootp = (r < 0) ?
&(*rootp)->left : /* T3: follow left branch */
&(*rootp)->right; /* T4: follow right branch */
}
return (ndpi_node *)0;
}
/* ****************************************** */
/* Walk the nodes of a tree */
static void ndpi_tdestroy_recurse(ndpi_node* root, void (*free_action)(void *))
{
if(root->left != NULL)
ndpi_tdestroy_recurse(root->left, free_action);
if(root->right != NULL)
ndpi_tdestroy_recurse(root->right, free_action);
(*free_action) ((void *) root->key);
ndpi_free(root);
}
void ndpi_tdestroy(void *vrootp, void (*freefct)(void *))
{
ndpi_node *root = (ndpi_node *) vrootp;
if(root != NULL)
ndpi_tdestroy_recurse(root, freefct);
}
/* ****************************************** */
u_int8_t ndpi_net_match(u_int32_t ip_to_check,
u_int32_t net,
u_int32_t num_bits)
{
u_int32_t mask = 0;
mask = ~(~mask >> num_bits);
return(((ip_to_check & mask) == (net & mask)) ? 1 : 0);
}
u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
u_int32_t net, u_int32_t num_bits)
{
return(ndpi_net_match(src, net, num_bits) || ndpi_net_match(dst, net, num_bits));
}
/* ****************************************** */
#ifdef WIN32
/* http://opensource.apple.com/source/Libc/Libc-186/string.subproj/strcasecmp.c */
/*
* This array is designed for mapping upper and lower case letter
* together for a case independent comparison. The mappings are
* based upon ascii character sequences.
*/
static const u_char charmap[] = {
'\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
'\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
'\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
'\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
'\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
'\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
'\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
'\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
'\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
'\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
'\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
'\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
'\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
'\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
'\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
'\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
'\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
'\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
'\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
'\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
'\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
'\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
'\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
'\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
'\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
'\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
'\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
'\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
'\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
'\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
};
int strcasecmp(const char *s1, const char *s2) {
register const u_char *cm = charmap,
*us1 = (const u_char *)s1,
*us2 = (const u_char *)s2;
while (cm[*us1] == cm[*us2++])
if(*us1++ == '\0')
return (0);
return (cm[*us1] - cm[*--us2]);
}
/* ****************************************** */
int strncasecmp(const char *s1, const char *s2, size_t n) {
if(n != 0) {
register const u_char *cm = charmap,
*us1 = (const u_char *)s1,
*us2 = (const u_char *)s2;
do {
if(cm[*us1] != cm[*us2++])
return (cm[*us1] - cm[*--us2]);
if(*us1++ == '\0')
break;
} while (--n != 0);
}
return (0);
}
#endif
/* **************************************** */
u_int8_t ndpi_is_safe_ssl_cipher(u_int32_t cipher) {
/* https://community.qualys.com/thread/18212-how-does-qualys-determine-the-server-cipher-suites */
/* INSECURE */
switch(cipher) {
case 0xc011: return(NDPI_CIPHER_INSECURE); /* TLS_ECDHE_RSA_WITH_RC4_128_SHA */
case 0x0005: return(NDPI_CIPHER_INSECURE); /* TLS_RSA_WITH_RC4_128_SHA */
case 0x0004: return(NDPI_CIPHER_INSECURE); /* TLS_RSA_WITH_RC4_128_MD5 */
/* WEAK */
case 0x009d: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_AES_256_GCM_SHA384 */
case 0x003d: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_AES_256_CBC_SHA256 */
case 0x0035: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_AES_256_CBC_SHA */
case 0x0084: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_CAMELLIA_256_CBC_SHA */
case 0x009c: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_AES_128_GCM_SHA256 */
case 0x003c: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_AES_128_CBC_SHA256 */
case 0x002f: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_AES_128_CBC_SHA */
case 0x0041: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_CAMELLIA_128_CBC_SHA */
case 0xc012: return(NDPI_CIPHER_WEAK); /* TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA */
case 0x0016: return(NDPI_CIPHER_WEAK); /* TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA */
case 0x000a: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_3DES_EDE_CBC_SHA */
case 0x0096: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_SEED_CBC_SHA */
case 0x0007: return(NDPI_CIPHER_WEAK); /* TLS_RSA_WITH_IDEA_CBC_SHA */
default: return(NDPI_CIPHER_SAFE);
}
}
/* ***************************************************** */
const char* ndpi_cipher2str(u_int32_t cipher) {
switch(cipher) {
case 0x000000: return("TLS_NULL_WITH_NULL_NULL");
case 0x000001: return("TLS_RSA_WITH_NULL_MD5");
case 0x000002: return("TLS_RSA_WITH_NULL_SHA");
case 0x000003: return("TLS_RSA_EXPORT_WITH_RC4_40_MD5");
case 0x000004: return("TLS_RSA_WITH_RC4_128_MD5");
case 0x000005: return("TLS_RSA_WITH_RC4_128_SHA");
case 0x000006: return("TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5");
case 0x000007: return("TLS_RSA_WITH_IDEA_CBC_SHA");
case 0x000008: return("TLS_RSA_EXPORT_WITH_DES40_CBC_SHA");
case 0x000009: return("TLS_RSA_WITH_DES_CBC_SHA");
case 0x00000a: return("TLS_RSA_WITH_3DES_EDE_CBC_SHA");
case 0x00000b: return("TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA");
case 0x00000c: return("TLS_DH_DSS_WITH_DES_CBC_SHA");
case 0x00000d: return("TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA");
case 0x00000e: return("TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA");
case 0x00000f: return("TLS_DH_RSA_WITH_DES_CBC_SHA");
case 0x000010: return("TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA");
case 0x000011: return("TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA");
case 0x000012: return("TLS_DHE_DSS_WITH_DES_CBC_SHA");
case 0x000013: return("TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA");
case 0x000014: return("TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA");
case 0x000015: return("TLS_DHE_RSA_WITH_DES_CBC_SHA");
case 0x000016: return("TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA");
case 0x000017: return("TLS_DH_anon_EXPORT_WITH_RC4_40_MD5");
case 0x000018: return("TLS_DH_anon_WITH_RC4_128_MD5");
case 0x000019: return("TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA");
case 0x00001a: return("TLS_DH_anon_WITH_DES_CBC_SHA");
case 0x00001b: return("TLS_DH_anon_WITH_3DES_EDE_CBC_SHA");
case 0x00001c: return("TLS_FORTEZZA_KEA_WITH_NULL_SHA");
case 0x00001d: return("TLS_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA");
/* case 0x00001e: return("TLS_FORTEZZA_KEA_WITH_RC4_128_SHA"); */
case 0x00001E: return("TLS_KRB5_WITH_DES_CBC_SHA");
case 0x00001F: return("TLS_KRB5_WITH_3DES_EDE_CBC_SHA");
case 0x000020: return("TLS_KRB5_WITH_RC4_128_SHA");
case 0x000021: return("TLS_KRB5_WITH_IDEA_CBC_SHA");
case 0x000022: return("TLS_KRB5_WITH_DES_CBC_MD5");
case 0x000023: return("TLS_KRB5_WITH_3DES_EDE_CBC_MD5");
case 0x000024: return("TLS_KRB5_WITH_RC4_128_MD5");
case 0x000025: return("TLS_KRB5_WITH_IDEA_CBC_MD5");
case 0x000026: return("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA");
case 0x000027: return("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA");
case 0x000028: return("TLS_KRB5_EXPORT_WITH_RC4_40_SHA");
case 0x000029: return("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5");
case 0x00002A: return("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5");
case 0x00002B: return("TLS_KRB5_EXPORT_WITH_RC4_40_MD5");
case 0x00002C: return("TLS_PSK_WITH_NULL_SHA");
case 0x00002D: return("TLS_DHE_PSK_WITH_NULL_SHA");
case 0x00002E: return("TLS_RSA_PSK_WITH_NULL_SHA");
case 0x00002f: return("TLS_RSA_WITH_AES_128_CBC_SHA");
case 0x000030: return("TLS_DH_DSS_WITH_AES_128_CBC_SHA");
case 0x000031: return("TLS_DH_RSA_WITH_AES_128_CBC_SHA");
case 0x000032: return("TLS_DHE_DSS_WITH_AES_128_CBC_SHA");
case 0x000033: return("TLS_DHE_RSA_WITH_AES_128_CBC_SHA");
case 0x000034: return("TLS_DH_anon_WITH_AES_128_CBC_SHA");
case 0x000035: return("TLS_RSA_WITH_AES_256_CBC_SHA");
case 0x000036: return("TLS_DH_DSS_WITH_AES_256_CBC_SHA");
case 0x000037: return("TLS_DH_RSA_WITH_AES_256_CBC_SHA");
case 0x000038: return("TLS_DHE_DSS_WITH_AES_256_CBC_SHA");
case 0x000039: return("TLS_DHE_RSA_WITH_AES_256_CBC_SHA");
case 0x00003A: return("TLS_DH_anon_WITH_AES_256_CBC_SHA");
case 0x00003B: return("TLS_RSA_WITH_NULL_SHA256");
case 0x00003C: return("TLS_RSA_WITH_AES_128_CBC_SHA256");
case 0x00003D: return("TLS_RSA_WITH_AES_256_CBC_SHA256");
case 0x00003E: return("TLS_DH_DSS_WITH_AES_128_CBC_SHA256");
case 0x00003F: return("TLS_DH_RSA_WITH_AES_128_CBC_SHA256");
case 0x000040: return("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256");
case 0x000041: return("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA");
case 0x000042: return("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA");
case 0x000043: return("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA");
case 0x000044: return("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA");
case 0x000045: return("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA");
case 0x000046: return("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA");
case 0x000047: return("TLS_ECDH_ECDSA_WITH_NULL_SHA");
case 0x000048: return("TLS_ECDH_ECDSA_WITH_RC4_128_SHA");
case 0x000049: return("TLS_ECDH_ECDSA_WITH_DES_CBC_SHA");
case 0x00004A: return("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA");
case 0x00004B: return("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA");
case 0x00004C: return("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA");
case 0x000060: return("TLS_RSA_EXPORT1024_WITH_RC4_56_MD5");
case 0x000061: return("TLS_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5");
case 0x000062: return("TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA");
case 0x000063: return("TLS_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA");
case 0x000064: return("TLS_RSA_EXPORT1024_WITH_RC4_56_SHA");
case 0x000065: return("TLS_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA");
case 0x000066: return("TLS_DHE_DSS_WITH_RC4_128_SHA");
case 0x000067: return("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256");
case 0x000068: return("TLS_DH_DSS_WITH_AES_256_CBC_SHA256");
case 0x000069: return("TLS_DH_RSA_WITH_AES_256_CBC_SHA256");
case 0x00006A: return("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256");
case 0x00006B: return("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256");
case 0x00006C: return("TLS_DH_anon_WITH_AES_128_CBC_SHA256");
case 0x00006D: return("TLS_DH_anon_WITH_AES_256_CBC_SHA256");
case 0x000084: return("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA");
case 0x000085: return("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA");
case 0x000086: return("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA");
case 0x000087: return("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA");
case 0x000088: return("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA");
case 0x000089: return("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA");
case 0x00008A: return("TLS_PSK_WITH_RC4_128_SHA");
case 0x00008B: return("TLS_PSK_WITH_3DES_EDE_CBC_SHA");
case 0x00008C: return("TLS_PSK_WITH_AES_128_CBC_SHA");
case 0x00008D: return("TLS_PSK_WITH_AES_256_CBC_SHA");
case 0x00008E: return("TLS_DHE_PSK_WITH_RC4_128_SHA");
case 0x00008F: return("TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA");
case 0x000090: return("TLS_DHE_PSK_WITH_AES_128_CBC_SHA");
case 0x000091: return("TLS_DHE_PSK_WITH_AES_256_CBC_SHA");
case 0x000092: return("TLS_RSA_PSK_WITH_RC4_128_SHA");
case 0x000093: return("TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA");
case 0x000094: return("TLS_RSA_PSK_WITH_AES_128_CBC_SHA");
case 0x000095: return("TLS_RSA_PSK_WITH_AES_256_CBC_SHA");
case 0x000096: return("TLS_RSA_WITH_SEED_CBC_SHA");
case 0x000097: return("TLS_DH_DSS_WITH_SEED_CBC_SHA");
case 0x000098: return("TLS_DH_RSA_WITH_SEED_CBC_SHA");
case 0x000099: return("TLS_DHE_DSS_WITH_SEED_CBC_SHA");
case 0x00009A: return("TLS_DHE_RSA_WITH_SEED_CBC_SHA");
case 0x00009B: return("TLS_DH_anon_WITH_SEED_CBC_SHA");
case 0x00009C: return("TLS_RSA_WITH_AES_128_GCM_SHA256");
case 0x00009D: return("TLS_RSA_WITH_AES_256_GCM_SHA384");
case 0x00009E: return("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256");
case 0x00009F: return("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384");
case 0x0000A0: return("TLS_DH_RSA_WITH_AES_128_GCM_SHA256");
case 0x0000A1: return("TLS_DH_RSA_WITH_AES_256_GCM_SHA384");
case 0x0000A2: return("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256");
case 0x0000A3: return("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384");
case 0x0000A4: return("TLS_DH_DSS_WITH_AES_128_GCM_SHA256");
case 0x0000A5: return("TLS_DH_DSS_WITH_AES_256_GCM_SHA384");
case 0x0000A6: return("TLS_DH_anon_WITH_AES_128_GCM_SHA256");
case 0x0000A7: return("TLS_DH_anon_WITH_AES_256_GCM_SHA384");
case 0x0000A8: return("TLS_PSK_WITH_AES_128_GCM_SHA256");
case 0x0000A9: return("TLS_PSK_WITH_AES_256_GCM_SHA384");
case 0x0000AA: return("TLS_DHE_PSK_WITH_AES_128_GCM_SHA256");
case 0x0000AB: return("TLS_DHE_PSK_WITH_AES_256_GCM_SHA384");
case 0x0000AC: return("TLS_RSA_PSK_WITH_AES_128_GCM_SHA256");
case 0x0000AD: return("TLS_RSA_PSK_WITH_AES_256_GCM_SHA384");
case 0x0000AE: return("TLS_PSK_WITH_AES_128_CBC_SHA256");
case 0x0000AF: return("TLS_PSK_WITH_AES_256_CBC_SHA384");
case 0x0000B0: return("TLS_PSK_WITH_NULL_SHA256");
case 0x0000B1: return("TLS_PSK_WITH_NULL_SHA384");
case 0x0000B2: return("TLS_DHE_PSK_WITH_AES_128_CBC_SHA256");
case 0x0000B3: return("TLS_DHE_PSK_WITH_AES_256_CBC_SHA384");
case 0x0000B4: return("TLS_DHE_PSK_WITH_NULL_SHA256");
case 0x0000B5: return("TLS_DHE_PSK_WITH_NULL_SHA384");
case 0x0000B6: return("TLS_RSA_PSK_WITH_AES_128_CBC_SHA256");
case 0x0000B7: return("TLS_RSA_PSK_WITH_AES_256_CBC_SHA384");
case 0x0000B8: return("TLS_RSA_PSK_WITH_NULL_SHA256");
case 0x0000B9: return("TLS_RSA_PSK_WITH_NULL_SHA384");
case 0x0000BA: return("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256");
case 0x0000BB: return("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256");
case 0x0000BC: return("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256");
case 0x0000BD: return("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256");
case 0x0000BE: return("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256");
case 0x0000BF: return("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256");
case 0x0000C0: return("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256");
case 0x0000C1: return("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256");
case 0x0000C2: return("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256");
case 0x0000C3: return("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256");
case 0x0000C4: return("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256");
case 0x0000C5: return("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256");
case 0x0000FF: return("TLS_EMPTY_RENEGOTIATION_INFO_SCSV");
case 0x00c001: return("TLS_ECDH_ECDSA_WITH_NULL_SHA");
case 0x00c002: return("TLS_ECDH_ECDSA_WITH_RC4_128_SHA");
case 0x00c003: return("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA");
case 0x00c004: return("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA");
case 0x00c005: return("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA");
case 0x00c006: return("TLS_ECDHE_ECDSA_WITH_NULL_SHA");
case 0x00c007: return("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA");
case 0x00c008: return("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA");
case 0x00c009: return("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA");
case 0x00c00a: return("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA");
case 0x00c00b: return("TLS_ECDH_RSA_WITH_NULL_SHA");
case 0x00c00c: return("TLS_ECDH_RSA_WITH_RC4_128_SHA");
case 0x00c00d: return("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA");
case 0x00c00e: return("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA");
case 0x00c00f: return("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA");
case 0x00c010: return("TLS_ECDHE_RSA_WITH_NULL_SHA");
case 0x00c011: return("TLS_ECDHE_RSA_WITH_RC4_128_SHA");
case 0x00c012: return("TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA");
case 0x00c013: return("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA");
case 0x00c014: return("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA");
case 0x00c015: return("TLS_ECDH_anon_WITH_NULL_SHA");
case 0x00c016: return("TLS_ECDH_anon_WITH_RC4_128_SHA");
case 0x00c017: return("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA");
case 0x00c018: return("TLS_ECDH_anon_WITH_AES_128_CBC_SHA");
case 0x00c019: return("TLS_ECDH_anon_WITH_AES_256_CBC_SHA");
case 0x00C01A: return("TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA");
case 0x00C01B: return("TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA");
case 0x00C01C: return("TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA");
case 0x00C01D: return("TLS_SRP_SHA_WITH_AES_128_CBC_SHA");
case 0x00C01E: return("TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA");
case 0x00C01F: return("TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA");
case 0x00C020: return("TLS_SRP_SHA_WITH_AES_256_CBC_SHA");
case 0x00C021: return("TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA");
case 0x00C022: return("TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA");
case 0x00C023: return("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256");
case 0x00C024: return("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384");
case 0x00C025: return("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256");
case 0x00C026: return("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384");
case 0x00C027: return("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256");
case 0x00C028: return("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384");
case 0x00C029: return("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256");
case 0x00C02A: return("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384");
case 0x00C02B: return("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256");
case 0x00C02C: return("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384");
case 0x00C02D: return("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256");
case 0x00C02E: return("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384");
case 0x00C02F: return("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256");
case 0x00C030: return("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384");
case 0x00C031: return("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256");
case 0x00C032: return("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384");
case 0x00C033: return("TLS_ECDHE_PSK_WITH_RC4_128_SHA");
case 0x00C034: return("TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA");
case 0x00C035: return("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA");
case 0x00C036: return("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA");
case 0x00C037: return("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256");
case 0x00C038: return("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384");
case 0x00C039: return("TLS_ECDHE_PSK_WITH_NULL_SHA");
case 0x00C03A: return("TLS_ECDHE_PSK_WITH_NULL_SHA256");
case 0x00C03B: return("TLS_ECDHE_PSK_WITH_NULL_SHA384");
case 0x00CC13: return("TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CC14: return("TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CC15: return("TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CCA8: return("TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CCA9: return("TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CCAA: return("TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CCAB: return("TLS_PSK_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CCAC: return("TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CCAD: return("TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256");
case 0x00CCAE: return("TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256");
case 0x00E410: return("TLS_RSA_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E411: return("TLS_RSA_WITH_SALSA20_SHA1");
case 0x00E412: return("TLS_ECDHE_RSA_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E413: return("TLS_ECDHE_RSA_WITH_SALSA20_SHA1");
case 0x00E414: return("TLS_ECDHE_ECDSA_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E415: return("TLS_ECDHE_ECDSA_WITH_SALSA20_SHA1");
case 0x00E416: return("TLS_PSK_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E417: return("TLS_PSK_WITH_SALSA20_SHA1");
case 0x00E418: return("TLS_ECDHE_PSK_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E419: return("TLS_ECDHE_PSK_WITH_SALSA20_SHA1");
case 0x00E41A: return("TLS_RSA_PSK_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E41B: return("TLS_RSA_PSK_WITH_SALSA20_SHA1");
case 0x00E41C: return("TLS_DHE_PSK_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E41D: return("TLS_DHE_PSK_WITH_SALSA20_SHA1");
case 0x00E41E: return("TLS_DHE_RSA_WITH_ESTREAM_SALSA20_SHA1");
case 0x00E41F: return("TLS_DHE_RSA_WITH_SALSA20_SHA1");
case 0x00fefe: return("TLS_RSA_FIPS_WITH_DES_CBC_SHA");
case 0x00feff: return("TLS_RSA_FIPS_WITH_3DES_EDE_CBC_SHA");
case 0x00ffe0: return("TLS_RSA_FIPS_WITH_3DES_EDE_CBC_SHA");
case 0x00ffe1: return("TLS_RSA_FIPS_WITH_DES_CBC_SHA");
case 0x010080: return("SSL2_RC4_128_WITH_MD5");
case 0x020080: return("SSL2_RC4_128_EXPORT40_WITH_MD5");
case 0x030080: return("SSL2_RC2_128_CBC_WITH_MD5");
case 0x040080: return("SSL2_RC2_128_CBC_EXPORT40_WITH_MD5");
case 0x050080: return("SSL2_IDEA_128_CBC_WITH_MD5");
case 0x060040: return("SSL2_DES_64_CBC_WITH_MD5");
case 0x0700c0: return("SSL2_DES_192_EDE3_CBC_WITH_MD5");
case 0x080080: return("SSL2_RC4_64_WITH_MD5");
case 0x001301: return("TLS_AES_128_GCM_SHA256");
case 0x001302: return("TLS_AES_256_GCM_SHA384");
case 0x001303: return("TLS_CHACHA20_POLY1305_SHA256");
case 0x001304: return("TLS_AES_128_CCM_SHA256");
case 0x001305: return("TLS_AES_128_CCM_8_SHA256");
default:
{
static char buf[8];
snprintf(buf, sizeof(buf), "0X%04X", cipher);
return(buf);
}
}
}
/* ******************************************************************** */
static int ndpi_is_other_char(char c) {
return((c == '.')
|| (c == ' ')
|| (c == '@')
|| (c == '/')
);
}
/* ******************************************************************** */
static int ndpi_is_valid_char(char c) {
if(ispunct(c) && (!ndpi_is_other_char(c)))
return(0);
else
return(isdigit(c)
|| isalpha(c)
|| ndpi_is_other_char(c));
}
/* ******************************************************************** */
static int ndpi_find_non_eng_bigrams(struct ndpi_detection_module_struct *ndpi_struct,
char *str) {
char s[3];
if((isdigit(str[0]) && isdigit(str[1]))
|| ndpi_is_other_char(str[0])
|| ndpi_is_other_char(str[1])
)
return(1);
s[0] = tolower(str[0]), s[1] = tolower(str[1]), s[2] = '\0';
return(ndpi_match_bigram(ndpi_struct, &ndpi_struct->bigrams_automa, s));
}
/* ******************************************************************** */
/* #define PRINT_STRINGS 1 */
int ndpi_has_human_readeable_string(struct ndpi_detection_module_struct *ndpi_struct,
char *buffer, u_int buffer_size,
u_int8_t min_string_match_len,
char *outbuf, u_int outbuf_len) {
u_int ret = 0, i = 0, do_cr = 0, len = 0, o_idx = 0, being_o_idx = 0;
if(buffer_size <= 0)
return(0);
outbuf_len--;
outbuf[outbuf_len] = '\0';
for(i=0; i<buffer_size-2; i++) {
if(ndpi_is_valid_char(buffer[i])
&& ndpi_is_valid_char(buffer[i+1])
&& ndpi_find_non_eng_bigrams(ndpi_struct, &buffer[i])) {
#ifdef PRINT_STRINGS
printf("%c%c", buffer[i], buffer[i+1]);
#endif
if(o_idx < outbuf_len) outbuf[o_idx++] = buffer[i];
if(o_idx < outbuf_len) outbuf[o_idx++] = buffer[i+1];
do_cr = 1, i += 1, len += 2;
} else {
if(ndpi_is_valid_char(buffer[i]) && do_cr) {
#ifdef PRINT_STRINGS
printf("%c", buffer[i]);
#endif
if(o_idx < outbuf_len) outbuf[o_idx++] = buffer[i];
len += 1;
}
// printf("->> %c%c\n", isprint(buffer[i]) ? buffer[i] : '.', isprint(buffer[i+1]) ? buffer[i+1] : '.');
if(do_cr) {
if(len > min_string_match_len)
ret = 1;
else {
o_idx = being_o_idx;
being_o_idx = o_idx;
outbuf[o_idx] = '\0';
}
#ifdef PRINT_STRINGS
printf(" [len: %u]%s\n", len, ret ? "<-- HIT" : "");
#endif
if(ret)
break;
do_cr = 0, len = 0;
}
}
}
#ifdef PRINT_STRINGS
printf("=======>> Found string: %u\n", ret);
#endif
return(ret);
}
/* ********************************** */
char* ndpi_ssl_version2str(u_int16_t version, u_int8_t *unknown_tls_version) {
static char v[12];
*unknown_tls_version = 0;
switch(version) {
case 0x0300: return("SSLv3");
case 0x0301: return("TLSv1");
case 0x0302: return("TLSv1.1");
case 0x0303: return("TLSv1.2");
case 0x0304: return("TLSv1.3");
case 0XFB1A: return("TLSv1.3 (Fizz)"); /* https://engineering.fb.com/security/fizz/ */
case 0XFEFF: return("DTLSv1.0");
case 0XFEFD: return("DTLSv1.2");
}
if((version >= 0x7f00) && (version <= 0x7fff))
return("TLSv1.3 (draft)");
*unknown_tls_version = 1;
snprintf(v, sizeof(v), "TLS (%04X)", version);
return(v);
}
/* ********************************** */
+59 -34
View File
@@ -1,8 +1,8 @@
/*
* afp.c
*
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2009-11 by ipoque GmbH
* Copyright (C) 2011-19 - 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
@@ -23,53 +23,78 @@
*
*/
#include "ndpi_protocol_ids.h"
#include "ndpi_protocols.h"
#ifdef NDPI_PROTOCOL_AFP
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AFP
#include "ndpi_api.h"
struct afpHeader {
u_int8_t flags, command;
u_int16_t requestId;
u_int32_t dataOffset, length, reserved;
};
static void ndpi_int_afp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_AFP, NDPI_REAL_PROTOCOL);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AFP, NDPI_PROTOCOL_UNKNOWN);
}
void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
struct ndpi_packet_struct *packet = &flow->packet;
// struct ndpi_id_struct *src = flow->src;
// struct ndpi_id_struct *dst = flow->dst;
/*
* this will detect the OpenSession command of the Data Stream Interface (DSI) protocol
* which is exclusively used by the Apple Filing Protocol (AFP) on TCP/IP networks
*/
if (packet->payload_packet_len >= 22 && get_u_int16_t(packet->payload, 0) == htons(0x0004) &&
get_u_int16_t(packet->payload, 2) == htons(0x0001) && get_u_int32_t(packet->payload, 4) == 0 &&
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)) {
NDPI_LOG_DBG(ndpi_struct, "search AFP\n");
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP: DSI OpenSession detected.\n");
ndpi_int_afp_add_connection(ndpi_struct, flow);
return;
}
if (packet->payload_packet_len >= sizeof(struct afpHeader)) {
struct afpHeader *h = (struct afpHeader*)packet->payload;
/*
* detection of GetStatus command of DSI protocl
*/
if (packet->payload_packet_len >= 18 && get_u_int16_t(packet->payload, 0) == htons(0x0003) &&
get_u_int16_t(packet->payload, 2) == htons(0x0001) && get_u_int32_t(packet->payload, 4) == 0 &&
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(0x0f00)) {
if(packet->payload_packet_len > 128) {
/*
When we transfer a large data chunk, unless we have observed
the initial connection, we need to discard these packets
as they are not an indication that this flow is not AFP
*/
return;
}
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP: DSI GetStatus detected.\n");
ndpi_int_afp_add_connection(ndpi_struct, flow);
return;
}
/*
* this will detect the OpenSession command of the Data Stream Interface (DSI) protocol
* which is exclusively used by the Apple Filing Protocol (AFP) on TCP/IP networks
*/
if (packet->payload_packet_len >= 22 && get_u_int16_t(packet->payload, 0) == htons(0x0004) &&
get_u_int16_t(packet->payload, 2) == htons(0x0001) && get_u_int32_t(packet->payload, 4) == 0 &&
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)) {
NDPI_LOG_INFO(ndpi_struct, "found AFP: DSI OpenSession\n");
ndpi_int_afp_add_connection(ndpi_struct, flow);
return;
}
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP excluded.\n");
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AFP);
if((h->flags <= 1)
&& ((h->command >= 1) && (h->command <= 8))
&& (h->reserved == 0)
&& (packet->payload_packet_len >= (sizeof(struct afpHeader)+ntohl(h->length)))) {
NDPI_LOG_INFO(ndpi_struct, "found AFP: DSI\n");
ndpi_int_afp_add_connection(ndpi_struct, flow);
return;
}
}
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
{
ndpi_set_bitmask_protocol_detection("AFP", ndpi_struct, detection_bitmask, *id,
NDPI_PROTOCOL_AFP,
ndpi_search_afp,
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
ADD_TO_DETECTION_BITMASK);
*id += 1;
}
#endif
+62 -52
View File
@@ -2,7 +2,7 @@
* aimini.c
*
* Copyright (C) 2009-2011 by ipoque GmbH
* Copyright (C) 2011-15 - ntop.org
* Copyright (C) 2011-19 - 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
@@ -23,15 +23,17 @@
*/
#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,
ndpi_protocol_type_t protocol_type)
static void ndpi_int_aimini_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */)
{
ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_AIMINI, protocol_type);
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AIMINI, NDPI_PROTOCOL_UNKNOWN);
}
@@ -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)
{
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_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "search aimini.\n");
NDPI_LOG_DBG(ndpi_struct, "search aimini\n");
if (packet->udp != NULL) {
if (flow->l4.udp.aimini_stage == 0) {
if (packet->payload_packet_len == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b) {
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;
}
if (packet->payload_packet_len == 136
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
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;
}
if (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
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;
}
if (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
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;
}
if (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
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;
}
if (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
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;
}
}
@@ -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
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115) {
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;
}
if (flow->l4.udp.aimini_stage == 2 &&
@@ -104,16 +103,16 @@ 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 == 88 && get_u_int16_t(packet->payload, 0) == ntohs(0x0115)))) {
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;
}
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 == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b)
|| (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");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
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
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
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;
}
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)) == 0x0165))) {
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;
}
if (flow->l4.udp.aimini_stage == 6 && ((packet->payload_packet_len == 136
@@ -137,9 +136,9 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|| ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9))
|| (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 (136, 0x01c9), (136, 0x01c9)," "(136, 0x01c9),(136, 0x01c9 || 32, 0x01ca).\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -148,20 +147,20 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
if (flow->l4.udp.aimini_stage == 7 && packet->payload_packet_len == 88
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
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;
}
if (flow->l4.udp.aimini_stage == 8
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
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;
}
if (flow->l4.udp.aimini_stage == 9
&& (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");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -170,21 +169,21 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
if (flow->l4.udp.aimini_stage == 10 && packet->payload_packet_len == 104
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
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;
}
if (flow->l4.udp.aimini_stage == 11
&& (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102)) {
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;
}
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 == 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");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -193,22 +192,22 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
if (flow->l4.udp.aimini_stage == 13 && packet->payload_packet_len == 32
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
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;
}
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 == 136 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0166))) {
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;
}
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 == 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");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
@@ -217,20 +216,20 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
if (flow->l4.udp.aimini_stage == 16 && packet->payload_packet_len == 16
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
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;
}
if (flow->l4.udp.aimini_stage == 17
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
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;
}
if (flow->l4.udp.aimini_stage == 18
&& (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");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_REAL_PROTOCOL);
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
} else if (packet->tcp != NULL) {
@@ -238,12 +237,12 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
(memcmp(packet->payload, "GET /player/", NDPI_STATICSTRING_LEN("GET /player/")) == 0)) ||
(packet->payload_packet_len > NDPI_STATICSTRING_LEN("GET /play/?fid=") &&
(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);
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)) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "AIMINI HTTP traffic detected.\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_CORRELATED_PROTOCOL);
NDPI_LOG_INFO(ndpi_struct, "found AIMINI HTTP traffic\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
}
@@ -255,9 +254,9 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
NDPI_STATICSTRING_LEN("download/")) == 0) {
ndpi_parse_packet_line_info(ndpi_struct, flow);
if (is_special_aimini_host(packet->host_line) == 1) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"AIMINI HTTP traffic detected.\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_CORRELATED_PROTOCOL);
NDPI_LOG_INFO(ndpi_struct,
"found AIMINI HTTP traffic\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
}
@@ -266,9 +265,9 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
NDPI_STATICSTRING_LEN("upload/")) == 0) {
ndpi_parse_packet_line_info(ndpi_struct, flow);
if (is_special_aimini_host(packet->host_line) == 1) {
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
"AIMINI HTTP traffic detected.\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow, NDPI_CORRELATED_PROTOCOL);
NDPI_LOG_INFO(ndpi_struct,
"found AIMINI HTTP traffic detected.\n");
ndpi_int_aimini_add_connection(ndpi_struct, flow);
return;
}
}
@@ -276,8 +275,19 @@ 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_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AIMINI);
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
#endif
void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
{
ndpi_set_bitmask_protocol_detection("Aimini", ndpi_struct, detection_bitmask, *id,
NDPI_PROTOCOL_AIMINI,
ndpi_search_aimini,
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD,
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
ADD_TO_DETECTION_BITMASK);
*id += 1;
}
+149
View File
@@ -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
};
PACK_ON
struct ajp_header {
uint16_t magic;
uint16_t len;
uint8_t code;
} PACK_OFF;
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 < sizeof(ajp_hdr)) {
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
return;
}
memcpy(&ajp_hdr, packet->payload, sizeof(struct ajp_header));
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;
}
+81
View File
@@ -0,0 +1,81 @@
/*
* amazon_video.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_AMAZON_VIDEO
#include "ndpi_api.h"
static void ndpi_check_amazon_video(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 Amazon Prime\n");
if((packet->tcp != NULL) &&
(packet->payload[0] == 0xFE &&
packet->payload[1] == 0xED &&
packet->payload[2] == 0xFA &&
packet->payload[3] == 0xCE))
{
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on TCP\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
return;
}
else if((packet->udp != NULL) &&
(packet->payload[0] == 0xDE &&
packet->payload[1] == 0xAD &&
packet->payload[2] == 0xBE &&
packet->payload[3] == 0xEF))
{
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on UDP\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
} else {
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
}
void ndpi_search_amazon_video(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 amazon_video\n");
/* skip marked packets */
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_AMAZON_VIDEO)
ndpi_check_amazon_video(ndpi_struct, flow);
}
void init_amazon_video_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
{
ndpi_set_bitmask_protocol_detection("AMAZON_VIDEO", ndpi_struct, detection_bitmask, *id,
NDPI_PROTOCOL_AMAZON_VIDEO,
ndpi_search_amazon_video,
NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD,
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
ADD_TO_DETECTION_BITMASK);
*id += 1;
}
+87
View File
@@ -0,0 +1,87 @@
/*
* amqp.c
*
* Copyright (C) 2011-19 - 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"
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AMQP
#include "ndpi_api.h"
PACK_ON
struct amqp_header {
u_int8_t ptype;
u_int16_t channel;
u_int32_t length;
u_int16_t class_id, method;
} PACK_OFF;
static void ndpi_int_amqp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow/* , */
/* ndpi_protocol_type_t protocol_type */) {
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMQP, NDPI_PROTOCOL_UNKNOWN);
}
void ndpi_search_amqp(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 amqp\n");
if (packet->tcp != NULL) {
if(packet->payload_packet_len > sizeof(struct amqp_header)) {
struct amqp_header *h = (struct amqp_header*)packet->payload;
if(h->ptype <= 3) {
u_int32_t length = htonl(h->length);
if(((length+8) >= packet->payload_packet_len)
&& (length < 32768) /* Upper bound */) {
u_int16_t class_id = htons(h->class_id);
if((class_id >= 10) /* Connection */
&& (class_id <= 110) /* Tunnel */) {
u_int16_t method = htons(h->method);
if(method <= 120 /* Method basic NACK */) {
NDPI_LOG_INFO(ndpi_struct, "found amqp over tcp\n");
ndpi_int_amqp_add_connection(ndpi_struct, flow);
return;
}
}
}
}
}
} else {
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
}
void init_amqp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
ndpi_set_bitmask_protocol_detection("AMQP", ndpi_struct, detection_bitmask, *id,
NDPI_PROTOCOL_AMQP,
ndpi_search_amqp,
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
ADD_TO_DETECTION_BITMASK);
*id += 1;
}
+78
View File
@@ -0,0 +1,78 @@
/*
* 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;
if(packet->iph) {
/* 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;
}

Some files were not shown because too many files have changed in this diff Show More