While the lists ina6ff0dd0and2f5f445fare somehow provided by the companies themselves (or by some interested parties), these new lists are directly extracted from BGP information, via AS prefixes. *Usually*, these new lists are far more stable than the previous ones. TODO: * add some other ASNs (see `src/lib/ndpi_content_match.c.inc`) * IPv6, as usual :-(
20 lines
431 B
Bash
Executable File
20 lines
431 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Usage: $0 AS-Number" >&2
|
|
return
|
|
fi
|
|
|
|
LIST=/tmp/asn.json
|
|
ORIGIN="https://stat.ripe.net/data/announced-prefixes/data.json?resource=$1"
|
|
|
|
http_response=$(curl -s -o "${LIST}" -w "%{http_code}" "${ORIGIN}")
|
|
if [ "$http_response" != "200" ]; then
|
|
echo "Error $http_response: wrong ASN number/format?" >&2
|
|
return
|
|
fi
|
|
|
|
jq -r '.data.prefixes[].prefix' $LIST | grep -v ":"
|
|
|
|
rm -f $LIST
|