Package ldns-devel

Development package that includes the ldns header files

http://www.nlnetlabs.nl/ldns/

The devel package contains the ldns library and the include files

Library Functions (Section 3)
ldns_bget_token
ldns_bget_token() returns a token/char from the buffer b. This function deals with ( and ) in the buffer, and ignores when it finds them. *b: the buffer to read...
ldns_buffer
ldns_buffer implementation of buffers to ease operations ldns_buffers can contain arbitrary information, per octet. You can write to the current end of a...
ldns_buffer2pkt_wire
ldns_buffer2pkt_wire() converts the data on the uint8_t bytearray (in wire format) to a DNS packet. This function will initialize and allocate memory space for...
ldns_buffer_flip
ldns_buffer_flip() makes the buffer ready for reading the data that has been written to the buffer. The buffer's limit is set to the current position and the...
ldns_buffer_limit
ldns_buffer_limit() returns the maximum size of the buffer \param[in] buffer Returns the size ldns_buffer_set_limit() changes the buffer's limit. If the...
ldns_buffer_new
ldns_buffer_new() creates a new buffer with the specified capacity. capacity: the size (in bytes) to allocate for the buffer Returns the created buffer...
ldns_buffer_read_at
ldns_buffer_write_at() writes the given data to the buffer at the specified position buffer: the buffer at: the position (in number of bytes) to write the data...
ldns_buffer_remaining_at
ldns_buffer_remaining_at() returns the number of bytes remaining between the indicated position and the limit. buffer: the buffer at: indicated position Returns...
ldns_create_nsec
ldns_create_nsec() Create a NSEC record cur_owner: the current owner which should be taken as the starting point next_owner: the rrlist which the nsec rr should...
ldns_dane_create_tlsa_owner
ldns_dane_create_tlsa_owner() Creates a dname consisting of the given name, prefixed by the service port and type of transport...
ldns_dane_verify
ldns_dane_verify() Verify if any of the given TLSA resource records matches the given certificate. tlsas: The resource records that specify what and how to...
ldns_dname
ldns_dname
ldns_dname2canonical
ldns_dname2canonical() Put a dname into canonical fmt - ie. lowercase it rdf: the dname to lowercase Returns void
ldns_dname_cat
ldns_dname_cat_clone() concatenates two dnames together rd1: the leftside rd2: the rightside Returns a new rdf with leftside/rightside ldns_dname_cat()...
ldns_dname_compare
ldns_dname_compare() Compares the two dname rdf's according to the algorithm for ordering in RFC4034 Section 6. dname1: First dname rdf to compare dname2...
ldns_dname_is_subdomain
ldns_dname_is_subdomain() test wether the name sub falls under parent (i.e. is a subdomain of parent). This function will return false if the given dnames are...
ldns_dname_left_chop
ldns_dname_left_chop() chop one label off the left side of a dname. so wwww.nlnetlabs.nl, becomes nlnetlabs.nl This new name is a clone and must be freed with...
ldns_dname_new
ldns_dname_new() Create a new dname rdf from a string s: the size of the new dname *data: pointer to the actual data Returns ldns_rdf* ldns_dname_new_frm_str()...
ldns_dnssec_data_chain
ldns_dnssec_data_chain Chain structure that contains all DNSSEC data needed to verify an rrset struct ldns_dnssec_data_chain_struct { ldns_rr_list *rrset...
ldns_dnssec_data_chain_new
ldns_dnssec_data_chain_new() Creates a new dnssec_chain structure Returns ldns_dnssec_data_chain * ldns_dnssec_data_chain_free() Frees a dnssec_data_chain...
ldns_dnssec_name_new
ldns_dnssec_name_new() Create a new data structure for a dnssec name Returns the allocated structure ldns_dnssec_name_new_frm_rr() Create a new data structure...
ldns_dnssec_rrsets_new
ldns_dnssec_rrsets_new() Creates a new list (entry) of RRsets Returns the newly allocated structure ldns_dnssec_rrsets_free() Frees the list of rrsets and their...
ldns_dnssec_rrs_new
ldns_dnssec_rrs_new() ldns_dnssec_rrs_free() Frees the list of rrs, but *not* the individual ldns_rr records contained in the list rrs: the data structure to...
ldns_dnssec_trust_tree_new
ldns_dnssec_trust_tree_new() Creates a new (empty) dnssec_trust_tree structure Returns ldns_dnssec_trust_tree * ldns_dnssec_trust_tree_free() Frees the...
ldns_dnssec_verify_denial
ldns_dnssec_verify_denial() denial is not just a river in egypt rr: The (query) RR to check the denial of existence for nsecs: The list of NSEC RRs that are...
ldns_dnssec_zone
ldns_dnssec_zone() ldns_dnssec_name Structure containing all resource records for a domain name Including the derived NSEC3, if present struct...
ldns_dnssec_zone_find_rrset
ldns_dnssec_zone_find_rrset() Find the RRset with the given name and type in the zone zone: the zone structure to find the RRset in dname: the domain name of...
ldns_dnssec_zone_sign
ldns_dnssec_zone_sign() signs the given zone with the given keys zone: the zone to sign key_list: the list of keys to sign the zone with new_rrs: newly created...
ldns_fget_token
ldns_fget_token() returns a token/char from the stream F. This function deals with ( and ) in the stream, and ignores them when encountered *f: the file to read...
ldns_getaddrinfo
ldns_getaddrinfo() This function is a wrapper function for ldns_get_rr_list_name_by_addr and ldns_get_rr_list_addr_by_name. It's name is from the getaddrinfo()...
ldns_get_errorstr_by_id
ldns_get_errorstr_by_id()
ldns_get_rr_class_by_name
ldns_get_rr_class_by_name() retrieves a class by looking up its name. name: string with the name Returns the cass which corresponds with the name...
ldns_get_rr_list_hosts_frm_fp
ldns_get_rr_list_hosts_frm_fp() wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there fp: the file pointer to...
ldns_get_rr_list_hosts_frm_fp_l
ldns_get_rr_list_hosts_frm_fp_l() wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there fp: the file pointer...
ldns_get_rr_list_name_by_addr
ldns_get_rr_list_addr_by_name() Ask the resolver about name and return all address records r: the resolver to use name: the name to look for c: the class to use...
ldns_init_random
ldns_init_random() Seed the random function. If the file descriptor is specified, the random generator is seeded with data from that file. If not, /dev/urandom...
ldns_is_rrset
ldns_is_rrset() checks if an rr_list is a rrset. rr_list: the rr_list to check Returns true if it is an rrset otherwise false
ldns_key
ldns_key
ldns_key2rr
ldns_key2rr() converts a ldns_key to a public key rr If the key data exists at an external point, the corresponding rdata field must still be added with...
ldns_key_free
ldns_key_free() frees a key structure, but not its internal data structures key: the key object to free ldns_key_deep_free() frees a key structure and all its...
ldns_key_new
ldns_key_new() Creates a new empty key structure Returns a new ldns_key * structure
ldns_key_new_frm_fp
ldns_key_new_frm_algorithm() Creates a new key based on the algorithm a: The algorithm to use size: the number of bytes for the keysize Returns a new ldns_key...
ldns_key_new_frm_fp_dsa
ldns_key_new_frm_fp_dsa() frm_fp helper function. This function parses the remainder of the (DSA) priv. key file fp: the file to parse Returns NULL on failure...
ldns_key_new_frm_fp_rsa
ldns_key_new_frm_fp_rsa() frm_fp helper function. This function parses the remainder of the (RSA) priv. key file generated from bind9 fp: the file to parse...
ldns_key_origttl
ldns_key_origttl() return the original ttl of the key k: the key Returns the original ttl ldns_key_inception() return the key's inception date k: the key...
ldns_key_print
ldns_key_print() print a private key to the file ouput output: the FILE descriptor where to print to k: the ldns_key to print
ldns_key_rr2ds
ldns_key_rr2ds() returns a new DS rr that represents the given key rr. *key: the key to convert h: the hash to use LDNS_SHA1/LDNS_SHA256 Returns ldns_rr* a new...
ldns_key_set_algorithm
ldns_key_set_algorithm() Set the key's algorithm k: the key l: the algorithm ldns_key_set_rsa_key() Set the key's rsa data. The rsa data should be freed by the...
ldns_native2rdf_int8
ldns_native2rdf_int8() returns the rdf containing the native uint8_t repr. type: the ldns_rdf type to use value: the uint8_t to use Returns ldns_rdf* with the...
ldns_octet
ldns_octet() removes \\DDD, \\[space] and other escapes from the input. See RFC 1035, section 5.1. word: what to check length: the string Returns ldns_status...
ldns_pkt
ldns_pkt DNS packet This structure contains a complete DNS packet (either a query or an answer) It is the complete representation of what you actually send to a...
ldns_pkt2buffer_str
ldns_pkt2buffer_str() Converts the data in the DNS packet to presentation format (as char *) and appends it to the given buffer output: pointer to the buffer to...
ldns_pkt_edns
ldns_pkt_edns() returns true if this packet needs and EDNS rr to be sent. At the moment the only reason is an expected packet size larger than 512 bytes, but...
ldns_pkt_id
ldns_pkt_id() ldns_pkt_qr() Read the packet's qr bit p: the packet Returns value of the bit ldns_pkt_aa() Read the packet's aa bit p: the packet Returns value...
ldns_pkt_new
ldns_pkt_new() allocates and initializes a ldns_pkt structure. Returns pointer to the new packet ldns_pkt_free() frees the packet structure and all data that it...
ldns_pkt_set_flags
ldns_pkt_set_flags() sets the flags in a packet. pkt: the packet to operate on flags: ORed values: LDNS_QR| LDNS_AR for instance Returns true on success...
ldns_pkt_tsig_verify
ldns_pkt_tsig_verify() verifies the tsig rr for the given packet and key. The wire must be given too because tsig does not sign normalized packets. pkt: the...
ldns_pkt_verify
ldns_pkt_verify() verify a packet p: the packet t: the rr set type to check o: the rr set name to check k: list of keys s: list of sigs (may be null) good_keys...
ldns_rdf
ldns_rdf Resource record data field. The data is a network ordered array of bytes, which size is specified by the (16-bit) size field. To correctly parse it...
ldns_rdf2buffer_str_a
ldns_rdf2buffer_str_a() Converts an LDNS_RDF_TYPE_A rdata element to string format and adds it to the output buffer *rdf: The rdata to convert *output: The...
ldns_rdf_address_reverse
ldns_rdf_address_reverse() reverses an rdf, only actually useful for AAAA and A records. The returned rdf has the type LDNS_RDF_TYPE_DNAME! *rd: rdf to be...
ldns_rdf_new
ldns_rdf_new() allocates a new rdf structure and fills it. This function DOES NOT copy the contents from the buffer, unlinke ldns_rdf_new_frm_data() type: type...
ldns_rdf_set_size
ldns_rdf_set_size() sets the size of the rdf. *rd: the rdf to operate on size: the new size Returns void ldns_rdf_set_type() sets the size of the rdf. *rd: the...
ldns_rdf_size
ldns_rdf_size() returns the size of the rdf. *rd: the rdf to read from Returns uint16_t with the size ldns_rdf_get_type() returns the type of the rdf. We need...
ldns_rr
ldns_rr Resource Record This is the basic DNS element that contains actual data From RFC1035: <pre> 3.2.1. Format All RRs have the same top level format shown...
ldns_rr2canonical
ldns_rr2canonical() converts each dname in a rr to its canonical form. rr: the rr to work on Returns void
ldns_rr2str
ldns_rr2str() Converts the data in the resource record to presentation format and returns that as a char *. Remember to free it. rr: The rdata field to convert...
ldns_rr2wire
ldns_rr2wire() Allocates an array of uint8_t at dest, and puts the wireformat of the given rr in that array. The result_size value contains the length of the...
ldns_rr_compare
ldns_rr_compare() compares two rrs. The TTL is not looked at. rr1: the first one rr2: the second one Returns 0 if equal -1 if rr1 comes before rr2 +1 if rr2...
ldns_rr_descript
ldns_rr_descriptor Contains all information about resource record types. This structure contains, for all rr types, the rdata fields that are defined. struct...
ldns_rr_dnskey_flags
ldns_rr_dnskey_flags() returns the flags of a LDNS_RR_TYPE_DNSKEY rr r: the resource record Returns a ldns_rdf* with the flags or NULL on failure...
ldns_rr_label_count
ldns_rr_label_count() counts the number of labels of the ownername. rr: count the labels of this rr Returns the number of labels
ldns_rr_list_cat
ldns_rr_list_cat() concatenates two ldns_rr_lists together. This modifies *left (to extend it and add the pointers from *right). left: the leftside right: the...
ldns_rr_list_clone
ldns_rr_list_clone() clones an rrlist. rrlist: the rrlist to clone Returns the cloned rr list
ldns_rr_list_free
ldns_rr_list_new() creates a new rr_list structure. Returns a new rr_list structure ldns_rr_list_free() frees an rr_list structure. rr_list: the list to free
ldns_rr_list_rr_count
ldns_rr_list_rr_count() returns the number of rr's in an rr_list. rr_list: the rr_list to read from Returns the number of rr's ldns_rr_list_set_rr_count() sets...
ldns_rr_list_sort
ldns_rr_list_sort() sorts an rr_list (canonical wire format). the sorting is done inband. unsorted: the rr_list to be sorted Returns void
ldns_rr_mx_preference
ldns_rr_mx_preference() returns the mx pref. of a LDNS_RR_TYPE_MX rr r: the resource record Returns a ldns_rdf* with the preference or NULL on failure...
ldns_rr_new
ldns_rr_new() creates a new rr structure. Returns ldns_rr * ldns_rr_new_frm_type() creates a new rr structure, based on the given type. alloc enough space to...
ldns_rr_ns_nsdname
ldns_rr_ns_nsdname() returns the name of a LDNS_RR_TYPE_NS rr r: the resource record Returns a ldns_rdf* with the name or NULL on failure
ldns_rr_print
ldns_rr_print() Prints the data in the resource record to the given file stream (in presentation format) output: the file stream to print to rr: the resource...
ldns_rr_push_rdf
ldns_rr_push_rdf() sets rd_field member, it will be placed in the next available spot. *rr: rr to operate on *f: the data field member to set Returns bool...
ldns_rr_rdf
ldns_rr_rdf() returns the rdata field member counter. *rr: rr to operate on nr: the number of the rdf to return Returns ldns_rdf * ldns_rr_owner() returns the...
ldns_rr_rrsig_set_typecovered
ldns_rr_rrsig_typecovered() returns the type covered of a LDNS_RR_TYPE_RRSIG rr r: the resource record Returns a ldns_rdf* with the type covered or NULL on...
ldns_rr_set_owner
ldns_rr_set_owner() sets the owner in the rr structure. *rr: rr to operate on *owner: set to this owner Returns void ldns_rr_set_ttl() sets the ttl in the rr...
ldns_rr_set_push_rr
ldns_rr_set_push_rr() pushes an rr to an rrset (which really are rr_list's). *rr_list: the rrset to push the rr to *rr: the rr to push Returns true if the push...
ldns_rr_uncompressed_size
ldns_rr_uncompressed_size() calculates the uncompressed size of an RR. r: the rr to operate on Returns size of the rr
ldns_send
ldns_send() Sends ptk to the nameserver at the resolver object. Returns the data as a ldns_pkt pkt: packet received from the nameserver r: the resolver to use...
ldns_sign_public
ldns_sign_public() Sign an rrset rrset: the rrset keys: the keys to use Returns a rr_list with the signatures
ldns_sign_public_dsa
ldns_sign_public_dsa() Sign a buffer with the DSA key (hash with SHA1) to_sign: buffer with the data key: the key to use Returns a ldns_rdf with the signed data...
ldns_status
ldns_status
ldns_str2period
ldns_str2period() converts a ttl value (like 5d2h) to a long. nptr: the start of the string endptr: points to the last char in case of error Returns the convert...
ldns_str_remove_comment
ldns_str_remove_comment()
ldns_tcp_send_query
ldns_tcp_send_query() send a query via tcp to a server. Don't want for the answer qbin: the buffer to send sockfd: the socket to use to: which ip to send it...
ldns_update_adcount
ldns_update_zocount() Get the zo count p: the packet Returns the zo count ldns_update_prcount() Get the zo count p: the packet Returns the pr count...
ldns_update_pkt_new
ldns_update_pkt_new() create an update packet from zone name, class and the rr lists zone_rdf: name of the zone clas: zone class pr_rrlist: list of Prerequisite...
ldns_update_pkt_tsig_add
ldns_update_pkt_tsig_add() add tsig credentials to a packet from a resolver p: packet to copy to r: resolver to copy from Returns status wether successfull or...
ldns_update_set_zocount
ldns_update_set_zocount() ldns_update_set_prcount() Set the pr count p: the packet c: the pr count to set ldns_update_set_upcount() Set the up count p: the...
ldns_verify
ldns_verify() Verifies a list of signatures for one rrset. rrset: the rrset to verify rrsig: a list of signatures to check keys: a list of keys to check with...
ldns_verify_rrsig_dsa
ldns_verify_rrsig_dsa() verifies a buffer with signature data (DSA) for a buffer with rrset data with a buffer with key data. sig: the signature data rrset: the...
ldns_wire2rr
ldns_wire2rr() converts the data on the uint8_t bytearray (in wire format) to a DNS resource record. This function will initialize and allocate memory space for...
ldns_zone
ldns_zone DNS Zone A list of RR's with some extra information which comes from the SOA RR Note: nothing has been done to make this efficient (yet). struct...
ldns_zone_new
ldns_zone_new() create a new ldns_zone structure Returns a pointer to a ldns_zone structure ldns_zone_deep_free() Frees the allocated memory for the zone, the...
ldns_zone_push_rr
ldns_zone_push_rr() push an single rr to a zone structure. This function use pointer copying, so the rr_list structure inside z is modified! z: the zone to add...
ldns_zone_rr_count
ldns_zone_rr_count() Returns the number of resource records in the zone, NOT counting the SOA record z: the zone to read from Returns the number of rr's in the...
ldns_zone_rrs
ldns_zone_rrs() Get a list of a zone's content. Note that the SOA isn't included in this list. You need to get the with ldns_zone_soa. z: the zone to read from...
ldns_zone_set_soa
ldns_zone_set_rrs() Set the zone's contents z: the zone to put the new soa in rrlist: the rrlist to use ldns_zone_set_soa() Set the zone's soa record z: the...
ldns_zone_sort
ldns_zone_sort() Sort the rrs in a zone, with the current impl. this is slow zone: the zone to sort ldns_zone_glue_rr_list() Retrieve all resource records from...