Commit 832fc7df authored by Jan Kadlec's avatar Jan Kadlec

Incremental commit.

parent e4b87292
ACLOCAL_AMFLAGS = -I ../m4
libexec_PROGRAMS = knot-zcompile unittests unittests-zcompile unittests-libknot-realdata unittests-libknot unittests-xfr unittests-zscanner
sbin_PROGRAMS = knotc knotd
libexec_PROGRAMS = knot-zcompile
sbin_PROGRAMS =
dist_man_MANS = knot.conf.5 knotc.8 knotd.8
# $(YACC) will generate header file
......@@ -10,32 +10,29 @@ AM_YFLAGS = -d
libknotd_la_YFLAGS = -pcf_ -d
libknotd_la_LFLAGS = # TODO: reentrant parser, prefix
zscanner/scanner.c: zscanner/scanner.rl zscanner/scanner_body.rl
$(RAGEL) -s -o zscanner/scanner.c zscanner/scanner.rl
knot_zcompile_SOURCES = \
libknot/rrset.c \
libknot/rrset.h \
zcompile/zcompile_main.c \
zcompile/zcompile-error.c \
zcompile/parser-util.h \
zcompile/parser-descriptor.h \
zcompile/zparser.y \
zcompile/zlexer.l \
zcompile/zcompile.c \
zcompile/parser-util.c \
zcompile/parser-descriptor.c
unittests_zscanner_SOURCES = \
zscanner/test/zscanner_test.c \
zscanner/test/tests.h \
zscanner/test/tests.c \
zcompile/parser-descriptor.c \
zscanner/test/processing.h \
zscanner/test/processing.c
noinst_LTLIBRARIES = libknot.la libknots.la libzscanner.la
libknot_la_SOURCES = \
zscanner/test/processing.c \
libknot/util/utils.c \
libknot/util/debug.c \
libknot/util/debug.h \
libknot/util/utils.h \
libknot/hash/cuckoo-hash-table.c \
libknot/hash/cuckoo-hash-table.h \
libknot/hash/hash-functions.h \
libknot/hash/hash-functions.c \
libknot/hash/universal-system.c \
libknot/hash/universal-system.h \
libknot/util/tolower.h \
libknot/util/tolower.c \
libknot/zone/zone.c \
......@@ -48,12 +45,10 @@ libknot_la_SOURCES = \
libknot/zone/node.c \
libknot/zone/dname-table.h \
libknot/zone/dname-table.c \
libknot/rrset.c \
libknot/dname.c \
libknot/dname.h \
libknot/rrset.h
libknots_la_SOURCES = \
libknot/nsec3.h \
libknot/nsec3.c \
common/slab/slab.c \
common/slab/slab.h \
common/libtap/tap.c \
......@@ -110,12 +105,7 @@ libknots_la_SOURCES = \
common/fdset_epoll.h \
common/fdset_epoll.c \
common/log.c \
common/log.h
zscanner/scanner.c: zscanner/scanner.rl zscanner/scanner_body.rl
$(RAGEL) -s -o zscanner/scanner.c zscanner/scanner.rl
libzscanner_la_SOURCES = \
common/log.h \
zscanner/file_loader.h \
zscanner/file_loader.c \
zscanner/scanner.h \
......@@ -123,9 +113,7 @@ libzscanner_la_SOURCES = \
zscanner/scanner_functions.h \
zscanner/scanner_functions.c
libknots_la_LIBADD = @LIBOBJS@
knot_zcompile_LDADD = libknots.la libknot.la libknotd.la libzscanner.la @LIBOBJS@
unittests_zscanner_LDADD = libknots.la libknot.la libknotd.la libzscanner.la @LIBOBJS@
knot_zcompile_LDADD = @LIBOBJS@
# automake complains on % rules:
# `%'-style pattern rules are a GNU make extension
......
......@@ -97,12 +97,12 @@ static const rdata_descriptor_t rdata_descriptors[] = {
KNOT_RDATA_WF_END } },
};
const int *get_rdata_descriptor(const uint16_t type)
const rdata_descriptor_t *get_rdata_descriptor(const uint16_t type)
{
if (type <= KNOT_RRTYPE_TSIG) {
return (int *)rdata_descriptors[type];
return &rdata_descriptors[type];
} else {
return (int *)rdata_descriptors[0];
return &rdata_descriptors[0];
}
}
......
......@@ -125,7 +125,7 @@ typedef struct {
* \return RR descriptor for given name, NULL descriptor if
* unknown type.
*/
const int *get_rdata_descriptor(const uint16_t type);
const rdata_descriptor_t *get_rdata_descriptor(const uint16_t type);
int descriptor_item_is_dname(int item);
......
......@@ -1691,7 +1691,7 @@ int ck_rehash(ck_hash_table_t *table)
us_next(&table->hash_system,
NEXT_GENERATION(table->generation));
} while (false /*! \todo Add proper condition!! */);
} while (0 /*! \todo Add proper condition!! */);
SET_REHASHING_OFF(&table->generation);
......
......@@ -364,7 +364,7 @@ uint16_t knot_packet_qtype(const knot_packet_t *packet);
* \param packet Packet containing question.
* \param qtype New QTYPE for question.
*/
void knot_packet_set_qtype(knot_packet_t *packet, knot_rr_type_t qtype);
void knot_packet_set_qtype(knot_packet_t *packet, int qtype);
/*!
......
......@@ -277,7 +277,7 @@ void knot_rdata_deep_free(knot_rdata_t **rdata, unsigned int type,
* \retval > 0 if \a r1 goes after \a r2 in canonical order.
*/
int knot_rdata_compare(const knot_rdata_t *r1, const knot_rdata_t *r2,
const uint8_t *format);
const int *format);
/*!
* \brief Retrieves the domain name from CNAME RDATA.
......
This diff is collapsed.
......@@ -225,7 +225,7 @@ uint8_t *knot_rrset_get_rdata(knot_rrset_t *rrset, size_t rdata_pos);
knot_rdata_t *knot_rrset_rdata_get_next(knot_rrset_t *rrset,
knot_rdata_t *rdata);
int knot_rrset_rdata_rr_count(const knot_rrset_t *rrset);
int16_t knot_rrset_rdata_rr_count(const knot_rrset_t *rrset);
/*!
* \brief Returns the set of RRSIGs covering the given RRSet.
......@@ -345,6 +345,9 @@ int knot_rrset_merge(void **r1, void **r2);
*/
int knot_rrset_merge_no_dupl(void **r1, void **r2);
uint32_t knot_rrset_rdata_length(const knot_rrset_t *rrset, size_t rdata_pos);
uint32_t knot_rrset_rdata_length_total(const knot_rrset_t *rrset);
#endif /* _KNOT_RRSET_H_ */
/*! @} */
......@@ -152,10 +152,11 @@ static int knot_zone_contents_solve_rrset_dnames(knot_zone_contents_t *zone,
// for each RDATA in RRSet
uint16_t rr_count = knot_rrset_rdata_rr_count(rrset);
for (int i = 0; i < rr_count; i++) {
const int *desc =
const rdata_descriptor_t *desc =
get_rdata_descriptor(knot_rrset_type(rrset));
for (int j = 0; desc[j] != KNOT_RDATA_WF_END; j++) {
if (descriptor_item_is_dname(desc[j])) {
assert(desc);
for (int j = 0; desc->block_types[j] != KNOT_RDATA_WF_END; j++) {
if (descriptor_item_is_dname(desc->block_types[j])) {
/* Query whole zone for these dnames. */
// TODO
}
......@@ -337,12 +338,13 @@ static void knot_zone_contents_adjust_rdata_in_rrset(knot_rrset_t *rrset,
{
uint16_t type = knot_rrset_type(rrset);
int *desc =
rdata_descriptor_by_type(type);
const rdata_descriptor_t *desc =
get_rdata_descriptor(type);
assert(desc);
for (int i = 0; i < knot_rrset_rdata_rr_count(rrset); i++) {
for (int j = 0; desc[j] != KNOT_RDATA_WF_END; j++) {
if (descriptor_item_is_dname(desc[j])) {
for (int j = 0; desc->block_types[j] != KNOT_RDATA_WF_END; j++) {
if (descriptor_item_is_dname(desc->block_types[j])) {
dbg_zone("Adjusting domain name at "
"position %d of RDATA of record with owner "
"%s and type %s.\n",
......@@ -510,18 +512,18 @@ dbg_zone_exec_verb(
/*
* 1) Store domain names to dname table.
* TODO: make optional!
* TODO: make optional! WFT? This was not even needed (maybe transfers)
*/
assert(zone->dname_table != NULL);
int ret = knot_zone_contents_dnames_from_node_to_table(
zone->dname_table, node);
if (ret != KNOT_EOK) {
dbg_xfrin("Failed to add dnames from adjusted node to "
"table: %s\n", knot_strerror(ret));
args->err = ret;
return;
}
// assert(zone->dname_table != NULL);
// int ret = knot_zone_contents_dnames_from_node_to_table(
// zone->dname_table, node);
// if (ret != KNOT_EOK) {
// dbg_xfrin("Failed to add dnames from adjusted node to "
// "table: %s\n", knot_strerror(ret));
// args->err = ret;
// return;
// }
/*
* 2) Do other adjusting (flags, closest enclosers, wildcard children,
......@@ -596,15 +598,15 @@ static void knot_zone_contents_adjust_nsec3_node_in_tree(
*/
knot_zone_contents_t *zone = args->zone;
assert(zone != NULL);
int ret = knot_zone_contents_dnames_from_node_to_table(
zone->dname_table, node);
if (ret != KNOT_EOK) {
dbg_xfrin("Failed to add dnames from adjusted node to "
"table: %s\n", knot_strerror(ret));
args->err = ret;
return;
}
// TODO only for transfers, sort out later
// int ret = knot_zone_contents_dnames_from_node_to_table(
// zone->dname_table, node);
// if (ret != KNOT_EOK) {
// dbg_xfrin("Failed to add dnames from adjusted node to "
// "table: %s\n", knot_strerror(ret));
// args->err = ret;
// return;
// }
}
/*----------------------------------------------------------------------------*/
......@@ -1066,15 +1068,15 @@ knot_zone_contents_t *knot_zone_contents_new(knot_node_t *apex,
#endif
// insert names from the apex to the domain table
if (use_domain_table) {
dbg_zone_verb("Inserting names from apex to table.\n");
int rc = knot_zone_contents_dnames_from_node_to_table(
contents->dname_table, apex);
if (rc != KNOT_EOK) {
ck_destroy_table(&contents->table, NULL, 0);
goto cleanup;
}
}
// if (use_domain_table) {
// dbg_zone_verb("Inserting names from apex to table.\n");
// int rc = knot_zone_contents_dnames_from_node_to_table(
// contents->dname_table, apex);
// if (rc != KNOT_EOK) {
// ck_destroy_table(&contents->table, NULL, 0);
// goto cleanup;
// }
// }
return contents;
......@@ -1198,15 +1200,16 @@ dbg_zone_exec_detail(
return ret;
}
if (use_domain_table) {
ret = knot_zone_contents_dnames_from_node_to_table(
zone->dname_table, node);
if (ret != KNOT_EOK) {
/*! \todo Remove node from the tree and hash table.*/
dbg_zone("Failed to add dnames into table.\n");
return ret;
}
}
// Try to find dnames TODO
// if (use_domain_table) {
// ret = knot_zone_contents_dnames_from_node_to_table(
// zone->dname_table, node);
// if (ret != KNOT_EOK) {
// /*! \todo Remove node from the tree and hash table.*/
// dbg_zone("Failed to add dnames into table.\n");
// return ret;
// }
// }
#ifdef USE_HASH_TABLE
// add the node also to the hash table if authoritative, or deleg. point
......@@ -1265,16 +1268,17 @@ dbg_zone_exec_detail(
return KNOT_ENOMEM;
}
if (use_domain_table) {
ret =
knot_zone_contents_dnames_from_node_to_table(
zone->dname_table, next_node);
if (ret != KNOT_EOK) {
knot_node_free(&next_node);
knot_dname_release(chopped);
return ret;
}
}
// ADD names to table TODO
// if (use_domain_table) {
// ret =
// knot_zone_contents_dnames_from_node_to_table(
// zone->dname_table, next_node);
// if (ret != KNOT_EOK) {
// knot_node_free(&next_node);
// knot_dname_release(chopped);
// return ret;
// }
// }
if (next_node->owner != chopped) {
/* Node owner was in RDATA */
......@@ -1415,20 +1419,21 @@ dbg_zone_exec_detail(
int ret = rc;
if (use_domain_table) {
dbg_zone_detail("Saving RRSet to table.\n");
rc = knot_zone_contents_dnames_from_rrset_to_table(
zone->dname_table, rrset, 0, (*node)->owner);
if (rc != KNOT_EOK) {
dbg_zone("Error saving domain names from "
"RRSIGs to the domain name table.\n "
"The zone may be in an inconsistent state.\n");
// WARNING: the zone is not in consistent state now -
// there may be domain names in it that are not inserted
// into the domain table
return rc;
}
}
//TODO rrset
// if (use_domain_table) {
// dbg_zone_detail("Saving RRSet to table.\n");
// rc = knot_zone_contents_dnames_from_rrset_to_table(
// zone->dname_table, rrset, 0, (*node)->owner);
// if (rc != KNOT_EOK) {
// dbg_zone("Error saving domain names from "
// "RRSIGs to the domain name table.\n "
// "The zone may be in an inconsistent state.\n");
// // WARNING: the zone is not in consistent state now -
// // there may be domain names in it that are not inserted
// // into the domain table
// return rc;
// }
// }
// replace RRSet's owner with the node's owner (that is already in the
// table)
......@@ -1536,20 +1541,21 @@ dbg_zone_exec(
}
// add all domain names from the RRSet to domain name table
if (use_domain_table) {
dbg_zone_detail("Saving RRSIG RRSet to table.\n");
rc = knot_zone_contents_dnames_from_rrset_to_table(
zone->dname_table, (*rrset)->rrsigs, 0, (*rrset)->owner);
if (rc != KNOT_EOK) {
dbg_zone("Error saving domain names from "
"RRSIGs to the domain name table.\n "
"The zone may be in an inconsistent state.\n");
// WARNING: the zone is not in consistent state now -
// there may be domain names in it that are not inserted
// into the domain table
return rc;
}
}
//
// if (use_domain_table) {
// dbg_zone_detail("Saving RRSIG RRSet to table.\n");
// rc = knot_zone_contents_dnames_from_rrset_to_table(
// zone->dname_table, (*rrset)->rrsigs, 0, (*rrset)->owner);
// if (rc != KNOT_EOK) {
// dbg_zone("Error saving domain names from "
// "RRSIGs to the domain name table.\n "
// "The zone may be in an inconsistent state.\n");
// // WARNING: the zone is not in consistent state now -
// // there may be domain names in it that are not inserted
// // into the domain table
// return rc;
// }
// }
// replace RRSet's owner with the node's owner (that is already in the
// table)
......@@ -1589,16 +1595,17 @@ int knot_zone_contents_add_nsec3_node(knot_zone_contents_t *zone,
return ret;
}
if (use_domain_table) {
ret = knot_zone_contents_dnames_from_node_to_table(
zone->dname_table, node);
if (ret != KNOT_EOK) {
/*! \todo Remove the node from the tree. */
dbg_zone("Failed to add dnames into table: %s.\n",
knot_strerror(ret));
return ret;
}
}
//TODO find names
// if (use_domain_table) {
// ret = knot_zone_contents_dnames_from_node_to_table(
// zone->dname_table, node);
// if (ret != KNOT_EOK) {
// /*! \todo Remove the node from the tree. */
// dbg_zone("Failed to add dnames into table: %s.\n",
// knot_strerror(ret));
// return ret;
// }
// }
// no parents to be created, the only parent is the zone apex
// set the apex as the parent of the node
......@@ -1657,20 +1664,21 @@ int knot_zone_contents_add_nsec3_rrset(knot_zone_contents_t *zone,
int ret = rc;
if (use_domain_table) {
dbg_zone_detail("Saving NSEC3 RRSet to table.\n");
rc = knot_zone_contents_dnames_from_rrset_to_table(
zone->dname_table, rrset, 0, (*node)->owner);
if (rc != KNOT_EOK) {
dbg_zone("Error saving domain names from "
"RRSIGs to the domain name table.\n "
"The zone may be in an inconsistent state.\n");
// WARNING: the zone is not in consistent state now -
// there may be domain names in it that are not inserted
// into the domain table
return rc;
}
}
//TODO find names
// if (use_domain_table) {
// dbg_zone_detail("Saving NSEC3 RRSet to table.\n");
// rc = knot_zone_contents_dnames_from_rrset_to_table(
// zone->dname_table, rrset, 0, (*node)->owner);
// if (rc != KNOT_EOK) {
// dbg_zone("Error saving domain names from "
// "RRSIGs to the domain name table.\n "
// "The zone may be in an inconsistent state.\n");
// // WARNING: the zone is not in consistent state now -
// // there may be domain names in it that are not inserted
// // into the domain table
// return rc;
// }
// }
// replace RRSet's owner with the node's owner (that is already in the
// table)
......
......@@ -43,7 +43,7 @@
#include "zcompile/zcompile-error.h"
#include "knot/zone/zone-dump.h"
#include "libknot/zone/zone-diff.h"
#include "libknot/libknot.h"
#include "libknot/rrset.h"
#include "libknot/util/utils.h"
/* Some global flags... */
......@@ -57,6 +57,29 @@ static long int totalrrs = 0;
extern FILE *zp_get_in(void *scanner);
struct parser {
rrset_list_t *node_rrsigs;
knot_zone_contents_t *current_zone;
knot_rrset_t *current_rrset;
knot_dname_t *origin_from_config;
knot_node_t *last_node;
};
typedef struct parser parser_t;
/*!
* \brief Adds RRSet to list.
*
......@@ -116,8 +139,6 @@ static int find_rrset_for_rrsig_in_node(knot_zone_contents_t *zone,
knot_node_t *node,
knot_rrset_t *rrsig)
{
assert(rrsig != NULL);
assert(rrsig->rdata->items[0].raw_data);
assert(node);
assert(knot_dname_compare(rrsig->owner, node->owner) == 0);
......@@ -197,8 +218,9 @@ static knot_node_t *create_node(knot_zone_contents_t *zone,
return node;
}
static void process_rrsigs_in_node(knot_zone_contents_t *zone,
knot_node_t *node)
static void process_rrsigs_in_node(parser_t *parser,
knot_zone_contents_t *zone,
knot_node_t *node)
{
dbg_zp_verb("zp: process_rrsigs: Processing RRSIGS in node: %p.\n",
node);
......@@ -213,16 +235,14 @@ static void process_rrsigs_in_node(knot_zone_contents_t *zone,
}
}
int process_rr(void)
int process_rr(void *data)
{
knot_zone_t *zone = parser->current_zone;
assert(zone != NULL);
knot_zone_contents_t *contents = knot_zone_get_contents(zone);
assert(contents != NULL);
parser_t *parser = data;
knot_zone_contents_t *contents = parser->current_zone;
knot_rrset_t *current_rrset = parser->current_rrset;
knot_rrset_t *rrset;
knot_rrtype_descriptor_t *descriptor =
knot_rrtype_descriptor_by_type(current_rrset->type);
rdata_descriptor_t *desc =
get_rdata_descriptor(current_rrset->type);
dbg_zp_exec_detail(
char *name = knot_dname_to_str(parser->current_rrset->owner);
......@@ -235,12 +255,12 @@ dbg_zp_exec_detail(
dbg_zp_verb("zp: process_rr: RDATA count: %d.\n",\
parser->current_rrset->rdata->count);
if (descriptor->fixed_items) {
assert(current_rrset->rdata->count == descriptor->length);
}
// if (descriptor->fixed_items) {
// assert(current_rrset->rdata->count == descriptor->length);
// }
assert(current_rrset->rdata->count > 0);
assert(current_rrset->rdata_count);
assert(knot_dname_is_fqdn(current_rrset->owner));
int (*node_add_func)(knot_zone_contents_t *, knot_node_t *, int,
......@@ -266,7 +286,7 @@ dbg_zp_exec_detail(
node_get_func = &knot_zone_contents_get_nsec3_node;
}
if ((current_rrset->type == KNOT_RRTYPE_SOA) && (zone != NULL)) {
if (current_rrset->type == KNOT_RRTYPE_SOA) {
if (knot_node_rrset(knot_zone_contents_apex(contents),
KNOT_RRTYPE_SOA) != NULL) {
/* Receiving another SOA. */
......@@ -298,23 +318,30 @@ dbg_zp_exec_detail(
if (current_rrset->type == KNOT_RRTYPE_RRSIG) {
/*!< \todo Use deep copy function here! */
knot_rrset_t *tmp_rrsig =
knot_rrset_new(current_rrset->owner,
KNOT_RRTYPE_RRSIG,
current_rrset->rclass,
current_rrset->ttl);
if (tmp_rrsig == NULL) {
dbg_zp("zp: process_rr: Cannot create tmp RRSIG.\n");
return KNOTDZCOMPILE_ENOMEM;
}
if (knot_rrset_add_rdata(tmp_rrsig,
current_rrset->rdata) != KNOT_EOK) {
knot_rrset_free(&tmp_rrsig);
dbg_zp("zp: process_rr: Cannot add data to tmp"
" RRSIG.\n");
return KNOTDZCOMPILE_EBRDATA;
knot_rrset_t *tmp_rrsig = NULL;
int ret = knot_rrset_deep_copy(current_rrset, &tmp_rrsig, 1);
if (ret != KNOT_EOK) {
dbg_zp("zp: Cannot copy RRSet.\n");
return ret;
}
// knot_rrset_t *tmp_rrsig =
// knot_rrset_new(current_rrset->owner,
// KNOT_RRTYPE_RRSIG,
// current_rrset->rclass,
// current_rrset->ttl);
// if (tmp_rrsig == NULL) {
// dbg_zp("zp: process_rr: Cannot create tmp RRSIG.\n");
// return KNOTDZCOMPILE_ENOMEM;
// }
// if (knot_rrset_add_rdata(tmp_rrsig,
// current_rrset->rdata,
// knot_rrset_rdata_length()) != KNOT_EOK) {
// knot_rrset_free(&tmp_rrsig);
// dbg_zp("zp: process_rr: Cannot add data to tmp"
// " RRSIG.\n");
// return KNOTDZCOMPILE_EBRDATA;
// }
if (parser->last_node &&
knot_dname_compare(parser->last_node->owner,
......@@ -323,7 +350,8 @@ dbg_zp_exec_detail(
* before we return
*/
if (parser->node_rrsigs != NULL) {
process_rrsigs_in_node(contents,
process_rrsigs_in_node(parser,
contents,
parser->last_node);
rrset_list_delete(&parser->node_rrsigs);
}
......@@ -377,7 +405,8 @@ dbg_zp_exec_detail(
node = parser->last_node;
} else {
if (parser->last_node && parser->node_rrsigs) {
process_rrsigs_in_node(contents,
process_rrsigs_in_node(parser,
contents,
parser->last_node);
}
......@@ -389,7 +418,8 @@ dbg_zp_exec_detail(
if (node == NULL) {
if (parser->last_node && parser->node_rrsigs) {
process_rrsigs_in_node(contents,
process_rrsigs_in_node(parser,
contents,
parser->last_node);
}
......@@ -404,22 +434,27 @@ dbg_zp_exec_detail(
rrset = knot_node_get_rrset(node, current_rrset->type);
if (!rrset) {
rrset = knot_rrset_new(current_rrset->owner,
current_rrset->type,
current_rrset->rclass,
current_rrset->ttl);
if (rrset == NULL) {
dbg_zp("zp: process_rr: Cannot "
"create new RRSet.\n");
return KNOTDZCOMPILE_ENOMEM;
}
if (knot_rrset_add_rdata(rrset, current_rrset->rdata) != 0) {
knot_rrset_free(&rrset);
dbg_zp("zp: process_rr: Cannot "
"add RDATA to RRSet.\n");
return KNOTDZCOMPILE_EBRDATA;
int ret = knot_rrset_deep_copy(current_rrset, &rrset, 1);
if (ret != KNOT_EOK) {
dbg_zp("zp: Cannot copy RRSet.\n");
return ret;
}
// rrset = knot_rrset_new(current_rrset->owner,
// current_rrset->type,
// current_rrset->rclass,
// current_rrset->ttl);
// if (rrset == NULL) {
// dbg_zp("zp: process_rr: Cannot "
// "create new RRSet.\n");
// return KNOTDZCOMPILE_ENOMEM;
// }
// if (knot_rrset_add_rdata(rrset, current_rrset->rdata) != 0) {
// knot_rrset_free(&rrset);
// dbg_zp("zp: process_rr: Cannot "
// "add RDATA to RRSet.\n");
// return KNOTDZCOMPILE_EBRDATA;
// }
/* Selected merge option does not really matter here. */
if (knot_zone_contents_add_rrset(contents, rrset, &node,
......@@ -604,7 +639,8 @@ int zone_read(const char *name, const char *zonefile, const char *outfile,
if (parser->last_node && parser->node_rrsigs != NULL) {
/* assign rrsigs to last node in the zone*/
process_rrsigs_in_node(contents,
process_rrsigs_in_node(parser,
contents,
parser->last_node);
rrset_list_delete(&parser->node_rrsigs);
}
......
......@@ -89,16 +89,8 @@ int main(int argc, char **argv)
log_zone_info("Parsing file '%s', origin '%s' ...\n",
zonefile, origin);
}
parser = zparser_create();
if (!parser) {
log_server_error("Failed to create parser.\n");
//log_close();
return 1;
}
int error = zone_read(origin, zonefile, outfile, semantic_checks);
zparser_free();
int error = 0;
if (error != 0) {
/* FIXME! */
......
......@@ -197,10 +197,10 @@ line: NL
}
assert(parser->current_rrset->rdata == NULL);
if (knot_rrset_add_rdata(parser->current_rrset, tmp_rdata)
!= 0) {
log_zone_error("Could not add rdata!\n");
}
// if (knot_rrset_add_rdata(parser->current_rrset, tmp_rdata)
// != 0) {
// log_zone_error("Could not add rdata!\n");
// }
// tmp_rdata->next = tmp_rdata;
// parser->current_rrset->rdata = tmp_rdata;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment