From owner-freebsd-hackers Mon Jan 13 22: 2:48 2003 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 7E1BB37B401; Mon, 13 Jan 2003 22:02:46 -0800 (PST) Received: from mel-rto6.wanadoo.fr (smtp-out-6.wanadoo.fr [193.252.19.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79DE143F3F; Mon, 13 Jan 2003 22:02:45 -0800 (PST) (envelope-from vjardin@wanadoo.fr) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto6.wanadoo.fr (6.7.015) id 3E0C343F009E5F6E; Tue, 14 Jan 2003 07:02:37 +0100 Received: from there (217.128.206.128) by mel-rta9.wanadoo.fr (6.7.015) id 3E075B46009F1F35; Tue, 14 Jan 2003 07:02:37 +0100 Message-ID: <3E075B46009F1F35@mel-rta9.wanadoo.fr> (added by postmaster@wanadoo.fr) Content-Type: text/plain; charset="iso-8859-1" From: Vincent Jardin To: "Radoslav Vasilev" , Subject: Re: kld && inetsw.pr_protocol overriding + old reuse Date: Tue, 14 Jan 2003 07:22:05 +0100 X-Mailer: KMail [version 1.3.2] Cc: References: <000b01c2bb5e$eb42f8f0$13e309d9@deckland> In-Reply-To: <000b01c2bb5e$eb42f8f0$13e309d9@deckland> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG It is not very simple. However Netgraph/ng_socket.c does something similar. net_add_domain is called from ngs_mod_event(). However, it is not possible to remove this module because the feature to remove a domain is missing. switch (event) { case MOD_LOAD: /* Register protocol domain */ net_add_domain(&ngdomain); break; case MOD_UNLOAD: /* Insure there are no open netgraph sockets */ if (!LIST_EMPTY(&ngsocklist)) { error = EBUSY; break; } #ifdef NOTYET if ((LIST_EMPTY(&ngsocklist)) && (typestruct.refs == 0)) { /* Unregister protocol domain XXX can't do this yet.. */ if ((error = net_rm_domain(&ngdomain)) != 0) break; } else #endif error = EBUSY; break; I would be interested in this feature too ;-) However there is no reference counter within the protosw structure, neither within the domain structure. It seems to be difficult to remove them. Moreover, how can the domains, that require a "routing layer", be loaded ? rn_init is called only during the boot process in order to find the max_keylen = MAX(dom->dom_maxrtkey). Vincent Le Mardi 14 Janvier 2003 00:53, Radoslav Vasilev a écrit : > I'm interested in whether the following could be acomplished: > there's KLD module, installing some new syscalls in the kernel, as well as > installing new ``struct ipprotosw'' for some protocol or another(let's > assume IPPROTO_UDP). > Could we just add some code in the begging of the new protocol handler > (counting, statistics , etc...) and call the old one after doing that. If > possible, what should be the preparation for that last call ? > Any help appreciated! > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-net" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message