Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello, I want to obtain a table of ip's that are reachable in LAN.
Something like method 2 in this article: Determine IP Address From a MAC Address[^]
And I need to do so using raw winsock2.h only.

What I have tried:

Pinging every single ip by given submask - this takes way too long.

And this this[^] tutorial, which doesn't compile for me.

EDIT:
I know tutorial above is c#. If anyone could tell me how to convert it to c++ correctly?
Posted
Updated 21-May-16 6:08am
v2
Comments
Dave Kreskowiak 21-May-16 13:35pm    
There are only two ways to know if a device is at an IP or not. One is to ping it, the other is to actively try to connect to it on every possible port, and even then it's not guaranteed that there is NOT a device at that IP.

The device could be setup to not respond to pings or it could be on the other side of a firewall or router filtering out such communication.

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