2 Unix SMB/Netbios implementation.
4 passdb structures and parameters
5 Copyright (C) Gerald Carter 2001
6 Copyright (C) Luke Kenneth Casson Leighton 1998 - 2000
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 /*****************************************************************
28 Functions to be implemented by the new (v2) passdb API
29 ****************************************************************/
31 typedef struct pdb_context
33 struct pdb_methods *pdb_selected;
35 /* These functions are wrappers for the functions listed above.
36 They may do extra things like re-reading a SAM_ACCOUNT on update */
38 BOOL (*pdb_setsampwent)(struct pdb_context *, BOOL update);
40 void (*pdb_endsampwent)(struct pdb_context *);
42 BOOL (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user);
44 BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
46 BOOL (*pdb_getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
48 BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass);
50 BOOL (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass);
52 BOOL (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username);
54 void (*free_fn)(struct pdb_context **);
60 typedef struct pdb_methods
62 char *name; /* What name got this module */
64 BOOL (*setsampwent)(struct pdb_context *, BOOL update);
66 void (*endsampwent)(struct pdb_context *);
68 BOOL (*getsampwent)(struct pdb_context *, SAM_ACCOUNT *user);
70 BOOL (*getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
72 BOOL (*getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
74 BOOL (*add_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
76 BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
78 BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username);
80 void *private_data; /* Private data of some kind */
82 void (*free_private_data)(void **);
87 struct pdb_init_function {
89 /* Function to create a member of the authmethods list */
90 NTSTATUS (*init)(struct pdb_context *pdb_context,
91 struct pdb_methods **pdb_method,
92 const char *location);
95 #endif /* _PASSDB_H */