This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hosts in LAN

 
S. Ganapathy
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
I am facing one problem while findingout all host machines in the LAN. I want to display all available hosts in the list. Can anybody help me to find all machines (host names/ip addresses) in the local area network
Ganapathy
[ May 16, 2003: Message edited by: S. Ganapathy ]
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think this is possible short of going through JNI, but I'd love to be corrected on this.
- Peter
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think this is possible short of going through JNI, but I'd love to be corrected on this.
You need to be able to send and recieve ARP packets to query a LAN. Since Java does not support raw sockets, as Peter says, you will either have to provide your own native library or find one that's already been built. A few months back, Michael Ernest posted a link to a Java ARP library, but I can't seem to find it by searching here or thru Google. We get so many questions on this subject, if I can find the time, I may just try to create one myself.
 
Murali Nanchala
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this out: Jpcap
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jpcap doesn't support ARP packets either. It does however support ICMP packets. You could write a dirty ping sweep hack if you knew the LAN's subnet. But even that wouldn't be 100%.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic