]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
net.c: put all your net stuff here
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 11 Jan 2005 12:44:26 +0000 (12:44 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 11 Jan 2005 12:44:26 +0000 (12:44 +0000)
Makefile.in
ldns/resolver.h
net.c [new file with mode: 0644]
resolver.c

index 70d82918aa719ab79454a713a06539c063e6f015..4cea07cde4c07547a41546e8e1b01ff447bced0c 100644 (file)
@@ -21,7 +21,8 @@ LINTFLAGS     = +quiet +posixlib -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_
 #INSTALL_PROGRAM = $(INSTALL)
 
 LIBDNS_SOURCES =       rdata.c util.c rr.c packet.c wire2host.c \
-                       host2str.c buffer.c str2host.c resolver.c
+                       host2str.c buffer.c str2host.c resolver.c \
+                       net.c
 LIBDNS_HEADERS =       ldns/error.h            \
                        ldns/packet.h           \
                        ldns/prototype.h        \
index 54163f3b7e4004c45a76a5da5b4e2cfdade6c5fa..5f86ff88325be0a890c502d6c2b3b1dcdba1a0fa 100644 (file)
@@ -74,7 +74,7 @@ void ldns_resolver_set_searchlist(ldns_resolver *, ldns_rdf *);
 
 ldns_pkt * ldns_search();
 ldns_pkt * ldns_query();
-ldns_pkt * ldns_send();
+ldns_pkt * ldns_send(ldns_resolver *, uint8_t*, uint8_t*, uint8_t*);
 ldns_pkt * ldns_bgsend();
 
 #endif  /* !_LDNS_RESOLVER_H */
diff --git a/net.c b/net.c
new file mode 100644 (file)
index 0000000..eb3d5a7
--- /dev/null
+++ b/net.c
@@ -0,0 +1,20 @@
+/*
+ * net.c
+ *
+ * Network implementation
+ * All network related functions are grouped here
+ *
+ * a Net::DNS like library for C
+ *
+ * (c) NLnet Labs, 2004
+ *
+ * See the file LICENSE for the license
+ */
+
+#include <config.h>
+
+#include <ldns/rdata.h>
+#include <ldns/error.h>
+#include <ldns/resolver.h>
+
+#include "util.h"
index b579669a044c0c87c29f4818bd46b56af151d4c2..4547f431d6da71a97efff21e814f70d1f992e9a5 100644 (file)
@@ -142,6 +142,19 @@ ldns_resolver_usevc(ldns_resolver *r)
 
 /* more sophisticated functions */
 
+/** \brief create a new resolver structure */
+ldns_resolver *
+ldns_resover_new(void)
+{
+       ldns_resolver *r;
+
+       r = MALLOC(ldns_resolver);
+
+       /* no defaults are filled out yet */
+
+       return r;
+}
+
 /* search for information in the DNS.
  * search() applies the search list.
  * See Net::DNS::Resolver for details
@@ -161,8 +174,11 @@ ldns_query()
 
 /* send the query as-is */
 ldns_pkt *
-ldns_send()
+ldns_send(ldns_resolver *r, uint8_t *name, uint8_t *type, uint8_t *class)
 {
+       assert(r != NULL);
+       assert(name != NULL);
+
        return NULL;
 }