Date: Tue, 14 Jan 2003 07:22:05 +0100 From: Vincent Jardin <vjardin@wanadoo.fr> To: "Radoslav Vasilev" <rado@cablebg.net>, <freebsd-net@freebsd.org> Cc: <freebsd-hackers@freebsd.org> Subject: Re: kld && inetsw.pr_protocol overriding + old reuse Message-ID: <3E075B46009F1F35@mel-rta9.wanadoo.fr> (added by postmaster@wanadoo.fr) In-Reply-To: <000b01c2bb5e$eb42f8f0$13e309d9@deckland> References: <000b01c2bb5e$eb42f8f0$13e309d9@deckland>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E075B46009F1F35>