Re: file access in kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

> 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.

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/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux