HACK ctdb/ib
[metze/samba/wip.git] / ctdb / ib / ibw_ctdb.c
index 96b126c4eaa3a07355ff8f6fc14be87c20fdafae..496a9f6ddf1726f2bc4db3d2ffc7b2e05bb63418 100644 (file)
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "includes.h"
-#include <system/network.h>
+#include "replace.h"
+#include "system/network.h"
+
 #include <assert.h>
+#include <talloc.h>
+#include <tevent.h>
+
+#include "lib/util/time.h"
+#include "lib/util/debug.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)
@@ -33,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;
                }
@@ -44,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);
@@ -107,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);
@@ -125,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"));