LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Finding active computer in local network. (http://www.linuxquestions.org/questions/linux-networking-3/finding-active-computer-in-local-network-907454/)

greyblake 10-10-2011 04:09 PM

Finding active computer in local network.
 
Hi guys!
How can I find out what computers in my local network? I need to implement something similar to this:
Quote:

nmap -sP 192.168.0.0/24
But need to implement it using pure C code without calling system().

nmap works pretty fast it doesn't look like it uses usual ping.

Thanks.

sunnydrake 10-10-2011 06:09 PM

grab source code of nmap and dig..
probably multicast ICMP packet or just inject bunch of ARP 223 12.449143 Casa_01:a9:4f Broadcast ARP Who has xxx.xxx.xxx.30? Tell xxx.xxx.xxx.1?
grab wireshark and look

macemoneta 10-10-2011 06:12 PM

You can just read /proc/net/arp and ignore entries with 00:00:00:00:00:00.


All times are GMT -5. The time now is 02:27 AM.