Libpcap: Set a filter. (C)

Hi

I'm reading about the libpcap documentation. I see that with the function:

pcap_setfilter ( pcap_t *p, struct bpf_program *fp)

we can choose to take one packet instead another.
I read that the struct bpf_program allow us to create a packet filter , ....so if I want just sample some pkts at a given rate, for example I'd like to take 1 packet every 10 (no matter which sourc or dest), have I to set in the right way the struct bpf_program?
Or is there another way?

thx in advance

Dedalus.

Why not just use pcap_loop() and have have a simple counter in your callback function to only actually process every 10th packet.

Thanks

I will try and I'll report the result. (Hope soon!)

Dedalus.