unsupported
     �ÂÁÀ      File not found.
  +   ˆl–Ãa¾”ji?u@?pÜŠbÑ¿¿„­__†I|¥�+ÃÂ ?÷     /*
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, you can obtain one at https://mozilla.org/MPL/2.0/.
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
 */

#ifndef ISCCFG_GRAMMAR_H
#define ISCCFG_GRAMMAR_H 1

/*! \file isccfg/grammar.h */

#include <inttypes.h>
#include <stdbool.h>

#include <isc/lex.h>
#include <isc/netaddr.h>
#include <isc/region.h>
#include <isc/sockaddr.h>
#include <isc/types.h>

#include <isccfg/cfg.h>

/*
 * Definitions shared between the configuration parser
 * and the grammars; not visible to users of the parser.
 */

/*% Clause may occur multiple times (e.g., "zone") */
#define CFG_CLAUSEFLAG_MULTI 0x00000001
/*% Clause is obsolete (logs a warning, but is not a fatal error) */
#define CFG_CLAUSEFLAG_OBSOLETE 0x00000002
/*% Clause is not implemented, and may never be */
#define CFG_CLAUSEFLAG_NOTIMP 0x00000004
/*% Clause is not implemented yet */
#define CFG_CLAUSEFLAG_NYI 0x00000008
/*% Default value has changed since earlier release */
#define CFG_CLAUSEFLAG_NEWDEFAULT 0x00000010
/*%
 * Clause needs to be interpreted during parsing
 * by calling a callback function, like the
 * "directory" option.
 */
#define CFG_CLAUSEFLAG_CALLBACK 0x00000020
/*% A option that is only used in testing. */
#define CFG_CLAUSEFLAG_TESTONLY 0x00000040
/*% A configuration option that was not configured at compile time. */
#define CFG_CLAUSEFLAG_NOTCONFIGURED 0x00000080
/*% A option for a experimental feature. */
#define CFG_CLAUSEFLAG_EXPERIMENTAL 0x00000100
/*% A configuration option that is ineffective due to
 * compile time options, but is harmless. */
#define CFG_CLAUSEFLAG_NOOP 0x00000200
/*% Clause will be obsolete in a future release (logs a warning) */
#define CFG_CLAUSEFLAG_DEPRECATED 0x00000400
/*% Clause has been obsolete so long that it's now a fatal error */
#define CFG_CLAUSEFLAG_ANCIENT 0x00000800

/*%
 * Zone types for which a clause is valid:
 * These share space with CFG_CLAUSEFLAG values, but count
 * down from the top.
 */
#define CFG_ZONE_PRIMARY    0x80000000
#define CFG_ZONE_SECONDARY  0x40000000
#define CFG_ZONE_STUB	    0x20000000
#define CFG_ZONE_HINT	    0x10000000
#define CFG_ZONE_FORWARD    0x08000000
#define CFG_ZONE_STATICSTUB 0x04000000
#define CFG_ZONE_REDIRECT   0x02000000
#define CFG_ZONE_DELEGATION 0x01000000
#define CFG_ZONE_INVIEW	    0x00800000
#define CFG_ZONE_MIRROR	    0x00400000

typedef struct cfg_clausedef	 cfg_clausedef_t;
typedef struct cfg_tuplefielddef cfg_tuplefielddef_t;
typedef struct cfg_printer	 cfg_printer_t;
typedef ISC_LIST(cfg_listelt_t) cfg_list_t;
typedef struct cfg_map	    cfg_map_t;
typedef struct cfg_rep	    cfg_rep_t;
typedef struct cfg_duration cfg_duration_t;

#define CFG_DURATION_MAXLEN 64

/*
 * Function types for configuration object methods
 */

typedef isc_result_t (*cfg_parsefunc_t)(cfg_parser_t *, const cfg_type_t *type,
					cfg_obj_t **);
typedef void (*cfg_printfunc_t)(cfg_printer_t *, const cfg_obj_t *);
typedef void (*cfg_docfunc_t)(cfg_printer_t *, const cfg_type_t *);
typedef void (*cfg_freefunc_t)(cfg_parser_t *, cfg_obj_t *);

/*
 * Structure definitions
 */

/*%
 * A configuration printer object.  This is an abstract
 * interface to a destination to which text can be printed
 * by calling the function 'f'.
 */
struct cfg_printer {
	void (*f)(void *closure, const char *text, int textlen);
	void *closure;
	int   indent;
	int   flags;
};

/*% A clause definition. */
struct cfg_clausedef {
	const char  *name;
	cfg_type_t  *type;
	unsigned int flags;
};

/*% A tuple field definition. */
struct cfg_tuplefielddef {
	const char  *name;
	cfg_type_t  *type;
	unsigned int flags;
};

/*% A configuration object type definition. */
struct cfg_type {
	const char	   *name; /*%< For debugging purposes only */
	cf