r20646: first preparations for cluster enablement. This changes "
authorAndrew Tridgell <tridge@samba.org>
Wed, 10 Jan 2007 10:52:09 +0000 (10:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:37:23 +0000 (14:37 -0500)
  uint32_t server_id
to
  struct server_id server_id;

which allows a server ID to have an node number. The node number will
be zero in non-clustered case. This is the most basic hook needed for
clustering, and ctdb.
(This used to be commit 2365abaa991d57d68c6ebe9be608e01c907102eb)

31 files changed:
source4/auth/auth_winbind.c
source4/lib/messaging/config.mk
source4/lib/messaging/irpc.h
source4/lib/messaging/messaging.c
source4/libcli/finddcs.c
source4/librpc/idl/misc.idl
source4/librpc/idl/notify.idl
source4/librpc/idl/opendb.idl
source4/main.mk
source4/ntvfs/common/brlock.c
source4/ntvfs/common/notify.c
source4/ntvfs/common/opendb.c
source4/ntvfs/ntvfs.h
source4/ntvfs/ntvfs_base.c
source4/ntvfs/posix/pvfs_wait.c
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
source4/scripting/ejs/smbcalls_rpc.c
source4/smb_server/smb/negprot.c
source4/smbd/process_model.h
source4/smbd/process_single.c
source4/smbd/process_standard.c
source4/smbd/service_stream.c
source4/smbd/service_stream.h
source4/smbd/service_task.c
source4/smbd/service_task.h
source4/torture/local/irpc.c
source4/torture/local/messaging.c
source4/winbind/wb_dom_info.c
source4/wrepl_server/wrepl_apply_records.c
source4/wrepl_server/wrepl_scavenging.c

index 209f8dc858a277b737ddd442a1b33008de4f1d63..0f31caa04768d37484c14cd250ec7e9b58d2b976 100644 (file)
@@ -157,13 +157,13 @@ static NTSTATUS winbind_check_password(struct auth_method_context *ctx,
                                       struct auth_serversupplied_info **server_info)
 {
        NTSTATUS status;
-       uint32_t *winbind_servers;
+       struct server_id *winbind_servers;
        struct winbind_check_password_state *s;
        const struct auth_usersupplied_info *user_info_new;
        struct netr_IdentityInfo *identity_info;
 
        winbind_servers = irpc_servers_byname(ctx->auth_ctx->msg_ctx, "winbind_server");
-       if ((winbind_servers == NULL) || (winbind_servers[0] == 0)) {
+       if ((winbind_servers == NULL) || (winbind_servers[0].id == 0)) {
                DEBUG(0, ("Winbind authentication for [%s]\\[%s] failed, " 
                          "no winbind_server running!\n",
                          user_info->client.domain_name, user_info->client.account_name));
index c4c3e6b2f8dc2e7e53bb24344d8d79607dd01476..85a57917032a8f36e154585b6c95429b454d3fe1 100644 (file)
@@ -9,6 +9,7 @@ PUBLIC_DEPENDENCIES = \
                DB_WRAP \
                NDR_IRPC \
                UNIX_PRIVS \
-               UTIL_TDB 
+               UTIL_TDB \
+               CLUSTER
 # End SUBSYSTEM MESSAGING
 ################################################
index 4e775bfe069acb81f9871d8c6203ace6320ca0ad..1d704ad943f63249f6a9fa768b3770c8a4fedf20 100644 (file)
@@ -26,7 +26,7 @@
   an incoming irpc message
 */
 struct irpc_message {
-       uint32_t from;
+       struct server_id from;
        void *private;
        struct irpc_header header;
        struct ndr_pull *ndr;
@@ -77,22 +77,25 @@ struct irpc_request {
 };
 
 typedef void (*msg_callback_t)(struct messaging_context *msg, void *private, 
-                              uint32_t msg_type, uint32_t server_id, DATA_BLOB *data);
+                              uint32_t msg_type, 
+                              struct server_id server_id, DATA_BLOB *data);
 
-struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, 
+struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 
+                                        struct server_id server_id, 
                                         struct event_context *ev);
-NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server, 
+NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server, 
                        uint32_t msg_type, DATA_BLOB *data);
 NTSTATUS messaging_register(struct messaging_context *msg, void *private,
                            uint32_t msg_type, 
                            msg_callback_t fn);
 NTSTATUS messaging_register_tmp(struct messaging_context *msg, void *private,
                                msg_callback_t fn, uint32_t *msg_type);
-struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, 
+struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 
+                                        struct server_id server_id, 
                                         struct event_context *ev);
 struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, 
                                         struct event_context *ev);
-NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server, 
+NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, 
                            uint32_t msg_type, void *ptr);
 void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void *private);
 
@@ -103,17 +106,17 @@ NTSTATUS irpc_register(struct messaging_context *msg_ctx,
                       const struct dcerpc_interface_table *table, 
                       int call, irpc_function_t fn, void *private);
 struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, 
-                                   uint32_t server_id, 
+                                   struct server_id server_id, 
                                    const struct dcerpc_interface_table *table, 
                                    int callnum, void *r, TALLOC_CTX *ctx);
 NTSTATUS irpc_call_recv(struct irpc_request *irpc);
 NTSTATUS irpc_call(struct messaging_context *msg_ctx, 
-                  uint32_t server_id, 
+                  struct server_id server_id, 
                   const struct dcerpc_interface_table *table, 
                   int callnum, void *r, TALLOC_CTX *ctx);
 
 NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name);
-uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name);
+struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name);
 void irpc_remove_name(struct messaging_context *msg_ctx, const char *name);
 NTSTATUS irpc_send_reply(struct irpc_message *m, NTSTATUS status);
 
index 09e04fda9be016642c396d0bbd2942a83da0fe55..691db2b9614eeb3e0c28a1fece650705cc47a09a 100644 (file)
 #include "librpc/rpc/dcerpc.h"
 #include "lib/tdb/include/tdb.h"
 #include "lib/util/util_tdb.h"
+#include "lib/util/util_tdb.h"
+#include "cluster/cluster.h"
 
 /* change the message version with any incompatible changes in the protocol */
 #define MESSAGING_VERSION 1
 
 struct messaging_context {
-       uint32_t server_id;
+       struct server_id server_id;
        struct socket_context *sock;
        const char *base_path;
        const char *path;
@@ -75,8 +77,8 @@ struct messaging_rec {
        struct messaging_header {
                uint32_t version;
                uint32_t msg_type;
-               uint32_t from;
-               uint32_t to;
+               struct server_id from;
+               struct server_id to;
                uint32_t length;
        } *header;
 
@@ -85,17 +87,17 @@ struct messaging_rec {
 
 
 static void irpc_handler(struct messaging_context *, void *, 
-                        uint32_t, uint32_t, DATA_BLOB *);
+                        uint32_t, struct server_id, DATA_BLOB *);
 
 
 /*
  A useful function for testing the message system.
 */
 static void ping_message(struct messaging_context *msg, void *private, 
-                        uint32_t msg_type, uint32_t src, DATA_BLOB *data)
+                        uint32_t msg_type, struct server_id src, DATA_BLOB *data)
 {
-       DEBUG(1,("INFO: Received PING message from server %u [%.*s]\n",
-                (uint_t)src, (int)data->length, 
+       DEBUG(1,("INFO: Received PING message from server %u.%u [%.*s]\n",
+                (uint_t)src.node, (uint_t)src.id, (int)data->length, 
                 data->data?(const char *)data->data:""));
        messaging_send(msg, src, MSG_PONG, data);
 }
@@ -114,9 +116,10 @@ static NTSTATUS irpc_uptime(struct irpc_message *msg,
 /* 
    return the path to a messaging socket
 */
-static char *messaging_path(struct messaging_context *msg, uint32_t server_id)
+static char *messaging_path(struct messaging_context *msg, struct server_id server_id)
 {
-       return talloc_asprintf(msg, "%s/msg.%u", msg->base_path, (unsigned)server_id);
+       return talloc_asprintf(msg, "%s/msg.%u.%u", msg->base_path, 
+                              (unsigned)server_id.node, (unsigned)server_id.id);
 }
 
 /*
@@ -192,7 +195,7 @@ static void messaging_send_handler(struct messaging_context *msg)
                }
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(1,("messaging: Lost message from %u to %u of type %u - %s\n", 
-                                rec->header->from, rec->header->to, rec->header->msg_type, 
+                                rec->header->from.id, rec->header->to.id, rec->header->msg_type, 
                                 nt_errstr(status)));
                }
                DLIST_REMOVE(msg->pending, rec);
@@ -365,7 +368,7 @@ void messaging_deregister(struct messaging_context *msg, uint32_t msg_type, void
 /*
   Send a message to a particular server
 */
-NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server, 
+NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server, 
                        uint32_t msg_type, DATA_BLOB *data)
 {
        struct messaging_rec *rec;
@@ -420,7 +423,7 @@ NTSTATUS messaging_send(struct messaging_context *msg, uint32_t server,
 /*
   Send a message to a particular server, with the message containing a single pointer
 */
-NTSTATUS messaging_send_ptr(struct messaging_context *msg, uint32_t server, 
+NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, 
                            uint32_t msg_type, void *ptr)
 {
        DATA_BLOB blob;
@@ -447,7 +450,8 @@ static int messaging_destructor(struct messaging_context *msg)
 /*
   create the listening socket and setup the dispatcher
 */
-struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id, 
+struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, 
+                                        struct server_id server_id, 
                                         struct event_context *ev)
 {
        struct messaging_context *msg;
@@ -522,7 +526,10 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, uint32_t server_id
 struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, 
                                                struct event_context *ev)
 {
-       return messaging_init(mem_ctx, random() % 0x10000000, ev);
+       struct server_id id;
+       ZERO_STRUCT(id);
+       id.id = random() % 0x10000000;
+       return messaging_init(mem_ctx, id, ev);
 }
 /*
   a list of registered irpc server functions
@@ -687,7 +694,7 @@ failed:
   handle an incoming irpc message
 */
 static void irpc_handler(struct messaging_context *msg_ctx, void *private, 
-                        uint32_t msg_type, uint32_t src, DATA_BLOB *packet)
+                        uint32_t msg_type, struct server_id src, DATA_BLOB *packet)
 {
        struct irpc_message *m;
        NTSTATUS status;
@@ -745,7 +752,7 @@ static void irpc_timeout(struct event_context *ev, struct timed_event *te,
   make a irpc call - async send
 */
 struct irpc_request *irpc_call_send(struct messaging_context *msg_ctx, 
-                                   uint32_t server_id, 
+                                   struct server_id server_id, 
                                    const struct dcerpc_interface_table *table, 
                                    int callnum, void *r, TALLOC_CTX *ctx)
 {
@@ -829,7 +836,7 @@ NTSTATUS irpc_call_recv(struct irpc_request *irpc)
   perform a synchronous irpc request
 */
 NTSTATUS irpc_call(struct messaging_context *msg_ctx, 
-                  uint32_t server_id, 
+                  struct server_id server_id, 
                   const struct dcerpc_interface_table *table, 
                   int callnum, void *r,
                   TALLOC_CTX *mem_ctx)
@@ -873,15 +880,15 @@ NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name)
                return NT_STATUS_LOCK_NOT_GRANTED;
        }
        rec = tdb_fetch_bystring(t->tdb, name);
-       count = rec.dsize / sizeof(uint32_t);
-       rec.dptr = (unsigned char *)realloc_p(rec.dptr, uint32_t, count+1);
-       rec.dsize += sizeof(uint32_t);
+       count = rec.dsize / sizeof(struct server_id);
+       rec.dptr = (unsigned char *)realloc_p(rec.dptr, struct server_id, count+1);
+       rec.dsize += sizeof(struct server_id);
        if (rec.dptr == NULL) {
                tdb_unlock_bystring(t->tdb, name);
                talloc_free(t);
                return NT_STATUS_NO_MEMORY;
        }
-       ((uint32_t *)rec.dptr)[count] = msg_ctx->server_id;
+       ((struct server_id *)rec.dptr)[count] = msg_ctx->server_id;
        if (tdb_store_bystring(t->tdb, name, rec, 0) != 0) {
                status = NT_STATUS_INTERNAL_ERROR;
        }
@@ -898,12 +905,13 @@ NTSTATUS irpc_add_name(struct messaging_context *msg_ctx, const char *name)
 /*
   return a list of server ids for a server name
 */
-uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *name)
+struct server_id *irpc_servers_byname(struct messaging_context *msg_ctx, 
+                                     const char *name)
 {
        struct tdb_wrap *t;
        TDB_DATA rec;
        int count, i;
-       uint32_t *ret;
+       struct server_id *ret;
 
        t = irpc_namedb_open(msg_ctx);
        if (t == NULL) {
@@ -920,17 +928,17 @@ uint32_t *irpc_servers_byname(struct messaging_context *msg_ctx, const char *nam
                talloc_free(t);
                return NULL;
        }
-       count = rec.dsize / sizeof(uint32_t);
-       ret = talloc_array(msg_ctx, uint32_t, count+1);
+       count = rec.dsize / sizeof(struct server_id);
+       ret = talloc_array(msg_ctx, struct server_id, count+1);
        if (ret == NULL) {
                tdb_unlock_bystring(t->tdb, name);
                talloc_free(t);
                return NULL;
        }
        for (i=0;i<count;i++) {
-               ret[i] = ((uint32_t *)rec.dptr)[i];
+               ret[i] = ((struct server_id *)rec.dptr)[i];
        }
-       ret[i] = 0;
+       ret[i] = cluster_id(0);
        free(rec.dptr);
        tdb_unlock_bystring(t->tdb, name);
        talloc_free(t);
@@ -946,7 +954,7 @@ void irpc_remove_name(struct messaging_context *msg_ctx, const char *name)
        struct tdb_wrap *t;
        TDB_DATA rec;
        int count, i;
-       uint32_t *ids;
+       struct server_id *ids;
 
        str_list_remove(msg_ctx->names, name);
 
@@ -960,19 +968,20 @@ void irpc_remove_name(struct messaging_context *msg_ctx, const char *name)
                return;
        }
        rec = tdb_fetch_bystring(t->tdb, name);
-       count = rec.dsize / sizeof(uint32_t);
+       count = rec.dsize / sizeof(struct server_id);
        if (count == 0) {
                tdb_unlock_bystring(t->tdb, name);
                talloc_free(t);
                return;
        }
-       ids = (uint32_t *)rec.dptr;
+       ids = (struct server_id *)rec.dptr;
        for (i=0;i<count;i++) {
-               if (ids[i] == msg_ctx->server_id) {
+               if (cluster_id_equal(&ids[i], &msg_ctx->server_id)) {
                        if (i < count-1) {
-                               memmove(ids+i, ids+i+1, count-(i+1));
+                               memmove(ids+i, ids+i+1, 
+                                       sizeof(struct server_id) * (count-(i+1)));
                        }
-                       rec.dsize -= sizeof(uint32_t);
+                       rec.dsize -= sizeof(struct server_id);
                        break;
                }
        }
index 417b33f2778b1c6362709ac5fbfb6442c9052d31..d8acf44ba0a2cb9643bb97462c2e91c2a60cc6aa 100644 (file)
@@ -112,7 +112,7 @@ static void finddcs_name_resolved(struct composite_context *ctx)
        struct finddcs_state *state =
                talloc_get_type(ctx->async.private_data, struct finddcs_state);
        struct irpc_request *ireq;
-       uint32_t *nbt_servers;
+       struct server_id *nbt_servers;
        const char *address;
 
        state->ctx->status = resolve_name_recv(ctx, state, &address);
@@ -134,7 +134,7 @@ static void finddcs_name_resolved(struct composite_context *ctx)
        }
 
        nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server");
-       if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) {
+       if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) {
                fallback_node_status(state);
                return;
        }
index 9d43a806b7f0ef16588728c25e410ed0b6550b8f..2b099a61645164e18b2209471b95d60a00c32c61 100644 (file)
@@ -44,5 +44,9 @@ interface misc
                SAMR_REJECT_COMPLEXITY = 5
        } samr_RejectReason;
 
-
+       /* id used to identify a endpoint, possibly in a cluster */
+       typedef [public] struct {
+               uint32 id;
+               uint32 node;
+       } server_id;
 }
index cf544f3a68e49c12bc416945fd818df4e325b01c..eecdd86d59942c0df98b6932fb66b1410c8d63b1 100644 (file)
@@ -15,7 +15,7 @@ interface notify
 
        /* structure used in the notify database */
        typedef [public] struct {
-               uint32 server;
+               server_id server;
                uint32 filter; /* filter to apply in this directory */
                uint32 subdir_filter; /* filter to apply in child directories */
                utf8string path;
index 8d1c30761c0a392da6b43879653aabb92056aac3..eaa626e89dee44a2efb8b4d2466d1839864c8f47 100644 (file)
@@ -7,13 +7,15 @@
    ntvfs/common/opendb.c
 */
 
+import "misc.idl";
+
 [
   pointer_default(unique)
 ]
 interface opendb
 {
        typedef struct {
-               uint32 server;
+               server_id server;
                uint32 stream_id;
                uint32 share_access;
                uint32 access_mask;
@@ -25,7 +27,7 @@ interface opendb
        } opendb_entry;
 
        typedef struct {
-               uint32 server;
+               server_id server;
                pointer notify_ptr;
        } opendb_pending;
 
index ba8b5b8c6af388961cf19d50b39a044013640ec6..d685a0a0fca252d4c15f578bebf6f53a7d87223e 100644 (file)
@@ -7,6 +7,7 @@ include config.mk
 include dsdb/config.mk
 include gtk/config.mk
 include smbd/config.mk
+include cluster/config.mk
 include smbd/process_model.mk
 include libnet/config.mk
 include auth/config.mk
index 2816c563b8e5f9ecff2e231be4b633f4202d1e0e..d7fb97415f587b6e54e149378aa9eb526ca2164e 100644 (file)
@@ -47,7 +47,7 @@ struct brl_context;
   lock is the same as another lock
 */
 struct lock_context {
-       uint32_t server;
+       struct server_id server;
        uint16_t smbpid;
        struct brl_context *ctx;
 };
@@ -74,7 +74,7 @@ struct brl_handle {
 /* this struct is typicaly attached to tcon */
 struct brl_context {
        struct tdb_wrap *w;
-       uint32_t server;
+       struct server_id server;
        struct messaging_context *messaging_ctx;
 };
 
@@ -83,7 +83,7 @@ struct brl_context {
   talloc_free(). We need the messaging_ctx to allow for
   pending lock notifications.
 */
-struct brl_context *brl_init(TALLOC_CTX *mem_ctx, uint32_t server, 
+struct brl_context *brl_init(TALLOC_CTX *mem_ctx, struct server_id server, 
                             struct messaging_context *messaging_ctx)
 {
        char *path;
@@ -130,7 +130,7 @@ struct brl_handle *brl_create_handle(TALLOC_CTX *mem_ctx, struct ntvfs_handle *n
 */
 static BOOL brl_same_context(struct lock_context *ctx1, struct lock_context *ctx2)
 {
-       return (ctx1->server == ctx2->server &&
+       return (cluster_id_equal(&ctx1->server, &ctx2->server) &&
                ctx1->smbpid == ctx2->smbpid &&
                ctx1->ctx == ctx2->ctx);
 }
@@ -249,7 +249,7 @@ static NTSTATUS brl_lock_failed(struct brl_handle *brlh, struct lock_struct *loc
         * if the current lock matches the last failed lock on the file handle
         * and starts at the same offset, then FILE_LOCK_CONFLICT should be returned
         */
-       if (lock->context.server == brlh->last_lock.context.server &&
+       if (cluster_id_equal(&lock->context.server, &brlh->last_lock.context.server) &&
            lock->context.ctx == brlh->last_lock.context.ctx &&
            lock->ntvfs == brlh->last_lock.ntvfs &&
            lock->start == brlh->last_lock.start) {
@@ -535,7 +535,7 @@ NTSTATUS brl_remove_pending(struct brl_context *brl,
                
                if (lock->lock_type >= PENDING_READ_LOCK &&
                    lock->notify_ptr == notify_ptr &&
-                   lock->context.server == brl->server) {
+                   cluster_id_equal(&lock->context.server, &brl->server)) {
                        /* found it - delete it */
                        if (count == 1) {
                                if (tdb_delete(brl->w->tdb, kbuf) != 0) {
@@ -648,7 +648,7 @@ NTSTATUS brl_close(struct brl_context *brl,
                struct lock_struct *lock = &locks[i];
 
                if (lock->context.ctx == brl &&
-                   lock->context.server == brl->server &&
+                   cluster_id_equal(&lock->context.server, &brl->server) &&
                    lock->ntvfs == brlh->ntvfs) {
                        /* found it - delete it */
                        if (count > 1 && i < count-1) {
index 19a60a51a9704cd42fea120e1e8e19d88d155de7..13fd44abf0372076e7e804cea29b96a6dced7aff 100644 (file)
@@ -37,7 +37,7 @@
 
 struct notify_context {
        struct tdb_wrap *w;
-       uint32_t server;
+       struct server_id server;
        struct messaging_context *messaging_ctx;
        struct notify_list *list;
        struct notify_array *array;
@@ -61,7 +61,7 @@ struct notify_list {
 
 static NTSTATUS notify_remove_all(struct notify_context *notify);
 static void notify_handler(struct messaging_context *msg_ctx, void *private, 
-                          uint32_t msg_type, uint32_t server_id, DATA_BLOB *data);
+                          uint32_t msg_type, struct server_id server_id, DATA_BLOB *data);
 
 /*
   destroy the notify context
@@ -78,7 +78,7 @@ static int notify_destructor(struct notify_context *notify)
   talloc_free(). We need the messaging_ctx to allow for notifications
   via internal messages
 */
-struct notify_context *notify_init(TALLOC_CTX *mem_ctx, uint32_t server, 
+struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, 
                                   struct messaging_context *messaging_ctx,
                                   struct event_context *ev,
                                   struct share_config *scfg)
@@ -241,7 +241,7 @@ static NTSTATUS notify_save(struct notify_context *notify)
   handle incoming notify messages
 */
 static void notify_handler(struct messaging_context *msg_ctx, void *private, 
-                          uint32_t msg_type, uint32_t server_id, DATA_BLOB *data)
+                          uint32_t msg_type, struct server_id server_id, DATA_BLOB *data)
 {
        struct notify_context *notify = talloc_get_type(private, struct notify_context);
        NTSTATUS status;
@@ -460,7 +460,7 @@ NTSTATUS notify_remove(struct notify_context *notify, void *private)
 
        for (i=0;i<d->num_entries;i++) {
                if (private == d->entries[i].private &&
-                   notify->server == d->entries[i].server) {
+                   cluster_id_equal(&notify->server, &d->entries[i].server)) {
                        break;
                }
        }
@@ -508,7 +508,7 @@ static NTSTATUS notify_remove_all(struct notify_context *notify)
        for (depth=0;depth<notify->array->num_depths;depth++) {
                struct notify_depth *d = &notify->array->depth[depth];
                for (i=0;i<d->num_entries;i++) {
-                       if (notify->server == d->entries[i].server) {
+                       if (cluster_id_equal(&notify->server, &d->entries[i].server)) {
                                if (i < d->num_entries-1) {
                                        memmove(&d->entries[i], &d->entries[i+1], 
                                                sizeof(d->entries[i])*(d->num_entries-(i+1)));
index c63a677847c325c22ebd3f8a6d83b4ce99982fea..e1766d670e9f90c13e24e352c73002702c741631 100644 (file)
@@ -408,7 +408,7 @@ _PUBLIC_ NTSTATUS odb_close_file(struct odb_lock *lck, void *file_handle)
        /* find the entry, and delete it */
        for (i=0;i<file.num_entries;i++) {
                if (file_handle == file.entries[i].file_handle &&
-                   odb->ntvfs_ctx->server_id == file.entries[i].server) {
+                   cluster_id_equal(&odb->ntvfs_ctx->server_id, &file.entries[i].server)) {
                        if (file.entries[i].delete_on_close) {
                                file.delete_on_close = True;
                        }
@@ -455,7 +455,7 @@ _PUBLIC_ NTSTATUS odb_remove_pending(struct odb_lock *lck, void *private)
        /* find the entry, and delete it */
        for (i=0;i<file.num_pending;i++) {
                if (private == file.pending[i].notify_ptr &&
-                   odb->ntvfs_ctx->server_id == file.pending[i].server) {
+                   cluster_id_equal(&odb->ntvfs_ctx->server_id, &file.pending[i].server)) {
                        if (i < file.num_pending-1) {
                                memmove(file.pending+i, file.pending+i+1, 
                                        (file.num_pending - (i+1)) * 
index b48a5dac001936fe28ca410140f48bbb3e3467d1..69e638e1a1a09d58e4d9debb2e2de16553c2cca3 100644 (file)
@@ -184,7 +184,7 @@ struct ntvfs_context {
 
        struct share_config *config;
 
-       uint32_t server_id;
+       struct server_id server_id;
        struct event_context *event_ctx;
        struct messaging_context *msg_ctx;
 
index 7e794b582facaf44386ebc5ab87e94f75e8bb324..599669360b6239f611a918a77b3cd766b850c765 100644 (file)
@@ -154,7 +154,7 @@ _PUBLIC_ BOOL ntvfs_interface_differs(const struct ntvfs_critical_sizes *const i
 NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, enum ntvfs_type type,
                               enum protocol_types protocol,
                               struct event_context *ev, struct messaging_context *msg,
-                              uint32_t server_id, struct ntvfs_context **_ctx)
+                              struct server_id server_id, struct ntvfs_context **_ctx)
 {
        const char **handlers = share_string_list_option(mem_ctx, scfg, SHARE_NTVFS_HANDLER);
        int i;
index 41c5f4742e58ba8933093592f427e1c9f961647f..6e8324183f5edd6c38bb188844a2481c728d32a5 100644 (file)
@@ -57,7 +57,7 @@ NTSTATUS pvfs_async_setup(struct ntvfs_module_context *ntvfs,
   receive a completion message for a wait
 */
 static void pvfs_wait_dispatch(struct messaging_context *msg, void *private, uint32_t msg_type, 
-                              uint32_t src, DATA_BLOB *data)
+                              struct server_id src, DATA_BLOB *data)
 {
        struct pvfs_wait *pwait = private;
        struct ntvfs_request *req;
index 08b68b2318f2effddff64dcfe403c94db05fbb88..6233a2e088690f85e0a1c9c80997866d91089059 100644 (file)
@@ -292,7 +292,7 @@ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
                                 struct auth_session_info *session_info,
                                 struct event_context *event_ctx,
                                 struct messaging_context *msg_ctx,
-                                uint32_t server_id,
+                                struct server_id server_id,
                                 uint32_t state_flags,
                                 struct dcesrv_connection **_p)
 {
@@ -344,7 +344,7 @@ _PUBLIC_ NTSTATUS dcesrv_endpoint_search_connect(struct dcesrv_context *dce_ctx,
                                        struct auth_session_info *session_info,
                                        struct event_context *event_ctx,
                                        struct messaging_context *msg_ctx,
-                                       uint32_t server_id,
+                                       struct server_id server_id,
                                        uint32_t state_flags,
                                        struct dcesrv_connection **dce_conn_p)
 {
index 2990d6e09f466d60dd6020ca205d36d69c971bcc..a1f771339ad046b9265b6f06c7314862b50d4fae 100644 (file)
@@ -192,7 +192,7 @@ struct dcesrv_connection {
        struct messaging_context *msg_ctx;
 
        /* the server_id that will be used for this connection */
-       uint32_t server_id;
+       struct server_id server_id;
 
        /* the transport level session key */
        DATA_BLOB transport_session_key;
index 76b5f0d695555ad6de16cf2ab40b2e4241bd3e96..4d4e12e855ef650a94d07003d2a703f0eef09253 100644 (file)
 #include "librpc/rpc/dcerpc_table.h"
 #include "auth/credentials/credentials.h"
 #include "librpc/rpc/dcerpc.h"
+#include "cluster/cluster.h"
 
 /*
   state of a irpc 'connection'
 */
 struct ejs_irpc_connection {
        const char *server_name;
-       uint32_t *dest_ids;
+       struct server_id *dest_ids;
        struct messaging_context *msg_ctx;
 };
 
@@ -78,7 +79,7 @@ static int ejs_irpc_connect(MprVarHandle eid, int argc, char **argv)
        /* create a messaging context, looping as we have no way to
           allocate temporary server ids automatically */
        for (i=0;i<10000;i++) {
-               p->msg_ctx = messaging_init(p, EJS_ID_BASE + i, ev);
+               p->msg_ctx = messaging_init(p, cluster_id(EJS_ID_BASE + i), ev);
                if (p->msg_ctx) break;
        }
        if (p->msg_ctx == NULL) {
@@ -88,7 +89,7 @@ static int ejs_irpc_connect(MprVarHandle eid, int argc, char **argv)
        }
 
        p->dest_ids = irpc_servers_byname(p->msg_ctx, p->server_name);
-       if (p->dest_ids == NULL || p->dest_ids[0] == 0) {
+       if (p->dest_ids == NULL || p->dest_ids[0].id == 0) {
                talloc_free(p);
                status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
        } else {
@@ -214,7 +215,7 @@ static int ejs_irpc_call(int eid, struct MprVar *io,
                goto done;
        }
 
-       for (count=0;p->dest_ids[count];count++) /* noop */ ;
+       for (count=0;p->dest_ids[count].id;count++) /* noop */ ;
 
        /* we need to make a call per server */
        reqs = talloc_array(ejs, struct irpc_request *, count);
index ea7e5797a1a0958b23c6156b7ca5981a6628182b..04bae886b6d22c2bb51161c4c78f63d311d147cd 100644 (file)
@@ -148,7 +148,7 @@ static void reply_lanman1(struct smbsrv_request *req, uint16_t choice)
        SSVAL(req->out.vwv, VWV(3), lp_maxmux());
        SSVAL(req->out.vwv, VWV(4), 1);
        SSVAL(req->out.vwv, VWV(5), raw); 
-       SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id);
+       SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
        srv_push_dos_date(req->smb_conn, req->out.vwv, VWV(8), t);
        SSVAL(req->out.vwv, VWV(10), req->smb_conn->negotiate.zone_offset/60);
        SIVAL(req->out.vwv, VWV(11), 0); /* reserved */
@@ -202,7 +202,7 @@ static void reply_lanman2(struct smbsrv_request *req, uint16_t choice)
        SSVAL(req->out.vwv, VWV(3), lp_maxmux());
        SSVAL(req->out.vwv, VWV(4), 1);
        SSVAL(req->out.vwv, VWV(5), raw); 
-       SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id);
+       SIVAL(req->out.vwv, VWV(6), req->smb_conn->connection->server_id.id);
        srv_push_dos_date(req->smb_conn, req->out.vwv, VWV(8), t);
        SSVAL(req->out.vwv, VWV(10), req->smb_conn->negotiate.zone_offset/60);
        SIVAL(req->out.vwv, VWV(11), 0);
@@ -334,7 +334,7 @@ static void reply_nt1(struct smbsrv_request *req, uint16_t choice)
        SSVAL(req->out.vwv+1, VWV(2), 1); /* num vcs */
        SIVAL(req->out.vwv+1, VWV(3), req->smb_conn->negotiate.max_recv);
        SIVAL(req->out.vwv+1, VWV(5), 0x10000); /* raw size. full 64k */
-       SIVAL(req->out.vwv+1, VWV(7), req->smb_conn->connection->server_id); /* session key */
+       SIVAL(req->out.vwv+1, VWV(7), req->smb_conn->connection->server_id.id); /* session key */
        SIVAL(req->out.vwv+1, VWV(9), capabilities);
        push_nttime(req->out.vwv+1, VWV(11), nttime);
        SSVALS(req->out.vwv+1,VWV(15), req->smb_conn->negotiate.zone_offset/60);
index 27fac68bb90f09a5cfb758c9445f579287a1a08b..a10f63f1c5e78ec8a75903aa4223005f2eb9f2c2 100644 (file)
@@ -26,6 +26,7 @@
 #define __PROCESS_MODEL_H__
 
 #include "lib/socket/socket.h"
+#include "smbd/service_task.h"
 
 /* modules can use the following to determine if the interface has changed
  * please increment the version number after each interface change
@@ -46,12 +47,12 @@ struct model_ops {
        /* function to accept new connection */
        void (*accept_connection)(struct event_context *, struct socket_context *, 
                                  void (*)(struct event_context *, struct socket_context *, 
-                                          uint32_t , void *), 
+                                          struct server_id , void *), 
                                  void *);
 
        /* function to create a task */
        void (*new_task)(struct event_context *, 
-                        void (*)(struct event_context *, uint32_t, void *),
+                        void (*)(struct event_context *, struct server_id, void *),
                         void *);
 
        /* function to terminate a connection or task */
index 96043021998f8500ef66aac6cb5042808c313b01..221cfb780746d5c51da4d27feba9dacde55c1c24 100644 (file)
@@ -25,6 +25,7 @@
 #include "includes.h"
 #include "smbd/process_model.h"
 #include "system/filesys.h"
+#include "cluster/cluster.h"
 
 /*
   called when the process model is selected
@@ -39,7 +40,7 @@ static void single_model_init(struct event_context *ev)
 static void single_accept_connection(struct event_context *ev, 
                                     struct socket_context *sock,
                                     void (*new_conn)(struct event_context *, struct socket_context *, 
-                                                     uint32_t , void *), 
+                                                     struct server_id , void *), 
                                     void *private)
 {
        NTSTATUS status;
@@ -61,18 +62,18 @@ static void single_accept_connection(struct event_context *ev,
 
        talloc_steal(private, sock);
 
-       new_conn(ev, sock2, socket_get_fd(sock2), private);
+       new_conn(ev, sock2, cluster_id(socket_get_fd(sock2)), private);
 }
 
 /*
   called to startup a new task
 */
 static void single_new_task(struct event_context *ev, 
-                           void (*new_task)(struct event_context *, uint32_t, void *), 
+                           void (*new_task)(struct event_context *, struct server_id, void *), 
                            void *private)
 {
        static uint32_t taskid = 0x10000000;
-       new_task(ev, taskid++, private);
+       new_task(ev, cluster_id(taskid++), private);
 }
 
 
index 0dc9274e21b0079374bebdbac772bbe39d132bde..074d988e1e79c63d8d23f870918a3c36e680ef83 100644 (file)
@@ -28,8 +28,8 @@
 #include "lib/socket/socket.h"
 #include "smbd/process_model.h"
 #include "param/secrets.h"
-
 #include "system/filesys.h"
+#include "cluster/cluster.h"
 
 #ifdef HAVE_SETPROCTITLE
 #ifdef HAVE_SETPROCTITLE_H
@@ -58,7 +58,7 @@ static void standard_model_init(struct event_context *ev)
 static void standard_accept_connection(struct event_context *ev, 
                                       struct socket_context *sock, 
                                       void (*new_conn)(struct event_context *, struct socket_context *, 
-                                                       uint32_t , void *), 
+                                                       struct server_id , void *), 
                                       void *private)
 {
        NTSTATUS status;
@@ -126,7 +126,7 @@ static void standard_accept_connection(struct event_context *ev,
        talloc_free(s);
 
        /* setup this new connection */
-       new_conn(ev2, sock2, pid, private);
+       new_conn(ev2, sock2, cluster_id(pid), private);
 
        /* we can't return to the top level here, as that event context is gone,
           so we now process events in the new event context until there are no
@@ -141,7 +141,7 @@ static void standard_accept_connection(struct event_context *ev,
   called to create a new server task
 */
 static void standard_new_task(struct event_context *ev, 
-                             void (*new_task)(struct event_context *, uint32_t , void *), 
+                             void (*new_task)(struct event_context *, struct server_id , void *), 
                              void *private)
 {
        pid_t pid;
@@ -179,7 +179,7 @@ static void standard_new_task(struct event_context *ev,
        setproctitle("task server_id[%d]", pid);
 
        /* setup this new connection */
-       new_task(ev2, pid, private);
+       new_task(ev2, cluster_id(pid), private);
 
        /* we can't return to the top level here, as that event context is gone,
           so we now process events in the new event context until there are no
index 725a3b5080cbc373db382d4781d1374f8f6354c1..f3f3a67e787a8611bc2860f3a660d73e07b9769d 100644 (file)
@@ -28,6 +28,7 @@
 #include "smbd/service.h"
 #include "smbd/service_stream.h"
 #include "lib/messaging/irpc.h"
+#include "cluster/cluster.h"
 
 /* the range of ports to try for dcerpc over tcp endpoints */
 #define SERVER_TCP_LOW_PORT  1024
@@ -134,7 +135,7 @@ NTSTATUS stream_new_connection_merge(struct event_context *ev,
        srv_conn->private       = private_data;
        srv_conn->model_ops     = model_ops;
        srv_conn->socket        = sock;
-       srv_conn->server_id     = 0;
+       srv_conn->server_id     = cluster_id(0);
        srv_conn->ops           = stream_ops;
        srv_conn->msg_ctx       = msg_ctx;
        srv_conn->event.ctx     = ev;
@@ -151,7 +152,7 @@ NTSTATUS stream_new_connection_merge(struct event_context *ev,
 */
 static void stream_new_connection(struct event_context *ev,
                                  struct socket_context *sock, 
-                                 uint32_t server_id, void *private)
+                                 struct server_id server_id, void *private)
 {
        struct stream_socket *stream_socket = talloc_get_type(private, struct stream_socket);
        struct stream_connection *srv_conn;
@@ -191,10 +192,10 @@ static void stream_new_connection(struct event_context *ev,
        s = socket_get_my_addr(sock, ev);
        if (s && c) {
                const char *title;
-               title = talloc_asprintf(s, "conn[%s] c[%s:%u] s[%s:%u] server_id[%d]",
+               title = talloc_asprintf(s, "conn[%s] c[%s:%u] s[%s:%u] server_id[%s]",
                                        stream_socket->ops->name, 
                                        c->addr, c->port, s->addr, s->port,
-                                       server_id);
+                                       cluster_id_string(s, server_id));
                if (title) {
                        stream_connection_set_title(srv_conn, title);
                }
index 692e18bea5b521f19e12a05a054785c1a181cdc8..03fdcf522ec73ee93d6a83c0e955e8a8323ac4b2 100644 (file)
@@ -37,7 +37,7 @@
 struct stream_connection {
        const struct stream_server_ops *ops;
        const struct model_ops *model_ops;
-       uint32_t server_id;
+       struct server_id server_id;
        void *private;
 
        struct {
index 2963bac425451e46efaab9f9184163f8d299c061..06bd328386adba29d51573458f451c7430b3cec8 100644 (file)
@@ -50,7 +50,8 @@ struct task_state {
   called by the process model code when the new task starts up. This then calls
   the server specific startup code
 */
-static void task_server_callback(struct event_context *event_ctx, uint32_t server_id, void *private)
+static void task_server_callback(struct event_context *event_ctx, 
+                                struct server_id server_id, void *private)
 {
        struct task_state *state = talloc_get_type(private, struct task_state);
        struct task_server *task;
index c0adf08fd0b5b6bf5e8e125d920125be01e5118b..f89b5e65f968ac762ab9f5b4e70028e1d8bd1ad9 100644 (file)
@@ -27,8 +27,10 @@ struct task_server {
        struct event_context *event_ctx;
        const struct model_ops *model_ops;
        struct messaging_context *msg_ctx;
-       uint32_t server_id;
+       struct server_id server_id;
        void *private;
 };
 
+
+
 #endif /* __SERVICE_TASK_H__ */
index 185e1fb4aeeca87148298413b27bc9cf757a2e3b..299cf7762528e3bb52724f1536eeecbdd0101261 100644 (file)
@@ -92,7 +92,8 @@ static bool test_addone(struct torture_context *test, const void *_data,
        r.in.in_data = value;
 
        test_debug = True;
-       status = IRPC_CALL(data->msg_ctx1, MSG_ID2, rpcecho, ECHO_ADDONE, &r, test);
+       status = IRPC_CALL(data->msg_ctx1, cluster_id(MSG_ID2), 
+                          rpcecho, ECHO_ADDONE, &r, test);
        test_debug = False;
        torture_assert_ntstatus_ok(test, status, "AddOne failed");
 
@@ -120,8 +121,9 @@ static bool test_echodata(struct torture_context *tctx,
        r.in.in_data = (unsigned char *)talloc_strdup(mem_ctx, "0123456789");
        r.in.len = strlen((char *)r.in.in_data);
 
-       status = IRPC_CALL(data->msg_ctx1, MSG_ID2, rpcecho, ECHO_ECHODATA, &r, 
-                                          mem_ctx);
+       status = IRPC_CALL(data->msg_ctx1, cluster_id(MSG_ID2), 
+                          rpcecho, ECHO_ECHODATA, &r, 
+                          mem_ctx);
        torture_assert_ntstatus_ok(tctx, status, "EchoData failed");
 
        /* check the answer */
@@ -177,8 +179,9 @@ static bool test_speed(struct torture_context *tctx,
        while (timeval_elapsed(&tv) < timelimit) {
                struct irpc_request *irpc;
 
-               irpc = IRPC_CALL_SEND(data->msg_ctx1, MSG_ID2, rpcecho, ECHO_ADDONE, 
-                                                         &r, mem_ctx);
+               irpc = IRPC_CALL_SEND(data->msg_ctx1, cluster_id(MSG_ID2), 
+                                     rpcecho, ECHO_ADDONE, 
+                                     &r, mem_ctx);
                torture_assert(tctx, irpc != NULL, "AddOne send failed");
 
                irpc->async.fn = irpc_callback;
@@ -214,11 +217,15 @@ static BOOL irpc_setup(struct torture_context *tctx, void **_data)
        lp_set_cmdline("lock dir", "lockdir.tmp");
 
        data->ev = event_context_init(tctx);
-       torture_assert(tctx, data->msg_ctx1 = messaging_init(tctx, MSG_ID1, data->ev),
-                                  "Failed to init first messaging context");
-
-       torture_assert(tctx, data->msg_ctx2 = messaging_init(tctx, MSG_ID2, data->ev),
-                                  "Failed to init second messaging context");
+       torture_assert(tctx, data->msg_ctx1 = 
+                      messaging_init(tctx, 
+                                     cluster_id(MSG_ID1), data->ev),
+                      "Failed to init first messaging context");
+
+       torture_assert(tctx, data->msg_ctx2 = 
+                      messaging_init(tctx, 
+                                     cluster_id(MSG_ID2), data->ev),
+                      "Failed to init second messaging context");
 
        /* register the server side function */
        IRPC_REGISTER(data->msg_ctx1, rpcecho, ECHO_ADDONE, irpc_AddOne, NULL);
index 27c343948b846a96ca52d2438da5606e0d391f36..ccf091cf62d89591e5a4c0035be6b839231007ff 100644 (file)
@@ -29,7 +29,7 @@
 static uint32_t msg_pong;
 
 static void ping_message(struct messaging_context *msg, void *private, 
-                        uint32_t msg_type, uint32_t src, DATA_BLOB *data)
+                        uint32_t msg_type, struct server_id src, DATA_BLOB *data)
 {
        NTSTATUS status;
        status = messaging_send(msg, src, msg_pong, data);
@@ -39,14 +39,14 @@ static void ping_message(struct messaging_context *msg, void *private,
 }
 
 static void pong_message(struct messaging_context *msg, void *private, 
-                        uint32_t msg_type, uint32_t src, DATA_BLOB *data)
+                        uint32_t msg_type, struct server_id src, DATA_BLOB *data)
 {
        int *count = private;
        (*count)++;
 }
 
 static void exit_message(struct messaging_context *msg, void *private, 
-                        uint32_t msg_type, uint32_t src, DATA_BLOB *data)
+                        uint32_t msg_type, struct server_id src, DATA_BLOB *data)
 {
        talloc_free(private);
        exit(0);
@@ -71,14 +71,14 @@ static bool test_ping_speed(struct torture_context *tctx)
 
        ev = event_context_init(mem_ctx);
 
-       msg_server_ctx = messaging_init(mem_ctx, 1, ev);
+       msg_server_ctx = messaging_init(mem_ctx, cluster_id(1), ev);
        
        torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context");
                
        messaging_register_tmp(msg_server_ctx, NULL, ping_message, &msg_ping);
        messaging_register_tmp(msg_server_ctx, mem_ctx, exit_message, &msg_exit);
 
-       msg_client_ctx = messaging_init(mem_ctx, 2, ev);
+       msg_client_ctx = messaging_init(mem_ctx, cluster_id(2), ev);
 
        torture_assert(tctx, msg_client_ctx != NULL, "msg_client_ctx messaging_init() failed");
 
@@ -94,8 +94,8 @@ static bool test_ping_speed(struct torture_context *tctx)
                data.data = discard_const_p(uint8_t, "testing");
                data.length = strlen((const char *)data.data);
 
-               status1 = messaging_send(msg_client_ctx, 1, msg_ping, &data);
-               status2 = messaging_send(msg_client_ctx, 1, msg_ping, NULL);
+               status1 = messaging_send(msg_client_ctx, cluster_id(1), msg_ping, &data);
+               status2 = messaging_send(msg_client_ctx, cluster_id(1), msg_ping, NULL);
 
                torture_assert_ntstatus_ok(tctx, status1, "msg1 failed");
                ping_count++;
@@ -115,7 +115,7 @@ static bool test_ping_speed(struct torture_context *tctx)
        }
 
        torture_comment(tctx, "sending exit");
-       messaging_send(msg_client_ctx, 1, msg_exit, NULL);
+       messaging_send(msg_client_ctx, cluster_id(1), msg_exit, NULL);
 
        torture_assert_int_equal(tctx, ping_count, pong_count, "ping test failed");
 
index 2ca29a9a8b2cf413e88c3b193ea29437f6025242..41334b420ab6638b9ab9f0e165cd0faf95b58700 100644 (file)
@@ -91,7 +91,7 @@ static void get_dom_info_recv_addrs(struct composite_context *ctx)
        struct get_dom_info_state *state =
                talloc_get_type(ctx->async.private_data,
                                struct get_dom_info_state);
-       uint32_t *nbt_servers;
+       struct server_id *nbt_servers;
        struct irpc_request *ireq;
 
        state->ctx->status = resolve_name_recv(ctx, state->info,
@@ -100,7 +100,7 @@ static void get_dom_info_recv_addrs(struct composite_context *ctx)
 
        nbt_servers = irpc_servers_byname(state->service->task->msg_ctx,
                                          "nbt_server");
-       if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) {
+       if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) {
                composite_error(state->ctx, NT_STATUS_NO_LOGON_SERVERS);
                return;
        }
index 6dff884444d245ab5a6ad8b493a03dae6c05ab11..f805d21dfe8d280561b2803b58a15a0cdcf5141d 100644 (file)
@@ -904,7 +904,7 @@ static void r_do_late_release_demand_handler(struct irpc_request *ireq)
 static NTSTATUS r_do_late_release_demand(struct r_do_challenge_state *state)
 {
        struct irpc_request *ireq;
-       uint32_t *nbt_servers;
+       struct server_id *nbt_servers;
        struct nbtd_proxy_wins_release_demand r;
        uint32_t i;
 
@@ -912,7 +912,7 @@ static NTSTATUS r_do_late_release_demand(struct r_do_challenge_state *state)
                 nbt_name_string(state, &state->replica.name)));
 
        nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server");
-       if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) {
+       if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) {
                return NT_STATUS_INTERNAL_ERROR;
        }
 
@@ -1032,7 +1032,7 @@ static NTSTATUS r_do_challenge(struct wreplsrv_partner *partner,
 {
        struct irpc_request *ireq;
        struct r_do_challenge_state *state;
-       uint32_t *nbt_servers;
+       struct server_id *nbt_servers;
        const char **addrs;
        uint32_t i;
 
@@ -1052,7 +1052,7 @@ static NTSTATUS r_do_challenge(struct wreplsrv_partner *partner,
        talloc_steal(state, replica->addresses);
 
        nbt_servers = irpc_servers_byname(state->msg_ctx, "nbt_server");
-       if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) {
+       if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) {
                return NT_STATUS_INTERNAL_ERROR;
        }
 
@@ -1094,7 +1094,7 @@ static NTSTATUS r_do_release_demand(struct wreplsrv_partner *partner,
 {
        NTSTATUS status;
        struct irpc_request *ireq;
-       uint32_t *nbt_servers;
+       struct server_id *nbt_servers;
        const char **addrs;
        struct winsdb_addr **addresses;
        struct nbtd_proxy_wins_release_demand r;
@@ -1114,7 +1114,7 @@ static NTSTATUS r_do_release_demand(struct wreplsrv_partner *partner,
                 nbt_name_string(mem_ctx, &replica->name)));
 
        nbt_servers = irpc_servers_byname(partner->service->task->msg_ctx, "nbt_server");
-       if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) {
+       if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) {
                return NT_STATUS_INTERNAL_ERROR;
        }
 
index 5628728a7602020a7b2ca71140b40a63d3c9b741..e134e64c06598ec30715099f24eb606baeec239a 100644 (file)
@@ -388,10 +388,10 @@ static NTSTATUS wreplsrv_scavenging_replica_active_records(struct wreplsrv_servi
        const char *now_timestr;
        struct irpc_request *ireq;
        struct verify_state *s;
-       uint32_t *nbt_servers;
+       struct server_id *nbt_servers;
 
        nbt_servers = irpc_servers_byname(service->task->msg_ctx, "nbt_server");
-       if ((nbt_servers == NULL) || (nbt_servers[0] == 0)) {
+       if ((nbt_servers == NULL) || (nbt_servers[0].id == 0)) {
                return NT_STATUS_INTERNAL_ERROR;
        }