Date: Fri, 24 Sep 2004 11:29:25 +0900 From: "George V. Neville-Neil" <gnn@neville-neil.com> To: Waldemar Kornewald <Waldemar.Kornewald@web.de> Cc: FreeBSD-net <freebsd-net@freebsd.org> Subject: Re: creating default route in kernel Message-ID: <m2y8j0xuuy.wl@minion.local.neville-neil.com> In-Reply-To: <4152A184.9020301@web.de> References: <4152A184.9020301@web.de>
next in thread | previous in thread | raw e-mail | index | archive | help
At Thu, 23 Sep 2004 12:12:20 +0200, Waldemar Kornewald wrote: > > Hi, > could you please tell me how I can create a default route from within > the kernel? I am a member of the Haiku (OS) networking team and > maintainer of the PPP stack and for dial-on-demand support there must be > a default route which does not work. BTW, we use a port of your netstack > (from the 4.x releases, I think). > Which values should the default route get (netmask, destination, etc.) > and which function(s) should I call (our PPP stack lives in the kernel)? If you look at src/sys/net/route.c you will find a function (in -CURRENT) called rtrequest1(). Read through that routine to see how to do an RTM_ADD. You will need a destination and netmask, yes. The destination for the default route is 0 and you need to set the gateway to the correct gateway. For debuggging this you should have something listening to a routing socket and printing out the messages. In userland on FreeBSD we do this with "route monitor", see the route(8) man page for more information. Later, George
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m2y8j0xuuy.wl>