The method routine must first lock the packet in question using snmpdPktLockGet( ), and call the appropriate process mechanism depending on the type of operation (getproc_started( ), nextproc_started( ), or setproc_started( )) to indicate that the activity has begun.
When the task completes, which is again indicatedwith a call to the appropriate process mechanism (getproc_good( ), nextproc_good( ), or setproc_good( )), the routine must call snmpdContinue( ) to complete processing of the packet and issue the response.
For more information on process mechanisms, see the manual pages for snmpProcLib and for the individual process routines in F. SNMP Reference. Also see the manual pages for snmpdPktLockGet( ) and snmpdContinue( ) in the same section.
groupGet ( OIDC_T lastmatch, int compc, OIDC_T * compl, SNMP_PKT_T * pktp, VB_T * vbp ) { snmpdGroupByGetprocAndInstance (pktp, vbp, compc, compl); if ( (compc != 1) || (*compl != 0) ) { for ( ; vbp != NULL; vbp = vbp->vb_link) { getproc_nosuchins (pktp, vbp); } return; } /* At this stage we are ready to spawn an asynchronous task that will continue withe the job of getting the vars and installing those values in the response pkt. However we must first indicate to the agent that the getproc for all these varbinds has been started, else the agent could start them again */ for (vbp = pVbpSaved ; vbp != NULL; vbp = vbp->vb_link) { getproc_started (pktp, vbp); } /* Now spawn the asynch routine */ status = taskSpawn (asyncRtn, ...); if (status != OK) { for (vbp = pVbpSaved ; vbp != NULL; vbp = vbp->vb_link) { getproc_error (pktp, vbp); return; } } return; } void asyncRtn ( OIDC_T lastmatch, int compc, OIDC_T * compl, SNMP_PKT_T * pktp, VB_T * vbp ) { /* time consumng tasks done here */ ..... /* after doing all the time consuming tasks we are now ready to install the values in the pkt. */ snmpdPktLockGet (pktp); for (vbp = pVbpSaved ; vbp != NULL; vbp = vbp->vb_link) { /* Do whatever steps are reqd to install the var bind value as in the synchronous method routines */ ...... } snmpdContinue (pktp); }