Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

hosts in LAN

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this out: Jpcap
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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%.
 
reply
    Bookmark Topic Watch Topic
  • New Topic