From owner-freebsd-net@FreeBSD.ORG Sun Jan 4 08:41:12 2004 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 74C9316A4CE; Sun, 4 Jan 2004 08:41:12 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE69C43D62; Sun, 4 Jan 2004 08:41:07 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id i04Gf5jl029717; Sun, 4 Jan 2004 17:41:05 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: current@freebsd.org, net@freebsd.org From: Poul-Henning Kamp Date: Sun, 04 Jan 2004 17:41:05 +0100 Message-ID: <29716.1073234465@critter.freebsd.dk> Subject: REVIEW & TEST: libalias megapatch 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: Sun, 04 Jan 2004 16:41:12 -0000 http://phk.freebsd.dk/patch/libalias.patch This patch makes it possible to have multiple packet aliasing instances in a single process. Redefine a new API based on s/PacketAlias/LibAlias/g Add new "instance" argument to all functions in the new API. Put all global variables in the instance structure. Implement old API in terms of the new API. No functional change. No functions removed so there is no need for shlib version bump, only an updating entry and a __FreeBSD_version bump. The intent is to subsequently add a "multilink" facility to natd(8) for people with two xDSL lines to different providers etc. For this we need to run one packet-aliasing engine per line, and in order to not totally toast throughput, this should not result in more context switches then we are used to. (ie: not kern/usr/kern/usr/kern for the second line, but just kern/usr/kern as always). This patch makes it possible for programs like natd to run multiple packet-aliasing engines, this was not previously possible because of the widespread use of global variables in libalias. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.