// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef IPCZ_SRC_IPCZ_LINK_TYPE_H_ #define IPCZ_SRC_IPCZ_LINK_TYPE_H_ #include <string> namespace ipcz { // Enumeration indicating what role a specific RouterLink plays along its route. // Every end-to-end route has exactly one "central" link -- the link that // connects one side of the route to the other -- along with any number of // "peripheral" links extending the route away from the central link on one side // or the other. // // If a peripheral link connects a router R1 to another router R2 which is // closer to the central link, the link is considered to be "outward" from R1 // and "inward" from R2. Conversely if a peripheral link connects a router R1 to // another router R2 which is *further* from the central link, the link is // considered to be inward R1 and outward from R2. // // Finally, when two routes are joined via the MergePortals API, the merged // portals' routers are linked together via a bridge link. // // The stable state of any given route is to have exactly two routers, both // terminal, with a single central link between them. Routes which are extended // by portal relocation or bridged via portal merges may grow into arbitrarily // long chains of linked routers, but over time all interior routers are // incrementally bypassed and discarded through a process of link decay and // replacement. // // The different link classifications defined here help with the orchestration // of this incremental reduction process. struct LinkType { … }; } // namespace ipcz #endif // IPCZ_SRC_IPCZ_LINK_TYPE_H_