From owner-freebsd-net@FreeBSD.ORG Fri Sep 24 02:30:07 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 288F816A4CE for ; Fri, 24 Sep 2004 02:30:07 +0000 (GMT) Received: from outbound0.sv.meer.net (outbound0.sv.meer.net [205.217.152.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8CBB43D48 for ; Fri, 24 Sep 2004 02:30:06 +0000 (GMT) (envelope-from gnn@neville-neil.com) Received: from mail.meer.net (mail.meer.net [209.157.152.14]) i8O2TVr2047167; Thu, 23 Sep 2004 19:29:31 -0700 (PDT) (envelope-from gnn@neville-neil.com) Received: from minion.local.neville-neil.com (pc1.oakwoodazabu1-unet.ocn.ne.jp [220.110.140.201]) by mail.meer.net (8.12.1/8.12.2/meer) with ESMTP id i8O2TS71022052; Thu, 23 Sep 2004 19:29:28 -0700 (PDT) (envelope-from gnn@neville-neil.com) Date: Fri, 24 Sep 2004 11:29:25 +0900 Message-ID: From: "George V. Neville-Neil" To: Waldemar Kornewald In-Reply-To: <4152A184.9020301@web.de> References: <4152A184.9020301@web.de> User-Agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.5 Emacs/21.2 (powerpc-apple-darwin) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII cc: FreeBSD-net Subject: Re: creating default route in kernel 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: Fri, 24 Sep 2004 02:30:07 -0000 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