]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
t_rr -> ldns_rr_type
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Wed, 15 Dec 2004 12:47:26 +0000 (12:47 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Wed, 15 Dec 2004 12:47:26 +0000 (12:47 +0000)
ldns/rr.h
packet.c
rr.c
run-test0.c
util.c
util.h

index cb1ba125c3812c4791110ae4a9cda0c82fc4054f..a118065dc4aca2d51bc5707dc9d122a061ec41cb 100644 (file)
--- a/ldns/rr.h
+++ b/ldns/rr.h
@@ -144,7 +144,7 @@ struct type_struct_rr
        /** \brief The list of rdata's */
        t_rdata_field   **_rdata_fields;
 };
-typedef struct type_struct_rr t_rr;
+typedef struct type_struct_rr ldns_rr_type;
 
 /**
  * \brief Resource Record Set
@@ -154,7 +154,7 @@ typedef struct type_struct_rr t_rr;
  */
 struct type_struct_rrset
 {
-       t_rr *rrs;
+       ldns_rr_type *rrs;
 
 };
 typedef struct type_struct_rrset t_rrset;
@@ -178,15 +178,15 @@ typedef struct ldns_struct_rr_descriptor_type ldns_rr_descriptor_type;
 
 
 /* prototypes */
-t_rr * ldns_rr_new(void);
-void ldns_rr_set_owner(t_rr *, uint8_t *);
-void ldns_rr_set_ttl(t_rr *, uint16_t);
-void ldns_rr_set_rd_count(t_rr *, uint16_t);
-void ldns_rr_set_class(t_rr *, t_class);
-bool ldns_rr_push_rd_field(t_rr *, t_rdata_field *);
-uint8_t *ldns_rr_owner(t_rr *);
-uint8_t ldns_rr_ttl(t_rr *);
-uint16_t ldns_rr_rd_count(t_rr *);
+ldns_rr_type * ldns_rr_new(void);
+void ldns_rr_set_owner(ldns_rr_type *, uint8_t *);
+void ldns_rr_set_ttl(ldns_rr_type *, uint16_t);
+void ldns_rr_set_rd_count(ldns_rr_type *, uint16_t);
+void ldns_rr_set_class(ldns_rr_type *, t_class);
+bool ldns_rr_push_rd_field(ldns_rr_type *, t_rdata_field *);
+uint8_t *ldns_rr_owner(ldns_rr_type *);
+uint8_t ldns_rr_ttl(ldns_rr_type *);
+uint16_t ldns_rr_rd_count(ldns_rr_type *);
 
 const ldns_rr_descriptor_type *ldns_rr_descriptor(uint16_t type);
 size_t ldns_rr_descriptor_minimum(ldns_rr_descriptor_type *descriptor);
index 9318d646bf24f4dad45425a5d7b22a633d1974e2..46ee2ba72151f92bad28bdec01551eb7bf852c42 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -379,7 +379,6 @@ ldns_wire2packet_header(ldns_packet_type *packet,
                packet_set_arcount(packet, ARCOUNT(wire));
 
                *pos += QHEADERSZ;
-               
                /* TODO t_status succ.  */
                return 0;
        }
@@ -389,10 +388,13 @@ size_t
 ldns_wire2packet(ldns_packet_type *packet, const uint8_t *wire, size_t max)
 {
        size_t pos = 0;
-
+       uint16_t i;
+       
        pos += ldns_wire2packet_header(packet, wire, max, &pos);
 
        /* TODO: rrs :) */
+       for (i = 0; i < packet_ancount(packet); i++) {
+       }
 
        return pos;
 }
diff --git a/rr.c b/rr.c
index 8ae7262395649cba66e93215d7ff679acc8f1b3b..1a395e6ef9ac43bf5a24712bb65246a71ab686fe 100644 (file)
--- a/rr.c
+++ b/rr.c
@@ -1,7 +1,7 @@
 /*
  * rr.c
  *
- * access function for t_rr
+ * access function for ldns_rr_type
  *
  * a Net::DNS like library for C
  *
 /**
  * create a new rr structure.
  */
-t_rr *
+ldns_rr_type *
 ldns_rr_new(void)
 {
-       t_rr *rr;
-       rr = MALLOC(t_rr);
+       ldns_rr_type *rr;
+       rr = MALLOC(ldns_rr_type);
         if (!rr) {
                 return NULL;
        }
@@ -39,7 +39,7 @@ ldns_rr_new(void)
  * set the owner in the rr structure
  */
 void
-ldns_rr_set_owner(t_rr *rr, uint8_t *owner)
+ldns_rr_set_owner(ldns_rr_type *rr, uint8_t *owner)
 {
        rr->_owner = owner;
 }
@@ -48,7 +48,7 @@ ldns_rr_set_owner(t_rr *rr, uint8_t *owner)
  * set the owner in the rr structure
  */
 void
-ldns_rr_set_ttl(t_rr *rr, uint16_t ttl)
+ldns_rr_set_ttl(ldns_rr_type *rr, uint16_t ttl)
 {
        rr->_ttl = ttl;
 }
@@ -57,7 +57,7 @@ ldns_rr_set_ttl(t_rr *rr, uint16_t ttl)
  * set the rd_count in the rr
  */
 void
-ldns_rr_set_rd_count(t_rr *rr, uint16_t count)
+ldns_rr_set_rd_count(ldns_rr_type *rr, uint16_t count)
 {
        rr->_rd_count = count;
 }
@@ -66,7 +66,7 @@ ldns_rr_set_rd_count(t_rr *rr, uint16_t count)
  * set the class in the rr
  */
 void
-ldns_rr_set_class(t_rr *rr, t_class klass)
+ldns_rr_set_class(ldns_rr_type *rr, t_class klass)
 {
        rr->_klass = klass;
 }
@@ -76,7 +76,7 @@ ldns_rr_set_class(t_rr *rr, t_class klass)
  * placed in the next available spot
  */
 bool
-ldns_rr_push_rd_field(t_rr *rr, t_rdata_field *f)
+ldns_rr_push_rd_field(ldns_rr_type *rr, t_rdata_field *f)
 {
        uint16_t rd_count;
        t_rdata_field **rdata_fields;
@@ -102,7 +102,7 @@ ldns_rr_push_rd_field(t_rr *rr, t_rdata_field *f)
  * return the owner name of an rr structure
  */
 uint8_t *
-ldns_rr_owner(t_rr *rr)
+ldns_rr_owner(ldns_rr_type *rr)
 {
        return rr->_owner;
 }
@@ -111,7 +111,7 @@ ldns_rr_owner(t_rr *rr)
  * return the owner name of an rr structure
  */
 uint8_t
-ldns_rr_ttl(t_rr *rr)
+ldns_rr_ttl(ldns_rr_type *rr)
 {
        return rr->_ttl;
 }
@@ -120,7 +120,7 @@ ldns_rr_ttl(t_rr *rr)
  * return the rd_count of an rr structure
  */
 uint16_t
-ldns_rr_rd_count(t_rr *rr)
+ldns_rr_rd_count(ldns_rr_type *rr)
 {
        return rr->_rd_count;
 }
@@ -342,7 +342,8 @@ ldns_rr_descriptor_maximum(ldns_rr_descriptor_type *descriptor)
 }
 
 ldns_rdata_field_type
-ldns_rr_descriptor_field_type(ldns_rr_descriptor_type *descriptor, size_t index)
+ldns_rr_descriptor_field_type(ldns_rr_descriptor_type *descriptor,
+                              size_t index)
 {
        assert(descriptor);
        assert(index < descriptor->_maximum
@@ -353,3 +354,4 @@ ldns_rr_descriptor_field_type(ldns_rr_descriptor_type *descriptor, size_t index)
                return descriptor->_variable;
        }
 }
+
index c3decc233a1556255fccafd058bc857ec763beaf..a78ab4ef1cae92212904015f994c5016f710d7b5 100644 (file)
 static const uint8_t wire[] = {
        0xc2, 0xb4, 0x81, 0x80, 0x00, 0x01, 0x00, 0x01,
        0x00, 0x02, 0x00, 0x02, 0x03, 0x77, 0x77, 0x77,
-       0x0b, 0x6b, 0x61, 0x6e
+       0x0b, 0x6b, 0x61, 0x6e, 0x61, 0x72, 0x69, 0x65,
+       0x70, 0x69, 0x65, 0x74, 0x03, 0x63, 0x6f, 0x6d,
+       0x00, 0x00, 0x01, 0x00, 0x01
 };
 
 int
 main(void)
 {
        t_rdata_field *rd_f;
-       t_rr *rr;
+       ldns_rr_type *rr;
        ldns_packet_type *packet;
        
        rr = ldns_rr_new();
diff --git a/util.c b/util.c
index 70a28c80bfe7f20cf8a4952c233a05efa8d0aab0..68eada5150329f1d389a086e4c5e2d131577895e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -26,7 +26,7 @@ xprintf_rd_field(t_rdata_field *rd)
 }
 
 void
-xprintf_rr(t_rr *rr)
+xprintf_rr(ldns_rr_type *rr)
 {
        /* assume printable string */
        uint16_t count, i;
diff --git a/util.h b/util.h
index 68daccc1e6175c7291bc8ab227b97ca455573c0a..759496f6485314f807694f7bdbe931af52e5c953 100644 (file)
--- a/util.h
+++ b/util.h
@@ -34,6 +34,6 @@
 
 /* prototypes */
 void    xprintf_rd_field(t_rdata_field *);
-void    xprintf_rr(t_rr *);
+void    xprintf_rr(ldns_rr_type *);
 
 #endif /* !_UTIL_H */