diff --git a/waf-tools/ccnx.py b/waf-tools/ccnx.py
deleted file mode 100644
index 5338b5f..0000000
--- a/waf-tools/ccnx.py
+++ /dev/null
@@ -1,77 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
-	def options(opt):
-	        opt.tool_options('ccnx', tooldir=["waf-tools"])
-
-	def configure(conf):
-		conf.load('compiler_cxx ccnx')
-
-	def build(bld):
-		bld(source='main.cpp', target='app', use='CCNX')
-
-Options are generated, in order to specify the location of ccnx includes/libraries.
-
-
-'''
-import sys
-import re
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-CCNX_DIR=['/usr','/usr/local','/opt/local','/sw']
-CCNX_VERSION_FILE='ccn/ccn.h'
-CCNX_VERSION_CODE='''
-#include <iostream>
-#include <ccn/ccn.h>
-int main() { std::cout << ((CCN_API_VERSION/100000) % 100) << "." << ((CCN_API_VERSION/1000) % 100) << "." << (CCN_API_VERSION % 1000); }
-'''
-
-def options(opt):
-	opt.add_option('--ccnx',type='string',default='',dest='ccnx_dir',help='''path to where CCNx is installed, e.g. /usr/local''')
-@conf
-def __ccnx_get_version_file(self,dir):
-	# Logs.pprint ('CYAN', '  + %s/%s/%s' % (dir, 'include', CCNX_VERSION_FILE))
-	try:
-		return self.root.find_dir(dir).find_node('%s/%s' % ('include', CCNX_VERSION_FILE))
-	except:
-		return None
-@conf
-def ccnx_get_version(self,dir):
-	val=self.check_cxx(fragment=CCNX_VERSION_CODE,includes=['%s/%s' % (dir, 'include')],execute=True,define_ret = True, mandatory=True)
-	return val
-@conf
-def ccnx_get_root(self,*k,**kw):
-	root=k and k[0]or kw.get('path',None)
-	# Logs.pprint ('RED', '   %s' %root)
-	if root and self.__ccnx_get_version_file(root):
-		return root
-	for dir in CCNX_DIR:
-		if self.__ccnx_get_version_file(dir):
-			return dir
-	if root:
-		self.fatal('CCNx not found in %s'%root)
-	else:
-		self.fatal('CCNx not found, please provide a --ccnx argument (see help)')
-@conf
-def check_ccnx(self,*k,**kw):
-	if not self.env['CXX']:
-		self.fatal('load a c++ compiler first, conf.load("compiler_cxx")')
-
-	var=kw.get('uselib_store','CCNX')
-	self.start_msg('Checking CCNx')
-	root = self.ccnx_get_root(*k,**kw);
-	self.env.CCNX_VERSION=self.ccnx_get_version(root)
-
-	self.env['INCLUDES_%s'%var]= '%s/%s' % (root, "include");
-	self.env['LIB_%s'%var] = "ccn"
-	self.env['LIBPATH_%s'%var] = '%s/%s' % (root, "lib")
-
-	self.end_msg(self.env.CCNX_VERSION)
-	if Logs.verbose:
-		Logs.pprint('CYAN','	ccnx include : %s'%self.env['INCLUDES_%s'%var])
-		Logs.pprint('CYAN','	ccnx lib     : %s'%self.env['LIB_%s'%var])
-		Logs.pprint('CYAN','	ccnx libpath : %s'%self.env['LIBPATH_%s'%var])
diff --git a/waf-tools/ndnx.py b/waf-tools/ndnx.py
new file mode 100644
index 0000000..eec23c5
--- /dev/null
+++ b/waf-tools/ndnx.py
@@ -0,0 +1,160 @@
+#! /usr/bin/env python
+# encoding: utf-8
+
+'''
+
+When using this tool, the wscript will look like:
+
+	def options(opt):
+	        opt.tool_options('ndnx')
+
+	def configure(conf):
+		conf.load('compiler_c ndnx')
+
+	def build(bld):
+		bld(source='main.cpp', target='app', use='NDNX')
+
+Options are generated, in order to specify the location of ndnx includes/libraries.
+
+
+'''
+import sys, re
+from waflib import Utils, Logs, Errors, Options, ConfigSet
+from waflib.Configure import conf
+
+NDNX_DIR=['/usr','/usr/local','/opt/local','/sw']
+NDNX_VERSION_FILE='ccn/ccn.h'
+NDNX_VERSION_CODE='''
+#include <ccn/ccn.h>
+#include <stdio.h>
+int main() { printf ("%d.%d.%d", ((CCN_API_VERSION/100000) % 100), ((CCN_API_VERSION/1000) % 100), (CCN_API_VERSION % 1000)); return 0; }
+'''
+
+@conf
+def __ndnx_get_version_file(self,dir):
+	# Logs.pprint ('CYAN', '  + %s/%s/%s' % (dir, 'include', NDNX_VERSION_FILE))
+	try:
+		return self.root.find_dir(dir).find_node('%s/%s' % ('include', NDNX_VERSION_FILE))
+	except:
+		return None
+@conf
+def ndnx_get_version(self,dir):
+	val=self.check_cc(fragment=NDNX_VERSION_CODE,includes=['%s/%s' % (dir, 'include')],execute=True,define_ret = True, mandatory=True)
+	return val
+@conf
+def ndnx_get_root(self,*k,**kw):
+	root=Options.options.ndnx_dir or (k and k[0]) or kw.get('path',None)
+        
+	if root:
+                if self.__ndnx_get_version_file(root):
+                        return root
+		self.fatal('NDNx not found in %s'%root)
+                
+	for dir in NDNX_DIR:
+		if self.__ndnx_get_version_file(dir):
+			return dir
+        self.fatal('NDNx not found, please provide a --ndnx argument (see help)')
+
+@conf
+def check_openssl(self,*k,**kw):
+        root = k and k[0] or kw.get('path',None) or Options.options.openssl
+        mandatory = kw.get('mandatory', True)
+        var = kw.get('var', 'SSL')
+
+        CODE = """
+#include <openssl/crypto.h>
+#include <stdio.h>
+
+int main(int argc, char **argv) {
+	(void)argc;
+        printf ("%s", argv[0]);
+
+	return 0;
+}
+"""
+        if root:
+                testApp = self.check_cc (lib=['ssl', 'crypto'],
+                                         header_name='openssl/crypto.h',
+                                         define_name='HAVE_%s' % var,
+                                         uselib_store=var,
+                                         mandatory = mandatory,
+                                         cflags="-I%s/include" % root,
+                                         linkflags="-L%s/lib" % root,
+                                         execute = True, fragment = CODE, define_ret = True)
+        else:
+                testApp = libcrypto = self.check_cc (lib=['ssl', 'crypto'],
+                                                     header_name='openssl/crypto.h',
+                                                     define_name='HAVE_%s' % var,
+                                                     uselib_store=var,
+                                                     mandatory = mandatory,
+                                                     execute = True, fragment = CODE, define_ret = True)
+
+        if not testApp:
+                return
+
+        self.start_msg ('Checking if selected openssl matches NDNx')
+
+        ndn_var = kw.get('ndn_var', "NDNX")
+        if Utils.unversioned_sys_platform () == "darwin":
+                def otool (binary):
+                        p = Utils.subprocess.Popen (['/usr/bin/otool', '-L', binary], 
+                                                    stdout = Utils.subprocess.PIPE, )
+                        for line in p.communicate()[0].split ('\n'):
+                                if re.match ('.*/libcrypto\..*', line):
+                                        return line
+
+                selected_crypto = otool (testApp)
+                ccnd_crypto = otool ('%s/bin/ccnd' % self.env['%s_ROOT' % ndn_var])
+
+                if ccnd_crypto != selected_crypto:
+                        self.fatal ("Selected openssl does not match used to compile NDNx (%s != %s)" % 
+                                    (selected_crypto.strip (), ccnd_crypto.strip ()))
+                self.end_msg (True)
+
+        elif Utils.unversioned_sys_platform () == "linux" or  Utils.unversioned_sys_platform () == "freebsd":
+                def ldd (binary):
+                        p = Utils.subprocess.Popen (['/usr/bin/ldd', binary], 
+                                                        stdout = Utils.subprocess.PIPE, )
+                        for line in p.communicate()[0].split ('\n'):
+                                if re.match ('libcrypto\..*', line):
+                                        return line
+
+                selected_crypto = ldd (testApp)
+                ccnd_crypto = ldd ('%s/bin/ccnd' % self.env['%s_ROOT' % ndn_var])
+
+                if ccnd_crypto != selected_crypto:
+                        self.fatal ("Selected openssl does not match used to compile NDNx (%s != %s)" % 
+                                    (selected_crypto.strip (), ccnd_crypto.strip ()))
+                self.end_msg (True)
+        else:
+                self.end_msg ("Don't know how to check", 'YELLOW')
+
+@conf
+def check_ndnx(self,*k,**kw):
+	if not self.env['CC']:
+		self.fatal('load a c compiler first, conf.load("compiler_c")')
+
+	var=kw.get('uselib_store', 'NDNX')
+	self.start_msg('Checking for NDNx')
+	root = self.ndnx_get_root(*k,**kw);
+	self.env.NDNX_VERSION=self.ndnx_get_version(root)
+
+	self.env['INCLUDES_%s' % var]= '%s/%s' % (root, "include");
+	self.env['LIB_%s' % var] = "ccn"
+	self.env['LIBPATH_%s' % var] = '%s/%s' % (root, "lib")
+
+        self.env['%s_ROOT' % var] = root
+
+	self.end_msg("%s in %s " % (self.env.NDNX_VERSION, root))
+	if Logs.verbose:
+		Logs.pprint('CYAN','	NDNx include : %s'%self.env['INCLUDES_%s' % var])
+		Logs.pprint('CYAN','	NDNx lib     : %s'%self.env['LIB_%s' % var])
+		Logs.pprint('CYAN','	NDNx libpath : %s'%self.env['LIBPATH_%s' % var])
+
+def options(opt):
+        """
+        NDNx options
+        """
+        ndnopt = opt.add_option_group("NDNx Options")
+	ndnopt.add_option('--ndnx',type='string',default=None,dest='ndnx_dir',help='''path to where NDNx is installed, e.g. /usr/local''')
+        ndnopt.add_option('--openssl',type='string',default='',dest='openssl',help='''path to openssl, should be the same NDNx is compiled against''')
diff --git a/waf-tools/ns3.py b/waf-tools/ns3.py
deleted file mode 100644
index 8a1f33f..0000000
--- a/waf-tools/ns3.py
+++ /dev/null
@@ -1,71 +0,0 @@
-## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-import waflib
-from waflib.Configure import conf
-from waflib import Utils,Logs,Errors
-
-@conf
-def _print_optional_features(conf):
-    # Write a summary of optional features status
-    print "---- Summary of optional NS-3 features:"
-    Logs.pprint ('RED', "---- Summary of optional NS-3 features:")
-    # for (name, caption, was_enabled, reason_not_enabled) in conf.env['NS3_OPTIONAL_FEATURES']:
-    #     if was_enabled:
-    #         status = 'enabled'
-    #     else:
-    #         status = 'not enabled (%s)' % reason_not_enabled
-    #     print "%-30s: %s" % (caption, status)
-
-@conf
-def _check_dependencies(conf, required, mandatory):
-    # Logs.pprint ('CYAN', '  + %s' % required)
-    found = []
-    
-    libversion = "optimized"
-    if conf.options.ns3_debug:
-        libversion = "debug"
-    
-    for module in required:
-        retval = conf.check_cfg(package = 'libns3-dev-%s-%s' % (module, libversion),
-                                args='--cflags --libs', mandatory=mandatory,
-                                msg="Checking for ns3-%s" % module,
-                                uselib_store='NS3_%s' % module.upper())
-        # Logs.pprint ('CYAN', 'NS3_%s' % module.upper())
-        if not retval is None:
-            found.append(module)
-    import copy
-    if not 'NS3_MODULES_FOUND' in conf.env:
-        conf.env['NS3_MODULES_FOUND'] = []
-    conf.env['NS3_MODULES_FOUND'] = conf.env['NS3_MODULES_FOUND'] + copy.copy(found)
-
-def modules_uselib(bld, names):
-    return ['NS3_%s' % name.upper() for name in names] + \
-        ['NS3_LIBRARY_%s' % name.upper() for name in names] + \
-        ['NS3_HEADERS_%s' % name.upper() for name in names]
-
-def modules_found(bld, needed):
-    for module in needed:
-        if not module in bld.env['NS3_MODULES_FOUND']:
-            return False
-    return True
-
-@conf
-def check_modules(conf, modules, mandatory = True):
-    import os
-
-    if not 'NS3_CHECK_MODULE_ONCE' in conf.env:
-        conf.env['NS3_CHECK_MODULE_ONCE'] = ''
-
-        conf.check_cfg(atleast_pkgconfig_version='0.0.0')
-
-        if conf.options.log4cxx:
-            conf.env.append_value('DEFINES', 'NS3_LOG_ENABLE')
-
-    conf._check_dependencies(modules, mandatory)
-    conf._print_optional_features
-
-@conf
-def print_ns3_feature_summary(conf):
-    Logs.pprint ('CYAN', "---- Summary of optional NS-3 features:")
-    conf._print_optional_features
-
diff --git a/waf-tools/protobuf.py b/waf-tools/protobuf.py
deleted file mode 100644
index 684a945..0000000
--- a/waf-tools/protobuf.py
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-#! /usr/bin/env python
-# encoding: utf-8
-
-'''
-
-When using this tool, the wscript will look like:
-
-def options(opt):
-   opt.tool_options("protobuf", tooldir=["waf-tools"])
-
-def configure(conf):
-   conf.load("compiler_cxx protobuf")
-
-def build(bld):
-   bld(source="main.cpp", target="app", use="PROTOBUF")
-
-Options are generated, in order to specify the location of protobuf includes/libraries.
-
-'''
-
-from waflib import Utils, TaskGen, Task, Logs
-
-from waflib import Utils,Logs,Errors
-from waflib.Configure import conf
-
-def options(opt):
-    pass
-
-def configure(conf):
-    """
-    """
-    conf.check_cfg(package='protobuf', args=['--cflags', '--libs'], uselib_store='PROTOBUF', mandatory=True)
-
-    conf.find_program ('protoc', var='PROTOC', path_list = conf.env['PATH'], mandatory = True)
-
-@TaskGen.extension('.proto')
-def add_proto(self, node):
-    """
-    Compile PROTOBUF protocol specifications
-    """
-    prototask = self.create_task ("protobuf", node, node.change_ext (".pb"))
-    try:
-        self.compiled_tasks.append (prototask)
-    except AttributeError:
-        self.compiled_tasks = [prototask]
-
-class protobuf(Task.Task):
-    """
-    Task for compiling PROTOBUF protocol specifications
-    """
-    run_str = '${PROTOC} --cpp_out ${TGT[0].parent.abspath()} --proto_path ${SRC[0].parent.abspath()} ${SRC[0].abspath()} -o${TGT[0].abspath()}'
-    color   = 'BLUE'
-
-@TaskGen.feature('cxxshlib')
-@TaskGen.before_method('process_source')
-def dynamic_post(self):
-    if not getattr(self, 'dynamic_source', None):
-        return
-    self.source = Utils.to_list(self.source)
-
-    src = self.bld.path.get_bld().ant_glob (Utils.to_list(self.dynamic_source))
-
-    for cc in src:
-        # Signature for the source
-        cc.sig = Utils.h_file (cc.abspath())
-        # Signature for the header
-        h = cc.change_ext (".h")
-        h.sig = Utils.h_file (h.abspath())
-
-    self.source.extend (src)
