Logging user id and process id of packets
Hi,
I would like to write a program which displays the user id and process id of all packets traversing the output chain.
I found some information about the owner module, but this allows only to filter based on a user id.
I took also a look at the pcap library, the ulog and libipq but can not find any function, that returns me the user id or the process id of a packet.
Does anybody know how to get this information?
Sascha
Quoted 4 lines · On 3/28/06, [email protected] <[email protected]> wrote:
Hi,
I would like to write a program which displays the user id and process id of all packets traversing the output chain.
Quoted 8 lines
I found some information about the owner module, but this allows only to filter based on a user id.
I took also a look at the pcap library, the ulog and libipq but can not find any function, that returns me the user id or the process id of a packet.
Does anybody know how to get this information?
Sascha
You need to get the inode for the connection (possibly using /proc/net/tcp) and then find the process which has that inode open.
- Daniel De Graaf