Local MAC address connected to incoming 'recvfrom' UDP message

  • Follow


Hello all,

For a little project of mine I need to return my local MAC address to
whomever sends a certain UDP message.

The preferred way would be to use a command which, in an WSAAsyncSelect
callback-message, accepts the socket and than returns the MAC address the
socket received the recvfrom message with.  But I'm open to suggestions to
other methods :-)

An added problem: I'm using INET_ANY to create the listening UDP socket, and
have three adapters over which the request can come in (meaning that a
"getsockname" does not return a usable IP).

Regards,
Rudy Wieser

P.s.
I think I've found a very round-about way to get the MAC address (using the
callees IP and parsing the 'getadaptersinfo' result to see if I can find a
match), but cannot say I like the solution.  I get the feeling it can be
done much simpler.



0
Reply R 3/28/2011 4:00:27 PM

R.Wieser a �crit :

> For a little project of mine I need to return my local MAC address to
> whomever sends a certain UDP message.


If you want to get the Mac address, you can see the KB118623
or SnmpExtensionQuery()
or GetIpAddrTable()
0
Reply Christian 3/28/2011 7:34:31 PM


1 Replies
430 Views

(page loaded in 0.022 seconds)

Similiar Articles:













7/27/2012 8:49:15 AM


Reply: