As the title states is there a means (kernel mode API) under Linux (any distro) that can identify the application path of a process that makes a connect() call and is attempting to access the internet ? Vice versa in the same respect if the application is attempting to receive a TCP data packet is it possible to identify the process that is receiving the packet? I need to be able to map and log programmatically such details whether the process is executing in kernel or user mode. 
IS there a means of identifying the application path for the process which attempts to access the internet on a linux distributution?
linux;linux kernel;tcp ip