2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

new functions cfg_obj_isnetprefix(), cfg_obj_asnetprefix()

This commit is contained in:
Andreas Gustafsson
2001-02-26 19:15:12 +00:00
parent 1c1156b6e7
commit 0136b4ef55
2 changed files with 38 additions and 4 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.23 2001/02/26 18:58:36 gson Exp $ */
/* $Id: parser.c,v 1.24 2001/02/26 19:15:11 gson Exp $ */
#include <config.h>
@@ -2679,6 +2679,21 @@ print_netprefix(cfg_printer_t *pctx, cfg_obj_t *obj) {
print_uint(pctx, p->prefixlen);
}
isc_boolean_t
cfg_obj_isnetprefix(cfg_obj_t *obj) {
REQUIRE(obj != NULL);
return (ISC_TF(obj->type->rep == &cfg_rep_netprefix));
}
void
cfg_obj_asnetprefix(cfg_obj_t *obj, isc_netaddr_t *netaddr,
unsigned int *prefixlen) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_netprefix);
*netaddr = obj->value.netprefix.address;
*prefixlen = obj->value.netprefix.prefixlen;
}
static cfg_type_t cfg_type_netprefix = {
"netprefix", parse_netprefix, print_netprefix, &cfg_rep_netprefix, NULL };