aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2021-01-01 11:30:03 -0800
committerGarrett D'Amore <garrett@damore.org>2021-01-01 12:46:17 -0800
commited542ac45e00c9b2faa0b41f3c00de6e291e5678 (patch)
tree673924ff077d468e6756529c2c204698d3faa47c
parent1413b2421a82cd9b9cde178d44fb60c7893176b0 (diff)
downloadnng-ed542ac45e00c9b2faa0b41f3c00de6e291e5678.tar.gz
nng-ed542ac45e00c9b2faa0b41f3c00de6e291e5678.tar.bz2
nng-ed542ac45e00c9b2faa0b41f3c00de6e291e5678.zip
fixes #1345 Restructure the source tree
This is not quite complete, but it sets the stage for other protocols (such as zmq or mqtt) to be added to the project.
-rw-r--r--CMakeLists.txt7
-rw-r--r--LICENSE.txt2
-rw-r--r--etc/README.adoc56
-rw-r--r--etc/pubrefman/README.adoc (renamed from tools/pubrefman/README.adoc)0
-rw-r--r--etc/pubrefman/go.mod (renamed from tools/pubrefman/go.mod)0
-rw-r--r--etc/pubrefman/go.sum (renamed from tools/pubrefman/go.sum)0
-rw-r--r--etc/pubrefman/pubrefman.go (renamed from tools/pubrefman/pubrefman.go)0
-rw-r--r--src/CMakeLists.txt19
-rw-r--r--src/compat/CMakeLists.txt12
-rw-r--r--src/sp/CMakeLists.txt13
-rw-r--r--src/sp/protocol/CMakeLists.txt (renamed from src/protocol/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/bus0/CMakeLists.txt (renamed from src/protocol/bus0/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/bus0/bug1247_test.c (renamed from src/protocol/bus0/bug1247_test.c)0
-rw-r--r--src/sp/protocol/bus0/bus.c (renamed from src/protocol/bus0/bus.c)0
-rw-r--r--src/sp/protocol/pair0/CMakeLists.txt (renamed from src/protocol/pair0/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/pair0/pair.c (renamed from src/protocol/pair0/pair.c)0
-rw-r--r--src/sp/protocol/pair1/CMakeLists.txt (renamed from src/protocol/pair1/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/pair1/pair.c (renamed from src/protocol/pair1/pair.c)0
-rw-r--r--src/sp/protocol/pair1/pair1_poly.c (renamed from src/protocol/pair1/pair1_poly.c)0
-rw-r--r--src/sp/protocol/pair1/pair1_poly_test.c (renamed from src/protocol/pair1/pair1_poly_test.c)0
-rw-r--r--src/sp/protocol/pair1/pair1_test.c (renamed from src/protocol/pair1/pair1_test.c)0
-rw-r--r--src/sp/protocol/pipeline0/CMakeLists.txt (renamed from src/protocol/pipeline0/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/pipeline0/pull.c (renamed from src/protocol/pipeline0/pull.c)0
-rw-r--r--src/sp/protocol/pipeline0/pull_test.c (renamed from src/protocol/pipeline0/pull_test.c)0
-rw-r--r--src/sp/protocol/pipeline0/push.c (renamed from src/protocol/pipeline0/push.c)0
-rw-r--r--src/sp/protocol/pipeline0/push_test.c (renamed from src/protocol/pipeline0/push_test.c)0
-rw-r--r--src/sp/protocol/pubsub0/CMakeLists.txt (renamed from src/protocol/pubsub0/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/pubsub0/pub.c (renamed from src/protocol/pubsub0/pub.c)0
-rw-r--r--src/sp/protocol/pubsub0/pub_test.c (renamed from src/protocol/pubsub0/pub_test.c)0
-rw-r--r--src/sp/protocol/pubsub0/sub.c (renamed from src/protocol/pubsub0/sub.c)0
-rw-r--r--src/sp/protocol/pubsub0/sub_test.c (renamed from src/protocol/pubsub0/sub_test.c)0
-rw-r--r--src/sp/protocol/pubsub0/xsub.c (renamed from src/protocol/pubsub0/xsub.c)0
-rw-r--r--src/sp/protocol/pubsub0/xsub_test.c (renamed from src/protocol/pubsub0/xsub_test.c)0
-rw-r--r--src/sp/protocol/reqrep0/CMakeLists.txt (renamed from src/protocol/reqrep0/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/reqrep0/rep.c (renamed from src/protocol/reqrep0/rep.c)0
-rw-r--r--src/sp/protocol/reqrep0/rep_test.c (renamed from src/protocol/reqrep0/rep_test.c)0
-rw-r--r--src/sp/protocol/reqrep0/req.c (renamed from src/protocol/reqrep0/req.c)0
-rw-r--r--src/sp/protocol/reqrep0/req_test.c (renamed from src/protocol/reqrep0/req_test.c)0
-rw-r--r--src/sp/protocol/reqrep0/xrep.c (renamed from src/protocol/reqrep0/xrep.c)0
-rw-r--r--src/sp/protocol/reqrep0/xrep_test.c (renamed from src/protocol/reqrep0/xrep_test.c)0
-rw-r--r--src/sp/protocol/reqrep0/xreq.c (renamed from src/protocol/reqrep0/xreq.c)0
-rw-r--r--src/sp/protocol/reqrep0/xreq_test.c (renamed from src/protocol/reqrep0/xreq_test.c)0
-rw-r--r--src/sp/protocol/survey0/CMakeLists.txt (renamed from src/protocol/survey0/CMakeLists.txt)0
-rw-r--r--src/sp/protocol/survey0/respond.c (renamed from src/protocol/survey0/respond.c)0
-rw-r--r--src/sp/protocol/survey0/respond_test.c (renamed from src/protocol/survey0/respond_test.c)0
-rw-r--r--src/sp/protocol/survey0/survey.c (renamed from src/protocol/survey0/survey.c)0
-rw-r--r--src/sp/protocol/survey0/survey_test.c (renamed from src/protocol/survey0/survey_test.c)0
-rw-r--r--src/sp/protocol/survey0/xrespond.c (renamed from src/protocol/survey0/xrespond.c)0
-rw-r--r--src/sp/protocol/survey0/xrespond_test.c (renamed from src/protocol/survey0/xrespond_test.c)0
-rw-r--r--src/sp/protocol/survey0/xsurvey.c (renamed from src/protocol/survey0/xsurvey.c)0
-rw-r--r--src/sp/protocol/survey0/xsurvey_test.c (renamed from src/protocol/survey0/xsurvey_test.c)0
-rw-r--r--src/sp/transport/CMakeLists.txt (renamed from src/transport/CMakeLists.txt)0
-rw-r--r--src/sp/transport/inproc/CMakeLists.txt (renamed from src/transport/inproc/CMakeLists.txt)0
-rw-r--r--src/sp/transport/inproc/inproc.c (renamed from src/transport/inproc/inproc.c)0
-rw-r--r--src/sp/transport/ipc/CMakeLists.txt (renamed from src/transport/ipc/CMakeLists.txt)0
-rw-r--r--src/sp/transport/ipc/ipc.c (renamed from src/transport/ipc/ipc.c)0
-rw-r--r--src/sp/transport/ipc/ipc_test.c (renamed from src/transport/ipc/ipc_test.c)0
-rw-r--r--src/sp/transport/tcp/CMakeLists.txt (renamed from src/transport/tcp/CMakeLists.txt)0
-rw-r--r--src/sp/transport/tcp/tcp.c (renamed from src/transport/tcp/tcp.c)0
-rw-r--r--src/sp/transport/tcp/tcp_test.c (renamed from src/transport/tcp/tcp_test.c)0
-rw-r--r--src/sp/transport/tls/CMakeLists.txt (renamed from src/transport/tls/CMakeLists.txt)0
-rw-r--r--src/sp/transport/tls/tls.c (renamed from src/transport/tls/tls.c)0
-rw-r--r--src/sp/transport/ws/CMakeLists.txt (renamed from src/transport/ws/CMakeLists.txt)0
-rw-r--r--src/sp/transport/ws/README.adoc (renamed from src/transport/ws/README.adoc)0
-rw-r--r--src/sp/transport/ws/websocket.c (renamed from src/transport/ws/websocket.c)0
-rw-r--r--src/sp/transport/ws/ws_test.c (renamed from src/transport/ws/ws_test.c)0
-rw-r--r--src/sp/transport/zerotier/CMakeLists.txt (renamed from src/transport/zerotier/CMakeLists.txt)0
-rw-r--r--src/sp/transport/zerotier/zerotier.c (renamed from src/transport/zerotier/zerotier.c)0
-rw-r--r--src/sp/transport/zerotier/zthash.c (renamed from src/transport/zerotier/zthash.c)0
-rw-r--r--src/sp/transport/zerotier/zthash.h (renamed from src/transport/zerotier/zthash.h)0
-rw-r--r--src/supplemental/CMakeLists.txt17
-rw-r--r--src/tools/CMakeLists.txt13
-rw-r--r--src/tools/nngcat/CMakeLists.txt (renamed from tools/nngcat/CMakeLists.txt)4
-rw-r--r--src/tools/nngcat/nngcat.c (renamed from tools/nngcat/nngcat.c)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_ambiguous_test.sh (renamed from tools/nngcat/nngcat_ambiguous_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_async_test.sh (renamed from tools/nngcat/nngcat_async_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_dup_proto_test.sh (renamed from tools/nngcat/nngcat_dup_proto_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_help_test.sh (renamed from tools/nngcat/nngcat_help_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_incompat_test.sh (renamed from tools/nngcat/nngcat_incompat_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_need_proto_test.sh (renamed from tools/nngcat/nngcat_need_proto_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_pubsub_test.sh (renamed from tools/nngcat/nngcat_pubsub_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_recvmaxsz_test.sh (renamed from tools/nngcat/nngcat_recvmaxsz_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_stdin_pipe_test.sh (renamed from tools/nngcat/nngcat_stdin_pipe_test.sh)0
-rwxr-xr-xsrc/tools/nngcat/nngcat_unlimited_test.sh (renamed from tools/nngcat/nngcat_unlimited_test.sh)0
-rw-r--r--src/tools/perf/CMakeLists.txt (renamed from perf/CMakeLists.txt)4
-rw-r--r--src/tools/perf/perf.c (renamed from perf/perf.c)0
-rw-r--r--src/tools/perf/pubdrop.c (renamed from perf/pubdrop.c)0
87 files changed, 82 insertions, 65 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f73e4e50..acd2a7f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+# Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
# Copyright (c) 2012 Martin Sustrik All rights reserved.
# Copyright (c) 2013 GoPivotal, Inc. All rights reserved.
# Copyright (c) 2015-2016 Jack R. Dunaway. All rights reserved.
@@ -253,15 +253,10 @@ add_subdirectory(src)
if (NNG_TESTS)
add_subdirectory(tests)
- add_subdirectory(perf)
endif ()
# Build the tools
-if (NNG_ENABLE_NNGCAT)
- add_subdirectory(tools/nngcat)
-endif ()
-
add_subdirectory(docs/man)
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
diff --git a/LICENSE.txt b/LICENSE.txt
index 67670eec..353da183 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,6 @@
The MIT License
-Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
Copyright 2018 Capitar IT Group BV <info@capitar.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/etc/README.adoc b/etc/README.adoc
index 06afa3fa..74723313 100644
--- a/etc/README.adoc
+++ b/etc/README.adoc
@@ -1,12 +1,9 @@
-About This Directory
-====================
+= About This Directory
This directory contains support files that I use for developing this
-project. I recommend others consider doing the same.
+project.
-
-Coding Style
-~~~~~~~~~~~~~~~~~~~~~~~~~
+== Coding Style
A clang-format configuration file is included in the project, you should
use that. (clang format requires that the style file live at the top of
@@ -17,55 +14,30 @@ the Convey framework has a style all it's own.
The style is based loosely on WebKit, but is really modified -- someday
if clang-format ever learns about BSD KNF I'll probably switch to that.
-Once upon a time this used uncrustify. However, the frequent breaking changes
-in uncrustify versions, and the fact that the latest (at this time 0.65) does
-not actually support one of the most common language constructs (extern "C"
-opening braces) has driven me towards clang-format. The good news is that
-this is probably actually easier for most folks to use.
-
-
-Sublime Text
-~~~~~~~~~~~~
+== Sublime Text
I've also arranged for Sublime text to understand that .h is C, not C++ (this
is important!)
+Having said that, these days I do most development on this project using CLion
+from JetBrains.
-ISO Standard C
-~~~~~~~~~~~~~~
+== ISO Standard C 99
-I've decided, after some gnashing of teeth, to finally accept that C99
-is here to stay. Therefore, I'm *not* spending any effort into supporting
-older C89/C90 compilers. That said I do understand that compiler support
-for C99 is not always complete. I will stick to the mainstream features,
-like <stdint.h>, the ability to use variadic macros, // comments, and perhaps
-the occasional use of for() locally scoped variables.
+This project uses C99. You may need to have modern compilers and
+a modern SDK. (Famously Windows Visual Studio releases older than
+2015 will either work poorly, or not at all.)
-We also insist that you have working vsnprintf, snprintf. Microsoft famously
-did not, or worse, had broken ones (that didn't guarantee NULL termination).
-Visual Studio 2015 reportedly fixes this. Building with older versions of
-Visual Studio for Microsoft platforms may leave you with some brittle code
-that could break in some bad ways -- use the latest to avoid this issue.
-(I'm not aware of any other platform with this kind of brain damage.)
+== Naming Conventions
-Naming Conventions
-~~~~~~~~~~~~~~~~~~
-
-Because not everyone wants to deal with CMake all the time, I anticipate that
-there will be folks who in the future want to just create one monster .c
-file that contains all these things, or even a .h that they just inline into
-their programmer. As vile as this idea seems to me, I can understand the
-motivations for it. In order to facilitate those cases, its important that
-all global symbols use names prefixed with nni_ or nng_ (or NNI_ or NNG_ for
-macro names). This is true even for static symbols that won't show up in
-a more conventional symbol table.
-
-We use nng_ (and NNG_) for symbols that are intended to be expoed to consumers.
+We use nng_ (and NNG_) for symbols that are intended to be exported to consumers.
These symbols form part of our public API.
We use nni_ and NNI_ for symbols that are *NOT* part of our public API and
should not be used by users.
+Statics may have any non-conflicting name.
+
Note that for the most part we try to avoid exposing structures directly to
users so that they don't get baked into binaries -- preferring instead to
dynamically allocate and give back an opaque pointer to the API. Any
diff --git a/tools/pubrefman/README.adoc b/etc/pubrefman/README.adoc
index a8929df9..a8929df9 100644
--- a/tools/pubrefman/README.adoc
+++ b/etc/pubrefman/README.adoc
diff --git a/tools/pubrefman/go.mod b/etc/pubrefman/go.mod
index b181f172..b181f172 100644
--- a/tools/pubrefman/go.mod
+++ b/etc/pubrefman/go.mod
diff --git a/tools/pubrefman/go.sum b/etc/pubrefman/go.sum
index 3d9237e3..3d9237e3 100644
--- a/tools/pubrefman/go.sum
+++ b/etc/pubrefman/go.sum
diff --git a/tools/pubrefman/pubrefman.go b/etc/pubrefman/pubrefman.go
index 9ed3f5af..9ed3f5af 100644
--- a/tools/pubrefman/pubrefman.go
+++ b/etc/pubrefman/pubrefman.go
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 57679309..20a7bef0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+# Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
# Copyright 2018 Capitar IT Group BV <info@capitar.com>
#
# This software is supplied under the terms of the MIT License, a
@@ -15,20 +15,11 @@ target_include_directories(nng PRIVATE ${PROJECT_SOURCE_DIR}/src)
target_include_directories(nng_testing PRIVATE ${PROJECT_SOURCE_DIR}/src)
add_subdirectory(core)
-
add_subdirectory(platform)
-add_subdirectory(compat/nanomsg)
-
-add_subdirectory(protocol)
-add_subdirectory(transport)
-
-add_subdirectory(supplemental/base64)
-add_subdirectory(supplemental/http)
-add_subdirectory(supplemental/sha1)
-add_subdirectory(supplemental/tls)
-add_subdirectory(supplemental/util)
-add_subdirectory(supplemental/websocket)
-
+add_subdirectory(compat)
+add_subdirectory(sp)
+add_subdirectory(supplemental)
+add_subdirectory(tools)
add_subdirectory(testing)
# When building shared libraries we prefer to suppress default symbol
diff --git a/src/compat/CMakeLists.txt b/src/compat/CMakeLists.txt
new file mode 100644
index 00000000..bf685e90
--- /dev/null
+++ b/src/compat/CMakeLists.txt
@@ -0,0 +1,12 @@
+#
+# Copyright 2021 Staysail Systems, Inc. <info@staystail.tech>
+#
+# This software is supplied under the terms of the MIT License, a
+# copy of which should be located in the distribution where this
+# file was obtained (LICENSE.txt). A copy of the license may also be
+# found online at https://opensource.org/licenses/MIT.
+#
+
+nng_directory(compat)
+
+add_subdirectory(nanomsg)
diff --git a/src/sp/CMakeLists.txt b/src/sp/CMakeLists.txt
new file mode 100644
index 00000000..b84952ee
--- /dev/null
+++ b/src/sp/CMakeLists.txt
@@ -0,0 +1,13 @@
+#
+# Copyright 2021 Staysail Systems, Inc. <info@staystail.tech>
+#
+# This software is supplied under the terms of the MIT License, a
+# copy of which should be located in the distribution where this
+# file was obtained (LICENSE.txt). A copy of the license may also be
+# found online at https://opensource.org/licenses/MIT.
+#
+
+nng_directory(sp)
+
+add_subdirectory(protocol)
+add_subdirectory(transport)
diff --git a/src/protocol/CMakeLists.txt b/src/sp/protocol/CMakeLists.txt
index fd480523..fd480523 100644
--- a/src/protocol/CMakeLists.txt
+++ b/src/sp/protocol/CMakeLists.txt
diff --git a/src/protocol/bus0/CMakeLists.txt b/src/sp/protocol/bus0/CMakeLists.txt
index 01c0b05b..01c0b05b 100644
--- a/src/protocol/bus0/CMakeLists.txt
+++ b/src/sp/protocol/bus0/CMakeLists.txt
diff --git a/src/protocol/bus0/bug1247_test.c b/src/sp/protocol/bus0/bug1247_test.c
index bbc6958b..bbc6958b 100644
--- a/src/protocol/bus0/bug1247_test.c
+++ b/src/sp/protocol/bus0/bug1247_test.c
diff --git a/src/protocol/bus0/bus.c b/src/sp/protocol/bus0/bus.c
index 9a610ac6..9a610ac6 100644
--- a/src/protocol/bus0/bus.c
+++ b/src/sp/protocol/bus0/bus.c
diff --git a/src/protocol/pair0/CMakeLists.txt b/src/sp/protocol/pair0/CMakeLists.txt
index b12583ab..b12583ab 100644
--- a/src/protocol/pair0/CMakeLists.txt
+++ b/src/sp/protocol/pair0/CMakeLists.txt
diff --git a/src/protocol/pair0/pair.c b/src/sp/protocol/pair0/pair.c
index 41f88c7c..41f88c7c 100644
--- a/src/protocol/pair0/pair.c
+++ b/src/sp/protocol/pair0/pair.c
diff --git a/src/protocol/pair1/CMakeLists.txt b/src/sp/protocol/pair1/CMakeLists.txt
index 12e12607..12e12607 100644
--- a/src/protocol/pair1/CMakeLists.txt
+++ b/src/sp/protocol/pair1/CMakeLists.txt
diff --git a/src/protocol/pair1/pair.c b/src/sp/protocol/pair1/pair.c
index ba497c42..ba497c42 100644
--- a/src/protocol/pair1/pair.c
+++ b/src/sp/protocol/pair1/pair.c
diff --git a/src/protocol/pair1/pair1_poly.c b/src/sp/protocol/pair1/pair1_poly.c
index 6c16745c..6c16745c 100644
--- a/src/protocol/pair1/pair1_poly.c
+++ b/src/sp/protocol/pair1/pair1_poly.c
diff --git a/src/protocol/pair1/pair1_poly_test.c b/src/sp/protocol/pair1/pair1_poly_test.c
index f26f7809..f26f7809 100644
--- a/src/protocol/pair1/pair1_poly_test.c
+++ b/src/sp/protocol/pair1/pair1_poly_test.c
diff --git a/src/protocol/pair1/pair1_test.c b/src/sp/protocol/pair1/pair1_test.c
index 881c4ac8..881c4ac8 100644
--- a/src/protocol/pair1/pair1_test.c
+++ b/src/sp/protocol/pair1/pair1_test.c
diff --git a/src/protocol/pipeline0/CMakeLists.txt b/src/sp/protocol/pipeline0/CMakeLists.txt
index 8a10eab7..8a10eab7 100644
--- a/src/protocol/pipeline0/CMakeLists.txt
+++ b/src/sp/protocol/pipeline0/CMakeLists.txt
diff --git a/src/protocol/pipeline0/pull.c b/src/sp/protocol/pipeline0/pull.c
index 616b0817..616b0817 100644
--- a/src/protocol/pipeline0/pull.c
+++ b/src/sp/protocol/pipeline0/pull.c
diff --git a/src/protocol/pipeline0/pull_test.c b/src/sp/protocol/pipeline0/pull_test.c
index 25066093..25066093 100644
--- a/src/protocol/pipeline0/pull_test.c
+++ b/src/sp/protocol/pipeline0/pull_test.c
diff --git a/src/protocol/pipeline0/push.c b/src/sp/protocol/pipeline0/push.c
index ad43d967..ad43d967 100644
--- a/src/protocol/pipeline0/push.c
+++ b/src/sp/protocol/pipeline0/push.c
diff --git a/src/protocol/pipeline0/push_test.c b/src/sp/protocol/pipeline0/push_test.c
index d22ccaa4..d22ccaa4 100644
--- a/src/protocol/pipeline0/push_test.c
+++ b/src/sp/protocol/pipeline0/push_test.c
diff --git a/src/protocol/pubsub0/CMakeLists.txt b/src/sp/protocol/pubsub0/CMakeLists.txt
index 160b7462..160b7462 100644
--- a/src/protocol/pubsub0/CMakeLists.txt
+++ b/src/sp/protocol/pubsub0/CMakeLists.txt
diff --git a/src/protocol/pubsub0/pub.c b/src/sp/protocol/pubsub0/pub.c
index e3d4f16a..e3d4f16a 100644
--- a/src/protocol/pubsub0/pub.c
+++ b/src/sp/protocol/pubsub0/pub.c
diff --git a/src/protocol/pubsub0/pub_test.c b/src/sp/protocol/pubsub0/pub_test.c
index a430b610..a430b610 100644
--- a/src/protocol/pubsub0/pub_test.c
+++ b/src/sp/protocol/pubsub0/pub_test.c
diff --git a/src/protocol/pubsub0/sub.c b/src/sp/protocol/pubsub0/sub.c
index 9f3f2283..9f3f2283 100644
--- a/src/protocol/pubsub0/sub.c
+++ b/src/sp/protocol/pubsub0/sub.c
diff --git a/src/protocol/pubsub0/sub_test.c b/src/sp/protocol/pubsub0/sub_test.c
index b830ae80..b830ae80 100644
--- a/src/protocol/pubsub0/sub_test.c
+++ b/src/sp/protocol/pubsub0/sub_test.c
diff --git a/src/protocol/pubsub0/xsub.c b/src/sp/protocol/pubsub0/xsub.c
index 0013b8b3..0013b8b3 100644
--- a/src/protocol/pubsub0/xsub.c
+++ b/src/sp/protocol/pubsub0/xsub.c
diff --git a/src/protocol/pubsub0/xsub_test.c b/src/sp/protocol/pubsub0/xsub_test.c
index 19815661..19815661 100644
--- a/src/protocol/pubsub0/xsub_test.c
+++ b/src/sp/protocol/pubsub0/xsub_test.c
diff --git a/src/protocol/reqrep0/CMakeLists.txt b/src/sp/protocol/reqrep0/CMakeLists.txt
index a3cecfd0..a3cecfd0 100644
--- a/src/protocol/reqrep0/CMakeLists.txt
+++ b/src/sp/protocol/reqrep0/CMakeLists.txt
diff --git a/src/protocol/reqrep0/rep.c b/src/sp/protocol/reqrep0/rep.c
index aa32d249..aa32d249 100644
--- a/src/protocol/reqrep0/rep.c
+++ b/src/sp/protocol/reqrep0/rep.c
diff --git a/src/protocol/reqrep0/rep_test.c b/src/sp/protocol/reqrep0/rep_test.c
index 5a47e67a..5a47e67a 100644
--- a/src/protocol/reqrep0/rep_test.c
+++ b/src/sp/protocol/reqrep0/rep_test.c
diff --git a/src/protocol/reqrep0/req.c b/src/sp/protocol/reqrep0/req.c
index cb3c9395..cb3c9395 100644
--- a/src/protocol/reqrep0/req.c
+++ b/src/sp/protocol/reqrep0/req.c
diff --git a/src/protocol/reqrep0/req_test.c b/src/sp/protocol/reqrep0/req_test.c
index fb78efa0..fb78efa0 100644
--- a/src/protocol/reqrep0/req_test.c
+++ b/src/sp/protocol/reqrep0/req_test.c
diff --git a/src/protocol/reqrep0/xrep.c b/src/sp/protocol/reqrep0/xrep.c
index 9737c600..9737c600 100644
--- a/src/protocol/reqrep0/xrep.c
+++ b/src/sp/protocol/reqrep0/xrep.c
diff --git a/src/protocol/reqrep0/xrep_test.c b/src/sp/protocol/reqrep0/xrep_test.c
index 6f1564eb..6f1564eb 100644
--- a/src/protocol/reqrep0/xrep_test.c
+++ b/src/sp/protocol/reqrep0/xrep_test.c
diff --git a/src/protocol/reqrep0/xreq.c b/src/sp/protocol/reqrep0/xreq.c
index bcb218bf..bcb218bf 100644
--- a/src/protocol/reqrep0/xreq.c
+++ b/src/sp/protocol/reqrep0/xreq.c
diff --git a/src/protocol/reqrep0/xreq_test.c b/src/sp/protocol/reqrep0/xreq_test.c
index 8c850cba..8c850cba 100644
--- a/src/protocol/reqrep0/xreq_test.c
+++ b/src/sp/protocol/reqrep0/xreq_test.c
diff --git a/src/protocol/survey0/CMakeLists.txt b/src/sp/protocol/survey0/CMakeLists.txt
index b5daca41..b5daca41 100644
--- a/src/protocol/survey0/CMakeLists.txt
+++ b/src/sp/protocol/survey0/CMakeLists.txt
diff --git a/src/protocol/survey0/respond.c b/src/sp/protocol/survey0/respond.c
index ad551c8f..ad551c8f 100644
--- a/src/protocol/survey0/respond.c
+++ b/src/sp/protocol/survey0/respond.c
diff --git a/src/protocol/survey0/respond_test.c b/src/sp/protocol/survey0/respond_test.c
index 51844c76..51844c76 100644
--- a/src/protocol/survey0/respond_test.c
+++ b/src/sp/protocol/survey0/respond_test.c
diff --git a/src/protocol/survey0/survey.c b/src/sp/protocol/survey0/survey.c
index ce1ed601..ce1ed601 100644
--- a/src/protocol/survey0/survey.c
+++ b/src/sp/protocol/survey0/survey.c
diff --git a/src/protocol/survey0/survey_test.c b/src/sp/protocol/survey0/survey_test.c
index 95d27adf..95d27adf 100644
--- a/src/protocol/survey0/survey_test.c
+++ b/src/sp/protocol/survey0/survey_test.c
diff --git a/src/protocol/survey0/xrespond.c b/src/sp/protocol/survey0/xrespond.c
index b2f203c3..b2f203c3 100644
--- a/src/protocol/survey0/xrespond.c
+++ b/src/sp/protocol/survey0/xrespond.c
diff --git a/src/protocol/survey0/xrespond_test.c b/src/sp/protocol/survey0/xrespond_test.c
index ec5e99a3..ec5e99a3 100644
--- a/src/protocol/survey0/xrespond_test.c
+++ b/src/sp/protocol/survey0/xrespond_test.c
diff --git a/src/protocol/survey0/xsurvey.c b/src/sp/protocol/survey0/xsurvey.c
index 2a198662..2a198662 100644
--- a/src/protocol/survey0/xsurvey.c
+++ b/src/sp/protocol/survey0/xsurvey.c
diff --git a/src/protocol/survey0/xsurvey_test.c b/src/sp/protocol/survey0/xsurvey_test.c
index f8e9d401..f8e9d401 100644
--- a/src/protocol/survey0/xsurvey_test.c
+++ b/src/sp/protocol/survey0/xsurvey_test.c
diff --git a/src/transport/CMakeLists.txt b/src/sp/transport/CMakeLists.txt
index add8a9c9..add8a9c9 100644
--- a/src/transport/CMakeLists.txt
+++ b/src/sp/transport/CMakeLists.txt
diff --git a/src/transport/inproc/CMakeLists.txt b/src/sp/transport/inproc/CMakeLists.txt
index 317686bb..317686bb 100644
--- a/src/transport/inproc/CMakeLists.txt
+++ b/src/sp/transport/inproc/CMakeLists.txt
diff --git a/src/transport/inproc/inproc.c b/src/sp/transport/inproc/inproc.c
index 84e2c625..84e2c625 100644
--- a/src/transport/inproc/inproc.c
+++ b/src/sp/transport/inproc/inproc.c
diff --git a/src/transport/ipc/CMakeLists.txt b/src/sp/transport/ipc/CMakeLists.txt
index c9927f75..c9927f75 100644
--- a/src/transport/ipc/CMakeLists.txt
+++ b/src/sp/transport/ipc/CMakeLists.txt
diff --git a/src/transport/ipc/ipc.c b/src/sp/transport/ipc/ipc.c
index efaa823c..efaa823c 100644
--- a/src/transport/ipc/ipc.c
+++ b/src/sp/transport/ipc/ipc.c
diff --git a/src/transport/ipc/ipc_test.c b/src/sp/transport/ipc/ipc_test.c
index 2fb4afa3..2fb4afa3 100644
--- a/src/transport/ipc/ipc_test.c
+++ b/src/sp/transport/ipc/ipc_test.c
diff --git a/src/transport/tcp/CMakeLists.txt b/src/sp/transport/tcp/CMakeLists.txt
index d6022329..d6022329 100644
--- a/src/transport/tcp/CMakeLists.txt
+++ b/src/sp/transport/tcp/CMakeLists.txt
diff --git a/src/transport/tcp/tcp.c b/src/sp/transport/tcp/tcp.c
index 524c6988..524c6988 100644
--- a/src/transport/tcp/tcp.c
+++ b/src/sp/transport/tcp/tcp.c
diff --git a/src/transport/tcp/tcp_test.c b/src/sp/transport/tcp/tcp_test.c
index d23227d7..d23227d7 100644
--- a/src/transport/tcp/tcp_test.c
+++ b/src/sp/transport/tcp/tcp_test.c
diff --git a/src/transport/tls/CMakeLists.txt b/src/sp/transport/tls/CMakeLists.txt
index 82f24c79..82f24c79 100644
--- a/src/transport/tls/CMakeLists.txt
+++ b/src/sp/transport/tls/CMakeLists.txt
diff --git a/src/transport/tls/tls.c b/src/sp/transport/tls/tls.c
index b6623733..b6623733 100644
--- a/src/transport/tls/tls.c
+++ b/src/sp/transport/tls/tls.c
diff --git a/src/transport/ws/CMakeLists.txt b/src/sp/transport/ws/CMakeLists.txt
index 6e409b43..6e409b43 100644
--- a/src/transport/ws/CMakeLists.txt
+++ b/src/sp/transport/ws/CMakeLists.txt
diff --git a/src/transport/ws/README.adoc b/src/sp/transport/ws/README.adoc
index e3101297..e3101297 100644
--- a/src/transport/ws/README.adoc
+++ b/src/sp/transport/ws/README.adoc
diff --git a/src/transport/ws/websocket.c b/src/sp/transport/ws/websocket.c
index 3f73f47f..3f73f47f 100644
--- a/src/transport/ws/websocket.c
+++ b/src/sp/transport/ws/websocket.c
diff --git a/src/transport/ws/ws_test.c b/src/sp/transport/ws/ws_test.c
index 7cbcd9d7..7cbcd9d7 100644
--- a/src/transport/ws/ws_test.c
+++ b/src/sp/transport/ws/ws_test.c
diff --git a/src/transport/zerotier/CMakeLists.txt b/src/sp/transport/zerotier/CMakeLists.txt
index 903b7f56..903b7f56 100644
--- a/src/transport/zerotier/CMakeLists.txt
+++ b/src/sp/transport/zerotier/CMakeLists.txt
diff --git a/src/transport/zerotier/zerotier.c b/src/sp/transport/zerotier/zerotier.c
index 896add29..896add29 100644
--- a/src/transport/zerotier/zerotier.c
+++ b/src/sp/transport/zerotier/zerotier.c
diff --git a/src/transport/zerotier/zthash.c b/src/sp/transport/zerotier/zthash.c
index ca46b373..ca46b373 100644
--- a/src/transport/zerotier/zthash.c
+++ b/src/sp/transport/zerotier/zthash.c
diff --git a/src/transport/zerotier/zthash.h b/src/sp/transport/zerotier/zthash.h
index 249eabbf..249eabbf 100644
--- a/src/transport/zerotier/zthash.h
+++ b/src/sp/transport/zerotier/zthash.h
diff --git a/src/supplemental/CMakeLists.txt b/src/supplemental/CMakeLists.txt
new file mode 100644
index 00000000..5be439b1
--- /dev/null
+++ b/src/supplemental/CMakeLists.txt
@@ -0,0 +1,17 @@
+#
+# Copyright 2021 Staysail Systems, Inc. <info@staystail.tech>
+#
+# This software is supplied under the terms of the MIT License, a
+# copy of which should be located in the distribution where this
+# file was obtained (LICENSE.txt). A copy of the license may also be
+# found online at https://opensource.org/licenses/MIT.
+#
+
+nng_directory(supplemental)
+
+add_subdirectory(base64)
+add_subdirectory(http)
+add_subdirectory(sha1)
+add_subdirectory(tls)
+add_subdirectory(util)
+add_subdirectory(websocket) \ No newline at end of file
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
new file mode 100644
index 00000000..0487d9ec
--- /dev/null
+++ b/src/tools/CMakeLists.txt
@@ -0,0 +1,13 @@
+#
+# Copyright 2021 Staysail Systems, Inc. <info@staystail.tech>
+#
+# This software is supplied under the terms of the MIT License, a
+# copy of which should be located in the distribution where this
+# file was obtained (LICENSE.txt). A copy of the license may also be
+# found online at https://opensource.org/licenses/MIT.
+#
+
+nng_directory(tools)
+
+add_subdirectory(nngcat)
+add_subdirectory(perf)
diff --git a/tools/nngcat/CMakeLists.txt b/src/tools/nngcat/CMakeLists.txt
index bd7327ac..d522a045 100644
--- a/tools/nngcat/CMakeLists.txt
+++ b/src/tools/nngcat/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+# Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
# Copyright 2018 Capitar IT Group BV <info@capitar.com>
#
# This software is supplied under the terms of the MIT License, a
@@ -8,6 +8,8 @@
# found online at https://opensource.org/licenses/MIT.
#
+nng_directory(nngcat)
+
if (NNG_ENABLE_NNGCAT)
add_executable(nngcat nngcat.c)
target_include_directories(nngcat PUBLIC ${PROJECT_SOURCE_DIR}/src)
diff --git a/tools/nngcat/nngcat.c b/src/tools/nngcat/nngcat.c
index 9e106069..9e106069 100644
--- a/tools/nngcat/nngcat.c
+++ b/src/tools/nngcat/nngcat.c
diff --git a/tools/nngcat/nngcat_ambiguous_test.sh b/src/tools/nngcat/nngcat_ambiguous_test.sh
index 414b6d19..414b6d19 100755
--- a/tools/nngcat/nngcat_ambiguous_test.sh
+++ b/src/tools/nngcat/nngcat_ambiguous_test.sh
diff --git a/tools/nngcat/nngcat_async_test.sh b/src/tools/nngcat/nngcat_async_test.sh
index 2b03e522..2b03e522 100755
--- a/tools/nngcat/nngcat_async_test.sh
+++ b/src/tools/nngcat/nngcat_async_test.sh
diff --git a/tools/nngcat/nngcat_dup_proto_test.sh b/src/tools/nngcat/nngcat_dup_proto_test.sh
index 1513d01c..1513d01c 100755
--- a/tools/nngcat/nngcat_dup_proto_test.sh
+++ b/src/tools/nngcat/nngcat_dup_proto_test.sh
diff --git a/tools/nngcat/nngcat_help_test.sh b/src/tools/nngcat/nngcat_help_test.sh
index 95ed9e3e..95ed9e3e 100755
--- a/tools/nngcat/nngcat_help_test.sh
+++ b/src/tools/nngcat/nngcat_help_test.sh
diff --git a/tools/nngcat/nngcat_incompat_test.sh b/src/tools/nngcat/nngcat_incompat_test.sh
index 128b57ba..128b57ba 100755
--- a/tools/nngcat/nngcat_incompat_test.sh
+++ b/src/tools/nngcat/nngcat_incompat_test.sh
diff --git a/tools/nngcat/nngcat_need_proto_test.sh b/src/tools/nngcat/nngcat_need_proto_test.sh
index d6733cad..d6733cad 100755
--- a/tools/nngcat/nngcat_need_proto_test.sh
+++ b/src/tools/nngcat/nngcat_need_proto_test.sh
diff --git a/tools/nngcat/nngcat_pubsub_test.sh b/src/tools/nngcat/nngcat_pubsub_test.sh
index b9ba90ed..b9ba90ed 100755
--- a/tools/nngcat/nngcat_pubsub_test.sh
+++ b/src/tools/nngcat/nngcat_pubsub_test.sh
diff --git a/tools/nngcat/nngcat_recvmaxsz_test.sh b/src/tools/nngcat/nngcat_recvmaxsz_test.sh
index b5d4ff4a..b5d4ff4a 100755
--- a/tools/nngcat/nngcat_recvmaxsz_test.sh
+++ b/src/tools/nngcat/nngcat_recvmaxsz_test.sh
diff --git a/tools/nngcat/nngcat_stdin_pipe_test.sh b/src/tools/nngcat/nngcat_stdin_pipe_test.sh
index 5fec0ab7..5fec0ab7 100755
--- a/tools/nngcat/nngcat_stdin_pipe_test.sh
+++ b/src/tools/nngcat/nngcat_stdin_pipe_test.sh
diff --git a/tools/nngcat/nngcat_unlimited_test.sh b/src/tools/nngcat/nngcat_unlimited_test.sh
index 0486b9b1..0486b9b1 100755
--- a/tools/nngcat/nngcat_unlimited_test.sh
+++ b/src/tools/nngcat/nngcat_unlimited_test.sh
diff --git a/perf/CMakeLists.txt b/src/tools/perf/CMakeLists.txt
index 778e583b..135544bb 100644
--- a/perf/CMakeLists.txt
+++ b/src/tools/perf/CMakeLists.txt
@@ -1,5 +1,5 @@
#
-# Copyright 2020 Staysail Systems, Inc. <info@staysail.tech>
+# Copyright 2021 Staysail Systems, Inc. <info@staysail.tech>
#
# This software is supplied under the terms of the MIT License, a
# copy of which should be located in the distribution where this
@@ -9,6 +9,8 @@
# Build performance tests.
+nng_directory(perf)
+
if (NNG_TESTS)
macro (add_nng_perf NAME)
add_executable (${NAME} perf.c)
diff --git a/perf/perf.c b/src/tools/perf/perf.c
index accac621..accac621 100644
--- a/perf/perf.c
+++ b/src/tools/perf/perf.c
diff --git a/perf/pubdrop.c b/src/tools/perf/pubdrop.c
index be51bb2f..be51bb2f 100644
--- a/perf/pubdrop.c
+++ b/src/tools/perf/pubdrop.c