Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2001 16:11:45 +0800
From:      "Wing Tim" <twchim1@hotmail.com>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Programming on Berkeley Packet Filter (bpf)
Message-ID:  <F148LiC1h1jYhAOylhg000080d8@hotmail.com>

next in thread | raw e-mail | index | archive | help
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 <sys/types.h>
# include <sys/time.h>
# include <sys/ioctl.h>
# include <net/bpf.h>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F148LiC1h1jYhAOylhg000080d8>