Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Network Computers

Reply
Thread Tools

Network Computers

 
 
Santy
Guest
Posts: n/a
 
      10-11-2006
Hello Friends,

I am making an application in which i need to list all the computers in
my network.

can anyone suggest any code to accomplish this task.

Thanks
Santosh

 
Reply With Quote
 
 
 
 
santosh
Guest
Posts: n/a
 
      10-11-2006
Santy wrote:
> Hello Friends,
>
> I am making an application in which i need to list all the computers in
> my network.
>
> can anyone suggest any code to accomplish this task.
>
> Thanks
> Santosh


This will depend on the API provided by the underlying OS. This group
deals mainly with ISO C, which has no notion of networks. Ask in a
group which deals with programming under your OS. Generally, there're
fairly portable POSIX APIs to do this, unless you happen to code for
Billy Gates.

 
Reply With Quote
 
 
 
 
Kenneth Brody
Guest
Posts: n/a
 
      10-11-2006
Santy wrote:
>
> Hello Friends,
>
> I am making an application in which i need to list all the computers in
> my network.
>
> can anyone suggest any code to accomplish this task.


This can't be done in standard C. Your networking software may have
some platform-specific calls that you can use. However, to find out
about that, you'll need to check somewhere else -- either the manual
that came with the network or C compiler, or a newsgroup that talks
about your platform.

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <(E-Mail Removed)>

 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      10-11-2006
In article <(E-Mail Removed) om>,
santosh <(E-Mail Removed)> wrote:
>Santy wrote:


>> I am making an application in which i need to list all the computers in
>> my network.


>This will depend on the API provided by the underlying OS. This group
>deals mainly with ISO C, which has no notion of networks. Ask in a
>group which deals with programming under your OS.


Correct so far.

>Generally, there're
>fairly portable POSIX APIs to do this, unless you happen to code for
>Billy Gates.


Unfortunately that part is not correct. There are no POSIX APIs
to enumerate all the computers in any network -- not even if one
confines oneself to a particular subnet. No matter what API you
use on computer X, computer Y might be programmed to ignore all
packets from computer X.

--
If you lie to the compiler, it will get its revenge. -- Henry Spencer
 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      10-11-2006
On Wed, 11 Oct 2006 16:47:45 +0000 (UTC), in comp.lang.c ,
http://www.velocityreviews.com/forums/(E-Mail Removed)-cnrc.gc.ca (Walter Roberson) wrote:

>In article <(E-Mail Removed) om>,
>santosh <(E-Mail Removed)> wrote:
>>Santy wrote:

>
>>> I am making an application in which i need to list all the computers in
>>> my network.


>>Generally, there're
>>fairly portable POSIX APIs to do this, unless you happen to code for
>>Billy Gates.

>
>Unfortunately that part is not correct. There are no POSIX APIs
>to enumerate all the computers in any network -- not even if one
>confines oneself to a particular subnet. No matter what API you
>use on computer X, computer Y might be programmed to ignore all
>packets from computer X.


The Billy Gates part is also incorrect. Unless you're running an
antique version of Windows from the early nineties (in which case, you
ought to mention Stevie J too) it'll respond to much the same
protocols as any other networked device.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
Reply With Quote
 
Gordon Burditt
Guest
Posts: n/a
 
      10-12-2006
>>Unfortunately that part is not correct. There are no POSIX APIs
>>to enumerate all the computers in any network -- not even if one
>>confines oneself to a particular subnet. No matter what API you
>>use on computer X, computer Y might be programmed to ignore all
>>packets from computer X.

>
>The Billy Gates part is also incorrect. Unless you're running an
>antique version of Windows from the early nineties (in which case, you
>ought to mention Stevie J too) it'll respond to much the same
>protocols as any other networked device.


Are you claiming that no recent version of Windows has a working
firewall that can block all packets from a particular IP or netblock?
("recent" includes at least Windows XP) Even if that's true, I can
still put a Cisco router in between that computer and the outside
world to implement that block.

 
Reply With Quote
 
Santy
Guest
Posts: n/a
 
      10-12-2006

Santy wrote:
> Hello Friends,
>
> I am making an application in which i need to list all the computers in
> my network.
>
> can anyone suggest any code to accomplish this task.
>
> Thanks
> Santosh




for coding The application i am using the Gcc C compiler on Linux
Platform.

 
Reply With Quote
 
Ancient_Hacker
Guest
Posts: n/a
 
      10-12-2006

Santy wrote:
> Hello Friends,
>
> I am making an application in which i need to list all the computers in
> my network.
>
> can anyone suggest any code to accomplish this task.
>
> Thanks
> Santosh



sure: system( "nmap -Sp >/tmp/MyOut.Txt" )

That's a joke of sorts.

There is nothing in C itself to have anything to do with networks.

But with the system() function you can run an external program.
Luckily there's a free program called "nmap" that can do a pretty
awesome job of peeking at a network. Use google to find where to
download nmap source or binary and go to it!

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      10-12-2006
Santy wrote:
> Santy wrote:
>>
>> I am making an application in which i need to list all the
>> computers in my network.
>>
>> can anyone suggest any code to accomplish this task.

>
> for coding The application i am using the Gcc C compiler on Linux
> Platform.


This is off-topic for c.l.c. The C language knows zip about
networks. Find a newsgroup with the word 'linux' in its name.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
One of two computers can't access network =?Utf-8?B?bWlrZWluYnZvcmRj?= Wireless Networking 1 08-21-2012 06:35 AM
Cannot see workgroup computers by ''view workgroup computers'' - important! kimiraikkonen Computer Support 5 02-07-2007 12:06 PM
Computers Enabled Inc - Cheap Notebook Computers KUTEATLBOI@gmail.com Computer Information 0 03-09-2006 04:42 AM
Cannot network 2 computers together! =?Utf-8?B?Uy4gRGF5?= Wireless Networking 2 11-01-2004 11:17 PM
Network recognition, yet cant see workgroup computers Ranjan Wireless Networking 5 09-24-2004 06:20 AM



Advertisments