1 /* rwm.h - dn rewrite/attribute mapping header file */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1999-2004 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 */
43 #define RWMMAP_F_NONE 0x00
44 #define RWMMAP_F_IS_OC 0x01
45 #define RWMMAP_F_FREE_SRC 0x10
46 #define RWMMAP_F_FREE_DST 0x20
49 AttributeDescription *m_s_ad;
52 #define m_src_ad m_src_ref.m_s_ad
53 #define m_src_oc m_src_ref.m_s_oc
56 AttributeDescription *m_d_ad;
59 #define m_dst_ad m_dst_ref.m_d_ad
60 #define m_dst_oc m_dst_ref.m_d_oc
68 struct rewrite_info *rwm_rw;
69 #else /* !ENABLE_REWRITE */
70 /* some time the suffix massaging without librewrite
72 BerVarray rwm_suffix_massage;
73 #endif /* !ENABLE_REWRITE */
76 * Attribute/objectClass mapping
78 struct ldapmap rwm_oc;
79 struct ldapmap rwm_at;
82 /* Whatever context ldap_back_dn_massage needs... */
83 typedef struct dncookie {
84 struct ldaprwmap *rwmap;
96 int rwm_dn_massage(dncookie *dc, struct berval *dn, struct berval *res);
98 /* attributeType/objectClass mapping */
99 int rwm_mapping_cmp (const void *, const void *);
100 int rwm_mapping_dup (void *, void *);
102 void rwm_map_init ( struct ldapmap *lm, struct ldapmapping ** );
103 void rwm_map ( struct ldapmap *map, struct berval *s, struct berval *m,
109 struct ldapmap *at_map,
110 struct ldapmap *oc_map,
117 struct ldapmap *at_map,
123 extern void rwm_mapping_free ( void *mapping );
125 extern int rwm_map_config(
126 struct ldapmap *oc_map,
127 struct ldapmap *at_map,
134 rwm_filter_map_rewrite(
140 /* suffix massaging by means of librewrite */
141 #ifdef ENABLE_REWRITE
142 extern int rwm_suffix_massage_config( struct rewrite_info *info,
143 struct berval *pvnc, struct berval *nvnc,
144 struct berval *prnc, struct berval *nrnc);
145 #endif /* ENABLE_REWRITE */
146 extern int rwm_dnattr_rewrite(
152 extern int rwm_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );