|
|
@ -173,7 +173,7 @@ class VertexID:
|
|
|
|
# enumeration, but socket does, so we use that (AF_INET, AF_INET6). Routers
|
|
|
|
# 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
|
|
|
|
# can omit the family, since the router ID is family-agnostic, and it also
|
|
|
|
# could be unknown for transit networks.
|
|
|
|
# could be unknown for transit networks.
|
|
|
|
family: AddressFamily
|
|
|
|
family: AddressFamily | None
|
|
|
|
|
|
|
|
|
|
|
|
# We do _not_ use NodeType, because what is an extra-area network in one
|
|
|
|
# We do _not_ use NodeType, because what is an extra-area network in one
|
|
|
|
# topology might become a transit network in another. So we only distinguish routers and networks.
|
|
|
|
# topology might become a transit network in another. So we only distinguish routers and networks.
|
|
|
@ -183,7 +183,7 @@ class VertexID:
|
|
|
|
# include all the possible elements here and set them to None when not
|
|
|
|
# include all the possible elements here and set them to None when not
|
|
|
|
# applicable.
|
|
|
|
# applicable.
|
|
|
|
|
|
|
|
|
|
|
|
address: IPv4Network | IPv6Network | None
|
|
|
|
address: IPv4Network | IPv6Network | tuple[IPv4Network | IPv6Network] | None
|
|
|
|
router_id: int | None
|
|
|
|
router_id: int | None
|
|
|
|
# For discriminating networks
|
|
|
|
# For discriminating networks
|
|
|
|
dr_id: int | None
|
|
|
|
dr_id: int | None
|
|
|
@ -257,7 +257,7 @@ class VertexFinder:
|
|
|
|
|
|
|
|
|
|
|
|
# All of the following dictionaries have scalars as keys and sets of VertexIDs as value.
|
|
|
|
# All of the following dictionaries have scalars as keys and sets of VertexIDs as value.
|
|
|
|
# If there were multiple addresses, they were added individually.
|
|
|
|
# If there were multiple addresses, they were added individually.
|
|
|
|
self.by_addr: dict[IPv4Network | IPv6Network, set[VertexID]] = defaultdict(lambda: set())
|
|
|
|
self.by_addr: dict[IPv4Network | IPv6Network | None, set[VertexID]] = defaultdict(lambda: set())
|
|
|
|
self.by_rid = defaultdict(lambda: set())
|
|
|
|
self.by_rid = defaultdict(lambda: set())
|
|
|
|
self.by_dr = defaultdict(lambda: set())
|
|
|
|
self.by_dr = defaultdict(lambda: set())
|
|
|
|
self.by_discriminator = defaultdict(lambda: set())
|
|
|
|
self.by_discriminator = defaultdict(lambda: set())
|
|
|
|