Electroneum
subnet-whitelist.h
Go to the documentation of this file.
1
/*
2
* edns-subnet/subnet-whitelist.h - Hosts we actively try to send subnet option
3
* to.
4
*
5
* Copyright (c) 2013, NLnet Labs. All rights reserved.
6
*
7
* This software is open source.
8
*
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions
11
* are met:
12
*
13
* Redistributions of source code must retain the above copyright notice,
14
* this list of conditions and the following disclaimer.
15
*
16
* Redistributions in binary form must reproduce the above copyright notice,
17
* this list of conditions and the following disclaimer in the documentation
18
* and/or other materials provided with the distribution.
19
*
20
* Neither the name of the NLNET LABS nor the names of its contributors may
21
* be used to endorse or promote products derived from this software without
22
* specific prior written permission.
23
*
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
30
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
31
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
32
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
*/
43
#ifndef EDNSSUBNET_WHITELIST_H
44
#define EDNSSUBNET_WHITELIST_H
45
#include "
util/storage/dnstree.h
"
46
47
struct
config_file
;
48
struct
regional
;
49
53
struct
ecs_whitelist
{
55
struct
regional
*
region
;
61
rbtree_type
upstream
;
66
rbtree_type
dname
;
67
};
68
73
struct
ecs_whitelist
*
ecs_whitelist_create
(
void
);
74
79
void
ecs_whitelist_delete
(
struct
ecs_whitelist
* whitelist);
80
87
int
ecs_whitelist_apply_cfg
(
struct
ecs_whitelist
* whitelist,
88
struct
config_file
* cfg);
89
100
int
ecs_is_whitelisted
(
struct
ecs_whitelist
* whitelist,
101
struct
sockaddr_storage
* addr, socklen_t addrlen,
uint8_t
* qname,
102
size_t
qname_len,
uint16_t
qclass);
103
109
size_t
ecs_whitelist_get_mem
(
struct
ecs_whitelist
* whitelist);
110
111
#endif
/* EDNSSUBNET_WHITELIST_H */
ecs_whitelist::region
struct regional * region
Definition:
subnet-whitelist.h:55
uint16_t
unsigned short uint16_t
Definition:
stdint.h:125
uint8_t
unsigned char uint8_t
Definition:
stdint.h:124
ecs_whitelist_delete
void ecs_whitelist_delete(struct ecs_whitelist *whitelist)
regional
Definition:
regional.h:59
rbtree_type
Definition:
rbtree.h:76
config_file
Definition:
config_file.h:68
ecs_whitelist
Definition:
subnet-whitelist.h:53
sockaddr_storage
Definition:
fake-rfc2553.h:54
ecs_whitelist_get_mem
size_t ecs_whitelist_get_mem(struct ecs_whitelist *whitelist)
ecs_whitelist_apply_cfg
int ecs_whitelist_apply_cfg(struct ecs_whitelist *whitelist, struct config_file *cfg)
ecs_whitelist::upstream
rbtree_type upstream
Definition:
subnet-whitelist.h:61
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)
ecs_whitelist::dname
rbtree_type dname
Definition:
subnet-whitelist.h:66
dnstree.h
ecs_whitelist_create
struct ecs_whitelist * ecs_whitelist_create(void)
external
unbound
edns-subnet
subnet-whitelist.h
Generated on Sun Mar 10 2024 12:00:00 for Electroneum by
1.8.14