higher.c File Reference

Go to the source code of this file.

Functions

ldns_rr_listldns_get_rr_list_addr_by_name (ldns_resolver *res, ldns_rdf *name, ldns_rr_class c, uint16_t flags)
 Ask the resolver about name and return all address records.
ldns_rr_listldns_get_rr_list_name_by_addr (ldns_resolver *res, ldns_rdf *addr, ldns_rr_class c, uint16_t flags)
 ask the resolver about the address and return the name
ldns_rr_listldns_get_rr_list_hosts_frm_fp (FILE *fp)
 wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there
ldns_rr_listldns_get_rr_list_hosts_frm_fp_l (FILE *fp, int *line_nr)
 wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there
ldns_rr_listldns_get_rr_list_hosts_frm_file (char *filename)
 wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there
uint16_t ldns_getaddrinfo (ldns_resolver *res, ldns_rdf *node, ldns_rr_class c, ldns_rr_list **ret)
 This function is a wrapper function for ldns_get_rr_list_name_by_addr and ldns_get_rr_list_addr_by_name.
bool ldns_nsec_type_check (ldns_rr *nsec, ldns_rr_type t)
 Check if t is enumerated in the nsec type rdata.
void ldns_print_rr_rdf (FILE *fp, ldns_rr *r, int rdfnum,...)
 Print a number of rdf's of the RR.


Function Documentation

ldns_rr_list* ldns_get_rr_list_addr_by_name ( ldns_resolver r,
ldns_rdf name,
ldns_rr_class  c,
uint16_t  flags 
)

ldns_rr_list* ldns_get_rr_list_name_by_addr ( ldns_resolver r,
ldns_rdf addr,
ldns_rr_class  c,
uint16_t  flags 
)

ask the resolver about the address and return the name

Parameters:
[in] r the resolver to use
[in] addr the addr to look for
[in] c the class to use
[in] flags give some optional flags to the query

Definition at line 105 of file higher.c.

References ldns_pkt_rr_list_by_type(), LDNS_RD, ldns_rdf_address_reverse(), ldns_rdf_get_type(), LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_AAAA, ldns_resolver_query(), LDNS_RR_TYPE_PTR, and LDNS_SECTION_ANSWER.

ldns_rr_list* ldns_get_rr_list_hosts_frm_fp ( FILE *  fp  ) 

wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there

Parameters:
[in] fp the file pointer to use
Returns:
ldns_rr_list * with the names

Definition at line 139 of file higher.c.

References ldns_get_rr_list_hosts_frm_fp_l().

ldns_rr_list* ldns_get_rr_list_hosts_frm_fp_l ( FILE *  fp,
int *  line_nr 
)

wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there

Parameters:
[in] fp the file pointer to use
[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
Returns:
ldns_rr_list * with the names

Definition at line 145 of file higher.c.

References ldns_bget_token(), ldns_buffer_free(), ldns_buffer_new_frm_data(), ldns_fget_token_l(), LDNS_FREE, LDNS_IP6ADDRLEN, LDNS_MALLOC, LDNS_MAX_LINELEN, LDNS_PARSE_NO_NL, ldns_rdf_deep_free(), ldns_rdf_new_frm_str(), LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_AAAA, ldns_rr_clone(), ldns_rr_free(), ldns_rr_list_new(), ldns_rr_list_push_rr(), ldns_rr_new_frm_str(), ldns_rr_owner(), ldns_rr_rd_count(), LDNS_STATUS_OK, and LDNS_XMALLOC.

ldns_rr_list* ldns_get_rr_list_hosts_frm_file ( char *  filename  ) 

wade through fp (a /etc/hosts like file) and return a rr_list containing all the defined hosts in there

Parameters:
[in] filename the filename to use (NULL for /etc/hosts)
Returns:
ldns_rr_list * with the names

Definition at line 226 of file higher.c.

References ldns_get_rr_list_hosts_frm_fp(), and LDNS_RESOLV_HOSTS.

uint16_t ldns_getaddrinfo ( ldns_resolver res,
ldns_rdf node,
ldns_rr_class  c,
ldns_rr_list **  list 
)

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() library call. It tries to mimic that call, but without the lowlevel stuff.

Parameters:
[in] res The resolver. If this value is NULL then a resolver will be created by ldns_getaddrinfo.
[in] node the name or ip address to look up
[in] c the class to look in
[out] list put the found RR's in this list
Returns:
the number of RR found.

Definition at line 247 of file higher.c.

References ldns_get_rr_list_addr_by_name(), ldns_get_rr_list_name_by_addr(), ldns_rdf_get_type(), LDNS_RDF_TYPE_A, LDNS_RDF_TYPE_AAAA, LDNS_RDF_TYPE_DNAME, ldns_resolver_deep_free(), ldns_resolver_new_frm_file(), ldns_rr_list_rr_count(), and LDNS_STATUS_OK.

bool ldns_nsec_type_check ( ldns_rr nsec,
ldns_rr_type  t 
)

Check if t is enumerated in the nsec type rdata.

Parameters:
[in] nsec the NSEC Record to look in
[in] t the type to check for
Returns:
true when t is found, otherwise return false

Definition at line 287 of file higher.c.

References ldns_get_bit(), ldns_rdf_data(), ldns_rdf_size(), and ldns_rr_rdf().

void ldns_print_rr_rdf ( FILE *  fp,
ldns_rr r,
int  rdfnum,
  ... 
)

Print a number of rdf's of the RR.

The rdfnum-list must be ended by -1, otherwise unpredictable things might happen. rdfs may be printed multiple times

Parameters:
[in] fp FILE * to write to
[in] r RR to write
[in] rdfnum a list of rdf to print.

Definition at line 320 of file higher.c.

References ldns_rdf_print(), and ldns_rr_rdf().


Generated on Wed Feb 20 20:27:05 2008 for ldns by  doxygen 1.5.5