diff options
author | Günther Deschner <gd@samba.org> | 2008-11-17 16:31:59 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-11-18 16:04:39 +0100 |
commit | eef8de5c887e013f5b05742a74fbb130596c62d3 (patch) | |
tree | 4aa8bba95ad415187968e1a83c175ea05f343583 /source3 | |
parent | d10293dfdc1c2aded1305191161dbd31521557bf (diff) | |
download | samba-eef8de5c887e013f5b05742a74fbb130596c62d3.tar.gz samba-eef8de5c887e013f5b05742a74fbb130596c62d3.tar.bz2 samba-eef8de5c887e013f5b05742a74fbb130596c62d3.zip |
s3-libnet-samsync: use samsync_ops.
Guenther
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libnet/libnet_samsync.c | 7 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync.h | 27 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_display.c | 10 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_keytab.c | 20 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_ldif.c | 20 | ||||
-rw-r--r-- | source3/libnet/libnet_samsync_passdb.c | 10 | ||||
-rw-r--r-- | source3/utils/net_rpc_samsync.c | 8 |
7 files changed, 38 insertions, 64 deletions
diff --git a/source3/libnet/libnet_samsync.c b/source3/libnet/libnet_samsync.c index 2e7063e4ea..e57c2a5e11 100644 --- a/source3/libnet/libnet_samsync.c +++ b/source3/libnet/libnet_samsync.c @@ -408,9 +408,10 @@ static NTSTATUS libnet_samsync_delta(enum netr_SamDatabaseID database_id, delta_enum_array); /* Process results */ - callback_status = ctx->delta_fn(mem_ctx, database_id, - delta_enum_array, - NT_STATUS_IS_OK(result), ctx); + callback_status = ctx->ops->process_objects(mem_ctx, database_id, + delta_enum_array, + NT_STATUS_IS_OK(result), + ctx); if (!NT_STATUS_IS_OK(callback_status)) { result = callback_status; goto out; diff --git a/source3/libnet/libnet_samsync.h b/source3/libnet/libnet_samsync.h index 2f0f049fb9..23a3746fc9 100644 --- a/source3/libnet/libnet_samsync.h +++ b/source3/libnet/libnet_samsync.h @@ -27,11 +27,6 @@ enum net_samsync_mode { struct samsync_context; -typedef NTSTATUS (*samsync_delta_fn_t)(TALLOC_CTX *, - enum netr_SamDatabaseID, - struct netr_DELTA_ENUM_ARRAY *, - bool, - struct samsync_context *); struct samsync_ops { NTSTATUS (*startup)(TALLOC_CTX *mem_ctx, struct samsync_context *ctx, @@ -82,7 +77,6 @@ struct samsync_context { const struct samsync_ops *ops; - samsync_delta_fn_t delta_fn; void *private_data; }; @@ -90,24 +84,3 @@ extern const struct samsync_ops libnet_samsync_ldif_ops; extern const struct samsync_ops libnet_samsync_keytab_ops; extern const struct samsync_ops libnet_samsync_display_ops; extern const struct samsync_ops libnet_samsync_passdb_ops; - -NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx); -NTSTATUS fetch_sam_entries(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx); -NTSTATUS display_sam_entries(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx); -NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx); diff --git a/source3/libnet/libnet_samsync_display.c b/source3/libnet/libnet_samsync_display.c index 5a0c3088cf..5fdf327b74 100644 --- a/source3/libnet/libnet_samsync_display.c +++ b/source3/libnet/libnet_samsync_display.c @@ -285,11 +285,11 @@ static NTSTATUS display_sam_entry(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } -NTSTATUS display_sam_entries(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx) +static NTSTATUS display_sam_entries(TALLOC_CTX *mem_ctx, + enum netr_SamDatabaseID database_id, + struct netr_DELTA_ENUM_ARRAY *r, + bool last_query, + struct samsync_context *ctx) { int i; diff --git a/source3/libnet/libnet_samsync_keytab.c b/source3/libnet/libnet_samsync_keytab.c index b68d70145c..679f9df480 100644 --- a/source3/libnet/libnet_samsync_keytab.c +++ b/source3/libnet/libnet_samsync_keytab.c @@ -105,11 +105,11 @@ static NTSTATUS fetch_sam_entry_keytab(TALLOC_CTX *mem_ctx, /**************************************************************** ****************************************************************/ -NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx) +static NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, + enum netr_SamDatabaseID database_id, + struct netr_DELTA_ENUM_ARRAY *r, + bool last_query, + struct samsync_context *ctx) { NTSTATUS status = NT_STATUS_OK; krb5_error_code ret = 0; @@ -178,11 +178,11 @@ NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, #else -NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx) +static NTSTATUS fetch_sam_entries_keytab(TALLOC_CTX *mem_ctx, + enum netr_SamDatabaseID database_id, + struct netr_DELTA_ENUM_ARRAY *r, + bool last_query, + struct samsync_context *ctx) { return NT_STATUS_NOT_SUPPORTED; } diff --git a/source3/libnet/libnet_samsync_ldif.c b/source3/libnet/libnet_samsync_ldif.c index 245ebe0b9f..7f794e7d8c 100644 --- a/source3/libnet/libnet_samsync_ldif.c +++ b/source3/libnet/libnet_samsync_ldif.c @@ -1156,11 +1156,11 @@ static NTSTATUS ldif_realloc_maps(TALLOC_CTX *mem_ctx, /**************************************************************** ****************************************************************/ -NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx) +static NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, + enum netr_SamDatabaseID database_id, + struct netr_DELTA_ENUM_ARRAY *r, + bool last_query, + struct samsync_context *ctx) { NTSTATUS status; int i; @@ -1216,11 +1216,11 @@ NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, #else /* HAVE_LDAP */ -NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx) +static NTSTATUS fetch_sam_entries_ldif(TALLOC_CTX *mem_ctx, + enum netr_SamDatabaseID database_id, + struct netr_DELTA_ENUM_ARRAY *r, + bool last_query, + struct samsync_context *ctx) { return NT_STATUS_NOT_SUPPORTED; } diff --git a/source3/libnet/libnet_samsync_passdb.c b/source3/libnet/libnet_samsync_passdb.c index 6e068e0f41..10c7ff110f 100644 --- a/source3/libnet/libnet_samsync_passdb.c +++ b/source3/libnet/libnet_samsync_passdb.c @@ -772,11 +772,11 @@ static NTSTATUS fetch_sam_entry(TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } -NTSTATUS fetch_sam_entries(TALLOC_CTX *mem_ctx, - enum netr_SamDatabaseID database_id, - struct netr_DELTA_ENUM_ARRAY *r, - bool last_query, - struct samsync_context *ctx) +static NTSTATUS fetch_sam_entries(TALLOC_CTX *mem_ctx, + enum netr_SamDatabaseID database_id, + struct netr_DELTA_ENUM_ARRAY *r, + bool last_query, + struct samsync_context *ctx) { int i; diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index 3b97718634..6b23db74cb 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -123,7 +123,7 @@ NTSTATUS rpc_samdump_internals(struct net_context *c, ctx->mode = NET_SAMSYNC_MODE_DUMP; ctx->cli = pipe_hnd; - ctx->delta_fn = display_sam_entries; + ctx->ops = &libnet_samsync_display_ops; ctx->domain_name = domain_name; ctx->force_full_replication = c->opt_force_full_repl ? true : false; @@ -206,7 +206,7 @@ NTSTATUS rpc_vampire_internals(struct net_context *c, ctx->mode = NET_SAMSYNC_MODE_FETCH_PASSDB; ctx->cli = pipe_hnd; - ctx->delta_fn = fetch_sam_entries; + ctx->ops = &libnet_samsync_passdb_ops; ctx->domain_name = domain_name; ctx->force_full_replication = c->opt_force_full_repl ? true : false; @@ -292,7 +292,7 @@ NTSTATUS rpc_vampire_ldif_internals(struct net_context *c, ctx->mode = NET_SAMSYNC_MODE_FETCH_LDIF; ctx->cli = pipe_hnd; - ctx->delta_fn = fetch_sam_entries_ldif; + ctx->ops = &libnet_samsync_ldif_ops; ctx->domain_name = domain_name; ctx->force_full_replication = c->opt_force_full_repl ? true : false; @@ -377,7 +377,7 @@ NTSTATUS rpc_vampire_keytab_internals(struct net_context *c, ctx->mode = NET_SAMSYNC_MODE_FETCH_KEYTAB; ctx->cli = pipe_hnd; - ctx->delta_fn = fetch_sam_entries_keytab; + ctx->ops = &libnet_samsync_keytab_ops; ctx->domain_name = domain_name; ctx->username = c->opt_user_name; ctx->password = c->opt_password; |