Using C, what ports are being used by which programs?

Using C, what ports are being used by which programs?

Post by jmt » Fri, 23 Jun 2000 04:00:00



Using a C written program, is there a way to find out what programs are
using what tcp ports? Is this possilble and if so, where can I find examples
in C to do this? Or, where to start?

The C utility would be written under AIX 4.3.2 and SCO 5.0.5

Appreciate your input.

Thanks,
Jeff

 
 
 

Using C, what ports are being used by which programs?

Post by Barry Margoli » Sat, 24 Jun 2000 04:00:00




>Using a C written program, is there a way to find out what programs are
>using what tcp ports? Is this possilble and if so, where can I find examples
>in C to do this? Or, where to start?

>The C utility would be written under AIX 4.3.2 and SCO 5.0.5

Download "lsof" and see how it does it.  There's no standard way, and the
authors of this program have dug up the ways to do it on most systems.

--

Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

Using C, what ports are being used by which programs?

Post by jmt » Sat, 24 Jun 2000 04:00:00





> >Using a C written program, is there a way to find out what programs are
> >using what tcp ports? Is this possilble and if so, where can I find
examples
> >in C to do this? Or, where to start?

> >The C utility would be written under AIX 4.3.2 and SCO 5.0.5

> Download "lsof" and see how it does it.  There's no standard way, and the
> authors of this program have dug up the ways to do it on most systems.

> --

Thanks, I never heard of the utility... I'll try to look for it.

- Jeff

 
 
 

Using C, what ports are being used by which programs?

Post by avalo.. » Sat, 24 Jun 2000 04:00:00





>> Download "lsof" and see how it does it.  There's no standard way, and the
>> authors of this program have dug up the ways to do it on most systems.
> Thanks, I never heard of the utility... I'll try to look for it.

Take a look at Freshmeat.net for that, if you haven't already found it.  I
was looking for that utility at one time as well (found a weird port open
in netstat and was looking for who it belonged to) and found it there.

--
----------------------------------------------------------------------

Software Developer  //  Gamer  //  Webmaster  //  System Administrator
      -= We are dyslexic of Borg - Your ass will be laminated =-

 
 
 

Using C, what ports are being used by which programs?

Post by Vic Abe » Sun, 25 Jun 2000 04:00:00






>>> Download "lsof" and see how it does it.  There's no standard way, and the
>>> authors of this program have dug up the ways to do it on most systems.
>> Thanks, I never heard of the utility... I'll try to look for it.
>Take a look at Freshmeat.net for that, if you haven't already found it.  I
>was looking for that utility at one time as well (found a weird port open
>in netstat and was looking for who it belonged to) and found it there.

Lsof's home "port" (couldn't resist  :-) is:

        ftp://vic.cc.purdue.edu/pub/tools/unix/lsof

There you will find source code, some binaries, and several methods
to verify source authenticity.

Vic Abell, lsof author

 
 
 

Using C, what ports are being used by which programs?

Post by jmt » Sun, 25 Jun 2000 04:00:00


Thanks to all that helped....

- Jeff

 
 
 

Using C, what ports are being used by which programs?

Post by Todd Lyon » Mon, 03 Jul 2000 04:00:00



> >> Download "lsof" and see how it does it.  There's no standard way, and the
> > Thanks, I never heard of the utility... I'll try to look for it.
> Take a look at Freshmeat.net for that, if you haven't already found it.  I
> was looking for that utility at one time as well (found a weird port open
> in netstat and was looking for who it belonged to) and found it there.

From a bash shell on Linux, a good way of finding open ports is:
    lsof -P | grep ":"
If you want to see the port name instead of the port number, drop the
-P.
--
Blue skies...           Cannonball      http://www.veryComputer.com/
* People are more *ly opposed to fur than leather because *
*   it's safer to harrass rich women than motorcycle gangs.     *