Ejemplo n.º 1
0
optviewzone_stmt_ixfr_from_differences = (
    Keyword('ixfr-from-differences').suppress()
    + (
            Literal('master')
            | Literal('primary')
            | Literal('slave')
            | Literal('secondary')
            | isc_boolean
    )('ixfr_from_differences')
    + semicolon
)

# ixfr-tmp-file <path_name:; [ Opt View Zone ]  #  v8.0 to v8.4; now inert
optviewzone_stmt_ixfr_tmp_file = (
    Keyword('ixfr-tmp-file').suppress()
    + path_name('ixfr_tmp_file')
    + semicolon
)

# key-directory path_name; [ Opt View Zone]
optviewzone_stmt_key_directory = (
    Keyword('key-directory').suppress()
    - quoted_path_name('key_directory')
    + semicolon
)

#  maintain-ixfr-base <boolean>; [ Opt View Zone ]  # v8.2- v9.7.0; still inert
optviewzone_stmt_maintain_ixfr_base = (
    Keyword('maintain-ixfr-base').suppress()
    - isc_boolean('maintain_ixfr_base')
    + semicolon
Ejemplo n.º 2
0
    Keyword('memstatistics-file').suppress()
    - quoted_path_name('memstatistics_file')
    + semicolon
)

#  multiple-cnames <boolean>; [ Opt ]
options_stmt_multiple_cnames = (
    Keyword('multiple-cnames').suppress()
    - isc_boolean('multiple_cnames_boolean')
    + semicolon
)

#  named-xfer <path_name>; [ Opt ]   Introduced in 8.1, still inert @ v9.10.3
options_stmt_named_xfer = (
    Keyword('named-xfer').suppress()
    - path_name('named_xfer_path_name')
    + semicolon
)

# pid-file "path_to_file"; [ Opt ]  # v8.1+
options_stmt_pid_file = (
    Keyword('pid-file').suppress()
    - quoted_path_name('pid_file_path_name')
    + semicolon
)

options_stmt_port = inet_ip_port_keyword_and_number_element + semicolon

#   prefetch expiry-ttl-seconds [threshold-ttl-secs] ; [ Opt ]\
options_stmt_prefetch = (
    Keyword('prefetch').suppress()
Ejemplo n.º 3
0
# from bind9_parser.isc_clause_masters import clause_stmt_masters_standalone

######## Zone statements #############################################
zone_stmt_check_names = (Keyword('check-names').suppress() -
                         check_options('check_names') + semicolon)

database_arg = path_name
zone_stmt_database_former = (
    Keyword('database').suppress() -
    Group(path_name - ZeroOrMore(database_arg('arg'))('args'))('') +
    semicolon)('database')

zone_stmt_delegation_only = (Keyword('delegation-only').suppress() -
                             isc_boolean('delegation-only') + semicolon)

zone_stmt_file = (Keyword('file').suppress() - path_name('file') + semicolon)

zone_stmt_in_view = (Keyword('in-view').suppress() - view_name('in_view') +
                     semicolon)

zone_stmt_inline_signing = (Keyword('inline-signing').suppress() -
                            isc_boolean('inline-signing') + semicolon)

# ixfr-base got obsoleted; 9.15.0 doesn't have it, might be before
zone_stmt_ixfr_base = (Keyword('ixfr-base').suppress() -
                       isc_file_name('ixfr_base') + semicolon)

zone_stmt_ixfr_from_differences = (
    Keyword('ixfr-from-differences').suppress() -
    isc_boolean('ixfr_from_differences') + semicolon)
Ejemplo n.º 4
0
options_stmt_memstatistics = (Keyword('memstatistics').suppress() -
                              isc_boolean('memstatistics') + semicolon)

#  memstatistics-file <path_name>; [ Opt ]  # v8.0 to v9.1.8; now inert
options_stmt_memstatistics_file = (Keyword('memstatistics-file').suppress() -
                                   quoted_path_name('memstatistics_file') +
                                   semicolon)

#  multiple-cnames <boolean>; [ Opt ]
options_stmt_multiple_cnames = (Keyword('multiple-cnames').suppress() -
                                isc_boolean('multiple_cnames_boolean') +
                                semicolon)

#  named-xfer <path_name>; [ Opt ]   Introduced in 8.1, still inert @ v9.10.3
options_stmt_named_xfer = (Keyword('named-xfer').suppress() -
                           path_name('named_xfer_path_name') + semicolon)

# pid-file "path_to_file"; [ Opt ]  # v8.1+
options_stmt_pid_file = (Keyword('pid-file').suppress() -
                         quoted_path_name('pid_file_path_name') + semicolon)

options_stmt_port = inet_ip_port_keyword_and_number_element + semicolon

#   prefetch expiry-ttl-seconds [threshold-ttl-secs] ; [ Opt ]\
options_stmt_prefetch = (
    Keyword('prefetch').suppress() +
    Group(number_type('expiry_ttl') +
          Optional(seconds_type('threshold_ttl')))('prefetch') + semicolon)

#   querylog ( yes | no ); [ Opt ]
options_stmt_querylog = (Keyword('querylog').suppress() -
Ejemplo n.º 5
0
    Optional(inet_dscp_port_keyword_and_number_element) + lbrack +
    (((forwarders_ip46_addr_prefix_port_series)(''))('fwdr3'))('fwdr2') +
    rbrack + semicolon)(''))('fowarders')

# ixfr-from-differences ( master | slave | <boolean> );
optviewzone_stmt_ixfr_from_differences = (
    Keyword('ixfr-from-differences').suppress() +
    (Literal('master')
     | Literal('primary')
     | Literal('slave')
     | Literal('secondary')
     | isc_boolean)('ixfr_from_differences') + semicolon)

# ixfr-tmp-file <path_name:; [ Opt View Zone ]  #  v8.0 to v8.4; now inert
optviewzone_stmt_ixfr_tmp_file = (Keyword('ixfr-tmp-file').suppress() +
                                  path_name('ixfr_tmp_file') + semicolon)

# key-directory path_name; [ Opt View Zone]
optviewzone_stmt_key_directory = (Keyword('key-directory').suppress() -
                                  quoted_path_name('key_directory') +
                                  semicolon)

#  maintain-ixfr-base <boolean>; [ Opt View Zone ]  # v8.2- v9.7.0; still inert
optviewzone_stmt_maintain_ixfr_base = (
    Keyword('maintain-ixfr-base').suppress() -
    isc_boolean('maintain_ixfr_base') + semicolon)

# masterfile-format text | raw | map;
# masterfile-format map;
optviewzone_stmt_masterfile_format = (Keyword('masterfile-format').suppress() +
                                      (Literal('text')
Ejemplo n.º 6
0
    Group(aml_nesting(''))('allow-recursion-on'))(
        '')  # 'allow-recursion-on' can only be specified ONCE

optview_attach_cache_name = name_type  # TODO: Identify when it got obsoleted???
optview_attach_cache_name.setName('<cache_name>')
optview_stmt_attach_cache = (Keyword('attach-cache').suppress() -
                             optview_attach_cache_name('attach_cache') +
                             semicolon)

# [auth-nxdomain yes | no;]
optview_stmt_auth_nxdomain = (Keyword('auth-nxdomain').suppress() -
                              isc_boolean('auth_nxdomain') + semicolon)

#  cache-file <path_name>  # [ Opt View ]
optview_stmt_cache_file = (Keyword('cache-file').suppress() -
                           path_name('cache_file') + semicolon)

optview_stmt_check_dup_records = (Keyword('check-dup-records').suppress() -
                                  check_options('check_dup_records') +
                                  semicolon)  # [ Opt View Zone ] v9.5+

optview_stmt_check_integrity = (Keyword('check-integrity').suppress() -
                                isc_boolean('check_integrity') + semicolon
                                )  # [ Opt View Zone ] v9.4+

optview_stmt_check_mx = (Keyword('check-mx').suppress() -
                         check_options('check_mx') + semicolon
                         )  # [ Opt View Zone ] v9.4+

optview_stmt_check_mx_cname = (Keyword('check-mx-cname').suppress() -
                               check_options('check_mx_cname') + semicolon
Ejemplo n.º 7
0
Clause: dlz

Title: Clause statement for the DLZ

Description:
"""

from pyparsing import Group, CaselessKeyword, alphanums, Word, ZeroOrMore, OneOrMore
from bind9_parser.isc_utils import semicolon, name_type, isc_boolean, \
        lbrack, rbrack, dlz_name_type,\
        path_name

#  database <string>;
dlz_database_element = (CaselessKeyword('database').suppress() -
                        path_name('db_args') + semicolon)

#  search <boolean>;
dlz_search_element = (CaselessKeyword('search').suppress() -
                      isc_boolean('search') + semicolon)

# At the moment, orderings matter: 'database' first, then 'search'
dlz_element_group = ((dlz_search_element + dlz_database_element)
                     | (dlz_database_element + dlz_search_element))

#  dlz <string> { database <string>; search <boolean>; };  [ DLZ ]
clause_stmt_dlz_standalone = (CaselessKeyword('dlz').suppress() - Group(
    dlz_name_type('dlz_name') - lbrack - OneOrMore(dlz_element_group('')) +
    rbrack) + semicolon)('dlz')

clause_stmt_dlz_series = (ZeroOrMore(clause_stmt_dlz_standalone))('dlz')