From owner-freebsd-hackers Wed Apr 4 1:20:11 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from relay1.ntu-kpi.kiev.ua (www.ntu-kpi.kiev.ua [212.111.192.161]) by hub.freebsd.org (Postfix) with ESMTP id A9C0B37B71F for ; Wed, 4 Apr 2001 01:20:05 -0700 (PDT) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: from comsys.ntu-kpi.kiev.ua (eth0.comsys.ntu-kpi.kiev.ua [10.0.1.184]) by relay1.ntu-kpi.kiev.ua (Postfix) with ESMTP id D24C330495 for ; Wed, 4 Apr 2001 11:19:59 +0300 (EEST) Received: from pm5149 (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) by comsys.ntu-kpi.kiev.ua (8.11.3/8.11.3) with SMTP id f348HBs02223 for ; Wed, 4 Apr 2001 11:17:11 +0300 (EEST) Message-ID: <007801c0bcd6$90784c00$6d36120a@comsys.ntukpi.kiev.ua> From: "Andrey Simonenko" To: Subject: Is it possible to use some BPF filters in one process, in some threads? Date: Wed, 4 Apr 2001 11:12:09 +0400 MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi I want to add BPF support to IPA (/usr/ports/sysutils/ipa). But I want to use one process for some BPF filters. I'm going to use pcap(3) library, because it understands human filter requests in pcap_compile(3). So, here is my question. Is it possible to use some pcap_dispatch(3) functions in one process? I need to use pcap_dispatch(3) only for counting number of bytes, I don't need to check network packets. If it possible to use some pcap_dispatch(3) functions and BPF filters will not lose network packets (on fast network traffic), how is it better to implemet this? I am not sure that it will be correct to call somehow pcap_dispatch(3) functions in loop and here is my second question. Is it possible to use pcap(3) routines in different threads? Is pcap(3) library thread safe? Thanks in advice. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message