Added "ndots" to the lwres{} statement in named.conf
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: conflwres.c,v 1.5 2000/10/19 01:38:26 bwelling Exp $ */
|
||||
/* $Id: conflwres.c,v 1.6 2000/10/20 19:32:46 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -158,6 +158,8 @@ dns_c_lwres_new(isc_mem_t *mem, dns_c_lwres_t **lwresp)
|
||||
lwres->view = NULL;
|
||||
lwres->viewclass = dns_rdataclass_in;
|
||||
lwres->searchlist = NULL;
|
||||
lwres->ndots = 1;
|
||||
lwres->ndotsset = ISC_FALSE;
|
||||
|
||||
ISC_LINK_INIT(lwres, next);
|
||||
|
||||
@@ -219,14 +221,25 @@ dns_c_lwres_setview(dns_c_lwres_t *lwres, char *view,
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_result_t dns_c_lwres_setsearchlist(dns_c_lwres_t *lwres,
|
||||
dns_c_searchlist_t *searchlist) {
|
||||
isc_result_t
|
||||
dns_c_lwres_setsearchlist(dns_c_lwres_t *lwres,
|
||||
dns_c_searchlist_t *searchlist)
|
||||
{
|
||||
if (lwres->searchlist != NULL)
|
||||
return (ISC_R_EXISTS);
|
||||
lwres->searchlist = searchlist;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_c_lwres_setndots(dns_c_lwres_t *lwres, unsigned int ndots) {
|
||||
if (lwres->ndotsset)
|
||||
return (ISC_R_EXISTS);
|
||||
lwres->ndots = ndots;
|
||||
lwres->ndotsset = ISC_TRUE;
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
void
|
||||
dns_c_lwres_print(FILE *fp, int indent, dns_c_lwres_t *lwres)
|
||||
{
|
||||
@@ -262,6 +275,11 @@ dns_c_lwres_print(FILE *fp, int indent, dns_c_lwres_t *lwres)
|
||||
fprintf(fp, ";\n");
|
||||
}
|
||||
|
||||
if (lwres->ndotsset) {
|
||||
dns_c_printtabs(fp, indent + 1);
|
||||
fprintf(fp, "ndots %d;\n", lwres->ndots);
|
||||
}
|
||||
|
||||
dns_c_printtabs(fp, indent);
|
||||
fprintf(fp, "};\n");
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: confparser.y.dirty,v 1.22 2000/10/19 01:26:37 gson Exp $ */
|
||||
/* $Id: confparser.y.dirty,v 1.23 2000/10/20 19:32:47 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -338,6 +338,7 @@ static isc_boolean_t int_too_big(isc_uint32_t base, isc_uint32_t mult);
|
||||
%token L_MULTIPLE_CNAMES
|
||||
%token L_NAME
|
||||
%token L_NAMED_XFER
|
||||
%token L_NDOTS
|
||||
%token L_NO
|
||||
%token L_NOTIFY
|
||||
#ifndef NOMINUM_PUBLIC
|
||||
@@ -5704,6 +5705,22 @@ lwres_option: L_LISTEN_ON port_ip_list
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
| L_NDOTS L_INTEGER
|
||||
{
|
||||
dns_c_lwres_t *lwres;
|
||||
lwres = ISC_LIST_TAIL(currcfg->lwres->lwreslist);
|
||||
tmpres = dns_c_lwres_setndots(lwres, $2);
|
||||
if (tmpres == ISC_R_EXISTS) {
|
||||
parser_error(ISC_FALSE, "cannot redefine ndots");
|
||||
YYABORT;
|
||||
} else if (tmpres != ISC_R_SUCCESS) {
|
||||
parser_error(ISC_FALSE, "failed to set ndots");
|
||||
YYABORT;
|
||||
} else if ($2 <= 0) {
|
||||
parser_error(ISC_FALSE, "ndots must be >= 1");
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -5862,6 +5879,7 @@ static struct token keyword_tokens [] = {
|
||||
{ "multiple-cnames", L_MULTIPLE_CNAMES },
|
||||
{ "name", L_NAME },
|
||||
{ "named-xfer", L_NAMED_XFER },
|
||||
{ "ndots", L_NDOTS },
|
||||
{ "no", L_NO },
|
||||
{ "notify", L_NOTIFY },
|
||||
#ifndef NOMINUM_PUBLIC
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: conflwres.h,v 1.2 2000/10/19 01:26:39 gson Exp $ */
|
||||
/* $Id: conflwres.h,v 1.3 2000/10/20 19:32:49 bwelling Exp $ */
|
||||
|
||||
#ifndef DNS_CONFLWRES_H
|
||||
#define DNS_CONFLWRES_H 1
|
||||
@@ -93,6 +93,8 @@ struct dns_c_lwres {
|
||||
char *view;
|
||||
dns_rdataclass_t viewclass;
|
||||
dns_c_searchlist_t *searchlist;
|
||||
unsigned int ndots;
|
||||
isc_boolean_t ndotsset;
|
||||
|
||||
ISC_LINK(dns_c_lwres_t) next;
|
||||
};
|
||||
@@ -169,6 +171,8 @@ isc_result_t dns_c_lwres_setview(dns_c_lwres_t *lwres, char *view,
|
||||
isc_result_t dns_c_lwres_setsearchlist(dns_c_lwres_t *lwres,
|
||||
dns_c_searchlist_t *searchlist);
|
||||
|
||||
isc_result_t dns_c_lwres_setndots(dns_c_lwres_t *lwres, unsigned int ndots);
|
||||
|
||||
void dns_c_lwres_print(FILE *fp, int indent, dns_c_lwres_t *lwres);
|
||||
|
||||
isc_result_t dns_c_searchlist_new(isc_mem_t *mem, dns_c_searchlist_t **list);
|
||||
|
||||
Reference in New Issue
Block a user