From owner-freebsd-net Sat Oct 20 11: 0: 8 2001 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 0B87437B401; Sat, 20 Oct 2001 11:00:03 -0700 (PDT) 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 KAA82982; Sat, 20 Oct 2001 10:51:08 -0700 (PDT) Received: (from archie@localhost) by arch20m.dellroad.org (8.11.3/8.11.3) id f9KHp1584570; Sat, 20 Oct 2001 10:51:01 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200110201751.f9KHp1584570@arch20m.dellroad.org> Subject: Re: netgraph one2many question In-Reply-To: "from Milon Papezik at Oct 18, 2001 12:37:56 pm" To: Milon Papezik Date: Sat, 20 Oct 2001 10:51:01 -0700 (PDT) Cc: "'hackers@freebsd.org'" , "'net@freebsd.org'" X-Mailer: ELM [version 2.4ME+ PL82 (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 Milon Papezik writes: > I would like to extend ng_one2many module to include > automatic link failure datection, failover and FEC functionality. > > My question is: > Are interface nodes able to send upstream notification > that their state has changed or do I have to poll their status periodically > as it is done in ng_fec module made kindly available by wpaul ? They don't now, but I think you could add this in a reasonably unoffensive way. What you would do is add a new function pointer to struct ifnet, say "void (*if_report)(struct ifnet *, int status)" or something. When a device driver detected link going up/down, it could call this function (if non-NULL). Then if_ethersubr() would set this function pointer to point to some function if_ether_report(). When if_ether_report() is called, if ng_ether was loaded, it would call into ng_ether() to generate a control message that would be passed to the node connected to the "lower" hook. Then, ng_one2many could be modified to understand this control message and do the right thing according to its configuration. Or, something like that. Polling might be a quicker and easier though less precise way to do it for starters. -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