me-web? 0.5: the shared exit measured, the route from the server, the network's upstreams
- Behind your provider's shared address, me-web? now shows how its exit hands out ports (kept, one after another, from one block, or at random), the range it gave this device, and how many customers may share the address at most; the estimate sharpens with each check on the same address. - It tests whether two devices behind the same address can reach each other (hairpin), and how long an unused connection stays open: the card says "measuring" for about two minutes after the check, then the answer. - With the test from outside, the publisher's server also traces the route back to your address: your provider's routers and the networks in between appear on the path, with their names. - The provider card says which networks your provider reaches the internet through. - On mobile data, the path shows the operator and the type of network (5G, 4G) read from the phone; on Android 13 and later the phone asks once for permission to read the network type. - The speed card adds the round trip to the publisher's server. - The network data now comes from the publisher's server, refreshed there from open sources: iptoasn.com, DB-IP Lite (CC BY 4.0), the University of Oregon Route Views Project (CC BY 4.0) and the Android Open Source Project's list of mobile operators (Apache 2.0); the release notes list each source's date and checksum. - Source links in the cards wrap instead of being cut off. - New strings, drafted in every language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
This commit is contained in:
1 parent
8caed6b28d
commit
eb8be87284
145 files changed
+3704
-193
No files matched your search
@@ -46,6 +46,21 @@ public sealed class AsnTable
|
||||
return index < 0 ? null : systems[index];
|
||||
}
|
||||
|
||||
public AsnEntry Find(uint number)
|
||||
{
|
||||
var low = 0;
|
||||
var high = systems.Length - 1;
|
||||
while (low <= high)
|
||||
{
|
||||
var middle = (low + high) / 2;
|
||||
var found = systems[middle].Number;
|
||||
if (found == number) return systems[middle];
|
||||
if (found < number) low = middle + 1;
|
||||
else high = middle - 1;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AsnTable Read(Stream compressed)
|
||||
{
|
||||
using var brotli = new BrotliStream(compressed, CompressionMode.Decompress);
|
||||
@@ -82,9 +97,19 @@ public sealed class AsnTable
|
||||
|
||||
public static void Write(Stream output, DateTimeOffset sourceDate, IEnumerable<AsnRange> ranges)
|
||||
{
|
||||
var list = ranges.Where(r => r.Number != 0).ToList();
|
||||
var systems = list.GroupBy(r => r.Number).OrderBy(g => g.Key)
|
||||
.Select(g => new AsnEntry { Number = g.Key, Country = g.First().Country ?? "", Name = g.First().Name ?? "" }).ToList();
|
||||
var known = new Dictionary<uint, AsnEntry>();
|
||||
var v4Ranges = new List<(UInt128 Start, UInt128 End, uint Number)>();
|
||||
var v6Ranges = new List<(UInt128 Start, UInt128 End, uint Number)>();
|
||||
foreach (var range in ranges)
|
||||
{
|
||||
if (range.Number == 0) continue;
|
||||
if (!known.ContainsKey(range.Number)) known[range.Number] = new AsnEntry { Number = range.Number, Country = range.Country ?? "", Name = range.Name ?? "" };
|
||||
if (range.Start.AddressFamily == AddressFamily.InterNetwork)
|
||||
v4Ranges.Add((BinaryPrimitives.ReadUInt32BigEndian(range.Start.GetAddressBytes()), BinaryPrimitives.ReadUInt32BigEndian(range.End.GetAddressBytes()), range.Number));
|
||||
else
|
||||
v6Ranges.Add((BinaryPrimitives.ReadUInt128BigEndian(range.Start.GetAddressBytes()), BinaryPrimitives.ReadUInt128BigEndian(range.End.GetAddressBytes()), range.Number));
|
||||
}
|
||||
var systems = known.Values.OrderBy(s => s.Number).ToList();
|
||||
var index = systems.Select((s, i) => (s.Number, i)).ToDictionary(p => p.Number, p => p.i);
|
||||
|
||||
using var brotli = new BrotliStream(output, CompressionLevel.SmallestSize, leaveOpen: true);
|
||||
@@ -99,7 +124,7 @@ public sealed class AsnTable
|
||||
writer.Write(system.Name);
|
||||
}
|
||||
|
||||
var v4 = Flatten(list.Where(r => r.Start.AddressFamily == AddressFamily.InterNetwork), a => BinaryPrimitives.ReadUInt32BigEndian(a.GetAddressBytes()), uint.MaxValue, index);
|
||||
var v4 = Flatten(v4Ranges, uint.MaxValue, index);
|
||||
writer.Write7BitEncodedInt(v4.Count);
|
||||
var previous4 = 0u;
|
||||
foreach (var (start, system) in v4)
|
||||
@@ -109,7 +134,7 @@ public sealed class AsnTable
|
||||
previous4 = (uint)start;
|
||||
}
|
||||
|
||||
var v6 = Flatten(list.Where(r => r.Start.AddressFamily == AddressFamily.InterNetworkV6), a => BinaryPrimitives.ReadUInt128BigEndian(a.GetAddressBytes()), UInt128.MaxValue, index);
|
||||
var v6 = Flatten(v6Ranges, UInt128.MaxValue, index);
|
||||
writer.Write7BitEncodedInt(v6.Count);
|
||||
var previous6 = UInt128.Zero;
|
||||
foreach (var (start, system) in v6)
|
||||
@@ -120,14 +145,16 @@ public sealed class AsnTable
|
||||
}
|
||||
}
|
||||
|
||||
static List<(UInt128 Start, int System)> Flatten(IEnumerable<AsnRange> ranges, Func<IPAddress, UInt128> number, UInt128 max, Dictionary<uint, int> index)
|
||||
static List<(UInt128 Start, int System)> Flatten(List<(UInt128 Start, UInt128 End, uint Number)> ranges, UInt128 max, Dictionary<uint, int> index)
|
||||
{
|
||||
ranges.Sort((a, b) => a.Start.CompareTo(b.Start));
|
||||
var result = new List<(UInt128 Start, int System)>();
|
||||
var nextFree = UInt128.Zero;
|
||||
var lastSystem = -1;
|
||||
var full = false;
|
||||
foreach (var range in ranges.Select(r => (Start: number(r.Start), End: number(r.End), System: index[r.Number])).OrderBy(r => r.Start))
|
||||
foreach (var (rangeStart, rangeEnd, number) in ranges)
|
||||
{
|
||||
var range = (Start: rangeStart, End: rangeEnd, System: index[number]);
|
||||
if (full || range.End < nextFree) continue;
|
||||
var start = range.Start < nextFree ? nextFree : range.Start;
|
||||
if (start > nextFree && lastSystem != -1)
|
||||
|
||||
Reference in new issue
Block a user