qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject [1/2] qpid-dispatch git commit: DISPATCH-179 - Wired the new core handlers into pyrouter. Verified basic operation.
Date Fri, 23 Oct 2015 16:12:31 GMT
Repository: qpid-dispatch
Updated Branches:
  refs/heads/tross-DISPATCH-179-1 2552cacf2 -> 995e5ad4c


DISPATCH-179 - Wired the new core handlers into pyrouter.  Verified basic operation.


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

Branch: refs/heads/tross-DISPATCH-179-1
Commit: 98e9682db09c5c8d7443f07317204c17862c3f3c
Parents: 2552cac
Author: Ted Ross <tross@redhat.com>
Authored: Thu Oct 22 15:28:53 2015 -0400
Committer: Ted Ross <tross@redhat.com>
Committed: Thu Oct 22 15:28:53 2015 -0400

----------------------------------------------------------------------
 include/qpid/dispatch.h               |  1 +
 src/router_core/route_tables.c        |  2 ++
 src/router_core/router_core_private.h |  1 +
 src/router_core/router_core_thread.c  |  4 +++-
 src/router_pynode.c                   | 12 ++++++++++++
 5 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/98e9682d/include/qpid/dispatch.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch.h b/include/qpid/dispatch.h
index 68f4dd5..156f831 100644
--- a/include/qpid/dispatch.h
+++ b/include/qpid/dispatch.h
@@ -47,6 +47,7 @@
 #include <qpid/dispatch/iterator.h>
 #include <qpid/dispatch/log.h>
 #include <qpid/dispatch/router.h>
+#include <qpid/dispatch/router_core.h>
 #include <qpid/dispatch/amqp.h>
 #include <qpid/dispatch/parse.h>
 #include <qpid/dispatch/compose.h>

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/98e9682d/src/router_core/route_tables.c
----------------------------------------------------------------------
diff --git a/src/router_core/route_tables.c b/src/router_core/route_tables.c
index e1095fb..5560dc1 100644
--- a/src/router_core/route_tables.c
+++ b/src/router_core/route_tables.c
@@ -18,6 +18,7 @@
  */
 
 #include "router_core_private.h"
+#include <stdio.h>
 
 static qdr_action_t *qdr_action(qdr_action_handler_t action_handler);
 static void qdr_action_enqueue(qdr_core_t *core, qdr_action_t *action);
@@ -150,6 +151,7 @@ static void qdr_action_enqueue(qdr_core_t *core, qdr_action_t *action)
 {
     sys_mutex_lock(core->lock);
     DEQ_INSERT_TAIL(core->action_list, action);
+    sys_cond_signal(core->cond);
     sys_mutex_unlock(core->lock);
 }
 

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/98e9682d/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 0837f58..e186092 100644
--- a/src/router_core/router_core_private.h
+++ b/src/router_core/router_core_private.h
@@ -209,5 +209,6 @@ struct qdr_core_t {
 };
 
 void *router_core_thread(void *arg);
+void  qdr_route_table_setup(qdr_core_t *core);
 
 #endif

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/98e9682d/src/router_core/router_core_thread.c
----------------------------------------------------------------------
diff --git a/src/router_core/router_core_thread.c b/src/router_core/router_core_thread.c
index 87f8c02..07c7ab2 100644
--- a/src/router_core/router_core_thread.c
+++ b/src/router_core/router_core_thread.c
@@ -32,10 +32,12 @@ ALLOC_DEFINE(qdr_action_t);
 
 void *router_core_thread(void *arg)
 {
-    qdr_core_t      *core = (qdr_core_t*) arg;
+    qdr_core_t        *core = (qdr_core_t*) arg;
     qdr_action_list_t  action_list;
     qdr_action_t      *action;
 
+    qdr_route_table_setup(core);
+
     qd_log(core->log, QD_LOG_INFO, "Router Core thread running");
     while (core->running) {
         //

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/98e9682d/src/router_pynode.c
----------------------------------------------------------------------
diff --git a/src/router_pynode.c b/src/router_pynode.c
index 2003779..361064a 100644
--- a/src/router_pynode.c
+++ b/src/router_pynode.c
@@ -54,6 +54,8 @@ static PyObject *qd_add_router(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "si", &address, &router_maskbit))
         return 0;
 
+    qdr_core_add_router(router->router_core, address, router_maskbit);
+
     do {
         if (router_maskbit >= qd_bitmask_width() || router_maskbit < 0) {
             error = "Router bit mask out of range";
@@ -140,6 +142,8 @@ static PyObject* qd_del_router(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "i", &router_maskbit))
         return 0;
 
+    qdr_core_del_router(router->router_core, router_maskbit);
+
     do {
         if (router_maskbit >= qd_bitmask_width() || router_maskbit < 0) {
             error = "Router bit mask out of range";
@@ -212,6 +216,8 @@ static PyObject* qd_set_link(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "ii", &router_maskbit, &link_maskbit))
         return 0;
 
+    qdr_core_set_link(router->router_core, router_maskbit, link_maskbit);
+
     do {
         if (link_maskbit >= qd_bitmask_width() || link_maskbit < 0) {
             error = "Link bit mask out of range";
@@ -254,6 +260,8 @@ static PyObject* qd_remove_link(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "i", &router_maskbit))
         return 0;
 
+    qdr_core_remove_link(router->router_core, router_maskbit);
+
     do {
         sys_mutex_lock(router->lock);
         qd_router_node_t *rnode = router->routers_by_mask_bit[router_maskbit];
@@ -282,6 +290,8 @@ static PyObject* qd_set_next_hop(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "ii", &router_maskbit, &next_hop_maskbit))
         return 0;
 
+    qdr_core_set_next_hop(router->router_core, router_maskbit, next_hop_maskbit);
+
     do {
         if (router_maskbit >= qd_bitmask_width() || router_maskbit < 0) {
             error = "Router bit mask out of range";
@@ -333,6 +343,8 @@ static PyObject* qd_remove_next_hop(PyObject *self, PyObject *args)
     if (!PyArg_ParseTuple(args, "i", &router_maskbit))
         return 0;
 
+    qdr_core_remove_next_hop(router->router_core, router_maskbit);
+
     do {
         if (router_maskbit >= qd_bitmask_width() || router_maskbit < 0) {
             error = "Router bit mask out of range";


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


Mime
View raw message