#include <openssl/evp.h>
#include <openssl/engine.h>
#include <openssl/conf.h>
-/* routine to load gost (from ldns) */
+/* routine to load gost (from sldns) */
int load_gost_id(void)
{
static int gost_id = 0;
#include <openssl/evp.h>
#include <openssl/engine.h>
#include <openssl/conf.h>
-/* routine to load gost (from ldns) */
+/* routine to load gost (from sldns) */
int load_gost_id(void)
{
static int gost_id = 0;
3 Dec 2013: Wouter
- Fix sldns to use sldns_ prefix for all ldns_ variables.
+ - Fix windows compile to compile with sldns.
30 Nov 2013: Wouter
- Fix sldns to make globals use sldns_ prefix. This fixes
http://unbound.net/svn/
* Uses the following libraries;
- * ldns http://www.nlnetlabs.nl/ldns/ (BSD license)
- (required) can use ldns build directory directly with --with-ldns=path.
* libevent http://www.monkey.org/~provos/libevent/ (BSD license)
(optional) can use builtin alternative instead.
+ * libexpat (for the unbound-anchor helper program) (MIT license)
* Make and install: ./configure; make; make install
- * --with-ldns=/path/to/ldns
- It will dynamically link against it.
* --with-libevent=/path/to/libevent
Can be set to either the system install or the build directory.
--with-libevent=no (default) gives a builtin alternative
programming errors, among which buffer overflows. The program exits
with an error if an assertion fails (but the buffer did not overflow).
* --enable-static-exe
- This enables a debug option to statically link, against ldns and
- libevent libraries.
+ This enables a debug option to statically link against the
+ libevent library.
* --enable-lock-checks
This enables a debug option to check lock and unlock calls. It needs
a recent pthreads library to work.
C:\msys\...\home\user to work in (click on MSYS; type: mkdir /home/user ).\r
\r
2. Install openssl, or compile it yourself. http://www.openssl.org\r
-Ldns and unbound need the header files and libraries. Static linking makes\r
+Unbounds need the header files and libraries. Static linking makes\r
things easier. This is an open source library for cryptographic functions.\r
+And libexpat is needed.\r
\r
-3. Compile LDNS\r
-Get the source code tarball http://nlnetlabs.nl/ldns\r
-Move it into the C:\msys\...\home\user directory.\r
-Double click on the MSYS icon and give these commands\r
-$ cd /home/user\r
-$ tar xzvf ldns-xxx.tar.gz\r
-$ cd ldns-xxx\r
-$ ./configure\r
-If you compiled openssl yourself, pass --with-ssl=../openssl-xxx\r
-$ make\r
-\r
-4. Compile Unbound\r
+3. Compile Unbound\r
Get the source code tarball http://unbound.net\r
Move it into the C:\msys\...\home\user directory.\r
Double click on the MSYS icon and give these commands\r
$ cd /home/user\r
$ tar xzvf unbound-xxx.tar.gz\r
$ cd unbound-xxx\r
-$ ./configure --enable-static-exe --with-ldns=../ldns-xxx\r
+$ ./configure --enable-static-exe\r
If you compiled openssl yourself, pass --with-ssl=../openssl-xxx too.\r
If you compiled libexpat yourself, pass --with-libexpat=../expat-install too.\r
The configure options for libevent or threads are not applicable for \r
return result;
}
-/** get answer into ldns rr list */
-static sldns_rr_list*
-result2answer(struct ub_result* result)
-{
- sldns_pkt* p = NULL;
- sldns_rr_list* a;
- if(sldns_wire2pkt(&p, result->answer_packet, (size_t)result->answer_len)
- != LDNS_STATUS_OK)
- return NULL;
- a = sldns_pkt_answer(p);
- sldns_pkt_set_answer(p, NULL);
- sldns_pkt_free(p);
- return a;
-}
-
/** print result to file */
static void
do_print(struct ub_result* result, char* file)
{
- FILE* out;
- sldns_rr_list* list = result2answer(result);
- if(!list) fatal("result2answer failed");
-
- out = fopen(file, "w");
+ FILE* out = fopen(file, "w");
+ char s[65535], t[32];
+ int i;
if(!out) {
perror(file);
fatal("fopen failed");
}
- sldns_rr_list_print(out, list);
+ i = 0;
+ while(result->data[i]) {
+ sldns_wire2str_rdata_buf((uint8_t*)result->data[i],
+ (size_t)result->len[i], s, sizeof(s),
+ (uint16_t)result->qtype)
+ sldns_wire2str_type_buf((uint16_t)result->qtype, t, sizeof(t));
+ fprintf(out, "%s\t%s\t%s\n", result->qname, t, s);
+ i++;
+ }
fclose(out);
- sldns_rr_list_deep_free(list);
}
/** update domain to file */