You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ph...@apache.org on 2018/01/10 11:11:43 UTC

[01/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Repository: nifi-minifi-cpp
Updated Branches:
  refs/heads/master 0da444e9a -> a8703b5c7


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_publish.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_publish.c b/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_publish.c
new file mode 100644
index 0000000..a524940
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_publish.c
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTAsync.h"
+
+#if !defined(WIN32)
+#include <unistd.h>
+#else
+#include <windows.h>
+#endif
+
+#include <OsWrapper.h>
+
+#define ADDRESS     "tcp://m2m.eclipse.org:1883"
+#define CLIENTID    "ExampleClientPub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTAsync_token deliveredtoken;
+
+int finished = 0;
+
+void connlost(void *context, char *cause)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	int rc;
+
+	printf("\nConnection lost\n");
+	printf("     cause: %s\n", cause);
+
+	printf("Reconnecting\n");
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+ 		finished = 1;
+	}
+}
+
+
+void onDisconnect(void* context, MQTTAsync_successData* response)
+{
+	printf("Successful disconnection\n");
+	finished = 1;
+}
+
+
+void onSend(void* context, MQTTAsync_successData* response)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_disconnectOptions opts = MQTTAsync_disconnectOptions_initializer;
+	int rc;
+
+	printf("Message with token value %d delivery confirmed\n", response->token);
+
+	opts.onSuccess = onDisconnect;
+	opts.context = client;
+
+	if ((rc = MQTTAsync_disconnect(client, &opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start sendMessage, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+void onConnectFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Connect failed, rc %d\n", response ? response->code : 0);
+	finished = 1;
+}
+
+
+void onConnect(void* context, MQTTAsync_successData* response)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_responseOptions opts = MQTTAsync_responseOptions_initializer;
+	MQTTAsync_message pubmsg = MQTTAsync_message_initializer;
+	int rc;
+
+	printf("Successful connection\n");
+	
+	opts.onSuccess = onSend;
+	opts.context = client;
+
+	pubmsg.payload = PAYLOAD;
+	pubmsg.payloadlen = strlen(PAYLOAD);
+	pubmsg.qos = QOS;
+	pubmsg.retained = 0;
+	deliveredtoken = 0;
+
+	if ((rc = MQTTAsync_sendMessage(client, TOPIC, &pubmsg, &opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start sendMessage, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+int main(int argc, char* argv[])
+{
+	MQTTAsync client;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	int rc;
+
+	MQTTAsync_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL);
+
+	MQTTAsync_setCallbacks(client, NULL, connlost, NULL, NULL);
+
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	conn_opts.onSuccess = onConnect;
+	conn_opts.onFailure = onConnectFailure;
+	conn_opts.context = client;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+
+	printf("Waiting for publication of %s\n"
+         "on topic %s for client with ClientID: %s\n",
+         PAYLOAD, TOPIC, CLIENTID);
+	while (!finished)
+		#if defined(WIN32)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+	MQTTAsync_destroy(&client);
+ 	return rc;
+}
+  

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_subscribe.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_subscribe.c b/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_subscribe.c
new file mode 100644
index 0000000..d0a01f8
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/MQTTAsync_subscribe.c
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTAsync.h"
+
+#if !defined(WIN32)
+#include <unistd.h>
+#else
+#include <windows.h>
+#endif
+
+#include <OsWrapper.h>
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientSub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTAsync_token deliveredtoken;
+
+int disc_finished = 0;
+int subscribed = 0;
+int finished = 0;
+
+void connlost(void *context, char *cause)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	int rc;
+
+	printf("\nConnection lost\n");
+	if (cause)
+		printf("     cause: %s\n", cause);
+
+	printf("Reconnecting\n");
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		finished = 1;
+	}
+}
+
+
+int msgarrvd(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
+{
+    int i;
+    char* payloadptr;
+
+    printf("Message arrived\n");
+    printf("     topic: %s\n", topicName);
+    printf("   message: ");
+
+    payloadptr = message->payload;
+    for(i=0; i<message->payloadlen; i++)
+    {
+        putchar(*payloadptr++);
+    }
+    putchar('\n');
+    MQTTAsync_freeMessage(&message);
+    MQTTAsync_free(topicName);
+    return 1;
+}
+
+
+void onDisconnect(void* context, MQTTAsync_successData* response)
+{
+	printf("Successful disconnection\n");
+	disc_finished = 1;
+}
+
+
+void onSubscribe(void* context, MQTTAsync_successData* response)
+{
+	printf("Subscribe succeeded\n");
+	subscribed = 1;
+}
+
+void onSubscribeFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Subscribe failed, rc %d\n", response ? response->code : 0);
+	finished = 1;
+}
+
+
+void onConnectFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Connect failed, rc %d\n", response ? response->code : 0);
+	finished = 1;
+}
+
+
+void onConnect(void* context, MQTTAsync_successData* response)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_responseOptions opts = MQTTAsync_responseOptions_initializer;
+	int rc;
+
+	printf("Successful connection\n");
+
+	printf("Subscribing to topic %s\nfor client %s using QoS%d\n\n"
+           "Press Q<Enter> to quit\n\n", TOPIC, CLIENTID, QOS);
+	opts.onSuccess = onSubscribe;
+	opts.onFailure = onSubscribeFailure;
+	opts.context = client;
+
+	deliveredtoken = 0;
+
+	if ((rc = MQTTAsync_subscribe(client, TOPIC, QOS, &opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start subscribe, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+int main(int argc, char* argv[])
+{
+	MQTTAsync client;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	MQTTAsync_disconnectOptions disc_opts = MQTTAsync_disconnectOptions_initializer;
+	int rc;
+	int ch;
+
+	MQTTAsync_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL);
+
+	MQTTAsync_setCallbacks(client, client, connlost, msgarrvd, NULL);
+
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	conn_opts.onSuccess = onConnect;
+	conn_opts.onFailure = onConnectFailure;
+	conn_opts.context = client;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+
+	while	(!subscribed)
+		#if defined(WIN32)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+	if (finished)
+		goto exit;
+
+	do 
+	{
+		ch = getchar();
+	} while (ch!='Q' && ch != 'q');
+
+	disc_opts.onSuccess = onDisconnect;
+	if ((rc = MQTTAsync_disconnect(client, &disc_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start disconnect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+ 	while	(!disc_finished)
+		#if defined(WIN32)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+exit:
+	MQTTAsync_destroy(&client);
+ 	return rc;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish.c b/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish.c
new file mode 100644
index 0000000..fc71417
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish.c
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTClient.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientPub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+int main(int argc, char* argv[])
+{
+    MQTTClient client;
+    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+    MQTTClient_message pubmsg = MQTTClient_message_initializer;
+    MQTTClient_deliveryToken token;
+    int rc;
+
+    MQTTClient_create(&client, ADDRESS, CLIENTID,
+        MQTTCLIENT_PERSISTENCE_NONE, NULL);
+    conn_opts.keepAliveInterval = 20;
+    conn_opts.cleansession = 1;
+
+    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
+    {
+        printf("Failed to connect, return code %d\n", rc);
+        exit(EXIT_FAILURE);
+    }
+    pubmsg.payload = PAYLOAD;
+    pubmsg.payloadlen = strlen(PAYLOAD);
+    pubmsg.qos = QOS;
+    pubmsg.retained = 0;
+    MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token);
+    printf("Waiting for up to %d seconds for publication of %s\n"
+            "on topic %s for client with ClientID: %s\n",
+            (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID);
+    rc = MQTTClient_waitForCompletion(client, token, TIMEOUT);
+    printf("Message with delivery token %d delivered\n", token);
+    MQTTClient_disconnect(client, 10000);
+    MQTTClient_destroy(&client);
+    return rc;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish_async.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish_async.c b/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish_async.c
new file mode 100644
index 0000000..7784349
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/MQTTClient_publish_async.c
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTClient.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientPub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTClient_deliveryToken deliveredtoken;
+
+void delivered(void *context, MQTTClient_deliveryToken dt)
+{
+    printf("Message with token value %d delivery confirmed\n", dt);
+    deliveredtoken = dt;
+}
+
+int msgarrvd(void *context, char *topicName, int topicLen, MQTTClient_message *message)
+{
+    int i;
+    char* payloadptr;
+
+    printf("Message arrived\n");
+    printf("     topic: %s\n", topicName);
+    printf("   message: ");
+
+    payloadptr = message->payload;
+    for(i=0; i<message->payloadlen; i++)
+    {
+        putchar(*payloadptr++);
+    }
+    putchar('\n');
+    MQTTClient_freeMessage(&message);
+    MQTTClient_free(topicName);
+    return 1;
+}
+
+void connlost(void *context, char *cause)
+{
+    printf("\nConnection lost\n");
+    printf("     cause: %s\n", cause);
+}
+
+int main(int argc, char* argv[])
+{
+    MQTTClient client;
+    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+    MQTTClient_message pubmsg = MQTTClient_message_initializer;
+    MQTTClient_deliveryToken token;
+    int rc;
+
+    MQTTClient_create(&client, ADDRESS, CLIENTID,
+        MQTTCLIENT_PERSISTENCE_NONE, NULL);
+    conn_opts.keepAliveInterval = 20;
+    conn_opts.cleansession = 1;
+
+    MQTTClient_setCallbacks(client, NULL, connlost, msgarrvd, delivered);
+
+    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
+    {
+        printf("Failed to connect, return code %d\n", rc);
+        exit(EXIT_FAILURE);
+    }
+    pubmsg.payload = PAYLOAD;
+    pubmsg.payloadlen = (int)strlen(PAYLOAD);
+    pubmsg.qos = QOS;
+    pubmsg.retained = 0;
+    deliveredtoken = 0;
+    MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token);
+    printf("Waiting for publication of %s\n"
+            "on topic %s for client with ClientID: %s\n",
+            PAYLOAD, TOPIC, CLIENTID);
+    while(deliveredtoken != token);
+    MQTTClient_disconnect(client, 10000);
+    MQTTClient_destroy(&client);
+    return rc;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/MQTTClient_subscribe.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/MQTTClient_subscribe.c b/thirdparty/paho.mqtt.c/src/samples/MQTTClient_subscribe.c
new file mode 100644
index 0000000..c675ecc
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/MQTTClient_subscribe.c
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTClient.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientSub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTClient_deliveryToken deliveredtoken;
+
+void delivered(void *context, MQTTClient_deliveryToken dt)
+{
+    printf("Message with token value %d delivery confirmed\n", dt);
+    deliveredtoken = dt;
+}
+
+int msgarrvd(void *context, char *topicName, int topicLen, MQTTClient_message *message)
+{
+    int i;
+    char* payloadptr;
+
+    printf("Message arrived\n");
+    printf("     topic: %s\n", topicName);
+    printf("   message: ");
+
+    payloadptr = message->payload;
+    for(i=0; i<message->payloadlen; i++)
+    {
+        putchar(*payloadptr++);
+    }
+    putchar('\n');
+    MQTTClient_freeMessage(&message);
+    MQTTClient_free(topicName);
+    return 1;
+}
+
+void connlost(void *context, char *cause)
+{
+    printf("\nConnection lost\n");
+    printf("     cause: %s\n", cause);
+}
+
+int main(int argc, char* argv[])
+{
+    MQTTClient client;
+    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+    int rc;
+    int ch;
+
+    MQTTClient_create(&client, ADDRESS, CLIENTID,
+        MQTTCLIENT_PERSISTENCE_NONE, NULL);
+    conn_opts.keepAliveInterval = 20;
+    conn_opts.cleansession = 1;
+
+    MQTTClient_setCallbacks(client, NULL, connlost, msgarrvd, delivered);
+
+    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
+    {
+        printf("Failed to connect, return code %d\n", rc);
+        exit(EXIT_FAILURE);
+    }
+    printf("Subscribing to topic %s\nfor client %s using QoS%d\n\n"
+           "Press Q<Enter> to quit\n\n", TOPIC, CLIENTID, QOS);
+    MQTTClient_subscribe(client, TOPIC, QOS);
+
+    do 
+    {
+        ch = getchar();
+    } while(ch!='Q' && ch != 'q');
+
+    MQTTClient_unsubscribe(client, TOPIC);
+    MQTTClient_disconnect(client, 10000);
+    MQTTClient_destroy(&client);
+    return rc;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/paho_c_pub.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/paho_c_pub.c b/thirdparty/paho.mqtt.c/src/samples/paho_c_pub.c
new file mode 100644
index 0000000..1a4040d
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/paho_c_pub.c
@@ -0,0 +1,379 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2016 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *    Guilherme Maciel Ferreira - add keep alive option
+ *******************************************************************************/
+
+ /*
+ stdin publisher
+
+ compulsory parameters:
+
+  --topic topic to publish on
+
+ defaulted parameters:
+
+	--host localhost
+	--port 1883
+	--qos 0
+	--delimiters \n
+	--clientid stdin-publisher-async
+	--maxdatalen 100
+	--keepalive 10
+
+	--userid none
+	--password none
+
+*/
+
+#include "MQTTAsync.h"
+
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined(WIN32)
+#include <windows.h>
+#define sleep Sleep
+#else
+#include <unistd.h>
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#include <OsWrapper.h>
+
+volatile int toStop = 0;
+
+
+struct
+{
+	char* clientid;
+	char* delimiter;
+	int maxdatalen;
+	int qos;
+	int retained;
+	char* username;
+	char* password;
+	char* host;
+	char* port;
+	int verbose;
+	int keepalive;
+} opts =
+{
+	"stdin-publisher-async", "\n", 100, 0, 0, NULL, NULL, "localhost", "1883", 0, 10
+};
+
+
+void usage(void)
+{
+	printf("MQTT stdin publisher\n");
+	printf("Usage: stdinpub topicname <options>, where options are:\n");
+	printf("  --host <hostname> (default is %s)\n", opts.host);
+	printf("  --port <port> (default is %s)\n", opts.port);
+	printf("  --qos <qos> (default is %d)\n", opts.qos);
+	printf("  --retained (default is %s)\n", opts.retained ? "on" : "off");
+	printf("  --delimiter <delim> (default is \\n)\n");
+	printf("  --clientid <clientid> (default is %s)\n", opts.clientid);
+	printf("  --maxdatalen <bytes> (default is %d)\n", opts.maxdatalen);
+	printf("  --username none\n");
+	printf("  --password none\n");
+	printf("  --keepalive <seconds> (default is 10 seconds)\n");
+	exit(EXIT_FAILURE);
+}
+
+
+
+void cfinish(int sig)
+{
+	signal(SIGINT, NULL);
+	toStop = 1;
+}
+
+void getopts(int argc, char** argv);
+
+int messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* m)
+{
+	/* not expecting any messages */
+	return 1;
+}
+
+
+static int disconnected = 0;
+
+void onDisconnect(void* context, MQTTAsync_successData* response)
+{
+	disconnected = 1;
+}
+
+
+static int connected = 0;
+void myconnect(MQTTAsync* client);
+
+void onConnectFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Connect failed, rc %d\n", response ? response->code : -1);
+	connected = -1;
+
+	MQTTAsync client = (MQTTAsync)context;
+	myconnect(client);
+}
+
+
+void onConnect(void* context, MQTTAsync_successData* response)
+{
+	printf("Connected\n");
+	connected = 1;
+}
+
+void myconnect(MQTTAsync* client)
+{
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	MQTTAsync_SSLOptions ssl_opts = MQTTAsync_SSLOptions_initializer;
+	int rc = 0;
+
+	printf("Connecting\n");
+	conn_opts.keepAliveInterval = opts.keepalive;
+	conn_opts.cleansession = 1;
+	conn_opts.username = opts.username;
+	conn_opts.password = opts.password;
+	conn_opts.onSuccess = onConnect;
+	conn_opts.onFailure = onConnectFailure;
+	conn_opts.context = client;
+	ssl_opts.enableServerCertAuth = 0;
+	conn_opts.ssl = &ssl_opts;
+	conn_opts.automaticReconnect = 1;
+	connected = 0;
+	if ((rc = MQTTAsync_connect(*client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+static int published = 0;
+
+void onPublishFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Publish failed, rc %d\n", response ? -1 : response->code);
+	published = -1;
+}
+
+
+void onPublish(void* context, MQTTAsync_successData* response)
+{
+	published = 1;
+}
+
+
+void connectionLost(void* context, char* cause)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	MQTTAsync_SSLOptions ssl_opts = MQTTAsync_SSLOptions_initializer;
+	int rc = 0;
+
+	printf("Connecting\n");
+	conn_opts.keepAliveInterval = 10;
+	conn_opts.cleansession = 1;
+	conn_opts.username = opts.username;
+	conn_opts.password = opts.password;
+	conn_opts.onSuccess = onConnect;
+	conn_opts.onFailure = onConnectFailure;
+	conn_opts.context = client;
+	ssl_opts.enableServerCertAuth = 0;
+	conn_opts.ssl = &ssl_opts;
+	connected = 0;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+int main(int argc, char** argv)
+{
+	MQTTAsync_disconnectOptions disc_opts = MQTTAsync_disconnectOptions_initializer;
+	MQTTAsync_responseOptions pub_opts = MQTTAsync_responseOptions_initializer;
+	MQTTAsync_createOptions create_opts = MQTTAsync_createOptions_initializer;
+	MQTTAsync client;
+	char* topic = NULL;
+	char* buffer = NULL;
+	int rc = 0;
+	char url[100];
+
+	if (argc < 2)
+		usage();
+
+	getopts(argc, argv);
+
+	sprintf(url, "%s:%s", opts.host, opts.port);
+	if (opts.verbose)
+		printf("URL is %s\n", url);
+
+	topic = argv[1];
+	printf("Using topic %s\n", topic);
+
+	create_opts.sendWhileDisconnected = 1;
+	rc = MQTTAsync_createWithOptions(&client, url, opts.clientid, MQTTCLIENT_PERSISTENCE_NONE, NULL, &create_opts);
+
+	signal(SIGINT, cfinish);
+	signal(SIGTERM, cfinish);
+
+	rc = MQTTAsync_setCallbacks(client, client, connectionLost, messageArrived, NULL);
+
+	myconnect(&client);
+
+	buffer = malloc(opts.maxdatalen);
+
+	while (!toStop)
+	{
+		int data_len = 0;
+		int delim_len = 0;
+
+		delim_len = (int)strlen(opts.delimiter);
+		do
+		{
+			buffer[data_len++] = getchar();
+			if (data_len > delim_len)
+			{
+			/* printf("comparing %s %s\n", opts.delimiter, &buffer[data_len - delim_len]); */
+			if (strncmp(opts.delimiter, &buffer[data_len - delim_len], delim_len) == 0)
+				break;
+			}
+		} while (data_len < opts.maxdatalen);
+
+		if (opts.verbose)
+				printf("Publishing data of length %d\n", data_len);
+		pub_opts.onSuccess = onPublish;
+		pub_opts.onFailure = onPublishFailure;
+		do
+		{
+			rc = MQTTAsync_send(client, topic, data_len, buffer, opts.qos, opts.retained, &pub_opts);
+		}
+		while (rc != MQTTASYNC_SUCCESS);
+	}
+
+	printf("Stopping\n");
+
+	free(buffer);
+
+	disc_opts.onSuccess = onDisconnect;
+	if ((rc = MQTTAsync_disconnect(client, &disc_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start disconnect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+
+	while	(!disconnected)
+		#if defined(WIN32)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+	MQTTAsync_destroy(&client);
+
+	return EXIT_SUCCESS;
+}
+
+void getopts(int argc, char** argv)
+{
+	int count = 2;
+
+	while (count < argc)
+	{
+		if (strcmp(argv[count], "--retained") == 0)
+			opts.retained = 1;
+		if (strcmp(argv[count], "--verbose") == 0)
+			opts.verbose = 1;
+		else if (strcmp(argv[count], "--qos") == 0)
+		{
+			if (++count < argc)
+			{
+				if (strcmp(argv[count], "0") == 0)
+					opts.qos = 0;
+				else if (strcmp(argv[count], "1") == 0)
+					opts.qos = 1;
+				else if (strcmp(argv[count], "2") == 0)
+					opts.qos = 2;
+				else
+					usage();
+			}
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--host") == 0)
+		{
+			if (++count < argc)
+				opts.host = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--port") == 0)
+		{
+			if (++count < argc)
+				opts.port = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--clientid") == 0)
+		{
+			if (++count < argc)
+				opts.clientid = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--username") == 0)
+		{
+			if (++count < argc)
+				opts.username = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--password") == 0)
+		{
+			if (++count < argc)
+				opts.password = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--maxdatalen") == 0)
+		{
+			if (++count < argc)
+				opts.maxdatalen = atoi(argv[count]);
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--delimiter") == 0)
+		{
+			if (++count < argc)
+				opts.delimiter = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--keepalive") == 0)
+		{
+			if (++count < argc)
+				opts.keepalive = atoi(argv[count]);
+			else
+				usage();
+		}
+		count++;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/paho_c_sub.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/paho_c_sub.c b/thirdparty/paho.mqtt.c/src/samples/paho_c_sub.c
new file mode 100644
index 0000000..bbb5edd
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/paho_c_sub.c
@@ -0,0 +1,359 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *    Ian Craggs - fix for bug 413429 - connectionLost not called
+ *    Guilherme Maciel Ferreira - add keep alive option
+ *******************************************************************************/
+
+/*
+
+ stdout subscriber for the asynchronous client
+
+ compulsory parameters:
+
+  --topic topic to subscribe to
+
+ defaulted parameters:
+
+	--host localhost
+	--port 1883
+	--qos 2
+	--delimiter \n
+	--clientid stdout-subscriber-async
+	--showtopics off
+	--keepalive 10
+
+	--userid none
+	--password none
+
+*/
+
+#include "MQTTAsync.h"
+#include "MQTTClientPersistence.h"
+
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <stdlib.h>
+
+
+#if defined(WIN32)
+#include <windows.h>
+#define sleep Sleep
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+#include <OsWrapper.h>
+
+volatile int finished = 0;
+char* topic = NULL;
+int subscribed = 0;
+int disconnected = 0;
+
+
+void cfinish(int sig)
+{
+	signal(SIGINT, NULL);
+	finished = 1;
+}
+
+
+struct
+{
+	char* clientid;
+	int nodelimiter;
+	char delimiter;
+	int qos;
+	char* username;
+	char* password;
+	char* host;
+	char* port;
+	int showtopics;
+	int keepalive;
+} opts =
+{
+	"stdout-subscriber-async", 1, '\n', 2, NULL, NULL, "localhost", "1883", 0, 10
+};
+
+
+void usage(void)
+{
+	printf("MQTT stdout subscriber\n");
+	printf("Usage: stdoutsub topicname <options>, where options are:\n");
+	printf("  --host <hostname> (default is %s)\n", opts.host);
+	printf("  --port <port> (default is %s)\n", opts.port);
+	printf("  --qos <qos> (default is %d)\n", opts.qos);
+	printf("  --delimiter <delim> (default is no delimiter)\n");
+	printf("  --clientid <clientid> (default is %s)\n", opts.clientid);
+	printf("  --username none\n");
+	printf("  --password none\n");
+	printf("  --showtopics <on or off> (default is on if the topic has a wildcard, else off)\n");
+	printf("  --keepalive <seconds> (default is 10 seconds)\n");
+	exit(EXIT_FAILURE);
+}
+
+
+void getopts(int argc, char** argv)
+{
+	int count = 2;
+
+	while (count < argc)
+	{
+		if (strcmp(argv[count], "--qos") == 0)
+		{
+			if (++count < argc)
+			{
+				if (strcmp(argv[count], "0") == 0)
+					opts.qos = 0;
+				else if (strcmp(argv[count], "1") == 0)
+					opts.qos = 1;
+				else if (strcmp(argv[count], "2") == 0)
+					opts.qos = 2;
+				else
+					usage();
+			}
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--host") == 0)
+		{
+			if (++count < argc)
+				opts.host = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--port") == 0)
+		{
+			if (++count < argc)
+				opts.port = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--clientid") == 0)
+		{
+			if (++count < argc)
+				opts.clientid = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--username") == 0)
+		{
+			if (++count < argc)
+				opts.username = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--password") == 0)
+		{
+			if (++count < argc)
+				opts.password = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--delimiter") == 0)
+		{
+			if (++count < argc)
+			{
+				if (strcmp("newline", argv[count]) == 0)
+					opts.delimiter = '\n';
+				else
+					opts.delimiter = argv[count][0];
+				opts.nodelimiter = 0;
+			}
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--showtopics") == 0)
+		{
+			if (++count < argc)
+			{
+				if (strcmp(argv[count], "on") == 0)
+					opts.showtopics = 1;
+				else if (strcmp(argv[count], "off") == 0)
+					opts.showtopics = 0;
+				else
+					usage();
+			}
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--keepalive") == 0)
+		{
+			if (++count < argc)
+				opts.keepalive = atoi(argv[count]);
+			else
+				usage();
+		}
+		count++;
+	}
+
+}
+
+
+int messageArrived(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
+{
+	if (opts.showtopics)
+		printf("%s\t", topicName);
+	if (opts.nodelimiter)
+		printf("%.*s", message->payloadlen, (char*)message->payload);
+	else
+		printf("%.*s%c", message->payloadlen, (char*)message->payload, opts.delimiter);
+	fflush(stdout);
+	MQTTAsync_freeMessage(&message);
+	MQTTAsync_free(topicName);
+	return 1;
+}
+
+
+void onDisconnect(void* context, MQTTAsync_successData* response)
+{
+	disconnected = 1;
+}
+
+
+void onSubscribe(void* context, MQTTAsync_successData* response)
+{
+	subscribed = 1;
+}
+
+
+void onSubscribeFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Subscribe failed, rc %d\n", response->code);
+	finished = 1;
+}
+
+
+void onConnectFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Connect failed, rc %d\n", response ? response->code : -99);
+	finished = 1;
+}
+
+
+void onConnect(void* context, MQTTAsync_successData* response)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_responseOptions ropts = MQTTAsync_responseOptions_initializer;
+	int rc;
+
+	if (opts.showtopics)
+		printf("Subscribing to topic %s with client %s at QoS %d\n", topic, opts.clientid, opts.qos);
+
+	ropts.onSuccess = onSubscribe;
+	ropts.onFailure = onSubscribeFailure;
+	ropts.context = client;
+	if ((rc = MQTTAsync_subscribe(client, topic, opts.qos, &ropts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start subscribe, return code %d\n", rc);
+		finished = 1;
+	}
+}
+
+
+MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+
+
+void connectionLost(void *context, char *cause)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	int rc;
+
+	printf("connectionLost called\n");
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start reconnect, return code %d\n", rc);
+		finished = 1;
+	}
+}
+
+
+int main(int argc, char** argv)
+{
+	MQTTAsync client;
+	MQTTAsync_disconnectOptions disc_opts = MQTTAsync_disconnectOptions_initializer;
+	int rc = 0;
+	char url[100];
+
+	if (argc < 2)
+		usage();
+
+	topic = argv[1];
+
+	if (strchr(topic, '#') || strchr(topic, '+'))
+		opts.showtopics = 1;
+	if (opts.showtopics)
+		printf("topic is %s\n", topic);
+
+	getopts(argc, argv);
+	sprintf(url, "%s:%s", opts.host, opts.port);
+
+	rc = MQTTAsync_create(&client, url, opts.clientid, MQTTCLIENT_PERSISTENCE_NONE, NULL);
+
+	MQTTAsync_setCallbacks(client, client, connectionLost, messageArrived, NULL);
+
+	signal(SIGINT, cfinish);
+	signal(SIGTERM, cfinish);
+
+	conn_opts.keepAliveInterval = opts.keepalive;
+	conn_opts.cleansession = 1;
+	conn_opts.username = opts.username;
+	conn_opts.password = opts.password;
+	conn_opts.onSuccess = onConnect;
+	conn_opts.onFailure = onConnectFailure;
+	conn_opts.context = client;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+
+	while (!subscribed)
+		#if defined(WIN32)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+	if (finished)
+		goto exit;
+
+	while (!finished)
+		#if defined(WIN32)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+	disc_opts.onSuccess = onDisconnect;
+	if ((rc = MQTTAsync_disconnect(client, &disc_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start disconnect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+
+	while	(!disconnected)
+		#if defined(WIN32)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+exit:
+	MQTTAsync_destroy(&client);
+
+	return EXIT_SUCCESS;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/paho_cs_pub.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/paho_cs_pub.c b/thirdparty/paho.mqtt.c/src/samples/paho_cs_pub.c
new file mode 100644
index 0000000..04ce688
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/paho_cs_pub.c
@@ -0,0 +1,276 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *******************************************************************************/
+
+ /*
+ stdin publisher
+
+ compulsory parameters:
+
+  --topic topic to publish on
+
+ defaulted parameters:
+
+	--host localhost
+	--port 1883
+	--qos 0
+	--delimiters \n
+	--clientid stdin_publisher
+	--maxdatalen 100
+
+	--userid none
+	--password none
+
+*/
+
+#include "MQTTClient.h"
+#include "MQTTClientPersistence.h"
+
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined(WIN32)
+#define sleep Sleep
+#else
+#include <sys/time.h>
+#endif
+
+
+volatile int toStop = 0;
+
+
+void usage(void)
+{
+	printf("MQTT stdin publisher\n");
+	printf("Usage: stdinpub topicname <options>, where options are:\n");
+	printf("  --host <hostname> (default is localhost)\n");
+	printf("  --port <port> (default is 1883)\n");
+	printf("  --qos <qos> (default is 0)\n");
+	printf("  --retained (default is off)\n");
+	printf("  --delimiter <delim> (default is \\n)");
+	printf("  --clientid <clientid> (default is hostname+timestamp)");
+	printf("  --maxdatalen 100\n");
+	printf("  --username none\n");
+	printf("  --password none\n");
+	exit(EXIT_FAILURE);
+}
+
+
+void myconnect(MQTTClient* client, MQTTClient_connectOptions* opts)
+{
+	printf("Connecting\n");
+	if (MQTTClient_connect(*client, opts) != 0)
+	{
+		printf("Failed to connect\n");
+		exit(EXIT_FAILURE);
+	}
+	printf("Connected\n");
+}
+
+
+void cfinish(int sig)
+{
+	signal(SIGINT, NULL);
+	toStop = 1;
+}
+
+
+struct
+{
+	char* clientid;
+	char* delimiter;
+	int maxdatalen;
+	int qos;
+	int retained;
+	char* username;
+	char* password;
+	char* host;
+	char* port;
+  int verbose;
+} opts =
+{
+	"publisher", "\n", 100, 0, 0, NULL, NULL, "localhost", "1883", 0
+};
+
+void getopts(int argc, char** argv);
+
+int messageArrived(void* context, char* topicName, int topicLen, MQTTClient_message* m)
+{
+	/* not expecting any messages */
+	return 1;
+}
+
+int main(int argc, char** argv)
+{
+	MQTTClient client;
+	MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+	MQTTClient_SSLOptions ssl_opts = MQTTClient_SSLOptions_initializer;
+	char* topic = NULL;
+	char* buffer = NULL;
+	int rc = 0;
+	char url[100];
+
+	if (argc < 2)
+		usage();
+
+	getopts(argc, argv);
+
+	sprintf(url, "%s:%s", opts.host, opts.port);
+	if (opts.verbose)
+		printf("URL is %s\n", url);
+
+	topic = argv[1];
+	printf("Using topic %s\n", topic);
+
+	rc = MQTTClient_create(&client, url, opts.clientid, MQTTCLIENT_PERSISTENCE_NONE, NULL);
+
+	signal(SIGINT, cfinish);
+	signal(SIGTERM, cfinish);
+
+	rc = MQTTClient_setCallbacks(client, NULL, NULL, messageArrived, NULL);
+
+	conn_opts.keepAliveInterval = 10;
+	conn_opts.reliable = 0;
+	conn_opts.cleansession = 1;
+	conn_opts.username = opts.username;
+	conn_opts.password = opts.password;
+	ssl_opts.enableServerCertAuth = 0;
+	conn_opts.ssl = &ssl_opts;
+
+	myconnect(&client, &conn_opts);
+
+	buffer = malloc(opts.maxdatalen);
+
+	while (!toStop)
+	{
+		int data_len = 0;
+		int delim_len = 0;
+
+		delim_len = (int)strlen(opts.delimiter);
+		do
+		{
+			buffer[data_len++] = getchar();
+			if (data_len > delim_len)
+			{
+			/* printf("comparing %s %s\n", opts.delimiter, &buffer[data_len - delim_len]); */
+			if (strncmp(opts.delimiter, &buffer[data_len - delim_len], delim_len) == 0)
+				break;
+			}
+		} while (data_len < opts.maxdatalen);
+
+		if (opts.verbose)
+				printf("Publishing data of length %d\n", data_len);
+		rc = MQTTClient_publish(client, topic, data_len, buffer, opts.qos, opts.retained, NULL);
+		if (rc != 0)
+		{
+			myconnect(&client, &conn_opts);
+			rc = MQTTClient_publish(client, topic, data_len, buffer, opts.qos, opts.retained, NULL);
+		}
+		if (opts.qos > 0)
+			MQTTClient_yield();
+	}
+
+	printf("Stopping\n");
+
+	free(buffer);
+
+	MQTTClient_disconnect(client, 0);
+
+ 	MQTTClient_destroy(&client);
+
+	return EXIT_SUCCESS;
+}
+
+void getopts(int argc, char** argv)
+{
+	int count = 2;
+
+	while (count < argc)
+	{
+		if (strcmp(argv[count], "--retained") == 0)
+			opts.retained = 1;
+		if (strcmp(argv[count], "--verbose") == 0)
+			opts.verbose = 1;
+		else if (strcmp(argv[count], "--qos") == 0)
+		{
+			if (++count < argc)
+			{
+				if (strcmp(argv[count], "0") == 0)
+					opts.qos = 0;
+				else if (strcmp(argv[count], "1") == 0)
+					opts.qos = 1;
+				else if (strcmp(argv[count], "2") == 0)
+					opts.qos = 2;
+				else
+					usage();
+			}
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--host") == 0)
+		{
+			if (++count < argc)
+				opts.host = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--port") == 0)
+		{
+			if (++count < argc)
+				opts.port = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--clientid") == 0)
+		{
+			if (++count < argc)
+				opts.clientid = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--username") == 0)
+		{
+			if (++count < argc)
+				opts.username = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--password") == 0)
+		{
+			if (++count < argc)
+				opts.password = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--maxdatalen") == 0)
+		{
+			if (++count < argc)
+				opts.maxdatalen = atoi(argv[count]);
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--delimiter") == 0)
+		{
+			if (++count < argc)
+				opts.delimiter = argv[count];
+			else
+				usage();
+		}
+		count++;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/paho_cs_sub.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/paho_cs_sub.c b/thirdparty/paho.mqtt.c/src/samples/paho_cs_sub.c
new file mode 100644
index 0000000..52fe9bc
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/paho_cs_sub.c
@@ -0,0 +1,270 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *   http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial contribution
+ *    Ian Craggs - change delimiter option from char to string
+ *    Guilherme Maciel Ferreira - add keep alive option
+ *******************************************************************************/
+
+/*
+
+ stdout subscriber
+
+ compulsory parameters:
+
+  --topic topic to subscribe to
+
+ defaulted parameters:
+
+	--host localhost
+	--port 1883
+	--qos 2
+	--delimiter \n
+	--clientid stdout-subscriber
+	--showtopics off
+	--keepalive 10
+
+	--userid none
+	--password none
+
+*/
+#include "MQTTClient.h"
+#include "MQTTClientPersistence.h"
+
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <stdlib.h>
+
+
+#if defined(WIN32)
+#define sleep Sleep
+#else
+#include <sys/time.h>
+#endif
+
+
+volatile int toStop = 0;
+
+
+struct opts_struct
+{
+	char* clientid;
+	int nodelimiter;
+	char* delimiter;
+	int qos;
+	char* username;
+	char* password;
+	char* host;
+	char* port;
+	int showtopics;
+	int keepalive;
+} opts =
+{
+	"stdout-subscriber", 0, "\n", 2, NULL, NULL, "localhost", "1883", 0, 10
+};
+
+
+void usage(void)
+{
+	printf("MQTT stdout subscriber\n");
+	printf("Usage: stdoutsub topicname <options>, where options are:\n");
+	printf("  --host <hostname> (default is %s)\n", opts.host);
+	printf("  --port <port> (default is %s)\n", opts.port);
+	printf("  --qos <qos> (default is %d)\n", opts.qos);
+	printf("  --delimiter <delim> (default is \\n)\n");
+	printf("  --clientid <clientid> (default is %s)\n", opts.clientid);
+	printf("  --username none\n");
+	printf("  --password none\n");
+	printf("  --showtopics <on or off> (default is on if the topic has a wildcard, else off)\n");
+	printf("  --keepalive <seconds> (default is %d seconds)\n", opts.keepalive);
+	exit(EXIT_FAILURE);
+}
+
+
+void myconnect(MQTTClient* client, MQTTClient_connectOptions* opts)
+{
+	int rc = 0;
+	if ((rc = MQTTClient_connect(*client, opts)) != 0)
+	{
+		printf("Failed to connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+void cfinish(int sig)
+{
+	signal(SIGINT, NULL);
+	toStop = 1;
+}
+
+void getopts(int argc, char** argv);
+
+int main(int argc, char** argv)
+{
+	MQTTClient client;
+	MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+	char* topic = NULL;
+	int rc = 0;
+	char url[100];
+
+	if (argc < 2)
+		usage();
+
+	topic = argv[1];
+
+	if (strchr(topic, '#') || strchr(topic, '+'))
+		opts.showtopics = 1;
+	if (opts.showtopics)
+		printf("topic is %s\n", topic);
+
+	getopts(argc, argv);
+	sprintf(url, "%s:%s", opts.host, opts.port);
+
+	rc = MQTTClient_create(&client, url, opts.clientid, MQTTCLIENT_PERSISTENCE_NONE, NULL);
+
+	signal(SIGINT, cfinish);
+	signal(SIGTERM, cfinish);
+
+	conn_opts.keepAliveInterval = opts.keepalive;
+	conn_opts.reliable = 0;
+	conn_opts.cleansession = 1;
+	conn_opts.username = opts.username;
+	conn_opts.password = opts.password;
+
+	myconnect(&client, &conn_opts);
+
+	rc = MQTTClient_subscribe(client, topic, opts.qos);
+
+	while (!toStop)
+	{
+		char* topicName = NULL;
+		int topicLen;
+		MQTTClient_message* message = NULL;
+
+		rc = MQTTClient_receive(client, &topicName, &topicLen, &message, 1000);
+		if (message)
+		{
+			if (opts.showtopics)
+				printf("%s\t", topicName);
+			if (opts.nodelimiter)
+				printf("%.*s", message->payloadlen, (char*)message->payload);
+			else
+				printf("%.*s%s", message->payloadlen, (char*)message->payload, opts.delimiter);
+			fflush(stdout);
+			MQTTClient_freeMessage(&message);
+			MQTTClient_free(topicName);
+		}
+		if (rc != 0)
+			myconnect(&client, &conn_opts);
+	}
+
+	printf("Stopping\n");
+
+	MQTTClient_disconnect(client, 0);
+
+	MQTTClient_destroy(&client);
+
+	return EXIT_SUCCESS;
+}
+
+void getopts(int argc, char** argv)
+{
+	int count = 2;
+
+	while (count < argc)
+	{
+		if (strcmp(argv[count], "--qos") == 0)
+		{
+			if (++count < argc)
+			{
+				if (strcmp(argv[count], "0") == 0)
+					opts.qos = 0;
+				else if (strcmp(argv[count], "1") == 0)
+					opts.qos = 1;
+				else if (strcmp(argv[count], "2") == 0)
+					opts.qos = 2;
+				else
+					usage();
+			}
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--host") == 0)
+		{
+			if (++count < argc)
+				opts.host = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--port") == 0)
+		{
+			if (++count < argc)
+				opts.port = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--clientid") == 0)
+		{
+			if (++count < argc)
+				opts.clientid = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--username") == 0)
+		{
+			if (++count < argc)
+				opts.username = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--password") == 0)
+		{
+			if (++count < argc)
+				opts.password = argv[count];
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--delimiter") == 0)
+		{
+			if (++count < argc)
+				opts.delimiter = argv[count];
+			else
+				opts.nodelimiter = 1;
+		}
+		else if (strcmp(argv[count], "--showtopics") == 0)
+		{
+			if (++count < argc)
+			{
+				if (strcmp(argv[count], "on") == 0)
+					opts.showtopics = 1;
+				else if (strcmp(argv[count], "off") == 0)
+					opts.showtopics = 0;
+				else
+					usage();
+			}
+			else
+				usage();
+		}
+		else if (strcmp(argv[count], "--keepalive") == 0)
+		{
+			if (++count < argc)
+				opts.keepalive = atoi(argv[count]);
+			else
+				usage();
+		}
+		count++;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/utf-8.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/utf-8.c b/thirdparty/paho.mqtt.c/src/utf-8.c
new file mode 100644
index 0000000..1530701
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/utf-8.c
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+
+/**
+ * @file
+ * \brief Functions for checking that strings contain UTF-8 characters only
+ *
+ * See page 104 of the Unicode Standard 5.0 for the list of well formed
+ * UTF-8 byte sequences.
+ * 
+ */
+#include "utf-8.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "StackTrace.h"
+
+/**
+ * Macro to determine the number of elements in a single-dimension array
+ */
+#if !defined(ARRAY_SIZE)
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
+
+/**
+ * Structure to hold the valid ranges of UTF-8 characters, for each byte up to 4
+ */
+struct
+{
+	int len; /**< number of elements in the following array (1 to 4) */
+	struct
+	{
+		char lower; /**< lower limit of valid range */
+		char upper; /**< upper limit of valid range */
+	} bytes[4];   /**< up to 4 bytes can be used per character */
+}
+valid_ranges[] = 
+{
+		{1, { {00, 0x7F} } },
+		{2, { {0xC2, 0xDF}, {0x80, 0xBF} } },
+		{3, { {0xE0, 0xE0}, {0xA0, 0xBF}, {0x80, 0xBF} } },
+		{3, { {0xE1, 0xEC}, {0x80, 0xBF}, {0x80, 0xBF} } },
+		{3, { {0xED, 0xED}, {0x80, 0x9F}, {0x80, 0xBF} } },
+		{3, { {0xEE, 0xEF}, {0x80, 0xBF}, {0x80, 0xBF} } },
+		{4, { {0xF0, 0xF0}, {0x90, 0xBF}, {0x80, 0xBF}, {0x80, 0xBF} } },
+		{4, { {0xF1, 0xF3}, {0x80, 0xBF}, {0x80, 0xBF}, {0x80, 0xBF} } },
+		{4, { {0xF4, 0xF4}, {0x80, 0x8F}, {0x80, 0xBF}, {0x80, 0xBF} } },
+};
+
+
+static const char* UTF8_char_validate(int len, const char* data);
+
+
+/**
+ * Validate a single UTF-8 character
+ * @param len the length of the string in "data"
+ * @param data the bytes to check for a valid UTF-8 char
+ * @return pointer to the start of the next UTF-8 character in "data"
+ */
+static const char* UTF8_char_validate(int len, const char* data)
+{
+	int good = 0;
+	int charlen = 2;
+	int i, j;
+	const char *rc = NULL;
+
+	FUNC_ENTRY;
+	/* first work out how many bytes this char is encoded in */
+	if ((data[0] & 128) == 0)
+		charlen = 1;
+	else if ((data[0] & 0xF0) == 0xF0)
+		charlen = 4;
+	else if ((data[0] & 0xE0) == 0xE0)
+		charlen = 3;
+
+	if (charlen > len)
+		goto exit;	/* not enough characters in the string we were given */
+
+	for (i = 0; i < ARRAY_SIZE(valid_ranges); ++i)
+	{ /* just has to match one of these rows */
+		if (valid_ranges[i].len == charlen)
+		{
+			good = 1;
+			for (j = 0; j < charlen; ++j)
+			{
+				if (data[j] < valid_ranges[i].bytes[j].lower ||
+						data[j] > valid_ranges[i].bytes[j].upper)
+				{
+					good = 0;  /* failed the check */
+					break;
+				}
+			}
+			if (good)
+				break;
+		}
+	}
+
+	if (good)
+		rc = data + charlen;
+	exit:
+	FUNC_EXIT;
+	return rc;
+}
+
+
+/**
+ * Validate a length-delimited string has only UTF-8 characters
+ * @param len the length of the string in "data"
+ * @param data the bytes to check for valid UTF-8 characters
+ * @return 1 (true) if the string has only UTF-8 characters, 0 (false) otherwise
+ */
+int UTF8_validate(int len, const char* data)
+{
+	const char* curdata = NULL;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (len == 0)
+	{
+		rc = 1;
+		goto exit;
+	}
+	curdata = UTF8_char_validate(len, data);
+	while (curdata && (curdata < data + len))
+		curdata = UTF8_char_validate(len, curdata);
+
+	rc = curdata != NULL;
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Validate a null-terminated string has only UTF-8 characters
+ * @param string the string to check for valid UTF-8 characters
+ * @return 1 (true) if the string has only UTF-8 characters, 0 (false) otherwise
+ */
+int UTF8_validateString(const char* string)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	rc = UTF8_validate((int)strlen(string), string);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+
+#if defined(UNIT_TESTS)
+#include <stdio.h>
+
+typedef struct
+{
+	int len;
+	char data[20];
+} tests;
+
+tests valid_strings[] =
+{
+		{3, "hjk" },
+		{7, {0x41, 0xE2, 0x89, 0xA2, 0xCE, 0x91, 0x2E} },
+		{3, {'f', 0xC9, 0xB1 } },
+		{9, {0xED, 0x95, 0x9C, 0xEA, 0xB5, 0xAD, 0xEC, 0x96, 0xB4} },
+		{9, {0xE6, 0x97, 0xA5, 0xE6, 0x9C, 0xAC, 0xE8, 0xAA, 0x9E} },
+		{4, {0x2F, 0x2E, 0x2E, 0x2F} },
+		{7, {0xEF, 0xBB, 0xBF, 0xF0, 0xA3, 0x8E, 0xB4} },
+};
+
+tests invalid_strings[] =
+{
+		{2, {0xC0, 0x80} },
+		{5, {0x2F, 0xC0, 0xAE, 0x2E, 0x2F} },
+		{6, {0xED, 0xA1, 0x8C, 0xED, 0xBE, 0xB4} },
+		{1, {0xF4} },
+};
+
+int main (int argc, char *argv[])
+{
+	int i, failed = 0;
+
+	for (i = 0; i < ARRAY_SIZE(valid_strings); ++i)
+	{
+		if (!UTF8_validate(valid_strings[i].len, valid_strings[i].data))
+		{
+			printf("valid test %d failed\n", i);
+			failed = 1;
+		}
+		else
+			printf("valid test %d passed\n", i);
+	}
+
+	for (i = 0; i < ARRAY_SIZE(invalid_strings); ++i)
+	{
+		if (UTF8_validate(invalid_strings[i].len, invalid_strings[i].data))
+		{
+			printf("invalid test %d failed\n", i);
+			failed = 1;
+		}
+		else
+			printf("invalid test %d passed\n", i);
+	}
+
+	if (failed)
+		printf("Failed\n");
+	else
+		printf("Passed\n");
+
+	return 0;
+} /* End of main function*/
+
+#endif
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/utf-8.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/utf-8.h b/thirdparty/paho.mqtt.c/src/utf-8.h
new file mode 100644
index 0000000..8bce4b3
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/utf-8.h
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+#if !defined(UTF8_H)
+#define UTF8_H
+
+int UTF8_validate(int len, const char *data);
+int UTF8_validateString(const char* string);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/travis-build.sh
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/travis-build.sh b/thirdparty/paho.mqtt.c/travis-build.sh
new file mode 100755
index 0000000..5356f8b
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/travis-build.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+set -e
+
+rm -rf build.paho
+mkdir build.paho
+cd build.paho
+echo "travis build dir $TRAVIS_BUILD_DIR pwd $PWD"
+cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_SAMPLES=TRUE ..
+make
+python ../test/mqttsas2.py &
+ctest -VV --timeout 600
+kill %1
+killall mosquitto
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/travis-env-vars
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/travis-env-vars b/thirdparty/paho.mqtt.c/travis-env-vars
new file mode 100644
index 0000000..2551ccb
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/travis-env-vars
@@ -0,0 +1,2 @@
+export TRAVIS_OS_NAME=linux
+export TRAVIS_BUILD_DIR=$PWD

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/travis-install.sh
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/travis-install.sh b/thirdparty/paho.mqtt.c/travis-install.sh
new file mode 100755
index 0000000..0405da6
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/travis-install.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+	pwd
+	sudo service mosquitto stop
+	# Stop any mosquitto instance which may be still running from previous runs
+	killall mosquitto
+	mosquitto -h
+	mosquitto -c test/tls-testing/mosquitto.conf &
+fi
+
+if [ "$TRAVIS_OS_NAME" == "osx" ]; then
+	pwd
+	brew update
+	brew install openssl mosquitto
+	brew services stop mosquitto
+	/usr/local/sbin/mosquitto -c test/tls-testing/mosquitto.conf &
+fi

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/travis-macos-vars
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/travis-macos-vars b/thirdparty/paho.mqtt.c/travis-macos-vars
new file mode 100644
index 0000000..bbdbccb
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/travis-macos-vars
@@ -0,0 +1,2 @@
+export TRAVIS_OS_NAME=osx
+export TRAVIS_BUILD_DIR=$PWD


[19/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
MINIFICPP-342: MQTT extension

This closes #228.

Signed-off-by: Marc Parisi <ph...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/commit/a8703b5c
Tree: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/tree/a8703b5c
Diff: http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/diff/a8703b5c

Branch: refs/heads/master
Commit: a8703b5c79380ae3a24ca3099572bf67b10e6f46
Parents: 0da444e
Author: Bin Qiu <be...@gmail.com>
Authored: Thu Jan 4 08:23:14 2018 -0800
Committer: Marc Parisi <ph...@apache.org>
Committed: Wed Jan 10 06:11:21 2018 -0500

----------------------------------------------------------------------
 CMakeLists.txt                                  |    7 +
 Extensions.md                                   |    1 +
 LICENSE                                         |   16 +
 PROCESSORS.md                                   |   62 +
 README.md                                       |    2 +
 bootstrap.sh                                    |   20 +-
 extensions/mqtt/AbstractMQTTProcessor.cpp       |  158 +
 extensions/mqtt/AbstractMQTTProcessor.h         |  154 +
 extensions/mqtt/CMakeLists.txt                  |   75 +
 extensions/mqtt/ConsumeMQTT.cpp                 |  110 +
 extensions/mqtt/ConsumeMQTT.h                   |  122 +
 extensions/mqtt/MQTTLoader.cpp                  |   29 +
 extensions/mqtt/MQTTLoader.h                    |   72 +
 extensions/mqtt/PublishMQTT.cpp                 |  106 +
 extensions/mqtt/PublishMQTT.h                   |  142 +
 libminifi/test/mqtt-tests/CMakeLists.txt        |   39 +
 thirdparty/paho.mqtt.c/.gitignore               |    6 +
 thirdparty/paho.mqtt.c/.gitreview               |    5 +
 thirdparty/paho.mqtt.c/.pydevproject            |    5 +
 thirdparty/paho.mqtt.c/CMakeLists.txt           |   86 +
 thirdparty/paho.mqtt.c/CONTRIBUTING.md          |   66 +
 thirdparty/paho.mqtt.c/Makefile                 |  283 ++
 thirdparty/paho.mqtt.c/README.md                |  215 ++
 .../MQTTVersion/MQTTVersion.vcxproj             |  166 +
 .../MQTTVersion/MQTTVersion.vcxproj.filters     |   36 +
 .../MQTTVersion/MQTTVersion.vcxproj.user        |    4 +
 .../Windows Build/Paho C MQTT APIs.sln          |  155 +
 .../paho-mqtt3a/paho-mqtt3a.vcxproj             |  202 ++
 .../paho-mqtt3a/paho-mqtt3a.vcxproj.filters     |  153 +
 .../paho-mqtt3a/paho-mqtt3a.vcxproj.user        |    3 +
 .../paho-mqtt3as/paho-mqtt3as.vcxproj           |  204 ++
 .../paho-mqtt3as/paho-mqtt3as.vcxproj.filters   |  147 +
 .../paho-mqtt3as/paho-mqtt3as.vcxproj.user      |    4 +
 .../paho-mqtt3c/paho-mqtt3c.vcxproj             |  172 +
 .../paho-mqtt3c/paho-mqtt3c.vcxproj.filters     |   79 +
 .../paho-mqtt3c/paho-mqtt3c.vcxproj.user        |    3 +
 .../paho-mqtt3cs/paho-mqtt3cs.vcxproj           |  204 ++
 .../paho-mqtt3cs/paho-mqtt3cs.vcxproj.filters   |  147 +
 .../paho-mqtt3cs/paho-mqtt3cs.vcxproj.user      |    4 +
 .../Windows Build/stdoutsub/stdoutsub.vcxproj   |  175 +
 .../stdoutsub/stdoutsub.vcxproj.filters         |   30 +
 .../stdoutsub/stdoutsub.vcxproj.user            |    3 +
 .../Windows Build/stdoutsuba/stdoutsuba.vcxproj |  170 +
 .../stdoutsuba/stdoutsuba.vcxproj.filters       |   30 +
 .../stdoutsuba/stdoutsuba.vcxproj.user          |    3 +
 .../Windows Build/test1/test1.vcxproj           |  173 +
 .../Windows Build/test1/test1.vcxproj.filters   |   30 +
 .../Windows Build/test2/test2.vcxproj           |  177 +
 .../Windows Build/test2/test2.vcxproj.filters   |   45 +
 .../Windows Build/test3/test3.vcxproj           |  178 +
 .../Windows Build/test3/test3.vcxproj.filters   |   30 +
 .../Windows Build/test4/test4.vcxproj           |  173 +
 .../Windows Build/test4/test4.vcxproj.filters   |   30 +
 .../Windows Build/test5/test5.vcxproj           |  173 +
 .../Windows Build/test5/test5.vcxproj.filters   |   30 +
 .../Windows Build/test9/test9.vcxproj           |  170 +
 .../Windows Build/test9/test9.vcxproj.filters   |   30 +
 thirdparty/paho.mqtt.c/about.html               |   28 +
 thirdparty/paho.mqtt.c/android/Android.mk       |  140 +
 thirdparty/paho.mqtt.c/appveyor.yml             |   50 +
 thirdparty/paho.mqtt.c/build.xml                |  316 ++
 thirdparty/paho.mqtt.c/cbuild.bat               |   19 +
 .../paho.mqtt.c/cmake/CPackDebConfig.cmake.in   |   91 +
 .../cmake/modules/CMakeDebHelper.cmake          |   74 +
 .../cmake/modules/CMakeDebHelperInstall.cmake   |   17 +
 .../cmake/toolchain.linux-arm11.cmake           |   10 +
 .../paho.mqtt.c/cmake/toolchain.win32.cmake     |   15 +
 .../paho.mqtt.c/cmake/toolchain.win64.cmake     |   15 +
 thirdparty/paho.mqtt.c/debian/CMakeLists.txt    |   16 +
 thirdparty/paho.mqtt.c/dist/Makefile            |   11 +
 thirdparty/paho.mqtt.c/dist/paho-c.spec         |   78 +
 thirdparty/paho.mqtt.c/doc/CMakeLists.txt       |   40 +
 thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI   | 1803 ++++++++++
 .../paho.mqtt.c/doc/DoxyfileV3AsyncAPI.in       | 1804 ++++++++++
 thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI  | 1803 ++++++++++
 .../paho.mqtt.c/doc/DoxyfileV3ClientAPI.in      | 1804 ++++++++++
 .../paho.mqtt.c/doc/DoxyfileV3ClientInternal    | 1851 ++++++++++
 .../paho.mqtt.c/doc/DoxyfileV3ClientInternal.in | 1852 ++++++++++
 thirdparty/paho.mqtt.c/doc/pahologo.png         |  Bin 0 -> 12197 bytes
 thirdparty/paho.mqtt.c/edl-v10                  |   15 +
 thirdparty/paho.mqtt.c/epl-v10                  |   70 +
 thirdparty/paho.mqtt.c/notice.html              |  108 +
 thirdparty/paho.mqtt.c/src/CMakeLists.txt       |  165 +
 thirdparty/paho.mqtt.c/src/Clients.c            |   55 +
 thirdparty/paho.mqtt.c/src/Clients.h            |  209 ++
 thirdparty/paho.mqtt.c/src/Heap.c               |  481 +++
 thirdparty/paho.mqtt.c/src/Heap.h               |   76 +
 thirdparty/paho.mqtt.c/src/LinkedList.c         |  500 +++
 thirdparty/paho.mqtt.c/src/LinkedList.h         |  105 +
 thirdparty/paho.mqtt.c/src/Log.c                |  572 ++++
 thirdparty/paho.mqtt.c/src/Log.h                |   85 +
 thirdparty/paho.mqtt.c/src/MQTTAsync.c          | 3227 ++++++++++++++++++
 thirdparty/paho.mqtt.c/src/MQTTAsync.h          | 1728 ++++++++++
 thirdparty/paho.mqtt.c/src/MQTTClient.c         | 2102 ++++++++++++
 thirdparty/paho.mqtt.c/src/MQTTClient.h         | 1396 ++++++++
 .../paho.mqtt.c/src/MQTTClientPersistence.h     |  254 ++
 thirdparty/paho.mqtt.c/src/MQTTPacket.c         |  755 ++++
 thirdparty/paho.mqtt.c/src/MQTTPacket.h         |  262 ++
 thirdparty/paho.mqtt.c/src/MQTTPacketOut.c      |  269 ++
 thirdparty/paho.mqtt.c/src/MQTTPacketOut.h      |   34 +
 thirdparty/paho.mqtt.c/src/MQTTPersistence.c    |  654 ++++
 thirdparty/paho.mqtt.c/src/MQTTPersistence.h    |   74 +
 .../paho.mqtt.c/src/MQTTPersistenceDefault.c    |  841 +++++
 .../paho.mqtt.c/src/MQTTPersistenceDefault.h    |   33 +
 thirdparty/paho.mqtt.c/src/MQTTProtocol.h       |   46 +
 thirdparty/paho.mqtt.c/src/MQTTProtocolClient.c |  769 +++++
 thirdparty/paho.mqtt.c/src/MQTTProtocolClient.h |   55 +
 thirdparty/paho.mqtt.c/src/MQTTProtocolOut.c    |  242 ++
 thirdparty/paho.mqtt.c/src/MQTTProtocolOut.h    |   46 +
 thirdparty/paho.mqtt.c/src/MQTTVersion.c        |  230 ++
 thirdparty/paho.mqtt.c/src/Messages.c           |  104 +
 thirdparty/paho.mqtt.c/src/Messages.h           |   24 +
 thirdparty/paho.mqtt.c/src/OsWrapper.c          |   28 +
 thirdparty/paho.mqtt.c/src/OsWrapper.h          |   42 +
 thirdparty/paho.mqtt.c/src/SSLSocket.c          |  917 +++++
 thirdparty/paho.mqtt.c/src/SSLSocket.h          |   51 +
 thirdparty/paho.mqtt.c/src/Socket.c             |  898 +++++
 thirdparty/paho.mqtt.c/src/Socket.h             |  143 +
 thirdparty/paho.mqtt.c/src/SocketBuffer.c       |  413 +++
 thirdparty/paho.mqtt.c/src/SocketBuffer.h       |   84 +
 thirdparty/paho.mqtt.c/src/StackTrace.c         |  207 ++
 thirdparty/paho.mqtt.c/src/StackTrace.h         |   71 +
 thirdparty/paho.mqtt.c/src/Thread.c             |  462 +++
 thirdparty/paho.mqtt.c/src/Thread.h             |   73 +
 thirdparty/paho.mqtt.c/src/Tree.c               |  724 ++++
 thirdparty/paho.mqtt.c/src/Tree.h               |  115 +
 thirdparty/paho.mqtt.c/src/VersionInfo.h.in     |    7 +
 .../paho.mqtt.c/src/samples/CMakeLists.txt      |   65 +
 .../paho.mqtt.c/src/samples/MQTTAsync_publish.c |  154 +
 .../src/samples/MQTTAsync_subscribe.c           |  190 ++
 .../src/samples/MQTTClient_publish.c            |   60 +
 .../src/samples/MQTTClient_publish_async.c      |   96 +
 .../src/samples/MQTTClient_subscribe.c          |   95 +
 thirdparty/paho.mqtt.c/src/samples/paho_c_pub.c |  379 ++
 thirdparty/paho.mqtt.c/src/samples/paho_c_sub.c |  359 ++
 .../paho.mqtt.c/src/samples/paho_cs_pub.c       |  276 ++
 .../paho.mqtt.c/src/samples/paho_cs_sub.c       |  270 ++
 thirdparty/paho.mqtt.c/src/utf-8.c              |  230 ++
 thirdparty/paho.mqtt.c/src/utf-8.h              |   23 +
 thirdparty/paho.mqtt.c/travis-build.sh          |   15 +
 thirdparty/paho.mqtt.c/travis-env-vars          |    2 +
 thirdparty/paho.mqtt.c/travis-install.sh        |   18 +
 thirdparty/paho.mqtt.c/travis-macos-vars        |    2 +
 143 files changed, 38998 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6f89a8..05d3425 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -172,6 +172,12 @@ if (ENABLE_ALL OR ENABLE_GPS)
 	createExtension(GPS-EXTENSION "GPS EXTENSIONS" "Enables LibGPS Functionality and the GetGPS processor." "extensions/gps" "${TEST_DIR}/gps-tests")
 endif()
 
+## Create MQTT Extension
+option(ENABLE_MQTT "Enables the mqtt extension." OFF)
+if(ENABLE_ALL OR ENABLE_MQTT)
+        createExtension(MQTT-EXTENSIONS "MQTT EXTENSIONS" "This Enables MQTT functionality including PublishMQTT/ConsumeMQTT" "extensions/mqtt" "${TEST_DIR}/mqtt-tests" "TRUE" "thirdparty/paho.mqtt.c")
+endif()
+
 option(ENABLE_PCAP "Enables the PCAP extension." OFF)
 if(ENABLE_ALL OR ENABLE_PCAP)
 	createExtension(PCAP-EXTENSION "PCAP EXTENSIONS" "Enables libPCAP Functionality and the PacketCapture processor." "extensions/pcap" "${TEST_DIR}/pcap-tests")
@@ -246,6 +252,7 @@ set(CPACK_PACKAGE_FILE_NAME "${ASSEMBLY_BASE_NAME}")
 set(CPACK_BINARY_TGZ, "ON")
 set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
 set(CPACK_RDKAFKA_COMPONENT_INSTALL ON)
+set(CPACK_MQTT_COMPONENT_INSTALL ON)
 set(CPACK_COMPONENTS_ALL bin)
 
 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/Extensions.md
----------------------------------------------------------------------
diff --git a/Extensions.md b/Extensions.md
index 24ef07e..3ccaf6c 100644
--- a/Extensions.md
+++ b/Extensions.md
@@ -27,6 +27,7 @@ Currently we support the following extension flags:
  - `-DENABLE_PCAP=TRUE`
  - `-DENABLE_GPS=TRUE`
  - `-DENABLE_TENSORFLOW=TRUE`
+ - `-DENABLE_MQTT=TRUE`
 
 For more information on these extensions, please visit [the Extension How-To on our wiki](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=74685143)
 

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index b4a2c77..a270b73 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1037,3 +1037,19 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 DEALINGS IN THE SOFTWARE.
+
+This product bundles 'paho mqtt' which is available under a Eclipse Software License.
+
+Eclipse Distribution License - v 1.0
+
+Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/PROCESSORS.md
----------------------------------------------------------------------
diff --git a/PROCESSORS.md b/PROCESSORS.md
index 09c7d24..6c4eedf 100644
--- a/PROCESSORS.md
+++ b/PROCESSORS.md
@@ -723,3 +723,65 @@ default values, and whether a property supports the NiFi Expression Language.
 | success | Any FlowFile that is successfully sent to Kafka will be routed to this Relationship |
 | failure | Any FlowFile that cannot be sent to Kafka will be routed to this Relationship |
 
+## PublishMQTT
+
+This Processor puts the contents of a FlowFile to a MQTT broker for a sepcified topic. The
+content of a FlowFile becomes the payload of the MQTT message.
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other
+properties (not in bold) are considered optional. The table also indicates any
+default values, and whether a property supports the NiFi Expression Language.
+
+| Name | Default Value | Allowable Values | Description |
+| - | - | - | - |
+| **Broker URI** | | | The URI to use to connect to the MQTT broker |
+| **Topic** | | | The topic to publish the message to |
+| Session state | | | Whether to start afresh or resume previous flows |
+| Client ID | | | MQTT client ID to use |
+| Username | | | Username to use when connecting to the broker |
+| Password | | | Password to use when connecting to the broker |
+| Keep Alive Interval | | | Defines the maximum time interval between messages sent or received |
+| Connection Timeout | | | Maximum time interval the client will wait for the network connection to the MQTT server |
+| Quality of Service | | | The Quality of Service(QoS) to send the message with. Accepts three values '0', '1' and '2' |
+| Retain | | | Retain MQTT published record in broker |
+| Max Flow Segment Size | | Maximum flow content payload segment size for the MQTT record |
+
+### Relationships
+
+| Name | Description |
+| - | - |
+| success | Any FlowFile that is successfully sent to broker will be routed to this Relationship |
+| failure | Any FlowFile that cannot be sent to broker will be routed to this Relationship |
+
+## ConsumeMQTT
+
+This Processor gets the contents of a FlowFile from a MQTT broker for a sepcified topic. The
+the payload of the MQTT message becomes content of a FlowFile
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other
+properties (not in bold) are considered optional. The table also indicates any
+default values, and whether a property supports the NiFi Expression Language.
+
+| Name | Default Value | Allowable Values | Description |
+| - | - | - | - |
+| **Broker URI** | | | The URI to use to connect to the MQTT broker |
+| **Topic** | | | The topic to publish the message to |
+| Session state | | | Whether to start afresh or resume previous flows |
+| Client ID | | | MQTT client ID to use |
+| Username | | | Username to use when connecting to the broker |
+| Password | | | Password to use when connecting to the broker |
+| Keep Alive Interval | | | Defines the maximum time interval between messages sent or received |
+| Connection Timeout | | | Maximum time interval the client will wait for the network connection to the MQTT server |
+| Quality of Service | | | The Quality of Service(QoS) to send the message with. Accepts three values '0', '1' and '2' |
+| Max Flow Segment Size | | Maximum flow content payload segment size for the MQTT record |
+
+### Relationships
+
+| Name | Description |
+| - | - |
+| success | Any FlowFile that is successfully sent to broker will be routed to this Relationship |
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index e22e464..40f7c97 100644
--- a/README.md
+++ b/README.md
@@ -65,6 +65,8 @@ MiNiFi - C++ supports the following processors:
 * [UnfocusArchiveEntry](PROCESSORS.md#unfocusarchiveentry)
 * [ManipulateArchive](PROCESSORS.md#manipulatearchive)
 * [PublishKafka](PROCESSORS.md#publishkafka)
+* [PublishMQTT](PROCESSORS.md#publishMQTT)
+* [ConsumeMQTT](PROCESSORS.md#consumeMQTT)
 
 ## Caveats
 * 0.4.0 represents a non-GA release, APIs and interfaces are subject to change

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/bootstrap.sh
----------------------------------------------------------------------
diff --git a/bootstrap.sh b/bootstrap.sh
index 270a4a5..bc8b1de 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -209,6 +209,8 @@ add_dependency GPS_ENABLED "gpsd"
 
 add_disabled_option KAFKA_ENABLED ${FALSE} "ENABLE_LIBRDKAFKA" "3.4.0"
 
+add_disabled_option MQTT_ENABLED ${FALSE} "ENABLE_MQTT"
+
 #add_disabled_option BUSTACHE_ENABLED ${FALSE} "ENABLE_BUSTACHE"
 #add_dependency BUSTACHE_ENABLED "boost"
 
@@ -360,10 +362,11 @@ show_supported_features() {
   echo "I. GPS support .................$(print_feature_status GPS_ENABLED)"
   echo "J. TensorFlow Support ..........$(print_feature_status TENSORFLOW_ENABLED)"
   echo "K. Bustache Support ............$(print_feature_status BUSTACHE_ENABLED)"
-  echo "L. Enable all extensions"
-  echo "M. Portable Build ..............$(print_feature_status PORTABLE_BUILD)"
-  echo "N. Build with Debug symbols ....$(print_feature_status DEBUG_SYMBOLS)"
-  echo "O. Continue with these options"
+  echo "L. MQTT Support ................$(print_feature_status MQTT_ENABLED)"
+  echo "M. Enable all extensions"
+  echo "N. Portable Build ..............$(print_feature_status PORTABLE_BUILD)"
+  echo "O. Build with Debug symbols ....$(print_feature_status DEBUG_SYMBOLS)"
+  echo "P. Continue with these options"
   echo "Q. Exit"
   echo "* Extension cannot be installed due to"
   echo -e "  version of cmake or other software\r\n"
@@ -384,10 +387,11 @@ read_options(){
     i) ToggleFeature GPS_ENABLED ;;
     j) ToggleFeature TENSORFLOW_ENABLED ;;
     k) ToggleFeature BUSTACHE_ENABLED ;;
-    l) EnableAllFeatures ;;
-    m) ToggleFeature PORTABLE_BUILD ;;
-    n) ToggleFeature DEBUG_SYMBOLS ;;
-    o) FEATURES_SELECTED="true" ;;
+    l) ToggleFeature MQTT_ENABLED ;;
+    m) EnableAllFeatures ;;
+    n) ToggleFeature PORTABLE_BUILD ;;
+    o) ToggleFeature DEBUG_SYMBOLS ;;
+    p) FEATURES_SELECTED="true" ;;
     q) exit 0;;
     *) echo -e "${RED}Please enter an option A-L...${NO_COLOR}" && sleep 2
   esac

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/AbstractMQTTProcessor.cpp
----------------------------------------------------------------------
diff --git a/extensions/mqtt/AbstractMQTTProcessor.cpp b/extensions/mqtt/AbstractMQTTProcessor.cpp
new file mode 100644
index 0000000..9ce052d
--- /dev/null
+++ b/extensions/mqtt/AbstractMQTTProcessor.cpp
@@ -0,0 +1,158 @@
+/**
+ * @file AbstractMQTTProcessor.cpp
+ * AbstractMQTTProcessor class implementation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "AbstractMQTTProcessor.h"
+#include <stdio.h>
+#include <memory>
+#include <string>
+#include "utils/TimeUtil.h"
+#include "utils/StringUtils.h"
+#include "core/ProcessContext.h"
+#include "core/ProcessSession.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+core::Property AbstractMQTTProcessor::BrokerURL("Broker URI", "The URI to use to connect to the MQTT broker", "");
+core::Property AbstractMQTTProcessor::CleanSession("Session state", "Whether to start afresh or resume previous flows. See the allowable value descriptions for more details", "true");
+core::Property AbstractMQTTProcessor::ClientID("Client ID", "MQTT client ID to use", "");
+core::Property AbstractMQTTProcessor::UserName("Username", "Username to use when connecting to the broker", "");
+core::Property AbstractMQTTProcessor::PassWord("Password", "Password to use when connecting to the broker", "");
+core::Property AbstractMQTTProcessor::KeepLiveInterval("Keep Alive Interval", "Defines the maximum time interval between messages sent or received", "60 sec");
+core::Property AbstractMQTTProcessor::ConnectionTimeOut("Connection Timeout", "Maximum time interval the client will wait for the network connection to the MQTT server", "30 sec");
+core::Property AbstractMQTTProcessor::QOS("Quality of Service", "The Quality of Service(QoS) to send the message with. Accepts three values '0', '1' and '2'", "MQTT_QOS_0");
+core::Property AbstractMQTTProcessor::Topic("Topic", "The topic to publish the message to", "");
+core::Relationship AbstractMQTTProcessor::Success("success", "FlowFiles that are sent successfully to the destination are transferred to this relationship");
+core::Relationship AbstractMQTTProcessor::Failure("failure", "FlowFiles that failed to send to the destination are transferred to this relationship");
+
+void AbstractMQTTProcessor::initialize() {
+  // Set the supported properties
+  std::set<core::Property> properties;
+  properties.insert(BrokerURL);
+  properties.insert(CleanSession);
+  properties.insert(ClientID);
+  properties.insert(UserName);
+  properties.insert(PassWord);
+  properties.insert(KeepLiveInterval);
+  properties.insert(ConnectionTimeOut);
+  properties.insert(QOS);
+  properties.insert(Topic);
+  setSupportedProperties(properties);
+  // Set the supported relationships
+  std::set<core::Relationship> relationships;
+  relationships.insert(Success);
+  relationships.insert(Failure);
+  setSupportedRelationships(relationships);
+}
+
+void AbstractMQTTProcessor::onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory) {
+  std::string value;
+  int64_t valInt;
+  value = "";
+  if (context->getProperty(BrokerURL.getName(), value) && !value.empty()) {
+    uri_ = value;
+    logger_->log_info("AbstractMQTTProcessor: BrokerURL [%s]", uri_);
+  }
+  value = "";
+  if (context->getProperty(ClientID.getName(), value) && !value.empty()) {
+    clientID_ = value;
+    logger_->log_info("AbstractMQTTProcessor: ClientID [%s]", clientID_);
+  }
+  value = "";
+  if (context->getProperty(Topic.getName(), value) && !value.empty()) {
+    topic_ = value;
+    logger_->log_info("AbstractMQTTProcessor: Topic [%s]", topic_);
+  }
+  value = "";
+  if (context->getProperty(UserName.getName(), value) && !value.empty()) {
+    userName_ = value;
+    logger_->log_info("AbstractMQTTProcessor: UserName [%s]", userName_);
+  }
+  value = "";
+  if (context->getProperty(PassWord.getName(), value) && !value.empty()) {
+    passWord_ = value;
+    logger_->log_info("AbstractMQTTProcessor: PassWord [%s]", passWord_);
+  }
+  value = "";
+  if (context->getProperty(CleanSession.getName(), value) && !value.empty() &&
+      org::apache::nifi::minifi::utils::StringUtils::StringToBool(value, cleanSession_)) {
+    logger_->log_info("AbstractMQTTProcessor: CleanSession [%d]", cleanSession_);
+  }
+  value = "";
+  if (context->getProperty(KeepLiveInterval.getName(), value) && !value.empty()) {
+    core::TimeUnit unit;
+    if (core::Property::StringToTime(value, valInt, unit) && core::Property::ConvertTimeUnitToMS(valInt, unit, valInt)) {
+      keepAliveInterval_ = valInt/1000;
+      logger_->log_info("AbstractMQTTProcessor: KeepLiveInterval [%ll]", keepAliveInterval_);
+    }
+  }
+  value = "";
+  if (context->getProperty(ConnectionTimeOut.getName(), value) && !value.empty()) {
+    core::TimeUnit unit;
+    if (core::Property::StringToTime(value, valInt, unit) && core::Property::ConvertTimeUnitToMS(valInt, unit, valInt)) {
+      connectionTimeOut_ = valInt/1000;
+      logger_->log_info("AbstractMQTTProcessor: ConnectionTimeOut [%ll]", connectionTimeOut_);
+    }
+  }
+  value = "";
+  if (context->getProperty(QOS.getName(), value) && !value.empty() && (value == MQTT_QOS_0 || value == MQTT_QOS_1 || MQTT_QOS_2) &&
+      core::Property::StringToInt(value, valInt)) {
+    qos_ = valInt;
+    logger_->log_info("AbstractMQTTProcessor: QOS [%ll]", qos_);
+  }
+  if (!client_) {
+    MQTTClient_create(&client_, uri_.c_str(), clientID_.c_str(), MQTTCLIENT_PERSISTENCE_NONE, NULL);
+  }
+  if (client_) {
+    MQTTClient_setCallbacks(client_, (void *) this, connectionLost, msgReceived, msgDelivered);
+    // call reconnect to bootstrap
+    this->reconnect();
+  }
+}
+
+bool AbstractMQTTProcessor::reconnect() {
+  if (!client_)
+    return false;
+  if (MQTTClient_isConnected(client_))
+    return true;
+  MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+  conn_opts.keepAliveInterval = keepAliveInterval_;
+  conn_opts.cleansession = cleanSession_;
+  if (!userName_.empty()) {
+    conn_opts.username = userName_.c_str();
+    conn_opts.password = passWord_.c_str();
+  }
+  if (MQTTClient_connect(client_, &conn_opts) != MQTTCLIENT_SUCCESS) {
+    logger_->log_error("Failed to connect to MQTT broker %s", uri_);
+    return false;
+  }
+  if (isSubscriber_) {
+    MQTTClient_subscribe(client_, topic_.c_str(), qos_);
+  }
+  return true;
+}
+
+} /* namespace processors */
+} /* namespace minifi */
+} /* namespace nifi */
+} /* namespace apache */
+} /* namespace org */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/AbstractMQTTProcessor.h
----------------------------------------------------------------------
diff --git a/extensions/mqtt/AbstractMQTTProcessor.h b/extensions/mqtt/AbstractMQTTProcessor.h
new file mode 100644
index 0000000..7870c2b
--- /dev/null
+++ b/extensions/mqtt/AbstractMQTTProcessor.h
@@ -0,0 +1,154 @@
+/**
+ * @file AbstractMQTTProcessor.h
+ * AbstractMQTTProcessor class declaration
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __ABSTRACTMQTT_H__
+#define __ABSTRACTMQTT_H__
+
+#include "FlowFileRecord.h"
+#include "core/Processor.h"
+#include "core/ProcessSession.h"
+#include "core/Core.h"
+#include "core/Resource.h"
+#include "core/logging/LoggerConfiguration.h"
+#include "MQTTClient.h"
+
+#define MQTT_QOS_0 "0"
+#define MQTT_QOS_1 "1"
+#define MQTT_QOS_2 "2"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+// AbstractMQTTProcessor Class
+class AbstractMQTTProcessor : public core::Processor {
+ public:
+  // Constructor
+  /*!
+   * Create a new processor
+   */
+  explicit AbstractMQTTProcessor(std::string name, uuid_t uuid = NULL)
+      : core::Processor(name, uuid),
+        logger_(logging::LoggerFactory<AbstractMQTTProcessor>::getLogger()) {
+    client_ = nullptr;
+    cleanSession_ = false;
+    keepAliveInterval_ = 60;
+    connectionTimeOut_ = 30;
+    qos_ = 0;
+    isSubscriber_ = false;
+  }
+  // Destructor
+  virtual ~AbstractMQTTProcessor() {
+    if (isSubscriber_) {
+      MQTTClient_unsubscribe(client_, topic_.c_str());
+    }
+    if (client_ && MQTTClient_isConnected(client_)) {
+      MQTTClient_disconnect(client_, connectionTimeOut_);
+    }
+    if (client_)
+      MQTTClient_destroy(&client_);
+  }
+  // Processor Name
+  static constexpr char const* ProcessorName = "AbstractMQTTProcessor";
+  // Supported Properties
+  static core::Property BrokerURL;
+  static core::Property ClientID;
+  static core::Property UserName;
+  static core::Property PassWord;
+  static core::Property CleanSession;
+  static core::Property KeepLiveInterval;
+  static core::Property ConnectionTimeOut;
+  static core::Property Topic;
+  static core::Property QOS;
+
+  // Supported Relationships
+  static core::Relationship Failure;
+  static core::Relationship Success;
+
+ public:
+  /**
+   * Function that's executed when the processor is scheduled.
+   * @param context process context.
+   * @param sessionFactory process session factory that is used when creating
+   * ProcessSession objects.
+   */
+  virtual void onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory);
+  // OnTrigger method, implemented by NiFi AbstractMQTTProcessor
+  virtual void onTrigger(core::ProcessContext *context, core::ProcessSession *session) {
+  }
+  // OnTrigger method, implemented by NiFi AbstractMQTTProcessor
+  virtual void onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) {
+  }
+  // Initialize, over write by NiFi AbstractMQTTProcessor
+  virtual void initialize(void);
+  // MQTT async callbacks
+  static void msgDelivered(void *context, MQTTClient_deliveryToken dt) {
+    AbstractMQTTProcessor *processor = (AbstractMQTTProcessor *) context;
+    processor->delivered_token_ = dt;
+  }
+  static int msgReceived(void *context, char *topicName, int topicLen, MQTTClient_message *message) {
+    AbstractMQTTProcessor *processor = (AbstractMQTTProcessor *) context;
+    if (processor->isSubscriber_) {
+      if (!processor->enqueueReceiveMQTTMsg(message))
+        MQTTClient_freeMessage(&message);
+    } else {
+      MQTTClient_freeMessage(&message);
+    }
+    MQTTClient_free(topicName);
+    return 1;
+  }
+  static void connectionLost(void *context, char *cause) {
+    AbstractMQTTProcessor *processor = (AbstractMQTTProcessor *) context;
+    processor->reconnect();
+  }
+  bool reconnect();
+  // enqueue receive MQTT message
+  virtual bool enqueueReceiveMQTTMsg(MQTTClient_message *message) {
+    return false;
+  }
+
+ protected:
+  MQTTClient client_;
+  MQTTClient_deliveryToken delivered_token_;
+  std::string uri_;
+  std::string topic_;
+  int64_t keepAliveInterval_;
+  int64_t connectionTimeOut_;
+  int64_t qos_;
+  bool cleanSession_;
+  std::string clientID_;
+  std::string userName_;
+  std::string passWord_;
+  bool isSubscriber_;
+
+ private:
+  std::shared_ptr<logging::Logger> logger_;
+};
+
+REGISTER_RESOURCE(AbstractMQTTProcessor);
+
+} /* namespace processors */
+} /* namespace minifi */
+} /* namespace nifi */
+} /* namespace apache */
+} /* namespace org */
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/extensions/mqtt/CMakeLists.txt b/extensions/mqtt/CMakeLists.txt
new file mode 100644
index 0000000..7e186ba
--- /dev/null
+++ b/extensions/mqtt/CMakeLists.txt
@@ -0,0 +1,75 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set(CMAKE_EXE_LINKER_FLAGS "-Wl,--export-all-symbols")
+set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-symbols")
+
+include_directories(../../libminifi/include  ../../libminifi/include/core  ../../thirdparty/spdlog-20170710/include ../../thirdparty/concurrentqueue ../../thirdparty/yaml-cpp-yaml-cpp-0.5.3/include ${CIVET_THIRDPARTY_ROOT}/include ../../thirdparty/jsoncpp/include  ../../thirdparty/)
+
+include_directories(../../thirdparty/paho.mqtt.c/src)
+
+file(GLOB SOURCES  "*.cpp")
+
+add_library(minifi-mqtt-extensions STATIC ${SOURCES})
+set_property(TARGET minifi-mqtt-extensions PROPERTY POSITION_INDEPENDENT_CODE ON)
+if(THREADS_HAVE_PTHREAD_ARG)
+  target_compile_options(PUBLIC minifi-mqtt-extensions "-pthread")
+endif()
+if(CMAKE_THREAD_LIBS_INIT)
+  target_link_libraries(minifi-mqtt-extensions "${CMAKE_THREAD_LIBS_INIT}")
+endif()
+
+
+# Include UUID
+find_package(UUID REQUIRED)
+target_link_libraries(minifi-mqtt-extensions ${LIBMINIFI} ${UUID_LIBRARIES} ${JSONCPP_LIB})
+add_dependencies(minifi-mqtt-extensions jsoncpp_project)
+find_package(OpenSSL REQUIRED)
+include_directories(${OPENSSL_INCLUDE_DIR})
+target_link_libraries(minifi-mqtt-extensions ${CMAKE_DL_LIBS} )
+if (MQTT_FOUND AND NOT BUILD_MQTT)
+	target_link_libraries(minifi-mqtt-extensions ${MQTT_LIBRARIES} )
+else()
+	target_link_libraries(minifi-mqtt-extensions paho-mqtt3a )
+	target_link_libraries(minifi-mqtt-extensions paho-mqtt3c )
+	target_link_libraries(minifi-mqtt-extensions paho-mqtt3as )
+	target_link_libraries(minifi-mqtt-extensions paho-mqtt3cs )
+endif()
+find_package(ZLIB REQUIRED)
+include_directories(${ZLIB_INCLUDE_DIRS})
+target_link_libraries (minifi-mqtt-extensions ${ZLIB_LIBRARIES})
+if (WIN32)
+    set_target_properties(minifi-mqtt-extensions PROPERTIES
+        LINK_FLAGS "/WHOLEMQTT"
+    )
+elseif (APPLE)
+    set_target_properties(minifi-mqtt-extensions PROPERTIES
+        LINK_FLAGS "-Wl,-all_load"
+    )
+else ()
+    set_target_properties(minifi-mqtt-extensions PROPERTIES
+        LINK_FLAGS "-Wl,--whole-mqtt"
+    )
+endif ()
+
+
+SET (MQTT-EXTENSIONS minifi-mqtt-extensions PARENT_SCOPE)
+
+register_extension(minifi-mqtt-extensions)
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/ConsumeMQTT.cpp
----------------------------------------------------------------------
diff --git a/extensions/mqtt/ConsumeMQTT.cpp b/extensions/mqtt/ConsumeMQTT.cpp
new file mode 100644
index 0000000..12de6bf
--- /dev/null
+++ b/extensions/mqtt/ConsumeMQTT.cpp
@@ -0,0 +1,110 @@
+/**
+ * @file ConsumeMQTT.cpp
+ * ConsumeMQTT class implementation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "ConsumeMQTT.h"
+#include <stdio.h>
+#include <algorithm>
+#include <memory>
+#include <string>
+#include <map>
+#include <set>
+#include "utils/TimeUtil.h"
+#include "utils/StringUtils.h"
+#include "core/ProcessContext.h"
+#include "core/ProcessSession.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+core::Property ConsumeMQTT::MaxQueueSize("Max Flow Segment Size", "Maximum flow content payload segment size for the MQTT record", "");
+
+void ConsumeMQTT::initialize() {
+  // Set the supported properties
+  std::set<core::Property> properties;
+  properties.insert(BrokerURL);
+  properties.insert(CleanSession);
+  properties.insert(ClientID);
+  properties.insert(UserName);
+  properties.insert(PassWord);
+  properties.insert(KeepLiveInterval);
+  properties.insert(ConnectionTimeOut);
+  properties.insert(QOS);
+  properties.insert(Topic);
+  properties.insert(MaxQueueSize);
+  setSupportedProperties(properties);
+  // Set the supported relationships
+  std::set<core::Relationship> relationships;
+  relationships.insert(Success);
+  setSupportedRelationships(relationships);
+}
+
+bool ConsumeMQTT::enqueueReceiveMQTTMsg(MQTTClient_message *message) {
+  if (queue_.size_approx() >= maxQueueSize_) {
+    logger_->log_debug("MQTT queue full");
+    return false;
+  } else {
+    queue_.enqueue(message);
+    logger_->log_debug("enqueue MQTT message length %d", message->payloadlen);
+    return true;
+  }
+}
+
+void ConsumeMQTT::onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory) {
+  AbstractMQTTProcessor::onSchedule(context, sessionFactory);
+  std::string value;
+  int64_t valInt;
+  value = "";
+  if (context->getProperty(MaxQueueSize.getName(), value) && !value.empty() && core::Property::StringToInt(value, valInt)) {
+    maxQueueSize_ = valInt;
+    logger_->log_info("ConsumeMQTT: max queue size [%ll]", maxQueueSize_);
+  }
+}
+
+void ConsumeMQTT::onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) {
+  // reconnect if necessary
+  reconnect();
+  std::deque<MQTTClient_message *> msg_queue;
+  getReceivedMQTTMsg(msg_queue);
+  while (!msg_queue.empty()) {
+    MQTTClient_message *message = msg_queue.front();
+    std::shared_ptr<core::FlowFile> processFlowFile = session->create();
+    ConsumeMQTT::WriteCallback callback(message);
+    session->write(processFlowFile, &callback);
+    if (callback.status_ < 0) {
+      logger_->log_error("ConsumeMQTT fail for the flow with UUID %s", processFlowFile->getUUIDStr());
+      session->remove(processFlowFile);
+    } else {
+      session->putAttribute(processFlowFile, MQTT_BROKER_ATTRIBUTE, uri_.c_str());
+      session->putAttribute(processFlowFile, MQTT_TOPIC_ATTRIBUTE, topic_.c_str());
+      logger_->log_debug("ConsumeMQTT processing success for the flow with UUID %s topic %s", processFlowFile->getUUIDStr(), topic_);
+      session->transfer(processFlowFile, Success);
+    }
+    MQTTClient_freeMessage(&message);
+    msg_queue.pop_front();
+  }
+}
+
+} /* namespace processors */
+} /* namespace minifi */
+} /* namespace nifi */
+} /* namespace apache */
+} /* namespace org */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/ConsumeMQTT.h
----------------------------------------------------------------------
diff --git a/extensions/mqtt/ConsumeMQTT.h b/extensions/mqtt/ConsumeMQTT.h
new file mode 100644
index 0000000..f5155fb
--- /dev/null
+++ b/extensions/mqtt/ConsumeMQTT.h
@@ -0,0 +1,122 @@
+/**
+ * @file ConsumeMQTT.h
+ * ConsumeMQTT class declaration
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __CONSUME_MQTT_H__
+#define __CONSUME_MQTT_H__
+
+#include <climits>
+#include <deque>
+#include "FlowFileRecord.h"
+#include "core/Processor.h"
+#include "core/ProcessSession.h"
+#include "core/Core.h"
+#include "core/Resource.h"
+#include "core/Property.h"
+#include "core/logging/LoggerConfiguration.h"
+#include "concurrentqueue.h"
+#include "MQTTClient.h"
+#include "AbstractMQTTProcessor.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+#define MQTT_TOPIC_ATTRIBUTE "mqtt.topic"
+#define MQTT_BROKER_ATTRIBUTE "mqtt.broker"
+
+// ConsumeMQTT Class
+class ConsumeMQTT: public processors::AbstractMQTTProcessor {
+public:
+  // Constructor
+  /*!
+   * Create a new processor
+   */
+  explicit ConsumeMQTT(std::string name, uuid_t uuid = NULL)
+    : processors::AbstractMQTTProcessor(name, uuid), logger_(logging::LoggerFactory<ConsumeMQTT>::getLogger()) {
+    isSubscriber_ = true;
+    maxQueueSize_ = 100;
+  }
+  // Destructor
+  virtual ~ConsumeMQTT() {
+    MQTTClient_message *message;
+    while (queue_.try_dequeue(message)) {
+      MQTTClient_freeMessage(&message);
+    }
+  }
+  // Processor Name
+  static constexpr char const* ProcessorName = "ConsumeMQTT";
+  // Supported Properties
+  static core::Property MaxQueueSize;
+  // Nest Callback Class for write stream
+  class WriteCallback: public OutputStreamCallback {
+  public:
+    WriteCallback(MQTTClient_message *message) :
+      message_(message) {
+      status_ = 0;
+    }
+    MQTTClient_message *message_;
+    int64_t process(std::shared_ptr<io::BaseStream> stream) {
+      int64_t len = stream->write(reinterpret_cast<uint8_t*>(message_->payload), message_->payloadlen);
+      if (len < 0)
+        status_ = -1;
+      return len;
+    }
+    int status_;
+  };
+
+public:
+  /**
+   * Function that's executed when the processor is scheduled.
+   * @param context process context.
+   * @param sessionFactory process session factory that is used when creating
+   * ProcessSession objects.
+   */
+  void onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory);
+  // OnTrigger method, implemented by NiFi ConsumeMQTT
+  virtual void onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session);
+  // Initialize, over write by NiFi ConsumeMQTT
+  virtual void initialize(void);
+  virtual bool enqueueReceiveMQTTMsg(MQTTClient_message *message);
+
+protected:
+  void getReceivedMQTTMsg(std::deque<MQTTClient_message *> &msg_queue) {
+    MQTTClient_message *message;
+    while (queue_.try_dequeue(message)) {
+      msg_queue.push_back(message);
+    }
+  }
+
+private:
+  std::shared_ptr<logging::Logger> logger_;
+  std::mutex mutex_;
+  uint64_t maxQueueSize_;
+  moodycamel::ConcurrentQueue<MQTTClient_message *> queue_;
+};
+
+REGISTER_RESOURCE (ConsumeMQTT);
+
+} /* namespace processors */
+} /* namespace minifi */
+} /* namespace nifi */
+} /* namespace apache */
+} /* namespace org */
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/MQTTLoader.cpp
----------------------------------------------------------------------
diff --git a/extensions/mqtt/MQTTLoader.cpp b/extensions/mqtt/MQTTLoader.cpp
new file mode 100644
index 0000000..869d41f
--- /dev/null
+++ b/extensions/mqtt/MQTTLoader.cpp
@@ -0,0 +1,29 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "MQTTLoader.h"
+#include "core/FlowConfiguration.h"
+
+bool MQTTFactory::added = core::FlowConfiguration::add_static_func("createMQTTFactory");
+
+extern "C" {
+
+void *createMQTTFactory(void) {
+  return new MQTTFactory();
+}
+
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/MQTTLoader.h
----------------------------------------------------------------------
diff --git a/extensions/mqtt/MQTTLoader.h b/extensions/mqtt/MQTTLoader.h
new file mode 100644
index 0000000..d337af5
--- /dev/null
+++ b/extensions/mqtt/MQTTLoader.h
@@ -0,0 +1,72 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef EXTENSION_MQTTLOADER_H
+#define EXTENSION_MQTTLOADER_H
+
+#include "PublishMQTT.h"
+#include "ConsumeMQTT.h"
+#include "core/ClassLoader.h"
+
+class __attribute__((visibility("default"))) MQTTFactory : public core::ObjectFactory {
+ public:
+  MQTTFactory() {
+
+  }
+
+  /**
+   * Gets the name of the object.
+   * @return class name of processor
+   */
+  virtual std::string getName() {
+    return "MQTTFactory";
+  }
+
+  virtual std::string getClassName() {
+    return "MQTTFactory";
+  }
+  /**
+   * Gets the class name for the object
+   * @return class name for the processor.
+   */
+  virtual std::vector<std::string> getClassNames() {
+    std::vector<std::string> class_names;
+    class_names.push_back("PublishMQTT");
+    class_names.push_back("ConsumeMQTT");
+    return class_names;
+  }
+
+  virtual std::unique_ptr<ObjectFactory> assign(const std::string &class_name) {
+    if (utils::StringUtils::equalsIgnoreCase(class_name, "PublishMQTT")) {
+      return std::unique_ptr<ObjectFactory>(new core::DefautObjectFactory<minifi::processors::PublishMQTT>());
+    }
+    else if (utils::StringUtils::equalsIgnoreCase(class_name, "ConsumeMQTT")) {
+      return std::unique_ptr<ObjectFactory>(new core::DefautObjectFactory<minifi::processors::ConsumeMQTT>());
+    }
+    else {
+      return nullptr;
+    }
+  }
+
+  static bool added;
+
+};
+
+extern "C" {
+void *createMQTTFactory(void);
+}
+#endif /* EXTENSION_MQTTLOADER_H */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/PublishMQTT.cpp
----------------------------------------------------------------------
diff --git a/extensions/mqtt/PublishMQTT.cpp b/extensions/mqtt/PublishMQTT.cpp
new file mode 100644
index 0000000..44ce298
--- /dev/null
+++ b/extensions/mqtt/PublishMQTT.cpp
@@ -0,0 +1,106 @@
+/**
+ * @file PublishMQTT.cpp
+ * PublishMQTT class implementation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "PublishMQTT.h"
+#include <stdio.h>
+#include <algorithm>
+#include <memory>
+#include <string>
+#include <map>
+#include <set>
+#include "utils/TimeUtil.h"
+#include "utils/StringUtils.h"
+#include "core/ProcessContext.h"
+#include "core/ProcessSession.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+core::Property PublishMQTT::Retain("Retain", "Retain MQTT published record in broker", "false");
+core::Property PublishMQTT::MaxFlowSegSize("Max Flow Segment Size", "Maximum flow content payload segment size for the MQTT record", "");
+
+void PublishMQTT::initialize() {
+  // Set the supported properties
+  std::set<core::Property> properties;
+  properties.insert(BrokerURL);
+  properties.insert(CleanSession);
+  properties.insert(ClientID);
+  properties.insert(UserName);
+  properties.insert(PassWord);
+  properties.insert(KeepLiveInterval);
+  properties.insert(ConnectionTimeOut);
+  properties.insert(QOS);
+  properties.insert(Topic);
+  properties.insert(Retain);
+  properties.insert(MaxFlowSegSize);
+  setSupportedProperties(properties);
+  // Set the supported relationships
+  std::set<core::Relationship> relationships;
+  relationships.insert(Success);
+  relationships.insert(Failure);
+  setSupportedRelationships(relationships);
+}
+
+void PublishMQTT::onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory) {
+  AbstractMQTTProcessor::onSchedule(context, sessionFactory);
+  std::string value;
+  int64_t valInt;
+  value = "";
+  if (context->getProperty(MaxFlowSegSize.getName(), value) && !value.empty() && core::Property::StringToInt(value, valInt)) {
+    max_seg_size_ = valInt;
+    logger_->log_info("PublishMQTT: max flow segment size [%ll]", max_seg_size_);
+  }
+  value = "";
+  if (context->getProperty(Retain.getName(), value) && !value.empty() && org::apache::nifi::minifi::utils::StringUtils::StringToBool(value, retain_)) {
+    logger_->log_info("PublishMQTT: Retain [%d]", retain_);
+  }
+}
+
+void PublishMQTT::onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session) {
+  std::shared_ptr<core::FlowFile> flowFile = session->get();
+
+  if (!flowFile) {
+    return;
+  }
+
+  if (!reconnect()) {
+    logger_->log_error("MQTT connect to %s failed", uri_);
+    session->transfer(flowFile, Failure);
+    return;
+  }
+
+  PublishMQTT::ReadCallback callback(flowFile->getSize(), max_seg_size_, topic_, client_, qos_, retain_, delivered_token_);
+  session->read(flowFile, &callback);
+  if (callback.status_ < 0) {
+    logger_->log_error("Failed to send flow to MQTT topic %s", topic_);
+    session->transfer(flowFile, Failure);
+  } else {
+    logger_->log_debug("Sent flow with length %d to MQTT topic %s", callback.read_size_, topic_);
+    session->transfer(flowFile, Success);
+  }
+}
+
+} /* namespace processors */
+} /* namespace minifi */
+} /* namespace nifi */
+} /* namespace apache */
+} /* namespace org */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/extensions/mqtt/PublishMQTT.h
----------------------------------------------------------------------
diff --git a/extensions/mqtt/PublishMQTT.h b/extensions/mqtt/PublishMQTT.h
new file mode 100644
index 0000000..ed17bd4
--- /dev/null
+++ b/extensions/mqtt/PublishMQTT.h
@@ -0,0 +1,142 @@
+/**
+ * @file PublishMQTT.h
+ * PublishMQTT class declaration
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __PUBLISH_MQTT_H__
+#define __PUBLISH_MQTT_H__
+
+#include "FlowFileRecord.h"
+#include "core/Processor.h"
+#include "core/ProcessSession.h"
+#include "core/Core.h"
+#include "core/Resource.h"
+#include "core/Property.h"
+#include "core/logging/LoggerConfiguration.h"
+#include "MQTTClient.h"
+#include "AbstractMQTTProcessor.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+// PublishMQTT Class
+class PublishMQTT: public processors::AbstractMQTTProcessor {
+public:
+  // Constructor
+  /*!
+   * Create a new processor
+   */
+  explicit PublishMQTT(std::string name, uuid_t uuid = NULL)
+    : processors::AbstractMQTTProcessor(name, uuid), logger_(logging::LoggerFactory<PublishMQTT>::getLogger()) {
+    retain_ = false;
+    max_seg_size_ = ULLONG_MAX;
+  }
+  // Destructor
+  virtual ~PublishMQTT() {
+  }
+  // Processor Name
+  static constexpr char const* ProcessorName = "PublishMQTT";
+  // Supported Properties
+  static core::Property Retain;
+  static core::Property MaxFlowSegSize;
+
+  // Nest Callback Class for read stream
+  class ReadCallback: public InputStreamCallback {
+  public:
+    ReadCallback(uint64_t flow_size, uint64_t max_seg_size, const std::string &key, MQTTClient client,
+        int qos, bool retain, MQTTClient_deliveryToken &token) :
+        flow_size_(flow_size), max_seg_size_(max_seg_size), key_(key), client_(client),
+        qos_(qos), retain_(retain), token_(token) {
+      status_ = 0;
+      read_size_ = 0;
+    }
+    ~ReadCallback() {
+    }
+    int64_t process(std::shared_ptr<io::BaseStream> stream) {
+      if (flow_size_ < max_seg_size_)
+        max_seg_size_ = flow_size_;
+      std::vector<unsigned char> buffer;
+      buffer.reserve(max_seg_size_);
+      read_size_ = 0;
+      status_ = 0;
+      while (read_size_ < flow_size_) {
+        int readRet = stream->read(&buffer[0], max_seg_size_);
+        if (readRet < 0) {
+          status_ = -1;
+          return read_size_;
+        }
+        if (readRet > 0) {
+          MQTTClient_message pubmsg = MQTTClient_message_initializer;
+          pubmsg.payload = &buffer[0];
+          pubmsg.payloadlen = readRet;
+          pubmsg.qos = qos_;
+          pubmsg.retained = retain_;
+          if (MQTTClient_publishMessage(client_, key_.c_str(), &pubmsg, &token_) != MQTTCLIENT_SUCCESS) {
+            status_ = -1;
+            return -1;
+          }
+          read_size_ += readRet;
+        } else {
+          break;
+        }
+      }
+      return read_size_;
+    }
+    uint64_t flow_size_;
+    uint64_t max_seg_size_;
+    std::string key_;
+    MQTTClient client_;;
+    int status_;
+    int read_size_;
+    int qos_;
+    int retain_;
+    MQTTClient_deliveryToken &token_;
+  };
+
+public:
+  /**
+   * Function that's executed when the processor is scheduled.
+   * @param context process context.
+   * @param sessionFactory process session factory that is used when creating
+   * ProcessSession objects.
+   */
+  void onSchedule(core::ProcessContext *context, core::ProcessSessionFactory *sessionFactory);
+  // OnTrigger method, implemented by NiFi PublishMQTT
+  virtual void onTrigger(const std::shared_ptr<core::ProcessContext> &context, const std::shared_ptr<core::ProcessSession> &session);
+  // Initialize, over write by NiFi PublishMQTT
+  virtual void initialize(void);
+
+protected:
+
+private:
+  uint64_t max_seg_size_;
+  bool retain_;
+  std::shared_ptr<logging::Logger> logger_;
+};
+
+REGISTER_RESOURCE (PublishMQTT);
+
+} /* namespace processors */
+} /* namespace minifi */
+} /* namespace nifi */
+} /* namespace apache */
+} /* namespace org */
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/libminifi/test/mqtt-tests/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/libminifi/test/mqtt-tests/CMakeLists.txt b/libminifi/test/mqtt-tests/CMakeLists.txt
new file mode 100644
index 0000000..1e465b1
--- /dev/null
+++ b/libminifi/test/mqtt-tests/CMakeLists.txt
@@ -0,0 +1,39 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+file(GLOB KAFKA_INTEGRATION_TESTS  "*.cpp")
+
+SET(EXTENSIONS_TEST_COUNT 0)
+FOREACH(testfile ${KAFKA_INTEGRATION_TESTS})
+	get_filename_component(testfilename "${testfile}" NAME_WE)
+	add_executable("${testfilename}" "${testfile}")
+	target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/librdkafka")
+	target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src")
+	target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka-0.11.1/src-cpp")
+	createTests("${testfilename}")
+	target_link_libraries(${testfilename} ${CATCH_MAIN_LIB})
+	if (APPLE)
+	      target_link_libraries (${testfilename} -Wl,-all_load minifi-rdkafka-extensions)
+	else ()
+	    target_link_libraries (${testfilename} -Wl,--whole-archive minifi-rdkafka-extensions -Wl,--no-whole-archive)
+	endif ()
+	MATH(EXPR EXTENSIONS_TEST_COUNT "${EXTENSIONS_TEST_COUNT}+1")
+	add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
+ENDFOREACH()
+message("-- Finished building ${KAFKA-EXTENSIONS_TEST_COUNT} Lib Kafka related test file(s)...")

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/.gitignore
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/.gitignore b/thirdparty/paho.mqtt.c/.gitignore
new file mode 100644
index 0000000..5b2b31f
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/.gitignore
@@ -0,0 +1,6 @@
+/dep/
+/build/
+/build.paho/
+*.swp
+*.pyc
+/build.paho

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/.gitreview
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/.gitreview b/thirdparty/paho.mqtt.c/.gitreview
new file mode 100644
index 0000000..2d16be7
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=git.eclipse.org
+port=29418
+project=paho/org.eclipse.paho.mqtt.c
+defaultbranch=develop

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/.pydevproject
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/.pydevproject b/thirdparty/paho.mqtt.c/.pydevproject
new file mode 100644
index 0000000..40e9f40
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/.pydevproject
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?eclipse-pydev version="1.0"?><pydev_project>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
+</pydev_project>

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/CMakeLists.txt b/thirdparty/paho.mqtt.c/CMakeLists.txt
new file mode 100644
index 0000000..35c3fc7
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/CMakeLists.txt
@@ -0,0 +1,86 @@
+#*******************************************************************************
+#  Copyright (c) 2015, 2017 logi.cals GmbH and others
+#
+#  All rights reserved. This program and the accompanying materials
+#  are made available under the terms of the Eclipse Public License v1.0
+#  and Eclipse Distribution License v1.0 which accompany this distribution.
+#
+#  The Eclipse Public License is available at
+#     http://www.eclipse.org/legal/epl-v10.html
+#  and the Eclipse Distribution License is available at
+#    http://www.eclipse.org/org/documents/edl-v10.php.
+#
+#  Contributors:
+#     Rainer Poisel - initial version
+#     Genis Riera Perez - Add support for building debian package
+#*******************************************************************************/
+
+# Note: on OS X you should install XCode and the associated command-line tools
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.4)
+PROJECT("paho" C)
+MESSAGE(STATUS "CMake version: " ${CMAKE_VERSION})
+MESSAGE(STATUS "CMake system name: " ${CMAKE_SYSTEM_NAME})
+
+SET(CMAKE_SCRIPTS "${CMAKE_SOURCE_DIR}/cmake")
+SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
+
+## build settings
+SET(PAHO_VERSION_MAJOR 1)
+SET(PAHO_VERSION_MINOR 2)
+SET(PAHO_VERSION_PATCH 0)
+SET(CLIENT_VERSION ${PAHO_VERSION_MAJOR}.${PAHO_VERSION_MINOR}.${PAHO_VERSION_PATCH})
+
+INCLUDE(GNUInstallDirs)
+
+STRING(TIMESTAMP BUILD_TIMESTAMP UTC)
+MESSAGE(STATUS "Timestamp is ${BUILD_TIMESTAMP}")
+
+IF(WIN32)
+  ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD)
+ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+  ADD_DEFINITIONS(-DOSX)
+ENDIF()
+
+## build options
+SET(PAHO_WITH_SSL TRUE CACHE BOOL "Flag that defines whether to build ssl-enabled binaries too. ")
+SET(PAHO_BUILD_STATIC FALSE CACHE BOOL "Build static library")
+SET(PAHO_BUILD_DOCUMENTATION FALSE CACHE BOOL "Create and install the HTML based API documentation (requires Doxygen)")
+SET(PAHO_BUILD_SAMPLES FALSE CACHE BOOL "Build sample programs")
+SET(PAHO_BUILD_DEB_PACKAGE FALSE CACHE BOOL "Build debian package")
+SET(PAHO_ENABLE_TESTING FALSE CACHE BOOL "Build tests and run")
+
+ADD_SUBDIRECTORY(src)
+IF(PAHO_BUILD_SAMPLES)
+    ADD_SUBDIRECTORY(src/samples)
+ENDIF()
+
+IF(PAHO_BUILD_DOCUMENTATION)
+    ADD_SUBDIRECTORY(doc)
+ENDIF()
+
+### packaging settings
+IF (WIN32)
+    SET(CPACK_GENERATOR "ZIP")
+ELSEIF(PAHO_BUILD_DEB_PACKAGE)
+    SET(CPACK_GENERATOR "DEB")
+    CONFIGURE_FILE(${CMAKE_SCRIPTS}/CPackDebConfig.cmake.in
+        ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake @ONLY)
+    SET(CPACK_PROJECT_CONFIG_FILE ${CMAKE_BINARY_DIR}/CPackDebConfig.cmake)
+    ADD_SUBDIRECTORY(debian)
+ELSE()
+    SET(CPACK_GENERATOR "TGZ")
+ENDIF()
+
+SET(CPACK_PACKAGE_VERSION_MAJOR ${PAHO_VERSION_MAJOR})
+SET(CPACK_PACKAGE_VERSION_MINOR ${PAHO_VERSION_MINOR})
+SET(CPACK_PACKAGE_VERSION_PATCH ${PAHO_VERSION_PATCH})
+INCLUDE(CPack)
+
+IF(PAHO_ENABLE_TESTING)
+    ENABLE_TESTING()
+    INCLUDE_DIRECTORIES(test src)
+    ADD_SUBDIRECTORY(test)
+ELSE()
+    INCLUDE_DIRECTORIES(src)
+ENDIF()

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/CONTRIBUTING.md b/thirdparty/paho.mqtt.c/CONTRIBUTING.md
new file mode 100644
index 0000000..1ebe9d1
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/CONTRIBUTING.md
@@ -0,0 +1,66 @@
+# Contributing to Paho
+
+Thanks for your interest in this project!
+
+You can contribute bugfixes and new features by sending pull requests through GitHub.
+
+## Legal
+
+In order for your contribution to be accepted, it must comply with the Eclipse Foundation IP policy.
+
+Please read the [Eclipse Foundation policy on accepting contributions via Git](http://wiki.eclipse.org/Development_Resources/Contributing_via_Git).
+
+1. Sign the [Eclipse CLA](http://www.eclipse.org/legal/CLA.php)
+  1. Register for an Eclipse Foundation User ID. You can register [here](https://dev.eclipse.org/site_login/createaccount.php).
+  2. Log into the [Projects Portal](https://projects.eclipse.org/), and click on the '[Eclipse CLA](https://projects.eclipse.org/user/sign/cla)' link.
+2. Go to your [account settings](https://dev.eclipse.org/site_login/myaccount.php#open_tab_accountsettings) and add your GitHub username to your account.
+3. Make sure that you _sign-off_ your Git commits in the following format:
+  ``` Signed-off-by: John Smith <jo...@nowhere.com> ``` This is usually at the bottom of the commit message. You can automate this by adding the '-s' flag when you make the commits. e.g.   ```git commit -s -m "Adding a cool feature"```
+4. Ensure that the email address that you make your commits with is the same one you used to sign up to the Eclipse Foundation website with.
+
+## Contributing a change
+
+1. [Fork the repository on GitHub](https://github.com/eclipse/paho.mqtt.c/fork)
+2. Clone the forked repository onto your computer: ``` git clone https://github.com/<your username>/paho.mqtt.c.git ```
+3. Create a new branch from the latest ```develop``` branch with ```git checkout -b YOUR_BRANCH_NAME origin/develop```
+4. Make your changes
+5. If developing a new feature, make sure to include JUnit tests.
+6. Ensure that all new and existing tests pass.
+7. Commit the changes into the branch: ``` git commit -s ``` Make sure that your commit message is meaningful and describes your changes correctly.
+8. If you have a lot of commits for the change, squash them into a single / few commits.
+9. Push the changes in your branch to your forked repository.
+10. Finally, go to [https://github.com/eclipse/paho.mqtt.c](https://github.com/eclipse/paho.mqtt.c) and create a pull request from your "YOUR_BRANCH_NAME" branch to the ```develop``` one to request review and merge of the commits in your pushed branch.
+
+
+What happens next depends on the content of the patch. If it is 100% authored
+by the contributor and is less than 1000 lines (and meets the needs of the
+project), then it can be pulled into the main repository. If not, more steps
+are required. These are detailed in the
+[legal process poster](http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf).
+
+
+
+## Developer resources:
+
+
+Information regarding source code management, builds, coding standards, and more.
+
+- [https://projects.eclipse.org/projects/iot.paho/developer](https://projects.eclipse.org/projects/iot.paho/developer)
+
+Contact:
+--------
+
+Contact the project developers via the project's development
+[mailing list](https://dev.eclipse.org/mailman/listinfo/paho-dev).
+
+Search for bugs:
+----------------
+
+This project uses GitHub Issues here: [github.com/eclipse/paho.mqtt.c/issues](https://github.com/eclipse/paho.mqtt.c/issues) to track ongoing development and issues.
+
+Create a new bug:
+-----------------
+
+Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!
+
+- [Create new Paho bug](https://github.com/eclipse/paho.mqtt.c/issues/new)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Makefile
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Makefile b/thirdparty/paho.mqtt.c/Makefile
new file mode 100755
index 0000000..63d745f
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Makefile
@@ -0,0 +1,283 @@
+#*******************************************************************************
+#  Copyright (c) 2009, 2017 IBM Corp.
+#
+#  All rights reserved. This program and the accompanying materials
+#  are made available under the terms of the Eclipse Public License v1.0
+#  and Eclipse Distribution License v1.0 which accompany this distribution.
+#
+#  The Eclipse Public License is available at
+#     http://www.eclipse.org/legal/epl-v10.html
+#  and the Eclipse Distribution License is available at
+#    http://www.eclipse.org/org/documents/edl-v10.php.
+#
+#  Contributors:
+#     Ian Craggs - initial API and implementation and/or initial documentation
+#     Allan Stockdill-Mander - SSL updates
+#     Andy Piper - various fixes
+#     Ian Craggs - OSX build
+#     Rainer Poisel - support for multi-core builds and cross-compilation
+#*******************************************************************************/
+
+# Note: on OS X you should install XCode and the associated command-line tools
+
+SHELL = /bin/sh
+.PHONY: clean, mkdir, install, uninstall, html
+
+ifndef release.version
+  release.version = 1.2.0
+endif
+
+# determine current platform
+BUILD_TYPE ?= debug
+ifeq ($(OS),Windows_NT)
+	OSTYPE ?= $(OS)
+	MACHINETYPE ?= $(PROCESSOR_ARCHITECTURE)
+else
+	OSTYPE ?= $(shell uname -s)
+	MACHINETYPE ?= $(shell uname -m)
+	build.level = $(shell date)
+endif # OS
+ifeq ($(OSTYPE),linux)
+	OSTYPE = Linux
+endif
+
+# assume this is normally run in the main Paho directory
+ifndef srcdir
+  srcdir = src
+endif
+
+ifndef blddir
+  blddir = build/output
+endif
+
+ifndef blddir_work
+  blddir_work = build
+endif
+
+ifndef docdir
+  docdir = $(blddir)/doc
+endif
+
+ifndef docdir_work
+  docdir_work = $(blddir)/../doc
+endif
+
+ifndef prefix
+	prefix = /usr/local
+endif
+
+ifndef exec_prefix
+	exec_prefix = ${prefix}
+endif
+
+bindir = $(exec_prefix)/bin
+includedir = $(prefix)/include
+libdir = $(exec_prefix)/lib
+
+SOURCE_FILES = $(wildcard $(srcdir)/*.c)
+SOURCE_FILES_C = $(filter-out $(srcdir)/MQTTAsync.c $(srcdir)/MQTTVersion.c $(srcdir)/SSLSocket.c, $(SOURCE_FILES))
+SOURCE_FILES_CS = $(filter-out $(srcdir)/MQTTAsync.c $(srcdir)/MQTTVersion.c, $(SOURCE_FILES))
+SOURCE_FILES_A = $(filter-out $(srcdir)/MQTTClient.c $(srcdir)/MQTTVersion.c $(srcdir)/SSLSocket.c, $(SOURCE_FILES))
+SOURCE_FILES_AS = $(filter-out $(srcdir)/MQTTClient.c $(srcdir)/MQTTVersion.c, $(SOURCE_FILES))
+
+HEADERS = $(srcdir)/*.h
+HEADERS_C = $(filter-out $(srcdir)/MQTTAsync.h, $(HEADERS))
+HEADERS_A = $(HEADERS)
+
+SAMPLE_FILES_C = paho_cs_pub paho_cs_sub MQTTClient_publish MQTTClient_publish_async MQTTClient_subscribe
+SYNC_SAMPLES = ${addprefix ${blddir}/samples/,${SAMPLE_FILES_C}}
+
+SAMPLE_FILES_A = paho_c_pub paho_c_sub MQTTAsync_subscribe MQTTAsync_publish
+ASYNC_SAMPLES = ${addprefix ${blddir}/samples/,${SAMPLE_FILES_A}}
+
+TEST_FILES_C = test1 test2 sync_client_test test_mqtt4sync
+SYNC_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_C}}
+
+TEST_FILES_CS = test3
+SYNC_SSL_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_CS}}
+
+TEST_FILES_A = test4 test9 test_mqtt4async
+ASYNC_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_A}}
+
+TEST_FILES_AS = test5
+ASYNC_SSL_TESTS = ${addprefix ${blddir}/test/,${TEST_FILES_AS}}
+
+# The names of the four different libraries to be built
+MQTTLIB_C = paho-mqtt3c
+MQTTLIB_CS = paho-mqtt3cs
+MQTTLIB_A = paho-mqtt3a
+MQTTLIB_AS = paho-mqtt3as
+
+CC ?= gcc
+
+ifndef INSTALL
+INSTALL = install
+endif
+INSTALL_PROGRAM = $(INSTALL)
+INSTALL_DATA =  $(INSTALL) -m 644
+DOXYGEN_COMMAND = doxygen
+
+MAJOR_VERSION = 1
+MINOR_VERSION = 0
+VERSION = ${MAJOR_VERSION}.${MINOR_VERSION}
+
+MQTTLIB_C_TARGET = ${blddir}/lib${MQTTLIB_C}.so.${VERSION}
+MQTTLIB_CS_TARGET = ${blddir}/lib${MQTTLIB_CS}.so.${VERSION}
+MQTTLIB_A_TARGET = ${blddir}/lib${MQTTLIB_A}.so.${VERSION}
+MQTTLIB_AS_TARGET = ${blddir}/lib${MQTTLIB_AS}.so.${VERSION}
+MQTTVERSION_TARGET = ${blddir}/MQTTVersion
+
+CCFLAGS_SO = -g -fPIC $(CFLAGS) -Os -Wall -fvisibility=hidden -I$(blddir_work)
+FLAGS_EXE = $(LDFLAGS) -I ${srcdir} -lpthread -L ${blddir}
+FLAGS_EXES = $(LDFLAGS) -I ${srcdir} ${START_GROUP} -lpthread -lssl -lcrypto ${END_GROUP} -L ${blddir}
+
+LDCONFIG ?= /sbin/ldconfig
+LDFLAGS_C = $(LDFLAGS) -shared -Wl,-init,$(MQTTCLIENT_INIT) -lpthread
+LDFLAGS_CS = $(LDFLAGS) -shared $(START_GROUP) -lpthread $(EXTRA_LIB) -lssl -lcrypto $(END_GROUP) -Wl,-init,$(MQTTCLIENT_INIT)
+LDFLAGS_A = $(LDFLAGS) -shared -Wl,-init,$(MQTTASYNC_INIT) -lpthread
+LDFLAGS_AS = $(LDFLAGS) -shared $(START_GROUP) -lpthread $(EXTRA_LIB) -lssl -lcrypto $(END_GROUP) -Wl,-init,$(MQTTASYNC_INIT)
+
+SED_COMMAND = sed \
+    -e "s/@CLIENT_VERSION@/${release.version}/g" \
+    -e "s/@BUILD_TIMESTAMP@/${build.level}/g"
+
+ifeq ($(OSTYPE),Linux)
+
+MQTTCLIENT_INIT = MQTTClient_init
+MQTTASYNC_INIT = MQTTAsync_init
+START_GROUP = -Wl,--start-group
+END_GROUP = -Wl,--end-group
+
+EXTRA_LIB = -ldl
+
+LDFLAGS_C += -Wl,-soname,lib$(MQTTLIB_C).so.${MAJOR_VERSION}
+LDFLAGS_CS += -Wl,-soname,lib$(MQTTLIB_CS).so.${MAJOR_VERSION} -Wl,-no-whole-archive
+LDFLAGS_A += -Wl,-soname,lib${MQTTLIB_A}.so.${MAJOR_VERSION}
+LDFLAGS_AS += -Wl,-soname,lib${MQTTLIB_AS}.so.${MAJOR_VERSION} -Wl,-no-whole-archive
+
+else ifeq ($(OSTYPE),Darwin)
+
+MQTTCLIENT_INIT = _MQTTClient_init
+MQTTASYNC_INIT = _MQTTAsync_init
+START_GROUP =
+END_GROUP =
+
+EXTRA_LIB = -ldl
+
+CCFLAGS_SO += -Wno-deprecated-declarations -DOSX -I /usr/local/opt/openssl/include
+LDFLAGS_C += -Wl,-install_name,lib$(MQTTLIB_C).so.${MAJOR_VERSION}
+LDFLAGS_CS += -Wl,-install_name,lib$(MQTTLIB_CS).so.${MAJOR_VERSION} -L /usr/local/opt/openssl/lib
+LDFLAGS_A += -Wl,-install_name,lib${MQTTLIB_A}.so.${MAJOR_VERSION}
+LDFLAGS_AS += -Wl,-install_name,lib${MQTTLIB_AS}.so.${MAJOR_VERSION} -L /usr/local/opt/openssl/lib
+FLAGS_EXE += -DOSX
+FLAGS_EXES += -L /usr/local/opt/openssl/lib
+
+endif
+
+all: build
+
+build: | mkdir ${MQTTLIB_C_TARGET} ${MQTTLIB_CS_TARGET} ${MQTTLIB_A_TARGET} ${MQTTLIB_AS_TARGET} ${MQTTVERSION_TARGET} ${SYNC_SAMPLES} ${ASYNC_SAMPLES} ${SYNC_TESTS} ${SYNC_SSL_TESTS} ${ASYNC_TESTS} ${ASYNC_SSL_TESTS}
+
+clean:
+	rm -rf ${blddir}/*
+	rm -rf ${blddir_work}/*
+
+mkdir:
+	-mkdir -p ${blddir}/samples
+	-mkdir -p ${blddir}/test
+	echo OSTYPE is $(OSTYPE)
+
+${SYNC_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_C_TARGET)
+	${CC} -DNOSTACKTRACE $(srcdir)/Thread.c -g -o $@ $< -l${MQTTLIB_C} ${FLAGS_EXE}
+
+${SYNC_SSL_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_CS_TARGET)
+	${CC} -g -o $@ $< -l${MQTTLIB_CS} ${FLAGS_EXES}
+
+${ASYNC_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_CS_TARGET)
+	${CC} -g -o $@ $< -l${MQTTLIB_A} ${FLAGS_EXE}
+
+${ASYNC_SSL_TESTS}: ${blddir}/test/%: ${srcdir}/../test/%.c $(MQTTLIB_CS_TARGET) $(MQTTLIB_AS_TARGET)
+	${CC} -g -o $@ $< -l${MQTTLIB_AS} ${FLAGS_EXES}
+
+${SYNC_SAMPLES}: ${blddir}/samples/%: ${srcdir}/samples/%.c $(MQTTLIB_C_TARGET)
+	${CC} -o $@ $< -l${MQTTLIB_C} ${FLAGS_EXE}
+
+${ASYNC_SAMPLES}: ${blddir}/samples/%: ${srcdir}/samples/%.c $(MQTTLIB_A_TARGET)
+	${CC} -o $@ $< -l${MQTTLIB_A} ${FLAGS_EXE}
+
+$(blddir_work)/VersionInfo.h: $(srcdir)/VersionInfo.h.in
+	$(SED_COMMAND) $< > $@
+
+${MQTTLIB_C_TARGET}: ${SOURCE_FILES_C} ${HEADERS_C} $(blddir_work)/VersionInfo.h
+	${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_C} ${LDFLAGS_C}
+	-ln -s lib$(MQTTLIB_C).so.${VERSION}  ${blddir}/lib$(MQTTLIB_C).so.${MAJOR_VERSION}
+	-ln -s lib$(MQTTLIB_C).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_C).so
+
+${MQTTLIB_CS_TARGET}: ${SOURCE_FILES_CS} ${HEADERS_C} $(blddir_work)/VersionInfo.h
+	${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_CS} -DOPENSSL ${LDFLAGS_CS}
+	-ln -s lib$(MQTTLIB_CS).so.${VERSION}  ${blddir}/lib$(MQTTLIB_CS).so.${MAJOR_VERSION}
+	-ln -s lib$(MQTTLIB_CS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_CS).so
+
+${MQTTLIB_A_TARGET}: ${SOURCE_FILES_A} ${HEADERS_A} $(blddir_work)/VersionInfo.h
+	${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_A} ${LDFLAGS_A}
+	-ln -s lib$(MQTTLIB_A).so.${VERSION}  ${blddir}/lib$(MQTTLIB_A).so.${MAJOR_VERSION}
+	-ln -s lib$(MQTTLIB_A).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_A).so
+
+${MQTTLIB_AS_TARGET}: ${SOURCE_FILES_AS} ${HEADERS_A} $(blddir_work)/VersionInfo.h
+	${CC} ${CCFLAGS_SO} -o $@ ${SOURCE_FILES_AS} -DOPENSSL ${LDFLAGS_AS}
+	-ln -s lib$(MQTTLIB_AS).so.${VERSION}  ${blddir}/lib$(MQTTLIB_AS).so.${MAJOR_VERSION}
+	-ln -s lib$(MQTTLIB_AS).so.${MAJOR_VERSION} ${blddir}/lib$(MQTTLIB_AS).so
+
+${MQTTVERSION_TARGET}: $(srcdir)/MQTTVersion.c $(srcdir)/MQTTAsync.h ${MQTTLIB_A_TARGET} $(MQTTLIB_CS_TARGET)
+	${CC} ${FLAGS_EXE} -o $@ -l${MQTTLIB_A} $(srcdir)/MQTTVersion.c -ldl
+
+strip_options:
+	$(eval INSTALL_OPTS := -s)
+
+install-strip: build strip_options install
+
+install: build
+	$(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_C_TARGET} $(DESTDIR)${libdir}
+	$(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_CS_TARGET} $(DESTDIR)${libdir}
+	$(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_A_TARGET} $(DESTDIR)${libdir}
+	$(INSTALL_DATA) ${INSTALL_OPTS} ${MQTTLIB_AS_TARGET} $(DESTDIR)${libdir}
+	$(INSTALL_PROGRAM) ${INSTALL_OPTS} ${MQTTVERSION_TARGET} $(DESTDIR)${bindir}
+	$(LDCONFIG) $(DESTDIR)${libdir}
+	ln -s lib$(MQTTLIB_C).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so
+	ln -s lib$(MQTTLIB_CS).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so
+	ln -s lib$(MQTTLIB_A).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so
+	ln -s lib$(MQTTLIB_AS).so.${MAJOR_VERSION} $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so
+	$(INSTALL_DATA) ${srcdir}/MQTTAsync.h $(DESTDIR)${includedir}
+	$(INSTALL_DATA) ${srcdir}/MQTTClient.h $(DESTDIR)${includedir}
+	$(INSTALL_DATA) ${srcdir}/MQTTClientPersistence.h $(DESTDIR)${includedir}
+
+uninstall:
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so.${VERSION}
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so.${VERSION}
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so.${VERSION}
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so.${VERSION}
+	rm $(DESTDIR)${bindir}/MQTTVersion
+	$(LDCONFIG) $(DESTDIR)${libdir}
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_C).so
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_CS).so
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_A).so
+	rm $(DESTDIR)${libdir}/lib$(MQTTLIB_AS).so
+	rm $(DESTDIR)${includedir}/MQTTAsync.h
+	rm $(DESTDIR)${includedir}/MQTTClient.h
+	rm $(DESTDIR)${includedir}/MQTTClientPersistence.h
+
+REGEX_DOXYGEN := \
+    's;@PROJECT_SOURCE_DIR@/src/\?;;' \
+    's;@PROJECT_SOURCE_DIR@;..;' \
+    's;@CMAKE_CURRENT_BINARY_DIR@;../build/output;'
+SED_DOXYGEN := $(foreach sed_exp,$(REGEX_DOXYGEN),-e $(sed_exp))
+define process_doxygen
+	cd ${srcdir}; sed $(SED_DOXYGEN) ../doc/${1}.in > ../$(docdir_work)/${1}
+	cd ${srcdir}; $(DOXYGEN_COMMAND) ../$(docdir_work)/${1}
+endef
+html:
+	-mkdir -p $(docdir_work)
+	-mkdir -p ${docdir}
+	$(call process_doxygen,DoxyfileV3ClientAPI)
+	$(call process_doxygen,DoxyfileV3AsyncAPI)
+	$(call process_doxygen,DoxyfileV3ClientInternal)


[04/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPacket.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPacket.c b/thirdparty/paho.mqtt.c/src/MQTTPacket.c
new file mode 100644
index 0000000..c21a432
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPacket.c
@@ -0,0 +1,755 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - MQTT 3.1.1 support
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief functions to deal with reading and writing of MQTT packets from and to sockets
+ *
+ * Some other related functions are in the MQTTPacketOut module
+ */
+
+#include "MQTTPacket.h"
+#include "Log.h"
+#if !defined(NO_PERSISTENCE)
+	#include "MQTTPersistence.h"
+#endif
+#include "Messages.h"
+#include "StackTrace.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "Heap.h"
+
+#if !defined(min)
+#define min(A,B) ( (A) < (B) ? (A):(B))
+#endif
+
+/**
+ * List of the predefined MQTT v3 packet names.
+ */
+static const char *packet_names[] =
+{
+	"RESERVED", "CONNECT", "CONNACK", "PUBLISH", "PUBACK", "PUBREC", "PUBREL",
+	"PUBCOMP", "SUBSCRIBE", "SUBACK", "UNSUBSCRIBE", "UNSUBACK",
+	"PINGREQ", "PINGRESP", "DISCONNECT"
+};
+
+const char** MQTTClient_packet_names = packet_names;
+
+
+/**
+ * Converts an MQTT packet code into its name
+ * @param ptype packet code
+ * @return the corresponding string, or "UNKNOWN"
+ */
+const char* MQTTPacket_name(int ptype)
+{
+	return (ptype >= 0 && ptype <= DISCONNECT) ? packet_names[ptype] : "UNKNOWN";
+}
+
+/**
+ * Array of functions to build packets, indexed according to packet code
+ */
+pf new_packets[] =
+{
+	NULL,	/**< reserved */
+	NULL,	/**< MQTTPacket_connect*/
+	MQTTPacket_connack, /**< CONNACK */
+	MQTTPacket_publish,	/**< PUBLISH */
+	MQTTPacket_ack, /**< PUBACK */
+	MQTTPacket_ack, /**< PUBREC */
+	MQTTPacket_ack, /**< PUBREL */
+	MQTTPacket_ack, /**< PUBCOMP */
+	NULL, /**< MQTTPacket_subscribe*/
+	MQTTPacket_suback, /**< SUBACK */
+	NULL, /**< MQTTPacket_unsubscribe*/
+	MQTTPacket_ack, /**< UNSUBACK */
+	MQTTPacket_header_only, /**< PINGREQ */
+	MQTTPacket_header_only, /**< PINGRESP */
+	MQTTPacket_header_only  /**< DISCONNECT */
+};
+
+
+static char* readUTFlen(char** pptr, char* enddata, int* len);
+static int MQTTPacket_send_ack(int type, int msgid, int dup, networkHandles *net);
+
+/**
+ * Reads one MQTT packet from a socket.
+ * @param socket a socket from which to read an MQTT packet
+ * @param error pointer to the error code which is completed if no packet is returned
+ * @return the packet structure or NULL if there was an error
+ */
+void* MQTTPacket_Factory(networkHandles* net, int* error)
+{
+	char* data = NULL;
+	static Header header;
+	size_t remaining_length;
+	int ptype;
+	void* pack = NULL;
+	size_t actual_len = 0;
+
+	FUNC_ENTRY;
+	*error = SOCKET_ERROR;  /* indicate whether an error occurred, or not */
+
+	/* read the packet data from the socket */
+#if defined(OPENSSL)
+	*error = (net->ssl) ? SSLSocket_getch(net->ssl, net->socket, &header.byte) : Socket_getch(net->socket, &header.byte); 
+#else
+	*error = Socket_getch(net->socket, &header.byte);
+#endif
+	if (*error != TCPSOCKET_COMPLETE)   /* first byte is the header byte */
+		goto exit; /* packet not read, *error indicates whether SOCKET_ERROR occurred */
+
+	/* now read the remaining length, so we know how much more to read */
+	if ((*error = MQTTPacket_decode(net, &remaining_length)) != TCPSOCKET_COMPLETE)
+		goto exit; /* packet not read, *error indicates whether SOCKET_ERROR occurred */
+
+	/* now read the rest, the variable header and payload */
+#if defined(OPENSSL)
+	data = (net->ssl) ? SSLSocket_getdata(net->ssl, net->socket, remaining_length, &actual_len) : 
+						Socket_getdata(net->socket, remaining_length, &actual_len);
+#else
+	data = Socket_getdata(net->socket, remaining_length, &actual_len);
+#endif
+	if (data == NULL)
+	{
+		*error = SOCKET_ERROR;
+		goto exit; /* socket error */
+	}
+
+	if (actual_len != remaining_length)
+		*error = TCPSOCKET_INTERRUPTED;
+	else
+	{
+		ptype = header.bits.type;
+		if (ptype < CONNECT || ptype > DISCONNECT || new_packets[ptype] == NULL)
+			Log(TRACE_MIN, 2, NULL, ptype);
+		else
+		{
+			if ((pack = (*new_packets[ptype])(header.byte, data, remaining_length)) == NULL)
+				*error = BAD_MQTT_PACKET;
+#if !defined(NO_PERSISTENCE)
+			else if (header.bits.type == PUBLISH && header.bits.qos == 2)
+			{
+				int buf0len;
+				char *buf = malloc(10);
+				buf[0] = header.byte;
+				buf0len = 1 + MQTTPacket_encode(&buf[1], remaining_length);
+				*error = MQTTPersistence_put(net->socket, buf, buf0len, 1,
+					&data, &remaining_length, header.bits.type, ((Publish *)pack)->msgId, 1);
+				free(buf);
+			}
+#endif
+		}
+	}
+	if (pack)
+		time(&(net->lastReceived));
+exit:
+	FUNC_EXIT_RC(*error);
+	return pack;
+}
+
+
+/**
+ * Sends an MQTT packet in one system call write
+ * @param socket the socket to which to write the data
+ * @param header the one-byte MQTT header
+ * @param buffer the rest of the buffer to write (not including remaining length)
+ * @param buflen the length of the data in buffer to be written
+ * @return the completion code (TCPSOCKET_COMPLETE etc)
+ */
+int MQTTPacket_send(networkHandles* net, Header header, char* buffer, size_t buflen, int freeData)
+{
+	int rc;
+	size_t buf0len;
+	char *buf;
+
+	FUNC_ENTRY;
+	buf = malloc(10);
+	buf[0] = header.byte;
+	buf0len = 1 + MQTTPacket_encode(&buf[1], buflen);
+#if !defined(NO_PERSISTENCE)
+	if (header.bits.type == PUBREL)
+	{
+		char* ptraux = buffer;
+		int msgId = readInt(&ptraux);
+		rc = MQTTPersistence_put(net->socket, buf, buf0len, 1, &buffer, &buflen,
+			header.bits.type, msgId, 0);
+	}
+#endif
+
+#if defined(OPENSSL)
+	if (net->ssl)
+		rc = SSLSocket_putdatas(net->ssl, net->socket, buf, buf0len, 1, &buffer, &buflen, &freeData);
+	else
+#endif
+		rc = Socket_putdatas(net->socket, buf, buf0len, 1, &buffer, &buflen, &freeData);
+		
+	if (rc == TCPSOCKET_COMPLETE)
+		time(&(net->lastSent));
+	
+	if (rc != TCPSOCKET_INTERRUPTED)
+	  free(buf);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Sends an MQTT packet from multiple buffers in one system call write
+ * @param socket the socket to which to write the data
+ * @param header the one-byte MQTT header
+ * @param count the number of buffers
+ * @param buffers the rest of the buffers to write (not including remaining length)
+ * @param buflens the lengths of the data in the array of buffers to be written
+ * @return the completion code (TCPSOCKET_COMPLETE etc)
+ */
+int MQTTPacket_sends(networkHandles* net, Header header, int count, char** buffers, size_t* buflens, int* frees)
+{
+	int i, rc;
+	size_t buf0len, total = 0;
+	char *buf;
+
+	FUNC_ENTRY;
+	buf = malloc(10);
+	buf[0] = header.byte;
+	for (i = 0; i < count; i++)
+		total += buflens[i];
+	buf0len = 1 + MQTTPacket_encode(&buf[1], total);
+#if !defined(NO_PERSISTENCE)
+	if (header.bits.type == PUBLISH && header.bits.qos != 0)
+	{   /* persist PUBLISH QoS1 and Qo2 */
+		char *ptraux = buffers[2];
+		int msgId = readInt(&ptraux);
+		rc = MQTTPersistence_put(net->socket, buf, buf0len, count, buffers, buflens,
+			header.bits.type, msgId, 0);
+	}
+#endif
+#if defined(OPENSSL)
+	if (net->ssl)
+		rc = SSLSocket_putdatas(net->ssl, net->socket, buf, buf0len, count, buffers, buflens, frees);
+	else
+#endif
+		rc = Socket_putdatas(net->socket, buf, buf0len, count, buffers, buflens, frees);
+		
+	if (rc == TCPSOCKET_COMPLETE)
+		time(&(net->lastSent));
+	
+	if (rc != TCPSOCKET_INTERRUPTED)
+	  free(buf);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Encodes the message length according to the MQTT algorithm
+ * @param buf the buffer into which the encoded data is written
+ * @param length the length to be encoded
+ * @return the number of bytes written to buffer
+ */
+int MQTTPacket_encode(char* buf, size_t length)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	do
+	{
+		char d = length % 128;
+		length /= 128;
+		/* if there are more digits to encode, set the top bit of this digit */
+		if (length > 0)
+			d |= 0x80;
+		buf[rc++] = d;
+	} while (length > 0);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Decodes the message length according to the MQTT algorithm
+ * @param socket the socket from which to read the bytes
+ * @param value the decoded length returned
+ * @return the number of bytes read from the socket
+ */
+int MQTTPacket_decode(networkHandles* net, size_t* value)
+{
+	int rc = SOCKET_ERROR;
+	char c;
+	int multiplier = 1;
+	int len = 0;
+#define MAX_NO_OF_REMAINING_LENGTH_BYTES 4
+
+	FUNC_ENTRY;
+	*value = 0;
+	do
+	{
+		if (++len > MAX_NO_OF_REMAINING_LENGTH_BYTES)
+		{
+			rc = SOCKET_ERROR;	/* bad data */
+			goto exit;
+		}
+#if defined(OPENSSL)
+		rc = (net->ssl) ? SSLSocket_getch(net->ssl, net->socket, &c) : Socket_getch(net->socket, &c);
+#else
+		rc = Socket_getch(net->socket, &c);
+#endif
+		if (rc != TCPSOCKET_COMPLETE)
+				goto exit;
+		*value += (c & 127) * multiplier;
+		multiplier *= 128;
+	} while ((c & 128) != 0);
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Calculates an integer from two bytes read from the input buffer
+ * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned
+ * @return the integer value calculated
+ */
+int readInt(char** pptr)
+{
+	char* ptr = *pptr;
+	int len = 256*((unsigned char)(*ptr)) + (unsigned char)(*(ptr+1));
+	*pptr += 2;
+	return len;
+}
+
+
+/**
+ * Reads a "UTF" string from the input buffer.  UTF as in the MQTT v3 spec which really means
+ * a length delimited string.  So it reads the two byte length then the data according to
+ * that length.  The end of the buffer is provided too, so we can prevent buffer overruns caused
+ * by an incorrect length.
+ * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned
+ * @param enddata pointer to the end of the buffer not to be read beyond
+ * @param len returns the calculcated value of the length bytes read
+ * @return an allocated C string holding the characters read, or NULL if the length read would
+ * have caused an overrun.
+ *
+ */
+static char* readUTFlen(char** pptr, char* enddata, int* len)
+{
+	char* string = NULL;
+
+	FUNC_ENTRY;
+	if (enddata - (*pptr) > 1) /* enough length to read the integer? */
+	{
+		*len = readInt(pptr);
+		if (&(*pptr)[*len] <= enddata)
+		{
+			string = malloc(*len+1);
+			memcpy(string, *pptr, *len);
+			string[*len] = '\0';
+			*pptr += *len;
+		}
+	}
+	FUNC_EXIT;
+	return string;
+}
+
+
+/**
+ * Reads a "UTF" string from the input buffer.  UTF as in the MQTT v3 spec which really means
+ * a length delimited string.  So it reads the two byte length then the data according to
+ * that length.  The end of the buffer is provided too, so we can prevent buffer overruns caused
+ * by an incorrect length.
+ * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned
+ * @param enddata pointer to the end of the buffer not to be read beyond
+ * @return an allocated C string holding the characters read, or NULL if the length read would
+ * have caused an overrun.
+ */
+char* readUTF(char** pptr, char* enddata)
+{
+	int len;
+	return readUTFlen(pptr, enddata, &len);
+}
+
+
+/**
+ * Reads one character from the input buffer.
+ * @param pptr pointer to the input buffer - incremented by the number of bytes used & returned
+ * @return the character read
+ */
+unsigned char readChar(char** pptr)
+{
+	unsigned char c = **pptr;
+	(*pptr)++;
+	return c;
+}
+
+
+/**
+ * Writes one character to an output buffer.
+ * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned
+ * @param c the character to write
+ */
+void writeChar(char** pptr, char c)
+{
+	**pptr = c;
+	(*pptr)++;
+}
+
+
+/**
+ * Writes an integer as 2 bytes to an output buffer.
+ * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned
+ * @param anInt the integer to write
+ */
+void writeInt(char** pptr, int anInt)
+{
+	**pptr = (char)(anInt / 256);
+	(*pptr)++;
+	**pptr = (char)(anInt % 256);
+	(*pptr)++;
+}
+
+
+/**
+ * Writes a "UTF" string to an output buffer.  Converts C string to length-delimited.
+ * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned
+ * @param string the C string to write
+ */
+void writeUTF(char** pptr, const char* string)
+{
+	size_t len = strlen(string);
+	writeInt(pptr, (int)len);
+	memcpy(*pptr, string, len);
+	*pptr += len;
+}
+
+
+/**
+ * Writes length delimited data to an output buffer
+ * @param pptr pointer to the output buffer - incremented by the number of bytes used & returned
+ * @param data the data to write
+ * @param datalen the length of the data to write
+ */
+void writeData(char** pptr, const void* data, int datalen)
+{
+	writeInt(pptr, datalen);
+	memcpy(*pptr, data, datalen);
+	*pptr += datalen;
+}
+
+
+/**
+ * Function used in the new packets table to create packets which have only a header.
+ * @param aHeader the MQTT header byte
+ * @param data the rest of the packet
+ * @param datalen the length of the rest of the packet
+ * @return pointer to the packet structure
+ */
+void* MQTTPacket_header_only(unsigned char aHeader, char* data, size_t datalen)
+{
+	static unsigned char header = 0;
+	header = aHeader;
+	return &header;
+}
+
+
+/**
+ * Send an MQTT disconnect packet down a socket.
+ * @param socket the open socket to send the data to
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_disconnect(networkHandles *net, const char* clientID)
+{
+	Header header;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	header.byte = 0;
+	header.bits.type = DISCONNECT;
+	rc = MQTTPacket_send(net, header, NULL, 0, 0);
+	Log(LOG_PROTOCOL, 28, NULL, net->socket, clientID, rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Function used in the new packets table to create publish packets.
+ * @param aHeader the MQTT header byte
+ * @param data the rest of the packet
+ * @param datalen the length of the rest of the packet
+ * @return pointer to the packet structure
+ */
+void* MQTTPacket_publish(unsigned char aHeader, char* data, size_t datalen)
+{
+	Publish* pack = malloc(sizeof(Publish));
+	char* curdata = data;
+	char* enddata = &data[datalen];
+
+	FUNC_ENTRY;
+	pack->header.byte = aHeader;
+	if ((pack->topic = readUTFlen(&curdata, enddata, &pack->topiclen)) == NULL) /* Topic name on which to publish */
+	{
+		free(pack);
+		pack = NULL;
+		goto exit;
+	}
+	if (pack->header.bits.qos > 0)  /* Msgid only exists for QoS 1 or 2 */
+		pack->msgId = readInt(&curdata);
+	else
+		pack->msgId = 0;
+	pack->payload = curdata;
+	pack->payloadlen = (int)(datalen-(curdata-data));
+exit:
+	FUNC_EXIT;
+	return pack;
+}
+
+
+/**
+ * Free allocated storage for a publish packet.
+ * @param pack pointer to the publish packet structure
+ */
+void MQTTPacket_freePublish(Publish* pack)
+{
+	FUNC_ENTRY;
+	if (pack->topic != NULL)
+		free(pack->topic);
+	free(pack);
+	FUNC_EXIT;
+}
+
+
+/**
+ * Send an MQTT acknowledgement packet down a socket.
+ * @param type the MQTT packet type e.g. SUBACK
+ * @param msgid the MQTT message id to use
+ * @param dup boolean - whether to set the MQTT DUP flag
+ * @param net the network handle to send the data to
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+static int MQTTPacket_send_ack(int type, int msgid, int dup, networkHandles *net)
+{
+	Header header;
+	int rc;
+	char *buf = malloc(2);
+	char *ptr = buf;
+
+	FUNC_ENTRY;
+	header.byte = 0;
+	header.bits.type = type;
+	header.bits.dup = dup;
+	if (type == PUBREL)
+	    header.bits.qos = 1;
+	writeInt(&ptr, msgid);
+	if ((rc = MQTTPacket_send(net, header, buf, 2, 1)) != TCPSOCKET_INTERRUPTED)
+		free(buf);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Send an MQTT PUBACK packet down a socket.
+ * @param msgid the MQTT message id to use
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_puback(int msgid, networkHandles* net, const char* clientID)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	rc =  MQTTPacket_send_ack(PUBACK, msgid, 0, net);
+	Log(LOG_PROTOCOL, 12, NULL, net->socket, clientID, msgid, rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Free allocated storage for a suback packet.
+ * @param pack pointer to the suback packet structure
+ */
+void MQTTPacket_freeSuback(Suback* pack)
+{
+	FUNC_ENTRY;
+	if (pack->qoss != NULL)
+		ListFree(pack->qoss);
+	free(pack);
+	FUNC_EXIT;
+}
+
+
+/**
+ * Send an MQTT PUBREC packet down a socket.
+ * @param msgid the MQTT message id to use
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_pubrec(int msgid, networkHandles* net, const char* clientID)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	rc =  MQTTPacket_send_ack(PUBREC, msgid, 0, net);
+	Log(LOG_PROTOCOL, 13, NULL, net->socket, clientID, msgid, rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Send an MQTT PUBREL packet down a socket.
+ * @param msgid the MQTT message id to use
+ * @param dup boolean - whether to set the MQTT DUP flag
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_pubrel(int msgid, int dup, networkHandles* net, const char* clientID)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	rc = MQTTPacket_send_ack(PUBREL, msgid, dup, net);
+	Log(LOG_PROTOCOL, 16, NULL, net->socket, clientID, msgid, rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Send an MQTT PUBCOMP packet down a socket.
+ * @param msgid the MQTT message id to use
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_pubcomp(int msgid, networkHandles* net, const char* clientID)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	rc = MQTTPacket_send_ack(PUBCOMP, msgid, 0, net);
+	Log(LOG_PROTOCOL, 18, NULL, net->socket, clientID, msgid, rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Function used in the new packets table to create acknowledgement packets.
+ * @param aHeader the MQTT header byte
+ * @param data the rest of the packet
+ * @param datalen the length of the rest of the packet
+ * @return pointer to the packet structure
+ */
+void* MQTTPacket_ack(unsigned char aHeader, char* data, size_t datalen)
+{
+	Ack* pack = malloc(sizeof(Ack));
+	char* curdata = data;
+
+	FUNC_ENTRY;
+	pack->header.byte = aHeader;
+	pack->msgId = readInt(&curdata);
+	FUNC_EXIT;
+	return pack;
+}
+
+
+/**
+ * Send an MQTT PUBLISH packet down a socket.
+ * @param pack a structure from which to get some values to use, e.g topic, payload
+ * @param dup boolean - whether to set the MQTT DUP flag
+ * @param qos the value to use for the MQTT QoS setting
+ * @param retained boolean - whether to set the MQTT retained flag
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_publish(Publish* pack, int dup, int qos, int retained, networkHandles* net, const char* clientID)
+{
+	Header header;
+	char *topiclen;
+	int rc = -1;
+
+	FUNC_ENTRY;
+	topiclen = malloc(2);
+
+	header.bits.type = PUBLISH;
+	header.bits.dup = dup;
+	header.bits.qos = qos;
+	header.bits.retain = retained;
+	if (qos > 0)
+	{
+		char *buf = malloc(2);
+		char *ptr = buf;
+		char* bufs[4] = {topiclen, pack->topic, buf, pack->payload};
+		size_t lens[4] = {2, strlen(pack->topic), 2, pack->payloadlen};
+		int frees[4] = {1, 0, 1, 0};
+
+		writeInt(&ptr, pack->msgId);
+		ptr = topiclen;
+		writeInt(&ptr, (int)lens[1]);
+		rc = MQTTPacket_sends(net, header, 4, bufs, lens, frees);
+		if (rc != TCPSOCKET_INTERRUPTED)
+			free(buf);
+	}
+	else
+	{
+		char* ptr = topiclen;
+		char* bufs[3] = {topiclen, pack->topic, pack->payload};
+		size_t lens[3] = {2, strlen(pack->topic), pack->payloadlen};
+		int frees[3] = {1, 0, 0};
+
+		writeInt(&ptr, (int)lens[1]);
+		rc = MQTTPacket_sends(net, header, 3, bufs, lens, frees);
+	}
+	if (rc != TCPSOCKET_INTERRUPTED)
+		free(topiclen);
+	if (qos == 0)
+		Log(LOG_PROTOCOL, 27, NULL, net->socket, clientID, retained, rc);
+	else
+		Log(LOG_PROTOCOL, 10, NULL, net->socket, clientID, pack->msgId, qos, retained, rc,
+				min(20, pack->payloadlen), pack->payload);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Free allocated storage for a various packet tyoes
+ * @param pack pointer to the suback packet structure
+ */
+void MQTTPacket_free_packet(MQTTPacket* pack)
+{
+	FUNC_ENTRY;
+	if (pack->header.bits.type == PUBLISH)
+		MQTTPacket_freePublish((Publish*)pack);
+	/*else if (pack->header.type == SUBSCRIBE)
+		MQTTPacket_freeSubscribe((Subscribe*)pack, 1);
+	else if (pack->header.type == UNSUBSCRIBE)
+		MQTTPacket_freeUnsubscribe((Unsubscribe*)pack);*/
+	else
+		free(pack);
+	FUNC_EXIT;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPacket.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPacket.h b/thirdparty/paho.mqtt.c/src/MQTTPacket.h
new file mode 100644
index 0000000..8bad955
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPacket.h
@@ -0,0 +1,262 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Ian Craggs - big endian Linux reversed definition
+ *******************************************************************************/
+
+#if !defined(MQTTPACKET_H)
+#define MQTTPACKET_H
+
+#include "Socket.h"
+#if defined(OPENSSL)
+#include "SSLSocket.h"
+#endif
+#include "LinkedList.h"
+#include "Clients.h"
+
+/*BE
+include "Socket"
+include "LinkedList"
+include "Clients"
+BE*/
+
+typedef unsigned int bool;
+typedef void* (*pf)(unsigned char, char*, size_t);
+
+#define BAD_MQTT_PACKET -4
+
+enum msgTypes
+{
+	CONNECT = 1, CONNACK, PUBLISH, PUBACK, PUBREC, PUBREL,
+	PUBCOMP, SUBSCRIBE, SUBACK, UNSUBSCRIBE, UNSUBACK,
+	PINGREQ, PINGRESP, DISCONNECT
+};
+
+#if defined(__linux__)
+#include <endian.h>
+#if __BYTE_ORDER == __BIG_ENDIAN
+	#define REVERSED 1
+#endif
+#endif
+
+/**
+ * Bitfields for the MQTT header byte.
+ */
+typedef union
+{
+	/*unsigned*/ char byte;	/**< the whole byte */
+#if defined(REVERSED)
+	struct
+	{
+		unsigned int type : 4;	/**< message type nibble */
+		bool dup : 1;			/**< DUP flag bit */
+		unsigned int qos : 2;	/**< QoS value, 0, 1 or 2 */
+		bool retain : 1;		/**< retained flag bit */
+	} bits;
+#else
+	struct
+	{
+		bool retain : 1;		/**< retained flag bit */
+		unsigned int qos : 2;	/**< QoS value, 0, 1 or 2 */
+		bool dup : 1;			/**< DUP flag bit */
+		unsigned int type : 4;	/**< message type nibble */
+	} bits;
+#endif
+} Header;
+
+
+/**
+ * Data for a connect packet.
+ */
+typedef struct
+{
+	Header header;	/**< MQTT header byte */
+	union
+	{
+		unsigned char all;	/**< all connect flags */
+#if defined(REVERSED)
+		struct
+		{
+			bool username : 1;			/**< 3.1 user name */
+			bool password : 1; 			/**< 3.1 password */
+			bool willRetain : 1;		/**< will retain setting */
+			unsigned int willQoS : 2;	/**< will QoS value */
+			bool will : 1;			/**< will flag */
+			bool cleanstart : 1;	/**< cleansession flag */
+			int : 1;	/**< unused */
+		} bits;
+#else
+		struct
+		{
+			int : 1;	/**< unused */
+			bool cleanstart : 1;	/**< cleansession flag */
+			bool will : 1;			/**< will flag */
+			unsigned int willQoS : 2;	/**< will QoS value */
+			bool willRetain : 1;		/**< will retain setting */
+			bool password : 1; 			/**< 3.1 password */
+			bool username : 1;			/**< 3.1 user name */
+		} bits;
+#endif
+	} flags;	/**< connect flags byte */
+
+	char *Protocol, /**< MQTT protocol name */
+		*clientID,	/**< string client id */
+        *willTopic,	/**< will topic */
+        *willMsg;	/**< will payload */
+
+	int keepAliveTimer;		/**< keepalive timeout value in seconds */
+	unsigned char version;	/**< MQTT version number */
+} Connect;
+
+
+/**
+ * Data for a connack packet.
+ */
+typedef struct
+{
+	Header header; /**< MQTT header byte */
+	union
+	{
+		unsigned char all;	/**< all connack flags */
+#if defined(REVERSED)
+		struct
+		{
+			unsigned int reserved : 7;	/**< message type nibble */
+			bool sessionPresent : 1;    /**< was a session found on the server? */
+		} bits;
+#else
+		struct
+		{
+			bool sessionPresent : 1;    /**< was a session found on the server? */
+			unsigned int reserved : 7;	/**< message type nibble */
+		} bits;
+#endif
+	} flags;	 /**< connack flags byte */
+	char rc; /**< connack return code */
+} Connack;
+
+
+/**
+ * Data for a packet with header only.
+ */
+typedef struct
+{
+	Header header;	/**< MQTT header byte */
+} MQTTPacket;
+
+
+/**
+ * Data for a subscribe packet.
+ */
+typedef struct
+{
+	Header header;	/**< MQTT header byte */
+	int msgId;		/**< MQTT message id */
+	List* topics;	/**< list of topic strings */
+	List* qoss;		/**< list of corresponding QoSs */
+	int noTopics;	/**< topic and qos count */
+} Subscribe;
+
+
+/**
+ * Data for a suback packet.
+ */
+typedef struct
+{
+	Header header;	/**< MQTT header byte */
+	int msgId;		/**< MQTT message id */
+	List* qoss;		/**< list of granted QoSs */
+} Suback;
+
+
+/**
+ * Data for an unsubscribe packet.
+ */
+typedef struct
+{
+	Header header;	/**< MQTT header byte */
+	int msgId;		/**< MQTT message id */
+	List* topics;	/**< list of topic strings */
+	int noTopics;	/**< topic count */
+} Unsubscribe;
+
+
+/**
+ * Data for a publish packet.
+ */
+typedef struct
+{
+	Header header;	/**< MQTT header byte */
+	char* topic;	/**< topic string */
+	int topiclen;
+	int msgId;		/**< MQTT message id */
+	char* payload;	/**< binary payload, length delimited */
+	int payloadlen;	/**< payload length */
+} Publish;
+
+
+/**
+ * Data for one of the ack packets.
+ */
+typedef struct
+{
+	Header header;	/**< MQTT header byte */
+	int msgId;		/**< MQTT message id */
+} Ack;
+
+typedef Ack Puback;
+typedef Ack Pubrec;
+typedef Ack Pubrel;
+typedef Ack Pubcomp;
+typedef Ack Unsuback;
+
+int MQTTPacket_encode(char* buf, size_t length);
+int MQTTPacket_decode(networkHandles* net, size_t* value);
+int readInt(char** pptr);
+char* readUTF(char** pptr, char* enddata);
+unsigned char readChar(char** pptr);
+void writeChar(char** pptr, char c);
+void writeInt(char** pptr, int anInt);
+void writeUTF(char** pptr, const char* string);
+void writeData(char** pptr, const void* data, int datalen);
+
+const char* MQTTPacket_name(int ptype);
+
+void* MQTTPacket_Factory(networkHandles* net, int* error);
+int MQTTPacket_send(networkHandles* net, Header header, char* buffer, size_t buflen, int free);
+int MQTTPacket_sends(networkHandles* net, Header header, int count, char** buffers, size_t* buflens, int* frees);
+
+void* MQTTPacket_header_only(unsigned char aHeader, char* data, size_t datalen);
+int MQTTPacket_send_disconnect(networkHandles* net, const char* clientID);
+
+void* MQTTPacket_publish(unsigned char aHeader, char* data, size_t datalen);
+void MQTTPacket_freePublish(Publish* pack);
+int MQTTPacket_send_publish(Publish* pack, int dup, int qos, int retained, networkHandles* net, const char* clientID);
+int MQTTPacket_send_puback(int msgid, networkHandles* net, const char* clientID);
+void* MQTTPacket_ack(unsigned char aHeader, char* data, size_t datalen);
+
+void MQTTPacket_freeSuback(Suback* pack);
+int MQTTPacket_send_pubrec(int msgid, networkHandles* net, const char* clientID);
+int MQTTPacket_send_pubrel(int msgid, int dup, networkHandles* net, const char* clientID);
+int MQTTPacket_send_pubcomp(int msgid, networkHandles* net, const char* clientID);
+
+void MQTTPacket_free_packet(MQTTPacket* pack);
+
+#if !defined(NO_BRIDGE)
+	#include "MQTTPacketOut.h"
+#endif
+
+#endif /* MQTTPACKET_H */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPacketOut.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPacketOut.c b/thirdparty/paho.mqtt.c/src/MQTTPacketOut.c
new file mode 100644
index 0000000..b924085
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPacketOut.c
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Rong Xiang, Ian Craggs - C++ compatibility
+ *    Ian Craggs - binary password and will payload
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief functions to deal with reading and writing of MQTT packets from and to sockets
+ *
+ * Some other related functions are in the MQTTPacket module
+ */
+
+
+#include "MQTTPacketOut.h"
+#include "Log.h"
+#include "StackTrace.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "Heap.h"
+
+
+/**
+ * Send an MQTT CONNECT packet down a socket.
+ * @param client a structure from which to get all the required values
+ * @param MQTTVersion the MQTT version to connect with
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_connect(Clients* client, int MQTTVersion)
+{
+	char *buf, *ptr;
+	Connect packet;
+	int rc = -1, len;
+
+	FUNC_ENTRY;
+	packet.header.byte = 0;
+	packet.header.bits.type = CONNECT;
+
+	len = ((MQTTVersion == 3) ? 12 : 10) + (int)strlen(client->clientID)+2;
+	if (client->will)
+		len += (int)strlen(client->will->topic)+2 + client->will->payloadlen+2;
+	if (client->username)
+		len += (int)strlen(client->username)+2;
+	if (client->password)
+		len += client->passwordlen+2;
+
+	ptr = buf = malloc(len);
+	if (MQTTVersion == 3)
+	{
+		writeUTF(&ptr, "MQIsdp");
+		writeChar(&ptr, (char)3);
+	}
+	else if (MQTTVersion == 4)
+	{
+		writeUTF(&ptr, "MQTT");
+		writeChar(&ptr, (char)4);
+	}
+	else
+		goto exit;
+
+	packet.flags.all = 0;
+	packet.flags.bits.cleanstart = client->cleansession;
+	packet.flags.bits.will = (client->will) ? 1 : 0;
+	if (packet.flags.bits.will)
+	{
+		packet.flags.bits.willQoS = client->will->qos;
+		packet.flags.bits.willRetain = client->will->retained;
+	}
+
+	if (client->username)
+		packet.flags.bits.username = 1;
+	if (client->password)
+		packet.flags.bits.password = 1;
+
+	writeChar(&ptr, packet.flags.all);
+	writeInt(&ptr, client->keepAliveInterval);
+	writeUTF(&ptr, client->clientID);
+	if (client->will)
+	{
+		writeUTF(&ptr, client->will->topic);
+		writeData(&ptr, client->will->payload, client->will->payloadlen);
+	}
+	if (client->username)
+		writeUTF(&ptr, client->username);
+	if (client->password)
+		writeData(&ptr, client->password, client->passwordlen);
+
+	rc = MQTTPacket_send(&client->net, packet.header, buf, len, 1);
+	Log(LOG_PROTOCOL, 0, NULL, client->net.socket, client->clientID, client->cleansession, rc);
+exit:
+	if (rc != TCPSOCKET_INTERRUPTED)
+		free(buf);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Function used in the new packets table to create connack packets.
+ * @param aHeader the MQTT header byte
+ * @param data the rest of the packet
+ * @param datalen the length of the rest of the packet
+ * @return pointer to the packet structure
+ */
+void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen)
+{
+	Connack* pack = malloc(sizeof(Connack));
+	char* curdata = data;
+
+	FUNC_ENTRY;
+	pack->header.byte = aHeader;
+	pack->flags.all = readChar(&curdata);
+	pack->rc = readChar(&curdata);
+	FUNC_EXIT;
+	return pack;
+}
+
+
+/**
+ * Send an MQTT PINGREQ packet down a socket.
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID)
+{
+	Header header;
+	int rc = 0;
+	size_t buflen = 0;
+
+	FUNC_ENTRY;
+	header.byte = 0;
+	header.bits.type = PINGREQ;
+	rc = MQTTPacket_send(net, header, NULL, buflen,0);
+	Log(LOG_PROTOCOL, 20, NULL, net->socket, clientID, rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Send an MQTT subscribe packet down a socket.
+ * @param topics list of topics
+ * @param qoss list of corresponding QoSs
+ * @param msgid the MQTT message id to use
+ * @param dup boolean - whether to set the MQTT DUP flag
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID)
+{
+	Header header;
+	char *data, *ptr;
+	int rc = -1;
+	ListElement *elem = NULL, *qosElem = NULL;
+	int datalen;
+
+	FUNC_ENTRY;
+	header.bits.type = SUBSCRIBE;
+	header.bits.dup = dup;
+	header.bits.qos = 1;
+	header.bits.retain = 0;
+
+	datalen = 2 + topics->count * 3; /* utf length + char qos == 3 */
+	while (ListNextElement(topics, &elem))
+		datalen += (int)strlen((char*)(elem->content));
+	ptr = data = malloc(datalen);
+
+	writeInt(&ptr, msgid);
+	elem = NULL;
+	while (ListNextElement(topics, &elem))
+	{
+		ListNextElement(qoss, &qosElem);
+		writeUTF(&ptr, (char*)(elem->content));
+		writeChar(&ptr, *(int*)(qosElem->content));
+	}
+	rc = MQTTPacket_send(net, header, data, datalen, 1);
+	Log(LOG_PROTOCOL, 22, NULL, net->socket, clientID, msgid, rc);
+	if (rc != TCPSOCKET_INTERRUPTED)
+		free(data);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Function used in the new packets table to create suback packets.
+ * @param aHeader the MQTT header byte
+ * @param data the rest of the packet
+ * @param datalen the length of the rest of the packet
+ * @return pointer to the packet structure
+ */
+void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen)
+{
+	Suback* pack = malloc(sizeof(Suback));
+	char* curdata = data;
+
+	FUNC_ENTRY;
+	pack->header.byte = aHeader;
+	pack->msgId = readInt(&curdata);
+	pack->qoss = ListInitialize();
+	while ((size_t)(curdata - data) < datalen)
+	{
+		int* newint;
+		newint = malloc(sizeof(int));
+		*newint = (int)readChar(&curdata);
+		ListAppend(pack->qoss, newint, sizeof(int));
+	}
+	FUNC_EXIT;
+	return pack;
+}
+
+
+/**
+ * Send an MQTT unsubscribe packet down a socket.
+ * @param topics list of topics
+ * @param msgid the MQTT message id to use
+ * @param dup boolean - whether to set the MQTT DUP flag
+ * @param socket the open socket to send the data to
+ * @param clientID the string client identifier, only used for tracing
+ * @return the completion code (e.g. TCPSOCKET_COMPLETE)
+ */
+int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID)
+{
+	Header header;
+	char *data, *ptr;
+	int rc = -1;
+	ListElement *elem = NULL;
+	int datalen;
+
+	FUNC_ENTRY;
+	header.bits.type = UNSUBSCRIBE;
+	header.bits.dup = dup;
+	header.bits.qos = 1;
+	header.bits.retain = 0;
+
+	datalen = 2 + topics->count * 2; /* utf length == 2 */
+	while (ListNextElement(topics, &elem))
+		datalen += (int)strlen((char*)(elem->content));
+	ptr = data = malloc(datalen);
+
+	writeInt(&ptr, msgid);
+	elem = NULL;
+	while (ListNextElement(topics, &elem))
+		writeUTF(&ptr, (char*)(elem->content));
+	rc = MQTTPacket_send(net, header, data, datalen, 1);
+	Log(LOG_PROTOCOL, 25, NULL, net->socket, clientID, msgid, rc);
+	if (rc != TCPSOCKET_INTERRUPTED)
+		free(data);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPacketOut.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPacketOut.h b/thirdparty/paho.mqtt.c/src/MQTTPacketOut.h
new file mode 100644
index 0000000..700db77
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPacketOut.h
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - MQTT 3.1.1 support
+ *******************************************************************************/
+
+#if !defined(MQTTPACKETOUT_H)
+#define MQTTPACKETOUT_H
+
+#include "MQTTPacket.h"
+
+int MQTTPacket_send_connect(Clients* client, int MQTTVersion);
+void* MQTTPacket_connack(unsigned char aHeader, char* data, size_t datalen);
+
+int MQTTPacket_send_pingreq(networkHandles* net, const char* clientID);
+
+int MQTTPacket_send_subscribe(List* topics, List* qoss, int msgid, int dup, networkHandles* net, const char* clientID);
+void* MQTTPacket_suback(unsigned char aHeader, char* data, size_t datalen);
+
+int MQTTPacket_send_unsubscribe(List* topics, int msgid, int dup, networkHandles* net, const char* clientID);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPersistence.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPersistence.c b/thirdparty/paho.mqtt.c/src/MQTTPersistence.c
new file mode 100644
index 0000000..24efb6d
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPersistence.c
@@ -0,0 +1,654 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - async client updates
+ *    Ian Craggs - fix for bug 432903 - queue persistence
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Functions that apply to persistence operations.
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#include "MQTTPersistence.h"
+#include "MQTTPersistenceDefault.h"
+#include "MQTTProtocolClient.h"
+#include "Heap.h"
+
+
+static MQTTPersistence_qEntry* MQTTPersistence_restoreQueueEntry(char* buffer, size_t buflen);
+static void MQTTPersistence_insertInSeqOrder(List* list, MQTTPersistence_qEntry* qEntry, size_t size);
+
+/**
+ * Creates a ::MQTTClient_persistence structure representing a persistence implementation.
+ * @param persistence the ::MQTTClient_persistence structure.
+ * @param type the type of the persistence implementation. See ::MQTTClient_create.
+ * @param pcontext the context for this persistence implementation. See ::MQTTClient_create.
+ * @return 0 if success, #MQTTCLIENT_PERSISTENCE_ERROR otherwise.
+ */
+#include "StackTrace.h"
+
+int MQTTPersistence_create(MQTTClient_persistence** persistence, int type, void* pcontext)
+{
+	int rc = 0;
+	MQTTClient_persistence* per = NULL;
+
+	FUNC_ENTRY;
+#if !defined(NO_PERSISTENCE)
+	switch (type)
+	{
+		case MQTTCLIENT_PERSISTENCE_NONE :
+			per = NULL;
+			break;
+		case MQTTCLIENT_PERSISTENCE_DEFAULT :
+			per = malloc(sizeof(MQTTClient_persistence));
+			if ( per != NULL )
+			{
+				if ( pcontext != NULL )
+				{
+					per->context = malloc(strlen(pcontext) + 1);
+					strcpy(per->context, pcontext);
+				}
+				else
+					per->context = ".";  /* working directory */
+				/* file system functions */
+				per->popen        = pstopen;
+				per->pclose       = pstclose;
+				per->pput         = pstput;
+				per->pget         = pstget;
+				per->premove      = pstremove;
+				per->pkeys        = pstkeys;
+				per->pclear       = pstclear;
+				per->pcontainskey = pstcontainskey;
+			}
+			else
+				rc = MQTTCLIENT_PERSISTENCE_ERROR;
+			break;
+		case MQTTCLIENT_PERSISTENCE_USER :
+			per = (MQTTClient_persistence *)pcontext;
+			if ( per == NULL || (per != NULL && (per->context == NULL || per->pclear == NULL ||
+				per->pclose == NULL || per->pcontainskey == NULL || per->pget == NULL || per->pkeys == NULL ||
+				per->popen == NULL || per->pput == NULL || per->premove == NULL)) )
+				rc = MQTTCLIENT_PERSISTENCE_ERROR;
+			break;
+		default:
+			rc = MQTTCLIENT_PERSISTENCE_ERROR;
+			break;
+	}
+#endif
+
+	*persistence = per;
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Open persistent store and restore any persisted messages.
+ * @param client the client as ::Clients.
+ * @param serverURI the URI of the remote end.
+ * @return 0 if success, #MQTTCLIENT_PERSISTENCE_ERROR otherwise.
+ */
+int MQTTPersistence_initialize(Clients *c, const char *serverURI)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if ( c->persistence != NULL )
+	{
+		rc = c->persistence->popen(&(c->phandle), c->clientID, serverURI, c->persistence->context);
+		if ( rc == 0 )
+			rc = MQTTPersistence_restore(c);
+	}
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Close persistent store.
+ * @param client the client as ::Clients.
+ * @return 0 if success, #MQTTCLIENT_PERSISTENCE_ERROR otherwise.
+ */
+int MQTTPersistence_close(Clients *c)
+{
+	int rc =0;
+
+	FUNC_ENTRY;
+	if (c->persistence != NULL)
+	{
+		rc = c->persistence->pclose(c->phandle);
+		c->phandle = NULL;
+#if !defined(NO_PERSISTENCE)
+		if ( c->persistence->popen == pstopen )
+			free(c->persistence);
+#endif
+		c->persistence = NULL;
+	}
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+/**
+ * Clears the persistent store.
+ * @param client the client as ::Clients.
+ * @return 0 if success, #MQTTCLIENT_PERSISTENCE_ERROR otherwise.
+ */
+int MQTTPersistence_clear(Clients *c)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (c->persistence != NULL)
+		rc = c->persistence->pclear(c->phandle);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Restores the persisted records to the outbound and inbound message queues of the
+ * client.
+ * @param client the client as ::Clients.
+ * @return 0 if success, #MQTTCLIENT_PERSISTENCE_ERROR otherwise.
+ */
+int MQTTPersistence_restore(Clients *c)
+{
+	int rc = 0;
+	char **msgkeys = NULL,
+		 *buffer = NULL;
+	int nkeys, buflen;
+	int i = 0;
+	int msgs_sent = 0;
+	int msgs_rcvd = 0;
+
+	FUNC_ENTRY;
+	if (c->persistence && (rc = c->persistence->pkeys(c->phandle, &msgkeys, &nkeys)) == 0)
+	{
+		while (rc == 0 && i < nkeys)
+		{
+			if (strncmp(msgkeys[i], PERSISTENCE_COMMAND_KEY, strlen(PERSISTENCE_COMMAND_KEY)) == 0)
+			{
+				;
+			}
+			else if (strncmp(msgkeys[i], PERSISTENCE_QUEUE_KEY, strlen(PERSISTENCE_QUEUE_KEY)) == 0)
+			{
+				;
+			}
+			else if ((rc = c->persistence->pget(c->phandle, msgkeys[i], &buffer, &buflen)) == 0)
+			{
+				MQTTPacket* pack = MQTTPersistence_restorePacket(buffer, buflen);
+				if ( pack != NULL )
+				{
+					if ( strstr(msgkeys[i],PERSISTENCE_PUBLISH_RECEIVED) != NULL )
+					{
+						Publish* publish = (Publish*)pack;
+						Messages* msg = NULL;
+						msg = MQTTProtocol_createMessage(publish, &msg, publish->header.bits.qos, publish->header.bits.retain);
+						msg->nextMessageType = PUBREL;
+						/* order does not matter for persisted received messages */
+						ListAppend(c->inboundMsgs, msg, msg->len);
+						publish->topic = NULL;
+						MQTTPacket_freePublish(publish);
+						msgs_rcvd++;
+					}
+					else if ( strstr(msgkeys[i],PERSISTENCE_PUBLISH_SENT) != NULL )
+					{
+						Publish* publish = (Publish*)pack;
+						Messages* msg = NULL;
+						char *key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+						sprintf(key, "%s%d", PERSISTENCE_PUBREL, publish->msgId);
+						msg = MQTTProtocol_createMessage(publish, &msg, publish->header.bits.qos, publish->header.bits.retain);
+						if ( c->persistence->pcontainskey(c->phandle, key) == 0 )
+							/* PUBLISH Qo2 and PUBREL sent */
+							msg->nextMessageType = PUBCOMP;
+						/* else: PUBLISH QoS1, or PUBLISH QoS2 and PUBREL not sent */
+						/* retry at the first opportunity */
+						msg->lastTouch = 0;
+						MQTTPersistence_insertInOrder(c->outboundMsgs, msg, msg->len);
+						publish->topic = NULL;
+						MQTTPacket_freePublish(publish);
+						free(key);
+						msgs_sent++;
+					}
+					else if ( strstr(msgkeys[i],PERSISTENCE_PUBREL) != NULL )
+					{
+						/* orphaned PUBRELs ? */
+						Pubrel* pubrel = (Pubrel*)pack;
+						char *key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+						sprintf(key, "%s%d", PERSISTENCE_PUBLISH_SENT, pubrel->msgId);
+						if ( c->persistence->pcontainskey(c->phandle, key) != 0 )
+							rc = c->persistence->premove(c->phandle, msgkeys[i]);
+						free(pubrel);
+						free(key);
+					}
+				}
+				else  /* pack == NULL -> bad persisted record */
+					rc = c->persistence->premove(c->phandle, msgkeys[i]);
+			}
+			if (buffer)
+			{
+				free(buffer);
+				buffer = NULL;
+			}
+			if (msgkeys[i])
+				free(msgkeys[i]);
+			i++;
+		}
+		if (msgkeys)
+			free(msgkeys);
+	}
+	Log(TRACE_MINIMUM, -1, "%d sent messages and %d received messages restored for client %s\n", 
+		msgs_sent, msgs_rcvd, c->clientID);
+	MQTTPersistence_wrapMsgID(c);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Returns a MQTT packet restored from persisted data.
+ * @param buffer the persisted data.
+ * @param buflen the number of bytes of the data buffer.
+ */
+void* MQTTPersistence_restorePacket(char* buffer, size_t buflen)
+{
+	void* pack = NULL;
+	Header header;
+	int fixed_header_length = 1, ptype, remaining_length = 0;
+	char c;
+	int multiplier = 1;
+	extern pf new_packets[];
+
+	FUNC_ENTRY;
+	header.byte = buffer[0];
+	/* decode the message length according to the MQTT algorithm */
+	do
+	{
+		c = *(++buffer);
+		remaining_length += (c & 127) * multiplier;
+		multiplier *= 128;
+		fixed_header_length++;
+	} while ((c & 128) != 0);
+
+	if ( (fixed_header_length + remaining_length) == buflen )
+	{
+		ptype = header.bits.type;
+		if (ptype >= CONNECT && ptype <= DISCONNECT && new_packets[ptype] != NULL)
+			pack = (*new_packets[ptype])(header.byte, ++buffer, remaining_length);
+	}
+
+	FUNC_EXIT;
+	return pack;
+}
+
+
+/**
+ * Inserts the specified message into the list, maintaining message ID order.
+ * @param list the list to insert the message into.
+ * @param content the message to add.
+ * @param size size of the message.
+ */
+void MQTTPersistence_insertInOrder(List* list, void* content, size_t size)
+{
+	ListElement* index = NULL;
+	ListElement* current = NULL;
+
+	FUNC_ENTRY;
+	while(ListNextElement(list, &current) != NULL && index == NULL)
+	{
+		if ( ((Messages*)content)->msgid < ((Messages*)current->content)->msgid )
+			index = current;
+	}
+
+	ListInsert(list, content, size, index);
+	FUNC_EXIT;
+}
+
+
+/**
+ * Adds a record to the persistent store. This function must not be called for QoS0
+ * messages.
+ * @param socket the socket of the client.
+ * @param buf0 fixed header.
+ * @param buf0len length of the fixed header.
+ * @param count number of buffers representing the variable header and/or the payload.
+ * @param buffers the buffers representing the variable header and/or the payload.
+ * @param buflens length of the buffers representing the variable header and/or the payload.
+ * @param msgId the message ID.
+ * @param scr 0 indicates message in the sending direction; 1 indicates message in the
+ * receiving direction.
+ * @return 0 if success, #MQTTCLIENT_PERSISTENCE_ERROR otherwise.
+ */
+int MQTTPersistence_put(int socket, char* buf0, size_t buf0len, int count,
+								 char** buffers, size_t* buflens, int htype, int msgId, int scr )
+{
+	int rc = 0;
+	extern ClientStates* bstate;
+	int nbufs, i;
+	int* lens = NULL;
+	char** bufs = NULL;
+	char *key;
+	Clients* client = NULL;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &socket, clientSocketCompare)->content);
+	if (client->persistence != NULL)
+	{
+		key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+		nbufs = 1 + count;
+		lens = (int *)malloc(nbufs * sizeof(int));
+		bufs = (char **)malloc(nbufs * sizeof(char *));
+		lens[0] = (int)buf0len;
+		bufs[0] = buf0;
+		for (i = 0; i < count; i++)
+		{
+			lens[i+1] = (int)buflens[i];
+			bufs[i+1] = buffers[i];
+		}
+
+		/* key */
+		if ( scr == 0 )
+		{  /* sending */
+			if (htype == PUBLISH)   /* PUBLISH QoS1 and QoS2*/
+				sprintf(key, "%s%d", PERSISTENCE_PUBLISH_SENT, msgId);
+			if (htype == PUBREL)  /* PUBREL */
+				sprintf(key, "%s%d", PERSISTENCE_PUBREL, msgId);
+		}
+		if ( scr == 1 )  /* receiving PUBLISH QoS2 */
+			sprintf(key, "%s%d", PERSISTENCE_PUBLISH_RECEIVED, msgId);
+
+		rc = client->persistence->pput(client->phandle, key, nbufs, bufs, lens);
+
+		free(key);
+		free(lens);
+		free(bufs);
+	}
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Deletes a record from the persistent store.
+ * @param client the client as ::Clients.
+ * @param type the type of the persisted record: #PERSISTENCE_PUBLISH_SENT, #PERSISTENCE_PUBREL
+ * or #PERSISTENCE_PUBLISH_RECEIVED.
+ * @param qos the qos field of the message.
+ * @param msgId the message ID.
+ * @return 0 if success, #MQTTCLIENT_PERSISTENCE_ERROR otherwise.
+ */
+int MQTTPersistence_remove(Clients* c, char *type, int qos, int msgId)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (c->persistence != NULL)
+	{
+		char *key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+		if ( (strcmp(type,PERSISTENCE_PUBLISH_SENT) == 0) && qos == 2 )
+		{
+			sprintf(key, "%s%d", PERSISTENCE_PUBLISH_SENT, msgId) ;
+			rc = c->persistence->premove(c->phandle, key);
+			sprintf(key, "%s%d", PERSISTENCE_PUBREL, msgId) ;
+			rc = c->persistence->premove(c->phandle, key);
+		}
+		else /* PERSISTENCE_PUBLISH_SENT && qos == 1 */
+		{    /* or PERSISTENCE_PUBLISH_RECEIVED */
+			sprintf(key, "%s%d", type, msgId) ;
+			rc = c->persistence->premove(c->phandle, key);
+		}
+		free(key);
+	}
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Checks whether the message IDs wrapped by looking for the largest gap between two consecutive
+ * message IDs in the outboundMsgs queue.
+ * @param client the client as ::Clients.
+ */
+void MQTTPersistence_wrapMsgID(Clients *client)
+{
+	ListElement* wrapel = NULL;
+	ListElement* current = NULL;
+
+	FUNC_ENTRY;
+	if ( client->outboundMsgs->count > 0 )
+	{
+		int firstMsgID = ((Messages*)client->outboundMsgs->first->content)->msgid;
+		int lastMsgID = ((Messages*)client->outboundMsgs->last->content)->msgid;
+		int gap = MAX_MSG_ID - lastMsgID + firstMsgID;
+		current = ListNextElement(client->outboundMsgs, &current);
+
+		while(ListNextElement(client->outboundMsgs, &current) != NULL)
+		{
+			int curMsgID = ((Messages*)current->content)->msgid;
+			int curPrevMsgID = ((Messages*)current->prev->content)->msgid;
+			int curgap = curMsgID - curPrevMsgID;
+			if ( curgap > gap )
+			{
+				gap = curgap;
+				wrapel = current;
+			}
+		}
+	}
+
+	if ( wrapel != NULL )
+	{
+		/* put wrapel at the beginning of the queue */
+		client->outboundMsgs->first->prev = client->outboundMsgs->last;
+		client->outboundMsgs->last->next = client->outboundMsgs->first;
+		client->outboundMsgs->first = wrapel;
+		client->outboundMsgs->last = wrapel->prev;
+		client->outboundMsgs->first->prev = NULL;
+		client->outboundMsgs->last->next = NULL;
+	}
+	FUNC_EXIT;
+}
+
+
+#if !defined(NO_PERSISTENCE)
+int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe)
+{
+	int rc = 0;
+	char key[PERSISTENCE_MAX_KEY_LENGTH + 1];
+	
+	FUNC_ENTRY;
+	sprintf(key, "%s%u", PERSISTENCE_QUEUE_KEY, qe->seqno);
+	if ((rc = client->persistence->premove(client->phandle, key)) != 0)
+		Log(LOG_ERROR, 0, "Error %d removing qEntry from persistence", rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry* qe)
+{
+	int rc = 0;
+	int nbufs = 8;
+	int bufindex = 0;
+	char key[PERSISTENCE_MAX_KEY_LENGTH + 1];
+	int* lens = NULL;
+	void** bufs = NULL;
+		
+	FUNC_ENTRY;
+	lens = (int*)malloc(nbufs * sizeof(int));
+	bufs = malloc(nbufs * sizeof(char *));
+						
+	bufs[bufindex] = &qe->msg->payloadlen;
+	lens[bufindex++] = sizeof(qe->msg->payloadlen);
+				
+	bufs[bufindex] = qe->msg->payload;
+	lens[bufindex++] = qe->msg->payloadlen;
+		
+	bufs[bufindex] = &qe->msg->qos;
+	lens[bufindex++] = sizeof(qe->msg->qos);
+		
+	bufs[bufindex] = &qe->msg->retained;
+	lens[bufindex++] = sizeof(qe->msg->retained);
+		
+	bufs[bufindex] = &qe->msg->dup;
+	lens[bufindex++] = sizeof(qe->msg->dup);
+				
+	bufs[bufindex] = &qe->msg->msgid;
+	lens[bufindex++] = sizeof(qe->msg->msgid);
+						
+	bufs[bufindex] = qe->topicName;
+	lens[bufindex++] = (int)strlen(qe->topicName) + 1;
+				
+	bufs[bufindex] = &qe->topicLen;
+	lens[bufindex++] = sizeof(qe->topicLen);			
+		
+	sprintf(key, "%s%d", PERSISTENCE_QUEUE_KEY, ++aclient->qentry_seqno);	
+	qe->seqno = aclient->qentry_seqno;
+
+	if ((rc = aclient->persistence->pput(aclient->phandle, key, nbufs, (char**)bufs, lens)) != 0)
+		Log(LOG_ERROR, 0, "Error persisting queue entry, rc %d", rc);
+
+	free(lens);
+	free(bufs);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static MQTTPersistence_qEntry* MQTTPersistence_restoreQueueEntry(char* buffer, size_t buflen)
+{
+	MQTTPersistence_qEntry* qe = NULL;
+	char* ptr = buffer;
+	int data_size;
+	
+	FUNC_ENTRY;
+	qe = malloc(sizeof(MQTTPersistence_qEntry));
+	memset(qe, '\0', sizeof(MQTTPersistence_qEntry));
+	
+	qe->msg = malloc(sizeof(MQTTPersistence_message));
+	memset(qe->msg, '\0', sizeof(MQTTPersistence_message));
+	
+	qe->msg->payloadlen = *(int*)ptr;
+	ptr += sizeof(int);
+	
+	data_size = qe->msg->payloadlen;
+	qe->msg->payload = malloc(data_size);
+	memcpy(qe->msg->payload, ptr, data_size);
+	ptr += data_size;
+	
+	qe->msg->qos = *(int*)ptr;
+	ptr += sizeof(int);
+	
+	qe->msg->retained = *(int*)ptr;
+	ptr += sizeof(int);
+	
+	qe->msg->dup = *(int*)ptr;
+	ptr += sizeof(int);
+	
+	qe->msg->msgid = *(int*)ptr;
+	ptr += sizeof(int);
+	
+	data_size = (int)strlen(ptr) + 1;	
+	qe->topicName = malloc(data_size);
+	strcpy(qe->topicName, ptr);
+	ptr += data_size;
+	
+	qe->topicLen = *(int*)ptr;
+	ptr += sizeof(int);
+
+	FUNC_EXIT;
+	return qe;
+}
+
+
+static void MQTTPersistence_insertInSeqOrder(List* list, MQTTPersistence_qEntry* qEntry, size_t size)
+{
+	ListElement* index = NULL;
+	ListElement* current = NULL;
+
+	FUNC_ENTRY;
+	while (ListNextElement(list, &current) != NULL && index == NULL)
+	{
+		if (qEntry->seqno < ((MQTTPersistence_qEntry*)current->content)->seqno)
+			index = current;
+	}
+	ListInsert(list, qEntry, size, index);
+	FUNC_EXIT;
+}
+
+
+/**
+ * Restores a queue of messages from persistence to memory
+ * @param c the client as ::Clients - the client object to restore the messages to
+ * @return return code, 0 if successful
+ */
+int MQTTPersistence_restoreMessageQueue(Clients* c)
+{
+	int rc = 0;
+	char **msgkeys;
+	int nkeys;
+	int i = 0;
+	int entries_restored = 0;
+
+	FUNC_ENTRY;
+	if (c->persistence && (rc = c->persistence->pkeys(c->phandle, &msgkeys, &nkeys)) == 0)
+	{
+		while (rc == 0 && i < nkeys)
+		{
+			char *buffer = NULL;
+			int buflen;
+					
+			if (strncmp(msgkeys[i], PERSISTENCE_QUEUE_KEY, strlen(PERSISTENCE_QUEUE_KEY)) != 0)
+			{
+				;
+			}
+			else if ((rc = c->persistence->pget(c->phandle, msgkeys[i], &buffer, &buflen)) == 0)
+			{
+				MQTTPersistence_qEntry* qe = MQTTPersistence_restoreQueueEntry(buffer, buflen);
+				
+				if (qe)
+				{	
+					qe->seqno = atoi(msgkeys[i]+2);
+					MQTTPersistence_insertInSeqOrder(c->messageQueue, qe, sizeof(MQTTPersistence_qEntry));
+					free(buffer);
+					c->qentry_seqno = max(c->qentry_seqno, qe->seqno);
+					entries_restored++;
+				}
+			}
+			if (msgkeys[i])
+			{
+				free(msgkeys[i]);
+			}
+			i++;
+		}
+		if (msgkeys != NULL)
+			free(msgkeys);
+	}
+	Log(TRACE_MINIMUM, -1, "%d queued messages restored for client %s", entries_restored, c->clientID);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPersistence.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPersistence.h b/thirdparty/paho.mqtt.c/src/MQTTPersistence.h
new file mode 100644
index 0000000..9a938ba
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPersistence.h
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - async client updates
+ *    Ian Craggs - fix for bug 432903 - queue persistence
+ *******************************************************************************/
+
+#if defined(__cplusplus)
+ extern "C" {
+#endif
+
+#include "Clients.h"
+
+/** Stem of the key for a sent PUBLISH QoS1 or QoS2 */
+#define PERSISTENCE_PUBLISH_SENT "s-"
+/** Stem of the key for a sent PUBREL */
+#define PERSISTENCE_PUBREL "sc-"
+/** Stem of the key for a received PUBLISH QoS2 */
+#define PERSISTENCE_PUBLISH_RECEIVED "r-"
+/** Stem of the key for an async client command */
+#define PERSISTENCE_COMMAND_KEY "c-"
+/** Stem of the key for an async client message queue */
+#define PERSISTENCE_QUEUE_KEY "q-"
+#define PERSISTENCE_MAX_KEY_LENGTH 8
+
+int MQTTPersistence_create(MQTTClient_persistence** per, int type, void* pcontext);
+int MQTTPersistence_initialize(Clients* c, const char* serverURI);
+int MQTTPersistence_close(Clients* c);
+int MQTTPersistence_clear(Clients* c);
+int MQTTPersistence_restore(Clients* c);
+void* MQTTPersistence_restorePacket(char* buffer, size_t buflen);
+void MQTTPersistence_insertInOrder(List* list, void* content, size_t size);
+int MQTTPersistence_put(int socket, char* buf0, size_t buf0len, int count, 
+								 char** buffers, size_t* buflens, int htype, int msgId, int scr);
+int MQTTPersistence_remove(Clients* c, char* type, int qos, int msgId);
+void MQTTPersistence_wrapMsgID(Clients *c);
+
+typedef struct
+{
+	char struct_id[4];
+	int struct_version;
+	int payloadlen;
+	void* payload;
+	int qos;
+	int retained;
+	int dup;
+	int msgid;
+} MQTTPersistence_message;
+
+typedef struct
+{
+	MQTTPersistence_message* msg;
+	char* topicName;
+	int topicLen;
+	unsigned int seqno; /* only used on restore */
+} MQTTPersistence_qEntry;
+
+int MQTTPersistence_unpersistQueueEntry(Clients* client, MQTTPersistence_qEntry* qe);
+int MQTTPersistence_persistQueueEntry(Clients* aclient, MQTTPersistence_qEntry* qe);
+int MQTTPersistence_restoreMessageQueue(Clients* c);
+#ifdef __cplusplus
+     }
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.c b/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.c
new file mode 100644
index 0000000..35c1f53
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.c
@@ -0,0 +1,841 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2016 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - async client updates
+ *    Ian Craggs - fix for bug 484496
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief A file system based persistence implementation.
+ *
+ * A directory is specified when the MQTT client is created. When the persistence is then
+ * opened (see ::Persistence_open), a sub-directory is made beneath the base for this
+ * particular client ID and connection key. This allows one persistence base directory to
+ * be shared by multiple clients.
+ *
+ */
+
+#if !defined(NO_PERSISTENCE)
+
+#include "OsWrapper.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#if defined(WIN32) || defined(WIN64)
+	#include <direct.h>
+	/* Windows doesn't have strtok_r, so remap it to strtok */
+	#define strtok_r( A, B, C ) strtok( A, B )
+	int keysWin32(char *, char ***, int *);
+	int clearWin32(char *);
+	int containskeyWin32(char *, char *);
+#else
+	#include <sys/stat.h>
+	#include <dirent.h>
+	#include <unistd.h>
+	int keysUnix(char *, char ***, int *);
+	int clearUnix(char *);
+	int containskeyUnix(char *, char *);
+#endif
+
+#include "MQTTClientPersistence.h"
+#include "MQTTPersistenceDefault.h"
+#include "StackTrace.h"
+#include "Heap.h"
+
+/** Create persistence directory for the client: context/clientID-serverURI.
+ *  See ::Persistence_open
+ */
+
+int pstopen(void **handle, const char* clientID, const char* serverURI, void* context)
+{
+	int rc = 0;
+	char *dataDir = context;
+	char *clientDir;
+	char *pToken = NULL;
+	char *save_ptr = NULL;
+	char *pCrtDirName = NULL;
+	char *pTokDirName = NULL;
+	char *perserverURI = NULL, *ptraux;
+
+	FUNC_ENTRY;
+	/* Note that serverURI=address:port, but ":" not allowed in Windows directories */
+	perserverURI = malloc(strlen(serverURI) + 1);
+	strcpy(perserverURI, serverURI);
+	while ((ptraux = strstr(perserverURI, ":")) != NULL)
+		*ptraux = '-' ;
+
+	/* consider '/'  +  '-'  +  '\0' */
+	clientDir = malloc(strlen(dataDir) + strlen(clientID) + strlen(perserverURI) + 3);
+	sprintf(clientDir, "%s/%s-%s", dataDir, clientID, perserverURI);
+
+
+	/* create clientDir directory */
+
+	/* pCrtDirName - holds the directory name we are currently trying to create.           */
+	/*               This gets built up level by level until the full path name is created.*/
+	/* pTokDirName - holds the directory name that gets used by strtok.         */
+	pCrtDirName = (char*)malloc( strlen(clientDir) + 1 );
+	pTokDirName = (char*)malloc( strlen(clientDir) + 1 );
+	strcpy( pTokDirName, clientDir );
+
+	pToken = strtok_r( pTokDirName, "\\/", &save_ptr );
+
+	strcpy( pCrtDirName, pToken );
+	rc = pstmkdir( pCrtDirName );
+	pToken = strtok_r( NULL, "\\/", &save_ptr );
+	while ( (pToken != NULL) && (rc == 0) )
+	{
+		/* Append the next directory level and try to create it */
+		strcat( pCrtDirName, "/" );
+		strcat( pCrtDirName, pToken );
+		rc = pstmkdir( pCrtDirName );
+		pToken = strtok_r( NULL, "\\/", &save_ptr );
+	}
+
+	*handle = clientDir;
+
+	free(pTokDirName);
+	free(pCrtDirName);
+	free(perserverURI);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+/** Function to create a directory.
+ * Returns 0 on success or if the directory already exists.
+ */
+int pstmkdir( char *pPathname )
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	if ( _mkdir( pPathname ) != 0 )
+	{
+#else
+	/* Create a directory with read, write and execute access for the owner and read access for the group */
+#if !defined(_WRS_KERNEL)
+	if ( mkdir( pPathname, S_IRWXU | S_IRGRP ) != 0 )
+#else
+	if ( mkdir( pPathname ) != 0 )
+#endif /* !defined(_WRS_KERNEL) */
+	{
+#endif
+		if ( errno != EEXIST )
+			rc = MQTTCLIENT_PERSISTENCE_ERROR;
+	}
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+
+/** Write wire message to the client persistence directory.
+ *  See ::Persistence_put
+ */
+int pstput(void* handle, char* key, int bufcount, char* buffers[], int buflens[])
+{
+	int rc = 0;
+	char *clientDir = handle;
+	char *file;
+	FILE *fp;
+	size_t bytesWritten = 0,
+	       bytesTotal = 0;
+	int i;
+
+	FUNC_ENTRY;
+	if (clientDir == NULL)
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+	/* consider '/' + '\0' */
+	file = malloc(strlen(clientDir) + strlen(key) + strlen(MESSAGE_FILENAME_EXTENSION) + 2 );
+	sprintf(file, "%s/%s%s", clientDir, key, MESSAGE_FILENAME_EXTENSION);
+
+	fp = fopen(file, "wb");
+	if ( fp != NULL )
+	{
+		for(i=0; i<bufcount; i++)
+		{
+			bytesTotal += buflens[i];
+			bytesWritten += fwrite(buffers[i], sizeof(char), buflens[i], fp );
+		}
+		fclose(fp);
+		fp = NULL;
+	} else
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+
+	if (bytesWritten != bytesTotal)
+	{
+		pstremove(handle, key);
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+	}
+
+	free(file);
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+};
+
+
+/** Retrieve a wire message from the client persistence directory.
+ *  See ::Persistence_get
+ */
+int pstget(void* handle, char* key, char** buffer, int* buflen)
+{
+	int rc = 0;
+	FILE *fp;
+	char *clientDir = handle;
+	char *file;
+	char *buf;
+	unsigned long fileLen = 0;
+	unsigned long bytesRead = 0;
+
+	FUNC_ENTRY;
+	if (clientDir == NULL)
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+	/* consider '/' + '\0' */
+	file = malloc(strlen(clientDir) + strlen(key) + strlen(MESSAGE_FILENAME_EXTENSION) + 2);
+	sprintf(file, "%s/%s%s", clientDir, key, MESSAGE_FILENAME_EXTENSION);
+
+	fp = fopen(file, "rb");
+	if ( fp != NULL )
+	{
+		fseek(fp, 0, SEEK_END);
+		fileLen = ftell(fp);
+		fseek(fp, 0, SEEK_SET);
+		buf=(char *)malloc(fileLen);
+		bytesRead = (int)fread(buf, sizeof(char), fileLen, fp);
+		*buffer = buf;
+		*buflen = bytesRead;
+		if ( bytesRead != fileLen )
+			rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		fclose(fp);
+		fp = NULL;
+	} else
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+
+	free(file);
+	/* the caller must free buf */
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+
+/** Delete a persisted message from the client persistence directory.
+ *  See ::Persistence_remove
+ */
+int pstremove(void* handle, char* key)
+{
+	int rc = 0;
+	char *clientDir = handle;
+	char *file;
+
+	FUNC_ENTRY;
+	if (clientDir == NULL)
+	{
+		return rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+	/* consider '/' + '\0' */
+	file = malloc(strlen(clientDir) + strlen(key) + strlen(MESSAGE_FILENAME_EXTENSION) + 2);
+	sprintf(file, "%s/%s%s", clientDir, key, MESSAGE_FILENAME_EXTENSION);
+
+#if defined(WIN32) || defined(WIN64)
+	if ( _unlink(file) != 0 )
+	{
+#else
+	if ( unlink(file) != 0 )
+	{
+#endif
+		if ( errno != ENOENT )
+			rc = MQTTCLIENT_PERSISTENCE_ERROR;
+	}
+
+	free(file);
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/** Delete client persistence directory (if empty).
+ *  See ::Persistence_close
+ */
+int pstclose(void* handle)
+{
+	int rc = 0;
+	char *clientDir = handle;
+
+	FUNC_ENTRY;
+	if (clientDir == NULL)
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+#if defined(WIN32) || defined(WIN64)
+	if ( _rmdir(clientDir) != 0 )
+	{
+#else
+	if ( rmdir(clientDir) != 0 )
+	{
+#endif
+		if ( errno != ENOENT && errno != ENOTEMPTY )
+			rc = MQTTCLIENT_PERSISTENCE_ERROR;
+	}
+
+	free(clientDir);
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/** Returns whether if a wire message is persisted in the client persistence directory.
+ * See ::Persistence_containskey
+ */
+int pstcontainskey(void *handle, char *key)
+{
+	int rc = 0;
+	char *clientDir = handle;
+
+	FUNC_ENTRY;
+	if (clientDir == NULL)
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+#if defined(WIN32) || defined(WIN64)
+	rc = containskeyWin32(clientDir, key);
+#else
+	rc = containskeyUnix(clientDir, key);
+#endif
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+#if defined(WIN32) || defined(WIN64)
+int containskeyWin32(char *dirname, char *key)
+{
+	int notFound = MQTTCLIENT_PERSISTENCE_ERROR;
+	int fFinished = 0;
+	char *filekey, *ptraux;
+	char dir[MAX_PATH+1];
+	WIN32_FIND_DATAA FileData;
+	HANDLE hDir;
+
+	FUNC_ENTRY;
+	sprintf(dir, "%s/*", dirname);
+
+	hDir = FindFirstFileA(dir, &FileData);
+	if (hDir != INVALID_HANDLE_VALUE)
+	{
+		while (!fFinished)
+		{
+			if (FileData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
+			{
+				filekey = malloc(strlen(FileData.cFileName) + 1);
+				strcpy(filekey, FileData.cFileName);
+				ptraux = strstr(filekey, MESSAGE_FILENAME_EXTENSION);
+				if ( ptraux != NULL )
+					*ptraux = '\0' ;
+				if(strcmp(filekey, key) == 0)
+				{
+					notFound = 0;
+					fFinished = 1;
+				}
+				free(filekey);
+			}
+			if (!FindNextFileA(hDir, &FileData))
+			{
+				if (GetLastError() == ERROR_NO_MORE_FILES)
+					fFinished = 1;
+			}
+		}
+		FindClose(hDir);
+	}
+
+	FUNC_EXIT_RC(notFound);
+	return notFound;
+}
+#else
+int containskeyUnix(char *dirname, char *key)
+{
+	int notFound = MQTTCLIENT_PERSISTENCE_ERROR;
+	char *filekey, *ptraux;
+	DIR *dp;
+	struct dirent *dir_entry;
+	struct stat stat_info;
+
+	FUNC_ENTRY;
+	if((dp = opendir(dirname)) != NULL)
+	{
+		while((dir_entry = readdir(dp)) != NULL && notFound)
+		{
+			char* filename = malloc(strlen(dirname) + strlen(dir_entry->d_name) + 2);
+			sprintf(filename, "%s/%s", dirname, dir_entry->d_name);
+			lstat(filename, &stat_info);
+			free(filename);
+			if(S_ISREG(stat_info.st_mode))
+			{
+				filekey = malloc(strlen(dir_entry->d_name) + 1);
+				strcpy(filekey, dir_entry->d_name);
+				ptraux = strstr(filekey, MESSAGE_FILENAME_EXTENSION);
+				if ( ptraux != NULL )
+					*ptraux = '\0' ;
+				if(strcmp(filekey, key) == 0)
+					notFound = 0;
+				free(filekey);
+			}
+		}
+		closedir(dp);
+	}
+
+	FUNC_EXIT_RC(notFound);
+	return notFound;
+}
+#endif
+
+
+/** Delete all the persisted message in the client persistence directory.
+ * See ::Persistence_clear
+ */
+int pstclear(void *handle)
+{
+	int rc = 0;
+	char *clientDir = handle;
+
+	FUNC_ENTRY;
+	if (clientDir == NULL)
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+#if defined(WIN32) || defined(WIN64)
+	rc = clearWin32(clientDir);
+#else
+	rc = clearUnix(clientDir);
+#endif
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+#if defined(WIN32) || defined(WIN64)
+int clearWin32(char *dirname)
+{
+	int rc = 0;
+	int fFinished = 0;
+	char *file;
+	char dir[MAX_PATH+1];
+	WIN32_FIND_DATAA FileData;
+	HANDLE hDir;
+
+	FUNC_ENTRY;
+	sprintf(dir, "%s/*", dirname);
+
+	hDir = FindFirstFileA(dir, &FileData);
+	if (hDir != INVALID_HANDLE_VALUE)
+	{
+		while (!fFinished)
+		{
+			if (FileData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
+			{
+				file = malloc(strlen(dirname) + strlen(FileData.cFileName) + 2);
+				sprintf(file, "%s/%s", dirname, FileData.cFileName);
+				rc = remove(file);
+				free(file);
+				if ( rc != 0 )
+				{
+					rc = MQTTCLIENT_PERSISTENCE_ERROR;
+					break;
+				}
+			}
+			if (!FindNextFileA(hDir, &FileData))
+			{
+				if (GetLastError() == ERROR_NO_MORE_FILES)
+					fFinished = 1;
+			}
+		}
+		FindClose(hDir);
+	} else
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+#else
+int clearUnix(char *dirname)
+{
+	int rc = 0;
+	DIR *dp;
+	struct dirent *dir_entry;
+	struct stat stat_info;
+
+	FUNC_ENTRY;
+	if((dp = opendir(dirname)) != NULL)
+	{
+		while((dir_entry = readdir(dp)) != NULL && rc == 0)
+		{
+			lstat(dir_entry->d_name, &stat_info);
+			if(S_ISREG(stat_info.st_mode))
+			{
+				if ( remove(dir_entry->d_name) != 0 )
+					rc = MQTTCLIENT_PERSISTENCE_ERROR;
+			}
+		}
+		closedir(dp);
+	} else
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+#endif
+
+
+/** Returns the keys (file names w/o the extension) in the client persistence directory.
+ *  See ::Persistence_keys
+ */
+int pstkeys(void *handle, char ***keys, int *nkeys)
+{
+	int rc = 0;
+	char *clientDir = handle;
+
+	FUNC_ENTRY;
+	if (clientDir == NULL)
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+#if defined(WIN32) || defined(WIN64)
+	rc = keysWin32(clientDir, keys, nkeys);
+#else
+	rc = keysUnix(clientDir, keys, nkeys);
+#endif
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+#if defined(WIN32) || defined(WIN64)
+int keysWin32(char *dirname, char ***keys, int *nkeys)
+{
+	int rc = 0;
+	char **fkeys = NULL;
+	int nfkeys = 0;
+	char dir[MAX_PATH+1];
+	WIN32_FIND_DATAA FileData;
+	HANDLE hDir;
+	int fFinished = 0;
+	char *ptraux;
+	int i;
+
+	FUNC_ENTRY;
+	sprintf(dir, "%s/*", dirname);
+
+	/* get number of keys */
+	hDir = FindFirstFileA(dir, &FileData);
+	if (hDir != INVALID_HANDLE_VALUE)
+	{
+		while (!fFinished)
+		{
+			if (FileData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
+				nfkeys++;
+			if (!FindNextFileA(hDir, &FileData))
+			{
+				if (GetLastError() == ERROR_NO_MORE_FILES)
+					fFinished = 1;
+			}
+		}
+		FindClose(hDir);
+	} else
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+	if (nfkeys != 0 )
+		fkeys = (char **)malloc(nfkeys * sizeof(char *));
+
+	/* copy the keys */
+	hDir = FindFirstFileA(dir, &FileData);
+	if (hDir != INVALID_HANDLE_VALUE)
+	{
+		fFinished = 0;
+		i = 0;
+		while (!fFinished)
+		{
+			if (FileData.dwFileAttributes & FILE_ATTRIBUTE_ARCHIVE)
+			{
+				fkeys[i] = malloc(strlen(FileData.cFileName) + 1);
+				strcpy(fkeys[i], FileData.cFileName);
+				ptraux = strstr(fkeys[i], MESSAGE_FILENAME_EXTENSION);
+				if ( ptraux != NULL )
+					*ptraux = '\0' ;
+				i++;
+			}
+			if (!FindNextFileA(hDir, &FileData))
+			{
+				if (GetLastError() == ERROR_NO_MORE_FILES)
+					fFinished = 1;
+			}
+		}
+		FindClose(hDir);
+	} else
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+	*nkeys = nfkeys;
+	*keys = fkeys;
+	/* the caller must free keys */
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+#else
+int keysUnix(char *dirname, char ***keys, int *nkeys)
+{
+	int rc = 0;
+	char **fkeys = NULL;
+	int nfkeys = 0;
+	char *ptraux;
+	int i;
+	DIR *dp;
+	struct dirent *dir_entry;
+	struct stat stat_info;
+
+	FUNC_ENTRY;
+	/* get number of keys */
+	if((dp = opendir(dirname)) != NULL)
+	{
+		while((dir_entry = readdir(dp)) != NULL)
+		{
+			char* temp = malloc(strlen(dirname)+strlen(dir_entry->d_name)+2);
+
+			sprintf(temp, "%s/%s", dirname, dir_entry->d_name);
+			if (lstat(temp, &stat_info) == 0 && S_ISREG(stat_info.st_mode))
+				nfkeys++;
+			free(temp);
+		}
+		closedir(dp);
+	} else
+	{
+		rc = MQTTCLIENT_PERSISTENCE_ERROR;
+		goto exit;
+	}
+
+	if (nfkeys != 0)
+	{
+		fkeys = (char **)malloc(nfkeys * sizeof(char *));
+
+		/* copy the keys */
+		if((dp = opendir(dirname)) != NULL)
+		{
+			i = 0;
+			while((dir_entry = readdir(dp)) != NULL)
+			{
+				char* temp = malloc(strlen(dirname)+strlen(dir_entry->d_name)+2);
+	
+				sprintf(temp, "%s/%s", dirname, dir_entry->d_name);
+				if (lstat(temp, &stat_info) == 0 && S_ISREG(stat_info.st_mode))
+				{
+					fkeys[i] = malloc(strlen(dir_entry->d_name) + 1);
+					strcpy(fkeys[i], dir_entry->d_name);
+					ptraux = strstr(fkeys[i], MESSAGE_FILENAME_EXTENSION);
+					if ( ptraux != NULL )
+						*ptraux = '\0' ;
+					i++;
+				}
+				free(temp);
+			}
+			closedir(dp);
+		} else
+		{
+			rc = MQTTCLIENT_PERSISTENCE_ERROR;
+			goto exit;
+		}
+	}
+
+	*nkeys = nfkeys;
+	*keys = fkeys;
+	/* the caller must free keys */
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+#endif
+
+
+
+#if defined(UNIT_TESTS)
+int main (int argc, char *argv[])
+{
+#define MSTEM "m-"
+#define NMSGS 10
+#define NBUFS 4
+#define NDEL 2
+#define RC !rc ? "(Success)" : "(Failed) "
+
+	int rc;
+	char *handle;
+	char *perdir = ".";
+	const char *clientID = "TheUTClient";
+	const char *serverURI = "127.0.0.1:1883";
+
+	char *stem = MSTEM;
+	int msgId, i;
+	int nm[NDEL] = {5 , 8};  /* msgIds to get and remove */
+
+	char *key;
+	char **keys;
+	int nkeys;
+	char *buffer, *buff;
+	int buflen;
+
+	int nbufs = NBUFS;
+	char *bufs[NBUFS] = {"m0", "mm1", "mmm2" , "mmmm3"};  /* message content */
+	int buflens[NBUFS];
+	for(i=0;i<nbufs;i++)
+		buflens[i]=strlen(bufs[i]);
+
+	/* open */
+	/* printf("Persistence directory : %s\n", perdir); */
+	rc = pstopen((void**)&handle, clientID, serverURI, perdir);
+	printf("%s Persistence directory for client %s : %s\n", RC, clientID, handle);
+
+	/* put */
+	for(msgId=0;msgId<NMSGS;msgId++)
+	{
+		key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+		sprintf(key, "%s%d", stem, msgId);
+		rc = pstput(handle, key, nbufs, bufs, buflens);
+		printf("%s Adding message %s\n", RC, key);
+		free(key);
+	}
+
+	/* keys ,ie, list keys added */
+	rc = pstkeys(handle, &keys, &nkeys);
+	printf("%s Found %d messages persisted in %s\n", RC, nkeys, handle);
+	for(i=0;i<nkeys;i++)
+		printf("%13s\n", keys[i]);
+
+	if (keys !=NULL)
+		free(keys);
+
+	/* containskey */
+	for(i=0;i<NDEL;i++)
+	{
+		key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+		sprintf(key, "%s%d", stem, nm[i]);
+		rc = pstcontainskey(handle, key);
+		printf("%s Message %s is persisted ?\n", RC, key);
+		free(key);
+	}
+
+	/* get && remove*/
+	for(i=0;i<NDEL;i++)
+	{
+		key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+		sprintf(key, "%s%d", stem, nm[i]);
+		rc = pstget(handle, key, &buffer, &buflen);
+		buff = malloc(buflen+1);
+		memcpy(buff, buffer, buflen);
+		buff[buflen] = '\0';
+		printf("%s Retrieving message %s : %s\n", RC, key, buff);
+		rc = pstremove(handle, key);
+		printf("%s Removing message %s\n", RC, key);
+		free(key);
+		free(buff);
+		free(buffer);
+	}
+
+	/* containskey */
+	for(i=0;i<NDEL;i++)
+	{
+		key = malloc(MESSAGE_FILENAME_LENGTH + 1);
+		sprintf(key, "%s%d", stem, nm[i]);
+		rc = pstcontainskey(handle, key);
+		printf("%s Message %s is persisted ?\n", RC, key);
+		free(key);
+	}
+
+	/* keys ,ie, list keys added */
+	rc = pstkeys(handle, &keys, &nkeys);
+	printf("%s Found %d messages persisted in %s\n", RC, nkeys, handle);
+	for(i=0;i<nkeys;i++)
+		printf("%13s\n", keys[i]);
+
+	if (keys != NULL)
+		free(keys);
+
+
+	/* close -> it will fail, since client persistence directory is not empty */
+	rc = pstclose(&handle);
+	printf("%s Closing client persistence directory for client %s\n", RC, clientID);
+
+	/* clear */
+	rc = pstclear(handle);
+	printf("%s Deleting all persisted messages in %s\n", RC, handle);
+
+	/* keys ,ie, list keys added */
+	rc = pstkeys(handle, &keys, &nkeys);
+	printf("%s Found %d messages persisted in %s\n", RC, nkeys, handle);
+	for(i=0;i<nkeys;i++)
+		printf("%13s\n", keys[i]);
+
+	if ( keys != NULL )
+		free(keys);
+
+	/* close */
+	rc = pstclose(&handle);
+	printf("%s Closing client persistence directory for client %s\n", RC, clientID);
+}
+#endif
+
+
+#endif /* NO_PERSISTENCE */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.h b/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.h
new file mode 100644
index 0000000..27fedd6
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTPersistenceDefault.h
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+/** 8.3 filesystem */
+#define MESSAGE_FILENAME_LENGTH 8    
+/** Extension of the filename */
+#define MESSAGE_FILENAME_EXTENSION ".msg"
+
+/* prototypes of the functions for the default file system persistence */
+int pstopen(void** handle, const char* clientID, const char* serverURI, void* context); 
+int pstclose(void* handle); 
+int pstput(void* handle, char* key, int bufcount, char* buffers[], int buflens[]); 
+int pstget(void* handle, char* key, char** buffer, int* buflen); 
+int pstremove(void* handle, char* key); 
+int pstkeys(void* handle, char*** keys, int* nkeys); 
+int pstclear(void* handle); 
+int pstcontainskey(void* handle, char* key);
+
+int pstmkdir(char *pPathname);
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTProtocol.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTProtocol.h b/thirdparty/paho.mqtt.c/src/MQTTProtocol.h
new file mode 100644
index 0000000..7478103
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTProtocol.h
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - MQTT 3.1.1 updates
+ *******************************************************************************/
+
+#if !defined(MQTTPROTOCOL_H)
+#define MQTTPROTOCOL_H
+
+#include "LinkedList.h"
+#include "MQTTPacket.h"
+#include "Clients.h"
+
+#define MAX_MSG_ID 65535
+#define MAX_CLIENTID_LEN 65535
+
+typedef struct
+{
+	int socket;
+	Publications* p;
+} pending_write;
+
+
+typedef struct
+{
+	List publications;
+	unsigned int msgs_received;
+	unsigned int msgs_sent;
+	List pending_writes; /* for qos 0 writes not complete */
+} MQTTProtocol;
+
+
+#include "MQTTProtocolOut.h"
+
+#endif


[02/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Socket.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Socket.c b/thirdparty/paho.mqtt.c/src/Socket.c
new file mode 100644
index 0000000..939dbab
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Socket.c
@@ -0,0 +1,898 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial implementation and documentation
+ *    Ian Craggs - async client updates
+ *    Ian Craggs - fix for bug 484496
+ *    Juergen Kosel, Ian Craggs - fix for issue #135
+ *    Ian Craggs - issue #217
+ *    Ian Craggs - fix for issue #186
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Socket related functions
+ *
+ * Some other related functions are in the SocketBuffer module
+ */
+
+
+#include "Socket.h"
+#include "Log.h"
+#include "SocketBuffer.h"
+#include "Messages.h"
+#include "StackTrace.h"
+#if defined(OPENSSL)
+#include "SSLSocket.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <signal.h>
+#include <ctype.h>
+
+#include "Heap.h"
+
+int Socket_setnonblocking(int sock);
+int Socket_error(char* aString, int sock);
+int Socket_addSocket(int newSd);
+int isReady(int socket, fd_set* read_set, fd_set* write_set);
+int Socket_writev(int socket, iobuf* iovecs, int count, unsigned long* bytes);
+int Socket_close_only(int socket);
+int Socket_continueWrite(int socket);
+int Socket_continueWrites(fd_set* pwset);
+char* Socket_getaddrname(struct sockaddr* sa, int sock);
+
+#if defined(WIN32) || defined(WIN64)
+#define iov_len len
+#define iov_base buf
+#endif
+
+/**
+ * Structure to hold all socket data for the module
+ */
+Sockets s;
+static fd_set wset;
+
+/**
+ * Set a socket non-blocking, OS independently
+ * @param sock the socket to set non-blocking
+ * @return TCP call error code
+ */
+int Socket_setnonblocking(int sock)
+{
+	int rc;
+#if defined(WIN32) || defined(WIN64)
+	u_long flag = 1L;
+
+	FUNC_ENTRY;
+	rc = ioctl(sock, FIONBIO, &flag);
+#else
+	int flags;
+
+	FUNC_ENTRY;
+	if ((flags = fcntl(sock, F_GETFL, 0)))
+		flags = 0;
+	rc = fcntl(sock, F_SETFL, flags | O_NONBLOCK);
+#endif
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Gets the specific error corresponding to SOCKET_ERROR
+ * @param aString the function that was being used when the error occurred
+ * @param sock the socket on which the error occurred
+ * @return the specific TCP error code
+ */
+int Socket_error(char* aString, int sock)
+{
+#if defined(WIN32) || defined(WIN64)
+	int errno;
+#endif
+
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	errno = WSAGetLastError();
+#endif
+	if (errno != EINTR && errno != EAGAIN && errno != EINPROGRESS && errno != EWOULDBLOCK)
+	{
+		if (strcmp(aString, "shutdown") != 0 || (errno != ENOTCONN && errno != ECONNRESET))
+			Log(TRACE_MINIMUM, -1, "Socket error %s(%d) in %s for socket %d", strerror(errno), errno, aString, sock);
+	}
+	FUNC_EXIT_RC(errno);
+	return errno;
+}
+
+
+/**
+ * Initialize the socket module
+ */
+void Socket_outInitialize(void)
+{
+#if defined(WIN32) || defined(WIN64)
+	WORD    winsockVer = 0x0202;
+	WSADATA wsd;
+
+	FUNC_ENTRY;
+	WSAStartup(winsockVer, &wsd);
+#else
+	FUNC_ENTRY;
+	signal(SIGPIPE, SIG_IGN);
+#endif
+
+	SocketBuffer_initialize();
+	s.clientsds = ListInitialize();
+	s.connect_pending = ListInitialize();
+	s.write_pending = ListInitialize();
+	s.cur_clientsds = NULL;
+	FD_ZERO(&(s.rset));														/* Initialize the descriptor set */
+	FD_ZERO(&(s.pending_wset));
+	s.maxfdp1 = 0;
+	memcpy((void*)&(s.rset_saved), (void*)&(s.rset), sizeof(s.rset_saved));
+	FUNC_EXIT;
+}
+
+
+/**
+ * Terminate the socket module
+ */
+void Socket_outTerminate(void)
+{
+	FUNC_ENTRY;
+	ListFree(s.connect_pending);
+	ListFree(s.write_pending);
+	ListFree(s.clientsds);
+	SocketBuffer_terminate();
+#if defined(WIN32) || defined(WIN64)
+	WSACleanup();
+#endif
+	FUNC_EXIT;
+}
+
+
+/**
+ * Add a socket to the list of socket to check with select
+ * @param newSd the new socket to add
+ */
+int Socket_addSocket(int newSd)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (ListFindItem(s.clientsds, &newSd, intcompare) == NULL) /* make sure we don't add the same socket twice */
+	{
+		if (s.clientsds->count >= FD_SETSIZE)
+		{
+			Log(LOG_ERROR, -1, "addSocket: exceeded FD_SETSIZE %d", FD_SETSIZE);
+			rc = SOCKET_ERROR;
+		}
+		else
+		{
+			int* pnewSd = (int*)malloc(sizeof(newSd));
+			*pnewSd = newSd;
+			ListAppend(s.clientsds, pnewSd, sizeof(newSd));
+			FD_SET(newSd, &(s.rset_saved));
+			s.maxfdp1 = max(s.maxfdp1, newSd + 1);
+			rc = Socket_setnonblocking(newSd);
+			if (rc == SOCKET_ERROR)
+				Log(LOG_ERROR, -1, "addSocket: setnonblocking");
+		}
+	}
+	else
+		Log(LOG_ERROR, -1, "addSocket: socket %d already in the list", newSd);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Don't accept work from a client unless it is accepting work back, i.e. its socket is writeable
+ * this seems like a reasonable form of flow control, and practically, seems to work.
+ * @param socket the socket to check
+ * @param read_set the socket read set (see select doc)
+ * @param write_set the socket write set (see select doc)
+ * @return boolean - is the socket ready to go?
+ */
+int isReady(int socket, fd_set* read_set, fd_set* write_set)
+{
+	int rc = 1;
+
+	FUNC_ENTRY;
+	if  (ListFindItem(s.connect_pending, &socket, intcompare) && FD_ISSET(socket, write_set))
+		ListRemoveItem(s.connect_pending, &socket, intcompare);
+	else
+		rc = FD_ISSET(socket, read_set) && FD_ISSET(socket, write_set) && Socket_noPendingWrites(socket);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ *  Returns the next socket ready for communications as indicated by select
+ *  @param more_work flag to indicate more work is waiting, and thus a timeout value of 0 should
+ *  be used for the select
+ *  @param tp the timeout to be used for the select, unless overridden
+ *  @return the socket next ready, or 0 if none is ready
+ */
+int Socket_getReadySocket(int more_work, struct timeval *tp)
+{
+	int rc = 0;
+	static struct timeval zero = {0L, 0L}; /* 0 seconds */
+	static struct timeval one = {1L, 0L}; /* 1 second */
+	struct timeval timeout = one;
+
+	FUNC_ENTRY;
+	if (s.clientsds->count == 0)
+		goto exit;
+
+	if (more_work)
+		timeout = zero;
+	else if (tp)
+		timeout = *tp;
+
+	while (s.cur_clientsds != NULL)
+	{
+		if (isReady(*((int*)(s.cur_clientsds->content)), &(s.rset), &wset))
+			break;
+		ListNextElement(s.clientsds, &s.cur_clientsds);
+	}
+
+	if (s.cur_clientsds == NULL)
+	{
+		int rc1;
+		fd_set pwset;
+
+		memcpy((void*)&(s.rset), (void*)&(s.rset_saved), sizeof(s.rset));
+		memcpy((void*)&(pwset), (void*)&(s.pending_wset), sizeof(pwset));
+		if ((rc = select(s.maxfdp1, &(s.rset), &pwset, NULL, &timeout)) == SOCKET_ERROR)
+		{
+			Socket_error("read select", 0);
+			goto exit;
+		}
+		Log(TRACE_MAX, -1, "Return code %d from read select", rc);
+
+		if (Socket_continueWrites(&pwset) == SOCKET_ERROR)
+		{
+			rc = 0;
+			goto exit;
+		}
+
+		memcpy((void*)&wset, (void*)&(s.rset_saved), sizeof(wset));
+		if ((rc1 = select(s.maxfdp1, NULL, &(wset), NULL, &zero)) == SOCKET_ERROR)
+		{
+			Socket_error("write select", 0);
+			rc = rc1;
+			goto exit;
+		}
+		Log(TRACE_MAX, -1, "Return code %d from write select", rc1);
+
+		if (rc == 0 && rc1 == 0)
+			goto exit; /* no work to do */
+
+		s.cur_clientsds = s.clientsds->first;
+		while (s.cur_clientsds != NULL)
+		{
+			int cursock = *((int*)(s.cur_clientsds->content));
+			if (isReady(cursock, &(s.rset), &wset))
+				break;
+			ListNextElement(s.clientsds, &s.cur_clientsds);
+		}
+	}
+
+	if (s.cur_clientsds == NULL)
+		rc = 0;
+	else
+	{
+		rc = *((int*)(s.cur_clientsds->content));
+		ListNextElement(s.clientsds, &s.cur_clientsds);
+	}
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+} /* end getReadySocket */
+
+
+/**
+ *  Reads one byte from a socket
+ *  @param socket the socket to read from
+ *  @param c the character read, returned
+ *  @return completion code
+ */
+int Socket_getch(int socket, char* c)
+{
+	int rc = SOCKET_ERROR;
+
+	FUNC_ENTRY;
+	if ((rc = SocketBuffer_getQueuedChar(socket, c)) != SOCKETBUFFER_INTERRUPTED)
+		goto exit;
+
+	if ((rc = recv(socket, c, (size_t)1, 0)) == SOCKET_ERROR)
+	{
+		int err = Socket_error("recv - getch", socket);
+		if (err == EWOULDBLOCK || err == EAGAIN)
+		{
+			rc = TCPSOCKET_INTERRUPTED;
+			SocketBuffer_interrupted(socket, 0);
+		}
+	}
+	else if (rc == 0)
+		rc = SOCKET_ERROR; 	/* The return value from recv is 0 when the peer has performed an orderly shutdown. */
+	else if (rc == 1)
+	{
+		SocketBuffer_queueChar(socket, *c);
+		rc = TCPSOCKET_COMPLETE;
+	}
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ *  Attempts to read a number of bytes from a socket, non-blocking. If a previous read did not
+ *  finish, then retrieve that data.
+ *  @param socket the socket to read from
+ *  @param bytes the number of bytes to read
+ *  @param actual_len the actual number of bytes read
+ *  @return completion code
+ */
+char *Socket_getdata(int socket, size_t bytes, size_t* actual_len)
+{
+	int rc;
+	char* buf;
+
+	FUNC_ENTRY;
+	if (bytes == 0)
+	{
+		buf = SocketBuffer_complete(socket);
+		goto exit;
+	}
+
+	buf = SocketBuffer_getQueuedData(socket, bytes, actual_len);
+
+	if ((rc = recv(socket, buf + (*actual_len), (int)(bytes - (*actual_len)), 0)) == SOCKET_ERROR)
+	{
+		rc = Socket_error("recv - getdata", socket);
+		if (rc != EAGAIN && rc != EWOULDBLOCK)
+		{
+			buf = NULL;
+			goto exit;
+		}
+	}
+	else if (rc == 0) /* rc 0 means the other end closed the socket, albeit "gracefully" */
+	{
+		buf = NULL;
+		goto exit;
+	}
+	else
+		*actual_len += rc;
+
+	if (*actual_len == bytes)
+		SocketBuffer_complete(socket);
+	else /* we didn't read the whole packet */
+	{
+		SocketBuffer_interrupted(socket, *actual_len);
+		Log(TRACE_MAX, -1, "%d bytes expected but %d bytes now received", bytes, *actual_len);
+	}
+exit:
+	FUNC_EXIT;
+	return buf;
+}
+
+
+/**
+ *  Indicate whether any data is pending outbound for a socket.
+ *  @return boolean - true == data pending.
+ */
+int Socket_noPendingWrites(int socket)
+{
+	int cursock = socket;
+	return ListFindItem(s.write_pending, &cursock, intcompare) == NULL;
+}
+
+
+/**
+ *  Attempts to write a series of iovec buffers to a socket in *one* system call so that
+ *  they are sent as one packet.
+ *  @param socket the socket to write to
+ *  @param iovecs an array of buffers to write
+ *  @param count number of buffers in iovecs
+ *  @param bytes number of bytes actually written returned
+ *  @return completion code, especially TCPSOCKET_INTERRUPTED
+ */
+int Socket_writev(int socket, iobuf* iovecs, int count, unsigned long* bytes)
+{
+	int rc;
+
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	rc = WSASend(socket, iovecs, count, (LPDWORD)bytes, 0, NULL, NULL);
+	if (rc == SOCKET_ERROR)
+	{
+		int err = Socket_error("WSASend - putdatas", socket);
+		if (err == EWOULDBLOCK || err == EAGAIN)
+			rc = TCPSOCKET_INTERRUPTED;
+	}
+#else
+	*bytes = 0L;
+	rc = writev(socket, iovecs, count);
+	if (rc == SOCKET_ERROR)
+	{
+		int err = Socket_error("writev - putdatas", socket);
+		if (err == EWOULDBLOCK || err == EAGAIN)
+			rc = TCPSOCKET_INTERRUPTED;
+	}
+	else
+		*bytes = rc;
+#endif
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ *  Attempts to write a series of buffers to a socket in *one* system call so that they are
+ *  sent as one packet.
+ *  @param socket the socket to write to
+ *  @param buf0 the first buffer
+ *  @param buf0len the length of data in the first buffer
+ *  @param count number of buffers
+ *  @param buffers an array of buffers to write
+ *  @param buflens an array of corresponding buffer lengths
+ *  @return completion code, especially TCPSOCKET_INTERRUPTED
+ */
+int Socket_putdatas(int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees)
+{
+	unsigned long bytes = 0L;
+	iobuf iovecs[5];
+	int frees1[5];
+	int rc = TCPSOCKET_INTERRUPTED, i;
+	size_t total = buf0len;
+
+	FUNC_ENTRY;
+	if (!Socket_noPendingWrites(socket))
+	{
+		Log(LOG_SEVERE, -1, "Trying to write to socket %d for which there is already pending output", socket);
+		rc = SOCKET_ERROR;
+		goto exit;
+	}
+
+	for (i = 0; i < count; i++)
+		total += buflens[i];
+
+	iovecs[0].iov_base = buf0;
+	iovecs[0].iov_len = (ULONG)buf0len;
+	frees1[0] = 1;
+	for (i = 0; i < count; i++)
+	{
+		iovecs[i+1].iov_base = buffers[i];
+		iovecs[i+1].iov_len = (ULONG)buflens[i];
+		frees1[i+1] = frees[i];
+	}
+
+	if ((rc = Socket_writev(socket, iovecs, count+1, &bytes)) != SOCKET_ERROR)
+	{
+		if (bytes == total)
+			rc = TCPSOCKET_COMPLETE;
+		else
+		{
+			int* sockmem = (int*)malloc(sizeof(int));
+			Log(TRACE_MIN, -1, "Partial write: %ld bytes of %d actually written on socket %d",
+					bytes, total, socket);
+#if defined(OPENSSL)
+			SocketBuffer_pendingWrite(socket, NULL, count+1, iovecs, frees1, total, bytes);
+#else
+			SocketBuffer_pendingWrite(socket, count+1, iovecs, frees1, total, bytes);
+#endif
+			*sockmem = socket;
+			ListAppend(s.write_pending, sockmem, sizeof(int));
+			FD_SET(socket, &(s.pending_wset));
+			rc = TCPSOCKET_INTERRUPTED;
+		}
+	}
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ *  Add a socket to the pending write list, so that it is checked for writing in select.  This is used
+ *  in connect processing when the TCP connect is incomplete, as we need to check the socket for both
+ *  ready to read and write states.
+ *  @param socket the socket to add
+ */
+void Socket_addPendingWrite(int socket)
+{
+	FD_SET(socket, &(s.pending_wset));
+}
+
+
+/**
+ *  Clear a socket from the pending write list - if one was added with Socket_addPendingWrite
+ *  @param socket the socket to remove
+ */
+void Socket_clearPendingWrite(int socket)
+{
+	if (FD_ISSET(socket, &(s.pending_wset)))
+		FD_CLR(socket, &(s.pending_wset));
+}
+
+
+/**
+ *  Close a socket without removing it from the select list.
+ *  @param socket the socket to close
+ *  @return completion code
+ */
+int Socket_close_only(int socket)
+{
+	int rc;
+
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	if (shutdown(socket, SD_BOTH) == SOCKET_ERROR)
+		Socket_error("shutdown", socket);
+	if ((rc = closesocket(socket)) == SOCKET_ERROR)
+		Socket_error("close", socket);
+#else
+	if (shutdown(socket, SHUT_WR) == SOCKET_ERROR)
+		Socket_error("shutdown", socket);
+	if ((rc = recv(socket, NULL, (size_t)0, 0)) == SOCKET_ERROR)
+		Socket_error("shutdown", socket);
+	if ((rc = close(socket)) == SOCKET_ERROR)
+		Socket_error("close", socket);
+#endif
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ *  Close a socket and remove it from the select list.
+ *  @param socket the socket to close
+ *  @return completion code
+ */
+void Socket_close(int socket)
+{
+	FUNC_ENTRY;
+	Socket_close_only(socket);
+	FD_CLR(socket, &(s.rset_saved));
+	if (FD_ISSET(socket, &(s.pending_wset)))
+		FD_CLR(socket, &(s.pending_wset));
+	if (s.cur_clientsds != NULL && *(int*)(s.cur_clientsds->content) == socket)
+		s.cur_clientsds = s.cur_clientsds->next;
+	ListRemoveItem(s.connect_pending, &socket, intcompare);
+	ListRemoveItem(s.write_pending, &socket, intcompare);
+	SocketBuffer_cleanup(socket);
+
+	if (ListRemoveItem(s.clientsds, &socket, intcompare))
+		Log(TRACE_MIN, -1, "Removed socket %d", socket);
+	else
+		Log(LOG_ERROR, -1, "Failed to remove socket %d", socket);
+	if (socket + 1 >= s.maxfdp1)
+	{
+		/* now we have to reset s.maxfdp1 */
+		ListElement* cur_clientsds = NULL;
+
+		s.maxfdp1 = 0;
+		while (ListNextElement(s.clientsds, &cur_clientsds))
+			s.maxfdp1 = max(*((int*)(cur_clientsds->content)), s.maxfdp1);
+		++(s.maxfdp1);
+		Log(TRACE_MAX, -1, "Reset max fdp1 to %d", s.maxfdp1);
+	}
+	FUNC_EXIT;
+}
+
+
+/**
+ *  Create a new socket and TCP connect to an address/port
+ *  @param addr the address string
+ *  @param port the TCP port
+ *  @param sock returns the new socket
+ *  @return completion code
+ */
+int Socket_new(char* addr, int port, int* sock)
+{
+	int type = SOCK_STREAM;
+	struct sockaddr_in address;
+#if defined(AF_INET6)
+	struct sockaddr_in6 address6;
+#endif
+	int rc = SOCKET_ERROR;
+#if defined(WIN32) || defined(WIN64)
+	short family;
+#else
+	sa_family_t family = AF_INET;
+#endif
+	struct addrinfo *result = NULL;
+	struct addrinfo hints = {0, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP, 0, NULL, NULL, NULL};
+
+	FUNC_ENTRY;
+	*sock = -1;
+	memset(&address6, '\0', sizeof(address6));
+
+	if (addr[0] == '[')
+	  ++addr;
+
+	if ((rc = getaddrinfo(addr, NULL, &hints, &result)) == 0)
+	{
+		struct addrinfo* res = result;
+
+		while (res)
+		{	/* prefer ip4 addresses */
+			if (res->ai_family == AF_INET || res->ai_next == NULL)
+				break;
+			res = res->ai_next;
+		}
+
+		if (res == NULL)
+			rc = -1;
+		else
+#if defined(AF_INET6)
+		if (res->ai_family == AF_INET6)
+		{
+			address6.sin6_port = htons(port);
+			address6.sin6_family = family = AF_INET6;
+			memcpy(&address6.sin6_addr, &((struct sockaddr_in6*)(res->ai_addr))->sin6_addr, sizeof(address6.sin6_addr));
+		}
+		else
+#endif
+		if (res->ai_family == AF_INET)
+		{
+			address.sin_port = htons(port);
+			address.sin_family = family = AF_INET;
+			address.sin_addr = ((struct sockaddr_in*)(res->ai_addr))->sin_addr;
+		}
+		else
+			rc = -1;
+
+		freeaddrinfo(result);
+	}
+	else
+	  	Log(LOG_ERROR, -1, "getaddrinfo failed for addr %s with rc %d", addr, rc);
+
+	if (rc != 0)
+		Log(LOG_ERROR, -1, "%s is not a valid IP address", addr);
+	else
+	{
+		*sock =	(int)socket(family, type, 0);
+		if (*sock == INVALID_SOCKET)
+			rc = Socket_error("socket", *sock);
+		else
+		{
+#if defined(NOSIGPIPE)
+			int opt = 1;
+
+			if (setsockopt(*sock, SOL_SOCKET, SO_NOSIGPIPE, (void*)&opt, sizeof(opt)) != 0)
+				Log(LOG_ERROR, -1, "Could not set SO_NOSIGPIPE for socket %d", *sock);
+#endif
+
+			Log(TRACE_MIN, -1, "New socket %d for %s, port %d",	*sock, addr, port);
+			if (Socket_addSocket(*sock) == SOCKET_ERROR)
+				rc = Socket_error("addSocket", *sock);
+			else
+			{
+				/* this could complete immmediately, even though we are non-blocking */
+				if (family == AF_INET)
+					rc = connect(*sock, (struct sockaddr*)&address, sizeof(address));
+	#if defined(AF_INET6)
+				else
+					rc = connect(*sock, (struct sockaddr*)&address6, sizeof(address6));
+	#endif
+				if (rc == SOCKET_ERROR)
+					rc = Socket_error("connect", *sock);
+				if (rc == EINPROGRESS || rc == EWOULDBLOCK)
+				{
+					int* pnewSd = (int*)malloc(sizeof(int));
+					*pnewSd = *sock;
+					ListAppend(s.connect_pending, pnewSd, sizeof(int));
+					Log(TRACE_MIN, 15, "Connect pending");
+				}
+			}
+                        /* Prevent socket leak by closing unusable sockets,
+                         * as reported in
+                         * https://github.com/eclipse/paho.mqtt.c/issues/135
+                         */
+                        if (rc != 0 && (rc != EINPROGRESS) && (rc != EWOULDBLOCK))
+                        {
+                            Socket_close(*sock); /* close socket and remove from our list of sockets */
+                            *sock = -1; /* as initialized before */
+                        }
+		}
+	}
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static Socket_writeComplete* writecomplete = NULL;
+
+void Socket_setWriteCompleteCallback(Socket_writeComplete* mywritecomplete)
+{
+	writecomplete = mywritecomplete;
+}
+
+/**
+ *  Continue an outstanding write for a particular socket
+ *  @param socket that socket
+ *  @return completion code
+ */
+int Socket_continueWrite(int socket)
+{
+	int rc = 0;
+	pending_writes* pw;
+	unsigned long curbuflen = 0L, /* cumulative total of buffer lengths */
+		bytes;
+	int curbuf = -1, i;
+	iobuf iovecs1[5];
+
+	FUNC_ENTRY;
+	pw = SocketBuffer_getWrite(socket);
+
+#if defined(OPENSSL)
+	if (pw->ssl)
+	{
+		rc = SSLSocket_continueWrite(pw);
+		goto exit;
+	}
+#endif
+
+	for (i = 0; i < pw->count; ++i)
+	{
+		if (pw->bytes <= curbuflen)
+		{ /* if previously written length is less than the buffer we are currently looking at,
+				add the whole buffer */
+			iovecs1[++curbuf].iov_len = pw->iovecs[i].iov_len;
+			iovecs1[curbuf].iov_base = pw->iovecs[i].iov_base;
+		}
+		else if (pw->bytes < curbuflen + pw->iovecs[i].iov_len)
+		{ /* if previously written length is in the middle of the buffer we are currently looking at,
+				add some of the buffer */
+			size_t offset = pw->bytes - curbuflen;
+			iovecs1[++curbuf].iov_len = pw->iovecs[i].iov_len - (ULONG)offset;
+			iovecs1[curbuf].iov_base = (char*)pw->iovecs[i].iov_base + offset;
+			break;
+		}
+		curbuflen += pw->iovecs[i].iov_len;
+	}
+
+	if ((rc = Socket_writev(socket, iovecs1, curbuf+1, &bytes)) != SOCKET_ERROR)
+	{
+		pw->bytes += bytes;
+		if ((rc = (pw->bytes == pw->total)))
+		{  /* topic and payload buffers are freed elsewhere, when all references to them have been removed */
+			for (i = 0; i < pw->count; i++)
+			{
+				if (pw->frees[i])
+					free(pw->iovecs[i].iov_base);
+			}
+			Log(TRACE_MIN, -1, "ContinueWrite: partial write now complete for socket %d", socket);
+		}
+		else
+			Log(TRACE_MIN, -1, "ContinueWrite wrote +%lu bytes on socket %d", bytes, socket);
+	}
+#if defined(OPENSSL)
+exit:
+#endif
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ *  Continue any outstanding writes for a socket set
+ *  @param pwset the set of sockets
+ *  @return completion code
+ */
+int Socket_continueWrites(fd_set* pwset)
+{
+	int rc1 = 0;
+	ListElement* curpending = s.write_pending->first;
+
+	FUNC_ENTRY;
+	while (curpending)
+	{
+		int socket = *(int*)(curpending->content);
+		if (FD_ISSET(socket, pwset) && Socket_continueWrite(socket))
+		{
+			if (!SocketBuffer_writeComplete(socket))
+				Log(LOG_SEVERE, -1, "Failed to remove pending write from socket buffer list");
+			FD_CLR(socket, &(s.pending_wset));
+			if (!ListRemove(s.write_pending, curpending->content))
+			{
+				Log(LOG_SEVERE, -1, "Failed to remove pending write from list");
+				ListNextElement(s.write_pending, &curpending);
+			}
+			curpending = s.write_pending->current;
+
+			if (writecomplete)
+				(*writecomplete)(socket);
+		}
+		else
+			ListNextElement(s.write_pending, &curpending);
+	}
+	FUNC_EXIT_RC(rc1);
+	return rc1;
+}
+
+
+/**
+ *  Convert a numeric address to character string
+ *  @param sa	socket numerical address
+ *  @param sock socket
+ *  @return the peer information
+ */
+char* Socket_getaddrname(struct sockaddr* sa, int sock)
+{
+/**
+ * maximum length of the address string
+ */
+#define ADDRLEN INET6_ADDRSTRLEN+1
+/**
+ * maximum length of the port string
+ */
+#define PORTLEN 10
+	static char addr_string[ADDRLEN + PORTLEN];
+
+#if defined(WIN32) || defined(WIN64)
+	int buflen = ADDRLEN*2;
+	wchar_t buf[ADDRLEN*2];
+	if (WSAAddressToStringW(sa, sizeof(struct sockaddr_in6), NULL, buf, (LPDWORD)&buflen) == SOCKET_ERROR)
+		Socket_error("WSAAddressToString", sock);
+	else
+		wcstombs(addr_string, buf, sizeof(addr_string));
+	/* TODO: append the port information - format: [00:00:00::]:port */
+	/* strcpy(&addr_string[strlen(addr_string)], "what?"); */
+#else
+	struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+	inet_ntop(sin->sin_family, &sin->sin_addr, addr_string, ADDRLEN);
+	sprintf(&addr_string[strlen(addr_string)], ":%d", ntohs(sin->sin_port));
+#endif
+	return addr_string;
+}
+
+
+/**
+ *  Get information about the other end connected to a socket
+ *  @param sock the socket to inquire on
+ *  @return the peer information
+ */
+char* Socket_getpeer(int sock)
+{
+	struct sockaddr_in6 sa;
+	socklen_t sal = sizeof(sa);
+	int rc;
+
+	if ((rc = getpeername(sock, (struct sockaddr*)&sa, &sal)) == SOCKET_ERROR)
+	{
+		Socket_error("getpeername", sock);
+		return "unknown";
+	}
+
+	return Socket_getaddrname((struct sockaddr*)&sa, sock);
+}
+
+
+#if defined(Socket_TEST)
+
+int main(int argc, char *argv[])
+{
+	Socket_connect("127.0.0.1", 1883);
+	Socket_connect("localhost", 1883);
+	Socket_connect("loadsadsacalhost", 1883);
+}
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Socket.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Socket.h b/thirdparty/paho.mqtt.c/src/Socket.h
new file mode 100644
index 0000000..dbf21b4
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Socket.h
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial implementation and documentation
+ *    Ian Craggs - async client updates
+ *******************************************************************************/
+
+#if !defined(SOCKET_H)
+#define SOCKET_H
+
+#include <sys/types.h>
+
+#if defined(WIN32) || defined(WIN64)
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#define MAXHOSTNAMELEN 256
+#if !defined(SSLSOCKET_H)
+#undef EAGAIN
+#define EAGAIN WSAEWOULDBLOCK
+#undef EINTR
+#define EINTR WSAEINTR
+#undef EINPROGRESS
+#define EINPROGRESS WSAEINPROGRESS
+#undef EWOULDBLOCK
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#undef ENOTCONN
+#define ENOTCONN WSAENOTCONN
+#undef ECONNRESET
+#define ECONNRESET WSAECONNRESET
+#undef ETIMEDOUT
+#define ETIMEDOUT WAIT_TIMEOUT
+#endif
+#define ioctl ioctlsocket
+#define socklen_t int
+#else
+#define INVALID_SOCKET SOCKET_ERROR
+#include <sys/socket.h>
+#if !defined(_WRS_KERNEL)
+#include <sys/param.h>
+#include <sys/time.h>
+#include <sys/select.h>
+#include <sys/uio.h>
+#else
+#include <selectLib.h>
+#endif
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#define ULONG size_t
+#endif
+
+/** socket operation completed successfully */
+#define TCPSOCKET_COMPLETE 0
+#if !defined(SOCKET_ERROR)
+	/** error in socket operation */
+	#define SOCKET_ERROR -1
+#endif
+/** must be the same as SOCKETBUFFER_INTERRUPTED */
+#define TCPSOCKET_INTERRUPTED -22
+#define SSL_FATAL -3
+
+#if !defined(INET6_ADDRSTRLEN)
+#define INET6_ADDRSTRLEN 46 /** only needed for gcc/cygwin on windows */
+#endif
+
+
+#if !defined(max)
+#define max(A,B) ( (A) > (B) ? (A):(B))
+#endif
+
+#include "LinkedList.h"
+
+/*BE
+def FD_SET
+{
+   128 n8 "data"
+}
+
+def SOCKETS
+{
+	FD_SET "rset"
+	FD_SET "rset_saved"
+	n32 dec "maxfdp1"
+	n32 ptr INTList "clientsds"
+	n32 ptr INTItem "cur_clientsds"
+	n32 ptr INTList "connect_pending"
+	n32 ptr INTList "write_pending"
+	FD_SET "pending_wset"
+}
+BE*/
+
+
+/**
+ * Structure to hold all socket data for the module
+ */
+typedef struct
+{
+	fd_set rset, /**< socket read set (see select doc) */
+		rset_saved; /**< saved socket read set */
+	int maxfdp1; /**< max descriptor used +1 (again see select doc) */
+	List* clientsds; /**< list of client socket descriptors */
+	ListElement* cur_clientsds; /**< current client socket descriptor (iterator) */
+	List* connect_pending; /**< list of sockets for which a connect is pending */
+	List* write_pending; /**< list of sockets for which a write is pending */
+	fd_set pending_wset; /**< socket pending write set for select */
+} Sockets;
+
+
+void Socket_outInitialize(void);
+void Socket_outTerminate(void);
+int Socket_getReadySocket(int more_work, struct timeval *tp);
+int Socket_getch(int socket, char* c);
+char *Socket_getdata(int socket, size_t bytes, size_t* actual_len);
+int Socket_putdatas(int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees);
+void Socket_close(int socket);
+int Socket_new(char* addr, int port, int* socket);
+
+int Socket_noPendingWrites(int socket);
+char* Socket_getpeer(int sock);
+
+void Socket_addPendingWrite(int socket);
+void Socket_clearPendingWrite(int socket);
+
+typedef void Socket_writeComplete(int socket);
+void Socket_setWriteCompleteCallback(Socket_writeComplete*);
+
+#endif /* SOCKET_H */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/SocketBuffer.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/SocketBuffer.c b/thirdparty/paho.mqtt.c/src/SocketBuffer.c
new file mode 100644
index 0000000..ba640f1
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/SocketBuffer.c
@@ -0,0 +1,413 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - fix for issue #244, issue #20
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Socket buffering related functions
+ *
+ * Some other related functions are in the Socket module
+ */
+#include "SocketBuffer.h"
+#include "LinkedList.h"
+#include "Log.h"
+#include "Messages.h"
+#include "StackTrace.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "Heap.h"
+
+#if defined(WIN32) || defined(WIN64)
+#define iov_len len
+#define iov_base buf
+#endif
+
+/**
+ * Default input queue buffer
+ */
+static socket_queue* def_queue;
+
+/**
+ * List of queued input buffers
+ */
+static List* queues;
+
+/**
+ * List of queued write buffers
+ */
+static List writes;
+
+
+int socketcompare(void* a, void* b);
+void SocketBuffer_newDefQ(void);
+void SocketBuffer_freeDefQ(void);
+int pending_socketcompare(void* a, void* b);
+
+
+/**
+ * List callback function for comparing socket_queues by socket
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+int socketcompare(void* a, void* b)
+{
+	return ((socket_queue*)a)->socket == *(int*)b;
+}
+
+
+/**
+ * Create a new default queue when one has just been used.
+ */
+void SocketBuffer_newDefQ(void)
+{
+	def_queue = malloc(sizeof(socket_queue));
+	def_queue->buflen = 1000;
+	def_queue->buf = malloc(def_queue->buflen);
+	def_queue->socket = def_queue->index = 0;
+	def_queue->buflen = def_queue->datalen = 0;
+}
+
+
+/**
+ * Initialize the socketBuffer module
+ */
+void SocketBuffer_initialize(void)
+{
+	FUNC_ENTRY;
+	SocketBuffer_newDefQ();
+	queues = ListInitialize();
+	ListZero(&writes);
+	FUNC_EXIT;
+}
+
+
+/**
+ * Free the default queue memory
+ */
+void SocketBuffer_freeDefQ(void)
+{
+	free(def_queue->buf);
+	free(def_queue);
+}
+
+
+/**
+ * Terminate the socketBuffer module
+ */
+void SocketBuffer_terminate(void)
+{
+	ListElement* cur = NULL;
+	ListEmpty(&writes);
+
+	FUNC_ENTRY;
+	while (ListNextElement(queues, &cur))
+		free(((socket_queue*)(cur->content))->buf);
+	ListFree(queues);
+	SocketBuffer_freeDefQ();
+	FUNC_EXIT;
+}
+
+
+/**
+ * Cleanup any buffers for a specific socket
+ * @param socket the socket to clean up
+ */
+void SocketBuffer_cleanup(int socket)
+{
+	FUNC_ENTRY;
+	SocketBuffer_writeComplete(socket); /* clean up write buffers */
+	if (ListFindItem(queues, &socket, socketcompare))
+	{
+		free(((socket_queue*)(queues->current->content))->buf);
+		ListRemove(queues, queues->current->content);
+	}
+	if (def_queue->socket == socket)
+	{
+		def_queue->socket = def_queue->index = 0;
+		def_queue->headerlen = def_queue->datalen = 0;
+	}
+	FUNC_EXIT;
+}
+
+
+/**
+ * Get any queued data for a specific socket
+ * @param socket the socket to get queued data for
+ * @param bytes the number of bytes of data to retrieve
+ * @param actual_len the actual length returned
+ * @return the actual data
+ */
+char* SocketBuffer_getQueuedData(int socket, size_t bytes, size_t* actual_len)
+{
+	socket_queue* queue = NULL;
+
+	FUNC_ENTRY;
+	if (ListFindItem(queues, &socket, socketcompare))
+	{  /* if there is queued data for this socket, add any data read to it */
+		queue = (socket_queue*)(queues->current->content);
+		*actual_len = queue->datalen;
+	}
+	else
+	{
+		*actual_len = 0;
+		queue = def_queue;
+	}
+	if (bytes > queue->buflen)
+	{
+		if (queue->datalen > 0)
+		{
+			void* newmem = malloc(bytes);
+			memcpy(newmem, queue->buf, queue->datalen);
+			free(queue->buf);
+			queue->buf = newmem;
+		}
+		else
+			queue->buf = realloc(queue->buf, bytes);
+		queue->buflen = bytes;
+	}
+
+	FUNC_EXIT;
+	return queue->buf;
+}
+
+
+/**
+ * Get any queued character for a specific socket
+ * @param socket the socket to get queued data for
+ * @param c the character returned if any
+ * @return completion code
+ */
+int SocketBuffer_getQueuedChar(int socket, char* c)
+{
+	int rc = SOCKETBUFFER_INTERRUPTED;
+
+	FUNC_ENTRY;
+	if (ListFindItem(queues, &socket, socketcompare))
+	{  /* if there is queued data for this socket, read that first */
+		socket_queue* queue = (socket_queue*)(queues->current->content);
+		if (queue->index < queue->headerlen)
+		{
+			*c = queue->fixed_header[(queue->index)++];
+			Log(TRACE_MAX, -1, "index is now %d, headerlen %d", queue->index, queue->headerlen);
+			rc = SOCKETBUFFER_COMPLETE;
+			goto exit;
+		}
+		else if (queue->index > 4)
+		{
+			Log(LOG_FATAL, -1, "header is already at full length");
+			rc = SOCKET_ERROR;
+			goto exit;
+		}
+	}
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;  /* there was no queued char if rc is SOCKETBUFFER_INTERRUPTED*/
+}
+
+
+/**
+ * A socket read was interrupted so we need to queue data
+ * @param socket the socket to get queued data for
+ * @param actual_len the actual length of data that was read
+ */
+void SocketBuffer_interrupted(int socket, size_t actual_len)
+{
+	socket_queue* queue = NULL;
+
+	FUNC_ENTRY;
+	if (ListFindItem(queues, &socket, socketcompare))
+		queue = (socket_queue*)(queues->current->content);
+	else /* new saved queue */
+	{
+		queue = def_queue;
+		/* if SocketBuffer_queueChar() has not yet been called, then the socket number
+		  in def_queue will not have been set.  Issue #244.
+		  If actual_len == 0 then we may not need to do anything - I'll leave that
+		  optimization for another time. */
+		queue->socket = socket;
+		ListAppend(queues, def_queue, sizeof(socket_queue)+def_queue->buflen);
+		SocketBuffer_newDefQ();
+	}
+	queue->index = 0;
+	queue->datalen = actual_len;
+	FUNC_EXIT;
+}
+
+
+/**
+ * A socket read has now completed so we can get rid of the queue
+ * @param socket the socket for which the operation is now complete
+ * @return pointer to the default queue data
+ */
+char* SocketBuffer_complete(int socket)
+{
+	FUNC_ENTRY;
+	if (ListFindItem(queues, &socket, socketcompare))
+	{
+		socket_queue* queue = (socket_queue*)(queues->current->content);
+		SocketBuffer_freeDefQ();
+		def_queue = queue;
+		ListDetach(queues, queue);
+	}
+	def_queue->socket = def_queue->index = 0;
+	def_queue->headerlen = def_queue->datalen = 0;
+	FUNC_EXIT;
+	return def_queue->buf;
+}
+
+
+/**
+ * A socket operation had now completed so we can get rid of the queue
+ * @param socket the socket for which the operation is now complete
+ * @param c the character to queue
+ */
+void SocketBuffer_queueChar(int socket, char c)
+{
+	int error = 0;
+	socket_queue* curq = def_queue;
+
+	FUNC_ENTRY;
+	if (ListFindItem(queues, &socket, socketcompare))
+		curq = (socket_queue*)(queues->current->content);
+	else if (def_queue->socket == 0)
+	{
+		def_queue->socket = socket;
+		def_queue->index = 0;
+		def_queue->datalen = 0;
+	}
+	else if (def_queue->socket != socket)
+	{
+		Log(LOG_FATAL, -1, "attempt to reuse socket queue");
+		error = 1;
+	}
+	if (curq->index > 4)
+	{
+		Log(LOG_FATAL, -1, "socket queue fixed_header field full");
+		error = 1;
+	}
+	if (!error)
+	{
+		curq->fixed_header[(curq->index)++] = c;
+		curq->headerlen = curq->index;
+	}
+	Log(TRACE_MAX, -1, "queueChar: index is now %d, headerlen %d", curq->index, curq->headerlen);
+	FUNC_EXIT;
+}
+
+
+/**
+ * A socket write was interrupted so store the remaining data
+ * @param socket the socket for which the write was interrupted
+ * @param count the number of iovec buffers
+ * @param iovecs buffer array
+ * @param total total data length to be written
+ * @param bytes actual data length that was written
+ */
+#if defined(OPENSSL)
+void SocketBuffer_pendingWrite(int socket, SSL* ssl, int count, iobuf* iovecs, int* frees, size_t total, size_t bytes)
+#else
+void SocketBuffer_pendingWrite(int socket, int count, iobuf* iovecs, int* frees, size_t total, size_t bytes)
+#endif
+{
+	int i = 0;
+	pending_writes* pw = NULL;
+
+	FUNC_ENTRY;
+	/* store the buffers until the whole packet is written */
+	pw = malloc(sizeof(pending_writes));
+	pw->socket = socket;
+#if defined(OPENSSL)
+	pw->ssl = ssl;
+#endif
+	pw->bytes = bytes;
+	pw->total = total;
+	pw->count = count;
+	for (i = 0; i < count; i++)
+	{
+		pw->iovecs[i] = iovecs[i];
+		pw->frees[i] = frees[i];
+	}
+	ListAppend(&writes, pw, sizeof(pw) + total);
+	FUNC_EXIT;
+}
+
+
+/**
+ * List callback function for comparing pending_writes by socket
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+int pending_socketcompare(void* a, void* b)
+{
+	return ((pending_writes*)a)->socket == *(int*)b;
+}
+
+
+/**
+ * Get any queued write data for a specific socket
+ * @param socket the socket to get queued data for
+ * @return pointer to the queued data or NULL
+ */
+pending_writes* SocketBuffer_getWrite(int socket)
+{
+	ListElement* le = ListFindItem(&writes, &socket, pending_socketcompare);
+	return (le) ? (pending_writes*)(le->content) : NULL;
+}
+
+
+/**
+ * A socket write has now completed so we can get rid of the queue
+ * @param socket the socket for which the operation is now complete
+ * @return completion code, boolean - was the queue removed?
+ */
+int SocketBuffer_writeComplete(int socket)
+{
+	return ListRemoveItem(&writes, &socket, pending_socketcompare);
+}
+
+
+/**
+ * Update the queued write data for a socket in the case of QoS 0 messages.
+ * @param socket the socket for which the operation is now complete
+ * @param topic the topic of the QoS 0 write
+ * @param payload the payload of the QoS 0 write
+ * @return pointer to the updated queued data structure, or NULL
+ */
+pending_writes* SocketBuffer_updateWrite(int socket, char* topic, char* payload)
+{
+	pending_writes* pw = NULL;
+	ListElement* le = NULL;
+
+	FUNC_ENTRY;
+	if ((le = ListFindItem(&writes, &socket, pending_socketcompare)) != NULL)
+	{
+		pw = (pending_writes*)(le->content);
+		if (pw->count == 4)
+		{
+			pw->iovecs[2].iov_base = topic;
+			pw->iovecs[3].iov_base = payload;
+		}
+	}
+
+	FUNC_EXIT;
+	return pw;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/SocketBuffer.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/SocketBuffer.h b/thirdparty/paho.mqtt.c/src/SocketBuffer.h
new file mode 100644
index 0000000..f7702dc
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/SocketBuffer.h
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *******************************************************************************/
+
+#if !defined(SOCKETBUFFER_H)
+#define SOCKETBUFFER_H
+
+#if defined(WIN32) || defined(WIN64)
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#endif
+
+#if defined(OPENSSL)
+#include <openssl/ssl.h>
+#endif
+
+#if defined(WIN32) || defined(WIN64)
+	typedef WSABUF iobuf;
+#else
+	typedef struct iovec iobuf;
+#endif
+
+typedef struct
+{
+	int socket;
+	unsigned int index;
+	size_t headerlen;
+	char fixed_header[5];	/**< header plus up to 4 length bytes */
+	size_t buflen, 			/**< total length of the buffer */
+		datalen; 			/**< current length of data in buf */
+	char* buf;
+} socket_queue;
+
+typedef struct
+{
+	int socket, count;
+	size_t total;
+#if defined(OPENSSL)
+	SSL* ssl;
+#endif
+	size_t bytes;
+	iobuf iovecs[5];
+	int frees[5];
+} pending_writes;
+
+#define SOCKETBUFFER_COMPLETE 0
+#if !defined(SOCKET_ERROR)
+	#define SOCKET_ERROR -1
+#endif
+#define SOCKETBUFFER_INTERRUPTED -22 /* must be the same value as TCPSOCKET_INTERRUPTED */
+
+void SocketBuffer_initialize(void);
+void SocketBuffer_terminate(void);
+void SocketBuffer_cleanup(int socket);
+char* SocketBuffer_getQueuedData(int socket, size_t bytes, size_t* actual_len);
+int SocketBuffer_getQueuedChar(int socket, char* c);
+void SocketBuffer_interrupted(int socket, size_t actual_len);
+char* SocketBuffer_complete(int socket);
+void SocketBuffer_queueChar(int socket, char c);
+
+#if defined(OPENSSL)
+void SocketBuffer_pendingWrite(int socket, SSL* ssl, int count, iobuf* iovecs, int* frees, size_t total, size_t bytes);
+#else
+void SocketBuffer_pendingWrite(int socket, int count, iobuf* iovecs, int* frees, size_t total, size_t bytes);
+#endif
+pending_writes* SocketBuffer_getWrite(int socket);
+int SocketBuffer_writeComplete(int socket);
+pending_writes* SocketBuffer_updateWrite(int socket, char* topic, char* payload);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/StackTrace.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/StackTrace.c b/thirdparty/paho.mqtt.c/src/StackTrace.c
new file mode 100644
index 0000000..dd55f71
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/StackTrace.c
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+#include "StackTrace.h"
+#include "Log.h"
+#include "LinkedList.h"
+
+#include "Clients.h"
+#include "Thread.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#if defined(WIN32) || defined(WIN64)
+#define snprintf _snprintf
+#endif
+
+/*BE
+def STACKENTRY
+{
+	n32 ptr STRING open "name"
+	n32 dec "line"
+}
+
+defList(STACKENTRY)
+BE*/
+
+#define MAX_STACK_DEPTH 50
+#define MAX_FUNCTION_NAME_LENGTH 30
+#define MAX_THREADS 255
+
+typedef struct
+{
+	thread_id_type threadid;
+	char name[MAX_FUNCTION_NAME_LENGTH];
+	int line;
+} stackEntry;
+
+typedef struct
+{
+	thread_id_type id;
+	int maxdepth;
+	int current_depth;
+	stackEntry callstack[MAX_STACK_DEPTH];
+} threadEntry;
+
+#include "StackTrace.h"
+
+static int thread_count = 0;
+static threadEntry threads[MAX_THREADS];
+static threadEntry *cur_thread = NULL;
+
+#if defined(WIN32) || defined(WIN64)
+mutex_type stack_mutex;
+#else
+static pthread_mutex_t stack_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type stack_mutex = &stack_mutex_store;
+#endif
+
+
+int setStack(int create);
+
+
+int setStack(int create)
+{
+	int i = -1;
+	thread_id_type curid = Thread_getid();
+
+	cur_thread = NULL;
+	for (i = 0; i < MAX_THREADS && i < thread_count; ++i)
+	{
+		if (threads[i].id == curid)
+		{
+			cur_thread = &threads[i];
+			break;
+		}
+	}
+
+	if (cur_thread == NULL && create && thread_count < MAX_THREADS)
+	{
+		cur_thread = &threads[thread_count];
+		cur_thread->id = curid;
+		cur_thread->maxdepth = 0;
+		cur_thread->current_depth = 0;
+		++thread_count;
+	}
+	return cur_thread != NULL; /* good == 1 */
+}
+
+void StackTrace_entry(const char* name, int line, enum LOG_LEVELS trace_level)
+{
+	Thread_lock_mutex(stack_mutex);
+	if (!setStack(1))
+		goto exit;
+	if (trace_level != -1)
+		Log_stackTrace(trace_level, 9, (int)cur_thread->id, cur_thread->current_depth, name, line, NULL);
+	strncpy(cur_thread->callstack[cur_thread->current_depth].name, name, sizeof(cur_thread->callstack[0].name)-1);
+	cur_thread->callstack[(cur_thread->current_depth)++].line = line;
+	if (cur_thread->current_depth > cur_thread->maxdepth)
+		cur_thread->maxdepth = cur_thread->current_depth;
+	if (cur_thread->current_depth >= MAX_STACK_DEPTH)
+		Log(LOG_FATAL, -1, "Max stack depth exceeded");
+exit:
+	Thread_unlock_mutex(stack_mutex);
+}
+
+
+void StackTrace_exit(const char* name, int line, void* rc, enum LOG_LEVELS trace_level)
+{
+	Thread_lock_mutex(stack_mutex);
+	if (!setStack(0))
+		goto exit;
+	if (--(cur_thread->current_depth) < 0)
+		Log(LOG_FATAL, -1, "Minimum stack depth exceeded for thread %lu", cur_thread->id);
+	if (strncmp(cur_thread->callstack[cur_thread->current_depth].name, name, sizeof(cur_thread->callstack[0].name)-1) != 0)
+		Log(LOG_FATAL, -1, "Stack mismatch. Entry:%s Exit:%s\n", cur_thread->callstack[cur_thread->current_depth].name, name);
+	if (trace_level != -1)
+	{
+		if (rc == NULL)
+			Log_stackTrace(trace_level, 10, (int)cur_thread->id, cur_thread->current_depth, name, line, NULL);
+		else
+			Log_stackTrace(trace_level, 11, (int)cur_thread->id, cur_thread->current_depth, name, line, (int*)rc);
+	}
+exit:
+	Thread_unlock_mutex(stack_mutex);
+}
+
+
+void StackTrace_printStack(FILE* dest)
+{
+	FILE* file = stdout;
+	int t = 0;
+
+	if (dest)
+		file = dest;
+	for (t = 0; t < thread_count; ++t)
+	{
+		threadEntry *cur_thread = &threads[t];
+
+		if (cur_thread->id > 0)
+		{
+			int i = cur_thread->current_depth - 1;
+
+			fprintf(file, "=========== Start of stack trace for thread %lu ==========\n", (unsigned long)cur_thread->id);
+			if (i >= 0)
+			{
+				fprintf(file, "%s (%d)\n", cur_thread->callstack[i].name, cur_thread->callstack[i].line);
+				while (--i >= 0)
+					fprintf(file, "   at %s (%d)\n", cur_thread->callstack[i].name, cur_thread->callstack[i].line);
+			}
+			fprintf(file, "=========== End of stack trace for thread %lu ==========\n\n", (unsigned long)cur_thread->id);
+		}
+	}
+	if (file != stdout && file != stderr && file != NULL)
+		fclose(file);
+}
+
+
+char* StackTrace_get(thread_id_type threadid)
+{
+	int bufsize = 256;
+	char* buf = NULL;
+	int t = 0;
+
+	if ((buf = malloc(bufsize)) == NULL)
+		goto exit;
+	buf[0] = '\0';
+	for (t = 0; t < thread_count; ++t)
+	{
+		threadEntry *cur_thread = &threads[t];
+
+		if (cur_thread->id == threadid)
+		{
+			int i = cur_thread->current_depth - 1;
+			int curpos = 0;
+
+			if (i >= 0)
+			{
+				curpos += snprintf(&buf[curpos], bufsize - curpos -1,
+						"%s (%d)\n", cur_thread->callstack[i].name, cur_thread->callstack[i].line);
+				while (--i >= 0)
+					curpos += snprintf(&buf[curpos], bufsize - curpos -1,
+							"   at %s (%d)\n", cur_thread->callstack[i].name, cur_thread->callstack[i].line);
+				if (buf[--curpos] == '\n')
+					buf[curpos] = '\0';
+			}
+			break;
+		}
+	}
+exit:
+	return buf;
+}
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/StackTrace.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/StackTrace.h b/thirdparty/paho.mqtt.c/src/StackTrace.h
new file mode 100644
index 0000000..f4ebba2
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/StackTrace.h
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+#ifndef STACKTRACE_H_
+#define STACKTRACE_H_
+
+#include <stdio.h>
+#include "Log.h"
+#include "Thread.h"
+
+#if defined(NOSTACKTRACE)
+#define FUNC_ENTRY
+#define FUNC_ENTRY_NOLOG
+#define FUNC_ENTRY_MED
+#define FUNC_ENTRY_MAX
+#define FUNC_EXIT
+#define FUNC_EXIT_NOLOG
+#define FUNC_EXIT_MED
+#define FUNC_EXIT_MAX
+#define FUNC_EXIT_RC(x)
+#define FUNC_EXIT_MED_RC(x)
+#define FUNC_EXIT_MAX_RC(x)
+#else
+#if defined(WIN32) || defined(WIN64)
+#define inline __inline
+#define FUNC_ENTRY StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MINIMUM)
+#define FUNC_ENTRY_NOLOG StackTrace_entry(__FUNCTION__, __LINE__, -1)
+#define FUNC_ENTRY_MED StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MEDIUM)
+#define FUNC_ENTRY_MAX StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MAXIMUM)
+#define FUNC_EXIT StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MINIMUM)
+#define FUNC_EXIT_NOLOG StackTrace_exit(__FUNCTION__, __LINE__, -1)
+#define FUNC_EXIT_MED StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MEDIUM)
+#define FUNC_EXIT_MAX StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MAXIMUM)
+#define FUNC_EXIT_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MINIMUM)
+#define FUNC_EXIT_MED_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MEDIUM)
+#define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MAXIMUM)
+#else
+#define FUNC_ENTRY StackTrace_entry(__func__, __LINE__, TRACE_MINIMUM)
+#define FUNC_ENTRY_NOLOG StackTrace_entry(__func__, __LINE__, -1)
+#define FUNC_ENTRY_MED StackTrace_entry(__func__, __LINE__, TRACE_MEDIUM)
+#define FUNC_ENTRY_MAX StackTrace_entry(__func__, __LINE__, TRACE_MAXIMUM)
+#define FUNC_EXIT StackTrace_exit(__func__, __LINE__, NULL, TRACE_MINIMUM)
+#define FUNC_EXIT_NOLOG StackTrace_exit(__func__, __LINE__, NULL, -1)
+#define FUNC_EXIT_MED StackTrace_exit(__func__, __LINE__, NULL, TRACE_MEDIUM)
+#define FUNC_EXIT_MAX StackTrace_exit(__func__, __LINE__, NULL, TRACE_MAXIMUM)
+#define FUNC_EXIT_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MINIMUM)
+#define FUNC_EXIT_MED_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MEDIUM)
+#define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MAXIMUM)
+#endif
+#endif
+
+void StackTrace_entry(const char* name, int line, enum LOG_LEVELS trace);
+void StackTrace_exit(const char* name, int line, void* return_value, enum LOG_LEVELS trace);
+
+void StackTrace_printStack(FILE* dest);
+char* StackTrace_get(thread_id_type);
+
+#endif /* STACKTRACE_H_ */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Thread.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Thread.c b/thirdparty/paho.mqtt.c/src/Thread.c
new file mode 100644
index 0000000..37aaa58
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Thread.c
@@ -0,0 +1,462 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial implementation
+ *    Ian Craggs, Allan Stockdill-Mander - async client updates
+ *    Ian Craggs - bug #415042 - start Linux thread as disconnected
+ *    Ian Craggs - fix for bug #420851
+ *    Ian Craggs - change MacOS semaphore implementation
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Threading related functions
+ *
+ * Used to create platform independent threading functions
+ */
+
+
+#include "Thread.h"
+#if defined(THREAD_UNIT_TESTS)
+#define NOSTACKTRACE
+#endif
+#include "StackTrace.h"
+
+#undef malloc
+#undef realloc
+#undef free
+
+#if !defined(WIN32) && !defined(WIN64)
+#include <errno.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <limits.h>
+#endif
+#include <stdlib.h>
+
+#include "OsWrapper.h"
+
+/**
+ * Start a new thread
+ * @param fn the function to run, must be of the correct signature
+ * @param parameter pointer to the function parameter, can be NULL
+ * @return the new thread
+ */
+thread_type Thread_start(thread_fn fn, void* parameter)
+{
+#if defined(WIN32) || defined(WIN64)
+	thread_type thread = NULL;
+#else
+	thread_type thread = 0;
+	pthread_attr_t attr;
+#endif
+
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	thread = CreateThread(NULL, 0, fn, parameter, 0, NULL);
+#else
+	pthread_attr_init(&attr);
+	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+	if (pthread_create(&thread, &attr, fn, parameter) != 0)
+		thread = 0;
+	pthread_attr_destroy(&attr);
+#endif
+	FUNC_EXIT;
+	return thread;
+}
+
+
+/**
+ * Create a new mutex
+ * @return the new mutex
+ */
+mutex_type Thread_create_mutex(void)
+{
+	mutex_type mutex = NULL;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	#if defined(WIN32) || defined(WIN64)
+		mutex = CreateMutex(NULL, 0, NULL);
+		if (mutex == NULL)
+			rc = GetLastError();
+	#else
+		mutex = malloc(sizeof(pthread_mutex_t));
+		rc = pthread_mutex_init(mutex, NULL);
+	#endif
+	FUNC_EXIT_RC(rc);
+	return mutex;
+}
+
+
+/**
+ * Lock a mutex which has alrea
+ * @return completion code, 0 is success
+ */
+int Thread_lock_mutex(mutex_type mutex)
+{
+	int rc = -1;
+
+	/* don't add entry/exit trace points as the stack log uses mutexes - recursion beckons */
+	#if defined(WIN32) || defined(WIN64)
+		/* WaitForSingleObject returns WAIT_OBJECT_0 (0), on success */
+		rc = WaitForSingleObject(mutex, INFINITE);
+	#else
+		rc = pthread_mutex_lock(mutex);
+	#endif
+
+	return rc;
+}
+
+
+/**
+ * Unlock a mutex which has already been locked
+ * @param mutex the mutex
+ * @return completion code, 0 is success
+ */
+int Thread_unlock_mutex(mutex_type mutex)
+{
+	int rc = -1;
+
+	/* don't add entry/exit trace points as the stack log uses mutexes - recursion beckons */
+	#if defined(WIN32) || defined(WIN64)
+		/* if ReleaseMutex fails, the return value is 0 */
+		if (ReleaseMutex(mutex) == 0)
+			rc = GetLastError();
+		else
+			rc = 0;
+	#else
+		rc = pthread_mutex_unlock(mutex);
+	#endif
+
+	return rc;
+}
+
+
+/**
+ * Destroy a mutex which has already been created
+ * @param mutex the mutex
+ */
+void Thread_destroy_mutex(mutex_type mutex)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	#if defined(WIN32) || defined(WIN64)
+		rc = CloseHandle(mutex);
+	#else
+		rc = pthread_mutex_destroy(mutex);
+		free(mutex);
+	#endif
+	FUNC_EXIT_RC(rc);
+}
+
+
+/**
+ * Get the thread id of the thread from which this function is called
+ * @return thread id, type varying according to OS
+ */
+thread_id_type Thread_getid(void)
+{
+	#if defined(WIN32) || defined(WIN64)
+		return GetCurrentThreadId();
+	#else
+		return pthread_self();
+	#endif
+}
+
+
+/**
+ * Create a new semaphore
+ * @return the new condition variable
+ */
+sem_type Thread_create_sem(void)
+{
+	sem_type sem = NULL;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	#if defined(WIN32) || defined(WIN64)
+		sem = CreateEvent(
+		        NULL,               /* default security attributes */
+		        FALSE,              /* manual-reset event? */
+		        FALSE,              /* initial state is nonsignaled */
+		        NULL                /* object name */
+		        );
+	#elif defined(OSX)
+		sem = dispatch_semaphore_create(0L);
+		rc = (sem == NULL) ? -1 : 0;
+	#else
+		sem = malloc(sizeof(sem_t));
+		rc = sem_init(sem, 0, 0);
+	#endif
+	FUNC_EXIT_RC(rc);
+	return sem;
+}
+
+
+/**
+ * Wait for a semaphore to be posted, or timeout.
+ * @param sem the semaphore
+ * @param timeout the maximum time to wait, in milliseconds
+ * @return completion code
+ */
+int Thread_wait_sem(sem_type sem, int timeout)
+{
+/* sem_timedwait is the obvious call to use, but seemed not to work on the Viper,
+ * so I've used trywait in a loop instead. Ian Craggs 23/7/2010
+ */
+	int rc = -1;
+#if !defined(WIN32) && !defined(WIN64) && !defined(OSX)
+#define USE_TRYWAIT
+#if defined(USE_TRYWAIT)
+	int i = 0;
+	int interval = 10000; /* 10000 microseconds: 10 milliseconds */
+	int count = (1000 * timeout) / interval; /* how many intervals in timeout period */
+#else
+	struct timespec ts;
+#endif
+#endif
+
+	FUNC_ENTRY;
+	#if defined(WIN32) || defined(WIN64)
+		rc = WaitForSingleObject(sem, timeout < 0 ? 0 : timeout);
+  #elif defined(OSX)
+		rc = (int)dispatch_semaphore_wait(sem, dispatch_time(DISPATCH_TIME_NOW, (int64_t)timeout*1000000L));
+	#elif defined(USE_TRYWAIT)
+		while (++i < count && (rc = sem_trywait(sem)) != 0)
+		{
+			if (rc == -1 && ((rc = errno) != EAGAIN))
+			{
+				rc = 0;
+				break;
+			}
+			usleep(interval); /* microseconds - .1 of a second */
+		}
+	#else
+		if (clock_gettime(CLOCK_REALTIME, &ts) != -1)
+		{
+			ts.tv_sec += timeout;
+			rc = sem_timedwait(sem, &ts);
+		}
+	#endif
+
+ 	FUNC_EXIT_RC(rc);
+ 	return rc;
+}
+
+
+/**
+ * Check to see if a semaphore has been posted, without waiting.
+ * @param sem the semaphore
+ * @return 0 (false) or 1 (true)
+ */
+int Thread_check_sem(sem_type sem)
+{
+#if defined(WIN32) || defined(WIN64)
+	return WaitForSingleObject(sem, 0) == WAIT_OBJECT_0;
+#elif defined(OSX)
+  return dispatch_semaphore_wait(sem, DISPATCH_TIME_NOW) == 0;
+#else
+	int semval = -1;
+	sem_getvalue(sem, &semval);
+	return semval > 0;
+#endif
+}
+
+
+/**
+ * Post a semaphore
+ * @param sem the semaphore
+ * @return completion code
+ */
+int Thread_post_sem(sem_type sem)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	#if defined(WIN32) || defined(WIN64)
+		if (SetEvent(sem) == 0)
+			rc = GetLastError();
+	#elif defined(OSX)
+		rc = (int)dispatch_semaphore_signal(sem);
+	#else
+		if (sem_post(sem) == -1)
+			rc = errno;
+	#endif
+
+ 	FUNC_EXIT_RC(rc);
+  return rc;
+}
+
+
+/**
+ * Destroy a semaphore which has already been created
+ * @param sem the semaphore
+ */
+int Thread_destroy_sem(sem_type sem)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	#if defined(WIN32) || defined(WIN64)
+		rc = CloseHandle(sem);
+  #elif defined(OSX)
+	  dispatch_release(sem);
+	#else
+		rc = sem_destroy(sem);
+		free(sem);
+	#endif
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+#if !defined(WIN32) && !defined(WIN64)
+/**
+ * Create a new condition variable
+ * @return the condition variable struct
+ */
+cond_type Thread_create_cond(void)
+{
+	cond_type condvar = NULL;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	condvar = malloc(sizeof(cond_type_struct));
+	rc = pthread_cond_init(&condvar->cond, NULL);
+	rc = pthread_mutex_init(&condvar->mutex, NULL);
+
+	FUNC_EXIT_RC(rc);
+	return condvar;
+}
+
+/**
+ * Signal a condition variable
+ * @return completion code
+ */
+int Thread_signal_cond(cond_type condvar)
+{
+	int rc = 0;
+
+	pthread_mutex_lock(&condvar->mutex);
+	rc = pthread_cond_signal(&condvar->cond);
+	pthread_mutex_unlock(&condvar->mutex);
+
+	return rc;
+}
+
+/**
+ * Wait with a timeout (seconds) for condition variable
+ * @return completion code
+ */
+int Thread_wait_cond(cond_type condvar, int timeout)
+{
+	FUNC_ENTRY;
+	int rc = 0;
+	struct timespec cond_timeout;
+	struct timeval cur_time;
+
+	gettimeofday(&cur_time, NULL);
+
+	cond_timeout.tv_sec = cur_time.tv_sec + timeout;
+	cond_timeout.tv_nsec = cur_time.tv_usec * 1000;
+
+	pthread_mutex_lock(&condvar->mutex);
+	rc = pthread_cond_timedwait(&condvar->cond, &condvar->mutex, &cond_timeout);
+	pthread_mutex_unlock(&condvar->mutex);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+/**
+ * Destroy a condition variable
+ * @return completion code
+ */
+int Thread_destroy_cond(cond_type condvar)
+{
+	int rc = 0;
+
+	rc = pthread_mutex_destroy(&condvar->mutex);
+	rc = pthread_cond_destroy(&condvar->cond);
+	free(condvar);
+
+	return rc;
+}
+#endif
+
+
+#if defined(THREAD_UNIT_TESTS)
+
+#include <stdio.h>
+
+thread_return_type secondary(void* n)
+{
+	int rc = 0;
+
+	/*
+	cond_type cond = n;
+
+	printf("Secondary thread about to wait\n");
+	rc = Thread_wait_cond(cond);
+	printf("Secondary thread returned from wait %d\n", rc);*/
+
+	sem_type sem = n;
+
+	printf("Secondary thread about to wait\n");
+	rc = Thread_wait_sem(sem);
+	printf("Secondary thread returned from wait %d\n", rc);
+
+	printf("Secondary thread about to wait\n");
+	rc = Thread_wait_sem(sem);
+	printf("Secondary thread returned from wait %d\n", rc);
+	printf("Secondary check sem %d\n", Thread_check_sem(sem));
+
+	return 0;
+}
+
+
+int main(int argc, char *argv[])
+{
+	int rc = 0;
+
+	sem_type sem = Thread_create_sem();
+
+	printf("check sem %d\n", Thread_check_sem(sem));
+
+	printf("post secondary\n");
+	rc = Thread_post_sem(sem);
+	printf("posted secondary %d\n", rc);
+
+	printf("check sem %d\n", Thread_check_sem(sem));
+
+	printf("Starting secondary thread\n");
+	Thread_start(secondary, (void*)sem);
+
+	sleep(3);
+	printf("check sem %d\n", Thread_check_sem(sem));
+
+	printf("post secondary\n");
+	rc = Thread_post_sem(sem);
+	printf("posted secondary %d\n", rc);
+
+	sleep(3);
+
+	printf("Main thread ending\n");
+}
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Thread.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Thread.h b/thirdparty/paho.mqtt.c/src/Thread.h
new file mode 100644
index 0000000..995e221
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Thread.h
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial implementation
+ *    Ian Craggs, Allan Stockdill-Mander - async client updates
+ *    Ian Craggs - fix for bug #420851
+ *    Ian Craggs - change MacOS semaphore implementation
+ *******************************************************************************/
+#include "MQTTClient.h"
+
+#if !defined(THREAD_H)
+#define THREAD_H
+
+#if defined(WIN32) || defined(WIN64)
+	#include <windows.h>
+	#define thread_type HANDLE
+	#define thread_id_type DWORD
+	#define thread_return_type DWORD
+	#define thread_fn LPTHREAD_START_ROUTINE
+	#define mutex_type HANDLE
+	#define cond_type HANDLE
+	#define sem_type HANDLE
+#else
+	#include <pthread.h>
+
+	#define thread_type pthread_t
+	#define thread_id_type pthread_t
+	#define thread_return_type void*
+	typedef thread_return_type (*thread_fn)(void*);
+	#define mutex_type pthread_mutex_t*
+	typedef struct { pthread_cond_t cond; pthread_mutex_t mutex; } cond_type_struct;
+	typedef cond_type_struct *cond_type;
+	#if defined(OSX)
+	  #include <dispatch/dispatch.h>
+	  typedef dispatch_semaphore_t sem_type;
+	#else
+	  #include <semaphore.h>
+	  typedef sem_t *sem_type;
+	#endif
+
+	cond_type Thread_create_cond(void);
+	int Thread_signal_cond(cond_type);
+	int Thread_wait_cond(cond_type condvar, int timeout);
+	int Thread_destroy_cond(cond_type);
+#endif
+
+DLLExport thread_type Thread_start(thread_fn, void*);
+
+DLLExport mutex_type Thread_create_mutex();
+DLLExport int Thread_lock_mutex(mutex_type);
+DLLExport int Thread_unlock_mutex(mutex_type);
+void Thread_destroy_mutex(mutex_type);
+
+DLLExport thread_id_type Thread_getid();
+
+sem_type Thread_create_sem(void);
+int Thread_wait_sem(sem_type sem, int timeout);
+int Thread_check_sem(sem_type sem);
+int Thread_post_sem(sem_type sem);
+int Thread_destroy_sem(sem_type sem);
+
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Tree.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Tree.c b/thirdparty/paho.mqtt.c/src/Tree.c
new file mode 100644
index 0000000..13134d6
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Tree.c
@@ -0,0 +1,724 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial implementation and documentation
+ *******************************************************************************/
+
+/** @file
+ * \brief functions which apply to tree structures.
+ *
+ * These trees can hold data of any sort, pointed to by the content pointer of the
+ * Node structure.
+ * */
+
+#define NO_HEAP_TRACKING 1
+
+#include "Tree.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "Heap.h"
+
+
+int isRed(Node* aNode);
+int isBlack(Node* aNode);
+int TreeWalk(Node* curnode, int depth);
+int TreeMaxDepth(Tree *aTree);
+void TreeRotate(Tree* aTree, Node* curnode, int direction, int index);
+Node* TreeBAASub(Tree* aTree, Node* curnode, int which, int index);
+void TreeBalanceAfterAdd(Tree* aTree, Node* curnode, int index);
+void* TreeAddByIndex(Tree* aTree, void* content, size_t size, int index);
+Node* TreeFindIndex1(Tree* aTree, void* key, int index, int value);
+Node* TreeFindContentIndex(Tree* aTree, void* key, int index);
+Node* TreeMinimum(Node* curnode);
+Node* TreeSuccessor(Node* curnode);
+Node* TreeNextElementIndex(Tree* aTree, Node* curnode, int index);
+Node* TreeBARSub(Tree* aTree, Node* curnode, int which, int index);
+void TreeBalanceAfterRemove(Tree* aTree, Node* curnode, int index);
+void* TreeRemoveIndex(Tree* aTree, void* content, int index);
+
+
+void TreeInitializeNoMalloc(Tree* aTree, int(*compare)(void*, void*, int))
+{
+	memset(aTree, '\0', sizeof(Tree));
+	aTree->heap_tracking = 1;
+	aTree->index[0].compare = compare;
+	aTree->indexes = 1;
+}
+
+/**
+ * Allocates and initializes a new tree structure.
+ * @return a pointer to the new tree structure
+ */
+Tree* TreeInitialize(int(*compare)(void*, void*, int))
+{
+#if defined(UNIT_TESTS)
+	Tree* newt = malloc(sizeof(Tree));
+#else
+	Tree* newt = mymalloc(__FILE__, __LINE__, sizeof(Tree));
+#endif
+	TreeInitializeNoMalloc(newt, compare);
+	return newt;
+}
+
+
+void TreeAddIndex(Tree* aTree, int(*compare)(void*, void*, int))
+{
+	aTree->index[aTree->indexes].compare = compare;
+	++(aTree->indexes);
+}
+
+
+void TreeFree(Tree* aTree)
+{
+#if defined(UNIT_TESTS)
+	free(aTree);
+#else
+	(aTree->heap_tracking) ? myfree(__FILE__, __LINE__, aTree) : free(aTree);
+#endif
+}
+
+
+#define LEFT 0
+#define RIGHT 1
+#if !defined(max)
+#define max(a, b) (a > b) ? a : b;
+#endif
+
+
+
+int isRed(Node* aNode)
+{
+	return (aNode != NULL) && (aNode->red);
+}
+
+
+int isBlack(Node* aNode)
+{
+	return (aNode == NULL) || (aNode->red == 0);
+}
+
+
+int TreeWalk(Node* curnode, int depth)
+{
+	if (curnode)
+	{
+		int left = TreeWalk(curnode->child[LEFT], depth+1);
+		int right = TreeWalk(curnode->child[RIGHT], depth+1);
+		depth = max(left, right);
+		if (curnode->red)
+		{
+			/*if (isRed(curnode->child[LEFT]) || isRed(curnode->child[RIGHT]))
+			{
+				printf("red/black tree violation %p\n", curnode->content);
+				exit(-99);
+			}*/;
+		}
+	}
+	return depth;
+}
+
+
+int TreeMaxDepth(Tree *aTree)
+{
+	int rc = TreeWalk(aTree->index[0].root, 0);
+	/*if (aTree->root->red)
+	{
+		printf("root node should not be red %p\n", aTree->root->content);
+		exit(-99);
+	}*/
+	return rc;
+}
+
+
+void TreeRotate(Tree* aTree, Node* curnode, int direction, int index)
+{
+	Node* other = curnode->child[!direction];
+
+	curnode->child[!direction] = other->child[direction];
+	if (other->child[direction] != NULL)
+		other->child[direction]->parent = curnode;
+	other->parent = curnode->parent;
+	if (curnode->parent == NULL)
+		aTree->index[index].root = other;
+	else if (curnode == curnode->parent->child[direction])
+		curnode->parent->child[direction] = other;
+	else
+		curnode->parent->child[!direction] = other;
+	other->child[direction] = curnode;
+	curnode->parent = other;
+}
+
+
+Node* TreeBAASub(Tree* aTree, Node* curnode, int which, int index)
+{
+	Node* uncle = curnode->parent->parent->child[which];
+
+	if (isRed(uncle))
+	{
+		curnode->parent->red = uncle->red = 0;
+		curnode = curnode->parent->parent;
+		curnode->red = 1;
+	}
+	else
+	{
+		if (curnode == curnode->parent->child[which])
+		{
+			curnode = curnode->parent;
+			TreeRotate(aTree, curnode, !which, index);
+		}
+		curnode->parent->red = 0;
+		curnode->parent->parent->red = 1;
+		TreeRotate(aTree, curnode->parent->parent, which, index);
+	}
+	return curnode;
+}
+
+
+void TreeBalanceAfterAdd(Tree* aTree, Node* curnode, int index)
+{
+	while (curnode && isRed(curnode->parent) && curnode->parent->parent)
+	{
+		if (curnode->parent == curnode->parent->parent->child[LEFT])
+			curnode = TreeBAASub(aTree, curnode, RIGHT, index);
+		else
+			curnode = TreeBAASub(aTree, curnode, LEFT, index);
+  }
+  aTree->index[index].root->red = 0;
+}
+
+
+/**
+ * Add an item to a tree
+ * @param aTree the list to which the item is to be added
+ * @param content the list item content itself
+ * @param size the size of the element
+ */
+void* TreeAddByIndex(Tree* aTree, void* content, size_t size, int index)
+{
+	Node* curparent = NULL;
+	Node* curnode = aTree->index[index].root;
+	Node* newel = NULL;
+	int left = 0;
+	int result = 1;
+	void* rc = NULL;
+
+	while (curnode)
+	{
+		result = aTree->index[index].compare(curnode->content, content, 1);
+		left = (result > 0);
+		if (result == 0)
+			break;
+		else
+		{
+			curparent = curnode;
+			curnode = curnode->child[left];
+		}
+	}
+	
+	if (result == 0)
+	{
+		if (aTree->allow_duplicates)
+			exit(-99);
+		{
+			newel = curnode;
+			rc = newel->content;
+			if (index == 0)
+				aTree->size += (size - curnode->size);
+		}
+	}
+	else
+	{
+		#if defined(UNIT_TESTS)
+			newel = malloc(sizeof(Node));
+		#else
+			newel = (aTree->heap_tracking) ? mymalloc(__FILE__, __LINE__, sizeof(Node)) : malloc(sizeof(Node));
+		#endif
+		memset(newel, '\0', sizeof(Node));
+		if (curparent)
+			curparent->child[left] = newel;
+		else
+			aTree->index[index].root = newel;
+		newel->parent = curparent;
+		newel->red = 1;
+		if (index == 0)
+		{
+			++(aTree->count);
+			aTree->size += size;
+		}
+	}
+	newel->content = content;
+	newel->size = size;
+	TreeBalanceAfterAdd(aTree, newel, index);
+	return rc;
+}
+
+
+void* TreeAdd(Tree* aTree, void* content, size_t size)
+{
+	void* rc = NULL;
+	int i;
+
+	for (i = 0; i < aTree->indexes; ++i)
+		rc = TreeAddByIndex(aTree, content, size, i);
+
+	return rc;
+}
+
+
+Node* TreeFindIndex1(Tree* aTree, void* key, int index, int value)
+{
+	int result = 0;
+	Node* curnode = aTree->index[index].root;
+
+	while (curnode)
+	{
+		result = aTree->index[index].compare(curnode->content, key, value);
+		if (result == 0)
+			break;
+		else
+			curnode = curnode->child[result > 0];
+	}
+	return curnode;
+}
+
+
+Node* TreeFindIndex(Tree* aTree, void* key, int index)
+{
+	return TreeFindIndex1(aTree, key, index, 0);
+}
+
+
+Node* TreeFindContentIndex(Tree* aTree, void* key, int index)
+{
+	return TreeFindIndex1(aTree, key, index, 1);
+}
+
+
+Node* TreeFind(Tree* aTree, void* key)
+{
+	return TreeFindIndex(aTree, key, 0);
+}
+
+
+Node* TreeMinimum(Node* curnode)
+{
+	if (curnode)
+		while (curnode->child[LEFT])
+			curnode = curnode->child[LEFT];
+	return curnode;
+}
+
+
+Node* TreeSuccessor(Node* curnode)
+{
+	if (curnode->child[RIGHT])
+		curnode = TreeMinimum(curnode->child[RIGHT]);
+	else
+	{
+		Node* curparent = curnode->parent;
+		while (curparent && curnode == curparent->child[RIGHT])
+		{
+			curnode = curparent;
+			curparent = curparent->parent;
+		}
+		curnode = curparent;
+	}
+	return curnode;
+}
+
+
+Node* TreeNextElementIndex(Tree* aTree, Node* curnode, int index)
+{
+	if (curnode == NULL)
+		curnode = TreeMinimum(aTree->index[index].root);
+	else
+		curnode = TreeSuccessor(curnode);
+	return curnode;
+}
+
+
+Node* TreeNextElement(Tree* aTree, Node* curnode)
+{
+	return TreeNextElementIndex(aTree, curnode, 0);
+}
+
+
+Node* TreeBARSub(Tree* aTree, Node* curnode, int which, int index)
+{
+	Node* sibling = curnode->parent->child[which];
+
+	if (isRed(sibling))
+	{
+		sibling->red = 0;
+		curnode->parent->red = 1;
+		TreeRotate(aTree, curnode->parent, !which, index);
+		sibling = curnode->parent->child[which];
+	}
+	if (!sibling)
+		curnode = curnode->parent;
+	else if (isBlack(sibling->child[!which]) && isBlack(sibling->child[which]))
+	{
+		sibling->red = 1;
+		curnode = curnode->parent;
+	}
+	else
+	{
+		if (isBlack(sibling->child[which]))
+		{
+			sibling->child[!which]->red = 0;
+			sibling->red = 1;
+			TreeRotate(aTree, sibling, which, index);
+			sibling = curnode->parent->child[which];
+		}
+		sibling->red = curnode->parent->red;
+		curnode->parent->red = 0;
+		sibling->child[which]->red = 0;
+		TreeRotate(aTree, curnode->parent, !which, index);
+		curnode = aTree->index[index].root;
+	}
+	return curnode;
+}
+
+
+void TreeBalanceAfterRemove(Tree* aTree, Node* curnode, int index)
+{
+	while (curnode != aTree->index[index].root && isBlack(curnode))
+	{
+		/* curnode->content == NULL must equal curnode == NULL */
+		if (((curnode->content) ? curnode : NULL) == curnode->parent->child[LEFT])
+			curnode = TreeBARSub(aTree, curnode, RIGHT, index);
+		else
+			curnode = TreeBARSub(aTree, curnode, LEFT, index);
+    }
+	curnode->red = 0;
+}
+
+
+/**
+ * Remove an item from a tree
+ * @param aTree the list to which the item is to be added
+ * @param curnode the list item content itself
+ */
+void* TreeRemoveNodeIndex(Tree* aTree, Node* curnode, int index)
+{
+	Node* redundant = curnode;
+	Node* curchild = NULL;
+	size_t size = curnode->size;
+	void* content = curnode->content;
+
+	/* if the node to remove has 0 or 1 children, it can be removed without involving another node */
+	if (curnode->child[LEFT] && curnode->child[RIGHT]) /* 2 children */
+		redundant = TreeSuccessor(curnode); 	/* now redundant must have at most one child */
+
+	curchild = redundant->child[(redundant->child[LEFT] != NULL) ? LEFT : RIGHT];
+	if (curchild) /* we could have no children at all */
+		curchild->parent = redundant->parent;
+
+	if (redundant->parent == NULL)
+		aTree->index[index].root = curchild;
+	else
+	{
+		if (redundant == redundant->parent->child[LEFT])
+			redundant->parent->child[LEFT] = curchild;
+		else
+			redundant->parent->child[RIGHT] = curchild;
+	}
+
+	if (redundant != curnode)
+	{
+		curnode->content = redundant->content;
+		curnode->size = redundant->size;
+	}
+
+	if (isBlack(redundant))
+	{
+		if (curchild == NULL)
+		{
+			if (redundant->parent)
+			{
+				Node temp;
+				memset(&temp, '\0', sizeof(Node));
+				temp.parent = (redundant) ? redundant->parent : NULL;
+				temp.red = 0;
+				TreeBalanceAfterRemove(aTree, &temp, index);
+			}
+		}
+		else
+			TreeBalanceAfterRemove(aTree, curchild, index);
+	}
+
+#if defined(UNIT_TESTS)
+	free(redundant);
+#else
+	(aTree->heap_tracking) ? myfree(__FILE__, __LINE__, redundant) : free(redundant);
+#endif
+	if (index == 0)
+	{
+		aTree->size -= size;
+		--(aTree->count);
+	}
+	return content;
+}
+
+
+/**
+ * Remove an item from a tree
+ * @param aTree the list to which the item is to be added
+ * @param curnode the list item content itself
+ */
+void* TreeRemoveIndex(Tree* aTree, void* content, int index)
+{
+	Node* curnode = TreeFindContentIndex(aTree, content, index);
+
+	if (curnode == NULL)
+		return NULL;
+
+	return TreeRemoveNodeIndex(aTree, curnode, index);
+}
+
+
+void* TreeRemove(Tree* aTree, void* content)
+{
+	int i;
+	void* rc = NULL;
+
+	for (i = 0; i < aTree->indexes; ++i)
+		rc = TreeRemoveIndex(aTree, content, i);
+
+	return rc;
+}
+
+
+void* TreeRemoveKeyIndex(Tree* aTree, void* key, int index)
+{
+	Node* curnode = TreeFindIndex(aTree, key, index);
+	void* content = NULL;
+	int i;
+
+	if (curnode == NULL)
+		return NULL;
+
+	content = TreeRemoveNodeIndex(aTree, curnode, index);
+	for (i = 0; i < aTree->indexes; ++i)
+	{
+		if (i != index)
+			content = TreeRemoveIndex(aTree, content, i);
+	}
+	return content;
+}
+
+
+void* TreeRemoveKey(Tree* aTree, void* key)
+{
+	return TreeRemoveKeyIndex(aTree, key, 0);
+}
+
+
+int TreeIntCompare(void* a, void* b, int content)
+{
+	int i = *((int*)a);
+	int j = *((int*)b);
+
+	/* printf("comparing %d %d\n", *((int*)a), *((int*)b)); */
+	return (i > j) ? -1 : (i == j) ? 0 : 1;
+}
+
+
+int TreePtrCompare(void* a, void* b, int content)
+{
+	return (a > b) ? -1 : (a == b) ? 0 : 1;
+}
+
+
+int TreeStringCompare(void* a, void* b, int content)
+{
+	return strcmp((char*)a, (char*)b);
+}
+
+
+#if defined(UNIT_TESTS)
+
+int check(Tree *t)
+{
+	Node* curnode = NULL;
+	int rc = 0;
+
+	curnode = TreeNextElement(t, curnode);
+	while (curnode)
+	{
+		Node* prevnode = curnode;
+
+		curnode = TreeNextElement(t, curnode);
+
+		if (prevnode && curnode && (*(int*)(curnode->content) < *(int*)(prevnode->content)))
+		{
+			printf("out of order %d < %d\n", *(int*)(curnode->content), *(int*)(prevnode->content));
+			rc = 99;
+		}
+	}
+	return rc;
+}
+
+
+int traverse(Tree *t, int lookfor)
+{
+	Node* curnode = NULL;
+	int rc = 0;
+
+	printf("Traversing\n");
+	curnode = TreeNextElement(t, curnode);
+	/* printf("content int %d\n", *(int*)(curnode->content)); */
+	while (curnode)
+	{
+		Node* prevnode = curnode;
+
+		curnode = TreeNextElement(t, curnode);
+		/* if (curnode)
+			printf("content int %d\n", *(int*)(curnode->content)); */
+		if (prevnode && curnode && (*(int*)(curnode->content) < *(int*)(prevnode->content)))
+		{
+			printf("out of order %d < %d\n", *(int*)(curnode->content), *(int*)(prevnode->content));
+		}
+		if (curnode && (lookfor == *(int*)(curnode->content)))
+			printf("missing item %d actually found\n", lookfor);
+	}
+	printf("End traverse %d\n", rc);
+	return rc;
+}
+
+
+int test(int limit)
+{
+	int i, *ip, *todelete;
+	Node* current = NULL;
+	Tree* t = TreeInitialize(TreeIntCompare);
+	int rc = 0;
+
+	printf("Tree initialized\n");
+
+	srand(time(NULL));
+
+	ip = malloc(sizeof(int));
+	*ip = 2;
+	TreeAdd(t, (void*)ip, sizeof(int));
+
+	check(t);
+
+	i = 2;
+	void* result = TreeRemove(t, (void*)&i);
+	if (result)
+		free(result);
+
+	int actual[limit];
+	for (i = 0; i < limit; i++)
+	{
+		void* replaced = NULL;
+
+		ip = malloc(sizeof(int));
+		*ip = rand();
+		replaced = TreeAdd(t, (void*)ip, sizeof(int));
+		if (replaced) /* duplicate */
+		{
+			free(replaced);
+			actual[i] = -1;
+		}
+		else
+			actual[i] = *ip;
+		if (i==5)
+			todelete = ip;
+		printf("Tree element added %d\n",  *ip);
+		if (1 % 1000 == 0)
+		{
+			rc = check(t);
+			printf("%d elements, check result %d\n", i+1, rc);
+			if (rc != 0)
+				return 88;
+		}
+	}
+
+	check(t);
+
+	for (i = 0; i < limit; i++)
+	{
+		int parm = actual[i];
+
+		if (parm == -1)
+			continue;
+
+		Node* found = TreeFind(t, (void*)&parm);
+		if (found)
+			printf("Tree find %d %d\n", parm, *(int*)(found->content));
+		else
+		{
+			printf("%d not found\n", parm);
+			traverse(t, parm);
+			return -2;
+		}
+	}
+
+	check(t);
+
+	for (i = limit -1; i >= 0; i--)
+	{
+		int parm = actual[i];
+		void *found;
+
+		if (parm == -1) /* skip duplicate */
+			continue;
+
+		found = TreeRemove(t, (void*)&parm);
+		if (found)
+		{
+			printf("%d Tree remove %d %d\n", i, parm, *(int*)(found));
+			free(found);
+		}
+		else
+		{
+			int count = 0;
+			printf("%d %d not found\n", i, parm);
+			traverse(t, parm);
+			for (i = 0; i < limit; i++)
+				if (actual[i] == parm)
+					++count;
+			printf("%d occurs %d times\n", parm, count);
+			return -2;
+		}
+		if (i % 1000 == 0)
+		{
+			rc = check(t);
+			printf("%d elements, check result %d\n", i+1, rc);
+			if (rc != 0)
+				return 88;
+		}
+	}
+	printf("finished\n");
+	return 0;
+}
+
+int main(int argc, char *argv[])
+{
+	int rc = 0;
+
+	while (rc == 0)
+		rc = test(999999);
+}
+
+#endif
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Tree.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Tree.h b/thirdparty/paho.mqtt.c/src/Tree.h
new file mode 100644
index 0000000..bbbd014
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Tree.h
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial implementation and documentation
+ *******************************************************************************/
+
+
+#if !defined(TREE_H)
+#define TREE_H
+
+#include <stdlib.h> /* for size_t definition */
+
+/*BE
+defm defTree(T) // macro to define a tree
+
+def T concat Node
+{
+	n32 ptr T concat Node "parent"
+	n32 ptr T concat Node "left"
+	n32 ptr T concat Node "right"
+	n32 ptr T id2str(T)
+	n32 suppress "size"
+}
+
+
+def T concat Tree
+{
+	struct
+	{
+		n32 ptr T concat Node suppress "root"
+		n32 ptr DATA suppress "compare"
+	} 
+	struct
+	{
+		n32 ptr T concat Node suppress "root"
+		n32 ptr DATA suppress "compare"
+	} 
+	n32 dec "count"
+	n32 dec suppress "size"
+}
+
+endm
+
+defTree(INT)
+defTree(STRING)
+defTree(TMP)
+
+BE*/
+
+/**
+ * Structure to hold all data for one list element
+ */
+typedef struct NodeStruct
+{
+	struct NodeStruct *parent,   /**< pointer to parent tree node, in case we need it */
+					  *child[2]; /**< pointers to child tree nodes 0 = left, 1 = right */
+	void* content;				 /**< pointer to element content */
+	size_t size;					 /**< size of content */
+	unsigned int red : 1;
+} Node;
+
+
+/**
+ * Structure to hold all data for one tree
+ */
+typedef struct
+{
+	struct
+	{
+		Node *root;	/**< root node pointer */
+		int (*compare)(void*, void*, int); /**< comparison function */
+	} index[2];
+	int indexes,  /**< no of indexes into tree */
+		count;    /**< no of items */
+	size_t size;  /**< heap storage used */
+	unsigned int heap_tracking : 1; /**< switch on heap tracking for this tree? */
+	unsigned int allow_duplicates : 1; /**< switch to allow duplicate entries */
+} Tree;
+
+
+Tree* TreeInitialize(int(*compare)(void*, void*, int));
+void TreeInitializeNoMalloc(Tree* aTree, int(*compare)(void*, void*, int));
+void TreeAddIndex(Tree* aTree, int(*compare)(void*, void*, int));
+
+void* TreeAdd(Tree* aTree, void* content, size_t size);
+
+void* TreeRemove(Tree* aTree, void* content);
+
+void* TreeRemoveKey(Tree* aTree, void* key);
+void* TreeRemoveKeyIndex(Tree* aTree, void* key, int index);
+
+void* TreeRemoveNodeIndex(Tree* aTree, Node* aNode, int index);
+
+void TreeFree(Tree* aTree);
+
+Node* TreeFind(Tree* aTree, void* key);
+Node* TreeFindIndex(Tree* aTree, void* key, int index);
+
+Node* TreeNextElement(Tree* aTree, Node* curnode);
+
+int TreeIntCompare(void* a, void* b, int);
+int TreePtrCompare(void* a, void* b, int);
+int TreeStringCompare(void* a, void* b, int);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/VersionInfo.h.in
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/VersionInfo.h.in b/thirdparty/paho.mqtt.c/src/VersionInfo.h.in
new file mode 100644
index 0000000..5b91bf3
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/VersionInfo.h.in
@@ -0,0 +1,7 @@
+#ifndef VERSIONINFO_H
+#define VERSIONINFO_H
+
+#define BUILD_TIMESTAMP "@BUILD_TIMESTAMP@"
+#define CLIENT_VERSION  "@CLIENT_VERSION@"
+
+#endif /* VERSIONINFO_H */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/samples/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/samples/CMakeLists.txt b/thirdparty/paho.mqtt.c/src/samples/CMakeLists.txt
new file mode 100644
index 0000000..79ea886
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/samples/CMakeLists.txt
@@ -0,0 +1,65 @@
+#*******************************************************************************
+#  Copyright (c) 2015, 2017 logi.cals GmbH and others
+#
+#  All rights reserved. This program and the accompanying materials
+#  are made available under the terms of the Eclipse Public License v1.0
+#  and Eclipse Distribution License v1.0 which accompany this distribution.
+#
+#  The Eclipse Public License is available at
+#     http://www.eclipse.org/legal/epl-v10.html
+#  and the Eclipse Distribution License is available at
+#    http://www.eclipse.org/org/documents/edl-v10.php.
+#
+#  Contributors:
+#     Rainer Poisel - initial version
+#     Ian Craggs - update sample names
+#*******************************************************************************/
+
+# Note: on OS X you should install XCode and the associated command-line tools
+
+## compilation/linkage settings
+INCLUDE_DIRECTORIES(
+    .
+    ${CMAKE_SOURCE_DIR}/src
+    ${CMAKE_BINARY_DIR}
+    )
+
+IF (WIN32)
+  	ADD_DEFINITIONS(/DCMAKE_BUILD /D_CRT_SECURE_NO_DEPRECATE)
+ENDIF()
+
+# sample files c
+ADD_EXECUTABLE(paho_c_pub paho_c_pub.c)
+ADD_EXECUTABLE(paho_c_sub paho_c_sub.c)
+ADD_EXECUTABLE(paho_cs_pub paho_cs_pub.c)
+ADD_EXECUTABLE(paho_cs_sub paho_cs_sub.c)
+
+TARGET_LINK_LIBRARIES(paho_c_pub paho-mqtt3a)
+TARGET_LINK_LIBRARIES(paho_c_sub paho-mqtt3a)
+TARGET_LINK_LIBRARIES(paho_cs_pub paho-mqtt3c)
+TARGET_LINK_LIBRARIES(paho_cs_sub paho-mqtt3c)
+
+ADD_EXECUTABLE(MQTTAsync_subscribe MQTTAsync_subscribe.c)
+ADD_EXECUTABLE(MQTTAsync_publish MQTTAsync_publish.c)
+ADD_EXECUTABLE(MQTTClient_subscribe MQTTClient_subscribe.c)
+ADD_EXECUTABLE(MQTTClient_publish MQTTClient_publish.c)
+ADD_EXECUTABLE(MQTTClient_publish_async MQTTClient_publish_async.c)
+
+TARGET_LINK_LIBRARIES(MQTTAsync_subscribe paho-mqtt3a)
+TARGET_LINK_LIBRARIES(MQTTAsync_publish paho-mqtt3a)
+TARGET_LINK_LIBRARIES(MQTTClient_subscribe paho-mqtt3c)
+TARGET_LINK_LIBRARIES(MQTTClient_publish paho-mqtt3c)
+TARGET_LINK_LIBRARIES(MQTTClient_publish_async paho-mqtt3c)
+
+INSTALL(TARGETS paho_c_sub
+                paho_c_pub
+                paho_cs_sub
+                paho_cs_pub
+                MQTTAsync_subscribe
+                MQTTAsync_publish
+                MQTTClient_subscribe
+                MQTTClient_publish
+                MQTTClient_publish_async
+
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})


[05/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTClient.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTClient.h b/thirdparty/paho.mqtt.c/src/MQTTClient.h
new file mode 100644
index 0000000..9aee563
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTClient.h
@@ -0,0 +1,1396 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - multiple server connection support
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Ian Craggs - remove const from eyecatchers #168
+ *******************************************************************************/
+
+/**
+ * @cond MQTTClient_internal
+ * @mainpage MQTT Client Library Internals
+ * In the beginning there was one MQTT C client library, MQTTClient, as implemented in MQTTClient.c
+ * This library was designed to be easy to use for applications which didn't mind if some of the calls
+ * blocked for a while.  For instance, the MQTTClient_connect call will block until a successful
+ * connection has completed, or a connection has failed, which could be as long as the "connection
+ * timeout" interval, whose default is 30 seconds.
+ *
+ * However in mobile devices and other windowing environments, blocking on the GUI thread is a bad
+ * thing as it causes the user interface to freeze.  Hence a new API, MQTTAsync, implemented
+ * in MQTTAsync.c, was devised.  There are no blocking calls in this library, so it is well suited
+ * to GUI and mobile environments, at the expense of some extra complexity.
+ *
+ * Both libraries are designed to be sparing in the use of threads.  So multiple client objects are
+ * handled by one or two threads, with a select call in Socket_getReadySocket(), used to determine
+ * when a socket has incoming data.  This API is thread safe: functions may be called by multiple application
+ * threads, with the exception of ::MQTTClient_yield and ::MQTTClient_receive, which are intended
+ * for single threaded environments only.
+ *
+ * @endcond
+ * @cond MQTTClient_main
+ * @mainpage MQTT Client library for C
+ * &copy; Copyright IBM Corp. 2009, 2017
+ *
+ * @brief An MQTT client library in C.
+ *
+ * These pages describe the original more synchronous API which might be
+ * considered easier to use.  Some of the calls will block.  For the new
+ * totally asynchronous API where no calls block, which is especially suitable
+ * for use in windowed environments, see the
+ * <a href="../../MQTTAsync/html/index.html">MQTT C Client Asynchronous API Documentation</a>.
+ * The MQTTClient API is not thread safe, whereas the MQTTAsync API is.
+ *
+ * An MQTT client application connects to MQTT-capable servers.
+ * A typical client is responsible for collecting information from a telemetry
+ * device and publishing the information to the server. It can also subscribe
+ * to topics, receive messages, and use this information to control the
+ * telemetry device.
+ *
+ * MQTT clients implement the published MQTT v3 protocol. You can write your own
+ * API to the MQTT protocol using the programming language and platform of your
+ * choice. This can be time-consuming and error-prone.
+ *
+ * To simplify writing MQTT client applications, this library encapsulates
+ * the MQTT v3 protocol for you. Using this library enables a fully functional
+ * MQTT client application to be written in a few lines of code.
+ * The information presented here documents the API provided
+ * by the MQTT Client library for C.
+ *
+ * <b>Using the client</b><br>
+ * Applications that use the client library typically use a similar structure:
+ * <ul>
+ * <li>Create a client object</li>
+ * <li>Set the options to connect to an MQTT server</li>
+ * <li>Set up callback functions if multi-threaded (asynchronous mode)
+ * operation is being used (see @ref async).</li>
+ * <li>Subscribe to any topics the client needs to receive</li>
+ * <li>Repeat until finished:</li>
+ *     <ul>
+ *     <li>Publish any messages the client needs to</li>
+ *     <li>Handle any incoming messages</li>
+ *     </ul>
+ * <li>Disconnect the client</li>
+ * <li>Free any memory being used by the client</li>
+ * </ul>
+ * Some simple examples are shown here:
+ * <ul>
+ * <li>@ref pubsync</li>
+ * <li>@ref pubasync</li>
+ * <li>@ref subasync</li>
+ * </ul>
+ * Additional information about important concepts is provided here:
+ * <ul>
+ * <li>@ref async</li>
+ * <li>@ref wildcard</li>
+ * <li>@ref qos</li>
+ * <li>@ref tracing</li>
+ * </ul>
+ * @endcond
+ */
+
+/*
+/// @cond EXCLUDE
+*/
+#if defined(__cplusplus)
+ extern "C" {
+#endif
+#if !defined(MQTTCLIENT_H)
+#define MQTTCLIENT_H
+
+#if defined(WIN32) || defined(WIN64)
+  #define DLLImport __declspec(dllimport)
+  #define DLLExport __declspec(dllexport)
+#else
+  #define DLLImport extern
+  #define DLLExport __attribute__ ((visibility ("default")))
+#endif
+
+#include <stdio.h>
+/*
+/// @endcond
+*/
+
+#if !defined(NO_PERSISTENCE)
+#include "MQTTClientPersistence.h"
+#endif
+
+/**
+ * Return code: No error. Indicates successful completion of an MQTT client
+ * operation.
+ */
+#define MQTTCLIENT_SUCCESS 0
+/**
+ * Return code: A generic error code indicating the failure of an MQTT client
+ * operation.
+ */
+#define MQTTCLIENT_FAILURE -1
+
+/* error code -2 is MQTTCLIENT_PERSISTENCE_ERROR */
+
+/**
+ * Return code: The client is disconnected.
+ */
+#define MQTTCLIENT_DISCONNECTED -3
+/**
+ * Return code: The maximum number of messages allowed to be simultaneously
+ * in-flight has been reached.
+ */
+#define MQTTCLIENT_MAX_MESSAGES_INFLIGHT -4
+/**
+ * Return code: An invalid UTF-8 string has been detected.
+ */
+#define MQTTCLIENT_BAD_UTF8_STRING -5
+/**
+ * Return code: A NULL parameter has been supplied when this is invalid.
+ */
+#define MQTTCLIENT_NULL_PARAMETER -6
+/**
+ * Return code: The topic has been truncated (the topic string includes
+ * embedded NULL characters). String functions will not access the full topic.
+ * Use the topic length value to access the full topic.
+ */
+#define MQTTCLIENT_TOPICNAME_TRUNCATED -7
+/**
+ * Return code: A structure parameter does not have the correct eyecatcher
+ * and version number.
+ */
+#define MQTTCLIENT_BAD_STRUCTURE -8
+/**
+ * Return code: A QoS value that falls outside of the acceptable range (0,1,2)
+ */
+#define MQTTCLIENT_BAD_QOS -9
+/**
+ * Return code: Attempting SSL connection using non-SSL version of library
+ */
+#define MQTTCLIENT_SSL_NOT_SUPPORTED -10
+
+/**
+ * Default MQTT version to connect with.  Use 3.1.1 then fall back to 3.1
+ */
+#define MQTTVERSION_DEFAULT 0
+/**
+ * MQTT version to connect with: 3.1
+ */
+#define MQTTVERSION_3_1 3
+/**
+ * MQTT version to connect with: 3.1.1
+ */
+#define MQTTVERSION_3_1_1 4
+/**
+ * Bad return code from subscribe, as defined in the 3.1.1 specification
+ */
+#define MQTT_BAD_SUBSCRIBE 0x80
+
+/**
+ *  Initialization options
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  Must be MQTG. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 */
+	int struct_version;
+	/** 1 = we do openssl init, 0 = leave it to the application */
+	int do_openssl_init;
+} MQTTClient_init_options;
+
+#define MQTTClient_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 }
+
+/**
+ * Global init of mqtt library. Call once on program start to set global behaviour.
+ * do_openssl_init - if mqtt library should initialize OpenSSL (1) or rely on the caller to do it before using the library (0)
+ */
+DLLExport void MQTTClient_global_init(MQTTClient_init_options* inits);
+
+/**
+ * A handle representing an MQTT client. A valid client handle is available
+ * following a successful call to MQTTClient_create().
+ */
+typedef void* MQTTClient;
+/**
+ * A value representing an MQTT message. A delivery token is returned to the
+ * client application when a message is published. The token can then be used to
+ * check that the message was successfully delivered to its destination (see
+ * MQTTClient_publish(),
+ * MQTTClient_publishMessage(),
+ * MQTTClient_deliveryComplete(),
+ * MQTTClient_waitForCompletion() and
+ * MQTTClient_getPendingDeliveryTokens()).
+ */
+typedef int MQTTClient_deliveryToken;
+typedef int MQTTClient_token;
+
+/**
+ * A structure representing the payload and attributes of an MQTT message. The
+ * message topic is not part of this structure (see MQTTClient_publishMessage(),
+ * MQTTClient_publish(), MQTTClient_receive(), MQTTClient_freeMessage()
+ * and MQTTClient_messageArrived()).
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  must be MQTM. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 */
+	int struct_version;
+	/** The length of the MQTT message payload in bytes. */
+	int payloadlen;
+	/** A pointer to the payload of the MQTT message. */
+	void* payload;
+	/**
+     * The quality of service (QoS) assigned to the message.
+     * There are three levels of QoS:
+     * <DL>
+     * <DT><B>QoS0</B></DT>
+     * <DD>Fire and forget - the message may not be delivered</DD>
+     * <DT><B>QoS1</B></DT>
+     * <DD>At least once - the message will be delivered, but may be
+     * delivered more than once in some circumstances.</DD>
+     * <DT><B>QoS2</B></DT>
+     * <DD>Once and one only - the message will be delivered exactly once.</DD>
+     * </DL>
+     */
+	int qos;
+	/**
+     * The retained flag serves two purposes depending on whether the message
+     * it is associated with is being published or received.
+     *
+     * <b>retained = true</b><br>
+     * For messages being published, a true setting indicates that the MQTT
+     * server should retain a copy of the message. The message will then be
+     * transmitted to new subscribers to a topic that matches the message topic.
+     * For subscribers registering a new subscription, the flag being true
+     * indicates that the received message is not a new one, but one that has
+     * been retained by the MQTT server.
+     *
+     * <b>retained = false</b> <br>
+     * For publishers, this ndicates that this message should not be retained
+     * by the MQTT server. For subscribers, a false setting indicates this is
+     * a normal message, received as a result of it being published to the
+     * server.
+     */
+	int retained;
+	/**
+      * The dup flag indicates whether or not this message is a duplicate.
+      * It is only meaningful when receiving QoS1 messages. When true, the
+      * client application should take appropriate action to deal with the
+      * duplicate message.
+      */
+	int dup;
+	/** The message identifier is normally reserved for internal use by the
+      * MQTT client and server.
+      */
+	int msgid;
+} MQTTClient_message;
+
+#define MQTTClient_message_initializer { {'M', 'Q', 'T', 'M'}, 0, 0, NULL, 0, 0, 0, 0 }
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * receipt of messages. The function is registered with the client library by
+ * passing it as an argument to MQTTClient_setCallbacks(). It is
+ * called by the client library when a new message that matches a client
+ * subscription has been received from the server. This function is executed on
+ * a separate thread to the one on which the client application is running.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * MQTTClient_setCallbacks(), which contains any application-specific context.
+ * @param topicName The topic associated with the received message.
+ * @param topicLen The length of the topic if there are one
+ * more NULL characters embedded in <i>topicName</i>, otherwise <i>topicLen</i>
+ * is 0. If <i>topicLen</i> is 0, the value returned by <i>strlen(topicName)</i>
+ * can be trusted. If <i>topicLen</i> is greater than 0, the full topic name
+ * can be retrieved by accessing <i>topicName</i> as a byte array of length
+ * <i>topicLen</i>.
+ * @param message The MQTTClient_message structure for the received message.
+ * This structure contains the message payload and attributes.
+ * @return This function must return a boolean value indicating whether or not
+ * the message has been safely received by the client application. Returning
+ * true indicates that the message has been successfully handled.
+ * Returning false indicates that there was a problem. In this
+ * case, the client library will reinvoke MQTTClient_messageArrived() to
+ * attempt to deliver the message to the application again.
+ */
+typedef int MQTTClient_messageArrived(void* context, char* topicName, int topicLen, MQTTClient_message* message);
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * notification of delivery of messages. The function is registered with the
+ * client library by passing it as an argument to MQTTClient_setCallbacks().
+ * It is called by the client library after the client application has
+ * published a message to the server. It indicates that the necessary
+ * handshaking and acknowledgements for the requested quality of service (see
+ * MQTTClient_message.qos) have been completed. This function is executed on a
+ * separate thread to the one on which the client application is running.
+ * <b>Note:</b>MQTTClient_deliveryComplete() is not called when messages are
+ * published at QoS0.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * MQTTClient_setCallbacks(), which contains any application-specific context.
+ * @param dt The ::MQTTClient_deliveryToken associated with
+ * the published message. Applications can check that all messages have been
+ * correctly published by matching the delivery tokens returned from calls to
+ * MQTTClient_publish() and MQTTClient_publishMessage() with the tokens passed
+ * to this callback.
+ */
+typedef void MQTTClient_deliveryComplete(void* context, MQTTClient_deliveryToken dt);
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * notification of the loss of connection to the server. The function is
+ * registered with the client library by passing it as an argument to
+ * MQTTClient_setCallbacks(). It is called by the client library if the client
+ * loses its connection to the server. The client application must take
+ * appropriate action, such as trying to reconnect or reporting the problem.
+ * This function is executed on a separate thread to the one on which the
+ * client application is running.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * MQTTClient_setCallbacks(), which contains any application-specific context.
+ * @param cause The reason for the disconnection.
+ * Currently, <i>cause</i> is always set to NULL.
+ */
+typedef void MQTTClient_connectionLost(void* context, char* cause);
+
+/**
+ * This function sets the callback functions for a specific client.
+ * If your client application doesn't use a particular callback, set the
+ * relevant parameter to NULL. Calling MQTTClient_setCallbacks() puts the
+ * client into multi-threaded mode. Any necessary message acknowledgements and
+ * status communications are handled in the background without any intervention
+ * from the client application. See @ref async for more information.
+ *
+ * <b>Note:</b> The MQTT client must be disconnected when this function is
+ * called.
+ * @param handle A valid client handle from a successful call to
+ * MQTTClient_create().
+ * @param context A pointer to any application-specific context. The
+ * the <i>context</i> pointer is passed to each of the callback functions to
+ * provide access to the context information in the callback.
+ * @param cl A pointer to an MQTTClient_connectionLost() callback
+ * function. You can set this to NULL if your application doesn't handle
+ * disconnections.
+ * @param ma A pointer to an MQTTClient_messageArrived() callback
+ * function. This callback function must be specified when you call
+ * MQTTClient_setCallbacks().
+ * @param dc A pointer to an MQTTClient_deliveryComplete() callback
+ * function. You can set this to NULL if your application publishes
+ * synchronously or if you do not want to check for successful delivery.
+ * @return ::MQTTCLIENT_SUCCESS if the callbacks were correctly set,
+ * ::MQTTCLIENT_FAILURE if an error occurred.
+ */
+DLLExport int MQTTClient_setCallbacks(MQTTClient handle, void* context, MQTTClient_connectionLost* cl,
+									MQTTClient_messageArrived* ma, MQTTClient_deliveryComplete* dc);
+
+
+/**
+ * This function creates an MQTT client ready for connection to the
+ * specified server and using the specified persistent storage (see
+ * MQTTClient_persistence). See also MQTTClient_destroy().
+ * @param handle A pointer to an ::MQTTClient handle. The handle is
+ * populated with a valid client reference following a successful return from
+ * this function.
+ * @param serverURI A null-terminated string specifying the server to
+ * which the client will connect. It takes the form <i>protocol://host:port</i>.
+ * Currently, <i>protocol</i> must be <i>tcp</i> or <i>ssl</i>.
+ * For <i>host</i>, you can
+ * specify either an IP address or a host name. For instance, to connect to
+ * a server running on the local machines with the default MQTT port, specify
+ * <i>tcp://localhost:1883</i>.
+ * @param clientId The client identifier passed to the server when the
+ * client connects to it. It is a null-terminated UTF-8 encoded string.
+ * @param persistence_type The type of persistence to be used by the client:
+ * <br>
+ * ::MQTTCLIENT_PERSISTENCE_NONE: Use in-memory persistence. If the device or
+ * system on which the client is running fails or is switched off, the current
+ * state of any in-flight messages is lost and some messages may not be
+ * delivered even at QoS1 and QoS2.
+ * <br>
+ * ::MQTTCLIENT_PERSISTENCE_DEFAULT: Use the default (file system-based)
+ * persistence mechanism. Status about in-flight messages is held in persistent
+ * storage and provides some protection against message loss in the case of
+ * unexpected failure.
+ * <br>
+ * ::MQTTCLIENT_PERSISTENCE_USER: Use an application-specific persistence
+ * implementation. Using this type of persistence gives control of the
+ * persistence mechanism to the application. The application has to implement
+ * the MQTTClient_persistence interface.
+ * @param persistence_context If the application uses
+ * ::MQTTCLIENT_PERSISTENCE_NONE persistence, this argument is unused and should
+ * be set to NULL. For ::MQTTCLIENT_PERSISTENCE_DEFAULT persistence, it
+ * should be set to the location of the persistence directory (if set
+ * to NULL, the persistence directory used is the working directory).
+ * Applications that use ::MQTTCLIENT_PERSISTENCE_USER persistence set this
+ * argument to point to a valid MQTTClient_persistence structure.
+ * @return ::MQTTCLIENT_SUCCESS if the client is successfully created, otherwise
+ * an error code is returned.
+ */
+DLLExport int MQTTClient_create(MQTTClient* handle, const char* serverURI, const char* clientId,
+		int persistence_type, void* persistence_context);
+
+/**
+ * MQTTClient_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for
+ * the client. In the event that a client unexpectedly loses its connection to
+ * the server, the server publishes the LWT message to the LWT topic on
+ * behalf of the client. This allows other clients (subscribed to the LWT topic)
+ * to be made aware that the client has disconnected. To enable the LWT
+ * function for a specific client, a valid pointer to an MQTTClient_willOptions
+ * structure is passed in the MQTTClient_connectOptions structure used in the
+ * MQTTClient_connect() call that connects the client to the server. The pointer
+ * to MQTTClient_willOptions can be set to NULL if the LWT function is not
+ * required.
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  must be MQTW. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 or 1
+		   0 means there is no binary payload option
+	 */
+	int struct_version;
+	/** The LWT topic to which the LWT message will be published. */
+	const char* topicName;
+	/** The LWT payload in string form. */
+	const char* message;
+	/**
+	 * The retained flag for the LWT message (see MQTTClient_message.retained).
+	 */
+	int retained;
+	/**
+	 * The quality of service setting for the LWT message (see
+	 * MQTTClient_message.qos and @ref qos).
+	 */
+	int qos;
+  /** The LWT payload in binary form. This is only checked and used if the message option is NULL */
+	struct
+	{
+  	int len;            /**< binary payload length */
+		const void* data;  /**< binary payload data */
+	} payload;
+} MQTTClient_willOptions;
+
+#define MQTTClient_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, {0, NULL} }
+
+#define MQTT_SSL_VERSION_DEFAULT 0
+#define MQTT_SSL_VERSION_TLS_1_0 1
+#define MQTT_SSL_VERSION_TLS_1_1 2
+#define MQTT_SSL_VERSION_TLS_1_2 3
+
+/**
+* MQTTClient_sslProperties defines the settings to establish an SSL/TLS connection using the
+* OpenSSL library. It covers the following scenarios:
+* - Server authentication: The client needs the digital certificate of the server. It is included
+*   in a store containting trusted material (also known as "trust store").
+* - Mutual authentication: Both client and server are authenticated during the SSL handshake. In
+*   addition to the digital certificate of the server in a trust store, the client will need its own
+*   digital certificate and the private key used to sign its digital certificate stored in a "key store".
+* - Anonymous connection: Both client and server do not get authenticated and no credentials are needed
+*   to establish an SSL connection. Note that this scenario is not fully secure since it is subject to
+*   man-in-the-middle attacks.
+*/
+typedef struct
+{
+	/** The eyecatcher for this structure.  Must be MQTS */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0, or 1 to enable TLS version selection. */
+	int struct_version;
+
+	/** The file in PEM format containing the public digital certificates trusted by the client. */
+	const char* trustStore;
+
+	/** The file in PEM format containing the public certificate chain of the client. It may also include
+	* the client's private key.
+	*/
+	const char* keyStore;
+
+	/** If not included in the sslKeyStore, this setting points to the file in PEM format containing
+	* the client's private key.
+	*/
+	const char* privateKey;
+	/** The password to load the client's privateKey if encrypted. */
+	const char* privateKeyPassword;
+
+	/**
+	* The list of cipher suites that the client will present to the server during the SSL handshake. For a
+	* full explanation of the cipher list format, please see the OpenSSL on-line documentation:
+	* http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT
+	* If this setting is ommitted, its default value will be "ALL", that is, all the cipher suites -excluding
+	* those offering no encryption- will be considered.
+	* This setting can be used to set an SSL anonymous connection ("aNULL" string value, for instance).
+	*/
+	const char* enabledCipherSuites;
+
+    /** True/False option to enable verification of the server certificate **/
+    int enableServerCertAuth;
+
+    /** The SSL/TLS version to use. Specify one of MQTT_SSL_VERSION_DEFAULT (0),
+    * MQTT_SSL_VERSION_TLS_1_0 (1), MQTT_SSL_VERSION_TLS_1_1 (2) or MQTT_SSL_VERSION_TLS_1_2 (3).
+    * Only used if struct_version is >= 1.
+    */
+    int sslVersion;
+
+} MQTTClient_SSLOptions;
+
+#define MQTTClient_SSLOptions_initializer { {'M', 'Q', 'T', 'S'}, 1, NULL, NULL, NULL, NULL, NULL, 1, MQTT_SSL_VERSION_DEFAULT }
+
+/**
+ * MQTTClient_connectOptions defines several settings that control the way the
+ * client connects to an MQTT server.
+ *
+ * <b>Note:</b> Default values are not defined for members of
+ * MQTTClient_connectOptions so it is good practice to specify all settings.
+ * If the MQTTClient_connectOptions structure is defined as an automatic
+ * variable, all members are set to random values and thus must be set by the
+ * client application. If the MQTTClient_connectOptions structure is defined
+ * as a static variable, initialization (in compliant compilers) sets all
+ * values to 0 (NULL for pointers). A #keepAliveInterval setting of 0 prevents
+ * correct operation of the client and so you <b>must</b> at least set a value
+ * for #keepAliveInterval.
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  must be MQTC. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0, 1, 2, 3, 4 or 5.
+	 * 0 signifies no SSL options and no serverURIs
+	 * 1 signifies no serverURIs
+	 * 2 signifies no MQTTVersion
+	 * 3 signifies no returned values
+	 * 4 signifies no binary password option
+	 */
+	int struct_version;
+	/** The "keep alive" interval, measured in seconds, defines the maximum time
+   * that should pass without communication between the client and the server
+   * The client will ensure that at least one message travels across the
+   * network within each keep alive period.  In the absence of a data-related
+	 * message during the time period, the client sends a very small MQTT
+   * "ping" message, which the server will acknowledge. The keep alive
+   * interval enables the client to detect when the server is no longer
+	 * available without having to wait for the long TCP/IP timeout.
+	 */
+	int keepAliveInterval;
+	/**
+   * This is a boolean value. The cleansession setting controls the behaviour
+   * of both the client and the server at connection and disconnection time.
+   * The client and server both maintain session state information. This
+   * information is used to ensure "at least once" and "exactly once"
+   * delivery, and "exactly once" receipt of messages. Session state also
+   * includes subscriptions created by an MQTT client. You can choose to
+   * maintain or discard state information between sessions.
+   *
+   * When cleansession is true, the state information is discarded at
+   * connect and disconnect. Setting cleansession to false keeps the state
+   * information. When you connect an MQTT client application with
+   * MQTTClient_connect(), the client identifies the connection using the
+   * client identifier and the address of the server. The server checks
+   * whether session information for this client
+   * has been saved from a previous connection to the server. If a previous
+   * session still exists, and cleansession=true, then the previous session
+   * information at the client and server is cleared. If cleansession=false,
+   * the previous session is resumed. If no previous session exists, a new
+   * session is started.
+	 */
+	int cleansession;
+	/**
+   * This is a boolean value that controls how many messages can be in-flight
+   * simultaneously. Setting <i>reliable</i> to true means that a published
+   * message must be completed (acknowledgements received) before another
+   * can be sent. Attempts to publish additional messages receive an
+   * ::MQTTCLIENT_MAX_MESSAGES_INFLIGHT return code. Setting this flag to
+	 * false allows up to 10 messages to be in-flight. This can increase
+   * overall throughput in some circumstances.
+	 */
+	int reliable;
+	/**
+   * This is a pointer to an MQTTClient_willOptions structure. If your
+   * application does not make use of the Last Will and Testament feature,
+   * set this pointer to NULL.
+   */
+	MQTTClient_willOptions* will;
+	/**
+   * MQTT servers that support the MQTT v3.1.1 protocol provide authentication
+   * and authorisation by user name and password. This is the user name
+   * parameter.
+   */
+	const char* username;
+	/**
+   * MQTT servers that support the MQTT v3.1.1 protocol provide authentication
+   * and authorisation by user name and password. This is the password
+   * parameter.
+   */
+	const char* password;
+	/**
+   * The time interval in seconds to allow a connect to complete.
+   */
+	int connectTimeout;
+	/**
+	 * The time interval in seconds
+	 */
+	int retryInterval;
+	/**
+   * This is a pointer to an MQTTClient_SSLOptions structure. If your
+   * application does not make use of SSL, set this pointer to NULL.
+   */
+	MQTTClient_SSLOptions* ssl;
+	/**
+	 * The number of entries in the optional serverURIs array. Defaults to 0.
+	 */
+	int serverURIcount;
+	/**
+   * An optional array of null-terminated strings specifying the servers to
+   * which the client will connect. Each string takes the form <i>protocol://host:port</i>.
+   * <i>protocol</i> must be <i>tcp</i> or <i>ssl</i>. For <i>host</i>, you can
+   * specify either an IP address or a host name. For instance, to connect to
+   * a server running on the local machines with the default MQTT port, specify
+   * <i>tcp://localhost:1883</i>.
+   * If this list is empty (the default), the server URI specified on MQTTClient_create()
+   * is used.
+   */
+	char* const* serverURIs;
+	/**
+	 * Sets the version of MQTT to be used on the connect.
+	 * MQTTVERSION_DEFAULT (0) = default: start with 3.1.1, and if that fails, fall back to 3.1
+	 * MQTTVERSION_3_1 (3) = only try version 3.1
+	 * MQTTVERSION_3_1_1 (4) = only try version 3.1.1
+	 */
+	int MQTTVersion;
+	/**
+	 * Returned from the connect when the MQTT version used to connect is 3.1.1
+	 */
+	struct
+	{
+		const char* serverURI;     /**< the serverURI connected to */
+		int MQTTVersion;     /**< the MQTT version used to connect with */
+		int sessionPresent;  /**< if the MQTT version is 3.1.1, the value of sessionPresent returned in the connack */
+	} returned;
+	/**
+   * Optional binary password.  Only checked and used if the password option is NULL
+   */
+  struct {
+  	int len;            /**< binary password length */
+		const void* data;  /**< binary password data */
+	} binarypwd;
+} MQTTClient_connectOptions;
+
+#define MQTTClient_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 5, 60, 1, 1, NULL, NULL, NULL, 30, 20, NULL, 0, NULL, 0,         {NULL, 0, 0}, {0, NULL} }
+
+/**
+  * MQTTClient_libraryInfo is used to store details relating to the currently used
+  * library such as the version in use, the time it was built and relevant openSSL
+  * options.
+  * There is one static instance of this struct in MQTTClient.c
+  */
+
+typedef struct
+{
+	const char* name;
+	const char* value;
+} MQTTClient_nameValue;
+
+/**
+  * This function returns version information about the library.
+  * no trace information will be returned.
+  * @return an array of strings describing the library.  The last entry is a NULL pointer.
+  */
+DLLExport MQTTClient_nameValue* MQTTClient_getVersionInfo(void);
+
+/**
+  * This function attempts to connect a previously-created client (see
+  * MQTTClient_create()) to an MQTT server using the specified options. If you
+  * want to enable asynchronous message and status notifications, you must call
+  * MQTTClient_setCallbacks() prior to MQTTClient_connect().
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param options A pointer to a valid MQTTClient_connectOptions
+  * structure.
+  * @return ::MQTTCLIENT_SUCCESS if the client successfully connects to the
+  * server. An error code is returned if the client was unable to connect to
+  * the server.
+  * Error codes greater than 0 are returned by the MQTT protocol:<br><br>
+  * <b>1</b>: Connection refused: Unacceptable protocol version<br>
+  * <b>2</b>: Connection refused: Identifier rejected<br>
+  * <b>3</b>: Connection refused: Server unavailable<br>
+  * <b>4</b>: Connection refused: Bad user name or password<br>
+  * <b>5</b>: Connection refused: Not authorized<br>
+  * <b>6-255</b>: Reserved for future use<br>
+  */
+DLLExport int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions* options);
+
+/**
+  * This function attempts to disconnect the client from the MQTT
+  * server. In order to allow the client time to complete handling of messages
+  * that are in-flight when this function is called, a timeout period is
+  * specified. When the timeout period has expired, the client disconnects even
+  * if there are still outstanding message acknowledgements.
+  * The next time the client connects to the same server, any QoS 1 or 2
+  * messages which have not completed will be retried depending on the
+  * cleansession settings for both the previous and the new connection (see
+  * MQTTClient_connectOptions.cleansession and MQTTClient_connect()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param timeout The client delays disconnection for up to this time (in
+  * milliseconds) in order to allow in-flight message transfers to complete.
+  * @return ::MQTTCLIENT_SUCCESS if the client successfully disconnects from
+  * the server. An error code is returned if the client was unable to disconnect
+  * from the server
+  */
+DLLExport int MQTTClient_disconnect(MQTTClient handle, int timeout);
+
+/**
+  * This function allows the client application to test whether or not a
+  * client is currently connected to the MQTT server.
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @return Boolean true if the client is connected, otherwise false.
+  */
+DLLExport int MQTTClient_isConnected(MQTTClient handle);
+
+
+/* Subscribe is synchronous.  QoS list parameter is changed on return to granted QoSs.
+   Returns return code, MQTTCLIENT_SUCCESS == success, non-zero some sort of error (TBD) */
+
+/**
+  * This function attempts to subscribe a client to a single topic, which may
+  * contain wildcards (see @ref wildcard). This call also specifies the
+  * @ref qos requested for the subscription
+  * (see also MQTTClient_subscribeMany()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param topic The subscription topic, which may include wildcards.
+  * @param qos The requested quality of service for the subscription.
+  * @return ::MQTTCLIENT_SUCCESS if the subscription request is successful.
+  * An error code is returned if there was a problem registering the
+  * subscription.
+  */
+DLLExport int MQTTClient_subscribe(MQTTClient handle, const char* topic, int qos);
+
+/**
+  * This function attempts to subscribe a client to a list of topics, which may
+  * contain wildcards (see @ref wildcard). This call also specifies the
+  * @ref qos requested for each topic (see also MQTTClient_subscribe()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param count The number of topics for which the client is requesting
+  * subscriptions.
+  * @param topic An array (of length <i>count</i>) of pointers to
+  * topics, each of which may include wildcards.
+  * @param qos An array (of length <i>count</i>) of @ref qos
+  * values. qos[n] is the requested QoS for topic[n].
+  * @return ::MQTTCLIENT_SUCCESS if the subscription request is successful.
+  * An error code is returned if there was a problem registering the
+  * subscriptions.
+  */
+DLLExport int MQTTClient_subscribeMany(MQTTClient handle, int count, char* const* topic, int* qos);
+
+/**
+  * This function attempts to remove an existing subscription made by the
+  * specified client.
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param topic The topic for the subscription to be removed, which may
+  * include wildcards (see @ref wildcard).
+  * @return ::MQTTCLIENT_SUCCESS if the subscription is removed.
+  * An error code is returned if there was a problem removing the
+  * subscription.
+  */
+DLLExport int MQTTClient_unsubscribe(MQTTClient handle, const char* topic);
+
+/**
+  * This function attempts to remove existing subscriptions to a list of topics
+  * made by the specified client.
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param count The number subscriptions to be removed.
+  * @param topic An array (of length <i>count</i>) of pointers to the topics of
+  * the subscriptions to be removed, each of which may include wildcards.
+  * @return ::MQTTCLIENT_SUCCESS if the subscriptions are removed.
+  * An error code is returned if there was a problem removing the subscriptions.
+  */
+DLLExport int MQTTClient_unsubscribeMany(MQTTClient handle, int count, char* const* topic);
+
+/**
+  * This function attempts to publish a message to a given topic (see also
+  * MQTTClient_publishMessage()). An ::MQTTClient_deliveryToken is issued when
+  * this function returns successfully. If the client application needs to
+  * test for succesful delivery of QoS1 and QoS2 messages, this can be done
+  * either asynchronously or synchronously (see @ref async,
+  * ::MQTTClient_waitForCompletion and MQTTClient_deliveryComplete()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param topicName The topic associated with this message.
+  * @param payloadlen The length of the payload in bytes.
+  * @param payload A pointer to the byte array payload of the message.
+  * @param qos The @ref qos of the message.
+  * @param retained The retained flag for the message.
+  * @param dt A pointer to an ::MQTTClient_deliveryToken. This is populated
+  * with a token representing the message when the function returns
+  * successfully. If your application does not use delivery tokens, set this
+  * argument to NULL.
+  * @return ::MQTTCLIENT_SUCCESS if the message is accepted for publication.
+  * An error code is returned if there was a problem accepting the message.
+  */
+DLLExport int MQTTClient_publish(MQTTClient handle, const char* topicName, int payloadlen, void* payload, int qos, int retained,
+																 MQTTClient_deliveryToken* dt);
+/**
+  * This function attempts to publish a message to a given topic (see also
+  * MQTTClient_publish()). An ::MQTTClient_deliveryToken is issued when
+  * this function returns successfully. If the client application needs to
+  * test for succesful delivery of QoS1 and QoS2 messages, this can be done
+  * either asynchronously or synchronously (see @ref async,
+  * ::MQTTClient_waitForCompletion and MQTTClient_deliveryComplete()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param topicName The topic associated with this message.
+  * @param msg A pointer to a valid MQTTClient_message structure containing
+  * the payload and attributes of the message to be published.
+  * @param dt A pointer to an ::MQTTClient_deliveryToken. This is populated
+  * with a token representing the message when the function returns
+  * successfully. If your application does not use delivery tokens, set this
+  * argument to NULL.
+  * @return ::MQTTCLIENT_SUCCESS if the message is accepted for publication.
+  * An error code is returned if there was a problem accepting the message.
+  */
+DLLExport int MQTTClient_publishMessage(MQTTClient handle, const char* topicName, MQTTClient_message* msg, MQTTClient_deliveryToken* dt);
+
+
+/**
+  * This function is called by the client application to synchronize execution
+  * of the main thread with completed publication of a message. When called,
+  * MQTTClient_waitForCompletion() blocks execution until the message has been
+  * successful delivered or the specified timeout has expired. See @ref async.
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param dt The ::MQTTClient_deliveryToken that represents the message being
+  * tested for successful delivery. Delivery tokens are issued by the
+  * publishing functions MQTTClient_publish() and MQTTClient_publishMessage().
+  * @param timeout The maximum time to wait in milliseconds.
+  * @return ::MQTTCLIENT_SUCCESS if the message was successfully delivered.
+  * An error code is returned if the timeout expires or there was a problem
+  * checking the token.
+  */
+DLLExport int MQTTClient_waitForCompletion(MQTTClient handle, MQTTClient_deliveryToken dt, unsigned long timeout);
+
+
+/**
+  * This function sets a pointer to an array of delivery tokens for
+  * messages that are currently in-flight (pending completion).
+  *
+  * <b>Important note:</b> The memory used to hold the array of tokens is
+  * malloc()'d in this function. The client application is responsible for
+  * freeing this memory when it is no longer required.
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param tokens The address of a pointer to an ::MQTTClient_deliveryToken.
+  * When the function returns successfully, the pointer is set to point to an
+  * array of tokens representing messages pending completion. The last member of
+  * the array is set to -1 to indicate there are no more tokens. If no tokens
+  * are pending, the pointer is set to NULL.
+  * @return ::MQTTCLIENT_SUCCESS if the function returns successfully.
+  * An error code is returned if there was a problem obtaining the list of
+  * pending tokens.
+  */
+DLLExport int MQTTClient_getPendingDeliveryTokens(MQTTClient handle, MQTTClient_deliveryToken **tokens);
+
+/**
+  * When implementing a single-threaded client, call this function periodically
+  * to allow processing of message retries and to send MQTT keepalive pings.
+  * If the application is calling MQTTClient_receive() regularly, then it is
+  * not necessary to call this function.
+  */
+DLLExport void MQTTClient_yield(void);
+
+/**
+  * This function performs a synchronous receive of incoming messages. It should
+  * be used only when the client application has not set callback methods to
+  * support asynchronous receipt of messages (see @ref async and
+  * MQTTClient_setCallbacks()). Using this function allows a single-threaded
+  * client subscriber application to be written. When called, this function
+  * blocks until the next message arrives or the specified timeout expires
+  *(see also MQTTClient_yield()).
+  *
+  * <b>Important note:</b> The application must free() the memory allocated
+  * to the topic and the message when processing is complete (see
+  * MQTTClient_freeMessage()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTClient_create().
+  * @param topicName The address of a pointer to a topic. This function
+  * allocates the memory for the topic and returns it to the application
+  * by setting <i>topicName</i> to point to the topic.
+  * @param topicLen The length of the topic. If the return code from this
+  * function is ::MQTTCLIENT_TOPICNAME_TRUNCATED, the topic contains embedded
+  * NULL characters and the full topic should be retrieved by using
+  * <i>topicLen</i>.
+  * @param message The address of a pointer to the received message. This
+  * function allocates the memory for the message and returns it to the
+  * application by setting <i>message</i> to point to the received message.
+  * The pointer is set to NULL if the timeout expires.
+  * @param timeout The length of time to wait for a message in milliseconds.
+  * @return ::MQTTCLIENT_SUCCESS or ::MQTTCLIENT_TOPICNAME_TRUNCATED if a
+  * message is received. ::MQTTCLIENT_SUCCESS can also indicate that the
+  * timeout expired, in which case <i>message</i> is NULL. An error code is
+  * returned if there was a problem trying to receive a message.
+  */
+DLLExport int MQTTClient_receive(MQTTClient handle, char** topicName, int* topicLen, MQTTClient_message** message,
+		unsigned long timeout);
+
+/**
+  * This function frees memory allocated to an MQTT message, including the
+  * additional memory allocated to the message payload. The client application
+  * calls this function when the message has been fully processed. <b>Important
+  * note:</b> This function does not free the memory allocated to a message
+  * topic string. It is the responsibility of the client application to free
+  * this memory using the MQTTClient_free() library function.
+  * @param msg The address of a pointer to the ::MQTTClient_message structure
+  * to be freed.
+  */
+DLLExport void MQTTClient_freeMessage(MQTTClient_message** msg);
+
+/**
+  * This function frees memory allocated by the MQTT C client library, especially the
+  * topic name. This is needed on Windows when the client libary and application
+  * program have been compiled with different versions of the C compiler.  It is
+  * thus good policy to always use this function when freeing any MQTT C client-
+  * allocated memory.
+  * @param ptr The pointer to the client library storage to be freed.
+  */
+DLLExport void MQTTClient_free(void* ptr);
+
+/**
+  * This function frees the memory allocated to an MQTT client (see
+  * MQTTClient_create()). It should be called when the client is no longer
+  * required.
+  * @param handle A pointer to the handle referring to the ::MQTTClient
+  * structure to be freed.
+  */
+DLLExport void MQTTClient_destroy(MQTTClient* handle);
+
+#endif
+#ifdef __cplusplus
+     }
+#endif
+
+/**
+  * @cond MQTTClient_main
+  * @page async Asynchronous vs synchronous client applications
+  * The client library supports two modes of operation. These are referred to
+  * as <b>synchronous</b> and <b>asynchronous</b> modes. If your application
+  * calls MQTTClient_setCallbacks(), this puts the client into asynchronous
+  * mode, otherwise it operates in synchronous mode.
+  *
+  * In synchronous mode, the client application runs on a single thread.
+  * Messages are published using the MQTTClient_publish() and
+  * MQTTClient_publishMessage() functions. To determine that a QoS1 or QoS2
+  * (see @ref qos) message has been successfully delivered, the application
+  * must call the MQTTClient_waitForCompletion() function. An example showing
+  * synchronous publication is shown in @ref pubsync. Receiving messages in
+  * synchronous mode uses the MQTTClient_receive() function. Client applications
+  * must call either MQTTClient_receive() or MQTTClient_yield() relatively
+  * frequently in order to allow processing of acknowledgements and the MQTT
+  * "pings" that keep the network connection to the server alive.
+  *
+  * In asynchronous mode, the client application runs on several threads. The
+  * main program calls functions in the client library to publish and subscribe,
+  * just as for the synchronous mode. Processing of handshaking and maintaining
+  * the network connection is performed in the background, however.
+  * Notifications of status and message reception are provided to the client
+  * application using callbacks registered with the library by the call to
+  * MQTTClient_setCallbacks() (see MQTTClient_messageArrived(),
+  * MQTTClient_connectionLost() and MQTTClient_deliveryComplete()).
+  * This API is not thread safe however - it is not possible to call it from multiple
+  * threads without synchronization.  You can use the MQTTAsync API for that.
+  *
+  * @page wildcard Subscription wildcards
+  * Every MQTT message includes a topic that classifies it. MQTT servers use
+  * topics to determine which subscribers should receive messages published to
+  * the server.
+  *
+  * Consider the server receiving messages from several environmental sensors.
+  * Each sensor publishes its measurement data as a message with an associated
+  * topic. Subscribing applications need to know which sensor originally
+  * published each received message. A unique topic is thus used to identify
+  * each sensor and measurement type. Topics such as SENSOR1TEMP,
+  * SENSOR1HUMIDITY, SENSOR2TEMP and so on achieve this but are not very
+  * flexible. If additional sensors are added to the system at a later date,
+  * subscribing applications must be modified to receive them.
+  *
+  * To provide more flexibility, MQTT supports a hierarchical topic namespace.
+  * This allows application designers to organize topics to simplify their
+  * management. Levels in the hierarchy are delimited by the '/' character,
+  * such as SENSOR/1/HUMIDITY. Publishers and subscribers use these
+  * hierarchical topics as already described.
+  *
+  * For subscriptions, two wildcard characters are supported:
+  * <ul>
+  * <li>A '#' character represents a complete sub-tree of the hierarchy and
+  * thus must be the last character in a subscription topic string, such as
+  * SENSOR/#. This will match any topic starting with SENSOR/, such as
+  * SENSOR/1/TEMP and SENSOR/2/HUMIDITY.</li>
+  * <li> A '+' character represents a single level of the hierarchy and is
+  * used between delimiters. For example, SENSOR/+/TEMP will match
+  * SENSOR/1/TEMP and SENSOR/2/TEMP.</li>
+  * </ul>
+  * Publishers are not allowed to use the wildcard characters in their topic
+  * names.
+  *
+  * Deciding on your topic hierarchy is an important step in your system design.
+  *
+  * @page qos Quality of service
+  * The MQTT protocol provides three qualities of service for delivering
+  * messages between clients and servers: "at most once", "at least once" and
+  * "exactly once".
+  *
+  * Quality of service (QoS) is an attribute of an individual message being
+  * published. An application sets the QoS for a specific message by setting the
+  * MQTTClient_message.qos field to the required value.
+  *
+  * A subscribing client can set the maximum quality of service a server uses
+  * to send messages that match the client subscriptions. The
+  * MQTTClient_subscribe() and MQTTClient_subscribeMany() functions set this
+  * maximum. The QoS of a message forwarded to a subscriber thus might be
+  * different to the QoS given to the message by the original publisher.
+  * The lower of the two values is used to forward a message.
+  *
+  * The three levels are:
+  *
+  * <b>QoS0, At most once:</b> The message is delivered at most once, or it
+  * may not be delivered at all. Its delivery across the network is not
+  * acknowledged. The message is not stored. The message could be lost if the
+  * client is disconnected, or if the server fails. QoS0 is the fastest mode of
+  * transfer. It is sometimes called "fire and forget".
+  *
+  * The MQTT protocol does not require servers to forward publications at QoS0
+  * to a client. If the client is disconnected at the time the server receives
+  * the publication, the publication might be discarded, depending on the
+  * server implementation.
+  *
+  * <b>QoS1, At least once:</b> The message is always delivered at least once.
+  * It might be delivered multiple times if there is a failure before an
+  * acknowledgment is received by the sender. The message must be stored
+  * locally at the sender, until the sender receives confirmation that the
+  * message has been published by the receiver. The message is stored in case
+  * the message must be sent again.
+  *
+  * <b>QoS2, Exactly once:</b> The message is always delivered exactly once.
+  * The message must be stored locally at the sender, until the sender receives
+  * confirmation that the message has been published by the receiver. The
+  * message is stored in case the message must be sent again. QoS2 is the
+  * safest, but slowest mode of transfer. A more sophisticated handshaking
+  * and acknowledgement sequence is used than for QoS1 to ensure no duplication
+  * of messages occurs.
+  * @page pubsync Synchronous publication example
+@code
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTClient.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientPub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+int main(int argc, char* argv[])
+{
+    MQTTClient client;
+    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+    MQTTClient_message pubmsg = MQTTClient_message_initializer;
+    MQTTClient_deliveryToken token;
+    int rc;
+
+    MQTTClient_create(&client, ADDRESS, CLIENTID,
+        MQTTCLIENT_PERSISTENCE_NONE, NULL);
+    conn_opts.keepAliveInterval = 20;
+    conn_opts.cleansession = 1;
+
+    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
+    {
+        printf("Failed to connect, return code %d\n", rc);
+        exit(EXIT_FAILURE);
+    }
+    pubmsg.payload = PAYLOAD;
+    pubmsg.payloadlen = strlen(PAYLOAD);
+    pubmsg.qos = QOS;
+    pubmsg.retained = 0;
+    MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token);
+    printf("Waiting for up to %d seconds for publication of %s\n"
+            "on topic %s for client with ClientID: %s\n",
+            (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID);
+    rc = MQTTClient_waitForCompletion(client, token, TIMEOUT);
+    printf("Message with delivery token %d delivered\n", token);
+    MQTTClient_disconnect(client, 10000);
+    MQTTClient_destroy(&client);
+    return rc;
+}
+
+  * @endcode
+  *
+  * @page pubasync Asynchronous publication example
+@code{.c}
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTClient.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientPub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTClient_deliveryToken deliveredtoken;
+
+void delivered(void *context, MQTTClient_deliveryToken dt)
+{
+    printf("Message with token value %d delivery confirmed\n", dt);
+    deliveredtoken = dt;
+}
+
+int msgarrvd(void *context, char *topicName, int topicLen, MQTTClient_message *message)
+{
+    int i;
+    char* payloadptr;
+
+    printf("Message arrived\n");
+    printf("     topic: %s\n", topicName);
+    printf("   message: ");
+
+    payloadptr = message->payload;
+    for(i=0; i<message->payloadlen; i++)
+    {
+        putchar(*payloadptr++);
+    }
+    putchar('\n');
+    MQTTClient_freeMessage(&message);
+    MQTTClient_free(topicName);
+    return 1;
+}
+
+void connlost(void *context, char *cause)
+{
+    printf("\nConnection lost\n");
+    printf("     cause: %s\n", cause);
+}
+
+int main(int argc, char* argv[])
+{
+    MQTTClient client;
+    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+    MQTTClient_message pubmsg = MQTTClient_message_initializer;
+    MQTTClient_deliveryToken token;
+    int rc;
+
+    MQTTClient_create(&client, ADDRESS, CLIENTID,
+        MQTTCLIENT_PERSISTENCE_NONE, NULL);
+    conn_opts.keepAliveInterval = 20;
+    conn_opts.cleansession = 1;
+
+    MQTTClient_setCallbacks(client, NULL, connlost, msgarrvd, delivered);
+
+    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
+    {
+        printf("Failed to connect, return code %d\n", rc);
+        exit(EXIT_FAILURE);
+    }
+    pubmsg.payload = PAYLOAD;
+    pubmsg.payloadlen = strlen(PAYLOAD);
+    pubmsg.qos = QOS;
+    pubmsg.retained = 0;
+    deliveredtoken = 0;
+    MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token);
+    printf("Waiting for publication of %s\n"
+            "on topic %s for client with ClientID: %s\n",
+            PAYLOAD, TOPIC, CLIENTID);
+    while(deliveredtoken != token);
+    MQTTClient_disconnect(client, 10000);
+    MQTTClient_destroy(&client);
+    return rc;
+}
+
+  * @endcode
+  * @page subasync Asynchronous subscription example
+@code
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTClient.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientSub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTClient_deliveryToken deliveredtoken;
+
+void delivered(void *context, MQTTClient_deliveryToken dt)
+{
+    printf("Message with token value %d delivery confirmed\n", dt);
+    deliveredtoken = dt;
+}
+
+int msgarrvd(void *context, char *topicName, int topicLen, MQTTClient_message *message)
+{
+    int i;
+    char* payloadptr;
+
+    printf("Message arrived\n");
+    printf("     topic: %s\n", topicName);
+    printf("   message: ");
+
+    payloadptr = message->payload;
+    for(i=0; i<message->payloadlen; i++)
+    {
+        putchar(*payloadptr++);
+    }
+    putchar('\n');
+    MQTTClient_freeMessage(&message);
+    MQTTClient_free(topicName);
+    return 1;
+}
+
+void connlost(void *context, char *cause)
+{
+    printf("\nConnection lost\n");
+    printf("     cause: %s\n", cause);
+}
+
+int main(int argc, char* argv[])
+{
+    MQTTClient client;
+    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
+    int rc;
+    int ch;
+
+    MQTTClient_create(&client, ADDRESS, CLIENTID,
+        MQTTCLIENT_PERSISTENCE_NONE, NULL);
+    conn_opts.keepAliveInterval = 20;
+    conn_opts.cleansession = 1;
+
+    MQTTClient_setCallbacks(client, NULL, connlost, msgarrvd, delivered);
+
+    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
+    {
+        printf("Failed to connect, return code %d\n", rc);
+        exit(EXIT_FAILURE);
+    }
+    printf("Subscribing to topic %s\nfor client %s using QoS%d\n\n"
+           "Press Q<Enter> to quit\n\n", TOPIC, CLIENTID, QOS);
+    MQTTClient_subscribe(client, TOPIC, QOS);
+
+    do
+    {
+        ch = getchar();
+    } while(ch!='Q' && ch != 'q');
+
+    MQTTClient_disconnect(client, 10000);
+    MQTTClient_destroy(&client);
+    return rc;
+}
+
+  * @endcode
+  * @page tracing Tracing
+  *
+  * Runtime tracing is controlled by environment variables.
+  *
+  * Tracing is switched on by setting MQTT_C_CLIENT_TRACE.  A value of ON, or stdout, prints to
+  * stdout, any other value is interpreted as a file name to use.
+  *
+  * The amount of trace detail is controlled with the MQTT_C_CLIENT_TRACE_LEVEL environment
+  * variable - valid values are ERROR, PROTOCOL, MINIMUM, MEDIUM and MAXIMUM
+  * (from least to most verbose).
+  *
+  * The variable MQTT_C_CLIENT_TRACE_MAX_LINES limits the number of lines of trace that are output
+  * to a file.  Two files are used at most, when they are full, the last one is overwritten with the
+  * new trace entries.  The default size is 1000 lines.
+  *
+  * ### MQTT Packet Tracing
+  *
+  * A feature that can be very useful is printing the MQTT packets that are sent and received.  To
+  * achieve this, use the following environment variable settings:
+  * @code
+    MQTT_C_CLIENT_TRACE=ON
+    MQTT_C_CLIENT_TRACE_LEVEL=PROTOCOL
+  * @endcode
+  * The output you should see looks like this:
+  * @code
+    20130528 155936.813 3 stdout-subscriber -> CONNECT cleansession: 1 (0)
+    20130528 155936.813 3 stdout-subscriber <- CONNACK rc: 0
+    20130528 155936.813 3 stdout-subscriber -> SUBSCRIBE msgid: 1 (0)
+    20130528 155936.813 3 stdout-subscriber <- SUBACK msgid: 1
+    20130528 155941.818 3 stdout-subscriber -> DISCONNECT (0)
+  * @endcode
+  * where the fields are:
+  * 1. date
+  * 2. time
+  * 3. socket number
+  * 4. client id
+  * 5. direction (-> from client to server, <- from server to client)
+  * 6. packet details
+  *
+  * ### Default Level Tracing
+  *
+  * This is an extract of a default level trace of a call to connect:
+  * @code
+    19700101 010000.000 (1152206656) (0)> MQTTClient_connect:893
+    19700101 010000.000 (1152206656)  (1)> MQTTClient_connectURI:716
+    20130528 160447.479 Connecting to serverURI localhost:1883
+    20130528 160447.479 (1152206656)   (2)> MQTTProtocol_connect:98
+    20130528 160447.479 (1152206656)    (3)> MQTTProtocol_addressPort:48
+    20130528 160447.479 (1152206656)    (3)< MQTTProtocol_addressPort:73
+    20130528 160447.479 (1152206656)    (3)> Socket_new:599
+    20130528 160447.479 New socket 4 for localhost, port 1883
+    20130528 160447.479 (1152206656)     (4)> Socket_addSocket:163
+    20130528 160447.479 (1152206656)      (5)> Socket_setnonblocking:73
+    20130528 160447.479 (1152206656)      (5)< Socket_setnonblocking:78 (0)
+    20130528 160447.479 (1152206656)     (4)< Socket_addSocket:176 (0)
+    20130528 160447.479 (1152206656)     (4)> Socket_error:95
+    20130528 160447.479 (1152206656)     (4)< Socket_error:104 (115)
+    20130528 160447.479 Connect pending
+    20130528 160447.479 (1152206656)    (3)< Socket_new:683 (115)
+    20130528 160447.479 (1152206656)   (2)< MQTTProtocol_connect:131 (115)
+  * @endcode
+  * where the fields are:
+  * 1. date
+  * 2. time
+  * 3. thread id
+  * 4. function nesting level
+  * 5. function entry (>) or exit (<)
+  * 6. function name : line of source code file
+  * 7. return value (if there is one)
+  *
+  * ### Memory Allocation Tracing
+  *
+  * Setting the trace level to maximum causes memory allocations and frees to be traced along with
+  * the default trace entries, with messages like the following:
+  * @code
+    20130528 161819.657 Allocating 16 bytes in heap at file /home/icraggs/workspaces/mqrtc/mqttv3c/src/MQTTPacket.c line 177 ptr 0x179f930
+
+    20130528 161819.657 Freeing 16 bytes in heap at file /home/icraggs/workspaces/mqrtc/mqttv3c/src/MQTTPacket.c line 201, heap use now 896 bytes
+  * @endcode
+  * When the last MQTT client object is destroyed, if the trace is being recorded
+  * and all memory allocated by the client library has not been freed, an error message will be
+  * written to the trace.  This can help with fixing memory leaks.  The message will look like this:
+  * @code
+    20130528 163909.208 Some memory not freed at shutdown, possible memory leak
+    20130528 163909.208 Heap scan start, total 880 bytes
+    20130528 163909.208 Heap element size 32, line 354, file /home/icraggs/workspaces/mqrtc/mqttv3c/src/MQTTPacket.c, ptr 0x260cb00
+    20130528 163909.208   Content
+    20130528 163909.209 Heap scan end
+  * @endcode
+  * @endcond
+  */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTClientPersistence.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTClientPersistence.h b/thirdparty/paho.mqtt.c/src/MQTTClientPersistence.h
new file mode 100644
index 0000000..4c9014d
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTClientPersistence.h
@@ -0,0 +1,254 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2012 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief This structure represents a persistent data store, used to store 
+ * outbound and inbound messages, in order to achieve reliable messaging.
+ *
+ * The MQTT Client persists QoS1 and QoS2 messages in order to meet the
+ * assurances of delivery associated with these @ref qos levels. The messages 
+ * are saved in persistent storage
+ * The type and context of the persistence implementation are specified when 
+ * the MQTT client is created (see MQTTClient_create()). The default 
+ * persistence type (::MQTTCLIENT_PERSISTENCE_DEFAULT) uses a file system-based
+ * persistence mechanism. The <i>persistence_context</i> argument passed to 
+ * MQTTClient_create() when using the default peristence is a string 
+ * representing the location of the persistence directory. If the context 
+ * argument is NULL, the working directory will be used. 
+ *
+ * To use memory-based persistence, an application passes 
+ * ::MQTTCLIENT_PERSISTENCE_NONE as the <i>persistence_type</i> to 
+ * MQTTClient_create(). This can lead to message loss in certain situations, 
+ * but can be appropriate in some cases (see @ref qos).
+ *
+ * Client applications can provide their own persistence mechanism by passing
+ * ::MQTTCLIENT_PERSISTENCE_USER as the <i>persistence_type</i>. To implement a
+ * custom persistence mechanism, the application must pass an initialized
+ * ::MQTTClient_persistence structure as the <i>persistence_context</i> 
+ * argument to MQTTClient_create().
+ *
+ * If the functions defined return an ::MQTTCLIENT_PERSISTENCE_ERROR then the 
+ * state of the persisted data should remain as it was prior to the function 
+ * being called. For example, if Persistence_put() returns 
+ * ::MQTTCLIENT_PERSISTENCE_ERROR, then it is assumed tha tthe persistent store
+ * does not contain the data that was passed to the function. Similarly,  if 
+ * Persistence_remove() returns ::MQTTCLIENT_PERSISTENCE_ERROR then it is 
+ * assumed that the data to be removed is still held in the persistent store.
+ *
+ * It is up to the persistence implementation to log any error information that
+ * may be required to diagnose a persistence mechanism failure.
+ */
+
+/*
+/// @cond EXCLUDE
+*/
+#if !defined(MQTTCLIENTPERSISTENCE_H)
+#define MQTTCLIENTPERSISTENCE_H
+/*
+/// @endcond
+*/
+
+/**
+  * This <i>persistence_type</i> value specifies the default file system-based 
+  * persistence mechanism (see MQTTClient_create()).
+  */
+#define MQTTCLIENT_PERSISTENCE_DEFAULT 0
+/**
+  * This <i>persistence_type</i> value specifies a memory-based 
+  * persistence mechanism (see MQTTClient_create()).
+  */
+#define MQTTCLIENT_PERSISTENCE_NONE 1
+/**
+  * This <i>persistence_type</i> value specifies an application-specific 
+  * persistence mechanism (see MQTTClient_create()).
+  */
+#define MQTTCLIENT_PERSISTENCE_USER 2
+
+/** 
+  * Application-specific persistence functions must return this error code if 
+  * there is a problem executing the function. 
+  */
+#define MQTTCLIENT_PERSISTENCE_ERROR -2
+
+/**
+  * @brief Initialize the persistent store.
+  * 
+  * Either open the existing persistent store for this client ID or create a new
+  * one if one doesn't exist. If the persistent store is already open, return 
+  * without taking any action.
+  *
+  * An application can use the same client identifier to connect to many
+  * different servers. The <i>clientid</i> in conjunction with the 
+  * <i>serverURI</i> uniquely identifies the persistence store required.
+  *
+  * @param handle The address of a pointer to a handle for this persistence 
+  * implementation. This function must set handle to a valid reference to the 
+  * persistence following a successful return. 
+  * The handle pointer is passed as an argument to all the other
+  * persistence functions. It may include the context parameter and/or any other
+  * data for use by the persistence functions.
+  * @param clientID The client identifier for which the persistent store should 
+  * be opened.
+  * @param serverURI The connection string specified when the MQTT client was
+  * created (see MQTTClient_create()).
+  * @param context A pointer to any data required to initialize the persistent
+  * store (see ::MQTTClient_persistence).
+  * @return Return 0 if the function completes successfully, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_open)(void** handle, const char* clientID, const char* serverURI, void* context);
+
+/**
+  * @brief Close the persistent store referred to by the handle.
+  *
+  * @param handle The handle pointer from a successful call to 
+  * Persistence_open().
+  * @return Return 0 if the function completes successfully, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_close)(void* handle); 
+
+/**
+  * @brief Put the specified data into the persistent store.
+  *
+  * @param handle The handle pointer from a successful call to 
+  * Persistence_open().
+  * @param key A string used as the key for the data to be put in the store. The
+  * key is later used to retrieve data from the store with Persistence_get().
+  * @param bufcount The number of buffers to write to the persistence store.
+  * @param buffers An array of pointers to the data buffers associated with 
+  * this <i>key</i>.
+  * @param buflens An array of lengths of the data buffers. <i>buflen[n]</i> 
+  * gives the length of <i>buffer[n]</i>.
+  * @return Return 0 if the function completes successfully, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_put)(void* handle, char* key, int bufcount, char* buffers[], int buflens[]);
+
+/**
+  * @brief Retrieve the specified data from the persistent store. 
+  *
+  * @param handle The handle pointer from a successful call to 
+  * Persistence_open().
+  * @param key A string that is the key for the data to be retrieved. This is 
+  * the same key used to save the data to the store with Persistence_put().
+  * @param buffer The address of a pointer to a buffer. This function sets the
+  * pointer to point at the retrieved data, if successful.
+  * @param buflen The address of an int that is set to the length of 
+  * <i>buffer</i> by this function if successful.
+  * @return Return 0 if the function completes successfully, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_get)(void* handle, char* key, char** buffer, int* buflen);
+
+/**
+  * @brief Remove the data for the specified key from the store.
+  *
+  * @param handle The handle pointer from a successful call to 
+  * Persistence_open().
+  * @param key A string that is the key for the data to be removed from the
+  * store. This is the same key used to save the data to the store with 
+  * Persistence_put().
+  * @return Return 0 if the function completes successfully, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_remove)(void* handle, char* key);
+
+/**
+  * @brief Returns the keys in this persistent data store.
+  *
+  * @param handle The handle pointer from a successful call to 
+  * Persistence_open().
+  * @param keys The address of a pointer to pointers to strings. Assuming
+  * successful execution, this function allocates memory to hold the returned
+  * keys (strings used to store the data with Persistence_put()). It also 
+  * allocates memory to hold an array of pointers to these strings. <i>keys</i>
+  * is set to point to the array of pointers to strings.
+  * @param nkeys A pointer to the number of keys in this persistent data store. 
+  * This function sets the number of keys, if successful.
+  * @return Return 0 if the function completes successfully, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_keys)(void* handle, char*** keys, int* nkeys);
+
+/**
+  * @brief Clears the persistence store, so that it no longer contains any 
+  * persisted data.
+  *
+  * @param handle The handle pointer from a successful call to 
+  * Persistence_open().
+  * @return Return 0 if the function completes successfully, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_clear)(void* handle);
+
+/**
+  * @brief Returns whether any data has been persisted using the specified key.
+  *
+  * @param handle The handle pointer from a successful call to 
+  * Persistence_open().
+  * @param key The string to be tested for existence in the store.
+  * @return Return 0 if the key was found in the store, otherwise return
+  * ::MQTTCLIENT_PERSISTENCE_ERROR.
+  */
+typedef int (*Persistence_containskey)(void* handle, char* key);
+
+/**
+  * @brief A structure containing the function pointers to a persistence 
+  * implementation and the context or state that will be shared across all 
+  * the persistence functions.
+  */
+typedef struct {
+  /** 
+    * A pointer to any data required to initialize the persistent store.
+    */
+	void* context;
+  /** 
+    * A function pointer to an implementation of Persistence_open().
+    */
+	Persistence_open popen;
+  /** 
+    * A function pointer to an implementation of Persistence_close().
+    */
+	Persistence_close pclose;
+  /**
+    * A function pointer to an implementation of Persistence_put().
+    */
+	Persistence_put pput;
+  /** 
+    * A function pointer to an implementation of Persistence_get().
+    */
+	Persistence_get pget;
+  /** 
+    * A function pointer to an implementation of Persistence_remove().
+    */
+	Persistence_remove premove;
+  /** 
+    * A function pointer to an implementation of Persistence_keys().
+    */
+	Persistence_keys pkeys;
+  /** 
+    * A function pointer to an implementation of Persistence_clear().
+    */
+	Persistence_clear pclear;
+  /** 
+    * A function pointer to an implementation of Persistence_containskey().
+    */
+	Persistence_containskey pcontainskey;
+} MQTTClient_persistence;
+
+#endif


[11/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal
new file mode 100644
index 0000000..5823639
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal
@@ -0,0 +1,1851 @@
+# Doxyfile 1.8.1.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "MQTT C Client Libraries Internals"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = "../doc/pahologo.png"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = "../build/output/doc/MQTTClient_internal/"
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = MQTTClient_internal
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = "."
+
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          = *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.f90 \
+                         *.f \
+                         *.vhd \
+                         *.vhdl \
+                         *.C \
+                         *.CC \
+                         *.C++ \
+                         *.II \
+                         *.I++ \
+                         *.H \
+                         *.HH \
+                         *.H++ \
+                         *.CS \
+                         *.PHP \
+                         *.PHP3 \
+                         *.M \
+                         *.MM \
+                         *.PY \
+                         *.F90 \
+                         *.F \
+                         *.VHD \
+                         *.VHDL \
+                         *.c
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = NONE
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 1000
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES


[12/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI.in
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI.in b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI.in
new file mode 100644
index 0000000..482542f
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI.in
@@ -0,0 +1,1804 @@
+# Doxyfile 1.8.1.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "Paho MQTT C Client Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = "@PROJECT_SOURCE_DIR@/doc/pahologo.png"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = "@CMAKE_CURRENT_BINARY_DIR@/doc/MQTTClient/"
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        = /Users/dimitri/doxygen/mail/1.5.7/doxywizard/
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = MQTTClient_main
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+STRIP_FROM_PATH        = @PROJECT_SOURCE_DIR@/src
+INPUT                  = @PROJECT_SOURCE_DIR@/src/MQTTClient.h \
+                         @PROJECT_SOURCE_DIR@/src/MQTTClientPersistence.h
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = NONE
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             = __attribute__(x)=
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES


[07/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTAsync.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTAsync.h b/thirdparty/paho.mqtt.c/src/MQTTAsync.h
new file mode 100644
index 0000000..e124b9e
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTAsync.h
@@ -0,0 +1,1728 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL connections
+ *    Ian Craggs - multiple server connection support
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Ian Craggs - fix for bug 444103 - success/failure callbacks not invoked
+ *    Ian Craggs - automatic reconnect and offline buffering (send while disconnected)
+ *    Ian Craggs - binary will message
+ *    Ian Craggs - binary password
+ *    Ian Craggs - remove const on eyecatchers #168
+ *******************************************************************************/
+
+/********************************************************************/
+
+/**
+ * @cond MQTTAsync_main
+ * @mainpage Asynchronous MQTT client library for C
+ *
+ * &copy; Copyright IBM Corp. 2009, 2017
+ *
+ * @brief An Asynchronous MQTT client library for C.
+ *
+ * An MQTT client application connects to MQTT-capable servers.
+ * A typical client is responsible for collecting information from a telemetry
+ * device and publishing the information to the server. It can also subscribe
+ * to topics, receive messages, and use this information to control the
+ * telemetry device.
+ *
+ * MQTT clients implement the published MQTT v3 protocol. You can write your own
+ * API to the MQTT protocol using the programming language and platform of your
+ * choice. This can be time-consuming and error-prone.
+ *
+ * To simplify writing MQTT client applications, this library encapsulates
+ * the MQTT v3 protocol for you. Using this library enables a fully functional
+ * MQTT client application to be written in a few lines of code.
+ * The information presented here documents the API provided
+ * by the Asynchronous MQTT Client library for C.
+ *
+ * <b>Using the client</b><br>
+ * Applications that use the client library typically use a similar structure:
+ * <ul>
+ * <li>Create a client object</li>
+ * <li>Set the options to connect to an MQTT server</li>
+ * <li>Set up callback functions</li>
+ * <li>Connect the client to an MQTT server</li>
+ * <li>Subscribe to any topics the client needs to receive</li>
+ * <li>Repeat until finished:</li>
+ *     <ul>
+ *     <li>Publish any messages the client needs to</li>
+ *     <li>Handle any incoming messages</li>
+ *     </ul>
+ * <li>Disconnect the client</li>
+ * <li>Free any memory being used by the client</li>
+ * </ul>
+ * Some simple examples are shown here:
+ * <ul>
+ * <li>@ref publish</li>
+ * <li>@ref subscribe</li>
+ * </ul>
+ * Additional information about important concepts is provided here:
+ * <ul>
+ * <li>@ref async</li>
+ * <li>@ref wildcard</li>
+ * <li>@ref qos</li>
+ * <li>@ref tracing</li>
+ * <li>@ref auto_reconnect</li>
+ * <li>@ref offline_publish</li>
+ * </ul>
+ * @endcond
+ */
+
+
+/*
+/// @cond EXCLUDE
+*/
+#if defined(__cplusplus)
+ extern "C" {
+#endif
+
+#if !defined(MQTTASYNC_H)
+#define MQTTASYNC_H
+
+#if defined(WIN32) || defined(WIN64)
+  #define DLLImport __declspec(dllimport)
+  #define DLLExport __declspec(dllexport)
+#else
+  #define DLLImport extern
+  #define DLLExport  __attribute__ ((visibility ("default")))
+#endif
+
+#include <stdio.h>
+/*
+/// @endcond
+*/
+
+#if !defined(NO_PERSISTENCE)
+#include "MQTTClientPersistence.h"
+#endif
+
+/**
+ * Return code: No error. Indicates successful completion of an MQTT client
+ * operation.
+ */
+#define MQTTASYNC_SUCCESS 0
+/**
+ * Return code: A generic error code indicating the failure of an MQTT client
+ * operation.
+ */
+#define MQTTASYNC_FAILURE -1
+
+/* error code -2 is MQTTAsync_PERSISTENCE_ERROR */
+
+#define MQTTASYNC_PERSISTENCE_ERROR -2
+
+/**
+ * Return code: The client is disconnected.
+ */
+#define MQTTASYNC_DISCONNECTED -3
+/**
+ * Return code: The maximum number of messages allowed to be simultaneously
+ * in-flight has been reached.
+ */
+#define MQTTASYNC_MAX_MESSAGES_INFLIGHT -4
+/**
+ * Return code: An invalid UTF-8 string has been detected.
+ */
+#define MQTTASYNC_BAD_UTF8_STRING -5
+/**
+ * Return code: A NULL parameter has been supplied when this is invalid.
+ */
+#define MQTTASYNC_NULL_PARAMETER -6
+/**
+ * Return code: The topic has been truncated (the topic string includes
+ * embedded NULL characters). String functions will not access the full topic.
+ * Use the topic length value to access the full topic.
+ */
+#define MQTTASYNC_TOPICNAME_TRUNCATED -7
+/**
+ * Return code: A structure parameter does not have the correct eyecatcher
+ * and version number.
+ */
+#define MQTTASYNC_BAD_STRUCTURE -8
+/**
+ * Return code: A qos parameter is not 0, 1 or 2
+ */
+#define MQTTASYNC_BAD_QOS -9
+/**
+ * Return code: All 65535 MQTT msgids are being used
+ */
+#define MQTTASYNC_NO_MORE_MSGIDS -10
+/**
+ * Return code: the request is being discarded when not complete
+ */
+#define MQTTASYNC_OPERATION_INCOMPLETE -11
+/**
+ * Return code: no more messages can be buffered
+ */
+#define MQTTASYNC_MAX_BUFFERED_MESSAGES -12
+/**
+ * Return code: Attempting SSL connection using non-SSL version of library
+ */
+#define MQTTASYNC_SSL_NOT_SUPPORTED -13
+
+/**
+ * Default MQTT version to connect with.  Use 3.1.1 then fall back to 3.1
+ */
+#define MQTTVERSION_DEFAULT 0
+/**
+ * MQTT version to connect with: 3.1
+ */
+#define MQTTVERSION_3_1 3
+/**
+ * MQTT version to connect with: 3.1.1
+ */
+#define MQTTVERSION_3_1_1 4
+/**
+ * Bad return code from subscribe, as defined in the 3.1.1 specification
+ */
+#define MQTT_BAD_SUBSCRIBE 0x80
+
+
+/**
+ *  Initialization options
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  Must be MQTG. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 */
+	int struct_version;
+	/** 1 = we do openssl init, 0 = leave it to the application */
+	int do_openssl_init;
+} MQTTAsync_init_options;
+
+#define MQTTAsync_init_options_initializer { {'M', 'Q', 'T', 'G'}, 0, 0 }
+
+/**
+ * Global init of mqtt library. Call once on program start to set global behaviour.
+ * handle_openssl_init - if mqtt library should handle openssl init (1) or rely on the caller to init it before using mqtt (0)
+ */
+DLLExport void MQTTAsync_global_init(MQTTAsync_init_options* inits);
+
+/**
+ * A handle representing an MQTT client. A valid client handle is available
+ * following a successful call to MQTTAsync_create().
+ */
+typedef void* MQTTAsync;
+/**
+ * A value representing an MQTT message. A token is returned to the
+ * client application when a message is published. The token can then be used to
+ * check that the message was successfully delivered to its destination (see
+ * MQTTAsync_publish(),
+ * MQTTAsync_publishMessage(),
+ * MQTTAsync_deliveryComplete(), and
+ * MQTTAsync_getPendingTokens()).
+ */
+typedef int MQTTAsync_token;
+
+/**
+ * A structure representing the payload and attributes of an MQTT message. The
+ * message topic is not part of this structure (see MQTTAsync_publishMessage(),
+ * MQTTAsync_publish(), MQTTAsync_receive(), MQTTAsync_freeMessage()
+ * and MQTTAsync_messageArrived()).
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  must be MQTM. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 */
+	int struct_version;
+	/** The length of the MQTT message payload in bytes. */
+	int payloadlen;
+	/** A pointer to the payload of the MQTT message. */
+	void* payload;
+	/**
+     * The quality of service (QoS) assigned to the message.
+     * There are three levels of QoS:
+     * <DL>
+     * <DT><B>QoS0</B></DT>
+     * <DD>Fire and forget - the message may not be delivered</DD>
+     * <DT><B>QoS1</B></DT>
+     * <DD>At least once - the message will be delivered, but may be
+     * delivered more than once in some circumstances.</DD>
+     * <DT><B>QoS2</B></DT>
+     * <DD>Once and one only - the message will be delivered exactly once.</DD>
+     * </DL>
+     */
+	int qos;
+	/**
+     * The retained flag serves two purposes depending on whether the message
+     * it is associated with is being published or received.
+     *
+     * <b>retained = true</b><br>
+     * For messages being published, a true setting indicates that the MQTT
+     * server should retain a copy of the message. The message will then be
+     * transmitted to new subscribers to a topic that matches the message topic.
+     * For subscribers registering a new subscription, the flag being true
+     * indicates that the received message is not a new one, but one that has
+     * been retained by the MQTT server.
+     *
+     * <b>retained = false</b> <br>
+     * For publishers, this ndicates that this message should not be retained
+     * by the MQTT server. For subscribers, a false setting indicates this is
+     * a normal message, received as a result of it being published to the
+     * server.
+     */
+	int retained;
+	/**
+      * The dup flag indicates whether or not this message is a duplicate.
+      * It is only meaningful when receiving QoS1 messages. When true, the
+      * client application should take appropriate action to deal with the
+      * duplicate message.
+      */
+	int dup;
+	/** The message identifier is normally reserved for internal use by the
+      * MQTT client and server.
+      */
+	int msgid;
+} MQTTAsync_message;
+
+#define MQTTAsync_message_initializer { {'M', 'Q', 'T', 'M'}, 0, 0, NULL, 0, 0, 0, 0 }
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * receipt of messages. The function is registered with the client library by
+ * passing it as an argument to MQTTAsync_setCallbacks(). It is
+ * called by the client library when a new message that matches a client
+ * subscription has been received from the server. This function is executed on
+ * a separate thread to the one on which the client application is running.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * MQTTAsync_setCallbacks(), which contains any application-specific context.
+ * @param topicName The topic associated with the received message.
+ * @param topicLen The length of the topic if there are one
+ * more NULL characters embedded in <i>topicName</i>, otherwise <i>topicLen</i>
+ * is 0. If <i>topicLen</i> is 0, the value returned by <i>strlen(topicName)</i>
+ * can be trusted. If <i>topicLen</i> is greater than 0, the full topic name
+ * can be retrieved by accessing <i>topicName</i> as a byte array of length
+ * <i>topicLen</i>.
+ * @param message The MQTTAsync_message structure for the received message.
+ * This structure contains the message payload and attributes.
+ * @return This function must return a boolean value indicating whether or not
+ * the message has been safely received by the client application. Returning
+ * true indicates that the message has been successfully handled.
+ * Returning false indicates that there was a problem. In this
+ * case, the client library will reinvoke MQTTAsync_messageArrived() to
+ * attempt to deliver the message to the application again.
+ */
+typedef int MQTTAsync_messageArrived(void* context, char* topicName, int topicLen, MQTTAsync_message* message);
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * notification of delivery of messages to the server. The function is
+ * registered with the client library by passing it as an argument to MQTTAsync_setCallbacks().
+ * It is called by the client library after the client application has
+ * published a message to the server. It indicates that the necessary
+ * handshaking and acknowledgements for the requested quality of service (see
+ * MQTTAsync_message.qos) have been completed. This function is executed on a
+ * separate thread to the one on which the client application is running.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * MQTTAsync_setCallbacks(), which contains any application-specific context.
+ * @param token The ::MQTTAsync_token associated with
+ * the published message. Applications can check that all messages have been
+ * correctly published by matching the tokens returned from calls to
+ * MQTTAsync_send() and MQTTAsync_sendMessage() with the tokens passed
+ * to this callback.
+ */
+typedef void MQTTAsync_deliveryComplete(void* context, MQTTAsync_token token);
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * notification of the loss of connection to the server. The function is
+ * registered with the client library by passing it as an argument to
+ * MQTTAsync_setCallbacks(). It is called by the client library if the client
+ * loses its connection to the server. The client application must take
+ * appropriate action, such as trying to reconnect or reporting the problem.
+ * This function is executed on a separate thread to the one on which the
+ * client application is running.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * MQTTAsync_setCallbacks(), which contains any application-specific context.
+ * @param cause The reason for the disconnection.
+ * Currently, <i>cause</i> is always set to NULL.
+ */
+typedef void MQTTAsync_connectionLost(void* context, char* cause);
+
+
+/**
+ * This is a callback function, which will be called when the client
+ * library successfully connects.  This is superfluous when the connection
+ * is made in response to a MQTTAsync_connect call, because the onSuccess
+ * callback can be used.  It is intended for use when automatic reconnect
+ * is enabled, so that when a reconnection attempt succeeds in the background,
+ * the application is notified and can take any required actions.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * MQTTAsync_setCallbacks(), which contains any application-specific context.
+ * @param cause The reason for the disconnection.
+ * Currently, <i>cause</i> is always set to NULL.
+ */
+typedef void MQTTAsync_connected(void* context, char* cause);
+
+
+
+/** The data returned on completion of an unsuccessful API call in the response callback onFailure. */
+typedef struct
+{
+	/** A token identifying the failed request. */
+	MQTTAsync_token token;
+	/** A numeric code identifying the error. */
+	int code;
+	/** Optional text explaining the error. Can be NULL. */
+	const char *message;
+} MQTTAsync_failureData;
+
+/** The data returned on completion of a successful API call in the response callback onSuccess. */
+typedef struct
+{
+	/** A token identifying the successful request. Can be used to refer to the request later. */
+	MQTTAsync_token token;
+	/** A union of the different values that can be returned for subscribe, unsubscribe and publish. */
+	union
+	{
+		/** For subscribe, the granted QoS of the subscription returned by the server. */
+		int qos;
+		/** For subscribeMany, the list of granted QoSs of the subscriptions returned by the server. */
+		int* qosList;
+		/** For publish, the message being sent to the server. */
+		struct
+		{
+			MQTTAsync_message message;
+			char* destinationName;
+		} pub;
+		/* For connect, the server connected to, MQTT version used, and sessionPresent flag */
+		struct
+		{
+			char* serverURI;
+			int MQTTVersion;
+			int sessionPresent;
+		} connect;
+	} alt;
+} MQTTAsync_successData;
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * notification of the successful completion of an API call. The function is
+ * registered with the client library by passing it as an argument in
+ * ::MQTTAsync_responseOptions.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * ::MQTTAsync_responseOptions, which contains any application-specific context.
+ * @param response Any success data associated with the API completion.
+ */
+typedef void MQTTAsync_onSuccess(void* context, MQTTAsync_successData* response);
+
+/**
+ * This is a callback function. The client application
+ * must provide an implementation of this function to enable asynchronous
+ * notification of the unsuccessful completion of an API call. The function is
+ * registered with the client library by passing it as an argument in
+ * ::MQTTAsync_responseOptions.
+ * @param context A pointer to the <i>context</i> value originally passed to
+ * ::MQTTAsync_responseOptions, which contains any application-specific context.
+ * @param response Any failure data associated with the API completion.
+ */
+typedef void MQTTAsync_onFailure(void* context,  MQTTAsync_failureData* response);
+
+typedef struct
+{
+	/** The eyecatcher for this structure.  Must be MQTR */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 */
+	int struct_version;
+	/**
+    * A pointer to a callback function to be called if the API call successfully
+    * completes.  Can be set to NULL, in which case no indication of successful
+    * completion will be received.
+    */
+	MQTTAsync_onSuccess* onSuccess;
+	/**
+    * A pointer to a callback function to be called if the API call fails.
+    * Can be set to NULL, in which case no indication of unsuccessful
+    * completion will be received.
+    */
+	MQTTAsync_onFailure* onFailure;
+	/**
+	* A pointer to any application-specific context. The
+    * the <i>context</i> pointer is passed to success or failure callback functions to
+    * provide access to the context information in the callback.
+    */
+	void* context;
+	MQTTAsync_token token;   /* output */
+} MQTTAsync_responseOptions;
+
+#define MQTTAsync_responseOptions_initializer { {'M', 'Q', 'T', 'R'}, 0, NULL, NULL, 0, 0 }
+
+
+/**
+ * This function sets the global callback functions for a specific client.
+ * If your client application doesn't use a particular callback, set the
+ * relevant parameter to NULL. Any necessary message acknowledgements and
+ * status communications are handled in the background without any intervention
+ * from the client application.  If you do not set a messageArrived callback
+ * function, you will not be notified of the receipt of any messages as a
+ * result of a subscription.
+ *
+ * <b>Note:</b> The MQTT client must be disconnected when this function is
+ * called.
+ * @param handle A valid client handle from a successful call to
+ * MQTTAsync_create().
+ * @param context A pointer to any application-specific context. The
+ * the <i>context</i> pointer is passed to each of the callback functions to
+ * provide access to the context information in the callback.
+ * @param cl A pointer to an MQTTAsync_connectionLost() callback
+ * function. You can set this to NULL if your application doesn't handle
+ * disconnections.
+ * @param ma A pointer to an MQTTAsync_messageArrived() callback
+ * function.  You can set this to NULL if your application doesn't handle
+ * receipt of messages.
+ * @param dc A pointer to an MQTTAsync_deliveryComplete() callback
+ * function. You can set this to NULL if you do not want to check
+ * for successful delivery.
+ * @return ::MQTTASYNC_SUCCESS if the callbacks were correctly set,
+ * ::MQTTASYNC_FAILURE if an error occurred.
+ */
+DLLExport int MQTTAsync_setCallbacks(MQTTAsync handle, void* context, MQTTAsync_connectionLost* cl,
+									MQTTAsync_messageArrived* ma, MQTTAsync_deliveryComplete* dc);
+
+
+/**
+ * Sets the MQTTAsync_connected() callback function for a client.
+ * @param handle A valid client handle from a successful call to
+ * MQTTAsync_create().
+ * @param context A pointer to any application-specific context. The
+ * the <i>context</i> pointer is passed to each of the callback functions to
+ * provide access to the context information in the callback.
+ * @param co A pointer to an MQTTAsync_connected() callback
+ * function.  NULL removes the callback setting.
+ * @return ::MQTTASYNC_SUCCESS if the callbacks were correctly set,
+ * ::MQTTASYNC_FAILURE if an error occurred.
+ */
+DLLExport int MQTTAsync_setConnected(MQTTAsync handle, void* context, MQTTAsync_connected* co);
+
+
+/**
+ * Reconnects a client with the previously used connect options.  Connect
+ * must have previously been called for this to work.
+ * @param handle A valid client handle from a successful call to
+ * MQTTAsync_create().
+ * @return ::MQTTASYNC_SUCCESS if the callbacks were correctly set,
+ * ::MQTTASYNC_FAILURE if an error occurred.
+ */
+DLLExport int MQTTAsync_reconnect(MQTTAsync handle);
+
+
+/**
+ * This function creates an MQTT client ready for connection to the
+ * specified server and using the specified persistent storage (see
+ * MQTTAsync_persistence). See also MQTTAsync_destroy().
+ * @param handle A pointer to an ::MQTTAsync handle. The handle is
+ * populated with a valid client reference following a successful return from
+ * this function.
+ * @param serverURI A null-terminated string specifying the server to
+ * which the client will connect. It takes the form <i>protocol://host:port</i>.
+ * <i>protocol</i> must be <i>tcp</i> or <i>ssl</i>. For <i>host</i>, you can
+ * specify either an IP address or a host name. For instance, to connect to
+ * a server running on the local machines with the default MQTT port, specify
+ * <i>tcp://localhost:1883</i>.
+ * @param clientId The client identifier passed to the server when the
+ * client connects to it. It is a null-terminated UTF-8 encoded string.
+ * @param persistence_type The type of persistence to be used by the client:
+ * <br>
+ * ::MQTTCLIENT_PERSISTENCE_NONE: Use in-memory persistence. If the device or
+ * system on which the client is running fails or is switched off, the current
+ * state of any in-flight messages is lost and some messages may not be
+ * delivered even at QoS1 and QoS2.
+ * <br>
+ * ::MQTTCLIENT_PERSISTENCE_DEFAULT: Use the default (file system-based)
+ * persistence mechanism. Status about in-flight messages is held in persistent
+ * storage and provides some protection against message loss in the case of
+ * unexpected failure.
+ * <br>
+ * ::MQTTCLIENT_PERSISTENCE_USER: Use an application-specific persistence
+ * implementation. Using this type of persistence gives control of the
+ * persistence mechanism to the application. The application has to implement
+ * the MQTTClient_persistence interface.
+ * @param persistence_context If the application uses
+ * ::MQTTCLIENT_PERSISTENCE_NONE persistence, this argument is unused and should
+ * be set to NULL. For ::MQTTCLIENT_PERSISTENCE_DEFAULT persistence, it
+ * should be set to the location of the persistence directory (if set
+ * to NULL, the persistence directory used is the working directory).
+ * Applications that use ::MQTTCLIENT_PERSISTENCE_USER persistence set this
+ * argument to point to a valid MQTTClient_persistence structure.
+ * @return ::MQTTASYNC_SUCCESS if the client is successfully created, otherwise
+ * an error code is returned.
+ */
+DLLExport int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
+		int persistence_type, void* persistence_context);
+
+typedef struct
+{
+	/** The eyecatcher for this structure.  must be MQCO. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 */
+	int struct_version;
+	/** Whether to allow messages to be sent when the client library is not connected. */
+	int sendWhileDisconnected;
+	/** the maximum number of messages allowed to be buffered while not connected. */
+	int maxBufferedMessages;
+} MQTTAsync_createOptions;
+
+#define MQTTAsync_createOptions_initializer { {'M', 'Q', 'C', 'O'}, 0, 0, 100 }
+
+
+DLLExport int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
+		int persistence_type, void* persistence_context, MQTTAsync_createOptions* options);
+
+/**
+ * MQTTAsync_willOptions defines the MQTT "Last Will and Testament" (LWT) settings for
+ * the client. In the event that a client unexpectedly loses its connection to
+ * the server, the server publishes the LWT message to the LWT topic on
+ * behalf of the client. This allows other clients (subscribed to the LWT topic)
+ * to be made aware that the client has disconnected. To enable the LWT
+ * function for a specific client, a valid pointer to an MQTTAsync_willOptions
+ * structure is passed in the MQTTAsync_connectOptions structure used in the
+ * MQTTAsync_connect() call that connects the client to the server. The pointer
+ * to MQTTAsync_willOptions can be set to NULL if the LWT function is not
+ * required.
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  must be MQTW. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 or 1
+	    0 indicates no binary will message support
+	 */
+	int struct_version;
+	/** The LWT topic to which the LWT message will be published. */
+	const char* topicName;
+	/** The LWT payload. */
+	const char* message;
+	/**
+      * The retained flag for the LWT message (see MQTTAsync_message.retained).
+      */
+	int retained;
+	/**
+      * The quality of service setting for the LWT message (see
+      * MQTTAsync_message.qos and @ref qos).
+      */
+	int qos;
+  /** The LWT payload in binary form. This is only checked and used if the message option is NULL */
+	struct
+	{
+  	int len;            /**< binary payload length */
+		const void* data;  /**< binary payload data */
+	} payload;
+} MQTTAsync_willOptions;
+
+#define MQTTAsync_willOptions_initializer { {'M', 'Q', 'T', 'W'}, 1, NULL, NULL, 0, 0, { 0, NULL } }
+
+#define MQTT_SSL_VERSION_DEFAULT 0
+#define MQTT_SSL_VERSION_TLS_1_0 1
+#define MQTT_SSL_VERSION_TLS_1_1 2
+#define MQTT_SSL_VERSION_TLS_1_2 3
+
+/**
+* MQTTAsync_sslProperties defines the settings to establish an SSL/TLS connection using the
+* OpenSSL library. It covers the following scenarios:
+* - Server authentication: The client needs the digital certificate of the server. It is included
+*   in a store containting trusted material (also known as "trust store").
+* - Mutual authentication: Both client and server are authenticated during the SSL handshake. In
+*   addition to the digital certificate of the server in a trust store, the client will need its own
+*   digital certificate and the private key used to sign its digital certificate stored in a "key store".
+* - Anonymous connection: Both client and server do not get authenticated and no credentials are needed
+*   to establish an SSL connection. Note that this scenario is not fully secure since it is subject to
+*   man-in-the-middle attacks.
+*/
+typedef struct
+{
+	/** The eyecatcher for this structure.  Must be MQTS */
+	char struct_id[4];
+	/** The version number of this structure.    Must be 0, or 1 to enable TLS version selection. */
+	int struct_version;
+
+	/** The file in PEM format containing the public digital certificates trusted by the client. */
+	const char* trustStore;
+
+	/** The file in PEM format containing the public certificate chain of the client. It may also include
+	* the client's private key.
+	*/
+	const char* keyStore;
+
+	/** If not included in the sslKeyStore, this setting points to the file in PEM format containing
+	* the client's private key.
+	*/
+	const char* privateKey;
+	/** The password to load the client's privateKey if encrypted. */
+	const char* privateKeyPassword;
+
+	/**
+	* The list of cipher suites that the client will present to the server during the SSL handshake. For a
+	* full explanation of the cipher list format, please see the OpenSSL on-line documentation:
+	* http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT
+	* If this setting is ommitted, its default value will be "ALL", that is, all the cipher suites -excluding
+	* those offering no encryption- will be considered.
+	* This setting can be used to set an SSL anonymous connection ("aNULL" string value, for instance).
+	*/
+	const char* enabledCipherSuites;
+
+    /** True/False option to enable verification of the server certificate **/
+    int enableServerCertAuth;
+
+    /** The SSL/TLS version to use. Specify one of MQTT_SSL_VERSION_DEFAULT (0),
+    * MQTT_SSL_VERSION_TLS_1_0 (1), MQTT_SSL_VERSION_TLS_1_1 (2) or MQTT_SSL_VERSION_TLS_1_2 (3).
+    * Only used if struct_version is >= 1.
+    */
+    int sslVersion;
+
+} MQTTAsync_SSLOptions;
+
+#define MQTTAsync_SSLOptions_initializer { {'M', 'Q', 'T', 'S'}, 1, NULL, NULL, NULL, NULL, NULL, 1, MQTT_SSL_VERSION_DEFAULT }
+
+/**
+ * MQTTAsync_connectOptions defines several settings that control the way the
+ * client connects to an MQTT server.  Default values are set in
+ * MQTTAsync_connectOptions_initializer.
+ */
+typedef struct
+{
+	/** The eyecatcher for this structure.  must be MQTC. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0, 1, 2, 3 4 or 5.
+	  * 0 signifies no SSL options and no serverURIs
+	  * 1 signifies no serverURIs
+    * 2 signifies no MQTTVersion
+    * 3 signifies no automatic reconnect options
+    * 4 signifies no binary password option (just string)
+	  */
+	int struct_version;
+	/** The "keep alive" interval, measured in seconds, defines the maximum time
+      * that should pass without communication between the client and the server
+      * The client will ensure that at least one message travels across the
+      * network within each keep alive period.  In the absence of a data-related
+	  * message during the time period, the client sends a very small MQTT
+      * "ping" message, which the server will acknowledge. The keep alive
+      * interval enables the client to detect when the server is no longer
+	  * available without having to wait for the long TCP/IP timeout.
+	  * Set to 0 if you do not want any keep alive processing.
+	  */
+	int keepAliveInterval;
+	/**
+      * This is a boolean value. The cleansession setting controls the behaviour
+      * of both the client and the server at connection and disconnection time.
+      * The client and server both maintain session state information. This
+      * information is used to ensure "at least once" and "exactly once"
+      * delivery, and "exactly once" receipt of messages. Session state also
+      * includes subscriptions created by an MQTT client. You can choose to
+      * maintain or discard state information between sessions.
+      *
+      * When cleansession is true, the state information is discarded at
+      * connect and disconnect. Setting cleansession to false keeps the state
+      * information. When you connect an MQTT client application with
+      * MQTTAsync_connect(), the client identifies the connection using the
+      * client identifier and the address of the server. The server checks
+      * whether session information for this client
+      * has been saved from a previous connection to the server. If a previous
+      * session still exists, and cleansession=true, then the previous session
+      * information at the client and server is cleared. If cleansession=false,
+      * the previous session is resumed. If no previous session exists, a new
+      * session is started.
+	  */
+	int cleansession;
+	/**
+      * This controls how many messages can be in-flight simultaneously.
+	  */
+	int maxInflight;
+	/**
+      * This is a pointer to an MQTTAsync_willOptions structure. If your
+      * application does not make use of the Last Will and Testament feature,
+      * set this pointer to NULL.
+      */
+	MQTTAsync_willOptions* will;
+	/**
+      * MQTT servers that support the MQTT v3.1 protocol provide authentication
+      * and authorisation by user name and password. This is the user name
+      * parameter.
+      */
+	const char* username;
+	/**
+      * MQTT servers that support the MQTT v3.1 protocol provide authentication
+      * and authorisation by user name and password. This is the password
+      * parameter.
+      */
+	const char* password;
+	/**
+      * The time interval in seconds to allow a connect to complete.
+      */
+	int connectTimeout;
+	/**
+	 * The time interval in seconds
+	 */
+	int retryInterval;
+	/**
+      * This is a pointer to an MQTTAsync_SSLOptions structure. If your
+      * application does not make use of SSL, set this pointer to NULL.
+      */
+	MQTTAsync_SSLOptions* ssl;
+	/**
+      * A pointer to a callback function to be called if the connect successfully
+      * completes.  Can be set to NULL, in which case no indication of successful
+      * completion will be received.
+      */
+	MQTTAsync_onSuccess* onSuccess;
+	/**
+      * A pointer to a callback function to be called if the connect fails.
+      * Can be set to NULL, in which case no indication of unsuccessful
+      * completion will be received.
+      */
+	MQTTAsync_onFailure* onFailure;
+	/**
+	  * A pointer to any application-specific context. The
+      * the <i>context</i> pointer is passed to success or failure callback functions to
+      * provide access to the context information in the callback.
+      */
+	void* context;
+	/**
+	  * The number of entries in the serverURIs array.
+	  */
+	int serverURIcount;
+	/**
+	  * An array of null-terminated strings specifying the servers to
+      * which the client will connect. Each string takes the form <i>protocol://host:port</i>.
+      * <i>protocol</i> must be <i>tcp</i> or <i>ssl</i>. For <i>host</i>, you can
+      * specify either an IP address or a domain name. For instance, to connect to
+      * a server running on the local machines with the default MQTT port, specify
+      * <i>tcp://localhost:1883</i>.
+      */
+	char* const* serverURIs;
+	/**
+      * Sets the version of MQTT to be used on the connect.
+      * MQTTVERSION_DEFAULT (0) = default: start with 3.1.1, and if that fails, fall back to 3.1
+      * MQTTVERSION_3_1 (3) = only try version 3.1
+      * MQTTVERSION_3_1_1 (4) = only try version 3.1.1
+	  */
+	int MQTTVersion;
+	/**
+	  * Reconnect automatically in the case of a connection being lost?
+	  */
+	int automaticReconnect;
+	/**
+	  * Minimum retry interval in seconds.  Doubled on each failed retry.
+	  */
+	int minRetryInterval;
+	/**
+	  * Maximum retry interval in seconds.  The doubling stops here on failed retries.
+	  */
+	int maxRetryInterval;
+	/**
+   * Optional binary password.  Only checked and used if the password option is NULL
+   */
+  struct {
+  	int len;            /**< binary password length */
+		const void* data;  /**< binary password data */
+	} binarypwd;
+} MQTTAsync_connectOptions;
+
+
+#define MQTTAsync_connectOptions_initializer { {'M', 'Q', 'T', 'C'}, 5, 60, 1, 10, NULL, NULL, NULL, 30, 0,\
+NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 1, 60, {0, NULL}}
+
+/**
+  * This function attempts to connect a previously-created client (see
+  * MQTTAsync_create()) to an MQTT server using the specified options. If you
+  * want to enable asynchronous message and status notifications, you must call
+  * MQTTAsync_setCallbacks() prior to MQTTAsync_connect().
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param options A pointer to a valid MQTTAsync_connectOptions
+  * structure.
+  * @return ::MQTTASYNC_SUCCESS if the client connect request was accepted.
+  * If the client was unable to connect to the server, an error code is
+  * returned via the onFailure callback, if set.
+  * Error codes greater than 0 are returned by the MQTT protocol:<br><br>
+  * <b>1</b>: Connection refused: Unacceptable protocol version<br>
+  * <b>2</b>: Connection refused: Identifier rejected<br>
+  * <b>3</b>: Connection refused: Server unavailable<br>
+  * <b>4</b>: Connection refused: Bad user name or password<br>
+  * <b>5</b>: Connection refused: Not authorized<br>
+  * <b>6-255</b>: Reserved for future use<br>
+  */
+DLLExport int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options);
+
+
+typedef struct
+{
+	/** The eyecatcher for this structure. Must be MQTD. */
+	char struct_id[4];
+	/** The version number of this structure.  Must be 0 or 1.  0 signifies no SSL options */
+	int struct_version;
+	/**
+      * The client delays disconnection for up to this time (in
+      * milliseconds) in order to allow in-flight message transfers to complete.
+      */
+	int timeout;
+	/**
+    * A pointer to a callback function to be called if the disconnect successfully
+    * completes.  Can be set to NULL, in which case no indication of successful
+    * completion will be received.
+    */
+	MQTTAsync_onSuccess* onSuccess;
+	/**
+    * A pointer to a callback function to be called if the disconnect fails.
+    * Can be set to NULL, in which case no indication of unsuccessful
+    * completion will be received.
+    */
+	MQTTAsync_onFailure* onFailure;
+	/**
+	* A pointer to any application-specific context. The
+    * the <i>context</i> pointer is passed to success or failure callback functions to
+    * provide access to the context information in the callback.
+    */
+	void* context;
+} MQTTAsync_disconnectOptions;
+
+#define MQTTAsync_disconnectOptions_initializer { {'M', 'Q', 'T', 'D'}, 0, 0, NULL, NULL, NULL }
+
+
+/**
+  * This function attempts to disconnect the client from the MQTT
+  * server. In order to allow the client time to complete handling of messages
+  * that are in-flight when this function is called, a timeout period is
+  * specified. When the timeout period has expired, the client disconnects even
+  * if there are still outstanding message acknowledgements.
+  * The next time the client connects to the same server, any QoS 1 or 2
+  * messages which have not completed will be retried depending on the
+  * cleansession settings for both the previous and the new connection (see
+  * MQTTAsync_connectOptions.cleansession and MQTTAsync_connect()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param options The client delays disconnection for up to this time (in
+  * milliseconds) in order to allow in-flight message transfers to complete.
+  * @return ::MQTTASYNC_SUCCESS if the client successfully disconnects from
+  * the server. An error code is returned if the client was unable to disconnect
+  * from the server
+  */
+DLLExport int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions* options);
+
+
+/**
+  * This function allows the client application to test whether or not a
+  * client is currently connected to the MQTT server.
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @return Boolean true if the client is connected, otherwise false.
+  */
+DLLExport int MQTTAsync_isConnected(MQTTAsync handle);
+
+
+/**
+  * This function attempts to subscribe a client to a single topic, which may
+  * contain wildcards (see @ref wildcard). This call also specifies the
+  * @ref qos requested for the subscription
+  * (see also MQTTAsync_subscribeMany()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param topic The subscription topic, which may include wildcards.
+  * @param qos The requested quality of service for the subscription.
+  * @param response A pointer to a response options structure. Used to set callback functions.
+  * @return ::MQTTASYNC_SUCCESS if the subscription request is successful.
+  * An error code is returned if there was a problem registering the
+  * subscription.
+  */
+DLLExport int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response);
+
+
+/**
+  * This function attempts to subscribe a client to a list of topics, which may
+  * contain wildcards (see @ref wildcard). This call also specifies the
+  * @ref qos requested for each topic (see also MQTTAsync_subscribe()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param count The number of topics for which the client is requesting
+  * subscriptions.
+  * @param topic An array (of length <i>count</i>) of pointers to
+  * topics, each of which may include wildcards.
+  * @param qos An array (of length <i>count</i>) of @ref qos
+  * values. qos[n] is the requested QoS for topic[n].
+  * @param response A pointer to a response options structure. Used to set callback functions.
+  * @return ::MQTTASYNC_SUCCESS if the subscription request is successful.
+  * An error code is returned if there was a problem registering the
+  * subscriptions.
+  */
+DLLExport int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, int* qos, MQTTAsync_responseOptions* response);
+
+/**
+  * This function attempts to remove an existing subscription made by the
+  * specified client.
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param topic The topic for the subscription to be removed, which may
+  * include wildcards (see @ref wildcard).
+  * @param response A pointer to a response options structure. Used to set callback functions.
+  * @return ::MQTTASYNC_SUCCESS if the subscription is removed.
+  * An error code is returned if there was a problem removing the
+  * subscription.
+  */
+DLLExport int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response);
+
+/**
+  * This function attempts to remove existing subscriptions to a list of topics
+  * made by the specified client.
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param count The number subscriptions to be removed.
+  * @param topic An array (of length <i>count</i>) of pointers to the topics of
+  * the subscriptions to be removed, each of which may include wildcards.
+  * @param response A pointer to a response options structure. Used to set callback functions.
+  * @return ::MQTTASYNC_SUCCESS if the subscriptions are removed.
+  * An error code is returned if there was a problem removing the subscriptions.
+  */
+DLLExport int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response);
+
+
+/**
+  * This function attempts to publish a message to a given topic (see also
+  * ::MQTTAsync_sendMessage()). An ::MQTTAsync_token is issued when
+  * this function returns successfully. If the client application needs to
+  * test for successful delivery of messages, a callback should be set
+  * (see ::MQTTAsync_onSuccess() and ::MQTTAsync_deliveryComplete()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param destinationName The topic associated with this message.
+  * @param payloadlen The length of the payload in bytes.
+  * @param payload A pointer to the byte array payload of the message.
+  * @param qos The @ref qos of the message.
+  * @param retained The retained flag for the message.
+  * @param response A pointer to an ::MQTTAsync_responseOptions structure. Used to set callback functions.
+  * This is optional and can be set to NULL.
+  * @return ::MQTTASYNC_SUCCESS if the message is accepted for publication.
+  * An error code is returned if there was a problem accepting the message.
+  */
+DLLExport int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, void* payload, int qos, int retained,
+																 MQTTAsync_responseOptions* response);
+
+
+/**
+  * This function attempts to publish a message to a given topic (see also
+  * MQTTAsync_publish()). An ::MQTTAsync_token is issued when
+  * this function returns successfully. If the client application needs to
+  * test for successful delivery of messages, a callback should be set
+  * (see ::MQTTAsync_onSuccess() and ::MQTTAsync_deliveryComplete()).
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param destinationName The topic associated with this message.
+  * @param msg A pointer to a valid MQTTAsync_message structure containing
+  * the payload and attributes of the message to be published.
+  * @param response A pointer to an ::MQTTAsync_responseOptions structure. Used to set callback functions.
+  * @return ::MQTTASYNC_SUCCESS if the message is accepted for publication.
+  * An error code is returned if there was a problem accepting the message.
+  */
+DLLExport int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* msg, MQTTAsync_responseOptions* response);
+
+
+/**
+  * This function sets a pointer to an array of tokens for
+  * messages that are currently in-flight (pending completion).
+  *
+  * <b>Important note:</b> The memory used to hold the array of tokens is
+  * malloc()'d in this function. The client application is responsible for
+  * freeing this memory when it is no longer required.
+  * @param handle A valid client handle from a successful call to
+  * MQTTAsync_create().
+  * @param tokens The address of a pointer to an ::MQTTAsync_token.
+  * When the function returns successfully, the pointer is set to point to an
+  * array of tokens representing messages pending completion. The last member of
+  * the array is set to -1 to indicate there are no more tokens. If no tokens
+  * are pending, the pointer is set to NULL.
+  * @return ::MQTTASYNC_SUCCESS if the function returns successfully.
+  * An error code is returned if there was a problem obtaining the list of
+  * pending tokens.
+  */
+DLLExport int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens);
+
+/**
+ * Tests whether a request corresponding to a token is complete.
+ *
+ * @param handle A valid client handle from a successful call to
+ * MQTTAsync_create().
+ * @param token An ::MQTTAsync_token associated with a request.
+ * @return 1 if the request has been completed, 0 if not.
+ */
+#define MQTTASYNC_TRUE 1
+DLLExport int MQTTAsync_isComplete(MQTTAsync handle, MQTTAsync_token token);
+
+
+/**
+ * Waits for a request corresponding to a token to complete.
+ *
+ * @param handle A valid client handle from a successful call to
+ * MQTTAsync_create().
+ * @param token An ::MQTTAsync_token associated with a request.
+ * @param timeout the maximum time to wait for completion, in milliseconds
+ * @return ::MQTTASYNC_SUCCESS if the request has been completed in the time allocated,
+ *  ::MQTTASYNC_FAILURE if not.
+ */
+DLLExport int MQTTAsync_waitForCompletion(MQTTAsync handle, MQTTAsync_token token, unsigned long timeout);
+
+
+/**
+  * This function frees memory allocated to an MQTT message, including the
+  * additional memory allocated to the message payload. The client application
+  * calls this function when the message has been fully processed. <b>Important
+  * note:</b> This function does not free the memory allocated to a message
+  * topic string. It is the responsibility of the client application to free
+  * this memory using the MQTTAsync_free() library function.
+  * @param msg The address of a pointer to the ::MQTTAsync_message structure
+  * to be freed.
+  */
+DLLExport void MQTTAsync_freeMessage(MQTTAsync_message** msg);
+
+/**
+  * This function frees memory allocated by the MQTT C client library, especially the
+  * topic name. This is needed on Windows when the client libary and application
+  * program have been compiled with different versions of the C compiler.  It is
+  * thus good policy to always use this function when freeing any MQTT C client-
+  * allocated memory.
+  * @param ptr The pointer to the client library storage to be freed.
+  */
+DLLExport void MQTTAsync_free(void* ptr);
+
+/**
+  * This function frees the memory allocated to an MQTT client (see
+  * MQTTAsync_create()). It should be called when the client is no longer
+  * required.
+  * @param handle A pointer to the handle referring to the ::MQTTAsync
+  * structure to be freed.
+  */
+DLLExport void MQTTAsync_destroy(MQTTAsync* handle);
+
+
+
+enum MQTTASYNC_TRACE_LEVELS
+{
+	MQTTASYNC_TRACE_MAXIMUM = 1,
+	MQTTASYNC_TRACE_MEDIUM,
+	MQTTASYNC_TRACE_MINIMUM,
+	MQTTASYNC_TRACE_PROTOCOL,
+	MQTTASYNC_TRACE_ERROR,
+	MQTTASYNC_TRACE_SEVERE,
+	MQTTASYNC_TRACE_FATAL,
+};
+
+
+/**
+  * This function sets the level of trace information which will be
+  * returned in the trace callback.
+  * @param level the trace level required
+  */
+DLLExport void MQTTAsync_setTraceLevel(enum MQTTASYNC_TRACE_LEVELS level);
+
+
+/**
+  * This is a callback function prototype which must be implemented if you want
+  * to receive trace information.
+  * @param level the trace level of the message returned
+  * @param meesage the trace message.  This is a pointer to a static buffer which
+  * will be overwritten on each call.  You must copy the data if you want to keep
+  * it for later.
+  */
+typedef void MQTTAsync_traceCallback(enum MQTTASYNC_TRACE_LEVELS level, char* message);
+
+/**
+  * This function sets the trace callback if needed.  If set to NULL,
+  * no trace information will be returned.  The default trace level is
+  * MQTTASYNC_TRACE_MINIMUM.
+  * @param callback a pointer to the function which will handle the trace information
+  */
+DLLExport void MQTTAsync_setTraceCallback(MQTTAsync_traceCallback* callback);
+
+
+typedef struct
+{
+	const char* name;
+	const char* value;
+} MQTTAsync_nameValue;
+
+/**
+  * This function returns version information about the library.
+  * no trace information will be returned.  The default trace level is
+  * MQTTASYNC_TRACE_MINIMUM
+  * @return an array of strings describing the library.  The last entry is a NULL pointer.
+  */
+DLLExport MQTTAsync_nameValue* MQTTAsync_getVersionInfo(void);
+
+
+/**
+  * @cond MQTTAsync_main
+  * @page async Threading
+  * The client application runs on several threads.
+  * Processing of handshaking and maintaining
+  * the network connection is performed in the background.
+  * This API is thread safe: functions may be called by multiple application
+  * threads.
+  * Notifications of status and message reception are provided to the client
+  * application using callbacks registered with the library by the call to
+  * MQTTAsync_setCallbacks() (see MQTTAsync_messageArrived(),
+  * MQTTAsync_connectionLost() and MQTTAsync_deliveryComplete()).
+  * In addition, some functions allow success and failure callbacks to be set
+  * for individual requests, in the ::MQTTAsync_responseOptions structure.  Applications
+  * can be written as a chain of callback functions. Note that it is a theoretically
+  * possible but unlikely event, that a success or failure callback could be called
+  * before function requesting the callback has returned.  In this case the token
+  * delivered in the callback would not yet be known to the application program (see
+  * Race condition for MQTTAsync_token in MQTTAsync.c
+  * https://bugs.eclipse.org/bugs/show_bug.cgi?id=444093)
+  *
+  * @page auto_reconnect Automatic Reconnect
+  * The ability for the client library to reconnect automatically in the event
+  * of a connection failure was added in 1.1.  The connection lost callback
+  * allows a flexible response to the loss of a connection, so almost any
+  * behaviour can be implemented in that way.  Automatic reconnect does have the
+  * advantage of being a little simpler to use.
+  *
+  * To switch on automatic reconnect, the connect options field
+  * automaticReconnect should be set to non-zero.  The minimum and maximum times
+  * before the next connection attempt can also be set, the defaults being 1 and
+  * 60 seconds.  At each failure to reconnect, the retry interval is doubled until
+  * the maximum value is reached, and there it stays until the connection is
+  * successfully re-established whereupon it is reset.
+  *
+  * When a reconnection attempt is successful, the ::MQTTAsync_connected callback
+  * function is invoked, if set by calling ::MQTTAsync_setConnected.  This allows
+  * the application to take any actions needed, such as amending subscriptions.
+  *
+  * @page offline_publish Publish While Disconnected
+  * This feature was not originally available because with persistence enabled,
+  * messages could be stored locally without ever knowing if they could be sent.
+  * The client application could have created the client with an erroneous broker
+  * address or port for instance.
+  *
+  * To enable messages to be published when the application is disconnected
+  * ::MQTTAsync_createWithOptions must be used instead of ::MQTTAsync_create to
+  * create the client object.  The ::createOptions field sendWhileDisconnected
+  * must be set to non-zero, and the maxBufferedMessages field set as required -
+  * the default being 100.
+  *
+  * ::MQTTAsync_getPendingTokens can be called to return the ids of the messages
+  * waiting to be sent, or for which the sending process has not completed.
+  *
+  * @page wildcard Subscription wildcards
+  * Every MQTT message includes a topic that classifies it. MQTT servers use
+  * topics to determine which subscribers should receive messages published to
+  * the server.
+  *
+  * Consider the server receiving messages from several environmental sensors.
+  * Each sensor publishes its measurement data as a message with an associated
+  * topic. Subscribing applications need to know which sensor originally
+  * published each received message. A unique topic is thus used to identify
+  * each sensor and measurement type. Topics such as SENSOR1TEMP,
+  * SENSOR1HUMIDITY, SENSOR2TEMP and so on achieve this but are not very
+  * flexible. If additional sensors are added to the system at a later date,
+  * subscribing applications must be modified to receive them.
+  *
+  * To provide more flexibility, MQTT supports a hierarchical topic namespace.
+  * This allows application designers to organize topics to simplify their
+  * management. Levels in the hierarchy are delimited by the '/' character,
+  * such as SENSOR/1/HUMIDITY. Publishers and subscribers use these
+  * hierarchical topics as already described.
+  *
+  * For subscriptions, two wildcard characters are supported:
+  * <ul>
+  * <li>A '#' character represents a complete sub-tree of the hierarchy and
+  * thus must be the last character in a subscription topic string, such as
+  * SENSOR/#. This will match any topic starting with SENSOR/, such as
+  * SENSOR/1/TEMP and SENSOR/2/HUMIDITY.</li>
+  * <li> A '+' character represents a single level of the hierarchy and is
+  * used between delimiters. For example, SENSOR/+/TEMP will match
+  * SENSOR/1/TEMP and SENSOR/2/TEMP.</li>
+  * </ul>
+  * Publishers are not allowed to use the wildcard characters in their topic
+  * names.
+  *
+  * Deciding on your topic hierarchy is an important step in your system design.
+  *
+  * @page qos Quality of service
+  * The MQTT protocol provides three qualities of service for delivering
+  * messages between clients and servers: "at most once", "at least once" and
+  * "exactly once".
+  *
+  * Quality of service (QoS) is an attribute of an individual message being
+  * published. An application sets the QoS for a specific message by setting the
+  * MQTTAsync_message.qos field to the required value.
+  *
+  * A subscribing client can set the maximum quality of service a server uses
+  * to send messages that match the client subscriptions. The
+  * MQTTAsync_subscribe() and MQTTAsync_subscribeMany() functions set this
+  * maximum. The QoS of a message forwarded to a subscriber thus might be
+  * different to the QoS given to the message by the original publisher.
+  * The lower of the two values is used to forward a message.
+  *
+  * The three levels are:
+  *
+  * <b>QoS0, At most once:</b> The message is delivered at most once, or it
+  * may not be delivered at all. Its delivery across the network is not
+  * acknowledged. The message is not stored. The message could be lost if the
+  * client is disconnected, or if the server fails. QoS0 is the fastest mode of
+  * transfer. It is sometimes called "fire and forget".
+  *
+  * The MQTT protocol does not require servers to forward publications at QoS0
+  * to a client. If the client is disconnected at the time the server receives
+  * the publication, the publication might be discarded, depending on the
+  * server implementation.
+  *
+  * <b>QoS1, At least once:</b> The message is always delivered at least once.
+  * It might be delivered multiple times if there is a failure before an
+  * acknowledgment is received by the sender. The message must be stored
+  * locally at the sender, until the sender receives confirmation that the
+  * message has been published by the receiver. The message is stored in case
+  * the message must be sent again.
+  *
+  * <b>QoS2, Exactly once:</b> The message is always delivered exactly once.
+  * The message must be stored locally at the sender, until the sender receives
+  * confirmation that the message has been published by the receiver. The
+  * message is stored in case the message must be sent again. QoS2 is the
+  * safest, but slowest mode of transfer. A more sophisticated handshaking
+  * and acknowledgement sequence is used than for QoS1 to ensure no duplication
+  * of messages occurs.
+
+
+  * @page publish Publication example
+@code
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTAsync.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientPub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTAsync_token deliveredtoken;
+
+int finished = 0;
+
+void connlost(void *context, char *cause)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	int rc;
+
+	printf("\nConnection lost\n");
+	printf("     cause: %s\n", cause);
+
+	printf("Reconnecting\n");
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+ 		finished = 1;
+	}
+}
+
+
+void onDisconnect(void* context, MQTTAsync_successData* response)
+{
+	printf("Successful disconnection\n");
+	finished = 1;
+}
+
+
+void onSend(void* context, MQTTAsync_successData* response)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_disconnectOptions opts = MQTTAsync_disconnectOptions_initializer;
+	int rc;
+
+	printf("Message with token value %d delivery confirmed\n", response->token);
+
+	opts.onSuccess = onDisconnect;
+	opts.context = client;
+
+	if ((rc = MQTTAsync_disconnect(client, &opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start sendMessage, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+void onConnectFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Connect failed, rc %d\n", response ? response->code : 0);
+	finished = 1;
+}
+
+
+void onConnect(void* context, MQTTAsync_successData* response)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_responseOptions opts = MQTTAsync_responseOptions_initializer;
+	MQTTAsync_message pubmsg = MQTTAsync_message_initializer;
+	int rc;
+
+	printf("Successful connection\n");
+
+	opts.onSuccess = onSend;
+	opts.context = client;
+
+	pubmsg.payload = PAYLOAD;
+	pubmsg.payloadlen = strlen(PAYLOAD);
+	pubmsg.qos = QOS;
+	pubmsg.retained = 0;
+	deliveredtoken = 0;
+
+	if ((rc = MQTTAsync_sendMessage(client, TOPIC, &pubmsg, &opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start sendMessage, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+int main(int argc, char* argv[])
+{
+	MQTTAsync client;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	MQTTAsync_message pubmsg = MQTTAsync_message_initializer;
+	MQTTAsync_token token;
+	int rc;
+
+	MQTTAsync_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL);
+
+	MQTTAsync_setCallbacks(client, NULL, connlost, NULL, NULL);
+
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	conn_opts.onSuccess = onConnect;
+	conn_opts.onFailure = onConnectFailure;
+	conn_opts.context = client;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+
+	printf("Waiting for publication of %s\n"
+         "on topic %s for client with ClientID: %s\n",
+         PAYLOAD, TOPIC, CLIENTID);
+	while (!finished)
+		#if defined(WIN32) || defined(WIN64)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+	MQTTAsync_destroy(&client);
+ 	return rc;
+}
+
+  * @endcode
+  * @page subscribe Subscription example
+@code
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "MQTTAsync.h"
+
+#define ADDRESS     "tcp://localhost:1883"
+#define CLIENTID    "ExampleClientSub"
+#define TOPIC       "MQTT Examples"
+#define PAYLOAD     "Hello World!"
+#define QOS         1
+#define TIMEOUT     10000L
+
+volatile MQTTAsync_token deliveredtoken;
+
+int disc_finished = 0;
+int subscribed = 0;
+int finished = 0;
+
+void connlost(void *context, char *cause)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	int rc;
+
+	printf("\nConnection lost\n");
+	printf("     cause: %s\n", cause);
+
+	printf("Reconnecting\n");
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+	    finished = 1;
+	}
+}
+
+
+int msgarrvd(void *context, char *topicName, int topicLen, MQTTAsync_message *message)
+{
+    int i;
+    char* payloadptr;
+
+    printf("Message arrived\n");
+    printf("     topic: %s\n", topicName);
+    printf("   message: ");
+
+    payloadptr = message->payload;
+    for(i=0; i<message->payloadlen; i++)
+    {
+        putchar(*payloadptr++);
+    }
+    putchar('\n');
+    MQTTAsync_freeMessage(&message);
+    MQTTAsync_free(topicName);
+    return 1;
+}
+
+
+void onDisconnect(void* context, MQTTAsync_successData* response)
+{
+	printf("Successful disconnection\n");
+	disc_finished = 1;
+}
+
+
+void onSubscribe(void* context, MQTTAsync_successData* response)
+{
+	printf("Subscribe succeeded\n");
+	subscribed = 1;
+}
+
+void onSubscribeFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Subscribe failed, rc %d\n", response ? response->code : 0);
+	finished = 1;
+}
+
+
+void onConnectFailure(void* context, MQTTAsync_failureData* response)
+{
+	printf("Connect failed, rc %d\n", response ? response->code : 0);
+	finished = 1;
+}
+
+
+void onConnect(void* context, MQTTAsync_successData* response)
+{
+	MQTTAsync client = (MQTTAsync)context;
+	MQTTAsync_responseOptions opts = MQTTAsync_responseOptions_initializer;
+	MQTTAsync_message pubmsg = MQTTAsync_message_initializer;
+	int rc;
+
+	printf("Successful connection\n");
+
+	printf("Subscribing to topic %s\nfor client %s using QoS%d\n\n"
+           "Press Q<Enter> to quit\n\n", TOPIC, CLIENTID, QOS);
+	opts.onSuccess = onSubscribe;
+	opts.onFailure = onSubscribeFailure;
+	opts.context = client;
+
+	deliveredtoken = 0;
+
+	if ((rc = MQTTAsync_subscribe(client, TOPIC, QOS, &opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start subscribe, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+}
+
+
+int main(int argc, char* argv[])
+{
+	MQTTAsync client;
+	MQTTAsync_connectOptions conn_opts = MQTTAsync_connectOptions_initializer;
+	MQTTAsync_disconnectOptions disc_opts = MQTTAsync_disconnectOptions_initializer;
+	MQTTAsync_message pubmsg = MQTTAsync_message_initializer;
+	MQTTAsync_token token;
+	int rc;
+	int ch;
+
+	MQTTAsync_create(&client, ADDRESS, CLIENTID, MQTTCLIENT_PERSISTENCE_NONE, NULL);
+
+	MQTTAsync_setCallbacks(client, NULL, connlost, msgarrvd, NULL);
+
+	conn_opts.keepAliveInterval = 20;
+	conn_opts.cleansession = 1;
+	conn_opts.onSuccess = onConnect;
+	conn_opts.onFailure = onConnectFailure;
+	conn_opts.context = client;
+	if ((rc = MQTTAsync_connect(client, &conn_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start connect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+
+	while	(!subscribed)
+		#if defined(WIN32) || defined(WIN64)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+	if (finished)
+		goto exit;
+
+	do
+	{
+		ch = getchar();
+	} while (ch!='Q' && ch != 'q');
+
+	disc_opts.onSuccess = onDisconnect;
+	if ((rc = MQTTAsync_disconnect(client, &disc_opts)) != MQTTASYNC_SUCCESS)
+	{
+		printf("Failed to start disconnect, return code %d\n", rc);
+		exit(EXIT_FAILURE);
+	}
+ 	while	(!disc_finished)
+		#if defined(WIN32) || defined(WIN64)
+			Sleep(100);
+		#else
+			usleep(10000L);
+		#endif
+
+exit:
+	MQTTAsync_destroy(&client);
+ 	return rc;
+}
+
+  * @endcode
+* @page tracing Tracing
+  *
+  * Runtime tracing can be controlled by environment variables or API calls.
+  *
+  * #### Environment variables
+  *
+  * Tracing is switched on by setting the MQTT_C_CLIENT_TRACE environment variable.
+  * A value of ON, or stdout, prints to stdout, any other value is interpreted as a file name to use.
+  *
+  * The amount of trace detail is controlled with the MQTT_C_CLIENT_TRACE_LEVEL environment
+  * variable - valid values are ERROR, PROTOCOL, MINIMUM, MEDIUM and MAXIMUM
+  * (from least to most verbose).
+  *
+  * The variable MQTT_C_CLIENT_TRACE_MAX_LINES limits the number of lines of trace that are output
+  * to a file.  Two files are used at most, when they are full, the last one is overwritten with the
+  * new trace entries.  The default size is 1000 lines.
+  *
+  * #### Trace API calls
+  *
+  * MQTTAsync_traceCallback() is used to set a callback function which is called whenever trace
+  * information is available.  This will be the same information as that printed if the
+  * environment variables were used to control the trace.
+  *
+  * The MQTTAsync_setTraceLevel() calls is used to set the maximum level of trace entries that will be
+  * passed to the callback function.  The levels are:
+  * 1. ::MQTTASYNC_TRACE_MAXIMUM
+  * 2. ::MQTTASYNC_TRACE_MEDIUM
+  * 3. ::MQTTASYNC_TRACE_MINIMUM
+  * 4. ::MQTTASYNC_TRACE_PROTOCOL
+  * 5. ::MQTTASYNC_TRACE_ERROR
+  * 6. ::MQTTASYNC_TRACE_SEVERE
+  * 7. ::MQTTASYNC_TRACE_FATAL
+  *
+  * Selecting ::MQTTASYNC_TRACE_MAXIMUM will cause all trace entries at all levels to be returned.
+  * Choosing ::MQTTASYNC_TRACE_ERROR will cause ERROR, SEVERE and FATAL trace entries to be returned
+  * to the callback function.
+  *
+  * ### MQTT Packet Tracing
+  *
+  * A feature that can be very useful is printing the MQTT packets that are sent and received.  To
+  * achieve this, use the following environment variable settings:
+  * @code
+    MQTT_C_CLIENT_TRACE=ON
+    MQTT_C_CLIENT_TRACE_LEVEL=PROTOCOL
+  * @endcode
+  * The output you should see looks like this:
+  * @code
+    20130528 155936.813 3 stdout-subscriber -> CONNECT cleansession: 1 (0)
+    20130528 155936.813 3 stdout-subscriber <- CONNACK rc: 0
+    20130528 155936.813 3 stdout-subscriber -> SUBSCRIBE msgid: 1 (0)
+    20130528 155936.813 3 stdout-subscriber <- SUBACK msgid: 1
+    20130528 155941.818 3 stdout-subscriber -> DISCONNECT (0)
+  * @endcode
+  * where the fields are:
+  * 1. date
+  * 2. time
+  * 3. socket number
+  * 4. client id
+  * 5. direction (-> from client to server, <- from server to client)
+  * 6. packet details
+  *
+  * ### Default Level Tracing
+  *
+  * This is an extract of a default level trace of a call to connect:
+  * @code
+    19700101 010000.000 (1152206656) (0)> MQTTClient_connect:893
+    19700101 010000.000 (1152206656)  (1)> MQTTClient_connectURI:716
+    20130528 160447.479 Connecting to serverURI localhost:1883
+    20130528 160447.479 (1152206656)   (2)> MQTTProtocol_connect:98
+    20130528 160447.479 (1152206656)    (3)> MQTTProtocol_addressPort:48
+    20130528 160447.479 (1152206656)    (3)< MQTTProtocol_addressPort:73
+    20130528 160447.479 (1152206656)    (3)> Socket_new:599
+    20130528 160447.479 New socket 4 for localhost, port 1883
+    20130528 160447.479 (1152206656)     (4)> Socket_addSocket:163
+    20130528 160447.479 (1152206656)      (5)> Socket_setnonblocking:73
+    20130528 160447.479 (1152206656)      (5)< Socket_setnonblocking:78 (0)
+    20130528 160447.479 (1152206656)     (4)< Socket_addSocket:176 (0)
+    20130528 160447.479 (1152206656)     (4)> Socket_error:95
+    20130528 160447.479 (1152206656)     (4)< Socket_error:104 (115)
+    20130528 160447.479 Connect pending
+    20130528 160447.479 (1152206656)    (3)< Socket_new:683 (115)
+    20130528 160447.479 (1152206656)   (2)< MQTTProtocol_connect:131 (115)
+  * @endcode
+  * where the fields are:
+  * 1. date
+  * 2. time
+  * 3. thread id
+  * 4. function nesting level
+  * 5. function entry (>) or exit (<)
+  * 6. function name : line of source code file
+  * 7. return value (if there is one)
+  *
+  * ### Memory Allocation Tracing
+  *
+  * Setting the trace level to maximum causes memory allocations and frees to be traced along with
+  * the default trace entries, with messages like the following:
+  * @code
+    20130528 161819.657 Allocating 16 bytes in heap at file /home/icraggs/workspaces/mqrtc/mqttv3c/src/MQTTPacket.c line 177 ptr 0x179f930
+
+    20130528 161819.657 Freeing 16 bytes in heap at file /home/icraggs/workspaces/mqrtc/mqttv3c/src/MQTTPacket.c line 201, heap use now 896 bytes
+  * @endcode
+  * When the last MQTT client object is destroyed, if the trace is being recorded
+  * and all memory allocated by the client library has not been freed, an error message will be
+  * written to the trace.  This can help with fixing memory leaks.  The message will look like this:
+  * @code
+    20130528 163909.208 Some memory not freed at shutdown, possible memory leak
+    20130528 163909.208 Heap scan start, total 880 bytes
+    20130528 163909.208 Heap element size 32, line 354, file /home/icraggs/workspaces/mqrtc/mqttv3c/src/MQTTPacket.c, ptr 0x260cb00
+    20130528 163909.208   Content
+    20130528 163909.209 Heap scan end
+  * @endcode
+  * @endcond
+  */
+
+
+#endif
+
+#ifdef __cplusplus
+     }
+#endif


[17/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj
new file mode 100755
index 0000000..c70676d
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj	
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{17F07F98-AA5F-4373-9877-992A341D650A}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>pahomqtt3as</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\Clients.h" />
+    <ClInclude Include="..\..\src\Heap.h" />
+    <ClInclude Include="..\..\src\LinkedList.h" />
+    <ClInclude Include="..\..\src\Log.h" />
+    <ClInclude Include="..\..\src\Messages.h" />
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClient.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+    <ClInclude Include="..\..\src\MQTTPacket.h" />
+    <ClInclude Include="..\..\src\MQTTPacketOut.h" />
+    <ClInclude Include="..\..\src\MQTTPersistence.h" />
+    <ClInclude Include="..\..\src\MQTTPersistenceDefault.h" />
+    <ClInclude Include="..\..\src\MQTTProtocol.h" />
+    <ClInclude Include="..\..\src\MQTTProtocolClient.h" />
+    <ClInclude Include="..\..\src\MQTTProtocolOut.h" />
+    <ClInclude Include="..\..\src\Socket.h" />
+    <ClInclude Include="..\..\src\SocketBuffer.h" />
+    <ClInclude Include="..\..\src\SSLSocket.h" />
+    <ClInclude Include="..\..\src\StackTrace.h" />
+    <ClInclude Include="..\..\src\Thread.h" />
+    <ClInclude Include="..\..\src\Tree.h" />
+    <ClInclude Include="..\..\src\utf-8.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c" />
+    <ClCompile Include="..\..\src\Heap.c" />
+    <ClCompile Include="..\..\src\LinkedList.c" />
+    <ClCompile Include="..\..\src\Log.c" />
+    <ClCompile Include="..\..\src\Messages.c" />
+    <ClCompile Include="..\..\src\MQTTClient.c" />
+    <ClCompile Include="..\..\src\MQTTPacket.c" />
+    <ClCompile Include="..\..\src\MQTTPacketOut.c" />
+    <ClCompile Include="..\..\src\MQTTPersistence.c" />
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c" />
+    <ClCompile Include="..\..\src\MQTTVersion.c" />
+    <ClCompile Include="..\..\src\Socket.c" />
+    <ClCompile Include="..\..\src\SocketBuffer.c" />
+    <ClCompile Include="..\..\src\SSLSocket.c" />
+    <ClCompile Include="..\..\src\StackTrace.c" />
+    <ClCompile Include="..\..\src\Thread.c" />
+    <ClCompile Include="..\..\src\Tree.c" />
+    <ClCompile Include="..\..\src\utf-8.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.filters
new file mode 100644
index 0000000..95f68ae
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.filters	
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\Clients.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Heap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\LinkedList.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Log.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Messages.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPacket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPacketOut.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPersistenceDefault.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocol.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocolClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocolOut.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Socket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\SocketBuffer.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\SSLSocket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\StackTrace.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Tree.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\utf-8.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Heap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\LinkedList.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Messages.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacketOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistence.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTVersion.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Socket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SocketBuffer.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SSLSocket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\StackTrace.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Thread.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Tree.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\utf-8.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTClient.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.user
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.user b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.user
new file mode 100644
index 0000000..ef5ff2a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3cs/paho-mqtt3cs.vcxproj.user	
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup />
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj
new file mode 100644
index 0000000..a6d8c85
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj	
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{DFDF6238-DA97-4474-84C2-D313E8B985AE}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>paho-cs-sub</RootNamespace>
+    <ProjectName>paho-cs-sub</ProjectName>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\samples\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\Debug</AdditionalLibraryDirectories>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)\</AdditionalLibraryDirectories>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\samples\paho_cs_sub.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClient.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\paho-mqtt3cs\paho-mqtt3cs.vcxproj">
+      <Project>{17f07f98-aa5f-4373-9877-992a341d650a}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.filters
new file mode 100644
index 0000000..1cfc2b2
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.filters	
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\samples\paho_cs_sub.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.user
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.user b/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/stdoutsub/stdoutsub.vcxproj.user	
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj
new file mode 100644
index 0000000..767166f
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj	
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{AF322561-C692-43D3-8502-CC1E6CD2869A}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>paho-cs-pub</RootNamespace>
+    <ProjectName>paho-cs-pub</ProjectName>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\samples\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(SolutionDir)\Debug</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\samples\paho_cs_pub.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.filters
new file mode 100644
index 0000000..69fd52a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.filters	
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\samples\paho_cs_pub.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.user
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.user b/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/stdoutsuba/stdoutsuba.vcxproj.user	
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj
new file mode 100755
index 0000000..85f83a0
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj	
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{4E643090-289D-487D-BCA8-685EA2210480}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>test1</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\Debug\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test1.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClient.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj.filters
new file mode 100644
index 0000000..f5ae8ca
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test1/test1.vcxproj.filters	
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test1.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj
new file mode 100644
index 0000000..9043a64
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj	
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{A4E14611-05DC-40A1-815B-DA30CA167C9B}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>test2</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3c.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <Text Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Log.c" />
+    <ClCompile Include="..\..\src\Messages.c" />
+    <ClCompile Include="..\..\src\StackTrace.c" />
+    <ClCompile Include="..\..\src\Thread.c" />
+    <ClCompile Include="..\..\test\test2.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj.filters
new file mode 100644
index 0000000..79e09c4
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test2/test2.vcxproj.filters	
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <Text Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test2.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Thread.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\StackTrace.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Messages.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj
new file mode 100755
index 0000000..8c94f73
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj	
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>test1</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3cs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3cs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3cs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3cs.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClient.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test3.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\paho-mqtt3cs\paho-mqtt3cs.vcxproj">
+      <Project>{17f07f98-aa5f-4373-9877-992a341d650a}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj.filters
new file mode 100644
index 0000000..a63cda7
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test3/test3.vcxproj.filters	
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test3.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj
new file mode 100755
index 0000000..31815bb
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj	
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{29D6A4E9-5A39-4CD3-8A24-348A34832405}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>test1</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test4.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file


[08/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTAsync.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTAsync.c b/thirdparty/paho.mqtt.c/src/MQTTAsync.c
new file mode 100644
index 0000000..87a1088
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTAsync.c
@@ -0,0 +1,3227 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial implementation and documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL support
+ *    Ian Craggs - multiple server connection support
+ *    Ian Craggs - fix for bug 413429 - connectionLost not called
+ *    Ian Craggs - fix for bug 415042 - using already freed structure
+ *    Ian Craggs - fix for bug 419233 - mutexes not reporting errors
+ *    Ian Craggs - fix for bug 420851
+ *    Ian Craggs - fix for bug 432903 - queue persistence
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Rong Xiang, Ian Craggs - C++ compatibility
+ *    Ian Craggs - fix for bug 442400: reconnecting after network cable unplugged
+ *    Ian Craggs - fix for bug 444934 - incorrect free in freeCommand1
+ *    Ian Craggs - fix for bug 445891 - assigning msgid is not thread safe
+ *    Ian Craggs - fix for bug 465369 - longer latency than expected
+ *    Ian Craggs - fix for bug 444103 - success/failure callbacks not invoked
+ *    Ian Craggs - fix for bug 484363 - segfault in getReadySocket
+ *    Ian Craggs - automatic reconnect and offline buffering (send while disconnected)
+ *    Ian Craggs - fix for bug 472250
+ *    Ian Craggs - fix for bug 486548
+ *    Ian Craggs - SNI support
+ *    Ian Craggs - auto reconnect timing fix #218
+ *    Ian Craggs - fix for issue #190
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Asynchronous API implementation
+ *
+ */
+
+#define _GNU_SOURCE /* for pthread_mutexattr_settype */
+#include <stdlib.h>
+#include <string.h>
+#if !defined(WIN32) && !defined(WIN64)
+	#include <sys/time.h>
+#endif
+
+#if !defined(NO_PERSISTENCE)
+#include "MQTTPersistence.h"
+#endif
+#include "MQTTAsync.h"
+#include "utf-8.h"
+#include "MQTTProtocol.h"
+#include "MQTTProtocolOut.h"
+#include "Thread.h"
+#include "SocketBuffer.h"
+#include "StackTrace.h"
+#include "Heap.h"
+#include "OsWrapper.h"
+
+#define URI_TCP "tcp://"
+
+#include "VersionInfo.h"
+
+const char *client_timestamp_eye = "MQTTAsyncV3_Timestamp " BUILD_TIMESTAMP;
+const char *client_version_eye = "MQTTAsyncV3_Version " CLIENT_VERSION;
+
+void MQTTAsync_global_init(MQTTAsync_init_options* inits)
+{
+#if defined(OPENSSL)
+	SSLSocket_handleOpensslInit(inits->do_openssl_init);
+#endif
+}
+
+#if !defined(min)
+#define min(a, b) (((a) < (b)) ? (a) : (b))
+#endif
+
+static ClientStates ClientState =
+{
+	CLIENT_VERSION, /* version */
+	NULL /* client list */
+};
+
+ClientStates* bstate = &ClientState;
+
+MQTTProtocol state;
+
+enum MQTTAsync_threadStates
+{
+	STOPPED, STARTING, RUNNING, STOPPING
+};
+
+enum MQTTAsync_threadStates sendThread_state = STOPPED;
+enum MQTTAsync_threadStates receiveThread_state = STOPPED;
+static thread_id_type sendThread_id = 0,
+					receiveThread_id = 0;
+
+#if defined(WIN32) || defined(WIN64)
+static mutex_type mqttasync_mutex = NULL;
+static mutex_type socket_mutex = NULL;
+static mutex_type mqttcommand_mutex = NULL;
+static sem_type send_sem = NULL;
+extern mutex_type stack_mutex;
+extern mutex_type heap_mutex;
+extern mutex_type log_mutex;
+BOOL APIENTRY DllMain(HANDLE hModule,
+					  DWORD  ul_reason_for_call,
+					  LPVOID lpReserved)
+{
+	switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+			Log(TRACE_MAX, -1, "DLL process attach");
+			if (mqttasync_mutex == NULL)
+			{
+				mqttasync_mutex = CreateMutex(NULL, 0, NULL);
+				mqttcommand_mutex = CreateMutex(NULL, 0, NULL);
+				send_sem = CreateEvent(
+		        NULL,               /* default security attributes */
+		        FALSE,              /* manual-reset event? */
+		        FALSE,              /* initial state is nonsignaled */
+		        NULL                /* object name */
+		        );
+				stack_mutex = CreateMutex(NULL, 0, NULL);
+				heap_mutex = CreateMutex(NULL, 0, NULL);
+				log_mutex = CreateMutex(NULL, 0, NULL);
+				socket_mutex = CreateMutex(NULL, 0, NULL);
+			}
+		case DLL_THREAD_ATTACH:
+			Log(TRACE_MAX, -1, "DLL thread attach");
+		case DLL_THREAD_DETACH:
+			Log(TRACE_MAX, -1, "DLL thread detach");
+		case DLL_PROCESS_DETACH:
+			Log(TRACE_MAX, -1, "DLL process detach");
+	}
+	return TRUE;
+}
+#else
+static pthread_mutex_t mqttasync_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type mqttasync_mutex = &mqttasync_mutex_store;
+
+static pthread_mutex_t socket_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type socket_mutex = &socket_mutex_store;
+
+static pthread_mutex_t mqttcommand_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type mqttcommand_mutex = &mqttcommand_mutex_store;
+
+static cond_type_struct send_cond_store = { PTHREAD_COND_INITIALIZER, PTHREAD_MUTEX_INITIALIZER };
+static cond_type send_cond = &send_cond_store;
+
+void MQTTAsync_init(void)
+{
+	pthread_mutexattr_t attr;
+	int rc;
+
+	pthread_mutexattr_init(&attr);
+#if !defined(_WRS_KERNEL)
+	pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
+#else
+	/* #warning "no pthread_mutexattr_settype" */
+#endif
+	if ((rc = pthread_mutex_init(mqttasync_mutex, &attr)) != 0)
+		printf("MQTTAsync: error %d initializing async_mutex\n", rc);
+	if ((rc = pthread_mutex_init(mqttcommand_mutex, &attr)) != 0)
+		printf("MQTTAsync: error %d initializing command_mutex\n", rc);
+	if ((rc = pthread_mutex_init(socket_mutex, &attr)) != 0)
+		printf("MQTTClient: error %d initializing socket_mutex\n", rc);
+
+	if ((rc = pthread_cond_init(&send_cond->cond, NULL)) != 0)
+		printf("MQTTAsync: error %d initializing send_cond cond\n", rc);
+	if ((rc = pthread_mutex_init(&send_cond->mutex, &attr)) != 0)
+		printf("MQTTAsync: error %d initializing send_cond mutex\n", rc);
+}
+
+#define WINAPI
+#endif
+
+static volatile int initialized = 0;
+static List* handles = NULL;
+static int tostop = 0;
+static List* commands = NULL;
+
+
+#if defined(WIN32) || defined(WIN64)
+#define START_TIME_TYPE DWORD
+START_TIME_TYPE MQTTAsync_start_clock(void)
+{
+	return GetTickCount();
+}
+#elif defined(AIX)
+#define START_TIME_TYPE struct timespec
+START_TIME_TYPE MQTTAsync_start_clock(void)
+{
+	static struct timespec start;
+	clock_gettime(CLOCK_REALTIME, &start);
+	return start;
+}
+#else
+#define START_TIME_TYPE struct timeval
+START_TIME_TYPE MQTTAsync_start_clock(void)
+{
+	static struct timeval start;
+	gettimeofday(&start, NULL);
+	return start;
+}
+#endif
+
+
+#if defined(WIN32) || defined(WIN64)
+long MQTTAsync_elapsed(DWORD milliseconds)
+{
+	return GetTickCount() - milliseconds;
+}
+#elif defined(AIX)
+#define assert(a)
+long MQTTAsync_elapsed(struct timespec start)
+{
+	struct timespec now, res;
+
+	clock_gettime(CLOCK_REALTIME, &now);
+	ntimersub(now, start, res);
+	return (res.tv_sec)*1000L + (res.tv_nsec)/1000000L;
+}
+#else
+long MQTTAsync_elapsed(struct timeval start)
+{
+	struct timeval now, res;
+
+	gettimeofday(&now, NULL);
+	timersub(&now, &start, &res);
+	return (res.tv_sec)*1000 + (res.tv_usec)/1000;
+}
+#endif
+
+
+typedef struct
+{
+	MQTTAsync_message* msg;
+	char* topicName;
+	int topicLen;
+	unsigned int seqno; /* only used on restore */
+} qEntry;
+
+typedef struct
+{
+	int type;
+	MQTTAsync_onSuccess* onSuccess;
+	MQTTAsync_onFailure* onFailure;
+	MQTTAsync_token token;
+	void* context;
+	START_TIME_TYPE start_time;
+	union
+	{
+		struct
+		{
+			int count;
+			char** topics;
+			int* qoss;
+		} sub;
+		struct
+		{
+			int count;
+			char** topics;
+		} unsub;
+		struct
+		{
+			char* destinationName;
+			int payloadlen;
+			void* payload;
+			int qos;
+			int retained;
+		} pub;
+		struct
+		{
+			int internal;
+			int timeout;
+		} dis;
+		struct
+		{
+			int currentURI;
+			int MQTTVersion; /**< current MQTT version being used to connect */
+		} conn;
+	} details;
+} MQTTAsync_command;
+
+
+typedef struct MQTTAsync_struct
+{
+	char* serverURI;
+	int ssl;
+	Clients* c;
+
+	/* "Global", to the client, callback definitions */
+	MQTTAsync_connectionLost* cl;
+	MQTTAsync_messageArrived* ma;
+	MQTTAsync_deliveryComplete* dc;
+	void* context; /* the context to be associated with the main callbacks*/
+
+	MQTTAsync_connected* connected;
+	void* connected_context; /* the context to be associated with the connected callback*/
+
+	/* Each time connect is called, we store the options that were used.  These are reused in
+	   any call to reconnect, or an automatic reconnect attempt */
+	MQTTAsync_command connect;		/* Connect operation properties */
+	MQTTAsync_command disconnect;		/* Disconnect operation properties */
+	MQTTAsync_command* pending_write;       /* Is there a socket write pending? */
+
+	List* responses;
+	unsigned int command_seqno;
+
+	MQTTPacket* pack;
+
+	/* added for offline buffering */
+	MQTTAsync_createOptions* createOptions;
+	int shouldBeConnected;
+
+	/* added for automatic reconnect */
+	int automaticReconnect;
+	int minRetryInterval;
+	int maxRetryInterval;
+	int serverURIcount;
+	char** serverURIs;
+	int connectTimeout;
+
+	int currentInterval;
+	START_TIME_TYPE lastConnectionFailedTime;
+	int retrying;
+	int reconnectNow;
+
+} MQTTAsyncs;
+
+
+typedef struct
+{
+	MQTTAsync_command command;
+	MQTTAsyncs* client;
+	unsigned int seqno; /* only used on restore */
+} MQTTAsync_queuedCommand;
+
+
+static int clientSockCompare(void* a, void* b);
+static void MQTTAsync_lock_mutex(mutex_type amutex);
+static void MQTTAsync_unlock_mutex(mutex_type amutex);
+static int MQTTAsync_checkConn(MQTTAsync_command* command, MQTTAsyncs* client);
+static void MQTTAsync_terminate(void);
+#if !defined(NO_PERSISTENCE)
+static int MQTTAsync_unpersistCommand(MQTTAsync_queuedCommand* qcmd);
+static int MQTTAsync_persistCommand(MQTTAsync_queuedCommand* qcmd);
+static MQTTAsync_queuedCommand* MQTTAsync_restoreCommand(char* buffer, int buflen);
+/*static void MQTTAsync_insertInOrder(List* list, void* content, int size);*/
+static int MQTTAsync_restoreCommands(MQTTAsyncs* client);
+#endif
+static int MQTTAsync_addCommand(MQTTAsync_queuedCommand* command, int command_size);
+static void MQTTAsync_startConnectRetry(MQTTAsyncs* m);
+static void MQTTAsync_checkDisconnect(MQTTAsync handle, MQTTAsync_command* command);
+static void MQTTProtocol_checkPendingWrites(void);
+static void MQTTAsync_freeServerURIs(MQTTAsyncs* m);
+static void MQTTAsync_freeCommand1(MQTTAsync_queuedCommand *command);
+static void MQTTAsync_freeCommand(MQTTAsync_queuedCommand *command);
+static void MQTTAsync_writeComplete(int socket);
+static int MQTTAsync_processCommand(void);
+static void MQTTAsync_checkTimeouts(void);
+static thread_return_type WINAPI MQTTAsync_sendThread(void* n);
+static void MQTTAsync_emptyMessageQueue(Clients* client);
+static void MQTTAsync_removeResponsesAndCommands(MQTTAsyncs* m);
+static int MQTTAsync_completeConnection(MQTTAsyncs* m, MQTTPacket* pack);
+static thread_return_type WINAPI MQTTAsync_receiveThread(void* n);
+static void MQTTAsync_stop(void);
+static void MQTTAsync_closeOnly(Clients* client);
+static void MQTTAsync_closeSession(Clients* client);
+static int clientStructCompare(void* a, void* b);
+static int MQTTAsync_cleanSession(Clients* client);
+static int MQTTAsync_deliverMessage(MQTTAsyncs* m, char* topicName, size_t topicLen, MQTTAsync_message* mm);
+static int MQTTAsync_disconnect1(MQTTAsync handle, const MQTTAsync_disconnectOptions* options, int internal);
+static int MQTTAsync_disconnect_internal(MQTTAsync handle, int timeout);
+static int cmdMessageIDCompare(void* a, void* b);
+static int MQTTAsync_assignMsgId(MQTTAsyncs* m);
+static int MQTTAsync_countBufferedMessages(MQTTAsyncs* m);
+static void MQTTAsync_retry(void);
+static int MQTTAsync_connecting(MQTTAsyncs* m);
+static MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc);
+/*static int pubCompare(void* a, void* b);*/
+
+
+void MQTTAsync_sleep(long milliseconds)
+{
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	Sleep(milliseconds);
+#else
+	usleep(milliseconds*1000);
+#endif
+	FUNC_EXIT;
+}
+
+
+/**
+ * List callback function for comparing clients by socket
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+static int clientSockCompare(void* a, void* b)
+{
+	MQTTAsyncs* m = (MQTTAsyncs*)a;
+	return m->c->net.socket == *(int*)b;
+}
+
+
+static void MQTTAsync_lock_mutex(mutex_type amutex)
+{
+	int rc = Thread_lock_mutex(amutex);
+	if (rc != 0)
+		Log(LOG_ERROR, 0, "Error %s locking mutex", strerror(rc));
+}
+
+
+static void MQTTAsync_unlock_mutex(mutex_type amutex)
+{
+	int rc = Thread_unlock_mutex(amutex);
+	if (rc != 0)
+		Log(LOG_ERROR, 0, "Error %s unlocking mutex", strerror(rc));
+}
+
+
+/*
+  Check whether there are any more connect options.  If not then we are finished
+  with connect attempts.
+*/
+static int MQTTAsync_checkConn(MQTTAsync_command* command, MQTTAsyncs* client)
+{
+	int rc;
+
+	FUNC_ENTRY;
+	rc = command->details.conn.currentURI + 1 < client->serverURIcount ||
+		(command->details.conn.MQTTVersion == 4 && client->c->MQTTVersion == MQTTVERSION_DEFAULT);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTAsync_createWithOptions(MQTTAsync* handle, const char* serverURI, const char* clientId,
+		int persistence_type, void* persistence_context,  MQTTAsync_createOptions* options)
+{
+	int rc = 0;
+	MQTTAsyncs *m = NULL;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+
+	if (serverURI == NULL || clientId == NULL)
+	{
+		rc = MQTTASYNC_NULL_PARAMETER;
+		goto exit;
+	}
+
+	if (!UTF8_validateString(clientId))
+	{
+		rc = MQTTASYNC_BAD_UTF8_STRING;
+		goto exit;
+	}
+
+	if (options && (strncmp(options->struct_id, "MQCO", 4) != 0 || options->struct_version != 0))
+	{
+		rc = MQTTASYNC_BAD_STRUCTURE;
+		goto exit;
+	}
+
+	if (!initialized)
+	{
+		#if defined(HEAP_H)
+			Heap_initialize();
+		#endif
+		Log_initialize((Log_nameValue*)MQTTAsync_getVersionInfo());
+		bstate->clients = ListInitialize();
+		Socket_outInitialize();
+		Socket_setWriteCompleteCallback(MQTTAsync_writeComplete);
+		handles = ListInitialize();
+		commands = ListInitialize();
+#if defined(OPENSSL)
+		SSLSocket_initialize();
+#endif
+		initialized = 1;
+	}
+	m = malloc(sizeof(MQTTAsyncs));
+	*handle = m;
+	memset(m, '\0', sizeof(MQTTAsyncs));
+	if (strncmp(URI_TCP, serverURI, strlen(URI_TCP)) == 0)
+		serverURI += strlen(URI_TCP);
+#if defined(OPENSSL)
+	else if (strncmp(URI_SSL, serverURI, strlen(URI_SSL)) == 0)
+	{
+		serverURI += strlen(URI_SSL);
+		m->ssl = 1;
+	}
+#endif
+	m->serverURI = MQTTStrdup(serverURI);
+	m->responses = ListInitialize();
+	ListAppend(handles, m, sizeof(MQTTAsyncs));
+
+	m->c = malloc(sizeof(Clients));
+	memset(m->c, '\0', sizeof(Clients));
+	m->c->context = m;
+	m->c->outboundMsgs = ListInitialize();
+	m->c->inboundMsgs = ListInitialize();
+	m->c->messageQueue = ListInitialize();
+	m->c->clientID = MQTTStrdup(clientId);
+
+	m->shouldBeConnected = 0;
+	if (options)
+	{
+		m->createOptions = malloc(sizeof(MQTTAsync_createOptions));
+		memcpy(m->createOptions, options, sizeof(MQTTAsync_createOptions));
+	}
+
+#if !defined(NO_PERSISTENCE)
+	rc = MQTTPersistence_create(&(m->c->persistence), persistence_type, persistence_context);
+	if (rc == 0)
+	{
+		rc = MQTTPersistence_initialize(m->c, m->serverURI);
+		if (rc == 0)
+		{
+			MQTTAsync_restoreCommands(m);
+			MQTTPersistence_restoreMessageQueue(m->c);
+		}
+	}
+#endif
+	ListAppend(bstate->clients, m->c, sizeof(Clients) + 3*sizeof(List));
+
+exit:
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTAsync_create(MQTTAsync* handle, const char* serverURI, const char* clientId,
+		int persistence_type, void* persistence_context)
+{
+	return MQTTAsync_createWithOptions(handle, serverURI, clientId, persistence_type,
+		persistence_context, NULL);
+}
+
+
+static void MQTTAsync_terminate(void)
+{
+	FUNC_ENTRY;
+	MQTTAsync_stop();
+	if (initialized)
+	{
+		ListElement* elem = NULL;
+		ListFree(bstate->clients);
+		ListFree(handles);
+		while (ListNextElement(commands, &elem))
+			MQTTAsync_freeCommand1((MQTTAsync_queuedCommand*)(elem->content));
+		ListFree(commands);
+		handles = NULL;
+		Socket_outTerminate();
+#if defined(OPENSSL)
+		SSLSocket_terminate();
+#endif
+		#if defined(HEAP_H)
+			Heap_terminate();
+		#endif
+		Log_terminate();
+		initialized = 0;
+	}
+	FUNC_EXIT;
+}
+
+
+#if !defined(NO_PERSISTENCE)
+static int MQTTAsync_unpersistCommand(MQTTAsync_queuedCommand* qcmd)
+{
+	int rc = 0;
+	char key[PERSISTENCE_MAX_KEY_LENGTH + 1];
+
+	FUNC_ENTRY;
+	sprintf(key, "%s%u", PERSISTENCE_COMMAND_KEY, qcmd->seqno);
+	if ((rc = qcmd->client->c->persistence->premove(qcmd->client->c->phandle, key)) != 0)
+		Log(LOG_ERROR, 0, "Error %d removing command from persistence", rc);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static int MQTTAsync_persistCommand(MQTTAsync_queuedCommand* qcmd)
+{
+	int rc = 0;
+	MQTTAsyncs* aclient = qcmd->client;
+	MQTTAsync_command* command = &qcmd->command;
+	int* lens = NULL;
+	void** bufs = NULL;
+	int bufindex = 0, i, nbufs = 0;
+	char key[PERSISTENCE_MAX_KEY_LENGTH + 1];
+
+	FUNC_ENTRY;
+	switch (command->type)
+	{
+		case SUBSCRIBE:
+			nbufs = 3 + (command->details.sub.count * 2);
+
+			lens = (int*)malloc(nbufs * sizeof(int));
+			bufs = malloc(nbufs * sizeof(char *));
+
+			bufs[bufindex] = &command->type;
+			lens[bufindex++] = sizeof(command->type);
+
+			bufs[bufindex] = &command->token;
+			lens[bufindex++] = sizeof(command->token);
+
+			bufs[bufindex] = &command->details.sub.count;
+			lens[bufindex++] = sizeof(command->details.sub.count);
+
+			for (i = 0; i < command->details.sub.count; ++i)
+			{
+				bufs[bufindex] = command->details.sub.topics[i];
+				lens[bufindex++] = (int)strlen(command->details.sub.topics[i]) + 1;
+				bufs[bufindex] = &command->details.sub.qoss[i];
+				lens[bufindex++] = sizeof(command->details.sub.qoss[i]);
+			}
+			sprintf(key, "%s%d", PERSISTENCE_COMMAND_KEY, ++aclient->command_seqno);
+			break;
+
+		case UNSUBSCRIBE:
+			nbufs = 3 + command->details.unsub.count;
+
+			lens = (int*)malloc(nbufs * sizeof(int));
+			bufs = malloc(nbufs * sizeof(char *));
+
+			bufs[bufindex] = &command->type;
+			lens[bufindex++] = sizeof(command->type);
+
+			bufs[bufindex] = &command->token;
+			lens[bufindex++] = sizeof(command->token);
+
+			bufs[bufindex] = &command->details.unsub.count;
+			lens[bufindex++] = sizeof(command->details.unsub.count);
+
+			for (i = 0; i < command->details.unsub.count; ++i)
+			{
+				bufs[bufindex] = command->details.unsub.topics[i];
+				lens[bufindex++] = (int)strlen(command->details.unsub.topics[i]) + 1;
+			}
+			sprintf(key, "%s%d", PERSISTENCE_COMMAND_KEY, ++aclient->command_seqno);
+			break;
+
+		case PUBLISH:
+			nbufs = 7;
+
+			lens = (int*)malloc(nbufs * sizeof(int));
+			bufs = malloc(nbufs * sizeof(char *));
+
+			bufs[bufindex] = &command->type;
+			lens[bufindex++] = sizeof(command->type);
+
+			bufs[bufindex] = &command->token;
+			lens[bufindex++] = sizeof(command->token);
+
+			bufs[bufindex] = command->details.pub.destinationName;
+			lens[bufindex++] = (int)strlen(command->details.pub.destinationName) + 1;
+
+			bufs[bufindex] = &command->details.pub.payloadlen;
+			lens[bufindex++] = sizeof(command->details.pub.payloadlen);
+
+			bufs[bufindex] = command->details.pub.payload;
+			lens[bufindex++] = command->details.pub.payloadlen;
+
+			bufs[bufindex] = &command->details.pub.qos;
+			lens[bufindex++] = sizeof(command->details.pub.qos);
+
+			bufs[bufindex] = &command->details.pub.retained;
+			lens[bufindex++] = sizeof(command->details.pub.retained);
+
+			sprintf(key, "%s%d", PERSISTENCE_COMMAND_KEY, ++aclient->command_seqno);
+			break;
+	}
+	if (nbufs > 0)
+	{
+		if ((rc = aclient->c->persistence->pput(aclient->c->phandle, key, nbufs, (char**)bufs, lens)) != 0)
+			Log(LOG_ERROR, 0, "Error persisting command, rc %d", rc);
+		qcmd->seqno = aclient->command_seqno;
+	}
+	if (lens)
+		free(lens);
+	if (bufs)
+		free(bufs);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static MQTTAsync_queuedCommand* MQTTAsync_restoreCommand(char* buffer, int buflen)
+{
+	MQTTAsync_command* command = NULL;
+	MQTTAsync_queuedCommand* qcommand = NULL;
+	char* ptr = buffer;
+	int i;
+	size_t data_size;
+
+	FUNC_ENTRY;
+	qcommand = malloc(sizeof(MQTTAsync_queuedCommand));
+	memset(qcommand, '\0', sizeof(MQTTAsync_queuedCommand));
+	command = &qcommand->command;
+
+	command->type = *(int*)ptr;
+	ptr += sizeof(int);
+
+	command->token = *(MQTTAsync_token*)ptr;
+	ptr += sizeof(MQTTAsync_token);
+
+	switch (command->type)
+	{
+		case SUBSCRIBE:
+			command->details.sub.count = *(int*)ptr;
+			ptr += sizeof(int);
+			
+			if (command->details.sub.count > 0)
+			{
+					command->details.sub.topics = (char **)malloc(sizeof(char *) * command->details.sub.count);
+					command->details.sub.qoss = (int *)malloc(sizeof(int) * command->details.sub.count);
+			}
+
+			for (i = 0; i < command->details.sub.count; ++i)
+			{
+				data_size = strlen(ptr) + 1;
+
+				command->details.sub.topics[i] = malloc(data_size);
+				strcpy(command->details.sub.topics[i], ptr);
+				ptr += data_size;
+
+				command->details.sub.qoss[i] = *(int*)ptr;
+				ptr += sizeof(int);
+			}
+			break;
+
+		case UNSUBSCRIBE:
+			command->details.unsub.count = *(int*)ptr;
+			ptr += sizeof(int);
+			
+			if (command->details.unsub.count > 0)
+			{
+					command->details.unsub.topics = (char **)malloc(sizeof(char *) * command->details.unsub.count);					
+			}
+
+			for (i = 0; i < command->details.unsub.count; ++i)
+			{
+				data_size = strlen(ptr) + 1;
+
+				command->details.unsub.topics[i] = malloc(data_size);
+				strcpy(command->details.unsub.topics[i], ptr);
+				ptr += data_size;
+			}
+			break;
+
+		case PUBLISH:
+			data_size = strlen(ptr) + 1;
+			command->details.pub.destinationName = malloc(data_size);
+			strcpy(command->details.pub.destinationName, ptr);
+			ptr += data_size;
+
+			command->details.pub.payloadlen = *(int*)ptr;
+			ptr += sizeof(int);
+
+			data_size = command->details.pub.payloadlen;
+			command->details.pub.payload = malloc(data_size);
+			memcpy(command->details.pub.payload, ptr, data_size);
+			ptr += data_size;
+
+			command->details.pub.qos = *(int*)ptr;
+			ptr += sizeof(int);
+
+			command->details.pub.retained = *(int*)ptr;
+			ptr += sizeof(int);
+			break;
+
+		default:
+			free(qcommand);
+			qcommand = NULL;
+
+	}
+
+	FUNC_EXIT;
+	return qcommand;
+}
+
+/*
+static void MQTTAsync_insertInOrder(List* list, void* content, int size)
+{
+	ListElement* index = NULL;
+	ListElement* current = NULL;
+
+	FUNC_ENTRY;
+	while (ListNextElement(list, &current) != NULL && index == NULL)
+	{
+		if (((MQTTAsync_queuedCommand*)content)->seqno < ((MQTTAsync_queuedCommand*)current->content)->seqno)
+			index = current;
+	}
+
+	ListInsert(list, content, size, index);
+	FUNC_EXIT;
+}*/
+
+
+static int MQTTAsync_restoreCommands(MQTTAsyncs* client)
+{
+	int rc = 0;
+	char **msgkeys;
+	int nkeys;
+	int i = 0;
+	Clients* c = client->c;
+	int commands_restored = 0;
+
+	FUNC_ENTRY;
+	if (c->persistence && (rc = c->persistence->pkeys(c->phandle, &msgkeys, &nkeys)) == 0)
+	{
+		while (rc == 0 && i < nkeys)
+		{
+			char *buffer = NULL;
+			int buflen;
+
+			if (strncmp(msgkeys[i], PERSISTENCE_COMMAND_KEY, strlen(PERSISTENCE_COMMAND_KEY)) != 0)
+			{
+				;
+			}
+			else if ((rc = c->persistence->pget(c->phandle, msgkeys[i], &buffer, &buflen)) == 0)
+			{
+				MQTTAsync_queuedCommand* cmd = MQTTAsync_restoreCommand(buffer, buflen);
+
+				if (cmd)
+				{
+					cmd->client = client;
+					cmd->seqno = atoi(msgkeys[i]+2);
+					MQTTPersistence_insertInOrder(commands, cmd, sizeof(MQTTAsync_queuedCommand));
+					free(buffer);
+					client->command_seqno = max(client->command_seqno, cmd->seqno);
+					commands_restored++;
+				}
+			}
+			if (msgkeys[i])
+				free(msgkeys[i]);
+			i++;
+		}
+		if (msgkeys != NULL)
+			free(msgkeys);
+	}
+	Log(TRACE_MINIMUM, -1, "%d commands restored for client %s", commands_restored, c->clientID);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+#endif
+
+
+static int MQTTAsync_addCommand(MQTTAsync_queuedCommand* command, int command_size)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttcommand_mutex);
+	/* Don't set start time if the connect command is already in process #218 */
+	if ((command->command.type != CONNECT) || (command->client->c->connect_state == 0))
+		command->command.start_time = MQTTAsync_start_clock();
+	if (command->command.type == CONNECT ||
+		(command->command.type == DISCONNECT && command->command.details.dis.internal))
+	{
+		MQTTAsync_queuedCommand* head = NULL;
+
+		if (commands->first)
+			head = (MQTTAsync_queuedCommand*)(commands->first->content);
+
+		if (head != NULL && head->client == command->client && head->command.type == command->command.type)
+			MQTTAsync_freeCommand(command); /* ignore duplicate connect or disconnect command */
+		else
+			ListInsert(commands, command, command_size, commands->first); /* add to the head of the list */
+	}
+	else
+	{
+		ListAppend(commands, command, command_size);
+#if !defined(NO_PERSISTENCE)
+		if (command->client->c->persistence)
+			MQTTAsync_persistCommand(command);
+#endif
+	}
+	MQTTAsync_unlock_mutex(mqttcommand_mutex);
+#if !defined(WIN32) && !defined(WIN64)
+	rc = Thread_signal_cond(send_cond);
+	if (rc != 0)
+		Log(LOG_ERROR, 0, "Error %d from signal cond", rc);
+#else
+	if (!Thread_check_sem(send_sem))
+		Thread_post_sem(send_sem);
+#endif
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void MQTTAsync_startConnectRetry(MQTTAsyncs* m)
+{
+	if (m->automaticReconnect && m->shouldBeConnected)
+	{
+		m->lastConnectionFailedTime = MQTTAsync_start_clock();
+		if (m->retrying)
+			m->currentInterval = min(m->currentInterval * 2, m->maxRetryInterval);
+		else
+		{
+			m->currentInterval = m->minRetryInterval;
+			m->retrying = 1;
+		}
+	}
+}
+
+
+int MQTTAsync_reconnect(MQTTAsync handle)
+{
+	int rc = MQTTASYNC_FAILURE;
+	MQTTAsyncs* m = handle;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+
+	if (m->automaticReconnect)
+	{
+		if (m->shouldBeConnected)
+		{
+			m->reconnectNow = 1;
+	  		if (m->retrying == 0)
+	  		{
+	  			m->currentInterval = m->minRetryInterval;
+	  			m->retrying = 1;
+	  		}
+	  		rc = MQTTASYNC_SUCCESS;
+		}
+	}
+	else
+	{
+		/* to reconnect, put the connect command to the head of the command queue */
+		MQTTAsync_queuedCommand* conn = malloc(sizeof(MQTTAsync_queuedCommand));
+		memset(conn, '\0', sizeof(MQTTAsync_queuedCommand));
+		conn->client = m;
+		conn->command = m->connect;
+		/* make sure that the version attempts are restarted */
+		if (m->c->MQTTVersion == MQTTVERSION_DEFAULT)
+	  		conn->command.details.conn.MQTTVersion = 0;
+		MQTTAsync_addCommand(conn, sizeof(m->connect));
+	  	rc = MQTTASYNC_SUCCESS;
+	}
+
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void MQTTAsync_checkDisconnect(MQTTAsync handle, MQTTAsync_command* command)
+{
+	MQTTAsyncs* m = handle;
+
+	FUNC_ENTRY;
+	/* wait for all inflight message flows to finish, up to timeout */;
+	if (m->c->outboundMsgs->count == 0 || MQTTAsync_elapsed(command->start_time) >= command->details.dis.timeout)
+	{
+		int was_connected = m->c->connected;
+		MQTTAsync_closeSession(m->c);
+		if (command->details.dis.internal)
+		{
+			if (m->cl && was_connected)
+			{
+				Log(TRACE_MIN, -1, "Calling connectionLost for client %s", m->c->clientID);
+				(*(m->cl))(m->context, NULL);
+			}
+			MQTTAsync_startConnectRetry(m);
+		}
+		else if (command->onSuccess)
+		{
+			Log(TRACE_MIN, -1, "Calling disconnect complete for client %s", m->c->clientID);
+			(*(command->onSuccess))(command->context, NULL);
+		}
+	}
+	FUNC_EXIT;
+}
+
+
+/**
+ * See if any pending writes have been completed, and cleanup if so.
+ * Cleaning up means removing any publication data that was stored because the write did
+ * not originally complete.
+ */
+static void MQTTProtocol_checkPendingWrites(void)
+{
+	FUNC_ENTRY;
+	if (state.pending_writes.count > 0)
+	{
+		ListElement* le = state.pending_writes.first;
+		while (le)
+		{
+			if (Socket_noPendingWrites(((pending_write*)(le->content))->socket))
+			{
+				MQTTProtocol_removePublication(((pending_write*)(le->content))->p);
+				state.pending_writes.current = le;
+				ListRemove(&(state.pending_writes), le->content); /* does NextElement itself */
+				le = state.pending_writes.current;
+			}
+			else
+				ListNextElement(&(state.pending_writes), &le);
+		}
+	}
+	FUNC_EXIT;
+}
+
+
+static void MQTTAsync_freeServerURIs(MQTTAsyncs* m)
+{
+	int i;
+
+	for (i = 0; i < m->serverURIcount; ++i)
+		free(m->serverURIs[i]);
+	if (m->serverURIs)
+		free(m->serverURIs);
+}
+
+
+static void MQTTAsync_freeCommand1(MQTTAsync_queuedCommand *command)
+{
+	if (command->command.type == SUBSCRIBE)
+	{
+		int i;
+
+		for (i = 0; i < command->command.details.sub.count; i++)
+			free(command->command.details.sub.topics[i]);
+
+		free(command->command.details.sub.topics);
+		free(command->command.details.sub.qoss);
+	}
+	else if (command->command.type == UNSUBSCRIBE)
+	{
+		int i;
+
+		for (i = 0; i < command->command.details.unsub.count; i++)
+			free(command->command.details.unsub.topics[i]);
+
+		free(command->command.details.unsub.topics);
+	}
+	else if (command->command.type == PUBLISH)
+	{
+		/* qos 1 and 2 topics are freed in the protocol code when the flows are completed */
+		if (command->command.details.pub.destinationName)
+			free(command->command.details.pub.destinationName);
+		free(command->command.details.pub.payload);
+	}
+}
+
+static void MQTTAsync_freeCommand(MQTTAsync_queuedCommand *command)
+{
+	MQTTAsync_freeCommand1(command);
+	free(command);
+}
+
+
+static void MQTTAsync_writeComplete(int socket)
+{
+	ListElement* found = NULL;
+
+	FUNC_ENTRY;
+	/* a partial write is now complete for a socket - this will be on a publish*/
+
+	MQTTProtocol_checkPendingWrites();
+
+	/* find the client using this socket */
+	if ((found = ListFindItem(handles, &socket, clientSockCompare)) != NULL)
+	{
+		MQTTAsyncs* m = (MQTTAsyncs*)(found->content);
+
+		time(&(m->c->net.lastSent));
+
+		/* see if there is a pending write flagged */
+		if (m->pending_write)
+		{
+			ListElement* cur_response = NULL;
+			MQTTAsync_command* command = m->pending_write;
+			MQTTAsync_queuedCommand* com = NULL;
+
+			while (ListNextElement(m->responses, &cur_response))
+			{
+				com = (MQTTAsync_queuedCommand*)(cur_response->content);
+				if (com->client->pending_write == m->pending_write)
+					break;
+			}
+
+			if (cur_response && command->onSuccess)
+			{
+				MQTTAsync_successData data;
+
+				data.token = command->token;
+				data.alt.pub.destinationName = command->details.pub.destinationName;
+				data.alt.pub.message.payload = command->details.pub.payload;
+				data.alt.pub.message.payloadlen = command->details.pub.payloadlen;
+				data.alt.pub.message.qos = command->details.pub.qos;
+				data.alt.pub.message.retained = command->details.pub.retained;
+				Log(TRACE_MIN, -1, "Calling publish success for client %s", m->c->clientID);
+				(*(command->onSuccess))(command->context, &data);
+			}
+			m->pending_write = NULL;
+
+			ListDetach(m->responses, com);
+			MQTTAsync_freeCommand(com);
+		}
+	}
+	FUNC_EXIT;
+}
+
+
+static int MQTTAsync_processCommand(void)
+{
+	int rc = 0;
+	MQTTAsync_queuedCommand* command = NULL;
+	ListElement* cur_command = NULL;
+	List* ignored_clients = NULL;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	MQTTAsync_lock_mutex(mqttcommand_mutex);
+
+	/* only the first command in the list must be processed for any particular client, so if we skip
+	   a command for a client, we must skip all following commands for that client.  Use a list of
+	   ignored clients to keep track
+	*/
+	ignored_clients = ListInitialize();
+
+	/* don't try a command until there isn't a pending write for that client, and we are not connecting */
+	while (ListNextElement(commands, &cur_command))
+	{
+		MQTTAsync_queuedCommand* cmd = (MQTTAsync_queuedCommand*)(cur_command->content);
+
+		if (ListFind(ignored_clients, cmd->client))
+			continue;
+
+		if (cmd->command.type == CONNECT || cmd->command.type == DISCONNECT || (cmd->client->c->connected &&
+			cmd->client->c->connect_state == 0 && Socket_noPendingWrites(cmd->client->c->net.socket)))
+		{
+			if ((cmd->command.type == PUBLISH || cmd->command.type == SUBSCRIBE || cmd->command.type == UNSUBSCRIBE) &&
+				cmd->client->c->outboundMsgs->count >= MAX_MSG_ID - 1)
+			{
+				; /* no more message ids available */
+			}
+			else
+			{
+				command = cmd;
+				break;
+			}
+		}
+		ListAppend(ignored_clients, cmd->client, sizeof(cmd->client));
+	}
+	ListFreeNoContent(ignored_clients);
+	if (command)
+	{
+		ListDetach(commands, command);
+#if !defined(NO_PERSISTENCE)
+		if (command->client->c->persistence)
+			MQTTAsync_unpersistCommand(command);
+#endif
+	}
+	MQTTAsync_unlock_mutex(mqttcommand_mutex);
+
+	if (!command)
+		goto exit; /* nothing to do */
+
+	if (command->command.type == CONNECT)
+	{
+		if (command->client->c->connect_state != 0 || command->client->c->connected)
+			rc = 0;
+		else
+		{
+			char* serverURI = command->client->serverURI;
+
+			if (command->client->serverURIcount > 0)
+			{
+				serverURI = command->client->serverURIs[command->command.details.conn.currentURI];
+
+				if (strncmp(URI_TCP, serverURI, strlen(URI_TCP)) == 0)
+					serverURI += strlen(URI_TCP);
+#if defined(OPENSSL)
+				else if (strncmp(URI_SSL, serverURI, strlen(URI_SSL)) == 0)
+				{
+					serverURI += strlen(URI_SSL);
+					command->client->ssl = 1;
+				}
+#endif
+			}
+
+			if (command->client->c->MQTTVersion == MQTTVERSION_DEFAULT)
+			{
+				if (command->command.details.conn.MQTTVersion == 0)
+					command->command.details.conn.MQTTVersion = MQTTVERSION_3_1_1;
+				else if (command->command.details.conn.MQTTVersion == MQTTVERSION_3_1_1)
+					command->command.details.conn.MQTTVersion = MQTTVERSION_3_1;
+			}
+			else
+				command->command.details.conn.MQTTVersion = command->client->c->MQTTVersion;
+
+			Log(TRACE_MIN, -1, "Connecting to serverURI %s with MQTT version %d", serverURI, command->command.details.conn.MQTTVersion);
+#if defined(OPENSSL)
+			rc = MQTTProtocol_connect(serverURI, command->client->c, command->client->ssl, command->command.details.conn.MQTTVersion);
+#else
+			rc = MQTTProtocol_connect(serverURI, command->client->c, command->command.details.conn.MQTTVersion);
+#endif
+			if (command->client->c->connect_state == 0)
+				rc = SOCKET_ERROR;
+
+			/* if the TCP connect is pending, then we must call select to determine when the connect has completed,
+			which is indicated by the socket being ready *either* for reading *or* writing.  The next couple of lines
+			make sure we check for writeability as well as readability, otherwise we wait around longer than we need to
+			in Socket_getReadySocket() */
+			if (rc == EINPROGRESS)
+				Socket_addPendingWrite(command->client->c->net.socket);
+		}
+	}
+	else if (command->command.type == SUBSCRIBE)
+	{
+		List* topics = ListInitialize();
+		List* qoss = ListInitialize();
+		int i;
+
+		for (i = 0; i < command->command.details.sub.count; i++)
+		{
+			ListAppend(topics, command->command.details.sub.topics[i], strlen(command->command.details.sub.topics[i]));
+			ListAppend(qoss, &command->command.details.sub.qoss[i], sizeof(int));
+		}
+		rc = MQTTProtocol_subscribe(command->client->c, topics, qoss, command->command.token);
+		ListFreeNoContent(topics);
+		ListFreeNoContent(qoss);
+	}
+	else if (command->command.type == UNSUBSCRIBE)
+	{
+		List* topics = ListInitialize();
+		int i;
+
+		for (i = 0; i < command->command.details.unsub.count; i++)
+			ListAppend(topics, command->command.details.unsub.topics[i], strlen(command->command.details.unsub.topics[i]));
+
+		rc = MQTTProtocol_unsubscribe(command->client->c, topics, command->command.token);
+		ListFreeNoContent(topics);
+	}
+	else if (command->command.type == PUBLISH)
+	{
+		Messages* msg = NULL;
+		Publish* p = NULL;
+
+		p = malloc(sizeof(Publish));
+
+		p->payload = command->command.details.pub.payload;
+		p->payloadlen = command->command.details.pub.payloadlen;
+		p->topic = command->command.details.pub.destinationName;
+		p->msgId = command->command.token;
+
+		rc = MQTTProtocol_startPublish(command->client->c, p, command->command.details.pub.qos, command->command.details.pub.retained, &msg);
+
+		if (command->command.details.pub.qos == 0)
+		{
+			if (rc == TCPSOCKET_COMPLETE)
+			{
+				if (command->command.onSuccess)
+				{
+					MQTTAsync_successData data;
+
+					data.token = command->command.token;
+					data.alt.pub.destinationName = command->command.details.pub.destinationName;
+					data.alt.pub.message.payload = command->command.details.pub.payload;
+					data.alt.pub.message.payloadlen = command->command.details.pub.payloadlen;
+					data.alt.pub.message.qos = command->command.details.pub.qos;
+					data.alt.pub.message.retained = command->command.details.pub.retained;
+					Log(TRACE_MIN, -1, "Calling publish success for client %s", command->client->c->clientID);
+					(*(command->command.onSuccess))(command->command.context, &data);
+				}
+			}
+			else
+			{
+				command->command.details.pub.destinationName = NULL; /* this will be freed by the protocol code */
+				command->client->pending_write = &command->command;
+			}
+		}
+		else
+			command->command.details.pub.destinationName = NULL; /* this will be freed by the protocol code */
+		free(p); /* should this be done if the write isn't complete? */
+	}
+	else if (command->command.type == DISCONNECT)
+	{
+		if (command->client->c->connect_state != 0 || command->client->c->connected != 0)
+		{
+			command->client->c->connect_state = -2;
+			MQTTAsync_checkDisconnect(command->client, &command->command);
+		}
+	}
+
+	if (command->command.type == CONNECT && rc != SOCKET_ERROR && rc != MQTTASYNC_PERSISTENCE_ERROR)
+	{
+		command->client->connect = command->command;
+		MQTTAsync_freeCommand(command);
+	}
+	else if (command->command.type == DISCONNECT)
+	{
+		command->client->disconnect = command->command;
+		MQTTAsync_freeCommand(command);
+	}
+	else if (command->command.type == PUBLISH && command->command.details.pub.qos == 0)
+	{
+		if (rc == TCPSOCKET_INTERRUPTED)
+			ListAppend(command->client->responses, command, sizeof(command));
+		else
+			MQTTAsync_freeCommand(command);
+	}
+	else if (rc == SOCKET_ERROR || rc == MQTTASYNC_PERSISTENCE_ERROR)
+	{
+		if (command->command.type == CONNECT)
+		{
+			MQTTAsync_disconnectOptions opts = MQTTAsync_disconnectOptions_initializer;
+			MQTTAsync_disconnect(command->client, &opts); /* not "internal" because we don't want to call connection lost */
+			command->client->shouldBeConnected = 1; /* as above call is not "internal" we need to reset this */
+		}
+		else
+			MQTTAsync_disconnect_internal(command->client, 0);
+
+		if (command->command.type == CONNECT && MQTTAsync_checkConn(&command->command, command->client))
+		{
+			Log(TRACE_MIN, -1, "Connect failed, more to try");
+
+                        if (command->client->c->MQTTVersion == MQTTVERSION_DEFAULT)
+                        {
+                            if (command->command.details.conn.MQTTVersion == MQTTVERSION_3_1)
+                            {
+                                command->command.details.conn.currentURI++;
+                                command->command.details.conn.MQTTVersion = MQTTVERSION_DEFAULT;
+                            }
+                        }
+                        else
+                            command->command.details.conn.currentURI++;
+
+			/* put the connect command back to the head of the command queue, using the next serverURI */
+			rc = MQTTAsync_addCommand(command, sizeof(command->command.details.conn));
+		}
+		else
+		{
+			if (command->command.onFailure)
+			{
+				Log(TRACE_MIN, -1, "Calling command failure for client %s", command->client->c->clientID);
+				(*(command->command.onFailure))(command->command.context, NULL);
+			}
+			MQTTAsync_freeCommand(command);  /* free up the command if necessary */
+		}
+	}
+	else /* put the command into a waiting for response queue for each client, indexed by msgid */
+		ListAppend(command->client->responses, command, sizeof(command));
+
+exit:
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	rc = (command != NULL);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void nextOrClose(MQTTAsyncs* m, int rc, char* message)
+{
+	if (MQTTAsync_checkConn(&m->connect, m))
+	{
+		MQTTAsync_queuedCommand* conn;
+
+		MQTTAsync_closeOnly(m->c);
+		/* put the connect command back to the head of the command queue, using the next serverURI */
+		conn = malloc(sizeof(MQTTAsync_queuedCommand));
+		memset(conn, '\0', sizeof(MQTTAsync_queuedCommand));
+		conn->client = m;
+		conn->command = m->connect;
+		Log(TRACE_MIN, -1, "Connect failed, more to try");
+
+                if (conn->client->c->MQTTVersion == MQTTVERSION_DEFAULT)
+                {
+                    if (conn->command.details.conn.MQTTVersion == MQTTVERSION_3_1)
+                    {
+                        conn->command.details.conn.currentURI++;
+                        conn->command.details.conn.MQTTVersion = MQTTVERSION_DEFAULT;
+                    }
+                }
+                else
+                    conn->command.details.conn.currentURI++;
+
+		MQTTAsync_addCommand(conn, sizeof(m->connect));
+	}
+	else
+	{
+		MQTTAsync_closeSession(m->c);
+	  if (m->connect.onFailure)
+		{
+			MQTTAsync_failureData data;
+
+			data.token = 0;
+			data.code = rc;
+			data.message = message;
+			Log(TRACE_MIN, -1, "Calling connect failure for client %s", m->c->clientID);
+			(*(m->connect.onFailure))(m->connect.context, &data);
+		}
+		MQTTAsync_startConnectRetry(m);
+	}
+}
+
+
+static void MQTTAsync_checkTimeouts(void)
+{
+	ListElement* current = NULL;
+	static time_t last = 0L;
+	time_t now;
+
+	FUNC_ENTRY;
+	time(&(now));
+	if (difftime(now, last) < 3)
+		goto exit;
+
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	last = now;
+	while (ListNextElement(handles, &current))		/* for each client */
+	{
+		ListElement* cur_response = NULL;
+		int i = 0,
+			timed_out_count = 0;
+
+		MQTTAsyncs* m = (MQTTAsyncs*)(current->content);
+
+		/* check disconnect timeout */
+		if (m->c->connect_state == -2)
+			MQTTAsync_checkDisconnect(m, &m->disconnect);
+
+		/* check connect timeout */
+		if (m->c->connect_state != 0 && MQTTAsync_elapsed(m->connect.start_time) > (m->connectTimeout * 1000))
+		{
+			nextOrClose(m, MQTTASYNC_FAILURE, "TCP connect timeout");
+			continue;
+		}
+
+		timed_out_count = 0;
+		/* check response timeouts */
+		while (ListNextElement(m->responses, &cur_response))
+		{
+			MQTTAsync_queuedCommand* com = (MQTTAsync_queuedCommand*)(cur_response->content);
+
+			if (1 /*MQTTAsync_elapsed(com->command.start_time) < 120000*/)
+				break; /* command has not timed out */
+			else
+			{
+				if (com->command.onFailure)
+				{
+					Log(TRACE_MIN, -1, "Calling %s failure for client %s",
+								MQTTPacket_name(com->command.type), m->c->clientID);
+					(*(com->command.onFailure))(com->command.context, NULL);
+				}
+				timed_out_count++;
+			}
+		}
+		for (i = 0; i < timed_out_count; ++i)
+			ListRemoveHead(m->responses);	/* remove the first response in the list */
+
+		if (m->automaticReconnect && m->retrying)
+		{
+			if (m->reconnectNow || MQTTAsync_elapsed(m->lastConnectionFailedTime) > (m->currentInterval * 1000))
+			{
+				/* to reconnect put the connect command to the head of the command queue */
+				MQTTAsync_queuedCommand* conn = malloc(sizeof(MQTTAsync_queuedCommand));
+				memset(conn, '\0', sizeof(MQTTAsync_queuedCommand));
+				conn->client = m;
+				conn->command = m->connect;
+	  			/* make sure that the version attempts are restarted */
+				if (m->c->MQTTVersion == MQTTVERSION_DEFAULT)
+					conn->command.details.conn.MQTTVersion = 0;
+				Log(TRACE_MIN, -1, "Automatically attempting to reconnect");
+				MQTTAsync_addCommand(conn, sizeof(m->connect));
+				m->reconnectNow = 0;
+			}
+		}
+	}
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+exit:
+	FUNC_EXIT;
+}
+
+
+static thread_return_type WINAPI MQTTAsync_sendThread(void* n)
+{
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	sendThread_state = RUNNING;
+	sendThread_id = Thread_getid();
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	while (!tostop)
+	{
+		int rc;
+
+		while (commands->count > 0)
+		{
+			if (MQTTAsync_processCommand() == 0)
+				break;  /* no commands were processed, so go into a wait */
+		}
+#if !defined(WIN32) && !defined(WIN64)
+		if ((rc = Thread_wait_cond(send_cond, 1)) != 0 && rc != ETIMEDOUT)
+			Log(LOG_ERROR, -1, "Error %d waiting for condition variable", rc);
+#else
+		if ((rc = Thread_wait_sem(send_sem, 1000)) != 0 && rc != ETIMEDOUT)
+			Log(LOG_ERROR, -1, "Error %d waiting for semaphore", rc);
+#endif
+
+		MQTTAsync_checkTimeouts();
+	}
+	sendThread_state = STOPPING;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	sendThread_state = STOPPED;
+	sendThread_id = 0;
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT;
+	return 0;
+}
+
+
+static void MQTTAsync_emptyMessageQueue(Clients* client)
+{
+	FUNC_ENTRY;
+	/* empty message queue */
+	if (client->messageQueue->count > 0)
+	{
+		ListElement* current = NULL;
+		while (ListNextElement(client->messageQueue, &current))
+		{
+			qEntry* qe = (qEntry*)(current->content);
+			free(qe->topicName);
+			free(qe->msg->payload);
+			free(qe->msg);
+		}
+		ListEmpty(client->messageQueue);
+	}
+	FUNC_EXIT;
+}
+
+
+static void MQTTAsync_removeResponsesAndCommands(MQTTAsyncs* m)
+{
+	int count = 0;
+	ListElement* current = NULL;
+	ListElement *next = NULL;
+
+	FUNC_ENTRY;
+	if (m->responses)
+	{
+		ListElement* cur_response = NULL;
+
+		while (ListNextElement(m->responses, &cur_response))
+		{
+			MQTTAsync_queuedCommand* command = (MQTTAsync_queuedCommand*)(cur_response->content);
+
+			if (command->command.onFailure)
+			{
+				MQTTAsync_failureData data;
+
+				data.token = command->command.token;
+				data.code = MQTTASYNC_OPERATION_INCOMPLETE; /* interrupted return code */
+				data.message = NULL;
+
+				Log(TRACE_MIN, -1, "Calling %s failure for client %s",
+						MQTTPacket_name(command->command.type), m->c->clientID);
+				(*(command->command.onFailure))(command->command.context, &data);
+			}
+
+			MQTTAsync_freeCommand1(command);
+			count++;
+		}
+	}
+	ListEmpty(m->responses);
+	Log(TRACE_MINIMUM, -1, "%d responses removed for client %s", count, m->c->clientID);
+
+	/* remove commands in the command queue relating to this client */
+	count = 0;
+	current = ListNextElement(commands, &next);
+	ListNextElement(commands, &next);
+	while (current)
+	{
+		MQTTAsync_queuedCommand* command = (MQTTAsync_queuedCommand*)(current->content);
+
+		if (command->client == m)
+		{
+			ListDetach(commands, command);
+
+			if (command->command.onFailure)
+			{
+				MQTTAsync_failureData data;
+
+				data.token = command->command.token;
+				data.code = MQTTASYNC_OPERATION_INCOMPLETE; /* interrupted return code */
+				data.message = NULL;
+
+				Log(TRACE_MIN, -1, "Calling %s failure for client %s",
+							MQTTPacket_name(command->command.type), m->c->clientID);
+					(*(command->command.onFailure))(command->command.context, &data);
+			}
+
+			MQTTAsync_freeCommand(command);
+			count++;
+		}
+		current = next;
+		ListNextElement(commands, &next);
+	}
+	Log(TRACE_MINIMUM, -1, "%d commands removed for client %s", count, m->c->clientID);
+	FUNC_EXIT;
+}
+
+
+void MQTTAsync_destroy(MQTTAsync* handle)
+{
+	MQTTAsyncs* m = *handle;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+
+	if (m == NULL)
+		goto exit;
+
+	MQTTAsync_removeResponsesAndCommands(m);
+	ListFree(m->responses);
+
+	if (m->c)
+	{
+		int saved_socket = m->c->net.socket;
+		char* saved_clientid = MQTTStrdup(m->c->clientID);
+#if !defined(NO_PERSISTENCE)
+		MQTTPersistence_close(m->c);
+#endif
+		MQTTAsync_emptyMessageQueue(m->c);
+		MQTTProtocol_freeClient(m->c);
+		if (!ListRemove(bstate->clients, m->c))
+			Log(LOG_ERROR, 0, NULL);
+		else
+			Log(TRACE_MIN, 1, NULL, saved_clientid, saved_socket);
+		free(saved_clientid);
+	}
+
+	if (m->serverURI)
+		free(m->serverURI);
+	if (m->createOptions)
+		free(m->createOptions);
+	MQTTAsync_freeServerURIs(m);
+	if (!ListRemove(handles, m))
+		Log(LOG_ERROR, -1, "free error");
+	*handle = NULL;
+	if (bstate->clients->count == 0)
+		MQTTAsync_terminate();
+
+exit:
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT;
+}
+
+
+void MQTTAsync_freeMessage(MQTTAsync_message** message)
+{
+	FUNC_ENTRY;
+	free((*message)->payload);
+	free(*message);
+	*message = NULL;
+	FUNC_EXIT;
+}
+
+
+void MQTTAsync_free(void* memory)
+{
+	FUNC_ENTRY;
+	free(memory);
+	FUNC_EXIT;
+}
+
+
+static int MQTTAsync_completeConnection(MQTTAsyncs* m, MQTTPacket* pack)
+{
+	int rc = MQTTASYNC_FAILURE;
+
+	FUNC_ENTRY;
+	if (m->c->connect_state == 3) /* MQTT connect sent - wait for CONNACK */
+	{
+		Connack* connack = (Connack*)pack;
+		Log(LOG_PROTOCOL, 1, NULL, m->c->net.socket, m->c->clientID, connack->rc);
+		if ((rc = connack->rc) == MQTTASYNC_SUCCESS)
+		{
+			m->retrying = 0;
+			m->c->connected = 1;
+			m->c->good = 1;
+			m->c->connect_state = 0;
+			if (m->c->cleansession)
+				rc = MQTTAsync_cleanSession(m->c);
+			if (m->c->outboundMsgs->count > 0)
+			{
+				ListElement* outcurrent = NULL;
+
+				while (ListNextElement(m->c->outboundMsgs, &outcurrent))
+				{
+					Messages* m = (Messages*)(outcurrent->content);
+					m->lastTouch = 0;
+				}
+				MQTTProtocol_retry((time_t)0, 1, 1);
+				if (m->c->connected != 1)
+					rc = MQTTASYNC_DISCONNECTED;
+			}
+		}
+		free(connack);
+		m->pack = NULL;
+#if !defined(WIN32) && !defined(WIN64)
+		Thread_signal_cond(send_cond);
+#else
+		if (!Thread_check_sem(send_sem))
+			Thread_post_sem(send_sem);
+#endif
+	}
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/* This is the thread function that handles the calling of callback functions if set */
+static thread_return_type WINAPI MQTTAsync_receiveThread(void* n)
+{
+	long timeout = 10L; /* first time in we have a small timeout.  Gets things started more quickly */
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	receiveThread_state = RUNNING;
+	receiveThread_id = Thread_getid();
+	while (!tostop)
+	{
+		int rc = SOCKET_ERROR;
+		int sock = -1;
+		MQTTAsyncs* m = NULL;
+		MQTTPacket* pack = NULL;
+
+		MQTTAsync_unlock_mutex(mqttasync_mutex);
+		pack = MQTTAsync_cycle(&sock, timeout, &rc);
+		MQTTAsync_lock_mutex(mqttasync_mutex);
+		if (tostop)
+			break;
+		timeout = 1000L;
+
+		if (sock == 0)
+			continue;
+		/* find client corresponding to socket */
+		if (ListFindItem(handles, &sock, clientSockCompare) == NULL)
+		{
+			Log(TRACE_MINIMUM, -1, "Could not find client corresponding to socket %d", sock);
+			/* Socket_close(sock); - removing socket in this case is not necessary (Bug 442400) */
+			continue;
+		}
+		m = (MQTTAsyncs*)(handles->current->content);
+		if (m == NULL)
+		{
+			Log(LOG_ERROR, -1, "Client structure was NULL for socket %d - removing socket", sock);
+			Socket_close(sock);
+			continue;
+		}
+		if (rc == SOCKET_ERROR)
+		{
+			Log(TRACE_MINIMUM, -1, "Error from MQTTAsync_cycle() - removing socket %d", sock);
+			if (m->c->connected == 1)
+			{
+				MQTTAsync_unlock_mutex(mqttasync_mutex);
+				MQTTAsync_disconnect_internal(m, 0);
+				MQTTAsync_lock_mutex(mqttasync_mutex);
+			}
+			else if (m->c->connect_state != 0)
+				nextOrClose(m, rc, "socket error");
+			else /* calling disconnect_internal won't have any effect if we're already disconnected */
+				MQTTAsync_closeOnly(m->c);
+		}
+		else
+		{
+			if (m->c->messageQueue->count > 0)
+			{
+				qEntry* qe = (qEntry*)(m->c->messageQueue->first->content);
+				int topicLen = qe->topicLen;
+
+				if (strlen(qe->topicName) == topicLen)
+					topicLen = 0;
+
+				if (m->ma)
+					rc = MQTTAsync_deliverMessage(m, qe->topicName, topicLen, qe->msg);
+				else
+					rc = 1;
+
+				if (rc)
+				{
+					ListRemove(m->c->messageQueue, qe);
+#if !defined(NO_PERSISTENCE)
+					if (m->c->persistence)
+						MQTTPersistence_unpersistQueueEntry(m->c, (MQTTPersistence_qEntry*)qe);
+#endif
+				}
+				else
+					Log(TRACE_MIN, -1, "False returned from messageArrived for client %s, message remains on queue",
+						m->c->clientID);
+			}
+			if (pack)
+			{
+				if (pack->header.bits.type == CONNACK)
+				{
+					int sessionPresent = ((Connack*)pack)->flags.bits.sessionPresent;
+					int rc = MQTTAsync_completeConnection(m, pack);
+
+					if (rc == MQTTASYNC_SUCCESS)
+					{
+						int onSuccess = 0;
+						if (m->serverURIcount > 0)
+							Log(TRACE_MIN, -1, "Connect succeeded to %s",
+								m->serverURIs[m->connect.details.conn.currentURI]);
+						onSuccess = (m->connect.onSuccess != NULL); /* save setting of onSuccess callback */
+						if (m->connect.onSuccess)
+						{
+							MQTTAsync_successData data;
+							memset(&data, '\0', sizeof(data));
+							Log(TRACE_MIN, -1, "Calling connect success for client %s", m->c->clientID);
+							if (m->serverURIcount > 0)
+								data.alt.connect.serverURI = m->serverURIs[m->connect.details.conn.currentURI];
+							else
+								data.alt.connect.serverURI = m->serverURI;
+							data.alt.connect.MQTTVersion = m->connect.details.conn.MQTTVersion;
+							data.alt.connect.sessionPresent = sessionPresent;
+							(*(m->connect.onSuccess))(m->connect.context, &data);
+							m->connect.onSuccess = NULL; /* don't accidentally call it again */
+						}
+						if (m->connected)
+						{
+							char* reason = (onSuccess) ? "connect onSuccess called" : "automatic reconnect";
+							Log(TRACE_MIN, -1, "Calling connected for client %s", m->c->clientID);
+							(*(m->connected))(m->connected_context, reason);
+						}
+					}
+					else
+						nextOrClose(m, rc, "CONNACK return code");
+				}
+				else if (pack->header.bits.type == SUBACK)
+				{
+					ListElement* current = NULL;
+
+					/* use the msgid to find the callback to be called */
+					while (ListNextElement(m->responses, &current))
+					{
+						MQTTAsync_queuedCommand* command = (MQTTAsync_queuedCommand*)(current->content);
+						if (command->command.token == ((Suback*)pack)->msgId)
+						{
+							Suback* sub = (Suback*)pack;
+							if (!ListDetach(m->responses, command)) /* remove the response from the list */
+								Log(LOG_ERROR, -1, "Subscribe command not removed from command list");
+
+							/* Call the failure callback if there is one subscribe in the MQTT packet and
+							 * the return code is 0x80 (failure).  If the MQTT packet contains >1 subscription
+							 * request, then we call onSuccess with the list of returned QoSs, which inelegantly,
+							 * could include some failures, or worse, the whole list could have failed.
+							 */
+							if (sub->qoss->count == 1 && *(int*)(sub->qoss->first->content) == MQTT_BAD_SUBSCRIBE)
+							{
+								if (command->command.onFailure)
+								{
+									MQTTAsync_failureData data;
+
+									data.token = command->command.token;
+									data.code = *(int*)(sub->qoss->first->content);
+									data.message = NULL;
+									Log(TRACE_MIN, -1, "Calling subscribe failure for client %s", m->c->clientID);
+									(*(command->command.onFailure))(command->command.context, &data);
+								}
+							}
+							else if (command->command.onSuccess)
+							{
+								MQTTAsync_successData data;
+								int* array = NULL;
+
+								if (sub->qoss->count == 1)
+									data.alt.qos = *(int*)(sub->qoss->first->content);
+								else if (sub->qoss->count > 1)
+								{
+									ListElement* cur_qos = NULL;
+									int* element = array = data.alt.qosList = malloc(sub->qoss->count * sizeof(int));
+									while (ListNextElement(sub->qoss, &cur_qos))
+										*element++ = *(int*)(cur_qos->content);
+								}
+								data.token = command->command.token;
+								Log(TRACE_MIN, -1, "Calling subscribe success for client %s", m->c->clientID);
+								(*(command->command.onSuccess))(command->command.context, &data);
+								if (array)
+									free(array);
+							}
+							MQTTAsync_freeCommand(command);
+							break;
+						}
+					}
+					rc = MQTTProtocol_handleSubacks(pack, m->c->net.socket);
+				}
+				else if (pack->header.bits.type == UNSUBACK)
+				{
+					ListElement* current = NULL;
+					int handleCalled = 0;
+
+					/* use the msgid to find the callback to be called */
+					while (ListNextElement(m->responses, &current))
+					{
+						MQTTAsync_queuedCommand* command = (MQTTAsync_queuedCommand*)(current->content);
+						if (command->command.token == ((Unsuback*)pack)->msgId)
+						{
+							if (!ListDetach(m->responses, command)) /* remove the response from the list */
+								Log(LOG_ERROR, -1, "Unsubscribe command not removed from command list");
+							if (command->command.onSuccess)
+							{
+								rc = MQTTProtocol_handleUnsubacks(pack, m->c->net.socket);
+								handleCalled = 1;
+								Log(TRACE_MIN, -1, "Calling unsubscribe success for client %s", m->c->clientID);
+								(*(command->command.onSuccess))(command->command.context, NULL);
+							}
+							MQTTAsync_freeCommand(command);
+							break;
+						}
+					}
+					if (!handleCalled)
+						rc = MQTTProtocol_handleUnsubacks(pack, m->c->net.socket);
+				}
+			}
+		}
+	}
+	receiveThread_state = STOPPED;
+	receiveThread_id = 0;
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+#if !defined(WIN32) && !defined(WIN64)
+	if (sendThread_state != STOPPED)
+		Thread_signal_cond(send_cond);
+#else
+	if (sendThread_state != STOPPED && !Thread_check_sem(send_sem))
+		Thread_post_sem(send_sem);
+#endif
+	FUNC_EXIT;
+	return 0;
+}
+
+
+static void MQTTAsync_stop(void)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (sendThread_state != STOPPED || receiveThread_state != STOPPED)
+	{
+		int conn_count = 0;
+		ListElement* current = NULL;
+
+		if (handles != NULL)
+		{
+			/* find out how many handles are still connected */
+			while (ListNextElement(handles, &current))
+			{
+				if (((MQTTAsyncs*)(current->content))->c->connect_state > 0 ||
+						((MQTTAsyncs*)(current->content))->c->connected)
+					++conn_count;
+			}
+		}
+		Log(TRACE_MIN, -1, "Conn_count is %d", conn_count);
+		/* stop the background thread, if we are the last one to be using it */
+		if (conn_count == 0)
+		{
+			int count = 0;
+			tostop = 1;
+			while ((sendThread_state != STOPPED || receiveThread_state != STOPPED) && ++count < 100)
+			{
+				MQTTAsync_unlock_mutex(mqttasync_mutex);
+				Log(TRACE_MIN, -1, "sleeping");
+				MQTTAsync_sleep(100L);
+				MQTTAsync_lock_mutex(mqttasync_mutex);
+			}
+			rc = 1;
+			tostop = 0;
+		}
+	}
+	FUNC_EXIT_RC(rc);
+}
+
+
+int MQTTAsync_setCallbacks(MQTTAsync handle, void* context,
+									MQTTAsync_connectionLost* cl,
+									MQTTAsync_messageArrived* ma,
+									MQTTAsync_deliveryComplete* dc)
+{
+	int rc = MQTTASYNC_SUCCESS;
+	MQTTAsyncs* m = handle;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+
+	if (m == NULL || ma == NULL || m->c->connect_state != 0)
+		rc = MQTTASYNC_FAILURE;
+	else
+	{
+		m->context = context;
+		m->cl = cl;
+		m->ma = ma;
+		m->dc = dc;
+	}
+
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTAsync_setConnected(MQTTAsync handle, void* context, MQTTAsync_connected* connected)
+{
+	int rc = MQTTASYNC_SUCCESS;
+	MQTTAsyncs* m = handle;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+
+	if (m == NULL || m->c->connect_state != 0)
+		rc = MQTTASYNC_FAILURE;
+	else
+	{
+		m->connected_context = context;
+		m->connected = connected;
+	}
+
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void MQTTAsync_closeOnly(Clients* client)
+{
+	FUNC_ENTRY;
+	client->good = 0;
+	client->ping_outstanding = 0;
+	if (client->net.socket > 0)
+	{
+		if (client->connected)
+			MQTTPacket_send_disconnect(&client->net, client->clientID);
+		Thread_lock_mutex(socket_mutex);
+#if defined(OPENSSL)
+		SSLSocket_close(&client->net);
+#endif
+		Socket_close(client->net.socket);
+		client->net.socket = 0;
+#if defined(OPENSSL)
+		client->net.ssl = NULL;
+#endif
+		Thread_unlock_mutex(socket_mutex);
+	}
+	client->connected = 0;
+	client->connect_state = 0;
+	FUNC_EXIT;
+}
+
+
+static void MQTTAsync_closeSession(Clients* client)
+{
+	FUNC_ENTRY;
+	MQTTAsync_closeOnly(client);
+
+	if (client->cleansession)
+		MQTTAsync_cleanSession(client);
+
+	FUNC_EXIT;
+}
+
+
+/**
+ * List callback function for comparing clients by client structure
+ * @param a Async structure
+ * @param b Client structure
+ * @return boolean indicating whether a and b are equal
+ */
+static int clientStructCompare(void* a, void* b)
+{
+	MQTTAsyncs* m = (MQTTAsyncs*)a;
+	return m->c == (Clients*)b;
+}
+
+
+static int MQTTAsync_cleanSession(Clients* client)
+{
+	int rc = 0;
+	ListElement* found = NULL;
+
+	FUNC_ENTRY;
+#if !defined(NO_PERSISTENCE)
+	rc = MQTTPersistence_clear(client);
+#endif
+	MQTTProtocol_emptyMessageList(client->inboundMsgs);
+	MQTTProtocol_emptyMessageList(client->outboundMsgs);
+	MQTTAsync_emptyMessageQueue(client);
+	client->msgID = 0;
+
+	if ((found = ListFindItem(handles, client, clientStructCompare)) != NULL)
+	{
+		MQTTAsyncs* m = (MQTTAsyncs*)(found->content);
+		MQTTAsync_removeResponsesAndCommands(m);
+	}
+	else
+		Log(LOG_ERROR, -1, "cleanSession: did not find client structure in handles list");
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static int MQTTAsync_deliverMessage(MQTTAsyncs* m, char* topicName, size_t topicLen, MQTTAsync_message* mm)
+{
+	int rc;
+
+	Log(TRACE_MIN, -1, "Calling messageArrived for client %s, queue depth %d",
+					m->c->clientID, m->c->messageQueue->count);
+	rc = (*(m->ma))(m->context, topicName, (int)topicLen, mm);
+	/* if 0 (false) is returned by the callback then it failed, so we don't remove the message from
+	 * the queue, and it will be retried later.  If 1 is returned then the message data may have been freed,
+	 * so we must be careful how we use it.
+	 */
+	return rc;
+}
+
+
+void Protocol_processPublication(Publish* publish, Clients* client)
+{
+	MQTTAsync_message* mm = NULL;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	mm = malloc(sizeof(MQTTAsync_message));
+
+	/* If the message is QoS 2, then we have already stored the incoming payload
+	 * in an allocated buffer, so we don't need to copy again.
+	 */
+	if (publish->header.bits.qos == 2)
+		mm->payload = publish->payload;
+	else
+	{
+		mm->payload = malloc(publish->payloadlen);
+		memcpy(mm->payload, publish->payload, publish->payloadlen);
+	}
+
+	mm->payloadlen = publish->payloadlen;
+	mm->qos = publish->header.bits.qos;
+	mm->retained = publish->header.bits.retain;
+	if (publish->header.bits.qos == 2)
+		mm->dup = 0;  /* ensure that a QoS2 message is not passed to the application with dup = 1 */
+	else
+		mm->dup = publish->header.bits.dup;
+	mm->msgid = publish->msgId;
+
+	if (client->messageQueue->count == 0 && client->connected)
+	{
+		ListElement* found = NULL;
+
+		if ((found = ListFindItem(handles, client, clientStructCompare)) == NULL)
+			Log(LOG_ERROR, -1, "processPublication: did not find client structure in handles list");
+		else
+		{
+			MQTTAsyncs* m = (MQTTAsyncs*)(found->content);
+
+			if (m->ma)
+				rc = MQTTAsync_deliverMessage(m, publish->topic, publish->topiclen, mm);
+		}
+	}
+
+	if (rc == 0) /* if message was not delivered, queue it up */
+	{
+		qEntry* qe = malloc(sizeof(qEntry));
+		qe->msg = mm;
+		qe->topicName = publish->topic;
+		qe->topicLen = publish->topiclen;
+		ListAppend(client->messageQueue, qe, sizeof(qe) + sizeof(mm) + mm->payloadlen + strlen(qe->topicName)+1);
+#if !defined(NO_PERSISTENCE)
+		if (client->persistence)
+			MQTTPersistence_persistQueueEntry(client, (MQTTPersistence_qEntry*)qe);
+#endif
+	}
+	publish->topic = NULL;
+	FUNC_EXIT;
+}
+
+
+static int retryLoopInterval = 5;
+
+static void setRetryLoopInterval(int keepalive)
+{
+	int proposed = keepalive / 10;
+
+	if (proposed < 1)
+		proposed = 1;
+	else if (proposed > 5)
+		proposed = 5;
+	if (proposed < retryLoopInterval)
+		retryLoopInterval = proposed;
+}
+
+
+int MQTTAsync_connect(MQTTAsync handle, const MQTTAsync_connectOptions* options)
+{
+	MQTTAsyncs* m = handle;
+	int rc = MQTTASYNC_SUCCESS;
+	MQTTAsync_queuedCommand* conn;
+
+	FUNC_ENTRY;
+	if (options == NULL)
+	{
+		rc = MQTTASYNC_NULL_PARAMETER;
+		goto exit;
+	}
+
+	if (strncmp(options->struct_id, "MQTC", 4) != 0 || options->struct_version < 0 || options->struct_version > 5)
+	{
+		rc = MQTTASYNC_BAD_STRUCTURE;
+		goto exit;
+	}
+	if (options->will) /* check validity of will options structure */
+	{
+		if (strncmp(options->will->struct_id, "MQTW", 4) != 0 || (options->will->struct_version != 0 && options->will->struct_version != 1))
+		{
+			rc = MQTTASYNC_BAD_STRUCTURE;
+			goto exit;
+		}
+		if (options->will->qos < 0 || options->will->qos > 2)
+		{
+			rc = MQTTASYNC_BAD_QOS;
+			goto exit;
+		}
+	}
+	if (options->struct_version != 0 && options->ssl) /* check validity of SSL options structure */
+	{
+		if (strncmp(options->ssl->struct_id, "MQTS", 4) != 0 || options->ssl->struct_version < 0 || options->ssl->struct_version > 1)
+		{
+			rc = MQTTASYNC_BAD_STRUCTURE;
+			goto exit;
+		}
+	}
+	if ((options->username && !UTF8_validateString(options->username)) ||
+		(options->password && !UTF8_validateString(options->password)))
+	{
+		rc = MQTTASYNC_BAD_UTF8_STRING;
+		goto exit;
+	}
+
+	m->connect.onSuccess = options->onSuccess;
+	m->connect.onFailure = options->onFailure;
+	m->connect.context = options->context;
+	m->connectTimeout = options->connectTimeout;
+
+	tostop = 0;
+	if (sendThread_state != STARTING && sendThread_state != RUNNING)
+	{
+		MQTTAsync_lock_mutex(mqttasync_mutex);
+		sendThread_state = STARTING;
+		Thread_start(MQTTAsync_sendThread, NULL);
+		MQTTAsync_unlock_mutex(mqttasync_mutex);
+	}
+	if (receiveThread_state != STARTING && receiveThread_state != RUNNING)
+	{
+		MQTTAsync_lock_mutex(mqttasync_mutex);
+		receiveThread_state = STARTING;
+		Thread_start(MQTTAsync_receiveThread, handle);
+		MQTTAsync_unlock_mutex(mqttasync_mutex);
+	}
+
+	m->c->keepAliveInterval = options->keepAliveInterval;
+	setRetryLoopInterval(options->keepAliveInterval);
+	m->c->cleansession = options->cleansession;
+	m->c->maxInflightMessages = options->maxInflight;
+	if (options->struct_version >= 3)
+		m->c->MQTTVersion = options->MQTTVersion;
+	else
+		m->c->MQTTVersion = 0;
+	if (options->struct_version >= 4)
+	{
+		m->automaticReconnect = options->automaticReconnect;
+		m->minRetryInterval = options->minRetryInterval;
+		m->maxRetryInterval = options->maxRetryInterval;
+	}
+
+	if (m->c->will)
+	{
+		free(m->c->will->payload);
+		free(m->c->will->topic);
+		free(m->c->will);
+		m->c->will = NULL;
+	}
+
+	if (options->will && (options->will->struct_version == 0 || options->will->struct_version == 1))
+	{
+		const void* source = NULL;
+
+		m->c->will = malloc(sizeof(willMessages));
+		if (options->will->message || (options->will->struct_version == 1 && options->will->payload.data))
+		{
+			if (options->will->struct_version == 1 && options->will->payload.data)
+			{
+				m->c->will->payloadlen = options->will->payload.len;
+				source = options->will->payload.data;
+			}
+			else
+			{
+				m->c->will->payloadlen = strlen(options->will->message);
+				source = (void*)options->will->message;
+			}
+			m->c->will->payload = malloc(m->c->will->payloadlen);
+			memcpy(m->c->will->payload, source, m->c->will->payloadlen);
+		}
+		else
+		{
+			m->c->will->payload = NULL;
+			m->c->will->payloadlen = 0;
+		}
+		m->c->will->qos = options->will->qos;
+		m->c->will->retained = options->will->retained;
+		m->c->will->topic = MQTTStrdup(options->will->topicName);
+	}
+
+#if defined(OPENSSL)
+	if (m->c->sslopts)
+	{
+		if (m->c->sslopts->trustStore)
+			free((void*)m->c->sslopts->trustStore);
+		if (m->c->sslopts->keyStore)
+			free((void*)m->c->sslopts->keyStore);
+		if (m->c->sslopts->privateKey)
+			free((void*)m->c->sslopts->privateKey);
+		if (m->c->sslopts->privateKeyPassword)
+			free((void*)m->c->sslopts->privateKeyPassword);
+		if (m->c->sslopts->enabledCipherSuites)
+			free((void*)m->c->sslopts->enabledCipherSuites);
+		free((void*)m->c->sslopts);
+		m->c->sslopts = NULL;
+	}
+
+	if (options->struct_version != 0 && options->ssl)
+	{
+		m->c->sslopts = malloc(sizeof(MQTTClient_SSLOptions));
+		memset(m->c->sslopts, '\0', sizeof(MQTTClient_SSLOptions));
+		m->c->sslopts->struct_version = options->ssl->struct_version;
+		if (options->ssl->trustStore)
+			m->c->sslopts->trustStore = MQTTStrdup(options->ssl->trustStore);
+		if (options->ssl->keyStore)
+			m->c->sslopts->keyStore = MQTTStrdup(options->ssl->keyStore);
+		if (options->ssl->privateKey)
+			m->c->sslopts->privateKey = MQTTStrdup(options->ssl->privateKey);
+		if (options->ssl->privateKeyPassword)
+			m->c->sslopts->privateKeyPassword = MQTTStrdup(options->ssl->privateKeyPassword);
+		if (options->ssl->enabledCipherSuites)
+			m->c->sslopts->enabledCipherSuites = MQTTStrdup(options->ssl->enabledCipherSuites);
+		m->c->sslopts->enableServerCertAuth = options->ssl->enableServerCertAuth;
+		if (m->c->sslopts->struct_version >= 1)
+			m->c->sslopts->sslVersion = options->ssl->sslVersion;
+	}
+#else
+	if (options->struct_version != 0 && options->ssl)
+	{
+		rc = MQTTASYNC_SSL_NOT_SUPPORTED;
+		goto exit;
+	}
+#endif
+
+	m->c->username = options->username;
+	m->c->password = options->password;
+	if (options->password)
+		m->c->passwordlen = strlen(options->password);
+	else if (options->struct_version >= 5 && options->binarypwd.data)
+	{
+		m->c->password = options->binarypwd.data;
+		m->c->passwordlen = options->binarypwd.len;
+	}
+
+	m->c->retryInterval = options->retryInterval;
+	m->shouldBeConnected = 1;
+
+	m->connectTimeout = options->connectTimeout;
+
+	MQTTAsync_freeServerURIs(m);
+	if (options->struct_version >= 2 && options->serverURIcount > 0)
+	{
+		int i;
+
+		m->serverURIcount = options->serverURIcount;
+		m->serverURIs = malloc(options->serverURIcount * sizeof(char*));
+		for (i = 0; i < options->serverURIcount; ++i)
+			m->serverURIs[i] = MQTTStrdup(options->serverURIs[i]);
+	}
+
+	/* Add connect request to operation queue */
+	conn = malloc(sizeof(MQTTAsync_queuedCommand));
+	memset(conn, '\0', sizeof(MQTTAsync_queuedCommand));
+	conn->client = m;
+	if (options)
+	{
+		conn->command.onSuccess = options->onSuccess;
+		conn->command.onFailure = options->onFailure;
+		conn->command.context = options->context;
+	}
+	conn->command.type = CONNECT;
+	conn->command.details.conn.currentURI = 0;
+	rc = MQTTAsync_addCommand(conn, sizeof(conn));
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static int MQTTAsync_disconnect1(MQTTAsync handle, const MQTTAsync_disconnectOptions* options, int internal)
+{
+	MQTTAsyncs* m = handle;
+	int rc = MQTTASYNC_SUCCESS;
+	MQTTAsync_queuedCommand* dis;
+
+	FUNC_ENTRY;
+	if (m == NULL || m->c == NULL)
+	{
+		rc = MQTTASYNC_FAILURE;
+		goto exit;
+	}
+	if (!internal)
+		m->shouldBeConnected = 0;
+	if (m->c->connected == 0)
+	{
+		rc = MQTTASYNC_DISCONNECTED;
+		goto exit;
+	}
+
+	/* Add disconnect request to operation queue */
+	dis = malloc(sizeof(MQTTAsync_queuedCommand));
+	memset(dis, '\0', sizeof(MQTTAsync_queuedCommand));
+	dis->client = m;
+	if (options)
+	{
+		dis->command.onSuccess = options->onSuccess;
+		dis->command.onFailure = options->onFailure;
+		dis->command.context = options->context;
+		dis->command.details.dis.timeout = options->timeout;
+	}
+	dis->command.type = DISCONNECT;
+	dis->command.details.dis.internal = internal;
+	rc = MQTTAsync_addCommand(dis, sizeof(dis));
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static int MQTTAsync_disconnect_internal(MQTTAsync handle, int timeout)
+{
+	MQTTAsync_disconnectOptions options = MQTTAsync_disconnectOptions_initializer;
+
+	options.timeout = timeout;
+	return MQTTAsync_disconnect1(handle, &options, 1);
+}
+
+
+void MQTTProtocol_closeSession(Clients* c, int sendwill)
+{
+	MQTTAsync_disconnect_internal((MQTTAsync)c->context, 0);
+}
+
+
+int MQTTAsync_disconnect(MQTTAsync handle, const MQTTAsync_disconnectOptions* options)
+{
+	return MQTTAsync_disconnect1(handle, options, 0);
+}
+
+
+int MQTTAsync_isConnected(MQTTAsync handle)
+{
+	MQTTAsyncs* m = handle;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	if (m && m->c)
+		rc = m->c->connected;
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static int cmdMessageIDCompare(void* a, void* b)
+{
+	MQTTAsync_queuedCommand* cmd = (MQTTAsync_queuedCommand*)a;
+	return cmd->command.token == *(int*)b;
+}
+
+
+/**
+ * Assign a new message id for a client.  Make sure it isn't already being used and does
+ * not exceed the maximum.
+ * @param m a client structure
+ * @return the next message id to use, or 0 if none available
+ */
+static int MQTTAsync_assignMsgId(MQTTAsyncs* m)
+{
+	int start_msgid = m->c->msgID;
+	int msgid = start_msgid;
+	thread_id_type thread_id = 0;
+	int locked = 0;
+
+	/* need to check: commands list and response list for a client */
+	FUNC_ENTRY;
+	/* We might be called in a callback. In which case, this mutex will be already locked. */
+	thread_id = Thread_getid();
+	if (thread_id != sendThread_id && thread_id != receiveThread_id)
+	{
+		MQTTAsync_lock_mutex(mqttasync_mutex);
+		locked = 1;
+	}
+
+	msgid = (msgid == MAX_MSG_ID) ? 1 : msgid + 1;
+	while (ListFindItem(commands, &msgid, cmdMessageIDCompare) ||
+			ListFindItem(m->responses, &msgid, cmdMessageIDCompare))
+	{
+		msgid = (msgid == MAX_MSG_ID) ? 1 : msgid + 1;
+		if (msgid == start_msgid)
+		{ /* we've tried them all - none free */
+			msgid = 0;
+			break;
+		}
+	}
+	if (msgid != 0)
+		m->c->msgID = msgid;
+	if (locked)
+		MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT_RC(msgid);
+	return msgid;
+}
+
+
+int MQTTAsync_subscribeMany(MQTTAsync handle, int count, char* const* topic, int* qos, MQTTAsync_responseOptions* response)
+{
+	MQTTAsyncs* m = handle;
+	int i = 0;
+	int rc = MQTTASYNC_FAILURE;
+	MQTTAsync_queuedCommand* sub;
+	int msgid = 0;
+
+	FUNC_ENTRY;
+	if (m == NULL || m->c == NULL)
+	{
+		rc = MQTTASYNC_FAILURE;
+		goto exit;
+	}
+	if (m->c->connected == 0)
+	{
+		rc = MQTTASYNC_DISCONNECTED;
+		goto exit;
+	}
+	for (i = 0; i < count; i++)
+	{
+		if (!UTF8_validateString(topic[i]))
+		{
+			rc = MQTTASYNC_BAD_UTF8_STRING;
+			goto exit;
+		}
+		if (qos[i] < 0 || qos[i] > 2)
+		{
+			rc = MQTTASYNC_BAD_QOS;
+			goto exit;
+		}
+	}
+	if ((msgid = MQTTAsync_assignMsgId(m)) == 0)
+	{
+		rc = MQTTASYNC_NO_MORE_MSGIDS;
+		goto exit;
+	}
+
+	/* Add subscribe request to operation queue */
+	sub = malloc(sizeof(MQTTAsync_queuedCommand));
+	memset(sub, '\0', sizeof(MQTTAsync_queuedCommand));
+	sub->client = m;
+	sub->command.token = msgid;
+	if (response)
+	{
+		sub->command.onSuccess = response->onSuccess;
+		sub->command.onFailure = response->onFailure;
+		sub->command.context = response->context;
+		response->token = sub->command.token;
+	}
+	sub->command.type = SUBSCRIBE;
+	sub->command.details.sub.count = count;
+	sub->command.details.sub.topics = malloc(sizeof(char*) * count);
+	sub->command.details.sub.qoss = malloc(sizeof(int) * count);
+	for (i = 0; i < count; ++i)
+	{
+		sub->command.details.sub.topics[i] = MQTTStrdup(topic[i]);
+		sub->command.details.sub.qoss[i] = qos[i];
+	}
+	rc = MQTTAsync_addCommand(sub, sizeof(sub));
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTAsync_subscribe(MQTTAsync handle, const char* topic, int qos, MQTTAsync_responseOptions* response)
+{
+	int rc = 0;
+	char *const topics[] = {(char*)topic};
+	FUNC_ENTRY;
+	rc = MQTTAsync_subscribeMany(handle, 1, topics, &qos, response);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTAsync_unsubscribeMany(MQTTAsync handle, int count, char* const* topic, MQTTAsync_responseOptions* response)
+{
+	MQTTAsyncs* m = handle;
+	int i = 0;
+	int rc = SOCKET_ERROR;
+	MQTTAsync_queuedCommand* unsub;
+	int msgid = 0;
+
+	FUNC_ENTRY;
+	if (m == NULL || m->c == NULL)
+	{
+		rc = MQTTASYNC_FAILURE;
+		goto exit;
+	}
+	if (m->c->connected == 0)
+	{
+		rc = MQTTASYNC_DISCONNECTED;
+		goto exit;
+	}
+	for (i = 0; i < count; i++)
+	{
+		if (!UTF8_validateString(topic[i]))
+		{
+			rc = MQTTASYNC_BAD_UTF8_STRING;
+			goto exit;
+		}
+	}
+	if ((msgid = MQTTAsync_assignMsgId(m)) == 0)
+	{
+		rc = MQTTASYNC_NO_MORE_MSGIDS;
+		goto exit;
+	}
+
+	/* Add unsubscribe request to operation queue */
+	unsub = malloc(sizeof(MQTTAsync_queuedCommand));
+	memset(unsub, '\0', sizeof(MQTTAsync_queuedCommand));
+	unsub->client = m;
+	unsub->command.type = UNSUBSCRIBE;
+	unsub->command.token = msgid;
+	if (response)
+	{
+		unsub->command.onSuccess = response->onSuccess;
+		unsub->command.onFailure = response->onFailure;
+		unsub->command.context = response->context;
+		response->token = unsub->command.token;
+	}
+	unsub->command.details.unsub.count = count;
+	unsub->command.details.unsub.topics = malloc(sizeof(char*) * count);
+	for (i = 0; i < count; ++i)
+		unsub->command.details.unsub.topics[i] = MQTTStrdup(topic[i]);
+	rc = MQTTAsync_addCommand(unsub, sizeof(unsub));
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTAsync_unsubscribe(MQTTAsync handle, const char* topic, MQTTAsync_responseOptions* response)
+{
+	int rc = 0;
+	char *const topics[] = {(char*)topic};
+	FUNC_ENTRY;
+	rc = MQTTAsync_unsubscribeMany(handle, 1, topics, response);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static int MQTTAsync_countBufferedMessages(MQTTAsyncs* m)
+{
+	ListElement* current = NULL;
+	int count = 0;
+
+	while (ListNextElement(commands, &current))
+	{
+		MQTTAsync_queuedCommand* cmd = (MQTTAsync_queuedCommand*)(current->content);
+
+		if (cmd->client == m && cmd->command.type == PUBLISH)
+			count++;
+	}
+	return count;
+}
+
+
+int MQTTAsync_send(MQTTAsync handle, const char* destinationName, int payloadlen, void* payload,
+							 int qos, int retained, MQTTAsync_responseOptions* response)
+{
+	int rc = MQTTASYNC_SUCCESS;
+	MQTTAsyncs* m = handle;
+	MQTTAsync_queuedCommand* pub;
+	int msgid = 0;
+
+	FUNC_ENTRY;
+	if (m == NULL || m->c == NULL)
+		rc = MQTTASYNC_FAILURE;
+	else if (m->c->connected == 0 && (m->createOptions == NULL ||
+		m->createOptions->sendWhileDisconnected == 0 || m->shouldBeConnected == 0))
+		rc = MQTTASYNC_DISCONNECTED;
+	else if (!UTF8_validateString(destinationName))
+		rc = MQTTASYNC_BAD_UTF8_STRING;
+	else if (qos < 0 || qos > 2)
+		rc = MQTTASYNC_BAD_QOS;
+	else if (qos > 0 && (msgid = MQTTAsync_assignMsgId(m)) == 0)
+		rc = MQTTASYNC_NO_MORE_MSGIDS;
+	else if (m->createOptions && (MQTTAsync_countBufferedMessages(m) >= m->createOptions->maxBufferedMessages))
+		rc = MQTTASYNC_MAX_BUFFERED_MESSAGES;
+
+	if (rc != MQTTASYNC_SUCCESS)
+		goto exit;
+
+	/* Add publish request to operation queue */
+	pub = malloc(sizeof(MQTTAsync_queuedCommand));
+	memset(pub, '\0', sizeof(MQTTAsync_queuedCommand));
+	pub->client = m;
+	pub->command.type = PUBLISH;
+	pub->command.token = msgid;
+	if (response)
+	{
+		pub->command.onSuccess = response->onSuccess;
+		pub->command.onFailure = response->onFailure;
+		pub->command.context = response->context;
+		response->token = pub->command.token;
+	}
+	pub->command.details.pub.destinationName = MQTTStrdup(destinationName);
+	pub->command.details.pub.payloadlen = payloadlen;
+	pub->command.details.pub.payload = malloc(payloadlen);
+	memcpy(pub->command.details.pub.payload, payload, payloadlen);
+	pub->command.details.pub.qos = qos;
+	pub->command.details.pub.retained = retained;
+	rc = MQTTAsync_addCommand(pub, sizeof(pub));
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+
+int MQTTAsync_sendMessage(MQTTAsync handle, const char* destinationName, const MQTTAsync_message* message,
+													 MQTTAsync_responseOptions* response)
+{
+	int rc = MQTTASYNC_SUCCESS;
+
+	FUNC_ENTRY;
+	if (message == NULL)
+	{
+		rc = MQTTASYNC_NULL_PARAMETER;
+		goto exit;
+	}
+	if (strncmp(message->struct_id, "MQTM", 4) != 0 || message->struct_version != 0)
+	{
+		rc = MQTTASYNC_BAD_STRUCTURE;
+		goto exit;
+	}
+
+	rc = MQTTAsync_send(handle, destinationName, message->payloadlen, message->payload,
+								message->qos, message->retained, response);
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void MQTTAsync_retry(void)
+{
+	static time_t last = 0L;
+	time_t now;
+
+	FUNC_ENTRY;
+	time(&(now));
+	if (difftime(now, last) > retryLoopInterval)
+	{
+		time(&(last));
+		MQTTProtocol_keepalive(now);
+		MQTTProtocol_retry(now, 1, 0);
+	}
+	else
+		MQTTProtocol_retry(now, 0, 0);
+	FUNC_EXIT;
+}
+
+
+static int MQTTAsync_connecting(MQTTAsyncs* m)
+{
+	int rc = -1;
+
+	FUNC_ENTRY;
+	if (m->c->connect_state == 1) /* TCP connect started - check for completion */
+	{
+		int error;
+		socklen_t len = sizeof(error);
+
+		if ((rc = getsockopt(m->c->net.socket, SOL_SOCKET, SO_ERROR, (char*)&error, &len)) == 0)
+			rc = error;
+
+		if (rc != 0)
+			goto exit;
+
+		Socket_clearPendingWrite(m->c->net.socket);
+
+#if defined(OPENSSL)
+		if (m->ssl)
+		{
+			int port;
+			char* hostname;
+			int setSocketForSSLrc = 0;
+
+			hostname = MQTTProtocol_addressPort(m->serverURI, &port);
+			setSocketForSSLrc = SSLSocket_setSocketForSSL(&m->c->net, m->c->sslopts, hostname);
+			if (hostname != m->serverURI)
+				free(hostname);
+
+			if (setSocketForSSLrc != MQTTASYNC_SUCCESS)
+			{
+				if (m->c->session != NULL)
+					if ((rc = SSL_set_session(m->c->net.ssl, m->c->session)) != 1)
+						Log(TRACE_MIN, -1, "Failed to set SSL session with stored data, non critical");
+				rc = SSLSocket_connect(m->c->net.ssl, m->c->net.socket);
+				if (rc == TCPSOCKET_INTERRUPTED)
+				{
+					rc = MQTTCLIENT_SUCCESS; /* the connect is still in progress */
+					m->c->connect_state = 2;
+				}
+				else if (rc == SSL_FATAL)
+				{
+					rc = SOCKET_ERROR;
+					goto exit;
+				}
+				else if (rc == 1)
+				{
+					rc = MQTTCLIENT_SUCCESS;
+					m->c->connect_state = 3;
+					if (MQTTPacket_send_connect(m->c, m->connect.details.conn.MQTTVersion) == SOCKET_ERROR)
+					{
+						rc = SOCKET_ERROR;
+						goto exit;
+					}
+					if (!m->c->cleansession && m->c->session == NULL)
+						m->c->session = SSL_get1_session(m->c->net.ssl);
+				}
+			}
+			else
+			{
+				rc = SOCKET_ERROR;
+				goto exit;
+			}
+		}
+		else
+		{
+#endif
+			m->c->connect_state = 3; /* TCP/SSL connect completed, in which case send the MQTT connect packet */
+			if ((rc = MQTTPacket_send_connect(m->c, m->connect.details.conn.MQTTVersion)) == SOCKET_ERROR)
+				goto exit;
+#if defined(OPENSSL)
+		}
+#endif
+	}
+#if defined(OPENSSL)
+	else if (m->c->connect_state == 2) /* SSL connect sent - wait for completion */
+	{
+		if ((rc = SSLSocket_connect(m->c->net.ssl, m->c->net.socket)) != 1)
+			goto exit;
+
+		if(!m->c->cleansession && m->c->session == NULL)
+			m->c->session = SSL_get1_session(m->c->net.ssl);
+		m->c->connect_state = 3; /* SSL connect completed, in which case send the MQTT connect packet */
+		if ((rc = MQTTPacket_send_connect(m->c, m->connect.details.conn.MQTTVersion)) == SOCKET_ERROR)
+			goto exit;
+	}
+#endif
+
+exit:
+	if ((rc != 0 && rc != TCPSOCKET_INTERRUPTED && m->c->connect_state != 2) || (rc == SSL_FATAL))
+		nextOrClose(m, MQTTASYNC_FAILURE, "TCP/TLS connect failure");
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static MQTTPacket* MQTTAsync_cycle(int* sock, unsigned long timeout, int* rc)
+{
+	struct timeval tp = {0L, 0L};
+	static Ack ack;
+	MQTTPacket* pack = NULL;
+
+	FUNC_ENTRY;
+	if (timeout > 0L)
+	{
+		tp.tv_sec = timeout / 1000;
+		tp.tv_usec = (timeout % 1000) * 1000; /* this field is microseconds! */
+	}
+
+#if defined(OPENSSL)
+	if ((*sock = SSLSocket_getPendingRead()) == -1)
+	{
+#endif
+		Thread_lock_mutex(socket_mutex);
+		/* 0 from getReadySocket indicates no work to do, -1 == error, but can happen normally */
+		*sock = Socket_getReadySocket(0, &tp);
+		Thread_unlock_mutex(socket_mutex);
+		if (!tostop && *sock == 0 && (tp.tv_sec > 0L || tp.tv_usec > 0L))
+			MQTTAsync_sleep(100L);
+#if defined(OPENSSL)
+	}
+#endif
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	if (*sock > 0)
+	{
+		MQTTAsyncs* m = NULL;
+		if (ListFindItem(handles, sock, clientSockCompare) != NULL)
+			m = (MQTTAsync)(handles->current->content);
+		if (m != NULL)
+		{
+			Log(TRACE_MINIMUM, -1, "m->c->connect_state = %d",m->c->connect_state);
+			if (m->c->connect_state == 1 || m->c->connect_state == 2)
+				*rc = MQTTAsync_connecting(m);
+			else
+				pack = MQTTPacket_Factory(&m->c->net, rc);
+			if (m->c->connect_state == 3 && *rc == SOCKET_ERROR)
+			{
+				Log(TRACE_MINIMUM, -1, "CONNECT sent but MQTTPacket_Factory has returned SOCKET_ERROR");
+				nextOrClose(m, MQTTASYNC_FAILURE, "TCP connect completion failure");
+			}
+			else
+			{
+				Log(TRACE_MINIMUM, -1, "m->c->connect_state = %d",m->c->connect_state);
+				Log(TRACE_MINIMUM, -1, "CONNECT sent, *rc is %d",*rc);
+			}
+		}
+		if (pack)
+		{
+			int freed = 1;
+
+			/* Note that these handle... functions free the packet structure that they are dealing with */
+			if (pack->header.bits.type == PUBLISH)
+				*rc = MQTTProtocol_handlePublishes(pack, *sock);
+			else if (pack->header.bits.type == PUBACK || pack->header.bits.type == PUBCOMP)
+			{
+				int msgid;
+
+				ack = (pack->header.bits.type == PUBCOMP) ? *(Pubcomp*)pack : *(Puback*)pack;
+				msgid = ack.msgId;
+				*rc = (pack->header.bits.type == PUBCOMP) ?
+						MQTTProtocol_handlePubcomps(pack, *sock) : MQTTProtocol_handlePubacks(pack, *sock);
+				if (!m)
+					Log(LOG_ERROR, -1, "PUBCOMP or PUBACK received for no client, msgid %d", msgid);
+				if (m)
+				{
+					ListElement* current = NULL;
+
+					if (m->dc)
+					{
+						Log(TRACE_MIN, -1, "Calling deliveryComplete for client %s, msgid %d", m->c->clientID, msgid);
+						(*(m->dc))(m->context, msgid);
+					}
+					/* use the msgid to find the callback to be called */
+					while (ListNextElement(m->responses, &current))
+					{
+						MQTTAsync_queuedCommand* command = (MQTTAsync_queuedCommand*)(current->content);
+						if (command->command.token == msgid)
+						{
+							if (!ListDetach(m->responses, command)) /* then remove the response from the list */
+								Log(LOG_ERROR, -1, "Publish command not removed from command list");
+							if (command->command.onSuccess)
+							{
+								MQTTAsync_successData data;
+
+								data.token = command->command.token;
+								data.alt.pub.destinationName = command->command.details.pub.destinationName;
+								data.alt.pub.message.payload = command->command.details.pub.payload;
+								data.alt.pub.message.payloadlen = command->command.details.pub.payloadlen;
+								data.alt.pub.message.qos = command->command.details.pub.qos;
+								data.alt.pub.message.retained = command->command.details.pub.retained;
+								Log(TRACE_MIN, -1, "Calling publish success for client %s", m->c->clientID);
+								(*(command->command.onSuccess))(command->command.context, &data);
+							}
+							MQTTAsync_freeCommand(command);
+							break;
+						}
+					}
+				}
+			}
+			else if (pack->header.bits.type == PUBREC)
+				*rc = MQTTProtocol_handlePubrecs(pack, *sock);
+			else if (pack->header.bits.type == PUBREL)
+				*rc = MQTTProtocol_handlePubrels(pack, *sock);
+			else if (pack->header.bits.type == PINGRESP)
+				*rc = MQTTProtocol_handlePingresps(pack, *sock);
+			else
+				freed = 0;
+			if (freed)
+				pack = NULL;
+		}
+	}
+	MQTTAsync_retry();
+	MQTTAsync_unlock_mutex(mqttasync_mutex);
+	FUNC_EXIT_RC(*rc);
+	return pack;
+}
+
+/*
+static int pubCompare(void* a, void* b)
+{
+	Messages* msg = (Messages*)a;
+	return msg->publish == (Publications*)b;
+}*/
+
+
+int MQTTAsync_getPendingTokens(MQTTAsync handle, MQTTAsync_token **tokens)
+{
+	int rc = MQTTASYNC_SUCCESS;
+	MQTTAsyncs* m = handle;
+	ListElement* current = NULL;
+	int count = 0;
+
+	FUNC_ENTRY;
+	MQTTAsync_lock_mutex(mqttasync_mutex);
+	*tokens = NULL;
+
+	if (m == NULL)
+	{
+		rc = MQTTASYNC_FAILURE;
+		goto exit;
+	}
+
+	/* calculate the number of pending tokens - commands plus inflight */
+	while (ListNextElement(commands, &current))
+	{
+		MQTTAsync_queuedCommand* cmd = (MQTTAsync_queuedCommand*)(current->content);
+
+		if (cmd->client == m)
+			count++;
+	}
+	if (m->c)
+		count += m->c->outboundMsgs->count;
+	if (count == 0)
+		goto exit; /* no tokens to return */
+	*tokens = malloc(sizeof(MQTTAsync_token) * (count + 1));  /* add space for sentinel at end of list */
+
+	/* First add the unprocessed commands to the pending tokens */
+	current = NULL;
+	count = 0;
+	while (ListNextElement(commands, &current))
+	{
+		MQTTAsync_queuedCommand* cmd = (MQTTAsync_queuedCommand*)(current->content);
+
+		if (cmd->client == m)
+			(*tokens)[c

<TRUNCATED>

[15/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI b/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI
new file mode 100644
index 0000000..91aea10
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI
@@ -0,0 +1,1803 @@
+# Doxyfile 1.8.1.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "Paho Asynchronous MQTT C Client Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = "../doc/pahologo.png"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = "../build/output/doc/MQTTAsync/"
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        = /Users/dimitri/doxygen/mail/1.5.7/doxywizard/
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = MQTTAsync_main
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = MQTTAsync.h \
+                         MQTTClientPersistence.h
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = NONE
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             = __attribute__(x)=
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES


[03/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.c b/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.c
new file mode 100644
index 0000000..fa3ff63
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.c
@@ -0,0 +1,769 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - fix for bug 413429 - connectionLost not called
+ *    Ian Craggs - fix for bug 421103 - trying to write to same socket, in retry
+ *    Rong Xiang, Ian Craggs - C++ compatibility
+ *    Ian Craggs - turn off DUP flag for PUBREL - MQTT 3.1.1
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Functions dealing with the MQTT protocol exchanges
+ *
+ * Some other related functions are in the MQTTProtocolOut module
+ * */
+
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MQTTProtocolClient.h"
+#if !defined(NO_PERSISTENCE)
+#include "MQTTPersistence.h"
+#endif
+#include "SocketBuffer.h"
+#include "StackTrace.h"
+#include "Heap.h"
+
+#if !defined(min)
+#define min(A,B) ( (A) < (B) ? (A):(B))
+#endif
+
+extern MQTTProtocol state;
+extern ClientStates* bstate;
+
+
+static void MQTTProtocol_storeQoS0(Clients* pubclient, Publish* publish);
+static int MQTTProtocol_startPublishCommon(
+		Clients* pubclient,
+		Publish* publish,
+		int qos,
+		int retained);
+static void MQTTProtocol_retries(time_t now, Clients* client, int regardless);
+
+/**
+ * List callback function for comparing Message structures by message id
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+int messageIDCompare(void* a, void* b)
+{
+	Messages* msg = (Messages*)a;
+	return msg->msgid == *(int*)b;
+}
+
+
+/**
+ * Assign a new message id for a client.  Make sure it isn't already being used and does
+ * not exceed the maximum.
+ * @param client a client structure
+ * @return the next message id to use, or 0 if none available
+ */
+int MQTTProtocol_assignMsgId(Clients* client)
+{
+	int start_msgid = client->msgID;
+	int msgid = start_msgid;
+
+	FUNC_ENTRY;
+	msgid = (msgid == MAX_MSG_ID) ? 1 : msgid + 1;
+	while (ListFindItem(client->outboundMsgs, &msgid, messageIDCompare) != NULL)
+	{
+		msgid = (msgid == MAX_MSG_ID) ? 1 : msgid + 1;
+		if (msgid == start_msgid) 
+		{ /* we've tried them all - none free */
+			msgid = 0;
+			break;
+		}
+	}
+	if (msgid != 0)
+		client->msgID = msgid;
+	FUNC_EXIT_RC(msgid);
+	return msgid;
+}
+
+
+static void MQTTProtocol_storeQoS0(Clients* pubclient, Publish* publish)
+{
+	int len;
+	pending_write* pw = NULL;
+
+	FUNC_ENTRY;
+	/* store the publication until the write is finished */
+	pw = malloc(sizeof(pending_write));
+	Log(TRACE_MIN, 12, NULL);
+	pw->p = MQTTProtocol_storePublication(publish, &len);
+	pw->socket = pubclient->net.socket;
+	ListAppend(&(state.pending_writes), pw, sizeof(pending_write)+len);
+	/* we don't copy QoS 0 messages unless we have to, so now we have to tell the socket buffer where
+	the saved copy is */
+	if (SocketBuffer_updateWrite(pw->socket, pw->p->topic, pw->p->payload) == NULL)
+		Log(LOG_SEVERE, 0, "Error updating write");
+	FUNC_EXIT;
+}
+
+
+/**
+ * Utility function to start a new publish exchange.
+ * @param pubclient the client to send the publication to
+ * @param publish the publication data
+ * @param qos the MQTT QoS to use
+ * @param retained boolean - whether to set the MQTT retained flag
+ * @return the completion code
+ */
+static int MQTTProtocol_startPublishCommon(Clients* pubclient, Publish* publish, int qos, int retained)
+{
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	rc = MQTTPacket_send_publish(publish, 0, qos, retained, &pubclient->net, pubclient->clientID);
+	if (qos == 0 && rc == TCPSOCKET_INTERRUPTED)
+		MQTTProtocol_storeQoS0(pubclient, publish);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Start a new publish exchange.  Store any state necessary and try to send the packet
+ * @param pubclient the client to send the publication to
+ * @param publish the publication data
+ * @param qos the MQTT QoS to use
+ * @param retained boolean - whether to set the MQTT retained flag
+ * @param mm - pointer to the message to send
+ * @return the completion code
+ */
+int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** mm)
+{
+	Publish p = *publish;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (qos > 0)
+	{
+		*mm = MQTTProtocol_createMessage(publish, mm, qos, retained);
+		ListAppend(pubclient->outboundMsgs, *mm, (*mm)->len);
+		/* we change these pointers to the saved message location just in case the packet could not be written
+		entirely; the socket buffer will use these locations to finish writing the packet */
+		p.payload = (*mm)->publish->payload;
+		p.topic = (*mm)->publish->topic;
+	}
+	rc = MQTTProtocol_startPublishCommon(pubclient, &p, qos, retained);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Copy and store message data for retries
+ * @param publish the publication data
+ * @param mm - pointer to the message data to store
+ * @param qos the MQTT QoS to use
+ * @param retained boolean - whether to set the MQTT retained flag
+ * @return pointer to the message data stored
+ */
+Messages* MQTTProtocol_createMessage(Publish* publish, Messages **mm, int qos, int retained)
+{
+	Messages* m = malloc(sizeof(Messages));
+
+	FUNC_ENTRY;
+	m->len = sizeof(Messages);
+	if (*mm == NULL || (*mm)->publish == NULL)
+	{
+		int len1;
+		*mm = m;
+		m->publish = MQTTProtocol_storePublication(publish, &len1);
+		m->len += len1;
+	}
+	else
+	{
+		++(((*mm)->publish)->refcount);
+		m->publish = (*mm)->publish;
+	}
+	m->msgid = publish->msgId;
+	m->qos = qos;
+	m->retain = retained;
+	time(&(m->lastTouch));
+	if (qos == 2)
+		m->nextMessageType = PUBREC;
+	FUNC_EXIT;
+	return m;
+}
+
+
+/**
+ * Store message data for possible retry
+ * @param publish the publication data
+ * @param len returned length of the data stored
+ * @return the publication stored
+ */
+Publications* MQTTProtocol_storePublication(Publish* publish, int* len)
+{
+	Publications* p = malloc(sizeof(Publications));
+
+	FUNC_ENTRY;
+	p->refcount = 1;
+
+	*len = (int)strlen(publish->topic)+1;
+	if (Heap_findItem(publish->topic))
+		p->topic = publish->topic;
+	else
+	{
+		p->topic = malloc(*len);
+		strcpy(p->topic, publish->topic);
+	}
+	*len += sizeof(Publications);
+
+	p->topiclen = publish->topiclen;
+	p->payloadlen = publish->payloadlen;
+	p->payload = malloc(publish->payloadlen);
+	memcpy(p->payload, publish->payload, p->payloadlen);
+	*len += publish->payloadlen;
+
+	ListAppend(&(state.publications), p, *len);
+	FUNC_EXIT;
+	return p;
+}
+
+/**
+ * Remove stored message data.  Opposite of storePublication
+ * @param p stored publication to remove
+ */
+void MQTTProtocol_removePublication(Publications* p)
+{
+	FUNC_ENTRY;
+	if (--(p->refcount) == 0)
+	{
+		free(p->payload);
+		free(p->topic);
+		ListRemove(&(state.publications), p);
+	}
+	FUNC_EXIT;
+}
+
+/**
+ * Process an incoming publish packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handlePublishes(void* pack, int sock)
+{
+	Publish* publish = (Publish*)pack;
+	Clients* client = NULL;
+	char* clientid = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	clientid = client->clientID;
+	Log(LOG_PROTOCOL, 11, NULL, sock, clientid, publish->msgId, publish->header.bits.qos,
+					publish->header.bits.retain, min(20, publish->payloadlen), publish->payload);
+
+	if (publish->header.bits.qos == 0)
+		Protocol_processPublication(publish, client);
+	else if (publish->header.bits.qos == 1)
+	{
+		/* send puback before processing the publications because a lot of return publications could fill up the socket buffer */
+		rc = MQTTPacket_send_puback(publish->msgId, &client->net, client->clientID);
+		/* if we get a socket error from sending the puback, should we ignore the publication? */
+		Protocol_processPublication(publish, client);
+	}
+	else if (publish->header.bits.qos == 2)
+	{
+		/* store publication in inbound list */
+		int len;
+		ListElement* listElem = NULL;
+		Messages* m = malloc(sizeof(Messages));
+		Publications* p = MQTTProtocol_storePublication(publish, &len);
+		m->publish = p;
+		m->msgid = publish->msgId;
+		m->qos = publish->header.bits.qos;
+		m->retain = publish->header.bits.retain;
+		m->nextMessageType = PUBREL;
+		if ( ( listElem = ListFindItem(client->inboundMsgs, &(m->msgid), messageIDCompare) ) != NULL )
+		{   /* discard queued publication with same msgID that the current incoming message */
+			Messages* msg = (Messages*)(listElem->content);
+			MQTTProtocol_removePublication(msg->publish);
+			ListInsert(client->inboundMsgs, m, sizeof(Messages) + len, listElem);
+			ListRemove(client->inboundMsgs, msg);
+		} else
+			ListAppend(client->inboundMsgs, m, sizeof(Messages) + len);
+		rc = MQTTPacket_send_pubrec(publish->msgId, &client->net, client->clientID);
+		publish->topic = NULL;
+	}
+	MQTTPacket_freePublish(publish);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+/**
+ * Process an incoming puback packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handlePubacks(void* pack, int sock)
+{
+	Puback* puback = (Puback*)pack;
+	Clients* client = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	Log(LOG_PROTOCOL, 14, NULL, sock, client->clientID, puback->msgId);
+
+	/* look for the message by message id in the records of outbound messages for this client */
+	if (ListFindItem(client->outboundMsgs, &(puback->msgId), messageIDCompare) == NULL)
+		Log(TRACE_MIN, 3, NULL, "PUBACK", client->clientID, puback->msgId);
+	else
+	{
+		Messages* m = (Messages*)(client->outboundMsgs->current->content);
+		if (m->qos != 1)
+			Log(TRACE_MIN, 4, NULL, "PUBACK", client->clientID, puback->msgId, m->qos);
+		else
+		{
+			Log(TRACE_MIN, 6, NULL, "PUBACK", client->clientID, puback->msgId);
+			#if !defined(NO_PERSISTENCE)
+				rc = MQTTPersistence_remove(client, PERSISTENCE_PUBLISH_SENT, m->qos, puback->msgId);
+			#endif
+			MQTTProtocol_removePublication(m->publish);
+			ListRemove(client->outboundMsgs, m);
+		}
+	}
+	free(pack);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Process an incoming pubrec packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handlePubrecs(void* pack, int sock)
+{
+	Pubrec* pubrec = (Pubrec*)pack;
+	Clients* client = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	Log(LOG_PROTOCOL, 15, NULL, sock, client->clientID, pubrec->msgId);
+
+	/* look for the message by message id in the records of outbound messages for this client */
+	client->outboundMsgs->current = NULL;
+	if (ListFindItem(client->outboundMsgs, &(pubrec->msgId), messageIDCompare) == NULL)
+	{
+		if (pubrec->header.bits.dup == 0)
+			Log(TRACE_MIN, 3, NULL, "PUBREC", client->clientID, pubrec->msgId);
+	}
+	else
+	{
+		Messages* m = (Messages*)(client->outboundMsgs->current->content);
+		if (m->qos != 2)
+		{
+			if (pubrec->header.bits.dup == 0)
+				Log(TRACE_MIN, 4, NULL, "PUBREC", client->clientID, pubrec->msgId, m->qos);
+		}
+		else if (m->nextMessageType != PUBREC)
+		{
+			if (pubrec->header.bits.dup == 0)
+				Log(TRACE_MIN, 5, NULL, "PUBREC", client->clientID, pubrec->msgId);
+		}
+		else
+		{
+			rc = MQTTPacket_send_pubrel(pubrec->msgId, 0, &client->net, client->clientID);
+			m->nextMessageType = PUBCOMP;
+			time(&(m->lastTouch));
+		}
+	}
+	free(pack);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Process an incoming pubrel packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handlePubrels(void* pack, int sock)
+{
+	Pubrel* pubrel = (Pubrel*)pack;
+	Clients* client = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	Log(LOG_PROTOCOL, 17, NULL, sock, client->clientID, pubrel->msgId);
+
+	/* look for the message by message id in the records of inbound messages for this client */
+	if (ListFindItem(client->inboundMsgs, &(pubrel->msgId), messageIDCompare) == NULL)
+	{
+		if (pubrel->header.bits.dup == 0)
+			Log(TRACE_MIN, 3, NULL, "PUBREL", client->clientID, pubrel->msgId);
+		else
+			/* Apparently this is "normal" behaviour, so we don't need to issue a warning */
+			rc = MQTTPacket_send_pubcomp(pubrel->msgId, &client->net, client->clientID);
+	}
+	else
+	{
+		Messages* m = (Messages*)(client->inboundMsgs->current->content);
+		if (m->qos != 2)
+			Log(TRACE_MIN, 4, NULL, "PUBREL", client->clientID, pubrel->msgId, m->qos);
+		else if (m->nextMessageType != PUBREL)
+			Log(TRACE_MIN, 5, NULL, "PUBREL", client->clientID, pubrel->msgId);
+		else
+		{
+			Publish publish;
+
+			/* send pubcomp before processing the publications because a lot of return publications could fill up the socket buffer */
+			rc = MQTTPacket_send_pubcomp(pubrel->msgId, &client->net, client->clientID);
+			publish.header.bits.qos = m->qos;
+			publish.header.bits.retain = m->retain;
+			publish.msgId = m->msgid;
+			publish.topic = m->publish->topic;
+			publish.topiclen = m->publish->topiclen;
+			publish.payload = m->publish->payload;
+			publish.payloadlen = m->publish->payloadlen;
+			Protocol_processPublication(&publish, client);
+			#if !defined(NO_PERSISTENCE)
+				rc += MQTTPersistence_remove(client, PERSISTENCE_PUBLISH_RECEIVED, m->qos, pubrel->msgId);
+			#endif
+			ListRemove(&(state.publications), m->publish);
+			ListRemove(client->inboundMsgs, m);
+			++(state.msgs_received);
+		}
+	}
+	free(pack);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Process an incoming pubcomp packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handlePubcomps(void* pack, int sock)
+{
+	Pubcomp* pubcomp = (Pubcomp*)pack;
+	Clients* client = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	Log(LOG_PROTOCOL, 19, NULL, sock, client->clientID, pubcomp->msgId);
+
+	/* look for the message by message id in the records of outbound messages for this client */
+	if (ListFindItem(client->outboundMsgs, &(pubcomp->msgId), messageIDCompare) == NULL)
+	{
+		if (pubcomp->header.bits.dup == 0)
+			Log(TRACE_MIN, 3, NULL, "PUBCOMP", client->clientID, pubcomp->msgId);
+	}
+	else
+	{
+		Messages* m = (Messages*)(client->outboundMsgs->current->content);
+		if (m->qos != 2)
+			Log(TRACE_MIN, 4, NULL, "PUBCOMP", client->clientID, pubcomp->msgId, m->qos);
+		else
+		{
+			if (m->nextMessageType != PUBCOMP)
+				Log(TRACE_MIN, 5, NULL, "PUBCOMP", client->clientID, pubcomp->msgId);
+			else
+			{
+				Log(TRACE_MIN, 6, NULL, "PUBCOMP", client->clientID, pubcomp->msgId);
+				#if !defined(NO_PERSISTENCE)
+					rc = MQTTPersistence_remove(client, PERSISTENCE_PUBLISH_SENT, m->qos, pubcomp->msgId);
+				#endif
+				MQTTProtocol_removePublication(m->publish);
+				ListRemove(client->outboundMsgs, m);
+				(++state.msgs_sent);
+			}
+		}
+	}
+	free(pack);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * MQTT protocol keepAlive processing.  Sends PINGREQ packets as required.
+ * @param now current time
+ */
+void MQTTProtocol_keepalive(time_t now)
+{
+	ListElement* current = NULL;
+
+	FUNC_ENTRY;
+	ListNextElement(bstate->clients, &current);
+	while (current)
+	{
+		Clients* client =	(Clients*)(current->content);
+		ListNextElement(bstate->clients, &current); 
+		if (client->connected && client->keepAliveInterval > 0 &&
+			(difftime(now, client->net.lastSent) >= client->keepAliveInterval ||
+					difftime(now, client->net.lastReceived) >= client->keepAliveInterval))
+		{
+			if (client->ping_outstanding == 0)
+			{
+				if (Socket_noPendingWrites(client->net.socket))
+				{
+					if (MQTTPacket_send_pingreq(&client->net, client->clientID) != TCPSOCKET_COMPLETE)
+					{
+						Log(TRACE_PROTOCOL, -1, "Error sending PINGREQ for client %s on socket %d, disconnecting", client->clientID, client->net.socket);
+						MQTTProtocol_closeSession(client, 1);
+					}
+					else
+					{
+						client->net.lastSent = now;
+						client->ping_outstanding = 1;
+					}
+				}
+			}
+			else
+			{
+				Log(TRACE_PROTOCOL, -1, "PINGRESP not received in keepalive interval for client %s on socket %d, disconnecting", client->clientID, client->net.socket);
+				MQTTProtocol_closeSession(client, 1);
+			}
+		}
+	}
+	FUNC_EXIT;
+}
+
+
+/**
+ * MQTT retry processing per client
+ * @param now current time
+ * @param client - the client to which to apply the retry processing
+ * @param regardless boolean - retry packets regardless of retry interval (used on reconnect)
+ */
+static void MQTTProtocol_retries(time_t now, Clients* client, int regardless)
+{
+	ListElement* outcurrent = NULL;
+
+	FUNC_ENTRY;
+
+	if (!regardless && client->retryInterval <= 0) /* 0 or -ive retryInterval turns off retry except on reconnect */
+		goto exit;
+
+	while (client && ListNextElement(client->outboundMsgs, &outcurrent) &&
+		   client->connected && client->good &&        /* client is connected and has no errors */
+		   Socket_noPendingWrites(client->net.socket)) /* there aren't any previous packets still stacked up on the socket */
+	{
+		Messages* m = (Messages*)(outcurrent->content);
+		if (regardless || difftime(now, m->lastTouch) > max(client->retryInterval, 10))
+		{
+			if (m->qos == 1 || (m->qos == 2 && m->nextMessageType == PUBREC))
+			{
+				Publish publish;
+				int rc;
+
+				Log(TRACE_MIN, 7, NULL, "PUBLISH", client->clientID, client->net.socket, m->msgid);
+				publish.msgId = m->msgid;
+				publish.topic = m->publish->topic;
+				publish.payload = m->publish->payload;
+				publish.payloadlen = m->publish->payloadlen;
+				rc = MQTTPacket_send_publish(&publish, 1, m->qos, m->retain, &client->net, client->clientID);
+				if (rc == SOCKET_ERROR)
+				{
+					client->good = 0;
+					Log(TRACE_PROTOCOL, 29, NULL, client->clientID, client->net.socket,
+												Socket_getpeer(client->net.socket));
+					MQTTProtocol_closeSession(client, 1);
+					client = NULL;
+				}
+				else
+				{
+					if (m->qos == 0 && rc == TCPSOCKET_INTERRUPTED)
+						MQTTProtocol_storeQoS0(client, &publish);
+					time(&(m->lastTouch));
+				}
+			}
+			else if (m->qos && m->nextMessageType == PUBCOMP)
+			{
+				Log(TRACE_MIN, 7, NULL, "PUBREL", client->clientID, client->net.socket, m->msgid);
+				if (MQTTPacket_send_pubrel(m->msgid, 0, &client->net, client->clientID) != TCPSOCKET_COMPLETE)
+				{
+					client->good = 0;
+					Log(TRACE_PROTOCOL, 29, NULL, client->clientID, client->net.socket,
+							Socket_getpeer(client->net.socket));
+					MQTTProtocol_closeSession(client, 1);
+					client = NULL;
+				}
+				else
+					time(&(m->lastTouch));
+			}
+			/* break; why not do all retries at once? */
+		}
+	}
+exit:
+	FUNC_EXIT;
+}
+
+
+/**
+ * MQTT retry protocol and socket pending writes processing.
+ * @param now current time
+ * @param doRetry boolean - retries as well as pending writes?
+ * @param regardless boolean - retry packets regardless of retry interval (used on reconnect)
+ */
+void MQTTProtocol_retry(time_t now, int doRetry, int regardless)
+{
+	ListElement* current = NULL;
+
+	FUNC_ENTRY;
+	ListNextElement(bstate->clients, &current);
+	/* look through the outbound message list of each client, checking to see if a retry is necessary */
+	while (current)
+	{
+		Clients* client = (Clients*)(current->content);
+		ListNextElement(bstate->clients, &current);
+		if (client->connected == 0)
+			continue;
+		if (client->good == 0)
+		{
+			MQTTProtocol_closeSession(client, 1);
+			continue;
+		}
+		if (Socket_noPendingWrites(client->net.socket) == 0)
+			continue;
+		if (doRetry)
+			MQTTProtocol_retries(now, client, regardless);
+	}
+	FUNC_EXIT;
+}
+
+
+/**
+ * Free a client structure
+ * @param client the client data to free
+ */
+void MQTTProtocol_freeClient(Clients* client)
+{
+	FUNC_ENTRY;
+	/* free up pending message lists here, and any other allocated data */
+	MQTTProtocol_freeMessageList(client->outboundMsgs);
+	MQTTProtocol_freeMessageList(client->inboundMsgs);
+	ListFree(client->messageQueue);
+	free(client->clientID);
+	if (client->will)
+	{
+		free(client->will->payload);
+		free(client->will->topic);
+		free(client->will);
+	}
+#if defined(OPENSSL)
+	if (client->sslopts)
+	{
+		if (client->sslopts->trustStore)
+			free((void*)client->sslopts->trustStore);
+		if (client->sslopts->keyStore)
+			free((void*)client->sslopts->keyStore);
+		if (client->sslopts->privateKey)
+			free((void*)client->sslopts->privateKey);
+		if (client->sslopts->privateKeyPassword)
+			free((void*)client->sslopts->privateKeyPassword);
+		if (client->sslopts->enabledCipherSuites)
+			free((void*)client->sslopts->enabledCipherSuites);
+		free(client->sslopts);
+	}
+#endif
+	/* don't free the client structure itself... this is done elsewhere */
+	FUNC_EXIT;
+}
+
+
+/**
+ * Empty a message list, leaving it able to accept new messages
+ * @param msgList the message list to empty
+ */
+void MQTTProtocol_emptyMessageList(List* msgList)
+{
+	ListElement* current = NULL;
+
+	FUNC_ENTRY;
+	while (ListNextElement(msgList, &current))
+	{
+		Messages* m = (Messages*)(current->content);
+		MQTTProtocol_removePublication(m->publish);
+	}
+	ListEmpty(msgList);
+	FUNC_EXIT;
+}
+
+
+/**
+ * Empty and free up all storage used by a message list
+ * @param msgList the message list to empty and free
+ */
+void MQTTProtocol_freeMessageList(List* msgList)
+{
+	FUNC_ENTRY;
+	MQTTProtocol_emptyMessageList(msgList);
+	ListFree(msgList);
+	FUNC_EXIT;
+}
+
+
+/**
+* Copy no more than dest_size -1 characters from the string pointed to by src to the array pointed to by dest.
+* The destination string will always be null-terminated.
+* @param dest the array which characters copy to
+* @param src the source string which characters copy from
+* @param dest_size the size of the memory pointed to by dest: copy no more than this -1 (allow for null).  Must be >= 1
+* @return the destination string pointer
+*/
+char* MQTTStrncpy(char *dest, const char *src, size_t dest_size)
+{
+  size_t count = dest_size;
+  char *temp = dest;
+
+  FUNC_ENTRY; 
+  if (dest_size < strlen(src))
+    Log(TRACE_MIN, -1, "the src string is truncated");
+
+  /* We must copy only the first (dest_size - 1) bytes */
+  while (count > 1 && (*temp++ = *src++))
+    count--;
+
+  *temp = '\0';
+
+  FUNC_EXIT;
+  return dest;
+}
+
+
+/**
+* Duplicate a string, safely, allocating space on the heap
+* @param src the source string which characters copy from
+* @return the duplicated, allocated string
+*/
+char* MQTTStrdup(const char* src)
+{
+	size_t mlen = strlen(src) + 1;
+	char* temp = malloc(mlen);
+	MQTTStrncpy(temp, src, mlen);
+	return temp;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.h b/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.h
new file mode 100644
index 0000000..36c2dd2
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTProtocolClient.h
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - MQTT 3.1.1 updates
+ *    Rong Xiang, Ian Craggs - C++ compatibility
+ *******************************************************************************/
+
+#if !defined(MQTTPROTOCOLCLIENT_H)
+#define MQTTPROTOCOLCLIENT_H
+
+#include "LinkedList.h"
+#include "MQTTPacket.h"
+#include "Log.h"
+#include "MQTTProtocol.h"
+#include "Messages.h"
+
+#define MAX_MSG_ID 65535
+#define MAX_CLIENTID_LEN 65535
+
+int MQTTProtocol_startPublish(Clients* pubclient, Publish* publish, int qos, int retained, Messages** m);
+Messages* MQTTProtocol_createMessage(Publish* publish, Messages** mm, int qos, int retained);
+Publications* MQTTProtocol_storePublication(Publish* publish, int* len);
+int messageIDCompare(void* a, void* b);
+int MQTTProtocol_assignMsgId(Clients* client);
+void MQTTProtocol_removePublication(Publications* p);
+void Protocol_processPublication(Publish* publish, Clients* client);
+
+int MQTTProtocol_handlePublishes(void* pack, int sock);
+int MQTTProtocol_handlePubacks(void* pack, int sock);
+int MQTTProtocol_handlePubrecs(void* pack, int sock);
+int MQTTProtocol_handlePubrels(void* pack, int sock);
+int MQTTProtocol_handlePubcomps(void* pack, int sock);
+
+void MQTTProtocol_closeSession(Clients* c, int sendwill);
+void MQTTProtocol_keepalive(time_t);
+void MQTTProtocol_retry(time_t, int, int);
+void MQTTProtocol_freeClient(Clients* client);
+void MQTTProtocol_emptyMessageList(List* msgList);
+void MQTTProtocol_freeMessageList(List* msgList);
+
+char* MQTTStrncpy(char *dest, const char* src, size_t num);
+char* MQTTStrdup(const char* src);
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.c b/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.c
new file mode 100644
index 0000000..90d38bf
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.c
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - fix for buffer overflow in addressPort bug #433290
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Rong Xiang, Ian Craggs - C++ compatibility
+ *    Ian Craggs - fix for bug 479376
+ *    Ian Craggs - SNI support
+ *    Ian Craggs - fix for issue #164
+ *    Ian Craggs - fix for issue #179
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Functions dealing with the MQTT protocol exchanges
+ *
+ * Some other related functions are in the MQTTProtocolClient module
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "MQTTProtocolOut.h"
+#include "StackTrace.h"
+#include "Heap.h"
+
+extern ClientStates* bstate;
+
+
+
+/**
+ * Separates an address:port into two separate values
+ * @param uri the input string - hostname:port
+ * @param port the returned port integer
+ * @return the address string
+ */
+char* MQTTProtocol_addressPort(const char* uri, int* port)
+{
+	char* colon_pos = strrchr(uri, ':'); /* reverse find to allow for ':' in IPv6 addresses */
+	char* buf = (char*)uri;
+	size_t len;
+
+	FUNC_ENTRY;
+	if (uri[0] == '[')
+	{  /* ip v6 */
+		if (colon_pos < strrchr(uri, ']'))
+			colon_pos = NULL;  /* means it was an IPv6 separator, not for host:port */
+	}
+
+	if (colon_pos) /* have to strip off the port */
+	{
+		size_t addr_len = colon_pos - uri;
+		buf = malloc(addr_len + 1);
+		*port = atoi(colon_pos + 1);
+		MQTTStrncpy(buf, uri, addr_len+1);
+	}
+	else
+		*port = DEFAULT_PORT;
+
+	len = strlen(buf);
+	if (buf[len - 1] == ']')
+	{
+		if (buf == (char*)uri)
+		{
+			buf = malloc(len);  /* we are stripping off the final ], so length is 1 shorter */
+			MQTTStrncpy(buf, uri, len);
+		}
+		else
+			buf[len - 1] = '\0';
+	}
+	FUNC_EXIT;
+	return buf;
+}
+
+
+/**
+ * MQTT outgoing connect processing for a client
+ * @param ip_address the TCP address:port to connect to
+ * @param aClient a structure with all MQTT data needed
+ * @param int ssl
+ * @param int MQTTVersion the MQTT version to connect with (3 or 4)
+ * @return return code
+ */
+#if defined(OPENSSL)
+int MQTTProtocol_connect(const char* ip_address, Clients* aClient, int ssl, int MQTTVersion)
+#else
+int MQTTProtocol_connect(const char* ip_address, Clients* aClient, int MQTTVersion)
+#endif
+{
+	int rc, port;
+	char* addr;
+
+	FUNC_ENTRY;
+	aClient->good = 1;
+
+	addr = MQTTProtocol_addressPort(ip_address, &port);
+	rc = Socket_new(addr, port, &(aClient->net.socket));
+	if (rc == EINPROGRESS || rc == EWOULDBLOCK)
+		aClient->connect_state = 1; /* TCP connect called - wait for connect completion */
+	else if (rc == 0)
+	{	/* TCP connect completed. If SSL, send SSL connect */
+#if defined(OPENSSL)
+		if (ssl)
+		{
+			if (SSLSocket_setSocketForSSL(&aClient->net, aClient->sslopts, addr) == 1)
+			{
+				rc = SSLSocket_connect(aClient->net.ssl, aClient->net.socket);
+				if (rc == TCPSOCKET_INTERRUPTED)
+					aClient->connect_state = 2; /* SSL connect called - wait for completion */
+			}
+			else
+				rc = SOCKET_ERROR;
+		}
+#endif
+		
+		if (rc == 0)
+		{
+			/* Now send the MQTT connect packet */
+			if ((rc = MQTTPacket_send_connect(aClient, MQTTVersion)) == 0)
+				aClient->connect_state = 3; /* MQTT Connect sent - wait for CONNACK */ 
+			else
+				aClient->connect_state = 0;
+		}
+	}
+	if (addr != ip_address)
+		free(addr);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Process an incoming pingresp packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handlePingresps(void* pack, int sock)
+{
+	Clients* client = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	Log(LOG_PROTOCOL, 21, NULL, sock, client->clientID);
+	client->ping_outstanding = 0;
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * MQTT outgoing subscribe processing for a client
+ * @param client the client structure
+ * @param topics list of topics
+ * @param qoss corresponding list of QoSs
+ * @return completion code
+ */
+int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	/* we should stack this up for retry processing too */
+	rc = MQTTPacket_send_subscribe(topics, qoss, msgID, 0, &client->net, client->clientID);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Process an incoming suback packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handleSubacks(void* pack, int sock)
+{
+	Suback* suback = (Suback*)pack;
+	Clients* client = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	Log(LOG_PROTOCOL, 23, NULL, sock, client->clientID, suback->msgId);
+	MQTTPacket_freeSuback(suback);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * MQTT outgoing unsubscribe processing for a client
+ * @param client the client structure
+ * @param topics list of topics
+ * @return completion code
+ */
+int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	/* we should stack this up for retry processing too? */
+	rc = MQTTPacket_send_unsubscribe(topics, msgID, 0, &client->net, client->clientID);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * Process an incoming unsuback packet for a socket
+ * @param pack pointer to the publish packet
+ * @param sock the socket on which the packet was received
+ * @return completion code
+ */
+int MQTTProtocol_handleUnsubacks(void* pack, int sock)
+{
+	Unsuback* unsuback = (Unsuback*)pack;
+	Clients* client = NULL;
+	int rc = TCPSOCKET_COMPLETE;
+
+	FUNC_ENTRY;
+	client = (Clients*)(ListFindItem(bstate->clients, &sock, clientSocketCompare)->content);
+	Log(LOG_PROTOCOL, 24, NULL, sock, client->clientID, unsuback->msgId);
+	free(unsuback);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.h b/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.h
new file mode 100644
index 0000000..3b890e7
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTProtocolOut.h
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs, Allan Stockdill-Mander - SSL updates
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Ian Craggs - SNI support
+ *******************************************************************************/
+
+#if !defined(MQTTPROTOCOLOUT_H)
+#define MQTTPROTOCOLOUT_H
+
+#include "LinkedList.h"
+#include "MQTTPacket.h"
+#include "Clients.h"
+#include "Log.h"
+#include "Messages.h"
+#include "MQTTProtocol.h"
+#include "MQTTProtocolClient.h"
+
+#define DEFAULT_PORT 1883
+
+char* MQTTProtocol_addressPort(const char* uri, int* port);
+void MQTTProtocol_reconnect(const char* ip_address, Clients* client);
+#if defined(OPENSSL)
+int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int ssl, int MQTTVersion);
+#else
+int MQTTProtocol_connect(const char* ip_address, Clients* acClients, int MQTTVersion);
+#endif
+int MQTTProtocol_handlePingresps(void* pack, int sock);
+int MQTTProtocol_subscribe(Clients* client, List* topics, List* qoss, int msgID);
+int MQTTProtocol_handleSubacks(void* pack, int sock);
+int MQTTProtocol_unsubscribe(Clients* client, List* topics, int msgID);
+int MQTTProtocol_handleUnsubacks(void* pack, int sock);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTVersion.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTVersion.c b/thirdparty/paho.mqtt.c/src/MQTTVersion.c
new file mode 100644
index 0000000..382033a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTVersion.c
@@ -0,0 +1,230 @@
+/*******************************************************************************
+ * Copyright (c) 2012, 2015 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+#include <stdio.h>
+
+#if !defined(_WRS_KERNEL)
+
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <ctype.h>
+#include "MQTTAsync.h"
+
+#if defined(WIN32) || defined(WIN64)
+#include <windows.h>
+#include <tchar.h>
+#include <io.h>
+#include <sys/stat.h>
+#else
+#include <dlfcn.h>
+#include <sys/mman.h>
+#include <unistd.h>
+#endif
+
+
+/**
+ *
+ * @file
+ * \brief MQTTVersion - display the version and build information strings for a library.
+ *
+ * With no arguments, we try to load and call the version string for the libraries we 
+ * know about: mqttv3c, mqttv3cs, mqttv3a, mqttv3as.
+ * With an argument:
+ *   1) we try to load the named library, call getVersionInfo and display those values. 
+ *   2) If that doesn't work, we look through the binary for eyecatchers, and display those.  
+ *      This will work if the library is not executable in the current environment.
+ *
+ * */
+ 
+ 
+ static const char* libraries[] = {"paho-mqtt3c", "paho-mqtt3cs", "paho-mqtt3a", "paho-mqtt3as"};
+ static const char* eyecatchers[] = {"MQTTAsyncV3_Version", "MQTTAsyncV3_Timestamp",
+ 					 "MQTTClientV3_Version", "MQTTClientV3_Timestamp"};
+ 
+
+char* FindString(char* filename, const char* eyecatcher_input);
+int printVersionInfo(MQTTAsync_nameValue* info);
+int loadandcall(char* libname);
+void printEyecatchers(char* filename);
+
+
+/**
+ * Finds an eyecatcher in a binary file and returns the following value.
+ * @param filename the name of the file
+ * @param eyecatcher_input the eyecatcher string to look for
+ * @return the value found - "" if not found 
+ */
+char* FindString(char* filename, const char* eyecatcher_input)
+{
+	FILE* infile = NULL;
+	static char value[100];
+	const char* eyecatcher = eyecatcher_input;
+	
+	memset(value, 0, 100);
+	if ((infile = fopen(filename, "rb")) != NULL)
+	{
+		size_t buflen = strlen(eyecatcher);
+		char* buffer = (char*) malloc(buflen);
+
+		if (buffer != NULL)
+		{
+			int c = fgetc(infile);
+
+			while (feof(infile) == 0)
+			{
+				int count = 0;
+				buffer[count++] = c;
+				if (memcmp(eyecatcher, buffer, buflen) == 0)
+				{
+					char* ptr = value;
+					c = fgetc(infile); /* skip space */
+					c = fgetc(infile);
+					while (isprint(c))
+					{
+						*ptr++ = c;
+						c = fgetc(infile);
+					}
+					break;
+				}
+				if (count == buflen)
+				{
+					memmove(buffer, &buffer[1], buflen - 1);
+					count--;
+				}
+				c = fgetc(infile);
+			}
+			free(buffer);
+		}
+
+		fclose(infile);
+	}
+	return value;
+}
+
+
+int printVersionInfo(MQTTAsync_nameValue* info)
+{
+	int rc = 0;
+	
+	while (info->name)
+	{
+		printf("%s: %s\n", info->name, info->value);
+		info++;
+		rc = 1;  /* at least one value printed */
+	}
+	return rc;
+}
+
+typedef MQTTAsync_nameValue* (*func_type)(void);
+
+int loadandcall(char* libname)
+{
+	int rc = 0;
+	MQTTAsync_nameValue* (*func_address)(void) = NULL;
+#if defined(WIN32) || defined(WIN64)
+	wchar_t wlibname[30];
+	HMODULE APILibrary;
+
+	mbstowcs(wlibname, libname, strlen(libname) + 1);
+	if ((APILibrary = LoadLibrary(wlibname)) == NULL)
+		printf("Error loading library %s, error code %d\n", libname, GetLastError());
+	else
+	{
+		func_address = (func_type)GetProcAddress(APILibrary, "MQTTAsync_getVersionInfo");
+		if (func_address == NULL) 
+			func_address = (func_type)GetProcAddress(APILibrary, "MQTTClient_getVersionInfo");
+		if (func_address)
+			rc = printVersionInfo((*func_address)());
+		FreeLibrary(APILibrary);
+	}
+#else
+	void* APILibrary = dlopen(libname, RTLD_LAZY); /* Open the Library in question */
+	char* ErrorOutput = dlerror(); 	               /* Check it opened properly */
+	if (ErrorOutput != NULL)
+		printf("Error loading library %s, error %s\n", libname, ErrorOutput);
+	else
+	{	
+		*(void **) (&func_address) = dlsym(APILibrary, "MQTTAsync_getVersionInfo");
+		if (func_address == NULL)
+			func_address = dlsym(APILibrary, "MQTTClient_getVersionInfo");
+		if (func_address)
+			rc = printVersionInfo((*func_address)());
+		dlclose(APILibrary);
+	}
+#endif
+	return rc;
+}
+ 
+	
+#if !defined(ARRAY_SIZE)
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
+void printEyecatchers(char* filename)
+{
+	int i = 0;
+	
+	for (i = 0; i < ARRAY_SIZE(eyecatchers); ++i)
+	{
+		char* value = FindString(filename, eyecatchers[i]);
+		if (value[0]) 
+			printf("%s: %s\n", eyecatchers[i], value);
+	}
+}
+
+
+int main(int argc, char** argv)
+{
+	printf("MQTTVersion: print the version strings of an MQTT client library\n"); 
+	printf("Copyright (c) 2012, 2015 IBM Corp.\n");
+	
+	if (argc == 1)
+	{
+		int i = 0;
+		char namebuf[60];
+		
+		printf("Specify a particular library name if it is not in the current directory, or not executable on this platform\n");
+		 
+		for (i = 0; i < ARRAY_SIZE(libraries); ++i)
+		{
+#if defined(WIN32) || defined(WIN64)
+			sprintf(namebuf, "%s.dll", libraries[i]);
+#else
+			sprintf(namebuf, "lib%s.so.1", libraries[i]);
+#endif
+			printf("--- Trying library %s ---\n", libraries[i]);
+			if (!loadandcall(namebuf))
+				printEyecatchers(namebuf);
+		}
+	}
+	else
+	{
+		if (!loadandcall(argv[1]))
+			printEyecatchers(argv[1]);
+	}
+
+	return 0;
+}
+#else
+int main(void)
+{
+    fprintf(stderr, "This tool is not supported on this platform yet.\n");
+    return 1;
+}
+#endif /* !defined(_WRS_KERNEL) */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Messages.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Messages.c b/thirdparty/paho.mqtt.c/src/Messages.c
new file mode 100644
index 0000000..63bd193
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Messages.c
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Trace messages
+ *
+ */
+
+
+#include "Messages.h"
+#include "Log.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "Heap.h"
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
+#define max_msg_len 120
+
+static const char *protocol_message_list[] =
+{
+	"%d %s -> CONNECT cleansession: %d (%d)", /* 0, was 131, 68 and 69 */
+	"%d %s <- CONNACK rc: %d", /* 1, was 132 */
+	"%d %s -> CONNACK rc: %d (%d)", /* 2, was 138 */
+	"%d %s <- PINGREQ", /* 3, was 35 */
+	"%d %s -> PINGRESP (%d)", /* 4 */
+	"%d %s <- DISCONNECT", /* 5 */
+	"%d %s <- SUBSCRIBE msgid: %d", /* 6, was 39 */
+	"%d %s -> SUBACK msgid: %d (%d)", /* 7, was 40 */
+	"%d %s <- UNSUBSCRIBE msgid: %d", /* 8, was 41 */
+	"%d %s -> UNSUBACK msgid: %d (%d)", /* 9 */
+	"%d %s -> PUBLISH msgid: %d qos: %d retained: %d (%d) payload: %.*s", /* 10, was 42 */
+	"%d %s <- PUBLISH msgid: %d qos: %d retained: %d payload: %.*s", /* 11, was 46 */
+	"%d %s -> PUBACK msgid: %d (%d)", /* 12, was 47 */
+	"%d %s -> PUBREC msgid: %d (%d)", /* 13, was 48 */
+	"%d %s <- PUBACK msgid: %d", /* 14, was 49 */
+	"%d %s <- PUBREC msgid: %d", /* 15, was 53 */
+	"%d %s -> PUBREL msgid: %d (%d)", /* 16, was 57 */
+	"%d %s <- PUBREL msgid %d", /* 17, was 58 */
+	"%d %s -> PUBCOMP msgid %d (%d)", /* 18, was 62 */
+	"%d %s <- PUBCOMP msgid:%d", /* 19, was 63 */
+	"%d %s -> PINGREQ (%d)", /* 20, was 137 */
+	"%d %s <- PINGRESP", /* 21, was 70 */
+	"%d %s -> SUBSCRIBE msgid: %d (%d)", /* 22, was 72 */
+	"%d %s <- SUBACK msgid: %d", /* 23, was 73 */
+	"%d %s <- UNSUBACK msgid: %d", /* 24, was 74 */
+	"%d %s -> UNSUBSCRIBE msgid: %d (%d)", /* 25, was 106 */
+	"%d %s <- CONNECT", /* 26 */
+	"%d %s -> PUBLISH qos: 0 retained: %d (%d)", /* 27 */
+	"%d %s -> DISCONNECT (%d)", /* 28 */
+	"Socket error for client identifier %s, socket %d, peer address %s; ending connection", /* 29 */
+};
+
+static const char *trace_message_list[] =
+{
+	"Failed to remove client from bstate->clients", /* 0 */
+	"Removed client %s from bstate->clients, socket %d", /* 1 */
+	"Packet_Factory: unhandled packet type %d", /* 2 */
+	"Packet %s received from client %s for message identifier %d, but no record of that message identifier found", /* 3 */
+	"Packet %s received from client %s for message identifier %d, but message is wrong QoS, %d", /* 4 */
+	"Packet %s received from client %s for message identifier %d, but message is in wrong state", /* 5 */
+	"%s received from client %s for message id %d - removing publication", /* 6 */
+	"Trying %s again for client %s, socket %d, message identifier %d", /* 7 */
+	"", /* 8 */
+	"(%lu) %*s(%d)> %s:%d", /* 9 */
+	"(%lu) %*s(%d)< %s:%d", /* 10 */
+	"(%lu) %*s(%d)< %s:%d (%d)", /* 11 */
+	"Storing unsent QoS 0 message", /* 12 */
+};
+
+/**
+ * Get a log message by its index
+ * @param index the integer index
+ * @param log_level the log level, used to determine which message list to use
+ * @return the message format string
+ */
+const char* Messages_get(int index, enum LOG_LEVELS log_level)
+{
+	const char *msg = NULL;
+
+	if (log_level == TRACE_PROTOCOL)
+		msg = (index >= 0 && index < ARRAY_SIZE(protocol_message_list)) ? protocol_message_list[index] : NULL;
+	else
+		msg = (index >= 0 && index < ARRAY_SIZE(trace_message_list)) ? trace_message_list[index] : NULL;
+	return msg;
+}
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Messages.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Messages.h b/thirdparty/paho.mqtt.c/src/Messages.h
new file mode 100644
index 0000000..08f292f
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Messages.h
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+
+#if !defined(MESSAGES_H)
+#define MESSAGES_H
+
+#include "Log.h"
+
+const char* Messages_get(int, enum LOG_LEVELS);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/OsWrapper.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/OsWrapper.c b/thirdparty/paho.mqtt.c/src/OsWrapper.c
new file mode 100644
index 0000000..6d2f97c
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/OsWrapper.c
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2016, 2017 logi.cals GmbH
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Gunter Raidl - timer support for VxWorks
+ *    Rainer Poisel - reusability
+ *******************************************************************************/
+
+#include "OsWrapper.h"
+
+#if defined(_WRS_KERNEL)
+void usleep(useconds_t useconds)
+{
+	struct timespec tv;
+	tv.tv_sec = useconds / 1000000;
+	tv.tv_nsec = (useconds % 1000000) * 1000;
+	nanosleep(&tv, NULL);
+}
+#endif /* defined(_WRS_KERNEL) */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/OsWrapper.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/OsWrapper.h b/thirdparty/paho.mqtt.c/src/OsWrapper.h
new file mode 100644
index 0000000..f657ab1
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/OsWrapper.h
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2016, 2017 logi.cals GmbH
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Gunter Raidl - timer support for VxWorks
+ *    Rainer Poisel - reusability
+ *******************************************************************************/
+
+#if !defined(OSWRAPPER_H)
+#define OSWRAPPER_H
+
+#if defined(_WRS_KERNEL)
+#include <time.h>
+
+#define lstat stat
+
+typedef unsigned long useconds_t;
+void usleep(useconds_t useconds);
+
+#define timersub(a, b, result) \
+	do \
+	{ \
+		(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+		(result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+		if ((result)->tv_usec < 0) \
+		{ \
+			--(result)->tv_sec; \
+			(result)->tv_usec += 1000000L; \
+		} \
+	} while (0)
+#endif /* defined(_WRS_KERNEL) */
+
+#endif /* OSWRAPPER_H */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/SSLSocket.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/SSLSocket.c b/thirdparty/paho.mqtt.c/src/SSLSocket.c
new file mode 100644
index 0000000..d17c8bc
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/SSLSocket.c
@@ -0,0 +1,917 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs, Allan Stockdill-Mander - initial implementation
+ *    Ian Craggs - fix for bug #409702
+ *    Ian Craggs - allow compilation for OpenSSL < 1.0
+ *    Ian Craggs - fix for bug #453883
+ *    Ian Craggs - fix for bug #480363, issue 13
+ *    Ian Craggs - SNI support
+ *    Ian Craggs - fix for issues #155, #160
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief SSL  related functions
+ *
+ */
+
+#if defined(OPENSSL)
+
+#include "SocketBuffer.h"
+#include "MQTTClient.h"
+#include "SSLSocket.h"
+#include "Log.h"
+#include "StackTrace.h"
+#include "Socket.h"
+
+#include "Heap.h"
+
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/crypto.h>
+
+extern Sockets s;
+
+int SSLSocket_error(char* aString, SSL* ssl, int sock, int rc);
+char* SSL_get_verify_result_string(int rc);
+void SSL_CTX_info_callback(const SSL* ssl, int where, int ret);
+char* SSLSocket_get_version_string(int version);
+void SSL_CTX_msg_callback(
+		int write_p,
+		int version,
+		int content_type,
+		const void* buf, size_t len,
+		SSL* ssl, void* arg);
+int pem_passwd_cb(char* buf, int size, int rwflag, void* userdata);
+int SSL_create_mutex(ssl_mutex_type* mutex);
+int SSL_lock_mutex(ssl_mutex_type* mutex);
+int SSL_unlock_mutex(ssl_mutex_type* mutex);
+void SSL_destroy_mutex(ssl_mutex_type* mutex);
+#if (OPENSSL_VERSION_NUMBER >= 0x010000000)
+extern void SSLThread_id(CRYPTO_THREADID *id);
+#else
+extern unsigned long SSLThread_id(void);
+#endif
+extern void SSLLocks_callback(int mode, int n, const char *file, int line);
+int SSLSocket_createContext(networkHandles* net, MQTTClient_SSLOptions* opts);
+void SSLSocket_destroyContext(networkHandles* net);
+void SSLSocket_addPendingRead(int sock);
+
+/* 1 ~ we are responsible for initializing openssl; 0 ~ openssl init is done externally */
+static int handle_openssl_init = 1;
+static ssl_mutex_type* sslLocks = NULL;
+static ssl_mutex_type sslCoreMutex;
+
+#if defined(WIN32) || defined(WIN64)
+#define iov_len len
+#define iov_base buf
+#endif
+
+/**
+ * Gets the specific error corresponding to SOCKET_ERROR
+ * @param aString the function that was being used when the error occurred
+ * @param sock the socket on which the error occurred
+ * @return the specific TCP error code
+ */
+int SSLSocket_error(char* aString, SSL* ssl, int sock, int rc)
+{
+    int error;
+
+    FUNC_ENTRY;
+    if (ssl)
+        error = SSL_get_error(ssl, rc);
+    else
+        error = ERR_get_error();
+    if (error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE)
+    {
+		Log(TRACE_MIN, -1, "SSLSocket error WANT_READ/WANT_WRITE");
+    }
+    else
+    {
+        static char buf[120];
+
+        if (strcmp(aString, "shutdown") != 0)
+        	Log(TRACE_MIN, -1, "SSLSocket error %s(%d) in %s for socket %d rc %d errno %d %s\n", buf, error, aString, sock, rc, errno, strerror(errno));
+         ERR_print_errors_fp(stderr);
+		if (error == SSL_ERROR_SSL || error == SSL_ERROR_SYSCALL)
+			error = SSL_FATAL;
+    }
+    FUNC_EXIT_RC(error);
+    return error;
+}
+
+static struct
+{
+	int code;
+	char* string;
+}
+X509_message_table[] =
+{
+	{ X509_V_OK, "X509_V_OK" },
+	{ X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT, "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT" },
+	{ X509_V_ERR_UNABLE_TO_GET_CRL, "X509_V_ERR_UNABLE_TO_GET_CRL" },
+	{ X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE, "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE" },
+	{ X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE, "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE" },
+	{ X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY, "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY" },
+	{ X509_V_ERR_CERT_SIGNATURE_FAILURE, "X509_V_ERR_CERT_SIGNATURE_FAILURE" },
+	{ X509_V_ERR_CRL_SIGNATURE_FAILURE, "X509_V_ERR_CRL_SIGNATURE_FAILURE" },
+	{ X509_V_ERR_CERT_NOT_YET_VALID, "X509_V_ERR_CERT_NOT_YET_VALID" },
+	{ X509_V_ERR_CERT_HAS_EXPIRED, "X509_V_ERR_CERT_HAS_EXPIRED" },
+	{ X509_V_ERR_CRL_NOT_YET_VALID, "X509_V_ERR_CRL_NOT_YET_VALID" },
+	{ X509_V_ERR_CRL_HAS_EXPIRED, "X509_V_ERR_CRL_HAS_EXPIRED" },
+	{ X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD, "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD" },
+	{ X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD, "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD" },
+	{ X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD, "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD" },
+	{ X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD, "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD" },
+	{ X509_V_ERR_OUT_OF_MEM, "X509_V_ERR_OUT_OF_MEM" },
+	{ X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT" },
+	{ X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN, "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN" },
+	{ X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY" },
+	{ X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE" },
+	{ X509_V_ERR_CERT_CHAIN_TOO_LONG, "X509_V_ERR_CERT_CHAIN_TOO_LONG" },
+	{ X509_V_ERR_CERT_REVOKED, "X509_V_ERR_CERT_REVOKED" },
+	{ X509_V_ERR_INVALID_CA, "X509_V_ERR_INVALID_CA" },
+	{ X509_V_ERR_PATH_LENGTH_EXCEEDED, "X509_V_ERR_PATH_LENGTH_EXCEEDED" },
+	{ X509_V_ERR_INVALID_PURPOSE, "X509_V_ERR_INVALID_PURPOSE" },
+	{ X509_V_ERR_CERT_UNTRUSTED, "X509_V_ERR_CERT_UNTRUSTED" },
+	{ X509_V_ERR_CERT_REJECTED, "X509_V_ERR_CERT_REJECTED" },
+	{ X509_V_ERR_SUBJECT_ISSUER_MISMATCH, "X509_V_ERR_SUBJECT_ISSUER_MISMATCH" },
+	{ X509_V_ERR_AKID_SKID_MISMATCH, "X509_V_ERR_AKID_SKID_MISMATCH" },
+	{ X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH, "X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH" },
+	{ X509_V_ERR_KEYUSAGE_NO_CERTSIGN, "X509_V_ERR_KEYUSAGE_NO_CERTSIGN" },
+	{ X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER, "X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER" },
+	{ X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION, "X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION" },
+	{ X509_V_ERR_KEYUSAGE_NO_CRL_SIGN, "X509_V_ERR_KEYUSAGE_NO_CRL_SIGN" },
+	{ X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION, "X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION" },
+	{ X509_V_ERR_INVALID_NON_CA, "X509_V_ERR_INVALID_NON_CA" },
+	{ X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED, "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED" },
+	{ X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE, "X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE" },
+	{ X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED, "X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED" },
+	{ X509_V_ERR_INVALID_EXTENSION, "X509_V_ERR_INVALID_EXTENSION" },
+	{ X509_V_ERR_INVALID_POLICY_EXTENSION, "X509_V_ERR_INVALID_POLICY_EXTENSION" },
+	{ X509_V_ERR_NO_EXPLICIT_POLICY, "X509_V_ERR_NO_EXPLICIT_POLICY" },
+	{ X509_V_ERR_UNNESTED_RESOURCE, "X509_V_ERR_UNNESTED_RESOURCE" },
+#if defined(X509_V_ERR_DIFFERENT_CRL_SCOPE)
+	{ X509_V_ERR_DIFFERENT_CRL_SCOPE, "X509_V_ERR_DIFFERENT_CRL_SCOPE" },
+	{ X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE, "X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE" },
+	{ X509_V_ERR_PERMITTED_VIOLATION, "X509_V_ERR_PERMITTED_VIOLATION" },
+	{ X509_V_ERR_EXCLUDED_VIOLATION, "X509_V_ERR_EXCLUDED_VIOLATION" },
+	{ X509_V_ERR_SUBTREE_MINMAX, "X509_V_ERR_SUBTREE_MINMAX" },
+	{ X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE, "X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE" },
+	{ X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX, "X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX" },
+	{ X509_V_ERR_UNSUPPORTED_NAME_SYNTAX, "X509_V_ERR_UNSUPPORTED_NAME_SYNTAX" },
+#endif
+};
+
+#if !defined(ARRAY_SIZE)
+/**
+ * Macro to calculate the number of entries in an array
+ */
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
+char* SSL_get_verify_result_string(int rc)
+{
+	int i;
+	char* retstring = "undef";
+
+	for (i = 0; i < ARRAY_SIZE(X509_message_table); ++i)
+	{
+		if (X509_message_table[i].code == rc)
+		{
+			retstring = X509_message_table[i].string;
+			break;
+		}
+	}
+	return retstring;
+}
+
+
+void SSL_CTX_info_callback(const SSL* ssl, int where, int ret)
+{
+	if (where & SSL_CB_LOOP)
+	{
+		Log(TRACE_PROTOCOL, 1, "SSL state %s:%s:%s", 
+                  (where & SSL_ST_CONNECT) ? "connect" : (where & SSL_ST_ACCEPT) ? "accept" : "undef", 
+                    SSL_state_string_long(ssl), SSL_get_cipher_name(ssl));
+	}
+	else if (where & SSL_CB_EXIT)
+	{
+		Log(TRACE_PROTOCOL, 1, "SSL %s:%s",
+                  (where & SSL_ST_CONNECT) ? "connect" : (where & SSL_ST_ACCEPT) ? "accept" : "undef",
+                    SSL_state_string_long(ssl));
+	}
+	else if (where & SSL_CB_ALERT)
+	{
+		Log(TRACE_PROTOCOL, 1, "SSL alert %s:%s:%s",
+                  (where & SSL_CB_READ) ? "read" : "write", 
+                    SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret));
+	}
+	else if (where & SSL_CB_HANDSHAKE_START)
+	{
+		Log(TRACE_PROTOCOL, 1, "SSL handshake started %s:%s:%s",
+                  (where & SSL_CB_READ) ? "read" : "write", 
+                    SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret));
+	}
+	else if (where & SSL_CB_HANDSHAKE_DONE)
+	{
+		Log(TRACE_PROTOCOL, 1, "SSL handshake done %s:%s:%s", 
+                  (where & SSL_CB_READ) ? "read" : "write",
+                    SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret));
+		Log(TRACE_PROTOCOL, 1, "SSL certificate verification: %s", 
+                    SSL_get_verify_result_string(SSL_get_verify_result(ssl)));
+	}
+	else
+	{
+		Log(TRACE_PROTOCOL, 1, "SSL state %s:%s:%s", SSL_state_string_long(ssl), 
+                   SSL_alert_type_string_long(ret), SSL_alert_desc_string_long(ret));
+	}
+}
+
+
+char* SSLSocket_get_version_string(int version)
+{
+	int i;
+	static char buf[20];
+	char* retstring = NULL;
+	static struct
+	{
+		int code;
+		char* string;
+	}
+	version_string_table[] =
+	{
+		{ SSL2_VERSION, "SSL 2.0" },
+		{ SSL3_VERSION, "SSL 3.0" },
+		{ TLS1_VERSION, "TLS 1.0" },
+#if defined(TLS2_VERSION)
+		{ TLS2_VERSION, "TLS 1.1" },
+#endif
+#if defined(TLS3_VERSION)
+		{ TLS3_VERSION, "TLS 1.2" },
+#endif
+	};
+
+	for (i = 0; i < ARRAY_SIZE(version_string_table); ++i)
+	{
+		if (version_string_table[i].code == version)
+		{
+			retstring = version_string_table[i].string;
+			break;
+		}
+	}
+	
+	if (retstring == NULL)
+	{
+		sprintf(buf, "%i", version);
+		retstring = buf;
+	}
+	return retstring;
+}
+
+
+void SSL_CTX_msg_callback(int write_p, int version, int content_type, const void* buf, size_t len, 
+        SSL* ssl, void* arg)
+{  
+
+/*  
+called by the SSL/TLS library for a protocol message, the function arguments have the following meaning:
+
+write_p
+This flag is 0 when a protocol message has been received and 1 when a protocol message has been sent.
+
+version
+The protocol version according to which the protocol message is interpreted by the library. Currently, this is one of SSL2_VERSION, SSL3_VERSION and TLS1_VERSION (for SSL 2.0, SSL 3.0 and TLS 1.0, respectively).
+
+content_type
+In the case of SSL 2.0, this is always 0. In the case of SSL 3.0 or TLS 1.0, this is one of the ContentType values defined in the protocol specification (change_cipher_spec(20), alert(21), handshake(22); but never application_data(23) because the callback will only be called for protocol messages).
+
+buf, len
+buf points to a buffer containing the protocol message, which consists of len bytes. The buffer is no longer valid after the callback function has returned.
+
+ssl
+The SSL object that received or sent the message.
+
+arg
+The user-defined argument optionally defined by SSL_CTX_set_msg_callback_arg() or SSL_set_msg_callback_arg().
+
+*/
+
+	Log(TRACE_PROTOCOL, -1, "%s %s %d buflen %d", (write_p ? "sent" : "received"), 
+		SSLSocket_get_version_string(version),
+		content_type, (int)len);	
+}
+
+
+int pem_passwd_cb(char* buf, int size, int rwflag, void* userdata)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (!rwflag)
+	{
+		strncpy(buf, (char*)(userdata), size);
+		buf[size-1] = '\0';
+		rc = (int)strlen(buf);
+	}
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+int SSL_create_mutex(ssl_mutex_type* mutex)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	*mutex = CreateMutex(NULL, 0, NULL);
+#else
+	rc = pthread_mutex_init(mutex, NULL);
+#endif
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+int SSL_lock_mutex(ssl_mutex_type* mutex)
+{
+	int rc = -1;
+
+	/* don't add entry/exit trace points, as trace gets lock too, and it might happen quite frequently  */
+#if defined(WIN32) || defined(WIN64)
+	if (WaitForSingleObject(*mutex, INFINITE) != WAIT_FAILED)
+#else
+	if ((rc = pthread_mutex_lock(mutex)) == 0)
+#endif
+	rc = 0;
+
+	return rc;
+}
+
+int SSL_unlock_mutex(ssl_mutex_type* mutex)
+{
+	int rc = -1;
+
+	/* don't add entry/exit trace points, as trace gets lock too, and it might happen quite frequently  */
+#if defined(WIN32) || defined(WIN64)
+	if (ReleaseMutex(*mutex) != 0)
+#else
+	if ((rc = pthread_mutex_unlock(mutex)) == 0)
+#endif
+	rc = 0;
+
+	return rc;
+}
+
+void SSL_destroy_mutex(ssl_mutex_type* mutex)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	rc = CloseHandle(*mutex);
+#else
+	rc = pthread_mutex_destroy(mutex);
+#endif
+	FUNC_EXIT_RC(rc);
+}
+
+
+
+#if (OPENSSL_VERSION_NUMBER >= 0x010000000)
+extern void SSLThread_id(CRYPTO_THREADID *id)
+{
+#if defined(WIN32) || defined(WIN64)
+	CRYPTO_THREADID_set_numeric(id, (unsigned long)GetCurrentThreadId());
+#else
+	CRYPTO_THREADID_set_numeric(id, (unsigned long)pthread_self());
+#endif
+}
+#else
+extern unsigned long SSLThread_id(void)
+{
+#if defined(WIN32) || defined(WIN64)
+	return (unsigned long)GetCurrentThreadId();
+#else
+	return (unsigned long)pthread_self();
+#endif
+}
+#endif
+
+extern void SSLLocks_callback(int mode, int n, const char *file, int line)
+{
+	if (sslLocks)
+	{
+		if (mode & CRYPTO_LOCK)
+			SSL_lock_mutex(&sslLocks[n]);
+		else
+			SSL_unlock_mutex(&sslLocks[n]);
+	}
+}
+
+
+void SSLSocket_handleOpensslInit(int bool_value)
+{
+	handle_openssl_init = bool_value;
+}
+
+
+int SSLSocket_initialize(void)
+{
+	int rc = 0;
+	/*int prc;*/
+	int i;
+	int lockMemSize;
+	
+	FUNC_ENTRY;
+
+	if (handle_openssl_init)
+	{
+		if ((rc = SSL_library_init()) != 1)
+			rc = -1;
+			
+		ERR_load_crypto_strings();
+		SSL_load_error_strings();
+		
+		/* OpenSSL 0.9.8o and 1.0.0a and later added SHA2 algorithms to SSL_library_init(). 
+		Applications which need to use SHA2 in earlier versions of OpenSSL should call 
+		OpenSSL_add_all_algorithms() as well. */
+		
+		OpenSSL_add_all_algorithms();
+		
+		lockMemSize = CRYPTO_num_locks() * sizeof(ssl_mutex_type);
+
+		sslLocks = malloc(lockMemSize);
+		if (!sslLocks)
+		{
+			rc = -1;
+			goto exit;
+		}
+		else
+			memset(sslLocks, 0, lockMemSize);
+
+		for (i = 0; i < CRYPTO_num_locks(); i++)
+		{
+			/* prc = */SSL_create_mutex(&sslLocks[i]);
+		}
+
+#if (OPENSSL_VERSION_NUMBER >= 0x010000000)
+		CRYPTO_THREADID_set_callback(SSLThread_id);
+#else
+		CRYPTO_set_id_callback(SSLThread_id);
+#endif
+		CRYPTO_set_locking_callback(SSLLocks_callback);
+		
+	}
+	
+	SSL_create_mutex(&sslCoreMutex);
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+void SSLSocket_terminate(void)
+{
+	FUNC_ENTRY;
+	
+	if (handle_openssl_init)
+	{
+		EVP_cleanup();
+		ERR_free_strings();
+		CRYPTO_set_locking_callback(NULL);
+		if (sslLocks)
+		{
+			int i = 0;
+
+			for (i = 0; i < CRYPTO_num_locks(); i++)
+			{
+				SSL_destroy_mutex(&sslLocks[i]);
+			}
+			free(sslLocks);
+		}
+	}
+	
+	SSL_destroy_mutex(&sslCoreMutex);
+	
+	FUNC_EXIT;
+}
+
+int SSLSocket_createContext(networkHandles* net, MQTTClient_SSLOptions* opts)
+{
+	int rc = 1;
+	const char* ciphers = NULL;
+	
+	FUNC_ENTRY;
+	if (net->ctx == NULL)
+	{
+		int sslVersion = MQTT_SSL_VERSION_DEFAULT;
+		if (opts->struct_version >= 1) sslVersion = opts->sslVersion;
+/* SSL_OP_NO_TLSv1_1 is defined in ssl.h if the library version supports TLSv1.1.
+ * OPENSSL_NO_TLS1 is defined in opensslconf.h or on the compiler command line
+ * if TLS1.x was removed at OpenSSL library build time via Configure options.
+ */
+		switch (sslVersion)
+		{
+		case MQTT_SSL_VERSION_DEFAULT:
+			net->ctx = SSL_CTX_new(SSLv23_client_method()); /* SSLv23 for compatibility with SSLv2, SSLv3 and TLSv1 */
+			break;
+#if defined(SSL_OP_NO_TLSv1) && !defined(OPENSSL_NO_TLS1)
+		case MQTT_SSL_VERSION_TLS_1_0:
+			net->ctx = SSL_CTX_new(TLSv1_client_method());
+			break;
+#endif
+#if defined(SSL_OP_NO_TLSv1_1) && !defined(OPENSSL_NO_TLS1)
+		case MQTT_SSL_VERSION_TLS_1_1:
+			net->ctx = SSL_CTX_new(TLSv1_1_client_method());
+			break;
+#endif
+#if defined(SSL_OP_NO_TLSv1_2) && !defined(OPENSSL_NO_TLS1)
+		case MQTT_SSL_VERSION_TLS_1_2:
+			net->ctx = SSL_CTX_new(TLSv1_2_client_method());
+			break;
+#endif
+		default:
+			break;
+		}
+		if (net->ctx == NULL)
+		{
+			SSLSocket_error("SSL_CTX_new", NULL, net->socket, rc);
+			goto exit;
+		}
+	}
+	
+	if (opts->keyStore)
+	{
+		if ((rc = SSL_CTX_use_certificate_chain_file(net->ctx, opts->keyStore)) != 1)
+		{
+			SSLSocket_error("SSL_CTX_use_certificate_chain_file", NULL, net->socket, rc);
+			goto free_ctx; /*If we can't load the certificate (chain) file then loading the privatekey won't work either as it needs a matching cert already loaded */
+		}	
+			
+		if (opts->privateKey == NULL)
+			opts->privateKey = opts->keyStore;   /* the privateKey can be included in the keyStore */
+
+		if (opts->privateKeyPassword != NULL)
+		{
+			SSL_CTX_set_default_passwd_cb(net->ctx, pem_passwd_cb);
+			SSL_CTX_set_default_passwd_cb_userdata(net->ctx, (void*)opts->privateKeyPassword);
+		}
+		
+		/* support for ASN.1 == DER format? DER can contain only one certificate? */
+		rc = SSL_CTX_use_PrivateKey_file(net->ctx, opts->privateKey, SSL_FILETYPE_PEM);
+		if (opts->privateKey == opts->keyStore)
+			opts->privateKey = NULL;
+		if (rc != 1)
+		{
+			SSLSocket_error("SSL_CTX_use_PrivateKey_file", NULL, net->socket, rc);
+			goto free_ctx;
+		}  
+	}
+
+	if (opts->trustStore)
+	{
+		if ((rc = SSL_CTX_load_verify_locations(net->ctx, opts->trustStore, NULL)) != 1)
+		{
+			SSLSocket_error("SSL_CTX_load_verify_locations", NULL, net->socket, rc);
+			goto free_ctx;
+		}                               
+	}
+	else if ((rc = SSL_CTX_set_default_verify_paths(net->ctx)) != 1)
+	{
+		SSLSocket_error("SSL_CTX_set_default_verify_paths", NULL, net->socket, rc);
+		goto free_ctx;
+	}
+
+	if (opts->enabledCipherSuites == NULL)
+		ciphers = "DEFAULT"; 
+	else
+		ciphers = opts->enabledCipherSuites;
+
+	if ((rc = SSL_CTX_set_cipher_list(net->ctx, ciphers)) != 1)
+	{
+		SSLSocket_error("SSL_CTX_set_cipher_list", NULL, net->socket, rc);
+		goto free_ctx;
+	}       
+	
+	SSL_CTX_set_mode(net->ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
+	goto exit;
+free_ctx:
+	SSL_CTX_free(net->ctx);
+	net->ctx = NULL;
+	
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts, char* hostname)
+{
+	int rc = 1;
+	
+	FUNC_ENTRY;
+	
+	if (net->ctx != NULL || (rc = SSLSocket_createContext(net, opts)) == 1)
+	{
+		int i;
+
+		SSL_CTX_set_info_callback(net->ctx, SSL_CTX_info_callback);
+		SSL_CTX_set_msg_callback(net->ctx, SSL_CTX_msg_callback);
+   		if (opts->enableServerCertAuth) 
+			SSL_CTX_set_verify(net->ctx, SSL_VERIFY_PEER, NULL);
+	
+		net->ssl = SSL_new(net->ctx);
+
+		/* Log all ciphers available to the SSL sessions (loaded in ctx) */
+		for (i = 0; ;i++)
+		{
+			const char* cipher = SSL_get_cipher_list(net->ssl, i);
+			if (cipher == NULL)
+				break;
+			Log(TRACE_PROTOCOL, 1, "SSL cipher available: %d:%s", i, cipher);
+	    	}	
+		if ((rc = SSL_set_fd(net->ssl, net->socket)) != 1)
+			SSLSocket_error("SSL_set_fd", net->ssl, net->socket, rc);
+
+		if ((rc = SSL_set_tlsext_host_name(net->ssl, hostname)) != 1)
+			SSLSocket_error("SSL_set_tlsext_host_name", NULL, net->socket, rc);
+	}
+		
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int SSLSocket_connect(SSL* ssl, int sock)      
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+
+	rc = SSL_connect(ssl);
+	if (rc != 1)
+	{
+		int error;
+		error = SSLSocket_error("SSL_connect", ssl, sock, rc);
+		if (error == SSL_FATAL)
+			rc = error;
+		if (error == SSL_ERROR_WANT_READ || error == SSL_ERROR_WANT_WRITE)
+			rc = TCPSOCKET_INTERRUPTED;
+	}
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+
+/**
+ *  Reads one byte from a socket
+ *  @param socket the socket to read from
+ *  @param c the character read, returned
+ *  @return completion code
+ */
+int SSLSocket_getch(SSL* ssl, int socket, char* c)
+{
+	int rc = SOCKET_ERROR;
+
+	FUNC_ENTRY;
+	if ((rc = SocketBuffer_getQueuedChar(socket, c)) != SOCKETBUFFER_INTERRUPTED)
+		goto exit;
+
+	if ((rc = SSL_read(ssl, c, (size_t)1)) < 0)
+	{
+		int err = SSLSocket_error("SSL_read - getch", ssl, socket, rc);
+		if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
+		{
+			rc = TCPSOCKET_INTERRUPTED;
+			SocketBuffer_interrupted(socket, 0);
+		}
+	}
+	else if (rc == 0)
+		rc = SOCKET_ERROR; 	/* The return value from recv is 0 when the peer has performed an orderly shutdown. */
+	else if (rc == 1)
+	{
+		SocketBuffer_queueChar(socket, *c);
+		rc = TCPSOCKET_COMPLETE;
+	}
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+
+/**
+ *  Attempts to read a number of bytes from a socket, non-blocking. If a previous read did not
+ *  finish, then retrieve that data.
+ *  @param socket the socket to read from
+ *  @param bytes the number of bytes to read
+ *  @param actual_len the actual number of bytes read
+ *  @return completion code
+ */
+char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len)
+{
+	int rc;
+	char* buf;
+
+	FUNC_ENTRY;
+	if (bytes == 0)
+	{
+		buf = SocketBuffer_complete(socket);
+		goto exit;
+	}
+
+	buf = SocketBuffer_getQueuedData(socket, bytes, actual_len);
+
+	if ((rc = SSL_read(ssl, buf + (*actual_len), (int)(bytes - (*actual_len)))) < 0)
+	{
+		rc = SSLSocket_error("SSL_read - getdata", ssl, socket, rc);
+		if (rc != SSL_ERROR_WANT_READ && rc != SSL_ERROR_WANT_WRITE)
+		{
+			buf = NULL;
+			goto exit;
+		}
+	}
+	else if (rc == 0) /* rc 0 means the other end closed the socket */
+	{
+		buf = NULL;
+		goto exit;
+	}
+	else
+		*actual_len += rc;
+
+	if (*actual_len == bytes)
+	{
+		SocketBuffer_complete(socket);
+		/* if we read the whole packet, there might still be data waiting in the SSL buffer, which
+		isn't picked up by select.  So here we should check for any data remaining in the SSL buffer, and
+		if so, add this socket to a new "pending SSL reads" list.
+		*/
+		if (SSL_pending(ssl) > 0) /* return no of bytes pending */
+			SSLSocket_addPendingRead(socket);
+	}
+	else /* we didn't read the whole packet */
+	{
+		SocketBuffer_interrupted(socket, *actual_len);
+		Log(TRACE_MAX, -1, "SSL_read: %d bytes expected but %d bytes now received", bytes, *actual_len);
+	}
+exit:
+	FUNC_EXIT;
+	return buf;
+}
+
+void SSLSocket_destroyContext(networkHandles* net)
+{
+	FUNC_ENTRY;
+	if (net->ctx)
+		SSL_CTX_free(net->ctx);
+	net->ctx = NULL;
+	FUNC_EXIT;
+}
+
+
+int SSLSocket_close(networkHandles* net)
+{
+	int rc = 1;
+	FUNC_ENTRY;
+	if (net->ssl) {
+		rc = SSL_shutdown(net->ssl);
+		SSL_free(net->ssl);
+		net->ssl = NULL;
+	}
+	SSLSocket_destroyContext(net);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/* No SSL_writev() provided by OpenSSL. Boo. */  
+int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees)
+{
+	int rc = 0;
+	int i;
+	char *ptr;
+	iobuf iovec;
+	int sslerror;
+
+	FUNC_ENTRY;
+	iovec.iov_len = (ULONG)buf0len;
+	for (i = 0; i < count; i++)
+		iovec.iov_len += (ULONG)buflens[i];
+
+	ptr = iovec.iov_base = (char *)malloc(iovec.iov_len);  
+	memcpy(ptr, buf0, buf0len);
+	ptr += buf0len;
+	for (i = 0; i < count; i++)
+	{
+		memcpy(ptr, buffers[i], buflens[i]);
+		ptr += buflens[i];
+	}
+
+	SSL_lock_mutex(&sslCoreMutex);
+	if ((rc = SSL_write(ssl, iovec.iov_base, iovec.iov_len)) == iovec.iov_len)
+		rc = TCPSOCKET_COMPLETE;
+	else 
+	{ 
+		sslerror = SSLSocket_error("SSL_write", ssl, socket, rc);
+		
+		if (sslerror == SSL_ERROR_WANT_WRITE)
+		{
+			int* sockmem = (int*)malloc(sizeof(int));
+			int free = 1;
+
+			Log(TRACE_MIN, -1, "Partial write: incomplete write of %d bytes on SSL socket %d",
+				iovec.iov_len, socket);
+			SocketBuffer_pendingWrite(socket, ssl, 1, &iovec, &free, iovec.iov_len, 0);
+			*sockmem = socket;
+			ListAppend(s.write_pending, sockmem, sizeof(int));
+			FD_SET(socket, &(s.pending_wset));
+			rc = TCPSOCKET_INTERRUPTED;
+		}
+		else 
+			rc = SOCKET_ERROR;
+	}
+	SSL_unlock_mutex(&sslCoreMutex);
+
+	if (rc != TCPSOCKET_INTERRUPTED)
+		free(iovec.iov_base);
+	else
+	{
+		int i;
+		free(buf0);
+		for (i = 0; i < count; ++i)
+		{
+			if (frees[i])
+				free(buffers[i]);
+		}	
+	}
+	FUNC_EXIT_RC(rc); 
+	return rc;
+}
+
+static List pending_reads = {NULL, NULL, NULL, 0, 0};
+
+void SSLSocket_addPendingRead(int sock)
+{
+	FUNC_ENTRY;
+	if (ListFindItem(&pending_reads, &sock, intcompare) == NULL) /* make sure we don't add the same socket twice */
+	{
+		int* psock = (int*)malloc(sizeof(sock));
+		*psock = sock;
+		ListAppend(&pending_reads, psock, sizeof(sock));
+	}
+	else
+		Log(TRACE_MIN, -1, "SSLSocket_addPendingRead: socket %d already in the list", sock);
+
+	FUNC_EXIT;
+}
+
+
+int SSLSocket_getPendingRead(void)
+{
+	int sock = -1;
+	
+	if (pending_reads.count > 0)
+	{
+		sock = *(int*)(pending_reads.first->content);
+		ListRemoveHead(&pending_reads);
+	}
+	return sock;
+}
+
+
+int SSLSocket_continueWrite(pending_writes* pw)
+{
+	int rc = 0; 
+	
+	FUNC_ENTRY;
+	if ((rc = SSL_write(pw->ssl, pw->iovecs[0].iov_base, pw->iovecs[0].iov_len)) == pw->iovecs[0].iov_len)
+	{
+		/* topic and payload buffers are freed elsewhere, when all references to them have been removed */
+		free(pw->iovecs[0].iov_base);
+		Log(TRACE_MIN, -1, "SSL continueWrite: partial write now complete for socket %d", pw->socket);
+		rc = 1;
+	}
+	else
+	{
+		int sslerror = SSLSocket_error("SSL_write", pw->ssl, pw->socket, rc);
+		if (sslerror == SSL_ERROR_WANT_WRITE)
+			rc = 0; /* indicate we haven't finished writing the payload yet */
+	}
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/SSLSocket.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/SSLSocket.h b/thirdparty/paho.mqtt.c/src/SSLSocket.h
new file mode 100644
index 0000000..ca18f62
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/SSLSocket.h
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs, Allan Stockdill-Mander - initial implementation 
+ *    Ian Craggs - SNI support
+ *******************************************************************************/
+#if !defined(SSLSOCKET_H)
+#define SSLSOCKET_H
+
+#if defined(WIN32) || defined(WIN64)
+	#define ssl_mutex_type HANDLE
+#else
+	#include <pthread.h>
+	#include <semaphore.h>
+	#define ssl_mutex_type pthread_mutex_t
+#endif
+
+#include <openssl/ssl.h>
+#include "SocketBuffer.h"
+#include "Clients.h"
+
+#define URI_SSL "ssl://"
+
+/** if we should handle openssl initialization (bool_value == 1) or depend on it to be initalized externally (bool_value == 0) */
+void SSLSocket_handleOpensslInit(int bool_value);
+
+int SSLSocket_initialize(void);
+void SSLSocket_terminate(void);
+int SSLSocket_setSocketForSSL(networkHandles* net, MQTTClient_SSLOptions* opts, char* hostname);
+
+int SSLSocket_getch(SSL* ssl, int socket, char* c);
+char *SSLSocket_getdata(SSL* ssl, int socket, size_t bytes, size_t* actual_len);
+
+int SSLSocket_close(networkHandles* net);
+int SSLSocket_putdatas(SSL* ssl, int socket, char* buf0, size_t buf0len, int count, char** buffers, size_t* buflens, int* frees);
+int SSLSocket_connect(SSL* ssl, int socket);
+
+int SSLSocket_getPendingRead(void);
+int SSLSocket_continueWrite(pending_writes* pw);
+
+#endif


[18/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/README.md
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/README.md b/thirdparty/paho.mqtt.c/README.md
new file mode 100644
index 0000000..66dfec7
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/README.md
@@ -0,0 +1,215 @@
+# Eclipse Paho MQTT C client
+
+This repository contains the source code for the [Eclipse Paho](http://eclipse.org/paho) MQTT C client library.
+
+This code builds libraries which enable applications to connect to an [MQTT](http://mqtt.org) broker to publish messages, and to subscribe to topics and receive published messages.
+
+Both synchronous and asynchronous modes of operation are supported.
+
+## Build Status
+
+Linux Build Status: [![Linux Build Status](https://travis-ci.org/eclipse/paho.mqtt.c.svg?branch=master)](https://travis-ci.org/eclipse/paho.mqtt.c)
+
+## Libraries
+
+The Paho C client comprises four shared libraries:
+
+ * libmqttv3a.so - asynchronous
+ * libmqttv3as.so - asynchronous with SSL
+ * libmqttv3c.so - "classic" / synchronous
+ * libmqttv3cs.so - "classic" / synchronous with SSL
+
+Optionally, using the CMake build, you can build static versions of those libraries.
+
+## Build instructions for GNU Make
+
+Ensure the OpenSSL development package is installed.  Then from the client library base directory run:
+
+```
+make
+sudo make install
+```
+
+This will build and install the libraries.  To uninstall:
+
+```
+sudo make uninstall
+```
+
+To build the documentation requires doxygen and optionally graphviz.
+
+```
+make html
+```
+
+The provided GNU Makefile is intended to perform all build steps in the ```build``` directory within the source-tree of Eclipse Paho. Generated binares, libraries, and the documentation can be found in the ```build/output``` directory after completion. 
+
+Options that are passed to the compiler/linker can be specified by typical Unix build variables:
+
+Variable | Description
+------------ | -------------
+CC | Path to the C compiler
+CFLAGS | Flags passed to compiler calls
+LDFLAGS | Flags passed to linker calls
+
+
+## Build requirements / compilation using CMake
+
+There build process currently supports a number of Linux "flavors" including ARM and s390, OS X, AIX and Solaris as well as the Windows operating system. The build process requires the following tools:
+  * CMake (http://cmake.org)
+  * Ninja (https://martine.github.io/ninja/) or
+    GNU Make (https://www.gnu.org/software/make/), and
+  * gcc (https://gcc.gnu.org/).
+
+On Debian based systems this would mean that the following packages have to be installed:
+
+```
+apt-get install build-essential gcc make cmake cmake-gui cmake-curses-gui
+```
+
+Also, in order to build a debian package from the source code, the following packages have to be installed
+
+```
+apt-get install fakeroot fakeroot devscripts dh-make lsb-release
+```
+
+Ninja can be downloaded from its github project page in the "releases" section. Optionally it is possible to build binaries with SSL support. This requires the OpenSSL libraries and includes to be available. E. g. on Debian:
+
+```
+apt-get install libssl-dev
+```
+
+The documentation requires doxygen and optionally graphviz:
+
+```
+apt-get install doxygen graphviz
+```
+
+Before compiling, determine the value of some variables in order to configure features, library locations, and other options:
+
+Variable | Default Value | Description
+------------ | ------------- | -------------
+PAHO_BUILD_STATIC | FALSE | Build a static version of the libraries
+PAHO_WITH_SSL | FALSE | Flag that defines whether to build ssl-enabled binaries too. 
+OPENSSL_SEARCH_PATH | "" (system default) | Directory containing your OpenSSL installation (i.e. `/usr/local` when headers are in `/usr/local/include` and libraries are in `/usr/local/lib`)
+PAHO_BUILD_DOCUMENTATION | FALSE | Create and install the HTML based API documentation (requires Doxygen)
+PAHO_BUILD_SAMPLES | FALSE | Build sample programs
+MQTT_TEST_BROKER | tcp://localhost:1883 | MQTT connection URL for a broker to use during test execution
+MQTT_TEST_PROXY | tcp://localhost:1883 | Hostname of the test proxy to use
+MQTT_SSL_HOSTNAME | localhost | Hostname of a test SSL MQTT broker to use
+PAHO_BUILD_DEB_PACKAGE | FALSE | Build debian package
+
+Using these variables CMake can be used to generate your Ninja or Make files. Using CMake, building out-of-source is the default. Therefore it is recommended to invoke all build commands inside your chosen build directory but outside of the source tree.
+
+An example build session targeting the build platform could look like this:
+
+```
+mkdir /tmp/build.paho
+cd /tmp/build.paho
+cmake -GNinja -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE ~/git/org.eclipse.paho.mqtt.c
+```
+
+Invoking cmake and specifying build options can also be performed using cmake-gui or ccmake (see https://cmake.org/runningcmake/). For example:
+
+```
+ccmake -GNinja ~/git/org.eclipse.paho.mqtt.c
+```
+
+To compile/link the binaries and to generate packages, simply invoke `ninja package` or `make -j <number-of-cores-to-use> package` after CMake. To simply compile/link invoke `ninja` or `make -j <number-of-cores-to-use>`.
+
+### Debug builds
+
+Debug builds can be performed by defining the value of the ```CMAKE_BUILD_TYPE``` option to ```Debug```. For example:
+
+```
+cmake -GNinja -DCMAKE_BUILD_TYPE=Debug git/org.eclipse.paho.mqtt.c
+```
+
+
+### Running the tests
+
+Test code is available in the ``test`` directory. The tests can be built and executed with the CMake build system. The test execution requires a MQTT broker running. By default, the build system uses ```localhost```, however it is possible to configure the build to use an external broker. These parameters are documented in the Build Requirements section above.
+
+After ensuring a MQTT broker is available, it is possible to execute the tests by starting the proxy and running `ctest` as described below:
+
+```
+python ../test/mqttsas2.py &
+ctest -VV
+```
+
+### Cross compilation
+
+Cross compilation using CMake is performed by using so called "toolchain files" (see: http://www.vtk.org/Wiki/CMake_Cross_Compiling).
+
+The path to the toolchain file can be specified by using CMake's `-DCMAKE_TOOLCHAIN_FILE` option. In case no toolchain file is specified, the build is performed for the native build platform.
+
+For your convenience toolchain files for the following platforms can be found in the `cmake` directory of Eclipse Paho:
+  * Linux x86
+  * Linux ARM11 (a.k.a. the Raspberry Pi)
+  * Windows x86_64
+  * Windows x86
+
+The provided toolchain files assume that required compilers/linkers are to be found in the environment, i. e. the PATH-Variable of your user or system. If you prefer, you can also specify the absolute location of your compilers in the toolchain files.
+
+Example invocation for the Raspberry Pi:
+
+```
+cmake -GNinja -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_SAMPLES=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE -DOPENSSL_LIB_SEARCH_PATH=/tmp/libssl-dev/usr/lib/arm-linux-gnueabihf -DOPENSSL_INC_SEARCH_PATH="/tmp/libssl-dev/usr/include/openssl;/tmp/libssl-dev/usr/include/arm-linux-gnueabihf" -DCMAKE_TOOLCHAIN_FILE=~/git/org.eclipse.paho.mqtt.c/cmake/toolchain.linux-arm11.cmake ~/git/org.eclipse.paho.mqtt.c
+```
+
+Compilers for the Raspberry Pi can be obtained from e. g. Linaro (see: http://releases.linaro.org/15.06/components/toolchain/binaries/4.8/arm-linux-gnueabihf/). This example assumes that OpenSSL-libraries and includes have been installed in the ```/tmp/libssl-dev``` directory.
+
+Example invocation for Windows 64 bit:
+
+```
+cmake -GNinja -DPAHO_BUILD_SAMPLES=TRUE -DCMAKE_TOOLCHAIN_FILE=~/git/org.eclipse.paho.mqtt.c/cmake/toolchain.win64.cmake ~/git/org.eclipse.paho.mqtt.c
+
+```
+
+In this case the libraries and executable are not linked against OpenSSL Libraries. Cross compilers for the Windows platform can be installed on Debian like systems like this:
+
+```
+apt-get install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
+```
+
+## Usage and API
+
+Detailed API documentation is available by building the Doxygen docs in the  ``doc`` directory. A [snapshot is also available online](https://www.eclipse.org/paho/files/mqttdoc/MQTTClient/html/index.html).
+
+Samples are available in the Doxygen docs and also in ``src/samples`` for reference.
+
+Note that using the C headers from a C++ program requires the following declaration as part of the C++ code:
+
+```
+    extern "C" {
+    #include "MQTTClient.h"
+    #include "MQTTClientPersistence.h"
+    }
+```
+
+## Runtime tracing
+
+A number of environment variables control runtime tracing of the C library.
+
+Tracing is switched on using ``MQTT_C_CLIENT_TRACE`` (a value of ON traces to stdout, any other value should specify a file to trace to).
+
+The verbosity of the output is controlled using the  ``MQTT_C_CLIENT_TRACE_LEVEL`` environment variable - valid values are ERROR, PROTOCOL, MINIMUM, MEDIUM and MAXIMUM (from least to most verbose).
+
+The variable ``MQTT_C_CLIENT_TRACE_MAX_LINES`` limits the number of lines of trace that are output.
+
+```
+export MQTT_C_CLIENT_TRACE=ON
+export MQTT_C_CLIENT_TRACE_LEVEL=PROTOCOL
+```
+
+## Reporting bugs
+
+Please open issues in the Github project: https://github.com/eclipse/paho.mqtt.c/issues.
+
+## More information
+
+Discussion of the Paho clients takes place on the [Eclipse paho-dev mailing list](https://dev.eclipse.org/mailman/listinfo/paho-dev).
+
+General questions about the MQTT protocol are discussed in the [MQTT Google Group](https://groups.google.com/forum/?hl=en-US&fromgroups#!forum/mqtt).
+
+There is much more information available via the [MQTT community site](http://mqtt.org).

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj
new file mode 100644
index 0000000..3ae0451
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj	
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>ConsoleApplication1</RootNamespace>
+    <ProjectName>MQTTVersion</ProjectName>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <Text Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\MQTTVersion.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClient.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.filters
new file mode 100644
index 0000000..2442da5
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.filters	
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <Text Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\MQTTVersion.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.user
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.user b/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.user
new file mode 100644
index 0000000..ef5ff2a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/MQTTVersion/MQTTVersion.vcxproj.user	
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup />
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/Paho C MQTT APIs.sln
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/Paho C MQTT APIs.sln b/thirdparty/paho.mqtt.c/Windows Build/Paho C MQTT APIs.sln
new file mode 100644
index 0000000..6b5fcb1
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/Paho C MQTT APIs.sln	
@@ -0,0 +1,155 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26228.9
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "paho-mqtt3c", "paho-mqtt3c\paho-mqtt3c.vcxproj", "{172F8995-C780-44A1-996C-C7949B4DB35A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "paho-mqtt3a", "paho-mqtt3a\paho-mqtt3a.vcxproj", "{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "paho-cs-sub", "stdoutsub\stdoutsub.vcxproj", "{DFDF6238-DA97-4474-84C2-D313E8B985AE}"
+	ProjectSection(ProjectDependencies) = postProject
+		{172F8995-C780-44A1-996C-C7949B4DB35A} = {172F8995-C780-44A1-996C-C7949B4DB35A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "paho-cs-pub", "stdoutsuba\stdoutsuba.vcxproj", "{AF322561-C692-43D3-8502-CC1E6CD2869A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9} = {B479B6EF-787D-4716-912A-E0F6F7BDA7A9}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MQTTVersion", "MQTTVersion\MQTTVersion.vcxproj", "{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "paho-mqtt3as", "paho-mqtt3as\paho-mqtt3as.vcxproj", "{DEF21D1B-CB65-4A78-805F-CF421249EB83}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "paho-mqtt3cs", "paho-mqtt3cs\paho-mqtt3cs.vcxproj", "{17F07F98-AA5F-4373-9877-992A341D650A}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test1", "test1\test1.vcxproj", "{4E643090-289D-487D-BCA8-685EA2210480}"
+	ProjectSection(ProjectDependencies) = postProject
+		{172F8995-C780-44A1-996C-C7949B4DB35A} = {172F8995-C780-44A1-996C-C7949B4DB35A}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test3", "test3\test3.vcxproj", "{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test4", "test4\test4.vcxproj", "{29D6A4E9-5A39-4CD3-8A24-348A34832405}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test5", "test5\test5.vcxproj", "{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test9", "test9\test9.vcxproj", "{D133C05E-87A6-48C6-A703-188A83B82400}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test2", "test2\test2.vcxproj", "{A4E14611-05DC-40A1-815B-DA30CA167C9B}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
+		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Debug|Win32.Build.0 = Debug|Win32
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Debug|x64.ActiveCfg = Debug|x64
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Debug|x64.Build.0 = Debug|x64
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Release|Win32.ActiveCfg = Release|Win32
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Release|Win32.Build.0 = Release|Win32
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Release|x64.ActiveCfg = Release|x64
+		{172F8995-C780-44A1-996C-C7949B4DB35A}.Release|x64.Build.0 = Release|x64
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Debug|Win32.Build.0 = Debug|Win32
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Debug|x64.ActiveCfg = Debug|x64
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Debug|x64.Build.0 = Debug|x64
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Release|Win32.ActiveCfg = Release|Win32
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Release|Win32.Build.0 = Release|Win32
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Release|x64.ActiveCfg = Release|x64
+		{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}.Release|x64.Build.0 = Release|x64
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Debug|Win32.Build.0 = Debug|Win32
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Debug|x64.ActiveCfg = Debug|x64
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Debug|x64.Build.0 = Debug|x64
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Release|Win32.ActiveCfg = Release|Win32
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Release|Win32.Build.0 = Release|Win32
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Release|x64.ActiveCfg = Release|x64
+		{DFDF6238-DA97-4474-84C2-D313E8B985AE}.Release|x64.Build.0 = Release|x64
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Debug|Win32.Build.0 = Debug|Win32
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Debug|x64.ActiveCfg = Debug|x64
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Debug|x64.Build.0 = Debug|x64
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Release|Win32.ActiveCfg = Release|Win32
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Release|Win32.Build.0 = Release|Win32
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Release|x64.ActiveCfg = Release|x64
+		{AF322561-C692-43D3-8502-CC1E6CD2869A}.Release|x64.Build.0 = Release|x64
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Debug|Win32.ActiveCfg = Debug|Win32
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Debug|Win32.Build.0 = Debug|Win32
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Debug|x64.ActiveCfg = Debug|x64
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Debug|x64.Build.0 = Debug|x64
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Release|Win32.ActiveCfg = Release|Win32
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Release|Win32.Build.0 = Release|Win32
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Release|x64.ActiveCfg = Release|x64
+		{6EFC1F3B-CEE1-4DD2-80B4-CEC37954D468}.Release|x64.Build.0 = Release|x64
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Debug|Win32.ActiveCfg = Debug|Win32
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Debug|Win32.Build.0 = Debug|Win32
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Debug|x64.ActiveCfg = Debug|x64
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Debug|x64.Build.0 = Debug|x64
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Release|Win32.ActiveCfg = Release|Win32
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Release|Win32.Build.0 = Release|Win32
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Release|x64.ActiveCfg = Release|x64
+		{DEF21D1B-CB65-4A78-805F-CF421249EB83}.Release|x64.Build.0 = Release|x64
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Debug|Win32.Build.0 = Debug|Win32
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Debug|x64.ActiveCfg = Debug|x64
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Debug|x64.Build.0 = Debug|x64
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Release|Win32.ActiveCfg = Release|Win32
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Release|Win32.Build.0 = Release|Win32
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Release|x64.ActiveCfg = Release|x64
+		{17F07F98-AA5F-4373-9877-992A341D650A}.Release|x64.Build.0 = Release|x64
+		{4E643090-289D-487D-BCA8-685EA2210480}.Debug|Win32.ActiveCfg = Debug|Win32
+		{4E643090-289D-487D-BCA8-685EA2210480}.Debug|Win32.Build.0 = Debug|Win32
+		{4E643090-289D-487D-BCA8-685EA2210480}.Debug|x64.ActiveCfg = Debug|x64
+		{4E643090-289D-487D-BCA8-685EA2210480}.Debug|x64.Build.0 = Debug|x64
+		{4E643090-289D-487D-BCA8-685EA2210480}.Release|Win32.ActiveCfg = Release|Win32
+		{4E643090-289D-487D-BCA8-685EA2210480}.Release|Win32.Build.0 = Release|Win32
+		{4E643090-289D-487D-BCA8-685EA2210480}.Release|x64.ActiveCfg = Release|x64
+		{4E643090-289D-487D-BCA8-685EA2210480}.Release|x64.Build.0 = Release|x64
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Debug|Win32.Build.0 = Debug|Win32
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Debug|x64.ActiveCfg = Debug|x64
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Debug|x64.Build.0 = Debug|x64
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Release|Win32.ActiveCfg = Release|Win32
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Release|Win32.Build.0 = Release|Win32
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Release|x64.ActiveCfg = Release|x64
+		{0CBDD939-F0C9-4887-8C7E-9E645C34FF94}.Release|x64.Build.0 = Release|x64
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Debug|Win32.ActiveCfg = Debug|Win32
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Debug|Win32.Build.0 = Debug|Win32
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Debug|x64.ActiveCfg = Debug|x64
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Debug|x64.Build.0 = Debug|x64
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Release|Win32.ActiveCfg = Release|Win32
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Release|Win32.Build.0 = Release|Win32
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Release|x64.ActiveCfg = Release|x64
+		{29D6A4E9-5A39-4CD3-8A24-348A34832405}.Release|x64.Build.0 = Release|x64
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Debug|Win32.ActiveCfg = Debug|Win32
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Debug|Win32.Build.0 = Debug|Win32
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Debug|x64.ActiveCfg = Debug|x64
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Debug|x64.Build.0 = Debug|x64
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Release|Win32.ActiveCfg = Release|Win32
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Release|Win32.Build.0 = Release|Win32
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Release|x64.ActiveCfg = Release|x64
+		{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}.Release|x64.Build.0 = Release|x64
+		{D133C05E-87A6-48C6-A703-188A83B82400}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D133C05E-87A6-48C6-A703-188A83B82400}.Debug|Win32.Build.0 = Debug|Win32
+		{D133C05E-87A6-48C6-A703-188A83B82400}.Debug|x64.ActiveCfg = Debug|Win32
+		{D133C05E-87A6-48C6-A703-188A83B82400}.Release|Win32.ActiveCfg = Release|Win32
+		{D133C05E-87A6-48C6-A703-188A83B82400}.Release|Win32.Build.0 = Release|Win32
+		{D133C05E-87A6-48C6-A703-188A83B82400}.Release|x64.ActiveCfg = Release|x64
+		{D133C05E-87A6-48C6-A703-188A83B82400}.Release|x64.Build.0 = Release|x64
+		{A4E14611-05DC-40A1-815B-DA30CA167C9B}.Debug|Win32.ActiveCfg = Debug|Win32
+		{A4E14611-05DC-40A1-815B-DA30CA167C9B}.Debug|Win32.Build.0 = Debug|Win32
+		{A4E14611-05DC-40A1-815B-DA30CA167C9B}.Debug|x64.ActiveCfg = Debug|Win32
+		{A4E14611-05DC-40A1-815B-DA30CA167C9B}.Release|Win32.ActiveCfg = Release|Win32
+		{A4E14611-05DC-40A1-815B-DA30CA167C9B}.Release|Win32.Build.0 = Release|Win32
+		{A4E14611-05DC-40A1-815B-DA30CA167C9B}.Release|x64.ActiveCfg = Release|x64
+		{A4E14611-05DC-40A1-815B-DA30CA167C9B}.Release|x64.Build.0 = Release|x64
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj
new file mode 100644
index 0000000..da018c8
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj	
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{B479B6EF-787D-4716-912A-E0F6F7BDA7A9}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>pahomqtt3a</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3A_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3A_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3A_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3A_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c" />
+    <ClCompile Include="..\..\src\Heap.c" />
+    <ClCompile Include="..\..\src\LinkedList.c" />
+    <ClCompile Include="..\..\src\Log.c" />
+    <ClCompile Include="..\..\src\Messages.c" />
+    <ClCompile Include="..\..\src\MQTTAsync.c" />
+    <ClCompile Include="..\..\src\MQTTPacket.c" />
+    <ClCompile Include="..\..\src\MQTTPacketOut.c" />
+    <ClCompile Include="..\..\src\MQTTPersistence.c" />
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c" />
+    <ClCompile Include="..\..\src\MQTTVersion.c" />
+    <ClCompile Include="..\..\src\Socket.c" />
+    <ClCompile Include="..\..\src\SocketBuffer.c" />
+    <ClCompile Include="..\..\src\SSLSocket.c" />
+    <ClCompile Include="..\..\src\StackTrace.c" />
+    <ClCompile Include="..\..\src\Thread.c" />
+    <ClCompile Include="..\..\src\Tree.c" />
+    <ClCompile Include="..\..\src\utf-8.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\Clients.h" />
+    <ClInclude Include="..\..\src\Heap.h" />
+    <ClInclude Include="..\..\src\LinkedList.h" />
+    <ClInclude Include="..\..\src\Log.h" />
+    <ClInclude Include="..\..\src\Messages.h" />
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClient.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+    <ClInclude Include="..\..\src\MQTTPacket.h" />
+    <ClInclude Include="..\..\src\MQTTPacketOut.h" />
+    <ClInclude Include="..\..\src\MQTTPersistence.h" />
+    <ClInclude Include="..\..\src\MQTTPersistenceDefault.h" />
+    <ClInclude Include="..\..\src\MQTTProtocol.h" />
+    <ClInclude Include="..\..\src\MQTTProtocolClient.h" />
+    <ClInclude Include="..\..\src\MQTTProtocolOut.h" />
+    <ClInclude Include="..\..\src\Socket.h" />
+    <ClInclude Include="..\..\src\SocketBuffer.h" />
+    <ClInclude Include="..\..\src\SSLSocket.h" />
+    <ClInclude Include="..\..\src\StackTrace.h" />
+    <ClInclude Include="..\..\src\Thread.h" />
+    <ClInclude Include="..\..\src\Tree.h" />
+    <ClInclude Include="..\..\src\utf-8.h" />
+    <ClInclude Include="..\paho-mqtt3c\stdafx.h" />
+    <ClInclude Include="..\paho-mqtt3c\targetver.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.filters
new file mode 100644
index 0000000..b142753
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.filters	
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\utf-8.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Heap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\LinkedList.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Messages.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacketOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistence.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTVersion.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Socket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SocketBuffer.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SSLSocket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\StackTrace.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Thread.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Tree.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTAsync.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\Clients.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\utf-8.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Heap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\LinkedList.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Log.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Messages.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPacket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPacketOut.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPersistenceDefault.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocol.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocolClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocolOut.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Socket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\SocketBuffer.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\SSLSocket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\StackTrace.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\paho-mqtt3c\stdafx.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\paho-mqtt3c\targetver.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Tree.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.user
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.user b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3a/paho-mqtt3a.vcxproj.user	
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj
new file mode 100644
index 0000000..cfa98a1
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj	
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{DEF21D1B-CB65-4A78-805F-CF421249EB83}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>pahomqtt3as</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;OPENSSL;WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3AS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+      <AdditionalIncludeDirectories>$(OpenSSLDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;libeay32.lib;ssleay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalLibraryDirectories>$(OpenSSLDir)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\Clients.h" />
+    <ClInclude Include="..\..\src\Heap.h" />
+    <ClInclude Include="..\..\src\LinkedList.h" />
+    <ClInclude Include="..\..\src\Log.h" />
+    <ClInclude Include="..\..\src\Messages.h" />
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClient.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+    <ClInclude Include="..\..\src\MQTTPacket.h" />
+    <ClInclude Include="..\..\src\MQTTPacketOut.h" />
+    <ClInclude Include="..\..\src\MQTTPersistence.h" />
+    <ClInclude Include="..\..\src\MQTTPersistenceDefault.h" />
+    <ClInclude Include="..\..\src\MQTTProtocol.h" />
+    <ClInclude Include="..\..\src\MQTTProtocolClient.h" />
+    <ClInclude Include="..\..\src\MQTTProtocolOut.h" />
+    <ClInclude Include="..\..\src\Socket.h" />
+    <ClInclude Include="..\..\src\SocketBuffer.h" />
+    <ClInclude Include="..\..\src\SSLSocket.h" />
+    <ClInclude Include="..\..\src\StackTrace.h" />
+    <ClInclude Include="..\..\src\Thread.h" />
+    <ClInclude Include="..\..\src\Tree.h" />
+    <ClInclude Include="..\..\src\utf-8.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c" />
+    <ClCompile Include="..\..\src\Heap.c" />
+    <ClCompile Include="..\..\src\LinkedList.c" />
+    <ClCompile Include="..\..\src\Log.c" />
+    <ClCompile Include="..\..\src\Messages.c" />
+    <ClCompile Include="..\..\src\MQTTAsync.c" />
+    <ClCompile Include="..\..\src\MQTTPacket.c" />
+    <ClCompile Include="..\..\src\MQTTPacketOut.c" />
+    <ClCompile Include="..\..\src\MQTTPersistence.c" />
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c" />
+    <ClCompile Include="..\..\src\MQTTVersion.c" />
+    <ClCompile Include="..\..\src\Socket.c" />
+    <ClCompile Include="..\..\src\SocketBuffer.c" />
+    <ClCompile Include="..\..\src\SSLSocket.c" />
+    <ClCompile Include="..\..\src\StackTrace.c" />
+    <ClCompile Include="..\..\src\Thread.c" />
+    <ClCompile Include="..\..\src\Tree.c" />
+    <ClCompile Include="..\..\src\utf-8.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.filters
new file mode 100644
index 0000000..87d749a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.filters	
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\Clients.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Heap.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\LinkedList.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Log.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Messages.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPacket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPacketOut.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTPersistenceDefault.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocol.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocolClient.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTProtocolOut.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Socket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\SocketBuffer.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\SSLSocket.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\StackTrace.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Thread.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\Tree.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\utf-8.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Heap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\LinkedList.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Messages.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTAsync.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacketOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistence.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTVersion.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Socket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SocketBuffer.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SSLSocket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\StackTrace.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Thread.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Tree.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\utf-8.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.user
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.user b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.user
new file mode 100644
index 0000000..ef5ff2a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3as/paho-mqtt3as.vcxproj.user	
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup />
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj
new file mode 100644
index 0000000..9461788
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj	
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{172F8995-C780-44A1-996C-C7949B4DB35A}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>pahomqtt3c</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3C_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PAHOMQTT3C_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3C_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PAHOMQTT3C_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c" />
+    <ClCompile Include="..\..\src\Heap.c" />
+    <ClCompile Include="..\..\src\LinkedList.c" />
+    <ClCompile Include="..\..\src\Log.c" />
+    <ClCompile Include="..\..\src\Messages.c" />
+    <ClCompile Include="..\..\src\MQTTClient.c" />
+    <ClCompile Include="..\..\src\MQTTPacket.c" />
+    <ClCompile Include="..\..\src\MQTTPacketOut.c" />
+    <ClCompile Include="..\..\src\MQTTPersistence.c" />
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c" />
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c" />
+    <ClCompile Include="..\..\src\MQTTVersion.c" />
+    <ClCompile Include="..\..\src\Socket.c" />
+    <ClCompile Include="..\..\src\SocketBuffer.c" />
+    <ClCompile Include="..\..\src\SSLSocket.c" />
+    <ClCompile Include="..\..\src\StackTrace.c" />
+    <ClCompile Include="..\..\src\Thread.c" />
+    <ClCompile Include="..\..\src\Tree.c" />
+    <ClCompile Include="..\..\src\utf-8.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.filters
new file mode 100644
index 0000000..18988cc
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.filters	
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\src\Clients.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Heap.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\LinkedList.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Log.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Messages.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTClient.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPacketOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistence.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTPersistenceDefault.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolClient.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTProtocolOut.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\MQTTVersion.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Socket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SocketBuffer.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\SSLSocket.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\StackTrace.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Thread.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\Tree.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\src\utf-8.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.user
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.user b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.user
new file mode 100644
index 0000000..ace9a86
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/paho-mqtt3c/paho-mqtt3c.vcxproj.user	
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+</Project>
\ No newline at end of file


[16/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj.filters
new file mode 100644
index 0000000..6ea29d7
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test4/test4.vcxproj.filters	
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test4.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj
new file mode 100755
index 0000000..f0ee0b2
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj	
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{B8A895EA-C8DE-4235-B4B4-06889BBBDC93}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>test1</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3as.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3as.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3as.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src;$(OpenSSLDir)\include</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3as.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test5.c" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj.filters
new file mode 100644
index 0000000..a9e956e
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test5/test5.vcxproj.filters	
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test5.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj b/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj
new file mode 100644
index 0000000..19d966f
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj	
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{D133C05E-87A6-48C6-A703-188A83B82400}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>test9</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v141</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <OutDir>$(SolutionDir)..\build\output\test\</OutDir>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)..\build\output\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32_LEAN_AND_MEAN;_WINDOWS;WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(SolutionDir)\..\src</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <AdditionalLibraryDirectories>$(SolutionDir)\x64\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalDependencies>ws2_32.lib;paho-mqtt3a.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test9.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h" />
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj.filters
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj.filters b/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj.filters
new file mode 100644
index 0000000..dc608bf
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/Windows Build/test9/test9.vcxproj.filters	
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\test\test9.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\src\MQTTAsync.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\src\MQTTClientPersistence.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/about.html
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/about.html b/thirdparty/paho.mqtt.c/about.html
new file mode 100644
index 0000000..6555a44
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+ 
+<p><em>December 9, 2013</em></p>	
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in ("Content").  Unless otherwise 
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL") and Eclipse Distribution License Version 1.0 ("EDL").
+A copy of the EPL is available at 
+<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> 
+and a copy of the EDL is available at 
+<a href="http://www.eclipse.org/org/documents/edl-v10.php">http://www.eclipse.org/org/documents/edl-v10.php</a>. 
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is 
+being redistributed by another party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.  Check the Redistributor's license that was 
+provided with the Content.  If no such license exists, contact the Redistributor.  Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body></html>

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/android/Android.mk
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/android/Android.mk b/thirdparty/paho.mqtt.c/android/Android.mk
new file mode 100644
index 0000000..6338da5
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/android/Android.mk
@@ -0,0 +1,140 @@
+# Example: Android Native Library makefile for paho.mqtt.c
+# contributed by Bin Li <bi...@windriver.com>
+
+LOCAL_PATH := $(call my-dir)
+libpaho-mqtt3_lib_path := ../src
+libpaho-mqtt3_c_includes := $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path) \
+	external/hdc/android-ifaddrs \
+	external/openssl/include \
+	external/zlib
+
+# build sample util
+define build_sample_util
+__sample_module:= $1
+__sample_lib:= $2
+include $(CLEAR_VARS)
+LOCAL_C_INCLUDES := $(libpaho-mqtt3_c_includes)
+LOCAL_SHARED_LIBRARIES := $$(__sample_lib)
+LOCAL_MODULE := $$(__sample_module)
+LOCAL_SRC_FILES := $(libpaho-mqtt3_lib_path)/samples/$$(__sample_module).c
+include $(BUILD_EXECUTABLE)
+endef
+
+libpaho-mqtt3_local_src_c_files_common := \
+	$(libpaho-mqtt3_lib_path)/MQTTProtocolClient.c \
+	$(libpaho-mqtt3_lib_path)/Tree.c \
+	$(libpaho-mqtt3_lib_path)/Heap.c \
+	$(libpaho-mqtt3_lib_path)/MQTTPacket.c \
+	$(libpaho-mqtt3_lib_path)/Clients.c \
+	$(libpaho-mqtt3_lib_path)/Thread.c \
+	$(libpaho-mqtt3_lib_path)/utf-8.c \
+	$(libpaho-mqtt3_lib_path)/StackTrace.c \
+	$(libpaho-mqtt3_lib_path)/MQTTProtocolOut.c \
+	$(libpaho-mqtt3_lib_path)/Socket.c \
+	$(libpaho-mqtt3_lib_path)/Log.c \
+	$(libpaho-mqtt3_lib_path)/Messages.c \
+	$(libpaho-mqtt3_lib_path)/LinkedList.c \
+	$(libpaho-mqtt3_lib_path)/MQTTPersistence.c \
+	$(libpaho-mqtt3_lib_path)/MQTTPacketOut.c \
+	$(libpaho-mqtt3_lib_path)/SocketBuffer.c \
+	$(libpaho-mqtt3_lib_path)/MQTTPersistenceDefault.c \
+
+libpaho-mqtt3_local_src_c_files_c := \
+	$(libpaho-mqtt3_lib_path)/MQTTClient.c \
+
+libpaho-mqtt3_local_src_c_files_cs := \
+	$(libpaho-mqtt3_lib_path)/MQTTClient.c \
+	$(libpaho-mqtt3_lib_path)/SSLSocket.c \
+
+libpaho-mqtt3_local_src_c_files_a := \
+	$(libpaho-mqtt3_lib_path)/MQTTAsync.c \
+
+libpaho-mqtt3_local_src_c_files_as := \
+	$(libpaho-mqtt3_lib_path)/MQTTAsync.c \
+	$(libpaho-mqtt3_lib_path)/SSLSocket.c \
+
+# update the header file which normally generated by cmake
+$(shell (cp -f $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)/VersionInfo.h.in $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)/VersionInfo.h))
+$(shell (sed -i "s/@CLIENT_VERSION@/1.2.0/g" $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)/VersionInfo.h))
+$(shell ( sed -i "s/@BUILD_TIMESTAMP@/$(shell date)/g" $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)/VersionInfo.h))
+
+# building static libraries
+
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3c
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_c)
+include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3cs
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_CFLAGS += -DOPENSSL
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_cs)
+include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3a
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/${libpaho-mqtt3_lib_path}
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_a)
+include $(BUILD_STATIC_LIBRARY)
+  
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3as
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/${libpaho-mqtt3_lib_path}
+LOCAL_CFLAGS += -DOPENSSL
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_as)
+include $(BUILD_STATIC_LIBRARY)
+
+# building shared libraries
+
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3c
+LOCAL_SHARED_LIBRARIES := libdl
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_c)
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3cs
+LOCAL_SHARED_LIBRARIES := libcrypto libssl libdl
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/$(libpaho-mqtt3_lib_path)
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_CFLAGS += -DOPENSSL
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_cs)
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3a
+LOCAL_SHARED_LIBRARIES := libdl
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/${libpaho-mqtt3_lib_path}
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_a)
+include $(BUILD_SHARED_LIBRARY)
+ 
+include $(CLEAR_VARS)
+LOCAL_MODULE    := libpaho-mqtt3as
+LOCAL_SHARED_LIBRARIES := libcrypto libssl libdl
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/${libpaho-mqtt3_lib_path}
+LOCAL_CFLAGS += -DOPENSSL
+LOCAL_C_INCLUDES:= $(libpaho-mqtt3_c_includes)
+LOCAL_SRC_FILES := $(libpaho-mqtt3_local_src_c_files_common) $(libpaho-mqtt3_local_src_c_files_as)
+include $(BUILD_SHARED_LIBRARY)
+
+# building samples
+
+$(eval $(call build_sample_util, MQTTAsync_subscribe, libpaho-mqtt3a ) )
+$(eval $(call build_sample_util, MQTTAsync_publish, libpaho-mqtt3a ) )
+$(eval $(call build_sample_util, MQTTClient_publish, libpaho-mqtt3c ) )
+$(eval $(call build_sample_util, MQTTClient_publish_async, libpaho-mqtt3c ) )
+$(eval $(call build_sample_util, MQTTClient_subscribe, libpaho-mqtt3c ) )
+$(eval $(call build_sample_util, paho_c_pub, libpaho-mqtt3a ) )
+$(eval $(call build_sample_util, paho_c_sub, libpaho-mqtt3a ) )
+$(eval $(call build_sample_util, paho_cs_pub, libpaho-mqtt3c ) )
+$(eval $(call build_sample_util, paho_cs_sub, libpaho-mqtt3c ) )
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/appveyor.yml
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/appveyor.yml b/thirdparty/paho.mqtt.c/appveyor.yml
new file mode 100644
index 0000000..ce250bd
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/appveyor.yml
@@ -0,0 +1,50 @@
+version: 1.2.{build}
+image:
+  - Visual Studio 2013
+  - Visual Studio 2015
+configuration: Debug
+install:
+  - cmd: openssl version
+
+  - cmd: python --version
+
+  - cmd: netsh advfirewall firewall add rule name="Python 2.7" dir=in action=allow program="C:\Python27\python.exe" enable=yes
+
+  - cmd: netsh advfirewall firewall add rule name="Open Port 1883" dir=in action=allow protocol=TCP localport=1883
+
+  - cmd: netsh advfirewall set allprofiles state off
+
+  - ps: Start-Process python -ArgumentList 'test\mqttsas2.py'
+
+  - cmd: C:\Python36\python --version
+
+  - cmd: git clone https://github.com/eclipse/paho.mqtt.testing.git
+
+  - cmd: cd paho.mqtt.testing\interoperability
+
+  - ps: Start-Process C:\Python36\python -ArgumentList 'startbroker.py'
+
+  - cmd: cd ..\..
+
+build_script:
+- cmd: >-
+    mkdir build.paho
+
+    cd build.paho
+
+    echo %APPVEYOR_BUILD_WORKER_IMAGE%
+
+    if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2015" call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
+
+    if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2013" call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
+
+    cmake -G "NMake Makefiles" -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_SAMPLES=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE ..
+
+    nmake
+
+    ctest -T test -VV
+
+    cd ..
+
+test:
+  assemblies: build/Testing/*/Test.xml

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/build.xml
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/build.xml b/thirdparty/paho.mqtt.c/build.xml
new file mode 100644
index 0000000..07a9ec3
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/build.xml
@@ -0,0 +1,316 @@
+<!--****************************************************************************
+  Copyright (c) 2012, 2017 IBM Corp.
+
+  All rights reserved. This program and the accompanying materials
+  are made available under the terms of the Eclipse Public License v1.0
+  and Eclipse Distribution License v1.0 which accompany this distribution.
+
+  The Eclipse Public License is available at
+     http://www.eclipse.org/legal/epl-v10.html
+  and the Eclipse Distribution License is available at
+    http://www.eclipse.org/org/documents/edl-v10.php.
+
+  Contributors:
+     Ian Craggs - initial API and implementation and/or initial documentation
+*******************************************************************************-->
+
+<project name="MQTT C Client" default="full">
+
+  <taskdef resource="net/sf/antcontrib/antlib.xml">
+    <classpath>
+      <pathelement location="/opt/public/cbi/build/3rdPartyJars/ant-contrib.jar" />
+      <pathelement location="/usr/share/java/ant-contrib.jar" />
+    </classpath>
+  </taskdef>
+
+  <property name="output.folder" value="build/output" />
+  <property name="release.version" value="1.2.0" />
+
+  <property name="libname" value="mqttv3c" />
+  <property name="libname.ssl" value="mqttv3cs" />
+  <property name="libname.async" value="mqttv3a" />
+  <property name="libname.async.ssl" value="mqttv3as" />
+  <property name="ssl" value="yes" />
+  <property name="windows.openssl.folder" value="c:\openssl\bin" />
+  <property name="test.hostname" value="iot.eclipse.org"/>
+  <property name="test.port" value="1883"/>
+  <property name="proxy.port" value="18883"/>
+  <if>
+    <os family="windows"/>
+    <then>
+      <property name="os.family" value="windows" />
+    </then>
+    <else>
+      <if>
+      <os family="mac"/>
+      <then>
+        <property name="os.family" value="mac" />
+      </then>
+      <else>
+        <property name="os.family" value="unix" />
+      </else>
+      </if>
+    </else>
+  </if>
+  <echo message="os.family is '${os.family}'" />
+
+  <target name="init">
+    <tstamp>
+      <format property="buildTimestamp" pattern="yyyyMMddHHmm" />
+    </tstamp>
+
+    <fileset id="sync.source.fileset" dir="src">
+      <include name="*.c"/>
+      <exclude name="MQTTAsync.c"/>
+      <exclude name="MQTTVersion.c"/>
+    </fileset>
+    <pathconvert refid="sync.source.fileset" property="sync.source.files" pathsep=" "/>
+
+    <fileset id="async.source.fileset" dir="src">
+      <include name="*.c"/>
+      <exclude name="MQTTClient.c"/>
+      <exclude name="MQTTVersion.c"/>
+    </fileset>
+    <pathconvert refid="async.source.fileset" property="async.source.files" pathsep=" "/>
+
+  </target>
+
+  <target name="version" depends="init" description="replace tags with the right levels">
+    <property name="build.level" value="${DSTAMP}${TSTAMP}" />
+    <copy file="src/VersionInfo.h.in" tofile="src/VersionInfo.h" overwrite="true"/>
+    <replace file="src/VersionInfo.h" token="@BUILD_TIMESTAMP@" value="${build.level}" />
+    <replace file="src/VersionInfo.h" token="@CLIENT_VERSION@" value="${release.version}" />
+  </target>
+
+  <target name="test" >
+    <!-- display Python version -->
+    <exec executable="python" failonerror="true">
+      <arg line="-V"/>
+    </exec>
+    <exec executable="python" dir="test" spawn="true">
+        <arg value="mqttsas2.py" />
+        <arg value="${test.hostname}" />
+        <arg value="${test.port}" />
+        <arg value="${proxy.port}" />
+    </exec>
+    <if>
+      <os family="windows"/>
+    <then>
+      <foreach target="runAtest" param="aTest" list="test1,test2,test4,test9"/>
+    </then>
+    <else>
+      <foreach target="runAtest" param="aTest" list="test1,test2,test4,test9"/>
+    </else>
+    </if>
+    <foreach target="runSSLtest" param="aTest" list="test3,test5"/>
+  </target>
+
+  <target name="runAtest">
+    <if>
+      <os family="windows"/>
+    <then>
+      <exec executable="cmd.exe" failonerror="true" dir="${output.folder}/test" >
+        <arg value="/c" />
+        <arg value="${aTest}.exe" />
+        <arg value="--connection" />
+        <arg value="tcp://${test.hostname}:${test.port}" />
+        <arg value="--proxy_connection" />
+        <arg value="tcp://localhost:${proxy.port}" />
+        <env key="PATH" path="${output.folder}" />
+      </exec>
+    </then>
+    <else>
+      <exec executable="./${aTest}" failonerror="true" dir="${output.folder}/test" >
+        <arg value="--connection" />
+        <arg value="tcp://${test.hostname}:${test.port}" />
+        <arg value="--proxy_connection" />
+        <arg value="tcp://localhost:${proxy.port}" />
+        <env key="LD_LIBRARY_PATH" path="${output.folder}" />
+        <env key="DYLD_LIBRARY_PATH" path="${output.folder}" />
+      </exec>
+    </else>
+    </if>
+  </target>
+
+  <target name="runSSLtest">
+    <if>
+      <os family="windows"/>
+    <then>
+      <exec executable="cmd.exe" failonerror="true" dir="${output.folder}/test" >
+        <arg value="/c" />
+        <arg value="${aTest}.exe" />
+        <arg value="--hostname" />
+        <arg value="${test.hostname}" />
+        <env key="PATH" path="${output.folder};${windows.openssl.folder}" />
+      </exec>
+    </then>
+    <else>
+      <exec executable="./${aTest}" failonerror="true" dir="${output.folder}/test" >
+        <arg value="--hostname" />
+        <arg value="${test.hostname}" />
+        <env key="LD_LIBRARY_PATH" path="${output.folder}" />
+        <env key="DYLD_LIBRARY_PATH" path="${output.folder}" />
+      </exec>
+    </else>
+    </if>
+  </target>
+
+  <target name="doc" >
+    <if>
+      <available file="/usr/bin/doxygen"/>
+      <then>
+        <mkdir dir="${output.folder}/doc"/>
+        <exec executable="doxygen" dir="src">
+          <arg value="../doc/DoxyfileV3ClientAPI"/>
+        </exec>
+        <exec executable="doxygen" dir="src">
+          <arg value="../doc/DoxyfileV3AsyncAPI"/>
+        </exec>
+        <zip destfile="${output.folder}/MQTTClient_doc.zip">
+          <zipfileset dir="${output.folder}/doc/MQTTClient" />
+        </zip>
+        <zip destfile="${output.folder}/MQTTAsync_doc.zip">
+	        <zipfileset dir="${output.folder}/doc/MQTTAsync" prefix="MQTTAsync/"/>
+        </zip>
+        <delete dir="${output.folder}/doc" />
+      </then>
+      <else>
+        <echo message="doxygen is not available" />
+      </else>
+    </if>
+  </target>
+
+  <target name="build" >
+    <if>
+    <os family="unix"/>
+    <then>
+    <delete dir="${output.folder}" />
+    <!-- display gcc version -->
+    <exec executable="gcc" failonerror="true">
+      <arg line="-v"/>
+    </exec>
+    <if>
+      <available file="/usr/bin/make"/>
+      <then>
+        <exec executable="make" dir="."/>
+      </then>
+    </if>
+    </then>
+    </if>
+    <if>
+    <os family="windows"/>
+    <then>
+    <delete dir="${output.folder}" />
+    <!-- display gcc version -->
+    <exec executable="cl" failonerror="true">
+    </exec>
+    <exec executable="msbuild" dir=".">
+           <arg line='"Windows Build\Paho C MQTT APIs.sln"'/>
+           <arg line="/p:Configuration=Release"/>
+    </exec>
+     </then>
+    </if>
+  </target>
+
+  <target name="package">
+    <mkdir dir="${output.folder}/include"/>
+    <copy overwrite="true" todir="${output.folder}/include">
+      <fileset dir="src" includes="MQTTClient.h,MQTTAsync.h,MQTTClientPersistence.h"/>
+    </copy>
+    <copy overwrite="true" todir="${output.folder}">
+      <fileset dir="." includes="README.md,CONTRIBUTING.md,about.html,notice.html,edl-v10,epl-v10"/>
+    </copy>
+    <mkdir dir="${output.folder}/lib"/>
+    <move overwrite="true" todir="${output.folder}/lib">
+      <fileset dir="${output.folder}" includes="*paho*"/>
+    </move>
+    <mkdir dir="${output.folder}/bin"/>
+    <move overwrite="true" todir="${output.folder}/bin">
+      <fileset dir="${output.folder}/samples" includes="*"/>
+      <fileset dir="${output.folder}" includes="MQTTVersion"/>
+    </move>
+    <copy overwrite="true" todir="${output.folder}/samples">
+      <fileset dir="src/samples" includes="*"/>
+    </copy>
+    <delete>
+       <fileset dir="." includes="eclipse-paho-mqtt-c-windows-${release.version}.zip"/>
+       <fileset dir="." includes="eclipse-paho-mqtt-c-${os.family}-${release.version}.tar.gz"/>
+    </delete>
+
+   <if>
+    <os family="windows"/>
+    <then>
+    <exec executable="c:\cygwin\bin\zip.exe" failonerror="true" dir="${output.folder}">
+      <arg value="-r"/>
+      <arg value="eclipse-paho-mqtt-c-windows-${release.version}.zip"/>
+      <arg value="about.html"/>
+      <arg value="notice.html"/>
+      <arg value="README.md"/>
+      <arg value="CONTRIBUTING.md"/>
+      <arg value="epl-v10"/>
+      <arg value="edl-v10"/>
+      <arg value="include"/>
+	  <arg value="samples"/>
+      <arg value="lib"/>
+      <arg value="bin"/>
+    </exec>
+    </then>
+    <else>
+    <exec executable="tar" failonerror="true" dir="${output.folder}">
+      <arg value="czf"/>
+      <arg value="eclipse-paho-mqtt-c-${os.family}-${release.version}.tar.gz"/>
+      <arg value="about.html"/>
+      <arg value="notice.html"/>
+      <arg value="README.md"/>
+      <arg value="CONTRIBUTING.md"/>
+      <arg value="epl-v10"/>
+      <arg value="edl-v10"/>
+      <arg value="include"/>
+	  <arg value="samples"/>
+      <arg value="lib"/>
+      <arg value="bin"/>
+    </exec>
+    </else>
+    </if>
+
+   <if>
+    <os family="unix"/>
+    <then>
+    <exec executable="tar" failonerror="true" dir=".">
+      <arg value="czf"/>
+      <arg value="${output.folder}/eclipse-paho-mqtt-c-src-${release.version}.tar.gz"/>
+      <arg value="about.html"/>
+      <arg value="notice.html"/>
+      <arg value="README.md"/>
+      <arg value="CONTRIBUTING.md"/>
+      <arg value="epl-v10"/>
+      <arg value="edl-v10"/>
+      <arg value="Makefile"/>
+      <arg value="build.xml"/>
+      <arg value="src"/>
+      <arg value="test"/>
+      <arg value="Windows Build"/>
+    </exec>
+    </then>
+   </if>
+  </target>
+
+  <target name="copy">
+    <if>
+      <available file="/shared/technology"/>
+      <then>
+        <mkdir dir="/shared/technology/paho/C/${release.version}/${build.level}"/>
+       	<echo message="Copying the build output to /shared" />
+      	<copy overwrite="true" todir="/shared/technology/paho/C/${release.version}/${build.level}">
+          <fileset dir="${output.folder}">
+	          <include name="*.gz"/>
+	          <include name="*.zip"/>
+          </fileset>
+        </copy>
+      </then>
+    </if>
+  </target>
+
+  <target name="full" depends="init, version, build, test, doc, package, copy" />
+
+</project>

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/cbuild.bat
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/cbuild.bat b/thirdparty/paho.mqtt.c/cbuild.bat
new file mode 100644
index 0000000..22cbd37
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/cbuild.bat
@@ -0,0 +1,19 @@
+
+setlocal
+
+rmdir /s /q build.paho
+mkdir build.paho
+
+cd build.paho
+
+call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
+
+cmake -G "NMake Makefiles" -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=FALSE -DPAHO_BUILD_SAMPLES=TRUE -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=TRUE ..
+
+nmake
+
+ctest -T test -VV
+
+cd ..
+
+endlocal

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/cmake/CPackDebConfig.cmake.in
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/cmake/CPackDebConfig.cmake.in b/thirdparty/paho.mqtt.c/cmake/CPackDebConfig.cmake.in
new file mode 100644
index 0000000..c815426
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/cmake/CPackDebConfig.cmake.in
@@ -0,0 +1,91 @@
+IF (CPACK_GENERATOR MATCHES "DEB")
+    FIND_PROGRAM(DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems")
+    IF (DPKG_PROGRAM)
+      EXECUTE_PROCESS(
+        COMMAND ${DPKG_PROGRAM} --print-architecture
+        OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+      )
+    ELSE (DPKG_PROGRAM)
+      MESSAGE(FATAL_ERROR "Could not find an architecture for the package")
+    ENDIF (DPKG_PROGRAM)
+
+    EXECUTE_PROCESS(
+      COMMAND lsb_release -si
+      OUTPUT_VARIABLE CPACK_DEBIAN_DIST_NAME
+      RESULT_VARIABLE DIST_NAME_STATUS
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+
+    IF (DIST_NAME_STATUS)
+       MESSAGE(FATAL_ERROR "Could not find a GNU/Linux distribution name")
+    ENDIF (DIST_NAME_STATUS)
+
+    IF (CPACK_DEBIAN_DIST_NAME STREQUAL "")
+      MESSAGE(FATAL_ERROR "Could not find a GNU/Linux distribution name")
+    ENDIF ()
+
+    EXECUTE_PROCESS(
+      COMMAND lsb_release -sc
+      OUTPUT_VARIABLE CPACK_DEBIAN_DIST_CODE
+      RESULT_VARIABLE DIST_CODE_STATUS
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+
+    IF (DIST_NAME_STATUS)
+       MESSAGE(FATAL_ERROR "Could not find a GNU/Linux distribution codename")
+    ENDIF (DIST_NAME_STATUS)
+
+    IF (CPACK_DEBIAN_DIST_CODE STREQUAL "")
+      MESSAGE(FATAL_ERROR "Could not find a GNU/Linux distribution codename")
+    ENDIF ()
+
+    SET(CPACK_PACKAGE_VERSION_MAJOR @PAHO_VERSION_MAJOR@)
+    SET(CPACK_PACKAGE_VERSION_MINOR @PAHO_VERSION_MINOR@)
+    SET(CPACK_PACKAGE_VERSION_PATCH @PAHO_VERSION_PATCH@)
+    SET(PACKAGE_VERSION
+        "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+
+    IF (PACKAGE_VERSION STREQUAL "")
+      MESSAGE(FATAL_ERROR "Could not find a version number for the package")
+    ENDIF ()
+
+    SET(PAHO_WITH_SSL @PAHO_WITH_SSL@)
+
+    MESSAGE("Package version:   ${PACKAGE_VERSION}")
+    MESSAGE("Package built for: ${CPACK_DEBIAN_DIST_NAME} ${CPACK_DEBIAN_DIST_CODE}")
+    IF(PAHO_WITH_SSL)
+        MESSAGE("Package built with ssl-enabled binaries too")
+    ENDIF()
+
+    # Additional lines to a paragraph should start with " "; paragraphs should
+    # be separated with a " ." line
+    SET(CPACK_PACKAGE_NAME "libpaho-mqtt")
+    SET(CPACK_PACKAGE_CONTACT "Eclipse")
+    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Eclipse Paho MQTT C client")
+    SET(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
+    SET(CPACK_DEBIAN_PACKAGE_MAINTAINER
+        "Genis Riera Perez <ge...@gmail.com>")
+    SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Eclipse Paho MQTT C client library")
+    SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+    SET(CPACK_DEBIAN_PACKAGE_VERSION ${PACKAGE_VERSION})
+    SET(CPACK_DEBIAN_PACKAGE_SECTION "net")
+    SET(CPACK_DEBIAN_PACKAGE_CONFLICTS ${CPACK_PACKAGE_NAME})
+    SET(CPACK_PACKAGE_FILE_NAME
+        "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_DEBIAN_PACKAGE_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
+    IF(PAHO_WITH_SSL)
+      SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libssl-dev")
+    ENDIF()
+
+    UNSET(PACKAGE_VERSION CACHE)
+    UNSET(CPACK_DEBIAN_PACKAGE_VERSION CACHE)
+
+    #
+    # From CMakeDebHelper
+    # See http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29
+    #
+
+    # When the DEB-generator runs, we want him to run our install-script
+    #set( CPACK_INSTALL_SCRIPT ${CPACK_DEBIAN_INSTALL_SCRIPT} )
+
+ENDIF()

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelper.cmake
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelper.cmake b/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelper.cmake
new file mode 100644
index 0000000..3dd9572
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelper.cmake
@@ -0,0 +1,74 @@
+#=============================================================================
+# CMakeDebHelper, Copyright (C) 2013 Sebastian Kienzl
+# http://knzl.de/cmake-debhelper/
+# Licensed under the GPL v2, see LICENSE
+#=============================================================================
+
+# configure() .in-files to the CURRENT_BINARY_DIR
+foreach( _F ${DH_INPUT} )
+    # strip the .in part
+    string( REGEX REPLACE ".in$" "" _F_WE ${_F} )
+    configure_file( ${_F} ${_F_WE} @ONLY )
+endforeach()
+
+# compat and control is only needed for running the debhelpers,
+# CMake is going to make up the one that ends up in the deb.
+file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/compat "9" )
+if( NOT CPACK_DEBIAN_PACKAGE_NAME )
+    string( TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME )
+endif()
+file( WRITE ${CMAKE_CURRENT_BINARY_DIR}/control "Package: ${CPACK_DEBIAN_PACKAGE_NAME}\nArchitecture: any\n" )
+
+# Some debhelpers need fakeroot, we use it for all of them
+find_program( FAKEROOT fakeroot )
+if( NOT FAKEROOT )
+    message( SEND_ERROR "fakeroot not found, please install" )
+endif()
+
+find_program( DEBHELPER dh_prep )
+if( NOT DEBHELPER )
+    message( SEND_ERROR "debhelper not found, please install" )
+endif()
+
+# Compose a string with a semicolon-seperated list of debhelpers
+foreach( _DH ${DH_RUN} )
+    set( _DH_RUN_SC_LIST "${_DH_RUN_SC_LIST} ${_DH} ;" )
+endforeach()
+
+# Making sure the debhelpers run each time we change one of ${DH_INPUT}
+add_custom_command(
+    OUTPUT dhtimestamp
+
+    # dh_prep is needed to clean up, dh_* aren't idempotent
+    COMMAND ${FAKEROOT} dh_prep
+    
+    # I haven't found another way to run a list of commands here
+    COMMAND ${FAKEROOT} -- sh -c "${_DH_RUN_SC_LIST}"
+    
+    # needed to create the files we'll use  
+    COMMAND ${FAKEROOT} dh_installdeb
+
+    COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/dhtimestamp
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
+    DEPENDS ${DH_INPUT}
+    COMMENT "Running debhelpers"
+    VERBATIM
+)
+
+add_custom_target( dhtarget ALL
+    DEPENDS dhtimestamp
+)
+
+# these files are generated by debhelpers from our templates
+foreach( _F ${DH_GENERATED_CONTROL_EXTRA} )
+    set( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
+            ${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA} 
+            ${CMAKE_CURRENT_BINARY_DIR}/${CPACK_DEBIAN_PACKAGE_NAME}/DEBIAN/${_F}
+            CACHE INTERNAL ""
+    )
+endforeach()
+
+# This will copy the generated dhhelper-files to our to-be-cpacked-directory.
+# CPACK_INSTALL_SCRIPT must be set to the value of CPACK_DEBIAN_INSTALL_SCRIPT in the file
+# pointed to by CPACK_PROJECT_CONFIG_FILE.
+set( CPACK_DEBIAN_INSTALL_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/CMakeDebHelperInstall.cmake CACHE INTERNAL "" )

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelperInstall.cmake
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelperInstall.cmake b/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelperInstall.cmake
new file mode 100644
index 0000000..7e61b32
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/cmake/modules/CMakeDebHelperInstall.cmake
@@ -0,0 +1,17 @@
+# This script is used internally by CMakeDebHelper.
+# It is run at CPack-Time and copies the files generated by the debhelpers to the right place.
+
+if( NOT CPACK_DEBIAN_PACKAGE_NAME )
+    string( TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME )
+endif()
+
+# Copy all generated files where the packing will happen,
+# exclude the DEBIAN-directory.
+
+MESSAGE(STATUS "CPACK_OUTPUT_FILE_PREFIX: " "${CPACK_OUTPUT_FILE_PREFIX}/debian/${CPACK_DEBIAN_PACKAGE_NAME}/")
+
+file( COPY
+    "${CPACK_OUTPUT_FILE_PREFIX}/debian/${CPACK_DEBIAN_PACKAGE_NAME}/"
+    DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" 
+    PATTERN DEBIAN EXCLUDE
+)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/cmake/toolchain.linux-arm11.cmake
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/cmake/toolchain.linux-arm11.cmake b/thirdparty/paho.mqtt.c/cmake/toolchain.linux-arm11.cmake
new file mode 100644
index 0000000..4965ff7
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/cmake/toolchain.linux-arm11.cmake
@@ -0,0 +1,10 @@
+# path to compiler and utilities
+# specify the cross compiler
+SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
+
+# Name of the target platform
+SET(CMAKE_SYSTEM_NAME Linux)
+SET(CMAKE_SYSTEM_PROCESSOR arm)
+
+# Version of the system
+SET(CMAKE_SYSTEM_VERSION 1)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/cmake/toolchain.win32.cmake
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/cmake/toolchain.win32.cmake b/thirdparty/paho.mqtt.c/cmake/toolchain.win32.cmake
new file mode 100644
index 0000000..05e7254
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/cmake/toolchain.win32.cmake
@@ -0,0 +1,15 @@
+# Name of the target platform
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# Version of the system
+SET(CMAKE_SYSTEM_VERSION 1)
+
+# specify the cross compiler
+SET(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+SET(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
+SET(CMAKE_RC_COMPILER "")
+SET(CMAKE_SHARED_LINKER_FLAGS
+    "-fdata-sections -ffunction-sections -Wl,--enable-stdcall-fixup -static-libgcc -static -lpthread" CACHE STRING "" FORCE)
+SET(CMAKE_EXE_LINKER_FLAGS
+    "-fdata-sections -ffunction-sections -Wl,--enable-stdcall-fixup -static-libgcc -static -lpthread" CACHE STRING "" FORCE)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/cmake/toolchain.win64.cmake
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/cmake/toolchain.win64.cmake b/thirdparty/paho.mqtt.c/cmake/toolchain.win64.cmake
new file mode 100644
index 0000000..98afef1
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/cmake/toolchain.win64.cmake
@@ -0,0 +1,15 @@
+# Name of the target platform
+SET(CMAKE_SYSTEM_NAME Windows)
+
+# Version of the system
+SET(CMAKE_SYSTEM_VERSION 1)
+
+# specify the cross compiler
+SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
+SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
+SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
+SET(CMAKE_RC_COMPILER "")
+SET(CMAKE_SHARED_LINKER_FLAGS
+    "-fdata-sections -ffunction-sections -Wl,--enable-stdcall-fixup -static-libgcc -static -lpthread" CACHE STRING "" FORCE)
+SET(CMAKE_EXE_LINKER_FLAGS
+    "-fdata-sections -ffunction-sections -Wl,--enable-stdcall-fixup -static-libgcc -static -lpthread" CACHE STRING "" FORCE)

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/debian/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/debian/CMakeLists.txt b/thirdparty/paho.mqtt.c/debian/CMakeLists.txt
new file mode 100644
index 0000000..7b315b8
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/debian/CMakeLists.txt
@@ -0,0 +1,16 @@
+# These files (generated by dhelpers) will be copied into the control-part of the deb.
+# Files that end up in the filesystem normally (e.g. cron/init-scripts) must not be mentioned here.
+# It's a good idea to add "conffiles", as the debhelpers may generate it.
+set( DH_GENERATED_CONTROL_EXTRA
+    preinst
+        postinst
+        postrm
+        prerm
+        conffiles
+)
+
+# At this point, CMakeDebHelper must be included (add .cmake if you have it in this directory)
+
+include( CMakeDebHelper )
+
+# CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA and CPACK_INSTALL_SCRIPT are set now, don't modify them!

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/dist/Makefile
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/dist/Makefile b/thirdparty/paho.mqtt.c/dist/Makefile
new file mode 100644
index 0000000..88d9c3d
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/dist/Makefile
@@ -0,0 +1,11 @@
+VERSION=1.2.0
+
+check:
+	rpmlint -i dist/paho-c.spec
+
+rpm-prep:
+	mkdir -p ${HOME}/rpmbuild/SOURCES/
+	tar --transform="s/\./paho-c-${VERSION}/" -cf ${HOME}/rpmbuild/SOURCES/v${VERSION}.tar.gz --exclude=./build.paho --exclude=.git --exclude=*.bz ./ --gzip
+
+rpm: rpm-prep
+	rpmbuild -ba dist/paho-c.spec

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/dist/paho-c.spec
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/dist/paho-c.spec b/thirdparty/paho.mqtt.c/dist/paho-c.spec
new file mode 100644
index 0000000..9314349
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/dist/paho-c.spec
@@ -0,0 +1,78 @@
+Summary:            MQTT C Client
+Name:               paho-c
+Version:            1.2.0
+Release:            3%{?dist}
+License:            Eclipse Distribution License 1.0 and Eclipse Public License 1.0
+Group:              Development/Tools
+Source:             https://github.com/eclipse/paho.mqtt.c/archive/v%{version}.tar.gz
+URL:                https://eclipse.org/paho/clients/c/
+BuildRequires:      cmake
+BuildRequires:      gcc
+BuildRequires:      graphviz
+BuildRequires:      doxygen
+BuildRequires:      openssl-devel
+Requires:           openssl
+
+
+%description
+The Paho MQTT C Client is a fully fledged MQTT client written in ANSI standard C.
+
+
+%package devel
+Summary:            MQTT C Client development kit
+Group:              Development/Libraries
+Requires:           paho-c
+
+%description devel
+Development files and samples for the the Paho MQTT C Client.
+
+
+%package devel-docs
+Summary:            MQTT C Client development kit documentation
+Group:              Development/Libraries
+
+%description devel-docs
+Development documentation files for the the Paho MQTT C Client.
+
+%prep
+%autosetup -n paho-c-%{version}
+
+%build
+mkdir build.paho && cd build.paho
+%cmake -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE ..
+make %{?_smp_mflags}
+
+%install
+cd build.paho
+make install DESTDIR=%{buildroot}
+
+%files
+%doc edl-v10 epl-v10
+%{_libdir}/*
+
+%files devel
+%{_bindir}/*
+%{_includedir}/*
+
+%files devel-docs
+%{_datadir}/*
+
+%changelog
+* Thu Jul 27 2017 Otavio R. Piske <op...@redhat.com> - 1.2.0-4
+- Enabled generation of debuginfo package
+
+* Thu Jul 27 2017 Otavio R. Piske <op...@redhat.com> - 1.2.0-3
+- Fixed changelog issues pointed by rpmlint
+
+* Thu Jul 27 2017 Otavio R. Piske <op...@redhat.com> - 1.2.0-2
+- Updated changelog to comply with Fedora packaging guidelines
+
+* Wed Jul 26 2017 Otavio R. Piske <op...@redhat.com> - 1.2.0-1
+- Fixed rpmlint warnings: replaced cmake call with builtin macro
+- Fixed rpmlint warnings: removed buildroot reference from build section
+
+* Fri Jun 30 2017 Otavio R. Piske <op...@redhat.com> - 1.2.0
+- Updated package to version 1.2.0
+
+* Sat Dec 31 2016 Otavio R. Piske <op...@redhat.com> - 1.1.0
+- Initial packaging

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/CMakeLists.txt b/thirdparty/paho.mqtt.c/doc/CMakeLists.txt
new file mode 100644
index 0000000..06e4c5d
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/doc/CMakeLists.txt
@@ -0,0 +1,40 @@
+#*******************************************************************************
+#  Copyright (c) 2015 logi.cals GmbH
+# 
+#  All rights reserved. This program and the accompanying materials
+#  are made available under the terms of the Eclipse Public License v1.0
+#  and Eclipse Distribution License v1.0 which accompany this distribution. 
+# 
+#  The Eclipse Public License is available at 
+#     http://www.eclipse.org/legal/epl-v10.html
+#  and the Eclipse Distribution License is available at 
+#    http://www.eclipse.org/org/documents/edl-v10.php.
+# 
+#  Contributors:
+#     Rainer Poisel - initial version
+#*******************************************************************************/
+
+# Note: on OS X you should install XCode and the associated command-line tools
+
+### documentation settings
+FIND_PACKAGE(Doxygen)
+IF(NOT DOXYGEN_FOUND)
+    message(FATAL_ERROR "Doxygen is needed to build the documentation.")
+ENDIF()
+SET(DOXYTARGETS)
+FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc)
+FOREACH(DOXYFILE_SRC DoxyfileV3ClientAPI;DoxyfileV3AsyncAPI;DoxyfileV3ClientInternal)
+    SET(DOXYFILE_IN ${DOXYFILE_SRC}.in)
+    SET(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/${DOXYFILE_SRC})
+
+    CONFIGURE_FILE(${DOXYFILE_IN} ${DOXYFILE} @ONLY)
+    ADD_CUSTOM_TARGET(${DOXYFILE_SRC}.target
+        COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE}
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+            COMMENT "Generating API documentation with Doxygen"
+            VERBATIM
+    )
+    SET(DOXYTARGETS ${DOXYTARGETS} ${DOXYFILE_SRC}.target)
+ENDFOREACH(DOXYFILE_SRC)
+ADD_CUSTOM_TARGET(doc ALL DEPENDS ${DOXYTARGETS})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share)


[09/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/epl-v10
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/epl-v10 b/thirdparty/paho.mqtt.c/epl-v10
new file mode 100644
index 0000000..79e486c
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/epl-v10
@@ -0,0 +1,70 @@
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Los
 ses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) 
 above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/notice.html
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/notice.html b/thirdparty/paho.mqtt.c/notice.html
new file mode 100644
index 0000000..f19c483
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/notice.html
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Eclipse Foundation Software User Agreement</title>
+</head>
+
+<body lang="EN-US">
+<h2>Eclipse Foundation Software User Agreement</h2>
+<p>February 1, 2011</p>
+
+<h3>Usage Of Content</h3>
+
+<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
+   (COLLECTIVELY &quot;CONTENT&quot;).  USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
+   CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW.  BY USING THE CONTENT, YOU AGREE THAT YOUR USE
+   OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
+   NOTICES INDICATED OR REFERENCED BELOW.  IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
+   CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
+
+<h3>Applicable Licenses</h3>
+
+<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
+   (&quot;EPL&quot;).  A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+   For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
+   repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
+
+<ul>
+       <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content.  Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
+       <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
+       <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.  Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.  Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
+      and/or Fragments associated with that Feature.</li>
+       <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
+</ul>
+
+<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
+Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;).  Abouts and Feature Licenses may be located in any directory of a Download or Module
+including, but not limited to the following locations:</p>
+
+<ul>
+       <li>The top-level (root) directory</li>
+       <li>Plug-in and Fragment directories</li>
+       <li>Inside Plug-ins and Fragments packaged as JARs</li>
+       <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
+       <li>Feature directories</li>
+</ul>
+
+<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
+installation process.  If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
+inform you where you can locate them.  Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
+Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
+that directory.</p>
+
+<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.  SOME OF THESE
+OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
+
+<ul>
+       <li>Eclipse Distribution License Version 1.0 (available at <a href="http://www.eclipse.org/licenses/edl-v10.html">http://www.eclipse.org/licenses/edl-v1.0.html</a>)</li>
+       <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
+       <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
+       <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
+       <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
+       <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
+</ul>
+
+<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT.  If no About, Feature License, or Feature Update License is provided, please
+contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
+
+
+<h3>Use of Provisioning Technology</h3>
+
+<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
+   Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
+   other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
+   install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
+       href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
+   (&quot;Specification&quot;).</p>
+
+<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
+   applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
+   in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
+   Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
+
+<ol>
+       <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
+       on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
+       product.</li>
+       <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
+       accessed and copied to the Target Machine.</li>
+       <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
+       Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
+       Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
+       the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
+       indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
+</ol>
+
+<h3>Cryptography</h3>
+
+<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
+   another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
+   possession, or use, and re-export of encryption software, to see if this is permitted.</p>
+
+<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/CMakeLists.txt b/thirdparty/paho.mqtt.c/src/CMakeLists.txt
new file mode 100644
index 0000000..c57185b
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/CMakeLists.txt
@@ -0,0 +1,165 @@
+#*******************************************************************************
+#  Copyright (c) 2015, 2017 logi.cals GmbH and others
+#
+#  All rights reserved. This program and the accompanying materials
+#  are made available under the terms of the Eclipse Public License v1.0
+#  and Eclipse Distribution License v1.0 which accompany this distribution.
+#
+#  The Eclipse Public License is available at
+#     http://www.eclipse.org/legal/epl-v10.html
+#  and the Eclipse Distribution License is available at
+#    http://www.eclipse.org/org/documents/edl-v10.php.
+#
+#  Contributors:
+#     Rainer Poisel - initial version
+#     Ian Craggs (IBM Corp.) - merge master
+#*******************************************************************************/
+
+# Note: on OS X you should install XCode and the associated command-line tools
+
+## compilation/linkage settings
+INCLUDE_DIRECTORIES(
+    .
+    ${CMAKE_BINARY_DIR}
+    )
+
+CONFIGURE_FILE(VersionInfo.h.in
+    ${CMAKE_BINARY_DIR}/VersionInfo.h
+    @ONLY
+    )
+
+SET(common_src
+    MQTTProtocolClient.c
+    Clients.c
+    utf-8.c
+    StackTrace.c
+    MQTTPacket.c
+    MQTTPacketOut.c
+    Messages.c
+    Tree.c
+    Socket.c
+    Log.c
+    MQTTPersistence.c
+    Thread.c
+    MQTTProtocolOut.c
+    MQTTPersistenceDefault.c
+    SocketBuffer.c
+    Heap.c
+    LinkedList.c
+    )
+
+IF (WIN32)
+    SET(LIBS_SYSTEM ws2_32)
+ELSEIF (UNIX)
+    IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+        SET(LIBS_SYSTEM c dl pthread)
+    ELSEIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+        SET(LIBS_SYSTEM compat pthread)
+    ELSE()
+        SET(LIBS_SYSTEM c pthread)
+    ENDIF()
+ENDIF()
+
+
+## common compilation for libpaho-mqtt3c and libpaho-mqtt3a
+ADD_LIBRARY(common_obj OBJECT ${common_src})
+SET_PROPERTY(TARGET common_obj PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+ADD_EXECUTABLE(MQTTVersion MQTTVersion.c)
+
+ADD_LIBRARY(paho-mqtt3c SHARED $<TARGET_OBJECTS:common_obj> MQTTClient.c)
+ADD_LIBRARY(paho-mqtt3a SHARED $<TARGET_OBJECTS:common_obj> MQTTAsync.c)
+
+TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM})
+TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM})
+
+TARGET_LINK_LIBRARIES(MQTTVersion paho-mqtt3a paho-mqtt3c ${LIBS_SYSTEM})
+SET_TARGET_PROPERTIES(
+    paho-mqtt3c paho-mqtt3a PROPERTIES
+    VERSION ${CLIENT_VERSION}
+    SOVERSION ${PAHO_VERSION_MAJOR})
+
+INSTALL(TARGETS paho-mqtt3c paho-mqtt3a
+    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+INSTALL(TARGETS MQTTVersion
+    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+IF (PAHO_BUILD_STATIC)
+    ADD_LIBRARY(paho-mqtt3c-static STATIC $<TARGET_OBJECTS:common_obj> MQTTClient.c)
+    ADD_LIBRARY(paho-mqtt3a-static STATIC $<TARGET_OBJECTS:common_obj> MQTTAsync.c)
+
+    TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM})
+    TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM})
+
+    INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static
+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ENDIF()
+
+INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h
+    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+IF (PAHO_WITH_SSL)
+    SET(OPENSSL_SEARCH_PATH "" CACHE PATH "Directory containing OpenSSL libraries and includes")
+
+    IF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+      SET(OPENSSL_SEARCH_PATH "/usr/local/opt/openssl")
+    ENDIF (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+
+    IF (WIN32)
+      SET(OPENSSL_SEARCH_PATH "C:/OpenSSL-Win64")
+    ENDIF ()
+
+    FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
+        HINTS ${OPENSSL_SEARCH_PATH}/include)
+    FIND_LIBRARY(OPENSSL_LIB NAMES ssl libssl ssleay32
+        HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_PATH}/lib64)
+    FIND_LIBRARY(OPENSSLCRYPTO_LIB NAMES crypto libcrypto libeay32
+      	HINTS ${OPENSSL_SEARCH_PATH}/lib ${OPENSSL_SEARCH_PATH}/lib64)
+
+    MESSAGE(STATUS "OpenSSL hints: ${OPENSSL_SEARCH_PATH}")
+    MESSAGE(STATUS "OpenSSL headers found at ${OPENSSL_INCLUDE_DIR}")
+    MESSAGE(STATUS "OpenSSL library found at ${OPENSSL_LIB}")
+    MESSAGE(STATUS "OpenSSL Crypto library found at ${OPENSSLCRYPTO_LIB}")
+
+    INCLUDE_DIRECTORIES(
+        ${OPENSSL_INCLUDE_DIR}
+    )
+
+    ## common compilation for libpaho-mqtt3cs and libpaho-mqtt3as
+    ## Note: SSL libraries must be recompiled due ifdefs
+    ADD_LIBRARY(common_ssl_obj OBJECT ${common_src})
+    SET_PROPERTY(TARGET common_ssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON)
+    SET_PROPERTY(TARGET common_ssl_obj PROPERTY COMPILE_DEFINITIONS "OPENSSL=1")
+    ADD_LIBRARY(paho-mqtt3cs SHARED $<TARGET_OBJECTS:common_ssl_obj> MQTTClient.c SSLSocket.c)
+    ADD_LIBRARY(paho-mqtt3as SHARED $<TARGET_OBJECTS:common_ssl_obj> MQTTAsync.c SSLSocket.c)
+
+    TARGET_LINK_LIBRARIES(paho-mqtt3cs ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM})
+    TARGET_LINK_LIBRARIES(paho-mqtt3as ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM})
+    SET_TARGET_PROPERTIES(
+        paho-mqtt3cs paho-mqtt3as PROPERTIES
+        VERSION ${CLIENT_VERSION}
+        SOVERSION ${PAHO_VERSION_MAJOR}
+        COMPILE_DEFINITIONS "OPENSSL=1")
+    INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as
+        ARCHIVE DESTINATION  ${CMAKE_INSTALL_LIBDIR}
+        LIBRARY DESTINATION  ${CMAKE_INSTALL_LIBDIR}
+        RUNTIME DESTINATION  ${CMAKE_INSTALL_BINDIR})
+
+    IF (PAHO_BUILD_STATIC)
+        ADD_LIBRARY(paho-mqtt3cs-static STATIC $<TARGET_OBJECTS:common_ssl_obj> MQTTClient.c SSLSocket.c)
+        ADD_LIBRARY(paho-mqtt3as-static STATIC $<TARGET_OBJECTS:common_ssl_obj> MQTTAsync.c SSLSocket.c)
+
+        TARGET_LINK_LIBRARIES(paho-mqtt3cs-static ${OPENSSL_LIBRARIES} ${LIBS_SYSTEM})
+        TARGET_LINK_LIBRARIES(paho-mqtt3as-static ${OPENSSL_LIBRARIES} ${LIBS_SYSTEM})
+        SET_TARGET_PROPERTIES(
+        paho-mqtt3cs-static paho-mqtt3as-static PROPERTIES
+        VERSION ${CLIENT_VERSION}
+        SOVERSION ${PAHO_VERSION_MAJOR}
+        COMPILE_DEFINITIONS "OPENSSL=1")
+
+        INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static
+            ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+    ENDIF()
+ENDIF()

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Clients.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Clients.c b/thirdparty/paho.mqtt.c/src/Clients.c
new file mode 100644
index 0000000..477d248
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Clients.c
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - add SSL support
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief functions which apply to client structures
+ * */
+
+
+#include "Clients.h"
+
+#include <string.h>
+#include <stdio.h>
+
+
+/**
+ * List callback function for comparing clients by clientid
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+int clientIDCompare(void* a, void* b)
+{
+	Clients* client = (Clients*)a;
+	/*printf("comparing clientdIDs %s with %s\n", client->clientID, (char*)b);*/
+	return strcmp(client->clientID, (char*)b) == 0;
+}
+
+
+/**
+ * List callback function for comparing clients by socket
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+int clientSocketCompare(void* a, void* b)
+{
+	Clients* client = (Clients*)a;
+	/*printf("comparing %d with %d\n", (char*)a, (char*)b); */
+	return client->net.socket == *(int*)b;
+}

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Clients.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Clients.h b/thirdparty/paho.mqtt.c/src/Clients.h
new file mode 100644
index 0000000..02ed23a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Clients.h
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - add SSL support
+ *    Ian Craggs - fix for bug 413429 - connectionLost not called
+ *    Ian Craggs - change will payload to binary
+ *    Ian Craggs - password to binary
+ *******************************************************************************/
+
+#if !defined(CLIENTS_H)
+#define CLIENTS_H
+
+#include <time.h>
+#if defined(OPENSSL)
+#if defined(WIN32) || defined(WIN64)
+#include <winsock2.h>
+#endif
+#include <openssl/ssl.h>
+#endif
+#include "MQTTClient.h"
+#include "LinkedList.h"
+#include "MQTTClientPersistence.h"
+/*BE
+include "LinkedList"
+BE*/
+
+/*BE
+def PUBLICATIONS
+{
+   n32 ptr STRING open "topic"
+   n32 ptr DATA "payload"
+   n32 dec "payloadlen"
+   n32 dec "refcount"
+}
+BE*/
+/**
+ * Stored publication data to minimize copying
+ */
+typedef struct
+{
+	char *topic;
+	int topiclen;
+	char* payload;
+	int payloadlen;
+	int refcount;
+} Publications;
+
+/*BE
+// This should get moved to MQTTProtocol, but the includes don't quite work yet
+map MESSAGE_TYPES
+{
+   "PUBREC" 5
+   "PUBREL" .
+   "PUBCOMP" .
+}
+
+
+def MESSAGES
+{
+   n32 dec "qos"
+   n32 map bool "retain"
+   n32 dec "msgid"
+   n32 ptr PUBLICATIONS "publish"
+   n32 time "lastTouch"
+   n8 map MESSAGE_TYPES "nextMessageType"
+   n32 dec "len"
+}
+defList(MESSAGES)
+BE*/
+/**
+ * Client publication message data
+ */
+typedef struct
+{
+	int qos;
+	int retain;
+	int msgid;
+	Publications *publish;
+	time_t lastTouch;		/**> used for retry and expiry */
+	char nextMessageType;	/**> PUBREC, PUBREL, PUBCOMP */
+	int len;				/**> length of the whole structure+data */
+} Messages;
+
+
+/*BE
+def WILLMESSAGES
+{
+   n32 ptr STRING open "topic"
+   n32 ptr DATA open "msg"
+   n32 dec "retained"
+   n32 dec "qos"
+}
+BE*/
+
+/**
+ * Client will message data
+ */
+typedef struct
+{
+	char *topic;
+	int payloadlen;
+	void *payload;
+	int retained;
+	int qos;
+} willMessages;
+
+/*BE
+map CLIENT_BITS
+{
+	"cleansession" 1 : .
+	"connected" 2 : .
+	"good" 4 : .
+	"ping_outstanding" 8 : .
+}
+def CLIENTS
+{
+	n32 ptr STRING open "clientID"
+	n32 ptr STRING open "username"
+	n32 ptr STRING open "password"
+	n32 map CLIENT_BITS "bits"
+	at 4 n8 bits 7:6 dec "connect_state"
+	at 8
+	n32 dec "socket"
+	n32 ptr "SSL"
+	n32 dec "msgID"
+	n32 dec "keepAliveInterval"
+	n32 dec "maxInflightMessages"
+	n32 ptr BRIDGECONNECTIONS "bridge_context"
+	n32 time "lastContact"
+	n32 ptr WILLMESSAGES "will"
+	n32 ptr MESSAGESList open "inboundMsgs"
+	n32 ptr MESSAGESList open "outboundMsgs"
+	n32 ptr MESSAGESList open "messageQueue"
+	n32 dec "discardedMsgs"
+}
+
+defList(CLIENTS)
+
+BE*/
+
+typedef struct
+{
+	int socket;
+	time_t lastSent;
+	time_t lastReceived;
+#if defined(OPENSSL)
+	SSL* ssl;
+	SSL_CTX* ctx;
+#endif
+} networkHandles;
+
+/**
+ * Data related to one client
+ */
+typedef struct
+{
+	char* clientID;					      /**< the string id of the client */
+	const char* username;					/**< MQTT v3.1 user name */
+	int passwordlen;              /**< MQTT password length */
+	const void* password;					/**< MQTT v3.1 binary password */
+	unsigned int cleansession : 1;	/**< MQTT clean session flag */
+	unsigned int connected : 1;		/**< whether it is currently connected */
+	unsigned int good : 1; 			  /**< if we have an error on the socket we turn this off */
+	unsigned int ping_outstanding : 1;
+	int connect_state : 4;
+	networkHandles net;
+	int msgID;
+	int keepAliveInterval;
+	int retryInterval;
+	int maxInflightMessages;
+	willMessages* will;
+	List* inboundMsgs;
+	List* outboundMsgs;				/**< in flight */
+	List* messageQueue;
+	unsigned int qentry_seqno;
+	void* phandle;  /* the persistence handle */
+	MQTTClient_persistence* persistence; /* a persistence implementation */
+	void* context; /* calling context - used when calling disconnect_internal */
+	int MQTTVersion;
+#if defined(OPENSSL)
+	MQTTClient_SSLOptions *sslopts;
+	SSL_SESSION* session;    /***< SSL session pointer for fast handhake */
+#endif
+} Clients;
+
+int clientIDCompare(void* a, void* b);
+int clientSocketCompare(void* a, void* b);
+
+/**
+ * Configuration data related to all clients
+ */
+typedef struct
+{
+	const char* version;
+	List* clients;
+} ClientStates;
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Heap.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Heap.c b/thirdparty/paho.mqtt.c/src/Heap.c
new file mode 100644
index 0000000..bef4c70
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Heap.c
@@ -0,0 +1,481 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - use tree data structure instead of list
+ *    Ian Craggs - change roundup to Heap_roundup to avoid macro name clash on MacOSX
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief functions to manage the heap with the goal of eliminating memory leaks
+ *
+ * For any module to use these functions transparently, simply include the Heap.h
+ * header file.  Malloc and free will be redefined, but will behave in exactly the same
+ * way as normal, so no recoding is necessary.
+ *
+ * */
+
+#include "Tree.h"
+#include "Log.h"
+#include "StackTrace.h"
+#include "Thread.h"
+
+#if defined(HEAP_UNIT_TESTS)
+char* Broker_recordFFDC(char* symptoms);
+#endif /* HEAP_UNIT_TESTS */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stddef.h>
+
+#include "Heap.h"
+
+#undef malloc
+#undef realloc
+#undef free
+
+#if defined(WIN32) || defined(WIN64)
+mutex_type heap_mutex;
+#else
+static pthread_mutex_t heap_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type heap_mutex = &heap_mutex_store;
+#endif
+
+static heap_info state = {0, 0}; /**< global heap state information */
+static int eyecatcher = 0x88888888;
+
+/**
+ * Each item on the heap is recorded with this structure.
+ */
+typedef struct
+{
+	char* file;		/**< the name of the source file where the storage was allocated */
+	int line;		/**< the line no in the source file where it was allocated */
+	void* ptr;		/**< pointer to the allocated storage */
+	size_t size;    /**< size of the allocated storage */
+} storageElement;
+
+static Tree heap;	/**< Tree that holds the allocation records */
+static const char *errmsg = "Memory allocation error";
+
+
+static size_t Heap_roundup(size_t size);
+static int ptrCompare(void* a, void* b, int value);
+/*static void Heap_check(char* string, void* ptr);*/
+static void checkEyecatchers(char* file, int line, void* p, size_t size);
+static int Internal_heap_unlink(char* file, int line, void* p);
+static void HeapScan(enum LOG_LEVELS log_level);
+
+
+/**
+ * Round allocation size up to a multiple of the size of an int.  Apart from possibly reducing fragmentation,
+ * on the old v3 gcc compilers I was hitting some weird behaviour, which might have been errors in
+ * sizeof() used on structures and related to packing.  In any case, this fixes that too.
+ * @param size the size actually needed
+ * @return the rounded up size
+ */
+static size_t Heap_roundup(size_t size)
+{
+	static int multsize = 4*sizeof(int);
+
+	if (size % multsize != 0)
+		size += multsize - (size % multsize);
+	return size;
+}
+
+
+/**
+ * List callback function for comparing storage elements
+ * @param a pointer to the current content in the tree (storageElement*)
+ * @param b pointer to the memory to free
+ * @return boolean indicating whether a and b are equal
+ */
+static int ptrCompare(void* a, void* b, int value)
+{
+	a = ((storageElement*)a)->ptr;
+	if (value)
+		b = ((storageElement*)b)->ptr;
+
+	return (a > b) ? -1 : (a == b) ? 0 : 1;
+}
+
+/*
+static void Heap_check(char* string, void* ptr)
+{
+	Node* curnode = NULL;
+	storageElement* prev, *s = NULL;
+
+	printf("Heap_check start %p\n", ptr);
+	while ((curnode = TreeNextElement(&heap, curnode)) != NULL)
+	{
+		prev = s;
+		s = (storageElement*)(curnode->content);
+
+		if (prev)
+		{
+		if (ptrCompare(s, prev, 1) != -1)
+		{
+			printf("%s: heap order error %d %p %p\n", string, ptrCompare(s, prev, 1), prev->ptr, s->ptr);
+			exit(99);
+		}
+		else
+			printf("%s: heap order good %d %p %p\n", string, ptrCompare(s, prev, 1), prev->ptr, s->ptr);
+		}
+	}
+}*/
+
+
+/**
+ * Allocates a block of memory.  A direct replacement for malloc, but keeps track of items
+ * allocated in a list, so that free can check that a item is being freed correctly and that
+ * we can check that all memory is freed at shutdown.
+ * @param file use the __FILE__ macro to indicate which file this item was allocated in
+ * @param line use the __LINE__ macro to indicate which line this item was allocated at
+ * @param size the size of the item to be allocated
+ * @return pointer to the allocated item, or NULL if there was an error
+ */
+void* mymalloc(char* file, int line, size_t size)
+{
+	storageElement* s = NULL;
+	size_t space = sizeof(storageElement);
+	size_t filenamelen = strlen(file)+1;
+
+	Thread_lock_mutex(heap_mutex);
+	size = Heap_roundup(size);
+	if ((s = malloc(sizeof(storageElement))) == NULL)
+	{
+		Log(LOG_ERROR, 13, errmsg);
+		return NULL;
+	}
+	s->size = size; /* size without eyecatchers */
+	if ((s->file = malloc(filenamelen)) == NULL)
+	{
+		Log(LOG_ERROR, 13, errmsg);
+		free(s);
+		return NULL;
+	}
+	space += filenamelen;
+	strcpy(s->file, file);
+	s->line = line;
+	/* Add space for eyecatcher at each end */
+	if ((s->ptr = malloc(size + 2*sizeof(int))) == NULL)
+	{
+		Log(LOG_ERROR, 13, errmsg);
+		free(s->file);
+		free(s);
+		return NULL;
+	}
+	space += size + 2*sizeof(int);
+	*(int*)(s->ptr) = eyecatcher; /* start eyecatcher */
+	*(int*)(((char*)(s->ptr)) + (sizeof(int) + size)) = eyecatcher; /* end eyecatcher */
+	Log(TRACE_MAX, -1, "Allocating %d bytes in heap at file %s line %d ptr %p\n", size, file, line, s->ptr);
+	TreeAdd(&heap, s, space);
+	state.current_size += size;
+	if (state.current_size > state.max_size)
+		state.max_size = state.current_size;
+	Thread_unlock_mutex(heap_mutex);
+	return ((int*)(s->ptr)) + 1;	/* skip start eyecatcher */
+}
+
+
+static void checkEyecatchers(char* file, int line, void* p, size_t size)
+{
+	int *sp = (int*)p;
+	char *cp = (char*)p;
+	int us;
+	static const char *msg = "Invalid %s eyecatcher %d in heap item at file %s line %d";
+
+	if ((us = *--sp) != eyecatcher)
+		Log(LOG_ERROR, 13, msg, "start", us, file, line);
+
+	cp += size;
+	if ((us = *(int*)cp) != eyecatcher)
+		Log(LOG_ERROR, 13, msg, "end", us, file, line);
+}
+
+
+/**
+ * Remove an item from the recorded heap without actually freeing it.
+ * Use sparingly!
+ * @param file use the __FILE__ macro to indicate which file this item was allocated in
+ * @param line use the __LINE__ macro to indicate which line this item was allocated at
+ * @param p pointer to the item to be removed
+ */
+static int Internal_heap_unlink(char* file, int line, void* p)
+{
+	Node* e = NULL;
+	int rc = 0;
+
+	e = TreeFind(&heap, ((int*)p)-1);
+	if (e == NULL)
+		Log(LOG_ERROR, 13, "Failed to remove heap item at file %s line %d", file, line);
+	else
+	{
+		storageElement* s = (storageElement*)(e->content);
+		Log(TRACE_MAX, -1, "Freeing %d bytes in heap at file %s line %d, heap use now %d bytes\n",
+											 s->size, file, line, state.current_size);
+		checkEyecatchers(file, line, p, s->size);
+		/* free(s->ptr); */
+		free(s->file);
+		state.current_size -= s->size;
+		TreeRemoveNodeIndex(&heap, e, 0);
+		free(s);
+		rc = 1;
+	}
+	return rc;
+}
+
+
+/**
+ * Frees a block of memory.  A direct replacement for free, but checks that a item is in
+ * the allocates list first.
+ * @param file use the __FILE__ macro to indicate which file this item was allocated in
+ * @param line use the __LINE__ macro to indicate which line this item was allocated at
+ * @param p pointer to the item to be freed
+ */
+void myfree(char* file, int line, void* p)
+{
+	Thread_lock_mutex(heap_mutex);
+	if (Internal_heap_unlink(file, line, p))
+		free(((int*)p)-1);
+	Thread_unlock_mutex(heap_mutex);
+}
+
+
+/**
+ * Remove an item from the recorded heap without actually freeing it.
+ * Use sparingly!
+ * @param file use the __FILE__ macro to indicate which file this item was allocated in
+ * @param line use the __LINE__ macro to indicate which line this item was allocated at
+ * @param p pointer to the item to be removed
+ */
+void Heap_unlink(char* file, int line, void* p)
+{
+	Thread_lock_mutex(heap_mutex);
+	Internal_heap_unlink(file, line, p);
+	Thread_unlock_mutex(heap_mutex);
+}
+
+
+/**
+ * Reallocates a block of memory.  A direct replacement for realloc, but keeps track of items
+ * allocated in a list, so that free can check that a item is being freed correctly and that
+ * we can check that all memory is freed at shutdown.
+ * We have to remove the item from the tree, as the memory is in order and so it needs to
+ * be reinserted in the correct place.
+ * @param file use the __FILE__ macro to indicate which file this item was reallocated in
+ * @param line use the __LINE__ macro to indicate which line this item was reallocated at
+ * @param p pointer to the item to be reallocated
+ * @param size the new size of the item
+ * @return pointer to the allocated item, or NULL if there was an error
+ */
+void *myrealloc(char* file, int line, void* p, size_t size)
+{
+	void* rc = NULL;
+	storageElement* s = NULL;
+
+	Thread_lock_mutex(heap_mutex);
+	s = TreeRemoveKey(&heap, ((int*)p)-1);
+	if (s == NULL)
+		Log(LOG_ERROR, 13, "Failed to reallocate heap item at file %s line %d", file, line);
+	else
+	{
+		size_t space = sizeof(storageElement);
+		size_t filenamelen = strlen(file)+1;
+
+		checkEyecatchers(file, line, p, s->size);
+		size = Heap_roundup(size);
+		state.current_size += size - s->size;
+		if (state.current_size > state.max_size)
+			state.max_size = state.current_size;
+		if ((s->ptr = realloc(s->ptr, size + 2*sizeof(int))) == NULL)
+		{
+			Log(LOG_ERROR, 13, errmsg);
+			return NULL;
+		}
+		space += size + 2*sizeof(int) - s->size;
+		*(int*)(s->ptr) = eyecatcher; /* start eyecatcher */
+		*(int*)(((char*)(s->ptr)) + (sizeof(int) + size)) = eyecatcher; /* end eyecatcher */
+		s->size = size;
+		space -= strlen(s->file);
+		s->file = realloc(s->file, filenamelen);
+		space += filenamelen;
+		strcpy(s->file, file);
+		s->line = line;
+		rc = s->ptr;
+		TreeAdd(&heap, s, space);
+	}
+	Thread_unlock_mutex(heap_mutex);
+	return (rc == NULL) ? NULL : ((int*)(rc)) + 1;	/* skip start eyecatcher */
+}
+
+
+/**
+ * Utility to find an item in the heap.  Lets you know if the heap already contains
+ * the memory location in question.
+ * @param p pointer to a memory location
+ * @return pointer to the storage element if found, or NULL
+ */
+void* Heap_findItem(void* p)
+{
+	Node* e = NULL;
+
+	Thread_lock_mutex(heap_mutex);
+	e = TreeFind(&heap, ((int*)p)-1);
+	Thread_unlock_mutex(heap_mutex);
+	return (e == NULL) ? NULL : e->content;
+}
+
+
+/**
+ * Scans the heap and reports any items currently allocated.
+ * To be used at shutdown if any heap items have not been freed.
+ */
+static void HeapScan(enum LOG_LEVELS log_level)
+{
+	Node* current = NULL;
+
+	Thread_lock_mutex(heap_mutex);
+	Log(log_level, -1, "Heap scan start, total %d bytes", state.current_size);
+	while ((current = TreeNextElement(&heap, current)) != NULL)
+	{
+		storageElement* s = (storageElement*)(current->content);
+		Log(log_level, -1, "Heap element size %d, line %d, file %s, ptr %p", s->size, s->line, s->file, s->ptr);
+		Log(log_level, -1, "  Content %*.s", (10 > current->size) ? s->size : 10, (char*)(((int*)s->ptr) + 1));
+	}
+	Log(log_level, -1, "Heap scan end");
+	Thread_unlock_mutex(heap_mutex);
+}
+
+
+/**
+ * Heap initialization.
+ */
+int Heap_initialize(void)
+{
+	TreeInitializeNoMalloc(&heap, ptrCompare);
+	heap.heap_tracking = 0; /* no recursive heap tracking! */
+	return 0;
+}
+
+
+/**
+ * Heap termination.
+ */
+void Heap_terminate(void)
+{
+	Log(TRACE_MIN, -1, "Maximum heap use was %d bytes", state.max_size);
+	if (state.current_size > 20) /* One log list is freed after this function is called */
+	{
+		Log(LOG_ERROR, -1, "Some memory not freed at shutdown, possible memory leak");
+		HeapScan(LOG_ERROR);
+	}
+}
+
+
+/**
+ * Access to heap state
+ * @return pointer to the heap state structure
+ */
+heap_info* Heap_get_info(void)
+{
+	return &state;
+}
+
+
+/**
+ * Dump a string from the heap so that it can be displayed conveniently
+ * @param file file handle to dump the heap contents to
+ * @param str the string to dump, could be NULL
+ */
+int HeapDumpString(FILE* file, char* str)
+{
+	int rc = 0;
+	size_t len = str ? strlen(str) + 1 : 0; /* include the trailing null */
+
+	if (fwrite(&(str), sizeof(char*), 1, file) != 1)
+		rc = -1;
+	else if (fwrite(&(len), sizeof(int), 1 ,file) != 1)
+		rc = -1;
+	else if (len > 0 && fwrite(str, len, 1, file) != 1)
+		rc = -1;
+	return rc;
+}
+
+
+/**
+ * Dump the state of the heap
+ * @param file file handle to dump the heap contents to
+ */
+int HeapDump(FILE* file)
+{
+	int rc = 0;
+	Node* current = NULL;
+
+	while (rc == 0 && (current = TreeNextElement(&heap, current)))
+	{
+		storageElement* s = (storageElement*)(current->content);
+
+		if (fwrite(&(s->ptr), sizeof(s->ptr), 1, file) != 1)
+			rc = -1;
+		else if (fwrite(&(current->size), sizeof(current->size), 1, file) != 1)
+			rc = -1;
+		else if (fwrite(s->ptr, current->size, 1, file) != 1)
+			rc = -1;
+	}
+	return rc;
+}
+
+
+#if defined(HEAP_UNIT_TESTS)
+
+void Log(enum LOG_LEVELS log_level, int msgno, char* format, ...)
+{
+	printf("Log %s", format);
+}
+
+char* Broker_recordFFDC(char* symptoms)
+{
+	printf("recordFFDC");
+	return "";
+}
+
+#define malloc(x) mymalloc(__FILE__, __LINE__, x)
+#define realloc(a, b) myrealloc(__FILE__, __LINE__, a, b)
+#define free(x) myfree(__FILE__, __LINE__, x)
+
+int main(int argc, char *argv[])
+{
+	char* h = NULL;
+	Heap_initialize();
+
+	h = malloc(12);
+	free(h);
+	printf("freed h\n");
+
+	h = malloc(12);
+	h = realloc(h, 14);
+	h = realloc(h, 25);
+	h = realloc(h, 255);
+	h = realloc(h, 2225);
+	h = realloc(h, 22225);
+    printf("freeing h\n");
+	free(h);
+	Heap_terminate();
+	printf("Finishing\n");
+	return 0;
+}
+
+#endif /* HEAP_UNIT_TESTS */

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Heap.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Heap.h b/thirdparty/paho.mqtt.c/src/Heap.h
new file mode 100644
index 0000000..165b89f
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Heap.h
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - use tree data structure instead of list
+ *******************************************************************************/
+
+
+#if !defined(HEAP_H)
+#define HEAP_H
+
+#if defined(HIGH_PERFORMANCE)
+#define NO_HEAP_TRACKING 1
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#if !defined(NO_HEAP_TRACKING)
+/**
+ * redefines malloc to use "mymalloc" so that heap allocation can be tracked
+ * @param x the size of the item to be allocated
+ * @return the pointer to the item allocated, or NULL
+ */
+#define malloc(x) mymalloc(__FILE__, __LINE__, x)
+
+/**
+ * redefines realloc to use "myrealloc" so that heap allocation can be tracked
+ * @param a the heap item to be reallocated
+ * @param b the new size of the item
+ * @return the new pointer to the heap item
+ */
+#define realloc(a, b) myrealloc(__FILE__, __LINE__, a, b)
+
+/**
+ * redefines free to use "myfree" so that heap allocation can be tracked
+ * @param x the size of the item to be freed
+ */
+#define free(x) myfree(__FILE__, __LINE__, x)
+
+#endif
+
+/**
+ * Information about the state of the heap.
+ */
+typedef struct
+{
+	size_t current_size;	/**< current size of the heap in bytes */
+	size_t max_size;		/**< max size the heap has reached in bytes */
+} heap_info;
+
+
+void* mymalloc(char*, int, size_t size);
+void* myrealloc(char*, int, void* p, size_t size);
+void myfree(char*, int, void* p);
+
+void Heap_scan(FILE* file);
+int Heap_initialize(void);
+void Heap_terminate(void);
+heap_info* Heap_get_info(void);
+int HeapDump(FILE* file);
+int HeapDumpString(FILE* file, char* str);
+void* Heap_findItem(void* p);
+void Heap_unlink(char* file, int line, void* p);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/LinkedList.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/LinkedList.c b/thirdparty/paho.mqtt.c/src/LinkedList.c
new file mode 100644
index 0000000..a8d073e
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/LinkedList.c
@@ -0,0 +1,500 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - updates for the async client
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief functions which apply to linked list structures.
+ *
+ * These linked lists can hold data of any sort, pointed to by the content pointer of the
+ * ListElement structure.  ListElements hold the points to the next and previous items in the
+ * list.
+ * */
+
+#include "LinkedList.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "Heap.h"
+
+
+static int ListUnlink(List* aList, void* content, int(*callback)(void*, void*), int freeContent);
+
+
+/**
+ * Sets a list structure to empty - all null values.  Does not remove any items from the list.
+ * @param newl a pointer to the list structure to be initialized
+ */
+void ListZero(List* newl)
+{
+	memset(newl, '\0', sizeof(List));
+	/*newl->first = NULL;
+	newl->last = NULL;
+	newl->current = NULL;
+	newl->count = newl->size = 0;*/
+}
+
+
+/**
+ * Allocates and initializes a new list structure.
+ * @return a pointer to the new list structure
+ */
+List* ListInitialize(void)
+{
+	List* newl = malloc(sizeof(List));
+	ListZero(newl);
+	return newl;
+}
+
+
+/**
+ * Append an already allocated ListElement and content to a list.  Can be used to move
+ * an item from one list to another.
+ * @param aList the list to which the item is to be added
+ * @param content the list item content itself
+ * @param newel the ListElement to be used in adding the new item
+ * @param size the size of the element
+ */
+void ListAppendNoMalloc(List* aList, void* content, ListElement* newel, size_t size)
+{ /* for heap use */
+	newel->content = content;
+	newel->next = NULL;
+	newel->prev = aList->last;
+	if (aList->first == NULL)
+		aList->first = newel;
+	else
+		aList->last->next = newel;
+	aList->last = newel;
+	++(aList->count);
+	aList->size += size;
+}
+
+
+/**
+ * Append an item to a list.
+ * @param aList the list to which the item is to be added
+ * @param content the list item content itself
+ * @param size the size of the element
+ */
+void ListAppend(List* aList, void* content, size_t size)
+{
+	ListElement* newel = malloc(sizeof(ListElement));
+	ListAppendNoMalloc(aList, content, newel, size);
+}
+
+
+/**
+ * Insert an item to a list at a specific position.
+ * @param aList the list to which the item is to be added
+ * @param content the list item content itself
+ * @param size the size of the element
+ * @param index the position in the list. If NULL, this function is equivalent
+ * to ListAppend.
+ */
+void ListInsert(List* aList, void* content, size_t size, ListElement* index)
+{
+	ListElement* newel = malloc(sizeof(ListElement));
+
+	if ( index == NULL )
+		ListAppendNoMalloc(aList, content, newel, size);
+	else
+	{
+		newel->content = content;
+		newel->next = index;
+		newel->prev = index->prev;
+
+		index->prev = newel;
+		if ( newel->prev != NULL )
+			newel->prev->next = newel;
+		else
+			aList->first = newel;
+
+		++(aList->count);
+		aList->size += size;
+	}
+}
+
+
+/**
+ * Finds an element in a list by comparing the content pointers, rather than the contents
+ * @param aList the list in which the search is to be conducted
+ * @param content pointer to the list item content itself
+ * @return the list item found, or NULL
+ */
+ListElement* ListFind(List* aList, void* content)
+{
+	return ListFindItem(aList, content, NULL);
+}
+
+
+/**
+ * Finds an element in a list by comparing the content or pointer to the content.  A callback
+ * function is used to define the method of comparison for each element.
+ * @param aList the list in which the search is to be conducted
+ * @param content pointer to the content to look for
+ * @param callback pointer to a function which compares each element (NULL means compare by content pointer)
+ * @return the list element found, or NULL
+ */
+ListElement* ListFindItem(List* aList, void* content, int(*callback)(void*, void*))
+{
+	ListElement* rc = NULL;
+
+	if (aList->current != NULL && ((callback == NULL && aList->current->content == content) ||
+		   (callback != NULL && callback(aList->current->content, content))))
+		rc = aList->current;
+	else
+	{
+		ListElement* current = NULL;
+
+		/* find the content */
+		while (ListNextElement(aList, &current) != NULL)
+		{
+			if (callback == NULL)
+			{
+				if (current->content == content)
+				{
+					rc = current;
+					break;
+				}
+			}
+			else
+			{
+				if (callback(current->content, content))
+				{
+					rc = current;
+					break;
+				}
+			}
+		}
+		if (rc != NULL)
+			aList->current = rc;
+	}
+	return rc;
+}
+
+
+/**
+ * Removes and optionally frees an element in a list by comparing the content.
+ * A callback function is used to define the method of comparison for each element.
+ * @param aList the list in which the search is to be conducted
+ * @param content pointer to the content to look for
+ * @param callback pointer to a function which compares each element
+ * @param freeContent boolean value to indicate whether the item found is to be freed
+ * @return 1=item removed, 0=item not removed
+ */
+static int ListUnlink(List* aList, void* content, int(*callback)(void*, void*), int freeContent)
+{
+	ListElement* next = NULL;
+	ListElement* saved = aList->current;
+	int saveddeleted = 0;
+
+	if (!ListFindItem(aList, content, callback))
+		return 0; /* false, did not remove item */
+
+	if (aList->current->prev == NULL)
+		/* so this is the first element, and we have to update the "first" pointer */
+		aList->first = aList->current->next;
+	else
+		aList->current->prev->next = aList->current->next;
+
+	if (aList->current->next == NULL)
+		aList->last = aList->current->prev;
+	else
+		aList->current->next->prev = aList->current->prev;
+
+	next = aList->current->next;
+	if (freeContent)
+		free(aList->current->content);
+	if (saved == aList->current)
+		saveddeleted = 1;
+	free(aList->current);
+	if (saveddeleted)
+		aList->current = next;
+	else
+		aList->current = saved;
+	--(aList->count);
+	return 1; /* successfully removed item */
+}
+
+
+/**
+ * Removes but does not free an item in a list by comparing the pointer to the content.
+ * @param aList the list in which the search is to be conducted
+ * @param content pointer to the content to look for
+ * @return 1=item removed, 0=item not removed
+ */
+int ListDetach(List* aList, void* content)
+{
+	return ListUnlink(aList, content, NULL, 0);
+}
+
+
+/**
+ * Removes and frees an item in a list by comparing the pointer to the content.
+ * @param aList the list from which the item is to be removed
+ * @param content pointer to the content to look for
+ * @return 1=item removed, 0=item not removed
+ */
+int ListRemove(List* aList, void* content)
+{
+	return ListUnlink(aList, content, NULL, 1);
+}
+
+
+/**
+ * Removes and frees an the first item in a list.
+ * @param aList the list from which the item is to be removed
+ * @return 1=item removed, 0=item not removed
+ */
+void* ListDetachHead(List* aList)
+{
+	void *content = NULL;
+	if (aList->count > 0)
+	{
+		ListElement* first = aList->first;
+		if (aList->current == first)
+			aList->current = first->next;
+		if (aList->last == first) /* i.e. no of items in list == 1 */
+			aList->last = NULL;
+		content = first->content;
+		aList->first = aList->first->next;
+		if (aList->first)
+			aList->first->prev = NULL;
+		free(first);
+		--(aList->count);
+	}
+	return content;
+}
+
+
+/**
+ * Removes and frees an the first item in a list.
+ * @param aList the list from which the item is to be removed
+ * @return 1=item removed, 0=item not removed
+ */
+int ListRemoveHead(List* aList)
+{
+	free(ListDetachHead(aList));
+	return 0;
+}
+
+
+/**
+ * Removes but does not free the last item in a list.
+ * @param aList the list from which the item is to be removed
+ * @return the last item removed (or NULL if none was)
+ */
+void* ListPopTail(List* aList)
+{
+	void* content = NULL;
+	if (aList->count > 0)
+	{
+		ListElement* last = aList->last;
+		if (aList->current == last)
+			aList->current = last->prev;
+		if (aList->first == last) /* i.e. no of items in list == 1 */
+			aList->first = NULL;
+		content = last->content;
+		aList->last = aList->last->prev;
+		if (aList->last)
+			aList->last->next = NULL;
+		free(last);
+		--(aList->count);
+	}
+	return content;
+}
+
+
+/**
+ * Removes but does not free an element in a list by comparing the content.
+ * A callback function is used to define the method of comparison for each element.
+ * @param aList the list in which the search is to be conducted
+ * @param content pointer to the content to look for
+ * @param callback pointer to a function which compares each element
+ * @return 1=item removed, 0=item not removed
+ */
+int ListDetachItem(List* aList, void* content, int(*callback)(void*, void*))
+{ /* do not free the content */
+	return ListUnlink(aList, content, callback, 0);
+}
+
+
+/**
+ * Removes and frees an element in a list by comparing the content.
+ * A callback function is used to define the method of comparison for each element
+ * @param aList the list in which the search is to be conducted
+ * @param content pointer to the content to look for
+ * @param callback pointer to a function which compares each element
+ * @return 1=item removed, 0=item not removed
+ */
+int ListRemoveItem(List* aList, void* content, int(*callback)(void*, void*))
+{ /* remove from list and free the content */
+	return ListUnlink(aList, content, callback, 1);
+}
+
+
+/**
+ * Removes and frees all items in a list, leaving the list ready for new items.
+ * @param aList the list to which the operation is to be applied
+ */
+void ListEmpty(List* aList)
+{
+	while (aList->first != NULL)
+	{
+		ListElement* first = aList->first;
+		if (first->content != NULL)
+			free(first->content);
+		aList->first = first->next;
+		free(first);
+	}
+	aList->count = 0;
+	aList->size = 0;
+	aList->current = aList->first = aList->last = NULL;
+}
+
+/**
+ * Removes and frees all items in a list, and frees the list itself
+ * @param aList the list to which the operation is to be applied
+ */
+void ListFree(List* aList)
+{
+	ListEmpty(aList);
+	free(aList);
+}
+
+
+/**
+ * Removes and but does not free all items in a list, and frees the list itself
+ * @param aList the list to which the operation is to be applied
+ */
+void ListFreeNoContent(List* aList)
+{
+	while (aList->first != NULL)
+	{
+		ListElement* first = aList->first;
+		aList->first = first->next;
+		free(first);
+	}
+	free(aList);
+}
+
+
+/**
+ * Forward iteration through a list
+ * @param aList the list to which the operation is to be applied
+ * @param pos pointer to the current position in the list.  NULL means start from the beginning of the list
+ * This is updated on return to the same value as that returned from this function
+ * @return pointer to the current list element
+ */
+ListElement* ListNextElement(List* aList, ListElement** pos)
+{
+	return *pos = (*pos == NULL) ? aList->first : (*pos)->next;
+}
+
+
+/**
+ * Backward iteration through a list
+ * @param aList the list to which the operation is to be applied
+ * @param pos pointer to the current position in the list.  NULL means start from the end of the list
+ * This is updated on return to the same value as that returned from this function
+ * @return pointer to the current list element
+ */
+ListElement* ListPrevElement(List* aList, ListElement** pos)
+{
+	return *pos = (*pos == NULL) ? aList->last : (*pos)->prev;
+}
+
+
+/**
+ * List callback function for comparing integers
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+int intcompare(void* a, void* b)
+{
+	return *((int*)a) == *((int*)b);
+}
+
+
+/**
+ * List callback function for comparing C strings
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+int stringcompare(void* a, void* b)
+{
+	return strcmp((char*)a, (char*)b) == 0;
+}
+
+
+#if defined(UNIT_TESTS)
+
+
+int main(int argc, char *argv[])
+{
+	int i, *ip, *todelete;
+	ListElement* current = NULL;
+	List* l = ListInitialize();
+	printf("List initialized\n");
+
+	for (i = 0; i < 10; i++)
+	{
+		ip = malloc(sizeof(int));
+		*ip = i;
+		ListAppend(l, (void*)ip, sizeof(int));
+		if (i==5)
+			todelete = ip;
+		printf("List element appended %d\n",  *((int*)(l->last->content)));
+	}
+
+	printf("List contents:\n");
+	current = NULL;
+	while (ListNextElement(l, &current) != NULL)
+		printf("List element: %d\n", *((int*)(current->content)));
+
+	printf("List contents in reverse order:\n");
+	current = NULL;
+	while (ListPrevElement(l, &current) != NULL)
+		printf("List element: %d\n", *((int*)(current->content)));
+
+	/* if ListFindItem(l, *ip, intcompare)->content */
+
+	printf("List contents having deleted element %d:\n", *todelete);
+	ListRemove(l, todelete);
+	current = NULL;
+	while (ListNextElement(l, &current) != NULL)
+		printf("List element: %d\n", *((int*)(current->content)));
+
+	i = 9;
+	ListRemoveItem(l, &i, intcompare);
+	printf("List contents having deleted another element, %d, size now %d:\n", i, l->size);
+	current = NULL;
+	while (ListNextElement(l, &current) != NULL)
+		printf("List element: %d\n", *((int*)(current->content)));
+
+	ListFree(l);
+	printf("List freed\n");
+}
+
+#endif
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/LinkedList.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/LinkedList.h b/thirdparty/paho.mqtt.c/src/LinkedList.h
new file mode 100644
index 0000000..102a4fd
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/LinkedList.h
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - updates for the async client
+ *    Ian Craggs - change size types from int to size_t
+ *******************************************************************************/
+
+#if !defined(LINKEDLIST_H)
+#define LINKEDLIST_H
+
+#include <stdlib.h> /* for size_t definition */
+
+/*BE
+defm defList(T)
+
+def T concat Item
+{
+	at 4
+	n32 ptr T concat Item suppress "next"
+	at 0
+	n32 ptr T concat Item suppress "prev"
+	at 8
+	n32 ptr T id2str(T)
+}
+
+def T concat List
+{
+	n32 ptr T concat Item suppress "first"
+	n32 ptr T concat Item suppress "last"
+	n32 ptr T concat Item suppress "current"
+	n32 dec "count"
+	n32 suppress "size"
+}
+endm
+
+defList(INT)
+defList(STRING)
+defList(TMP)
+
+BE*/
+
+/**
+ * Structure to hold all data for one list element
+ */
+typedef struct ListElementStruct
+{
+	struct ListElementStruct *prev, /**< pointer to previous list element */
+							*next;	/**< pointer to next list element */
+	void* content;					/**< pointer to element content */
+} ListElement;
+
+
+/**
+ * Structure to hold all data for one list
+ */
+typedef struct
+{
+	ListElement *first,	/**< first element in the list */
+				*last,	/**< last element in the list */
+				*current;	/**< current element in the list, for iteration */
+	int count;  /**< no of items */
+	size_t size;  /**< heap storage used */
+} List;
+
+void ListZero(List*);
+List* ListInitialize(void);
+
+void ListAppend(List* aList, void* content, size_t size);
+void ListAppendNoMalloc(List* aList, void* content, ListElement* newel, size_t size);
+void ListInsert(List* aList, void* content, size_t size, ListElement* index);
+
+int ListRemove(List* aList, void* content);
+int ListRemoveItem(List* aList, void* content, int(*callback)(void*, void*));
+void* ListDetachHead(List* aList);
+int ListRemoveHead(List* aList);
+void* ListPopTail(List* aList);
+
+int ListDetach(List* aList, void* content);
+int ListDetachItem(List* aList, void* content, int(*callback)(void*, void*));
+
+void ListFree(List* aList);
+void ListEmpty(List* aList);
+void ListFreeNoContent(List* aList);
+
+ListElement* ListNextElement(List* aList, ListElement** pos);
+ListElement* ListPrevElement(List* aList, ListElement** pos);
+
+ListElement* ListFind(List* aList, void* content);
+ListElement* ListFindItem(List* aList, void* content, int(*callback)(void*, void*));
+
+int intcompare(void* a, void* b);
+int stringcompare(void* a, void* b);
+
+#endif

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Log.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Log.c b/thirdparty/paho.mqtt.c/src/Log.c
new file mode 100644
index 0000000..472e888
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Log.c
@@ -0,0 +1,572 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2014 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - updates for the async client
+ *    Ian Craggs - fix for bug #427028
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Logging and tracing module
+ *
+ * 
+ */
+
+#include "Log.h"
+#include "MQTTPacket.h"
+#include "MQTTProtocol.h"
+#include "MQTTProtocolClient.h"
+#include "Messages.h"
+#include "LinkedList.h"
+#include "StackTrace.h"
+#include "Thread.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <time.h>
+#include <string.h>
+
+#if !defined(WIN32) && !defined(WIN64)
+#include <syslog.h>
+#include <sys/stat.h>
+#define GETTIMEOFDAY 1
+#else
+#define snprintf _snprintf
+#endif
+
+#if defined(GETTIMEOFDAY)
+	#include <sys/time.h>
+#else
+	#include <sys/timeb.h>
+#endif
+
+#if !defined(WIN32) && !defined(WIN64)
+/**
+ * _unlink mapping for linux
+ */
+#define _unlink unlink
+#endif
+
+
+#if !defined(min)
+#define min(A,B) ( (A) < (B) ? (A):(B))
+#endif
+
+trace_settings_type trace_settings =
+{
+	TRACE_MINIMUM,
+	400,
+	INVALID_LEVEL
+};
+
+#define MAX_FUNCTION_NAME_LENGTH 256
+
+typedef struct
+{
+#if defined(GETTIMEOFDAY)
+	struct timeval ts;
+#else
+	struct timeb ts;
+#endif
+	int sametime_count;
+	int number;
+	int thread_id;
+	int depth;
+	char name[MAX_FUNCTION_NAME_LENGTH + 1];
+	int line;
+	int has_rc;
+	int rc;
+	enum LOG_LEVELS level;
+} traceEntry;
+
+static int start_index = -1,
+			next_index = 0;
+static traceEntry* trace_queue = NULL;
+static int trace_queue_size = 0;
+
+static FILE* trace_destination = NULL;	/**< flag to indicate if trace is to be sent to a stream */
+static char* trace_destination_name = NULL; /**< the name of the trace file */
+static char* trace_destination_backup_name = NULL; /**< the name of the backup trace file */
+static int lines_written = 0; /**< number of lines written to the current output file */
+static int max_lines_per_file = 1000; /**< maximum number of lines to write to one trace file */
+static enum LOG_LEVELS trace_output_level = INVALID_LEVEL;
+static Log_traceCallback* trace_callback = NULL;
+static traceEntry* Log_pretrace(void);
+static char* Log_formatTraceEntry(traceEntry* cur_entry);
+static void Log_output(enum LOG_LEVELS log_level, const char *msg);
+static void Log_posttrace(enum LOG_LEVELS log_level, traceEntry* cur_entry);
+static void Log_trace(enum LOG_LEVELS log_level, const char *buf);
+#if 0
+static FILE* Log_destToFile(const char *dest);
+static int Log_compareEntries(const char *entry1, const char *entry2);
+#endif
+
+static int sametime_count = 0;
+#if defined(GETTIMEOFDAY)
+struct timeval ts, last_ts;
+#else
+struct timeb ts, last_ts;
+#endif
+static char msg_buf[512];
+
+#if defined(WIN32) || defined(WIN64)
+mutex_type log_mutex;
+#else
+static pthread_mutex_t log_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type log_mutex = &log_mutex_store;
+#endif
+
+
+int Log_initialize(Log_nameValue* info)
+{
+	int rc = -1;
+	char* envval = NULL;
+
+	if ((trace_queue = malloc(sizeof(traceEntry) * trace_settings.max_trace_entries)) == NULL)
+		return rc;
+	trace_queue_size = trace_settings.max_trace_entries;
+
+	if ((envval = getenv("MQTT_C_CLIENT_TRACE")) != NULL && strlen(envval) > 0)
+	{
+		if (strcmp(envval, "ON") == 0 || (trace_destination = fopen(envval, "w")) == NULL)
+			trace_destination = stdout;
+		else
+		{
+			trace_destination_name = malloc(strlen(envval) + 1);
+			strcpy(trace_destination_name, envval);
+			trace_destination_backup_name = malloc(strlen(envval) + 3);
+			sprintf(trace_destination_backup_name, "%s.0", trace_destination_name);
+		}
+	}
+	if ((envval = getenv("MQTT_C_CLIENT_TRACE_MAX_LINES")) != NULL && strlen(envval) > 0)
+	{
+		max_lines_per_file = atoi(envval);
+		if (max_lines_per_file <= 0)
+			max_lines_per_file = 1000;
+	}
+	if ((envval = getenv("MQTT_C_CLIENT_TRACE_LEVEL")) != NULL && strlen(envval) > 0)
+	{
+		if (strcmp(envval, "MAXIMUM") == 0 || strcmp(envval, "TRACE_MAXIMUM") == 0)
+			trace_settings.trace_level = TRACE_MAXIMUM;
+		else if (strcmp(envval, "MEDIUM") == 0 || strcmp(envval, "TRACE_MEDIUM") == 0)
+			trace_settings.trace_level = TRACE_MEDIUM;
+		else if (strcmp(envval, "MINIMUM") == 0 || strcmp(envval, "TRACE_MEDIUM") == 0)
+			trace_settings.trace_level = TRACE_MINIMUM;
+		else if (strcmp(envval, "PROTOCOL") == 0  || strcmp(envval, "TRACE_PROTOCOL") == 0)
+			trace_output_level = TRACE_PROTOCOL;
+		else if (strcmp(envval, "ERROR") == 0  || strcmp(envval, "TRACE_ERROR") == 0)
+			trace_output_level = LOG_ERROR;
+	}
+	Log_output(TRACE_MINIMUM, "=========================================================");
+	Log_output(TRACE_MINIMUM, "                   Trace Output");
+	if (info)
+	{
+		while (info->name)
+		{
+			snprintf(msg_buf, sizeof(msg_buf), "%s: %s", info->name, info->value);
+			Log_output(TRACE_MINIMUM, msg_buf);
+			info++;
+		}
+	}
+#if !defined(WIN32) && !defined(WIN64)
+	struct stat buf;
+	if (stat("/proc/version", &buf) != -1)
+	{
+		FILE* vfile;
+		
+		if ((vfile = fopen("/proc/version", "r")) != NULL)
+		{
+			int len;
+			
+			strcpy(msg_buf, "/proc/version: ");
+			len = strlen(msg_buf);
+			if (fgets(&msg_buf[len], sizeof(msg_buf) - len, vfile))
+				Log_output(TRACE_MINIMUM, msg_buf);
+			fclose(vfile);
+		}
+	}
+#endif
+	Log_output(TRACE_MINIMUM, "=========================================================");
+		
+	return rc;
+}
+
+
+void Log_setTraceCallback(Log_traceCallback* callback)
+{
+	trace_callback = callback;
+}
+
+
+void Log_setTraceLevel(enum LOG_LEVELS level)
+{
+	if (level < TRACE_MINIMUM) /* the lowest we can go is TRACE_MINIMUM*/
+		trace_settings.trace_level = level;
+	trace_output_level = level;
+}
+
+
+void Log_terminate(void)
+{
+	free(trace_queue);
+	trace_queue = NULL;
+	trace_queue_size = 0;
+	if (trace_destination)
+	{
+		if (trace_destination != stdout)
+			fclose(trace_destination);
+		trace_destination = NULL;
+	}
+	if (trace_destination_name) {
+		free(trace_destination_name);
+		trace_destination_name = NULL;
+	}
+	if (trace_destination_backup_name) {
+		free(trace_destination_backup_name);
+		trace_destination_backup_name = NULL;
+	}
+	start_index = -1;
+	next_index = 0;
+	trace_output_level = INVALID_LEVEL;
+	sametime_count = 0;
+}
+
+
+static traceEntry* Log_pretrace(void)
+{
+	traceEntry *cur_entry = NULL;
+
+	/* calling ftime/gettimeofday seems to be comparatively expensive, so we need to limit its use */
+	if (++sametime_count % 20 == 0)
+	{
+#if defined(GETTIMEOFDAY)
+		gettimeofday(&ts, NULL);
+		if (ts.tv_sec != last_ts.tv_sec || ts.tv_usec != last_ts.tv_usec)
+#else
+		ftime(&ts);
+		if (ts.time != last_ts.time || ts.millitm != last_ts.millitm)
+#endif
+		{
+			sametime_count = 0;
+			last_ts = ts;
+		}
+	}
+
+	if (trace_queue_size != trace_settings.max_trace_entries)
+	{
+		traceEntry* new_trace_queue = malloc(sizeof(traceEntry) * trace_settings.max_trace_entries);
+
+		memcpy(new_trace_queue, trace_queue, min(trace_queue_size, trace_settings.max_trace_entries) * sizeof(traceEntry));
+		free(trace_queue);
+		trace_queue = new_trace_queue;
+		trace_queue_size = trace_settings.max_trace_entries;
+
+		if (start_index > trace_settings.max_trace_entries + 1 ||
+				next_index > trace_settings.max_trace_entries + 1)
+		{
+			start_index = -1;
+			next_index = 0;
+		}
+	}
+
+	/* add to trace buffer */
+	cur_entry = &trace_queue[next_index];
+	if (next_index == start_index) /* means the buffer is full */
+	{
+		if (++start_index == trace_settings.max_trace_entries)
+			start_index = 0;
+	} else if (start_index == -1)
+		start_index = 0;
+	if (++next_index == trace_settings.max_trace_entries)
+		next_index = 0;
+
+	return cur_entry;
+}
+
+static char* Log_formatTraceEntry(traceEntry* cur_entry)
+{
+	struct tm *timeinfo;
+	int buf_pos = 31;
+
+#if defined(GETTIMEOFDAY)
+	timeinfo = localtime((time_t *)&cur_entry->ts.tv_sec);
+#else
+	timeinfo = localtime(&cur_entry->ts.time);
+#endif
+	strftime(&msg_buf[7], 80, "%Y%m%d %H%M%S ", timeinfo);
+#if defined(GETTIMEOFDAY)
+	sprintf(&msg_buf[22], ".%.3lu ", cur_entry->ts.tv_usec / 1000L);
+#else
+	sprintf(&msg_buf[22], ".%.3hu ", cur_entry->ts.millitm);
+#endif
+	buf_pos = 27;
+
+	sprintf(msg_buf, "(%.4d)", cur_entry->sametime_count);
+	msg_buf[6] = ' ';
+
+	if (cur_entry->has_rc == 2)
+		strncpy(&msg_buf[buf_pos], cur_entry->name, sizeof(msg_buf)-buf_pos);
+	else
+	{
+		const char *format = Messages_get(cur_entry->number, cur_entry->level);
+		if (cur_entry->has_rc == 1)
+			snprintf(&msg_buf[buf_pos], sizeof(msg_buf)-buf_pos, format, cur_entry->thread_id,
+					cur_entry->depth, "", cur_entry->depth, cur_entry->name, cur_entry->line, cur_entry->rc);
+		else
+			snprintf(&msg_buf[buf_pos], sizeof(msg_buf)-buf_pos, format, cur_entry->thread_id,
+					cur_entry->depth, "", cur_entry->depth, cur_entry->name, cur_entry->line);
+	}
+	return msg_buf;
+}
+
+
+static void Log_output(enum LOG_LEVELS log_level, const char *msg)
+{
+	if (trace_destination)
+	{
+		fprintf(trace_destination, "%s\n", msg);
+
+		if (trace_destination != stdout && ++lines_written >= max_lines_per_file)
+		{	
+
+			fclose(trace_destination);		
+			_unlink(trace_destination_backup_name); /* remove any old backup trace file */
+			rename(trace_destination_name, trace_destination_backup_name); /* rename recently closed to backup */
+			trace_destination = fopen(trace_destination_name, "w"); /* open new trace file */
+			if (trace_destination == NULL)
+				trace_destination = stdout;
+			lines_written = 0;
+		}
+		else
+			fflush(trace_destination);
+	}
+		
+	if (trace_callback)
+		(*trace_callback)(log_level, msg);
+}
+
+
+static void Log_posttrace(enum LOG_LEVELS log_level, traceEntry* cur_entry)
+{
+	if (((trace_output_level == -1) ? log_level >= trace_settings.trace_level : log_level >= trace_output_level))
+	{
+		char* msg = NULL;
+		
+		if (trace_destination || trace_callback)
+			msg = &Log_formatTraceEntry(cur_entry)[7];
+		
+		Log_output(log_level, msg);
+	}
+}
+
+
+static void Log_trace(enum LOG_LEVELS log_level, const char *buf)
+{
+	traceEntry *cur_entry = NULL;
+
+	if (trace_queue == NULL)
+		return;
+
+	cur_entry = Log_pretrace();
+
+	memcpy(&(cur_entry->ts), &ts, sizeof(ts));
+	cur_entry->sametime_count = sametime_count;
+
+	cur_entry->has_rc = 2;
+	strncpy(cur_entry->name, buf, sizeof(cur_entry->name));
+	cur_entry->name[MAX_FUNCTION_NAME_LENGTH] = '\0';
+
+	Log_posttrace(log_level, cur_entry);
+}
+
+
+/**
+ * Log a message.  If possible, all messages should be indexed by message number, and
+ * the use of the format string should be minimized or negated altogether.  If format is
+ * provided, the message number is only used as a message label.
+ * @param log_level the log level of the message
+ * @param msgno the id of the message to use if the format string is NULL
+ * @param aFormat the printf format string to be used if the message id does not exist
+ * @param ... the printf inserts
+ */
+void Log(enum LOG_LEVELS log_level, int msgno, const char *format, ...)
+{
+	if (log_level >= trace_settings.trace_level)
+	{
+		const char *temp = NULL;
+		static char msg_buf[512];
+		va_list args;
+
+		/* we're using a static character buffer, so we need to make sure only one thread uses it at a time */
+		Thread_lock_mutex(log_mutex); 
+		if (format == NULL && (temp = Messages_get(msgno, log_level)) != NULL)
+			format = temp;
+
+		va_start(args, format);
+		vsnprintf(msg_buf, sizeof(msg_buf), format, args);
+
+		Log_trace(log_level, msg_buf);
+		va_end(args);
+		Thread_unlock_mutex(log_mutex); 
+	}
+
+	/*if (log_level >= LOG_ERROR)
+	{
+		char* filename = NULL;
+		Log_recordFFDC(&msg_buf[7]);
+	}
+	*/
+}
+
+
+/**
+ * The reason for this function is to make trace logging as fast as possible so that the
+ * function exit/entry history can be captured by default without unduly impacting
+ * performance.  Therefore it must do as little as possible.
+ * @param log_level the log level of the message
+ * @param msgno the id of the message to use if the format string is NULL
+ * @param aFormat the printf format string to be used if the message id does not exist
+ * @param ... the printf inserts
+ */
+void Log_stackTrace(enum LOG_LEVELS log_level, int msgno, int thread_id, int current_depth, const char* name, int line, int* rc)
+{
+	traceEntry *cur_entry = NULL;
+
+	if (trace_queue == NULL)
+		return;
+
+	if (log_level < trace_settings.trace_level)
+		return;
+
+	Thread_lock_mutex(log_mutex);
+	cur_entry = Log_pretrace();
+
+	memcpy(&(cur_entry->ts), &ts, sizeof(ts));
+	cur_entry->sametime_count = sametime_count;
+	cur_entry->number = msgno;
+	cur_entry->thread_id = thread_id;
+	cur_entry->depth = current_depth;
+	strcpy(cur_entry->name, name);
+	cur_entry->level = log_level;
+	cur_entry->line = line;
+	if (rc == NULL)
+		cur_entry->has_rc = 0;
+	else
+	{
+		cur_entry->has_rc = 1;
+		cur_entry->rc = *rc;
+	}
+
+	Log_posttrace(log_level, cur_entry);
+	Thread_unlock_mutex(log_mutex);
+}
+
+
+#if 0
+static FILE* Log_destToFile(const char *dest)
+{
+	FILE* file = NULL;
+
+	if (strcmp(dest, "stdout") == 0)
+		file = stdout;
+	else if (strcmp(dest, "stderr") == 0)
+		file = stderr;
+	else
+	{
+		if (strstr(dest, "FFDC"))
+			file = fopen(dest, "ab");
+		else
+			file = fopen(dest, "wb");
+	}
+	return file;
+}
+
+
+static int Log_compareEntries(const char *entry1, const char *entry2)
+{
+	int comp = strncmp(&entry1[7], &entry2[7], 19);
+
+	/* if timestamps are equal, use the sequence numbers */
+	if (comp == 0)
+		comp = strncmp(&entry1[1], &entry2[1], 4);
+
+	return comp;
+}
+
+
+/**
+ * Write the contents of the stored trace to a stream
+ * @param dest string which contains a file name or the special strings stdout or stderr
+ */
+int Log_dumpTrace(char* dest)
+{
+	FILE* file = NULL;
+	ListElement* cur_trace_entry = NULL;
+	const int msgstart = 7;
+	int rc = -1;
+	int trace_queue_index = 0;
+
+	if ((file = Log_destToFile(dest)) == NULL)
+	{
+		Log(LOG_ERROR, 9, NULL, "trace", dest, "trace entries");
+		goto exit;
+	}
+
+	fprintf(file, "=========== Start of trace dump ==========\n");
+	/* Interleave the log and trace entries together appropriately */
+	ListNextElement(trace_buffer, &cur_trace_entry);
+	trace_queue_index = start_index;
+	if (trace_queue_index == -1)
+		trace_queue_index = next_index;
+	else
+	{
+		Log_formatTraceEntry(&trace_queue[trace_queue_index++]);
+		if (trace_queue_index == trace_settings.max_trace_entries)
+			trace_queue_index = 0;
+	}
+	while (cur_trace_entry || trace_queue_index != next_index)
+	{
+		if (cur_trace_entry && trace_queue_index != -1)
+		{	/* compare these timestamps */
+			if (Log_compareEntries((char*)cur_trace_entry->content, msg_buf) > 0)
+				cur_trace_entry = NULL;
+		}
+
+		if (cur_trace_entry)
+		{
+			fprintf(file, "%s\n", &((char*)(cur_trace_entry->content))[msgstart]);
+			ListNextElement(trace_buffer, &cur_trace_entry);
+		}
+		else
+		{
+			fprintf(file, "%s\n", &msg_buf[7]);
+			if (trace_queue_index != next_index)
+			{
+				Log_formatTraceEntry(&trace_queue[trace_queue_index++]);
+				if (trace_queue_index == trace_settings.max_trace_entries)
+					trace_queue_index = 0;
+			}
+		}
+	}
+	fprintf(file, "========== End of trace dump ==========\n\n");
+	if (file != stdout && file != stderr && file != NULL)
+		fclose(file);
+	rc = 0;
+exit:
+	return rc;
+}
+#endif
+
+

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/Log.h
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/Log.h b/thirdparty/paho.mqtt.c/src/Log.h
new file mode 100644
index 0000000..455beb6
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/Log.h
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution. 
+ *
+ * The Eclipse Public License is available at 
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at 
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - updates for the async client
+ *******************************************************************************/
+
+#if !defined(LOG_H)
+#define LOG_H
+
+/*BE
+map LOG_LEVELS
+{
+	"TRACE_MAXIMUM" 1
+	"TRACE_MEDIUM" 2
+	"TRACE_MINIMUM" 3
+	"TRACE_PROTOCOL" 4
+
+	"ERROR" 5
+	"SEVERE" 6
+	"FATAL" 7
+}
+BE*/
+
+enum LOG_LEVELS {
+	INVALID_LEVEL = -1,
+	TRACE_MAXIMUM = 1,
+	TRACE_MEDIUM,
+	TRACE_MINIMUM,
+	TRACE_PROTOCOL,
+	LOG_ERROR,
+	LOG_SEVERE,
+	LOG_FATAL,
+};
+
+
+/*BE
+def trace_settings_type
+{
+   n32 map LOG_LEVELS "trace_level"
+   n32 dec "max_trace_entries"
+   n32 dec "trace_output_level"
+}
+BE*/
+typedef struct
+{
+	enum LOG_LEVELS trace_level;	/**< trace level */
+	int max_trace_entries;		/**< max no of entries in the trace buffer */
+	enum LOG_LEVELS trace_output_level;		/**< trace level to output to destination */
+} trace_settings_type;
+
+extern trace_settings_type trace_settings;
+
+#define LOG_PROTOCOL TRACE_PROTOCOL
+#define TRACE_MAX TRACE_MAXIMUM
+#define TRACE_MIN TRACE_MINIMUM
+#define TRACE_MED TRACE_MEDIUM
+
+typedef struct
+{
+	const char* name;
+	const char* value;
+} Log_nameValue;
+
+int Log_initialize(Log_nameValue*);
+void Log_terminate(void);
+
+void Log(enum LOG_LEVELS, int, const char *, ...);
+void Log_stackTrace(enum LOG_LEVELS, int, int, int, const char*, int, int*);
+
+typedef void Log_traceCallback(enum LOG_LEVELS level, const char *message);
+void Log_setTraceCallback(Log_traceCallback* callback);
+void Log_setTraceLevel(enum LOG_LEVELS level);
+
+#endif


[14/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI.in
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI.in b/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI.in
new file mode 100644
index 0000000..e2ed5ae
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/doc/DoxyfileV3AsyncAPI.in
@@ -0,0 +1,1804 @@
+# Doxyfile 1.8.1.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "Paho Asynchronous MQTT C Client Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = "@PROJECT_SOURCE_DIR@/doc/pahologo.png"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = "@CMAKE_CURRENT_BINARY_DIR@/doc/MQTTAsync/"
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        = /Users/dimitri/doxygen/mail/1.5.7/doxywizard/
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = MQTTAsync_main
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+STRIP_FROM_PATH        = @PROJECT_SOURCE_DIR@/src
+INPUT                  = @PROJECT_SOURCE_DIR@/src/MQTTAsync.h \
+                         @PROJECT_SOURCE_DIR@/src/MQTTClientPersistence.h
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = NONE
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             = __attribute__(x)=
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES


[06/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/src/MQTTClient.c
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/src/MQTTClient.c b/thirdparty/paho.mqtt.c/src/MQTTClient.c
new file mode 100644
index 0000000..abeaab0
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/src/MQTTClient.c
@@ -0,0 +1,2102 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2017 IBM Corp.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * and Eclipse Distribution License v1.0 which accompany this distribution.
+ *
+ * The Eclipse Public License is available at
+ *    http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ *   http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ *    Ian Craggs - initial API and implementation and/or initial documentation
+ *    Ian Craggs - bug 384016 - segv setting will message
+ *    Ian Craggs - bug 384053 - v1.0.0.7 - stop MQTTClient_receive on socket error
+ *    Ian Craggs, Allan Stockdill-Mander - add ability to connect with SSL
+ *    Ian Craggs - multiple server connection support
+ *    Ian Craggs - fix for bug 413429 - connectionLost not called
+ *    Ian Craggs - fix for bug 421103 - trying to write to same socket, in publish/retries
+ *    Ian Craggs - fix for bug 419233 - mutexes not reporting errors
+ *    Ian Craggs - fix for bug 420851
+ *    Ian Craggs - fix for bug 432903 - queue persistence
+ *    Ian Craggs - MQTT 3.1.1 support
+ *    Ian Craggs - fix for bug 438176 - MQTT version selection
+ *    Rong Xiang, Ian Craggs - C++ compatibility
+ *    Ian Craggs - fix for bug 443724 - stack corruption
+ *    Ian Craggs - fix for bug 447672 - simultaneous access to socket structure
+ *    Ian Craggs - fix for bug 459791 - deadlock in WaitForCompletion for bad client
+ *    Ian Craggs - fix for bug 474905 - insufficient synchronization for subscribe, unsubscribe, connect
+ *    Ian Craggs - make it clear that yield and receive are not intended for multi-threaded mode (bug 474748)
+ *    Ian Craggs - SNI support, message queue unpersist bug
+ *    Ian Craggs - binary will message support
+ *    Ian Craggs - waitforCompletion fix #240
+ *******************************************************************************/
+
+/**
+ * @file
+ * \brief Synchronous API implementation
+ *
+ */
+
+#define _GNU_SOURCE /* for pthread_mutexattr_settype */
+#include <stdlib.h>
+#include <string.h>
+#if !defined(WIN32) && !defined(WIN64)
+	#include <sys/time.h>
+#endif
+
+#include "MQTTClient.h"
+#if !defined(NO_PERSISTENCE)
+#include "MQTTPersistence.h"
+#endif
+
+#include "utf-8.h"
+#include "MQTTProtocol.h"
+#include "MQTTProtocolOut.h"
+#include "Thread.h"
+#include "SocketBuffer.h"
+#include "StackTrace.h"
+#include "Heap.h"
+
+#if defined(OPENSSL)
+#include <openssl/ssl.h>
+#else
+#define URI_SSL "ssl://"
+#endif
+
+#include "OsWrapper.h"
+
+#define URI_TCP "tcp://"
+
+#include "VersionInfo.h"
+
+
+const char *client_timestamp_eye = "MQTTClientV3_Timestamp " BUILD_TIMESTAMP;
+const char *client_version_eye = "MQTTClientV3_Version " CLIENT_VERSION;
+
+void MQTTClient_global_init(MQTTClient_init_options* inits)
+{
+#if defined(OPENSSL)
+	SSLSocket_handleOpensslInit(inits->do_openssl_init);
+#endif
+}
+
+static ClientStates ClientState =
+{
+	CLIENT_VERSION, /* version */
+	NULL /* client list */
+};
+
+ClientStates* bstate = &ClientState;
+
+MQTTProtocol state;
+
+#if defined(WIN32) || defined(WIN64)
+static mutex_type mqttclient_mutex = NULL;
+static mutex_type socket_mutex = NULL;
+static mutex_type subscribe_mutex = NULL;
+static mutex_type unsubscribe_mutex = NULL;
+static mutex_type connect_mutex = NULL;
+extern mutex_type stack_mutex;
+extern mutex_type heap_mutex;
+extern mutex_type log_mutex;
+BOOL APIENTRY DllMain(HANDLE hModule,
+					  DWORD  ul_reason_for_call,
+					  LPVOID lpReserved)
+{
+	switch (ul_reason_for_call)
+	{
+		case DLL_PROCESS_ATTACH:
+			Log(TRACE_MAX, -1, "DLL process attach");
+			if (mqttclient_mutex == NULL)
+			{
+				mqttclient_mutex = CreateMutex(NULL, 0, NULL);
+				subscribe_mutex = CreateMutex(NULL, 0, NULL);
+				unsubscribe_mutex = CreateMutex(NULL, 0, NULL);
+				connect_mutex = CreateMutex(NULL, 0, NULL);
+				stack_mutex = CreateMutex(NULL, 0, NULL);
+				heap_mutex = CreateMutex(NULL, 0, NULL);
+				log_mutex = CreateMutex(NULL, 0, NULL);
+				socket_mutex = CreateMutex(NULL, 0, NULL);
+			}
+		case DLL_THREAD_ATTACH:
+			Log(TRACE_MAX, -1, "DLL thread attach");
+		case DLL_THREAD_DETACH:
+			Log(TRACE_MAX, -1, "DLL thread detach");
+		case DLL_PROCESS_DETACH:
+			Log(TRACE_MAX, -1, "DLL process detach");
+	}
+	return TRUE;
+}
+#else
+static pthread_mutex_t mqttclient_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type mqttclient_mutex = &mqttclient_mutex_store;
+
+static pthread_mutex_t socket_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type socket_mutex = &socket_mutex_store;
+
+static pthread_mutex_t subscribe_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type subscribe_mutex = &subscribe_mutex_store;
+
+static pthread_mutex_t unsubscribe_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type unsubscribe_mutex = &unsubscribe_mutex_store;
+
+static pthread_mutex_t connect_mutex_store = PTHREAD_MUTEX_INITIALIZER;
+static mutex_type connect_mutex = &connect_mutex_store;
+
+void MQTTClient_init(void)
+{
+	pthread_mutexattr_t attr;
+	int rc;
+
+	pthread_mutexattr_init(&attr);
+#if !defined(_WRS_KERNEL)
+	pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
+#else
+	/* #warning "no pthread_mutexattr_settype" */
+#endif /* !defined(_WRS_KERNEL) */
+	if ((rc = pthread_mutex_init(mqttclient_mutex, &attr)) != 0)
+		printf("MQTTClient: error %d initializing client_mutex\n", rc);
+	if ((rc = pthread_mutex_init(socket_mutex, &attr)) != 0)
+		printf("MQTTClient: error %d initializing socket_mutex\n", rc);
+	if ((rc = pthread_mutex_init(subscribe_mutex, &attr)) != 0)
+		printf("MQTTClient: error %d initializing subscribe_mutex\n", rc);
+	if ((rc = pthread_mutex_init(unsubscribe_mutex, &attr)) != 0)
+		printf("MQTTClient: error %d initializing unsubscribe_mutex\n", rc);
+	if ((rc = pthread_mutex_init(connect_mutex, &attr)) != 0)
+		printf("MQTTClient: error %d initializing connect_mutex\n", rc);
+}
+
+#define WINAPI
+#endif
+
+static volatile int initialized = 0;
+static List* handles = NULL;
+static int running = 0;
+static int tostop = 0;
+static thread_id_type run_id = 0;
+
+typedef struct
+{
+	MQTTClient_message* msg;
+	char* topicName;
+	int topicLen;
+	unsigned int seqno; /* only used on restore */
+} qEntry;
+
+
+typedef struct
+{
+	char* serverURI;
+#if defined(OPENSSL)
+	int ssl;
+#endif
+	Clients* c;
+	MQTTClient_connectionLost* cl;
+	MQTTClient_messageArrived* ma;
+	MQTTClient_deliveryComplete* dc;
+	void* context;
+
+	sem_type connect_sem;
+	int rc; /* getsockopt return code in connect */
+	sem_type connack_sem;
+	sem_type suback_sem;
+	sem_type unsuback_sem;
+	MQTTPacket* pack;
+
+} MQTTClients;
+
+void MQTTClient_sleep(long milliseconds)
+{
+	FUNC_ENTRY;
+#if defined(WIN32) || defined(WIN64)
+	Sleep(milliseconds);
+#else
+	usleep(milliseconds*1000);
+#endif
+	FUNC_EXIT;
+}
+
+
+#if defined(WIN32) || defined(WIN64)
+#define START_TIME_TYPE DWORD
+START_TIME_TYPE MQTTClient_start_clock(void)
+{
+	return GetTickCount();
+}
+#elif defined(AIX)
+#define START_TIME_TYPE struct timespec
+START_TIME_TYPE MQTTClient_start_clock(void)
+{
+	static struct timespec start;
+	clock_gettime(CLOCK_REALTIME, &start);
+	return start;
+}
+#else
+#define START_TIME_TYPE struct timeval
+START_TIME_TYPE MQTTClient_start_clock(void)
+{
+	static struct timeval start;
+	gettimeofday(&start, NULL);
+	return start;
+}
+#endif
+
+
+#if defined(WIN32) || defined(WIN64)
+long MQTTClient_elapsed(DWORD milliseconds)
+{
+	return GetTickCount() - milliseconds;
+}
+#elif defined(AIX)
+#define assert(a)
+long MQTTClient_elapsed(struct timespec start)
+{
+	struct timespec now, res;
+
+	clock_gettime(CLOCK_REALTIME, &now);
+	ntimersub(now, start, res);
+	return (res.tv_sec)*1000L + (res.tv_nsec)/1000000L;
+}
+#else
+long MQTTClient_elapsed(struct timeval start)
+{
+	struct timeval now, res;
+
+	gettimeofday(&now, NULL);
+	timersub(&now, &start, &res);
+	return (res.tv_sec)*1000 + (res.tv_usec)/1000;
+}
+#endif
+
+static void MQTTClient_terminate(void);
+static void MQTTClient_emptyMessageQueue(Clients* client);
+static int MQTTClient_deliverMessage(
+		int rc, MQTTClients* m,
+		char** topicName, int* topicLen,
+		MQTTClient_message** message);
+static int clientSockCompare(void* a, void* b);
+static thread_return_type WINAPI connectionLost_call(void* context);
+static thread_return_type WINAPI MQTTClient_run(void* n);
+static void MQTTClient_stop(void);
+static void MQTTClient_closeSession(Clients* client);
+static int MQTTClient_cleanSession(Clients* client);
+static int MQTTClient_connectURIVersion(
+	MQTTClient handle, MQTTClient_connectOptions* options,
+	const char* serverURI, int MQTTVersion,
+	START_TIME_TYPE start, long millisecsTimeout);
+static int MQTTClient_connectURI(MQTTClient handle, MQTTClient_connectOptions* options, const char* serverURI);
+static int MQTTClient_disconnect1(MQTTClient handle, int timeout, int internal, int stop);
+static int MQTTClient_disconnect_internal(MQTTClient handle, int timeout);
+static void MQTTClient_retry(void);
+static MQTTPacket* MQTTClient_cycle(int* sock, unsigned long timeout, int* rc);
+static MQTTPacket* MQTTClient_waitfor(MQTTClient handle, int packet_type, int* rc, long timeout);
+/*static int pubCompare(void* a, void* b); */
+static void MQTTProtocol_checkPendingWrites(void);
+static void MQTTClient_writeComplete(int socket);
+
+
+int MQTTClient_create(MQTTClient* handle, const char* serverURI, const char* clientId,
+		int persistence_type, void* persistence_context)
+{
+	int rc = 0;
+	MQTTClients *m = NULL;
+
+	FUNC_ENTRY;
+	rc = Thread_lock_mutex(mqttclient_mutex);
+
+	if (serverURI == NULL || clientId == NULL)
+	{
+		rc = MQTTCLIENT_NULL_PARAMETER;
+		goto exit;
+	}
+
+	if (!UTF8_validateString(clientId))
+	{
+		rc = MQTTCLIENT_BAD_UTF8_STRING;
+		goto exit;
+	}
+
+	if (!initialized)
+	{
+		#if defined(HEAP_H)
+			Heap_initialize();
+		#endif
+		Log_initialize((Log_nameValue*)MQTTClient_getVersionInfo());
+		bstate->clients = ListInitialize();
+		Socket_outInitialize();
+		Socket_setWriteCompleteCallback(MQTTClient_writeComplete);
+		handles = ListInitialize();
+#if defined(OPENSSL)
+		SSLSocket_initialize();
+#endif
+		initialized = 1;
+	}
+	m = malloc(sizeof(MQTTClients));
+	*handle = m;
+	memset(m, '\0', sizeof(MQTTClients));
+	if (strncmp(URI_TCP, serverURI, strlen(URI_TCP)) == 0)
+		serverURI += strlen(URI_TCP);
+	else if (strncmp(URI_SSL, serverURI, strlen(URI_SSL)) == 0)
+	{
+#if defined(OPENSSL)
+		serverURI += strlen(URI_SSL);
+		m->ssl = 1;
+#else
+        rc = MQTTCLIENT_SSL_NOT_SUPPORTED;
+        goto exit;
+#endif
+	}
+	m->serverURI = MQTTStrdup(serverURI);
+	ListAppend(handles, m, sizeof(MQTTClients));
+
+	m->c = malloc(sizeof(Clients));
+	memset(m->c, '\0', sizeof(Clients));
+	m->c->context = m;
+	m->c->outboundMsgs = ListInitialize();
+	m->c->inboundMsgs = ListInitialize();
+	m->c->messageQueue = ListInitialize();
+	m->c->clientID = MQTTStrdup(clientId);
+	m->connect_sem = Thread_create_sem();
+	m->connack_sem = Thread_create_sem();
+	m->suback_sem = Thread_create_sem();
+	m->unsuback_sem = Thread_create_sem();
+
+#if !defined(NO_PERSISTENCE)
+	rc = MQTTPersistence_create(&(m->c->persistence), persistence_type, persistence_context);
+	if (rc == 0)
+	{
+		rc = MQTTPersistence_initialize(m->c, m->serverURI);
+		if (rc == 0)
+			MQTTPersistence_restoreMessageQueue(m->c);
+	}
+#endif
+	ListAppend(bstate->clients, m->c, sizeof(Clients) + 3*sizeof(List));
+
+exit:
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void MQTTClient_terminate(void)
+{
+	FUNC_ENTRY;
+	MQTTClient_stop();
+	if (initialized)
+	{
+		ListFree(bstate->clients);
+		ListFree(handles);
+		handles = NULL;
+		Socket_outTerminate();
+#if defined(OPENSSL)
+		SSLSocket_terminate();
+#endif
+		#if defined(HEAP_H)
+			Heap_terminate();
+		#endif
+		Log_terminate();
+		initialized = 0;
+	}
+	FUNC_EXIT;
+}
+
+
+static void MQTTClient_emptyMessageQueue(Clients* client)
+{
+	FUNC_ENTRY;
+	/* empty message queue */
+	if (client->messageQueue->count > 0)
+	{
+		ListElement* current = NULL;
+		while (ListNextElement(client->messageQueue, &current))
+		{
+			qEntry* qe = (qEntry*)(current->content);
+			free(qe->topicName);
+			free(qe->msg->payload);
+			free(qe->msg);
+		}
+		ListEmpty(client->messageQueue);
+	}
+	FUNC_EXIT;
+}
+
+
+void MQTTClient_destroy(MQTTClient* handle)
+{
+	MQTTClients* m = *handle;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (m == NULL)
+		goto exit;
+
+	if (m->c)
+	{
+		int saved_socket = m->c->net.socket;
+		char* saved_clientid = MQTTStrdup(m->c->clientID);
+#if !defined(NO_PERSISTENCE)
+		MQTTPersistence_close(m->c);
+#endif
+		MQTTClient_emptyMessageQueue(m->c);
+		MQTTProtocol_freeClient(m->c);
+		if (!ListRemove(bstate->clients, m->c))
+			Log(LOG_ERROR, 0, NULL);
+		else
+			Log(TRACE_MIN, 1, NULL, saved_clientid, saved_socket);
+		free(saved_clientid);
+	}
+	if (m->serverURI)
+		free(m->serverURI);
+	Thread_destroy_sem(m->connect_sem);
+	Thread_destroy_sem(m->connack_sem);
+	Thread_destroy_sem(m->suback_sem);
+	Thread_destroy_sem(m->unsuback_sem);
+	if (!ListRemove(handles, m))
+		Log(LOG_ERROR, -1, "free error");
+	*handle = NULL;
+	if (bstate->clients->count == 0)
+		MQTTClient_terminate();
+
+exit:
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT;
+}
+
+
+void MQTTClient_freeMessage(MQTTClient_message** message)
+{
+	FUNC_ENTRY;
+	free((*message)->payload);
+	free(*message);
+	*message = NULL;
+	FUNC_EXIT;
+}
+
+
+void MQTTClient_free(void* memory)
+{
+	FUNC_ENTRY;
+	free(memory);
+	FUNC_EXIT;
+}
+
+
+static int MQTTClient_deliverMessage(int rc, MQTTClients* m, char** topicName, int* topicLen, MQTTClient_message** message)
+{
+	qEntry* qe = (qEntry*)(m->c->messageQueue->first->content);
+
+	FUNC_ENTRY;
+	*message = qe->msg;
+	*topicName = qe->topicName;
+	*topicLen = qe->topicLen;
+	if (strlen(*topicName) != *topicLen)
+		rc = MQTTCLIENT_TOPICNAME_TRUNCATED;
+#if !defined(NO_PERSISTENCE)
+	if (m->c->persistence)
+		MQTTPersistence_unpersistQueueEntry(m->c, (MQTTPersistence_qEntry*)qe);
+#endif
+	ListRemove(m->c->messageQueue, m->c->messageQueue->first->content);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * List callback function for comparing clients by socket
+ * @param a first integer value
+ * @param b second integer value
+ * @return boolean indicating whether a and b are equal
+ */
+static int clientSockCompare(void* a, void* b)
+{
+	MQTTClients* m = (MQTTClients*)a;
+	return m->c->net.socket == *(int*)b;
+}
+
+
+/**
+ * Wrapper function to call connection lost on a separate thread.  A separate thread is needed to allow the
+ * connectionLost function to make API calls (e.g. connect)
+ * @param context a pointer to the relevant client
+ * @return thread_return_type standard thread return value - not used here
+ */
+static thread_return_type WINAPI connectionLost_call(void* context)
+{
+	MQTTClients* m = (MQTTClients*)context;
+
+	(*(m->cl))(m->context, NULL);
+	return 0;
+}
+
+
+/* This is the thread function that handles the calling of callback functions if set */
+static thread_return_type WINAPI MQTTClient_run(void* n)
+{
+	long timeout = 10L; /* first time in we have a small timeout.  Gets things started more quickly */
+
+	FUNC_ENTRY;
+	running = 1;
+	run_id = Thread_getid();
+
+	Thread_lock_mutex(mqttclient_mutex);
+	while (!tostop)
+	{
+		int rc = SOCKET_ERROR;
+		int sock = -1;
+		MQTTClients* m = NULL;
+		MQTTPacket* pack = NULL;
+
+		Thread_unlock_mutex(mqttclient_mutex);
+		pack = MQTTClient_cycle(&sock, timeout, &rc);
+		Thread_lock_mutex(mqttclient_mutex);
+		if (tostop)
+			break;
+		timeout = 1000L;
+
+		/* find client corresponding to socket */
+		if (ListFindItem(handles, &sock, clientSockCompare) == NULL)
+		{
+			/* assert: should not happen */
+			continue;
+		}
+		m = (MQTTClient)(handles->current->content);
+		if (m == NULL)
+		{
+			/* assert: should not happen */
+			continue;
+		}
+		if (rc == SOCKET_ERROR)
+		{
+			if (m->c->connected)
+				MQTTClient_disconnect_internal(m, 0);
+			else
+			{
+				if (m->c->connect_state == 2 && !Thread_check_sem(m->connect_sem))
+				{
+					Log(TRACE_MIN, -1, "Posting connect semaphore for client %s", m->c->clientID);
+					Thread_post_sem(m->connect_sem);
+				}
+				if (m->c->connect_state == 3 && !Thread_check_sem(m->connack_sem))
+				{
+					Log(TRACE_MIN, -1, "Posting connack semaphore for client %s", m->c->clientID);
+					Thread_post_sem(m->connack_sem);
+				}
+			}
+		}
+		else
+		{
+			if (m->c->messageQueue->count > 0)
+			{
+				qEntry* qe = (qEntry*)(m->c->messageQueue->first->content);
+				int topicLen = qe->topicLen;
+
+				if (strlen(qe->topicName) == topicLen)
+					topicLen = 0;
+
+				Log(TRACE_MIN, -1, "Calling messageArrived for client %s, queue depth %d",
+					m->c->clientID, m->c->messageQueue->count);
+				Thread_unlock_mutex(mqttclient_mutex);
+				rc = (*(m->ma))(m->context, qe->topicName, topicLen, qe->msg);
+				Thread_lock_mutex(mqttclient_mutex);
+				/* if 0 (false) is returned by the callback then it failed, so we don't remove the message from
+				 * the queue, and it will be retried later.  If 1 is returned then the message data may have been freed,
+				 * so we must be careful how we use it.
+				 */
+				if (rc)
+				{
+					#if !defined(NO_PERSISTENCE)
+					if (m->c->persistence)
+						MQTTPersistence_unpersistQueueEntry(m->c, (MQTTPersistence_qEntry*)qe);
+					#endif
+					ListRemove(m->c->messageQueue, qe);
+				}
+				else
+					Log(TRACE_MIN, -1, "False returned from messageArrived for client %s, message remains on queue",
+						m->c->clientID);
+			}
+			if (pack)
+			{
+				if (pack->header.bits.type == CONNACK && !Thread_check_sem(m->connack_sem))
+				{
+					Log(TRACE_MIN, -1, "Posting connack semaphore for client %s", m->c->clientID);
+					m->pack = pack;
+					Thread_post_sem(m->connack_sem);
+				}
+				else if (pack->header.bits.type == SUBACK)
+				{
+					Log(TRACE_MIN, -1, "Posting suback semaphore for client %s", m->c->clientID);
+					m->pack = pack;
+					Thread_post_sem(m->suback_sem);
+				}
+				else if (pack->header.bits.type == UNSUBACK)
+				{
+					Log(TRACE_MIN, -1, "Posting unsuback semaphore for client %s", m->c->clientID);
+					m->pack = pack;
+					Thread_post_sem(m->unsuback_sem);
+				}
+			}
+			else if (m->c->connect_state == 1 && !Thread_check_sem(m->connect_sem))
+			{
+				int error;
+				socklen_t len = sizeof(error);
+
+				if ((m->rc = getsockopt(m->c->net.socket, SOL_SOCKET, SO_ERROR, (char*)&error, &len)) == 0)
+					m->rc = error;
+				Log(TRACE_MIN, -1, "Posting connect semaphore for client %s rc %d", m->c->clientID, m->rc);
+				Thread_post_sem(m->connect_sem);
+			}
+#if defined(OPENSSL)
+			else if (m->c->connect_state == 2 && !Thread_check_sem(m->connect_sem))
+			{
+				rc = SSLSocket_connect(m->c->net.ssl, m->c->net.socket);
+				if (rc == 1 || rc == SSL_FATAL)
+				{
+					if (rc == 1 && !m->c->cleansession && m->c->session == NULL)
+						m->c->session = SSL_get1_session(m->c->net.ssl);
+					m->rc = rc;
+					Log(TRACE_MIN, -1, "Posting connect semaphore for SSL client %s rc %d", m->c->clientID, m->rc);
+					Thread_post_sem(m->connect_sem);
+				}
+			}
+#endif
+		}
+	}
+	run_id = 0;
+	running = tostop = 0;
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT;
+	return 0;
+}
+
+
+static void MQTTClient_stop(void)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (running == 1 && tostop == 0)
+	{
+		int conn_count = 0;
+		ListElement* current = NULL;
+
+		if (handles != NULL)
+		{
+			/* find out how many handles are still connected */
+			while (ListNextElement(handles, &current))
+			{
+				if (((MQTTClients*)(current->content))->c->connect_state > 0 ||
+						((MQTTClients*)(current->content))->c->connected)
+					++conn_count;
+			}
+		}
+		Log(TRACE_MIN, -1, "Conn_count is %d", conn_count);
+		/* stop the background thread, if we are the last one to be using it */
+		if (conn_count == 0)
+		{
+			int count = 0;
+			tostop = 1;
+			if (Thread_getid() != run_id)
+			{
+				while (running && ++count < 100)
+				{
+					Thread_unlock_mutex(mqttclient_mutex);
+					Log(TRACE_MIN, -1, "sleeping");
+					MQTTClient_sleep(100L);
+					Thread_lock_mutex(mqttclient_mutex);
+				}
+			}
+			rc = 1;
+		}
+	}
+	FUNC_EXIT_RC(rc);
+}
+
+
+int MQTTClient_setCallbacks(MQTTClient handle, void* context, MQTTClient_connectionLost* cl,
+														MQTTClient_messageArrived* ma, MQTTClient_deliveryComplete* dc)
+{
+	int rc = MQTTCLIENT_SUCCESS;
+	MQTTClients* m = handle;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (m == NULL || ma == NULL || m->c->connect_state != 0)
+		rc = MQTTCLIENT_FAILURE;
+	else
+	{
+		m->context = context;
+		m->cl = cl;
+		m->ma = ma;
+		m->dc = dc;
+	}
+
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void MQTTClient_closeSession(Clients* client)
+{
+	FUNC_ENTRY;
+	client->good = 0;
+	client->ping_outstanding = 0;
+	if (client->net.socket > 0)
+	{
+		if (client->connected)
+			MQTTPacket_send_disconnect(&client->net, client->clientID);
+		Thread_lock_mutex(socket_mutex);
+#if defined(OPENSSL)
+		SSLSocket_close(&client->net);
+#endif
+		Socket_close(client->net.socket);
+		Thread_unlock_mutex(socket_mutex);
+		client->net.socket = 0;
+#if defined(OPENSSL)
+		client->net.ssl = NULL;
+#endif
+	}
+	client->connected = 0;
+	client->connect_state = 0;
+
+	if (client->cleansession)
+		MQTTClient_cleanSession(client);
+	FUNC_EXIT;
+}
+
+
+static int MQTTClient_cleanSession(Clients* client)
+{
+	int rc = 0;
+
+	FUNC_ENTRY;
+#if !defined(NO_PERSISTENCE)
+	rc = MQTTPersistence_clear(client);
+#endif
+	MQTTProtocol_emptyMessageList(client->inboundMsgs);
+	MQTTProtocol_emptyMessageList(client->outboundMsgs);
+	MQTTClient_emptyMessageQueue(client);
+	client->msgID = 0;
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+void Protocol_processPublication(Publish* publish, Clients* client)
+{
+	qEntry* qe = NULL;
+	MQTTClient_message* mm = NULL;
+
+	FUNC_ENTRY;
+	qe = malloc(sizeof(qEntry));
+	mm = malloc(sizeof(MQTTClient_message));
+
+	qe->msg = mm;
+
+	qe->topicName = publish->topic;
+	qe->topicLen = publish->topiclen;
+	publish->topic = NULL;
+
+	/* If the message is QoS 2, then we have already stored the incoming payload
+	 * in an allocated buffer, so we don't need to copy again.
+	 */
+	if (publish->header.bits.qos == 2)
+		mm->payload = publish->payload;
+	else
+	{
+		mm->payload = malloc(publish->payloadlen);
+		memcpy(mm->payload, publish->payload, publish->payloadlen);
+	}
+
+	mm->payloadlen = publish->payloadlen;
+	mm->qos = publish->header.bits.qos;
+	mm->retained = publish->header.bits.retain;
+	if (publish->header.bits.qos == 2)
+		mm->dup = 0;  /* ensure that a QoS2 message is not passed to the application with dup = 1 */
+	else
+		mm->dup = publish->header.bits.dup;
+	mm->msgid = publish->msgId;
+
+	ListAppend(client->messageQueue, qe, sizeof(qe) + sizeof(mm) + mm->payloadlen + strlen(qe->topicName)+1);
+#if !defined(NO_PERSISTENCE)
+	if (client->persistence)
+		MQTTPersistence_persistQueueEntry(client, (MQTTPersistence_qEntry*)qe);
+#endif
+	FUNC_EXIT;
+}
+
+
+static int MQTTClient_connectURIVersion(MQTTClient handle, MQTTClient_connectOptions* options, const char* serverURI, int MQTTVersion,
+	START_TIME_TYPE start, long millisecsTimeout)
+{
+	MQTTClients* m = handle;
+	int rc = SOCKET_ERROR;
+	int sessionPresent = 0;
+
+	FUNC_ENTRY;
+	if (m->ma && !running)
+	{
+		Thread_start(MQTTClient_run, handle);
+		if (MQTTClient_elapsed(start) >= millisecsTimeout)
+		{
+			rc = SOCKET_ERROR;
+			goto exit;
+		}
+		MQTTClient_sleep(100L);
+	}
+
+	Log(TRACE_MIN, -1, "Connecting to serverURI %s with MQTT version %d", serverURI, MQTTVersion);
+#if defined(OPENSSL)
+	rc = MQTTProtocol_connect(serverURI, m->c, m->ssl, MQTTVersion);
+#else
+	rc = MQTTProtocol_connect(serverURI, m->c, MQTTVersion);
+#endif
+	if (rc == SOCKET_ERROR)
+		goto exit;
+
+	if (m->c->connect_state == 0)
+	{
+		rc = SOCKET_ERROR;
+		goto exit;
+	}
+
+	if (m->c->connect_state == 1) /* TCP connect started - wait for completion */
+	{
+		Thread_unlock_mutex(mqttclient_mutex);
+		MQTTClient_waitfor(handle, CONNECT, &rc, millisecsTimeout - MQTTClient_elapsed(start));
+		Thread_lock_mutex(mqttclient_mutex);
+		if (rc != 0)
+		{
+			rc = SOCKET_ERROR;
+			goto exit;
+		}
+
+#if defined(OPENSSL)
+		if (m->ssl)
+		{
+			int port;
+			char* hostname;
+			int setSocketForSSLrc = 0;
+
+			hostname = MQTTProtocol_addressPort(m->serverURI, &port);
+			setSocketForSSLrc = SSLSocket_setSocketForSSL(&m->c->net, m->c->sslopts, hostname);
+			if (hostname != m->serverURI)
+				free(hostname);
+
+			if (setSocketForSSLrc != MQTTCLIENT_SUCCESS)
+			{
+				if (m->c->session != NULL)
+					if ((rc = SSL_set_session(m->c->net.ssl, m->c->session)) != 1)
+						Log(TRACE_MIN, -1, "Failed to set SSL session with stored data, non critical");
+				rc = SSLSocket_connect(m->c->net.ssl, m->c->net.socket);
+				if (rc == TCPSOCKET_INTERRUPTED)
+					m->c->connect_state = 2;  /* the connect is still in progress */
+				else if (rc == SSL_FATAL)
+				{
+					rc = SOCKET_ERROR;
+					goto exit;
+				}
+				else if (rc == 1)
+				{
+					rc = MQTTCLIENT_SUCCESS;
+					m->c->connect_state = 3;
+					if (MQTTPacket_send_connect(m->c, MQTTVersion) == SOCKET_ERROR)
+					{
+						rc = SOCKET_ERROR;
+						goto exit;
+					}
+					if (!m->c->cleansession && m->c->session == NULL)
+						m->c->session = SSL_get1_session(m->c->net.ssl);
+				}
+			}
+			else
+			{
+				rc = SOCKET_ERROR;
+				goto exit;
+			}
+		}
+		else
+		{
+#endif
+			m->c->connect_state = 3; /* TCP connect completed, in which case send the MQTT connect packet */
+			if (MQTTPacket_send_connect(m->c, MQTTVersion) == SOCKET_ERROR)
+			{
+				rc = SOCKET_ERROR;
+				goto exit;
+			}
+#if defined(OPENSSL)
+		}
+#endif
+	}
+
+#if defined(OPENSSL)
+	if (m->c->connect_state == 2) /* SSL connect sent - wait for completion */
+	{
+		Thread_unlock_mutex(mqttclient_mutex);
+		MQTTClient_waitfor(handle, CONNECT, &rc, millisecsTimeout - MQTTClient_elapsed(start));
+		Thread_lock_mutex(mqttclient_mutex);
+		if (rc != 1)
+		{
+			rc = SOCKET_ERROR;
+			goto exit;
+		}
+		if(!m->c->cleansession && m->c->session == NULL)
+			m->c->session = SSL_get1_session(m->c->net.ssl);
+		m->c->connect_state = 3; /* TCP connect completed, in which case send the MQTT connect packet */
+		if (MQTTPacket_send_connect(m->c, MQTTVersion) == SOCKET_ERROR)
+		{
+			rc = SOCKET_ERROR;
+			goto exit;
+		}
+	}
+#endif
+
+	if (m->c->connect_state == 3) /* MQTT connect sent - wait for CONNACK */
+	{
+		MQTTPacket* pack = NULL;
+
+		Thread_unlock_mutex(mqttclient_mutex);
+		pack = MQTTClient_waitfor(handle, CONNACK, &rc, millisecsTimeout - MQTTClient_elapsed(start));
+		Thread_lock_mutex(mqttclient_mutex);
+		if (pack == NULL)
+			rc = SOCKET_ERROR;
+		else
+		{
+			Connack* connack = (Connack*)pack;
+			Log(TRACE_PROTOCOL, 1, NULL, m->c->net.socket, m->c->clientID, connack->rc);
+			if ((rc = connack->rc) == MQTTCLIENT_SUCCESS)
+			{
+				m->c->connected = 1;
+				m->c->good = 1;
+				m->c->connect_state = 0;
+				if (MQTTVersion == 4)
+					sessionPresent = connack->flags.bits.sessionPresent;
+				if (m->c->cleansession)
+					rc = MQTTClient_cleanSession(m->c);
+				if (m->c->outboundMsgs->count > 0)
+				{
+					ListElement* outcurrent = NULL;
+
+					while (ListNextElement(m->c->outboundMsgs, &outcurrent))
+					{
+						Messages* m = (Messages*)(outcurrent->content);
+						m->lastTouch = 0;
+					}
+					MQTTProtocol_retry((time_t)0, 1, 1);
+					if (m->c->connected != 1)
+						rc = MQTTCLIENT_DISCONNECTED;
+				}
+			}
+			free(connack);
+			m->pack = NULL;
+		}
+	}
+exit:
+	if (rc == MQTTCLIENT_SUCCESS)
+	{
+		if (options->struct_version == 4) /* means we have to fill out return values */
+		{
+			options->returned.serverURI = serverURI;
+			options->returned.MQTTVersion = MQTTVersion;
+			options->returned.sessionPresent = sessionPresent;
+		}
+	}
+	else
+		MQTTClient_disconnect1(handle, 0, 0, (MQTTVersion == 3)); /* don't want to call connection lost */
+	FUNC_EXIT_RC(rc);
+  return rc;
+}
+
+static int retryLoopInterval = 5;
+
+static void setRetryLoopInterval(int keepalive)
+{
+	int proposed = keepalive / 10;
+
+	if (proposed < 1)
+		proposed = 1;
+	else if (proposed > 5)
+		proposed = 5;
+	if (proposed < retryLoopInterval)
+		retryLoopInterval = proposed;
+}
+
+
+static int MQTTClient_connectURI(MQTTClient handle, MQTTClient_connectOptions* options, const char* serverURI)
+{
+	MQTTClients* m = handle;
+	START_TIME_TYPE start;
+	long millisecsTimeout = 30000L;
+	int rc = SOCKET_ERROR;
+	int MQTTVersion = 0;
+
+	FUNC_ENTRY;
+	millisecsTimeout = options->connectTimeout * 1000;
+	start = MQTTClient_start_clock();
+
+	m->c->keepAliveInterval = options->keepAliveInterval;
+	setRetryLoopInterval(options->keepAliveInterval);
+	m->c->cleansession = options->cleansession;
+	m->c->maxInflightMessages = (options->reliable) ? 1 : 10;
+
+	if (m->c->will)
+	{
+		free(m->c->will->payload);
+		free(m->c->will->topic);
+		free(m->c->will);
+		m->c->will = NULL;
+	}
+
+	if (options->will && (options->will->struct_version == 0 || options->will->struct_version == 1))
+	{
+		const void* source = NULL;
+
+		m->c->will = malloc(sizeof(willMessages));
+		if (options->will->message || (options->will->struct_version == 1 && options->will->payload.data))
+		{
+			if (options->will->struct_version == 1 && options->will->payload.data)
+			{
+				m->c->will->payloadlen = options->will->payload.len;
+				source = options->will->payload.data;
+			}
+			else
+			{
+				m->c->will->payloadlen = strlen(options->will->message);
+				source = (void*)options->will->message;
+			}
+			m->c->will->payload = malloc(m->c->will->payloadlen);
+			memcpy(m->c->will->payload, source, m->c->will->payloadlen);
+		}
+		else
+		{
+			m->c->will->payload = NULL;
+			m->c->will->payloadlen = 0;
+		}
+		m->c->will->qos = options->will->qos;
+		m->c->will->retained = options->will->retained;
+		m->c->will->topic = MQTTStrdup(options->will->topicName);
+	}
+
+#if defined(OPENSSL)
+	if (m->c->sslopts)
+	{
+		if (m->c->sslopts->trustStore)
+			free((void*)m->c->sslopts->trustStore);
+		if (m->c->sslopts->keyStore)
+			free((void*)m->c->sslopts->keyStore);
+		if (m->c->sslopts->privateKey)
+			free((void*)m->c->sslopts->privateKey);
+		if (m->c->sslopts->privateKeyPassword)
+			free((void*)m->c->sslopts->privateKeyPassword);
+		if (m->c->sslopts->enabledCipherSuites)
+			free((void*)m->c->sslopts->enabledCipherSuites);
+		free(m->c->sslopts);
+		m->c->sslopts = NULL;
+	}
+
+	if (options->struct_version != 0 && options->ssl)
+	{
+		m->c->sslopts = malloc(sizeof(MQTTClient_SSLOptions));
+		memset(m->c->sslopts, '\0', sizeof(MQTTClient_SSLOptions));
+		m->c->sslopts->struct_version = options->ssl->struct_version;
+		if (options->ssl->trustStore)
+			m->c->sslopts->trustStore = MQTTStrdup(options->ssl->trustStore);
+		if (options->ssl->keyStore)
+			m->c->sslopts->keyStore = MQTTStrdup(options->ssl->keyStore);
+		if (options->ssl->privateKey)
+			m->c->sslopts->privateKey = MQTTStrdup(options->ssl->privateKey);
+		if (options->ssl->privateKeyPassword)
+			m->c->sslopts->privateKeyPassword = MQTTStrdup(options->ssl->privateKeyPassword);
+		if (options->ssl->enabledCipherSuites)
+			m->c->sslopts->enabledCipherSuites = MQTTStrdup(options->ssl->enabledCipherSuites);
+		m->c->sslopts->enableServerCertAuth = options->ssl->enableServerCertAuth;
+		if (m->c->sslopts->struct_version >= 1)
+			m->c->sslopts->sslVersion = options->ssl->sslVersion;
+	}
+#endif
+
+	m->c->username = options->username;
+	m->c->password = options->password;
+	if (options->password)
+		m->c->passwordlen = strlen(options->password);
+	else if (options->struct_version >= 5 && options->binarypwd.data)
+	{
+		m->c->password = options->binarypwd.data;
+		m->c->passwordlen = options->binarypwd.len;
+	}
+	m->c->retryInterval = options->retryInterval;
+
+	if (options->struct_version >= 3)
+		MQTTVersion = options->MQTTVersion;
+	else
+		MQTTVersion = MQTTVERSION_DEFAULT;
+
+	if (MQTTVersion == MQTTVERSION_DEFAULT)
+	{
+		if ((rc = MQTTClient_connectURIVersion(handle, options, serverURI, 4, start, millisecsTimeout)) != MQTTCLIENT_SUCCESS)
+			rc = MQTTClient_connectURIVersion(handle, options, serverURI, 3, start, millisecsTimeout);
+	}
+	else
+		rc = MQTTClient_connectURIVersion(handle, options, serverURI, MQTTVersion, start, millisecsTimeout);
+
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTClient_connect(MQTTClient handle, MQTTClient_connectOptions* options)
+{
+	MQTTClients* m = handle;
+	int rc = SOCKET_ERROR;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(connect_mutex);
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (options == NULL)
+	{
+		rc = MQTTCLIENT_NULL_PARAMETER;
+		goto exit;
+	}
+
+	if (strncmp(options->struct_id, "MQTC", 4) != 0 || 	options->struct_version < 0 || options->struct_version > 5)
+	{
+		rc = MQTTCLIENT_BAD_STRUCTURE;
+		goto exit;
+	}
+
+	if (options->will) /* check validity of will options structure */
+	{
+		if (strncmp(options->will->struct_id, "MQTW", 4) != 0 || (options->will->struct_version != 0 && options->will->struct_version != 1))
+		{
+			rc = MQTTCLIENT_BAD_STRUCTURE;
+			goto exit;
+		}
+	}
+
+#if defined(OPENSSL)
+	if (options->struct_version != 0 && options->ssl) /* check validity of SSL options structure */
+	{
+		if (strncmp(options->ssl->struct_id, "MQTS", 4) != 0 || options->ssl->struct_version < 0 || options->ssl->struct_version > 1)
+		{
+			rc = MQTTCLIENT_BAD_STRUCTURE;
+			goto exit;
+		}
+	}
+#endif
+
+	if ((options->username && !UTF8_validateString(options->username)) ||
+		(options->password && !UTF8_validateString(options->password)))
+	{
+		rc = MQTTCLIENT_BAD_UTF8_STRING;
+		goto exit;
+	}
+
+	if (options->struct_version < 2 || options->serverURIcount == 0)
+		rc = MQTTClient_connectURI(handle, options, m->serverURI);
+	else
+	{
+		int i;
+
+		for (i = 0; i < options->serverURIcount; ++i)
+		{
+			char* serverURI = options->serverURIs[i];
+
+			if (strncmp(URI_TCP, serverURI, strlen(URI_TCP)) == 0)
+				serverURI += strlen(URI_TCP);
+#if defined(OPENSSL)
+			else if (strncmp(URI_SSL, serverURI, strlen(URI_SSL)) == 0)
+			{
+				serverURI += strlen(URI_SSL);
+				m->ssl = 1;
+			}
+#endif
+			if ((rc = MQTTClient_connectURI(handle, options, serverURI)) == MQTTCLIENT_SUCCESS)
+				break;
+		}
+	}
+
+exit:
+	if (m->c->will)
+	{
+		if (m->c->will->payload)
+			free(m->c->will->payload);
+		if (m->c->will->topic)
+			free(m->c->will->topic);
+		free(m->c->will);
+		m->c->will = NULL;
+	}
+	Thread_unlock_mutex(mqttclient_mutex);
+	Thread_unlock_mutex(connect_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * mqttclient_mutex must be locked when you call this function, if multi threaded
+ */
+static int MQTTClient_disconnect1(MQTTClient handle, int timeout, int call_connection_lost, int stop)
+{
+	MQTTClients* m = handle;
+	START_TIME_TYPE start;
+	int rc = MQTTCLIENT_SUCCESS;
+	int was_connected = 0;
+
+	FUNC_ENTRY;
+	if (m == NULL || m->c == NULL)
+	{
+		rc = MQTTCLIENT_FAILURE;
+		goto exit;
+	}
+	if (m->c->connected == 0 && m->c->connect_state == 0)
+	{
+		rc = MQTTCLIENT_DISCONNECTED;
+		goto exit;
+	}
+	was_connected = m->c->connected; /* should be 1 */
+	if (m->c->connected != 0)
+	{
+		start = MQTTClient_start_clock();
+		m->c->connect_state = -2; /* indicate disconnecting */
+		while (m->c->inboundMsgs->count > 0 || m->c->outboundMsgs->count > 0)
+		{ /* wait for all inflight message flows to finish, up to timeout */
+			if (MQTTClient_elapsed(start) >= timeout)
+				break;
+			Thread_unlock_mutex(mqttclient_mutex);
+			MQTTClient_yield();
+			Thread_lock_mutex(mqttclient_mutex);
+		}
+	}
+
+	MQTTClient_closeSession(m->c);
+
+	while (Thread_check_sem(m->connect_sem))
+		Thread_wait_sem(m->connect_sem, 100);
+	while (Thread_check_sem(m->connack_sem))
+		Thread_wait_sem(m->connack_sem, 100);
+	while (Thread_check_sem(m->suback_sem))
+		Thread_wait_sem(m->suback_sem, 100);
+	while (Thread_check_sem(m->unsuback_sem))
+		Thread_wait_sem(m->unsuback_sem, 100);
+exit:
+	if (stop)
+		MQTTClient_stop();
+	if (call_connection_lost && m->cl && was_connected)
+	{
+		Log(TRACE_MIN, -1, "Calling connectionLost for client %s", m->c->clientID);
+		Thread_start(connectionLost_call, m);
+	}
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+/**
+ * mqttclient_mutex must be locked when you call this function, if multi threaded
+ */
+static int MQTTClient_disconnect_internal(MQTTClient handle, int timeout)
+{
+	return MQTTClient_disconnect1(handle, timeout, 1, 1);
+}
+
+
+/**
+ * mqttclient_mutex must be locked when you call this function, if multi threaded
+ */
+void MQTTProtocol_closeSession(Clients* c, int sendwill)
+{
+	MQTTClient_disconnect_internal((MQTTClient)c->context, 0);
+}
+
+
+int MQTTClient_disconnect(MQTTClient handle, int timeout)
+{
+	int rc = 0;
+
+	Thread_lock_mutex(mqttclient_mutex);
+	rc = MQTTClient_disconnect1(handle, timeout, 0, 1);
+	Thread_unlock_mutex(mqttclient_mutex);
+	return rc;
+}
+
+
+int MQTTClient_isConnected(MQTTClient handle)
+{
+	MQTTClients* m = handle;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(mqttclient_mutex);
+	if (m && m->c)
+		rc = m->c->connected;
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTClient_subscribeMany(MQTTClient handle, int count, char* const* topic, int* qos)
+{
+	MQTTClients* m = handle;
+	List* topics = NULL;
+	List* qoss = NULL;
+	int i = 0;
+	int rc = MQTTCLIENT_FAILURE;
+	int msgid = 0;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(subscribe_mutex);
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (m == NULL || m->c == NULL)
+	{
+		rc = MQTTCLIENT_FAILURE;
+		goto exit;
+	}
+	if (m->c->connected == 0)
+	{
+		rc = MQTTCLIENT_DISCONNECTED;
+		goto exit;
+	}
+	for (i = 0; i < count; i++)
+	{
+		if (!UTF8_validateString(topic[i]))
+		{
+			rc = MQTTCLIENT_BAD_UTF8_STRING;
+			goto exit;
+		}
+
+		if(qos[i] < 0 || qos[i] > 2)
+		{
+			rc = MQTTCLIENT_BAD_QOS;
+			goto exit;
+		}
+	}
+	if ((msgid = MQTTProtocol_assignMsgId(m->c)) == 0)
+	{
+		rc = MQTTCLIENT_MAX_MESSAGES_INFLIGHT;
+		goto exit;
+	}
+
+	topics = ListInitialize();
+	qoss = ListInitialize();
+	for (i = 0; i < count; i++)
+	{
+		ListAppend(topics, topic[i], strlen(topic[i]));
+		ListAppend(qoss, &qos[i], sizeof(int));
+	}
+
+	rc = MQTTProtocol_subscribe(m->c, topics, qoss, msgid);
+	ListFreeNoContent(topics);
+	ListFreeNoContent(qoss);
+
+	if (rc == TCPSOCKET_COMPLETE)
+	{
+		MQTTPacket* pack = NULL;
+
+		Thread_unlock_mutex(mqttclient_mutex);
+		pack = MQTTClient_waitfor(handle, SUBACK, &rc, 10000L);
+		Thread_lock_mutex(mqttclient_mutex);
+		if (pack != NULL)
+		{
+			Suback* sub = (Suback*)pack;
+			ListElement* current = NULL;
+			i = 0;
+			while (ListNextElement(sub->qoss, &current))
+			{
+				int* reqqos = (int*)(current->content);
+				qos[i++] = *reqqos;
+			}
+			rc = MQTTProtocol_handleSubacks(pack, m->c->net.socket);
+			m->pack = NULL;
+		}
+		else
+			rc = SOCKET_ERROR;
+	}
+
+	if (rc == SOCKET_ERROR)
+		MQTTClient_disconnect_internal(handle, 0);
+	else if (rc == TCPSOCKET_COMPLETE)
+		rc = MQTTCLIENT_SUCCESS;
+
+exit:
+	Thread_unlock_mutex(mqttclient_mutex);
+	Thread_unlock_mutex(subscribe_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTClient_subscribe(MQTTClient handle, const char* topic, int qos)
+{
+	int rc = 0;
+	char *const topics[] = {(char*)topic};
+
+	FUNC_ENTRY;
+	rc = MQTTClient_subscribeMany(handle, 1, topics, &qos);
+	if (qos == MQTT_BAD_SUBSCRIBE) /* addition for MQTT 3.1.1 - error code from subscribe */
+		rc = MQTT_BAD_SUBSCRIBE;
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTClient_unsubscribeMany(MQTTClient handle, int count, char* const* topic)
+{
+	MQTTClients* m = handle;
+	List* topics = NULL;
+	int i = 0;
+	int rc = SOCKET_ERROR;
+	int msgid = 0;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(unsubscribe_mutex);
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (m == NULL || m->c == NULL)
+	{
+		rc = MQTTCLIENT_FAILURE;
+		goto exit;
+	}
+	if (m->c->connected == 0)
+	{
+		rc = MQTTCLIENT_DISCONNECTED;
+		goto exit;
+	}
+	for (i = 0; i < count; i++)
+	{
+		if (!UTF8_validateString(topic[i]))
+		{
+			rc = MQTTCLIENT_BAD_UTF8_STRING;
+			goto exit;
+		}
+	}
+	if ((msgid = MQTTProtocol_assignMsgId(m->c)) == 0)
+	{
+		rc = MQTTCLIENT_MAX_MESSAGES_INFLIGHT;
+		goto exit;
+	}
+
+	topics = ListInitialize();
+	for (i = 0; i < count; i++)
+		ListAppend(topics, topic[i], strlen(topic[i]));
+	rc = MQTTProtocol_unsubscribe(m->c, topics, msgid);
+	ListFreeNoContent(topics);
+
+	if (rc == TCPSOCKET_COMPLETE)
+	{
+		MQTTPacket* pack = NULL;
+
+		Thread_unlock_mutex(mqttclient_mutex);
+		pack = MQTTClient_waitfor(handle, UNSUBACK, &rc, 10000L);
+		Thread_lock_mutex(mqttclient_mutex);
+		if (pack != NULL)
+		{
+			rc = MQTTProtocol_handleUnsubacks(pack, m->c->net.socket);
+			m->pack = NULL;
+		}
+		else
+			rc = SOCKET_ERROR;
+	}
+
+	if (rc == SOCKET_ERROR)
+		MQTTClient_disconnect_internal(handle, 0);
+
+exit:
+	Thread_unlock_mutex(mqttclient_mutex);
+	Thread_unlock_mutex(unsubscribe_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTClient_unsubscribe(MQTTClient handle, const char* topic)
+{
+	int rc = 0;
+	char *const topics[] = {(char*)topic};
+	FUNC_ENTRY;
+	rc = MQTTClient_unsubscribeMany(handle, 1, topics);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTClient_publish(MQTTClient handle, const char* topicName, int payloadlen, void* payload,
+							 int qos, int retained, MQTTClient_deliveryToken* deliveryToken)
+{
+	int rc = MQTTCLIENT_SUCCESS;
+	MQTTClients* m = handle;
+	Messages* msg = NULL;
+	Publish* p = NULL;
+	int blocked = 0;
+	int msgid = 0;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (m == NULL || m->c == NULL)
+		rc = MQTTCLIENT_FAILURE;
+	else if (m->c->connected == 0)
+		rc = MQTTCLIENT_DISCONNECTED;
+	else if (!UTF8_validateString(topicName))
+		rc = MQTTCLIENT_BAD_UTF8_STRING;
+	if (rc != MQTTCLIENT_SUCCESS)
+		goto exit;
+
+	/* If outbound queue is full, block until it is not */
+	while (m->c->outboundMsgs->count >= m->c->maxInflightMessages ||
+         Socket_noPendingWrites(m->c->net.socket) == 0) /* wait until the socket is free of large packets being written */
+	{
+		if (blocked == 0)
+		{
+			blocked = 1;
+			Log(TRACE_MIN, -1, "Blocking publish on queue full for client %s", m->c->clientID);
+		}
+		Thread_unlock_mutex(mqttclient_mutex);
+		MQTTClient_yield();
+		Thread_lock_mutex(mqttclient_mutex);
+		if (m->c->connected == 0)
+		{
+			rc = MQTTCLIENT_FAILURE;
+			goto exit;
+		}
+	}
+	if (blocked == 1)
+		Log(TRACE_MIN, -1, "Resuming publish now queue not full for client %s", m->c->clientID);
+	if (qos > 0 && (msgid = MQTTProtocol_assignMsgId(m->c)) == 0)
+	{	/* this should never happen as we've waited for spaces in the queue */
+		rc = MQTTCLIENT_MAX_MESSAGES_INFLIGHT;
+		goto exit;
+	}
+
+	p = malloc(sizeof(Publish));
+
+	p->payload = payload;
+	p->payloadlen = payloadlen;
+	p->topic = (char*)topicName;
+	p->msgId = msgid;
+
+	rc = MQTTProtocol_startPublish(m->c, p, qos, retained, &msg);
+
+	/* If the packet was partially written to the socket, wait for it to complete.
+	 * However, if the client is disconnected during this time and qos is not 0, still return success, as
+	 * the packet has already been written to persistence and assigned a message id so will
+	 * be sent when the client next connects.
+	 */
+	if (rc == TCPSOCKET_INTERRUPTED)
+	{
+		while (m->c->connected == 1 && SocketBuffer_getWrite(m->c->net.socket))
+		{
+			Thread_unlock_mutex(mqttclient_mutex);
+			MQTTClient_yield();
+			Thread_lock_mutex(mqttclient_mutex);
+		}
+		rc = (qos > 0 || m->c->connected == 1) ? MQTTCLIENT_SUCCESS : MQTTCLIENT_FAILURE;
+	}
+
+	if (deliveryToken && qos > 0)
+		*deliveryToken = msg->msgid;
+
+	free(p);
+
+	if (rc == SOCKET_ERROR)
+	{
+		MQTTClient_disconnect_internal(handle, 0);
+		/* Return success for qos > 0 as the send will be retried automatically */
+		rc = (qos > 0) ? MQTTCLIENT_SUCCESS : MQTTCLIENT_FAILURE;
+	}
+
+exit:
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+
+int MQTTClient_publishMessage(MQTTClient handle, const char* topicName, MQTTClient_message* message,
+															 MQTTClient_deliveryToken* deliveryToken)
+{
+	int rc = MQTTCLIENT_SUCCESS;
+
+	FUNC_ENTRY;
+	if (message == NULL)
+	{
+		rc = MQTTCLIENT_NULL_PARAMETER;
+		goto exit;
+	}
+
+	if (strncmp(message->struct_id, "MQTM", 4) != 0 || message->struct_version != 0)
+	{
+		rc = MQTTCLIENT_BAD_STRUCTURE;
+		goto exit;
+	}
+
+	rc = MQTTClient_publish(handle, topicName, message->payloadlen, message->payload,
+								message->qos, message->retained, deliveryToken);
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+static void MQTTClient_retry(void)
+{
+	static time_t last = 0L;
+	time_t now;
+
+	FUNC_ENTRY;
+	time(&(now));
+	if (difftime(now, last) > retryLoopInterval)
+	{
+		time(&(last));
+		MQTTProtocol_keepalive(now);
+		MQTTProtocol_retry(now, 1, 0);
+	}
+	else
+		MQTTProtocol_retry(now, 0, 0);
+	FUNC_EXIT;
+}
+
+
+static MQTTPacket* MQTTClient_cycle(int* sock, unsigned long timeout, int* rc)
+{
+	struct timeval tp = {0L, 0L};
+	static Ack ack;
+	MQTTPacket* pack = NULL;
+
+	FUNC_ENTRY;
+	if (timeout > 0L)
+	{
+		tp.tv_sec = timeout / 1000;
+		tp.tv_usec = (timeout % 1000) * 1000; /* this field is microseconds! */
+	}
+
+#if defined(OPENSSL)
+	if ((*sock = SSLSocket_getPendingRead()) == -1)
+	{
+		/* 0 from getReadySocket indicates no work to do, -1 == error, but can happen normally */
+#endif
+		Thread_lock_mutex(socket_mutex);
+		*sock = Socket_getReadySocket(0, &tp);
+		Thread_unlock_mutex(socket_mutex);
+#if defined(OPENSSL)
+	}
+#endif
+	Thread_lock_mutex(mqttclient_mutex);
+	if (*sock > 0)
+	{
+		MQTTClients* m = NULL;
+		if (ListFindItem(handles, sock, clientSockCompare) != NULL)
+			m = (MQTTClient)(handles->current->content);
+		if (m != NULL)
+		{
+			if (m->c->connect_state == 1 || m->c->connect_state == 2)
+				*rc = 0;  /* waiting for connect state to clear */
+			else
+			{
+				pack = MQTTPacket_Factory(&m->c->net, rc);
+				if (*rc == TCPSOCKET_INTERRUPTED)
+					*rc = 0;
+			}
+		}
+		if (pack)
+		{
+			int freed = 1;
+
+			/* Note that these handle... functions free the packet structure that they are dealing with */
+			if (pack->header.bits.type == PUBLISH)
+				*rc = MQTTProtocol_handlePublishes(pack, *sock);
+			else if (pack->header.bits.type == PUBACK || pack->header.bits.type == PUBCOMP)
+			{
+				int msgid;
+
+				ack = (pack->header.bits.type == PUBCOMP) ? *(Pubcomp*)pack : *(Puback*)pack;
+				msgid = ack.msgId;
+				*rc = (pack->header.bits.type == PUBCOMP) ?
+						MQTTProtocol_handlePubcomps(pack, *sock) : MQTTProtocol_handlePubacks(pack, *sock);
+				if (m && m->dc)
+				{
+					Log(TRACE_MIN, -1, "Calling deliveryComplete for client %s, msgid %d", m->c->clientID, msgid);
+					(*(m->dc))(m->context, msgid);
+				}
+			}
+			else if (pack->header.bits.type == PUBREC)
+				*rc = MQTTProtocol_handlePubrecs(pack, *sock);
+			else if (pack->header.bits.type == PUBREL)
+				*rc = MQTTProtocol_handlePubrels(pack, *sock);
+			else if (pack->header.bits.type == PINGRESP)
+				*rc = MQTTProtocol_handlePingresps(pack, *sock);
+			else
+				freed = 0;
+			if (freed)
+				pack = NULL;
+		}
+	}
+	MQTTClient_retry();
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT_RC(*rc);
+	return pack;
+}
+
+
+static MQTTPacket* MQTTClient_waitfor(MQTTClient handle, int packet_type, int* rc, long timeout)
+{
+	MQTTPacket* pack = NULL;
+	MQTTClients* m = handle;
+	START_TIME_TYPE start = MQTTClient_start_clock();
+
+	FUNC_ENTRY;
+	if (((MQTTClients*)handle) == NULL || timeout <= 0L)
+	{
+		*rc = MQTTCLIENT_FAILURE;
+		goto exit;
+	}
+
+	if (running)
+	{
+		if (packet_type == CONNECT)
+		{
+			if ((*rc = Thread_wait_sem(m->connect_sem, timeout)) == 0)
+				*rc = m->rc;
+		}
+		else if (packet_type == CONNACK)
+			*rc = Thread_wait_sem(m->connack_sem, timeout);
+		else if (packet_type == SUBACK)
+			*rc = Thread_wait_sem(m->suback_sem, timeout);
+		else if (packet_type == UNSUBACK)
+			*rc = Thread_wait_sem(m->unsuback_sem, timeout);
+		if (*rc == 0 && packet_type != CONNECT && m->pack == NULL)
+			Log(LOG_ERROR, -1, "waitfor unexpectedly is NULL for client %s, packet_type %d, timeout %ld", m->c->clientID, packet_type, timeout);
+		pack = m->pack;
+	}
+	else
+	{
+		*rc = TCPSOCKET_COMPLETE;
+		while (1)
+		{
+			int sock = -1;
+			pack = MQTTClient_cycle(&sock, 100L, rc);
+			if (sock == m->c->net.socket)
+			{
+				if (*rc == SOCKET_ERROR)
+					break;
+				if (pack && (pack->header.bits.type == packet_type))
+					break;
+				if (m->c->connect_state == 1)
+				{
+					int error;
+					socklen_t len = sizeof(error);
+
+					if ((*rc = getsockopt(m->c->net.socket, SOL_SOCKET, SO_ERROR, (char*)&error, &len)) == 0)
+						*rc = error;
+					break;
+				}
+#if defined(OPENSSL)
+				else if (m->c->connect_state == 2)
+				{
+					*rc = SSLSocket_connect(m->c->net.ssl, sock);
+					if (*rc == SSL_FATAL)
+						break;
+					else if (*rc == 1) /* rc == 1 means SSL connect has finished and succeeded */
+					{
+						if (!m->c->cleansession && m->c->session == NULL)
+							m->c->session = SSL_get1_session(m->c->net.ssl);
+						break;
+					}
+				}
+#endif
+				else if (m->c->connect_state == 3)
+				{
+					int error;
+					socklen_t len = sizeof(error);
+
+					if (getsockopt(m->c->net.socket, SOL_SOCKET, SO_ERROR, (char*)&error, &len) == 0)
+					{
+						if (error)
+						{
+							*rc = error;
+							break;
+						}
+					}
+				}
+			}
+			if (MQTTClient_elapsed(start) > timeout)
+			{
+				pack = NULL;
+				break;
+			}
+		}
+	}
+
+exit:
+	FUNC_EXIT_RC(*rc);
+	return pack;
+}
+
+
+int MQTTClient_receive(MQTTClient handle, char** topicName, int* topicLen, MQTTClient_message** message,
+											 unsigned long timeout)
+{
+	int rc = TCPSOCKET_COMPLETE;
+	START_TIME_TYPE start = MQTTClient_start_clock();
+	unsigned long elapsed = 0L;
+	MQTTClients* m = handle;
+
+	FUNC_ENTRY;
+	if (m == NULL || m->c == NULL
+			|| running) /* receive is not meant to be called in a multi-thread environment */
+	{
+		rc = MQTTCLIENT_FAILURE;
+		goto exit;
+	}
+	if (m->c->connected == 0)
+	{
+		rc = MQTTCLIENT_DISCONNECTED;
+		goto exit;
+	}
+
+	*topicName = NULL;
+	*message = NULL;
+
+	/* if there is already a message waiting, don't hang around but still do some packet handling */
+	if (m->c->messageQueue->count > 0)
+		timeout = 0L;
+
+	elapsed = MQTTClient_elapsed(start);
+	do
+	{
+		int sock = 0;
+		MQTTClient_cycle(&sock, (timeout > elapsed) ? timeout - elapsed : 0L, &rc);
+
+		if (rc == SOCKET_ERROR)
+		{
+			if (ListFindItem(handles, &sock, clientSockCompare) && 	/* find client corresponding to socket */
+			  (MQTTClient)(handles->current->content) == handle)
+				break; /* there was an error on the socket we are interested in */
+		}
+		elapsed = MQTTClient_elapsed(start);
+	}
+	while (elapsed < timeout && m->c->messageQueue->count == 0);
+
+	if (m->c->messageQueue->count > 0)
+		rc = MQTTClient_deliverMessage(rc, m, topicName, topicLen, message);
+
+	if (rc == SOCKET_ERROR)
+		MQTTClient_disconnect_internal(handle, 0);
+
+exit:
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+void MQTTClient_yield(void)
+{
+	START_TIME_TYPE start = MQTTClient_start_clock();
+	unsigned long elapsed = 0L;
+	unsigned long timeout = 100L;
+	int rc = 0;
+
+	FUNC_ENTRY;
+	if (running) /* yield is not meant to be called in a multi-thread environment */
+	{
+		MQTTClient_sleep(timeout);
+		goto exit;
+	}
+
+	elapsed = MQTTClient_elapsed(start);
+	do
+	{
+		int sock = -1;
+		MQTTClient_cycle(&sock, (timeout > elapsed) ? timeout - elapsed : 0L, &rc);
+		Thread_lock_mutex(mqttclient_mutex);
+		if (rc == SOCKET_ERROR && ListFindItem(handles, &sock, clientSockCompare))
+		{
+			MQTTClients* m = (MQTTClient)(handles->current->content);
+			if (m->c->connect_state != -2)
+				MQTTClient_disconnect_internal(m, 0);
+		}
+		Thread_unlock_mutex(mqttclient_mutex);
+		elapsed = MQTTClient_elapsed(start);
+	}
+	while (elapsed < timeout);
+exit:
+	FUNC_EXIT;
+}
+
+/*
+static int pubCompare(void* a, void* b)
+{
+	Messages* msg = (Messages*)a;
+	return msg->publish == (Publications*)b;
+}*/
+
+
+int MQTTClient_waitForCompletion(MQTTClient handle, MQTTClient_deliveryToken mdt, unsigned long timeout)
+{
+	int rc = MQTTCLIENT_FAILURE;
+	START_TIME_TYPE start = MQTTClient_start_clock();
+	unsigned long elapsed = 0L;
+	MQTTClients* m = handle;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (m == NULL || m->c == NULL)
+	{
+		rc = MQTTCLIENT_FAILURE;
+		goto exit;
+	}
+
+	elapsed = MQTTClient_elapsed(start);
+	while (elapsed < timeout)
+	{
+		if (m->c->connected == 0)
+		{
+			rc = MQTTCLIENT_DISCONNECTED;
+			goto exit;
+		}
+		if (ListFindItem(m->c->outboundMsgs, &mdt, messageIDCompare) == NULL)
+		{
+			rc = MQTTCLIENT_SUCCESS; /* well we couldn't find it */
+			goto exit;
+		}
+		Thread_unlock_mutex(mqttclient_mutex);
+		MQTTClient_yield();
+		Thread_lock_mutex(mqttclient_mutex);
+		elapsed = MQTTClient_elapsed(start);
+	}
+
+exit:
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+
+int MQTTClient_getPendingDeliveryTokens(MQTTClient handle, MQTTClient_deliveryToken **tokens)
+{
+	int rc = MQTTCLIENT_SUCCESS;
+	MQTTClients* m = handle;
+	*tokens = NULL;
+
+	FUNC_ENTRY;
+	Thread_lock_mutex(mqttclient_mutex);
+
+	if (m == NULL)
+	{
+		rc = MQTTCLIENT_FAILURE;
+		goto exit;
+	}
+
+	if (m->c && m->c->outboundMsgs->count > 0)
+	{
+		ListElement* current = NULL;
+		int count = 0;
+
+		*tokens = malloc(sizeof(MQTTClient_deliveryToken) * (m->c->outboundMsgs->count + 1));
+		/*Heap_unlink(__FILE__, __LINE__, *tokens);*/
+		while (ListNextElement(m->c->outboundMsgs, &current))
+		{
+			Messages* m = (Messages*)(current->content);
+			(*tokens)[count++] = m->msgid;
+		}
+		(*tokens)[count] = -1;
+	}
+
+exit:
+	Thread_unlock_mutex(mqttclient_mutex);
+	FUNC_EXIT_RC(rc);
+	return rc;
+}
+
+MQTTClient_nameValue* MQTTClient_getVersionInfo(void)
+{
+	#define MAX_INFO_STRINGS 8
+	static MQTTClient_nameValue libinfo[MAX_INFO_STRINGS + 1];
+	int i = 0;
+
+	libinfo[i].name = "Product name";
+	libinfo[i++].value = "Paho Synchronous MQTT C Client Library";
+
+	libinfo[i].name = "Version";
+	libinfo[i++].value = CLIENT_VERSION;
+
+	libinfo[i].name = "Build level";
+	libinfo[i++].value = BUILD_TIMESTAMP;
+#if defined(OPENSSL)
+	libinfo[i].name = "OpenSSL version";
+	libinfo[i++].value = SSLeay_version(SSLEAY_VERSION);
+
+	libinfo[i].name = "OpenSSL flags";
+	libinfo[i++].value = SSLeay_version(SSLEAY_CFLAGS);
+
+	libinfo[i].name = "OpenSSL build timestamp";
+	libinfo[i++].value = SSLeay_version(SSLEAY_BUILT_ON);
+
+	libinfo[i].name = "OpenSSL platform";
+	libinfo[i++].value = SSLeay_version(SSLEAY_PLATFORM);
+
+	libinfo[i].name = "OpenSSL directory";
+	libinfo[i++].value = SSLeay_version(SSLEAY_DIR);
+#endif
+	libinfo[i].name = NULL;
+	libinfo[i].value = NULL;
+	return libinfo;
+}
+
+
+/**
+ * See if any pending writes have been completed, and cleanup if so.
+ * Cleaning up means removing any publication data that was stored because the write did
+ * not originally complete.
+ */
+static void MQTTProtocol_checkPendingWrites(void)
+{
+	FUNC_ENTRY;
+	if (state.pending_writes.count > 0)
+	{
+		ListElement* le = state.pending_writes.first;
+		while (le)
+		{
+			if (Socket_noPendingWrites(((pending_write*)(le->content))->socket))
+			{
+				MQTTProtocol_removePublication(((pending_write*)(le->content))->p);
+				state.pending_writes.current = le;
+				ListRemove(&(state.pending_writes), le->content); /* does NextElement itself */
+				le = state.pending_writes.current;
+			}
+			else
+				ListNextElement(&(state.pending_writes), &le);
+		}
+	}
+	FUNC_EXIT;
+}
+
+
+static void MQTTClient_writeComplete(int socket)
+{
+	ListElement* found = NULL;
+
+	FUNC_ENTRY;
+	/* a partial write is now complete for a socket - this will be on a publish*/
+
+	MQTTProtocol_checkPendingWrites();
+
+	/* find the client using this socket */
+	if ((found = ListFindItem(handles, &socket, clientSockCompare)) != NULL)
+	{
+		MQTTClients* m = (MQTTClients*)(found->content);
+
+		time(&(m->c->net.lastSent));
+	}
+	FUNC_EXIT;
+}


[10/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal.in
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal.in b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal.in
new file mode 100644
index 0000000..802651a
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientInternal.in
@@ -0,0 +1,1852 @@
+# Doxyfile 1.8.1.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "MQTT C Client Libraries Internals"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = "@PROJECT_SOURCE_DIR@/doc/pahologo.png"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = "@CMAKE_CURRENT_BINARY_DIR@/doc/MQTTClient_internal/"
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        = 
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = YES
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = NO
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = MQTTClient_internal
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+STRIP_FROM_PATH        = @PROJECT_SOURCE_DIR@/src
+INPUT                  = @PROJECT_SOURCE_DIR@/src
+
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          = *.cc \
+                         *.cxx \
+                         *.cpp \
+                         *.c++ \
+                         *.d \
+                         *.java \
+                         *.ii \
+                         *.ixx \
+                         *.ipp \
+                         *.i++ \
+                         *.inl \
+                         *.h \
+                         *.hh \
+                         *.hxx \
+                         *.hpp \
+                         *.h++ \
+                         *.idl \
+                         *.odl \
+                         *.cs \
+                         *.php \
+                         *.php3 \
+                         *.inc \
+                         *.m \
+                         *.mm \
+                         *.dox \
+                         *.py \
+                         *.f90 \
+                         *.f \
+                         *.vhd \
+                         *.vhdl \
+                         *.C \
+                         *.CC \
+                         *.C++ \
+                         *.II \
+                         *.I++ \
+                         *.H \
+                         *.HH \
+                         *.H++ \
+                         *.CS \
+                         *.PHP \
+                         *.PHP3 \
+                         *.M \
+                         *.MM \
+                         *.PY \
+                         *.F90 \
+                         *.F \
+                         *.VHD \
+                         *.VHDL \
+                         *.c
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = NONE
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = NO
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 1000
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = YES
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/pahologo.png
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/pahologo.png b/thirdparty/paho.mqtt.c/doc/pahologo.png
new file mode 100644
index 0000000..27f197d
Binary files /dev/null and b/thirdparty/paho.mqtt.c/doc/pahologo.png differ

http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/edl-v10
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/edl-v10 b/thirdparty/paho.mqtt.c/edl-v10
new file mode 100644
index 0000000..cf989f1
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/edl-v10
@@ -0,0 +1,15 @@
+
+Eclipse Distribution License - v 1.0
+
+Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+


[13/19] nifi-minifi-cpp git commit: MINIFICPP-342: MQTT extension

Posted by ph...@apache.org.
http://git-wip-us.apache.org/repos/asf/nifi-minifi-cpp/blob/a8703b5c/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI
----------------------------------------------------------------------
diff --git a/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI
new file mode 100644
index 0000000..7026856
--- /dev/null
+++ b/thirdparty/paho.mqtt.c/doc/DoxyfileV3ClientAPI
@@ -0,0 +1,1803 @@
+# Doxyfile 1.8.1.2
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a hash (#) is considered a comment and will be ignored.
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = "Paho MQTT C Client Library"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = "../doc/pahologo.png"
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = "../build/output/doc/MQTTClient/"
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = "The $name class" \
+                         "The $name widget" \
+                         "The $name file" \
+                         is \
+                         provides \
+                         specifies \
+                         contains \
+                         represents \
+                         a \
+                         an \
+                         the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        = /Users/dimitri/doxygen/mail/1.5.7/doxywizard/
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding
+# "class=itcl::class" will allow you to use the command class in the
+# itcl::class meaning.
+
+TCL_SUBST              =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
+# comments according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you
+# can mix doxygen, HTML, and XML commands with Markdown formatting.
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
+# their name and scope. Since this can be an expensive process and often the
+# same symbol appear multiple times in the code, doxygen keeps a cache of
+# pre-resolved symbols. If the cache is too small doxygen will become slower.
+# If the cache is too large, memory is wasted. The cache size is given by this
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = YES
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = NO
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       = MQTTClient_main
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+# feature you need bibtex and perl available in the search path.
+
+CITE_BIB_FILES         =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  = MQTTClient.h \
+                         MQTTClientPersistence.h
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+#  for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is advised to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# style sheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the style sheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
+# entries shown in the various tree structured indices initially; the user
+# can expand and collapse entries dynamically later on. Doxygen will expand
+# the tree to such a level that at most the specified number of entries are
+# visible (unless a fully collapsed tree already exceeds this amount).
+# So setting the number of entries 1 will produce a full collapsed tree by
+# default. 0 is a special value representing an infinite number of entries
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          =
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
+# at top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it. Since the tabs have the same information as the
+# navigation tree you can set this option to NO if you already set
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+# Since the tree basically has the same information as the tab index you
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = NONE
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you may also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to
+# the MathJax Content Delivery Network so you can quickly see the result without
+# installing MathJax.
+# However, it is strongly recommended to install a local
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             = __attribute__(x)=
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each
+# tag file the location of the external documentation should be added. The
+# format of a tag file without this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths
+# or URLs. Note that each tag file must have a unique name (where the name does
+# NOT include the path). If a tag file is not located in the directory in which
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = NO
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = NO
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside
+# the class node. If there are many fields or methods and many nodes the
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
+# threshold limits the number of items for each type to make the size more
+# managable. Set this to 0 for no limit. Note that the threshold may be
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES