Hi, Thomas
please see the reply followed
2006/1/25, Thomas Petazzoni <thomas.petazzoni@xxxxxxxx>:
Hi,
Hsieh Steve a écrit :
> I have some problem to access file in kernel space
Do not try to access a file from kernel space.
Could u explan "Dont try to access files in kernel space?"
it this any drawback??
> since I want to get the info about current connection status(tcp/udp flow, local
> in or forwading ) in my module
> with ip_contrack/netfilter not compiled in
> I know no other ways to get this info but to access /proc/net/tcp or
> proc/net/udp ....
If these informations are available through a /proc, it means that they
are available in the kernel without having to open a /proc/something.
Have you looked at how /proc/net/tcp is implemented in the kernel ?
After a very quick look, it seems to be implemented at
http://lxr.linux.no/source/net/ipv4/tcp_ipv4.c#L2394.
You are right, the infomation I need is available in kernel through invoking tcp_get_info()
(kernel version 2.4.25)
However, this func is written in tcp module and not exposed as a kernel symbol, so that
I can not call this func in my module.
Sincerly,
Steve
Sincerly,
Thomas
--
Thomas Petazzoni
thomas.petazzoni@xxxxxxxx
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/