From b6711dd32eca24c91adfde87b2e4ffa1582d1be8 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Mon, 10 Jul 2023 10:41:36 +0200 Subject: [PATCH] Add a few clarifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The clarifications sometimes are about change that will come in a future commit, sorry for that. (But the order of commits on this branch is broken anyway…) --- birdvisu/topo_v3.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/birdvisu/topo_v3.py b/birdvisu/topo_v3.py index 5790299..da7eb8c 100644 --- a/birdvisu/topo_v3.py +++ b/birdvisu/topo_v3.py @@ -56,6 +56,9 @@ class TopologyV3: specific detail. (Currently, only detail to be checked is the type, since when the ID differs, we create two vertices). + This also means that any original topology provider must make sure not + to accidentaly create duplicate vertices. + When adding a vertex from different topology, we must not modify it, so we create our own copy.""" if self.frozen: raise ValueError('Cannot add vertex to frozen topology.') @@ -165,6 +168,10 @@ class VertexID: description of the network, leaving such heuristics and advanced matching to another algorithm.""" + # The ipaddress module does not provide a simple address family + # enumeration, but socket does, so we use that (AF_INET, AF_INET6). Routers + # can omit the family, since the router ID is family-agnostic, and it also + # could be unknown for transit networks. family: AddressFamily # We do _not_ use NodeType, because what is an extra-area network in one @@ -252,6 +259,7 @@ class VertexFinder: self.vertices: dict[VertexID, list[TopologyV3]] = defaultdict(lambda: []) # All of the following dictionaries have scalars as keys and sets of VertexIDs as value. + # If there were multiple addresses, they were added individually. self.by_addr: dict[IPv4Network | IPv6Network, set[VertexID]] = defaultdict(lambda: set()) self.by_rid = defaultdict(lambda: set()) self.by_dr = defaultdict(lambda: set())