summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorInternet Software Consortium, Inc <@isc.org>2008-07-08 14:51:20 -0600
committerInternet Software Consortium, Inc <@isc.org>2008-07-08 14:51:20 -0600
commit3ff4f2ccd1b62c92dfbb75ec0b24ea9e68ea2b71 (patch)
tree4ff06e735f055067b50109e55dabf9eb61ec5759 /contrib
parent6c13108bd89f1848a45f1e8f3bb7efdddf04f931 (diff)
downloadbind9-3ff4f2ccd1b62c92dfbb75ec0b24ea9e68ea2b71.tar.gz
9.5.1b1
Diffstat (limited to 'contrib')
-rw-r--r--contrib/dlz/config.dlz.in48
-rw-r--r--contrib/queryperf/utils/gen-data-queryperf.py27
2 files changed, 65 insertions, 10 deletions
diff --git a/contrib/dlz/config.dlz.in b/contrib/dlz/config.dlz.in
index 0e4b2e58..f78e907a 100644
--- a/contrib/dlz/config.dlz.in
+++ b/contrib/dlz/config.dlz.in
@@ -123,6 +123,8 @@ AC_ARG_WITH(dlz_mysql,
(Required to use MySQL with DLZ)],
use_dlz_mysql="$withval", use_dlz_mysql="no")
+mysql_include=""
+mysql_lib=""
if test "$use_dlz_mysql" = "yes"
then
# User did not specify a path - guess it
@@ -132,9 +134,49 @@ then
if test -f $d/include/mysql/mysql.h
then
use_dlz_mysql=$d
+ mysql_include=$d/include/mysql
+ if test -d $d/lib/mysql
+ then
+ mysql_lib=$d/lib/mysql
+ else
+ mysql_lib=$d/lib
+ fi
+ break
+ elif test -f $d/include/mysql.h
+ then
+ use_dlz_mysql=$d
+ mysql_include=$d/include
+ if test -d $d/lib/mysql
+ then
+ mysql_lib=$d/lib/mysql
+ else
+ mysql_lib=$d/lib
+ fi
break
fi
done
+elif test "$use_dlz_mysql" != "no"
+then
+ d=$use_dlz_mysql
+ if test -f $d/include/mysql/mysql.h
+ then
+ mysql_include=$d/include/mysql
+ if test -d $d/lib/mysql
+ then
+ mysql_lib=$d/lib/mysql
+ else
+ mysql_lib=$d/lib
+ fi
+ elif test -f $d/include/mysql.h
+ then
+ mysql_include=$d/include
+ if test -d $d/lib/mysql
+ then
+ mysql_lib=$d/lib/mysql
+ else
+ mysql_lib=$d/lib
+ fi
+ fi
fi
if test "$use_dlz_mysql" = "yes"
@@ -150,11 +192,11 @@ case "$use_dlz_mysql" in
;;
*)
DLZ_ADD_DRIVER(MYSQL, dlz_mysql_driver,
- [-I$use_dlz_mysql/include/mysql],
- [-L$use_dlz_mysql/lib/mysql -lmysqlclient -lz -lcrypt -lm])
+ [-I${mysql_include}],
+ [-L${mysql_lib} -lmysqlclient -lz -lcrypt -lm])
AC_MSG_RESULT(
-[using mysql from $use_dlz_mysql/lib/mysql and $use_dlz_mysql/include/mysql])
+[using mysql from ${mysql_lib} and ${mysql_include}])
;;
esac
diff --git a/contrib/queryperf/utils/gen-data-queryperf.py b/contrib/queryperf/utils/gen-data-queryperf.py
index b164025a..28eaa3f7 100644
--- a/contrib/queryperf/utils/gen-data-queryperf.py
+++ b/contrib/queryperf/utils/gen-data-queryperf.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
#
-# $Id: gen-data-queryperf.py,v 1.1 2003/04/10 02:33:40 marka Exp $
+# $Id: gen-data-queryperf.py,v 1.1.1236.1 2008/06/13 18:18:04 jinmei Exp $
#
# Contributed by Stephane Bortzmeyer <bortzmeyer@nic.fr>
#
@@ -32,9 +32,15 @@ percent_random = 0.3
gen = None
zone_file = None
domains = {}
-domain_ns = "^([a-z0-9-]+)(\.([a-z0-9-\.]+|)|)( +IN|) +NS"
+domain_ns = r'^([a-z0-9-\.]+)((\s+\d+)?(\s+IN)?|(\s+IN)(\s+\d+)?)\s+NS'
domain_ns_re = re.compile(domain_ns, re.IGNORECASE)
+def remove_tld(label, tld):
+ if label.endswith('.' + tld + '.'):
+ return label[0:-(1+ len(tld) + 1)]
+ else:
+ return label
+
def gen_random_label():
label = ""
for i in range(gen.randint(1, maxsize)):
@@ -52,7 +58,7 @@ def usage():
try:
optlist, args = getopt.getopt(sys.argv[1:], "hp:f:n:t:m:",
["help", "percentrandom=", "zonefile=",
- "num=", "tld=",
+ "number=", "tld=",
"maxsize="])
for option, value in optlist:
if option == "--help" or option == "-h":
@@ -86,15 +92,22 @@ if zone_file:
while line:
domain_line = domain_ns_re.match(line)
if domain_line:
- domain = domain_line.group(1)
+ print domain_line.group(1)
+ domain = remove_tld(domain_line.group(1), tld)
domains[domain] = 1
line = file.readline()
file.close()
+if zone_file:
+ domains = domains.keys()
+ if len(domains) == 0:
+ sys.stderr.write("No domains found in '%s'\n" % zone_file)
+ sys.exit(1)
for i in range(num):
if zone_file:
if gen.random() < percent_random:
- print make_domain(gen_random_label())
+ sys.stdout.write(make_domain(gen_random_label()))
else:
- print make_domain(gen.choice(domains.keys()))
+ sys.stdout.write(make_domain(gen.choice(domains)))
else:
- print make_domain(gen_random_label())
+ sys.stdout.write(make_domain(gen_random_label()))
+ sys.stdout.write("\n")