diff options
Diffstat (limited to 'src/lib/protocols')
133 files changed, 1653 insertions, 53 deletions
diff --git a/src/lib/protocols/afp.c b/src/lib/protocols/afp.c index 2ed7b5ccc..e13529f24 100644 --- a/src/lib/protocols/afp.c +++ b/src/lib/protocols/afp.c @@ -71,4 +71,16 @@ void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct nd NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AFP); } + +void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("AFP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_AFP, + ndpi_search_afp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + + #endif diff --git a/src/lib/protocols/aimini.c b/src/lib/protocols/aimini.c index 9fd5172cb..eab32d6f1 100644 --- a/src/lib/protocols/aimini.c +++ b/src/lib/protocols/aimini.c @@ -280,4 +280,16 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AIMINI); } + + +void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("AIMINI", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_AIMINI, + ndpi_search_aimini, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/applejuice.c b/src/lib/protocols/applejuice.c index 3ca4985a6..9f0376345 100644 --- a/src/lib/protocols/applejuice.c +++ b/src/lib/protocols/applejuice.c @@ -54,4 +54,15 @@ void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_APPLEJUICE); } + +void init_applejuice_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("APPLEJUICE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_APPLEJUICE, + ndpi_search_applejuice_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/armagetron.c b/src/lib/protocols/armagetron.c index d97927b2e..1e70e1334 100644 --- a/src/lib/protocols/armagetron.c +++ b/src/lib/protocols/armagetron.c @@ -22,8 +22,6 @@ * */ - - /* include files */ #include "ndpi_protocols.h" #ifdef NDPI_PROTOCOL_ARMAGETRON @@ -99,4 +97,17 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_ARMAGETRON); } + + +void init_armagetron_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("ARMAGETRON", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_ARMAGETRON, + ndpi_search_armagetron_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + + #endif diff --git a/src/lib/protocols/ayiya.c b/src/lib/protocols/ayiya.c index ea190ed47..2d910e813 100644 --- a/src/lib/protocols/ayiya.c +++ b/src/lib/protocols/ayiya.c @@ -64,4 +64,16 @@ void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AYIYA); } } + + +void init_ayiya_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("AYIYA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_AYIYA, + ndpi_search_ayiya, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/battlefield.c b/src/lib/protocols/battlefield.c index eef89afd1..5f8a0c0e2 100644 --- a/src/lib/protocols/battlefield.c +++ b/src/lib/protocols/battlefield.c @@ -115,4 +115,15 @@ void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, s return; } + +void init_battlefield_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("BATTLEFIELD", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_BATTLEFIELD, + ndpi_search_battlefield, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/bgp.c b/src/lib/protocols/bgp.c index 6b937a453..9d1e5e5ad 100644 --- a/src/lib/protocols/bgp.c +++ b/src/lib/protocols/bgp.c @@ -54,4 +54,16 @@ void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct nd NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BGP); } + +void init_bgp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("BGP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_BGP, + ndpi_search_bgp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + + #endif diff --git a/src/lib/protocols/bittorrent.c b/src/lib/protocols/bittorrent.c index 358ad7523..cc7842756 100644 --- a/src/lib/protocols/bittorrent.c +++ b/src/lib/protocols/bittorrent.c @@ -475,4 +475,16 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st } } } + + +void init_bittorrent_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("BITTORRENT", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_BITTORRENT, + ndpi_search_bittorrent, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ciscovpn.c b/src/lib/protocols/ciscovpn.c index 7d35a0cca..8bfbf80a4 100644 --- a/src/lib/protocols/ciscovpn.c +++ b/src/lib/protocols/ciscovpn.c @@ -67,4 +67,16 @@ void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, stru } } + + +void init_ciscovpn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("CISCOVPN", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_CISCOVPN, + ndpi_search_ciscovpn, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/citrix.c b/src/lib/protocols/citrix.c index a5e6ef9de..d5602903b 100644 --- a/src/lib/protocols/citrix.c +++ b/src/lib/protocols/citrix.c @@ -90,4 +90,15 @@ void ndpi_search_citrix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_check_citrix(ndpi_struct, flow); } + +void init_citrix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("CITRIX", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_CITRIX, + ndpi_search_citrix, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/collectd.c b/src/lib/protocols/collectd.c index 61ed95327..7e6227980 100644 --- a/src/lib/protocols/collectd.c +++ b/src/lib/protocols/collectd.c @@ -50,4 +50,5 @@ void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, stru NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_COLLECTD); } } + #endif diff --git a/src/lib/protocols/corba.c b/src/lib/protocols/corba.c index c694d60a7..a99f16fa3 100644 --- a/src/lib/protocols/corba.c +++ b/src/lib/protocols/corba.c @@ -45,4 +45,15 @@ void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CORBA); } } + + +void init_corba_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("CORBA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_CORBA, + ndpi_search_corba, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/crossfire.c b/src/lib/protocols/crossfire.c index b70c7fceb..2bdcd79c3 100644 --- a/src/lib/protocols/crossfire.c +++ b/src/lib/protocols/crossfire.c @@ -22,7 +22,6 @@ */ - /* include files */ #include "ndpi_protocols.h" #ifdef NDPI_PROTOCOL_CROSSFIRE @@ -81,5 +80,14 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str } +void init_crossfire_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("CROSSFIRE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_CROSSFIRE, + ndpi_search_crossfire_tcp_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/dcerpc.c b/src/lib/protocols/dcerpc.c index 4ae4a5d42..f57c0e54e 100644 --- a/src/lib/protocols/dcerpc.c +++ b/src/lib/protocols/dcerpc.c @@ -51,4 +51,15 @@ void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DCERPC); } + +void init_dcerpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DCERPC", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DCERPC, + ndpi_search_dcerpc, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/dhcp.c b/src/lib/protocols/dhcp.c index 4ae48cffb..a64f52199 100644 --- a/src/lib/protocols/dhcp.c +++ b/src/lib/protocols/dhcp.c @@ -57,4 +57,16 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCP); } + + +void init_dhcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DHCP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DHCP, + ndpi_search_dhcp_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/dhcpv6.c b/src/lib/protocols/dhcpv6.c index dcae86690..e2cd9d99a 100644 --- a/src/lib/protocols/dhcpv6.c +++ b/src/lib/protocols/dhcpv6.c @@ -57,4 +57,15 @@ void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, st NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCPV6); } + +void init_dhcpv6_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DHCPV6", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DHCPV6, + ndpi_search_dhcpv6_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/directconnect.c b/src/lib/protocols/directconnect.c index 67b09b501..7e4e1b1d8 100644 --- a/src/lib/protocols/directconnect.c +++ b/src/lib/protocols/directconnect.c @@ -471,4 +471,15 @@ void ndpi_search_directconnect(struct ndpi_detection_module_struct } } + +void init_directconnect_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DIRECTCONNECT", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DIRECTCONNECT, + ndpi_search_directconnect, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/directdownloadlink.c b/src/lib/protocols/directdownloadlink.c index 1d79eac6a..e5b30da0f 100644 --- a/src/lib/protocols/directdownloadlink.c +++ b/src/lib/protocols/directdownloadlink.c @@ -734,4 +734,14 @@ void ndpi_search_direct_download_link_tcp(struct ndpi_detection_module_struct *n } } + +void init_directdownloadlink_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DIRECT_DOWNLOAD_LINK", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, + ndpi_search_direct_download_link_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/dns.c b/src/lib/protocols/dns.c index 9db7c8c7a..9d62b6477 100644 --- a/src/lib/protocols/dns.c +++ b/src/lib/protocols/dns.c @@ -297,4 +297,16 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd } } } + + +void init_dns_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DNS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DNS, + ndpi_search_dns, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/dofus.c b/src/lib/protocols/dofus.c index f514b8f6f..14ab3a478 100644 --- a/src/lib/protocols/dofus.c +++ b/src/lib/protocols/dofus.c @@ -145,4 +145,14 @@ void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DOFUS); } + +void init_dofus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DOFUS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DOFUS, + ndpi_search_dofus, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/dropbox.c b/src/lib/protocols/dropbox.c index c0104ccde..d5b3bed34 100644 --- a/src/lib/protocols/dropbox.c +++ b/src/lib/protocols/dropbox.c @@ -72,4 +72,18 @@ void ndpi_search_dropbox(struct ndpi_detection_module_struct *ndpi_struct, struc } } + +void init_dropbox_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("DROPBOX", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_DROPBOX, + ndpi_search_dropbox, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); + +} + + + #endif diff --git a/src/lib/protocols/eaq.c b/src/lib/protocols/eaq.c index 9b610db14..7d0702cb9 100644 --- a/src/lib/protocols/eaq.c +++ b/src/lib/protocols/eaq.c @@ -70,4 +70,16 @@ void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct nd } else goto exclude_eaq; } + + +void init_eaq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("EAQ", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_EAQ, + ndpi_search_eaq, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/edonkey.c b/src/lib/protocols/edonkey.c index 51c4ed994..9fe50d12a 100644 --- a/src/lib/protocols/edonkey.c +++ b/src/lib/protocols/edonkey.c @@ -208,4 +208,15 @@ void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struc } } + +void init_edonkey_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("EDONKEY", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_EDONKEY, + ndpi_search_edonkey, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/fasttrack.c b/src/lib/protocols/fasttrack.c index 2b998bda9..a8c37342d 100644 --- a/src/lib/protocols/fasttrack.c +++ b/src/lib/protocols/fasttrack.c @@ -79,4 +79,16 @@ void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct, NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "fasttrack/kazaa excluded.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FASTTRACK); } + + +void init_fasttrack_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("FASTTRACK", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_FASTTRACK, + ndpi_search_fasttrack_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/fiesta.c b/src/lib/protocols/fiesta.c index c312d107f..c4b02d3ac 100644 --- a/src/lib/protocols/fiesta.c +++ b/src/lib/protocols/fiesta.c @@ -22,8 +22,6 @@ * */ - - /* include files */ #include "ndpi_protocols.h" #ifdef NDPI_PROTOCOL_FIESTA @@ -94,4 +92,15 @@ void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_int_fiesta_add_connection(ndpi_struct, flow); return; } + + +void init_fiesta_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("FIESTA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_FIESTA, + ndpi_search_fiesta, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/filetopia.c b/src/lib/protocols/filetopia.c index f6cf7bef5..399336a0f 100644 --- a/src/lib/protocols/filetopia.c +++ b/src/lib/protocols/filetopia.c @@ -80,4 +80,15 @@ void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FILETOPIA); } + +void init_filetopia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("FILETOPIA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_FILETOPIA, + ndpi_search_filetopia_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/florensia.c b/src/lib/protocols/florensia.c index b82265b00..feeb49e7a 100644 --- a/src/lib/protocols/florensia.c +++ b/src/lib/protocols/florensia.c @@ -119,4 +119,15 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FLORENSIA); } + +void init_florensia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("FLORENSIA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_FLORENSIA, + ndpi_search_florensia, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ftp_control.c b/src/lib/protocols/ftp_control.c index 9e9eb1761..67900ea77 100644 --- a/src/lib/protocols/ftp_control.c +++ b/src/lib/protocols/ftp_control.c @@ -996,4 +996,15 @@ void ndpi_search_ftp_control(struct ndpi_detection_module_struct *ndpi_struct, s } } + +void init_ftp_control_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("FTP_CONTROL", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_FTP_CONTROL, + ndpi_search_ftp_control, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ftp_data.c b/src/lib/protocols/ftp_data.c index 4eb28a908..4afa50bb6 100644 --- a/src/lib/protocols/ftp_data.c +++ b/src/lib/protocols/ftp_data.c @@ -272,4 +272,15 @@ void ndpi_search_ftp_data(struct ndpi_detection_module_struct *ndpi_struct, stru ndpi_check_ftp_data(ndpi_struct, flow); } + +void init_ftp_data_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("FTP_DATA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_FTP_DATA, + ndpi_search_ftp_data, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/gnutella.c b/src/lib/protocols/gnutella.c index cfd6ea74b..311192b2c 100644 --- a/src/lib/protocols/gnutella.c +++ b/src/lib/protocols/gnutella.c @@ -371,4 +371,17 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_GNUTELLA); } + + +void init_gnutella_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("GNUTELLA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_GNUTELLA, + ndpi_search_gnutella, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + + #endif diff --git a/src/lib/protocols/gtp.c b/src/lib/protocols/gtp.c index eb5dd1f0d..d3ab13bfe 100644 --- a/src/lib/protocols/gtp.c +++ b/src/lib/protocols/gtp.c @@ -82,4 +82,15 @@ void ndpi_search_gtp(struct ndpi_detection_module_struct *ndpi_struct, struct nd ndpi_check_gtp(ndpi_struct, flow); } + +void init_gtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("GTP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_GTP, + ndpi_search_gtp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/guildwars.c b/src/lib/protocols/guildwars.c index 34159d4be..d3373f5f6 100644 --- a/src/lib/protocols/guildwars.c +++ b/src/lib/protocols/guildwars.c @@ -23,8 +23,6 @@ */ - -/* include files */ #include "ndpi_protocols.h" #ifdef NDPI_PROTOCOL_GUILDWARS @@ -68,4 +66,15 @@ void ndpi_search_guildwars_tcp(struct ndpi_detection_module_struct *ndpi_struct, NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_GUILDWARS); } + +void init_guildwars_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("GUILDWARS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_GUILDWARS, + ndpi_search_guildwars_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/h323.c b/src/lib/protocols/h323.c index 65d30bf67..8f12c7648 100644 --- a/src/lib/protocols/h323.c +++ b/src/lib/protocols/h323.c @@ -94,4 +94,15 @@ void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct n } } + +void init_h323_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("H323", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_H323, + ndpi_search_h323, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/halflife2_and_mods.c b/src/lib/protocols/halflife2_and_mods.c index eb6ca3585..da2435b70 100644 --- a/src/lib/protocols/halflife2_and_mods.c +++ b/src/lib/protocols/halflife2_and_mods.c @@ -62,4 +62,15 @@ void ndpi_search_halflife2(struct ndpi_detection_module_struct *ndpi_struct, str NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HALFLIFE2); } + +void init_halflife2_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("HALFLIFE2", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_HALFLIFE2, + ndpi_search_halflife2, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/http.c b/src/lib/protocols/http.c index 1bebc3553..584853ef3 100644 --- a/src/lib/protocols/http.c +++ b/src/lib/protocols/http.c @@ -985,4 +985,160 @@ char* ndpi_get_http_content_type(struct ndpi_detection_module_struct *ndpi_mod, return(flow->http.content_type); } + +void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + +/* #ifdef NDPI_PROTOCOL_HTTP */ +/* ndpi_set_bitmask_protocol_detection("HTTP",ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_PROTOCOL_HTTP, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ + +/* ndpi_set_bitmask_protocol_detection("HTTP_PROXY", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_PROTOCOL_HTTP_PROXY, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ + +/* #ifdef NDPI_CONTENT_MPEG */ +/* ndpi_set_bitmask_protocol_detection("MPEG", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_MPEG, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_CONTENT_FLASH */ +/* ndpi_set_bitmask_protocol_detection("FLASH", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_FLASH, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_CONTENT_QUICKTIME */ +/* ndpi_set_bitmask_protocol_detection("QUICKTIME", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_QUICKTIME, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_CONTENT_REALMEDIA */ +/* ndpi_set_bitmask_protocol_detection("REALMEDIA", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_REALMEDIA, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_CONTENT_WINDOWSMEDIA */ +/* ndpi_set_bitmask_protocol_detection("WINDOWSMEDIA", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_WINDOWSMEDIA, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ + +/* /\* MMS *\/ */ +/* #ifdef NDPI_CONTENT_MMS */ +/* ndpi_set_bitmask_protocol_detection("MMS", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_MMS, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ + +/* /\* XBOX *\/ */ +/* #ifdef NDPI_PROTOCOL_XBOX */ +/* ndpi_set_bitmask_protocol_detection("XBOX", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_PROTOCOL_XBOX, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_PROTOCOL_WINDOWS_UPDATE */ +/* ndpi_set_bitmask_protocol_detection("WINDOWS_UPDATE", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_PROTOCOL_WINDOWS_UPDATE, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* /\* QQ *\/ */ +/* #ifdef NDPI_PROTOCOL_QQ */ +/* ndpi_set_bitmask_protocol_detection("QQ", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_PROTOCOL_QQ, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_CONTENT_AVI */ +/* ndpi_set_bitmask_protocol_detection("AVI", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_AVI, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_CONTENT_OGG */ +/* ndpi_set_bitmask_protocol_detection("OGG", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_CONTENT_OGG, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ +/* #ifdef NDPI_PROTOCOL_MOVE */ +/* ndpi_set_bitmask_protocol_detection("MOVE", ndpi_struct, detection_bitmask, *id++, */ +/* NDPI_PROTOCOL_MOVE, */ +/* ndpi_search_http_tcp, */ +/* NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, */ +/* NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, */ +/* ADD_TO_DETECTION_BITMASK); */ +/* #endif */ + + +/* /\* Update excluded protocol bitmask *\/ */ +/* NDPI_BITMASK_SET(ndpi_struct->callback_buffer[*id].excluded_protocol_bitmask, */ +/* ndpi_struct->callback_buffer[*id].detection_bitmask); */ + +/* /\*Delete protocol from exluded protocol bitmask*\/ */ +/* NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[*id].excluded_protocol_bitmask, */ +/* NDPI_PROTOCOL_UNKNOWN); */ + +/* NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[*id].excluded_protocol_bitmask, */ +/* NDPI_PROTOCOL_QQ); */ + +/* #ifdef NDPI_CONTENT_FLASH */ +/* NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[*id].excluded_protocol_bitmask, */ +/* NDPI_CONTENT_FLASH); */ +/* #endif */ + +/* NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[*id].excluded_protocol_bitmask, */ +/* NDPI_CONTENT_MMS); */ + +/* NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->callback_buffer[*id].excluded_protocol_bitmask, */ +/* NDPI_PROTOCOL_XBOX); */ + +/* NDPI_BITMASK_SET(ndpi_struct->generic_http_packet_bitmask, */ +/* ndpi_struct->callback_buffer[*id].detection_bitmask); */ + +/* NDPI_DEL_PROTOCOL_FROM_BITMASK(ndpi_struct->generic_http_packet_bitmask, NDPI_PROTOCOL_UNKNOWN); */ + +/* /\* Update callback_buffer index *\/ */ +/* *id++; */ + +/* #endif */ + +} + #endif diff --git a/src/lib/protocols/http_activesync.c b/src/lib/protocols/http_activesync.c index b3d44c67e..4eeeba835 100644 --- a/src/lib/protocols/http_activesync.c +++ b/src/lib/protocols/http_activesync.c @@ -51,4 +51,16 @@ void ndpi_search_activesync(struct ndpi_detection_module_struct *ndpi_struct, st NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC); } + + +void init_http_activesync_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("HTTP_APPLICATION_ACTIVESYNC", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC, + ndpi_search_activesync, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/iax.c b/src/lib/protocols/iax.c index 79f4df8bf..14874ba11 100644 --- a/src/lib/protocols/iax.c +++ b/src/lib/protocols/iax.c @@ -24,6 +24,7 @@ #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_IAX #define NDPI_IAX_MAX_INFORMATION_ELEMENTS 15 @@ -91,4 +92,16 @@ void ndpi_search_iax(struct ndpi_detection_module_struct *ndpi_struct, struct nd && (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)) ndpi_search_setup_iax(ndpi_struct, flow); } + + +void init_iax_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("IAX", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_IAX, + ndpi_search_iax, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/icecast.c b/src/lib/protocols/icecast.c index b44dfd6cf..dcd22f417 100644 --- a/src/lib/protocols/icecast.c +++ b/src/lib/protocols/icecast.c @@ -88,4 +88,16 @@ void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, s NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_ICECAST); NDPI_LOG(NDPI_PROTOCOL_ICECAST, ndpi_struct, NDPI_LOG_DEBUG, "Icecast excluded.\n"); } + + +void init_icecast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("ICECAST", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_ICECAST, + ndpi_search_icecast_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/imesh.c b/src/lib/protocols/imesh.c index 463e4c0cd..fea5635c8 100644 --- a/src/lib/protocols/imesh.c +++ b/src/lib/protocols/imesh.c @@ -291,4 +291,16 @@ void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, packet->tcp != NULL ? flow->l4.tcp.imesh_stage : 0); } + + +void init_imesh_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("IMESH", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_IMESH, + ndpi_search_imesh_tcp_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ipp.c b/src/lib/protocols/ipp.c index ee11f0fb4..659bccd90 100644 --- a/src/lib/protocols/ipp.c +++ b/src/lib/protocols/ipp.c @@ -24,6 +24,7 @@ #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_IPP static void ndpi_int_ipp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, @@ -109,4 +110,15 @@ void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct nd NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_IPP); } + +void init_ipp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("IPP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_IPP, + ndpi_search_ipp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/irc.c b/src/lib/protocols/irc.c index 9f2d87a45..8a1cc156f 100644 --- a/src/lib/protocols/irc.c +++ b/src/lib/protocols/irc.c @@ -801,4 +801,15 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc } } + +void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("IRC", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_IRC, + ndpi_search_irc_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/jabber.c b/src/lib/protocols/jabber.c index aea5db715..030beee71 100644 --- a/src/lib/protocols/jabber.c +++ b/src/lib/protocols/jabber.c @@ -304,4 +304,14 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st #endif } + +void init_jabber_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("UNENCRYPED_JABBER", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_UNENCRYPED_JABBER, + ndpi_search_jabber_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/kakaotalk_voice.c b/src/lib/protocols/kakaotalk_voice.c index 3fd89bafc..60f6bb68b 100644 --- a/src/lib/protocols/kakaotalk_voice.c +++ b/src/lib/protocols/kakaotalk_voice.c @@ -59,4 +59,16 @@ void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struc NDPI_LOG(NDPI_PROTOCOL_KAKAOTALK_VOICE, ndpi_struct, NDPI_LOG_DEBUG, "Exclude kakaotalk_voice.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_SERVICE_KAKAOTALK_VOICE); } + + +void init_kakaotalk_voice_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("KakaoTalk_Voice", ndpi_struct, detection_bitmask, *id++, + NDPI_SERVICE_KAKAOTALK_VOICE, + ndpi_search_kakaotalk_voice, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/kerberos.c b/src/lib/protocols/kerberos.c index 137d6f102..039890eac 100644 --- a/src/lib/protocols/kerberos.c +++ b/src/lib/protocols/kerberos.c @@ -23,10 +23,8 @@ */ - -/* include files */ - #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_KERBEROS static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct, @@ -68,15 +66,19 @@ void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, stru } - - - - - - - NDPI_LOG(NDPI_PROTOCOL_KERBEROS, ndpi_struct, NDPI_LOG_DEBUG, "no KERBEROS detected.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_KERBEROS); } + +void init_kerberos_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("KERBEROS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_KERBEROS, + ndpi_search_kerberos, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/kontiki.c b/src/lib/protocols/kontiki.c index cd52abb00..1789a6558 100644 --- a/src/lib/protocols/kontiki.c +++ b/src/lib/protocols/kontiki.c @@ -24,6 +24,7 @@ #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_KONTIKI static void ndpi_int_kontiki_add_connection(struct ndpi_detection_module_struct *ndpi_struct, @@ -62,4 +63,15 @@ void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_KONTIKI); } + +void init_kontiki_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("KONTIKI", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_KONTIKI, + ndpi_search_kontiki, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ldap.c b/src/lib/protocols/ldap.c index e2c08d338..6114995de 100644 --- a/src/lib/protocols/ldap.c +++ b/src/lib/protocols/ldap.c @@ -23,10 +23,8 @@ */ - -/* include files */ - #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_LDAP static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, @@ -98,4 +96,15 @@ void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct n NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_LDAP); } + +void init_ldap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("LDAP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_LDAP, + ndpi_search_ldap, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/lotus_notes.c b/src/lib/protocols/lotus_notes.c index 0d3ea0efe..ba6dd1bd2 100644 --- a/src/lib/protocols/lotus_notes.c +++ b/src/lib/protocols/lotus_notes.c @@ -84,4 +84,15 @@ void ndpi_search_lotus_notes(struct ndpi_detection_module_struct *ndpi_struct, s ndpi_check_lotus_notes(ndpi_struct, flow); } + +void init_lotus_notes_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("LOTUS_NOTES", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_LOTUS_NOTES, + ndpi_search_lotus_notes, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/mail_imap.c b/src/lib/protocols/mail_imap.c index 0d53770d5..20a06d807 100644 --- a/src/lib/protocols/mail_imap.c +++ b/src/lib/protocols/mail_imap.c @@ -24,6 +24,7 @@ #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_MAIL_IMAP static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) @@ -290,4 +291,16 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct, NDPI_LOG(NDPI_PROTOCOL_MAIL_IMAP, ndpi_struct, NDPI_LOG_DEBUG, "exclude IMAP.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MAIL_IMAP); } + + +void init_mail_imap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MAIL_IMAP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MAIL_IMAP, + ndpi_search_mail_imap_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/mail_pop.c b/src/lib/protocols/mail_pop.c index 1f7fa41f2..65c8814a2 100644 --- a/src/lib/protocols/mail_pop.c +++ b/src/lib/protocols/mail_pop.c @@ -201,4 +201,16 @@ void ndpi_search_mail_pop_tcp(struct ndpi_detection_module_struct NDPI_LOG(NDPI_PROTOCOL_MAIL_POP, ndpi_struct, NDPI_LOG_DEBUG, "exclude mail_pop\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MAIL_POP); } + + +void init_mail_pop_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MAIL_POP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MAIL_POP, + ndpi_search_mail_pop_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/mail_smtp.c b/src/lib/protocols/mail_smtp.c index f18c72ec5..f3074086e 100644 --- a/src/lib/protocols/mail_smtp.c +++ b/src/lib/protocols/mail_smtp.c @@ -177,4 +177,15 @@ void ndpi_search_mail_smtp_tcp(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MAIL_SMTP); } + +void init_mail_smtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MAIL_SMTP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MAIL_SMTP, + ndpi_search_mail_smtp_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/maplestory.c b/src/lib/protocols/maplestory.c index a49c39108..7771249a2 100644 --- a/src/lib/protocols/maplestory.c +++ b/src/lib/protocols/maplestory.c @@ -22,8 +22,6 @@ * */ - - #include "ndpi_api.h" #ifdef NDPI_PROTOCOL_MAPLESTORY @@ -83,4 +81,16 @@ void ndpi_search_maplestory(struct ndpi_detection_module_struct *ndpi_struct, st NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MAPLESTORY); } + + +void init_maplestory_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MAPLESTORY", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MAPLESTORY, + ndpi_search_maplestory, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/mdns.c b/src/lib/protocols/mdns.c index 22a2bc36a..f23333b69 100644 --- a/src/lib/protocols/mdns.c +++ b/src/lib/protocols/mdns.c @@ -29,9 +29,6 @@ #define NDPI_MAX_MDNS_REQUESTS 128 -/* -This module should detect MDNS -*/ static void ndpi_int_mdns_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) @@ -143,4 +140,16 @@ void ndpi_search_mdns(struct ndpi_detection_module_struct *ndpi_struct, struct n } NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MDNS); } + + +void init_mdns_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MDNS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MDNS, + ndpi_search_mdns, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/meebo.c b/src/lib/protocols/meebo.c index dda7f2c7c..421d5a071 100644 --- a/src/lib/protocols/meebo.c +++ b/src/lib/protocols/meebo.c @@ -159,4 +159,23 @@ void ndpi_search_meebo(struct ndpi_detection_module_struct NDPI_LOG(NDPI_PROTOCOL_MEEBO, ndpi_struct, NDPI_LOG_DEBUG, "exclude meebo.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MEEBO); } + + +void init_meebo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("Meebo", ndpi_struct, detection_bitmask, *id, + NDPI_PROTOCOL_MEEBO, + ndpi_search_meebo, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); + + /* Add protocol bitmask dependencies to detected bitmask*/ +#ifdef NDPI_CONTENT_FLASH + NDPI_ADD_PROTOCOL_TO_BITMASK(ndpi_struct->callback_buffer[*id].detection_bitmask, NDPI_CONTENT_FLASH); +#endif + + *id++; +} + #endif diff --git a/src/lib/protocols/megaco.c b/src/lib/protocols/megaco.c index 151210c9c..64b18b6b4 100644 --- a/src/lib/protocols/megaco.c +++ b/src/lib/protocols/megaco.c @@ -46,4 +46,14 @@ void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MEGACO); } + +void init_megaco_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MEGACO", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MEGACO, + ndpi_search_megaco, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/mgcp.c b/src/lib/protocols/mgcp.c index 56e60e18c..ca65f6c2a 100644 --- a/src/lib/protocols/mgcp.c +++ b/src/lib/protocols/mgcp.c @@ -95,8 +95,18 @@ __forceinline static void ndpi_search_mgcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { + ndpi_search_mgcp_connection(ndpi_struct, flow); +} - ndpi_search_mgcp_connection(ndpi_struct, flow); +void init_mgpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MGCP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MGCP, + ndpi_search_mgcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); } + #endif diff --git a/src/lib/protocols/mms.c b/src/lib/protocols/mms.c index 67d4002db..cec6b7ce9 100644 --- a/src/lib/protocols/mms.c +++ b/src/lib/protocols/mms.c @@ -77,4 +77,16 @@ void ndpi_search_mms_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc #endif /* NDPI_PROTOCOL_HTTP */ } + + +void init_mms_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MMS", ndpi_struct, detection_bitmask, *id++, + NDPI_CONTENT_MMS, + ndpi_search_mms_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, + NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/mpegts.c b/src/lib/protocols/mpegts.c index a6ea4b81f..9b0c1370f 100644 --- a/src/lib/protocols/mpegts.c +++ b/src/lib/protocols/mpegts.c @@ -50,4 +50,16 @@ void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_LOG(NDPI_PROTOCOL_MPEGTS, ndpi_struct, NDPI_LOG_DEBUG, "Excluded MPEGTS.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MPEGTS); } + + +void init_mpegts_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MPEG_TS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MPEGTS, + ndpi_search_mpegts, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/msn.c b/src/lib/protocols/msn.c index 24baf653f..594638c8b 100644 --- a/src/lib/protocols/msn.c +++ b/src/lib/protocols/msn.c @@ -92,8 +92,6 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct } #endif - - /* we detect the initial connection only ! */ /* match: "VER " ..... "CVR" x 0x0d 0x0a * len should be small, lets say less than 100 bytes @@ -396,9 +394,6 @@ static void ndpi_search_msn_tcp(struct ndpi_detection_module_struct *ndpi_struct } } - - - /* finished examining the secone packet only */ /* direct user connection (file transfer,...) */ @@ -560,4 +555,18 @@ void ndpi_search_msn(struct ndpi_detection_module_struct *ndpi_struct, struct nd } } + +void init_msn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + + NDPI_BITMASK_RESET(ndpi_struct->callback_buffer[*id].excluded_protocol_bitmask); + + ndpi_set_bitmask_protocol_detection("MSN", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MSN, + ndpi_search_msn, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/mssql.c b/src/lib/protocols/mssql.c index d270cd6fd..c5c3bdd39 100644 --- a/src/lib/protocols/mssql.c +++ b/src/lib/protocols/mssql.c @@ -23,10 +23,8 @@ */ - -/* include files */ - #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_MSSQL static void ndpi_int_mssql_add_connection(struct ndpi_detection_module_struct @@ -53,4 +51,16 @@ void ndpi_search_mssql(struct ndpi_detection_module_struct NDPI_LOG(NDPI_PROTOCOL_MSSQL, ndpi_struct, NDPI_LOG_DEBUG, "exclude mssql.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MSSQL); } + + +void init_mssql_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MSSQL", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MSSQL, + ndpi_search_mssql, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/mysql.c b/src/lib/protocols/mysql.c index d23ce29f5..1190b80f7 100644 --- a/src/lib/protocols/mysql.c +++ b/src/lib/protocols/mysql.c @@ -24,6 +24,7 @@ #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_MYSQL static void ndpi_int_mysql_add_connection(struct ndpi_detection_module_struct @@ -66,4 +67,15 @@ void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, str NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MYSQL); } + +void init_mysql_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("MYSQL", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_MYSQL, + ndpi_search_mysql_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/netbios.c b/src/lib/protocols/netbios.c index 556142237..1785d7ce1 100644 --- a/src/lib/protocols/netbios.c +++ b/src/lib/protocols/netbios.c @@ -365,4 +365,16 @@ void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_NETBIOS); } + + +void init_netbios_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("NETBIOS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_NETBIOS, + ndpi_search_netbios, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/netflow.c b/src/lib/protocols/netflow.c index 0f059b582..19a6d30ae 100644 --- a/src/lib/protocols/netflow.c +++ b/src/lib/protocols/netflow.c @@ -90,4 +90,15 @@ void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct, struc ndpi_check_netflow(ndpi_struct, flow); } + +void init_netflow_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("NETFLOW", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_NETFLOW, + ndpi_search_netflow, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/nfs.c b/src/lib/protocols/nfs.c index c411902fc..c1f9a40fc 100644 --- a/src/lib/protocols/nfs.c +++ b/src/lib/protocols/nfs.c @@ -24,6 +24,7 @@ #include "ndpi_protocols.h" + #ifdef NDPI_PROTOCOL_NFS static void ndpi_int_nfs_add_connection(struct ndpi_detection_module_struct @@ -83,4 +84,15 @@ void ndpi_search_nfs(struct ndpi_detection_module_struct *ndpi_struct, struct nd NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_NFS); } + +void init_nfs_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("NFS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_NFS, + ndpi_search_nfs, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/noe.c b/src/lib/protocols/noe.c index d9cd11e51..203680f4b 100644 --- a/src/lib/protocols/noe.c +++ b/src/lib/protocols/noe.c @@ -8,8 +8,8 @@ #include "ndpi_api.h" - #ifdef NDPI_PROTOCOL_NOE + static void ndpi_int_noe_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) { @@ -49,4 +49,16 @@ void ndpi_search_noe(struct ndpi_detection_module_struct *ndpi_struct, struct nd NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_NOE); } } + + +void init_noe_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("NOE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_NOE, + ndpi_search_noe, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/non_tcp_udp.c b/src/lib/protocols/non_tcp_udp.c index 753ece393..c9dfaa386 100644 --- a/src/lib/protocols/non_tcp_udp.c +++ b/src/lib/protocols/non_tcp_udp.c @@ -104,4 +104,13 @@ void ndpi_search_in_non_tcp_udp(struct ndpi_detection_module_struct } } + +/* void init_non_tcp_udp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) */ +/* { */ + +/* u_int32_t a = *id; */ + + +/* } */ + #endif diff --git a/src/lib/protocols/ntp.c b/src/lib/protocols/ntp.c index 8a2a8aa25..7ce0900e6 100644 --- a/src/lib/protocols/ntp.c +++ b/src/lib/protocols/ntp.c @@ -65,4 +65,15 @@ void ndpi_search_ntp_udp(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_NTP); } + +void init_ntp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("NTP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_NTP, + ndpi_search_ntp_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/openft.c b/src/lib/protocols/openft.c index 8402263d3..1db4fb561 100644 --- a/src/lib/protocols/openft.c +++ b/src/lib/protocols/openft.c @@ -53,4 +53,16 @@ void ndpi_search_openft_tcp(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OPENFT); } + + +void init_openft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("OPENFT", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_OPENFT, + ndpi_search_openft_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/openvpn.c b/src/lib/protocols/openvpn.c index 4b9f725d3..b568448e4 100644 --- a/src/lib/protocols/openvpn.c +++ b/src/lib/protocols/openvpn.c @@ -62,4 +62,15 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct, NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OPENVPN); } + +void init_openvpn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("OPENVPN", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_OPENVPN, + ndpi_search_openvpn, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/oracle.c b/src/lib/protocols/oracle.c index daeb76e7c..35bc42dec 100644 --- a/src/lib/protocols/oracle.c +++ b/src/lib/protocols/oracle.c @@ -59,4 +59,16 @@ void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_ORACLE); } } + + +void init_oracle_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("ORACLE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_ORACLE, + ndpi_search_oracle, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/oscar.c b/src/lib/protocols/oscar.c index e287f4de7..ba4ddba35 100644 --- a/src/lib/protocols/oscar.c +++ b/src/lib/protocols/oscar.c @@ -270,4 +270,17 @@ void ndpi_search_oscar(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_search_oscar_tcp_connect(ndpi_struct, flow); } } + + +void init_oscar_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + + ndpi_set_bitmask_protocol_detection("OSCAR", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_OSCAR, + ndpi_search_oscar, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/pando.c b/src/lib/protocols/pando.c index 3237bbac8..81294b0ed 100644 --- a/src/lib/protocols/pando.c +++ b/src/lib/protocols/pando.c @@ -154,4 +154,15 @@ void ndpi_search_pando(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_check_pando_udp(ndpi_struct, flow); } + +void init_pando_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("PANDO", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_PANDO, + ndpi_search_pando, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/pcanywhere.c b/src/lib/protocols/pcanywhere.c index 743778816..8d2ea7796 100644 --- a/src/lib/protocols/pcanywhere.c +++ b/src/lib/protocols/pcanywhere.c @@ -52,4 +52,15 @@ void ndpi_search_pcanywhere(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_PCANYWHERE); } + +void init_pcanywhere_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("PCANYWHERE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_PCANYWHERE, + ndpi_search_pcanywhere, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/postgres.c b/src/lib/protocols/postgres.c index 08ec13a26..2169fad40 100644 --- a/src/lib/protocols/postgres.c +++ b/src/lib/protocols/postgres.c @@ -117,4 +117,15 @@ void ndpi_search_postgres_tcp(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_POSTGRES); } + +void init_postgres_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("POSTGRES", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_POSTGRES, + ndpi_search_postgres_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/pplive.c b/src/lib/protocols/pplive.c index 57580b6bc..796bfd633 100644 --- a/src/lib/protocols/pplive.c +++ b/src/lib/protocols/pplive.c @@ -217,4 +217,15 @@ void ndpi_search_pplive(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_check_pplive_udp3(ndpi_struct, flow); } + +void init_pplive_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("PPLIVE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_PPLIVE, + ndpi_search_pplive, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ppstream.c b/src/lib/protocols/ppstream.c index 89c783436..fb0df8d02 100644 --- a/src/lib/protocols/ppstream.c +++ b/src/lib/protocols/ppstream.c @@ -94,12 +94,21 @@ void ndpi_search_ppstream(struct ndpi_detection_module_struct return; } - - - } NDPI_LOG(NDPI_PROTOCOL_PPSTREAM, ndpi_struct, NDPI_LOG_DEBUG, "exclude ppstream.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_PPSTREAM); } + + +void init_ppstream_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("PPSTREAM", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_PPSTREAM, + ndpi_search_ppstream, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/pptp.c b/src/lib/protocols/pptp.c index 085ae5dde..6f25056dc 100644 --- a/src/lib/protocols/pptp.c +++ b/src/lib/protocols/pptp.c @@ -58,4 +58,16 @@ void ndpi_search_pptp(struct ndpi_detection_module_struct NDPI_LOG(NDPI_PROTOCOL_PPTP, ndpi_struct, NDPI_LOG_DEBUG, "exclude pptp.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_PPTP); } + + +void init_pptp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("PPTP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_PPTP, + ndpi_search_pptp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/qq.c b/src/lib/protocols/qq.c index a70f88878..7b9827dc5 100644 --- a/src/lib/protocols/qq.c +++ b/src/lib/protocols/qq.c @@ -662,4 +662,15 @@ void ndpi_search_qq(struct ndpi_detection_module_struct *ndpi_struct, struct ndp ndpi_search_qq_tcp(ndpi_struct, flow); } + +void init_qq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("QQ", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_QQ, + ndpi_search_qq, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, + NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/quake.c b/src/lib/protocols/quake.c index 9029c4b5b..7fa13c6cf 100644 --- a/src/lib/protocols/quake.c +++ b/src/lib/protocols/quake.c @@ -88,4 +88,15 @@ void ndpi_search_quake(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_QUAKE); } + +void init_quake_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("QUAKE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_QUAKE, + ndpi_search_quake, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index d47affbd8..7df8d5fe9 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -167,4 +167,16 @@ void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct, struct n } } } + + +void init_quic_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("QUIC", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_QUIC, + ndpi_search_quic, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/radius.c b/src/lib/protocols/radius.c index 79cd0407d..2daade2db 100644 --- a/src/lib/protocols/radius.c +++ b/src/lib/protocols/radius.c @@ -73,4 +73,15 @@ void ndpi_search_radius(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_check_radius(ndpi_struct, flow); } + +void init_radius_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("RADIUS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_RADIUS, + ndpi_search_radius, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/rdp.c b/src/lib/protocols/rdp.c index e909c17a1..7625caaef 100644 --- a/src/lib/protocols/rdp.c +++ b/src/lib/protocols/rdp.c @@ -53,4 +53,15 @@ void ndpi_search_rdp(struct ndpi_detection_module_struct *ndpi_struct, struct nd NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RDP); } + +void init_rdp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("RDP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_RDP, + ndpi_search_rdp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/redis_net.c b/src/lib/protocols/redis_net.c index 0daf67f46..14e0d9642 100644 --- a/src/lib/protocols/redis_net.c +++ b/src/lib/protocols/redis_net.c @@ -89,4 +89,15 @@ void ndpi_search_redis(struct ndpi_detection_module_struct *ndpi_struct, struct } } + +void init_redis_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("REDIS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_REDIS, + ndpi_search_redis, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/rsync.c b/src/lib/protocols/rsync.c index 2430a7e8f..ba1df3cdd 100644 --- a/src/lib/protocols/rsync.c +++ b/src/lib/protocols/rsync.c @@ -53,4 +53,17 @@ void ndpi_search_rsync(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RSYNC); } } + + +void init_rsync_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + + ndpi_set_bitmask_protocol_detection("RSYNC", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_RSYNC, + ndpi_search_rsync, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/rtcp.c b/src/lib/protocols/rtcp.c index 49114c8e5..1b1f134c0 100644 --- a/src/lib/protocols/rtcp.c +++ b/src/lib/protocols/rtcp.c @@ -64,4 +64,16 @@ void ndpi_search_rtcp(struct ndpi_detection_module_struct *ndpi_struct, struct n NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_RTCP); } } + + +void init_rtcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("RTCP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_RTCP, + ndpi_search_rtcp, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/rtmp.c b/src/lib/protocols/rtmp.c index ec00ff4b8..b7e669dab 100644 --- a/src/lib/protocols/rtmp.c +++ b/src/lib/protocols/rtmp.c @@ -89,4 +89,15 @@ void ndpi_search_rtmp(struct ndpi_detection_module_struct *ndpi_struct, struct n } } + +void init_rtmp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("RTMP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_RTMP, + ndpi_search_rtmp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/rtp.c b/src/lib/protocols/rtp.c index 05a53bb1c..8182b53c4 100644 --- a/src/lib/protocols/rtp.c +++ b/src/lib/protocols/rtp.c @@ -321,5 +321,16 @@ void ndpi_search_rtp(struct ndpi_detection_module_struct *ndpi_struct, struct nd } #endif + +void init_rtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("RTP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_RTP, + ndpi_search_rtp, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif /* NDPI_PROTOCOL_RTP */ diff --git a/src/lib/protocols/rtsp.c b/src/lib/protocols/rtsp.c index 3ba1b5e61..c1e66508b 100644 --- a/src/lib/protocols/rtsp.c +++ b/src/lib/protocols/rtsp.c @@ -117,4 +117,14 @@ void ndpi_search_rtsp_tcp_udp(struct ndpi_detection_module_struct } +void init_rtsp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("RTSP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_RTSP, + ndpi_search_rtsp_tcp_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/sflow.c b/src/lib/protocols/sflow.c index 768c2eed6..9b6293bfd 100644 --- a/src/lib/protocols/sflow.c +++ b/src/lib/protocols/sflow.c @@ -46,4 +46,15 @@ void ndpi_search_sflow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_check_sflow(ndpi_struct, flow); } + +void init_sflow_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SFLOW", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SFLOW, + ndpi_search_sflow, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/shoutcast.c b/src/lib/protocols/shoutcast.c index 794e20351..af3d80c2e 100644 --- a/src/lib/protocols/shoutcast.c +++ b/src/lib/protocols/shoutcast.c @@ -104,4 +104,15 @@ void ndpi_search_shoutcast_tcp(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SHOUTCAST); NDPI_LOG(NDPI_PROTOCOL_SHOUTCAST, ndpi_struct, NDPI_LOG_DEBUG, "Shoutcast excluded.\n"); } + + +void init_shoutcast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SHOUTCAST", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SHOUTCAST, + ndpi_search_shoutcast_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/sip.c b/src/lib/protocols/sip.c index a796beb33..a7b17700e 100644 --- a/src/lib/protocols/sip.c +++ b/src/lib/protocols/sip.c @@ -191,4 +191,15 @@ void ndpi_search_sip(struct ndpi_detection_module_struct *ndpi_struct, struct nd } } + +void init_sip_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SIP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SIP, + ndpi_search_sip, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD,/* Fix courtesy of Miguel Quesada <mquesadab@gmail.com> */ + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/skinny.c b/src/lib/protocols/skinny.c index 78de1107e..a5ea0653e 100644 --- a/src/lib/protocols/skinny.c +++ b/src/lib/protocols/skinny.c @@ -60,4 +60,16 @@ void ndpi_search_skinny(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SKINNY); } } + + +void init_skinny_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SKINNY", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SKINNY, + ndpi_search_skinny, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/skype.c b/src/lib/protocols/skype.c index 339147dfa..2f4d07144 100644 --- a/src/lib/protocols/skype.c +++ b/src/lib/protocols/skype.c @@ -118,15 +118,15 @@ void ndpi_search_skype(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_check_skype(ndpi_struct, flow); } -void init_skype_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) { - ndpi_set_bitmask_protocol_detection("Skype", ndpi_struct, detection_bitmask, *id, + +void init_skype_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("Skype", ndpi_struct, detection_bitmask, *id++, NDPI_PROTOCOL_SKYPE, ndpi_search_skype, NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK); - - *id = *id+1; } #endif diff --git a/src/lib/protocols/smb.c b/src/lib/protocols/smb.c index e259bc2d2..5f4146e84 100644 --- a/src/lib/protocols/smb.c +++ b/src/lib/protocols/smb.c @@ -54,4 +54,15 @@ void ndpi_search_smb_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SMB); } + +void init_smb_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SMB", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SMB, + ndpi_search_smb_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/snmp.c b/src/lib/protocols/snmp.c index 902934490..0ee6f61e8 100644 --- a/src/lib/protocols/snmp.c +++ b/src/lib/protocols/snmp.c @@ -123,4 +123,15 @@ void ndpi_search_snmp(struct ndpi_detection_module_struct *ndpi_struct, struct n } + +void init_snmp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SNMP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SNMP, + ndpi_search_snmp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/socrates.c b/src/lib/protocols/socrates.c index 91ae76da1..a00265e4d 100644 --- a/src/lib/protocols/socrates.c +++ b/src/lib/protocols/socrates.c @@ -74,4 +74,15 @@ void ndpi_search_socrates(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SOCRATES); } + +void init_socrates_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SOCRATES", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SOCRATES, + ndpi_search_socrates, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/sopcast.c b/src/lib/protocols/sopcast.c index c0879a2dd..b249ff709 100644 --- a/src/lib/protocols/sopcast.c +++ b/src/lib/protocols/sopcast.c @@ -201,8 +201,6 @@ static void ndpi_search_sopcast_udp(struct ndpi_detection_module_struct NDPI_LOG(NDPI_PROTOCOL_SOPCAST, ndpi_struct, NDPI_LOG_DEBUG, "exclude sopcast. \n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SOPCAST); - - } void ndpi_search_sopcast(struct ndpi_detection_module_struct @@ -216,4 +214,16 @@ void ndpi_search_sopcast(struct ndpi_detection_module_struct ndpi_search_sopcast_tcp(ndpi_struct, flow); } + + +void init_sopcast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SOPCAST", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SOPCAST, + ndpi_search_sopcast, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/soulseek.c b/src/lib/protocols/soulseek.c index 6bfa9334e..5d2e1bcfb 100644 --- a/src/lib/protocols/soulseek.c +++ b/src/lib/protocols/soulseek.c @@ -283,4 +283,15 @@ void ndpi_search_soulseek_tcp(struct ndpi_detection_module_struct } } + +void init_soulseek_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SOULSEEK", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SOULSEEK, + ndpi_search_soulseek_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/spotify.c b/src/lib/protocols/spotify.c index ee1ceabb3..8c6cabd9c 100644 --- a/src/lib/protocols/spotify.c +++ b/src/lib/protocols/spotify.c @@ -123,4 +123,15 @@ void ndpi_search_spotify(struct ndpi_detection_module_struct *ndpi_struct, struc } } + +void init_spotify_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SPOTIFY", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SPOTIFY, + ndpi_search_spotify, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ssdp.c b/src/lib/protocols/ssdp.c index 94a0fe30d..5bf82041a 100644 --- a/src/lib/protocols/ssdp.c +++ b/src/lib/protocols/ssdp.c @@ -67,4 +67,15 @@ void ndpi_search_ssdp(struct ndpi_detection_module_struct *ndpi_struct, struct n NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SSDP); } + +void init_ssdp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SSDP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SSDP, + ndpi_search_ssdp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/ssh.c b/src/lib/protocols/ssh.c index cadc43f6d..3e78af72d 100644 --- a/src/lib/protocols/ssh.c +++ b/src/lib/protocols/ssh.c @@ -58,4 +58,14 @@ void ndpi_search_ssh_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SSH); } + +void init_ssh_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SSH", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SSH, + ndpi_search_ssh_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} #endif diff --git a/src/lib/protocols/ssl.c b/src/lib/protocols/ssl.c index c1ed2b666..93d5d2673 100644 --- a/src/lib/protocols/ssl.c +++ b/src/lib/protocols/ssl.c @@ -641,4 +641,16 @@ void ndpi_search_ssl_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SSL); return; } + + +void init_ssl_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SSL", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SSL, + ndpi_search_ssl_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/stealthnet.c b/src/lib/protocols/stealthnet.c index ff147c360..ba69dd263 100644 --- a/src/lib/protocols/stealthnet.c +++ b/src/lib/protocols/stealthnet.c @@ -55,4 +55,17 @@ void ndpi_search_stealthnet(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_STEALTHNET); } + + +void init_stealthnet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + + ndpi_set_bitmask_protocol_detection("STEALTHNET", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_STEALTHNET, + ndpi_search_stealthnet, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/steam.c b/src/lib/protocols/steam.c index d820b9ee7..369418520 100644 --- a/src/lib/protocols/steam.c +++ b/src/lib/protocols/steam.c @@ -283,4 +283,15 @@ void ndpi_search_steam(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_check_steam_udp3(ndpi_struct, flow); } + +void init_steam_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("STEAM", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_STEAM, + ndpi_search_steam, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c index 72af5313e..4712afe6d 100644 --- a/src/lib/protocols/stun.c +++ b/src/lib/protocols/stun.c @@ -222,4 +222,15 @@ void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, struct n } } + +void init_stun_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("STUN", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_STUN, + ndpi_search_stun, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/syslog.c b/src/lib/protocols/syslog.c index 2d578b2cc..7c217e6a3 100644 --- a/src/lib/protocols/syslog.c +++ b/src/lib/protocols/syslog.c @@ -127,4 +127,15 @@ void ndpi_search_syslog(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_SYSLOG); } + +void init_syslog_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("SYSLOG", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_SYSLOG, + ndpi_search_syslog, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/tcp_udp.c b/src/lib/protocols/tcp_udp.c index 7abe27b52..1eb9c8773 100644 --- a/src/lib/protocols/tcp_udp.c +++ b/src/lib/protocols/tcp_udp.c @@ -73,6 +73,3 @@ void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, st ndpi_set_detected_protocol(ndpi_struct, flow, proto, NDPI_PROTOCOL_UNKNOWN); } } - - - diff --git a/src/lib/protocols/tds.c b/src/lib/protocols/tds.c index 32accbb6c..4e429ec3c 100644 --- a/src/lib/protocols/tds.c +++ b/src/lib/protocols/tds.c @@ -88,4 +88,15 @@ void ndpi_search_tds_tcp(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TDS); } + +void init_tds_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TDS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TDS, + ndpi_search_tds_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/teamspeak.c b/src/lib/protocols/teamspeak.c index dbd1874b6..8be6104ce 100644 --- a/src/lib/protocols/teamspeak.c +++ b/src/lib/protocols/teamspeak.c @@ -1,5 +1,5 @@ /* - * viber.c + * teamspeak.c * * Copyright (C) 2013 Remy Mudingay <mudingay@ill.fr> * @@ -62,4 +62,15 @@ else if (packet->tcp != NULL) { NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TEAMSPEAK); return; } + +void init_teamspeak_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TEAMSPEAK", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TEAMSPEAK, + ndpi_search_teamspeak, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/teamviewer.c b/src/lib/protocols/teamviewer.c index 6a35bb1af..1991121be 100644 --- a/src/lib/protocols/teamviewer.c +++ b/src/lib/protocols/teamviewer.c @@ -97,4 +97,16 @@ void ndpi_search_teamview(struct ndpi_detection_module_struct *ndpi_struct, stru NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TEAMVIEWER); } + + +void init_teamviewer_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TEAMVIEWER", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TEAMVIEWER, + ndpi_search_teamview, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/telegram.c b/src/lib/protocols/telegram.c index 0c518a963..86f9a1655 100644 --- a/src/lib/protocols/telegram.c +++ b/src/lib/protocols/telegram.c @@ -65,4 +65,16 @@ void ndpi_search_telegram(struct ndpi_detection_module_struct *ndpi_struct, stru NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TELEGRAM); } + + +void init_telegram_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TELEGRAM", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TELEGRAM, + ndpi_search_telegram, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/telnet.c b/src/lib/protocols/telnet.c index 4ed6c79ae..5f4034e7d 100644 --- a/src/lib/protocols/telnet.c +++ b/src/lib/protocols/telnet.c @@ -104,4 +104,15 @@ void ndpi_search_telnet_tcp(struct ndpi_detection_module_struct return; } + +void init_telnet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TELNET", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TELNET, + ndpi_search_telnet_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/tftp.c b/src/lib/protocols/tftp.c index 503de6b57..33fae48f5 100644 --- a/src/lib/protocols/tftp.c +++ b/src/lib/protocols/tftp.c @@ -62,4 +62,16 @@ void ndpi_search_tftp(struct ndpi_detection_module_struct NDPI_LOG(NDPI_PROTOCOL_TFTP, ndpi_struct, NDPI_LOG_DEBUG, "exclude TFTP.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TFTP); } + + +void init_tftp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TFTP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TFTP, + ndpi_search_tftp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/thunder.c b/src/lib/protocols/thunder.c index 2c013c750..8c50324b8 100644 --- a/src/lib/protocols/thunder.c +++ b/src/lib/protocols/thunder.c @@ -208,4 +208,15 @@ void ndpi_search_thunder(struct ndpi_detection_module_struct *ndpi_struct, struc } } + +void init_thunder_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("THUNDER", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_THUNDER, + ndpi_search_thunder, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/tor.c b/src/lib/protocols/tor.c index 458e1ef3a..28b186257 100644 --- a/src/lib/protocols/tor.c +++ b/src/lib/protocols/tor.c @@ -9,7 +9,6 @@ #include "ndpi_api.h" - #ifdef NDPI_PROTOCOL_TOR static void ndpi_int_tor_add_connection(struct ndpi_detection_module_struct @@ -106,4 +105,16 @@ void ndpi_search_tor(struct ndpi_detection_module_struct *ndpi_struct, struct nd NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TOR); } } + + +void init_tor_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TOR", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TOR, + ndpi_search_tor, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/tvants.c b/src/lib/protocols/tvants.c index ba52cc50c..b4f78ea89 100644 --- a/src/lib/protocols/tvants.c +++ b/src/lib/protocols/tvants.c @@ -75,4 +75,16 @@ void ndpi_search_tvants_udp(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TVANTS); } + + +void init_tvants_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TVANTS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TVANTS, + ndpi_search_tvants_udp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/tvuplayer.c b/src/lib/protocols/tvuplayer.c index 7e58c54a3..c397a2308 100644 --- a/src/lib/protocols/tvuplayer.c +++ b/src/lib/protocols/tvuplayer.c @@ -150,4 +150,16 @@ void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, str NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TVUPLAYER); } + + +void init_tvuplayer_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TVUPLAYER", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_TVUPLAYER, + ndpi_search_tvuplayer, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/twitter.c b/src/lib/protocols/twitter.c index 13dd1e98d..59744172e 100644 --- a/src/lib/protocols/twitter.c +++ b/src/lib/protocols/twitter.c @@ -55,9 +55,20 @@ void ndpi_search_twitter(struct ndpi_detection_module_struct *ndpi_struct, struc ndpi_int_twitter_add_connection(ndpi_struct, flow); return; } - } - + NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_SERVICE_TWITTER); } + + +void init_twitter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("TWITTER", ndpi_struct, detection_bitmask, *id++, + NDPI_SERVICE_TWITTER, + ndpi_search_twitter, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/usenet.c b/src/lib/protocols/usenet.c index 3d81dd928..33d2af671 100644 --- a/src/lib/protocols/usenet.c +++ b/src/lib/protocols/usenet.c @@ -102,4 +102,15 @@ void ndpi_search_usenet_tcp(struct ndpi_detection_module_struct } + +void init_usenet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("USENET", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_USENET, + ndpi_search_usenet_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/veohtv.c b/src/lib/protocols/veohtv.c index f6b29607f..54b4ee377 100644 --- a/src/lib/protocols/veohtv.c +++ b/src/lib/protocols/veohtv.c @@ -113,4 +113,16 @@ void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, st NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV); } + + +void init_veohtv_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("HTTP_APPLICATION_VEOHTV", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV, + ndpi_search_veohtv_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/vhua.c b/src/lib/protocols/vhua.c index 7e8951e4c..4b9816f8a 100644 --- a/src/lib/protocols/vhua.c +++ b/src/lib/protocols/vhua.c @@ -65,4 +65,15 @@ void ndpi_search_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct n } } + +void init_vhua_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("VHUA", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_VHUA, + ndpi_search_vhua, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/viber.c b/src/lib/protocols/viber.c index 803227457..d9d879b60 100644 --- a/src/lib/protocols/viber.c +++ b/src/lib/protocols/viber.c @@ -45,4 +45,16 @@ void ndpi_search_viber(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VIBER); } + +void init_viber_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("VIBER", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_VIBER, + ndpi_search_viber, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + + #endif diff --git a/src/lib/protocols/vmware.c b/src/lib/protocols/vmware.c index 6fb74aea5..123f1f820 100644 --- a/src/lib/protocols/vmware.c +++ b/src/lib/protocols/vmware.c @@ -41,5 +41,15 @@ void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct } -#endif /* NDPI_PROTOCOL_VMWARE */ +void init_vmware_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("VMWARE", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_VMWARE, + ndpi_search_vmware, + NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + +#endif diff --git a/src/lib/protocols/vnc.c b/src/lib/protocols/vnc.c index b44b7a167..3d0dcbfae 100644 --- a/src/lib/protocols/vnc.c +++ b/src/lib/protocols/vnc.c @@ -64,4 +64,16 @@ void ndpi_search_vnc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_VNC); } + + +void init_vnc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("VNC", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_VNC, + ndpi_search_vnc_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/warcraft3.c b/src/lib/protocols/warcraft3.c index 4433eb55d..75423aa93 100644 --- a/src/lib/protocols/warcraft3.c +++ b/src/lib/protocols/warcraft3.c @@ -97,4 +97,15 @@ void ndpi_search_warcraft3(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_WARCRAFT3); } + +void init_warcraft3_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("WARCRAFT3", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_WARCRAFT3, + ndpi_search_warcraft3, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/whoisdas.c b/src/lib/protocols/whoisdas.c index 1da106e8d..dfe198bb1 100644 --- a/src/lib/protocols/whoisdas.c +++ b/src/lib/protocols/whoisdas.c @@ -1,5 +1,5 @@ /* - * ssh.c + * whoisdas.c * * Copyright (C) 2013 - ntop.org * @@ -57,4 +57,15 @@ void ndpi_search_whois_das(struct ndpi_detection_module_struct *ndpi_struct, str } } + +void init_whois_das_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("WHOIS_DAS", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_WHOIS_DAS, + ndpi_search_whois_das, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/winmx.c b/src/lib/protocols/winmx.c index f2cac7482..bbddb6b2a 100644 --- a/src/lib/protocols/winmx.c +++ b/src/lib/protocols/winmx.c @@ -101,4 +101,15 @@ void ndpi_search_winmx_tcp(struct ndpi_detection_module_struct *ndpi_struct, str NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_WINMX); } + +void init_winmx_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("WINMX", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_WINMX, + ndpi_search_winmx_tcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/world_of_kung_fu.c b/src/lib/protocols/world_of_kung_fu.c index b6b202803..327ca64f6 100644 --- a/src/lib/protocols/world_of_kung_fu.c +++ b/src/lib/protocols/world_of_kung_fu.c @@ -55,4 +55,15 @@ void ndpi_search_world_of_kung_fu(struct ndpi_detection_module_struct *ndpi_stru NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_WORLD_OF_KUNG_FU); } + +void init_world_of_kung_fu_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("WORLD_OF_KUNG_FU", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_WORLD_OF_KUNG_FU, + ndpi_search_world_of_kung_fu, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/world_of_warcraft.c b/src/lib/protocols/world_of_warcraft.c index b8c0ba3a9..de405a805 100644 --- a/src/lib/protocols/world_of_warcraft.c +++ b/src/lib/protocols/world_of_warcraft.c @@ -207,4 +207,15 @@ void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_WORLDOFWARCRAFT); } + +void init_world_of_warcraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("WORLDOFWARCRAFT", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_WORLDOFWARCRAFT, + ndpi_search_worldofwarcraft, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/xbox.c b/src/lib/protocols/xbox.c index cd5f9ba67..c8198c081 100644 --- a/src/lib/protocols/xbox.c +++ b/src/lib/protocols/xbox.c @@ -100,4 +100,15 @@ void ndpi_search_xbox(struct ndpi_detection_module_struct *ndpi_struct, struct n /* to not exclude tcp traffic here, done by http code... */ } + +void init_xbox_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("XBOX", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_XBOX, + ndpi_search_xbox, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD, + NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/xdmcp.c b/src/lib/protocols/xdmcp.c index 7468765c7..9842b151b 100644 --- a/src/lib/protocols/xdmcp.c +++ b/src/lib/protocols/xdmcp.c @@ -66,4 +66,15 @@ void ndpi_search_xdmcp(struct ndpi_detection_module_struct NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_XDMCP); } + +void init_xdmcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("XDMCP", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_XDMCP, + ndpi_search_xdmcp, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/yahoo.c b/src/lib/protocols/yahoo.c index ad9500a40..bd3784cf0 100644 --- a/src/lib/protocols/yahoo.c +++ b/src/lib/protocols/yahoo.c @@ -429,4 +429,17 @@ void ndpi_search_yahoo(struct ndpi_detection_module_struct *ndpi_struct, struct } } } + + +void init_yahoo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + + ndpi_set_bitmask_protocol_detection("YAHOO", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_YAHOO, + ndpi_search_yahoo, + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/zattoo.c b/src/lib/protocols/zattoo.c index 9a9226a04..f14486798 100644 --- a/src/lib/protocols/zattoo.c +++ b/src/lib/protocols/zattoo.c @@ -232,4 +232,16 @@ void ndpi_search_zattoo(struct ndpi_detection_module_struct *ndpi_struct, struct NDPI_LOG(NDPI_PROTOCOL_ZATTOO, ndpi_struct, NDPI_LOG_DEBUG, "exclude zattoo.\n"); NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_ZATTOO); } + + +void init_zattoo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("ZATTOO", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_ZATTOO, + ndpi_search_zattoo, + NDPI_SELECTION_BITMASK_PROTOCOL_TCP_OR_UDP_WITH_PAYLOAD, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif diff --git a/src/lib/protocols/zeromq.c b/src/lib/protocols/zeromq.c index af277c6dc..5c70a0cf9 100644 --- a/src/lib/protocols/zeromq.c +++ b/src/lib/protocols/zeromq.c @@ -97,4 +97,15 @@ void ndpi_search_zmq(struct ndpi_detection_module_struct *ndpi_struct, struct nd } } + +void init_zmq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) +{ + ndpi_set_bitmask_protocol_detection("ZMQ", ndpi_struct, detection_bitmask, *id++, + NDPI_PROTOCOL_ZMQ, + ndpi_search_zmq, /* TODO: add UDP support */ + NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION, + SAVE_DETECTION_BITMASK_AS_UNKNOWN, + ADD_TO_DETECTION_BITMASK); +} + #endif |