Skip to content

Commit 408953e

Browse files
Add content-control categories (Search Engine, Children, Violence, Drugs, Weapons) (#3143)
Also add NDPI_PROTOCOL_YOUTUBE_KIDS (ID 473) as a distinct protocol.
1 parent c4c1844 commit 408953e

6 files changed

Lines changed: 434 additions & 350 deletions

File tree

doc/protocols.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,3 +4300,13 @@ References: `Official site <https://docs.github.com/en/packages/learn-github-pac
43004300
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline.
43014301

43024302
References: `Official site <https://docs.github.com/en/actions/get-started/understand-github-actions>`_
4303+
4304+
4305+
.. _Proto_473:
4306+
4307+
`NDPI_PROTOCOL_YOUTUBE_KIDS`
4308+
============================
4309+
YouTube Kids is a video platform by Google designed for children, offering curated, age-appropriate content with parental controls.
4310+
4311+
References: `YouTube Kids official site <https://www.youtubekids.com/>`_
4312+

src/include/ndpi_protocol_ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ typedef enum {
502502
NDPI_PROTOCOL_GITHUB_COPILOT = 470,
503503
NDPI_PROTOCOL_GITHUB_PACKAGES = 471,
504504
NDPI_PROTOCOL_GITHUB_ACTIONS = 472,
505+
NDPI_PROTOCOL_YOUTUBE_KIDS = 473,
505506

506507
/* If you add a new protocol, please update the documentation at doc/protocols.rst, too! */
507508

src/include/ndpi_typedefs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,11 @@ typedef enum {
12541254
NDPI_PROTOCOL_CATEGORY_HISTORY,
12551255
NDPI_PROTOCOL_CATEGORY_POLITICS,
12561256
NDPI_PROTOCOL_CATEGORY_VEHICLES, /* 157 */
1257+
NDPI_PROTOCOL_CATEGORY_SEARCH_ENGINE, /* 158 - search engines */
1258+
NDPI_PROTOCOL_CATEGORY_CHILDREN, /* 159 - content targeted at children */
1259+
NDPI_PROTOCOL_CATEGORY_VIOLENCE, /* 160 - explicit violent content */
1260+
NDPI_PROTOCOL_CATEGORY_DRUGS, /* 161 - drug-related content */
1261+
NDPI_PROTOCOL_CATEGORY_WEAPONS, /* 162 - firearms, ammunition, and weaponry */
12571262

12581263
/*
12591264
IMPORTANT

src/lib/ndpi_content_match.c.inc

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ static ndpi_protocol_match host_match[] =
792792
{ "upload.youtube.com", "YouTubeUpload", NDPI_PROTOCOL_YOUTUBE_UPLOAD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
793793
{ "upload.video.google.com", "YouTubeUpload", NDPI_PROTOCOL_YOUTUBE_UPLOAD, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
794794
{ "youtubei.googleapis.com", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
795+
{ "kids.youtube.com", "YouTubeKids", NDPI_PROTOCOL_YOUTUBE_KIDS, NDPI_PROTOCOL_CATEGORY_CHILDREN, NDPI_PROTOCOL_SAFE, NDPI_PROTOCOL_DEFAULT_LEVEL },
795796
{ "youtube.", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
796797
{ "youtu.be", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
797798
{ "yt3.ggpht.com", "YouTube", NDPI_PROTOCOL_YOUTUBE, NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN, NDPI_PROTOCOL_DEFAULT_LEVEL },
@@ -1615,7 +1616,7 @@ static ndpi_category_match category_match[] = {
16151616
{ "jquery.com", NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_ACCEPTABLE },
16161617
{ "mncdn.com", NDPI_PROTOCOL_CATEGORY_MEDIA, NDPI_PROTOCOL_FUN },
16171618
{ "vultr.com", NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_FUN },
1618-
{ "baidu.com", NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_FUN },
1619+
{ "baidu.com", NDPI_PROTOCOL_CATEGORY_SEARCH_ENGINE, NDPI_PROTOCOL_FUN },
16191620
{ "icq.com", NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
16201621
{ "quickplay.com", NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
16211622
{ "71.am", NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
@@ -1868,5 +1869,65 @@ static ndpi_category_match category_match[] = {
18681869
{ "quantummetric.com", NDPI_PROTOCOL_CATEGORY_ADVERTISEMENT, NDPI_PROTOCOL_TRACKER_ADS },
18691870
/* Qualtrix: The XM Platform and our specialized AI uncovers insights, prioritizes actions, and empowers everyone to improve customer & employee experiences */
18701871
{ "qualtrics.com", NDPI_PROTOCOL_CATEGORY_ADVERTISEMENT, NDPI_PROTOCOL_TRACKER_ADS },
1872+
/* Children's content */
1873+
{ "pbskids.org", NDPI_PROTOCOL_CATEGORY_CHILDREN, NDPI_PROTOCOL_SAFE },
1874+
{ "nickjr.com", NDPI_PROTOCOL_CATEGORY_CHILDREN, NDPI_PROTOCOL_SAFE },
1875+
{ "disneyjunior.com", NDPI_PROTOCOL_CATEGORY_CHILDREN, NDPI_PROTOCOL_SAFE },
1876+
{ "cartoonnetwork.com", NDPI_PROTOCOL_CATEGORY_CHILDREN, NDPI_PROTOCOL_FUN },
1877+
{ "abcmouse.com", NDPI_PROTOCOL_CATEGORY_CHILDREN, NDPI_PROTOCOL_SAFE },
1878+
{ "starfall.com", NDPI_PROTOCOL_CATEGORY_CHILDREN, NDPI_PROTOCOL_SAFE },
1879+
1880+
/* Weapons */
1881+
{ "guns.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1882+
{ "gunsamerica.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1883+
{ "gunbroker.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1884+
{ "armslist.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1885+
{ "brownells.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1886+
{ "midwayusa.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1887+
{ "cheaperthandirt.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1888+
{ "primaryarms.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1889+
{ "grabagun.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1890+
{ "nra.org", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1891+
{ "ar15.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1892+
{ "glock.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1893+
{ "beretta.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1894+
{ "smith-wesson.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1895+
{ "remington.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1896+
{ "winchester.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1897+
{ "ruger.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1898+
{ "mossberg.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1899+
{ "hornady.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1900+
{ "federalcartridge.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1901+
{ "sigsauer.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1902+
{ "heckler-koch.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1903+
{ "springfield-armory.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1904+
{ "rockriverarms.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1905+
{ "budk.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1906+
{ "bladeforums.com", NDPI_PROTOCOL_CATEGORY_WEAPONS, NDPI_PROTOCOL_ACCEPTABLE },
1907+
1908+
/* Violence */
1909+
{ "bestgore.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1910+
{ "goregrish.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1911+
{ "theync.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1912+
{ "liveleak.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1913+
{ "watchpeopledie.tv", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1914+
{ "kaotic.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1915+
{ "crazyshit.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1916+
{ "documentingreality.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1917+
{ "ogrish.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1918+
{ "rotten.com", NDPI_PROTOCOL_CATEGORY_VIOLENCE, NDPI_PROTOCOL_UNRATED },
1919+
1920+
/* Drugs */
1921+
{ "erowid.org", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1922+
{ "shroomery.org", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1923+
{ "drugs-forum.com", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1924+
{ "rollsafe.org", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1925+
{ "bluelight.org", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1926+
{ "drugpolicy.org", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1927+
{ "thecannabist.co", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1928+
{ "cannabis.com", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1929+
{ "leafly.com", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1930+
{ "weedmaps.com", NDPI_PROTOCOL_CATEGORY_DRUGS, NDPI_PROTOCOL_DANGEROUS },
1931+
18711932
{ NULL, 0, NDPI_PROTOCOL_SAFE }
18721933
};

src/lib/ndpi_main.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4103,7 +4103,12 @@ static const char *categories[NDPI_PROTOCOL_NUM_CATEGORIES] = {
41034103
"Beauty",
41044104
"History",
41054105
"Politics",
4106-
"Vehicles"
4106+
"Vehicles",
4107+
"Search_Engine",
4108+
"Children",
4109+
"Violence",
4110+
"Drugs",
4111+
"Weapons"
41074112
};
41084113

41094114
#if !defined(NDPI_CFFI_PREPROCESSING) && defined(__linux__)
@@ -9496,6 +9501,7 @@ static void internal_giveup(struct ndpi_detection_module_struct *ndpi_struct,
94969501
case NDPI_PROTOCOL_GMAIL:
94979502
case NDPI_PROTOCOL_GOOGLE_MAPS:
94989503
case NDPI_PROTOCOL_YOUTUBE:
9504+
case NDPI_PROTOCOL_YOUTUBE_KIDS:
94999505
case NDPI_PROTOCOL_GOOGLE:
95009506
case NDPI_PROTOCOL_YOUTUBE_UPLOAD:
95019507
case NDPI_PROTOCOL_PLAYSTORE:
@@ -9558,6 +9564,7 @@ static void internal_giveup(struct ndpi_detection_module_struct *ndpi_struct,
95589564
case NDPI_PROTOCOL_GMAIL:
95599565
case NDPI_PROTOCOL_GOOGLE_MAPS:
95609566
case NDPI_PROTOCOL_YOUTUBE:
9567+
case NDPI_PROTOCOL_YOUTUBE_KIDS:
95619568
case NDPI_PROTOCOL_GOOGLE:
95629569
case NDPI_PROTOCOL_YOUTUBE_UPLOAD:
95639570
case NDPI_PROTOCOL_PLAYSTORE:

0 commit comments

Comments
 (0)