diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2021-09-20 13:01:39 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2021-09-20 13:01:39 +0200 |
commit | a21c91dc23ca0267f4547bc07c872d9ac4937cb4 (patch) | |
tree | 6b108d08f415f2ffe3635318cd4b07496f6b2e48 /src/database.c | |
parent | f7101248f706d48b2deaefd337c45a245589ea7d (diff) | |
download | dns-a21c91dc23ca0267f4547bc07c872d9ac4937cb4.tar.gz |
restructuring
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 34 |
1 files changed, 1 insertions, 33 deletions
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; |