lib:cmdline: Add client credentials
[kseeger/samba-autobuild/.git] / lib / cmdline / cmdline_private.h
1 /*
2  * Copyright (c) 2020      Andreas Schneider <asn@samba.org>
3  *
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.
8  *
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.
13  *
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/>.
16  */
17
18 #ifndef _CMDLINE_PRIVATE_H
19 #define _CMDLINE_PRIVATE_H
20
21 #include "lib/cmdline/cmdline.h"
22
23 /**
24  * @internal
25  *
26  * @brief Initialize the commandline interface for parsing options.
27  *
28  * This the common function to initialize the command line interface. This
29  * initializes:
30  *
31  *   - Crash setup
32  *   - logging system sening logs to stdout
33  *   - talloc leak reporting
34  *
35  * @param[in]  mem_ctx  The talloc memory context to use for allocating memory.
36  *                      This should be a long living context till the client
37  *                      exits.
38  *
39  * @return true on success, false if an error occured.
40  */
41 bool samba_cmdline_init_common(TALLOC_CTX *mem_ctx);
42
43 /**
44  * @internal
45  *
46  * @brief Set the talloc context for the command line interface.
47  *
48  * This is stored as a static pointer.
49  *
50  * @param[in]  mem_ctx  The talloc memory context.
51  *
52  * @return true on success, false if an error occured.
53  */
54 bool samba_cmdline_set_talloc_ctx(TALLOC_CTX *mem_ctx);
55
56 /**
57  * @internal
58  *
59  * @brief Get the talloc context for the cmdline interface.
60  *
61  * @return A talloc context.
62  */
63 TALLOC_CTX *samba_cmdline_get_talloc_ctx(void);
64
65 /**
66  * @internal
67  *
68  * @brief Set the loadparm context for the command line interface.
69  *
70  * @param[in]  lp_ctx  The loadparm context to use.
71  *
72  * @return true on success, false if an error occured.
73  */
74 bool samba_cmdline_set_lp_ctx(struct loadparm_context *lp_ctx);
75
76 /**
77  * @internal
78  *
79  * @brief Set the client credentials for the commandline interface.
80  *
81  * @param[in]  creds   The client credentials to use.
82  *
83  * @return true on success, false if an error occured.
84  */
85 bool samba_cmdline_set_creds(struct cli_credentials *creds);
86
87 #endif /* _CMDLINE_PRIVATE_H */