From owner-p4-projects@FreeBSD.ORG Tue Jul 19 03:51:14 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 02D3216A420; Tue, 19 Jul 2005 03:51:13 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B7FF916A41C for ; Tue, 19 Jul 2005 03:51:13 +0000 (GMT) (envelope-from soc-anders@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 885D343D48 for ; Tue, 19 Jul 2005 03:51:13 +0000 (GMT) (envelope-from soc-anders@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6J3pDbT012923 for ; Tue, 19 Jul 2005 03:51:13 GMT (envelope-from soc-anders@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6J3pDgo012920 for perforce@freebsd.org; Tue, 19 Jul 2005 03:51:13 GMT (envelope-from soc-anders@freebsd.org) Date: Tue, 19 Jul 2005 03:51:13 GMT Message-Id: <200507190351.j6J3pDgo012920@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-anders@freebsd.org using -f From: soc-anders To: Perforce Change Reviews Cc: Subject: PERFORCE change 80499 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2005 03:51:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=80499 Change 80499 by soc-anders@soc-anders_gimli on 2005/07/19 03:50:53 '-rs' mode now uses sysctl to obtain rtstat and rttrash info Affected files ... .. //depot/projects/soc2005/ifcleanup/src/src/usr.bin/netstat/route.c#3 edit Differences ... ==== //depot/projects/soc2005/ifcleanup/src/src/usr.bin/netstat/route.c#3 (text+ko) ==== @@ -755,22 +755,21 @@ { struct rtstat rtstat; int rttrash; + size_t len; - /* IFCLEANUP - * rtstat should be accessible via sysctl.. until then skip this - */ - return; - - if (rtsaddr == 0) { - printf("rtstat: symbol not in namelist\n"); + len = sizeof(rtstat); + if (sysctlbyname("net.route.rtstat", &rtstat, &len, + NULL, 0) < 0) { + warn("sysctl: net.route.rtstat"); return; } - if (rttaddr == 0) { - printf("rttrash: symbol not in namelist\n"); + len = sizeof(rttrash); + if (sysctlbyname("net.route.rttrash", &rttrash, &len, + NULL, 0) < 0) { + warn("sysctl: net.route.rttrash"); return; } - kread(rtsaddr, (char *)&rtstat, sizeof (rtstat)); - kread(rttaddr, (char *)&rttrash, sizeof (rttrash)); + printf("routing:\n"); #define p(f, m) if (rtstat.f || sflag <= 1) \