From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 23 19:00:41 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org 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 B22CA16A49E; Fri, 23 Jun 2006 19:00:41 +0000 (UTC) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 714DC43D4C; Fri, 23 Jun 2006 19:00:41 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.23.241]) ([10.251.23.241]) by a50.ironport.com with ESMTP; 23 Jun 2006 12:00:41 -0700 Message-ID: <449C3A58.6000709@elischer.org> Date: Fri, 23 Jun 2006 12:00:40 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.13) Gecko/20060414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Watson References: <006701c696ad$81b41850$2bba90c1@Altair> <20060623145326.U12942@fledge.watson.org> In-Reply-To: <20060623145326.U12942@fledge.watson.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Johnny Choque , freebsd-hackers@freebsd.org Subject: Re: Virtual device driver programming X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jun 2006 19:00:41 -0000 Robert Watson wrote: > > On Fri, 23 Jun 2006, Johnny Choque wrote: > >> I'm interested in programming a virtual network device driver -Linux >> concept- on a FreeBSD box. The idea behind of this sort of interface >> is the following: >> >> "From the kernel's point of view, a network interface is a software >> object that can process outgoing packets, and the actual transmission >> mechanism remains hidden inside the interface driver. Even though >> most interfaces are associated to physical devices (or, for the >> loopback interface, to a software-only data loop), it is possible to >> design network interface drivers that rely on other interfaces to >> perform actual packet transmission. The idea of a ``virtual'' >> interface can be useful to implement special-purpose processing on >> data packets while avoiding to hack with the network subsystem of the >> kernel." >> >> I know that is not too complicated to program this sort of >> functionality in linux but I would like to do it over freebsd, has >> anybody some idea on how could I start doing it? I've been searching >> in the freebsd handbook but I haven't found anything really relevant. > > > tap(4) and tun(4) describe pseudo-devices you can use to instantiate > ethernet and tunnel interfaces from user space. Programs attach to > pseudo-devices, and using read/write operations on the pseudo-device, > can receive and generate packets on the network interface. In kernel, > the ifnet(9) API is used to implement network interfaces -- nothing in > the API requires that the under-side of a network interface be > hardware. In fact, a great many network types without underlying > hardware have been implemented, including the loopback interface, > encapsulation interfaces, and the tap/tun interface > drivers. > there is also gif(4) as well and if that is not enough the netgraph system gives you a toolkit to make your own kernel based virtual network interfaces. (ng_iface, ng_ether, ng_eiface (and others)) > Robert N M Watson > Computer Laboratory > University of Cambridge > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org"