This is a simple tool for capturing all packets of an interface and convert everything into a PCAP file.
During the implementation of this tool the lsniffer.c file provided here and here was used and adapted.
After starting, the tool fetches all interfaces of the system and prints them to stdout. Via stdin one interface must be selected to be captured. This interface will be used and all packets will be written into a PCAP file named "log.pcap".
Building and executing the tool:
make
./interface_to_pcap
Cleaning the repository (the binary and log.pcap will be deleted):
make clean
It is pretty simple to extend this tool with a packet filter or similar to get a more detailed capture.