DNS zone files agent
====================

For reading and writing zone files (usually located in /var/lib/named
directory or in some of its subdirectories) dns_zone agent was created.

It is stateless. Its only functions are 
1. Read and parse specified zone file and provide it as a map
2. Take map descrining the zone file, assemble the file and write it to
   specified file


The map used for communication between the agent and YCP code has following
structure:

$[
  "TTL":"2W",
  "records":[
    $[
      "key":"",
      "type":"MX",
      "value":"10 dns.domain.cz."
    ],
    $[
      "key":"",
      "type":"NS",
      "value":"dns.domain.cz."
    ],
    $[
      "key":"dns",
      "type":"A",
      "value":"1.2.3.4"
    ],
  ],
  "soa":$[
    "expiry":"1W",
    "mail":"root.domain.cz.",
    "minimum":"1D",
    "refresh":"1H",
    "retry":"1H",
    "serial":2003080400,
    "server":"dns.domain.cz",
    "zone":"@"
  ]
]

This example is equal to following zone file:

$TTL 2W
@               IN SOA          dns.domain.cz   root.domain.cz. (
                                2003080400      ; serial
                                1H              ; refresh
                                1H              ; retry
                                1W              ; expiry
                                1D )            ; minimum
                IN MX           10 dns.domain.cz.
                IN NS           dns.domain.cz.
dns             IN A            1.2.3.4



The map comtains 3 main keys:
1. "TTL" contains the TTL value at the beginning of the zone file
2. "records" containing all records in the zone file except TTL and SOA
3. "soa" containint the SOA record of the domain

The meaning of all of the entries is obvious from the example.


Agent interface:

Read (.dns.zone, [ "filename" ]) -> zone_map
  reads the specified zone file, parses it and returns the zone as a map
  with the above mentioned structure
  FIXME: Why list, why not only filename?
Write (.dns.zone, [ "filename", zone_map ]) -> boolean
  assembles the zone file from the specified map and saves it as file
  with specified name. Returns true on success
