MeWeb.Core runs seven checks concurrently and reports each as it settles:
online or behind a login page, this connection, the public IPv4 and IPv6
seen from v4./v6.meweb, the provider from a built-in map, the router
(UPnP IGD, NAT-PMP and PCP, read-only), address sharing (router WAN
against the echo, TTL hops only as a hint), and the history kept on the
device. The app draws the path from this device to the internet and lights
it node by node, with a card per check and a sheet listing every host it
contacts.
The provider map is iptoasn's table compressed to 2.1 MB by
tools/knowledge.cs and built before every app release; eleven Italian
provider profiles carry each fact with who said it, the source and the
month. The server gains a download page (en, it) and /download/{platform}
from the latest Gitea release.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
71 lines
1.3 KiB
C#
71 lines
1.3 KiB
C#
namespace MeWeb.Core.Checks;
|
|
|
|
public enum CheckId
|
|
{
|
|
Online,
|
|
Connection,
|
|
Addresses,
|
|
Provider,
|
|
Router,
|
|
Nat,
|
|
History,
|
|
}
|
|
|
|
public enum Outcome
|
|
{
|
|
Waiting,
|
|
Running,
|
|
Good,
|
|
Caution,
|
|
Bad,
|
|
Unknown,
|
|
Info,
|
|
}
|
|
|
|
public enum NatKind
|
|
{
|
|
Unknown,
|
|
Direct,
|
|
HomeRouter,
|
|
DoubleNat,
|
|
Shared,
|
|
Translated,
|
|
NoIpv4,
|
|
}
|
|
|
|
public class Fact
|
|
{
|
|
public string Label { get; set; }
|
|
public string Text { get; set; }
|
|
public string Key { get; set; }
|
|
public List<string> Args { get; set; } = [];
|
|
public decimal? Amount { get; set; }
|
|
public string Currency { get; set; }
|
|
public string Link { get; set; }
|
|
public string Basis { get; set; }
|
|
public string Date { get; set; }
|
|
}
|
|
|
|
public class Finding
|
|
{
|
|
public CheckId Id { get; set; }
|
|
public Outcome Outcome { get; set; }
|
|
public string Summary { get; set; }
|
|
public List<string> Args { get; set; } = [];
|
|
public List<Fact> Facts { get; set; } = [];
|
|
|
|
public static Finding Running(CheckId id) => new() { Id = id, Outcome = Outcome.Running };
|
|
|
|
public Finding With(string label, string text)
|
|
{
|
|
if (!string.IsNullOrEmpty(text)) Facts.Add(new Fact { Label = label, Text = text });
|
|
return this;
|
|
}
|
|
|
|
public Finding WithKey(string label, string key, params string[] args)
|
|
{
|
|
Facts.Add(new Fact { Label = label, Key = key, Args = [.. args] });
|
|
return this;
|
|
}
|
|
}
|