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
;
30 typedef NTSTATUS (*samsync_delta_fn_t
)(TALLOC_CTX
*,
31 enum netr_SamDatabaseID
,
32 struct netr_DELTA_ENUM_ARRAY
*,
34 struct samsync_context
*);
36 struct samsync_context
{
37 enum net_samsync_mode mode
;
38 const struct dom_sid
*domain_sid
;
39 const char *domain_sid_str
;
40 const char *domain_name
;
41 const char *output_filename
;
49 struct rpc_pipe_client
*cli
;
50 samsync_delta_fn_t delta_fn
;
54 NTSTATUS
fetch_sam_entries_ldif(TALLOC_CTX
*mem_ctx
,
55 enum netr_SamDatabaseID database_id
,
56 struct netr_DELTA_ENUM_ARRAY
*r
,
58 struct samsync_context
*ctx
);
59 NTSTATUS
fetch_sam_entries(TALLOC_CTX
*mem_ctx
,
60 enum netr_SamDatabaseID database_id
,
61 struct netr_DELTA_ENUM_ARRAY
*r
,
63 struct samsync_context
*ctx
);
64 NTSTATUS
display_sam_entries(TALLOC_CTX
*mem_ctx
,
65 enum netr_SamDatabaseID database_id
,
66 struct netr_DELTA_ENUM_ARRAY
*r
,
68 struct samsync_context
*ctx
);
69 NTSTATUS
fetch_sam_entries_keytab(TALLOC_CTX
*mem_ctx
,
70 enum netr_SamDatabaseID database_id
,
71 struct netr_DELTA_ENUM_ARRAY
*r
,
73 struct samsync_context
*ctx
);