HACK ctdb/ib
[metze/samba/wip.git] / ctdb / ib / ibw_ctdb.c
index 35d0514b6821d95610bbcf43068266a48d65e767..496a9f6ddf1726f2bc4db3d2ffc7b2e05bb63418 100644 (file)
 #include "lib/util/time.h"
 #include "lib/util/debug.h"
 
-#include "ctdb_logging.h"
 #include "ctdb_private.h"
 
+#include "common/common.h"
+#include "common/logging.h"
+
 #include "ibwrapper.h"
 #include "ibw_ctdb.h"
+#include "lib/util/dlinklist.h"
 
 int ctdb_ibw_get_address(struct ctdb_context *ctdb,
        const char *address, struct in_addr *addr)
@@ -42,7 +45,7 @@ int ctdb_ibw_get_address(struct ctdb_context *ctdb,
        if (inet_pton(AF_INET, address, addr) <= 0) {
                struct hostent *he = gethostbyname(address);
                if (he == NULL || he->h_length > sizeof(*addr)) {
-                       ctdb_set_error(ctdb, "invalid nework address '%s'\n", 
+                       ctdb_set_error(ctdb, "invalid network address '%s'\n", 
                                       address);
                        return -1;
                }
@@ -53,7 +56,8 @@ int ctdb_ibw_get_address(struct ctdb_context *ctdb,
 
 int ctdb_ibw_node_connect(struct ctdb_node *node)
 {
-       struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+       struct ctdb_ibw_node *cn = talloc_get_type(node->transport_data,
+                                                  struct ctdb_ibw_node);
        int     rc;
 
        assert(cn!=NULL);
@@ -116,7 +120,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
                case IBWC_CONNECTED: { /* after ibw_accept or ibw_connect */
                        struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
                        if (node!=NULL) { /* after ibw_connect */
-                               struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+                               struct ctdb_ibw_node *cn = talloc_get_type(
+                                       node->transport_data,
+                                       struct ctdb_ibw_node);
 
                                node->ctdb->upcalls->node_connected(node);
                                ctdb_flush_cn_queue(cn);
@@ -134,7 +140,9 @@ int ctdb_ibw_connstate_handler(struct ibw_ctx *ctx, struct ibw_conn *conn)
                case IBWC_ERROR: {
                        struct ctdb_node *node = talloc_get_type(conn->conn_userdata, struct ctdb_node);
                        if (node!=NULL) {
-                               struct ctdb_ibw_node *cn = talloc_get_type(node->private_data, struct ctdb_ibw_node);
+                               struct ctdb_ibw_node *cn = talloc_get_type(
+                                       node->transport_data,
+                                       struct ctdb_ibw_node);
                                struct ibw_ctx *ictx = cn->conn->ctx;
 
                                DEBUG(DEBUG_DEBUG, ("IBWC_ERROR, reconnecting...\n"));