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>
30 * Ask the resolver about name
31 * and return all address records
32 * \param[in] r the resolver to use
33 * \param[in] name the name to look for
34 * \param[in] c the class to use
35 * \param[in] flags give some optional flags to the query
37 ldns_rr_list *ldns_get_rr_list_addr_by_name(ldns_resolver *r, ldns_rdf *name, ldns_rr_class c, uint16_t flags);
40 * ask the resolver about the address
42 * \param[in] r the resolver to use
43 * \param[in] addr the addr to look for
44 * \param[in] c the class to use
45 * \param[in] flags give some optional flags to the query
47 ldns_rr_list *ldns_get_rr_list_name_by_addr(ldns_resolver *r, ldns_rdf *addr, ldns_rr_class c, uint16_t flags);
50 * wade through fp (a /etc/hosts like file)
51 * and return a rr_list containing all the
52 * defined hosts in there
53 * \param[in] fp the file pointer to use
54 * \return ldns_rr_list * with the names
56 ldns_rr_list *ldns_get_rr_list_hosts_frm_fp(FILE *fp);
59 * wade through fp (a /etc/hosts like file)
60 * and return a rr_list containing all the
61 * defined hosts in there
62 * \param[in] fp the file pointer to use
63 * \param[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
64 * \return ldns_rr_list * with the names
66 ldns_rr_list *ldns_get_rr_list_hosts_frm_fp_l(FILE *fp, int *line_nr);
69 * wade through fp (a /etc/hosts like file)
70 * and return a rr_list containing all the
71 * defined hosts in there
72 * \param[in] filename the filename to use (NULL for /etc/hosts)
73 * \return ldns_rr_list * with the names
75 ldns_rr_list *ldns_get_rr_list_hosts_frm_file(char *filename);
78 * This function is a wrapper function for ldns_get_rr_list_name_by_addr
79 * and ldns_get_rr_list_addr_by_name. It's name is from the getaddrinfo()
80 * library call. It tries to mimic that call, but without the lowlevel
82 * \param[in] res The resolver. If this value is NULL then a resolver will
83 * be created by ldns_getaddrinfo.
84 * \param[in] node the name or ip address to look up
85 * \param[in] c the class to look in
86 * \param[out] list put the found RR's in this list
87 * \return the number of RR found.
89 uint16_t ldns_getaddrinfo(ldns_resolver *res, ldns_rdf *node, ldns_rr_class c, ldns_rr_list **list);
92 * Check if t is enumerated in the nsec type rdata
93 * \param[in] nsec the NSEC Record to look in
94 * \param[in] t the type to check for
95 * \return true when t is found, otherwise return false
97 bool ldns_nsec_type_check(ldns_rr *nsec, ldns_rr_type t);
100 * Print a number of rdf's of the RR. The rdfnum-list must
101 * be ended by -1, otherwise unpredictable things might happen.
102 * rdfs may be printed multiple times
103 * \param[in] fp FILE * to write to
104 * \param[in] r RR to write
105 * \param[in] rdfnum a list of rdf to print.
107 void ldns_print_rr_rdf(FILE *fp, ldns_rr *r, int rdfnum, ...);
113 #endif /* LDNS_HIGHER_H */