Lines Matching defs:confdata
227 lwres_conf_t *confdata;
230 confdata = &ctx->confdata;
232 confdata->nsnext = 0;
233 confdata->lwnext = 0;
234 confdata->domainname = NULL;
235 confdata->searchnxt = 0;
236 confdata->sortlistnxt = 0;
237 confdata->resdebug = 0;
238 confdata->ndots = 1;
239 confdata->no_tld_query = 0;
242 lwres_resetaddr(&confdata->nameservers[i]);
245 confdata->search[i] = NULL;
248 lwres_resetaddr(&confdata->sortlist[i].addr);
249 lwres_resetaddr(&confdata->sortlist[i].mask);
257 lwres_conf_t *confdata;
260 confdata = &ctx->confdata;
262 for (i = 0; i < confdata->nsnext; i++)
263 lwres_resetaddr(&confdata->nameservers[i]);
265 if (confdata->domainname != NULL) {
266 CTXFREE(confdata->domainname,
267 strlen(confdata->domainname) + 1);
268 confdata->domainname = NULL;
271 for (i = 0; i < confdata->searchnxt; i++) {
272 if (confdata->search[i] != NULL) {
273 CTXFREE(confdata->search[i],
274 strlen(confdata->search[i]) + 1);
275 confdata->search[i] = NULL;
280 lwres_resetaddr(&confdata->sortlist[i].addr);
281 lwres_resetaddr(&confdata->sortlist[i].mask);
284 confdata->nsnext = 0;
285 confdata->lwnext = 0;
286 confdata->domainname = NULL;
287 confdata->searchnxt = 0;
288 confdata->sortlistnxt = 0;
289 confdata->resdebug = 0;
290 confdata->ndots = 1;
291 confdata->no_tld_query = 0;
298 lwres_conf_t *confdata;
301 confdata = &ctx->confdata;
303 if (confdata->nsnext == LWRES_CONFMAXNAMESERVERS)
319 confdata->nameservers[confdata->nsnext++] = address;
329 lwres_conf_t *confdata;
331 confdata = &ctx->confdata;
333 if (confdata->lwnext == LWRES_CONFMAXLWSERVERS)
346 &confdata->lwservers[confdata->lwnext++], 1);
357 lwres_conf_t *confdata;
359 confdata = &ctx->confdata;
370 if (confdata->domainname != NULL)
371 CTXFREE(confdata->domainname,
372 strlen(confdata->domainname) + 1); /* */
378 if (confdata->search[i] != NULL) {
379 CTXFREE(confdata->search[i],
380 strlen(confdata->search[i])+1);
381 confdata->search[i] = NULL;
384 confdata->searchnxt = 0;
386 confdata->domainname = lwres_strdup(ctx, word);
388 if (confdata->domainname == NULL)
398 lwres_conf_t *confdata;
400 confdata = &ctx->confdata;
402 if (confdata->domainname != NULL) {
406 CTXFREE(confdata->domainname,
407 strlen(confdata->domainname) + 1);
408 confdata->domainname = NULL;
415 if (confdata->search[idx] != NULL) {
416 CTXFREE(confdata->search[idx],
417 strlen(confdata->search[idx])+1);
418 confdata->search[idx] = NULL;
421 confdata->searchnxt = 0;
429 if (confdata->searchnxt == LWRES_CONFMAXSEARCH)
432 confdata->search[idx] = lwres_strdup(ctx, word);
433 if (confdata->search[idx] == NULL)
436 confdata->searchnxt++;
480 lwres_conf_t *confdata;
482 confdata = &ctx->confdata;
489 if (confdata->sortlistnxt == LWRES_CONFMAXSORTLIST)
496 idx = confdata->sortlistnxt;
497 res = lwres_create_addr(word, &confdata->sortlist[idx].addr, 1);
503 &confdata->sortlist[idx].mask,
511 confdata->sortlist[idx].mask =
512 confdata->sortlist[idx].addr;
514 memset(&confdata->sortlist[idx].mask.address, 0xff,
515 confdata->sortlist[idx].addr.length);
518 confdata->sortlistnxt++;
535 lwres_conf_t *confdata;
538 confdata = &ctx->confdata;
546 confdata->resdebug = 1;
548 confdata->no_tld_query = 1;
555 confdata->ndots = (lwres_uint8_t)ndots;
573 lwres_conf_t *confdata;
577 confdata = &ctx->confdata;
581 REQUIRE(confdata != NULL);
634 lwres_conf_t *confdata;
638 confdata = &ctx->confdata;
640 REQUIRE(confdata->nsnext <= LWRES_CONFMAXNAMESERVERS);
642 for (i = 0; i < confdata->nsnext; i++) {
643 af = lwresaddr2af(confdata->nameservers[i].family);
645 p = lwres_net_ntop(af, confdata->nameservers[i].address,
653 for (i = 0; i < confdata->lwnext; i++) {
654 af = lwresaddr2af(confdata->lwservers[i].family);
656 p = lwres_net_ntop(af, confdata->lwservers[i].address,
664 if (confdata->domainname != NULL) {
665 fprintf(fp, "domain %s\n", confdata->domainname);
666 } else if (confdata->searchnxt > 0) {
667 REQUIRE(confdata->searchnxt <= LWRES_CONFMAXSEARCH);
670 for (i = 0; i < confdata->searchnxt; i++)
671 fprintf(fp, " %s", confdata->search[i]);
675 REQUIRE(confdata->sortlistnxt <= LWRES_CONFMAXSORTLIST);
677 if (confdata->sortlistnxt > 0) {
679 for (i = 0; i < confdata->sortlistnxt; i++) {
680 af = lwresaddr2af(confdata->sortlist[i].addr.family);
683 confdata->sortlist[i].addr.address,
690 tmpaddr = confdata->sortlist[i].mask;
694 confdata->sortlist[i].mask.address,
695 confdata->sortlist[i].mask.length) != 0) {
697 confdata->sortlist[i].mask.family);
700 confdata->sortlist[i].mask.address,
711 if (confdata->resdebug)
714 if (confdata->ndots > 0)
715 fprintf(fp, "options ndots:%d\n", confdata->ndots);
717 if (confdata->no_tld_query)
728 return (&ctx->confdata);