site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com I think you're going down the wrong track. Instead, you need to think about what it means to have a router at all. When the given machine needs to talk to other machines, it uses an address. So you can get the information you want without asking the network anything. Take a long look at: 'man 4 route' -pmb _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... At 6:02 PM -0500 6/28/05, Chase wrote: if this turns out to be consistently predictable (pinging the broadcast address of the subnet yields **ONLY** results from oneself and the router on that subnet), then i can just look thru the ping source, pull out the relevant parts, and simply filter out responses from the local address. that should always give me the router address, right? Routers may or may not have certain behaviors that you can use to identify them, but those behaviors might be different and change over time. You have a given machine connected to any number of networks. There are other devices connected to those networks. Some of those devices might not be final destinations, but instead will forward traffic. First, it checks to see if that address lives on a network already connected to itself. If it is, then it picks the interface holding that network, and sends the data directly there. No router is used. If the destination address is NOT on a directly connected network, it starts looking for a 'gateway'. Gateways are machines on a directly connected network that will accept traffic for networks beyond. AKA, routers. There might be gateways that are only valid for a range of IPs. And there will almost always be one gateway that's valid for any IP; that's the default route/gateway. They're checked from most-specific to least specific. netstat knows a list of the valid gateways. It has to, since your machine can't use routers it doesn't know about! This email sent to site_archiver@lists.apple.com
participants (1)
-
Peter Bierman