s3:idmap: remove unused method dump_data() from the idmap API
[amitay/samba.git] / source3 / include / idmap.h
index 783a5f56fb728d6d57d68e377adb42cbb2481b12..e32ade709f015d996bfcb08625a21dc15344f46c 100644 (file)
@@ -5,53 +5,68 @@
 
    Idmap headers
 
-   Copyright (C) Jim McDonough 2003
+   Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003
    Copyright (C) Simo Sorce 2003
    
    This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
+   modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
-   version 2 of the License, or (at your option) any later version.
+   version 3 of the License, or (at your option) any later version.
    
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
    
-   You should have received a copy of the GNU Library General Public
-   License along with this library; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA  02111-1307, USA.   
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-#define SMB_IDMAP_INTERFACE_VERSION    2
+/* The interface version specifier. 
+   Updated to 3 for enum types by JRA. */
 
+/* Updated to 4, completely new interface, SSS */
+/* Updated to 5, simplified interface by Volker */
 
-#define ID_EMPTY       0x00
-#define ID_USERID      0x01
-#define ID_GROUPID     0x02
-#define ID_OTHER       0x04
+#define SMB_IDMAP_INTERFACE_VERSION 5
 
-#define ID_TYPEMASK    0x0f
-
-#define ID_QUERY_ONLY  0x10
+struct idmap_domain {
+       const char *name;
+       struct idmap_methods *methods;
+       void *private_data;
+};
 
 /* Filled out by IDMAP backends */
 struct idmap_methods {
 
        /* Called when backend is first loaded */
-       NTSTATUS (*init)( char *params );
+       NTSTATUS (*init)(struct idmap_domain *dom, const char *params);
+
+       /* Map an array of uids/gids to SIDs.  The caller specifies
+          the uid/gid and type. Gets back the SID. */
+       NTSTATUS (*unixids_to_sids)(struct idmap_domain *dom, struct id_map **ids);
 
-       NTSTATUS (*allocate_rid)(uint32 *rid, int rid_type);
-       NTSTATUS (*allocate_id)(unid_t *id, int id_type);
-       NTSTATUS (*get_sid_from_id)(DOM_SID *sid, unid_t id, int id_type);
-       NTSTATUS (*get_id_from_sid)(unid_t *id, int *id_type, const DOM_SID *sid);
-       NTSTATUS (*set_mapping)(const DOM_SID *sid, unid_t id, int id_type);
+       /* Map an arry of SIDs to uids/gids.  The caller sets the SID
+          and type and gets back a uid or gid. */
+       NTSTATUS (*sids_to_unixids)(struct idmap_domain *dom, struct id_map **ids);
+
+       NTSTATUS (*set_mapping)(struct idmap_domain *dom, const struct id_map *map);
 
        /* Called when backend is unloaded */
-       NTSTATUS (*close)(void);
+       NTSTATUS (*close_fn)(struct idmap_domain *dom);
+};
+
+struct idmap_alloc_methods {
 
-       /* Called to dump backend status */
-       void (*status)(void);
+       /* Called when backend is first loaded */
+       NTSTATUS (*init)(const char *compat_params);
+
+       NTSTATUS (*allocate_id)(struct unixid *id);
+       NTSTATUS (*get_id_hwm)(struct unixid *id);
+       NTSTATUS (*set_id_hwm)(struct unixid *id);
+
+       /* Called when backend is unloaded */
+       NTSTATUS (*close_fn)(void);
 };
+
 #endif /* _IDMAP_H_ */