Networking Forums

Networking Forums > Computer Networking > Linux Networking > detecting tcp/udp socket bind in kernel module

Reply
Thread Tools Display Modes

detecting tcp/udp socket bind in kernel module

 
 
hari_kannan@hotmail.com
Guest
Posts: n/a

 
      03-21-2007, 05:34 PM
Hi,

I want to detect tcp/udp socket binds programmatically i.e. I want to
write a module which will "know" whenever any tcp/ip application does
a tcp or udp socket bind. In SLES9/RHEL3.X versions, we used to trap
the "bind" function in inet_dgram_ops and tcpsniff_bind, but in SLES10/
RHEL4.x versions, those variables have become "const" in af_inet.c

What we did before was

udp.save_bind = inet_dgram_ops.bind;
udp.save_release = inet_dgram_ops.release;
inet_dgram_ops.bind = udpsniff_bind;
inet_dgram_ops.release = udpsniff_release;

and

tcp.save_bind = inet_stream_ops.bind;
tcp.save_release = inet_stream_ops.release;
inet_stream_ops.bind = tcpsniff_bind;
inet_stream_ops.release = tcpsniff_release

I cant do that anymore because inet_stream_ops and inet_dgram_ops are
const in SLES10.

Any ideas?

Thanks a lot!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
How to get data in kernel SEND buffer for a TCP socket from a netfilter based kernel module Rohit Linux Networking 0 05-10-2007 11:27 AM
Kernel module W.P. Linux Networking 9 04-04-2007 06:36 PM
killing a kernel thread ....... UDP server (kernel module)......... alex Linux Networking 0 09-20-2006 11:26 AM
UDP server as a kernel module alex Linux Networking 2 09-04-2006 09:48 AM
Help for socket programming as kernel module sank Linux Networking 1 02-05-2004 04:32 PM



1 2 3 4 5 6 7 8 9 10 11