From owner-freebsd-net@FreeBSD.ORG Fri Oct 5 14:41:35 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D2F216A468 for ; Fri, 5 Oct 2007 14:41:35 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from pobox.codelabs.ru (pobox.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 25DA313C4AC for ; Fri, 5 Oct 2007 14:41:34 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender:X-Spam-Status:Subject; b=ROxAYlFzus3RMBefjIlh+I1+jWoEisooV1Mt42/Kw4xWPY5zA5VKJlC/jZmRxWUXQLN8NbFlzE40oiQ5/uKnkez323xdvBfT4Ac3dQKhr0ztcSJpP4CyqomQQU3tuZvLAPb4TIV/OZAQrQji5e+Uni5CaGnNAfKHIaU6yHkRlPE=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by pobox.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1IdoMu-000AcI-Vf; Fri, 05 Oct 2007 18:41:33 +0400 Date: Fri, 5 Oct 2007 18:41:28 +0400 From: Eygene Ryabinkin To: Vinod VM Message-ID: <20071005144128.GU971@void.codelabs.ru> References: <8de278a20710050424t68cf95eap99cd34a13e8ce594@mail.gmail.com> <20071005120406.GQ971@void.codelabs.ru> <8de278a20710050659y55cbc312le303f1b44452b605@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <8de278a20710050659y55cbc312le303f1b44452b605@mail.gmail.com> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-2.2 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_20 Cc: freebsd-net@freebsd.org Subject: Re: cant compile - undefined reference to `bpfattach' X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2007 14:41:35 -0000 Fri, Oct 05, 2007 at 07:29:35PM +0530, Vinod VM wrote: > Yes. I am trying to write a program to capture from an interface and > inject them to another, kind of like bcrelay functionality in poptop > [http://www.poptop.org/] You can examine the divert sockets in FreeBSD: seems like that this will suite you too. 'man 4 divert' will give you some clues. The example of divert sockets usage is the natd program. > > If you're trying to capture packets, you'll probably want to > > consult the pcap(3) manual page. > > Thanks! Does it support injecting packets into an interface? Yes, pcap_inject and pcap_sendpacket. But this can be done via the raw sockets too. Again, 'man 3 pcap' is your friend ;)) -- Eygene