]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
prefix ahoy
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Tue, 14 Dec 2004 15:07:05 +0000 (15:07 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Tue, 14 Dec 2004 15:07:05 +0000 (15:07 +0000)
ldns/packet.h
packet.c
run-test0.c

index 2cbde518f50d0b8162ac178e4550299e05b0a4d9..51b42569b745da5eb047aa1c9f54d550727f9a36 100644 (file)
@@ -110,7 +110,7 @@ void packet_set_arcount(t_packet *, uint16_t);
  *
  * @return pointer to the new packet
  */
-t_packet *dns_packet_new();
+t_packet *ldns_packet_new();
 
 /**
  * Converts the data on the uint8_t bytearray (in wire format) to a DNS packet
@@ -120,6 +120,6 @@ t_packet *dns_packet_new();
  * @param packet pointer to the structure to hold the packet
  * @return the number of bytes read from the wire
  */
-size_t dns_wire2packet(uint8_t *data, size_t len, t_packet *packet);
+size_t ldns_wire2packet(uint8_t *data, size_t len, t_packet *packet);
 
 #endif  /* !_LDNS_PACKET_H */
index 2d894175624d49a6e1a72eee6591df908d81a6c4..6c259976bbe5f4ab6405690205a7ed3b2d8e7f48 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -309,7 +309,7 @@ packet_set_arcount(t_packet *packet, uint16_t arcount)
  */
  
 t_packet *
-dns_packet_new()
+ldns_packet_new()
 {
        t_packet *packet;
        MALLOC(packet, t_packet);
@@ -330,7 +330,7 @@ dns_packet_new()
 }
 
 size_t
-dns_wire2packet_header(uint8_t *wire, size_t max, size_t *pos, t_packet *packet)
+ldns_wire2packet_header(uint8_t *wire, size_t max, size_t *pos, t_packet *packet)
 {
        if (*pos + HEADER_SIZE > *wire + max) {
                // TODO: set t_status error
@@ -362,11 +362,11 @@ dns_wire2packet_header(uint8_t *wire, size_t max, size_t *pos, t_packet *packet)
 }
 
 size_t
-dns_wire2packet(uint8_t *wire, size_t max, t_packet *packet)
+ldns_wire2packet(uint8_t *wire, size_t max, t_packet *packet)
 {
        size_t pos = 0;
 
-       pos += dns_wire2packet_header(wire, max, &pos, packet);
+       pos += ldns_wire2packet_header(wire, max, &pos, packet);
 
        /* TODO: rrs :) */
 
index 57a680323a041c08af394e0846cc8d413f408317..1312092711604d4bcef171be2d7432d7dd8d1f2b 100644 (file)
@@ -48,8 +48,8 @@ main(void)
        wire[18] = 0x61;
        wire[19] = 0x6e;
        
-       packet = dns_packet_new();
-       (void) dns_wire2packet(wire, 20, packet);
+       packet = ldns_packet_new();
+       (void) ldns_wire2packet(wire, 20, packet);
        
        printf("packet id: %d\n", (int) packet_id(packet));
        printf("qr bit: %d\n", (int) packet_qr(packet));