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 *in,
97 struct berval *dn, struct berval *ndn );
99 /* attributeType/objectClass mapping */
100 int rwm_mapping_cmp (const void *, const void *);
101 int rwm_mapping_dup (void *, void *);
103 int rwm_map_init ( struct ldapmap *lm, struct ldapmapping ** );
104 void rwm_map ( struct ldapmap *map, struct berval *s, struct berval *m,
106 int rwm_mapping ( struct ldapmap *map, struct berval *s,
107 struct ldapmapping **m, int remap );
112 struct ldapmap *at_map,
113 struct ldapmap *oc_map,
118 struct ldapmap *at_map,
121 char ***mapped_attrs );
125 struct ldapmap *at_map,
126 struct ldapmap *oc_map,
131 extern void rwm_mapping_free ( void *mapping );
133 extern int rwm_map_config(
134 struct ldapmap *oc_map,
135 struct ldapmap *at_map,
142 rwm_filter_map_rewrite(
145 struct berval *fstr );
147 /* suffix massaging by means of librewrite */
148 #ifdef ENABLE_REWRITE
149 extern int rwm_suffix_massage_config( struct rewrite_info *info,
150 struct berval *pvnc, struct berval *nvnc,
151 struct berval *prnc, struct berval *nrnc);
152 #endif /* ENABLE_REWRITE */
153 extern int rwm_dnattr_rewrite(
158 BerVarray *pa_nvals );
159 extern int rwm_dnattr_result_rewrite( dncookie *dc, BerVarray a_vals );