From owner-freebsd-questions Mon Aug 13 8:46:21 2001 Delivered-To: freebsd-questions@freebsd.org Received: from hotmail.com (f202.pav2.hotmail.com [64.4.37.202]) by hub.freebsd.org (Postfix) with ESMTP id 9875837B407 for ; Mon, 13 Aug 2001 08:46:10 -0700 (PDT) (envelope-from twchim1@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 13 Aug 2001 08:46:10 -0700 Received: from 147.8.145.21 by pv2fd.pav2.hotmail.msn.com with HTTP; Mon, 13 Aug 2001 15:46:10 GMT X-Originating-IP: [147.8.145.21] From: "Wing Tim" To: freebsd-questions@FreeBSD.ORG Subject: Programming on Berkeley Packet Filter (bpf) Date: Mon, 13 Aug 2001 23:46:10 +0800 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 13 Aug 2001 15:46:10.0299 (UTC) FILETIME=[12E1ECB0:01C1240F] 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