Re: How can I read from ARP-Table the MAC-Address of my Router.
Re: How can I read from ARP-Table the MAC-Address of my Router.
- Subject: Re: How can I read from ARP-Table the MAC-Address of my Router.
- From: "Justin C. Walker" <email@hidden>
- Date: Fri, 3 Feb 2006 07:03:39 -0800
On Feb 3, 2006, at 03:14 , Cool Water wrote:
How can I read from ARP-Table the MAC-Address of my Router.
I have the Sample "GetPrimaryMACAddress", the Sample is for the
Ethernetadapter.
I need for my DSL-Router...
You don't actually have any information in the arp table that lets
you identify "my DSL-router". It's probably a safe bet that its IP
address is that of the default router, but that is certainly not
guaranteed (i.e., this might be the case for your configuration, at
your house; but it won't be the case for my configuration at my
house, all the time).
In any case, you can do the following:
- the 'arp' command (in the 'network_cmds' project) shows how to
access the arp table in Darwin (see
<http://developer.apple.com/darwin> to get the source)
- see the 'netstat' command (source in the same project) to see
how to get the IP address of the "default router"
Of course, the IP address of the router may not be in the arp table
at any given moment, so you may have to 'ping' the router to get the
arp table reloaded.
Hope this helps.
Regards,
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Director
Institute for the Enhancement of the Director's Income
--------
"Weaseling out of things is what separates us from the animals.
Well, except the weasel."
- Homer J Simpson
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden