Packet capture library

Is there any packet capture library like libpcap used in mitmproxy. Is pathod similar to it