You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2016/03/16 15:29:46 UTC

qpid-dispatch git commit: DISPATCH-179 - Added configuration/management hooks for autoLink

Repository: qpid-dispatch
Updated Branches:
  refs/heads/tross-DISPATCH-179-1 56c5a93fa -> 2aa0e26a7


DISPATCH-179 - Added configuration/management hooks for autoLink


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/2aa0e26a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/2aa0e26a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/2aa0e26a

Branch: refs/heads/tross-DISPATCH-179-1
Commit: 2aa0e26a7646110f6b9cfe66fe0f7a41a638f409
Parents: 56c5a93
Author: Ted Ross <tr...@redhat.com>
Authored: Wed Mar 16 10:28:43 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed Mar 16 10:28:43 2016 -0400

----------------------------------------------------------------------
 src/CMakeLists.txt                        |   1 +
 src/router_core/agent.c                   |  13 +-
 src/router_core/agent_config_auto_link.c  | 397 +++++++++++++++++++++++++
 src/router_core/agent_config_auto_link.h  |  35 +++
 src/router_core/agent_config_link_route.c |   2 +-
 src/router_core/agent_link.c              |   8 +-
 src/router_core/connections.c             |   4 +-
 src/router_core/forwarder.c               |   2 +-
 src/router_core/route_control.c           |   9 +-
 src/router_core/route_control.h           |   9 +-
 src/router_core/router_core_private.h     |   2 +-
 11 files changed, 457 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fbcbd6e..e901335 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -67,6 +67,7 @@ set(qpid_dispatch_SOURCES
   router_core/agent.c
   router_core/agent_address.c
   router_core/agent_config_address.c
+  router_core/agent_config_auto_link.c
   router_core/agent_config_link_route.c
   router_core/agent_link.c
   router_core/connections.c

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/agent.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent.c b/src/router_core/agent.c
index 450293a..485d738 100644
--- a/src/router_core/agent.c
+++ b/src/router_core/agent.c
@@ -20,6 +20,7 @@
 #include <qpid/dispatch/amqp.h>
 #include "agent_config_address.h"
 #include "agent_config_link_route.h"
+#include "agent_config_auto_link.h"
 #include "agent_address.h"
 #include "agent_link.h"
 #include "router_core_private.h"
@@ -180,7 +181,7 @@ qdr_query_t *qdr_manage_query(qdr_core_t              *core,
     switch (query->entity_type) {
     case QD_ROUTER_CONFIG_ADDRESS:    qdr_agent_set_columns(query, attribute_names, qdr_config_address_columns, QDR_CONFIG_ADDRESS_COLUMN_COUNT);  break;
     case QD_ROUTER_CONFIG_LINK_ROUTE: qdr_agent_set_columns(query, attribute_names, qdr_config_link_route_columns, QDR_CONFIG_LINK_ROUTE_COLUMN_COUNT);  break;
-    case QD_ROUTER_CONFIG_AUTO_LINK:  break;
+    case QD_ROUTER_CONFIG_AUTO_LINK:  qdr_agent_set_columns(query, attribute_names, qdr_config_auto_link_columns, QDR_CONFIG_AUTO_LINK_COLUMN_COUNT);  break;
     case QD_ROUTER_CONNECTION:        break;
     case QD_ROUTER_LINK:              qdr_agent_set_columns(query, attribute_names, qdr_link_columns, QDR_LINK_COLUMN_COUNT);  break;
     case QD_ROUTER_ADDRESS:           qdr_agent_set_columns(query, attribute_names, qdr_address_columns, QDR_ADDRESS_COLUMN_COUNT); break;
@@ -197,7 +198,7 @@ void qdr_query_add_attribute_names(qdr_query_t *query)
     switch (query->entity_type) {
     case QD_ROUTER_CONFIG_ADDRESS:    qdr_agent_emit_columns(query, qdr_config_address_columns, QDR_CONFIG_ADDRESS_COLUMN_COUNT); break;
     case QD_ROUTER_CONFIG_LINK_ROUTE: qdr_agent_emit_columns(query, qdr_config_link_route_columns, QDR_CONFIG_LINK_ROUTE_COLUMN_COUNT); break;
-    case QD_ROUTER_CONFIG_AUTO_LINK:  break;
+    case QD_ROUTER_CONFIG_AUTO_LINK:  qdr_agent_emit_columns(query, qdr_config_auto_link_columns, QDR_CONFIG_AUTO_LINK_COLUMN_COUNT); break;
     case QD_ROUTER_CONNECTION:        break;
     case QD_ROUTER_LINK:              qdr_agent_emit_columns(query, qdr_link_columns, QDR_LINK_COLUMN_COUNT); break;
     case QD_ROUTER_ADDRESS:           qdr_agent_emit_columns(query, qdr_address_columns, QDR_ADDRESS_COLUMN_COUNT); break;
@@ -341,7 +342,7 @@ static void qdr_manage_create_CT(qdr_core_t *core, qdr_action_t *action, bool di
     switch (query->entity_type) {
     case QD_ROUTER_CONFIG_ADDRESS:    qdra_config_address_create_CT(core, name, query, in_body); break;
     case QD_ROUTER_CONFIG_LINK_ROUTE: qdra_config_link_route_create_CT(core, name, query, in_body); break;
-    case QD_ROUTER_CONFIG_AUTO_LINK:  break;
+    case QD_ROUTER_CONFIG_AUTO_LINK:  qdra_config_auto_link_create_CT(core, name, query, in_body); break;
     case QD_ROUTER_CONNECTION:        break;
     case QD_ROUTER_LINK:              break;
     case QD_ROUTER_ADDRESS:           break;
@@ -363,7 +364,7 @@ static void qdr_manage_delete_CT(qdr_core_t *core, qdr_action_t *action, bool di
     switch (query->entity_type) {
     case QD_ROUTER_CONFIG_ADDRESS:    qdra_config_address_delete_CT(core, query, name, identity); break;
     case QD_ROUTER_CONFIG_LINK_ROUTE: qdra_config_link_route_delete_CT(core, query, name, identity); break;
-    case QD_ROUTER_CONFIG_AUTO_LINK:  break;
+    case QD_ROUTER_CONFIG_AUTO_LINK:  qdra_config_auto_link_delete_CT(core, query, name, identity); break;
     case QD_ROUTER_CONNECTION:        break;
     case QD_ROUTER_LINK:              break;
     case QD_ROUTER_ADDRESS:           break;
@@ -405,7 +406,7 @@ static void qdrh_query_get_first_CT(qdr_core_t *core, qdr_action_t *action, bool
         switch (query->entity_type) {
         case QD_ROUTER_CONFIG_ADDRESS:    qdra_config_address_get_first_CT(core, query, offset); break;
         case QD_ROUTER_CONFIG_LINK_ROUTE: qdra_config_link_route_get_first_CT(core, query, offset); break;
-        case QD_ROUTER_CONFIG_AUTO_LINK:  break;
+        case QD_ROUTER_CONFIG_AUTO_LINK:  qdra_config_auto_link_get_first_CT(core, query, offset); break;
         case QD_ROUTER_CONNECTION:        break;
         case QD_ROUTER_LINK:              qdra_link_get_first_CT(core, query, offset); break;
         case QD_ROUTER_ADDRESS:           qdra_address_get_first_CT(core, query, offset); break;
@@ -424,7 +425,7 @@ static void qdrh_query_get_next_CT(qdr_core_t *core, qdr_action_t *action, bool
         switch (query->entity_type) {
         case QD_ROUTER_CONFIG_ADDRESS:    qdra_config_address_get_next_CT(core, query); break;
         case QD_ROUTER_CONFIG_LINK_ROUTE: qdra_config_link_route_get_next_CT(core, query); break;
-        case QD_ROUTER_CONFIG_AUTO_LINK:  break;
+        case QD_ROUTER_CONFIG_AUTO_LINK:  qdra_config_auto_link_get_next_CT(core, query); break;
         case QD_ROUTER_CONNECTION:        break;
         case QD_ROUTER_LINK:              qdra_link_get_next_CT(core, query); break;
         case QD_ROUTER_ADDRESS:           qdra_address_get_next_CT(core, query); break;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/agent_config_auto_link.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent_config_auto_link.c b/src/router_core/agent_config_auto_link.c
new file mode 100644
index 0000000..6f8ef8a
--- /dev/null
+++ b/src/router_core/agent_config_auto_link.c
@@ -0,0 +1,397 @@
+/*
+ * 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 <qpid/dispatch/ctools.h>
+#include "agent_config_auto_link.h"
+#include "route_control.h"
+#include <stdio.h>
+
+#define QDR_CONFIG_AUTO_LINK_NAME          0
+#define QDR_CONFIG_AUTO_LINK_IDENTITY      1
+#define QDR_CONFIG_AUTO_LINK_TYPE          2
+#define QDR_CONFIG_AUTO_LINK_ADDR          3
+#define QDR_CONFIG_AUTO_LINK_DIR           4
+#define QDR_CONFIG_AUTO_LINK_PHASE         5
+#define QDR_CONFIG_AUTO_LINK_CONNECTION    6
+#define QDR_CONFIG_AUTO_LINK_CONTAINER_ID  7
+#define QDR_CONFIG_AUTO_LINK_LINK_REF      8
+
+const char *qdr_config_auto_link_columns[] =
+    {"name",
+     "identity",
+     "type",
+     "addr",
+     "dir",
+     "phase",
+     "containerId",
+     "connection",
+     "linkRef",
+     0};
+
+
+static void qdr_config_auto_link_insert_column_CT(qdr_auto_link_t *al, int col, qd_composed_field_t *body, bool as_map)
+{
+    const char *text = 0;
+    const char *key;
+    char id_str[100];
+
+    if (as_map)
+        qd_compose_insert_string(body, qdr_config_auto_link_columns[col]);
+
+    switch(col) {
+    case QDR_CONFIG_AUTO_LINK_NAME:
+        if (al->name)
+            qd_compose_insert_string(body, al->name);
+        else
+            qd_compose_insert_null(body);
+        break;
+
+    case QDR_CONFIG_AUTO_LINK_IDENTITY:
+        snprintf(id_str, 100, "%ld", al->identity);
+        qd_compose_insert_string(body, id_str);
+        break;
+
+    case QDR_CONFIG_AUTO_LINK_TYPE:
+        qd_compose_insert_string(body, "org.apache.qpid.dispatch.config.autoLink");
+        break;
+
+    case QDR_CONFIG_AUTO_LINK_ADDR:
+        key = (const char*) qd_hash_key_by_handle(al->addr->hash_handle);
+        if (key && key[0] == 'M')
+            qd_compose_insert_string(body, &key[1]);
+        else
+            qd_compose_insert_null(body);
+        break;
+
+    case QDR_CONFIG_AUTO_LINK_DIR:
+        text = al->dir == QD_INCOMING ? "in" : "out";
+        qd_compose_insert_string(body, text);
+        break;
+
+    case QDR_CONFIG_AUTO_LINK_PHASE:
+        qd_compose_insert_int(body, al->phase);
+        break;
+
+    case QDR_CONFIG_AUTO_LINK_CONNECTION:
+    case QDR_CONFIG_AUTO_LINK_CONTAINER_ID:
+        if (al->conn_id) {
+            key = (const char*) qd_hash_key_by_handle(al->conn_id->hash_handle);
+            if (key && key[0] == 'L' && col == QDR_CONFIG_AUTO_LINK_CONNECTION) {
+                qd_compose_insert_string(body, &key[1]);
+                break;
+            }
+            if (key && key[0] == 'C' && col == QDR_CONFIG_AUTO_LINK_CONTAINER_ID) {
+                qd_compose_insert_string(body, &key[1]);
+                break;
+            }
+        }
+        qd_compose_insert_null(body);
+        break;
+
+    case QDR_CONFIG_AUTO_LINK_LINK_REF:
+        if (al->link) {
+            snprintf(id_str, 100, "%ld", al->link->identity);
+            qd_compose_insert_string(body, id_str);
+        } else
+            qd_compose_insert_null(body);
+    }
+}
+
+
+static void qdr_agent_write_config_auto_link_CT(qdr_query_t *query,  qdr_auto_link_t *al)
+{
+    qd_composed_field_t *body = query->body;
+
+    qd_compose_start_list(body);
+    int i = 0;
+    while (query->columns[i] >= 0) {
+        qdr_config_auto_link_insert_column_CT(al, query->columns[i], body, false);
+        i++;
+    }
+    qd_compose_end_list(body);
+}
+
+
+static void qdr_manage_advance_config_auto_link_CT(qdr_query_t *query, qdr_auto_link_t *al)
+{
+    query->next_offset++;
+    al = DEQ_NEXT(al);
+    query->more = !!al;
+}
+
+
+void qdra_config_auto_link_get_first_CT(qdr_core_t *core, qdr_query_t *query, int offset)
+{
+    //
+    // Queries that get this far will always succeed.
+    //
+    query->status = QD_AMQP_OK;
+
+    //
+    // If the offset goes beyond the set of objects, end the query now.
+    //
+    if (offset >= DEQ_SIZE(core->auto_links)) {
+        query->more = false;
+        qdr_agent_enqueue_response_CT(core, query);
+        return;
+    }
+
+    //
+    // Run to the object at the offset.
+    //
+    qdr_auto_link_t *al = DEQ_HEAD(core->auto_links);
+    for (int i = 0; i < offset && al; i++)
+        al = DEQ_NEXT(al);
+    assert(al);
+
+    //
+    // Write the columns of the object into the response body.
+    //
+    qdr_agent_write_config_auto_link_CT(query, al);
+
+    //
+    // Advance to the next auto_link
+    //
+    query->next_offset = offset;
+    qdr_manage_advance_config_auto_link_CT(query, al);
+
+    //
+    // Enqueue the response.
+    //
+    qdr_agent_enqueue_response_CT(core, query);
+}
+
+
+void qdra_config_auto_link_get_next_CT(qdr_core_t *core, qdr_query_t *query)
+{
+    qdr_auto_link_t *al = 0;
+
+    if (query->next_offset < DEQ_SIZE(core->auto_links)) {
+        al = DEQ_HEAD(core->auto_links);
+        for (int i = 0; i < query->next_offset && al; i++)
+            al = DEQ_NEXT(al);
+    }
+
+    if (al) {
+        //
+        // Write the columns of the addr entity into the response body.
+        //
+        qdr_agent_write_config_auto_link_CT(query, al);
+
+        //
+        // Advance to the next object
+        //
+        qdr_manage_advance_config_auto_link_CT(query, al);
+    } else
+        query->more = false;
+
+    //
+    // Enqueue the response.
+    //
+    qdr_agent_enqueue_response_CT(core, query);
+}
+
+
+static const char *qdra_auto_link_direction_CT(qd_parsed_field_t *field, qd_direction_t *dir)
+{
+    if (field) {
+        qd_field_iterator_t *iter = qd_parse_raw(field);
+        if (qd_field_iterator_equal(iter, (unsigned char*) "in")) {
+            *dir = QD_INCOMING;
+            return 0;
+        } else if (qd_field_iterator_equal(iter, (unsigned char*) "out")) {
+            *dir = QD_OUTGOING;
+            return 0;
+        }
+        return "Invalid value for 'dir'";
+    }
+    return "Missing value for 'dir'";
+}
+
+
+static qdr_auto_link_t *qdr_auto_link_config_find_by_identity_CT(qdr_core_t *core, qd_field_iterator_t *identity)
+{
+    if (!identity)
+        return 0;
+
+    qdr_auto_link_t *rc = DEQ_HEAD(core->auto_links);
+    while (rc) {
+        // Convert the passed in identity to a char*
+        char id[100];
+        snprintf(id, 100, "%ld", rc->identity);
+        if (qd_field_iterator_equal(identity, (const unsigned char*) id))
+            break;
+        rc = DEQ_NEXT(rc);
+    }
+
+    return rc;
+
+}
+
+
+static qdr_auto_link_t *qdr_auto_link_config_find_by_name_CT(qdr_core_t *core, qd_field_iterator_t *name)
+{
+    if (!name)
+        return 0;
+
+    qdr_auto_link_t *rc = DEQ_HEAD(core->auto_links);
+    while (rc) { // Sometimes the name can be null
+        if (rc->name && qd_field_iterator_equal(name, (const unsigned char*) rc->name))
+            break;
+        rc = DEQ_NEXT(rc);
+    }
+
+    return rc;
+}
+
+
+void qdra_config_auto_link_delete_CT(qdr_core_t          *core,
+                                      qdr_query_t         *query,
+                                      qd_field_iterator_t *name,
+                                      qd_field_iterator_t *identity)
+{
+    qdr_auto_link_t *al = 0;
+
+    if (!name && !identity)
+        query->status = QD_AMQP_BAD_REQUEST;
+    else {
+        if (identity)
+            al = qdr_auto_link_config_find_by_identity_CT(core, identity);
+        else if (name)
+            al = qdr_auto_link_config_find_by_name_CT(core, name);
+
+        if (al) {
+            qdr_route_del_auto_link_CT(core, al);
+            query->status = QD_AMQP_NO_CONTENT;
+        } else
+            query->status = QD_AMQP_NOT_FOUND;
+    }
+
+    //
+    // Enqueue the response.
+    //
+    qdr_agent_enqueue_response_CT(core, query);
+}
+
+void qdra_config_auto_link_create_CT(qdr_core_t          *core,
+                                      qd_field_iterator_t *name,
+                                      qdr_query_t         *query,
+                                      qd_parsed_field_t   *in_body)
+{
+    while (true) {
+        //
+        // Ensure there isn't a duplicate name and that the body is a map
+        //
+        qdr_auto_link_t *al = DEQ_HEAD(core->auto_links);
+        while (al) {
+            if (name && al->name && qd_field_iterator_equal(name, (const unsigned char*) al->name))
+                break;
+            al = DEQ_NEXT(al);
+        }
+
+        if (!!al) {
+            query->status = QD_AMQP_BAD_REQUEST;
+            query->status.description = "Name conflicts with an existing entity";
+            break;
+        }
+
+        if (!qd_parse_is_map(in_body)) {
+            query->status = QD_AMQP_BAD_REQUEST;
+            break;
+        }
+
+        //
+        // Extract the fields from the request
+        //
+        qd_parsed_field_t *addr_field       = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_ADDR]);
+        qd_parsed_field_t *dir_field        = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_DIR]);
+        qd_parsed_field_t *phase_field      = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_PHASE]);
+        qd_parsed_field_t *connection_field = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_CONNECTION]);
+        qd_parsed_field_t *container_field  = qd_parse_value_by_key(in_body, qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_CONTAINER_ID]);
+
+        //
+        // Addr and dir fields are mandatory.  Fail if they're not both here.
+        //
+        if (!addr_field || !dir_field) {
+            query->status = QD_AMQP_BAD_REQUEST;
+            break;
+        }
+
+        qd_direction_t dir;
+        const char *error = qdra_auto_link_direction_CT(dir_field, &dir);
+        if (error) {
+            query->status = QD_AMQP_BAD_REQUEST;
+            query->status.description = error;
+            break;
+        }
+
+        //
+        // Use the specified phase if present.  Otherwise default based on the direction:
+        // Phase 0 for outgoing links and phase 1 for incoming links.
+        //
+        int phase = phase_field ? qd_parse_as_int(phase_field) : (dir == QD_OUTGOING ? 0 : 1);
+
+        //
+        // Validate the phase
+        //
+        if (phase < 0 || phase > 9) {
+            query->status = QD_AMQP_BAD_REQUEST;
+            query->status.description = "autoLink phase must be between 0 and 9";
+            break;
+        }
+
+        //
+        // The request is good.  Create the entity.
+        //
+        bool               is_container = !!container_field;
+        qd_parsed_field_t *in_use_conn  = is_container ? container_field : connection_field;
+
+        qdr_route_add_auto_link_CT(core, name, addr_field, dir, phase, in_use_conn, is_container);
+
+        //
+        // Compose the result map for the response.
+        //
+        if (query->body) {
+            qd_compose_start_map(query->body);
+            for (int col = 0; col < QDR_CONFIG_AUTO_LINK_COLUMN_COUNT; col++)
+                qdr_config_auto_link_insert_column_CT(al, col, query->body, true);
+            qd_compose_end_map(query->body);
+        }
+
+        query->status = QD_AMQP_CREATED;
+        break;
+    }
+
+    //
+    // Enqueue the response if there is a body. If there is no body, this is a management
+    // operation created internally by the configuration file parser.
+    //
+    if (query->body) {
+        //
+        // If there was an error in processing the create, insert a NULL value into the body.
+        //
+        if (query->status.status / 100 > 2)
+            qd_compose_insert_null(query->body);
+        qdr_agent_enqueue_response_CT(core, query);
+    } else {
+        if (query->status.status / 100 > 2)
+            qd_log(core->log, QD_LOG_ERROR, "Error configuring linkRoute: %s", query->status.description);
+        free_qdr_query_t(query);
+    }
+}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/agent_config_auto_link.h
----------------------------------------------------------------------
diff --git a/src/router_core/agent_config_auto_link.h b/src/router_core/agent_config_auto_link.h
new file mode 100644
index 0000000..578d402
--- /dev/null
+++ b/src/router_core/agent_config_auto_link.h
@@ -0,0 +1,35 @@
+#ifndef qdr_agent_config_auto_link
+#define qdr_agent_config_auto_link 1
+/*
+ * 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 "router_core_private.h"
+
+void qdra_config_auto_link_get_first_CT(qdr_core_t *core, qdr_query_t *query, int offset);
+void qdra_config_auto_link_get_next_CT(qdr_core_t *core, qdr_query_t *query);
+void qdra_config_auto_link_create_CT(qdr_core_t *core, qd_field_iterator_t *name, qdr_query_t *query, qd_parsed_field_t *in_body);
+void qdra_config_auto_link_update_CT(qdr_core_t *core, qdr_query_t *query, qd_parsed_field_t *in_body);
+void qdra_config_auto_link_delete_CT(qdr_core_t *core, qdr_query_t *query, qd_field_iterator_t *name,
+                                     qd_field_iterator_t *identity);
+
+#define QDR_CONFIG_AUTO_LINK_COLUMN_COUNT 9
+
+const char *qdr_config_auto_link_columns[QDR_CONFIG_AUTO_LINK_COLUMN_COUNT + 1];
+
+#endif

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/agent_config_link_route.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent_config_link_route.c b/src/router_core/agent_config_link_route.c
index 839dab7..bfdc70f 100644
--- a/src/router_core/agent_config_link_route.c
+++ b/src/router_core/agent_config_link_route.c
@@ -67,7 +67,7 @@ static void qdr_config_link_route_insert_column_CT(qdr_link_route_t *lr, int col
     }
 
     case QDR_CONFIG_LINK_ROUTE_TYPE:
-        qd_compose_insert_string(body, "org.apache.qpid.dispatch.config.link_route");
+        qd_compose_insert_string(body, "org.apache.qpid.dispatch.config.linkRoute");
         break;
 
     case QDR_CONFIG_LINK_ROUTE_PREFIX:

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/agent_link.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent_link.c b/src/router_core/agent_link.c
index 33ed2be..b9f23c2 100644
--- a/src/router_core/agent_link.c
+++ b/src/router_core/agent_link.c
@@ -84,7 +84,7 @@ static void qdr_agent_write_column_CT(qd_composed_field_t *body, int col, qdr_li
 
         case QDR_LINK_IDENTITY: {
             char id[100];
-            snprintf(id, 100, "%ld", link->identifier);
+            snprintf(id, 100, "%ld", link->identity);
             qd_compose_insert_string(body, id);
             break;
         }
@@ -120,7 +120,7 @@ static void qdr_agent_write_column_CT(qd_composed_field_t *body, int col, qdr_li
         case QDR_LINK_PEER:
             if (link->connected_link) {
                 char id[100];
-                snprintf(id, 100, "link.%ld", link->connected_link->identifier);
+                snprintf(id, 100, "link.%ld", link->connected_link->identity);
                 qd_compose_insert_string(body, id);
               } else
                 qd_compose_insert_null(body);
@@ -266,8 +266,8 @@ static qdr_link_t *qdr_link_find_by_identity(qdr_core_t *core, qd_field_iterator
 
     while(link) {
         char id[100];
-        if (link->identifier) {
-            snprintf(id, 100, "%ld", link->identifier);
+        if (link->identity) {
+            snprintf(id, 100, "%ld", link->identity);
             if (qd_field_iterator_equal(identity, (const unsigned char *)id))
                 break;
         }

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/connections.c
----------------------------------------------------------------------
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index c0c28d9..45d7920 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -266,7 +266,7 @@ qdr_link_t *qdr_link_first_attach(qdr_connection_t *conn,
 
     ZERO(link);
     link->core = conn->core;
-    link->identifier = qdr_identifier(conn->core);
+    link->identity = qdr_identifier(conn->core);
     link->conn = conn;
     link->name = (char*) malloc(strlen(name) + 1);
     strcpy(link->name, name);
@@ -448,7 +448,7 @@ static qdr_link_t *qdr_create_link_CT(qdr_core_t       *core,
     ZERO(link);
 
     link->core           = core;
-    link->identifier     = qdr_identifier(core);
+    link->identity       = qdr_identifier(core);
     link->user_context   = 0;
     link->conn           = conn;
     link->link_type      = link_type;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/forwarder.c
----------------------------------------------------------------------
diff --git a/src/router_core/forwarder.c b/src/router_core/forwarder.c
index 3bae3fd..4327636 100644
--- a/src/router_core/forwarder.c
+++ b/src/router_core/forwarder.c
@@ -415,7 +415,7 @@ bool qdr_forward_link_balanced_CT(qdr_core_t     *core,
         qdr_link_t *out_link = new_qdr_link_t();
         ZERO(out_link);
         out_link->core           = core;
-        out_link->identifier     = qdr_identifier(core);
+        out_link->identity       = qdr_identifier(core);
         out_link->conn           = conn;
         out_link->link_type      = QD_LINK_ENDPOINT;
         out_link->link_direction = qdr_link_direction(in_link) == QD_OUTGOING ? QD_INCOMING : QD_OUTGOING;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/route_control.c
----------------------------------------------------------------------
diff --git a/src/router_core/route_control.c b/src/router_core/route_control.c
index a421802..88a1e93 100644
--- a/src/router_core/route_control.c
+++ b/src/router_core/route_control.c
@@ -172,16 +172,15 @@ void qdr_route_del_link_route_CT(qdr_core_t *core, qdr_link_route_t *lr)
 void qdr_route_add_auto_link_CT(qdr_core_t             *core,
                                 qd_field_iterator_t    *name,
                                 qd_parsed_field_t      *addr_field,
-                                qd_address_treatment_t  treatment,
                                 qd_direction_t          dir,
-                                qd_parsed_field_t      *phase_field,
-                                qd_parsed_field_t      *container_id_field,
-                                qd_parsed_field_t      *conn_name_field)
+                                int                     phase,
+                                qd_parsed_field_t      *conn_id,
+                                bool                    is_container)
 {
 }
 
 
-void qdr_route_del_auto_link_CT(qdr_core_t *core, qdr_auto_link_t *autolink)
+void qdr_route_del_auto_link_CT(qdr_core_t *core, qdr_auto_link_t *auto_link)
 {
 }
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/route_control.h
----------------------------------------------------------------------
diff --git a/src/router_core/route_control.h b/src/router_core/route_control.h
index f725a3d..7738c6d 100644
--- a/src/router_core/route_control.h
+++ b/src/router_core/route_control.h
@@ -34,13 +34,12 @@ void qdr_route_del_link_route_CT(qdr_core_t *core, qdr_link_route_t *lr);
 void qdr_route_add_auto_link_CT(qdr_core_t             *core,
                                 qd_field_iterator_t    *name,
                                 qd_parsed_field_t      *addr_field,
-                                qd_address_treatment_t  treatment,
                                 qd_direction_t          dir,
-                                qd_parsed_field_t      *phase_field,
-                                qd_parsed_field_t      *container_id_field,
-                                qd_parsed_field_t      *conn_name_field);
+                                int                     phase,
+                                qd_parsed_field_t      *conn_id,
+                                bool                    is_container);
 
-void qdr_route_del_auto_link_CT(qdr_core_t *core, qdr_auto_link_t *autolink);
+void qdr_route_del_auto_link_CT(qdr_core_t *core, qdr_auto_link_t *auto_link);
 
 void qdr_route_connection_opened_CT(qdr_core_t       *core,
                                     qdr_connection_t *conn,

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/2aa0e26a/src/router_core/router_core_private.h
----------------------------------------------------------------------
diff --git a/src/router_core/router_core_private.h b/src/router_core/router_core_private.h
index c252063..28e4aef 100644
--- a/src/router_core/router_core_private.h
+++ b/src/router_core/router_core_private.h
@@ -218,7 +218,7 @@ void qdr_del_delivery_ref(qdr_delivery_ref_list_t *list, qdr_delivery_ref_t *ref
 struct qdr_link_t {
     DEQ_LINKS(qdr_link_t);
     qdr_core_t              *core;
-    uint64_t                 identifier;
+    uint64_t                 identity;
     void                    *user_context;
     qdr_connection_t        *conn;               ///< [ref] Connection that owns this link
     qd_link_type_t           link_type;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org