4 * Specifies some higher level functions that could
5 * be useful for certain applications
9 * a Net::DNS like library for C
11 * (c) NLnet Labs, 2005-2006
13 * See the file LICENSE for the license
19 #include <ldns/resolver.h>
20 #include <ldns/rdata.h>
22 #include <ldns/host2str.h>
23 #include <ldns/tsig.h>
26 * Ask the resolver about name
27 * and return all address records
28 * \param[in] r the resolver to use
29 * \param[in] name the name to look for
30 * \param[in] c the class to use
31 * \param[in] flags give some optional flags to the query
33 ldns_rr_list *ldns_get_rr_list_addr_by_name(ldns_resolver *r, ldns_rdf *name, ldns_rr_class c, uint16_t flags);
36 * ask the resolver about the address
38 * \param[in] r the resolver to use
39 * \param[in] addr the addr to look for
40 * \param[in] c the class to use
41 * \param[in] flags give some optional flags to the query
43 ldns_rr_list *ldns_get_rr_list_name_by_addr(ldns_resolver *r, ldns_rdf *addr, ldns_rr_class c, uint16_t flags);
46 * wade through fp (a /etc/hosts like file)
47 * and return a rr_list containing all the
48 * defined hosts in there
49 * \param[in] fp the file pointer to use
50 * \return ldns_rr_list * with the names
52 ldns_rr_list *ldns_get_rr_list_hosts_frm_fp(FILE *fp);
55 * wade through fp (a /etc/hosts like file)
56 * and return a rr_list containing all the
57 * defined hosts in there
58 * \param[in] fp the file pointer to use
59 * \param[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
60 * \return ldns_rr_list * with the names
62 ldns_rr_list *ldns_get_rr_list_hosts_frm_fp_l(FILE *fp, int *line_nr);
65 * wade through fp (a /etc/hosts like file)
66 * and return a rr_list containing all the
67 * defined hosts in there
68 * \param[in] filename the filename to use (NULL for /etc/hosts)
69 * \return ldns_rr_list * with the names
71 ldns_rr_list *ldns_get_rr_list_hosts_frm_file(char *filename);
74 * This function is a wrapper function for ldns_get_rr_list_name_by_addr
75 * and ldns_get_rr_list_addr_by_name. It's name is from the getaddrinfo()
76 * library call. It tries to mimic that call, but without the lowlevel
78 * \param[in] res The resolver. If this value is NULL then a resolver will
79 * be created by ldns_getaddrinfo.
80 * \param[in] node the name or ip address to look up
81 * \param[in] c the class to look in
82 * \param[out] list put the found RR's in this list
83 * \return the number of RR found.
85 uint16_t ldns_getaddrinfo(ldns_resolver *res, ldns_rdf *node, ldns_rr_class c, ldns_rr_list **list);
88 * Check if t is enumerated in the nsec type rdata
89 * \param[in] nsec the NSEC Record to look in
90 * \param[in] t the type to check for
91 * \return true when t is found, otherwise return false
93 bool ldns_nsec_type_check(ldns_rr *nsec, ldns_rr_type t);
96 * Print a number of rdf's of the RR. The rdfnum-list must
97 * be ended by -1, otherwise unpredictable things might happen.
98 * rdfs may be printed multiple times
99 * \param[in] fp FILE * to write to
100 * \param[in] r RR to write
101 * \param[in] rdfnum a list of rdf to print.
103 void ldns_print_rr_rdf(FILE *fp, ldns_rr *r, int rdfnum, ...);
105 #endif /* LDNS_HIGHER_H */