]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
get it to compile on linux first
authorMiek Gieben <miekg@NLnetLabs.nl>
Tue, 21 Dec 2004 14:06:17 +0000 (14:06 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Tue, 21 Dec 2004 14:06:17 +0000 (14:06 +0000)
Makefile.in
ldns/str2host.h
str2host.c

index ec082a907cd192fef975696d12a82201500a7a46..5a7ae381cfe993640056c5f163a20d22ae49f32b 100644 (file)
@@ -28,6 +28,7 @@ LIBDNS_HEADERS        =       ldns/error.h            \
                        ldns/rr.h               \
                        ldns/wire2host.h        \
                        ldns/host2str.h         \
+                       ldns/str2host.h         \
                        util.h                  \
                        buffer.h        
 LIBDNS_OBJECTS =       $(LIBDNS_SOURCES:.c=.o)
index e5527fa7c265cd9979075115e3e32989e216df28..05645a2fba85418b195b6eaef137bb70446c676a 100644 (file)
@@ -10,8 +10,6 @@
 #include <ldns/buffer.h>
 #include <ctype.h>
 
-
 ldns_status zparser_conv_short(ldns_rdf *, const char *);
 
-
 #endif
index 4503b5a6b60e12323959dc9f95633095b1a7cfde..5f17aad1f81b2c931897c556c93aee056e5d4cd7 100644 (file)
@@ -12,8 +12,9 @@
  */
 #include <config.h>
 
+#include <ldns/str2host.h>
 
-#include <ldns/host2str.h>
+#include "util.h"
 
 #include <sys/socket.h>
 #include <arpa/inet.h>
 ldns_status
 zparser_conv_short(ldns_rdf *rd, const char *shortstr)
 {
-       char *end;      /* Used to parse longs, ttls, etc.  */
-       rd->_size = 2;
-       rd->_data = (uint8_t*)htons((uint16_t)strtol(shortstr, &end, 0));
-            
+       char *end = NULL;      /* Used to parse longs, ttls, etc.  */
+       
+       uint16_t *r;
+
+       r = MALLOC(uint16_t);
+       
+       *r = htons((uint16_t)strtol(shortstr, &end, 0));
+       
        if(*end != 0) {
                return LDNS_STATUS_INT_EXP;
        } else {
+               rd = ldns_rdf_new(2, LDNS_RDF_TYPE_INT16, (uint8_t*)r);
                return LDNS_STATUS_OK;
        }
 }