Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need to check if mac address is connected to local network. I think pinging it is the best option.

What I have tried:

Sending ARP request to all ips and then checking which is mac I'm looking for, but it's not so effective.
Posted
Updated 19-May-16 3:05am
Comments
Sergey Alexandrovich Kryukov 18-May-16 19:43pm    
Please, your platform? Or do you want a cross-platform solution?
—SA
Cansisti 19-May-16 2:23am    
Windows, as in topic (8.1)
Sergey Alexandrovich Kryukov 19-May-16 8:37am    
Yes, thank you. I answered, but on "ping"; and only later noticed it was about MAC address.
—SA
Cansisti 19-May-16 9:45am    
It's not strict about ping, I just thought ping is the best method to check if something is online
Sergey Alexandrovich Kryukov 19-May-16 12:31pm    
No, it has nothing to do with MAC address. You may need to search on "MAC address discovery". But why, I wonder?
—SA

1 solution

Probably your best bet is to retrieve all the MAC addresses on the LAN segment, and compare them manually.
That's not too difficult to do: Retrieving IP and MAC addresses for a LAN[^] shows how - it's in C# rather than C++, but it's all via calls to unmanaged methods, and as such should be simple to convert to C++.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900