2 * Unix SMB/CIFS implementation.
4 * Copyright (C) Guenther Deschner 2008
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 enum net_samsync_mode {
22 NET_SAMSYNC_MODE_FETCH_PASSDB = 0,
23 NET_SAMSYNC_MODE_FETCH_LDIF = 1,
24 NET_SAMSYNC_MODE_FETCH_KEYTAB = 2,
25 NET_SAMSYNC_MODE_DUMP = 3
28 struct samsync_context;
31 NTSTATUS (*startup)(TALLOC_CTX *mem_ctx,
32 struct samsync_context *ctx,
33 enum netr_SamDatabaseID id,
34 uint64_t *sequence_num);
35 NTSTATUS (*process_objects)(TALLOC_CTX *mem_ctx,
36 enum netr_SamDatabaseID id,
37 struct netr_DELTA_ENUM_ARRAY *array,
38 struct samsync_context *ctx);
39 NTSTATUS (*finish)(TALLOC_CTX *mem_ctx,
40 struct samsync_context *ctx,
41 enum netr_SamDatabaseID id,
42 uint64_t sequence_num);
45 struct samsync_object {
55 struct samsync_context {
56 enum net_samsync_mode mode;
57 const struct dom_sid *domain_sid;
58 const char *domain_sid_str;
59 const char *domain_name;
60 const char *output_filename;
68 bool single_object_replication;
69 bool force_full_replication;
70 bool clean_old_entries;
73 struct samsync_object *objects;
75 struct rpc_pipe_client *cli;
77 const struct samsync_ops *ops;
82 extern const struct samsync_ops libnet_samsync_ldif_ops;
83 extern const struct samsync_ops libnet_samsync_keytab_ops;
84 extern const struct samsync_ops libnet_samsync_display_ops;
85 extern const struct samsync_ops libnet_samsync_passdb_ops;