How can I enumerate all machine names and IPs of remote computers in the local network ?
Note: NOT on Windows (how to do that one finds via google), I need something that works on Linux !
Or a C/C++ sample would also do it, I can call libc from C#.
views:
101answers:
2
A:
The easiest way would be to send out a broadcast icmp packet, and see who responds, and count that. This should be doable in a pretty standard manner with any programming language that has standard networking libraries for tcp/ip.
supercheetah
2010-08-21 19:23:37
You mean ping an entire range.
Quandary
2010-08-21 22:05:43
That's what ping does, it sends an ICMP packet out with an echo request. If it's sent out to the broadcast address for the network, all the computers on the network will see it and respond. This is something that is basic to networking concepts. The broadcast address is the IP address AND'ed with the subnet mask. Try it with ping, and you'll see what I'm talking about (in Linux, ifconfig will tell you what the broadcast address is for the network, and also make sure your router allows these packets).
supercheetah
2010-08-22 08:10:45
The idea is good, just that none of the computer responds. I read that so far, that's pretty normal.
Quandary
2010-09-02 12:20:08