## Chapter 2. Configuration

## sections

A section declaration follow the rules:

         section  : name argument '{' commands '}' ';'
         name     : symbol
         argument : (string)?
         commands : (section_specific_command ';')*
         symbol   : [a-zA-Z0-9_]+
         string   : "([^\\\"]|\\[\\\"])*"

### config

         section_specific_command : option_selection
         option_selection         : symbol '=' string

    config {
        transp   = "ipv4,ipv6,std";
        output   = "straight,text";
        verbose  = "explain,details,intro,counter";
        error    = "standard";
        resolver = "127.0.0.1";
    };

### constant

toto

         section_specific_command : affectation
         affectation              : symbol '=' string

    constant {
        # For connectivity testing
        #  the '%s' will be replaced by the IP address
        ping4                 = "ping  -q -c 5 %s > /dev/null";
        ping6                 = "ping6 -q -c 5 %s > /dev/null";

        # HTML path for generated pages
        publish_html_path     = "/zc/";
    };

### useconf

toto

         section_specific_command : domain_mapping
         domain_mapping           : 'map' domainname filename
         domainname               : string
         filename                 : string

    useconf {
        map "fr."         "zc.conf.fr";
        map "arpa."       "zc.conf.arpa";
        map "."           "zc.conf.root";
    };

### testseq

toto

         commands                 : block
         block                    : (check ';' | switch)*
         check                    : checkname  severity  category
         switch                   : 'case' testname ('when' symbol block)+
                                                    ('else' block)? 'end'
         testname                 : symbol    # with prefix 'tst_'
         checkname                : symbol    # with prefix 'chk_'
         severity                 : 'f' | 'w' | 'i'

    testseq "address" {
        chk_given_ip			f	dns;
        chk_given_nsprim_vs_soa		f	dns;
        case tst_mail_by_mx_or_a
        when MX
            # MX
    	chk_mx				f	dns;
    	chk_mx_auth			f	dns;
    	chk_mx_sntx			f	dns;
        end
    };