Roman V. Palagin writes:
> I've wrote netgraph node which collects some information from network. Now
> I want to transfer collected data into user program. I've NGM_XXX_STAT
> message which initiates data transfer and program which uses libnetgraph
> to communicate with node. When I send NGM_XXX_STAT message node must
> starts data transfer but I don't know exactly how much data should be
> transfered so I can't use synhronous reply. Also, NgSendMsg(...,
> NGM_XXX_STAT, ...) doesn't return until handler of NGM_XXX_STAT is
> finished, so I can't use ng_send_msg() in NGM_XXX_STAT handler - nobody
> will read sended messages and I finished up with "No buffer space
> available".
> 
> The question is: how I can initiate smth. like asynchronous reply (so I
> can get data via NgRecvMsg later in my prgram)? Or I'm going wrong way and
> should use another scheme for data transfer? Data size ranges from 10Kb to
> 500Kb.

Whenever you're ready to send the reply, just create one and send it.
You'll want the same 'token' value in the reply and you'll want to
set the NGF_REPLY bit in the flags word to indicate it's a reply.
For an exmple of doing this, see pppoe_send_event() in ng_pppoe.c
(this is not a reply but shows how to create and send a message).

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to