Hi,
How can i set the pcap filter to capture only UDP frames?
Consulting the documentation of pcap i found that i should use pcap_compile and in the 3rd argument i enter the filter string
when i enter
1 2 3 4 5 6 7 8
filter=(char*)"ip proto udp";
if (pcap_compile(adhandle, &fcode,filter, 1, netmask) <0 )
{
fprintf(stderr,"\nUnable to compile the packet filter. Check the syntax.\n");
/* Free the device list */
pcap_freealldevs(alldevs);
exit(1);
}
i receive frames where the protocol feild differs from 17 ( the value of udp protocol)
Please any idea to solve this?
Thanks