Date: Thu, 5 Jun 2003 09:42:52 +0200 (CEST) From: Harti Brandt <brandt@fokus.fraunhofer.de> To: Vincent Jardin <vjardin@wanadoo.fr> Cc: net@freebsd.org Subject: Re: [netgraph] NGF_RESP Message-ID: <20030605093540.F4422@beagle.fokus.fraunhofer.de> In-Reply-To: <200306042335.08541.vjardin@wanadoo.fr> References: <200306042335.08541.vjardin@wanadoo.fr>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030605093540.F4422>