Im trying to analyze traffic network using libpcap in C language. I would like to filter packets by process PID. I've been doing research and apparantly pcap can't do what I want but netstat can give me information about traffic with process pid.
Is this ugly to call "system("netstat - apn")" or is there any other library in C/C++ that I could use ? I want my programm running under Linux and Windows.