1 /* rwm.h - dn rewrite/attribute mapping header file */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1999-2003 The OpenLDAP Foundation.
6 * Portions Copyright 1999-2003 Howard Chu.
7 * Portions Copyright 2000-2003 Pierangelo Masarati.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted only as authorized by the OpenLDAP
14 * A copy of this license is available in the file LICENSE in the
15 * top-level directory of the distribution or, alternatively, at
16 * <http://www.OpenLDAP.org/license.html>.
19 * This work was initially developed by the Howard Chu for inclusion
20 * in OpenLDAP Software and subsequently enhanced by Pierangelo
27 /* String rewrite library */
30 #endif /* ENABLE_REWRITE */
51 struct rewrite_info *rwm_rw;
52 #else /* !ENABLE_REWRITE */
53 /* some time the suffix massaging without librewrite
55 BerVarray rwm_suffix_massage;
56 #endif /* !ENABLE_REWRITE */
59 * Attribute/objectClass mapping
61 struct ldapmap rwm_oc;
62 struct ldapmap rwm_at;
65 /* Whatever context ldap_back_dn_massage needs... */
66 typedef struct dncookie {
67 struct ldaprwmap *rwmap;
79 int rwm_dn_massage(dncookie *dc, struct berval *dn, struct berval *res);
81 /* attributeType/objectClass mapping */
82 int mapping_cmp (const void *, const void *);
83 int mapping_dup (void *, void *);
85 void rwm_map_init ( struct ldapmap *lm, struct ldapmapping ** );
86 void rwm_map ( struct ldapmap *map, struct berval *s, struct berval *m,
88 #define BACKLDAP_MAP 0
89 #define BACKLDAP_REMAP 1
92 struct ldapmap *at_map,
93 struct ldapmap *oc_map,
100 struct ldapmap *at_map,
106 extern void mapping_free ( void *mapping );
108 extern int rwm_map_config(
109 struct ldapmap *oc_map,
110 struct ldapmap *at_map,
117 rwm_filter_map_rewrite(
123 /* suffix massaging by means of librewrite */
124 #ifdef ENABLE_REWRITE
125 extern int rwm_suffix_massage_config( struct rewrite_info *info,
126 struct berval *pvnc, struct berval *nvnc,
127 struct berval *prnc, struct berval *nrnc);
128 #endif /* ENABLE_REWRITE */
129 extern int rwm_dnattr_rewrite( dncookie *dc, BerVarray a_vals );
130 extern int rwm_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );