I am trying to make something like a firewall but it isnt a firewall it is just suppose to see all the incomming and outgoing connections of each port. And put the IP address and port into a .txt file. Basicly creating a log of incomming and outgoing connections.
While Wireshark is a great tool I, think it is a little hard to digest for something as simple as grabbing packets. It is probably easier to concentrate on the underlying libpcap to get started and move up from there.