From owner-freebsd-hackers Thu Apr 5 0: 5:32 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 DB3B437B449 for ; Thu, 5 Apr 2001 00:05:20 -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 C517E2FE91; Thu, 5 Apr 2001 10:05:10 +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 f356uEk02831; Thu, 5 Apr 2001 09:56:14 +0300 (EEST) Message-ID: <002901c0bd94$6ec222c0$6d36120a@comsys.ntukpi.kiev.ua> From: "Andrey Simonenko" To: "Mike Wade" Cc: References: Subject: Re: Is it possible to use some BPF filters in one process, in some Date: Thu, 5 Apr 2001 09:51:03 +0400 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" 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 Currently ports/sysutils/ipa supports IPv4/v6 Firewall and IP Filter, so I implemented it already. Sometime admins want to count bytes on Ethernet segment (for example). As I know IP Firewall and IP Filter can't catch all bytes on interface (interface is switched to promiscuous-mode). If I'm wrong please tell me how to do it with IP Firewall and IP Filter. I tried to test pcap(3) library, but unfortunately it is not well documented (for me at least). Also I didn't find any good documentation in Internet. So any advice with pcap(3) are welcome. ----- Original Message ----- From: Mike Wade Newsgroups: lucky.freebsd.hackers Sent: 4 april 2001. 16:57 Subject: Re: Is it possible to use some BPF filters in one process, in some > On Wed, 4 Apr 2001, Andrey Simonenko wrote: > > > 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. > > Why not use ipfw's count command instead? Example: > > [root@net-ninja]:~> ipfw add 10 count ip from any to 192.168.1.1 in recv fxp0 > [root@net-ninja]:~> ipfw add 11 count ip from 192.168.1.1 to any out xmit fxp0 > [root@net-ninja]:~> ipfw show 10 11 > 00010 7 430 count ip from any to 192.168.1.1 in recv fxp0 > 00011 2 187 count ip from 192.168.1.1 to any out xmit fxp0 > > Second column reports packets xfered, thrid column reports bytes xfered. > > --- > Mike Wade (mwade@cdc.net) > Chief Technical Officer > CDC Internet, Inc. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message