Lines Matching refs:client

39 	ns_lwdclient_t *client;
55 client = event->ev_arg;
56 cm = client->clientmgr;
57 INSIST(client->byaddr == (dns_byaddr_t *)event->ev_sender);
60 gnba = &client->gnba;
67 dns_byaddr_destroy(&client->byaddr);
71 if (client->na.family != AF_INET6 ||
72 (client->options & DNS_BYADDROPT_IPV6INT) != 0) {
80 ns_lwdclient_errorpktsend(client, lwresult);
88 client->options |= DNS_BYADDROPT_IPV6INT;
90 start_byaddr(client);
98 b = client->recv_buffer;
100 result = dns_name_totext(name, ISC_TRUE, &client->recv_buffer);
104 (int)(client->recv_buffer.used - b.used),
108 gnba->realnamelen = client->recv_buffer.used - b.used;
115 client->recv_buffer.used - b.used;
120 dns_byaddr_destroy(&client->byaddr);
126 client->pkt.recvlength = LWRES_RECVLENGTH;
127 client->pkt.authtype = 0; /* XXXMLG */
128 client->pkt.authlength = 0;
129 client->pkt.result = LWRES_R_SUCCESS;
132 gnba, &client->pkt, &lwb);
138 client->sendbuf = r.base;
139 client->sendlength = r.length;
140 result = ns_lwdclient_sendreply(client, &r);
144 NS_LWDCLIENT_SETSEND(client);
149 if (client->byaddr != NULL)
150 dns_byaddr_destroy(&client->byaddr);
160 start_byaddr(ns_lwdclient_t *client) {
164 cm = client->clientmgr;
166 INSIST(client->byaddr == NULL);
168 result = dns_byaddr_create(cm->mctx, &client->na, cm->view,
169 client->options, cm->task, byaddr_done,
170 client, &client->byaddr);
172 ns_lwdclient_errorpktsend(client, LWRES_R_FAILURE);
178 init_gnba(ns_lwdclient_t *client) {
186 client->aliases[i] = NULL;
187 client->aliaslen[i] = 0;
190 client->addrs[i].family = 0;
191 client->addrs[i].length = 0;
192 memset(client->addrs[i].address, 0, LWRES_ADDR_MAXLEN);
193 LWRES_LINK_INIT(&client->addrs[i], link);
196 client->gnba.naliases = 0;
197 client->gnba.realname = NULL;
198 client->gnba.aliases = client->aliases;
199 client->gnba.realnamelen = 0;
200 client->gnba.aliaslen = client->aliaslen;
201 client->gnba.base = NULL;
202 client->gnba.baselen = 0;
203 isc_buffer_init(&client->recv_buffer, client->buffer, LWRES_RECVLENGTH);
207 ns_lwdclient_processgnba(ns_lwdclient_t *client, lwres_buffer_t *b) {
213 REQUIRE(NS_LWDCLIENT_ISRECVDONE(client));
214 INSIST(client->byaddr == NULL);
216 cm = client->clientmgr;
220 b, &client->pkt, &req);
224 client->options = 0;
226 client->na.family = AF_INET;
229 memmove(&client->na.type.in, req->addr.address, 4);
231 client->na.family = AF_INET6;
234 memmove(&client->na.type.in6, req->addr.address, 16);
238 isc_sockaddr_fromnetaddr(&sa, &client->na, 53);
240 ns_lwdclient_log(50, "client %p looking for addrtype %08x",
241 client, req->addr.family);
252 init_gnba(client);
253 client->options = 0;
258 start_byaddr(client);
269 ns_lwdclient_errorpktsend(client, LWRES_R_FAILURE);