Skip to contentSkip to conversation

Logging user id and process id of packets

DISCUSSION [email protected] 2 participants 2 messages Mar 28, 2006 netfilter

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
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