summaryrefslogtreecommitdiffstats
path: root/src/lib/idmap/sss_idmap_private.h
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2013-04-19 18:02:32 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-04-29 17:01:38 +0200
commit46222e5191473f9a46aec581273eb2eef22e23be (patch)
tree0400aa5c121bdef63809b1cec209cfbd9c2d2134 /src/lib/idmap/sss_idmap_private.h
parent313119612112b7ba97d9467277e8981d765b1eba (diff)
downloadsssd-46222e5191473f9a46aec581273eb2eef22e23be.tar.gz
sssd-46222e5191473f9a46aec581273eb2eef22e23be.tar.xz
sssd-46222e5191473f9a46aec581273eb2eef22e23be.zip
libsss_idmap: function to calculate range
Calculation of range for domains is moved from sdap_idmap code to sss_idmap code. Some refactoring have been done to allow this move. https://fedorahosted.org/sssd/ticket/1844
Diffstat (limited to 'src/lib/idmap/sss_idmap_private.h')
-rw-r--r--src/lib/idmap/sss_idmap_private.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/idmap/sss_idmap_private.h b/src/lib/idmap/sss_idmap_private.h
index bdb528951..1d3a36901 100644
--- a/src/lib/idmap/sss_idmap_private.h
+++ b/src/lib/idmap/sss_idmap_private.h
@@ -25,16 +25,36 @@
#ifndef SSS_IDMAP_PRIVATE_H_
#define SSS_IDMAP_PRIVATE_H_
+#define SSS_IDMAP_DEFAULT_LOWER 200000
+#define SSS_IDMAP_DEFAULT_UPPER 2000200000
+#define SSS_IDMAP_DEFAULT_RANGESIZE 200000
+#define SSS_IDMAP_DEFAULT_AUTORID false
+
#define CHECK_IDMAP_CTX(ctx, ret) do { \
if (ctx == NULL || ctx->alloc_func == NULL || ctx->free_func == NULL) { \
return ret; \
} \
} while(0)
+struct sss_idmap_opts {
+ /* true if autorid compatibility mode is used */
+ bool autorid_mode;
+
+ /* smallest available id (for all domains) */
+ id_t idmap_lower;
+
+ /* highest available id (for all domains) */
+ id_t idmap_upper;
+
+ /* number of available UIDs (for single domain) */
+ id_t rangesize;
+};
+
struct sss_idmap_ctx {
idmap_alloc_func *alloc_func;
void *alloc_pvt;
idmap_free_func *free_func;
+ struct sss_idmap_opts idmap_opts;
struct idmap_domain_info *idmap_domain_info;
};