This is a small source code what get a device port(e.g : eth0) through pcap_lookupdev function .
This is a small source code what open and close net port through pcap_open_live function base on packet_port_get.c .
This is a small source code what get a net packet through pcap_nest function base on packet_port_open.c .
This is a small source file what get many net packet through pcap_loop function base on packet_port_open.c .
If you can get net packet ,then you need use this header file to analysis net packet data (ps: header of packet data) .
Yes ,Once you can get net packet ,you can use this header file to analysis a five_tuple .
This is a source code what you can create a socket .
This is a source code what connet other socket(ps: client) .
This is a source code what  send massage to other socket(ps: client) .