unbound: edns-subnet/subnet-whitelist.h File Reference

unbound 0.1

Data Structures | Functions
subnet-whitelist.h File Reference

Keep track of the white listed servers and domain names for subnet option. More...

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

## Data Structures
struct | ecs_whitelist
| ecs_whitelist structure More...

## Functions
struct ecs_whitelist * | ecs_whitelist_create (void)
| Create ecs_whitelist structure.
void | ecs_whitelist_delete (struct ecs_whitelist *whitelist)
| Delete ecs_whitelist structure.
int | ecs_whitelist_apply_cfg (struct ecs_whitelist *whitelist, struct config_file *cfg)
| Process ecs_whitelist config.
int | ecs_is_whitelisted (struct ecs_whitelist *whitelist, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *qname, size_t qname_len, uint16_t qclass)
| See if an address or domain is whitelisted.
size_t | ecs_whitelist_get_mem (struct ecs_whitelist *whitelist)
| Get memory used by ecs_whitelist structure.

## Detailed Description

Keep track of the white listed servers and domain names for subnet option.

Based on acl_list.c|h

## Function Documentation

## ◆ ecs_whitelist_create()

struct ecs_whitelist * ecs_whitelist_create | ( | void |  | ) |

Create ecs_whitelist structure.

Returns
  new structure or NULL on error.

## ◆ ecs_whitelist_delete()

void ecs_whitelist_delete | ( | struct ecs_whitelist * | whitelist | ) |

Delete ecs_whitelist structure.

Parameters

  whitelist | to delete.

## ◆ ecs_whitelist_apply_cfg()

int ecs_whitelist_apply_cfg | ( | struct ecs_whitelist * | whitelist,
|  | struct config_file * | cfg
| ) |  |

Process ecs_whitelist config.

Parameters

  whitelist | where to store.
  cfg | config options.

Returns
  0 on error.

## ◆ ecs_is_whitelisted()

int ecs_is_whitelisted | ( | struct ecs_whitelist * | whitelist,
|  | struct sockaddr_storage * | addr,
|  | socklen_t | addrlen,
|  | uint8_t * | qname,
|  | size_t | qname_len,
|  | uint16_t | qclass
| ) |  |

See if an address or domain is whitelisted.

Parameters

  whitelist | structure for address storage.
  addr | address to check
  addrlen | length of addr.
  qname | dname in query
  qname_len | length of dname
  qclass | class in query

Returns
  : true if the address is whitelisted for subnet option.

## ◆ ecs_whitelist_get_mem()

size_t ecs_whitelist_get_mem | ( | struct ecs_whitelist * | whitelist | ) |

Get memory used by ecs_whitelist structure.

Parameters

  whitelist | structure for address storage.

Returns
  bytes in use.