Skip to content
Snippets Groups Projects
Commit 7e5809be authored by Lubos Slovak's avatar Lubos Slovak
Browse files

Merge remote branch 'origin/zoneparser' into ldns-to-dnslib

Conflicts:
	src/dnslib/zone.h
parents 74a97727 b2c68157
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,8 @@ struct dnslib_zone {
dnslib_node_t *apex; /*!< Apex node of the zone (holding SOA) */
avl_tree_t *tree; /*!< AVL tree for holding zone nodes. */
avl_tree_t *nsec3_nodes; /*!< AVL tree for holding NSEC3 nodes. */
ck_hash_table *table; /*!< Hash table for holding zone nodes. */
uint non_authorative_node_count;
ck_hash_table_t *table; /*!< Hash table for holding zone nodes. */
uint node_count;
};
typedef struct dnslib_zone dnslib_zone_t;
......
......@@ -320,7 +320,7 @@ static void dnslib_node_dump_binary(dnslib_node_t *node, void *data)
assert(node->owner != NULL);
if (!dnslib_node_is_non_auth(node)) {
zone->non_authorative_node_count++;
zone->node_count++;
}
dnslib_dname_dump_binary(node->owner, f);
......@@ -397,7 +397,7 @@ int dnslib_zone_dump_binary(dnslib_zone_t *zone, const char *filename)
return -1;
}
zone->non_authorative_node_count = 0;
zone->node_count = 0;
skip_list_t *encloser_list = skip_create_list(compare_pointers);
......@@ -410,8 +410,8 @@ int dnslib_zone_dump_binary(dnslib_zone_t *zone, const char *filename)
fwrite(&node_count, sizeof(node_count), 1, f);
fwrite(&node_count, sizeof(node_count), 1, f);
fwrite(&zone->non_authorative_node_count,
sizeof(zone->non_authorative_node_count),
fwrite(&zone->node_count,
sizeof(zone->node_count),
1, f);
dnslib_dname_dump_binary(zone->apex->owner, f);
......@@ -436,15 +436,15 @@ int dnslib_zone_dump_binary(dnslib_zone_t *zone, const char *filename)
fwrite(&tmp_count, sizeof(tmp_count), 1, f);
fwrite(&node_count, sizeof(node_count), 1, f);
fwrite(&zone->non_authorative_node_count,
sizeof(zone->non_authorative_node_count),
fwrite(&zone->node_count,
sizeof(zone->node_count),
1, f);
printf("written %d normal nodes\n", tmp_count);
printf("written %d nsec3 nodes\n", node_count);
printf("non authorative nodes: %u\n", zone->non_authorative_node_count);
printf("authorative nodes: %u\n", zone->node_count);
fclose(f);
......
......@@ -335,7 +335,7 @@ dnslib_zone_t *dnslib_zone_load(const char *filename)
char apex_found = 0;
uint non_authorative_node_count;
uint auth_node_count;
static const uint8_t MAGIC[MAGIC_LENGTH] = {99, 117, 116, 101};
/*c u t e */
......@@ -347,10 +347,10 @@ dnslib_zone_t *dnslib_zone_load(const char *filename)
fread(&node_count, sizeof(node_count), 1, f);
fread(&nsec3_node_count, sizeof(nsec3_node_count), 1, f);
fread(&non_authorative_node_count,
sizeof(non_authorative_node_count), 1, f);
fread(&auth_node_count,
sizeof(auth_node_count), 1, f);
debug_zp("non authorative nodes: %u\n", non_authorative_node_count);
debug_zp("authorative nodes: %u\n", auth_node_count);
uint8_t dname_size;
uint8_t dname_wire[DNAME_MAX_WIRE_LENGTH];
......
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