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