Go to the source code of this file.
Defines |
|
#define | POSLIB_MF_AUTOPROBE 1 /**< ignore given znroot and guess from file name */ |
#define | POSLIB_MF_NOSOA 2 /**< Do not require SOA record */ |
Typedefs |
|
typedef void(* | error_callback )(void *user_dat, const char *fname, int linenum, const char *message) |
error callback function |
|
typedef void(* | rr_literal_callback )(void *user_dat, const char *dom, const char *ttl, const char *type, const char *rrdata, domainname origin) |
literal RR callback function |
|
typedef void(* | rr_callback )(void *user_dat, DnsRR *rr) |
compiled RR callback function |
|
typedef void(* | comment_callback )(void *user_dat, const char *comment) |
comment callback function |
|
Functions |
|
void | read_master_file (const char *file, domainname &znroot, void *userdat, error_callback err, rr_callback rr_cb, rr_literal_callback rrl_cb, comment_callback comm_cb, int flags) |
read master files |
|
domainname | guess_zone_name (const char *file) |
guess zone name from file name |
|
FILE * | try_fopen_r (const char *file) |
try and open a file for reading |
|
FILE * | try_fopen (const char *file, const char *mode) |
try and open a file |
|
bool | file_exists (const char *file) |
check for existence of file |
In this file, you will find everything you need to start reading and interpreting master files today!
Definition in file masterfile.h.
|
ignore given znroot and guess from file name Definition at line 91 of file masterfile.h. |
|
Do not require SOA record Definition at line 92 of file masterfile.h. |
|
comment callback function Callback function for line comments, that is lines beginning with a ';' sign. These can be used to embed configuration options in master files.
Definition at line 89 of file masterfile.h. |
|
error callback function This user callback function will be called by read_master_file if a non-terminal error has occured in the master file (e.g. one RR could not be read). It can be handled by the application to display the error message.
Definition at line 48 of file masterfile.h. |
|
compiled RR callback function Callback function getting a compiled resource record.
Definition at line 78 of file masterfile.h. |
|
literal RR callback function Callback function getting literal RR data back from the reader. This can be used by editors to preserve the way the user spelled an RR, for example by using '2h' instead of 7200. The implication of this is that there is no guarantee the actual RR data has the right syntax. If however this is not the case, the error callback is called. If the data contains data relative to a non-znroot origin, it is converted to make it relative to the zone root.
Definition at line 68 of file masterfile.h. |
|
check for existence of file This function tests whether the given file exists and is a common file.
|
|
guess zone name from file name This function will do an educated guess on the zone name for a given file. For example, a file called 'db.acdam.net' will probably be of the 'acdam.net' zone. Supported are the 'db.' prefix and the '.prm' postfix.
|
|
read master files This function will read the given master file for you, calling the supplied callbacks when nessecary. This function contains a fairly simple lexical analyzer which supports most standard master file features, but not the '$include' functionality. If the function detects a syntax error, it will call the error callback function, but it will continue reading the file.
|
|
try and open a file This function tests whether the given filename is a directory, and if it isn't, it will try opening it and return a C-style FILE* pointer.
|
|
try and open a file for reading This function tests whether the given filename is a directory, and if it isn't, it will try opening it and return a C-style FILE* pointer.
|