From owner-freebsd-arch Tue May 22 11:43: 2 2001 Delivered-To: freebsd-arch@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id A5DE337B422 for ; Tue, 22 May 2001 11:42:54 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f4MIgrY03521 for ; Tue, 22 May 2001 19:42:53 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f4MIgqb84117; Tue, 22 May 2001 19:42:52 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200105221842.f4MIgqb84117@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: freebsd-arch@FreeBSD.org Cc: Brian Somers Subject: RFC: unit_list routines Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 22 May 2001 19:42:52 +0100 From: Brian Somers Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I want to change if_tun.c so that userland can open /dev/tun and get back a /dev/tunX device. To do this, I need to track the units that have (or haven't) been opened, and I figure other devices may wish to do this too. To this end, I've written the attached URLs for /sys/kern/unit_list.c /sys/sys/unit_list.h and have also attached URLs for patches to /sys/conf/files and /sys/net/if_tun.c. The unit_list stuff is designed to be an easy way of tracking sparce arrays of units - arrays that are generally expected to start at zero and increment, but may sometimes be allocated randomly. I haven't tested as extensively as I plan to because my dev box is useless at the moment due to mutex problems, but I believe it works :) I ansified if_tun.c while I was there - sorry if that complicates any reviews :-/ Comments ? ftp://ftp.Awfulhak.org/pub/unit_list/sys-kern-unit_list.c ftp://ftp.Awfulhak.org/pub/unit_list/sys-sys-unit_list.h ftp://ftp.Awfulhak.org/pub/unit_list/sys-conf-files.patch ftp://ftp.Awfulhak.org/pub/unit_list/sys-net-if_tun.c.patch Cheers. -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message