#define TYPECLASSLEN 20 /* DNS mnemonic size. Must be less than 100. */
#define TYPECLASSBUF (TYPECLASSLEN + 1)
#define TYPECLASSFMT "%" STR(TYPECLASSLEN) "[-0-9a-z]_%d"
-#define ATTRIBUTESIZE 256
#define DIRNAMESIZE 256
static struct cc {
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdataset.h,v 1.12 2022/06/25 10:20:30 florian Exp $ */
+/* $Id: rdataset.h,v 1.13 2022/06/25 12:14:18 jsg Exp $ */
#ifndef DNS_RDATASET_H
#define DNS_RDATASET_H 1
*\li 'rdataset' is a valid, associated, question rdataset.
*/
-void
-dns_rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target);
-/*%<
- * Make 'target' refer to the same rdataset as 'source'.
- *
- * Requires:
- *\li 'source' is a valid, associated rdataset.
- *
- *\li 'target' is a valid, dissociated rdataset.
- *
- * Ensures:
- *\li 'target' references the same rdataset as 'source'.
- */
-
isc_result_t
dns_rdataset_first(dns_rdataset_t *rdataset);
/*%<
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdata.c,v 1.33 2021/04/02 06:37:40 florian Exp $ */
+/* $Id: rdata.c,v 1.34 2022/06/25 12:14:18 jsg Exp $ */
/*! \file */
#include <arpa/inet.h>
-#include <ctype.h>
#include <stdlib.h>
#include <string.h>
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: rdatalist.c,v 1.3 2022/06/25 10:20:29 florian Exp $ */
+/* $Id: rdatalist.c,v 1.4 2022/06/25 12:14:18 jsg Exp $ */
/*! \file */
#include <isc/util.h>
-#include <dns/name.h>
#include <dns/rdata.h>
#include <dns/rdatalist.h>
#include <dns/rdataset.h>
rdataset->attributes |= DNS_RDATASETATTR_QUESTION;
}
-void
-dns_rdataset_clone(dns_rdataset_t *source, dns_rdataset_t *target) {
-
- /*
- * Make 'target' refer to the same rdataset as 'source'.
- */
-
- REQUIRE(source->methods != NULL);
- REQUIRE(target->methods == NULL);
-
- (source->methods->clone)(source, target);
-}
-
isc_result_t
dns_rdataset_first(dns_rdataset_t *rdataset) {
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: lex.c,v 1.14 2022/01/17 18:19:51 naddy Exp $ */
+/* $Id: lex.c,v 1.15 2022/06/25 12:14:18 jsg Exp $ */
/*! \file */
-#include <ctype.h>
#include <stdlib.h>
#include <isc/buffer.h>
lexstate_qstring
} lexstate;
-#define IWSEOL (ISC_LEXOPT_INITIALWS | ISC_LEXOPT_EOL)
-
static void
pushback(inputsource *source, int c) {
REQUIRE(source->pushback->current > 0);
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: cfg.h,v 1.6 2020/09/14 08:40:44 florian Exp $ */
+/* $Id: cfg.h,v 1.7 2022/06/25 12:14:18 jsg Exp $ */
#ifndef ISCCFG_CFG_H
#define ISCCFG_CFG_H 1
* \li A pointer to a null terminated string.
*/
-int
-cfg_obj_islist(const cfg_obj_t *obj);
-/*%<
- * Return true iff 'obj' is of list type.
- */
-
-const cfg_listelt_t *
-cfg_list_first(const cfg_obj_t *obj);
-/*%<
- * Returns the first list element in a configuration object of a list type.
- *
- * Requires:
- * \li 'obj' points to a valid configuration object of a list type or NULL.
- *
- * Returns:
- * \li A pointer to a cfg_listelt_t representing the first list element,
- * or NULL if the list is empty or nonexistent.
- */
-
-const cfg_listelt_t *
-cfg_list_next(const cfg_listelt_t *elt);
-/*%<
- * Returns the next element of a list of configuration objects.
- *
- * Requires:
- * \li 'elt' points to cfg_listelt_t obtained from cfg_list_first() or
- * a previous call to cfg_list_next().
- *
- * Returns:
- * \li A pointer to a cfg_listelt_t representing the next element,
- * or NULL if there are no more elements.
- */
-
-unsigned int
-cfg_list_length(const cfg_obj_t *obj, int recurse);
-/*%<
- * Returns the length of a list of configure objects. If obj is
- * not a list, returns 0. If recurse is true, add in the length of
- * all contained lists.
- */
-
-void
-cfg_print(const cfg_obj_t *obj,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-void
-cfg_printx(const cfg_obj_t *obj, unsigned int flags,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-
#define CFG_PRINTER_XKEY 0x1 /* '?' out shared keys. */
-/*%<
- * Print the configuration object 'obj' by repeatedly calling the
- * function 'f', passing 'closure' and a region of text starting
- * at 'text' and comprising 'textlen' characters.
- *
- * If CFG_PRINTER_XKEY the contents of shared keys will be obscured
- * by replacing them with question marks ('?')
- */
-
-void
-cfg_print_grammar(const cfg_type_t *type,
- void (*f)(void *closure, const char *text, int textlen),
- void *closure);
-/*%<
- * Print a summary of the grammar of the configuration type 'type'.
- */
-
void
cfg_obj_destroy(cfg_parser_t *pctx, cfg_obj_t **obj);
/*%<
return (result);
}
-int
-cfg_obj_islist(const cfg_obj_t *obj) {
- REQUIRE(obj != NULL);
- return (obj->type->rep == &cfg_rep_list);
-}
-
-const cfg_listelt_t *
-cfg_list_first(const cfg_obj_t *obj) {
- REQUIRE(obj == NULL || obj->type->rep == &cfg_rep_list);
- if (obj == NULL)
- return (NULL);
- return (ISC_LIST_HEAD(obj->value.list));
-}
-
-const cfg_listelt_t *
-cfg_list_next(const cfg_listelt_t *elt) {
- REQUIRE(elt != NULL);
- return (ISC_LIST_NEXT(elt, link));
-}
-
-/*
- * Return the length of a list object. If obj is NULL or is not
- * a list, return 0.
- */
-unsigned int
-cfg_list_length(const cfg_obj_t *obj, int recurse) {
- const cfg_listelt_t *elt;
- unsigned int count = 0;
-
- if (obj == NULL || !cfg_obj_islist(obj))
- return (0U);
- for (elt = cfg_list_first(obj);
- elt != NULL;
- elt = cfg_list_next(elt)) {
- if (recurse && cfg_obj_islist(elt->obj)) {
- count += cfg_list_length(elt->obj, recurse);
- } else {
- count++;
- }
- }
- return (count);
-}
-
/*
* Maps.
*/