From owner-freebsd-net@FreeBSD.ORG Sat Aug 9 11:36:27 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AA64106566C for ; Sat, 9 Aug 2008 11:36:27 +0000 (UTC) (envelope-from ady@ady.ro) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.175]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8FF8FC0A for ; Sat, 9 Aug 2008 11:36:26 +0000 (UTC) (envelope-from ady@ady.ro) Received: by wf-out-1314.google.com with SMTP id 24so1076369wfg.7 for ; Sat, 09 Aug 2008 04:36:26 -0700 (PDT) Received: by 10.142.240.9 with SMTP id n9mr1335298wfh.6.1218281786423; Sat, 09 Aug 2008 04:36:26 -0700 (PDT) Received: by 10.142.80.3 with HTTP; Sat, 9 Aug 2008 04:36:26 -0700 (PDT) Message-ID: <78cb3d3f0808090436h565dbe9foea6cf8df55c3cf14@mail.gmail.com> Date: Sat, 9 Aug 2008 13:36:26 +0200 From: "Adrian Penisoara" Sender: ady@ady.ro To: "Ryan French" In-Reply-To: <200808092209.55478.rfrench@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200808092209.55478.rfrench@freebsd.org> X-Google-Sender-Auth: 7dc7ec914013d81b Cc: freebsd-net@freebsd.org Subject: Re: Looking for the FreeBSD equivalent of an OpenBSD function X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2008 11:36:27 -0000 Hi, On Sat, Aug 9, 2008 at 12:09 PM, Ryan French wrote: > Hi all, > > First of all thank you for all the help with my question yesterday, my problem > today is unfortunately not something syntactical like the last one. > > I am working on moving over code from OpenBSDs implementation ofMPLS to > FreeBSD, and I have run up against a function called 'sysctl_ifq' and I was > wondering if anyone knew of an equivalent in FreeBSD. The code that calls the > function is shown below. Thanks for any help. You mean the following one: http://fxr.watson.org/fxr/source/net/if.c?v=OPENBSD#L1944 In FreeBSD I think one can extract the values for queue (maximum) length and drops stats from the ifq structure using the _IF_DROP()/_IF_QLEN() macros here: http://fxr.watson.org/fxr/source/net/if_var.h?im=bigexcerpts#L247 I'm not sure whether you might need to use locking primitives to query these values for MP reasons with IF_LOCK()/IF_UNLOCK(). Regards, Adrian.