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 2020/08/04 18:57:49 UTC

[qpid-dispatch] 03/32: Dataplane: Exposed the protocol name with the connection entity.

This is an automated email from the ASF dual-hosted git repository.

tross pushed a commit to branch dev-protocol-adaptors
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git

commit f4a41568eb8eaa5a4498b779967e89db81fc4a9c
Author: Ted Ross <tr...@apache.org>
AuthorDate: Mon Jun 1 18:31:32 2020 -0400

    Dataplane: Exposed the protocol name with the connection entity.
---
 python/qpid_dispatch/management/qdrouter.json |  4 +++
 src/router_core/agent_connection.c            | 46 +++++++++++++++------------
 src/router_core/agent_connection.h            |  2 +-
 tools/qdstat.in                               |  4 ++-
 4 files changed, 34 insertions(+), 22 deletions(-)

diff --git a/python/qpid_dispatch/management/qdrouter.json b/python/qpid_dispatch/management/qdrouter.json
index 616cf64..4dee14a 100644
--- a/python/qpid_dispatch/management/qdrouter.json
+++ b/python/qpid_dispatch/management/qdrouter.json
@@ -1742,6 +1742,10 @@
                 "operStatus": {
                     "type": ["up", "closing"]
                 },
+                "protocol": {
+                    "type": "string",
+                    "description": "The protocol adaptor that is handling this connection"
+                },
                 "container": {
                     "description": "The container for this connection",
                     "type": "string"
diff --git a/src/router_core/agent_connection.c b/src/router_core/agent_connection.c
index 93faec6..f1fef54 100644
--- a/src/router_core/agent_connection.c
+++ b/src/router_core/agent_connection.c
@@ -26,26 +26,27 @@
 #define QDR_CONNECTION_IDENTITY               1
 #define QDR_CONNECTION_HOST                   2
 #define QDR_CONNECTION_ROLE                   3
-#define QDR_CONNECTION_DIR                    4
-#define QDR_CONNECTION_CONTAINER_ID           5
-#define QDR_CONNECTION_SASL_MECHANISMS        6
-#define QDR_CONNECTION_IS_AUTHENTICATED       7
-#define QDR_CONNECTION_USER                   8
-#define QDR_CONNECTION_IS_ENCRYPTED           9
-#define QDR_CONNECTION_SSLPROTO              10
-#define QDR_CONNECTION_SSLCIPHER             11
-#define QDR_CONNECTION_PROPERTIES            12
-#define QDR_CONNECTION_SSLSSF                13
-#define QDR_CONNECTION_TENANT                14
-#define QDR_CONNECTION_TYPE                  15
-#define QDR_CONNECTION_SSL                   16
-#define QDR_CONNECTION_OPENED                17
-#define QDR_CONNECTION_ACTIVE                18
-#define QDR_CONNECTION_ADMIN_STATUS          19
-#define QDR_CONNECTION_OPER_STATUS           20
-#define QDR_CONNECTION_UPTIME_SECONDS        21
-#define QDR_CONNECTION_LAST_DLV_SECONDS      22
-#define QDR_CONNECTION_ENABLE_PROTOCOL_TRACE 23
+#define QDR_CONNECTION_PROTOCOL               4
+#define QDR_CONNECTION_DIR                    5
+#define QDR_CONNECTION_CONTAINER_ID           6
+#define QDR_CONNECTION_SASL_MECHANISMS        7
+#define QDR_CONNECTION_IS_AUTHENTICATED       8
+#define QDR_CONNECTION_USER                   9
+#define QDR_CONNECTION_IS_ENCRYPTED          10
+#define QDR_CONNECTION_SSLPROTO              11
+#define QDR_CONNECTION_SSLCIPHER             12
+#define QDR_CONNECTION_PROPERTIES            13
+#define QDR_CONNECTION_SSLSSF                14
+#define QDR_CONNECTION_TENANT                15
+#define QDR_CONNECTION_TYPE                  16
+#define QDR_CONNECTION_SSL                   17
+#define QDR_CONNECTION_OPENED                18
+#define QDR_CONNECTION_ACTIVE                19
+#define QDR_CONNECTION_ADMIN_STATUS          20
+#define QDR_CONNECTION_OPER_STATUS           21
+#define QDR_CONNECTION_UPTIME_SECONDS        22
+#define QDR_CONNECTION_LAST_DLV_SECONDS      23
+#define QDR_CONNECTION_ENABLE_PROTOCOL_TRACE 24
 
 
 const char * const QDR_CONNECTION_DIR_IN  = "in";
@@ -70,6 +71,7 @@ const char *qdr_connection_columns[] =
      "identity",
      "host",
      "role",
+     "protocol",
      "dir",
      "container",
      "sasl",
@@ -147,6 +149,10 @@ static void qdr_connection_insert_column_CT(qdr_core_t *core, qdr_connection_t *
         qd_compose_insert_string(body, qdr_connection_roles[conn->connection_info->role]);
         break;
 
+    case QDR_CONNECTION_PROTOCOL:
+        qd_compose_insert_string(body, conn->protocol_adaptor->name);
+        break;
+
     case QDR_CONNECTION_DIR:
         if (conn->connection_info->dir == QD_INCOMING)
             qd_compose_insert_string(body, QDR_CONNECTION_DIR_IN);
diff --git a/src/router_core/agent_connection.h b/src/router_core/agent_connection.h
index f9ce002..dc57dc5 100644
--- a/src/router_core/agent_connection.h
+++ b/src/router_core/agent_connection.h
@@ -35,7 +35,7 @@ void qdra_connection_update_CT(qdr_core_t      *core,
                              qdr_query_t       *query,
                              qd_parsed_field_t *in_body);
 
-#define QDR_CONNECTION_COLUMN_COUNT 24
+#define QDR_CONNECTION_COLUMN_COUNT 25
 extern const char *qdr_connection_columns[QDR_CONNECTION_COLUMN_COUNT + 1];
 
 #endif
diff --git a/tools/qdstat.in b/tools/qdstat.in
index 5b423c4..13be1d0 100755
--- a/tools/qdstat.in
+++ b/tools/qdstat.in
@@ -192,6 +192,7 @@ class BusManager(Node):
         heads.append(Header("host"))
         heads.append(Header("container"))
         heads.append(Header("role"))
+        heads.append(Header("proto"))
         heads.append(Header("dir"))
         heads.append(Header("security"))
         heads.append(Header("authentication"))
@@ -230,7 +231,8 @@ class BusManager(Node):
             row.append(conn.identity)
             row.append(conn.host)
             row.append(conn.container)
-            row.append(conn.role)
+            row.append(get(conn, 'role'))
+            row.append(conn.protocol)
             row.append(conn.dir)
             row.append(self.connSecurity(conn))
             row.append(self.connAuth(conn))


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