From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 25 15:20:39 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5862B16A4CE for ; Tue, 25 Jan 2005 15:20:39 +0000 (GMT) Received: from smtpx.spintech.ro (smtpx.spintech.ro [81.181.24.231]) by mx1.FreeBSD.org (Postfix) with ESMTP id D284043D53 for ; Tue, 25 Jan 2005 15:20:38 +0000 (GMT) (envelope-from aanton@spintech.ro) Received: from smtpx.spintech.ro (antivirus [15.0.0.1]) by smtpx.spintech.ro (Postfix) with ESMTP id 732D93AB0B; Tue, 25 Jan 2005 14:03:19 +0000 (UTC) Received: from [10.0.0.2] (beastie [10.0.0.2]) by smtpx.spintech.ro (Postfix) with ESMTP id 3E3323A4DB; Tue, 25 Jan 2005 14:03:19 +0000 (UTC) Message-ID: <41F6640D.60705@spintech.ro> Date: Tue, 25 Jan 2005 17:21:49 +0200 From: Alin-Adrian Anton User-Agent: Mozilla Thunderbird 1.0 (X11/20041229) X-Accept-Language: en-us, en MIME-Version: 1.0 To: DJF , freebsd-hackers@freebsd.org References: <20050125094646.GA969@nexus.hta.fhz.ch> In-Reply-To: <20050125094646.GA969@nexus.hta.fhz.ch> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Open-Source: www.opensource.org Subject: Re: Rawsock bpf mambo jambo? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2005 15:20:39 -0000 DJF wrote: > Hi everybody, > > I've recently been looking into raw socket programming. However there's still a question that remains. Maybe it's just a case of RTFM, if so point me to a good manual on the topic. > The man pages indicate that you can do read and write operations with rawsock aswell as bpf. However, in all of the source codes I found, a raw socket was used to write to, and bpf was used to read from the interface. > http://packetstorm.widexs.nl/programming-tutorials/indexdate.html Search for "raw_tcp.tgz" in that page. > What's the advantage in using the rawsock bpf combination instead of > bpf (or raw socket) only? Depends on what best fits your development circumstances. The paper I co-authored uses bpf for reading, and socket for writing. > > Thx in advance, > dave > -- Alin-Adrian Anton GPG keyID 0x1E2FFF2E (2963 0C11 1AF1 96F6 0030 6EE9 D323 639D 1E2F FF2E) gpg --keyserver pgp.mit.edu --recv-keys 1E2FFF2E Never ask a man what OS he uses. If it's FreeBSD, he'll tell you. If it's not, why embarrass him? ..I'm sorry..