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 */
34 /* define to enable referral DN massage by default */
35 #undef RWM_REFERRAL_REWRITE
46 #define RWMMAP_F_NONE 0x00
47 #define RWMMAP_F_IS_OC 0x01
48 #define RWMMAP_F_FREE_SRC 0x10
49 #define RWMMAP_F_FREE_DST 0x20
52 AttributeDescription *m_s_ad;
55 #define m_src_ad m_src_ref.m_s_ad
56 #define m_src_oc m_src_ref.m_s_oc
59 AttributeDescription *m_d_ad;
62 #define m_dst_ad m_dst_ref.m_d_ad
63 #define m_dst_oc m_dst_ref.m_d_oc
71 struct rewrite_info *rwm_rw;
72 #else /* !ENABLE_REWRITE */
73 /* some time the suffix massaging without librewrite
75 BerVarray rwm_suffix_massage;
76 #endif /* !ENABLE_REWRITE */
79 * Attribute/objectClass mapping
81 struct ldapmap rwm_oc;
82 struct ldapmap rwm_at;
85 /* Whatever context ldap_back_dn_massage needs... */
86 typedef struct dncookie {
87 struct ldaprwmap *rwmap;
93 #else /* !ENABLE_REWRITE */
96 #endif /* !ENABLE_REWRITE */
99 int rwm_dn_massage( dncookie *dc, struct berval *in,
100 struct berval *dn, struct berval *ndn );
102 /* attributeType/objectClass mapping */
103 int rwm_mapping_cmp (const void *, const void *);
104 int rwm_mapping_dup (void *, void *);
106 int rwm_map_init ( struct ldapmap *lm, struct ldapmapping ** );
107 void rwm_map ( struct ldapmap *map, struct berval *s, struct berval *m,
109 int rwm_mapping ( struct ldapmap *map, struct berval *s,
110 struct ldapmapping **m, int remap );
115 struct ldapmap *at_map,
116 struct ldapmap *oc_map,
121 struct ldapmap *at_map,
124 char ***mapped_attrs );
128 struct ldapmap *at_map,
129 struct ldapmap *oc_map,
134 extern void rwm_mapping_free ( void *mapping );
136 extern int rwm_map_config(
137 struct ldapmap *oc_map,
138 struct ldapmap *at_map,
145 rwm_filter_map_rewrite(
148 struct berval *fstr );
150 /* suffix massaging by means of librewrite */
151 #ifdef ENABLE_REWRITE
152 extern int rwm_suffix_massage_config( struct rewrite_info *info,
153 struct berval *pvnc, struct berval *nvnc,
154 struct berval *prnc, struct berval *nrnc);
155 #endif /* ENABLE_REWRITE */
156 extern int rwm_dnattr_rewrite(
161 BerVarray *pa_nvals );
162 extern int rwm_referral_rewrite(
167 BerVarray *pa_nvals );
168 extern int rwm_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );
169 extern int rwm_referral_result_rewrite( dncookie *dc, BerVarray a_vals );