|
|
BSD 4.3reno
BEGIN {
printf "from %s to %s:\n", AGENT, DEST;
tried[AGENT] = 1;
INVALID = 2; DIRECT = 3;
while (DEST != AGENT) {
dr = 0;
if ((hop = ipRouteNextHop[addr = DEST]) \
&& (type = ipRouteType[addr]) == INVALID)
hop = 0;
if (!hop \
&& (hop = ipRouteNextHop[addr = "0.0.0.0"]) \
&& (type = ipRouteType[addr]) != INVALID)
dr = 1;
if (hop) {
printf " via %-15s metric %2d%s\n",
hop, ipRouteMetric1[addr],
dr ? " (default route)" : "";
}
else {
printf "\nno path to %s from %s\n%s\n",
DEST, AGENT, DIAGNOSTIC;
exit(1);
}
if (type == DIRECT)
exit(0);
if (hop in tried)
printf "\nrouting loop!\n";
else
tried[hop] = 1;
AGENT = hop;
}
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.