003 File Manager
Current Path:
/usr/src/contrib/unbound/contrib
usr
/
src
/
contrib
/
unbound
/
contrib
/
📁
..
📄
README
(3.49 KB)
📄
aaaa-filter-iterator.patch
(14.98 KB)
📁
android
📄
build-unbound-localzone-from-hosts.pl
(1.18 KB)
📄
create_unbound_ad_servers.cmd
(1.1 KB)
📄
create_unbound_ad_servers.sh
(1.02 KB)
📄
drop-tld.diff
(3.13 KB)
📄
drop2rpz
(1009 B)
📄
fastrpz.patch
(106.8 KB)
📁
ios
📄
libunbound.pc.in
(416 B)
📄
libunbound.so.conf
(2.03 KB)
📄
metrics.awk
(10.13 KB)
📄
parseunbound.pl
(5.58 KB)
📄
patch_rsamd5_enable.diff
(542 B)
📄
rc_d_unbound
(586 B)
📄
redirect-bogus.patch
(12.57 KB)
📁
selinux
📄
unbound-fuzzers.tar.bz2
(1.61 KB)
📄
unbound-fuzzme.patch
(6.43 KB)
📄
unbound-host.nagios.patch
(3.17 KB)
📄
unbound-querycachedb.py
(2.71 KB)
📄
unbound.init
(3.45 KB)
📄
unbound.init_fedora
(2.77 KB)
📄
unbound.plist
(926 B)
📄
unbound.service.in
(3.43 KB)
📄
unbound.socket.in
(142 B)
📄
unbound.spec
(3.79 KB)
📄
unbound.spec_fedora
(14.83 KB)
📄
unbound_cache.cmd
(2.56 KB)
📄
unbound_cache.sh
(3.38 KB)
📄
unbound_cacti.tar.gz
(71.5 KB)
📄
unbound_munin_
(17.57 KB)
📄
unbound_portable.service.in
(1.38 KB)
📄
unbound_smf23.tar.gz
(4.54 KB)
📄
update-anchor.sh
(4.25 KB)
📄
validation-reporter.sh
(2.27 KB)
📄
warmup.cmd
(2.47 KB)
📄
warmup.sh
(2.13 KB)
Editing: unbound-querycachedb.py
#!/usr/bin/env python import hashlib import sys import struct import socket import time from optparse import OptionParser import dns.message import dns.name import dns.rdataclass import dns.rdatatype def _calc_hashkey(qname, secret, qtype): qclass = 'IN' # CLASS is fixed for simplicity hobj = hashlib.sha256() hobj.update(dns.name.from_text(qname).to_wire()) hobj.update(struct.pack('HH', socket.htons(dns.rdatatype.from_text(qtype)), socket.htons(dns.rdataclass.from_text(qclass)))) hobj.update(secret) return hobj.hexdigest().upper() def _redis_get(options, key): import redis return redis.Redis(options.address, int(options.port)).get(key) def _dump_value(options, qname, key, value): print(';; query=%s/IN/%s' % (qname, options.qtype)) print(';; key=%s' % key) if value is None: print(';; no value') return if len(value) < 16: print(';; broken value, short length: %d' % len(value)) return now = int(time.time()) timestamp = struct.unpack('!Q', value[-16:-8])[0] expire = struct.unpack('!Q', value[-8:])[0] print(';; Now=%d, TimeStamp=%d, Expire=%d, TTL=%d' % (now, timestamp, expire, max(expire - now, 0))) print(dns.message.from_wire(value[:-16])) def main(): parser = OptionParser(usage='usage: %prog [options] query_name') parser.add_option("-a", "--address", dest="address", action="store", default='127.0.0.1', help="backend-server address", metavar='ADDRESS') parser.add_option("-b", "--backend", dest="backend", action="store", default='redis', help="backend name", metavar='BACKEND') parser.add_option("-p", "--port", dest="port", action="store", default='6379', help="backend-server port", metavar='PORT') parser.add_option("-s", "--secret", dest="secret", action="store", default='default', help="secret seed", metavar='SECRET') parser.add_option("-t", "--qtype", dest="qtype", action="store", default='A', help="query RR type", metavar='QTYPE') (options, args) = parser.parse_args() if len(args) < 1: parser.error('qname is missing') if options.backend == 'redis': get_func = _redis_get else: raise Exception('unknown backend name: %s\n' % options.backend) key = _calc_hashkey(args[0], options.secret, options.qtype) value = get_func(options, key) _dump_value(options, args[0], key, value) if __name__ == '__main__': try: main() except Exception as e: sys.stderr.write('%s\n' % e) exit(1)
Upload File
Create Folder