aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/ndpi_private.h2
-rw-r--r--src/include/ndpi_protocol_ids.h4
-rw-r--r--src/lib/ndpi_content_match.c.inc204
-rw-r--r--src/lib/ndpi_main.c14
-rw-r--r--src/lib/protocols/rtp.c5
-rw-r--r--src/lib/protocols/stun.c43
6 files changed, 151 insertions, 121 deletions
diff --git a/src/include/ndpi_private.h b/src/include/ndpi_private.h
index 677976f9a..c2aa37db5 100644
--- a/src/include/ndpi_private.h
+++ b/src/include/ndpi_private.h
@@ -767,7 +767,7 @@ int search_into_bittorrent_cache(struct ndpi_detection_module_struct *ndpi_struc
/* Stun */
int is_stun(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
- u_int16_t *app_proto);
+ u_int16_t *app_proto, ndpi_protocol_category_t *category);
void switch_extra_dissection_to_stun(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, int std_callback);
/* TPKT */
diff --git a/src/include/ndpi_protocol_ids.h b/src/include/ndpi_protocol_ids.h
index 8d7d369da..a671a39bd 100644
--- a/src/include/ndpi_protocol_ids.h
+++ b/src/include/ndpi_protocol_ids.h
@@ -136,7 +136,7 @@ typedef enum {
NDPI_PROTOCOL_CROSSFIRE = 105,
NDPI_PROTOCOL_DOFUS = 106,
NDPI_PROTOCOL_ADS_ANALYTICS_TRACK = 107, /* Generic id for advertisement/analytics/tracking stuff */
- NDPI_PROTOCOL_ADULT_CONTENT = 108,
+ NDPI_PROTOCOL_FREE = 108, /* Free to use */
NDPI_PROTOCOL_GUILDWARS2 = 109,
NDPI_PROTOCOL_AMAZON_ALEXA = 110,
NDPI_PROTOCOL_KERBEROS = 111,
@@ -474,7 +474,7 @@ typedef enum {
NDPI_PROTOCOL_RUTUBE = 443,
NDPI_PROTOCOL_LAGOFAST = 444,
NDPI_PROTOCOL_GEARUP_BOOSTER = 445,
- NDPI_PROTOCOL_LLM = 446, /* Large Language Models */
+ NDPI_PROTOCOL_FREE_1 = 446, /* Free to use */
NDPI_PROTOCOL_UBIQUITY = 447,
NDPI_PROTOCOL_MSDO = 448,
NDPI_PROTOCOL_ROCKSTAR_GAMES = 449,
diff --git a/src/lib/ndpi_content_match.c.inc b/src/lib/ndpi_content_match.c.inc
index 39a8710df..6746cf291 100644
--- a/src/lib/ndpi_content_match.c.inc
+++ b/src/lib/ndpi_content_match.c.inc
@@ -1539,95 +1539,6 @@ static ndpi_protocol_match host_match[] =
/* Amazon Ads helps you reach customers at scale through full-funnel advertising across streaming, shopping, and everything in-between */
{ "amazon-adsystem.com", "ADS_Analytic_Track", NDPI_PROTOCOL_ADS_ANALYTICS_TRACK, NDPI_PROTOCOL_CATEGORY_ADVERTISEMENT, NDPI_PROTOCOL_TRACKER_ADS, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xvideos.", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xvideos-games.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xvideoslive.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "pornhub.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "pornhubselect.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "pornhubpremium.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "pornhublive.", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "transpornhublive.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "gaypornhublive.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xnxx.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xhamster.", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "realsrv.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "stripchat.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "spankbang.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "chaturbate.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xhamster18.desi", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "zooxhamster.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xhwebsite4.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xhamstercreators.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xhamstershop.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "pornmate.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "thebestfetishsites.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "thepornmap.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "mrstiff.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "porngeek.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "mrporngeek.", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "kink.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xxxi.porn", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "mrpornlive.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xnxx-games.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "onlyfans.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "twinrdsrv.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "livejasmin.", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "livejasminacademy.", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "livejasmincdn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "mylivejasmin.org", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "dmm.co.jp", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "youporn.", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xhamsterlive.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "bongacams.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "eporner.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xvideos2.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "nhentai.net", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "ixxx.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "redtube.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "gayredtubelive.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "redtubelive.net", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "redtubeplatinum.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "cityheaven.net", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "missav.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "rule34.xxx", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xnxx.tv", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "crjpgate.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "tnaflix.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xlivrdr.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "dlsite.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "hqporner.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "youjizz.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "txxx.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xvideos3.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xxxnewvideos.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "ok.xxx", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xnxx115.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "nutaku.net", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "sxyprn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "brazzersnetwork.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "superchatlive.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "theporndude.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "fapello.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "hitomi.la", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "erome.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "kiynew.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "jerkmate.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xnxx-cdn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xvideos-cdn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "porndudecdn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xhcdn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "phncdn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "ypncdn.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "strpst.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "trafficjunky.net", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "afcdn.net", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "ktkjmp.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "xxxyouporn.me", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "youporngay.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "freeyoupornxnxx.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "youpornshop.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "youpornmate.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "youporninhd.com", "AdultContent", NDPI_PROTOCOL_ADULT_CONTENT, NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
{ "tesla.services", "TeslaServices", NDPI_PROTOCOL_TESLA_SERVICES, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
{ "digitalassets.tesla.com", "TeslaServices", NDPI_PROTOCOL_TESLA_SERVICES, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_DEFAULT_LEVEL },
@@ -1739,17 +1650,6 @@ static ndpi_protocol_match host_match[] =
{ "gearupportal.com.cdn.cloudflare.net", "GearUP_Booster", NDPI_PROTOCOL_GEARUP_BOOSTER, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
{ "gearupportal.com", "GearUP_Booster", NDPI_PROTOCOL_GEARUP_BOOSTER, NDPI_PROTOCOL_CATEGORY_VPN, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
- /* Artificial Intelligence / LLM */
- { "deepseek.com", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "openapi.com", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "chatgpt.com", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "gemini.google.com", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "notebooklm.google.com", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "claude.ai", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "perplexity.ai", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "ollama.com", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
- { "huggingface.com", "LLM", NDPI_PROTOCOL_LLM, NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
-
{ "rsg.sc", "RockstarGames", NDPI_PROTOCOL_ROCKSTAR_GAMES, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
{ "rockstargames.com", "RockstarGames", NDPI_PROTOCOL_ROCKSTAR_GAMES, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
{ "gamedownloads-rockstargames-com.akamaized.net", "RockstarGames", NDPI_PROTOCOL_ROCKSTAR_GAMES, NDPI_PROTOCOL_CATEGORY_GAME, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
@@ -1838,6 +1738,108 @@ static ndpi_category_match category_match[] = {
{ "detectportal.firefox.com", NDPI_PROTOCOL_CATEGORY_CONNECTIVITY_CHECK },
{ "connectivitycheck.platform.hicloud.com", NDPI_PROTOCOL_CATEGORY_CONNECTIVITY_CHECK },
{ "nmcheck.gnome.org", NDPI_PROTOCOL_CATEGORY_CONNECTIVITY_CHECK },
-
+
+ { "xvideos.", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xvideos-games.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xvideoslive.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "pornhub.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "pornhubselect.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "pornhubpremium.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "pornhublive.", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "transpornhublive.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "gaypornhublive.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xnxx.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xhamster.", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "realsrv.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "stripchat.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "stripcdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "spankbang.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "chaturbate.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xhamster18.desi", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "zooxhamster.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xhwebsite4.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xhamstercreators.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xhamstershop.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "pornmate.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "thebestfetishsites.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "thepornmap.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "mrstiff.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "porngeek.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "mrporngeek.", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "kink.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xxxi.porn", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "mrpornlive.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xnxx-games.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "onlyfans.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "twinrdsrv.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "livejasmin.", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "livejasminacademy.", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "livejasmincdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "mylivejasmin.org", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "dmm.co.jp", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "youporn.", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xhamsterlive.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "bongacams.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "eporner.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xvideos2.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "nhentai.net", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "ixxx.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "redtube.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "gayredtubelive.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "redtubelive.net", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "redtubeplatinum.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "cityheaven.net", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "missav.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "rule34.xxx", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xnxx.tv", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "crjpgate.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "tnaflix.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xlivrdr.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "dlsite.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "hqporner.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "youjizz.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "txxx.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xvideos3.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xxxnewvideos.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "ok.xxx", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xnxx115.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "nutaku.net", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "sxyprn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "brazzersnetwork.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "superchatlive.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "theporndude.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "fapello.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "hitomi.la", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "erome.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "kiynew.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "jerkmate.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xnxx-cdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xvideos-cdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "porndudecdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xhcdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "phncdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "ypncdn.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "strpst.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "trafficjunky.net", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "afcdn.net", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "ktkjmp.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "xxxyouporn.me", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "youporngay.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "freeyoupornxnxx.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "youpornshop.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "youpornmate.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+ { "youporninhd.com", NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT },
+
+ /* Artificial Intelligence / LLM */
+ { "deepseek.com", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "openapi.com", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "chatgpt.com", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "gemini.google.com", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "notebooklm.google.com", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "claude.ai", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "perplexity.ai", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "ollama.com", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+ { "huggingface.com", NDPI_PROTOCOL_CATEGORY_ARTIFICIAL_INTELLIGENCE },
+
{ NULL, 0 }
};
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index d4c9dcd17..e8d5f84a6 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -2900,6 +2900,18 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
ndpi_build_default_ports(ports_b, 3222, 0, 0, 0, 0) /* UDP */,
0);
+ /* Remove */
+ ndpi_set_proto_defaults(ndpi_str, 1 /* cleartext */, 0 /* nw proto */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_FREE,
+ "FREE", NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_QOE_CATEGORY_UNSPECIFIED,
+ ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
+ ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */,
+ 0);
+ ndpi_set_proto_defaults(ndpi_str, 1 /* cleartext */, 0 /* nw proto */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_FREE_1,
+ "FREE_1", NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_QOE_CATEGORY_UNSPECIFIED,
+ ndpi_build_default_ports(ports_a, 0, 0, 0, 0, 0) /* TCP */,
+ ndpi_build_default_ports(ports_b, 0, 0, 0, 0, 0) /* UDP */,
+ 0);
+
#ifdef CUSTOM_NDPI_PROTOCOLS
#include "../../../nDPI-custom/custom_ndpi_main.c"
#endif
@@ -4047,7 +4059,7 @@ struct ndpi_detection_module_struct *ndpi_init_detection_module_ext(struct ndpi_
the custom protocols!
Only the first **consecutive** `ndpi_str->num_supported_protocols` entries in the
array `ndpi_str->proto_defaults[]` MUST have been initialized!
- In other words, all the other functions can safely access to `ndpi_str->num_supported_protocols` and
+ In other words, all the other functions can safely access to `ndpi_str->num_supported_protocols` and
`ndpi_str->num_internal_protocols`
Sanity checks
diff --git a/src/lib/protocols/rtp.c b/src/lib/protocols/rtp.c
index 0240e81cd..7c1bdceed 100644
--- a/src/lib/protocols/rtp.c
+++ b/src/lib/protocols/rtp.c
@@ -467,9 +467,10 @@ static void ndpi_rtp_search(struct ndpi_detection_module_struct *ndpi_struct,
if(flow->rtp_stage || flow->rtcp_stage) {
u_int32_t unused;
u_int16_t app_proto = NDPI_PROTOCOL_UNKNOWN;
-
+ ndpi_protocol_category_t category;
+
/* TODO: we should switch to the demultiplexing-code in stun dissector */
- if(is_stun(ndpi_struct, flow, &app_proto) != 0 &&
+ if(is_stun(ndpi_struct, flow, &app_proto, &category) != 0 &&
!is_dtls(packet->payload, packet->payload_packet_len, &unused)) {
flow->rtp_stage = 0;
flow->rtcp_stage = 0;
diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c
index 103adfc5e..ad72447de 100644
--- a/src/lib/protocols/stun.c
+++ b/src/lib/protocols/stun.c
@@ -55,7 +55,8 @@ static u_int64_t get_stun_lru_key_raw6(u_int8_t *ip, u_int16_t port);
static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t app_proto,
- u_int16_t master_proto);
+ u_int16_t master_proto,
+ ndpi_protocol_category_t category);
static int stun_search_again(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow);
@@ -354,8 +355,8 @@ static void parse_xor_ip_port_attribute(struct ndpi_detection_module_struct *ndp
int is_stun(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
- u_int16_t *app_proto)
-{
+ u_int16_t *app_proto,
+ ndpi_protocol_category_t *category) {
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
u_int16_t msg_type, msg_len, method;
int off;
@@ -366,6 +367,8 @@ int is_stun(struct ndpi_detection_module_struct *ndpi_struct,
u_int32_t magic_cookie;
u_int32_t transaction_id[3];
+ *category = NDPI_PROTOCOL_CATEGORY_UNSPECIFIED;
+
if(payload_length < STUN_HDR_LEN)
return(-1);
@@ -578,7 +581,7 @@ int is_stun(struct ndpi_detection_module_struct *ndpi_struct,
} else if(strstr(flow->host_server_name, "facebook") != NULL) {
*app_proto = NDPI_PROTOCOL_FACEBOOK_VOIP;
} else if(strstr(flow->host_server_name, "stripcdn.com") != NULL) {
- *app_proto = NDPI_PROTOCOL_ADULT_CONTENT;
+ *category = NDPI_PROTOCOL_CATEGORY_ADULT_CONTENT;
} else if(strstr(flow->host_server_name, "telegram") != NULL) {
*app_proto = NDPI_PROTOCOL_TELEGRAM_VOIP;
} else if(strstr(flow->host_server_name, "viber") != NULL) {
@@ -833,10 +836,14 @@ static int stun_search_again(struct ndpi_detection_module_struct *ndpi_struct,
(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_WHATSAPP_CALL &&
(msg_type == 0x0800 || msg_type == 0x0801 || msg_type == 0x0802 ||
msg_type == 0x0804 || msg_type == 0x0805))) {
+ ndpi_protocol_category_t category;
+
NDPI_LOG_DBG(ndpi_struct, "Still STUN\n");
- if(is_stun(ndpi_struct, flow, &app_proto) == 1) { /* To extract other metadata */
+
+ if(is_stun(ndpi_struct, flow, &app_proto, &category) == 1) { /* To extract other metadata */
if(is_new_subclassification_better(ndpi_struct, flow, app_proto)) {
- ndpi_int_stun_add_connection(ndpi_struct, flow, app_proto, __get_master(flow));
+ ndpi_int_stun_add_connection(ndpi_struct, flow,
+ app_proto, __get_master(flow), category);
}
}
} else if(first_byte <= 15) {
@@ -905,7 +912,7 @@ static int stun_search_again(struct ndpi_detection_module_struct *ndpi_struct,
NDPI_LOG_DBG(ndpi_struct, "Keeping old subclassification %d\n", old_proto_stack[0]);
ndpi_int_stun_add_connection(ndpi_struct, flow,
old_proto_stack[0] == NDPI_PROTOCOL_RTP ? NDPI_PROTOCOL_SRTP : old_proto_stack[0],
- __get_master(flow));
+ __get_master(flow), NDPI_PROTOCOL_CATEGORY_UNSPECIFIED);
}
/* If this is not a real DTLS packet, we need to restore the old state */
@@ -992,14 +999,15 @@ static int stun_search_again(struct ndpi_detection_module_struct *ndpi_struct,
} else {
/* STUN/SUBPROTO -> SRTP/SUBPROTO */
ndpi_int_stun_add_connection(ndpi_struct, flow,
- flow->detected_protocol_stack[0], NDPI_PROTOCOL_SRTP);
+ flow->detected_protocol_stack[0], NDPI_PROTOCOL_SRTP,
+ NDPI_PROTOCOL_CATEGORY_UNSPECIFIED);
}
} else {
/* STUN -> STUN/RTP, or
DTLS -> DTLS/SRTP */
ndpi_int_stun_add_connection(ndpi_struct, flow,
__get_master(flow) == NDPI_PROTOCOL_STUN ? NDPI_PROTOCOL_RTP: NDPI_PROTOCOL_SRTP,
- __get_master(flow));
+ __get_master(flow), NDPI_PROTOCOL_CATEGORY_UNSPECIFIED);
}
} else if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_RTCP &&
flow->detected_protocol_stack[1] == NDPI_PROTOCOL_UNKNOWN) {
@@ -1143,7 +1151,8 @@ static u_int64_t get_stun_lru_key_raw6(u_int8_t *ip, u_int16_t port_host_order)
static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int16_t app_proto,
- u_int16_t master_proto) {
+ u_int16_t master_proto,
+ ndpi_protocol_category_t category) {
ndpi_confidence_t confidence = NDPI_CONFIDENCE_DPI;
u_int16_t new_app_proto;
@@ -1200,7 +1209,7 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
if(master_proto == NDPI_PROTOCOL_RTP || master_proto == NDPI_PROTOCOL_RTCP) {
if(app_proto == NDPI_PROTOCOL_UNKNOWN) {
app_proto = NDPI_PROTOCOL_RTP;
- master_proto = NDPI_PROTOCOL_STUN; /* RTP|RTCP ->STUN/RTP */
+ master_proto = NDPI_PROTOCOL_STUN; /* RTP|RTCP -> STUN/RTP */
} else {
master_proto = NDPI_PROTOCOL_SRTP;
}
@@ -1210,6 +1219,9 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
if(is_subclassification_real_by_proto(app_proto))
add_to_cache(ndpi_struct, flow, app_proto);
+ if(category != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED)
+ flow->category = category;
+
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN ||
app_proto != NDPI_PROTOCOL_UNKNOWN) {
NDPI_LOG_DBG(ndpi_struct, "Setting %d/%d\n", master_proto, app_proto);
@@ -1219,10 +1231,11 @@ static void ndpi_int_stun_add_connection(struct ndpi_detection_module_struct *nd
takes care of setting the category */
if(flow->extra_packets_func) {
ndpi_protocol ret = { { master_proto, app_proto }, NDPI_PROTOCOL_UNKNOWN /* unused */, NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, NULL};
+
flow->category = ndpi_get_proto_category(ndpi_struct, ret);
}
}
-
+
switch_extra_dissection_to_stun(ndpi_struct, flow, 1);
}
@@ -1250,6 +1263,7 @@ static void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, s
{
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
u_int16_t app_proto;
+ ndpi_protocol_category_t category;
int rc;
NDPI_LOG_DBG(ndpi_struct, "search stun\n");
@@ -1263,10 +1277,11 @@ static void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, s
return;
}
- rc = is_stun(ndpi_struct, flow, &app_proto);
+ rc = is_stun(ndpi_struct, flow, &app_proto, &category);
if(rc == 1) {
- ndpi_int_stun_add_connection(ndpi_struct, flow, app_proto, __get_master(flow));
+ ndpi_int_stun_add_connection(ndpi_struct, flow, app_proto,
+ __get_master(flow), category);
return;
}