Removed ipcalc dependency of ldnsx.
Removed the unused function 'ldns_rr_list_contains_name' from ldns-verify-zone.c
And a very ugly syntax error in Makefile.in
install-config:
if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
- $(INSTALL) -d $(DESTDIR)$(bindir) \
- $(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/ \
+ $(INSTALL) -d $(DESTDIR)$(bindir) ; \
+ $(INSTALL) -c -m 755 packaging/ldns-config $(DESTDIR)$(bindir)/ ; \
fi
uninstall-config:
${INSTALL} -c -m 444 $$f $(DESTDIR)$(mandir)/man3/; \
done
if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
- ${INSTALL} -d $(DESTDIR)$(mandir)/man1 \
- ${INSTALL} -c -m 444 packaging/ldns-config.1 $(DESTDIR)$(mandir)/man1/ \
+ ${INSTALL} -d $(DESTDIR)$(mandir)/man1; \
+ ${INSTALL} -c -m 444 packaging/ldns-config.1 $(DESTDIR)$(mandir)/man1/; \
fi
uninstall-manpages:
rm -f $(DESTDIR)$(mandir)/man3/$$i.3 ; done
rmdir -p $(DESTDIR)$(mandir)/man3 || echo "ok, dir already gone"
if [ $(INSTALL_LDNS_CONFIG) = "yes" ] ; then \
- rm -f $(DESTDIR)$(mandir)/man1/ldns-config.1 \
+ rm -f $(DESTDIR)$(mandir)/man1/ldns-config.1; \
[ ! -d $(DESTDIR)$(mandir)/man1 ] || rmdir -p $(DESTDIR)$(mandir)/man1 || echo "ok, dir already gone"; \
fi
rm -f $(DESTDIR)$(includedir)/ldns/net.h
rm -f $(DESTDIR)$(includedir)/ldns/util.h
rm -f $(DESTDIR)$(includedir)/ldns/common.h
- [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone"
+ [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDIR)$(includedir)/ldns || echo "ok, dir already gone"
exit 0
install-lib: lib
uninstall-pyldns:
rm -f $(DESTDIR)$(python_site)/ldns/*
- rmdir -p $(DESTDIR)$(python_site)/ldns
+ rmdir $(DESTDIR)$(python_site)/ldns || echo "ok, dir already gone"
install-pyldnsx:
$(INSTALL) -c -m 644 $(pyldnsxwrapdir)/ldnsx.py $(DESTDIR)$(python_site)/ldnsx.py
+++ /dev/null
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_python_module.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PYTHON_MODULE(modname[, fatal])
-#
-# DESCRIPTION
-#
-# Checks for Python module.
-#
-# If fatal is non-empty then absence of a module will trigger an error.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 5
-
-AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
-AC_DEFUN([AX_PYTHON_MODULE],[
- if test -z $PYTHON;
- then
- PYTHON="python"
- fi
- PYTHON_NAME=`basename $PYTHON`
- AC_MSG_CHECKING($PYTHON_NAME module: $1)
- $PYTHON -c "import $1" 2>/dev/null
- if test $? -eq 0;
- then
- AC_MSG_RESULT(yes)
- eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
- else
- AC_MSG_RESULT(no)
- eval AS_TR_CPP(HAVE_PYMOD_$1)=no
- #
- if test -n "$2"
- then
- AC_MSG_ERROR(failed to find required module $1)
- exit 1
- fi
- fi
-])
[],[ withval="with_pyldns" ])
if test x_$withval != x_no; then
if test x_$ldns_with_pyldns != x_no; then
- # The python ipcalc module is needed for pyldnsx, but it is not
- # a build dependency
- #
- #sinclude(ax_python_module.m4)
- #AX_PYTHON_MODULE(ipcalc)
AC_SUBST(PYLDNSX, "pyldnsx")
else
if test x_$withval != x_with_pyldns; then
-# (c) Christopher Olah <colah@xelerance.com>, 2011. Xelerance <http://www.xelerance.com/>.
+# Copyright (C) Xelerance Corp. <http://www.xelerance.com/>.
+# Author: Christopher Olah <colah@xelerance.com>
# License: BSD
""" Easy DNS (including DNSSEC) via ldns.
"""
-import time, sys, calendar, warnings
-try:
- import ipcalc
-except ImportError:
- print >> sys.stderr, "ldnsx requires the python-ipcalc"
- print >> sys.stderr, "Fedora/CentOS: yum install python-ipcalc"
- print >> sys.stderr, "Debian/Ubuntu: apt-get install python-ipcalc"
- print >> sys.stderr, "openSUSE: zypper in python-ipcalc"
- sys.exit(1)
+import time, sys, calendar, warnings, socket
try:
import ldns
except ImportError:
def isValidIP(ipaddr):
try:
- bits_to_type = { 32 : 4, 128 : 6}
- bits = len(ipcalc.IP(ipaddr).bin())
- return bits_to_type[bits]
+ v4 = socket.inet_pton(socket.AF_INET,ipaddr)
+ return 4
except:
- return 0
+ try:
+ v6 = socket.inet_pton(socket.AF_INET6,ipaddr)
+ return 6
+ except:
+ return 0
def query(name, rr_type, rr_class="IN", flags=["RD"], tries = 3, res=None):
"""Convenience function. Creates a resolver and then queries it. Refer to resolver.query()
return 0;
}
-static bool
-ldns_rr_list_contains_name(const ldns_rr_list *rr_list,
- const ldns_rdf *name)
-{
- size_t i;
- for (i = 0; i < ldns_rr_list_rr_count(rr_list); i++) {
- if (ldns_dname_compare(name,
- ldns_rr_owner(ldns_rr_list_rr(rr_list, i))) == 0) {
- return true;
- }
- }
- return false;
-}
-
static void
print_type(ldns_rr_type type)
{