Commit e44487bf authored by Michael Graff's avatar Michael Graff

convert sender, arg, action, etc. to ev_sender, ev_arg, ev_action, etc.

parent 0d89e0d5
......@@ -145,7 +145,7 @@ process_request(client_t *client)
void
client_recv(isc_task_t *task, isc_event_t *ev)
{
client_t *client = ev->arg;
client_t *client = ev->ev_arg;
clientmgr_t *cm = client->clientmgr;
isc_socketevent_t *dev = (isc_socketevent_t *)ev;
......@@ -242,10 +242,10 @@ client_start_recv(clientmgr_t *cm)
void
client_shutdown(isc_task_t *task, isc_event_t *ev)
{
clientmgr_t *cm = ev->arg;
clientmgr_t *cm = ev->ev_arg;
REQUIRE(task == cm->task);
REQUIRE(ev->type == LWRD_SHUTDOWN);
REQUIRE(ev->ev_type == LWRD_SHUTDOWN);
REQUIRE((cm->flags & CLIENTMGR_FLAG_SHUTTINGDOWN) == 0);
DP(50, "Got shutdown event, task %p", task);
......@@ -295,7 +295,7 @@ client_state_idle(client_t *client)
void
client_send(isc_task_t *task, isc_event_t *ev)
{
client_t *client = ev->arg;
client_t *client = ev->ev_arg;
clientmgr_t *cm = client->clientmgr;
isc_socketevent_t *dev = (isc_socketevent_t *)ev;
......
......@@ -278,13 +278,13 @@ store_realname(client_t *client)
static void
process_gabn_finddone(isc_task_t *task, isc_event_t *ev)
{
client_t *client = ev->arg;
isc_eventtype_t result;
client_t *client = ev->ev_arg;
isc_eventtype_t evtype;
isc_boolean_t claimed;
DP(50, "Find done for task %p, client %p", task, client);
result = ev->type;
evtype = ev->ev_type;
isc_event_free(&ev);
/*
......@@ -292,7 +292,7 @@ process_gabn_finddone(isc_task_t *task, isc_event_t *ev)
* right now, so we can render things.
*/
claimed = ISC_FALSE;
if (result == DNS_EVENT_ADBNOMOREADDRESSES) {
if (evtype == DNS_EVENT_ADBNOMOREADDRESSES) {
if (NEED_V4(client)) {
client->v4find = client->find;
claimed = ISC_TRUE;
......@@ -328,7 +328,7 @@ process_gabn_finddone(isc_task_t *task, isc_event_t *ev)
* We have some new information we can gather. Run off and fetch
* it.
*/
if (result == DNS_EVENT_ADBMOREADDRESSES) {
if (evtype == DNS_EVENT_ADBMOREADDRESSES) {
start_find(client);
return;
}
......
......@@ -57,12 +57,12 @@ byaddr_done(isc_task_t *task, isc_event_t *event)
isc_uint16_t naliases;
isc_stdtime_t now;
(void)task;
UNUSED(task);
lwb.base = NULL;
client = event->arg;
client = event->ev_arg;
cm = client->clientmgr;
INSIST(client->byaddr == event->sender);
INSIST(client->byaddr == event->ev_sender);
bevent = (dns_byaddrevent_t *)event;
gnba = &client->gnba;
......
......@@ -460,8 +460,8 @@ client_shutdown(isc_task_t *task, isc_event_t *event) {
ns_client_t *client;
REQUIRE(event != NULL);
REQUIRE(event->type == ISC_TASKEVENT_SHUTDOWN);
client = event->arg;
REQUIRE(event->ev_type == ISC_TASKEVENT_SHUTDOWN);
client = event->ev_arg;
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(task == client->task);
......@@ -476,7 +476,7 @@ client_shutdown(isc_task_t *task, isc_event_t *event) {
}
client->newstate = NS_CLIENTSTATE_FREED;
(void) exit_check(client);
(void)exit_check(client);
}
......@@ -579,8 +579,8 @@ client_senddone(isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *sevent = (isc_socketevent_t *) event;
REQUIRE(sevent != NULL);
REQUIRE(sevent->type == ISC_SOCKEVENT_SENDDONE);
client = sevent->arg;
REQUIRE(sevent->ev_type == ISC_SOCKEVENT_SENDDONE);
client = sevent->ev_arg;
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(task == client->task);
......@@ -812,7 +812,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
isc_boolean_t ra; /* Recursion available. */
REQUIRE(event != NULL);
client = event->arg;
client = event->ev_arg;
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(task == client->task);
......@@ -826,7 +826,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
RWLOCK(&ns_g_server->conflock, isc_rwlocktype_read);
dns_zonemgr_lockconf(ns_g_server->zonemgr, isc_rwlocktype_read);
if (event->type == DNS_EVENT_DISPATCH) {
if (event->ev_type == DNS_EVENT_DISPATCH) {
INSIST(!TCP_CLIENT(client));
devent = (dns_dispatchevent_t *)event;
REQUIRE(client->dispentry != NULL);
......@@ -835,7 +835,7 @@ client_request(isc_task_t *task, isc_event_t *event) {
result = devent->result;
client->peeraddr = devent->addr;
client->peeraddr_valid = ISC_TRUE;
if ((devent->attributes & DNS_DISPATCHATTR_PKTINFO) != 0) {
if ((devent->attributes & ISC_SOCKEVENTATTR_PKTINFO) != 0) {
client->attributes |= NS_CLIENTATTR_PKTINFO;
client->pktinfo = devent->pktinfo;
} else {
......@@ -843,8 +843,8 @@ client_request(isc_task_t *task, isc_event_t *event) {
}
} else {
INSIST(TCP_CLIENT(client));
REQUIRE(event->type == DNS_EVENT_TCPMSG);
REQUIRE(event->sender == &client->tcpmsg);
REQUIRE(event->ev_type == DNS_EVENT_TCPMSG);
REQUIRE(event->ev_sender == &client->tcpmsg);
buffer = &client->tcpmsg.buffer;
result = client->tcpmsg.result;
INSIST(client->nreads == 1);
......@@ -1069,9 +1069,9 @@ client_timeout(isc_task_t *task, isc_event_t *event) {
ns_client_t *client;
REQUIRE(event != NULL);
REQUIRE(event->type == ISC_TIMEREVENT_LIFE ||
event->type == ISC_TIMEREVENT_IDLE);
client = event->arg;
REQUIRE(event->ev_type == ISC_TIMEREVENT_LIFE ||
event->ev_type == ISC_TIMEREVENT_IDLE);
client = event->ev_arg;
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(task == client->task);
REQUIRE(client->timer != NULL);
......@@ -1233,11 +1233,11 @@ client_read(ns_client_t *client) {
static void
client_newconn(isc_task_t *task, isc_event_t *event) {
ns_client_t *client = event->arg;
ns_client_t *client = event->ev_arg;
isc_socket_newconnev_t *nevent = (isc_socket_newconnev_t *)event;
isc_result_t result;
REQUIRE(event->type == ISC_SOCKEVENT_NEWCONN);
REQUIRE(event->ev_type == ISC_SOCKEVENT_NEWCONN);
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(client->task == task);
......
......@@ -1653,8 +1653,8 @@ query_resume(isc_task_t *task, isc_event_t *event) {
* Resume a query after recursion.
*/
REQUIRE(event->type == DNS_EVENT_FETCHDONE);
client = devent->arg;
REQUIRE(event->ev_type == DNS_EVENT_FETCHDONE);
client = devent->ev_arg;
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(task == client->task);
REQUIRE(RECURSING(client));
......
......@@ -1076,7 +1076,7 @@ scan_interfaces(ns_server_t *server) {
*/
static void
interface_timer_tick(isc_task_t *task, isc_event_t *event) {
ns_server_t *server = (ns_server_t *) event->arg;
ns_server_t *server = (ns_server_t *) event->ev_arg;
UNUSED(task);
isc_event_free(&event);
RWLOCK(&server->conflock, isc_rwlocktype_write);
......@@ -1390,7 +1390,7 @@ load_zones(ns_server_t *server, isc_boolean_t stop) {
static void
run_server(isc_task_t *task, isc_event_t *event) {
isc_result_t result;
ns_server_t *server = (ns_server_t *) event->arg;
ns_server_t *server = (ns_server_t *)event->ev_arg;
UNUSED(task);
......@@ -1424,7 +1424,7 @@ run_server(isc_task_t *task, isc_event_t *event) {
static void
shutdown_server(isc_task_t *task, isc_event_t *event) {
dns_view_t *view, *view_next;
ns_server_t *server = (ns_server_t *) event->arg;
ns_server_t *server = (ns_server_t *)event->ev_arg;
UNUSED(task);
......@@ -1580,7 +1580,7 @@ fatal(char *msg, isc_result_t result) {
static void
ns_server_reload(isc_task_t *task, isc_event_t *event) {
isc_result_t result;
ns_server_t *server = (ns_server_t *)event->arg;
ns_server_t *server = (ns_server_t *)event->ev_arg;
UNUSED(task);
result = load_configuration(ns_g_conffile, server, ISC_FALSE);
......
......@@ -1753,14 +1753,14 @@ send_update_event(ns_client_t *client, dns_zone_t *zone) {
evclient = NULL;
ns_client_attach(client, &evclient);
event->arg = evclient;
event->ev_arg = evclient;
dns_zone_gettask(zone, &zonetask);
isc_task_send(zonetask, (isc_event_t **) &event);
isc_task_send(zonetask, (isc_event_t **)&event);
failure:
if (event != NULL)
isc_event_free((isc_event_t **) &event);
isc_event_free((isc_event_t **)&event);
return (result);
}
......@@ -1855,7 +1855,7 @@ update_action(isc_task_t *task, isc_event_t *event)
{
update_event_t *uev = (update_event_t *) event;
dns_zone_t *zone = uev->zone;
ns_client_t *client = (ns_client_t *) event->arg;
ns_client_t *client = (ns_client_t *)event->ev_arg;
isc_result_t result;
dns_db_t *db = NULL;
......@@ -1871,7 +1871,7 @@ update_action(isc_task_t *task, isc_event_t *event)
dns_name_t *zonename;
dns_ssutable_t *ssutable = NULL;
INSIST(event->type == DNS_EVENT_UPDATE);
INSIST(event->ev_type == DNS_EVENT_UPDATE);
dns_diff_init(mctx, &diff);
dns_diff_init(mctx, &temp);
......@@ -2294,8 +2294,8 @@ update_action(isc_task_t *task, isc_event_t *event)
isc_task_detach(&task);
uev->result = result;
uev->type = DNS_EVENT_UPDATEDONE;
uev->action = updatedone_action;
uev->ev_type = DNS_EVENT_UPDATEDONE;
uev->ev_action = updatedone_action;
isc_task_send(client->task, &event);
INSIST(event == NULL);
}
......@@ -2304,9 +2304,9 @@ static void
updatedone_action(isc_task_t *task, isc_event_t *event)
{
update_event_t *uev = (update_event_t *) event;
ns_client_t *client = (ns_client_t *) event->arg;
ns_client_t *client = (ns_client_t *) event->ev_arg;
INSIST(event->type == DNS_EVENT_UPDATEDONE);
INSIST(event->ev_type == DNS_EVENT_UPDATEDONE);
INSIST(task == client->task);
respond(client, uev->result);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: xfrout.c,v 1.56 2000/04/11 19:08:32 gson Exp $ */
/* $Id: xfrout.c,v 1.57 2000/04/17 19:22:00 explorer Exp $ */
#include <config.h>
......@@ -1431,15 +1431,19 @@ xfrout_ctx_destroy(xfrout_ctx_t **xfrp) {
static void
xfrout_senddone(isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *sev = (isc_socketevent_t *) event;
xfrout_ctx_t *xfr = (xfrout_ctx_t *) event->arg;
isc_socketevent_t *sev = (isc_socketevent_t *)event;
xfrout_ctx_t *xfr = (xfrout_ctx_t *)event->ev_arg;
isc_result_t evresult = sev->result;
UNUSED(task);
INSIST(event->type == ISC_SOCKEVENT_SENDDONE);
INSIST(event->ev_type == ISC_SOCKEVENT_SENDDONE);
isc_event_free(&event);
xfr->sends--;
INSIST(xfr->sends == 0);
(void) isc_timer_touch(xfr->client->timer);
(void)isc_timer_touch(xfr->client->timer);
if (xfr->shuttingdown == ISC_TRUE) {
xfrout_maybe_destroy(xfr);
} else if (evresult != ISC_R_SUCCESS) {
......
......@@ -138,11 +138,11 @@ lookup_callback(isc_task_t *task, isc_event_t *ev)
{
client_t *client;
client = ev->arg;
INSIST(client->find == ev->sender);
client = ev->ev_arg;
INSIST(client->find == ev->ev_sender);
printf("Task %p got event %p type %08x from %p, client %p\n",
task, ev, ev->type, client->find, client);
task, ev, ev->ev_type, client->find, client);
isc_event_free(&ev);
......
......@@ -60,7 +60,7 @@ done(isc_task_t *task, isc_event_t *event) {
isc_result_t result;
isc_region_t r;
REQUIRE(event->type == DNS_EVENT_BYADDRDONE);
REQUIRE(event->ev_type == DNS_EVENT_BYADDRDONE);
bevent = (dns_byaddrevent_t *)event;
(void)task;
......@@ -86,7 +86,7 @@ done(isc_task_t *task, isc_event_t *event) {
}
}
byaddr = event->sender;
byaddr = event->ev_sender;
dns_byaddr_destroy(&byaddr);
isc_event_free(&event);
......
......@@ -200,7 +200,7 @@ do_find(isc_boolean_t want_event) {
static void
adb_callback(isc_task_t *etask, isc_event_t *event) {
unsigned int type = event->type;
unsigned int type = event->ev_type;
REQUIRE(etask == task);
......
......@@ -124,7 +124,7 @@ void
send_done(isc_task_t *task, isc_event_t *ev_in)
{
isc_socketevent_t *ev = (isc_socketevent_t *)ev_in;
dns_dispentry_t *resp = (dns_dispentry_t *)ev_in->arg;
dns_dispentry_t *resp = (dns_dispentry_t *)ev_in->ev_arg;
(void)task;
......@@ -252,7 +252,7 @@ void
got_response(isc_task_t *task, isc_event_t *ev_in)
{
dns_dispatchevent_t *ev = (dns_dispatchevent_t *)ev_in;
dns_dispentry_t *resp = ev->sender;
dns_dispentry_t *resp = ev->ev_sender;
dns_message_t *msg;
isc_result_t result;
......@@ -283,7 +283,7 @@ void
got_request(isc_task_t *task, isc_event_t *ev_in)
{
dns_dispatchevent_t *ev = (dns_dispatchevent_t *)ev_in;
dns_dispentry_t *resp = ev->sender;
dns_dispentry_t *resp = ev->ev_sender;
static int cnt = 0;
dns_message_t *msg;
isc_result_t result;
......
......@@ -103,7 +103,7 @@ void
send_done(isc_task_t *task, isc_event_t *ev_in)
{
isc_socketevent_t *ev = (isc_socketevent_t *)ev_in;
clictx_t *cli = (clictx_t *)ev_in->arg;
clictx_t *cli = (clictx_t *)ev_in->ev_arg;
(void)task;
......@@ -231,7 +231,7 @@ void
got_response(isc_task_t *task, isc_event_t *ev_in)
{
dns_dispatchevent_t *ev = (dns_dispatchevent_t *)ev_in;
dns_dispentry_t *resp = ev->sender;
dns_dispentry_t *resp = ev->ev_sender;
dns_message_t *msg;
isc_result_t result;
unsigned int cnt;
......@@ -286,7 +286,7 @@ void
got_request(isc_task_t *task, isc_event_t *ev_in)
{
dns_dispatchevent_t *ev = (dns_dispatchevent_t *)ev_in;
clictx_t *cli = (clictx_t *)ev_in->arg;
clictx_t *cli = (clictx_t *)ev_in->ev_arg;
dns_message_t *msg;
isc_result_t result;
unsigned int cnt;
......
......@@ -65,7 +65,6 @@ int
main(int argc, char *argv[])
{
lwres_context_t *ctx;
lwres_conf_t conf;
const char *file = "/etc/resolv.conf";
int ret;
#ifdef USE_ISC_MEM
......@@ -91,14 +90,14 @@ main(int argc, char *argv[])
#endif
CHECK(ret, "lwres_context_create");
lwres_conf_init(&conf);
if (lwres_conf_parse(ctx, file, &conf) == 0) {
lwres_conf_print(stderr, &conf);
lwres_conf_init(ctx);
if (lwres_conf_parse(ctx, file) == 0) {
lwres_conf_print(ctx, stderr);
} else {
perror("lwres_conf_parse");
}
lwres_conf_clear(ctx, &conf);
lwres_conf_clear(ctx);
lwres_context_destroy(&ctx);
#ifdef USE_ISC_MEM
......
......@@ -531,7 +531,7 @@ do_connect(const char *host, int port) {
static void
listen_done(isc_task_t *task, isc_event_t *event) {
omapi_object_t *listener = event->arg;
omapi_object_t *listener = event->ev_arg;
UNUSED(task);
......
......@@ -45,7 +45,7 @@ utick(isc_task_t *task, isc_event_t *event)
{
(void) task;
printf("utick\n");
event->action = ltick;
event->ev_action = ltick;
isc_ratelimiter_enqueue(rlim, &event);
}
......
......@@ -36,6 +36,8 @@ extern int h_errno;
#include <isc/socket.h>
#include <isc/task.h>
#include <isc/util.h>
#include <dns/types.h>
#include <dns/message.h>
#include <dns/name.h>
......@@ -187,10 +189,10 @@ recv_done(isc_task_t *task, isc_event_t *event) {
isc_buffer_t *b;
isc_result_t result;
REQUIRE(event->type == ISC_SOCKEVENT_RECVDONE);
REQUIRE(event->ev_type == ISC_SOCKEVENT_RECVDONE);
sevent = (isc_socketevent_t *)event;
(void)task;
UNUSED(task);
/*
* There will be one buffer (since that is what we put on the list)
......@@ -215,7 +217,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
static void
send_done(isc_task_t *task, isc_event_t *event) {
(void)task;
UNUSED(task);
isc_event_free(&event);
}
......
......@@ -57,7 +57,7 @@ static isc_timermgr_t * timer_manager;
static void
t1_shutdown(isc_task_t *task, isc_event_t *event) {
t_info *info = event->arg;
t_info *info = event->ev_arg;
printf("task %s (%p) t1_shutdown\n", info->name, task);
isc_task_detach(&info->task);
......@@ -66,7 +66,7 @@ t1_shutdown(isc_task_t *task, isc_event_t *event) {
static void
t2_shutdown(isc_task_t *task, isc_event_t *event) {
t_info *info = event->arg;
t_info *info = event->ev_arg;
printf("task %s (%p) t2_shutdown\n", info->name, task);
info->exiting = ISC_TRUE;
......@@ -75,10 +75,10 @@ t2_shutdown(isc_task_t *task, isc_event_t *event) {
static void
shutdown_action(isc_task_t *task, isc_event_t *event) {
t_info *info = event->arg;
t_info *info = event->ev_arg;
isc_event_t *nevent;
INSIST(event->type == ISC_TASKEVENT_SHUTDOWN);
INSIST(event->ev_type == ISC_TASKEVENT_SHUTDOWN);
printf("task %s (%p) shutdown\n", info->name, task);
if (strcmp(info->name, "0") == 0) {
......@@ -102,10 +102,10 @@ foo_event(isc_task_t *task, isc_event_t *event) {
static void
tick(isc_task_t *task, isc_event_t *event)
{
t_info *info = event->arg;
t_info *info = event->ev_arg;
isc_event_t *nevent;
INSIST(event->type == ISC_TIMEREVENT_TICK);
INSIST(event->ev_type == ISC_TIMEREVENT_TICK);
printf("task %s (%p) tick\n", info->name, task);
......
......@@ -41,7 +41,7 @@ static void my_recv(isc_task_t *task, isc_event_t *event);
static void
my_shutdown(isc_task_t *task, isc_event_t *event)
{
char *name = event->arg;
char *name = event->ev_arg;
printf("shutdown %s (%p)\n", name, task);
fflush(stdout);
......@@ -57,11 +57,11 @@ my_recv(isc_task_t *task, isc_event_t *event)
char buf[1024];
char host[256];
sock = event->sender;
sock = event->ev_sender;
dev = (isc_socketevent_t *)event;
printf("Socket %s (sock %p, base %p, length %d, n %d, result %d)\n",
(char *)(event->arg), sock,
(char *)(event->ev_arg), sock,
dev->region.base, dev->region.length,
dev->n, dev->result);
if (dev->address.type.sa.sa_family == AF_INET6) {
......@@ -90,21 +90,21 @@ my_recv(isc_task_t *task, isc_event_t *event)
/*
* Echo the data back
*/
if (strcmp(event->arg, "so2") != 0) {
if (strcmp(event->ev_arg, "so2") != 0) {
region = dev->region;
sprintf(buf, "\r\nReceived: %.*s\r\n\r\n",
(int)dev->n, (char *)region.base);
region.base = isc_mem_get(mctx, strlen(buf) + 1);
region.length = strlen(buf) + 1;
strcpy((char *)region.base, buf); /* strcpy is safe */
isc_socket_send(sock, &region, task, my_send, event->arg);
isc_socket_send(sock, &region, task, my_send, event->ev_arg);
} else {
region = dev->region;
printf("\r\nReceived: %.*s\r\n\r\n",
(int)dev->n, (char *)region.base);
}
isc_socket_recv(sock, &dev->region, 1, task, my_recv, event->arg);
isc_socket_recv(sock, &dev->region, 1, task, my_recv, event->ev_arg);
isc_event_free(&event);
}
......@@ -115,11 +115,11 @@ my_send(isc_task_t *task, isc_event_t *event)
isc_socket_t *sock;
isc_socketevent_t *dev;
sock = event->sender;
sock = event->ev_sender;
dev = (isc_socketevent_t *)event;
printf("my_send: %s task %p\n\t(sock %p, base %p, length %d, n %d, result %d)\n",
(char *)(event->arg), task, sock,
(char *)(event->ev_arg), task, sock,
dev->region.base, dev->region.length,
dev->n, dev->result);
......@@ -139,11 +139,11 @@ my_http_get(isc_task_t *task, isc_event_t *event)
isc_socket_t *sock;
isc_socketevent_t *dev;
sock = event->sender;
sock = event->ev_sender;
dev = (isc_socketevent_t *)event;
printf("my_http_get: %s task %p\n\t(sock %p, base %p, length %d, n %d, result %d)\n",
(char *)(event->arg), task, sock,
(char *)(event->ev_arg), task, sock,
dev->region.base, dev->region.length,
dev->n, dev->result<