Skip to content
Snippets Groups Projects
Commit 7fcc9d08 authored by Jan Kadlec's avatar Jan Kadlec
Browse files

Added comments to zone load/dump.

Refs #280
parent 24ee8d32
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,25 @@
#include "dnslib.h"
#include "skip-list.h"
/* \note For space and speed purposes, dname ID (to be later used in loading)
* is being stored in dname->node field. Not to be confused with dname's actual
* node.
*/
/* \note Contents of dump file:
* MAGIC(cutexx) NUMBER_OF_NORMAL_NODES NUMBER_OF_NSEC3_NODES
* [normal_nodes] [nsec3_nodes]
* node has following format:
* owner_size owner_wire owner_label_size owner_labels owner_id
* node_flags node_rrset_count [node_rrsets]
* rrset has following format:
* rrset_type rrset_class rrset_ttl rrset_rdata_count rrset_rrsig_count
* [rrset_rdata] [rrset_rrsigs]
* rdata can either contain full dnames (that is with labels but without ID)
* or dname ID, if dname is in the zone
* or raw data stored like this: data_len [data]
*/
struct arg {
void *arg1; /* FILE *f / zone */
void *arg2; /* skip_list_t */
......@@ -21,7 +40,6 @@ static int compare_pointers(void *p1, void *p2)
return ((size_t)p1 == (size_t)p2 ? 0 : (size_t)p1 < (size_t)p2 ? -1 : 1);
}
/* Functions for zone traversal are taken from dnslib/zone.c */
static void dnslib_zone_save_encloser_rdata_item(dnslib_rdata_t *rdata,
dnslib_zone_t *zone, uint pos,
......
......@@ -9,6 +9,20 @@
#include "common.h"
#include "debug.h"
/* \note Contents of dump file:
* MAGIC(cutexx) NUMBER_OF_NORMAL_NODES NUMBER_OF_NSEC3_NODES
* [normal_nodes] [nsec3_nodes]
* node has following format:
* owner_size owner_wire owner_label_size owner_labels owner_id
* node_flags node_rrset_count [node_rrsets]
* rrset has following format:
* rrset_type rrset_class rrset_ttl rrset_rdata_count rrset_rrsig_count
* [rrset_rdata] [rrset_rrsigs]
* rdata can either contain full dnames (that is with labels but without ID)
* or dname ID, if dname is in the zone
* or raw data stored like this: data_len [data]
*/
enum { MAGIC_LENGTH = 6 };
enum { DNAME_MAX_WIRE_LENGTH = 256 };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment