/usr/include/bind9/dns
NameSizeModeActions
acache.h142320644editdlrm
acl.h72420644editdlrm
adb.h225950644editdlrm
badcache.h33690644editdlrm
bit.h8070644editdlrm
byaddr.h40020644editdlrm
cache.h86430644editdlrm
callbacks.h22710644editdlrm
catz.h118330644editdlrm
cert.h14660644editdlrm
client.h220420644editdlrm
clientinfo.h20060644editdlrm
compress.h66460644editdlrm
db.h470610644editdlrm
dbiterator.h74220644editdlrm
dbtable.h31650644editdlrm
diff.h69800644editdlrm
dispatch.h164270644editdlrm
dlz.h106180644editdlrm
dlz_dlopen.h46770644editdlrm
dns64.h56350644editdlrm
dnssec.h123710644editdlrm
dnstap.h93640644editdlrm
ds.h12250644editdlrm
dsdigest.h17220644editdlrm
dyndb.h48350644editdlrm
ecdb.h8090644editdlrm
edns.h7220644editdlrm
enumclass.h12200644editdlrm
enumtype.h83000644editdlrm
events.h40590644editdlrm
fixedname.h16630644editdlrm
forward.h34520644editdlrm
geoip.h27920644editdlrm
ipkeylist.h21860644editdlrm
iptable.h16210644editdlrm
journal.h82270644editdlrm
keydata.h10590644editdlrm
keyflags.h12780644editdlrm
keytable.h94620644editdlrm
keyvalues.h41590644editdlrm
lib.h11920644editdlrm
log.h39640644editdlrm
lookup.h29240644editdlrm
master.h112890644editdlrm
masterdump.h126470644editdlrm
message.h390230644editdlrm
name.h371150644editdlrm
ncache.h49290644editdlrm
nsec.h33970644editdlrm
nsec3.h80320644editdlrm
nta.h45480644editdlrm
opcode.h10070644editdlrm
order.h19990644editdlrm
peer.h59660644editdlrm
portlist.h21010644editdlrm
private.h19350644editdlrm
rbt.h406180644editdlrm
rcode.h24810644editdlrm
rdata.h216130644editdlrm
rdataclass.h22570644editdlrm
rdatalist.h25690644editdlrm
rdataset.h215360644editdlrm
rdatasetiter.h39260644editdlrm
rdataslab.h45280644editdlrm
rdatastruct.h615840644editdlrm
rdatatype.h22980644editdlrm
request.h111560644editdlrm
resolver.h202270644editdlrm
result.h92840644editdlrm
rootns.h8920644editdlrm
rpz.h103350644editdlrm
rriterator.h42300644editdlrm
rrl.h66400644editdlrm
sdb.h72240644editdlrm
sdlz.h142140644editdlrm
secalg.h17060644editdlrm
secproto.h15570644editdlrm
soa.h21860644editdlrm
ssu.h83080644editdlrm
stats.h134510644editdlrm
tcpmsg.h31450644editdlrm
time.h16950644editdlrm
timer.h10510644editdlrm
tkey.h76310644editdlrm
tsec.h29490644editdlrm
tsig.h83840644editdlrm
ttl.h19450644editdlrm
types.h142120644editdlrm
update.h16530644editdlrm
validator.h71610644editdlrm
version.h8680644editdlrm
view.h352740644editdlrm
xfrin.h29240644editdlrm
zone.h608640644editdlrm
zonekey.h7770644editdlrm
zt.h55620644editdlrm
Edit: /usr/include/bind9/dns/rrl.h (6640B)
/* * Copyright (C) Internet Systems Consortium, Inc. ("ISC") * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, you can obtain one at https://mozilla.org/MPL/2.0/. * * See the COPYRIGHT file distributed with this work for additional * information regarding copyright ownership. */ #ifndef DNS_RRL_H #define DNS_RRL_H 1 /* * Rate limit DNS responses. */ #include #include #include #include #include #include ISC_LANG_BEGINDECLS /* * Memory allocation or other failures. */ #define DNS_RRL_LOG_FAIL ISC_LOG_WARNING /* * dropped or slipped responses. */ #define DNS_RRL_LOG_DROP ISC_LOG_INFO /* * Major events in dropping or slipping. */ #define DNS_RRL_LOG_DEBUG1 ISC_LOG_DEBUG(3) /* * Limit computations. */ #define DNS_RRL_LOG_DEBUG2 ISC_LOG_DEBUG(4) /* * Even less interesting. */ #define DNS_RRL_LOG_DEBUG3 ISC_LOG_DEBUG(9) #define DNS_RRL_LOG_ERR_LEN 64 #define DNS_RRL_LOG_BUF_LEN (sizeof("would continue limiting") + \ DNS_RRL_LOG_ERR_LEN + \ sizeof(" responses to ") + \ ISC_NETADDR_FORMATSIZE + \ sizeof("/128 for IN ") + \ DNS_RDATATYPE_FORMATSIZE + \ DNS_NAME_FORMATSIZE) typedef struct dns_rrl_hash dns_rrl_hash_t; /* * Response types. */ typedef enum { DNS_RRL_RTYPE_FREE = 0, DNS_RRL_RTYPE_QUERY, DNS_RRL_RTYPE_REFERRAL, DNS_RRL_RTYPE_NODATA, DNS_RRL_RTYPE_NXDOMAIN, DNS_RRL_RTYPE_ERROR, DNS_RRL_RTYPE_ALL, DNS_RRL_RTYPE_TCP, } dns_rrl_rtype_t; /* * A rate limit bucket key. * This should be small to limit the total size of the database. * The hash of the qname should be wide enough to make the probability * of collisions among requests from a single IP address block less than 50%. * We need a 32-bit hash value for 10000 qps (e.g. random qnames forged * by attacker) to collide with legitimate qnames from the target with * probability at most 1%. */ #define DNS_RRL_MAX_PREFIX 64 typedef union dns_rrl_key dns_rrl_key_t; struct dns__rrl_key { uint32_t ip[DNS_RRL_MAX_PREFIX/32]; uint32_t qname_hash; dns_rdatatype_t qtype; uint8_t qclass; unsigned int rtype :4; /* dns_rrl_rtype_t */ unsigned int ipv6 :1; }; union dns_rrl_key { struct dns__rrl_key s; uint16_t w[sizeof(struct dns__rrl_key)/sizeof(uint16_t)]; }; /* * A rate-limit entry. * This should be small to limit the total size of the table of entries. */ typedef struct dns_rrl_entry dns_rrl_entry_t; typedef ISC_LIST(dns_rrl_entry_t) dns_rrl_bin_t; struct dns_rrl_entry { ISC_LINK(dns_rrl_entry_t) lru; ISC_LINK(dns_rrl_entry_t) hlink; dns_rrl_key_t key; # define DNS_RRL_RESPONSE_BITS 24 signed int responses :DNS_RRL_RESPONSE_BITS; # define DNS_RRL_QNAMES_BITS 8 unsigned int log_qname :DNS_RRL_QNAMES_BITS; # define DNS_RRL_TS_GEN_BITS 2 unsigned int ts_gen :DNS_RRL_TS_GEN_BITS; unsigned int ts_valid :1; # define DNS_RRL_HASH_GEN_BITS 1 unsigned int hash_gen :DNS_RRL_HASH_GEN_BITS; unsigned int logged :1; # define DNS_RRL_LOG_BITS 11 unsigned int log_secs :DNS_RRL_LOG_BITS; # define DNS_RRL_TS_BITS 12 unsigned int ts :DNS_RRL_TS_BITS; # define DNS_RRL_MAX_SLIP 10 unsigned int slip_cnt :4; }; #define DNS_RRL_MAX_TIME_TRAVEL 5 #define DNS_RRL_FOREVER (1<= DNS_RRL_MAX_TS #error "DNS_RRL_MAX_WINDOW is too large" #endif #define DNS_RRL_MAX_RATE 1000 #if DNS_RRL_MAX_RATE >= (DNS_RRL_MAX_RESPONSES / DNS_RRL_MAX_WINDOW) #error "DNS_RRL_MAX_rate is too large" #endif #if (1<= DNS_RRL_FOREVER #error DNS_RRL_LOG_BITS is too big #endif #define DNS_RRL_MAX_LOG_SECS 1800 #if DNS_RRL_MAX_LOG_SECS >= (1<= (1<