Routing
maxHops: NAT ~ 15;
unreachable:
NAT ~ maxHops+1;
Anything more than maxHops away is unreachable.
Hops: TYPE ~ [0..maxHops+1];
RoutingTableEntry:
TYPE ~
RECORD [
hops: Hops, -- 0 => directly connected
immediate: XNS.Net, -- local net on which packets to a given remote net will be sent
delay: CARD -- estimated delay, msec
];
GetHops: PROC [XNS.Net] RETURNS [Hops];
GetRouting: PROC [XNS.Net] RETURNS [RoutingTableEntry];
Enumerate:
PROC [low: Hops ¬ 0, high: Hops ¬ unreachable,
proc:
PROC [
XNS.Net, RoutingTableEntry] ];
Enumerate routing table entries with distance between low and high, inclusive, calling proc on each of them. Client may abort the enumeration by raising an exception in proc and catching it in the caller of Enumerate. It's okay for proc to send/receive packets.