cifs-utils: convert setcifsacl to use the plugin interface
[jlayton/cifs-utils.git] / idmap_plugin.h
1 /*
2  * ID Mapping Plugin interface for cifs-utils
3  * Copyright (C) 2012 Jeff Layton (jlayton@samba.org)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19 #include "cifsidmap.h"
20
21 #ifndef _IDMAP_PLUGIN_H
22 #define _IDMAP_PLUGIN_H
23
24 /*
25  * On error, plugin functions will set this pointer to a string description
26  * of the error. The string should not be freed.
27  */
28 extern const char *plugin_errmsg;
29
30 /*
31  * External API. Programs should call this to use the plugin functionality.
32  */
33
34 /*
35  * Initialize plugin. Returns an opaque handle that should be passed to
36  * other idmapping functions.
37  */
38 extern int init_plugin(void **handle);
39
40 /* Close out an init'ed handle */
41 extern void exit_plugin(void *handle);
42
43 /* Convert cifs_sid to a string. Caller must free *name on success */
44 extern int sid_to_str(void *handle, const struct cifs_sid *sid, char **name);
45
46 /* Convert string to cifs_sid. */
47 extern int str_to_sid(void *handle, const char *name, struct cifs_sid *csid);
48
49 #endif /* _IDMAP_PLUGIN_H */