unbound: iterator/iter_donotq.h File Reference

unbound 0.1

Data Structures | Functions
iter_donotq.h File Reference

This file contains functions to assist the iterator module. More...

`#include "util/storage/dnstree.h"`

## Data Structures
struct | iter_donotq
| Iterator donotqueryaddresses structure. More...

## Functions
struct iter_donotq * | donotq_create (void)
| Create donotqueryaddresses structure.
void | donotq_delete (struct iter_donotq *donotq)
| Delete donotqueryaddresses structure.
int | donotq_apply_cfg (struct iter_donotq *donotq, struct config_file *cfg)
| Process donotqueryaddresses config.
int | donotq_lookup (struct iter_donotq *donotq, struct sockaddr_storage *addr, socklen_t addrlen)
| See if an address is blocked.
size_t | donotq_get_mem (struct iter_donotq *donotq)
| Get memory used by donotqueryaddresses structure.

## Detailed Description

This file contains functions to assist the iterator module.

Keep track of the donotquery addresses and lookup fast.

## Function Documentation

## ◆ donotq_create()

struct iter_donotq * donotq_create | ( | void |  | ) |

Create donotqueryaddresses structure.

Returns
  new structure or NULL on error.

References donotq_delete(), iter_donotq::region, and regional_create().

Referenced by iter_apply_cfg().

## ◆ donotq_delete()

void donotq_delete | ( | struct iter_donotq * | donotq | ) |

Delete donotqueryaddresses structure.

Parameters

  donotq | to delete.

References iter_donotq::region, and regional_destroy().

Referenced by donotq_create(), and iter_deinit().

## ◆ donotq_apply_cfg()

int donotq_apply_cfg | ( | struct iter_donotq * | donotq,
|  | struct config_file * | cfg )

Process donotqueryaddresses config.

Parameters

  donotq | where to store.
  cfg | config options.

Returns
  0 on error.

References addr_tree_init(), addr_tree_init_parents(), config_file::do_ip6, donotq_str_cfg(), config_file::donotquery_localhost, read_donotq(), iter_donotq::region, regional_free_all(), and iter_donotq::tree.

Referenced by iter_apply_cfg().

## ◆ donotq_lookup()

int donotq_lookup | ( | struct iter_donotq * | donotq,
|  | struct sockaddr_storage * | addr,
|  | socklen_t | addrlen )

See if an address is blocked.

Parameters

  donotq | structure for address storage.
  addr | address to check
  addrlen | length of addr.

Returns
  : true if the address must not be queried. false if unlisted.

References addr_tree_lookup(), and iter_donotq::tree.

Referenced by iter_filter_unsuitable().

## ◆ donotq_get_mem()

size_t donotq_get_mem | ( | struct iter_donotq * | donotq | ) |

Get memory used by donotqueryaddresses structure.

Parameters

  donotq | structure for address storage.

Returns
  bytes in use.

References iter_donotq::region, and regional_get_mem().

Referenced by iter_get_mem().