]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
function names more inline with the rest
authorMiek Gieben <miekg@NLnetLabs.nl>
Thu, 20 Jan 2005 13:53:38 +0000 (13:53 +0000)
committerMiek Gieben <miekg@NLnetLabs.nl>
Thu, 20 Jan 2005 13:53:38 +0000 (13:53 +0000)
doc/ldns_api [deleted file]
doc/ldns_api_packet [deleted file]
doc/ldns_api_rr [deleted file]
ldns/str2host.h
rdata.c
run-test1.c
str2host.c

diff --git a/doc/ldns_api b/doc/ldns_api
deleted file mode 100644 (file)
index de3c19f..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-LibDNS - API
-
-   LibDNS (or lDNS) is modelled after the Net::DNS perl library. It has
-   been shown that Net::DNS  can be used very efficiently for 
-   programming DNS aware applications.
-
-   The current [need to look at bind lwres_ XXX] C library implementations
-   of DNS a rarely more than a wrapper for getaddrinfo(). Especially the
-   handling of Resource Records and RRsets is missing from those libraries.
-   This is the gap lDNS wants to fill.
-
-   The lDNS API consist of two layers. The top-layer, this is
-   what is actually exported to the application via the library. And the
-   bottom-layer, this is what lDNS needs to compile and function.
-
-Bottom Layer
-   lDNS is currently only dependent on libc and uses only 4 system calls:
-   send/recvfrom (for udp) and sendto/recv (for tcp) [XXX Not checked if
-   this is correct, i.e. is sendto for tcp?]
-
-   Furhter more, it is to be expected that lDNS is going to depend on
-   a cryptographic library. Probably openSSL.
-
-   And some netdb-functions. [Jelte plz extend]
-
-Top Layer
-   As said, lDNS is modelled after Net::DNS, therefor its API looks very
-   much like the one used for Net::DNS. Some modification are made
-   ofcourse, because not all functionality of Perl can be caught in C.
-
-   The following API details are a rewrite of 'perldoc Net::DNS:XXX' where
-   XXX is the actual manpage. At the top of each section it will state from
-   which Perl manual page it has been converted.
-
-API
-   From Net::DNS - Perl interface to the DNS resolver
-
-  Resolver Structures [ldns_resolver]
-    ldns_resolver* ldns_resolver_new(void)
-
-    A program can have multiple resolver structurs, each maintaining its own
-    state information such as the nameservers to be queried, whether
-    recursion is desired, etc.
-
-  Packet Structures [ldns_pkt]
-    ldns_pkt* ldns_pkt_new(void)
-
-    ldns_resolver queries return ldns_pkt structures. A ldns_pkt structure
-    have five sections:
-
-    *  The header section, a ldns_hdr structure.
-
-    *  The question section, a ldns_rr_list structure.
-
-    *  The answer section, a ldns_rr_list structure.
-
-    *  The authority section, a ldns_rr_list structure.
-
-    *  The additional section, a ldns_rr_list structure.
-
-  Update Objects [NOT IMPL]
-    [NOT IMPL]
-
-  Header Structures [ldns_hdr]
-    ldns_hdr represents the header section of a DNS packet.
-
-  Question Section [no special type is used]
-    ldns_rr_list structure. A list of RRs in the Question section of a DNS
-    packet.
-
-  Answer Section [no special type is used]
-    ldns_rr_list structure. A list of RRs in the Question section of a DNS
-    packet.
-
-  Authority Section [no special type is used]
-    ldns_rr_list structure. A list of RRs in the Question section of a DNS
-    packet.
-    
-  Additional Section [no special type is used]
-    ldns_rr_list structure. A list of RRs in the Question section of a DNS
-    packet.
-
-  RR List Structure [ldns_rr_list]
-    An array containing Resource Records (RR).
-   
-  RR Structures [ldns_rr]
-    A single Resource Record.
-
-
-Function on ldns_resolver
-
-  ldns_version(resolver *res)
-    Returns the version of lDNS.
-
-  ldns_mx(ldns_resolver *res, char *dname)
-    Returns a ldns_rr_list representing the MX records
-    for the specified name; the list will be sorted by preference. Returns
-    an empty list if the query failed or no MX records were found.
-
-    This method does not look up A records -- it only performs MX queries.
-
---- FROM HERE IT ONLY TALKS ABOUT DYNAMIC UPDATES - WHAT TO DO WITH THAT -
-
-  yxrrset [NOT IMPL]
-    Use this method to add an "RRset exists" prerequisite to a dynamic
-    update packet. There are two forms, value-independent and
-    value-dependent:
-
-        # RRset exists (value-independent)
-        $update->push(pre => yxrrset("host.example.com A"));
-
-  nxrrset [NOT IMPL]
-    Use this method to add an "RRset does not exist" prerequisite to a
-    dynamic update packet.
-
-        $packet->push(pre => nxrrset("host.example.com A"));
-
-    Meaning: No RRs with the specified name and type can exist.
-
-    Returns a "Net::DNS::RR" object or "undef" if the object couldn't be
-    created.
-
-  yxdomain [NOT IMPL]
-    Use this method to add a "name is in use" prerequisite to a dynamic
-    update packet.
-
-        $packet->push(pre => yxdomain("host.example.com"));
-
-    Meaning: At least one RR with the specified name must exist.
-
-    Returns a "Net::DNS::RR" object or "undef" if the object couldn't be
-    created.
-
-  ldns_nxdomain [NOT IMPL]
-    Use this method to add a "name is not in use" prerequisite to a dynamic
-    update packet.
-
-        $packet->push(pre => nxdomain("host.example.com"));
-
-    Meaning: No RR with the specified name can exist.
-
-    Returns a "Net::DNS::RR" object or "undef" if the object couldn't be
-    created.
-
-  ldns_rr_add(ldns_resolver *res, ldns_rr *r) [NOT IMPL]
-    Use this method to add RRs to a zone.
-
-        $packet->push(update => rr_add("host.example.com A 10.1.2.3"));
-
-    Meaning: Add this RR to the zone.
-
-    RR objects created by this method should be added to the "update"
-    section of a dynamic update packet. The TTL defaults to 86400 seconds
-    (24 hours) if not specified.
-
-    Returns a "Net::DNS::RR" object or "undef" if the object couldn't be
-    created.
-
-  ldns_rr_del(ldns_resolver *res, ldns_rr *r) [NOT IMPL]
-    Use this method to delete RRs from a zone. There are three forms: delete
-    an RRset, delete all RRsets, and delete an RR.
-
-        # Delete an RRset.
-        $packet->push(update => rr_del("host.example.com A"));
-
-    Meaning: Delete all RRs having the specified name and type.
-
-        # Delete all RRsets.
-        $packet->push(update => rr_del("host.example.com"));
-
-    Meaning: Delete all RRs having the specified name.
-
-        # Delete an RR.
-        $packet->push(update => rr_del("host.example.com A 10.1.2.3"));
-
-    Meaning: Delete all RRs having the specified name, type, and data.
-
-    RR objects created by this method should be added to the "update"
-    section of a dynamic update packet.
-
-    Returns a "Net::DNS::RR" object or "undef" if the object couldn't be
-    created.
diff --git a/doc/ldns_api_packet b/doc/ldns_api_packet
deleted file mode 100644 (file)
index c04d500..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-Structure and function of ldns_pkt
-
-
-API
-   From Net::DNS::Packet - DNS packet object class
-
-  ldns_pkt * ldns_pkt_new()
-    Creates a new empty packet.
-
-  ldns_buffer* ldns_pkt_data(ldns_pkt *pkt)
-    Returns the packet data in binary format, suitable for sending to a
-    nameserver. [XXX, suitable for sending to a NS?]
-
-  ldns_hdr *ldns_header(ldn_pkt *pkt)
-    Returns a ldns_hdr structure representing the header section of
-    the packet.
-
-[Again here we have all the dynamic update stuff. NOT IMPL, for now]
-
-  ldns_rr_list *ldns_question(ldns_pkt *pkt)
-    Returns a pointer to a ldns_rr_list representing the question section
-    of the packet.
-
-    [XXX] In dynamic update packets, this section is known as "zone" and specifies
-    the zone to be updated.
-
-  ldns_rr_list *ldns_answer(ldns_pkt *pkt)
-    Returns a pointer to a ldns_rr_list representing the answer section of
-    the packet.
-
-    [XXX] In dynamic update packets, this section is known as "pre" or
-    "prerequisite" and specifies the RRs or RRsets which must or must not
-    preexist.
-
-  ldns_rr_list *ldns_authority(ldns_pkt *pkt)
-    Returns a pointer to a ldns_rr_list representing the authority section
-    of the packet.
-
-    [XXX] In dynamic update packets, this section is known as "update" and
-    specifies the RRs or RRsets to be added or delted.
-
-  ldns_rr_list *ldns_additional(ldns_pkt *pkt)
-    Returns a pointer to a ldns_rr_list of representing the additional
-    section of the packet.
-
-  void ldsn_pkt_print(ldns_pkt *pkt)
-    Prints the packet data on the standard output in an ASCII format similar
-    to that used in DNS zone files. See RFC1035.
-
-  ldns_buffer *ldns_pkt_string(ldns_pkt *pkt)
-    Returns a ldns_buffer containing the string representation of the packet.
-
-  <return type unknown> ldns_pkt_answerfrom(ldns_pkt *pkt)
-    Returns the IP address from which we received this packet. User-created
-    packets will return NULL.
-
-  uint16_t ldns_pkt_answersize(ldns_pkt *pkt)
-    Returns the size of the packet in bytes as it was received from a
-    nameserver. User-created packets will return 0. [XXX user-created??]
-
-  ldns_status ldns_push(ldns_pkt *pkt, ldns_pkt_section section, ldns_rr *rr)
-    Adds *rr to the specified section of the packet. Return LDNS_STATUS_OK
-    on success, LDNS_STATUS_ERR otherwise.
-
-  ldns_status ldns_unique_push(ldns_pkt *pkt, ldns_pkt_section section, ldns_rr *rr)
-    Adds *rr to the specified section of the packet provided that the RR
-    does not already exist in the packet. Return LDNS_STATUS_OK
-    on success, LDNS_STATUS_ERR otherwise.
-
-  ldns_rr *ldns_pop(ldns_pkt, ldns_pkt_section)
-    Removes a RR from the specified section of the packet. Returns NULL if
-    no RR's could be popped.
-
-  <NEW, not in Net::DNS>
-  ldns_rr_list *ldns_pkt_rrset(ldns_pkt *pkt, ....
-
--- STUFF BELOW IS TODO ---
-
-  dn_comp [TODO]
-        $compname = $packet->dn_comp("foo.example.com", $offset);
-
-    Returns a domain name compressed for a particular packet object, to be
-    stored beginning at the given offset within the packet data. The name
-    will be added to a running list of compressed domain names for future
-    use.
-
-  dn_expand [TODO]
-        use Net::DNS::Packet qw(dn_expand);
-        ($name, $nextoffset) = dn_expand(\$data, $offset);
-
-        ($name, $nextoffset) = Net::DNS::Packet::dn_expand(\$data, $offset);
-
-    Expands the domain name stored at a particular location in a DNS packet.
-    The first argument is a reference to a scalar containing the packet
-    data. The second argument is the offset within the packet where the
-    (possibly compressed) domain name is stored.
-
-    Returns the domain name and the offset of the next location in the
-    packet.
-
-  sign_tsig
-        $key_name = "tsig-key";
-        $key      = "awwLOtRfpGE+rRKF2+DEiw==";
-
-        $update = Net::DNS::Update->new("example.com");
-        $update->push("update", rr_add("foo.example.com A 10.1.2.3"));
-
-        $update->sign_tsig($key_name, $key);
-
-        $response = $res->send($update);
-
-    Signs a packet with a TSIG resource record (see RFC 2845). Uses the
-    following defaults:
-
-        algorithm   = HMAC-MD5.SIG-ALG.REG.INT
-        time_signed = current time
-        fudge       = 300 seconds
-
-    If you wish to customize the TSIG record, you'll have to create it
-    yourself and call the appropriate Net::DNS::RR::TSIG methods. The
-    following example creates a TSIG record and sets the fudge to 60
-    seconds:
-
-        $key_name = "tsig-key";
-        $key      = "awwLOtRfpGE+rRKF2+DEiw==";
-
-        $tsig = Net::DNS::RR->new("$key_name TSIG $key");
-        $tsig->fudge(60);
-
-        $query = Net::DNS::Packet->new("www.example.com");
-        $query->sign_tsig($tsig);
-
-        $response = $res->send($query);
-
-    You shouldn't modify a packet after signing it; otherwise authentication
-    will probably fail.
-
-  sign_sig0
-    SIG0 support is provided through the Net::DNS::RR::SIG class. This class
-    is not part of the default Net::DNS distribution but resides in the
-    Net::DNS::SEC distribution.
-
-        $update = Net::DNS::Update->new("example.com");
-        $update->push("update", rr_add("foo.example.com A 10.1.2.3"));
-        $update->sign_sig0("Kexample.com+003+25317.private");
-
-    SIG0 support is experimental see Net::DNS::RR::SIG for details.
diff --git a/doc/ldns_api_rr b/doc/ldns_api_rr
deleted file mode 100644 (file)
index 350561d..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-Structure and function of ldns_rr
-
-API
-   From Net::DNS::RR - DNS Resource Record class
-
-   ldns_rr is the base structure for DNS Recorce Records.
-   [ See also the manual pages for each RR type. - TODO??]
-
-  ldns_rr *ldns_rr_new(void)
-    Returns a pointer to a newly created ldns_rr structure.
-    
-  [TODO: do we want the stuff descibed below?]
-  ldns_rr_new (from string)
-     $a     = Net::DNS::RR->new("foo.example.com. 86400 A 10.1.2.3");
-     $mx    = Net::DNS::RR->new("example.com. 7200 MX 10 mailhost.example.com.");
-     $cname = Net::DNS::RR->new("www.example.com 300 IN CNAME www1.example.com");
-     $txt   = Net::DNS::RR->new("baz.example.com 3600 HS TXT 'text record'");
-
-    Returns a "Net::DNS::RR" object of the appropriate type and initialized
-    from the string passed by the user. The format of the string is that
-    used in zone files, and is compatible with the string returned by
-    "Net::DNS::RR->string".
-
-    The name and RR type are required; all other information is optional. If
-    omitted, the TTL defaults to 0 and the RR class defaults to IN. Omitting
-    the optional fields is useful for creating the empty RDATA sections
-    required for certain dynamic update operations. See the
-    "Net::DNS::Update" manual page for additional examples.
-
-    All names must be fully qualified. The trailing dot (.) is optional.
-
-  void ldns_rr_print(ldns_rr *r)
-    Prints the record to the standard output. 
-
-  ldns_buffer *ldns_rr_string(ldns_rr *r)
-    Returns a ldns_buffer with the string representation of the RR. Calls the rdatastr method to
-    get the RR-specific data.
-
-  ldns_buffer ldns_rr_rdatastr(ldns_rr *r)
-    Returns a pointer to a ldns_buffer containing with string containing
-    RR-specific data. 
-
-  ldns_rdf *ldns_rr_name(ldns_rr *r)
-    Returns the record's domain name as a ldns_rdf type. [XXX how should we
-    return stuff like this? ldns_rdf, uint8_t, ldns_buffer?
-
-  ldns_rdf_type ldns_rr_get_type(ldns_rr *r)
-    Returns the record's type.
-
-  ldns_rr_class ldns_rr_get_class(ldns_rr *r)
-    Returns the record's class.
-
-  uint32_t ldns_rr_get_ttl(ldns_rr *r)
-    Returns the record's time-to-live (TTL).
-
-  [TODO nodig??] rdlength
-        $rdlength = $rr->rdlength;
-
-    Returns the length of the record's data section.
-
-  [TODO nodig??] rdata
-        $rdata = $rr->rdata
-
-    Returns the record's data section as binary data.
index 839bf812fe244eac7f5b7b47e1ea516a1e1d2eb5..3fbc13e5b982f93bb4d01d607af03a414a3ae3e1 100644 (file)
 #include <ldns/buffer.h>
 #include <ctype.h>
 
-ldns_status ldns_conv_int8(ldns_rdf **, const uint8_t *);
-ldns_status ldns_conv_int16(ldns_rdf **, const uint8_t *);
-ldns_status ldns_conv_int32(ldns_rdf **, const uint8_t *);
-ldns_status ldns_conv_time(ldns_rdf **, const uint8_t *);
-ldns_status ldns_conv_none(ldns_rdf **, const uint8_t* );
-ldns_status ldns_conv_dname(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_a(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_aaaa(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_str(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_apl(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_b64(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_hex(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_nsec(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_type(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_class(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_cert(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_alg(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_unknown(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_tsigtime(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_service(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_loc(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_wks(ldns_rdf **, const uint8_t*);
-ldns_status ldns_conv_nsap(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_int8(ldns_rdf **, const uint8_t *);
+ldns_status ldns_str2rdf_int16(ldns_rdf **, const uint8_t *);
+ldns_status ldns_str2rdf_int32(ldns_rdf **, const uint8_t *);
+ldns_status ldns_str2rdf_time(ldns_rdf **, const uint8_t *);
+ldns_status ldns_str2rdf_dname(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_a(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_aaaa(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_str(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_apl(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_b64(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_hex(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_nsec(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_type(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_class(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_cert(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_alg(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_unknown(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_tsigtime(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_service(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_loc(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_wks(ldns_rdf **, const uint8_t*);
+ldns_status ldns_str2rdf_nsap(ldns_rdf **, const uint8_t*);
 
 #endif
diff --git a/rdata.c b/rdata.c
index bc7393b7871f3e967057ea6e48787802b6e5470c..03140ec0684f97bc0081544e783f65c9165efd38 100644 (file)
--- a/rdata.c
+++ b/rdata.c
@@ -99,73 +99,72 @@ ldns_rdf_new_frm_str(const char *str, ldns_rdf_type t)
        
        switch(t) {
                case LDNS_RDF_TYPE_NONE:
-                       stat = ldns_conv_none(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_DNAME:
-                       stat = ldns_conv_dname(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_dname(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_INT8:
-                       stat = ldns_conv_int8(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_int8(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_INT16:
-                       stat = ldns_conv_int16(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_int16(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_INT32:
-                       stat = ldns_conv_int32(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_int32(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_A:
-                       stat = ldns_conv_a(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_a(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_AAAA:
-                       stat = ldns_conv_aaaa(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_aaaa(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_STR:
-                       stat = ldns_conv_str(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_str(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_APL:
-                       stat = ldns_conv_apl(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_apl(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_B64:
-                       stat = ldns_conv_b64(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_b64(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_HEX:
-                       stat = ldns_conv_hex(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_hex(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_NSEC:
-                       stat = ldns_conv_nsec(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_nsec(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_TYPE:
-                       stat = ldns_conv_type(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_type(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_CLASS:
-                       stat = ldns_conv_class(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_class(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_CERT:
-                       stat = ldns_conv_cert(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_cert(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_ALG:
-                       stat = ldns_conv_alg(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_alg(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_UNKNOWN:
-                       stat = ldns_conv_unknown(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_unknown(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_TIME:
-                       stat = ldns_conv_time(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_time(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_TSIGTIME:
-                       stat = ldns_conv_tsigtime(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_tsigtime(&rd, (const uint8_t*) str);
                        break;
                        case LDNS_RDF_TYPE_SERVICE:
-                       stat = ldns_conv_service(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_service(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_LOC:
-                       stat = ldns_conv_loc(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_loc(&rd, (const uint8_t*) str);
                        break;
                case LDNS_RDF_TYPE_WKS:
-                       stat = ldns_conv_wks(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_wks(&rd, (const uint8_t*) str);
                        break;
                        case LDNS_RDF_TYPE_NSAP:
-                       stat = ldns_conv_nsap(&rd, (const uint8_t*) str);
+                       stat = ldns_str2rdf_nsap(&rd, (const uint8_t*) str);
                        break;
                default:
                        /* default default ??? */
index 59b73ec53e5057268a2c7bbc058bfe299c18c3c2..28de8212f6eb57ba2f01bd1063312e41350582c7 100644 (file)
@@ -40,7 +40,7 @@ doit(void)
        }
 
        printf("Setting 15242\n");
-       if (ldns_conv_int16(&rdata, "15242") != LDNS_STATUS_OK) {
+       if (ldns_str2rdf_int16(&rdata, "15242") != LDNS_STATUS_OK) {
                printf("_short: ah man, shit hit the fan\n");
        }
        
@@ -53,11 +53,11 @@ int
 main(void)
 {
        ldns_rdf *bla;
-       if (ldns_conv_int16(&bla, "15242") != LDNS_STATUS_OK) {
+       if (ldns_str2rdf_int16(&bla, "15242") != LDNS_STATUS_OK) {
                printf("_int16: ah man, shit hit the fan\n");
        }
        /* %Y%m%d%H%M%S */
-       if (ldns_conv_time(&bla, "20041222134100") != LDNS_STATUS_OK) {
+       if (ldns_str2rdf_time(&bla, "20041222134100") != LDNS_STATUS_OK) {
                printf("_time: ah man, shit hit the fan\n");
        }
 
index 4731cd6dd42cae3d6d8f307071e13c600136476a..90a50beb56f3b62c3fc8533f3e5229a9bf81987c 100644 (file)
@@ -33,7 +33,7 @@
  * \return ldns_status
  */
 ldns_status
-ldns_conv_int16(ldns_rdf **rd, const uint8_t *shortstr)
+ldns_str2rdf_int16(ldns_rdf **rd, const uint8_t *shortstr)
 {
        char *end = NULL;    
        uint16_t *r;
@@ -57,7 +57,7 @@ ldns_conv_int16(ldns_rdf **rd, const uint8_t *shortstr)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_time(ldns_rdf **rd, const uint8_t *time)
+ldns_str2rdf_time(ldns_rdf **rd, const uint8_t *time)
 {
        /* convert a time YYHM to wireformat */
        uint16_t *r = NULL;
@@ -85,7 +85,7 @@ ldns_conv_time(ldns_rdf **rd, const uint8_t *time)
  * \return ldns_status
  */
 ldns_status 
-ldns_conv_int32(ldns_rdf **rd, const uint8_t *longstr)
+ldns_str2rdf_int32(ldns_rdf **rd, const uint8_t *longstr)
 {
        char *end;  
        uint16_t *r = NULL;
@@ -111,7 +111,7 @@ ldns_conv_int32(ldns_rdf **rd, const uint8_t *longstr)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_int8(ldns_rdf **rd, const uint8_t *bytestr)
+ldns_str2rdf_int8(ldns_rdf **rd, const uint8_t *bytestr)
 {
        char *end;     
        uint8_t *r = NULL;
@@ -129,18 +129,6 @@ ldns_conv_int8(ldns_rdf **rd, const uint8_t *bytestr)
         }
 }
 
-/**
- * convert .... into wireformat
- * \param[in] rd the rdf where to put the data
- * \param[in] str the string to be converted
- * \return ldns_status
- */
-ldns_status 
-ldns_conv_none(ldns_rdf **rd, const uint8_t* str)
-{
-       return LDNS_STATUS_OK;
-}
-
 /**
  * convert .... into wireformat
  * \param[in] rd the rdf where to put the data
@@ -148,7 +136,7 @@ ldns_conv_none(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_dname(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_dname(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -160,7 +148,7 @@ ldns_conv_dname(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_a(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_a(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -172,7 +160,7 @@ ldns_conv_a(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_aaaa(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_aaaa(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -184,7 +172,7 @@ ldns_conv_aaaa(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_str(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_str(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -196,7 +184,7 @@ ldns_conv_str(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_apl(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_apl(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -208,7 +196,7 @@ ldns_conv_apl(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_b64(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_b64(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -220,7 +208,7 @@ ldns_conv_b64(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_hex(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_hex(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -232,7 +220,7 @@ ldns_conv_hex(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_nsec(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_nsec(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -244,7 +232,7 @@ ldns_conv_nsec(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_type(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_type(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -256,7 +244,7 @@ ldns_conv_type(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_class(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_class(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -268,7 +256,7 @@ ldns_conv_class(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_cert(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_cert(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -280,7 +268,7 @@ ldns_conv_cert(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_alg(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_alg(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -292,7 +280,7 @@ ldns_conv_alg(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_unknown(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_unknown(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -304,7 +292,7 @@ ldns_conv_unknown(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_tsigtime(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_tsigtime(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -316,7 +304,7 @@ ldns_conv_tsigtime(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_service(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_service(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -328,7 +316,7 @@ ldns_conv_service(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_loc(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_loc(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -340,7 +328,7 @@ ldns_conv_loc(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_wks(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_wks(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -352,7 +340,7 @@ ldns_conv_wks(ldns_rdf **rd, const uint8_t* str)
  * \return ldns_status
  */
 ldns_status
-ldns_conv_nsap(ldns_rdf **rd, const uint8_t* str)
+ldns_str2rdf_nsap(ldns_rdf **rd, const uint8_t* str)
 {
        return LDNS_STATUS_OK;
 }
@@ -365,7 +353,7 @@ ldns_conv_nsap(ldns_rdf **rd, const uint8_t* str)
  * convert a hex value to wireformat
  */
 ldns_status
-zparser_conv_hex(ldns_rdf *rd, const char *hex)
+zparser_str2rdf_hex(ldns_rdf *rd, const char *hex)
 {
        uint16_t *rd = NULL;
        uint8_t *t;