From owner-freebsd-net Wed Feb 6 20: 0:16 2002 Delivered-To: freebsd-net@freebsd.org Received: from InterJet.dellroad.org (adsl-63-194-81-26.dsl.snfc21.pacbell.net [63.194.81.26]) by hub.freebsd.org (Postfix) with ESMTP id 9B20637B421 for ; Wed, 6 Feb 2002 20:00:09 -0800 (PST) Received: from arch20m.dellroad.org (arch20m.dellroad.org [10.1.1.20]) by InterJet.dellroad.org (8.9.1a/8.9.1) with ESMTP id TAA79540; Wed, 6 Feb 2002 19:56:35 -0800 (PST) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.6/8.11.6) id g173uO015959; Wed, 6 Feb 2002 19:56:24 -0800 (PST) (envelope-from archie) From: Archie Cobbs Message-Id: <200202070356.g173uO015959@arch20m.dellroad.org> Subject: Re: ng_dummy - netgraph traffic shaping node In-Reply-To: <14420000.1013008215@blues.viagenie.qc.ca> "from Florent Parent at Feb 6, 2002 10:10:15 am" To: Florent Parent Date: Wed, 6 Feb 2002 19:56:24 -0800 (PST) Cc: Marko Zec , freebsd-net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Florent Parent writes: > > Btw, where could I find some examples on parsing setsockopt() calls to > > selected nodes, if such thing is possible at all? > > > > Here's how I do it on a ksocket node (patch on ksocket is required unless > you're using -CURRENT. Check thread on "netgraph: how to setsockopt on > ksocket node ?". ) > > struct opts { > int level; > int name; > int value; > } myopts = { SOL_SOCKET, SO_REUSEADDR, 1 }; > > if ( (ret = NgSendMsg(cs, epath, NGM_KSOCKET_COOKIE, NGM_KSOCKET_SETOPT, > (struct ng_ksocket_sockopt *)&myopts, > sizeof(myopts))) < 0) { > fprintf(stderr, "%s Cannot setopt the ksocket node: %s\n", > epath, strerror(errno)); > return (-1); > } Plus, you need 4.5-stable for this to work because of a bug that was recently fixed. -Archie __________________________________________________________________________ Archie Cobbs * Packet Design * http://www.packetdesign.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message