]> git.sur5r.net Git - openldap/blob - servers/slapd/component.h
Happy New Year
[openldap] / servers / slapd / component.h
1 /* component.h */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 2004-2018 The OpenLDAP Foundation.
6  * Portions Copyright 2004 by IBM Corporation.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted only as authorized by the OpenLDAP
11  * Public License.
12  *
13  * A copy of this license is available in the file LICENSE in the
14  * top-level directory of the distribution or, alternatively, at
15  * <http://www.OpenLDAP.org/license.html>.
16  */
17
18 #ifndef _H_SLAPD_COMPONENT
19 #define _H_SLAPD_COMPONENT
20
21 #include "portable.h"
22
23 #include <ac/string.h>
24 #include <ac/socket.h>
25 #include <ldap_pvt.h>
26 #include "lutil.h"
27 #include <ldap.h>
28 #include "slap.h"
29
30 typedef enum { ASN_BASIC, ASN_COMPOSITE } AsnType;
31 /*
32  * Decoder Modes
33  * Different operation is required to handle Decoding(2), Extracted Component
34  * decoding(0), ANY DEFINED TYPe(2)
35  * b0 : Component Alloc(yes)
36  *      Constructed type : Component Alloc (Yes)
37  *      Primitive type : Component Alloc (Yes)
38  *      set to mode 2 in inner decoders
39  * b1 : Component Alloc (No)
40  *      Constructed type : Component Alloc (No)
41  *      Primitive type : Component Alloc (No)
42  *      set to mode 2 in inner decoders
43  * b2 : Default Mode
44  *      Constructed type : Component Alloc (Yes)
45  *      Primitive type : Component Alloc (No)
46  * in addition to above modes, the 4th bit has special meaning,
47  * b4 : if the 4th bit is clear, DecxxxContent is called
48  * b4 : if the 4th bit is set, Decxxx is called, then it is cleared.
49  */
50 #define DEC_ALLOC_MODE_0        0x01
51 #define DEC_ALLOC_MODE_1        0x02
52 #define DEC_ALLOC_MODE_2        0x04
53 #define CALL_TAG_DECODER        0x08
54 #define CALL_CONTENT_DECODER    ~0x08
55 /*
56  * For Attribute Aliasing
57  */
58 #define MAX_ALIASING_ENTRY 128
59 typedef struct comp_attribute_aliasing {
60         AttributeDescription*   aa_aliasing_ad;
61         AttributeDescription*   aa_aliased_ad;
62         ComponentFilter*        aa_cf;
63         MatchingRule*           aa_mr;
64         char*                   aa_cf_str;
65 } AttributeAliasing;
66                                                                                  
67 typedef struct comp_matchingrule_aliasing {
68         MatchingRule*   mra_aliasing_attr;
69         MatchingRule*   mra_aliased_attr;
70         AttributeDescription*   mra_attr;
71         ComponentFilter*        mra_cf;
72         MatchingRule*           mra_mr;
73         char*                   mra_cf_str;
74 } MatchingRuleAliasing;
75
76 #endif