s4:kdc: also provide cross-realm keys via samba_kdc_seq()
[Samba.git] / lib / cmdline / cmdline_private.h
blobe2d4e9563fbad58199c3b908c27d128adbb03d5e
1 /*
2 * Copyright (c) 2020 Andreas Schneider <asn@samba.org>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef _CMDLINE_PRIVATE_H
19 #define _CMDLINE_PRIVATE_H
21 #include "lib/cmdline/cmdline.h"
23 enum {
24 OPT_OPTION = 0x1000000,
25 OPT_NETBIOS_SCOPE,
26 OPT_LEAK_REPORT,
27 OPT_LEAK_REPORT_FULL,
28 OPT_DEBUG_STDOUT,
29 OPT_CONFIGFILE,
30 OPT_SIMPLE_BIND_DN,
31 OPT_PASSWORD,
32 OPT_NT_HASH,
33 OPT_USE_KERBEROS,
34 OPT_USE_KERBEROS_CCACHE,
35 OPT_USE_WINBIND_CCACHE,
36 OPT_CLIENT_PROTECTION,
37 OPT_DAEMON,
38 OPT_INTERACTIVE,
39 OPT_FORK,
40 OPT_NO_PROCESS_GROUP,
43 typedef bool (*samba_cmdline_load_config)(void);
45 /**
46 * @internal
48 * @brief Initialize the commandline interface for parsing options.
50 * This the common function to initialize the command line interface. This
51 * initializes:
53 * - Crash setup
54 * - logging system sending logs to stdout
55 * - talloc leak reporting
57 * @param[in] mem_ctx The talloc memory context to use for allocating memory.
58 * This should be a long living context till the client
59 * exits.
61 * @return true on success, false if an error occurred.
63 bool samba_cmdline_init_common(TALLOC_CTX *mem_ctx);
65 /**
66 * @brief Set the callback for loading the smb.conf file.
68 * This is needed as sourc3 and source4 have different code for loading the
69 * smb.conf file.
71 * @param[in] fn The callback to load the smb.conf file.
73 * @return true on success, false if an error occurred.
75 bool samba_cmdline_set_load_config_fn(samba_cmdline_load_config fn);
77 /**
78 * @internal
80 * @brief Set the talloc context for the command line interface.
82 * This is stored as a static pointer.
84 * @param[in] mem_ctx The talloc memory context.
86 * @return true on success, false if an error occurred.
88 bool samba_cmdline_set_talloc_ctx(TALLOC_CTX *mem_ctx);
90 /**
91 * @internal
93 * @brief Get the talloc context for the cmdline interface.
95 * @return A talloc context.
97 TALLOC_CTX *samba_cmdline_get_talloc_ctx(void);
99 /**
100 * @internal
102 * @brief Set the loadparm context for the command line interface.
104 * @param[in] lp_ctx The loadparm context to use.
106 * @return true on success, false if an error occurred.
108 bool samba_cmdline_set_lp_ctx(struct loadparm_context *lp_ctx);
111 * @internal
113 * @brief Set the client credentials for the commandline interface.
115 * @param[in] creds The client credentials to use.
117 * @return true on success, false if an error occurred.
119 bool samba_cmdline_set_creds(struct cli_credentials *creds);
121 #endif /* _CMDLINE_PRIVATE_H */