The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Unix::Conf::Bind8::Conf - Front end for a suite of classes for manipulating a Bind8 style configuration file.

SYNOPSIS

Refer to the SYNOPSIS section for Unix::Conf::Bind8.

DESCRIPTION

This class has interfaces for the various class methods of the classes that reside beneath Unix::Conf::Bind8::Conf. This class is an internal class and should not be accessed directly. Methods in this class can be accessed through a Unix::Conf::Bind8::Conf object which is returned by Unix::Conf::Bind8->new_conf (). Refer to Unix::Conf::Bind8 for further details.

new ()
 Arguments
 FILE         => 'path of the configuration file',
 SECURE_OPEN  => 0/1,       # default 1 (enabled)

Class constructor. Creates a new Unix::Conf::Bind8::Conf object. The constructor parses the Bind8 file specified by FILE and contains subobjects representing various directives like options, logging, zone, acl etc. Direct use of this constructor is deprecated. Use Unix::Conf::Bind8->new_conf () instead. Returns a Unix::Conf::Bind8::Conf object on success, or an Err object on failure.

fh ()

Object method. Returns the ConfIO object representing the configuration file.

new_dummy ()
 Arguments
 WHERE             => 'FIRST'|'LAST'|'BEFORE'|'AFTER'
 WARG              => Unix::Conf::Bind8::Conf::Directive subclass object
                                  # WARG is to be provided only in case WHERE eq 'BEFORE 
                                  # or WHERE eq 'AFTER'

Object method. Creates a dummy directive. Such directives are used to hold data between two directives, i.e. comments, whitespace etc. Returns a Unix::Conf::Bind8::Conf::Directive object on success or Err object on failure.

new_options ()
 Arguments
 SUPPORTED-OPTION-NAME-IN-CAPS => value    
 WHERE             => 'FIRST'|'LAST'|'BEFORE'|'AFTER'
 WARG              => Unix::Conf::Bind8::Conf::Directive subclass object
                                  # WARG is to be provided only in case WHERE eq 'BEFORE 
                                  # or WHERE eq 'AFTER'

Object Method. Refer to Unix::Conf::Bind8::Conf::Options for supported options. The arguments should be same as expected by various the various methods of Unix::Conf::Bind8::Conf::Options. Returns a Unix::Conf::Bind8::Conf::Options object on success or an Err object on failure.

get_options ()

Object method. Returns the Unix::Conf::Bind8::Conf::Options object if defined (either through a call to new_options or one created when the configuration file is parsed) or Err if none is defined.

delete_options ()

Object method Deletes the defined (either through a call to new_options or one created when the configuration file is parsed) Unix::Conf::Bind8::Conf::Options object. Returns true if a Unix::Conf::Bind8::Conf::Options object is present, an Err object otherwise.

new_acl ()
 Arguments
 NAME      => 'acl-name',                               # Optional
 ELEMENTS  => [ qw (10.0.0.1 10.0.0.2 192.168.1.0/24) ],
 WHERE             => 'FIRST'|'LAST'|'BEFORE'|'AFTER'
 WARG              => Unix::Conf::Bind8::Conf::Directive subclass object
                                  # WARG is to be provided only in case WHERE eq 'BEFORE 
                                  # or WHERE eq 'AFTER'

Object method. Returns a new Unix::Conf::Bind8::Conf::Acl object on success or an Err object on failure.

get_acl ()
 Arguments
 'ACL-NAME',

Class/Object method. Returns the Unix::Conf::Bind8::Conf::Acl object representing 'ACL-NAME' if defined (either through a call to new_acl or one created when the configuration file is parsed), an Err object otherwise.

delete_acl ()
 Arguments
 'ACL-NAME',

Class/Object method. Deletes the Unix::Conf::Bind8::Conf::Acl object representing 'ACL-NAME' if defined (either through a call to new_acl or one created when the configuration file is parsed) and returns true, or returns an Err object otherwise.

acls ()
 Arguments
 CONTEXT        => 'ROOT'               # Optional. If this argument is not present
                                                        # only ACLs defined in this conf file will
                                                        # be returned. Else all ACLs defined will
                                                        # be returned.

Class/Object method. Iterates through the list of defined Unix::Conf::Bind8::Conf::Acl objects (either through a call to new_acl or ones created when parsing the file, returning an object at a time when called in scalar context, or a list of all objects when called in list context.

new_zone ()
 Arguments
 NAME          => 'zone-name',
 CLASS         => 'zone-class',        # in|hs|hesiod|chaos
 TYPE          => 'zone-type',         # master|slave|forward|stub|hint
 FILE          => 'records-file',
 MASTERS       => [ qw (10.0.0.1 10.0.0.2) ],
 FORWARD       => 'value',             # yes|no
 FORWARDERS    => [ qw (192.168.1.1 192.168.1.2) ],
 CHECK-NAMES   => 'value'              # fail|warn|ignore
 ALLOW-UPDATE  => Unix::Conf::Bind8::Conf::Acl object,
 ALLOW-QUERY   => Unix::Conf::Bind8::Conf::Acl object,
 ALLOW-TRANSFER=> Unix::Conf::Bind8::Conf::Acl object,
 NOTIFY        => 'value,              # yes|no
 ALSO-NOTIFY   => [ qw (10.0.0.3) ],
 WHERE             => 'FIRST'|'LAST'|'BEFORE'|'AFTER'
 WARG              => Unix::Conf::Bind8::Conf::Directive subclass object
                                  # WARG is to be provided only in case WHERE eq 'BEFORE 
                                  # or WHERE eq 'AFTER'

Object method. Creates and returns a new Unix::Conf::Bind8::Conf::Zone object if successful, or an Err object otherwise.

get_zone () Arguments 'ZONE-NAME',

Class/Object method. Returns the Unix::Conf::Bind8::Conf::Zone object representing ZONE-NAME if defined (either through a call to new_zone () or one created when parsing the configuration file), an Err object otherwise.

delete_zone ()
 Arguments
 'ZONE-NAME',

Class/Object method. Deletes the Unix::Conf::Bind8::Conf::Zone object representing ZONE-NAME if defined (either through a call to new_zone () or one created when parsing the configuration file) and returns true, or returns an Err object otherwise.

zones ()
 Arguments
 CONTEXT        => 'ROOT'               # Optional. If this argument is not present
                                                        # only ZONEs defined in this conf file will
                                                        # be returned. Else all ZONEs defined will
                                                        # be returned.

Class/Object method. Iterates through a list of defined Unix::Conf::Bind8::Conf::Zone objects (either through a call to new_zone () or ones created when parsing the configuration file), returning one at a time when called in scalar context, or a list of all objects when called in list context.

new_logging ()
 Arguments
 CHANNELS   => [
    { 
           NAME             => 'channel-name1',
           OUTPUT           => 'value',      # syslog|file|null
           SEVERITY         => 'severity',   # if OUTPUT eq 'syslog'
           FILE             => 'path',       # if OUTPUT eq 'file'
           'PRINT-TIME'     => 'value',      # 'yes|no'
           'PRINT-SEVERITY' => 'value',      # 'yes|no'
           'PRINT-CATEGORY' => 'value',      # 'yes|no'
   },
 ],
 CATEGORIES  => [
      [ category1        => [ qw (channel1 channel2) ],
      [ category2        => [ qw (channel1 channel2) ],
 ],
 WHERE             => 'FIRST'|'LAST'|'BEFORE'|'AFTER'
 WARG              => Unix::Conf::Bind8::Conf::Directive subclass object
                                  # WARG is to be provided only in case WHERE eq 'BEFORE 
                                  # or WHERE eq 'AFTER'

Object method. Creates a new Unix::Conf::Bind8::Conf::Logging object and returns it if successful, or an Err object otherwise.

get_logging ()

Class/Object method. Returns the Unix::Conf::Bind8::Logging object if defined (either through a call to new_logging () or one created when parsing the configuration file), an Err object otherwise.

delete_logging ()

Class/Object method. Deletes the Unix::Conf::Bind8::Logging object if defined (either through a call to new_logging () or one created when parsing the configuration file) and returns true, or returns an Err object otherwise.

new_include ()
 Arguments
 FILE         => 'path of the configuration file',
 SECURE_OPEN  => 0/1,        # default 1 (enabled)
 WHERE             => 'FIRST'|'LAST'|'BEFORE'|'AFTER'
 WARG              => Unix::Conf::Bind8::Conf::Directive subclass object
                                  # WARG is to be provided only in case WHERE eq 'BEFORE 
                                  # or WHERE eq 'AFTER'

Object method. Creates a new Unix::Conf::Bind8::Conf::Include object which contains an Unix::Conf::Bind8::Conf object representing FILE and returns it if successful, or an Err object otherwise.

get_include ()
 Arguments
 'INCLUDE-NAME',

Object method. Returns the Unix::Conf::Bind8::Conf::Include object representing INCLUDE-NAME if defined (either through a call to new_include () or one created when parsing the configuration file), an Err object otherwise.

get_include_conf ()
 Arguments
 'INCLUDE-NAME'

Object method. Return the Unix::Conf::Bind8::Conf object inside a defined Unix::Conf::Bind8::Conf::Include of name INCLUDE-NAME.

delete_include ()
 Arguments
 'INCLUDE-NAME',

Object method. Deletes the Unix::Conf::Bind8::Conf::Include object representing INCLUDE-NAME if defined (either through a call to new_include () or one created when parsing the configuration file) and returns true, or returns an Err object otherwise.

includes ()
 Arguments
 CONTEXT        => 'ROOT'               # Optional. If this argument is not present
                                                        # only INCLUDEs defined in this conf file will
                                                        # be returned. Else all INCLUDEs defined will
                                                        # be returned.

Object method. Iterates through defined Unix::Conf::Bind8::Conf::Include objects (either through a call to new_include () or ones created when parsing the configuration file), returning one at a time when called in scalar context, or a list of all defined includes when called in list context.

get_db ()
 Arguments
 'ZONE-NAME',
 0/1,        # SECURE_OPEN (OPTIONAL). If not specified the value
             # for the ConfIO object is taken.

Object method Returns a Unix::Conf::Bind8::DB object representing the records file for zone 'ZONE-NAME' if successful, an Err object otherwise.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 63:

=over without closing =back