From owner-freebsd-net@FreeBSD.ORG Thu Jun 5 00:42:55 2003 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4267D37B401 for ; Thu, 5 Jun 2003 00:42:55 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15E3A43FD7 for ; Thu, 5 Jun 2003 00:42:54 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h557gqv14424; Thu, 5 Jun 2003 09:42:52 +0200 (MEST) Date: Thu, 5 Jun 2003 09:42:52 +0200 (CEST) From: Harti Brandt To: Vincent Jardin In-Reply-To: <200306042335.08541.vjardin@wanadoo.fr> Message-ID: <20030605093540.F4422@beagle.fokus.fraunhofer.de> References: <200306042335.08541.vjardin@wanadoo.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: net@freebsd.org Subject: Re: [netgraph] NGF_RESP X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2003 07:42:55 -0000 On Wed, 4 Jun 2003, Vincent Jardin wrote: VJ>Hi, VJ> VJ>I'm trying to understand how does NGF_RESP work and how can it be used ? VJ> VJ>According to ng_message.h, it is a flag that describes a response message, VJ>however are all the response messages synchronous to a request or could some VJ>messages be asynchronous ? If some messages could be asynchronous, what does VJ>receive these messages ? If you look at the NG_MKRESPONSE macro you'll see that a response has the same cookie, token and cmd code as the original command. The difference is, that the response flag is set. There is no need to send a response immediately, you can do it anytime later. I use asynchronuous messages in my ng_atm node for things like carrier change and PVC changes. I have defined a message code for this just like other message codes for the node (just with command codes above 10000). The node defines a special hook 'manage'. If this hook is connected, these messages are sent to the node at the other end of the hook. The SNMP daemon connects this hook when it starts to manage the interface and so receives these asynchronuous messages. Another possibility is to configure a node number or path into the node, where it should send messages to. This technique, however, may be subject to races when nodes are created/destroyed. harti -- harti brandt, http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private brandt@fokus.fraunhofer.de, harti@freebsd.org