From a21c91dc23ca0267f4547bc07c872d9ac4937cb4 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Mon, 20 Sep 2021 13:01:39 +0200 Subject: restructuring --- src/database.c | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'src/database.c') diff --git a/src/database.c b/src/database.c index 5c865d8..21174f7 100644 --- a/src/database.c +++ b/src/database.c @@ -6,7 +6,7 @@ #include "database.h" -static int database_init ( database_t* _database ) { +int database_init ( database_t* _database ) { unsigned int i = 0; size_t rr_size; @@ -25,38 +25,6 @@ static int database_init ( database_t* _database ) { return 0; } -int database_populate ( database_t* _database, char* _zonefile ) { - char* qname; - int len; - void* data; - - if ( database_init( _database ) ) { - LOGPRINTF(_LOG_ERROR, "Failed to initialize database."); - return 1; - } - - /* TODO parsing */ - - qname = malloc(32); - - len = fqdn_to_qname( "test.example.com", 17, qname, 32 ); - - if ( len <= 0 ) - return 1; - - data = malloc( 10 ); - - *((uint32_t*)data) = 1800; - *((uint16_t*)(data+4)) = 4; - *((uint32_t*)(data+6)) = 0x45454545; - - tree_insert( &_database->zone[0][0], qname, data ); - - LOGPRINTF(_LOG_NOTE, "Database initialized and populated"); - - return 0; -} - int database_destroy ( database_t* _database ) { unsigned int i, o; -- cgit v1.2.3