Electroneum
Toggle main menu visibility
Loading...
Searching...
No Matches
subnetmod.h
Go to the documentation of this file.
1
/*
2
* edns-subnet/subnetmod.h - edns subnet module. Must be called before validator
3
* and iterator.
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
*/
40
41
#ifndef SUBNETMOD_H
42
#define SUBNETMOD_H
43
#include "
util/module.h
"
44
#include "
services/outbound_list.h
"
45
#include "
util/alloc.h
"
46
#include "
util/net_help.h
"
47
#include "
util/storage/slabhash.h
"
48
#include "
edns-subnet/addrtree.h
"
49
#include "
edns-subnet/edns-subnet.h
"
50
54
struct
subnet_env
{
58
struct
slabhash
*
subnet_msg_cache
;
60
struct
ecs_whitelist
*
whitelist
;
62
struct
alloc_cache
alloc
;
63
lock_rw_type
biglock
;
64
};
65
66
struct
subnet_msg_cache_data
{
67
struct
addrtree
*
tree4
;
68
struct
addrtree
*
tree6
;
69
};
70
71
struct
subnet_qstate
{
73
hashvalue_type
qinfo_hash
;
75
struct
ecs_data
ecs_client_in
;
76
struct
ecs_data
ecs_client_out
;
78
struct
ecs_data
ecs_server_in
;
79
struct
ecs_data
ecs_server_out
;
80
int
subnet_downstream
;
81
int
subnet_sent
;
82
};
83
84
void
subnet_data_delete
(
void
* d,
void
* ATTR_UNUSED(arg));
85
size_t
msg_cache_sizefunc
(
void
* k,
void
* d);
86
91
struct
module_func_block
*
subnetmod_get_funcblock
(
void
);
92
94
int
subnetmod_init
(
struct
module_env
* env,
int
id
);
95
97
void
subnetmod_deinit
(
struct
module_env
* env,
int
id
);
98
100
void
subnetmod_operate
(
struct
module_qstate
* qstate,
enum
module_ev
event,
101
int
id
,
struct
outbound_entry
* outbound);
102
104
void
subnetmod_inform_super
(
struct
module_qstate
* qstate,
int
id
,
105
struct
module_qstate
* super);
106
108
void
subnetmod_clear
(
struct
module_qstate
* qstate,
int
id
);
109
111
size_t
subnetmod_get_mem
(
struct
module_env
* env,
int
id
);
112
114
size_t
unittest_wrapper_subnetmod_sizefunc
(
void
*elemptr);
115
117
int
ecs_whitelist_check
(
struct
query_info
* qinfo,
uint16_t
flags,
118
struct
module_qstate
* qstate,
struct
sockaddr_storage
* addr,
119
socklen_t addrlen,
uint8_t
* zone,
size_t
zonelen,
120
struct
regional
* region,
int
id
,
void
* cbargs);
121
124
int
ecs_edns_back_parsed
(
struct
module_qstate
* qstate,
int
id
,
void
* cbargs);
125
127
int
ecs_query_response
(
struct
module_qstate
* qstate,
struct
dns_msg
* response,
128
int
id
,
void
* cbargs);
129
130
#endif
/* SUBNETMOD_H */
addrtree.h
alloc.h
edns-subnet.h
lock_rw_type
int lock_rw_type
Definition
locks.h:261
hashvalue_type
uint32_t hashvalue_type
Definition
lruhash.h:119
module.h
module_ev
module_ev
Definition
module.h:536
net_help.h
outbound_list.h
slabhash.h
uint16_t
unsigned short uint16_t
Definition
stdint.h:125
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
addrtree
Definition
addrtree.h:65
alloc_cache
Definition
alloc.h:72
dns_msg
Definition
dns.h:61
ecs_data
Definition
edns-subnet.h:52
ecs_whitelist
Definition
subnet-whitelist.h:53
module_env
Definition
module.h:307
module_func_block
Definition
module.h:642
module_qstate
Definition
module.h:571
outbound_entry
Definition
outbound_list.h:61
query_info
Definition
msgreply.h:69
regional
Definition
regional.h:60
slabhash
Definition
slabhash.h:57
sockaddr_storage
Definition
fake-rfc2553.h:54
subnet_env
Definition
subnetmod.h:54
subnet_env::subnet_msg_cache
struct slabhash * subnet_msg_cache
Definition
subnetmod.h:58
subnet_env::biglock
lock_rw_type biglock
Definition
subnetmod.h:63
subnet_env::whitelist
struct ecs_whitelist * whitelist
Definition
subnetmod.h:60
subnet_env::alloc
struct alloc_cache alloc
Definition
subnetmod.h:62
subnet_msg_cache_data
Definition
subnetmod.h:66
subnet_msg_cache_data::tree6
struct addrtree * tree6
Definition
subnetmod.h:68
subnet_msg_cache_data::tree4
struct addrtree * tree4
Definition
subnetmod.h:67
subnet_qstate
Definition
subnetmod.h:71
subnet_qstate::subnet_downstream
int subnet_downstream
Definition
subnetmod.h:80
subnet_qstate::ecs_server_in
struct ecs_data ecs_server_in
Definition
subnetmod.h:78
subnet_qstate::subnet_sent
int subnet_sent
Definition
subnetmod.h:81
subnet_qstate::ecs_client_out
struct ecs_data ecs_client_out
Definition
subnetmod.h:76
subnet_qstate::ecs_server_out
struct ecs_data ecs_server_out
Definition
subnetmod.h:79
subnet_qstate::ecs_client_in
struct ecs_data ecs_client_in
Definition
subnetmod.h:75
subnet_qstate::qinfo_hash
hashvalue_type qinfo_hash
Definition
subnetmod.h:73
subnet_data_delete
void subnet_data_delete(void *d, void *ATTR_UNUSED(arg))
subnetmod_init
int subnetmod_init(struct module_env *env, int id)
ecs_query_response
int ecs_query_response(struct module_qstate *qstate, struct dns_msg *response, int id, void *cbargs)
subnetmod_get_funcblock
struct module_func_block * subnetmod_get_funcblock(void)
unittest_wrapper_subnetmod_sizefunc
size_t unittest_wrapper_subnetmod_sizefunc(void *elemptr)
subnetmod_clear
void subnetmod_clear(struct module_qstate *qstate, int id)
msg_cache_sizefunc
size_t msg_cache_sizefunc(void *k, void *d)
ecs_edns_back_parsed
int ecs_edns_back_parsed(struct module_qstate *qstate, int id, void *cbargs)
subnetmod_deinit
void subnetmod_deinit(struct module_env *env, int id)
subnetmod_inform_super
void subnetmod_inform_super(struct module_qstate *qstate, int id, struct module_qstate *super)
subnetmod_get_mem
size_t subnetmod_get_mem(struct module_env *env, int id)
subnetmod_operate
void subnetmod_operate(struct module_qstate *qstate, enum module_ev event, int id, struct outbound_entry *outbound)
ecs_whitelist_check
int ecs_whitelist_check(struct query_info *qinfo, uint16_t flags, struct module_qstate *qstate, struct sockaddr_storage *addr, socklen_t addrlen, uint8_t *zone, size_t zonelen, struct regional *region, int id, void *cbargs)
external
unbound
edns-subnet
subnetmod.h
Generated on
for Electroneum by
1.17.0