Ethereal-users: [Ethereal-users] Newbie : bpf filtering format

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Barnaud, Jacques, ASE73" <jacques.barnaud@xxxxxxxxxxxxxx>
Date: Tue, 4 Jun 2002 17:28:15 +0200
Hi,
I am not sure it is the right place to post this message, but I hope someone
will help me ...

I am currently writing an application to filter the content of an UDP
datagram.
I read the bpf man page, and learned a bit about BPF syntax, and more
precisely about the bpf_program struct.
(struct bpf_program {
 int bf_len; 
struct bpf_insn *bf_insns; 
};)

I would like to know if there is an easy way to calculate the bf_len field
for and hand written filter program... (or a place to get this information)

Thanks for any help.
Jacques