IP : 3.138.178.231Hostname : premium184.web-hosting.comKernel : Linux premium184.web-hosting.com 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64Disable Function : None :) OS : Linux
PATH:
/
home/
riggvwfp/
../
../
./
home/
../
usr/
include/
ncursesw/
../
bind9/
isccfg/
grammar.h/
/
/* * 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. */
/* * 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 */ #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 is obsolete in a future release */ #define CFG_CLAUSEFLAG_DEPRECATED 0x00000400
/*% * Zone types for which a clause is valid: * These share space with CFG_CLAUSEFLAG values, but count * down from the top. */ #define CFG_ZONE_MASTER 0x80000000 #define CFG_ZONE_SLAVE 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
/*% * 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 */ cfg_parsefunc_t parse; cfg_printfunc_t print; cfg_docfunc_t doc; /*%< Print grammar description */ cfg_rep_t * rep; /*%< Data representation */ const void * of; /*%< Additional data for meta-types */ };
/*% A keyword-type definition, for things like "port <integer>". */ typedef struct { const char *name; const cfg_type_t *type; } keyword_type_t;
struct cfg_map { cfg_obj_t *id; /*%< Used for 'named maps' like keys, zones, &c */ const cfg_clausedef_t * const *clausesets; /*%< The clauses that can occur in this map; used for printing */ isc_symtab_t *symtab; };
/*% * A configuration data representation. */ struct cfg_rep { const char * name; /*%< For debugging only */ cfg_freefunc_t free; /*%< How to free this kind of data. */ };
/*% * A configuration object. This is the main building block * of the configuration parse tree. */
/*% A list element. */ struct cfg_listelt { cfg_obj_t *obj; ISC_LINK(cfg_listelt_t) link; };
/*% The parser object. */ struct cfg_parser { isc_mem_t * mctx; isc_log_t * lctx; isc_lex_t * lexer; unsigned int errors; unsigned int warnings; isc_token_t token;
/*% We are at the end of all input. */ bool seen_eof;
/*% The current token has been pushed back. */ bool ungotten;
/*% * The stack of currently active files, represented * as a configuration list of configuration strings. * The head is the top-level file, subsequent elements * (if any) are the nested include files, and the * last element is the file currently being parsed. */ cfg_obj_t * open_files;
/*% * Names of files that we have parsed and closed * and were previously on the open_file list. * We keep these objects around after closing * the files because the file names may still be * referenced from other configuration objects * for use in reporting semantic errors after * parsing is complete. */ cfg_obj_t * closed_files;
/*% * Name of a buffer being parsed; used only for * logging. */ char const * buf_name;
/*% * Current line number. We maintain our own * copy of this so that it is available even * when a file has just been closed. */ unsigned int line;
/*% * Parser context flags, used for maintaining state * from one token to the next. */ unsigned int flags;
void cfg_doc_obj(cfg_printer_t *pctx, const cfg_type_t *type); /*%< * Print a description of the grammar of an arbitrary configuration * type 'type' */
void cfg_doc_terminal(cfg_printer_t *pctx, const cfg_type_t *type); /*%< * Document the type 'type' as a terminal by printing its * name in angle brackets, e.g., <uint32>. */
void cfg_parser_error(cfg_parser_t *pctx, unsigned int flags, const char *fmt, ...) ISC_FORMAT_PRINTF(3, 4); /*! * Pass one of these flags to cfg_parser_error() to include the * token text in log message. */ #define CFG_LOG_NEAR 0x00000001 /*%< Say "near <token>" */ #define CFG_LOG_BEFORE 0x00000002 /*%< Say "before <token>" */ #define CFG_LOG_NOPREP 0x00000004 /*%< Say just "<token>" */
bool cfg_is_enum(const char *s, const char *const *enums); /*%< Return true iff the string 's' is one of the strings in 'enums' */
bool cfg_clause_validforzone(const char *name, unsigned int ztype); /*%< * Check whether an option is legal for the specified zone type. */
void cfg_print_zonegrammar(const unsigned int zonetype, void (*f)(void *closure, const char *text, int textlen), void *closure); /*%< * Print a summary of the grammar of the zone type represented by * 'zonetype'. */
void cfg_print_clauseflags(cfg_printer_t *pctx, unsigned int flags); /*%< * Print clause flags (e.g. "obsolete", "not implemented", etc) in * human readable form */
void cfg_print_indent(cfg_printer_t *pctx); /*%< * Print the necessary indent required by the current settings of 'pctx'. */