diff options
author | Atul Kulkarni <atul.kulkarni@in.ibm.com> | 2013-08-28 13:19:27 +0530 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2013-10-01 11:27:26 +0000 |
commit | f80f43c772e8c5504111dd4274eb928e61fa56ed (patch) | |
tree | d52c0b3282190e4b0e82e08ab69c6f846d370379 /source3/include/idmap_autorid_tdb.h | |
parent | 41450fe1c39ff56ff9384a3055b44f3310336abb (diff) | |
download | samba-f80f43c772e8c5504111dd4274eb928e61fa56ed.tar.gz samba-f80f43c772e8c5504111dd4274eb928e61fa56ed.tar.bz2 samba-f80f43c772e8c5504111dd4274eb928e61fa56ed.zip |
idmap_autorid: extract common code to separate file
This is in preparation of adding "net idmap autorid" functionality.
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com>
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/include/idmap_autorid_tdb.h')
-rw-r--r-- | source3/include/idmap_autorid_tdb.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/source3/include/idmap_autorid_tdb.h b/source3/include/idmap_autorid_tdb.h new file mode 100644 index 0000000000..12151289cb --- /dev/null +++ b/source3/include/idmap_autorid_tdb.h @@ -0,0 +1,72 @@ +/* + * idmap_autorid: static map between Active Directory/NT RIDs + * and RFC 2307 accounts. This file contains common functions + * and structures used by idmap_autorid and net idmap autorid utilities + * + * Copyright (C) Christian Ambach, 2010-2012 + * Copyright (C) Atul Kulkarni, 2013 + * Copyright (C) Michael Adam, 2012-2013 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + * + */ + +#ifndef _IDMAP_AUTORID_H_ +#define _IDMAP_AUTORID_H_ + +#include "includes.h" +#include "system/filesys.h" +#include "dbwrap/dbwrap.h" +#include "dbwrap/dbwrap_open.h" +#include "../lib/util/util_tdb.h" +#include "winbindd/idmap_tdb_common.h" + +#define HWM "NEXT RANGE" +#define ALLOC_HWM_UID "NEXT ALLOC UID" +#define ALLOC_HWM_GID "NEXT ALLOC GID" +#define ALLOC_RANGE "ALLOC" +#define CONFIGKEY "CONFIG" + +struct autorid_global_config { + uint32_t minvalue; + uint32_t rangesize; + uint32_t maxranges; +}; + +struct autorid_range_config { + fstring domsid; + fstring keystr; + uint32_t rangenum; + uint32_t domain_range_index; + uint32_t low_id; + struct autorid_global_config *globalcfg; +}; + +NTSTATUS idmap_autorid_get_domainrange(struct db_context *db, + struct autorid_range_config *range, + bool read_only); + +NTSTATUS idmap_autorid_init_hwm(struct db_context *db, const char *hwm); + +NTSTATUS idmap_autorid_db_init(const char *path, + TALLOC_CTX *mem_ctx, + struct db_context **db); + +struct autorid_global_config *idmap_autorid_loadconfig(struct db_context *db, + TALLOC_CTX *ctx); + +NTSTATUS idmap_autorid_saveconfig(struct db_context *db, + struct autorid_global_config *cfg); + +#endif /* _IDMAP_AUTORID_H_ */ |