* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lwres.h,v 1.3 2020/02/12 13:05:04 jsg Exp $ */
+/* $Id: lwres.h,v 1.4 2024/08/14 17:36:48 florian Exp $ */
#ifndef LWRES_LWRES_H
#define LWRES_LWRES_H 1
*/
#define LWRES_CONFMAXNAMESERVERS 3 /*%< max 3 "nameserver" entries */
-#define LWRES_CONFMAXLWSERVERS 1 /*%< max 1 "lwserver" entry */
#define LWRES_CONFMAXSEARCH 8 /*%< max 8 domains in "search" entry */
#define LWRES_CONFMAXLINELEN 256 /*%< max size of a line */
#define LWRES_CONFMAXSORTLIST 10 /*%< max 10 */
lwres_addr_t nameservers[LWRES_CONFMAXNAMESERVERS];
uint8_t nsnext; /*%< index for next free slot */
- lwres_addr_t lwservers[LWRES_CONFMAXLWSERVERS];
- uint8_t lwnext; /*%< index for next free slot */
-
char *domainname;
char *search[LWRES_CONFMAXSEARCH];
static lwres_result_t
lwres_conf_parsenameserver(lwres_conf_t *confdata, FILE *fp);
-static lwres_result_t
-lwres_conf_parselwserver(lwres_conf_t *confdata, FILE *fp);
-
static lwres_result_t
lwres_conf_parsedomain(lwres_conf_t *confdata, FILE *fp);
int i;
confdata->nsnext = 0;
- confdata->lwnext = 0;
confdata->domainname = NULL;
confdata->searchnxt = 0;
confdata->sortlistnxt = 0;
}
confdata->nsnext = 0;
- confdata->lwnext = 0;
confdata->domainname = NULL;
confdata->searchnxt = 0;
confdata->sortlistnxt = 0;
return (LWRES_R_SUCCESS);
}
-static lwres_result_t
-lwres_conf_parselwserver(lwres_conf_t *confdata, FILE *fp) {
- char word[LWRES_CONFMAXLINELEN];
- int res;
-
- if (confdata->lwnext == LWRES_CONFMAXLWSERVERS)
- return (LWRES_R_SUCCESS);
-
- res = getword(fp, word, sizeof(word));
- if (strlen(word) == 0U)
- return (LWRES_R_FAILURE); /* Nothing on line. */
- else if (res == ' ' || res == '\t')
- res = eatwhite(fp);
-
- if (res != EOF && res != '\n')
- return (LWRES_R_FAILURE); /* Extra junk on line. */
-
- res = lwres_create_addr(word,
- &confdata->lwservers[confdata->lwnext++], 1);
- if (res != LWRES_R_SUCCESS)
- return (res);
-
- return (LWRES_R_SUCCESS);
-}
-
static lwres_result_t
lwres_conf_parsedomain(lwres_conf_t *confdata, FILE *fp) {
char word[LWRES_CONFMAXLINELEN];
rval = LWRES_R_SUCCESS;
else if (strcmp(word, "nameserver") == 0)
rval = lwres_conf_parsenameserver(confdata, fp);
- else if (strcmp(word, "lwserver") == 0)
- rval = lwres_conf_parselwserver(confdata, fp);
else if (strcmp(word, "domain") == 0)
rval = lwres_conf_parsedomain(confdata, fp);
else if (strcmp(word, "search") == 0)