LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-07-2007, 09:41 PM   #1
haoyu
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Rep: Reputation: 0
How to acquire local TCP socks?


I'm writing a kernel module about network, in which I need to traverse all ``ESTABLISHED'' TCP connections, and get ``struct sock'' of those matching specific (local IPv6, peer IPv6).

Please tell me which kernel data structures and/or functions should I refer to?
 
Old 09-08-2007, 04:22 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Look into net/socket.c That's the place where nearly all basic socket operations are defined. Also, the function __inet_lookup_established (include/net/inet_hashtables.h) may be useful for you.
 
Old 09-09-2007, 02:05 AM   #3
haoyu
LQ Newbie
 
Registered: Sep 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Mara View Post
Look into net/socket.c That's the place where nearly all basic socket operations are defined. Also, the function __inet_lookup_established (include/net/inet_hashtables.h) may be useful for you.
Thank you very much.
Infact, I've already examined the code of ``__inet_lookup_established'' and found that many of its operations and data structures are port essential ones.
Anyway, I'll check the codes in ``net/socket.c''.
;-)
 
  


Reply



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
specification of local and foreign ip addresses and port number for tcp adilturbo Linux - Networking 7 12-20-2006 05:20 AM
Snort detecting "TCP Portsweep" from local machine to internet IBall Linux - Security 2 10-22-2006 05:46 AM
Unable to acquire an IP Address ras777 Linux - Wireless Networking 13 12-03-2005 11:07 AM
GIMP Acquire question darkranger Linux - Software 1 12-11-2004 07:03 PM
Novell to Acquire Suse jeremy Linux - Distributions 35 11-18-2003 10:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:58 AM.

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
Open Source Consulting | Domain Registration