dispatch.c revision d1ba6e9180c7d7458656a6e53e52fde056fd244c
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer * Copyright (C) 1999 Internet Software Consortium.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews * Permission to use, copy, modify, and distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
70e5a7403f0e0a3bd292b8287c5fed5772c15270Automatic Updater * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
722cac3cdcc5385ab64fa2d6c7f48ce3b9a68331Andreas Gustafsson * If we cannot send to this task, the application is broken.
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer#define ISC_TASK_SEND(a, b) do { \
813d6c9781d1fb48bb5c1d6d3415e65f7be5eeb0Andreas Gustafsson RUNTIME_CHECK(isc_task_send(a, b) == ISC_R_SUCCESS); \
02bc88821c5c853027b20199d178b321093ad2ceMichael Sawyer unsigned int magic;
a2b565626ba9a98eecc7b82cb86c6d68c38d3d94Michael Sawyer unsigned int bucket;
3635d8f9104e70e141a8f191a0e6c1502ceed2f3Mark Andrewstypedef ISC_LIST(dns_dispentry_t) dns_displist_t;
struct dns_dispatch {
static dns_dispentry_t *
dns_messageid_t, unsigned int);
static dns_messageid_t
static inline dns_dispatchevent_t *
static inline isc_boolean_t
static dns_dispentry_t *
static dns_dispentry_t *
static dns_dispentry_t *
unsigned int bucket;
bucket = 0;
return (ret);
bucket++;
return (NULL);
static dns_dispentry_t *
unsigned int bucket;
return (ret);
return (ret);
bucket++;
return (NULL);
unsigned int ret;
return (ret);
static dns_messageid_t
static inline isc_boolean_t
return (ISC_FALSE);
return (ISC_FALSE);
return (ISC_TRUE);
static dns_dispentry_t *
unsigned int bucket)
return (res);
return (NULL);
void *temp;
return (temp);
static inline dns_dispatchevent_t *
return (ev);
unsigned int flags;
unsigned int bucket;
if (killit)
goto restart;
goto restart;
goto restart;
goto restart;
goto restart;
goto restart;
unsigned int wanted;
if (wanted == 0)
switch (socktype) {
case isc_socket_udp:
case isc_socket_tcp:
unsigned int maxbuffersize,
unsigned int tablesize;
return (DNS_R_NOMEMORY);
goto out1;
for (i = 0 ; i < tablesize ; i++)
goto out2;
goto out3;
goto out4;
goto out5;
goto out6;
return (DNS_R_SUCCESS);
out6:
out5:
out4:
out3:
out2:
out1:
return (res);
if (killit)
unsigned int bucket;
if (!ok) {
return (DNS_R_NOMORE);
return (DNS_R_NOMEMORY);
return (DNS_R_SUCCESS);
unsigned int bucket;
if (killit)
return (DNS_R_NOMEMORY);
return (DNS_R_SUCCESS);
if (killit)
if (response)