Add isc_task_getnetmgr() function

Add a function to pull the attached netmgr from inside the executed
task.  This is needed for any task that needs to call the netmgr API.
This commit is contained in:
Ondřej Surý 2021-05-27 09:45:07 +02:00 committed by Ondřej Surý
parent 87fe97ed91
commit 7670f98377
3 changed files with 11 additions and 0 deletions

View file

@ -511,6 +511,9 @@ isc_task_getname(isc_task_t *task);
*
*/
isc_nm_t *
isc_task_getnetmgr(isc_task_t *task);
void *
isc_task_gettag(isc_task_t *task);
/*%<

View file

@ -774,6 +774,13 @@ isc_task_gettag(isc_task_t *task) {
return (task->tag);
}
isc_nm_t *
isc_task_getnetmgr(isc_task_t *task) {
REQUIRE(VALID_TASK(task));
return (task->manager->netmgr);
}
/***
*** Task Manager.
***/

View file

@ -100,6 +100,7 @@ isc_socketmgr_getmaxsockets
isc_socketmgr_setreserved
isc_socketmgr_setstats
isc_task_getname
isc_task_getnetmgr
isc_task_gettag
isc_task_ready
isc_task_run