00001 /* 00002 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. 00003 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file 00004 */ 00005 00006 00007 #ifndef LDAP_CONSTRAINTS_H 00008 #define LDAP_CONSTRAINTS_H 00009 #include <list> 00010 00011 #include <LDAPControl.h> 00012 #include <LDAPControlSet.h> 00013 #include <LDAPRebind.h> 00014 00015 //TODO!! 00016 // * implement the Alias-Handling Option (OPT_DEREF) 00017 // * the Restart-Option ??? 00018 // * default Server(s) 00019 00020 //* Class for representating the various protocol options 00026 class LDAPConstraints{ 00027 00028 public : 00029 static const int DEREF_NEVER = 0x00; 00030 static const int DEREF_SEARCHING = 0x01; 00031 static const int DEREF_FINDING = 0x02; 00032 static const int DEREF_ALWAYS = 0x04; 00033 00034 //* Constructs a LDAPConstraints object with default values 00035 LDAPConstraints(); 00036 00037 //* Copy constructor 00038 LDAPConstraints(const LDAPConstraints& c); 00039 00040 ~LDAPConstraints(); 00041 00042 void setAliasDeref(int deref); 00043 void setMaxTime(int t); 00044 void setSizeLimit(int s); 00045 void setReferralChase(bool rc); 00046 void setHopLimit(int hop); 00047 void setReferralRebind(const LDAPRebind* rebind); 00048 void setServerControls(const LDAPControlSet* ctrls); 00049 void setClientControls(const LDAPControlSet* ctrls); 00050 00051 int getAliasDeref() const; 00052 int getMaxTime() const ; 00053 int getSizeLimit() const; 00054 const LDAPRebind* getReferralRebind() const; 00055 const LDAPControlSet* getServerControls() const; 00056 const LDAPControlSet* getClientControls() const; 00057 00058 //*for internal use only 00059 LDAPControl** getSrvCtrlsArray() const; 00060 00061 //*for internal use only 00062 LDAPControl** getClCtrlsArray() const; 00063 00064 //*for internal use only 00065 timeval* getTimeoutStruct() const; 00066 bool getReferralChase() const ; 00067 int getHopLimit() const; 00068 00069 private : 00070 int m_aliasDeref; 00071 00072 //* max. time the server may spend for a search request 00073 int m_maxTime; 00074 00075 //* max number of entries to return from a search request 00076 int m_maxSize; 00077 00078 //* Flag for enabling automatic referral/reference chasing 00079 bool m_referralChase; 00080 00081 //* HopLimit for referral chasing 00082 int m_HopLimit; 00083 00084 //* Alias dereferencing option 00085 int m_deref; 00086 00087 //* Object used to do bind for Referral chasing 00088 const LDAPRebind* m_refRebind; 00089 00090 //* List of Client Controls that should be used for each request 00091 LDAPControlSet* m_clientControls; 00092 00093 //* List of Server Controls that should be used for each request 00094 LDAPControlSet* m_serverControls; 00095 00096 }; 00097 #endif //LDAP_CONSTRAINTS_H