Skip to content

Commit

Permalink
DisneyPlus/Hulu ip lists should be auto-generated
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi committed Mar 17, 2023
1 parent 9f46d41 commit 3fe888c
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 31 deletions.
45 changes: 45 additions & 0 deletions src/lib/inc_generated/ndpi_asn_disney_plus.c.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
*
* This file is generated automatically and part of nDPI
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* nDPI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
*
*/

/* ****************************************************** */


static ndpi_network ndpi_protocol_disneyplus_protocol_list[] = {
{ 0x08050500 /* 8.5.5.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B686000 /* 139.104.96.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B686200 /* 139.104.98.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B687000 /* 139.104.112.0/23 */, 23, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B687D00 /* 139.104.125.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B687F00 /* 139.104.127.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68C000 /* 139.104.192.0/22 */, 22, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68C500 /* 139.104.197.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68C600 /* 139.104.198.0/23 */, 23, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68C800 /* 139.104.200.0/22 */, 22, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68CC00 /* 139.104.204.0/23 */, 23, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68CF00 /* 139.104.207.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68D000 /* 139.104.208.0/22 */, 22, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68D500 /* 139.104.213.0/24 */, 24, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68D600 /* 139.104.214.0/23 */, 23, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x8B68D800 /* 139.104.216.0/21 */, 21, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x9D17E000 /* 157.23.224.0/23 */, 23, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x9D17E800 /* 157.23.232.0/22 */, 22, NDPI_PROTOCOL_DISNEYPLUS },
{ 0x9D17EC00 /* 157.23.236.0/23 */, 23, NDPI_PROTOCOL_DISNEYPLUS },
/* End */
{ 0x0, 0, 0 }
};
31 changes: 31 additions & 0 deletions src/lib/inc_generated/ndpi_asn_hulu.c.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
*
* This file is generated automatically and part of nDPI
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* nDPI is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
*
*/

/* ****************************************************** */


static ndpi_network ndpi_protocol_hulu_protocol_list[] = {
{ 0x081C7C00 /* 8.28.124.0/23 */, 23, NDPI_PROTOCOL_HULU },
{ 0xC73C7400 /* 199.60.116.0/24 */, 24, NDPI_PROTOCOL_HULU },
{ 0xC7C83000 /* 199.200.48.0/24 */, 24, NDPI_PROTOCOL_HULU },
{ 0xC7C83200 /* 199.200.50.0/23 */, 23, NDPI_PROTOCOL_HULU },
{ 0xD05B9C00 /* 208.91.156.0/22 */, 22, NDPI_PROTOCOL_HULU },
/* End */
{ 0x0, 0, 0 }
};
31 changes: 0 additions & 31 deletions src/lib/ndpi_content_match.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1871,37 +1871,6 @@ static ndpi_category_match category_match[] = {
{ "detectportal.firefox.com", NDPI_PROTOCOL_CATEGORY_CONNECTIVITY_CHECK },
{ "connectivitycheck.platform.hicloud.com", NDPI_PROTOCOL_CATEGORY_CONNECTIVITY_CHECK },

/* Hulu Streaming services AS23286 */
{ "8.28.124.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "8.28.125.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "199.200.50.0/23", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "199.200.51.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "199.60.116.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "208.91.158.0/23", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "209.249.186.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },

/* Disney Streaming services AS11251 */
{ "8.4.4.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "8.5.5.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "8.33.30.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "63.116.222.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "63.116.223.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.192.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.193.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.200.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.201.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.202.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.203.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.204.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.205.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.206.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.207.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.208.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.209.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.212.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.216.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },
{ "139.104.217.0/24", NDPI_PROTOCOL_CATEGORY_STREAMING },

/*
ADS and tracking
*/
Expand Down
4 changes: 4 additions & 0 deletions src/lib/ndpi_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@
#include "inc_generated/ndpi_asn_vk.c.inc"
#include "inc_generated/ndpi_asn_yandex.c.inc"
#include "inc_generated/ndpi_asn_yandex_cloud.c.inc"
#include "inc_generated/ndpi_asn_disney_plus.c.inc"
#include "inc_generated/ndpi_asn_hulu.c.inc"

/* Third party libraries */
#include "third_party/include/ndpi_patricia.h"
Expand Down Expand Up @@ -2737,6 +2739,8 @@ struct ndpi_detection_module_struct *ndpi_init_detection_module(ndpi_init_prefs
ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_vk_protocol_list);
ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_yandex_protocol_list);
ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_yandex_cloud_protocol_list);
ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_disneyplus_protocol_list);
ndpi_init_ptree_ipv4(ndpi_str, ndpi_str->protocols_ptree, ndpi_protocol_hulu_protocol_list);
}

if(prefs & ndpi_track_flow_payload)
Expand Down
10 changes: 10 additions & 0 deletions utils/asn_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ DEST=../src/lib/inc_generated/ndpi_asn_yandex_cloud.c.inc
create_list NDPI_PROTOCOL_YANDEX_CLOUD $DEST "AS210656" "AS200350"
echo "(3) Yandex Cloud IPs are available in $DEST"

echo "(1) Downloading Disney+..." #Only "Disney Streaming Services"
DEST=../src/lib/inc_generated/ndpi_asn_disney_plus.c.inc
create_list NDPI_PROTOCOL_DISNEYPLUS $DEST "AS400805" "AS398849" "AS22604" "AS11251"
echo "(3) Disney+ IPs are available in $DEST"

echo "(1) Downloading Hulu..."
DEST=../src/lib/inc_generated/ndpi_asn_hulu.c.inc
create_list NDPI_PROTOCOL_HULU $DEST "AS23286"
echo "(3) Hulu IPs are available in $DEST"

if [ ${TOTAL_ASN} -eq ${FAILED_ASN} ]; then
printf '%s: %s\n' "${0}" "All download(s) failed, ./get_routes_by_asn.sh broken?"
exit 1
Expand Down

0 comments on commit 3fe888c

Please sign in to comment.