I'm currently using pcap in C++ to read a tcp packet. The problem is I'm confused as to how I go about reading if the packet is using an IRC protocol and then how do I read the commands that are sent from and to the IRC client and server? For instance, using wireshark I'm able to see if the protocol is IRC and I'm able to see all of the commands and parameters given. I'm trying to do the samething in pcap. Is there a IRC specific header struct used for reading the portion of a TCP packet?
IRC is based on rfc 2812 and you can get all the details here