Пример #1
0
    + semicolon
)
options_stmt_avoid_v6_udp_ports.setName('avoid-v6-udp-ports { port; ... };')

#  Wut?  was 'bindkey-file', now 'bindkeys-file'???
#  bindkey-file <path_name>; [ Opt ]    #  v9.5.0 to Feb 2017
options_stmt_bindkeys_file = (
    Keyword('bindkeys-file').suppress()
    - quoted_path_name('bindkeys_file')
    + semicolon
)

options_stmt_blackhole = (
        Keyword('blackhole').suppress()
        + Group(
            aml_nesting('')
        )('blackhole')
)


#  cache-file <path_name>    # used for ISC internal testing
options_stmt_cache_file = (
    Keyword('cache-file').suppress()
    + quoted_path_name('cache_file')
    + semicolon
)

options_stmt_coresize = (
    Keyword('coresize').suppress()
    - size_spec('coresize')
    + semicolon
Пример #2
0
             Covers the statements that are only found in View
             clause (and no other clauses).

             Does not test for view_name (that is in
             isc_util.py/test_util.py) nor test for
             clause_stmt_view_standalone (that is in clause_view.py/test_clause_view.py)
"""
from pyparsing import Group, Keyword, ZeroOrMore
from bind9_parser.isc_utils import semicolon, isc_boolean
from bind9_parser.isc_aml import aml_nesting
from bind9_parser.isc_trusted_keys import trusted_keys_statements_set

#   match-clients { aml; } ; [ View ]
view_stmt_match_clients = (
    Keyword('match-clients').suppress() -
    Group(aml_nesting(''))('match_clients'))(
        '')  # remove List label as 'match-clients' occurs exactly once

#  match-destinations { aml; } ; [ View ]
view_stmt_match_destinations = (
    Keyword('match-destinations').suppress() -
    Group(aml_nesting(''))('match_destinations'))(
        '')  # remove List label as 'match-destinations' occurs exactly once

#  match-recursive-only { boolean; } ; [ View ]
view_stmt_match_recursive_only = (Keyword('match-recursive-only').suppress() -
                                  isc_boolean('match_recursive_only') +
                                  semicolon)('')

# Keywords are in dictionary-order, but with longest pattern as having been listed firstly
view_statements_set = (
Пример #3
0
    Keyword('avoid-v4-udp-ports').suppress() + lbrack +
    options_ip_port_series('avoid_v4_udp_ports') + rbrack + semicolon)
options_stmt_avoid_v4_udp_ports.setName('avoid-v4-udp-ports { port; ... };')

options_stmt_avoid_v6_udp_ports = (
    Keyword('avoid-v6-udp-ports').suppress() + lbrack +
    options_ip_port_series('avoid_v6_udp_ports') + rbrack + semicolon)
options_stmt_avoid_v6_udp_ports.setName('avoid-v6-udp-ports { port; ... };')

#  Wut?  was 'bindkey-file', now 'bindkeys-file'???
#  bindkey-file <path_name>; [ Opt ]    #  v9.5.0 to Feb 2017
options_stmt_bindkeys_file = (Keyword('bindkeys-file').suppress() -
                              quoted_path_name('bindkeys_file') + semicolon)

options_stmt_blackhole = (Keyword('blackhole').suppress() +
                          Group(aml_nesting(''))('blackhole'))

#  cache-file <path_name>    # used for ISC internal testing
options_stmt_cache_file = (Keyword('cache-file').suppress() +
                           quoted_path_name('cache_file') + semicolon)

options_stmt_coresize = (Keyword('coresize').suppress() -
                         size_spec('coresize') + semicolon)

options_stmt_datasize = (Keyword('datasize').suppress() -
                         size_spec('datasize') + semicolon)

#  deallocate-on-exit <isc_boolean>;
options_stmt_deallocate_on_exit = (Keyword('deallocate-on-exit').suppress() -
                                   isc_boolean('deallocate_on_exit') +
                                   semicolon)
Пример #4
0
#                addresses are added or removed, the
#                localhost ACL element is updated to reflect
#                the changes.
#  * localnets - Matches any host on an IPv4 or IPv6 network
#                for which the system has an interface. When
#                addresses are added or removed, the
#                localnets ACL element is updated to reflect
#                the changes. Some systems do not provide a
#                way to determine the prefix lengths of
#                local IPv6 addresses. In such a case,
#                localnets only matches the local IPv6
#                addresses, just like localhost
#############################################################
# acl acl-name {
#    [ address_match_nosemicolon | any | all ];
# };

clause_stmt_acl_standalone = (
    Keyword('acl').suppress() - Group(  # Best thing I've ever done.
        acl_name  #(Word(alphanums + '_-'))('acl_name')
        - (
            ZeroOrMore(
                Group(aml_nesting('')  # peel away testing label here
                      )('')  # ('aml_series3')
            )(''))('aml_series'))(''))('acl')

# Syntax:
#         acl a { b; };  acl c { d; e; f; }; acl g { ! h; ! { i; }; };
#
clause_stmt_acl_series = ZeroOrMore((clause_stmt_acl_standalone))('acl')
Пример #5
0
optview_stmt_additional_from_auth = (
    Keyword('additional-from-auth').suppress() -
    isc_boolean('additional_from_auth') + semicolon)

optview_stmt_additional_from_cache = (
    Keyword('additional-from-cache').suppress() -
    isc_boolean('additional_from_cache') + semicolon)

# allow-new-zones <boolean>; [ Opt View ]  # v9.5.0+
optview_stmt_allow_new_zones = (Keyword('allow-new-zones').suppress() -
                                isc_boolean('allow_new_zones') + semicolon)

optview_stmt_allow_query_cache = (
    Keyword('allow-query-cache').suppress() -
    Group(aml_nesting(''))('allow_query_cache'))('')

optview_stmt_allow_query_cache_on = (
    Keyword('allow-query-cache-on').suppress() -
    Group(aml_nesting(''))('allow_query_cache_on'))('')

optview_stmt_allow_recursion = (
    Keyword('allow-recursion').suppress() -
    Group(aml_nesting(''))('allow-recursion'))(
        '')  # 'allow-recursion' can only be specified ONCE

optview_stmt_allow_recursion_on = (
    Keyword('allow-recursion-on').suppress() -
    Group(aml_nesting(''))('allow-recursion-on'))(
        '')  # 'allow-recursion-on' can only be specified ONCE