r9438: Add initial files for ldb_map
[sfrench/samba-autobuild/.git] / source4 / lib / ldb / ldb_map / ldb_map.h
diff --git a/source4/lib/ldb/ldb_map/ldb_map.h b/source4/lib/ldb/ldb_map/ldb_map.h
new file mode 100644 (file)
index 0000000..6d6e478
--- /dev/null
@@ -0,0 +1,29 @@
+struct objectclass_mapping {
+       char *local_name;
+       char *remote_name;
+
+       char *key; /* Name of attribute used in rdn */
+
+       /* For mapping attributes used in searches */
+       struct local_attribute_mapping {
+               char *local_name;
+
+               /* Attributes to request from the server for this attribute, 
+                * needed by generate */
+               char *required_attributes[]; 
+
+               /* If not set, the value for the first element of 
+                * required_attributes will simply be used here */
+               struct ldb_message_element *(*generate) (LDAPMessage *msg); 
+       } *local_attribute_mappings;
+
+       /* Generate LDAPMod for adds and modifies */
+       LDAPMod *(*generate_mod)(struct ldb_message *);
+}
+
+struct ldb_map_backend {
+       struct objectclass_mapping *objectclass_mappings;
+};
+
+const char *ldb_map_dn(const char *old);
+const char *ldb_map_rdn(const char *old);