3 * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #ifndef LDAP_CONSTRAINTS_H
9 #define LDAP_CONSTRAINTS_H
12 #include <LDAPControl.h>
13 #include <LDAPControlSet.h>
14 #include <LDAPRebind.h>
17 // * implement the Alias-Handling Option (OPT_DEREF)
18 // * the Restart-Option ???
19 // * default Server(s)
21 //* Class for representating the various protocol options
22 /** This class represents some options that can be set for a LDAPConnection
23 * operation. Namely these are time and size limits. Options for referral
24 * chasing and a default set of client of server controls to be used with
27 class LDAPConstraints{
30 static const int DEREF_NEVER = 0x00;
31 static const int DEREF_SEARCHING = 0x01;
32 static const int DEREF_FINDING = 0x02;
33 static const int DEREF_ALWAYS = 0x04;
35 //* Constructs a LDAPConstraints object with default values
39 LDAPConstraints(const LDAPConstraints& c);
43 void setAliasDeref(int deref);
44 void setMaxTime(int t);
45 void setSizeLimit(int s);
46 void setReferralChase(bool rc);
47 void setHopLimit(int hop);
48 void setReferralRebind(const LDAPRebind* rebind);
49 void setServerControls(const LDAPControlSet* ctrls);
50 void setClientControls(const LDAPControlSet* ctrls);
52 int getAliasDeref() const;
53 int getMaxTime() const ;
54 int getSizeLimit() const;
55 const LDAPRebind* getReferralRebind() const;
56 const LDAPControlSet* getServerControls() const;
57 const LDAPControlSet* getClientControls() const;
59 //*for internal use only
60 LDAPControl** getSrvCtrlsArray() const;
62 //*for internal use only
63 LDAPControl** getClCtrlsArray() const;
65 //*for internal use only
66 timeval* getTimeoutStruct() const;
67 bool getReferralChase() const ;
68 int getHopLimit() const;
73 //* max. time the server may spend for a search request
76 //* max number of entries to return from a search request
79 //* Flag for enabling automatic referral/reference chasing
82 //* HopLimit for referral chasing
85 //* Alias dereferencing option
88 //* Object used to do bind for Referral chasing
89 const LDAPRebind* m_refRebind;
91 //* List of Client Controls that should be used for each request
92 LDAPControlSet* m_clientControls;
94 //* List of Server Controls that should be used for each request
95 LDAPControlSet* m_serverControls;
98 #endif //LDAP_CONSTRAINTS_H