2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #ifndef LDAP_CONSTRAINTS_H
8 #define LDAP_CONSTRAINTS_H
11 #include <LDAPControl.h>
12 #include <LDAPControlSet.h>
13 #include <LDAPRebind.h>
16 // * implement the Alias-Handling Option (OPT_DEREF)
17 // * the Restart-Option ???
18 // * default Server(s)
20 //* Class for representating the various protocol options
21 /** This class represents some options that can be set for a LDAPConnection
22 * operation. Namely these are time and size limits. Options for referral
23 * chasing and a default set of client of server controls to be used with
26 class LDAPConstraints{
29 const static int DEREF_NEVER = 0x00;
30 const static int DEREF_SEARCHING = 0x01;
31 const static int DEREF_FINDING = 0x02;
32 const static int DEREF_ALWAYS = 0x04;
34 //* Constructs a LDAPConstraints object with default values
38 LDAPConstraints(const LDAPConstraints& c);
42 void setAliasDeref(int deref);
43 void setMaxTime(int t);
44 void setSizeLimit(int s);
45 void setReferralChase(bool rc);
46 void setHopLimit(int hop);
47 void setReferralRebind(const LDAPRebind* rebind);
48 void setServerControls(const LDAPControlSet* ctrls);
49 void setClientControls(const LDAPControlSet* ctrls);
51 int getAliasDeref() const;
52 int getMaxTime() const ;
53 int getSizeLimit() const;
54 const LDAPRebind* getReferralRebind() const;
55 const LDAPControlSet* getServerControls() const;
56 const LDAPControlSet* getClientControls() const;
58 //*for internal use only
59 LDAPControl** getSrvCtrlsArray() const;
61 //*for internal use only
62 LDAPControl** getClCtrlsArray() const;
64 //*for internal use only
65 timeval* getTimeoutStruct() const;
66 bool getReferralChase() const ;
67 int getHopLimit() const;
72 //* max. time the server may spend for a search request
75 //* max number of entries to return from a search request
78 //* Flag for enabling automatic referral/reference chasing
81 //* HopLimit for referral chasing
84 //* Alias dereferencing option
87 //* Object used to do bind for Referral chasing
88 const LDAPRebind* m_refRebind;
90 //* List of Client Controls that should be used for each request
91 LDAPControlSet* m_clientControls;
93 //* List of Server Controls that should be used for each request
94 LDAPControlSet* m_serverControls;
97 #endif //LDAP_CONSTRAINTS_H