PID of process that owns TCP Socket

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

 



Hi all:

This is what I would like to do: I have written a module that intercepts all incoming and outgoing TCP packets using the netfiltering hooks provided by the networking stack. Is there some way of getting at the PID of the process that owns the socket from the TCP packets (sk_buff structures) that I intercept? I know I can get to the INET socket structure (struct sk) and hence its corresponding BSD socket (struct socket), but how do I get to the process pid from there?

Any help will be appreciated.

Thanks,

Vishwas

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