openldap/contrib/ldapc++/src/LDAPConstraints.h

99 lines
2.9 KiB
C
Raw Normal View History

2008-03-28 07:05:10 -04:00
// $OpenLDAP$
/*
2020-01-09 11:50:21 -05:00
* Copyright 2000-2020 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#ifndef LDAP_CONSTRAINTS_H
#define LDAP_CONSTRAINTS_H
#include <list>
#include <LDAPControl.h>
#include <LDAPControlSet.h>
#include <LDAPRebind.h>
//TODO!!
// * implement the Alias-Handling Option (OPT_DEREF)
// * the Restart-Option ???
// * default Server(s)
//* Class for representating the various protocol options
/** This class represents some options that can be set for a LDAPConnection
* operation. Namely these are time and size limits. Options for referral
* chasing and a default set of client of server controls to be used with
* every request
*/
class LDAPConstraints{
2010-02-15 12:07:46 -05:00
public :
static const int DEREF_NEVER = 0x00;
static const int DEREF_SEARCHING = 0x01;
static const int DEREF_FINDING = 0x02;
static const int DEREF_ALWAYS = 0x04;
2010-02-15 12:07:46 -05:00
//* Constructs a LDAPConstraints object with default values
LDAPConstraints();
2010-02-15 12:07:46 -05:00
//* Copy constructor
LDAPConstraints(const LDAPConstraints& c);
~LDAPConstraints();
2010-02-15 12:07:46 -05:00
void setAliasDeref(int deref);
void setMaxTime(int t);
2010-02-15 12:07:46 -05:00
void setSizeLimit(int s);
void setReferralChase(bool rc);
void setHopLimit(int hop);
void setReferralRebind(const LDAPRebind* rebind);
void setServerControls(const LDAPControlSet* ctrls);
void setClientControls(const LDAPControlSet* ctrls);
2010-02-15 12:07:46 -05:00
int getAliasDeref() const;
int getMaxTime() const ;
2010-02-15 12:07:46 -05:00
int getSizeLimit() const;
const LDAPRebind* getReferralRebind() const;
const LDAPControlSet* getServerControls() const;
const LDAPControlSet* getClientControls() const;
//*for internal use only
LDAPControl** getSrvCtrlsArray() const;
//*for internal use only
LDAPControl** getClCtrlsArray() const;
//*for internal use only
timeval* getTimeoutStruct() const;
2010-02-15 12:07:46 -05:00
bool getReferralChase() const ;
int getHopLimit() const;
2010-02-15 12:07:46 -05:00
private :
int m_aliasDeref;
//* max. time the server may spend for a search request
2010-02-15 12:07:46 -05:00
int m_maxTime;
//* max number of entries to return from a search request
int m_maxSize;
2010-02-15 12:07:46 -05:00
//* Flag for enabling automatic referral/reference chasing
bool m_referralChase;
//* HopLimit for referral chasing
int m_HopLimit;
//* Alias dereferencing option
int m_deref;
//* Object used to do bind for Referral chasing
const LDAPRebind* m_refRebind;
2010-02-15 12:07:46 -05:00
//* List of Client Controls that should be used for each request
LDAPControlSet* m_clientControls;
2010-02-15 12:07:46 -05:00
//* List of Server Controls that should be used for each request
LDAPControlSet* m_serverControls;
};
#endif //LDAP_CONSTRAINTS_H