From owner-freebsd-net@FreeBSD.ORG Mon Jul 28 19:13:17 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7092037B401 for ; Mon, 28 Jul 2003 19:13:17 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0BC943FA3 for ; Mon, 28 Jul 2003 19:13:16 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc12) with ESMTP id <2003072902131001400amnjse>; Tue, 29 Jul 2003 02:13:10 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id TAA08327; Mon, 28 Jul 2003 19:13:06 -0700 (PDT) Date: Mon, 28 Jul 2003 19:13:04 -0700 (PDT) From: Julian Elischer To: Paolo Pisati In-Reply-To: <20030728224737.GA47439@newluxor.skynet.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: FreeBSD_Net Subject: Re: Differences between netgraph nodes in 4.x and 5.x X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Jul 2003 02:13:17 -0000 Netgraph in 5.0 had to be alterred to support SMP locking. at teh same time some 'simplificatiosn were made, however changing a driver from one, to work witht he orther is relatively simple.. Major changes: Instead of passing separate message and o-o-band data, both are attached to a single 'item' which is passed. You need to keep track of, and free if neccesary, the 'item'. You can extract the message and oob data from the 'item' simply, using the macro's supplied.. In 4.x the functions take teh message and oob data separatly as arguments. Ther eis no "item" so you don't need tr keep track of it. In 5.x you can send a control message to whoever is on the other end of a link. In 4.x you need to get the address and send it there. If you want to send me the node you have writen I can make the diffs and send it back :-) The init functions have very subtly changed Instead of your init routine calling teh common code, it is called by teh framework first so that it is already called bty teh time your code is called. Examine the two "ng_sample.c" source files and examine the differences.. On Tue, 29 Jul 2003, Paolo Pisati wrote: > > As the subject says, > i developed a netgraph node (it's classifier node) > using a 5.x box but tonight, i had a bad > surprise: > > it seems the netgraph implemntation in 4.x and 5.x > are different, so now. > > Could someone shed some light on the differences, please? > > Thanks. > > -- > > Paolo > > GUFI: http://www.gufi.org > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" >