i am writing a code to search tcp payload of every packet in a libpcap file, to search for a string.
so what i am trying to do is,
pcap_handle_in = pcap_open_offline(infile, pcap_errbuf);
.
.
.
while (pcap_next_ex(pcap_handle_in, &pcap_header, &pcap_packet) > 0) {
.
.
if (memmem(packet, len, search, strlen(search))) {
found++;
}
it is working fine, but it will print also those packets , containing this string as a sub-string. i want to eliminate this sub-string packets. but coudn figure out how.
suggestions pls..