diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2020-02-18 18:10:18 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2020-02-18 18:10:18 +0000 |
commit | 5103c7f43f33923f9cc93aa2185d2ea467ab1e30 (patch) | |
tree | d6ac39067fd470778ce03627e2d30417a8d2cdbe /usr.bin/dig | |
parent | 3af705a86e05161fc5d21c8fa41c1aff72dd0acc (diff) |
Remove unused task, taskmgr, app, socket and socketmgr methods.
OK millert
Diffstat (limited to 'usr.bin/dig')
-rw-r--r-- | usr.bin/dig/lib/isc/include/isc/app.h | 26 | ||||
-rw-r--r-- | usr.bin/dig/lib/isc/include/isc/socket.h | 25 | ||||
-rw-r--r-- | usr.bin/dig/lib/isc/include/isc/task.h | 40 | ||||
-rw-r--r-- | usr.bin/dig/lib/isc/task.c | 43 | ||||
-rw-r--r-- | usr.bin/dig/lib/isc/unix/app.c | 31 | ||||
-rw-r--r-- | usr.bin/dig/lib/isc/unix/socket.c | 26 |
6 files changed, 3 insertions, 188 deletions
diff --git a/usr.bin/dig/lib/isc/include/isc/app.h b/usr.bin/dig/lib/isc/include/isc/app.h index d82a4854858..e371d54b59d 100644 --- a/usr.bin/dig/lib/isc/include/isc/app.h +++ b/usr.bin/dig/lib/isc/include/isc/app.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: app.h,v 1.3 2020/02/17 18:58:39 jung Exp $ */ +/* $Id: app.h,v 1.4 2020/02/18 18:10:17 florian Exp $ */ #ifndef ISC_APP_H #define ISC_APP_H 1 @@ -91,29 +91,6 @@ typedef isc_event_t isc_appevent_t; #define ISC_APPEVENT_LASTEVENT (ISC_EVENTCLASS_APP + 65535) /*% - * app module methods. Only app driver implementations use this structure. - * Other clients should use the top-level interfaces (i.e., isc_app_xxx - * functions). magic must be ISCAPI_APPMETHODS_MAGIC. - */ -typedef struct isc_appmethods { - void (*ctxdestroy)(isc_appctx_t **ctxp); - isc_result_t (*ctxstart)(isc_appctx_t *ctx); - isc_result_t (*ctxrun)(isc_appctx_t *ctx); - isc_result_t (*ctxsuspend)(isc_appctx_t *ctx); - isc_result_t (*ctxshutdown)(isc_appctx_t *ctx); - void (*ctxfinish)(isc_appctx_t *ctx); - void (*settaskmgr)(isc_appctx_t *ctx, - isc_taskmgr_t *timermgr); - void (*setsocketmgr)(isc_appctx_t *ctx, - isc_socketmgr_t *timermgr); - void (*settimermgr)(isc_appctx_t *ctx, - isc_timermgr_t *timermgr); - isc_result_t (*ctxonrun)(isc_appctx_t *ctx, - isc_task_t *task, isc_taskaction_t action, - void *arg); -} isc_appmethods_t; - -/*% * This structure is actually just the common prefix of an application context * implementation's version of an isc_appctx_t. * \brief @@ -125,7 +102,6 @@ typedef struct isc_appmethods { struct isc_appctx { unsigned int impmagic; unsigned int magic; - isc_appmethods_t *methods; }; #define ISCAPI_APPCTX_MAGIC ISC_MAGIC('A','a','p','c') diff --git a/usr.bin/dig/lib/isc/include/isc/socket.h b/usr.bin/dig/lib/isc/include/isc/socket.h index 5942c182900..23de1086474 100644 --- a/usr.bin/dig/lib/isc/include/isc/socket.h +++ b/usr.bin/dig/lib/isc/include/isc/socket.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.h,v 1.3 2020/02/16 18:05:09 florian Exp $ */ +/* $Id: socket.h,v 1.4 2020/02/18 18:10:17 florian Exp $ */ #ifndef ISC_SOCKET_H #define ISC_SOCKET_H 1 @@ -190,27 +190,6 @@ typedef enum { #define ISC_SOCKFDWATCH_WRITE 0x00000002 /*%< watch for writable */ /*@}*/ -/*% Socket and socket manager methods */ -typedef struct isc_socketmgrmethods { - void (*destroy)(isc_socketmgr_t **managerp); - isc_result_t (*socketcreate)(isc_socketmgr_t *manager, int pf, - isc_sockettype_t type, - isc_socket_t **socketp); -} isc_socketmgrmethods_t; - -typedef struct isc_socketmethods { - void (*attach)(isc_socket_t *socket, - isc_socket_t **socketp); - void (*detach)(isc_socket_t **socketp); - isc_result_t (*bind)(isc_socket_t *sock, isc_sockaddr_t *sockaddr, - unsigned int options); - isc_result_t (*connect)(isc_socket_t *sock, isc_sockaddr_t *addr, - isc_task_t *task, isc_taskaction_t action, - void *arg); - void (*cancel)(isc_socket_t *sock, isc_task_t *task, - unsigned int how); -} isc_socketmethods_t; - /*% * This structure is actually just the common prefix of a socket manager * object implementation's version of an isc_socketmgr_t. @@ -227,7 +206,6 @@ typedef struct isc_socketmethods { struct isc_socketmgr { unsigned int impmagic; unsigned int magic; - isc_socketmgrmethods_t *methods; }; #define ISCAPI_SOCKETMGR_MAGIC ISC_MAGIC('A','s','m','g') @@ -241,7 +219,6 @@ struct isc_socketmgr { struct isc_socket { unsigned int impmagic; unsigned int magic; - isc_socketmethods_t *methods; }; #define ISCAPI_SOCKET_MAGIC ISC_MAGIC('A','s','c','t') diff --git a/usr.bin/dig/lib/isc/include/isc/task.h b/usr.bin/dig/lib/isc/include/isc/task.h index e948131d73c..d493d182d79 100644 --- a/usr.bin/dig/lib/isc/include/isc/task.h +++ b/usr.bin/dig/lib/isc/include/isc/task.h @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: task.h,v 1.4 2020/02/16 21:12:41 florian Exp $ */ +/* $Id: task.h,v 1.5 2020/02/18 18:10:17 florian Exp $ */ #ifndef ISC_TASK_H #define ISC_TASK_H 1 @@ -100,42 +100,6 @@ typedef enum { isc_taskmgrmode_privileged } isc_taskmgrmode_t; -/*% Task and task manager methods */ -typedef struct isc_taskmgrmethods { - void (*destroy)(isc_taskmgr_t **managerp); - void (*setmode)(isc_taskmgr_t *manager, - isc_taskmgrmode_t mode); - isc_taskmgrmode_t (*mode)(isc_taskmgr_t *manager); - isc_result_t (*taskcreate)(isc_taskmgr_t *manager, - unsigned int quantum, - isc_task_t **taskp); - void (*setexcltask)(isc_taskmgr_t *mgr, isc_task_t *task); - isc_result_t (*excltask)(isc_taskmgr_t *mgr, isc_task_t **taskp); -} isc_taskmgrmethods_t; - -typedef struct isc_taskmethods { - void (*attach)(isc_task_t *source, isc_task_t **targetp); - void (*detach)(isc_task_t **taskp); - void (*destroy)(isc_task_t **taskp); - void (*send)(isc_task_t *task, isc_event_t **eventp); - void (*sendanddetach)(isc_task_t **taskp, isc_event_t **eventp); - unsigned int (*unsend)(isc_task_t *task, void *sender, isc_eventtype_t type, - void *tag, isc_eventlist_t *events); - isc_result_t (*onshutdown)(isc_task_t *task, isc_taskaction_t action, - void *arg); - void (*shutdown)(isc_task_t *task); - void (*setname)(isc_task_t *task, const char *name, void *tag); - unsigned int (*purgeevents)(isc_task_t *task, void *sender, - isc_eventtype_t type, void *tag); - unsigned int (*purgerange)(isc_task_t *task, void *sender, - isc_eventtype_t first, isc_eventtype_t last, - void *tag); - isc_result_t (*beginexclusive)(isc_task_t *task); - void (*endexclusive)(isc_task_t *task); - void (*setprivilege)(isc_task_t *task, isc_boolean_t priv); - isc_boolean_t (*privilege)(isc_task_t *task); -} isc_taskmethods_t; - /*% * This structure is actually just the common prefix of a task manager * object implementation's version of an isc_taskmgr_t. @@ -148,7 +112,6 @@ typedef struct isc_taskmethods { struct isc_taskmgr { unsigned int impmagic; unsigned int magic; - isc_taskmgrmethods_t *methods; }; #define ISCAPI_TASKMGR_MAGIC ISC_MAGIC('A','t','m','g') @@ -162,7 +125,6 @@ struct isc_taskmgr { struct isc_task { unsigned int impmagic; unsigned int magic; - isc_taskmethods_t *methods; }; #define ISCAPI_TASK_MAGIC ISC_MAGIC('A','t','s','t') diff --git a/usr.bin/dig/lib/isc/task.c b/usr.bin/dig/lib/isc/task.c index 17f327a2fd2..95ea423d6fc 100644 --- a/usr.bin/dig/lib/isc/task.c +++ b/usr.bin/dig/lib/isc/task.c @@ -189,47 +189,6 @@ pop_readyq(isc__taskmgr_t *manager); static inline void push_readyq(isc__taskmgr_t *manager, isc__task_t *task); -static struct isc__taskmethods { - isc_taskmethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ - void *purgeevent, *unsendrange, *getname, *gettag, *getcurrenttime; -} taskmethods = { - { - isc__task_attach, - isc__task_detach, - isc__task_destroy, - isc__task_send, - isc__task_sendanddetach, - isc__task_unsend, - isc__task_onshutdown, - isc__task_shutdown, - isc__task_setname, - isc__task_purge, - isc__task_purgerange, - isc__task_beginexclusive, - isc__task_endexclusive, - isc__task_setprivilege, - isc__task_privilege - }, - (void *)isc_task_purgeevent, - (void *)isc__task_unsendrange, - (void *)isc__task_getname, - (void *)isc__task_gettag, - (void *)isc__task_getcurrenttime -}; - -static isc_taskmgrmethods_t taskmgrmethods = { - isc__taskmgr_destroy, - isc__taskmgr_setmode, - isc__taskmgr_mode, - isc__task_create, - isc_taskmgr_setexcltask, - isc_taskmgr_excltask -}; - /*** *** Tasks. ***/ @@ -293,7 +252,6 @@ isc__task_create(isc_taskmgr_t *manager0, unsigned int quantum, return (ISC_R_SHUTTINGDOWN); } - task->common.methods = (isc_taskmethods_t *)&taskmethods; task->common.magic = ISCAPI_TASK_MAGIC; task->common.impmagic = TASK_MAGIC; *taskp = (isc_task_t *)task; @@ -1035,7 +993,6 @@ isc__taskmgr_create(unsigned int workers, manager = malloc(sizeof(*manager)); if (manager == NULL) return (ISC_R_NOMEMORY); - manager->common.methods = &taskmgrmethods; manager->common.impmagic = TASK_MANAGER_MAGIC; manager->common.magic = ISCAPI_TASKMGR_MAGIC; manager->mode = isc_taskmgrmode_normal; diff --git a/usr.bin/dig/lib/isc/unix/app.c b/usr.bin/dig/lib/isc/unix/app.c index 012f0e0523d..555079e0bb7 100644 --- a/usr.bin/dig/lib/isc/unix/app.c +++ b/usr.bin/dig/lib/isc/unix/app.c @@ -104,35 +104,6 @@ typedef struct isc__appctx { static isc__appctx_t isc_g_appctx; -static struct { - isc_appmethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ - void *run, *shutdown, *start, *reload, *finish, *block, *unblock; -} appmethods = { - { - isc__appctx_destroy, - isc__app_ctxstart, - isc__app_ctxrun, - isc__app_ctxsuspend, - isc__app_ctxshutdown, - isc__app_ctxfinish, - isc__appctx_settaskmgr, - isc__appctx_setsocketmgr, - isc__appctx_settimermgr, - isc__app_ctxonrun - }, - (void *)isc__app_run, - (void *)isc__app_shutdown, - (void *)isc__app_start, - (void *)isc__app_reload, - (void *)isc__app_finish, - (void *)isc__app_block, - (void *)isc__app_unblock -}; - static void reload_action(int arg) { UNUSED(arg); @@ -241,7 +212,6 @@ isc_result_t isc__app_start(void) { isc_g_appctx.common.impmagic = APPCTX_MAGIC; isc_g_appctx.common.magic = ISCAPI_APPCTX_MAGIC; - isc_g_appctx.common.methods = &appmethods.methods; /* The remaining members will be initialized in ctxstart() */ return (isc__app_ctxstart((isc_appctx_t *)&isc_g_appctx)); @@ -516,7 +486,6 @@ isc__appctx_create(isc_appctx_t **ctxp) { ctx->common.impmagic = APPCTX_MAGIC; ctx->common.magic = ISCAPI_APPCTX_MAGIC; - ctx->common.methods = &appmethods.methods; ctx->taskmgr = NULL; ctx->socketmgr = NULL; diff --git a/usr.bin/dig/lib/isc/unix/socket.c b/usr.bin/dig/lib/isc/unix/socket.c index da2d0b32964..c6ce5c328e2 100644 --- a/usr.bin/dig/lib/isc/unix/socket.c +++ b/usr.bin/dig/lib/isc/unix/socket.c @@ -268,30 +268,6 @@ isc__socketmgr_create2(isc_socketmgr_t **managerp, void isc__socketmgr_destroy(isc_socketmgr_t **managerp); -static struct { - isc_socketmethods_t methods; - - /*% - * The following are defined just for avoiding unused static functions. - */ - void *recvv, *sendv; -} socketmethods = { - { - isc__socket_attach, - isc__socket_detach, - isc__socket_bind, - isc__socket_connect, - isc__socket_cancel, - }, - (void *)isc__socket_recvv, - (void *)isc__socket_sendv, -}; - -static isc_socketmgrmethods_t socketmgrmethods = { - isc__socketmgr_destroy, - isc__socket_create -}; - #define SELECT_POKE_SHUTDOWN (-1) #define SELECT_POKE_READ (-3) #define SELECT_POKE_WRITE (-4) @@ -1446,7 +1422,6 @@ socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type, return (result); } - sock->common.methods = (isc_socketmethods_t *)&socketmethods; sock->references = 1; *socketp = (isc_socket_t *)sock; @@ -1933,7 +1908,6 @@ isc__socketmgr_create2(isc_socketmgr_t **managerp, goto free_manager; } - manager->common.methods = &socketmgrmethods; manager->common.magic = ISCAPI_SOCKETMGR_MAGIC; manager->common.impmagic = SOCKET_MANAGER_MAGIC; memset(manager->fds, 0, manager->maxsocks * sizeof(isc_socket_t *)); |