From owner-freebsd-questions Mon Aug 13 1:11:48 2001 Delivered-To: freebsd-questions@freebsd.org Received: from hotmail.com (f148.pav2.hotmail.com [64.4.37.148]) by hub.freebsd.org (Postfix) with ESMTP id E22B637B405 for ; Mon, 13 Aug 2001 01:11:45 -0700 (PDT) (envelope-from twchim1@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 13 Aug 2001 01:11:45 -0700 Received: from 147.8.182.48 by pv2fd.pav2.hotmail.msn.com with HTTP; Mon, 13 Aug 2001 08:11:45 GMT X-Originating-IP: [147.8.182.48] From: "Wing Tim" To: freebsd-questions@FreeBSD.ORG Subject: Programming on Berkeley Packet Filter (bpf) Date: Mon, 13 Aug 2001 16:11:45 +0800 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 13 Aug 2001 08:11:45.0658 (UTC) FILETIME=[97E3DDA0:01C123CF] Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi all, From the man page of BPF(4), I found there're lots of useful functions such as BIOCGBLEN, BIOCSBLEN, BIOCGDLT, ... , BIOCGSTATS. I tried to write a should program to use these functions as follows: # include # include # include # include main () { printf(BIOCGBLEN); ... } Then I met the error "Segmentation fault (core dumped)", I guess it is because I haven't specified any interface. Is it right? By the way, how can I specify which interface I want to snoop data on? Could anyone kindly give me a help? Thanks! Regards, Wing _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message