I'm looking for a way to dump pcap of network data generated by an application, in a simmilar way strace dumps syscalls, etc. eg:
net-strace somecommand -args
somecommand would do something over the network, and net-strace would save a pcap dump of all the traffic generated by that app (+ replies and related traffic).
Can this be achieved?