mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-28 17:46:40 -04:00
Add allow-update-forwarding supprt to views.
This commit is contained in:
parent
0b73e4eb53
commit
83be31d86d
2 changed files with 55 additions and 0 deletions
|
|
@ -346,6 +346,14 @@ dns_c_view_print(FILE *fp, int indent, dns_c_view_t *view)
|
|||
fprintf(fp, ";\n");
|
||||
}
|
||||
|
||||
if (view->allowupdateforwarding != NULL) {
|
||||
dns_c_printtabs(fp, indent + 1);
|
||||
fprintf(fp, "allow-update-forwarding ");
|
||||
dns_c_ipmatchlist_print(fp, indent + 2,
|
||||
view->allowupdateforwarding);
|
||||
fprintf(fp, ";\n");
|
||||
}
|
||||
|
||||
if (view->blackhole != NULL) {
|
||||
dns_c_printtabs(fp, indent + 1);
|
||||
fprintf(fp, "blackhole ");
|
||||
|
|
@ -518,6 +526,33 @@ dns_c_view_setallowrecursion(dns_c_view_t *view,
|
|||
}
|
||||
|
||||
|
||||
isc_result_t
|
||||
dns_c_view_setallowupdateforwarding(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t *ipml,
|
||||
isc_boolean_t deepcopy)
|
||||
{
|
||||
isc_result_t res;
|
||||
|
||||
REQUIRE(DNS_C_VIEW_VALID(view));
|
||||
REQUIRE(DNS_C_IPMLIST_VALID(ipml));
|
||||
|
||||
if (view->allowupdateforwarding != NULL) {
|
||||
dns_c_ipmatchlist_detach(&view->allowupdateforwarding);
|
||||
}
|
||||
|
||||
if (deepcopy) {
|
||||
res = dns_c_ipmatchlist_copy(view->mem,
|
||||
&view->allowupdateforwarding,
|
||||
ipml);
|
||||
} else {
|
||||
view->allowupdateforwarding = ipml;
|
||||
res = ISC_R_SUCCESS;
|
||||
}
|
||||
|
||||
return (res);
|
||||
}
|
||||
|
||||
|
||||
isc_result_t
|
||||
dns_c_view_setblackhole(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t *ipml,
|
||||
|
|
@ -661,6 +696,17 @@ isc_result_t dns_c_view_getallowrecursion(dns_c_view_t *view,
|
|||
return (*ipml == NULL ? ISC_R_NOTFOUND : ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_result_t dns_c_view_getallowupdateforwarding(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t **ipml)
|
||||
{
|
||||
REQUIRE(DNS_C_VIEW_VALID(view));
|
||||
REQUIRE(ipml != NULL);
|
||||
|
||||
*ipml = view->allowupdateforwarding;
|
||||
|
||||
return (*ipml == NULL ? ISC_R_NOTFOUND : ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
isc_result_t dns_c_view_getblackhole(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t **ipml)
|
||||
{
|
||||
|
|
@ -760,6 +806,9 @@ dns_c_view_delete(dns_c_view_t **viewptr)
|
|||
if (view->recursionacl != NULL)
|
||||
dns_c_ipmatchlist_detach(&view->recursionacl);
|
||||
|
||||
if (view->allowupdateforwarding != NULL)
|
||||
dns_c_ipmatchlist_detach(&view->allowupdateforwarding);
|
||||
|
||||
if (view->blackhole != NULL)
|
||||
dns_c_ipmatchlist_detach(&view->blackhole);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,7 @@ struct dns_c_view
|
|||
dns_c_forw_t forward;
|
||||
|
||||
dns_c_ipmatchlist_t *allowquery;
|
||||
dns_c_ipmatchlist_t *allowupdateforwarding;
|
||||
dns_c_ipmatchlist_t *transferacl;
|
||||
dns_c_ipmatchlist_t *recursionacl;
|
||||
dns_c_ipmatchlist_t *blackhole;
|
||||
|
|
@ -348,6 +349,9 @@ isc_result_t dns_c_view_setallowtransfer(dns_c_view_t *view,
|
|||
isc_result_t dns_c_view_setallowrecursion(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t *ipml,
|
||||
isc_boolean_t deepcopy);
|
||||
isc_result_t dns_c_view_setallowupdateforwarding(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t *ipml,
|
||||
isc_boolean_t deepcopy);
|
||||
isc_result_t dns_c_view_setblackhole(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t *ipml,
|
||||
isc_boolean_t deepcopy);
|
||||
|
|
@ -379,6 +383,8 @@ isc_result_t dns_c_view_getallowtransfer(dns_c_view_t *view,
|
|||
dns_c_ipmatchlist_t **ipml);
|
||||
isc_result_t dns_c_view_getallowrecursion(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t **ipml);
|
||||
isc_result_t dns_c_view_getallowupdateforwarding(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t **ipml);
|
||||
isc_result_t dns_c_view_getblackhole(dns_c_view_t *view,
|
||||
dns_c_ipmatchlist_t **ipml);
|
||||
isc_result_t dns_c_view_getforwarders(dns_c_view_t *view,
|
||||
|
|
|
|||
Loading…
Reference in a new issue