From owner-freebsd-questions Fri Oct 4 9:11: 0 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4842237B404 for ; Fri, 4 Oct 2002 09:10:59 -0700 (PDT) Received: from web9503.mail.yahoo.com (web9503.mail.yahoo.com [216.136.129.133]) by mx1.FreeBSD.org (Postfix) with SMTP id DAAF243E3B for ; Fri, 4 Oct 2002 09:10:58 -0700 (PDT) (envelope-from yat_33@yahoo.com) Message-ID: <20021004161058.91584.qmail@web9503.mail.yahoo.com> Received: from [65.207.163.130] by web9503.mail.yahoo.com via HTTP; Fri, 04 Oct 2002 09:10:58 PDT Date: Fri, 4 Oct 2002 09:10:58 -0700 (PDT) From: yatin chalke Subject: Parsing route dump received by using sysctl To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, I am currently trying to get a route dump in freebsd4.4 using sysctl with NET_RT_DUMP. I am running into problems while parsing the returned rt_msghdr structures. The sockaddr structures returned after the rt_msghdr are messed up and it is not giving correct gateway or netmask. For ex: when I am parsing the received route dump the netmask received is nonzero(random value) for a default route (which it returns as 0.0.0.0) and also netmask doesnt appear to be a sockaddr structure. Also for further routes gateway and netmasks are 0.0.0.0. I am parsing the received sockaddr structures to get all the values depending on flag bits set in rt_msghdr structure. If anyone can help me in this matter it will be a great help. Thanks, --Yatin __________________________________________________ Do you Yahoo!? New DSL Internet Access from SBC & Yahoo! http://sbc.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message