From owner-freebsd-net@FreeBSD.ORG Tue Dec 27 09:30:42 2011 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 71F4B1065680 for ; Tue, 27 Dec 2011 09:30:42 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (unknown [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 143288FC0A for ; Tue, 27 Dec 2011 09:30:42 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id pBR9UdeL043473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 27 Dec 2011 01:30:40 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id pBR9Ud1a043472; Tue, 27 Dec 2011 01:30:39 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 ([192.168.200.81]) by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA27771; Tue, 27 Dec 11 01:27:47 PST Date: Tue, 27 Dec 2011 08:27:48 -0800 From: perryh@pluto.rain.com To: egrosbein@rdtc.ru Message-Id: <4ef9f204.c2ZP2f73gFwo7lUU%perryh@pluto.rain.com> References: <20111226143421.GB17435@DataIX.net> <4ef9c41f.rC8YkQQx738CJ3EN%perryh@pluto.rain.com> <4EF975FC.5080604@rdtc.ru> In-Reply-To: <4EF975FC.5080604@rdtc.ru> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: iwc2010005@gmail.com, freebsd-net@freebsd.org, jhell@DataIX.net Subject: Re: Can we do perform a C style file Read/Write from within a ARP module 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: Tue, 27 Dec 2011 09:30:42 -0000 Eugene Grosbein wrote: > 27.12.2011 20:11, perryh@pluto.rain.com ?????: > > Jason Hellenthal wrote: > >> > >> See siftr(4). This module writes to a file. > > > > Is siftr(4) new since 8.1? > > HISTORY > SIFTR first appeared in FreeBSD 7.4 and FreeBSD 8.2. which explains why there's no manpage for it in 8.1 :) It turns out that siftr(4) does not directly manipulate its logfiles, instead using alq(9) which has been around since 5.0. To (partly) answer the original question, it looks as if alq(9) can handle opening/creating and writing to the file -- and siftr(4) will serve as an example of using alq(9) -- but on a brief perusal it does not look as if alq(9) includes a mechanism to read back the data. One kernel operation that does directly process data from files -- as opposed to passing the data to a userland process for processing -- is execve(2), which must examine the file header to identify the type of executable being invoked.