Blame idmap_plugin.h

Packit 5f9837
/*
Packit 5f9837
 * ID Mapping Plugin interface for cifs-utils
Packit 5f9837
 * Copyright (C) 2012 Jeff Layton (jlayton@samba.org)
Packit 5f9837
 *
Packit 5f9837
 * This program is free software; you can redistribute it and/or modify
Packit 5f9837
 * it under the terms of the GNU General Public License as published by
Packit 5f9837
 * the Free Software Foundation; either version 3 of the License, or
Packit 5f9837
 * (at your option) any later version.
Packit 5f9837
 *
Packit 5f9837
 * This program is distributed in the hope that it will be useful,
Packit 5f9837
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 5f9837
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 5f9837
 * GNU General Public License for more details.
Packit 5f9837
 *
Packit 5f9837
 * You should have received a copy of the GNU General Public License
Packit 5f9837
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 5f9837
 */
Packit 5f9837
Packit 5f9837
#include "cifsidmap.h"
Packit 5f9837
Packit 5f9837
#ifndef _IDMAP_PLUGIN_H
Packit 5f9837
#define _IDMAP_PLUGIN_H
Packit 5f9837
Packit 5f9837
/*
Packit 5f9837
 * On error, plugin functions will set this pointer to a string description
Packit 5f9837
 * of the error. The string should not be freed.
Packit 5f9837
 */
Packit 5f9837
extern const char *plugin_errmsg;
Packit 5f9837
Packit 5f9837
/*
Packit 5f9837
 * External API. Programs should call this to use the plugin functionality.
Packit 5f9837
 */
Packit 5f9837
Packit 5f9837
/*
Packit 5f9837
 * Initialize plugin. Returns an opaque handle that should be passed to
Packit 5f9837
 * other idmapping functions.
Packit 5f9837
 */
Packit 5f9837
extern int init_plugin(void **handle);
Packit 5f9837
Packit 5f9837
/* Close out an init'ed handle */
Packit 5f9837
extern void exit_plugin(void *handle);
Packit 5f9837
Packit 5f9837
/* Convert cifs_sid to a string. Caller must free *name on success */
Packit 5f9837
extern int sid_to_str(void *handle, const struct cifs_sid *sid, char **name);
Packit 5f9837
Packit 5f9837
/* Convert string to cifs_sid. */
Packit 5f9837
extern int str_to_sid(void *handle, const char *name, struct cifs_sid *csid);
Packit 5f9837
Packit 5f9837
/* convert array of cifs_sids to cifs_uxids */
Packit 5f9837
extern int sids_to_ids(void *handle, const struct cifs_sid *sids,
Packit 5f9837
			const size_t num, struct cifs_uxid *ids);
Packit 5f9837
Packit 5f9837
/* convert array of cifs_uxids to cifs_sids */
Packit 5f9837
extern int ids_to_sids(void *handle, const struct cifs_uxid *id,
Packit 5f9837
			const size_t num, struct cifs_sid *sid);
Packit 5f9837
Packit 5f9837
#endif /* _IDMAP_PLUGIN_H */