├── .gitignore ├── CMakeLists.txt ├── README.md ├── deps ├── cmake │ ├── FindLibConfigConfig.cmake │ └── FindPCAPConfig.cmake ├── nDPI-1.6 │ ├── CMakeLists.txt │ ├── config.h │ └── src │ │ ├── include │ │ ├── Makefile.am │ │ ├── linux_compat.h │ │ ├── ndpi_api.h │ │ ├── ndpi_define.h │ │ ├── ndpi_main.h │ │ ├── ndpi_protocol_ids.h │ │ ├── ndpi_protocols.h │ │ ├── ndpi_typedefs.h │ │ ├── ndpi_unix.h │ │ └── ndpi_win32.h │ │ └── lib │ │ ├── .deps │ │ └── libndpi_la-ndpi_main.Plo │ │ ├── .libs │ │ ├── libndpi.a │ │ ├── libndpi.la │ │ ├── libndpi.lai │ │ ├── libndpi.so │ │ ├── libndpi.so.1 │ │ ├── libndpi.so.1.0.0 │ │ └── libndpi.ver │ │ ├── Makefile │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── libndpi.la │ │ ├── libndpi_la-ndpi_main.lo │ │ ├── ndpi_content_match.c.inc │ │ ├── ndpi_main.c │ │ ├── protocols │ │ ├── .deps │ │ │ ├── .dirstamp │ │ │ ├── libndpi_la-afp.Plo │ │ │ ├── libndpi_la-aimini.Plo │ │ │ ├── libndpi_la-applejuice.Plo │ │ │ ├── libndpi_la-armagetron.Plo │ │ │ ├── libndpi_la-ayiya.Plo │ │ │ ├── libndpi_la-battlefield.Plo │ │ │ ├── libndpi_la-bgp.Plo │ │ │ ├── libndpi_la-bittorrent.Plo │ │ │ ├── libndpi_la-ciscovpn.Plo │ │ │ ├── libndpi_la-citrix.Plo │ │ │ ├── libndpi_la-collectd.Plo │ │ │ ├── libndpi_la-corba.Plo │ │ │ ├── libndpi_la-crossfire.Plo │ │ │ ├── libndpi_la-dcerpc.Plo │ │ │ ├── libndpi_la-dhcp.Plo │ │ │ ├── libndpi_la-dhcpv6.Plo │ │ │ ├── libndpi_la-directconnect.Plo │ │ │ ├── libndpi_la-directdownloadlink.Plo │ │ │ ├── libndpi_la-dns.Plo │ │ │ ├── libndpi_la-dofus.Plo │ │ │ ├── libndpi_la-dropbox.Plo │ │ │ ├── libndpi_la-edonkey.Plo │ │ │ ├── libndpi_la-fasttrack.Plo │ │ │ ├── libndpi_la-fiesta.Plo │ │ │ ├── libndpi_la-filetopia.Plo │ │ │ ├── libndpi_la-florensia.Plo │ │ │ ├── libndpi_la-ftp_control.Plo │ │ │ ├── libndpi_la-ftp_data.Plo │ │ │ ├── libndpi_la-gnutella.Plo │ │ │ ├── libndpi_la-gtp.Plo │ │ │ ├── libndpi_la-guildwars.Plo │ │ │ ├── libndpi_la-h323.Plo │ │ │ ├── libndpi_la-halflife2_and_mods.Plo │ │ │ ├── libndpi_la-http.Plo │ │ │ ├── libndpi_la-http_activesync.Plo │ │ │ ├── libndpi_la-iax.Plo │ │ │ ├── libndpi_la-icecast.Plo │ │ │ ├── libndpi_la-imesh.Plo │ │ │ ├── libndpi_la-ipp.Plo │ │ │ ├── libndpi_la-irc.Plo │ │ │ ├── libndpi_la-jabber.Plo │ │ │ ├── libndpi_la-kerberos.Plo │ │ │ ├── libndpi_la-kontiki.Plo │ │ │ ├── libndpi_la-ldap.Plo │ │ │ ├── libndpi_la-lotus_notes.Plo │ │ │ ├── libndpi_la-mail_imap.Plo │ │ │ ├── libndpi_la-mail_pop.Plo │ │ │ ├── libndpi_la-mail_smtp.Plo │ │ │ ├── libndpi_la-maplestory.Plo │ │ │ ├── libndpi_la-mdns.Plo │ │ │ ├── libndpi_la-meebo.Plo │ │ │ ├── libndpi_la-megaco.Plo │ │ │ ├── libndpi_la-mgcp.Plo │ │ │ ├── libndpi_la-mms.Plo │ │ │ ├── libndpi_la-msn.Plo │ │ │ ├── libndpi_la-mssql.Plo │ │ │ ├── libndpi_la-mysql.Plo │ │ │ ├── libndpi_la-netbios.Plo │ │ │ ├── libndpi_la-netflow.Plo │ │ │ ├── libndpi_la-nfs.Plo │ │ │ ├── libndpi_la-noe.Plo │ │ │ ├── libndpi_la-non_tcp_udp.Plo │ │ │ ├── libndpi_la-ntp.Plo │ │ │ ├── libndpi_la-openft.Plo │ │ │ ├── libndpi_la-openvpn.Plo │ │ │ ├── libndpi_la-oracle.Plo │ │ │ ├── libndpi_la-oscar.Plo │ │ │ ├── libndpi_la-pando.Plo │ │ │ ├── libndpi_la-pcanywhere.Plo │ │ │ ├── libndpi_la-postgres.Plo │ │ │ ├── libndpi_la-pplive.Plo │ │ │ ├── libndpi_la-ppstream.Plo │ │ │ ├── libndpi_la-pptp.Plo │ │ │ ├── libndpi_la-qq.Plo │ │ │ ├── libndpi_la-quake.Plo │ │ │ ├── libndpi_la-quic.Plo │ │ │ ├── libndpi_la-radius.Plo │ │ │ ├── libndpi_la-rdp.Plo │ │ │ ├── libndpi_la-redis_net.Plo │ │ │ ├── libndpi_la-rsync.Plo │ │ │ ├── libndpi_la-rtcp.Plo │ │ │ ├── libndpi_la-rtmp.Plo │ │ │ ├── libndpi_la-rtp.Plo │ │ │ ├── libndpi_la-rtsp.Plo │ │ │ ├── libndpi_la-sflow.Plo │ │ │ ├── libndpi_la-shoutcast.Plo │ │ │ ├── libndpi_la-sip.Plo │ │ │ ├── libndpi_la-skinny.Plo │ │ │ ├── libndpi_la-skype.Plo │ │ │ ├── libndpi_la-smb.Plo │ │ │ ├── libndpi_la-snmp.Plo │ │ │ ├── libndpi_la-socks4.Plo │ │ │ ├── libndpi_la-socks5.Plo │ │ │ ├── libndpi_la-socrates.Plo │ │ │ ├── libndpi_la-sopcast.Plo │ │ │ ├── libndpi_la-soulseek.Plo │ │ │ ├── libndpi_la-spotify.Plo │ │ │ ├── libndpi_la-ssdp.Plo │ │ │ ├── libndpi_la-ssh.Plo │ │ │ ├── libndpi_la-ssl.Plo │ │ │ ├── libndpi_la-stealthnet.Plo │ │ │ ├── libndpi_la-steam.Plo │ │ │ ├── libndpi_la-stun.Plo │ │ │ ├── libndpi_la-syslog.Plo │ │ │ ├── libndpi_la-tcp_udp.Plo │ │ │ ├── libndpi_la-tds.Plo │ │ │ ├── libndpi_la-teamspeak.Plo │ │ │ ├── libndpi_la-teamviewer.Plo │ │ │ ├── libndpi_la-telegram.Plo │ │ │ ├── libndpi_la-telnet.Plo │ │ │ ├── libndpi_la-tftp.Plo │ │ │ ├── libndpi_la-thunder.Plo │ │ │ ├── libndpi_la-tor.Plo │ │ │ ├── libndpi_la-tvants.Plo │ │ │ ├── libndpi_la-tvuplayer.Plo │ │ │ ├── libndpi_la-twitter.Plo │ │ │ ├── libndpi_la-usenet.Plo │ │ │ ├── libndpi_la-veohtv.Plo │ │ │ ├── libndpi_la-vhua.Plo │ │ │ ├── libndpi_la-viber.Plo │ │ │ ├── libndpi_la-vmware.Plo │ │ │ ├── libndpi_la-vnc.Plo │ │ │ ├── libndpi_la-warcraft3.Plo │ │ │ ├── libndpi_la-whoisdas.Plo │ │ │ ├── libndpi_la-winmx.Plo │ │ │ ├── libndpi_la-world_of_kung_fu.Plo │ │ │ ├── libndpi_la-world_of_warcraft.Plo │ │ │ ├── libndpi_la-xbox.Plo │ │ │ ├── libndpi_la-xdmcp.Plo │ │ │ ├── libndpi_la-yahoo.Plo │ │ │ ├── libndpi_la-zattoo.Plo │ │ │ └── libndpi_la-zeromq.Plo │ │ ├── .dirstamp │ │ ├── afp.c │ │ ├── aimini.c │ │ ├── applejuice.c │ │ ├── armagetron.c │ │ ├── attic │ │ │ ├── flash.c │ │ │ ├── ftp.c │ │ │ ├── manolito.c │ │ │ ├── popo.c │ │ │ └── secondlife.c │ │ ├── ayiya.c │ │ ├── battlefield.c │ │ ├── bgp.c │ │ ├── bittorrent.c │ │ ├── btlib.c │ │ ├── btlib.h │ │ ├── ciscovpn.c │ │ ├── citrix.c │ │ ├── collectd.c │ │ ├── corba.c │ │ ├── crossfire.c │ │ ├── dcerpc.c │ │ ├── dhcp.c │ │ ├── dhcpv6.c │ │ ├── directconnect.c │ │ ├── directdownloadlink.c │ │ ├── dns.c │ │ ├── dofus.c │ │ ├── dropbox.c │ │ ├── edonkey.c │ │ ├── fasttrack.c │ │ ├── fiesta.c │ │ ├── filetopia.c │ │ ├── florensia.c │ │ ├── ftp_control.c │ │ ├── ftp_data.c │ │ ├── gnutella.c │ │ ├── gtp.c │ │ ├── guildwars.c │ │ ├── h323.c │ │ ├── halflife2_and_mods.c │ │ ├── http.c │ │ ├── http_activesync.c │ │ ├── iax.c │ │ ├── icecast.c │ │ ├── imesh.c │ │ ├── ipp.c │ │ ├── irc.c │ │ ├── jabber.c │ │ ├── kerberos.c │ │ ├── kontiki.c │ │ ├── ldap.c │ │ ├── libndpi_la-afp.lo │ │ ├── libndpi_la-aimini.lo │ │ ├── libndpi_la-applejuice.lo │ │ ├── libndpi_la-armagetron.lo │ │ ├── libndpi_la-ayiya.lo │ │ ├── libndpi_la-battlefield.lo │ │ ├── libndpi_la-bgp.lo │ │ ├── libndpi_la-bittorrent.lo │ │ ├── libndpi_la-ciscovpn.lo │ │ ├── libndpi_la-citrix.lo │ │ ├── libndpi_la-collectd.lo │ │ ├── libndpi_la-corba.lo │ │ ├── libndpi_la-crossfire.lo │ │ ├── libndpi_la-dcerpc.lo │ │ ├── libndpi_la-dhcp.lo │ │ ├── libndpi_la-dhcpv6.lo │ │ ├── libndpi_la-directconnect.lo │ │ ├── libndpi_la-directdownloadlink.lo │ │ ├── libndpi_la-dns.lo │ │ ├── libndpi_la-dofus.lo │ │ ├── libndpi_la-dropbox.lo │ │ ├── libndpi_la-edonkey.lo │ │ ├── libndpi_la-fasttrack.lo │ │ ├── libndpi_la-fiesta.lo │ │ ├── libndpi_la-filetopia.lo │ │ ├── libndpi_la-florensia.lo │ │ ├── libndpi_la-ftp_control.lo │ │ ├── libndpi_la-ftp_data.lo │ │ ├── libndpi_la-gnutella.lo │ │ ├── libndpi_la-gtp.lo │ │ ├── libndpi_la-guildwars.lo │ │ ├── libndpi_la-h323.lo │ │ ├── libndpi_la-halflife2_and_mods.lo │ │ ├── libndpi_la-http.lo │ │ ├── libndpi_la-http_activesync.lo │ │ ├── libndpi_la-iax.lo │ │ ├── libndpi_la-icecast.lo │ │ ├── libndpi_la-imesh.lo │ │ ├── libndpi_la-ipp.lo │ │ ├── libndpi_la-irc.lo │ │ ├── libndpi_la-jabber.lo │ │ ├── libndpi_la-kerberos.lo │ │ ├── libndpi_la-kontiki.lo │ │ ├── libndpi_la-ldap.lo │ │ ├── libndpi_la-lotus_notes.lo │ │ ├── libndpi_la-mail_imap.lo │ │ ├── libndpi_la-mail_pop.lo │ │ ├── libndpi_la-mail_smtp.lo │ │ ├── libndpi_la-maplestory.lo │ │ ├── libndpi_la-mdns.lo │ │ ├── libndpi_la-meebo.lo │ │ ├── libndpi_la-megaco.lo │ │ ├── libndpi_la-mgcp.lo │ │ ├── libndpi_la-mms.lo │ │ ├── libndpi_la-msn.lo │ │ ├── libndpi_la-mssql.lo │ │ ├── libndpi_la-mysql.lo │ │ ├── libndpi_la-netbios.lo │ │ ├── libndpi_la-netflow.lo │ │ ├── libndpi_la-nfs.lo │ │ ├── libndpi_la-noe.lo │ │ ├── libndpi_la-non_tcp_udp.lo │ │ ├── libndpi_la-ntp.lo │ │ ├── libndpi_la-openft.lo │ │ ├── libndpi_la-openvpn.lo │ │ ├── libndpi_la-oracle.lo │ │ ├── libndpi_la-oscar.lo │ │ ├── libndpi_la-pando.lo │ │ ├── libndpi_la-pcanywhere.lo │ │ ├── libndpi_la-postgres.lo │ │ ├── libndpi_la-pplive.lo │ │ ├── libndpi_la-ppstream.lo │ │ ├── libndpi_la-pptp.lo │ │ ├── libndpi_la-qq.lo │ │ ├── libndpi_la-quake.lo │ │ ├── libndpi_la-quic.lo │ │ ├── libndpi_la-radius.lo │ │ ├── libndpi_la-rdp.lo │ │ ├── libndpi_la-redis_net.lo │ │ ├── libndpi_la-rsync.lo │ │ ├── libndpi_la-rtcp.lo │ │ ├── libndpi_la-rtmp.lo │ │ ├── libndpi_la-rtp.lo │ │ ├── libndpi_la-rtsp.lo │ │ ├── libndpi_la-sflow.lo │ │ ├── libndpi_la-shoutcast.lo │ │ ├── libndpi_la-sip.lo │ │ ├── libndpi_la-skinny.lo │ │ ├── libndpi_la-skype.lo │ │ ├── libndpi_la-smb.lo │ │ ├── libndpi_la-snmp.lo │ │ ├── libndpi_la-socks4.lo │ │ ├── libndpi_la-socks5.lo │ │ ├── libndpi_la-socrates.lo │ │ ├── libndpi_la-sopcast.lo │ │ ├── libndpi_la-soulseek.lo │ │ ├── libndpi_la-spotify.lo │ │ ├── libndpi_la-ssdp.lo │ │ ├── libndpi_la-ssh.lo │ │ ├── libndpi_la-ssl.lo │ │ ├── libndpi_la-stealthnet.lo │ │ ├── libndpi_la-steam.lo │ │ ├── libndpi_la-stun.lo │ │ ├── libndpi_la-syslog.lo │ │ ├── libndpi_la-tcp_udp.lo │ │ ├── libndpi_la-tds.lo │ │ ├── libndpi_la-teamspeak.lo │ │ ├── libndpi_la-teamviewer.lo │ │ ├── libndpi_la-telegram.lo │ │ ├── libndpi_la-telnet.lo │ │ ├── libndpi_la-tftp.lo │ │ ├── libndpi_la-thunder.lo │ │ ├── libndpi_la-tor.lo │ │ ├── libndpi_la-tvants.lo │ │ ├── libndpi_la-tvuplayer.lo │ │ ├── libndpi_la-twitter.lo │ │ ├── libndpi_la-usenet.lo │ │ ├── libndpi_la-veohtv.lo │ │ ├── libndpi_la-vhua.lo │ │ ├── libndpi_la-viber.lo │ │ ├── libndpi_la-vmware.lo │ │ ├── libndpi_la-vnc.lo │ │ ├── libndpi_la-warcraft3.lo │ │ ├── libndpi_la-whoisdas.lo │ │ ├── libndpi_la-winmx.lo │ │ ├── libndpi_la-world_of_kung_fu.lo │ │ ├── libndpi_la-world_of_warcraft.lo │ │ ├── libndpi_la-xbox.lo │ │ ├── libndpi_la-xdmcp.lo │ │ ├── libndpi_la-yahoo.lo │ │ ├── libndpi_la-zattoo.lo │ │ ├── libndpi_la-zeromq.lo │ │ ├── lotus_notes.c │ │ ├── mail_imap.c │ │ ├── mail_pop.c │ │ ├── mail_smtp.c │ │ ├── maplestory.c │ │ ├── mdns.c │ │ ├── meebo.c │ │ ├── megaco.c │ │ ├── mgcp.c │ │ ├── mms.c │ │ ├── msn.c │ │ ├── mssql.c │ │ ├── mysql.c │ │ ├── netbios.c │ │ ├── netflow.c │ │ ├── nfs.c │ │ ├── noe.c │ │ ├── non_tcp_udp.c │ │ ├── ntp.c │ │ ├── openft.c │ │ ├── openvpn.c │ │ ├── oracle.c │ │ ├── oscar.c │ │ ├── pando.c │ │ ├── pcanywhere.c │ │ ├── postgres.c │ │ ├── pplive.c │ │ ├── ppstream.c │ │ ├── pptp.c │ │ ├── qq.c │ │ ├── quake.c │ │ ├── quic.c │ │ ├── radius.c │ │ ├── rdp.c │ │ ├── redis_net.c │ │ ├── rsync.c │ │ ├── rtcp.c │ │ ├── rtmp.c │ │ ├── rtp.c │ │ ├── rtsp.c │ │ ├── sflow.c │ │ ├── shoutcast.c │ │ ├── sip.c │ │ ├── skinny.c │ │ ├── skype.c │ │ ├── smb.c │ │ ├── snmp.c │ │ ├── socks4.c │ │ ├── socks5.c │ │ ├── socrates.c │ │ ├── sopcast.c │ │ ├── soulseek.c │ │ ├── spotify.c │ │ ├── ssdp.c │ │ ├── ssh.c │ │ ├── ssl.c │ │ ├── stealthnet.c │ │ ├── steam.c │ │ ├── stun.c │ │ ├── syslog.c │ │ ├── tcp_udp.c │ │ ├── tds.c │ │ ├── teamspeak.c │ │ ├── teamviewer.c │ │ ├── telegram.c │ │ ├── telnet.c │ │ ├── tftp.c │ │ ├── thunder.c │ │ ├── tor.c │ │ ├── tvants.c │ │ ├── tvuplayer.c │ │ ├── twitter.c │ │ ├── usenet.c │ │ ├── veohtv.c │ │ ├── vhua.c │ │ ├── viber.c │ │ ├── vmware.c │ │ ├── vnc.c │ │ ├── warcraft3.c │ │ ├── whoisdas.c │ │ ├── winmx.c │ │ ├── world_of_kung_fu.c │ │ ├── world_of_warcraft.c │ │ ├── xbox.c │ │ ├── xdmcp.c │ │ ├── yahoo.c │ │ ├── zattoo.c │ │ └── zeromq.c │ │ └── third_party │ │ ├── include │ │ ├── actypes.h │ │ ├── ahocorasick.h │ │ ├── ndpi_patricia.h │ │ ├── node.h │ │ └── sort.h │ │ └── src │ │ ├── .deps │ │ ├── .dirstamp │ │ ├── libndpi_la-ahocorasick.Plo │ │ ├── libndpi_la-node.Plo │ │ └── libndpi_la-sort.Plo │ │ ├── .dirstamp │ │ ├── ahocorasick.c │ │ ├── libndpi_la-ahocorasick.lo │ │ ├── libndpi_la-node.lo │ │ ├── libndpi_la-sort.lo │ │ ├── ndpi_patricia.c │ │ ├── node.c │ │ └── sort.c └── zlog │ ├── CMakeLists.txt │ └── src │ ├── buf.c │ ├── buf.h │ ├── category.c │ ├── category.h │ ├── category_table.c │ ├── category_table.h │ ├── conf.c │ ├── conf.h │ ├── event.c │ ├── event.h │ ├── fmacros.h │ ├── format.c │ ├── format.h │ ├── level.c │ ├── level.h │ ├── level_list.c │ ├── level_list.h │ ├── makefile │ ├── mdc.c │ ├── mdc.h │ ├── record.c │ ├── record.h │ ├── record_table.c │ ├── record_table.h │ ├── rotater.c │ ├── rotater.h │ ├── rule.c │ ├── rules.h │ ├── spec.c │ ├── spec.h │ ├── thread.c │ ├── thread.h │ ├── version.h │ ├── zc_arraylist.c │ ├── zc_arraylist.h │ ├── zc_defs.h │ ├── zc_hashtable.c │ ├── zc_hashtable.h │ ├── zc_profile.c │ ├── zc_profile.h │ ├── zc_util.c │ ├── zc_util.h │ ├── zc_xplatform.h │ ├── zlog-chk-conf.c │ ├── zlog.c │ └── zlog.h ├── logging.conf ├── ndpi-demo.conf └── src ├── common.h ├── config.c ├── config.h ├── context.c ├── context.h ├── dpi_engine.c ├── dpi_engine.h ├── main.c └── main.h /.gitignore: -------------------------------------------------------------------------------- 1 | cmake-build-debug 2 | build 3 | .idea 4 | .vagrant 5 | *.o -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(ndpi_demo) 3 | set(EXE_NAME ndpi-demo) 4 | set(CMAKE_BUILD_TYPE Debug) 5 | set(CMAKE_PREFIX_PATH ${PROJECT_SOURCE_DIR}/deps/cmake) 6 | set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}") 7 | aux_source_directory(./src SOURCE_FILES) 8 | SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) 9 | 10 | #数学库 11 | list(APPEND DEPS_LIB m) 12 | 13 | include_directories(deps/zlog/src) 14 | add_subdirectory(deps/zlog) 15 | list(APPEND DEPS_LIB zlog) 16 | 17 | include_directories(deps/nDPI-1.6/src/include) 18 | add_subdirectory(deps/nDPI-1.6) 19 | list(APPEND DEPS_LIB ndpi) 20 | 21 | add_executable(${EXE_NAME} ${SOURCE_FILES}) 22 | 23 | #多线程支持 24 | find_package(Threads REQUIRED) 25 | if (THREADS_HAVE_PTHREAD_ARG) 26 | target_compile_options(PUBLIC ${EXE_NAME} "-pthread") 27 | endif () 28 | if (CMAKE_THREAD_LIBS_INIT) 29 | list(APPEND DEPS_LIB ${CMAKE_THREAD_LIBS_INIT}) 30 | endif () 31 | find_package(FindLibConfig) 32 | if (CONFIG_FOUND) 33 | include_directories(${CONFIG_INCLUDE_DIR}) 34 | list(APPEND DEPS_LIB ${CONFIG_LIBRARY}) 35 | else () 36 | message(FATAL_ERROR "libconfig not found!") 37 | endif () 38 | find_package(FindPCAP) 39 | if (PCAP_FOUND) 40 | include_directories(${PCAP_INCLUDE_DIR}) 41 | list(APPEND DEPS_LIB ${PCAP_LIBRARY}) 42 | else () 43 | message(FATAL_ERROR "libpcap not found!") 44 | endif () 45 | target_link_libraries(${EXE_NAME} ${DEPS_LIB}) 46 | 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #nDPI演示代码 2 | 3 | ##编译方法 4 | 保证机器上安装了cmake、libpcap-dev、libconfig-dev 5 | ``` 6 | mkdir build && cd build 7 | cmake .. 8 | make 9 | ``` 10 | 最终生成ndpi-demo,执行它需要两个参数分别是配置文件和日志文件,对应代码中ndpi-demo.conf和logging.conf 11 | 12 | -------------------------------------------------------------------------------- /deps/cmake/FindLibConfigConfig.cmake: -------------------------------------------------------------------------------- 1 | FIND_PATH(CONFIG_INCLUDE_DIR libconfig.h /usr/include /usr/local/include) 2 | 3 | FIND_LIBRARY(CONFIG_LIBRARY NAMES config PATH /usr/lib /usr/local/lib) 4 | 5 | IF (CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY) 6 | SET(CONFIG_FOUND TRUE) 7 | ENDIF ( CONFIG_INCLUDE_DIR AND CONFIG_LIBRARY) 8 | 9 | IF (CONFIG_FOUND) 10 | IF (NOT CONFIG_FIND_QUIETLY) 11 | MESSAGE(STATUS "Found Config: ${CONFIG_LIBRARY}") 12 | ENDIF (NOT CONFIG_FIND_QUIETLY) 13 | ELSE(CONFIG_FOUND) 14 | IF (Config_FIND_REQUIRED) 15 | IF(NOT CONFIG_INCLUDE_DIR) 16 | MESSAGE(FATAL_ERROR "Could not find LibConfig header file!") 17 | ENDIF(NOT CONFIG_INCLUDE_DIR) 18 | 19 | IF(NOT CONFIG_LIBRARY) 20 | MESSAGE(FATAL_ERROR "Could not find LibConfig library file!") 21 | ENDIF(NOT CONFIG_LIBRARY) 22 | ENDIF (Config_FIND_REQUIRED) 23 | ENDIF (CONFIG_FOUND) -------------------------------------------------------------------------------- /deps/cmake/FindPCAPConfig.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find libpcap include dirs and libraries 2 | # 3 | # Usage of this module as follows: 4 | # 5 | # find_package(PCAP) 6 | # 7 | # Variables used by this module, they can change the default behaviour and need 8 | # to be set before calling find_package: 9 | # 10 | # PCAP_ROOT_DIR Set this variable to the root installation of 11 | # libpcap if the module has problems finding the 12 | # proper installation path. 13 | # 14 | # Variables defined by this module: 15 | # 16 | # PCAP_FOUND System has libpcap, include and library dirs found 17 | # PCAP_INCLUDE_DIR The libpcap include directories. 18 | # PCAP_LIBRARY The libpcap library (possibly includes a thread 19 | # library e.g. required by pf_ring's libpcap) 20 | 21 | find_path(PCAP_ROOT_DIR 22 | NAMES include/pcap.h 23 | ) 24 | 25 | find_path(PCAP_INCLUDE_DIR 26 | NAMES pcap.h 27 | HINTS ${PCAP_ROOT_DIR}/include 28 | ) 29 | 30 | find_library(PCAP_LIBRARY 31 | NAMES pcap 32 | HINTS ${PCAP_ROOT_DIR}/lib 33 | ) 34 | 35 | include(FindPackageHandleStandardArgs) 36 | find_package_handle_standard_args(PCAP DEFAULT_MSG 37 | PCAP_LIBRARY 38 | PCAP_INCLUDE_DIR 39 | ) 40 | 41 | include(CheckCSourceCompiles) 42 | set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY}) 43 | check_c_source_compiles("int main() { return 0; }" PCAP_LINKS_SOLO) 44 | set(CMAKE_REQUIRED_LIBRARIES) 45 | 46 | # check if linking against libpcap also needs to link against a thread library 47 | if (NOT PCAP_LINKS_SOLO) 48 | find_package(Threads) 49 | if (THREADS_FOUND) 50 | set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) 51 | check_c_source_compiles("int main() { return 0; }" PCAP_NEEDS_THREADS) 52 | set(CMAKE_REQUIRED_LIBRARIES) 53 | endif () 54 | if (THREADS_FOUND AND PCAP_NEEDS_THREADS) 55 | set(_tmp ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) 56 | list(REMOVE_DUPLICATES _tmp) 57 | set(PCAP_LIBRARY ${_tmp} 58 | CACHE STRING "Libraries needed to link against libpcap" FORCE) 59 | else () 60 | message(FATAL_ERROR "Couldn't determine how to link against libpcap") 61 | endif () 62 | endif () 63 | 64 | include(CheckFunctionExists) 65 | set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY}) 66 | set(CMAKE_REQUIRED_LIBRARIES) 67 | 68 | mark_as_advanced( 69 | PCAP_ROOT_DIR 70 | PCAP_INCLUDE_DIR 71 | PCAP_LIBRARY 72 | ) -------------------------------------------------------------------------------- /deps/nDPI-1.6/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(./src/lib/third_party/include) 2 | include_directories(./src/include) 3 | aux_source_directory(./src/lib DIR_LIB_SRCS) 4 | aux_source_directory(./src/lib/protocols DIR_LIB_SRCS) 5 | aux_source_directory(./src/lib/third_party/src DIR_LIB_SRCS) 6 | add_library(ndpi ${DIR_LIB_SRCS}) -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/include/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | library_includedir=$(includedir)/libndpi-1.4/libndpi 3 | 4 | library_include_HEADERS = ndpi_api.h \ 5 | ndpi_debug_functions.h \ 6 | ndpi_define.h \ 7 | ndpi_macros.h \ 8 | ndpi_protocols_osdpi.h \ 9 | ndpi_public_functions.h 10 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/include/ndpi_unix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ndpi_unix.h 3 | * 4 | * Copyright (C) 2011-15 - ntop.org 5 | * Copyright (C) 2009-2011 by ipoque GmbH 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | #ifndef __NDPI_UNIX_INCLUDE_FILE__ 26 | #define __NDPI_UNIX_INCLUDE_FILE__ 27 | 28 | #include "linux_compat.h" 29 | 30 | #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 31 | #include 32 | #if defined(__NetBSD__) || defined(__OpenBSD__) 33 | #include 34 | #if defined(__OpenBSD__) 35 | #include 36 | #endif 37 | #endif 38 | #endif 39 | 40 | #ifndef WIN32 41 | #ifndef __KERNEL__ 42 | 43 | #include 44 | #include 45 | #include 46 | #else 47 | #include 48 | #include 49 | #include 50 | #endif 51 | #endif 52 | 53 | #endif /* __NDPI_UNIX_INCLUDE_FILE__ */ 54 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/include/ndpi_win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ndpi_win32.h 3 | * 4 | * Copyright (C) 2011-15 - ntop.org 5 | * Copyright (C) 2009-2011 by ipoque GmbH 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | #ifndef __NDPI_WIN32_INCLUDE_FILE__ 26 | #define __NDPI_WIN32_INCLUDE_FILE__ 27 | 28 | #ifdef WIN32 29 | #include /* winsock.h is included automatically */ 30 | #include 31 | #include 32 | #include /* getopt from: http://www.pwilson.net/sample.html. */ 33 | #include /* for getpid() and the exec..() family */ 34 | 35 | #ifndef _CRT_SECURE_NO_WARNINGS 36 | #define _CRT_SECURE_NO_WARNINGS 37 | #endif 38 | #define snprintf _snprintf 39 | 40 | extern char* strsep(char **stringp, const char *delim); 41 | 42 | #define __attribute__(x) 43 | #include 44 | #ifndef __GNUC__ 45 | typedef unsigned char u_char; 46 | typedef unsigned short u_short; 47 | typedef unsigned int uint; 48 | typedef unsigned long u_long; 49 | #endif 50 | typedef u_char u_int8_t; 51 | typedef u_short u_int16_t; 52 | typedef unsigned int u_int32_t; 53 | typedef unsigned __int64 u_int64_t; 54 | 55 | 56 | #define pthread_t HANDLE 57 | #define pthread_mutex_t HANDLE 58 | #define pthread_rwlock_t pthread_mutex_t 59 | #define pthread_rwlock_init pthread_mutex_init 60 | #define pthread_rwlock_wrlock pthread_mutex_lock 61 | #define pthread_rwlock_rdlock pthread_mutex_lock 62 | #define pthread_rwlock_unlock pthread_mutex_unlock 63 | #define pthread_rwlock_destroy pthread_mutex_destroy 64 | 65 | #define gmtime_r(a, b) gmtime(a) /* Already thread safe on windows */ 66 | 67 | extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */); 68 | 69 | #define sleep(a /* sec */) waitForNextEvent(1000*a /* ms */) 70 | 71 | #endif /* Win32 */ 72 | 73 | #endif /* __NDPI_WIN32_INCLUDE_FILE__ */ 74 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/.libs/libndpi.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireflyc/ndpi-demo/b9cf6fc8ed6ebe57bb14339362a0b935512d3428/deps/nDPI-1.6/src/lib/.libs/libndpi.a -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/.libs/libndpi.la: -------------------------------------------------------------------------------- 1 | ../libndpi.la -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/.libs/libndpi.lai: -------------------------------------------------------------------------------- 1 | # libndpi.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libndpi.so.1' 9 | 10 | # Names of this library. 11 | library_names='libndpi.so.1.0.0 libndpi.so.1 libndpi.so' 12 | 13 | # The name of the static archive. 14 | old_library='libndpi.a' 15 | 16 | # Linker flags that cannot go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs='' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libndpi. 26 | current=1 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=yes 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/usr/local/lib' 42 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/.libs/libndpi.so: -------------------------------------------------------------------------------- 1 | libndpi.so.1.0.0 -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/.libs/libndpi.so.1: -------------------------------------------------------------------------------- 1 | libndpi.so.1.0.0 -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/.libs/libndpi.so.1.0.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireflyc/ndpi-demo/b9cf6fc8ed6ebe57bb14339362a0b935512d3428/deps/nDPI-1.6/src/lib/.libs/libndpi.so.1.0.0 -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/.libs/libndpi.ver: -------------------------------------------------------------------------------- 1 | { global: 2 | ndpi_dump_protocols; 3 | ndpi_get_proto_name; 4 | ndpi_free; 5 | ndpi_guess_undetected_protocol; 6 | ndpi_tfind; 7 | ndpi_tsearch; 8 | ndpi_set_protocol_detection_bitmask2; 9 | ndpi_detection_get_sizeof_ndpi_id_struct; 10 | ndpi_detection_get_sizeof_ndpi_flow_struct; 11 | ndpi_load_protocols_file; 12 | ndpi_tdestroy; 13 | ndpi_exit_detection_module; 14 | ndpi_detection_process_packet; 15 | ndpi_twalk; 16 | ndpi_tdelete; 17 | ndpi_revision; 18 | ndpi_init_detection_module; 19 | ndpi_get_num_supported_protocols; 20 | ndpi_set_proto_defaults; 21 | ndpi_get_protocol_id; 22 | ndpi_find_port_based_protocol; 23 | ndpi_get_http_method; 24 | ndpi_get_http_url; 25 | ndpi_get_http_content_type; 26 | ndpi_free_flow; 27 | ndpi_get_proto_breed; 28 | ndpi_get_proto_breed_name; 29 | local: *; }; 30 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/libndpi.la: -------------------------------------------------------------------------------- 1 | # libndpi.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # The name that we can dlopen(3). 8 | dlname='libndpi.so.1' 9 | 10 | # Names of this library. 11 | library_names='libndpi.so.1.0.0 libndpi.so.1 libndpi.so' 12 | 13 | # The name of the static archive. 14 | old_library='libndpi.a' 15 | 16 | # Linker flags that cannot go in dependency_libs. 17 | inherited_linker_flags='' 18 | 19 | # Libraries that this one depends upon. 20 | dependency_libs='' 21 | 22 | # Names of additional weak libraries provided by this library 23 | weak_library_names='' 24 | 25 | # Version information for libndpi. 26 | current=1 27 | age=0 28 | revision=0 29 | 30 | # Is this an already installed library? 31 | installed=no 32 | 33 | # Should we warn about portability when linking against -modules? 34 | shouldnotlink=no 35 | 36 | # Files to dlopen/dlpreopen 37 | dlopen='' 38 | dlpreopen='' 39 | 40 | # Directory that this library needs to be installed in: 41 | libdir='/usr/local/lib' 42 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/libndpi_la-ndpi_main.lo: -------------------------------------------------------------------------------- 1 | # libndpi_la-ndpi_main.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ndpi_main.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ndpi_main.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/.deps/.dirstamp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireflyc/ndpi-demo/b9cf6fc8ed6ebe57bb14339362a0b935512d3428/deps/nDPI-1.6/src/lib/protocols/.deps/.dirstamp -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/.dirstamp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireflyc/ndpi-demo/b9cf6fc8ed6ebe57bb14339362a0b935512d3428/deps/nDPI-1.6/src/lib/protocols/.dirstamp -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/applejuice.c: -------------------------------------------------------------------------------- 1 | /* 2 | * applejuice.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_APPLEJUICE 28 | 29 | 30 | static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct, 31 | struct ndpi_flow_struct *flow) 32 | { 33 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_APPLEJUICE, NDPI_REAL_PROTOCOL); 34 | } 35 | 36 | void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct, 37 | struct ndpi_flow_struct *flow) 38 | { 39 | struct ndpi_packet_struct *packet = &flow->packet; 40 | // struct ndpi_id_struct *src=ndpi_struct->src; 41 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 42 | 43 | NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "search applejuice.\n"); 44 | 45 | if ((packet->payload_packet_len > 7) && (packet->payload[6] == 0x0d) 46 | && (packet->payload[7] == 0x0a) 47 | && (memcmp(packet->payload, "ajprot", 6) == 0)) { 48 | NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "detected applejuice.\n"); 49 | ndpi_int_applejuice_add_connection(ndpi_struct, flow); 50 | return; 51 | } 52 | 53 | NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "exclude applejuice.\n"); 54 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_APPLEJUICE); 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/ayiya.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ayiya.c 3 | * 4 | * Copyright (C) 2011-15 - ntop.org 5 | * 6 | * This file is part of nDPI, an open source deep packet inspection 7 | * library based on the OpenDPI and PACE technology by ipoque GmbH 8 | * 9 | * nDPI is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * nDPI is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with nDPI. If not, see . 21 | * 22 | */ 23 | 24 | /* 25 | http://en.wikipedia.org/wiki/Anything_In_Anything 26 | http://tools.ietf.org/html/rfc4891 27 | */ 28 | 29 | 30 | #include "ndpi_protocols.h" 31 | #ifdef NDPI_PROTOCOL_AYIYA 32 | 33 | struct ayiya { 34 | u_int8_t flags[3]; 35 | u_int8_t next_header; 36 | u_int32_t epoch; 37 | u_int8_t identity[16]; 38 | u_int8_t signature[20]; 39 | }; 40 | 41 | void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 42 | { 43 | struct ndpi_packet_struct *packet = &flow->packet; 44 | 45 | if(packet->udp && (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)) { 46 | /* Ayiya is udp based, port 5072 */ 47 | if ((packet->udp->source == htons(5072) || packet->udp->dest == htons(5072)) 48 | /* check for ayiya new packet */ 49 | && (packet->payload_packet_len > 44) 50 | ) { 51 | /* FINISH */ 52 | struct ayiya *a = (struct ayiya*)packet->payload; 53 | u_int32_t epoch = ntohl(a->epoch), now; 54 | u_int32_t fireyears = 86400 * 365 * 5; 55 | 56 | now = flow->packet.tick_timestamp; 57 | 58 | if((epoch >= (now - fireyears)) && (epoch <= (now+86400 /* 1 day */))) 59 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA, NDPI_REAL_PROTOCOL); 60 | 61 | return; 62 | } 63 | 64 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AYIYA); 65 | } 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/bgp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * bgp.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_BGP 28 | 29 | 30 | static void ndpi_int_bgp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | /* this detection also works asymmetrically */ 36 | void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 37 | { 38 | struct ndpi_packet_struct *packet = &flow->packet; 39 | 40 | // struct ndpi_id_struct *src=ndpi_struct->src; 41 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 42 | 43 | if (packet->payload_packet_len > 18 && 44 | get_u_int64_t(packet->payload, 0) == 0xffffffffffffffffULL && 45 | get_u_int64_t(packet->payload, 8) == 0xffffffffffffffffULL && 46 | ntohs(get_u_int16_t(packet->payload, 16)) <= packet->payload_packet_len && 47 | (packet->tcp->dest == htons(179) || packet->tcp->source == htons(179)) 48 | && packet->payload[18] < 5) { 49 | NDPI_LOG(NDPI_PROTOCOL_BGP, ndpi_struct, NDPI_LOG_DEBUG, "BGP detected.\n"); 50 | ndpi_int_bgp_add_connection(ndpi_struct, flow); 51 | return; 52 | } 53 | 54 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BGP); 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/ciscovpn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ciscovpn.c 3 | * Copyright (C) 2013 by Remy Mudingay 4 | * 5 | */ 6 | 7 | 8 | #include "ndpi_protocols.h" 9 | #ifdef NDPI_PROTOCOL_CISCOVPN 10 | 11 | static void ndpi_int_ciscovpn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 12 | { 13 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_CISCOVPN, NDPI_REAL_PROTOCOL); 14 | } 15 | 16 | void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 17 | { 18 | struct ndpi_packet_struct *packet = &flow->packet; 19 | u_int16_t udport = 0, usport = 0; 20 | u_int16_t tdport = 0, tsport = 0; 21 | 22 | 23 | NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "search CISCOVPN.\n"); 24 | 25 | if(packet->tcp != NULL) { 26 | tsport = ntohs(packet->tcp->source), tdport = ntohs(packet->tcp->dest); 27 | NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "calculated CISCOVPN over tcp ports.\n"); 28 | } 29 | if(packet->udp != NULL) { 30 | usport = ntohs(packet->udp->source), udport = ntohs(packet->udp->dest); 31 | NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "calculated CISCOVPN over udp ports.\n"); 32 | } 33 | 34 | if((tdport == 10000 && tsport == 10000) || 35 | ((tsport == 443 || tdport == 443) && 36 | (packet->payload[0] == 0x17 && 37 | packet->payload[1] == 0x01 && 38 | packet->payload[2] == 0x00 && 39 | packet->payload[3] == 0x00) 40 | ) 41 | ) 42 | 43 | { 44 | /* This is a good query 17010000*/ 45 | NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "found CISCOVPN.\n"); 46 | ndpi_int_ciscovpn_add_connection(ndpi_struct, flow); 47 | } 48 | else if( 49 | ( 50 | (usport == 10000 && udport == 10000) 51 | && 52 | (packet->payload[0] == 0xfe && 53 | packet->payload[1] == 0x57 && 54 | packet->payload[2] == 0x7e && 55 | packet->payload[3] == 0x2b) 56 | ) 57 | ) 58 | { 59 | 60 | 61 | /* This is a good query fe577e2b */ 62 | NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "found CISCOVPN.\n"); 63 | ndpi_int_ciscovpn_add_connection(ndpi_struct, flow); 64 | } else { 65 | NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "exclude CISCOVPN.\n"); 66 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CISCOVPN); 67 | } 68 | 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/collectd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * collectd.c 3 | * 4 | * Copyright (C) 2014 - ntop.org 5 | * 6 | * nDPI is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * nDPI is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with nDPI. If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_protocols.h" 23 | 24 | #ifdef NDPI_PROTOCOL_COLLECTD 25 | 26 | void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 27 | { 28 | struct ndpi_packet_struct *packet = &flow->packet; 29 | u_int len = 0; 30 | 31 | NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "search collectd.\n"); 32 | 33 | if (packet->udp == NULL) return; 34 | 35 | 36 | while(len < packet->payload_packet_len) { 37 | // u_int16_t elem_type = ntohs(*((u_int16_t*)&packet->payload[len])); 38 | u_int16_t elem_len = ntohs(*((u_int16_t*)&packet->payload[len+2])); 39 | 40 | if (elem_len == 0) break; 41 | 42 | len += elem_len; 43 | } 44 | 45 | if(len == packet->payload_packet_len) { 46 | NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "found COLLECTD.\n"); 47 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD, NDPI_REAL_PROTOCOL); 48 | } else { 49 | NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "exclude COLLECTD.\n"); 50 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_COLLECTD); 51 | } 52 | } 53 | #endif 54 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/corba.c: -------------------------------------------------------------------------------- 1 | /* 2 | * corba.c 3 | * 4 | * Copyright (C) 2013 Remy Mudingay 5 | * 6 | * This module is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This module is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License. 17 | * If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | #ifdef NDPI_PROTOCOL_CORBA 25 | static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct 26 | *ndpi_struct, struct ndpi_flow_struct *flow) 27 | { 28 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_CORBA, NDPI_CORRELATED_PROTOCOL); 29 | } 30 | void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | struct ndpi_packet_struct *packet = &flow->packet; 33 | 34 | NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "search for CORBA.\n"); 35 | if(packet->tcp != NULL) { 36 | NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "calculating CORBA over tcp.\n"); 37 | /* Corba General Inter-ORB Protocol -> GIOP */ 38 | if ((packet->payload_packet_len >= 24 && packet->payload_packet_len <= 144) && 39 | memcmp(packet->payload, "GIOP", 4) == 0) { 40 | NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "found corba.\n"); 41 | ndpi_int_corba_add_connection(ndpi_struct, flow); 42 | } 43 | } else { 44 | NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "exclude CORBA.\n"); 45 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CORBA); 46 | } 47 | } 48 | #endif 49 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/dcerpc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dcerpc.c 3 | * 4 | * Copyright (C) 2011-13 by ntop.org 5 | * 6 | * This file is part of nDPI, an open source deep packet inspection 7 | * library based on the OpenDPI and PACE technology by ipoque GmbH 8 | * 9 | * nDPI is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * nDPI is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with nDPI. If not, see . 21 | * 22 | */ 23 | 24 | 25 | #include "ndpi_api.h" 26 | 27 | #ifdef NDPI_PROTOCOL_DCERPC 28 | 29 | static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DCERPC, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 36 | { 37 | struct ndpi_packet_struct *packet = &flow->packet; 38 | 39 | 40 | if((packet->tcp != NULL) 41 | && (packet->payload_packet_len > 64) 42 | && ((ntohs(packet->tcp->source) == 135) || (ntohs(packet->tcp->dest) == 135)) 43 | && (packet->payload[0] == 0x05) /* version 5 */ 44 | && (packet->payload[2] < 16) /* Packet type */ 45 | ) { 46 | NDPI_LOG(NDPI_PROTOCOL_DCERPC, ndpi_struct, NDPI_LOG_DEBUG, "DCERPC match\n"); 47 | ndpi_int_dcerpc_add_connection(ndpi_struct, flow); 48 | return; 49 | } 50 | 51 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DCERPC); 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/dhcp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dhcp.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | 28 | #ifdef NDPI_PROTOCOL_DHCP 29 | 30 | static void ndpi_int_dhcp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DHCP, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | 36 | void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 37 | { 38 | struct ndpi_packet_struct *packet = &flow->packet; 39 | 40 | // struct ndpi_id_struct *src=ndpi_struct->src; 41 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 42 | 43 | /* this detection also works for asymmetric dhcp traffic */ 44 | 45 | /*check standard DHCP 0.0.0.0:68 -> 255.255.255.255:67 */ 46 | if (packet->payload_packet_len >= 244 && (packet->udp->source == htons(67) 47 | || packet->udp->source == htons(68)) 48 | && (packet->udp->dest == htons(67) || packet->udp->dest == htons(68)) 49 | && get_u_int32_t(packet->payload, 236) == htonl(0x63825363) 50 | && get_u_int16_t(packet->payload, 240) == htons(0x3501)) { 51 | 52 | NDPI_LOG(NDPI_PROTOCOL_DHCP, ndpi_struct, NDPI_LOG_DEBUG, "DHCP request\n"); 53 | 54 | ndpi_int_dhcp_add_connection(ndpi_struct, flow); 55 | return; 56 | } 57 | 58 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCP); 59 | } 60 | #endif 61 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/dhcpv6.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dhcpv6.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | 27 | /* include files */ 28 | 29 | #include "ndpi_protocols.h" 30 | #ifdef NDPI_PROTOCOL_DHCPV6 31 | 32 | static void ndpi_int_dhcpv6_add_connection(struct ndpi_detection_module_struct *ndpi_struct, 33 | struct ndpi_flow_struct *flow) 34 | { 35 | 36 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_DHCPV6, NDPI_REAL_PROTOCOL); 37 | } 38 | 39 | void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 40 | { 41 | struct ndpi_packet_struct *packet = &flow->packet; 42 | 43 | // struct ndpi_id_struct *src=ndpi_struct->src; 44 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 45 | 46 | if (packet->payload_packet_len >= 4 && 47 | (packet->udp->source == htons(546) || packet->udp->source == htons(547)) && 48 | (packet->udp->dest == htons(546) || packet->udp->dest == htons(547)) && 49 | packet->payload[0] >= 1 && packet->payload[0] <= 13) { 50 | 51 | NDPI_LOG(NDPI_PROTOCOL_DHCPV6, ndpi_struct, NDPI_LOG_DEBUG, "DHCPv6 detected.\n"); 52 | ndpi_int_dhcpv6_add_connection(ndpi_struct, flow); 53 | return; 54 | } 55 | 56 | NDPI_LOG(NDPI_PROTOCOL_DHCPV6, ndpi_struct, NDPI_LOG_DEBUG, "DHCPv6 excluded.\n"); 57 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCPV6); 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/http_activesync.c: -------------------------------------------------------------------------------- 1 | /* 2 | * http_activesync.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | 27 | #include "ndpi_protocols.h" 28 | #ifdef NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC 29 | static void ndpi_int_activesync_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 30 | { 31 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, NDPI_CORRELATED_PROTOCOL); 32 | } 33 | 34 | void ndpi_search_activesync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 35 | { 36 | struct ndpi_packet_struct *packet = &flow->packet; 37 | 38 | if (packet->tcp != NULL) { 39 | 40 | if (packet->payload_packet_len > 150 41 | && ((memcmp(packet->payload, "OPTIONS /Microsoft-Server-ActiveSync?", 37) == 0) 42 | || (memcmp(packet->payload, "POST /Microsoft-Server-ActiveSync?", 34) == 0))) { 43 | ndpi_int_activesync_add_connection(ndpi_struct, flow); 44 | NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, ndpi_struct, NDPI_LOG_DEBUG, 45 | " flow marked as ActiveSync \n"); 46 | return; 47 | } 48 | } 49 | 50 | NDPI_LOG(NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, ndpi_struct, NDPI_LOG_DEBUG, "exclude activesync\n"); 51 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC); 52 | 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/kontiki.c: -------------------------------------------------------------------------------- 1 | /* 2 | * kontiki.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_KONTIKI 28 | 29 | static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct, 30 | struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_KONTIKI, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 36 | { 37 | struct ndpi_packet_struct *packet = &flow->packet; 38 | 39 | // struct ndpi_id_struct *src=ndpi_struct->src; 40 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 41 | 42 | 43 | if (packet->payload_packet_len == 4 && (get_u_int32_t(packet->payload, 0) == htonl(0x02010100))) { 44 | NDPI_LOG(NDPI_PROTOCOL_KONTIKI, ndpi_struct, NDPI_LOG_DEBUG, "Kontiki UDP detected.\n"); 45 | ndpi_int_kontiki_add_connection(ndpi_struct, flow); 46 | return; 47 | } 48 | if (packet->payload_packet_len > 0 && packet->payload[0] == 0x02) { 49 | 50 | if (packet->payload_packet_len == 20 && (get_u_int32_t(packet->payload, 16) == htonl(0x02040100))) { 51 | NDPI_LOG(NDPI_PROTOCOL_KONTIKI, ndpi_struct, NDPI_LOG_DEBUG, "Kontiki UDP detected.\n"); 52 | ndpi_int_kontiki_add_connection(ndpi_struct, flow); 53 | return; 54 | } 55 | if (packet->payload_packet_len == 16 && (get_u_int32_t(packet->payload, 12) == htonl(0x000004e4))) { 56 | NDPI_LOG(NDPI_PROTOCOL_KONTIKI, ndpi_struct, NDPI_LOG_DEBUG, "Kontiki UDP detected.\n"); 57 | ndpi_int_kontiki_add_connection(ndpi_struct, flow); 58 | return; 59 | } 60 | } 61 | 62 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_KONTIKI); 63 | } 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-afp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-afp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-afp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-afp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-aimini.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-aimini.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-aimini.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-aimini.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-applejuice.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-applejuice.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-applejuice.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-applejuice.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-armagetron.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-armagetron.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-armagetron.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-armagetron.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ayiya.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ayiya.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ayiya.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ayiya.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-battlefield.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-battlefield.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-battlefield.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-battlefield.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-bgp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-bgp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-bgp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-bgp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-bittorrent.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-bittorrent.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-bittorrent.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-bittorrent.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ciscovpn.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ciscovpn.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ciscovpn.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ciscovpn.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-citrix.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-citrix.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-citrix.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-citrix.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-collectd.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-collectd.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-collectd.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-collectd.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-corba.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-corba.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-corba.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-corba.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-crossfire.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-crossfire.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-crossfire.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-crossfire.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-dcerpc.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-dcerpc.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-dcerpc.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-dcerpc.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-dhcp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-dhcp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-dhcp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-dhcp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-dhcpv6.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-dhcpv6.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-dhcpv6.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-dhcpv6.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-directconnect.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-directconnect.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-directconnect.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-directconnect.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-directdownloadlink.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-directdownloadlink.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-directdownloadlink.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-directdownloadlink.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-dns.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-dns.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-dns.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-dns.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-dofus.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-dofus.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-dofus.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-dofus.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-dropbox.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-dropbox.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-dropbox.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-dropbox.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-edonkey.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-edonkey.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-edonkey.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-edonkey.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-fasttrack.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-fasttrack.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-fasttrack.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-fasttrack.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-fiesta.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-fiesta.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-fiesta.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-fiesta.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-filetopia.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-filetopia.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-filetopia.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-filetopia.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-florensia.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-florensia.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-florensia.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-florensia.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ftp_control.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ftp_control.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ftp_control.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ftp_control.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ftp_data.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ftp_data.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ftp_data.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ftp_data.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-gnutella.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-gnutella.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-gnutella.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-gnutella.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-gtp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-gtp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-gtp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-gtp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-guildwars.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-guildwars.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-guildwars.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-guildwars.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-h323.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-h323.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-h323.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-h323.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-halflife2_and_mods.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-halflife2_and_mods.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-halflife2_and_mods.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-halflife2_and_mods.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-http.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-http.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-http.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-http.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-http_activesync.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-http_activesync.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-http_activesync.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-http_activesync.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-iax.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-iax.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-iax.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-iax.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-icecast.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-icecast.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-icecast.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-icecast.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-imesh.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-imesh.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-imesh.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-imesh.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ipp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ipp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ipp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ipp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-irc.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-irc.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-irc.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-irc.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-jabber.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-jabber.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-jabber.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-jabber.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-kerberos.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-kerberos.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-kerberos.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-kerberos.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-kontiki.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-kontiki.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-kontiki.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-kontiki.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ldap.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ldap.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ldap.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ldap.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-lotus_notes.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-lotus_notes.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-lotus_notes.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-lotus_notes.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mail_imap.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mail_imap.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mail_imap.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mail_imap.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mail_pop.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mail_pop.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mail_pop.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mail_pop.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mail_smtp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mail_smtp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mail_smtp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mail_smtp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-maplestory.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-maplestory.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-maplestory.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-maplestory.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mdns.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mdns.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mdns.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mdns.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-meebo.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-meebo.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-meebo.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-meebo.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-megaco.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-megaco.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-megaco.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-megaco.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mgcp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mgcp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mgcp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mgcp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mms.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mms.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mms.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mms.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-msn.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-msn.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-msn.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-msn.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mssql.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mssql.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mssql.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mssql.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-mysql.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-mysql.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-mysql.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-mysql.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-netbios.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-netbios.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-netbios.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-netbios.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-netflow.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-netflow.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-netflow.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-netflow.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-nfs.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-nfs.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-nfs.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-nfs.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-noe.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-noe.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-noe.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-noe.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-non_tcp_udp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-non_tcp_udp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-non_tcp_udp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-non_tcp_udp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ntp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ntp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ntp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ntp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-openft.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-openft.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-openft.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-openft.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-openvpn.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-openvpn.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-openvpn.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-openvpn.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-oracle.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-oracle.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-oracle.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-oracle.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-oscar.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-oscar.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-oscar.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-oscar.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-pando.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-pando.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-pando.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-pando.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-pcanywhere.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-pcanywhere.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-pcanywhere.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-pcanywhere.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-postgres.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-postgres.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-postgres.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-postgres.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-pplive.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-pplive.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-pplive.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-pplive.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ppstream.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ppstream.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ppstream.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ppstream.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-pptp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-pptp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-pptp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-pptp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-qq.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-qq.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-qq.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-qq.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-quake.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-quake.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-quake.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-quake.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-quic.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-quic.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-quic.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-quic.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-radius.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-radius.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-radius.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-radius.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-rdp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-rdp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-rdp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-rdp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-redis_net.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-redis_net.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-redis_net.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-redis_net.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-rsync.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-rsync.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-rsync.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-rsync.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-rtcp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-rtcp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-rtcp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-rtcp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-rtmp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-rtmp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-rtmp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-rtmp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-rtp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-rtp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-rtp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-rtp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-rtsp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-rtsp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-rtsp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-rtsp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-sflow.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-sflow.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-sflow.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-sflow.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-shoutcast.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-shoutcast.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-shoutcast.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-shoutcast.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-sip.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-sip.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-sip.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-sip.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-skinny.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-skinny.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-skinny.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-skinny.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-skype.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-skype.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-skype.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-skype.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-smb.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-smb.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-smb.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-smb.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-snmp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-snmp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-snmp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-snmp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-socks4.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-socks4.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-socks4.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-socks4.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-socks5.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-socks5.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-socks5.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-socks5.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-socrates.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-socrates.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-socrates.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-socrates.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-sopcast.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-sopcast.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-sopcast.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-sopcast.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-soulseek.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-soulseek.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-soulseek.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-soulseek.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-spotify.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-spotify.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-spotify.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-spotify.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ssdp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ssdp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ssdp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ssdp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ssh.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ssh.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ssh.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ssh.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-ssl.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-ssl.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ssl.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ssl.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-stealthnet.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-stealthnet.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-stealthnet.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-stealthnet.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-steam.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-steam.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-steam.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-steam.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-stun.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-stun.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-stun.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-stun.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-syslog.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-syslog.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-syslog.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-syslog.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-tcp_udp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-tcp_udp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-tcp_udp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-tcp_udp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-tds.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-tds.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-tds.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-tds.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-teamspeak.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-teamspeak.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-teamspeak.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-teamspeak.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-teamviewer.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-teamviewer.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-teamviewer.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-teamviewer.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-telegram.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-telegram.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-telegram.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-telegram.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-telnet.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-telnet.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-telnet.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-telnet.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-tftp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-tftp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-tftp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-tftp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-thunder.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-thunder.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-thunder.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-thunder.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-tor.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-tor.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-tor.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-tor.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-tvants.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-tvants.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-tvants.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-tvants.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-tvuplayer.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-tvuplayer.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-tvuplayer.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-tvuplayer.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-twitter.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-twitter.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-twitter.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-twitter.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-usenet.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-usenet.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-usenet.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-usenet.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-veohtv.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-veohtv.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-veohtv.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-veohtv.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-vhua.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-vhua.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-vhua.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-vhua.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-viber.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-viber.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-viber.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-viber.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-vmware.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-vmware.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-vmware.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-vmware.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-vnc.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-vnc.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-vnc.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-vnc.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-warcraft3.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-warcraft3.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-warcraft3.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-warcraft3.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-whoisdas.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-whoisdas.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-whoisdas.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-whoisdas.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-winmx.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-winmx.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-winmx.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-winmx.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-world_of_kung_fu.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-world_of_kung_fu.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-world_of_kung_fu.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-world_of_kung_fu.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-world_of_warcraft.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-world_of_warcraft.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-world_of_warcraft.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-world_of_warcraft.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-xbox.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-xbox.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-xbox.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-xbox.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-xdmcp.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-xdmcp.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-xdmcp.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-xdmcp.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-yahoo.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-yahoo.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-yahoo.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-yahoo.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-zattoo.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-zattoo.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-zattoo.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-zattoo.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/libndpi_la-zeromq.lo: -------------------------------------------------------------------------------- 1 | # protocols/libndpi_la-zeromq.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-zeromq.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-zeromq.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/megaco.c: -------------------------------------------------------------------------------- 1 | /* 2 | * megaco.c 3 | * 4 | * Copyright (C) 2014 by Gianluca Costa http://www.capanalysis.net 5 | * Copyright (C) 2012-15 - ntop.org 6 | * 7 | * This module is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This module is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License. 18 | * If not, see . 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | #ifdef NDPI_PROTOCOL_MEGACO 25 | 26 | void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 27 | { 28 | struct ndpi_packet_struct *packet = &flow->packet; 29 | 30 | NDPI_LOG(NDPI_PROTOCOL_MEGACO, ndpi_struct, NDPI_LOG_DEBUG, "search for MEGACO.\n"); 31 | 32 | if(packet->udp != NULL) { 33 | if((packet->payload_packet_len > 4 && packet->payload[0] == '!' && packet->payload[1] == '/' && 34 | packet->payload[2] == '1' && packet->payload[3] == ' ' && packet->payload[4] == '[') 35 | || (packet->payload_packet_len > 9 && packet->payload[0] == 'M' && packet->payload[1] == 'E' && 36 | packet->payload[2] == 'G' && packet->payload[3] == 'A' && packet->payload[4] == 'C' && 37 | packet->payload[5] == 'O' && packet->payload[6] == '/' && 38 | packet->payload[7] == '1' && packet->payload[8] == ' ' && packet->payload[9] == '[')) { 39 | NDPI_LOG(NDPI_PROTOCOL_MEGACO, ndpi_struct, NDPI_LOG_DEBUG, "found MEGACO.\n"); 40 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MEGACO, NDPI_REAL_PROTOCOL); 41 | return; 42 | } 43 | } 44 | 45 | NDPI_LOG(NDPI_PROTOCOL_MEGACO, ndpi_struct, NDPI_LOG_DEBUG, "exclude MEGACO.\n"); 46 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MEGACO); 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/mssql.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mssql.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | 27 | /* include files */ 28 | 29 | #include "ndpi_protocols.h" 30 | #ifdef NDPI_PROTOCOL_MSSQL 31 | 32 | static void ndpi_int_mssql_add_connection(struct ndpi_detection_module_struct 33 | *ndpi_struct, struct ndpi_flow_struct *flow) 34 | { 35 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_MSSQL, NDPI_REAL_PROTOCOL); 36 | } 37 | 38 | void ndpi_search_mssql(struct ndpi_detection_module_struct 39 | *ndpi_struct, struct ndpi_flow_struct *flow) 40 | { 41 | struct ndpi_packet_struct *packet = &flow->packet; 42 | 43 | 44 | 45 | 46 | NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "search mssql.\n"); 47 | 48 | 49 | if (packet->payload_packet_len > 51 && ntohs(get_u_int32_t(packet->payload, 0)) == 0x1201 50 | && ntohs(get_u_int16_t(packet->payload, 2)) == packet->payload_packet_len 51 | && ntohl(get_u_int32_t(packet->payload, 4)) == 0x00000100 && memcmp(&packet->payload[41], "sqlexpress", 10) == 0) { 52 | NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "found mssql.\n"); 53 | ndpi_int_mssql_add_connection(ndpi_struct, flow); 54 | return; 55 | } 56 | 57 | 58 | NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "exclude mssql.\n"); 59 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MSSQL); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/noe.c: -------------------------------------------------------------------------------- 1 | /* 2 | * noe.c (Alcatel new office environment) 3 | * 4 | * Copyright (C) 2013 Remy Mudingay 5 | * 6 | */ 7 | 8 | 9 | #include "ndpi_api.h" 10 | 11 | 12 | #ifdef NDPI_PROTOCOL_NOE 13 | static void ndpi_int_noe_add_connection(struct ndpi_detection_module_struct 14 | *ndpi_struct, struct ndpi_flow_struct *flow) 15 | { 16 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NOE, NDPI_CORRELATED_PROTOCOL); 17 | } 18 | 19 | void ndpi_search_noe(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 20 | { 21 | struct ndpi_packet_struct *packet = &flow->packet; 22 | 23 | NDPI_LOG(NDPI_PROTOCOL_NOE, ndpi_struct, NDPI_LOG_DEBUG, "search for NOE.\n"); 24 | 25 | if(packet->udp != NULL) { 26 | NDPI_LOG(NDPI_PROTOCOL_NOE, ndpi_struct, NDPI_LOG_DEBUG, "calculating dport over udp.\n"); 27 | 28 | if (packet->payload_packet_len == 1 && ( packet->payload[0] == 0x05 || packet->payload[0] == 0x04 )) { 29 | NDPI_LOG(NDPI_PROTOCOL_NOE, ndpi_struct, NDPI_LOG_DEBUG, "found noe.\n"); 30 | ndpi_int_noe_add_connection(ndpi_struct, flow); 31 | return; 32 | } else if((packet->payload_packet_len == 5 || packet->payload_packet_len == 12) && 33 | (packet->payload[0] == 0x07 ) && 34 | (packet->payload[1] == 0x00 ) && 35 | (packet->payload[2] != 0x00 ) && 36 | (packet->payload[3] == 0x00 )) { 37 | NDPI_LOG(NDPI_PROTOCOL_NOE, ndpi_struct, NDPI_LOG_DEBUG, "found noe.\n"); 38 | ndpi_int_noe_add_connection(ndpi_struct, flow); 39 | } else if((packet->payload_packet_len >= 25) && 40 | (packet->payload[0] == 0x00 && 41 | packet->payload[1] == 0x06 && 42 | packet->payload[2] == 0x62 && 43 | packet->payload[3] == 0x6c)) { 44 | NDPI_LOG(NDPI_PROTOCOL_NOE, ndpi_struct, NDPI_LOG_DEBUG, "found noe.\n"); 45 | ndpi_int_noe_add_connection(ndpi_struct, flow); 46 | } 47 | } else { 48 | NDPI_LOG(NDPI_PROTOCOL_NOE, ndpi_struct, NDPI_LOG_DEBUG, "exclude NOE.\n"); 49 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_NOE); 50 | } 51 | } 52 | #endif 53 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/ntp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ntp.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_NTP 28 | 29 | static void ndpi_int_ntp_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NTP, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | /* detection also works asymmetrically */ 36 | 37 | void ndpi_search_ntp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 38 | { 39 | struct ndpi_packet_struct *packet = &flow->packet; 40 | 41 | // struct ndpi_id_struct *src=ndpi_struct->src; 42 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 43 | 44 | if (!(packet->udp->dest == htons(123) || packet->udp->source == htons(123))) 45 | goto exclude_ntp; 46 | 47 | NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "NTP port detected\n"); 48 | 49 | if (packet->payload_packet_len != 48) 50 | goto exclude_ntp; 51 | 52 | NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "NTP length detected\n"); 53 | 54 | 55 | if ((((packet->payload[0] & 0x38) >> 3) <= 4)) { 56 | NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "detected NTP."); 57 | ndpi_int_ntp_add_connection(ndpi_struct, flow); 58 | return; 59 | } 60 | 61 | 62 | 63 | exclude_ntp: 64 | NDPI_LOG(NDPI_PROTOCOL_NTP, ndpi_struct, NDPI_LOG_DEBUG, "NTP excluded.\n"); 65 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_NTP); 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/openft.c: -------------------------------------------------------------------------------- 1 | /* 2 | * openft.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_OPENFT 28 | 29 | static void ndpi_int_openft_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENFT, NDPI_CORRELATED_PROTOCOL); 33 | } 34 | 35 | void ndpi_search_openft_tcp(struct ndpi_detection_module_struct 36 | *ndpi_struct, struct ndpi_flow_struct *flow) 37 | { 38 | struct ndpi_packet_struct *packet = &flow->packet; 39 | 40 | // struct ndpi_id_struct *src=ndpi_struct->src; 41 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 42 | 43 | if (packet->payload_packet_len > 5 && memcmp(packet->payload, "GET /", 5) == 0) { 44 | NDPI_LOG(NDPI_PROTOCOL_OPENFT, ndpi_struct, NDPI_LOG_DEBUG, "HTTP packet detected.\n"); 45 | ndpi_parse_packet_line_info(ndpi_struct, flow); 46 | if (packet->parsed_lines >= 2 47 | && packet->line[1].len > 13 && memcmp(packet->line[1].ptr, "X-OpenftAlias:", 14) == 0) { 48 | NDPI_LOG(NDPI_PROTOCOL_OPENFT, ndpi_struct, NDPI_LOG_DEBUG, "OpenFT detected.\n"); 49 | ndpi_int_openft_add_connection(ndpi_struct, flow); 50 | return; 51 | } 52 | } 53 | 54 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OPENFT); 55 | } 56 | #endif 57 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/openvpn.c: -------------------------------------------------------------------------------- 1 | /* 2 | * h323.c 3 | * 4 | * Copyright (C) 2013 Remy Mudingay 5 | * 6 | */ 7 | 8 | #include "ndpi_api.h" 9 | 10 | 11 | #ifdef NDPI_PROTOCOL_OPENVPN 12 | 13 | void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct, 14 | struct ndpi_flow_struct* flow) { 15 | struct ndpi_packet_struct* packet = &flow->packet; 16 | u_int16_t dport = 0, sport = 0; 17 | 18 | if (packet->udp != NULL) { 19 | 20 | sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest); 21 | 22 | if ((packet->payload_packet_len >= 25) && (sport == 443 || dport == 443) && 23 | (packet->payload[0] == 0x17 && packet->payload[1] == 0x01 && 24 | packet->payload[2] == 0x00 && packet->payload[3] == 0x00)) { 25 | NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG, 26 | "found openvpn udp 443.\n"); 27 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, 28 | NDPI_REAL_PROTOCOL); 29 | return; 30 | } 31 | 32 | if ( ( (packet->payload_packet_len > 40) || 33 | (packet->payload_packet_len <= 14) ) && // hard-reset 34 | (sport == 1194 || dport == 1194) && 35 | (packet->payload[0] == 0x30 || packet->payload[0] == 0x31 || 36 | packet->payload[0] == 0x32 || packet->payload[0] == 0x33 || 37 | packet->payload[0] == 0x34 || packet->payload[0] == 0x35 || 38 | packet->payload[0] == 0x36 || packet->payload[0] == 0x37 || 39 | packet->payload[0] == 0x38 || packet->payload[0] == 0x39)) { 40 | NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG, 41 | "found openvpn broadcast udp STD.\n"); 42 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, 43 | NDPI_REAL_PROTOCOL); 44 | return; 45 | } 46 | 47 | } 48 | 49 | if (packet->tcp != NULL) { 50 | 51 | sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest); 52 | 53 | if ((packet->payload_packet_len >= 40) && 54 | (sport == 1194 || dport == 1194) && 55 | ((packet->payload[0] == 0x00) && (packet->payload[1] == 0x2a) && 56 | (packet->payload[2] == 0x38))) { 57 | NDPI_LOG(NDPI_PROTOCOL_OPENVPN, ndpi_struct, NDPI_LOG_DEBUG, 58 | "found openvpn broadcast udp STD.\n"); 59 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OPENVPN, 60 | NDPI_REAL_PROTOCOL); 61 | return; 62 | } 63 | } 64 | 65 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, 66 | NDPI_PROTOCOL_OPENVPN); 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/pcanywhere.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pcanywhere.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_PCANYWHERE 28 | 29 | static void ndpi_int_pcanywhere_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PCANYWHERE, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | void ndpi_search_pcanywhere(struct ndpi_detection_module_struct 36 | *ndpi_struct, struct ndpi_flow_struct *flow) 37 | { 38 | struct ndpi_packet_struct *packet = &flow->packet; 39 | 40 | // struct ndpi_id_struct *src=ndpi_struct->src; 41 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 42 | 43 | if (packet->udp != NULL && packet->udp->dest == htons(5632) 44 | && packet->payload_packet_len == 2 45 | && (memcmp(packet->payload, "NQ", 2) == 0 || memcmp(packet->payload, "ST", 2) == 0)) { 46 | NDPI_LOG(NDPI_PROTOCOL_PCANYWHERE, ndpi_struct, NDPI_LOG_DEBUG, 47 | "PC Anywhere name or status query detected.\n"); 48 | ndpi_int_pcanywhere_add_connection(ndpi_struct, flow); 49 | return; 50 | } 51 | 52 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_PCANYWHERE); 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/pptp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * pptp.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | 27 | /* include files */ 28 | 29 | #include "ndpi_protocols.h" 30 | #ifdef NDPI_PROTOCOL_PPTP 31 | 32 | static void ndpi_int_pptp_add_connection(struct ndpi_detection_module_struct 33 | *ndpi_struct, struct ndpi_flow_struct *flow) 34 | { 35 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PPTP, NDPI_REAL_PROTOCOL); 36 | } 37 | 38 | void ndpi_search_pptp(struct ndpi_detection_module_struct 39 | *ndpi_struct, struct ndpi_flow_struct *flow) 40 | { 41 | struct ndpi_packet_struct *packet = &flow->packet; 42 | 43 | 44 | // struct ndpi_id_struct *src=ndpi_struct->src; 45 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 46 | 47 | if (packet->payload_packet_len >= 10 && get_u_int16_t(packet->payload, 0) == htons(packet->payload_packet_len) 48 | && get_u_int16_t(packet->payload, 2) == htons(0x0001) /* message type: control message */ 49 | &&get_u_int32_t(packet->payload, 4) == htonl(0x1a2b3c4d) /* cookie: correct */ 50 | &&(get_u_int16_t(packet->payload, 8) == htons(0x0001) /* control type: start-control-connection-request */ 51 | )) { 52 | 53 | NDPI_LOG(NDPI_PROTOCOL_PPTP, ndpi_struct, NDPI_LOG_DEBUG, "found pptp.\n"); 54 | ndpi_int_pptp_add_connection(ndpi_struct, flow); 55 | return; 56 | } 57 | 58 | NDPI_LOG(NDPI_PROTOCOL_PPTP, ndpi_struct, NDPI_LOG_DEBUG, "exclude pptp.\n"); 59 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_PPTP); 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/radius.c: -------------------------------------------------------------------------------- 1 | /* 2 | * radius.c 3 | * 4 | * Copyright (C) 2012-15 - ntop.org 5 | * 6 | * nDPI is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * nDPI is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with nDPI. If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | #ifdef NDPI_PROTOCOL_RADIUS 25 | 26 | struct radius_header { 27 | u_int8_t code; 28 | u_int8_t packet_id; 29 | u_int16_t len; 30 | }; 31 | 32 | static void ndpi_check_radius(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 33 | { 34 | struct ndpi_packet_struct *packet = &flow->packet; 35 | // const u_int8_t *packet_payload = packet->payload; 36 | u_int32_t payload_len = packet->payload_packet_len; 37 | 38 | #if 0 39 | printf("[len=%u][%02X %02X %02X %02X]\n", payload_len, 40 | packet->payload[0] & 0xFF, 41 | packet->payload[1] & 0xFF, 42 | packet->payload[2] & 0xFF, 43 | packet->payload[3] & 0xFF); 44 | #endif 45 | 46 | if(packet->udp != NULL) { 47 | struct radius_header *h = (struct radius_header*)packet->payload; 48 | u_int len = ntohs(h->len); 49 | 50 | if((payload_len > sizeof(struct radius_header)) 51 | && (h->code > 0) 52 | && (h->code <= 5) 53 | && (len == payload_len)) { 54 | NDPI_LOG(NDPI_PROTOCOL_RADIUS, ndpi_struct, NDPI_LOG_DEBUG, "Found radius.\n"); 55 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RADIUS, NDPI_REAL_PROTOCOL); 56 | 57 | return; 58 | } 59 | 60 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RADIUS); 61 | return; 62 | } 63 | } 64 | 65 | void ndpi_search_radius(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 66 | { 67 | struct ndpi_packet_struct *packet = &flow->packet; 68 | 69 | NDPI_LOG(NDPI_PROTOCOL_RADIUS, ndpi_struct, NDPI_LOG_DEBUG, "radius detection...\n"); 70 | 71 | /* skip marked packets */ 72 | if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_RADIUS) 73 | ndpi_check_radius(ndpi_struct, flow); 74 | } 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/rdp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rdp.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_RDP 28 | 29 | static void ndpi_int_rdp_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RDP, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | void ndpi_search_rdp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 36 | { 37 | struct ndpi_packet_struct *packet = &flow->packet; 38 | 39 | // struct ndpi_id_struct *src=ndpi_struct->src; 40 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 41 | 42 | if (packet->payload_packet_len > 10 43 | && get_u_int8_t(packet->payload, 0) > 0 44 | && get_u_int8_t(packet->payload, 0) < 4 && get_u_int16_t(packet->payload, 2) == ntohs(packet->payload_packet_len) 45 | && get_u_int8_t(packet->payload, 4) == packet->payload_packet_len - 5 46 | && get_u_int8_t(packet->payload, 5) == 0xe0 47 | && get_u_int16_t(packet->payload, 6) == 0 && get_u_int16_t(packet->payload, 8) == 0 && get_u_int8_t(packet->payload, 10) == 0) { 48 | NDPI_LOG(NDPI_PROTOCOL_RDP, ndpi_struct, NDPI_LOG_DEBUG, "RDP detected.\n"); 49 | ndpi_int_rdp_add_connection(ndpi_struct, flow); 50 | return; 51 | } 52 | 53 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RDP); 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/rsync.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rsync.c 3 | * 4 | * Copyright (C) 2013 Remy Mudingay 5 | * 6 | * This module is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This module is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License. 17 | * If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | 25 | #ifdef NDPI_PROTOCOL_RSYNC 26 | static void ndpi_int_rsync_add_connection(struct ndpi_detection_module_struct 27 | *ndpi_struct, struct ndpi_flow_struct *flow) 28 | { 29 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RSYNC, NDPI_CORRELATED_PROTOCOL); 30 | } 31 | 32 | void ndpi_search_rsync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 33 | { 34 | struct ndpi_packet_struct *packet = &flow->packet; 35 | 36 | NDPI_LOG(NDPI_PROTOCOL_RSYNC, ndpi_struct, NDPI_LOG_DEBUG, "search for RSYNC.\n"); 37 | 38 | if(packet->tcp != NULL) { 39 | NDPI_LOG(NDPI_PROTOCOL_RSYNC, ndpi_struct, NDPI_LOG_DEBUG, "calculating RSYNC over tcp.\n"); 40 | /* 41 | * Should match: memcmp(packet->payload, "@RSYN NCD: 28", 14) == 0) 42 | */ 43 | if (packet->payload_packet_len == 12 && packet->payload[0] == 0x40 && 44 | packet->payload[1] == 0x52 && packet->payload[2] == 0x53 && 45 | packet->payload[3] == 0x59 && packet->payload[4] == 0x4e && 46 | packet->payload[5] == 0x43 && packet->payload[6] == 0x44 && 47 | packet->payload[7] == 0x3a ) { 48 | NDPI_LOG(NDPI_PROTOCOL_RSYNC, ndpi_struct, NDPI_LOG_DEBUG, "found rsync.\n"); 49 | ndpi_int_rsync_add_connection(ndpi_struct, flow); 50 | } 51 | } else { 52 | NDPI_LOG(NDPI_PROTOCOL_RSYNC, ndpi_struct, NDPI_LOG_DEBUG, "exclude RSYNC.\n"); 53 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RSYNC); 54 | } 55 | } 56 | #endif 57 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/rtcp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * rtcp.c (RTP Control Protocol) 3 | * 4 | * Copyright (C) 2013 Remy Mudingay 5 | * 6 | */ 7 | 8 | 9 | #include "ndpi_api.h" 10 | 11 | #ifdef NDPI_PROTOCOL_RTCP 12 | static void ndpi_int_rtcp_add_connection(struct ndpi_detection_module_struct 13 | *ndpi_struct, struct ndpi_flow_struct *flow) 14 | { 15 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTCP, NDPI_CORRELATED_PROTOCOL); 16 | } 17 | 18 | void ndpi_search_rtcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 19 | { 20 | struct ndpi_packet_struct *packet = &flow->packet; 21 | u_int16_t dport = 0, sport = 0; 22 | 23 | NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "search for RTCP.\n"); 24 | 25 | if(packet->tcp != NULL) { 26 | sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest); 27 | NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "calculating dport over tcp.\n"); 28 | 29 | if(packet->payload_packet_len > 13 && (sport == 554 || dport == 554) && 30 | packet->payload[0] == 0x00 && packet->payload[1] == 0x00 && 31 | packet->payload[2] == 0x01 && packet->payload[3] == 0x01 && 32 | packet->payload[4] == 0x08 && packet->payload[5] == 0x0a && 33 | packet->payload[6] == 0x00 && packet->payload[7] == 0x01) { 34 | NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "found rtcp.\n"); 35 | ndpi_int_rtcp_add_connection(ndpi_struct, flow); 36 | } 37 | } else if(packet->udp != NULL) { 38 | sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest); 39 | NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "calculating dport over udp.\n"); 40 | if(((packet->payload_packet_len >= 28 || packet->payload_packet_len <= 1200) && 41 | ((packet->payload[0] == 0x80) && ((packet->payload[1] == 0xc8) || (packet->payload[1] == 0xc9)) && (packet->payload[2] == 0x00))) 42 | || (((packet->payload[0] == 0x81) && ((packet->payload[1] == 0xc8) || (packet->payload[1] == 0xc9)) 43 | && (packet->payload[2] == 0x00)))) { 44 | NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "found rtcp.\n"); 45 | ndpi_int_rtcp_add_connection(ndpi_struct, flow); 46 | } 47 | } else { 48 | NDPI_LOG(NDPI_PROTOCOL_RTCP, ndpi_struct, NDPI_LOG_DEBUG, "exclude RTCP.\n"); 49 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RTCP); 50 | } 51 | } 52 | #endif 53 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/sflow.c: -------------------------------------------------------------------------------- 1 | /* 2 | * sflow.c 3 | * 4 | * Copyright (C) 2011-15 - ntop.org 5 | * 6 | * nDPI is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * nDPI is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with nDPI. If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | #ifdef NDPI_PROTOCOL_SFLOW 25 | 26 | static void ndpi_check_sflow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 27 | { 28 | struct ndpi_packet_struct *packet = &flow->packet; 29 | // const u_int8_t *packet_payload = packet->payload; 30 | u_int32_t payload_len = packet->payload_packet_len; 31 | 32 | if((packet->udp != NULL) 33 | && (payload_len >= 24) 34 | /* Version */ 35 | && (packet->payload[0] == 0) && (packet->payload[1] == 0) && (packet->payload[2] == 0) 36 | && ((packet->payload[3] == 2) || (packet->payload[3] == 5))) { 37 | NDPI_LOG(NDPI_PROTOCOL_SFLOW, ndpi_struct, NDPI_LOG_DEBUG, "Found sflow.\n"); 38 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SFLOW, NDPI_REAL_PROTOCOL); 39 | return; 40 | } 41 | } 42 | 43 | void ndpi_search_sflow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 44 | { 45 | NDPI_LOG(NDPI_PROTOCOL_SFLOW, ndpi_struct, NDPI_LOG_DEBUG, "sflow detection...\n"); 46 | ndpi_check_sflow(ndpi_struct, flow); 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/smb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * smb.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_SMB 28 | 29 | static void ndpi_int_smb_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SMB, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | void ndpi_search_smb_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 36 | { 37 | struct ndpi_packet_struct *packet = &flow->packet; 38 | 39 | if(packet && packet->tcp) { 40 | NDPI_LOG(NDPI_PROTOCOL_SMB, ndpi_struct, NDPI_LOG_DEBUG, "search SMB.\n"); 41 | 42 | if (packet->tcp->dest == htons(445) 43 | && packet->payload_packet_len > (32 + 4 + 4) 44 | && (packet->payload_packet_len - 4) == ntohl(get_u_int32_t(packet->payload, 0)) 45 | && get_u_int32_t(packet->payload, 4) == htonl(0xff534d42)) { 46 | NDPI_LOG(NDPI_PROTOCOL_SMB, ndpi_struct, NDPI_LOG_DEBUG, "found SMB.\n"); 47 | ndpi_int_smb_add_connection(ndpi_struct, flow); 48 | return; 49 | 50 | } 51 | } 52 | 53 | NDPI_LOG(NDPI_PROTOCOL_SMB, ndpi_struct, NDPI_LOG_DEBUG, "exclude SMB.\n"); 54 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SMB); 55 | } 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/ssdp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ssdp.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_SSDP 28 | 29 | 30 | static void ndpi_int_ssdp_add_connection(struct ndpi_detection_module_struct 31 | *ndpi_struct, struct ndpi_flow_struct *flow) 32 | { 33 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SSDP, NDPI_REAL_PROTOCOL); 34 | } 35 | 36 | /* this detection also works asymmetrically */ 37 | void ndpi_search_ssdp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 38 | { 39 | struct ndpi_packet_struct *packet = &flow->packet; 40 | 41 | // struct ndpi_id_struct *src=ndpi_struct->src; 42 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 43 | 44 | NDPI_LOG(NDPI_PROTOCOL_SSDP, ndpi_struct, NDPI_LOG_DEBUG, "search ssdp.\n"); 45 | if (packet->udp != NULL) { 46 | 47 | if (packet->payload_packet_len > 100) { 48 | if ((memcmp(packet->payload, "M-SEARCH * HTTP/1.1", 19) == 0) 49 | || memcmp(packet->payload, "NOTIFY * HTTP/1.1", 17) == 0) { 50 | 51 | 52 | NDPI_LOG(NDPI_PROTOCOL_SSDP, ndpi_struct, NDPI_LOG_DEBUG, "found ssdp.\n"); 53 | ndpi_int_ssdp_add_connection(ndpi_struct, flow); 54 | return; 55 | } 56 | 57 | #define SSDP_HTTP "HTTP/1.1 200 OK\r\n" 58 | if(memcmp(packet->payload, SSDP_HTTP, strlen(SSDP_HTTP)) == 0) { 59 | NDPI_LOG(NDPI_PROTOCOL_SSDP, ndpi_struct, NDPI_LOG_DEBUG, "found ssdp.\n"); 60 | ndpi_int_ssdp_add_connection(ndpi_struct, flow); 61 | return; 62 | } 63 | } 64 | } 65 | 66 | NDPI_LOG(NDPI_PROTOCOL_SSDP, ndpi_struct, NDPI_LOG_DEBUG, "ssdp excluded.\n"); 67 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SSDP); 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/ssh.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ssh.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | #ifdef NDPI_PROTOCOL_SSH 28 | 29 | static void ndpi_int_ssh_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_SSH, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | void ndpi_search_ssh_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 36 | { 37 | struct ndpi_packet_struct *packet = &flow->packet; 38 | 39 | // struct ndpi_id_struct *src=ndpi_struct->src; 40 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 41 | 42 | 43 | 44 | if (flow->l4.tcp.ssh_stage == 0) { 45 | if (packet->payload_packet_len > 7 && packet->payload_packet_len < 100 46 | && memcmp(packet->payload, "SSH-", 4) == 0) { 47 | NDPI_LOG(NDPI_PROTOCOL_SSH, ndpi_struct, NDPI_LOG_DEBUG, "ssh stage 0 passed\n"); 48 | flow->l4.tcp.ssh_stage = 1 + packet->packet_direction; 49 | return; 50 | } 51 | } else if (flow->l4.tcp.ssh_stage == (2 - packet->packet_direction)) { 52 | if (packet->payload_packet_len > 7 && packet->payload_packet_len < 100 53 | && memcmp(packet->payload, "SSH-", 4) == 0) { 54 | NDPI_LOG(NDPI_PROTOCOL_SSH, ndpi_struct, NDPI_LOG_DEBUG, "found ssh\n"); 55 | ndpi_int_ssh_add_connection(ndpi_struct, flow); 56 | return; 57 | 58 | } 59 | 60 | 61 | } 62 | 63 | NDPI_LOG(NDPI_PROTOCOL_SSH, ndpi_struct, NDPI_LOG_DEBUG, "excluding ssh at stage %d\n", flow->l4.tcp.ssh_stage); 64 | 65 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SSH); 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/stealthnet.c: -------------------------------------------------------------------------------- 1 | /* 2 | * stealthnet.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | 28 | #ifdef NDPI_PROTOCOL_STEALTHNET 29 | 30 | 31 | static void ndpi_int_stealthnet_add_connection(struct ndpi_detection_module_struct 32 | *ndpi_struct, struct ndpi_flow_struct *flow) 33 | { 34 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_STEALTHNET, NDPI_REAL_PROTOCOL); 35 | } 36 | 37 | void ndpi_search_stealthnet(struct ndpi_detection_module_struct 38 | *ndpi_struct, struct ndpi_flow_struct *flow) 39 | { 40 | struct ndpi_packet_struct *packet = &flow->packet; 41 | 42 | 43 | // struct ndpi_id_struct *src = flow->src; 44 | // struct ndpi_id_struct *dst = flow->dst; 45 | 46 | 47 | if (packet->payload_packet_len > 40 48 | && memcmp(packet->payload, "LARS REGENSBURGER'S FILE SHARING PROTOCOL", 41) == 0) { 49 | NDPI_LOG(NDPI_PROTOCOL_STEALTHNET, ndpi_struct, NDPI_LOG_DEBUG, "found stealthnet\n"); 50 | ndpi_int_stealthnet_add_connection(ndpi_struct, flow); 51 | return; 52 | } 53 | 54 | NDPI_LOG(NDPI_PROTOCOL_STEALTHNET, ndpi_struct, NDPI_LOG_DEBUG, "exclude stealthnet.\n"); 55 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_STEALTHNET); 56 | 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/telegram.c: -------------------------------------------------------------------------------- 1 | /* 2 | * telegram.c 3 | * 4 | * Copyright (C) 2014 by Gianluca Costa xplico.org 5 | * Copyright (C) 2012-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | 28 | #ifdef NDPI_PROTOCOL_TELEGRAM 29 | 30 | static void ndpi_int_telegram_add_connection(struct ndpi_detection_module_struct 31 | *ndpi_struct, struct ndpi_flow_struct *flow) 32 | { 33 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_TELEGRAM, NDPI_REAL_PROTOCOL); 34 | NDPI_LOG(NDPI_PROTOCOL_TELEGRAM, ndpi_struct, NDPI_LOG_TRACE, "TELEGRAM Found.\n"); 35 | } 36 | 37 | 38 | void ndpi_search_telegram(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 39 | { 40 | struct ndpi_packet_struct *packet = &flow->packet; 41 | u_int16_t dport /* , sport */; 42 | 43 | NDPI_LOG(NDPI_PROTOCOL_TELEGRAM, ndpi_struct, NDPI_LOG_TRACE, "TELEGRAM detection...\n"); 44 | 45 | if (packet->payload_packet_len == 0) 46 | return; 47 | if (packet->tcp != NULL) { 48 | if (packet->payload_packet_len > 56) { 49 | dport = ntohs(packet->tcp->dest); 50 | /* sport = ntohs(packet->tcp->source); */ 51 | 52 | if (packet->payload[0] == 0xef && ( 53 | dport == 443 || dport == 80 || dport == 25 54 | )) { 55 | if (packet->payload[1] == 0x7f) { 56 | ndpi_int_telegram_add_connection(ndpi_struct, flow); 57 | } 58 | else if (packet->payload[1]*4 <= packet->payload_packet_len - 1) { 59 | ndpi_int_telegram_add_connection(ndpi_struct, flow); 60 | } 61 | return; 62 | } 63 | } 64 | } 65 | 66 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TELEGRAM); 67 | } 68 | #endif 69 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/twitter.c: -------------------------------------------------------------------------------- 1 | /* 2 | * twitter.c 3 | * 4 | * Copyright (C) 2014 - ntop.org 5 | * 6 | * This file is part of nDPI, an open source deep packet inspection 7 | * library based on the OpenDPI and PACE technology by ipoque GmbH 8 | * 9 | * nDPI is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * nDPI is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with nDPI. If not, see . 21 | * 22 | */ 23 | 24 | 25 | #include "ndpi_protocols.h" 26 | 27 | #ifdef NDPI_SERVICE_TWITTER 28 | 29 | static void ndpi_int_twitter_add_connection(struct ndpi_detection_module_struct 30 | *ndpi_struct, struct ndpi_flow_struct *flow) 31 | { 32 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_SERVICE_TWITTER, NDPI_REAL_PROTOCOL); 33 | } 34 | 35 | 36 | void ndpi_search_twitter(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 37 | { 38 | 39 | /* 40 | Twitter AS34702 41 | 42 | http://bgp.he.net/AS13414 43 | */ 44 | if(flow->packet.iph) { 45 | // IPv4 46 | u_int32_t src = ntohl(flow->packet.iph->saddr); 47 | u_int32_t dst = ntohl(flow->packet.iph->daddr); 48 | 49 | if(ndpi_ips_match(src, dst, 0xC0854C00, 22) /* 192.133.76.0/22 */ 50 | || ndpi_ips_match(src, dst, 0xC7109C00, 22) /* 199.16.156.0/22 */ 51 | || ndpi_ips_match(src, dst, 0xC73B9400, 22) /* 199.59.148.0/22 */ 52 | || ndpi_ips_match(src, dst, 0xC7603A00, 23) /* 199.96.58.0/23 */ 53 | || ndpi_ips_match(src, dst, 0xC7603E00, 23) /* 199.96.62.0/23 */ 54 | ) { 55 | ndpi_int_twitter_add_connection(ndpi_struct, flow); 56 | return; 57 | } 58 | 59 | } 60 | 61 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_SERVICE_TWITTER); 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/vhua.c: -------------------------------------------------------------------------------- 1 | /* 2 | * vhua.c 3 | * 4 | * Copyright (C) 2011-15 - ntop.org 5 | * 6 | * nDPI is free software: you can vhuatribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * nDPI is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with nDPI. If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | /* 25 | http://www.vhua.com 26 | 27 | Skype-like Chinese phone protocol 28 | 29 | */ 30 | 31 | #ifdef NDPI_PROTOCOL_VHUA 32 | 33 | static void ndpi_int_vhua_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { 34 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VHUA, NDPI_REAL_PROTOCOL); 35 | NDPI_LOG(NDPI_PROTOCOL_VHUA, ndpi_struct, NDPI_LOG_TRACE, "VHUA Found.\n"); 36 | } 37 | 38 | 39 | static void ndpi_check_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { 40 | struct ndpi_packet_struct *packet = &flow->packet; 41 | u_int32_t payload_len = packet->payload_packet_len; 42 | u_char p0[] = { 0x05, 0x14, 0x3a, 0x05, 0x08, 0xf8, 0xa1, 0xb1, 0x03 }; 43 | 44 | if(payload_len == 0) return; /* Shouldn't happen */ 45 | 46 | /* Break after 3 packets. */ 47 | if((flow->packet_counter > 3) 48 | || (packet->udp == NULL) 49 | || (packet->payload_packet_len < sizeof(p0))) { 50 | NDPI_LOG(NDPI_PROTOCOL_VHUA, ndpi_struct, NDPI_LOG_TRACE, "Exclude VHUA.\n"); 51 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VHUA); 52 | } else if(memcmp(packet->payload, p0, sizeof(p0)) == 0) { 53 | ndpi_int_vhua_add_connection(ndpi_struct, flow); 54 | } 55 | } 56 | 57 | void ndpi_search_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { 58 | struct ndpi_packet_struct *packet = &flow->packet; 59 | 60 | NDPI_LOG(NDPI_PROTOCOL_VHUA, ndpi_struct, NDPI_LOG_TRACE, "VHUA detection...\n"); 61 | 62 | /* skip marked packets */ 63 | if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_VHUA) { 64 | ndpi_check_vhua(ndpi_struct, flow); 65 | } 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/viber.c: -------------------------------------------------------------------------------- 1 | /* 2 | * viber.c 3 | * 4 | * Copyright (C) 2013 Remy Mudingay 5 | * Copyright (C) 2013 - 2014 ntop.org 6 | * 7 | * This module is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This module is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License. 18 | * If not, see . 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | #ifdef NDPI_PROTOCOL_VIBER 25 | 26 | void ndpi_search_viber(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 27 | { 28 | struct ndpi_packet_struct *packet = &flow->packet; 29 | 30 | NDPI_LOG(NDPI_PROTOCOL_VIBER, ndpi_struct, NDPI_LOG_DEBUG, "search for VIBER.\n"); 31 | 32 | if(packet->udp != NULL) { 33 | NDPI_LOG(NDPI_PROTOCOL_VIBER, ndpi_struct, NDPI_LOG_DEBUG, "calculating dport over udp.\n"); 34 | 35 | if((packet->payload_packet_len == 12 && packet->payload[2] == 0x03 && packet->payload[3] == 0x00) 36 | || (packet->payload_packet_len == 20 && packet->payload[2] == 0x09 && packet->payload[3] == 0x00) 37 | || ((packet->payload_packet_len < 135) && (packet->payload[0] == 0x11))) { 38 | NDPI_LOG(NDPI_PROTOCOL_VIBER, ndpi_struct, NDPI_LOG_DEBUG, "found VIBER.\n"); 39 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VIBER, NDPI_REAL_PROTOCOL); 40 | return; 41 | } 42 | } 43 | 44 | NDPI_LOG(NDPI_PROTOCOL_VIBER, ndpi_struct, NDPI_LOG_DEBUG, "exclude VIBER.\n"); 45 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VIBER); 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/vmware.c: -------------------------------------------------------------------------------- 1 | /* 2 | * vmware.c 3 | * 4 | * Copyright (C) 2011-15 - ntop.org 5 | * 6 | * nDPI is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * nDPI is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with nDPI. If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_api.h" 23 | 24 | #ifdef NDPI_PROTOCOL_VMWARE 25 | 26 | 27 | void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 28 | { 29 | struct ndpi_packet_struct *packet = &flow->packet; 30 | 31 | /* Check whether this is an VMWARE flow */ 32 | if((packet->payload_packet_len == 66) 33 | && (ntohs(packet->udp->dest) == 902) 34 | && ((packet->payload[0] & 0xFF) == 0xA4)) { 35 | NDPI_LOG(NDPI_PROTOCOL_VMWARE, ndpi_struct, NDPI_LOG_DEBUG, "Found vmware.\n"); 36 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VMWARE, NDPI_REAL_PROTOCOL); 37 | } else { 38 | NDPI_LOG(NDPI_PROTOCOL_VMWARE, ndpi_struct, NDPI_LOG_DEBUG, "exclude vmware.\n"); 39 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VMWARE); 40 | } 41 | } 42 | 43 | 44 | #endif /* NDPI_PROTOCOL_VMWARE */ 45 | 46 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/vnc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * vnc.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | #include "ndpi_protocols.h" 27 | 28 | #ifdef NDPI_PROTOCOL_VNC 29 | 30 | static void ndpi_int_vnc_add_connection(struct ndpi_detection_module_struct 31 | *ndpi_struct, struct ndpi_flow_struct *flow) 32 | { 33 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_VNC, NDPI_REAL_PROTOCOL); 34 | } 35 | 36 | /* 37 | return 0 if nothing has been detected 38 | return 1 if it is a http packet 39 | */ 40 | 41 | void ndpi_search_vnc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 42 | { 43 | struct ndpi_packet_struct *packet = &flow->packet; 44 | 45 | // struct ndpi_id_struct *src=ndpi_struct->src; 46 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 47 | 48 | 49 | if (flow->l4.tcp.vnc_stage == 0) { 50 | if (packet->payload_packet_len == 12 51 | && memcmp(packet->payload, "RFB 003.00", 10) == 0 && packet->payload[11] == 0x0a) { 52 | NDPI_LOG(NDPI_PROTOCOL_VNC, ndpi_struct, NDPI_LOG_DEBUG, "reached vnc stage one\n"); 53 | flow->l4.tcp.vnc_stage = 1 + packet->packet_direction; 54 | return; 55 | } 56 | } else if (flow->l4.tcp.vnc_stage == 2 - packet->packet_direction) { 57 | if (packet->payload_packet_len == 12 58 | && memcmp(packet->payload, "RFB 003.00", 10) == 0 && packet->payload[11] == 0x0a) { 59 | NDPI_LOG(NDPI_PROTOCOL_VNC, ndpi_struct, NDPI_LOG_DEBUG, "found vnc\n"); 60 | ndpi_int_vnc_add_connection(ndpi_struct, flow); 61 | return; 62 | } 63 | } 64 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VNC); 65 | 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/whoisdas.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ssh.c 3 | * 4 | * Copyright (C) 2013 - ntop.org 5 | * 6 | * nDPI is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * nDPI is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with nDPI. If not, see . 18 | * 19 | */ 20 | 21 | 22 | #include "ndpi_protocols.h" 23 | #ifdef NDPI_PROTOCOL_WHOIS_DAS 24 | 25 | void ndpi_search_whois_das(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 26 | { 27 | struct ndpi_packet_struct *packet = &flow->packet; 28 | u_int16_t sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest); 29 | 30 | if ((packet->tcp != NULL) 31 | && ( 32 | ((sport == 43) || (dport == 43)) 33 | || 34 | ((sport == 4343) || (dport == 4343)) 35 | ) 36 | ) { 37 | if(packet->payload_packet_len > 0) { 38 | u_int max_len = sizeof(flow->host_server_name)-1; 39 | u_int i, j; 40 | 41 | for(i=strlen((const char *)flow->host_server_name), j=0; (ipayload_packet_len); i++, j++) { 42 | if((packet->payload[j] == '\n') || (packet->payload[j] == '\r')) break; 43 | 44 | flow->host_server_name[i] = packet->payload[j]; 45 | } 46 | 47 | flow->host_server_name[i] = '\0'; 48 | flow->server_id = ((sport == 43) || (sport == 4343)) ? flow->src : flow->dst; 49 | 50 | NDPI_LOG(NDPI_PROTOCOL_WHOIS_DAS, ndpi_struct, NDPI_LOG_DEBUG, "[WHOIS/DAS] %s\n", flow->host_server_name); 51 | } 52 | 53 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_WHOIS_DAS, NDPI_REAL_PROTOCOL); 54 | } else { 55 | NDPI_LOG(NDPI_PROTOCOL_WHOIS_DAS, ndpi_struct, NDPI_LOG_TRACE, "WHOIS Excluded.\n"); 56 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_WHOIS_DAS); 57 | } 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/protocols/world_of_kung_fu.c: -------------------------------------------------------------------------------- 1 | /* 2 | * world_of_kung_fu.c 3 | * 4 | * Copyright (C) 2009-2011 by ipoque GmbH 5 | * Copyright (C) 2011-15 - ntop.org 6 | * 7 | * This file is part of nDPI, an open source deep packet inspection 8 | * library based on the OpenDPI and PACE technology by ipoque GmbH 9 | * 10 | * nDPI is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU Lesser General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * nDPI is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU Lesser General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU Lesser General Public License 21 | * along with nDPI. If not, see . 22 | * 23 | */ 24 | 25 | 26 | 27 | /* include files */ 28 | #include "ndpi_protocols.h" 29 | #ifdef NDPI_PROTOCOL_WORLD_OF_KUNG_FU 30 | 31 | static void ndpi_int_world_of_kung_fu_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 32 | { 33 | ndpi_int_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_WORLD_OF_KUNG_FU, NDPI_REAL_PROTOCOL); 34 | } 35 | 36 | void ndpi_search_world_of_kung_fu(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) 37 | { 38 | struct ndpi_packet_struct *packet = &flow->packet; 39 | 40 | // struct ndpi_id_struct *src=ndpi_struct->src; 41 | // struct ndpi_id_struct *dst=ndpi_struct->dst; 42 | 43 | NDPI_LOG(NDPI_PROTOCOL_WORLD_OF_KUNG_FU, ndpi_struct, NDPI_LOG_DEBUG, "search world_of_kung_fu.\n"); 44 | 45 | if ((packet->payload_packet_len == 16) 46 | && ntohl(get_u_int32_t(packet->payload, 0)) == 0x0c000000 && ntohl(get_u_int32_t(packet->payload, 4)) == 0xd2000c00 47 | && (packet->payload[9] 48 | == 0x16) && ntohs(get_u_int16_t(packet->payload, 10)) == 0x0000 && ntohs(get_u_int16_t(packet->payload, 14)) == 0x0000) { 49 | NDPI_LOG(NDPI_PROTOCOL_WORLD_OF_KUNG_FU, ndpi_struct, NDPI_LOG_DEBUG, "detected world_of_kung_fu.\n"); 50 | ndpi_int_world_of_kung_fu_add_connection(ndpi_struct, flow); 51 | return; 52 | } 53 | 54 | NDPI_LOG(NDPI_PROTOCOL_WORLD_OF_KUNG_FU, ndpi_struct, NDPI_LOG_DEBUG, "exclude world_of_kung_fu.\n"); 55 | NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_WORLD_OF_KUNG_FU); 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/include/ndpi_patricia.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireflyc/ndpi-demo/b9cf6fc8ed6ebe57bb14339362a0b935512d3428/deps/nDPI-1.6/src/lib/third_party/include/ndpi_patricia.h -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/include/node.h: -------------------------------------------------------------------------------- 1 | /* 2 | * node.h: automata node header file 3 | * This file is part of multifast. 4 | * 5 | Copyright 2010-2012 Kamiar Kanani 6 | 7 | multifast is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU Lesser General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | multifast is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public License 18 | along with multifast. If not, see . 19 | */ 20 | 21 | #ifndef _NODE_H_ 22 | #define _NODE_H_ 23 | 24 | #include "actypes.h" 25 | 26 | /* Forward Declaration */ 27 | struct edge; 28 | 29 | /* automata node */ 30 | typedef struct ac_node 31 | { 32 | int id; /* Node ID : for debugging purpose */ 33 | short int final; /* 0: no ; 1: yes, it is a final node */ 34 | struct ac_node * failure_node; /* The failure node of this node */ 35 | unsigned short depth; /* depth: distance between this node and the root */ 36 | 37 | /* Matched patterns */ 38 | AC_PATTERN_t * matched_patterns; /* Array of matched patterns */ 39 | unsigned short matched_patterns_num; /* Number of matched patterns at this node */ 40 | unsigned short matched_patterns_max; /* Max capacity of allocated memory for matched_patterns */ 41 | 42 | /* Outgoing Edges */ 43 | struct edge * outgoing; /* Array of outgoing edges */ 44 | unsigned short outgoing_degree; /* Number of outgoing edges */ 45 | unsigned short outgoing_max; /* Max capacity of allocated memory for outgoing */ 46 | } AC_NODE_t; 47 | 48 | /* The Edge of the Node */ 49 | struct edge 50 | { 51 | AC_ALPHABET_t alpha; /* Edge alpha */ 52 | struct ac_node * next; /* Target of the edge */ 53 | }; 54 | 55 | 56 | AC_NODE_t * node_create (void); 57 | AC_NODE_t * node_create_next (AC_NODE_t * thiz, AC_ALPHABET_t alpha); 58 | void node_register_matchstr (AC_NODE_t * thiz, AC_PATTERN_t * str); 59 | void node_register_outgoing (AC_NODE_t * thiz, AC_NODE_t * next, AC_ALPHABET_t alpha); 60 | AC_NODE_t * node_find_next (AC_NODE_t * thiz, AC_ALPHABET_t alpha); 61 | AC_NODE_t * node_findbs_next (AC_NODE_t * thiz, AC_ALPHABET_t alpha); 62 | void node_release (AC_NODE_t * thiz); 63 | void node_assign_id (AC_NODE_t * thiz); 64 | void node_sort_edges (AC_NODE_t * thiz); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/include/sort.h: -------------------------------------------------------------------------------- 1 | /* This is a function ported from the Linux kernel lib/sort.c */ 2 | 3 | void sort(void *base, size_t num, size_t len, 4 | int (*cmp_func)(const void *, const void *), 5 | void (*swap_func)(void *, void *, int size)); 6 | 7 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/src/.deps/.dirstamp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireflyc/ndpi-demo/b9cf6fc8ed6ebe57bb14339362a0b935512d3428/deps/nDPI-1.6/src/lib/third_party/src/.deps/.dirstamp -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/src/.dirstamp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireflyc/ndpi-demo/b9cf6fc8ed6ebe57bb14339362a0b935512d3428/deps/nDPI-1.6/src/lib/third_party/src/.dirstamp -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/src/libndpi_la-ahocorasick.lo: -------------------------------------------------------------------------------- 1 | # third_party/src/libndpi_la-ahocorasick.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-ahocorasick.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-ahocorasick.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/src/libndpi_la-node.lo: -------------------------------------------------------------------------------- 1 | # third_party/src/libndpi_la-node.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-node.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-node.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/nDPI-1.6/src/lib/third_party/src/libndpi_la-sort.lo: -------------------------------------------------------------------------------- 1 | # third_party/src/libndpi_la-sort.lo - a libtool object file 2 | # Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-0.1 3 | # 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Name of the PIC object. 8 | pic_object='.libs/libndpi_la-sort.o' 9 | 10 | # Name of the non-PIC object 11 | non_pic_object='libndpi_la-sort.o' 12 | 13 | -------------------------------------------------------------------------------- /deps/zlog/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | aux_source_directory(./src DIR_LIB_SRCS) 2 | add_library(zlog ${DIR_LIB_SRCS}) -------------------------------------------------------------------------------- /deps/zlog/src/buf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_buf_h 10 | #define __zlog_buf_h 11 | 12 | /* buf, is a dynamic expand buffer for one single log, 13 | * as one single log will interlace if use multiple write() to file. 14 | * and buf is always keep in a thread, to make each thread has its 15 | * own buffer to avoid lock. 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | typedef struct zlog_buf_s { 22 | char *start; 23 | char *tail; 24 | char *end; 25 | char *end_plus_1; 26 | 27 | size_t size_min; 28 | size_t size_max; 29 | size_t size_real; 30 | 31 | char truncate_str[MAXLEN_PATH + 1]; 32 | size_t truncate_str_len; 33 | } zlog_buf_t; 34 | 35 | 36 | zlog_buf_t *zlog_buf_new(size_t min, size_t max, const char *truncate_str); 37 | void zlog_buf_del(zlog_buf_t * a_buf); 38 | void zlog_buf_profile(zlog_buf_t * a_buf, int flag); 39 | 40 | int zlog_buf_vprintf(zlog_buf_t * a_buf, const char *format, va_list args); 41 | int zlog_buf_append(zlog_buf_t * a_buf, const char *str, size_t str_len); 42 | int zlog_buf_adjust_append(zlog_buf_t * a_buf, const char *str, size_t str_len, 43 | int left_adjust, size_t in_width, size_t out_width); 44 | int zlog_buf_printf_dec32(zlog_buf_t * a_buf, uint32_t ui32, int width); 45 | int zlog_buf_printf_dec64(zlog_buf_t * a_buf, uint64_t ui64, int width); 46 | int zlog_buf_printf_hex(zlog_buf_t * a_buf, uint32_t ui32, int width); 47 | 48 | #define zlog_buf_restart(a_buf) do { \ 49 | a_buf->tail = a_buf->start; \ 50 | } while(0) 51 | 52 | #define zlog_buf_len(a_buf) (a_buf->tail - a_buf->start) 53 | #define zlog_buf_str(a_buf) (a_buf->start) 54 | #define zlog_buf_seal(a_buf) do {*(a_buf)->tail = '\0';} while (0) 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /deps/zlog/src/category.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_category_h 10 | #define __zlog_category_h 11 | 12 | #include "zc_defs.h" 13 | #include "thread.h" 14 | 15 | 16 | 17 | zlog_category_t *zlog_category_new(const char *name, zc_arraylist_t * rules); 18 | void zlog_category_del(zlog_category_t * a_category); 19 | void zlog_category_profile(zlog_category_t *a_category, int flag); 20 | 21 | int zlog_category_update_rules(zlog_category_t * a_category, zc_arraylist_t * new_rules); 22 | void zlog_category_commit_rules(zlog_category_t * a_category); 23 | void zlog_category_rollback_rules(zlog_category_t * a_category); 24 | 25 | int zlog_category_output(zlog_category_t * a_category, zlog_thread_t * a_thread); 26 | 27 | #define zlog_category_needless_level(a_category, lv) \ 28 | !((a_category->level_bitmap[lv/8] >> (7 - lv % 8)) & 0x01) 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /deps/zlog/src/category_table.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_category_table_h 10 | #define __zlog_category_table_h 11 | 12 | #include "zc_defs.h" 13 | #include "category.h" 14 | 15 | zc_hashtable_t *zlog_category_table_new(void); 16 | void zlog_category_table_del(zc_hashtable_t * categories); 17 | void zlog_category_table_profile(zc_hashtable_t * categories, int flag); 18 | 19 | /* if none, create new and return */ 20 | zlog_category_t *zlog_category_table_fetch_category( 21 | zc_hashtable_t * categories, 22 | const char *category_name, zc_arraylist_t * rules); 23 | 24 | int zlog_category_table_update_rules(zc_hashtable_t * categories, zc_arraylist_t * new_rules); 25 | void zlog_category_table_commit_rules(zc_hashtable_t * categories); 26 | void zlog_category_table_rollback_rules(zc_hashtable_t * categories); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /deps/zlog/src/conf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_conf_h 10 | #define __zlog_conf_h 11 | 12 | #include "zc_defs.h" 13 | #include "format.h" 14 | #include "rotater.h" 15 | 16 | typedef struct zlog_conf_s { 17 | char file[MAXLEN_PATH + 1]; 18 | char mtime[20 + 1]; 19 | 20 | int strict_init; 21 | size_t buf_size_min; 22 | size_t buf_size_max; 23 | 24 | char rotate_lock_file[MAXLEN_CFG_LINE + 1]; 25 | zlog_rotater_t *rotater; 26 | 27 | char default_format_line[MAXLEN_CFG_LINE + 1]; 28 | zlog_format_t *default_format; 29 | 30 | unsigned int file_perms; 31 | size_t fsync_period; 32 | size_t reload_conf_period; 33 | 34 | zc_arraylist_t *levels; 35 | zc_arraylist_t *formats; 36 | zc_arraylist_t *rules; 37 | int time_cache_count; 38 | } zlog_conf_t; 39 | 40 | extern zlog_conf_t * zlog_env_conf; 41 | 42 | zlog_conf_t *zlog_conf_new(const char *confpath); 43 | void zlog_conf_del(zlog_conf_t * a_conf); 44 | void zlog_conf_profile(zlog_conf_t * a_conf, int flag); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /deps/zlog/src/event.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_event_h 10 | #define __zlog_event_h 11 | 12 | #include /* for pid_t */ 13 | #include /* for struct timeval */ 14 | #include /* for pthread_t */ 15 | #include /* for va_list */ 16 | #include "zc_defs.h" 17 | 18 | typedef enum { 19 | ZLOG_FMT = 0, 20 | ZLOG_HEX = 1, 21 | } zlog_event_cmd; 22 | 23 | typedef struct zlog_time_cache_s { 24 | char str[MAXLEN_CFG_LINE + 1]; 25 | size_t len; 26 | time_t sec; 27 | } zlog_time_cache_t; 28 | 29 | typedef struct { 30 | char *category_name; 31 | size_t category_name_len; 32 | char host_name[256 + 1]; 33 | size_t host_name_len; 34 | 35 | const char *file; 36 | size_t file_len; 37 | const char *func; 38 | size_t func_len; 39 | long line; 40 | int level; 41 | 42 | const void *hex_buf; 43 | size_t hex_buf_len; 44 | const char *str_format; 45 | va_list str_args; 46 | zlog_event_cmd generate_cmd; 47 | 48 | struct timeval time_stamp; 49 | 50 | time_t time_local_sec; 51 | struct tm time_local; 52 | 53 | zlog_time_cache_t *time_caches; 54 | int time_cache_count; 55 | 56 | pid_t pid; 57 | pid_t last_pid; 58 | char pid_str[30 + 1]; 59 | size_t pid_str_len; 60 | 61 | pthread_t tid; 62 | char tid_str[30 + 1]; 63 | size_t tid_str_len; 64 | 65 | char tid_hex_str[30 + 1]; 66 | size_t tid_hex_str_len; 67 | } zlog_event_t; 68 | 69 | 70 | zlog_event_t *zlog_event_new(int time_cache_count); 71 | void zlog_event_del(zlog_event_t * a_event); 72 | void zlog_event_profile(zlog_event_t * a_event, int flag); 73 | 74 | void zlog_event_set_fmt(zlog_event_t * a_event, 75 | char *category_name, size_t category_name_len, 76 | const char *file, size_t file_len, const char *func, size_t func_len, long line, int level, 77 | const char *str_format, va_list str_args); 78 | 79 | void zlog_event_set_hex(zlog_event_t * a_event, 80 | char *category_name, size_t category_name_len, 81 | const char *file, size_t file_len, const char *func, size_t func_len, long line, int level, 82 | const void *hex_buf, size_t hex_buf_len); 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /deps/zlog/src/fmacros.h: -------------------------------------------------------------------------------- 1 | #ifndef __zlog_fmacro_h 2 | #define __zlog_fmacro_h 3 | 4 | #define _BSD_SOURCE 5 | 6 | #if defined(__linux__) || defined(__OpenBSD__) || defined(_AIX) 7 | #ifndef _XOPEN_SOURCE 8 | #define _XOPEN_SOURCE 700 9 | #endif 10 | #ifndef _XOPEN_SOURCE_EXTENDED 11 | #define _XOPEN_SOURCE_EXTENDED 12 | #endif 13 | #else 14 | #define _XOPEN_SOURCE 15 | #endif 16 | 17 | #define _LARGEFILE_SOURCE 18 | #define _FILE_OFFSET_BITS 64 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /deps/zlog/src/format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_format_h 10 | #define __zlog_format_h 11 | 12 | #include "thread.h" 13 | #include "zc_defs.h" 14 | 15 | typedef struct zlog_format_s zlog_format_t; 16 | 17 | struct zlog_format_s { 18 | char name[MAXLEN_CFG_LINE + 1]; 19 | char pattern[MAXLEN_CFG_LINE + 1]; 20 | zc_arraylist_t *pattern_specs; 21 | }; 22 | 23 | zlog_format_t *zlog_format_new(char *line, int * time_cache_count); 24 | void zlog_format_del(zlog_format_t * a_format); 25 | void zlog_format_profile(zlog_format_t * a_format, int flag); 26 | 27 | int zlog_format_gen_msg(zlog_format_t * a_format, zlog_thread_t * a_thread); 28 | 29 | #define zlog_format_has_name(a_format, fname) \ 30 | STRCMP(a_format->name, ==, fname) 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /deps/zlog/src/level.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_level_h 10 | #define __zlog_level_h 11 | 12 | #include "zc_defs.h" 13 | 14 | typedef struct zlog_level_s { 15 | int int_level; 16 | char str_uppercase[MAXLEN_PATH + 1]; 17 | char str_lowercase[MAXLEN_PATH + 1]; 18 | size_t str_len; 19 | int syslog_level; 20 | } zlog_level_t; 21 | 22 | zlog_level_t *zlog_level_new(char *line); 23 | void zlog_level_del(zlog_level_t *a_level); 24 | void zlog_level_profile(zlog_level_t *a_level, int flag); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /deps/zlog/src/level_list.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_level_list_h 10 | #define __zlog_level_list_h 11 | 12 | #include "zc_defs.h" 13 | #include "level.h" 14 | 15 | zc_arraylist_t *zlog_level_list_new(void); 16 | void zlog_level_list_del(zc_arraylist_t *levels); 17 | void zlog_level_list_profile(zc_arraylist_t *levels, int flag); 18 | 19 | /* conf init use, slow */ 20 | /* if l is wrong or str=="", return -1 */ 21 | int zlog_level_list_set(zc_arraylist_t *levels, char *line); 22 | 23 | /* spec ouput use, fast */ 24 | /* rule output use, fast */ 25 | /* if not found, return levels[254] */ 26 | zlog_level_t *zlog_level_list_get(zc_arraylist_t *levels, int l); 27 | 28 | /* rule init use, slow */ 29 | /* if not found, return -1 */ 30 | int zlog_level_list_atoi(zc_arraylist_t *levels, char *str); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /deps/zlog/src/mdc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_mdc_h 10 | #define __zlog_mdc_h 11 | 12 | #include "zc_defs.h" 13 | 14 | typedef struct zlog_mdc_s zlog_mdc_t; 15 | struct zlog_mdc_s { 16 | zc_hashtable_t *tab; 17 | }; 18 | 19 | zlog_mdc_t *zlog_mdc_new(void); 20 | void zlog_mdc_del(zlog_mdc_t * a_mdc); 21 | void zlog_mdc_profile(zlog_mdc_t *a_mdc, int flag); 22 | 23 | void zlog_mdc_clean(zlog_mdc_t * a_mdc); 24 | int zlog_mdc_put(zlog_mdc_t * a_mdc, const char *key, const char *value); 25 | char *zlog_mdc_get(zlog_mdc_t * a_mdc, const char *key); 26 | void zlog_mdc_remove(zlog_mdc_t * a_mdc, const char *key); 27 | 28 | typedef struct zlog_mdc_kv_s { 29 | char key[MAXLEN_PATH + 1]; 30 | char value[MAXLEN_PATH + 1]; 31 | size_t value_len; 32 | } zlog_mdc_kv_t; 33 | 34 | zlog_mdc_kv_t *zlog_mdc_get_kv(zlog_mdc_t * a_mdc, const char *key); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /deps/zlog/src/record.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | #include "errno.h" 9 | #include "zc_defs.h" 10 | #include "record.h" 11 | 12 | void zlog_record_profile(zlog_record_t *a_record, int flag) 13 | { 14 | zc_assert(a_record,); 15 | zc_profile(flag, "--record:[%p][%s:%p]--", a_record, a_record->name, a_record->output); 16 | return; 17 | } 18 | 19 | void zlog_record_del(zlog_record_t *a_record) 20 | { 21 | zc_assert(a_record,); 22 | free(a_record); 23 | zc_debug("zlog_record_del[%p]", a_record); 24 | return; 25 | } 26 | 27 | zlog_record_t *zlog_record_new(const char *name, zlog_record_fn output) 28 | { 29 | zlog_record_t *a_record; 30 | 31 | zc_assert(name, NULL); 32 | zc_assert(output, NULL); 33 | 34 | a_record = calloc(1, sizeof(zlog_record_t)); 35 | if (!a_record) { 36 | zc_error("calloc fail, errno[%d]", errno); 37 | return NULL; 38 | } 39 | 40 | if (strlen(name) > sizeof(a_record->name) - 1) { 41 | zc_error("name[%s] is too long", name); 42 | goto err; 43 | } 44 | 45 | strcpy(a_record->name, name); 46 | a_record->output = output; 47 | 48 | zlog_record_profile(a_record, ZC_DEBUG); 49 | return a_record; 50 | err: 51 | zlog_record_del(a_record); 52 | return NULL; 53 | } 54 | -------------------------------------------------------------------------------- /deps/zlog/src/record.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_record_h 10 | #define __zlog_record_h 11 | 12 | #include "zc_defs.h" 13 | 14 | /* record is user-defined output function and it's name from configure file */ 15 | typedef struct zlog_msg_s { 16 | char *buf; 17 | size_t len; 18 | char *path; 19 | } zlog_msg_t; /* 3 of this first, see need thread or not later */ 20 | 21 | typedef int (*zlog_record_fn)(zlog_msg_t * msg); 22 | 23 | typedef struct zlog_record_s { 24 | char name[MAXLEN_PATH + 1]; 25 | zlog_record_fn output; 26 | } zlog_record_t; 27 | 28 | zlog_record_t *zlog_record_new(const char *name, zlog_record_fn output); 29 | void zlog_record_del(zlog_record_t *a_record); 30 | void zlog_record_profile(zlog_record_t *a_record, int flag); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /deps/zlog/src/record_table.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #include "zc_defs.h" 14 | #include "record_table.h" 15 | 16 | void zlog_record_table_profile(zc_hashtable_t * records, int flag) 17 | { 18 | zc_hashtable_entry_t *a_entry; 19 | zlog_record_t *a_record; 20 | 21 | zc_assert(records,); 22 | zc_profile(flag, "-record_table[%p]-", records); 23 | zc_hashtable_foreach(records, a_entry) { 24 | a_record = (zlog_record_t *) a_entry->value; 25 | zlog_record_profile(a_record, flag); 26 | } 27 | return; 28 | } 29 | 30 | /*******************************************************************************/ 31 | 32 | void zlog_record_table_del(zc_hashtable_t * records) 33 | { 34 | zc_assert(records,); 35 | zc_hashtable_del(records); 36 | zc_debug("zlog_record_table_del[%p]", records); 37 | return; 38 | } 39 | 40 | zc_hashtable_t *zlog_record_table_new(void) 41 | { 42 | zc_hashtable_t *records; 43 | 44 | records = zc_hashtable_new(20, 45 | (zc_hashtable_hash_fn) zc_hashtable_str_hash, 46 | (zc_hashtable_equal_fn) zc_hashtable_str_equal, 47 | NULL, (zc_hashtable_del_fn) zlog_record_del); 48 | if (!records) { 49 | zc_error("zc_hashtable_new fail"); 50 | return NULL; 51 | } else { 52 | zlog_record_table_profile(records, ZC_DEBUG); 53 | return records; 54 | } 55 | } 56 | /*******************************************************************************/ 57 | -------------------------------------------------------------------------------- /deps/zlog/src/record_table.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_record_table_h 10 | #define __zlog_record_table_h 11 | 12 | #include "zc_defs.h" 13 | #include "record.h" 14 | 15 | zc_hashtable_t *zlog_record_table_new(void); 16 | void zlog_record_table_del(zc_hashtable_t * records); 17 | void zlog_record_table_profile(zc_hashtable_t * records, int flag); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /deps/zlog/src/rotater.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_rotater_h 10 | #define __zlog_rotater_h 11 | 12 | #include "zc_defs.h" 13 | 14 | typedef struct zlog_rotater_s { 15 | pthread_mutex_t lock_mutex; 16 | char *lock_file; 17 | int lock_fd; 18 | 19 | /* single-use members */ 20 | char *base_path; /* aa.log */ 21 | char *archive_path; /* aa.#5i.log */ 22 | char glob_path[MAXLEN_PATH + 1]; /* aa.*.log */ 23 | size_t num_start_len; /* 3, offset to glob_path */ 24 | size_t num_end_len; /* 6, offset to glob_path */ 25 | int num_width; /* 5 */ 26 | int mv_type; /* ROLLING or SEQUENCE */ 27 | int max_count; 28 | zc_arraylist_t *files; 29 | } zlog_rotater_t; 30 | 31 | zlog_rotater_t *zlog_rotater_new(char *lock_file); 32 | void zlog_rotater_del(zlog_rotater_t *a_rotater); 33 | 34 | /* 35 | * return 36 | * -1 fail 37 | * 0 no rotate, or rotate and success 38 | */ 39 | int zlog_rotater_rotate(zlog_rotater_t *a_rotater, 40 | char *base_path, size_t msg_len, 41 | char *archive_path, long archive_max_size, int archive_max_count); 42 | 43 | void zlog_rotater_profile(zlog_rotater_t *a_rotater, int flag); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /deps/zlog/src/rules.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | /** 10 | * @file rule.h 11 | * @brief rule decide to output in format by category & level 12 | */ 13 | 14 | #ifndef __zlog_rule_h 15 | #define __zlog_rule_h 16 | 17 | #include 18 | #include 19 | 20 | #include "zc_defs.h" 21 | #include "format.h" 22 | #include "thread.h" 23 | #include "rotater.h" 24 | #include "record.h" 25 | 26 | typedef struct zlog_rule_s zlog_rule_t; 27 | 28 | typedef int (*zlog_rule_output_fn) (zlog_rule_t * a_rule, zlog_thread_t * a_thread); 29 | 30 | struct zlog_rule_s { 31 | char category[MAXLEN_CFG_LINE + 1]; 32 | char compare_char; 33 | /* 34 | * [*] log all level 35 | * [.] log level >= rule level, default 36 | * [=] log level == rule level 37 | * [!] log level != rule level 38 | */ 39 | int level; 40 | unsigned char level_bitmap[32]; /* for category determine whether ouput or not */ 41 | 42 | unsigned int file_perms; 43 | int file_open_flags; 44 | 45 | char file_path[MAXLEN_PATH + 1]; 46 | zc_arraylist_t *dynamic_specs; 47 | int static_fd; 48 | dev_t static_dev; 49 | ino_t static_ino; 50 | 51 | long archive_max_size; 52 | int archive_max_count; 53 | char archive_path[MAXLEN_PATH + 1]; 54 | zc_arraylist_t *archive_specs; 55 | 56 | FILE *pipe_fp; 57 | int pipe_fd; 58 | 59 | size_t fsync_period; 60 | size_t fsync_count; 61 | 62 | zc_arraylist_t *levels; 63 | int syslog_facility; 64 | 65 | zlog_format_t *format; 66 | zlog_rule_output_fn output; 67 | 68 | char record_name[MAXLEN_PATH + 1]; 69 | char record_path[MAXLEN_PATH + 1]; 70 | zlog_record_fn record_func; 71 | }; 72 | 73 | zlog_rule_t *zlog_rule_new(char * line, 74 | zc_arraylist_t * levels, 75 | zlog_format_t * default_format, 76 | zc_arraylist_t * formats, 77 | unsigned int file_perms, 78 | size_t fsync_period, 79 | int * time_cache_count); 80 | 81 | void zlog_rule_del(zlog_rule_t * a_rule); 82 | void zlog_rule_profile(zlog_rule_t * a_rule, int flag); 83 | int zlog_rule_match_category(zlog_rule_t * a_rule, char *category); 84 | int zlog_rule_is_wastebin(zlog_rule_t * a_rule); 85 | int zlog_rule_set_record(zlog_rule_t * a_rule, zc_hashtable_t *records); 86 | int zlog_rule_output(zlog_rule_t * a_rule, zlog_thread_t * a_thread); 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /deps/zlog/src/spec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_spec_h 10 | #define __zlog_spec_h 11 | 12 | #include "event.h" 13 | #include "buf.h" 14 | #include "thread.h" 15 | 16 | typedef struct zlog_spec_s zlog_spec_t; 17 | 18 | /* write buf, according to each spec's Conversion Characters */ 19 | typedef int (*zlog_spec_write_fn) (zlog_spec_t * a_spec, 20 | zlog_thread_t * a_thread, 21 | zlog_buf_t * a_buf); 22 | 23 | /* gen a_thread->msg or gen a_thread->path by using write_fn */ 24 | typedef int (*zlog_spec_gen_fn) (zlog_spec_t * a_spec, 25 | zlog_thread_t * a_thread); 26 | 27 | struct zlog_spec_s { 28 | char *str; 29 | int len; 30 | 31 | char time_fmt[MAXLEN_CFG_LINE + 1]; 32 | int time_cache_index; 33 | char mdc_key[MAXLEN_PATH + 1]; 34 | 35 | char print_fmt[MAXLEN_CFG_LINE + 1]; 36 | int left_adjust; 37 | size_t max_width; 38 | size_t min_width; 39 | 40 | zlog_spec_write_fn write_buf; 41 | zlog_spec_gen_fn gen_msg; 42 | zlog_spec_gen_fn gen_path; 43 | zlog_spec_gen_fn gen_archive_path; 44 | }; 45 | 46 | zlog_spec_t *zlog_spec_new(char *pattern_start, char **pattern_end, int * time_cache_count); 47 | void zlog_spec_del(zlog_spec_t * a_spec); 48 | void zlog_spec_profile(zlog_spec_t * a_spec, int flag); 49 | 50 | #define zlog_spec_gen_msg(a_spec, a_thread) \ 51 | a_spec->gen_msg(a_spec, a_thread) 52 | 53 | #define zlog_spec_gen_path(a_spec, a_thread) \ 54 | a_spec->gen_path(a_spec, a_thread) 55 | 56 | #define zlog_spec_gen_archive_path(a_spec, a_thread) \ 57 | a_spec->gen_archive_path(a_spec, a_thread) 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /deps/zlog/src/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zlog_thread_h 10 | #define __zlog_thread_h 11 | 12 | #include "zc_defs.h" 13 | #include "event.h" 14 | #include "buf.h" 15 | #include "mdc.h" 16 | 17 | typedef struct { 18 | int init_version; 19 | zlog_mdc_t *mdc; 20 | zlog_event_t *event; 21 | 22 | zlog_buf_t *pre_path_buf; 23 | zlog_buf_t *path_buf; 24 | zlog_buf_t *archive_path_buf; 25 | zlog_buf_t *pre_msg_buf; 26 | zlog_buf_t *msg_buf; 27 | } zlog_thread_t; 28 | 29 | 30 | void zlog_thread_del(zlog_thread_t * a_thread); 31 | void zlog_thread_profile(zlog_thread_t * a_thread, int flag); 32 | zlog_thread_t *zlog_thread_new(int init_version, 33 | size_t buf_size_min, size_t buf_size_max, int time_cache_count); 34 | 35 | int zlog_thread_rebuild_msg_buf(zlog_thread_t * a_thread, size_t buf_size_min, size_t buf_size_max); 36 | int zlog_thread_rebuild_event(zlog_thread_t * a_thread, int time_cache_count); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /deps/zlog/src/version.h: -------------------------------------------------------------------------------- 1 | #define ZLOG_VERSION "1.2.12" 2 | -------------------------------------------------------------------------------- /deps/zlog/src/zc_arraylist.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zc_arraylist_h 10 | #define __zc_arraylist_h 11 | 12 | #define ARRAY_LIST_DEFAULT_SIZE 32 13 | 14 | typedef void (*zc_arraylist_del_fn) (void *data); 15 | typedef int (*zc_arraylist_cmp_fn) (void *data1, void *data2); 16 | 17 | /* make zc_arraylist_foreach speed up, so keep struct defination here */ 18 | typedef struct { 19 | void **array; 20 | int len; 21 | int size; 22 | zc_arraylist_del_fn del; 23 | } zc_arraylist_t; 24 | 25 | zc_arraylist_t *zc_arraylist_new(zc_arraylist_del_fn del); 26 | void zc_arraylist_del(zc_arraylist_t * a_list); 27 | 28 | int zc_arraylist_set(zc_arraylist_t * a_list, int i, void *data); 29 | int zc_arraylist_add(zc_arraylist_t * a_list, void *data); 30 | int zc_arraylist_sortadd(zc_arraylist_t * a_list, zc_arraylist_cmp_fn cmp, 31 | void *data); 32 | 33 | #define zc_arraylist_len(a_list) (a_list->len) 34 | 35 | #define zc_arraylist_get(a_list, i) \ 36 | ((i >= a_list->len) ? NULL : a_list->array[i]) 37 | 38 | #define zc_arraylist_foreach(a_list, i, a_unit) \ 39 | for(i = 0, a_unit = a_list->array[0]; (i < a_list->len) && (a_unit = a_list->array[i], 1) ; i++) 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /deps/zlog/src/zc_defs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zc_defs_h 10 | #define __zc_defs_h 11 | 12 | #include "zc_profile.h" 13 | #include "zc_arraylist.h" 14 | #include "zc_hashtable.h" 15 | #include "zc_xplatform.h" 16 | #include "zc_util.h" 17 | 18 | typedef struct zlog_category_s { 19 | char name[MAXLEN_PATH + 1]; 20 | size_t name_len; 21 | unsigned char level_bitmap[32]; 22 | unsigned char level_bitmap_backup[32]; 23 | zc_arraylist_t *fit_rules; 24 | zc_arraylist_t *fit_rules_backup; 25 | } zlog_category_t; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /deps/zlog/src/zc_hashtable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zc_hashtalbe_h 10 | #define __zc_hashtalbe_h 11 | 12 | #include 13 | 14 | typedef struct zc_hashtable_entry_s { 15 | unsigned int hash_key; 16 | void *key; 17 | void *value; 18 | struct zc_hashtable_entry_s *prev; 19 | struct zc_hashtable_entry_s *next; 20 | } zc_hashtable_entry_t; 21 | 22 | typedef struct zc_hashtable_s zc_hashtable_t; 23 | 24 | typedef unsigned int (*zc_hashtable_hash_fn) (const void *key); 25 | typedef int (*zc_hashtable_equal_fn) (const void *key1, const void *key2); 26 | typedef void (*zc_hashtable_del_fn) (void *kv); 27 | 28 | zc_hashtable_t *zc_hashtable_new(size_t a_size, 29 | zc_hashtable_hash_fn hash_fn, 30 | zc_hashtable_equal_fn equal_fn, 31 | zc_hashtable_del_fn key_del_fn, 32 | zc_hashtable_del_fn value_del_fn); 33 | 34 | void zc_hashtable_del(zc_hashtable_t * a_table); 35 | void zc_hashtable_clean(zc_hashtable_t * a_table); 36 | int zc_hashtable_put(zc_hashtable_t * a_table, void *a_key, void *a_value); 37 | zc_hashtable_entry_t *zc_hashtable_get_entry(zc_hashtable_t * a_table, const void *a_key); 38 | void *zc_hashtable_get(zc_hashtable_t * a_table, const void *a_key); 39 | void zc_hashtable_remove(zc_hashtable_t * a_table, const void *a_key); 40 | zc_hashtable_entry_t *zc_hashtable_begin(zc_hashtable_t * a_table); 41 | zc_hashtable_entry_t *zc_hashtable_next(zc_hashtable_t * a_table, zc_hashtable_entry_t * a_entry); 42 | 43 | #define zc_hashtable_foreach(a_table, a_entry) \ 44 | for(a_entry = zc_hashtable_begin(a_table); a_entry; a_entry = zc_hashtable_next(a_table, a_entry)) 45 | 46 | unsigned int zc_hashtable_str_hash(const void *str); 47 | int zc_hashtable_str_equal(const void *key1, const void *key2); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /deps/zlog/src/zc_profile.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #include "fmacros.h" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "zc_profile.h" 21 | #include "zc_xplatform.h" 22 | 23 | static void zc_time(char *time_str, size_t time_str_size) 24 | { 25 | time_t tt; 26 | struct tm local_time; 27 | 28 | time(&tt); 29 | localtime_r(&tt, &local_time); 30 | strftime(time_str, time_str_size, "%m-%d %T", &local_time); 31 | 32 | return; 33 | } 34 | 35 | int zc_profile_inner(int flag, const char *file, const long line, const char *fmt, ...) 36 | { 37 | va_list args; 38 | char time_str[20 + 1]; 39 | FILE *fp = NULL; 40 | 41 | static char *debug_log = NULL; 42 | static char *error_log = NULL; 43 | static size_t init_flag = 0; 44 | 45 | if (!init_flag) { 46 | init_flag = 1; 47 | debug_log = getenv("ZLOG_PROFILE_DEBUG"); 48 | error_log = getenv("ZLOG_PROFILE_ERROR"); 49 | } 50 | 51 | switch (flag) { 52 | case ZC_DEBUG: 53 | if (debug_log == NULL) return 0; 54 | fp = fopen(debug_log, "a"); 55 | if (!fp) return -1; 56 | zc_time(time_str, sizeof(time_str)); 57 | fprintf(fp, "%s DEBUG (%d:%s:%ld) ", time_str, getpid(), file, line); 58 | break; 59 | case ZC_WARN: 60 | if (error_log == NULL) return 0; 61 | fp = fopen(error_log, "a"); 62 | if (!fp) return -1; 63 | zc_time(time_str, sizeof(time_str)); 64 | fprintf(fp, "%s WARN (%d:%s:%ld) ", time_str, getpid(), file, line); 65 | break; 66 | case ZC_ERROR: 67 | if (error_log == NULL) return 0; 68 | fp = fopen(error_log, "a"); 69 | if (!fp) return -1; 70 | zc_time(time_str, sizeof(time_str)); 71 | fprintf(fp, "%s ERROR (%d:%s:%ld) ", time_str, getpid(), file, line); 72 | break; 73 | } 74 | 75 | /* writing file twice(time & msg) is not atomic 76 | * may cause cross 77 | * but avoid log size limit */ 78 | va_start(args, fmt); 79 | vfprintf(fp, fmt, args); 80 | va_end(args); 81 | fprintf(fp, "\n"); 82 | 83 | fclose(fp); 84 | return 0; 85 | } 86 | 87 | -------------------------------------------------------------------------------- /deps/zlog/src/zc_profile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #ifndef __zc_profile_h 10 | #define __zc_profile_h 11 | 12 | #include 13 | 14 | #define EMPTY() 15 | #define zc_assert(expr, rv) \ 16 | if(!(expr)) { \ 17 | zc_error(#expr" is null or 0"); \ 18 | return rv; \ 19 | } 20 | 21 | enum zc_profile_flag { 22 | ZC_DEBUG = 0, 23 | ZC_WARN = 1, 24 | ZC_ERROR = 2 25 | }; 26 | 27 | 28 | #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L 29 | #define zc_debug(...) \ 30 | zc_profile_inner(ZC_DEBUG, __FILE__, __LINE__, __VA_ARGS__) 31 | #define zc_warn(...) \ 32 | zc_profile_inner(ZC_WARN, __FILE__, __LINE__, __VA_ARGS__) 33 | #define zc_error(...) \ 34 | zc_profile_inner(ZC_ERROR, __FILE__, __LINE__, __VA_ARGS__) 35 | #define zc_profile(flag, ...) \ 36 | zc_profile_inner(flag, __FILE__, __LINE__, __VA_ARGS__) 37 | #elif defined __GNUC__ 38 | #define zc_debug(fmt, args...) \ 39 | zc_profile_inner(ZC_DEBUG, __FILE__, __LINE__, fmt, ## args) 40 | #define zc_warn(fmt, args...) \ 41 | zc_profile_inner(ZC_WARN, __FILE__, __LINE__, fmt, ## args) 42 | #define zc_error(fmt, args...) \ 43 | zc_profile_inner(ZC_ERROR, __FILE__, __LINE__, fmt, ## args) 44 | #define zc_profile(flag, fmt, args...) \ 45 | zc_profile_inner(flag, __FILE__, __LINE__, fmt, ## args) 46 | #endif 47 | 48 | 49 | int zc_profile_inner(int flag, 50 | const char *file, const long line, 51 | const char *fmt, ...); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /deps/zlog/src/zc_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | #ifndef __zc_util_h 9 | #define __zc_util_h 10 | 11 | size_t zc_parse_byte_size(char *astring); 12 | int zc_str_replace_env(char *str, size_t str_size); 13 | 14 | #define zc_max(a,b) ((a) > (b) ? (a) : (b)) 15 | #define zc_min(a,b) ((a) < (b) ? (a) : (b)) 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /deps/zlog/src/zc_xplatform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | #ifndef __zc_xplatform_h 9 | #define __zc_xplatform_h 10 | 11 | #include 12 | 13 | #define ZLOG_INT32_LEN sizeof("-2147483648") - 1 14 | #define ZLOG_INT64_LEN sizeof("-9223372036854775808") - 1 15 | 16 | #if ((__GNU__ == 2) && (__GNUC_MINOR__ < 8)) 17 | #define ZLOG_MAX_UINT32_VALUE (uint32_t) 0xffffffffLL 18 | #else 19 | #define ZLOG_MAX_UINT32_VALUE (uint32_t) 0xffffffff 20 | #endif 21 | 22 | #define ZLOG_MAX_INT32_VALUE (uint32_t) 0x7fffffff 23 | 24 | #define MAXLEN_PATH 1024 25 | #define MAXLEN_CFG_LINE (MAXLEN_PATH * 4) 26 | 27 | #define FILE_NEWLINE "\n" 28 | #define FILE_NEWLINE_LEN 1 29 | 30 | #include 31 | #include 32 | 33 | #define STRCMP(_a_,_C_,_b_) ( strcmp(_a_,_b_) _C_ 0 ) 34 | #define STRNCMP(_a_,_C_,_b_,_n_) ( strncmp(_a_,_b_,_n_) _C_ 0 ) 35 | #define STRICMP(_a_,_C_,_b_) ( strcasecmp(_a_,_b_) _C_ 0 ) 36 | #define STRNICMP(_a_,_C_,_b_,_n_) ( strncasecmp(_a_,_b_,_n_) _C_ 0 ) 37 | 38 | 39 | #ifdef __APPLE__ 40 | #include 41 | #endif 42 | 43 | /* Define zlog_fstat to fstat or fstat64() */ 44 | #if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6) 45 | #define zlog_fstat fstat64 46 | #define zlog_stat stat64 47 | #else 48 | #define zlog_fstat fstat 49 | #define zlog_stat stat 50 | #endif 51 | 52 | /* Define zlog_fsync to fdatasync() in Linux and fsync() for all the rest */ 53 | #ifdef __linux__ 54 | #define zlog_fsync fdatasync 55 | #else 56 | #define zlog_fsync fsync 57 | #endif 58 | 59 | 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /deps/zlog/src/zlog-chk-conf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the zlog Library. 3 | * 4 | * Copyright (C) 2011 by Hardy Simpson 5 | * 6 | * Licensed under the LGPL v2.1, see the file COPYING in base directory. 7 | */ 8 | 9 | #include "fmacros.h" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #include 17 | 18 | #include "zlog.h" 19 | #include "version.h" 20 | 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | int rc = 0; 25 | int op; 26 | int quiet = 0; 27 | static const char *help = 28 | "useage: zlog-chk-conf [conf files]...\n" 29 | "\t-q,\tsuppress non-error message\n" 30 | "\t-h,\tshow help message\n" 31 | "zlog version: " ZLOG_VERSION "\n"; 32 | 33 | while((op = getopt(argc, argv, "qhv")) > 0) { 34 | if (op == 'h') { 35 | fputs(help, stdout); 36 | return 0; 37 | } else if (op == 'q') { 38 | quiet = 1; 39 | } 40 | } 41 | 42 | argc -= optind; 43 | argv += optind; 44 | 45 | if (argc == 0) { 46 | fputs(help, stdout); 47 | return -1; 48 | } 49 | 50 | setenv("ZLOG_PROFILE_ERROR", "/dev/stderr", 1); 51 | setenv("ZLOG_CHECK_FORMAT_RULE", "1", 1); 52 | 53 | while (argc > 0) { 54 | rc = zlog_init(*argv); 55 | if (rc) { 56 | printf("\n---[%s] syntax error, see error message above\n", 57 | *argv); 58 | exit(2); 59 | } else { 60 | zlog_fini(); 61 | if (!quiet) { 62 | printf("--[%s] syntax right\n", *argv); 63 | } 64 | } 65 | argc--; 66 | argv++; 67 | } 68 | 69 | exit(0); 70 | } 71 | -------------------------------------------------------------------------------- /logging.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | strict init = true 3 | buffer min = 1024 4 | buffer max = 2MB 5 | 6 | #用来保证多进程情况下日志安全转档。zlog会在zlog_init()时候以读写权限打开这个文件。确认你执行程序的用户有权限创建和读写这个文件。 7 | #rotate lock file = self。在这种情况下,zlog不会创建任何锁文件,用配置文件作为锁文件。 8 | rotate lock file = self 9 | 10 | #这个参数是缺省的日志格式,默认值为:"%d %V [%p:%F:%L] %m%n" 11 | default format = "%d.%us %-6V (%c:pid=%p:%F:%L) - %m%n" 12 | file perms = 600 13 | 14 | [rules] 15 | *.INFO >stdout 16 | #*.INFO "/var/log/dpi-server/dpi-server.%d(%F).log", 1GB * 5 -------------------------------------------------------------------------------- /ndpi-demo.conf: -------------------------------------------------------------------------------- 1 | sniff_dev = "ens33" -------------------------------------------------------------------------------- /src/common.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fireflyc on 2016/12/22. 3 | // 4 | 5 | #ifndef DPI_SERVER_COMMON_H 6 | #define DPI_SERVER_COMMON_H 7 | 8 | #include 9 | #include 10 | 11 | #define TRUE 1==1 12 | #define FALSE 1==0 13 | #define CORE_LOG(...) fprintf(stdout, __VA_ARGS__) 14 | 15 | #define log_debug(...) zlog_debug(__VA_ARGS__) 16 | #define log_error(...) zlog_error(__VA_ARGS__) 17 | #define log_info(...) zlog_info(__VA_ARGS__) 18 | #define log_warn(...) zlog_warn(__VA_ARGS__) 19 | 20 | #endif //DPI_SERVER_COMMON_H 21 | -------------------------------------------------------------------------------- /src/config.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fireflyc on 2016/12/22. 3 | // 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "config.h" 9 | 10 | int init_config_from_file(dpi_server_config_t *config, const char *config_path, char *errbuf) { 11 | config_t cfg; 12 | config_init(&cfg); 13 | if (!config_read_file(&cfg, config_path)) { 14 | snprintf(errbuf, BUFSIZ, "%s:%d - %s", config_error_file(&cfg), config_error_line(&cfg), 15 | config_error_text(&cfg)); 16 | goto bad; 17 | } 18 | config_lookup_string(&cfg, "filter_exp", (const char **) &config->filter_exp); 19 | if (!config_lookup_string(&cfg, "sniff_dev", (const char **) &config->sniff_dev)) { 20 | snprintf(errbuf, BUFSIZ, "No '%s' setting in configuration file", "sniff_dev"); 21 | goto bad; 22 | } 23 | config_lookup_string(&cfg, "proto_file_path", (const char **) &config->proto_file_path); 24 | if (config->proto_file_path != NULL) { 25 | //测试文件是否存在 26 | if (fopen(config->proto_file_path, "r") == NULL) { 27 | snprintf(errbuf, BUFSIZ, "Unable to open file %s [%s]", config->proto_file_path, strerror(errno)); 28 | goto bad; 29 | } 30 | } 31 | return TRUE; 32 | 33 | bad: 34 | config_destroy(&cfg); 35 | return FALSE; 36 | } -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fireflyc on 2016/12/22. 3 | // 4 | 5 | #ifndef DPI_SERVER_CONFIG_H 6 | #define DPI_SERVER_CONFIG_H 7 | 8 | #include "common.h" 9 | 10 | typedef struct dpi_server_config { 11 | char *sniff_dev; 12 | char *filter_exp; 13 | char *proto_file_path; 14 | } dpi_server_config_t; 15 | 16 | int init_config_from_file(dpi_server_config_t *config, const char *config_path, char *errbuf); 17 | 18 | #endif //DPI_SERVER_CONFIG_H 19 | -------------------------------------------------------------------------------- /src/context.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fireflyc on 2016/12/22. 3 | // 4 | 5 | -------------------------------------------------------------------------------- /src/context.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fireflyc on 2016/12/22. 3 | // 4 | 5 | #ifndef DPI_SERVER_CONTEXT_H 6 | #define DPI_SERVER_CONTEXT_H 7 | 8 | #include 9 | #include 10 | #include 11 | #include "dpi_engine.h" 12 | 13 | struct _dpi_struct; 14 | 15 | typedef struct dpi_server_context { 16 | struct _dpi_struct *dpi_struct; 17 | pcap_t *pcap; 18 | } dpi_server_context_t; 19 | #endif //DPI_SERVER_CONTEXT_H 20 | -------------------------------------------------------------------------------- /src/dpi_engine.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fireflyc on 2016/12/29. 3 | // 4 | 5 | #ifndef DPI_SERVER_DPI_ENGINE_H 6 | #define DPI_SERVER_DPI_ENGINE_H 7 | 8 | #include 9 | #include 10 | #include "config.h" 11 | 12 | #define MAX_IDLE_TIME 30000 13 | #define NUM_ROOTS 512 14 | 15 | typedef struct _dpi_struct { 16 | ndpi_detection_module_struct_t *ndpi_struct; 17 | uint64_t dpi_flow_count; 18 | uint64_t last_time;//最后一次抓取数据时间 19 | void *dpi_flows_root[NUM_ROOTS]; 20 | uint64_t num_idle_flows; 21 | void *idle_flows[NUM_ROOTS]; 22 | uint64_t idle_scan_idx; 23 | } dpi_struct_t; 24 | 25 | typedef struct _dpi_flow { 26 | //每次通讯都会有源、目标IP和端口,下面的四个成员会把它们之后保存 27 | uint32_t lower_ip;//小IP 28 | uint32_t upper_ip;//大IP 29 | uint16_t lower_port;//小端口 30 | uint16_t upper_port;//大端口 31 | 32 | //vlanid 33 | uint16_t vlan_id; 34 | 35 | char lower_name[32], upper_name[32];//字符串形式的IP地址 36 | 37 | uint8_t protocol; //IPPROTO_TCP IPPROTO_TCP 38 | 39 | struct ndpi_flow_struct *ndpi_flow;//单独释放 40 | 41 | uint64_t bytes; 42 | uint32_t packets; 43 | 44 | uint64_t last_seen;//最后更新时间 45 | 46 | //识别出来的协议 47 | uint32_t detected_protocol; 48 | 49 | u_int32_t idx;//dpi_flows_root中的位置 50 | } dpi_flow_t; 51 | 52 | void dpi_free(dpi_struct_t *dpi_struct); 53 | 54 | dpi_struct_t *init_dpi(dpi_server_config_t config, char *errbuf); 55 | 56 | int dpi_packet_processing(dpi_struct_t *dpi_struct, 57 | struct ndpi_iphdr *iph4, struct ndpi_ip6_hdr *iph6, struct timeval time, 58 | uint16_t vlan_id, uint16_t ipsize, uint16_t rawsize, char *errbuf); 59 | 60 | #endif //DPI_SERVER_DPI_ENGINE_H 61 | -------------------------------------------------------------------------------- /src/main.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by fireflyc on 2016/12/22. 3 | // 4 | 5 | #ifndef DPI_SERVER_MAIN_H 6 | #define DPI_SERVER_MAIN_H 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "common.h" 12 | #include "dpi_engine.h" 13 | 14 | #endif //DPI_SERVER_MAIN_H 15 | --------------------------------------------------------------------------------