2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 08:05:21 +00:00

add cfg_obj_assockaddr

This commit is contained in:
Brian Wellington
2001-02-22 23:59:28 +00:00
parent dc9870de55
commit fba7c63ea4
2 changed files with 21 additions and 2 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: cfg.h,v 1.10 2001/02/22 20:41:43 gson Exp $ */
/* $Id: cfg.h,v 1.11 2001/02/22 23:59:28 bwelling Exp $ */
#ifndef DNS_CFG_H
#define DNS_CFG_H 1
@@ -216,6 +216,19 @@ cfg_obj_asboolean(cfg_obj_t *obj);
* A boolean value.
*/
isc_sockaddr_t *
cfg_obj_assockaddr(cfg_obj_t *obj);
/*
* Returns the value of a configuration object of a socket address type.
*
* Requires:
* 'obj' points to a valid configuration object of a socket address type.
*
* Returns:
* A pointer to a sockaddr. The sockaddr must be copied by the caller
* if necessary.
*/
cfg_listelt_t *
cfg_list_first(cfg_obj_t *obj);
/*

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.18 2001/02/22 20:41:41 gson Exp $ */
/* $Id: parser.c,v 1.19 2001/02/22 23:59:27 bwelling Exp $ */
#include <config.h>
@@ -1604,6 +1604,12 @@ cfg_obj_asboolean(cfg_obj_t *obj) {
return (obj->value.boolean);
}
isc_sockaddr_t *
cfg_obj_assockaddr(cfg_obj_t *obj) {
REQUIRE(obj != NULL && obj->type->rep == &cfg_rep_sockaddr);
return (&obj->value.sockaddr);
}
/* Quoted string only */
static cfg_type_t cfg_type_qstring = {
"qstring", parse_qstring, print_qstring, &cfg_rep_string, NULL };