LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-29-2004, 02:13 AM   #1
pavgust
Member
 
Registered: May 2003
Distribution: Debian
Posts: 40

Rep: Reputation: 15
Network Programming Questions - please help


Hi all,

There are a few things i'll need for my next programming project. Code snippets and/or pointers to relevant documentation would be greatly appreciated.

I need code/shell scripts/anything that can achieve one or all of the following:

1. List all open ports on the machine (is there a more low-level way than a portscan?)
2. Find out which program/process ID is associated with each open port.
3. Find out how much bandwidth each open port uses (would that have to be done by IP accounting?)
4. Attach handler functions to be called (a) before a process opens a port, and (b) after a port is closed.
5. Find out about all currently active network connections and the relevant programs/process IDs (note - this is more than just 1&2, since for server ports you can have several connections per port)

I'd be grateful for any help/ideas you might have.

Cheers,

P



 
Old 03-29-2004, 02:04 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
I'm unsure about 4 - I'll move this to Programming as you are likely to get better responses there.

For all others you can use netstat. For example:
netstat -anp
 
Old 03-29-2004, 03:37 PM   #3
pavgust
Member
 
Registered: May 2003
Distribution: Debian
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks for the reply, reading the friendly man-page

The answer to 4 would be of particular interest.............
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
questions about programming... efm Programming 12 11-29-2005 02:58 PM
2 programming questions hk_michael Programming 4 02-01-2005 01:02 AM
where to get PL/SQL programming questions? AskMe Programming 2 11-14-2003 11:50 AM
programming questions eboats Linux - General 19 10-22-2001 06:15 PM
programming questions eboats Programming 4 10-17-2001 03:15 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration